codenest-cli 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +9 -3
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("node:events"),t=require("node:child_process"),n=require("node:path"),r=require("node:fs"),s=require("node:process"),i=require("node:buffer"),o=require("node:tty"),u=require("node:util"),a=require("node:os"),l=require("node:readline"),c=require("node:async_hooks"),h=require("node:stream");function D(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var p=D(l);function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f,m,g={},F={},C={};function b(){if(f)return C;f=1;class e extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}return C.CommanderError=e,C.InvalidArgumentError=class extends e{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},C}function E(){if(m)return F;m=1;const{InvalidArgumentError:e}=b();return F.Argument=class{constructor(e,t){switch(this.description=t||"",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}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?(t.push(e),t):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},F.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"},F}var y,w={},v={};function _(){if(y)return v;y=1;const{humanReadableArgName:e}=E();function t(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,"")}return v.Help=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),n=e._getHelpOption();if(n&&!n.hidden){const r=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);r||s?n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!r&&t.push(e.createOption(n.short,n.description)):t.push(n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(t){const n=t.registeredArguments.map(t=>e(t)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,n)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return 0===t.length?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){const r=new Map;return e.forEach(e=>{const t=n(e);r.has(t)||r.set(t,[])}),t.forEach(e=>{const t=n(e);r.has(t)||r.set(t,[]),r.get(t).push(e)}),r}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth??80;function s(e,r){return t.formatItem(e,n,r,t)}let i=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""];const o=t.commandDescription(e);o.length>0&&(i=i.concat([t.boxWrap(t.styleCommandDescription(o),r),""]));const u=t.visibleArguments(e).map(e=>s(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));i=i.concat(this.formatItemList("Arguments:",u,t));const a=this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??"Options:");if(a.forEach((e,n)=>{const r=e.map(e=>s(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));i=i.concat(this.formatItemList(n,r,t))}),t.showGlobalOptions){const n=t.visibleGlobalOptions(e).map(e=>s(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));i=i.concat(this.formatItemList("Global Options:",n,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||"Commands:").forEach((e,n)=>{const r=e.map(e=>s(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));i=i.concat(this.formatItemList(n,r,t))}),i.join("\n")}displayWidth(e){return t(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"[command]"===e?this.styleSubcommandText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,r){const s=" ".repeat(2);if(!n)return s+e;const i=e.padEnd(t+e.length-r.displayWidth(e)),o=(this.helpWidth??80)-t-2-2;let u;if(o<this.minWidthToWrap||r.preformatted(n))u=n;else{u=r.boxWrap(n,o).replace(/\n/g,"\n"+" ".repeat(t+2))}return s+i+" ".repeat(2)+u.replace(/\n/g,`\n${s}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;const n=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,s=[];return n.forEach(e=>{const n=e.match(r);if(null===n)return void s.push("");let i=[n.shift()],o=this.displayWidth(i[0]);n.forEach(e=>{const n=this.displayWidth(e);if(o+n<=t)return i.push(e),void(o+=n);s.push(i.join(""));const r=e.trimStart();i=[r],o=this.displayWidth(r)}),s.push(i.join(""))}),s.join("\n")}},v.stripColor=t,v}var O,B={};function k(){if(O)return B;O=1;const{InvalidArgumentError:e}=b();function t(e){return e.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}return B.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=function(e){let t,n;const r=/^-[^-]$/,s=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");r.test(i[0])&&(t=i.shift());s.test(i[0])&&(n=i.shift());!t&&r.test(i[0])&&(t=i.shift());!t&&s.test(i[0])&&(t=n,n=i.shift());if(i[0].startsWith("-")){const t=i[0],n=`option creation failed due to '${t}' in option flags '${e}'`;if(/^-[^-][^-]/.test(t))throw new Error(`${n}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(r.test(t))throw new Error(`${n}\n- too many short flags`);if(s.test(t))throw new Error(`${n}\n- too many long flags`);throw new Error(`${n}\n- unrecognised flag format`)}if(void 0===t&&void 0===n)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}(e);this.short=n.shortFlag,this.long=n.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,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),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}_collectValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?(t.push(e),t):[e]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?t(this.name().replace(/^no-/,"")):t(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},B.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,s=void 0!==r&&r;return t.negate===(s===e)}},B}var A,x,T,S={};function R(){if(A)return S;A=1;return S.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],s=3;return t.forEach(t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let s=1;s<=e.length;s++){let i=1;i=e[s-1]===t[r-1]?0:1,n[s][r]=Math.min(n[s-1][r]+1,n[s][r-1]+1,n[s-1][r-1]+i),s>1&&r>1&&e[s-1]===t[r-2]&&e[s-2]===t[r-1]&&(n[s][r]=Math.min(n[s][r],n[s-2][r-2]+1))}return n[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-n)/i>.4&&(n<s?(s=n,r=[t]):n===s&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),n&&(r=r.map(e=>`--${e}`)),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""},S}var $=function(){if(T)return g;T=1;const{Argument:i}=E(),{Command:o}=function(){if(x)return w;x=1;const i=e.EventEmitter,o=t,u=n,a=r,l=s,{Argument:c,humanReadableArgName:h}=E(),{CommanderError:D}=b(),{Help:p,stripColor:d}=_(),{Option:f,DualOptions:m}=k(),{suggestSimilar:g}=R();class F extends i{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,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._savedState=null,this._outputConfiguration={writeOut:e=>l.stdout.write(e),writeErr:e=>l.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>l.stdout.isTTY?l.stdout.columns:void 0,getErrHelpWidth:()=>l.stderr.isTTY?l.stderr.columns:void 0,getOutHasColors:()=>y()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>y()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:e=>d(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,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(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,s=n;"object"==typeof r&&null!==r&&(s=r,r=null),s=s||{};const[,i,o]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(i);return r&&(u.description(r),u._executableHandler=!0),s.isDefault&&(this._defaultCommandName=u._name),u._hidden=!(!s.noHelp&&!s.hidden),u._executableFile=s.executableFile||null,o&&u.arguments(o),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),r?this:u}createCommand(e){return new F(e)}createHelp(){return Object.assign(new p,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new c(e,t)}argument(e,t,n,r){const s=this.createArgument(e,t);return"function"==typeof n?s.default(r).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;const n=e??"help [command]",[,r,s]=n.match(/([^ ]+) *(.*)/),i=t??"display help for command",o=this.createCommand(r);return o.helpOption(!1),s&&o.arguments(s),i&&o.description(i),this._addImplicitHelpCommand=!0,this._helpCommand=o,(e||t)&&this._initCommandGroup(o),this}addHelpCommand(e,t){return"object"!=typeof e?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new D(e,t,n)),l.exit(e)}action(e){return this._actionHandler=t=>{const n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new f(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if("commander.invalidArgument"===e.code){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'\n- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){const t=e=>[e.name()].concat(e.aliases()),n=t(e).find(e=>this._findCommand(e));if(n){const r=t(this._findCommand(n)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");const r=(t,r,s)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(n);null!==t&&e.parseArg?t=this._callParseArg(e,t,i,r):null!==t&&e.variadic&&(t=e._collectValue(t,i)),null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,s)};return this.on("option:"+t,t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")}),this}_optionEx(e,t,n,r,s){if("object"==typeof t&&t instanceof f)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,n);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof r)i.default(s).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},i.default(s).argParser(r)}else i.default(r);return this.addOption(i)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,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){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},void 0===e&&void 0===t.from){l.versions?.electron&&(t.from="electron");const e=l.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(t.from="eval")}let n;switch(void 0===e&&(e=l.argv),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":l.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){this._prepareForParse();const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){this._prepareForParse();const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_prepareForParse(){null===this._savedState?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error("Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties");this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,n){if(!a.existsSync(e))throw new Error(`'${e}' does not exist\n - if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`)}_executeSubCommand(e,t){t=t.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function s(e,t){const n=u.resolve(e,t);if(a.existsSync(n))return n;if(r.includes(u.extname(t)))return;const s=r.find(e=>a.existsSync(`${n}${e}`));return s?`${n}${s}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i,c=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}h=u.resolve(u.dirname(e),h)}if(h){let t=s(h,c);if(!t&&!e._executableFile&&this._scriptPath){const n=u.basename(this._scriptPath,u.extname(this._scriptPath));n!==this._name&&(t=s(h,`${n}-${e._name}`))}c=t||c}n=r.includes(u.extname(c)),"win32"!==l.platform?n?(t.unshift(c),t=C(l.execArgv).concat(t),i=o.spawn(l.argv[0],t,{stdio:"inherit"})):i=o.spawn(c,t,{stdio:"inherit"}):(this._checkForMissingExecutable(c,h,e._name),t.unshift(c),t=C(l.execArgv).concat(t),i=o.spawn(l.execPath,t,{stdio:"inherit"})),i.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{l.on(e,()=>{!1===i.killed&&null===i.exitCode&&i.kill(e)})});const p=this._exitCallback;i.on("close",e=>{e=e??1,p?p(new D(e,"commander.executeSubCommandAsync","(close)")):l.exit(e)}),i.on("error",t=>{if("ENOENT"===t.code)this._checkForMissingExecutable(c,h,e._name);else if("EACCES"===t.code)throw new Error(`'${c}' not executable`);if(p){const e=new D(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,p(e)}else l.exit(1)}),this.runningCommand=i}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let s;return r||this.help({error:!0}),r._prepareForParse(),s=this._chainOrCallSubCommandHook(s,r,"preSubcommand"),s=this._chainOrCall(s,()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))}),s}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&null==this.args[t]&&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(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg){const s=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,s)}return r};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((n,r)=>{let s=n.defaultValue;n.variadic?r<this.args.length?(s=this.args.slice(r),n.parseArg&&(s=s.reduce((t,r)=>e(n,r,t),n.defaultValue))):void 0===s&&(s=[]):r<this.args.length&&(s=this.args[r],n.parseArg&&(s=e(n,s,n.defaultValue))),t[r]=s}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{r.push({hookedCommand:e,callback:t})})}),"postAction"===t&&r.reverse(),r.forEach(e=>{n=this._chainOrCall(n,()=>e.callback(e.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach(e=>{r=this._chainOrCall(r,()=>e(this,t))}),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,()=>this._actionHandler(this.processedArgs)),this.parent&&(n=this._chainOrCall(n,()=>{this.parent.emit(s,e,t)})),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent?.listenerCount(s))r(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):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(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)}),t=e.filter(e=>e.conflictsWith.length>0);t.forEach(t=>{const n=e.find(e=>t.conflictsWith.includes(e.attributeName()));n&&this._conflictingOption(t,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],n=[];let r=t;function s(e){return e.length>1&&"-"===e[0]}const i=e=>!!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)&&!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e)));let o=null,u=null,a=0;for(;a<e.length||u;){const l=u??e[a++];if(u=null,"--"===l){r===n&&r.push(l),r.push(...e.slice(a));break}if(!o||s(l)&&!i(l)){if(o=null,s(l)){const t=this._findOption(l);if(t){if(t.required){const n=e[a++];void 0===n&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,n)}else if(t.optional){let n=null;a<e.length&&(!s(e[a])||i(e[a]))&&(n=e[a++]),this.emit(`option:${t.name()}`,n)}else this.emit(`option:${t.name()}`);o=t.variadic?t:null;continue}}if(l.length>2&&"-"===l[0]&&"-"!==l[1]){const e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){const e=l.indexOf("="),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(r!==t||!s(l)||0===this.commands.length&&i(l)||(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(l)){t.push(l),n.push(...e.slice(a));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(a));break}if(this._defaultCommandName){n.push(l,...e.slice(a));break}}if(this._passThroughOptions){r.push(l,...e.slice(a));break}r.push(l)}else this.emit(`option:${o.name()}`,l)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,s=n.code||"commander.error";this._exit(r,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in l.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,l.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new m(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find(e=>e.negate&&t===e.attributeName()),s=this.options.find(e=>!e.negate&&t===e.attributeName());return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:s||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},s=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter(e=>e.long).map(e=>e.long);n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=g(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach(e=>{n.push(e.name()),e.alias()&&n.push(e.alias())}),t=g(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const n=this.parent?._findCommand(e);if(n){const t=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map(e=>h(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}helpGroup(e){return void 0===e?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return void 0===e?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return void 0===e?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=u.basename(e,u.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});const r=t.formatHelp(this,t);return n.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){const t=!!(e=e||{}).error;let n,r,s;return t?(n=e=>this._outputConfiguration.writeErr(e),r=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=e=>this._outputConfiguration.writeOut(e),r=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(r||(e=this._outputConfiguration.stripColor(e)),n(e)),hasColors:r,helpWidth:s}}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getOutputContext(e),r={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let s=this.helpInformation({error:n.error});if(t&&(s=t(s),"string"!=typeof s&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",r))}helpOption(e,t){return"boolean"==typeof e?(e?(null===this._helpOption&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(l.exitCode??0);0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function C(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",s="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?s=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],s=n[4]),t&&"0"!==s?`${t}=${r}:${parseInt(s)+1}`:e})}function y(){return!l.env.NO_COLOR&&"0"!==l.env.FORCE_COLOR&&"false"!==l.env.FORCE_COLOR&&(!(!l.env.FORCE_COLOR&&void 0===l.env.CLICOLOR_FORCE)||void 0)}return w.Command=F,w.useColor=y,w}(),{CommanderError:u,InvalidArgumentError:a}=b(),{Help:l}=_(),{Option:c}=k();return g.program=new o,g.createCommand=e=>new o(e),g.createOption=(e,t)=>new c(e,t),g.createArgument=(e,t)=>new i(e,t),g.Command=o,g.Option=c,g.Argument=i,g.Help=l,g.CommanderError=u,g.InvalidArgumentError=a,g.InvalidOptionArgumentError=a,g}(),M=d($);const{program:j,createCommand:L,createArgument:P,createOption:I,CommanderError:U,InvalidArgumentError:N,InvalidOptionArgumentError:H,Command:G,Argument:V,Option:q,Help:W}=M;const z=(e,t=[])=>"up"===e.name||t.includes("vim")&&"k"===e.name||t.includes("emacs")&&e.ctrl&&"p"===e.name,Y=(e,t=[])=>"down"===e.name||t.includes("vim")&&"j"===e.name||t.includes("emacs")&&e.ctrl&&"n"===e.name,K=e=>"backspace"===e.name,J=e=>"enter"===e.name||"return"===e.name;class Q extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}}class X extends Error{name="CancelPromptError";message="Prompt was canceled"}class Z extends Error{name="ExitPromptError"}class ee extends Error{name="HookError"}class te extends Error{name="ValidationError"}const ne=new c.AsyncLocalStorage;function re(){const e=ne.getStore();if(!e)throw new ee("[Inquirer] Hook functions can only be called from within a prompt");return e}function se(){return re().rl}function ie(e){return c.AsyncResource.bind((...t)=>{const n=re();let r=!1;const s=n.handleChange;n.handleChange=()=>{r=!0};const i=e(...t);return r&&s(),n.handleChange=s,i})}function oe(e){const t=re(),{index:n}=t,r=e({get:()=>t.hooks[n],set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}const ue={queue(e){const t=re(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();const r=e(se());if(null!=r&&"function"!=typeof r)throw new te("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[n]=r})},run(){const e=re();ie(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){const e=re();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function ae(e){return oe(t=>{const n=c.AsyncResource.bind(function(e){t.get()!==e&&(t.set(e),re().handleChange())});if(t.initialized)return[t.get(),n];const r="function"==typeof e?e():e;return t.set(r),[r,n]})}function le(e,t){oe(n=>{const r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&ue.queue(e),n.set(t)})}const ce={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},he={...ce,tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},De={...ce,tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},pe=("win32"!==s.platform?"linux"!==s.env.TERM:Boolean(s.env.WT_SESSION)||Boolean(s.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===s.env.ConEmuTask||"Terminus-Sublime"===s.env.TERM_PROGRAM||"vscode"===s.env.TERM_PROGRAM||"xterm-256color"===s.env.TERM||"alacritty"===s.env.TERM||"JetBrains-JediTerm"===s.env.TERMINAL_EMULATOR)?he:De,de={prefix:{idle:u.styleText("blue","?"),done:u.styleText("green",pe.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(e=>u.styleText("yellow",e))},style:{answer:e=>u.styleText("cyan",e),message:e=>u.styleText("bold",e),error:e=>u.styleText("red",`> ${e}`),defaultAnswer:e=>u.styleText("dim",`(${e})`),help:e=>u.styleText("dim",e),highlight:e=>u.styleText("cyan",e),key:e=>u.styleText("cyan",u.styleText("bold",`<${e}>`))}};function fe(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function me(...e){const t={};for(const n of e)for(const[e,r]of Object.entries(n)){const n=t[e];t[e]=fe(n)&&fe(r)?me(n,r):r}return t}function ge(...e){return me(...[de,...e.filter(e=>null!=e)])}function Fe({status:e="idle",theme:t}){const[n,r]=ae(!1),[s,i]=ae(0),{prefix:o,spinner:u}=ge(t);if(le(()=>{if("loading"===e){let e,t=-1;const n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,i(t%u.frames.length)},u.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}r(!1)},[e]),n)return u.frames[s];return"string"==typeof o?o:o["loading"===e?"idle":e]??o.idle}function Ce(e,t){return oe(n=>{const r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){const r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function be(e){return ae({current:e})[0]}function Ee(e){const t=be(e);t.current=e,le(e=>{let n=!1;const r=ie((r,s)=>{n||t.current(s,e)});return e.input.on("keypress",r),()=>{n=!0,e.input.removeListener("keypress",r)}},[])}var ye,we;var ve=d(we?ye:(we=1,ye=function(e){const t=function(e){const t={defaultWidth:0,output:process.stdout,tty:o};return e?(Object.keys(t).forEach(function(n){e[n]||(e[n]=t[n])}),e):t}(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){const e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&0!==e)return e}return t.defaultWidth}));const _e=function({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function Oe(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(_e,"")}function Be(e,{ambiguousAsWide:t=!1}={}){return function(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}(e),12288===(n=e)||n>=65281&&n<=65376||n>=65504&&n<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||129736===e||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)||t&&function(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}(e)?2:1;var n}var ke=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;const Ae=new Intl.Segmenter,xe=/^\p{Default_Ignorable_Code_Point}$/u;function Te(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Oe(e)),0===e.length)return 0;let s=0;const i={ambiguousAsWide:!n};for(const{segment:t}of Ae.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||xe.test(t)||(ke().test(t)?s+=2:s+=Be(e,i)))}return s}const Se=(e=0)=>t=>`[${t+e}m`,Re=(e=0)=>t=>`[${38+e};5;${t}m`,$e=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,Me={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Me.modifier);Object.keys(Me.color),Object.keys(Me.bgColor);const je=function(){const e=new Map;for(const[t,n]of Object.entries(Me)){for(const[t,r]of Object.entries(n))Me[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=Me[t],e.set(r[0],r[1]);Object.defineProperty(Me,t,{value:n,enumerable:!1})}return Object.defineProperty(Me,"codes",{value:e,enumerable:!1}),Me.color.close="[39m",Me.bgColor.close="[49m",Me.color.ansi=Se(),Me.color.ansi256=Re(),Me.color.ansi16m=$e(),Me.bgColor.ansi=Se(10),Me.bgColor.ansi256=Re(10),Me.bgColor.ansi16m=$e(10),Object.defineProperties(Me,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>Me.rgbToAnsi256(...Me.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const s=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(s/6)/5,r=s%6/5}const s=2*Math.max(t,n,r);if(0===s)return 30;let i=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===s&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>Me.ansi256ToAnsi(Me.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>Me.ansi256ToAnsi(Me.hexToAnsi256(e)),enumerable:!1}}),Me}(),Le=new Set(["",""]),Pe="]8;;",Ie=e=>`${Le.values().next().value}[${e}m`,Ue=e=>`${Le.values().next().value}${Pe}${e}`,Ne=(e,t,n)=>{const r=[...t];let s=!1,i=!1,o=Te(Oe(e.at(-1)));for(const[t,u]of r.entries()){const a=Te(u);if(o+a<=n?e[e.length-1]+=u:(e.push(u),o=0),Le.has(u)){s=!0;i=r.slice(t+1,t+1+4).join("")===Pe}s?i?""===u&&(s=!1,i=!1):"m"===u&&(s=!1):(o+=a,o===n&&t<r.length-1&&(e.push(""),o=0))}!o&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},He=(e,t,n={})=>{if(!1!==n.trim&&""===e.trim())return"";let r,s,i="";const o=(e=>e.split(" ").map(e=>Te(e)))(e);let u=[""];for(const[r,s]of e.split(" ").entries()){!1!==n.trim&&(u[u.length-1]=u.at(-1).trimStart());let e=Te(u.at(-1));if(0!==r&&(e>=t&&(!1===n.wordWrap||!1===n.trim)&&(u.push(""),e=0),(e>0||!1===n.trim)&&(u[u.length-1]+=" ",e++)),n.hard&&o[r]>t){const n=t-e,i=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<i&&u.push(""),Ne(u,s,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(!1===n.wordWrap&&e<t){Ne(u,s,t);continue}u.push("")}e+o[r]>t&&!1===n.wordWrap?Ne(u,s,t):u[u.length-1]+=s}!1!==n.trim&&(u=u.map(e=>(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(Te(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")})(e)));const a=u.join("\n"),l=[...a];let c=0;for(const[e,t]of l.entries()){if(i+=t,Le.has(t)){const{groups:e}=new RegExp(`(?:\\[(?<code>\\d+)m|\\${Pe}(?<uri>.*))`).exec(a.slice(c))||{groups:{}};if(void 0!==e.code){const t=Number.parseFloat(e.code);r=39===t?void 0:t}else void 0!==e.uri&&(s=0===e.uri.length?void 0:e.uri)}const n=je.codes.get(Number(r));"\n"===l[e+1]?(s&&(i+=Ue("")),r&&n&&(i+=Ie(n))):"\n"===t&&(r&&n&&(i+=Ie(r)),s&&(i+=Ue(s))),c+=t.length}return i};function Ge(e,t){return e.split("\n").flatMap(e=>{return(n=e,r=t,s={trim:!1,hard:!0},String(n).normalize().replaceAll("\r\n","\n").split("\n").map(e=>He(e,r,s)).join("\n")).split("\n").map(e=>e.trimEnd());var n,r,s}).join("\n")}function Ve(){return ve({defaultWidth:80,output:se().output})}function qe({items:e,active:t,renderItem:n,pageSize:r,loop:s=!0}){const i=Ve(),o=t=>(t%e.length+e.length)%e.length,u=e.map((e,r)=>null==e?[]:Ge(n({item:e,index:r,isActive:r===t}),i).split("\n")),a=u.reduce((e,t)=>e+t.length,0),l=e=>u[e]??[],c=function({active:e,renderedItems:t,pageSize:n,loop:r}){const s=be({lastPointer:e,lastActive:void 0}),{lastPointer:i,lastActive:o}=s.current,u=Math.floor(n/2),a=t.reduce((e,t)=>e+t.length,0),l=t.slice(0,e).reduce((e,t)=>e+t.length,0);let c=l;if(a>n)if(r)c=i,null!=o&&o<e&&e-o<n&&(c=Math.min(u,1===Math.abs(e-o)?Math.min(i+(t[o]?.length??0),Math.max(l,i)):i+e-o));else{const r=t.slice(e).reduce((e,t)=>e+t.length,0);c=r<n-u?n-r:Math.min(l,u)}return s.current.lastPointer=c,s.current.lastActive=e,c}({active:t,renderedItems:u,pageSize:r,loop:s}),h=l(t).slice(0,r),D=c+h.length<=r?c:r-h.length,p=Array.from({length:r});p.splice(D,h.length,...h);const d=new Set([t]);let f=D+h.length,m=o(t+1);for(;f<r&&!d.has(m)&&(s&&a>r?m!==t:m>t);){const e=l(m).slice(0,r-f);p.splice(f,e.length,...e),d.add(m),f+=e.length,m=o(m+1)}for(f=D-1,m=o(t-1);f>=0&&!d.has(m)&&(s&&a>r?m!==t:m<t);){const e=l(m),t=e.slice(Math.max(0,e.length-f-1));p.splice(f-t.length+1,t.length,...t),d.add(m),f-=t.length,m=o(m-1)}return p.filter(e=>"string"==typeof e).join("\n")}var We,ze;var Ye=function(){if(ze)return We;ze=1;const e=h;return We=class extends e{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#n(e,...t){"function"==typeof this._dest?.[e]&&this._dest[e](...t),"function"==typeof this._src?.[e]&&this._src[e](...t)}get isTTY(){return null!==this.#e?this.#e:this.#t("isTTY",!1)}set isTTY(e){this.#e=e}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return 0===e.indexOf(this._prompt)&&(e=(e=e.slice(this._prompt.length)).replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&0===e.indexOf(this._prompt)&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e=e&&this.replace?e.toString().replace(/./g,this.replace):null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#n("destroy",...e)}destroySoon(...e){return this.#n("destroySoon",...e)}close(...e){return this.#n("close",...e)}},We}(),Ke=d(Ye);const Je=[];Je.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&Je.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&Je.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const Qe=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,Xe=Symbol.for("signal-exit emitter"),Ze=globalThis,et=Object.defineProperty.bind(Object);class tt{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ze[Xe])return Ze[Xe];et(Ze,Xe,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const n=this.listeners[e],r=n.indexOf(t);-1!==r&&(0===r&&1===n.length?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(const s of this.listeners[e])r=!0===s(t,n)||r;return"exit"===e&&(r=this.emit("afterExit",t,n)||r),r}}class nt{}const rt=globalThis.process,{onExit:st}=(it=Qe(rt)?new class extends nt{#r="win32"===rt.platform?"SIGINT":"SIGHUP";#s=new tt;#i;#o;#u;#a={};#l=!1;constructor(e){super(),this.#i=e,this.#a={};for(const t of Je)this.#a[t]=()=>{const n=this.#i.listeners(t);let{count:r}=this.#s;const s=e;if("object"==typeof s.__signal_exit_emitter__&&"number"==typeof s.__signal_exit_emitter__.count&&(r+=s.__signal_exit_emitter__.count),n.length===r){this.unload();const n=this.#s.emit("exit",null,t),r="SIGHUP"===t?this.#r:t;n||e.kill(e.pid,r)}};this.#u=e.reallyExit,this.#o=e.emit}onExit(e,t){if(!Qe(this.#i))return()=>{};!1===this.#l&&this.load();const n=t?.alwaysLast?"afterExit":"exit";return this.#s.on(n,e),()=>{this.#s.removeListener(n,e),0===this.#s.listeners.exit.length&&0===this.#s.listeners.afterExit.length&&this.unload()}}load(){if(!this.#l){this.#l=!0,this.#s.count+=1;for(const e of Je)try{const t=this.#a[e];t&&this.#i.on(e,t)}catch(e){}this.#i.emit=(e,...t)=>this.#c(e,...t),this.#i.reallyExit=e=>this.#h(e)}}unload(){this.#l&&(this.#l=!1,Je.forEach(e=>{const t=this.#a[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#i.removeListener(e,t)}catch(e){}}),this.#i.emit=this.#o,this.#i.reallyExit=this.#u,this.#s.count-=1)}#h(e){return Qe(this.#i)?(this.#i.exitCode=e||0,this.#s.emit("exit",this.#i.exitCode,null),this.#u.call(this.#i,this.#i.exitCode)):0}#c(e,...t){const n=this.#o;if("exit"===e&&Qe(this.#i)){"number"==typeof t[0]&&(this.#i.exitCode=t[0]);const r=n.call(this.#i,e,...t);return this.#s.emit("exit",this.#i.exitCode,null),r}return n.call(this.#i,e,...t)}}(rt):new class extends nt{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>it.onExit(e,t),load:()=>it.load(),unload:()=>it.unload()});var it;const ot="[",ut=(e=1)=>e>0?`${ot}${e}A`:"",at=(e=1)=>e>0?`${ot}${e}B`:"",lt=(e,t)=>`${ot}${e+1}G`,ct="[2K",ht=e=>e>0?(ct+ut(1)).repeat(e-1)+ct+"[G":"",Dt=e=>e.split("\n").length;class pt{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,t=""){const n=(e=>e.split("\n").pop()??"")(e),r=u.stripVTControlCharacters(n);let s=r;this.rl.line.length>0&&(s=s.slice(0,-this.rl.line.length)),this.rl.setPrompt(s),this.cursorPos=this.rl.getCursorPos();const i=Ve();e=Ge(e,i),t=Ge(t,i),r.length%i===0&&(e+="\n");let o=e+(t?"\n"+t:"");const a=Math.floor(r.length/i)-this.cursorPos.rows+(t?Dt(t):0);a>0&&(o+=ut(a)),o+=lt(this.cursorPos.cols),this.write(at(this.extraLinesUnderPrompt)+ht(this.height)+o),this.extraLinesUnderPrompt=a,this.height=Dt(o)}checkCursorPos(){const e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(lt(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let t=at(this.extraLinesUnderPrompt);t+=e?ht(this.height):"\n",t+="[?25h",this.write(t),this.rl.close()}}class dt extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}}function ft(e){const t=function(){const e=Error.prepareStackTrace;let t=[];try{Error.prepareStackTrace=(e,n)=>{const r=n.slice(1);return t=r,r},(new Error).stack}catch{return t}return Error.prepareStackTrace=e,t}();return(n,r={})=>{const{input:s=process.stdin,signal:i}=r,o=new Set,u=new Ke;u.pipe(r.output??process.stdout);const a=p.createInterface({terminal:!0,input:s,output:u}),l=new pt(a),{promise:h,resolve:D,reject:d}=dt.withResolver(),f=()=>d(new X);if(i){const e=()=>d(new Q({cause:i.reason}));if(i.aborted)return e(),Object.assign(h,{cancel:f});i.addEventListener("abort",e),o.add(()=>i.removeEventListener("abort",e))}o.add(st((e,t)=>{d(new Z(`User force closed the prompt with ${e} ${t}`))}));const m=()=>d(new Z("User force closed the prompt with SIGINT"));a.on("SIGINT",m),o.add(()=>a.removeListener("SIGINT",m));const g=()=>l.checkCursorPos();return a.input.on("keypress",g),o.add(()=>a.input.removeListener("keypress",g)),function(e,t){const n=function(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}(e);return ne.run(n,()=>t(function(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}))}(a,s=>{const i=c.AsyncResource.bind(()=>ue.clearAll());return a.on("close",i),o.add(()=>a.removeListener("close",i)),s(()=>{try{const r=e(n,e=>{setImmediate(()=>D(e))});if(void 0===r){const e=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.\n at ${e}`)}const[s,i]="string"==typeof r?[r]:r;l.render(s,i),ue.run()}catch(e){d(e)}}),Object.assign(h.then(e=>(ue.clearAll(),e),e=>{throw ue.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:Boolean(r.clearPromptOnDone)}),u.end()}).then(()=>h),{cancel:f})})}}class mt{separator=u.styleText("dim",Array.from({length:15}).join(pe.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"separator"===e.type)}}const gt={validationFailureMode:"keep"};var Ft=ft((e,t)=>{const{prefill:n="tab"}=e,r=ge(gt,e.theme),[s,i]=ae("idle"),[o="",u]=ae(e.default),[a,l]=ae(),[c,h]=ae(""),D=Fe({status:s,theme:r});Ee(async(n,a)=>{if("idle"===s)if(J(n)){const n=c||o;i("loading");const s=await async function(t){const{required:n,pattern:r,patternError:s="Invalid input"}=e;return n&&!t?"You must provide a value":r&&!r.test(t)?s:"function"!=typeof e.validate||await e.validate(t)||"You must provide a valid value"}(n);!0===s?(h(n),i("done"),t(n)):("clear"===r.validationFailureMode?h(""):a.write(c),l(s),i("idle"))}else K(n)&&!c?u(void 0):(e=>"tab"===e.name)(n)&&!c?(u(void 0),a.clearLine(0),a.write(o),h(o)):(h(a.line),l(void 0))}),le(e=>{"editable"===n&&o&&(e.write(o),h(o))},[]);const p=r.style.message(e.message,s);let d,f=c;"function"==typeof e.transformer?f=e.transformer(c,{isFinal:"done"===s}):"done"===s&&(f=r.style.answer(c)),o&&"done"!==s&&!c&&(d=r.style.defaultAnswer(o));let m="";return a&&(m=r.style.error(a)),[[D,p,d,f].filter(e=>void 0!==e).join(" "),m]});const Ct={icon:{cursor:pe.pointer},style:{disabled:e=>u.styleText("dim",`- ${e}`),description:e=>u.styleText("cyan",e),keysHelpTip:e=>e.map(([e,t])=>`${u.styleText("bold",e)} ${u.styleText("dim",t)}`).join(u.styleText("dim"," • "))},indexMode:"hidden",keybindings:[]};function bt(e){return!mt.isSeparator(e)&&!e.disabled}var Et=ft((e,t)=>{const{loop:n=!0,pageSize:r=7}=e,s=ge(Ct,e.theme),{keybindings:i}=s,[o,u]=ae("idle"),a=Fe({status:o,theme:s}),l=be(),c=!i.includes("vim"),h=Ce(()=>e.choices.map(e=>{if(mt.isSeparator(e))return e;if("object"!=typeof e||null===e||!("value"in e)){const t=String(e);return{value:e,name:t,short:t,disabled:!1}}const t=e.name??String(e.value),n={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n}),[e.choices]),D=Ce(()=>{const e=h.findIndex(bt),t=h.findLastIndex(bt);if(-1===e)throw new te("[select prompt] No selectable choices. All choices are disabled.");return{first:e,last:t}},[h]),p=Ce(()=>"default"in e?h.findIndex(t=>bt(t)&&t.value===e.default):-1,[e.default,h]),[d,f]=ae(-1===p?D.first:p),m=h[d];Ee((e,r)=>{if(clearTimeout(l.current),J(e))u("done"),t(m.value);else if(z(e,i)||Y(e,i)){if(r.clearLine(0),n||z(e,i)&&d!==D.first||Y(e,i)&&d!==D.last){const t=z(e,i)?-1:1;let n=d;do{n=(n+t+h.length)%h.length}while(!bt(h[n]));f(n)}}else if((e=>"1234567890".includes(e.name))(e)&&!Number.isNaN(Number(r.line))){const e=Number(r.line)-1;let t=-1;const n=h.findIndex(n=>!mt.isSeparator(n)&&(t++,t===e)),s=h[n];null!=s&&bt(s)&&f(n),l.current=setTimeout(()=>{r.clearLine(0)},700)}else if(K(e))r.clearLine(0);else if(c){const e=r.line.toLowerCase(),t=h.findIndex(t=>!(mt.isSeparator(t)||!bt(t))&&t.name.toLowerCase().startsWith(e));-1!==t&&f(t),l.current=setTimeout(()=>{r.clearLine(0)},700)}}),le(()=>()=>{clearTimeout(l.current)},[]);const g=s.style.message(e.message,o),F=s.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]);let C=0;const b=qe({items:h,active:d,renderItem({item:e,isActive:t,index:n}){if(mt.isSeparator(e))return C++,` ${e.separator}`;const r="number"===s.indexMode?n+1-C+". ":"";if(e.disabled){const t="string"==typeof e.disabled?e.disabled:"(disabled)";return s.style.disabled(`${r}${e.name} ${t}`)}return(t?s.style.highlight:e=>e)(`${t?s.icon.cursor:" "} ${r}${e.name}`)},pageSize:r,loop:n});if("done"===o)return[a,g,s.style.answer(m.short)].filter(Boolean).join(" ");const{description:E}=m;return`${[[a,g].filter(Boolean).join(" "),b," ",E?s.style.description(E):"",F].filter(Boolean).join("\n").trimEnd()}[?25l`});const yt=new Map([["elpis",{name:"elpis",downloadUrl:"https://github.com/wshiqyuan/elpis-demo.git",description:"elpis 框架项目模板",branch:"develop"}]]);var wt,vt,_t,Ot,Bt,kt={},At={},xt={exports:{}},Tt={exports:{}};function St(){if(vt)return wt;vt=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=7*r,i=365.25*r;function o(e,t,n,r){var s=t>=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}return wt=function(u,a){a=a||{};var l=typeof u;if("string"===l&&u.length>0)return function(o){if((o=String(o)).length>100)return;var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(!u)return;var a=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*i;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(u);if("number"===l&&isFinite(u))return a.long?function(s){var i=Math.abs(s);if(i>=r)return o(s,i,r,"day");if(i>=n)return o(s,i,n,"hour");if(i>=t)return o(s,i,t,"minute");if(i>=e)return o(s,i,e,"second");return s+" ms"}(u):function(s){var i=Math.abs(s);if(i>=r)return Math.round(s/r)+"d";if(i>=n)return Math.round(s/n)+"h";if(i>=t)return Math.round(s/t)+"m";if(i>=e)return Math.round(s/e)+"s";return s+"ms"}(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))}}function Rt(){if(Ot)return _t;return Ot=1,_t=function(e){function t(e){let r,s,i,o=null;function u(...e){if(!u.enabled)return;const n=u,s=Number(new Date),i=s-(r||s);n.diff=i,n.prev=r,n.curr=s,r=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,s)=>{if("%%"===r)return"%";o++;const i=t.formatters[s];if("function"==typeof i){const t=e[o];r=i.call(n,t),e.splice(o,1),o--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return u.namespace=e,u.useColors=t.useColors(),u.color=t.selectColor(e),u.extend=n,u.destroy=t.destroy,Object.defineProperty(u,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==t.namespaces&&(s=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(u),u}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,s=-1,i=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(s=r,i=n,r++):(n++,r++);else{if(-1===s)return!1;r=s+1,i++,n=i}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=St(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},_t}var $t,Mt,jt,Lt,Pt,It,Ut,Nt,Ht={exports:{}};function Gt(){return Mt?$t:(Mt=1,$t=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),s=t.indexOf("--");return-1!==r&&(-1===s||r<s)})}function Vt(){if(Lt)return jt;Lt=1;const e=a,t=o,n=Gt(),{env:r}=process;let s;function i(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function u(t,i){if(0===s)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!i&&void 0===s)return 0;const o=s||0;if("dumb"===r.TERM)return o;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in r)||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:o}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?s=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(s=1),"FORCE_COLOR"in r&&(s="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),jt={supportsColor:function(e){return i(u(e,e&&e.isTTY))},stdout:i(u(!0,t.isatty(1))),stderr:i(u(!0,t.isatty(2)))}}function qt(){return Pt||(Pt=1,function(e,t){const n=o,r=u;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:s}=this;if(s){const t=this.color,s="[3"+(t<8?t:"8;5;"+t),i=` ${s};1m${r} [0m`;n[0]=i+n[0].split("\n").join("\n"+i),n.push(s+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=Vt();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=Rt()(t);const{formatters:s}=e.exports;s.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},s.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(Ht,Ht.exports)),Ht.exports}function Wt(){return It||(It=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?xt.exports=(Bt||(Bt=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Rt()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Tt,Tt.exports)),Tt.exports):xt.exports=qt()),xt.exports}function zt(){return Ut||(Ut=1,function(e){var t=At&&At.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});const n=r,s=t(Wt()).default("@kwsites/file-exists");e.exists=function(t,r=e.READABLE){return function(e,t,r){s("checking %s",e);try{const i=n.statSync(e);return i.isFile()&&t?(s("[OK] path represents a file"),!0):i.isDirectory()&&r?(s("[OK] path represents a directory"),!0):(s("[FAIL] path represents something other than a file or directory"),!1)}catch(e){if("ENOENT"===e.code)return s("[FAIL] path is not accessible: %o",e),!1;throw s("[FATAL] %o",e),e}}(t,(r&e.FILE)>0,(r&e.FOLDER)>0)},e.FILE=1,e.FOLDER=2,e.READABLE=e.FILE+e.FOLDER}(At)),At}var Yt,Kt,Jt=(Nt||(Nt=1,Yt=kt,Object.defineProperty(Yt,"__esModule",{value:!0}),function(e){for(var t in e)Yt.hasOwnProperty(t)||(Yt[t]=e[t])}(zt())),kt),Qt=d(Wt()),Xt={};var Zt,en=function(){if(Kt)return Xt;function e(){let e,t,n="pending";return{promise:new Promise((n,r)=>{e=n,t=r}),done(t){"pending"===n&&(n="resolved",e(t))},fail(e){"pending"===n&&(n="rejected",t(e))},get fulfilled(){return"pending"!==n},get status(){return n}}}return Kt=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.createDeferred=Xt.deferred=void 0,Xt.deferred=e,Xt.createDeferred=e,Xt.default=e,Xt}(),tn=Object.defineProperty,nn=Object.getOwnPropertyDescriptor,rn=Object.getOwnPropertyNames,sn=Object.prototype.hasOwnProperty,on=(e,t)=>function(){return e&&(t=(0,e[rn(e)[0]])(e=0)),t},un=(e,t)=>{for(var n in t)tn(e,n,{get:t[n],enumerable:!0})},an=e=>((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of rn(t))sn.call(e,s)||s===n||tn(e,s,{get:()=>t[s],enumerable:!(r=nn(t,s))||r.enumerable});return e})(tn({},"__esModule",{value:!0}),e);function ln(e){return e instanceof String&&Zt.has(e)}function cn(e){return Zt.get(e)||[]}var hn,Dn,pn,dn,fn,mn,gn=on({"src/lib/args/pathspec.ts"(){Zt=new WeakMap}}),Fn=on({"src/lib/errors/git-error.ts"(){hn=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),Cn=on({"src/lib/errors/git-response-error.ts"(){Fn(),Dn=class extends hn{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),bn=on({"src/lib/errors/task-configuration-error.ts"(){Fn(),pn=class extends hn{constructor(e){super(void 0,e)}}}});function En(e){return"function"!=typeof e?fn:e}function yn(e){return"function"==typeof e&&e!==fn}function wn(e,t){const n=e.indexOf(t);return n<=0?[e,""]:[e.substr(0,n),e.substr(n+1)]}function vn(e,t=0){return On(e)&&e.length>t?e[t]:void 0}function _n(e,t=0){if(On(e)&&e.length>t)return e[e.length-1-t]}function On(e){return Wn(e)}function Bn(e="",t=!0,n="\n"){return e.split(n).reduce((e,n)=>{const r=t?n.trim():n;return r&&e.push(r),e},[])}function kn(e,t){return Bn(e,!0).map(e=>t(e))}function An(e){return Jt.exists(e,Jt.FOLDER)}function xn(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Tn(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Sn(e,t){if(Array.isArray(e)){const n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function Rn(e){return Array.isArray(e)?e:[e]}function $n(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function Mn(e){return Rn(e).map(e=>e instanceof String?e:String(e))}function jn(e,t=0){if(null==e)return t;const n=parseInt(e,10);return Number.isNaN(n)?t:n}function Ln(e,t){const n=[];for(let r=0,s=e.length;r<s;r++)n.push(t,e[r]);return n}function Pn(e){return(Array.isArray(e)?i.Buffer.concat(e):e).toString("utf-8")}function In(e,t){const n={};return t.forEach(t=>{void 0!==e[t]&&(n[t]=e[t])}),n}function Un(e=0){return new Promise(t=>setTimeout(t,e))}function Nn(e){if(!1!==e)return e}var Hn,Gn,Vn,qn,Wn,zn=on({"src/lib/utils/util.ts"(){nr(),dn="\0",fn=()=>{},mn=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Yn(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function Kn(e,t){const n=ln(e)?"string":typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function Jn(e){return!!e&&"[object Object]"===mn(e)}function Qn(e){return"function"==typeof e}var Xn,Zn,er,tr,nr=on({"src/lib/utils/argument-filters.ts"(){gn(),zn(),Hn=e=>Array.isArray(e),Gn=e=>"number"==typeof e,Vn=e=>"string"==typeof e,qn=e=>Vn(e)||Array.isArray(e)&&e.every(Vn),Wn=e=>null!=e&&!"number|boolean|function".includes(typeof e)&&"number"==typeof e.length}}),rr=on({"src/lib/utils/exit-codes.ts"(){Xn=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Xn||{})}}),sr=on({"src/lib/utils/git-output-streams.ts"(){Zn=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function ir(){throw new Error("LineParser:useMatches not implemented")}var or,ur=on({"src/lib/utils/line-parser.ts"(){er=class{constructor(e,t){this.matches=[],this.useMatches=ir,this.parse=(e,t)=>(this.resetMatches(),!!this._regExp.every((t,n)=>this.addMatch(t,n,e(n)))&&!1!==this.useMatches(t,this.prepareMatches())),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){const r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},tr=class extends er{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function ar(...e){const t=process.cwd(),n=Object.assign({baseDir:t,...or},...e.filter(e=>"object"==typeof e&&e));return n.baseDir=n.baseDir||t,n.trimmed=!0===n.trimmed,n}var lr=on({"src/lib/utils/simple-git-options.ts"(){or={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function cr(e,t=[]){return Jn(e)?Object.keys(e).reduce((t,n)=>{const r=e[n];if(ln(r))t.push(r);else if(Kn(r,["boolean"]))t.push(n+"="+r);else if(Array.isArray(r))for(const e of r)Kn(e,["string","number"])||t.push(n+"="+e);else t.push(n);return t},t):t}function hr(e,t=0,n=!1){const r=[];for(let n=0,s=t<0?e.length:t;n<s;n++)"string|number".includes(typeof e[n])&&r.push(String(e[n]));return cr(Dr(e),r),n||r.push(...function(e){const t="function"==typeof _n(e);return Mn(Yn(_n(e,t?1:0),Hn,[]))}(e)),r}function Dr(e){const t=Qn(_n(e));return Yn(_n(e,t?1:0),Jn)}function pr(e,t=!0){const n=En(_n(e));return t||yn(n)?n:void 0}var dr=on({"src/lib/utils/task-options.ts"(){nr(),zn(),gn()}});function fr(e,t){return e(t.stdOut,t.stdErr)}function mr(e,t,n,r=!0){return Rn(n).forEach(n=>{for(let s=Bn(n,r),i=0,o=s.length;i<o;i++){const n=(e=0)=>{if(!(i+e>=o))return s[i+e]};t.some(({parse:t})=>t(n,e))}}),e}var gr=on({"src/lib/utils/task-parser.ts"(){zn()}}),Fr={};un(Fr,{ExitCodes:()=>Xn,GitOutputStreams:()=>Zn,LineParser:()=>er,NOOP:()=>fn,NULL:()=>dn,RemoteLineParser:()=>tr,append:()=>xn,appendTaskOptions:()=>cr,asArray:()=>Rn,asCamelCase:()=>$n,asFunction:()=>En,asNumber:()=>jn,asStringArray:()=>Mn,bufferToString:()=>Pn,callTaskParser:()=>fr,createInstanceConfig:()=>ar,delay:()=>Un,filterArray:()=>Hn,filterFunction:()=>Qn,filterHasLength:()=>Wn,filterNumber:()=>Gn,filterPlainObject:()=>Jn,filterPrimitives:()=>Kn,filterString:()=>Vn,filterStringOrStringArray:()=>qn,filterType:()=>Yn,first:()=>vn,folderExists:()=>An,forEachLineWithContent:()=>kn,getTrailingOptions:()=>hr,including:()=>Tn,isUserFunction:()=>yn,last:()=>_n,objectToString:()=>mn,orVoid:()=>Nn,parseStringResponse:()=>mr,pick:()=>In,prefixedArray:()=>Ln,remove:()=>Sn,splitOn:()=>wn,toLinesWithContent:()=>Bn,trailingFunctionArgument:()=>pr,trailingOptionsArgument:()=>Dr});var Cr,br,Er,yr=on({"src/lib/utils/index.ts"(){nr(),rr(),sr(),ur(),lr(),dr(),gr(),zn()}}),wr={};function vr(e){switch(e){case"bare":return Or();case"root":return _r()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:br,parser:Er}}function _r(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:br,parser:e=>/^\.(git)?$/.test(e.trim())}}function Or(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:br,parser:Er}}un(wr,{CheckRepoActions:()=>Cr,checkIsBareRepoTask:()=>Or,checkIsRepoRootTask:()=>_r,checkIsRepoTask:()=>vr});var Br,kr,Ar,xr,Tr=on({"src/lib/tasks/check-is-repo.ts"(){yr(),Cr=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Cr||{}),br=({exitCode:e},t,n,r)=>{if(128===e&&function(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}(t))return n(Buffer.from("false"));r(t)},Er=e=>"true"===e.trim()}});var Sr,Rr=on({"src/lib/responses/CleanSummary.ts"(){yr(),Br=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},kr=/^[a-z]+\s*/i,Ar=/^[a-z]+\s+[a-z]+\s*/i,xr=/\/$/}}),$r={};function Mr(e){return{commands:Sr,format:"empty",parser:e}}function jr(e){return{commands:Sr,format:"empty",parser(){throw"string"==typeof e?new pn(e):e}}}function Lr(e,t=!1){return{commands:e,format:"utf-8",parser:e=>t?String(e).trim():e}}function Pr(e){return{commands:e,format:"buffer",parser:e=>e}}function Ir(e){return"buffer"===e.format}function Ur(e){return"empty"===e.format||!e.commands.length}un($r,{EMPTY_COMMANDS:()=>Sr,adhocExecTask:()=>Mr,configurationErrorTask:()=>jr,isBufferTask:()=>Ir,isEmptyTask:()=>Ur,straightThroughBufferTask:()=>Pr,straightThroughStringTask:()=>Lr});var Nr,Hr,Gr,Vr,qr,Wr=on({"src/lib/tasks/task.ts"(){bn(),Sr=[]}}),zr={};function Yr(e,t){const{cleanMode:n,options:r,valid:s}=function(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(e=>{!function(e){return"f"===e||"n"===e}(e)?r.options=r.options&&function(e){return/^-[a-z]$/i.test(e)&&qr.has(e.charAt(1))}(n[n.length]=`-${e}`):(t=e,r.cleanMode=!0)}),{cleanMode:t,options:n,valid:r}}(e);return n?s.options?(r.push(...t),r.some(Qr)?jr(Nr):Kr(n,r)):jr(Gr+JSON.stringify(e)):jr(Hr)}function Kr(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser:t=>function(e,t){const n=new Br(e),r=e?Ar:kr;return Bn(t).forEach(e=>{const t=e.replace(r,"");n.paths.push(t),(xr.test(t)?n.folders:n.files).push(t)}),n}("n"===e,t)}}function Jr(e){return Array.isArray(e)&&e.every(e=>qr.has(e))}function Qr(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:"--interactive"===e}un(zr,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Nr,CONFIG_ERROR_MODE_REQUIRED:()=>Hr,CONFIG_ERROR_UNKNOWN_OPTION:()=>Gr,CleanOptions:()=>Vr,cleanTask:()=>Kr,cleanWithOptionsTask:()=>Yr,isCleanOptionsArray:()=>Jr});var Xr,Zr=on({"src/lib/tasks/clean.ts"(){Rr(),yr(),Wr(),Nr="Git clean interactive mode is not supported",Hr='Git clean mode parameter ("n" or "f") is required',Gr="Git clean unknown option found in: ",Vr=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(Vr||{}),qr=new Set(["i",...Mn(Object.values(Vr))])}});function es(e){return e.replace(/^(file):/,"")}function*ts(e,t=null){const n=e.split("\0");for(let e=0,r=n.length-1;e<r;){const r=es(n[e++]);let s=n[e++],i=t;if(s.includes("\n")){const e=wn(s,"\n");i=e[0],s=e[1]}yield{file:r,key:i,value:s}}}var ns,rs=on({"src/lib/responses/ConfigList.ts"(){yr(),Xr=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){const t=_n(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){const r=this.addFile(e);Object.hasOwn(r,t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function ss(e,t){return"string"==typeof e&&Object.hasOwn(ns,e)?e:t}function is(e,t){const n=["config","--null","--show-origin","--get-all",e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:"utf-8",parser:t=>function(e,t){let n=null;const r=[],s=new Map;for(const i of ts(e,t))i.key===t&&(r.push(n=i.value),s.has(i.file)||s.set(i.file,[]),s.get(i.file).push(n));return{key:t,paths:Array.from(s.keys()),scopes:s,value:n,values:r}}(t,e)}}function os(e){const t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser:e=>function(e){const t=new Xr;for(const n of ts(e))t.addValue(n.file,String(n.key),n.value);return t}(e)}}var us,as,ls=on({"src/lib/tasks/config.ts"(){rs(),yr(),ns=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(ns||{})}});function cs(e){return as.has(e)}var hs,Ds,ps,ds,fs=on({"src/lib/tasks/diff-name-status.ts"(){us=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(us||{}),as=new Set(Object.values(us))}});function ms(){return{grep(e){const t=pr(arguments),n=hr(arguments);for(const e of hs)if(n.includes(e))return this._runTask(jr(`git.grep: use of "${e}" is not supported.`),t);"string"==typeof e&&(e=function(...e){return(new ds).param(...e)}().param(e));const r=["grep","--null","-n","--full-name",...n,...e];return this._runTask({commands:r,format:"utf-8",parser:e=>function(e){const t=new Set,n={};return kn(e,e=>{const[r,s,i]=e.split(dn);t.add(r),(n[r]=n[r]||[]).push({line:jn(s),path:r,preview:i})}),{paths:t,results:n}}(e)},t)}}}var gs,Fs,Cs=on({"src/lib/tasks/grep.ts"(){yr(),Wr(),hs=["-h"],Ds=Symbol("grepQuery"),ds=class{constructor(){this[ps]=[]}*[(ps=Ds,Symbol.iterator)](){for(const e of this[Ds])yield e}and(...e){return e.length&&this[Ds].push("--and","(",...Ln(e,"-e"),")"),this}param(...e){return this[Ds].push(...Ln(e,"-e")),this}}}}),bs={};function Es(e,t){const n=["reset"];return ws(e)&&n.push(`--${e}`),n.push(...t),Lr(n)}function ys(e){if(ws(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function ws(e){return"string"==typeof e&&Fs.includes(e)}un(bs,{ResetMode:()=>gs,getResetMode:()=>ys,resetTask:()=>Es});var vs=on({"src/lib/tasks/reset.ts"(){yr(),Wr(),gs=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(gs||{}),Fs=Mn(Object.values(gs))}});function _s(e,t,n){return t&&String(t).replace(/\s*/,"")?(r,...s)=>{e(`%s ${r}`,t,...s),n&&n(r,...s)}:n?(t,...r)=>{e(t,...r),n(t,...r)}:e}function Os(e,t,n,r=function(){return Qt("simple-git")}()){const s=e&&`[${e}]`||"",i=[],o="string"==typeof t?r.extend(t):t,u=function(e,t,{namespace:n}){if("string"==typeof e)return e;const r=t&&t.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}(Yn(t,Vn),o,r);return function t(n){const i=n&&`[${n}]`||"",u=o&&_s(o,i)||fn,l=_s(r,`${s} ${i}`,u);return Object.assign(o?u:l,{label:e,sibling:a,info:l,step:t})}(n);function a(t,n){return xn(i,Os(e,u.replace(/^[^:]+/,t),n,r))}}var Bs,ks,As=on({"src/lib/git-logger.ts"(){yr(),Qt.formatters.L=e=>String(Wn(e)?e.length:"-"),Qt.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):mn(e)}}),xs=on({"src/lib/runners/tasks-pending-queue.ts"(){Fn(),As(),Bs=class e{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){const n=e.getName(t.commands[0]);return{task:t,logger:Os(this.logLabel,n),name:n}}push(e){const t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(const[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(0!==this._queue.size)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){const t=this.withProgress(e);if(!t)throw new hn(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(t="empty"){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function Ts(e,t){return{method:vn(e.commands)||"",commands:t}}function Ss(e,t,n,r){return s=>{n("%s received %L bytes",t,s),r("%B",s),e.push(s)}}var Rs,$s=on({"src/lib/runners/git-executor-chain.ts"(){Fn(),Wr(),yr(),xs(),ks=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new Bs}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){const t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{const{logger:t}=this._queue.attempt(e);return await(Ur(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}onFatalException(e,t){const n=t instanceof hn?Object.assign(t,{task:e}):new hn(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){const n=this._plugins.exec("spawn.binary","",Ts(e,e.commands)),r=this._plugins.exec("spawn.args",[...e.commands],Ts(e,e.commands)),s=await this.gitResponse(e,n,r,this.outputHandler,t.step("SPAWN")),i=await this.handleTaskData(e,r,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Ir(e)?fr(e.parser,i):fr(e.parser,i.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,n,r){const{exitCode:s,rejection:i,stdOut:o,stdErr:u}=n;return new Promise((a,l)=>{r("Preparing to handle process response exitCode=%d stdOut=",s);const{error:c}=this._plugins.exec("task.error",{error:i},{...Ts(e,t),...n});return c&&e.onError?(r.info("exitCode=%s handling with custom error handler"),e.onError(n,c,e=>{r.info("custom error handler treated as success"),r("custom error returned a %s",mn(e)),a(new Zn(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(u)))},l)):c?(r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,u.length,i),l(c)):(r.info("retrieving task output complete"),void a(new Zn(Buffer.concat(o),Buffer.concat(u))))})}async gitResponse(e,n,r,s,i){const o=i.sibling("output"),u=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ts(e,e.commands));return new Promise(a=>{const l=[],c=[];i.info("%s %o",n,r),i("%O",u);let h=this._beforeSpawn(e,r);if(h)return a({stdOut:l,stdErr:c,exitCode:9901,rejection:h});this._plugins.exec("spawn.before",void 0,{...Ts(e,r),kill(e){h=e||h}});const D=t.spawn(n,r,u);D.stdout.on("data",Ss(l,"stdOut",i,o.step("stdOut"))),D.stderr.on("data",Ss(c,"stdErr",i,o.step("stdErr"))),D.on("error",function(e,t){return n=>{t("[ERROR] child process exception %o",n),e.push(Buffer.from(String(n.stack),"ascii"))}}(c,i)),s&&(i("Passing child process stdOut/stdErr to custom outputHandler"),s(n,D.stdout,D.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Ts(e,r),spawned:D,close(e,t){a({stdOut:l,stdErr:c,exitCode:e,rejection:h||t})},kill(e){D.killed||(h=e,D.kill("SIGINT"))}})})}_beforeSpawn(e,t){let n;return this._plugins.exec("spawn.before",void 0,{...Ts(e,t),kill(e){n=e||n}}),n}}}}),Ms={};un(Ms,{GitExecutor:()=>Rs});var js=on({"src/lib/runners/git-executor.ts"(){$s(),Rs=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new ks(this,this._scheduler,this._plugins)}chain(){return new ks(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function Ls(e,t,n=fn){t.then(e=>{n(null,e)},t=>{t?.task===e&&n(t instanceof Dn?function(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=fn};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(n,r){return r in e||(n[r]={enumerable:!1,configurable:!1,get:()=>(t(r),e.git[r])}),n}}(t):t,void 0)})}var Ps=on({"src/lib/task-callback.ts"(){Cn(),yr()}});function Is(e,t){return Mr(n=>{if(!An(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var Us=on({"src/lib/tasks/change-working-directory.ts"(){yr(),Wr()}});function Ns(e){const t=["checkout",...e];return"-b"===t[1]&&t.includes("-B")&&(t[1]=Sn(t,"-B")),Lr(t)}var Hs,Gs=on({"src/lib/tasks/checkout.ts"(){yr(),Wr()}});var Vs,qs=on({"src/lib/tasks/count-objects.ts"(){yr(),Hs=new er(/([a-z-]+): (\d+)$/,(e,[t,n])=>{const r=$n(t);Object.hasOwn(e,r)&&(e[r]=jn(n))})}});function Ws(e){return mr({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Vs,e)}var zs=on({"src/lib/parsers/parse-commit.ts"(){yr(),Vs=[new er(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new er(/\s*Author:\s(.+)/i,(e,[t])=>{const n=t.split("<"),r=n.pop();r&&r.includes("@")&&(e.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})}),new er(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new er(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;const s=parseInt(n,10)||0;"-"===r?e.summary.deletions=s:"+"===r&&(e.summary.insertions=s)})]}});function Ys(){return{commit(e,...t){const n=pr(arguments),r=function(e){return!qn(e)&&jr("git.commit: requires the commit message to be supplied as a string/string[]")}(e)||function(e,t,n){return{commands:["-c","core.abbrev=40","commit",...Ln(e,"-m"),...t,...n],format:"utf-8",parser:Ws}}(Rn(e),Rn(Yn(t[0],qn,[])),[...Mn(Yn(t[1],Hn,[])),...hr(arguments,0,!0)]);return this._runTask(r,n)}}}var Ks=on({"src/lib/tasks/commit.ts"(){zs(),yr(),Wr()}});var Js=on({"src/lib/tasks/first-commit.ts"(){yr(),Wr()}});var Qs,Xs,Zs,ei=on({"src/lib/tasks/hash-object.ts"(){Wr()}});var ti,ni=on({"src/lib/responses/InitSummary.ts"(){Qs=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Xs=/^Init.+ repository in (.+)$/,Zs=/^Rein.+ in (.+)$/}});function ri(e=!1,t,n){const r=["init",...n];return e&&!function(e){return e.includes(ti)}(r)&&r.splice(1,0,ti),{commands:r,format:"utf-8",parser:e=>function(e,t,n){const r=String(n).trim();let s;if(s=Xs.exec(r))return new Qs(e,t,!1,s[1]);if(s=Zs.exec(r))return new Qs(e,t,!0,s[1]);let i="";const o=r.split(" ");for(;o.length;)if("in"===o.shift()){i=o.join(" ");break}return new Qs(e,t,/^re/i.test(r),i)}(r.includes("--bare"),t,e)}}var si,ii=on({"src/lib/tasks/init.ts"(){ni(),ti="--bare"}});function oi(e){for(let t=0;t<e.length;t++){const n=si.exec(e[t]);if(n)return`--${n[1]}`}return""}function ui(e){return si.test(e)}var ai,li,ci,hi,Di,pi,di=on({"src/lib/args/log-format.ts"(){si=/^--(stat|numstat|name-only|name-status)(=|$)/}}),fi=on({"src/lib/responses/DiffSummary.ts"(){ai=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function mi(e=""){const t=pi[e];return e=>mr(new ai,t,e,!1)}var gi,Fi,Ci,bi,Ei=on({"src/lib/parsers/parse-diff-summary.ts"(){di(),fi(),fs(),yr(),li=[new er(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=""])=>{e.files.push({file:t.trim(),changes:jn(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})}),new er(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:jn(n),after:jn(r),binary:!0})}),new er(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{const r=/(\d+) i/.exec(n),s=/(\d+) d/.exec(n);e.changed=jn(t),e.insertions=jn(r?.[1]),e.deletions=jn(s?.[1])})],ci=[new er(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{const s=jn(t),i=jn(n);e.changed++,e.insertions+=s,e.deletions+=i,e.files.push({file:r,changes:s+i,insertions:s,deletions:i,binary:!1})}),new er(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],hi=[new er(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],Di=[new er(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,s,i])=>{e.changed++,e.files.push({file:i??r,changes:0,insertions:0,deletions:0,binary:!1,status:Nn(cs(t)&&t),from:Nn(!!i&&r!==i&&r),similarity:jn(n)})})],pi={"":li,"--stat":li,"--numstat":ci,"--name-status":Di,"--name-only":hi}}});function yi(e=Ci,t=bi,n=""){const r=mi(n);return function(n){const s=Bn(n.trim(),!1,gi).map(function(n){const s=n.split(Fi),i=function(e,t){return t.reduce((t,n,r)=>(t[n]=e[r]||"",t),Object.create({diff:null}))}(s[0].split(e),t);return s.length>1&&s[1].trim()&&(i.diff=r(s[1])),i});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var wi=on({"src/lib/parsers/parse-list-log-summary.ts"(){yr(),Ei(),di(),gi="òòòòòò ",Fi=" òò",Ci=" ò ",bi=["hash","date","message","refs","author_name","author_email"]}}),vi={};function _i(e){let t=oi(e);const n=["diff"];return""===t&&(t="--stat",n.push("--stat=4096")),n.push(...e),Oi(n)||{commands:n,format:"utf-8",parser:mi(t)}}function Oi(e){const t=e.filter(ui);return t.length>1?jr(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`):t.length&&e.includes("-z")?jr(`Summary flag ${t} parsing is not compatible with null termination option '-z'`):void 0}un(vi,{diffSummaryTask:()=>_i,validateLogFormatConfig:()=>Oi});var Bi,ki=on({"src/lib/tasks/diff.ts"(){di(),Ei(),Wr()}});function Ai(e={},t=[]){const n=Yn(e.splitter,Vn,Ci),r=Jn(e.format)?e.format:{hash:"%H",date:!1===e.strictDate?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:!1!==e.mailMap?"%aN":"%an",author_email:!1!==e.mailMap?"%aE":"%ae"},[s,i]=function(e,t){const n=[],r=[];return Object.keys(e).forEach(t=>{n.push(t),r.push(String(e[t]))}),[n,r.join(t)]}(r,n),o=[],u=[`--pretty=format:${gi}${i}${Fi}`,...t],a=e.n||e["max-count"]||e.maxCount;if(a&&u.push(`--max-count=${a}`),e.from||e.to){const t=!1!==e.symmetric?"...":"..";o.push(`${e.from||""}${t}${e.to||""}`)}return Vn(e.file)&&u.push("--follow",function(...e){const t=new String(e);return Zt.set(t,e),t}(e.file)),cr(function(e){return Object.keys(e).reduce((t,n)=>(n in Bi||(t[n]=e[n]),t),{})}(e),u),{fields:s,splitter:n,commands:[...u,...o]}}function xi(){return{log(...e){const t=pr(arguments),n=Ai(Dr(arguments),Mn(Yn(arguments[0],Hn,[]))),r=function(e,t){return Vn(e)&&Vn(t)&&jr("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}(...e)||Oi(n.commands)||function(e){return function(e,t,n){const r=yi(e,t,oi(n));return{commands:["log",...n],format:"utf-8",parser:r}}(e.splitter,e.fields,e.commands)}(n);return this._runTask(r,t)}}}var Ti,Si,Ri,$i,Mi,ji=on({"src/lib/tasks/log.ts"(){di(),gn(),wi(),yr(),Wr(),ki(),Bi=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Bi||{})}}),Li=on({"src/lib/responses/MergeSummary.ts"(){Ti=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Si=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Pi=on({"src/lib/responses/PullSummary.ts"(){Ri=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},$i=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Ii(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Ui(e){const t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:jn(t&&t[1]||"0"),delta:jn(n&&n[1]||"0")}}var Ni,Hi,Gi=on({"src/lib/parsers/parse-remote-objects.ts"(){yr(),Mi=[new tr(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{const r=t.toLowerCase(),s=Ii(e.remoteMessages);Object.assign(s,{[r]:jn(n)})}),new tr(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{const r=t.toLowerCase(),s=Ii(e.remoteMessages);Object.assign(s,{[r]:jn(n)})}),new tr(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{const s=Ii(e.remoteMessages);s.total=Ui(t),s.reused=Ui(n),s.packReused=jn(r)})]}});function Vi(e,t){return mr({remoteMessages:new Hi},Ni,t)}var qi,Wi,zi,Yi,Ki,Ji,Qi=on({"src/lib/parsers/parse-remote-messages.ts"(){yr(),Gi(),Ni=[new tr(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Mi,new tr([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new tr([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:jn(t),summary:n,url:r}})],Hi=class{constructor(){this.all=[]}}}});var Xi,Zi,eo,to=on({"src/lib/parsers/parse-pull.ts"(){Pi(),yr(),Qi(),qi=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Wi=/^(create|delete) mode \d+ (.+)/,zi=[new er(/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new er(qi,(e,[t,,n,,r])=>(void 0!==n||void 0!==r)&&(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0)),new er(Wi,(e,[t,n])=>{xn(e.files,n),xn("create"===t?e.created:e.deleted,n)})],Yi=[new er(/^from\s(.+)$/i,(e,[t])=>{e.remote=t}),new er(/^fatal:\s(.+)$/,(e,[t])=>{e.message=t}),new er(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,s])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=s,e.hash.remote=n})],Ki=(e,t)=>mr(new Ri,zi,[e,t]),Ji=(e,t)=>Object.assign(new Ri,Ki(e,t),Vi(0,t))}}),no=on({"src/lib/parsers/parse-merge.ts"(){Li(),yr(),to(),Xi=[new er(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new er(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new Ti(t,n))}),new er(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new Ti(t,n,{deleteRef:r}))}),new er(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Ti(t,null))}),new er(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Zi=(e,t)=>Object.assign(eo(e,t),Ji(e,t)),eo=e=>mr(new Si,Xi,e)}});function ro(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(e,t){const n=Zi(e,t);if(n.failed)throw new Dn(n);return n}}:jr("Git.merge requires at least one option")}var so,io,oo,uo=on({"src/lib/tasks/merge.ts"(){Cn(),no(),Wr()}});var ao=on({"src/lib/parsers/parse-push.ts"(){yr(),Qi(),so=[new er(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new er(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new er(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(function(e,t,n){const r=n.includes("deleted"),s=n.includes("tag")||/^refs\/tags/.test(e),i=!n.includes("new");return{deleted:r,tag:s,branch:!s,new:!i,alreadyUpdated:i,local:e,remote:t}}(t,n,r))}),new er(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch={...e.branch||{},local:t,remote:n,remoteName:r}}),new er(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,s])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:s}}})],io=(e,t)=>({...oo(e,t),...Vi(0,t)}),oo=(e,t)=>mr({pushed:[]},so,[e,t])}}),lo={};function co(e={},t){return xn(t,"--tags"),ho(e,t)}function ho(e={},t){const n=["push",...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),Sn(n,"-v"),xn(n,"--verbose"),xn(n,"--porcelain"),{commands:n,format:"utf-8",parser:io}}un(lo,{pushTagsTask:()=>co,pushTask:()=>ho});var Do=on({"src/lib/tasks/push.ts"(){ao(),yr()}});var po,fo,mo,go,Fo,Co=on({"src/lib/tasks/show.ts"(){yr(),Wr()}}),bo=on({"src/lib/responses/FileStatusSummary.ts"(){po=/^(.+)\0(.+)$/,fo=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,"R"===t||"R"===n){const t=po.exec(e)||[null,e,e];this.from=t[2]||"",this.path=t[1]||""}}}}});function Eo(e){const[t,n]=e.split(dn);return{from:n||t,to:t}}function yo(e,t,n){return[`${e}${t}`,n]}function wo(e,...t){return t.map(t=>yo(e,t,(e,t)=>xn(e.conflicted,t)))}function vo(e,t){const n=t.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return r(" ",n.charAt(0),n.substr(2));default:return}function r(t,n,r){const s=`${t}${n}`,i=go.get(s);i&&i(e,r),"##"!==s&&"!!"!==s&&e.files.push(new fo(r,t,n))}}var _o,Oo=on({"src/lib/responses/StatusSummary.ts"(){yr(),bo(),mo=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},go=new Map([yo(" ","A",(e,t)=>xn(e.created,t)),yo(" ","D",(e,t)=>xn(e.deleted,t)),yo(" ","M",(e,t)=>xn(e.modified,t)),yo("A"," ",(e,t)=>xn(e.created,t)&&xn(e.staged,t)),yo("A","M",(e,t)=>xn(e.created,t)&&xn(e.staged,t)&&xn(e.modified,t)),yo("D"," ",(e,t)=>xn(e.deleted,t)&&xn(e.staged,t)),yo("M"," ",(e,t)=>xn(e.modified,t)&&xn(e.staged,t)),yo("M","M",(e,t)=>xn(e.modified,t)&&xn(e.staged,t)),yo("R"," ",(e,t)=>{xn(e.renamed,Eo(t))}),yo("R","M",(e,t)=>{const n=Eo(t);xn(e.renamed,n),xn(e.modified,n.to)}),yo("!","!",(e,t)=>{xn(e.ignored=e.ignored||[],t)}),yo("?","?",(e,t)=>xn(e.not_added,t)),...wo("A","A","U"),...wo("D","D","U"),...wo("U","A","D","U"),["##",(e,t)=>{let n=/ahead (\d+)/.exec(t);e.ahead=n&&+n[1]||0,n=/behind (\d+)/.exec(t),e.behind=n&&+n[1]||0,n=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(t),e.current=Yn(n?.[1],Vn,null),n=/\.{3}(\S*)/.exec(t),e.tracking=Yn(n?.[1],Vn,null),n=/\son\s(\S+?)(?=\.{3}|$)/.exec(t),n&&(e.current=Yn(n?.[1],Vn,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Fo=function(e){const t=e.split(dn),n=new mo;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&("R"===r.charAt(0)&&(r+=dn+(t[e++]||"")),vo(n,r))}return n}}});var Bo,ko,Ao=on({"src/lib/tasks/status.ts"(){Oo(),_o=["--null","-z"]}});function xo(e=0,t=0,n=0,r="",s=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function To(e){return e===Bo?xo(0,0,0,"",!1):mr(xo(0,0,0,e),ko,e)}var So,Ro=on({"src/lib/tasks/version.ts"(){yr(),Bo="installed=false",ko=[new er(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,s=""])=>{Object.assign(e,xo(jn(t),jn(n),jn(r),s))}),new er(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,s=""])=>{Object.assign(e,xo(jn(t),jn(n),r,s))})]}}),$o={};un($o,{SimpleGitApi:()=>So});var Mo,jo,Lo=on({"src/lib/simple-git-api.ts"(){Ps(),Us(),Gs(),qs(),Ks(),ls(),Js(),Cs(),ei(),ii(),ji(),uo(),Do(),Co(),Ao(),Wr(),Ro(),yr(),So=class{constructor(e){this._executor=e}_runTask(e,t){const n=this._executor.chain(),r=n.push(e);return t&&Ls(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(Lr(["add",...Rn(e)]),pr(arguments))}cwd(e){const t=pr(arguments);return"string"==typeof e?this._runTask(Is(e,this._executor),t):"string"==typeof e?.path?this._runTask(Is(e.path,e.root&&this._executor||void 0),t):this._runTask(jr("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(function(e,t){const n=["hash-object",e];return t&&n.push("-w"),Lr(n,!0)}(e,!0===t),pr(arguments))}init(e){return this._runTask(ri(!0===e,this._executor.cwd,hr(arguments)),pr(arguments))}merge(){return this._runTask(ro(hr(arguments)),pr(arguments))}mergeFromTo(e,t){return Vn(e)&&Vn(t)?this._runTask(ro([e,t,...hr(arguments)]),pr(arguments,!1)):this._runTask(jr("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){const e=ho({remote:Yn(arguments[0],Vn),branch:Yn(arguments[1],Vn)},hr(arguments));return this._runTask(e,pr(arguments))}stash(){return this._runTask(Lr(["stash",...hr(arguments)]),pr(arguments))}status(){return this._runTask({format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...hr(arguments).filter(e=>!_o.includes(e))],parser:e=>Fo(e)},pr(arguments))}},Object.assign(So.prototype,{checkout(){return this._runTask(Ns(hr(arguments,1)),pr(arguments))},checkoutBranch(e,t){return this._runTask(Ns(["-b",e,t,...hr(arguments)]),pr(arguments))},checkoutLocalBranch(e){return this._runTask(Ns(["-b",e,...hr(arguments)]),pr(arguments))}},Ys(),{addConfig(e,t,...n){return this._runTask(function(e,t,n,r){const s=["config",`--${r}`];return n&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser:e=>e}}(e,t,!0===n[0],ss(n[1],"local")),pr(arguments))},getConfig(e,t){return this._runTask(is(e,ss(t,void 0)),pr(arguments))},listConfig(...e){return this._runTask(os(ss(e[0],void 0)),pr(arguments))}},{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser:e=>mr({count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0},[Hs],e)})}},{firstCommit(){return this._runTask(Lr(["rev-list","--max-parents=0","HEAD"],!0),pr(arguments))}},ms(),xi(),{showBuffer(){const e=["show",...hr(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Pr(e),pr(arguments))},show(){const e=["show",...hr(arguments,1)];return this._runTask(Lr(e),pr(arguments))}},{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:To,onError(e,t,n,r){if(-2===e.exitCode)return n(Buffer.from(Bo));r(t)}})}})}}),Po={};un(Po,{Scheduler:()=>jo});var Io=on({"src/lib/runners/scheduler.ts"(){yr(),As(),Mo=(()=>{let e=0;return()=>{e++;const{promise:t,done:n}=en.createDeferred();return{promise:t,done:n,id:e}}})(),jo=class{constructor(e=2){this.concurrency=e,this.logger=Os("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency)return void this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);const e=xn(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Sn(this.running,e),this.schedule()})}next(){const{promise:e,id:t}=xn(this.pending,Mo());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),Uo={};function No(e,t){return Lr(["apply",...t,...e])}un(Uo,{applyPatchTask:()=>No});var Ho,Go=on({"src/lib/tasks/apply-patch.ts"(){Wr()}});var Vo,qo,Wo,zo=on({"src/lib/responses/BranchDeleteSummary.ts"(){Ho=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Yo(e,t){return 1===t&&Vo.test(e)}var Ko,Jo,Qo,Xo=on({"src/lib/parsers/parse-branch-delete.ts"(){zo(),yr(),Vo=/^error[^']+'([^']+)'/m,qo=[new er(/(\S+)\s+\(\S+\s([^)]+)\)/,(e,[t,n])=>{const r=function(e,t){return{branch:e,hash:t,success:!0}}(t,n);e.all.push(r),e.branches[t]=r}),new er(Vo,(e,[t])=>{const n=function(e){return{branch:e,hash:null,success:!1}}(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],Wo=(e,t)=>mr(new Ho,qo,[e,t])}}),Zo=on({"src/lib/responses/BranchSummary.ts"(){Ko=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,n,r,s){"*"===e&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:"*"===e,linkedWorkTree:"+"===e,name:n,commit:r,label:s}}}}});function eu(e){return e?e.charAt(0):""}function tu(e,t=!1){return mr(new Ko,t?[Qo]:Jo,e)}var nu=on({"src/lib/parsers/parse-branch.ts"(){Zo(),yr(),Jo=[new er(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,s])=>{e.push(eu(t),!0,n,r,s)}),new er(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,r,s])=>{e.push(eu(t),!1,n,r,s)})],Qo=new er(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),ru={};function su(e){const t=["-d","-D","--delete"];return e.some(e=>t.includes(e))}function iu(e){const t=su(e),n=e.includes("--show-current"),r=["branch",...e];return 1===r.length&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser:(e,r)=>t?Wo(e,r).all[0]:tu(e,n)}}function ou(){return{format:"utf-8",commands:["branch","-v"],parser:e=>tu(e)}}function uu(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser:(e,t)=>Wo(e,t),onError({exitCode:e,stdOut:t},n,r,s){if(!Yo(String(n),e))return s(n);r(t)}}}function au(e,t=!1){const n={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser:(t,n)=>Wo(t,n).branches[e],onError({exitCode:e,stdErr:t,stdOut:r},s,i,o){if(!Yo(String(s),e))return o(s);throw new Dn(n.parser(Pn(r),Pn(t)),String(s))}};return n}un(ru,{branchLocalTask:()=>ou,branchTask:()=>iu,containsDeleteBranchCommand:()=>su,deleteBranchTask:()=>au,deleteBranchesTask:()=>uu});var lu,cu=on({"src/lib/tasks/branch.ts"(){Cn(),Xo(),nu(),yr()}});function hu(e){const t=e.trim().replace(/^["']|["']$/g,"");return t&&n.normalize(t)}var Du=on({"src/lib/responses/CheckIgnore.ts"(){lu=e=>e.split(/\n/g).map(hu).filter(Boolean)}}),pu={};function du(e){return{commands:["check-ignore",...e],format:"utf-8",parser:lu}}un(pu,{checkIgnoreTask:()=>du});var fu=on({"src/lib/tasks/check-ignore.ts"(){Du()}}),mu={};function gu(e){return/^--upload-pack(=|$)/.test(e)}function Fu(e,t,n){const r=["clone",...n];Vn(e)&&r.push(e),Vn(t)&&r.push(t);return r.find(gu)?jr("git.fetch: potential exploit argument blocked."):Lr(r)}function Cu(e,t,n){return xn(n,"--mirror"),Fu(e,t,n)}un(mu,{cloneMirrorTask:()=>Cu,cloneTask:()=>Fu});var bu,Eu=on({"src/lib/tasks/clone.ts"(){Wr(),yr()}});function yu(e,t){return mr({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},bu,[e,t])}var wu=on({"src/lib/parsers/parse-fetch.ts"(){yr(),bu=[new er(/From (.+)$/,(e,[t])=>{e.remote=t}),new er(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new er(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new er(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new er(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,s])=>{e.updated.push({name:r,tracking:s,to:n,from:t})})]}}),vu={};function _u(e){return/^--upload-pack(=|$)/.test(e)}function Ou(e,t,n){const r=["fetch",...n];e&&t&&r.push(e,t);return r.find(_u)?jr("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:yu}}un(vu,{fetchTask:()=>Ou});var Bu,ku=on({"src/lib/tasks/fetch.ts"(){wu(),Wr()}});function Au(e){return mr({moves:[]},Bu,e)}var xu=on({"src/lib/parsers/parse-move.ts"(){yr(),Bu=[new er(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Tu={};function Su(e,t){return{commands:["mv","-v",...Rn(e),t],format:"utf-8",parser:Au}}un(Tu,{moveTask:()=>Su});var Ru=on({"src/lib/tasks/move.ts"(){xu(),yr()}}),$u={};function Mu(e,t,n){const r=["pull",...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:"utf-8",parser:(e,t)=>Ji(e,t),onError(e,t,n,r){const s=function(e,t){const n=mr(new $i,Yi,[e,t]);return n.message&&n}(Pn(e.stdOut),Pn(e.stdErr));if(s)return r(new Dn(s));r(t)}}}un($u,{pullTask:()=>Mu});var ju=on({"src/lib/tasks/pull.ts"(){Cn(),to(),yr()}});function Lu(e){const t={};return Iu(e,([e])=>t[e]={name:e}),Object.values(t)}function Pu(e){const t={};return Iu(e,([e,n,r])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:"",push:""}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function Iu(e,t){kn(e,e=>t(e.split(/\s+/)))}var Uu=on({"src/lib/responses/GetRemoteSummary.ts"(){yr()}}),Nu={};function Hu(e,t,n){return Lr(["remote","add",...n,e,t])}function Gu(e){const t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Pu:Lu}}function Vu(e){const t=[...e];return"ls-remote"!==t[0]&&t.unshift("ls-remote"),Lr(t)}function qu(e){const t=[...e];return"remote"!==t[0]&&t.unshift("remote"),Lr(t)}function Wu(e){return Lr(["remote","remove",e])}un(Nu,{addRemoteTask:()=>Hu,getRemotesTask:()=>Gu,listRemotesTask:()=>Vu,remoteTask:()=>qu,removeRemoteTask:()=>Wu});var zu=on({"src/lib/tasks/remote.ts"(){Uu(),Wr()}}),Yu={};function Ku(e={},t){const n=Ai(e),r=["stash","list",...n.commands,...t],s=yi(n.splitter,n.fields,oi(r));return Oi(r)||{commands:r,format:"utf-8",parser:s}}un(Yu,{stashListTask:()=>Ku});var Ju=on({"src/lib/tasks/stash-list.ts"(){di(),wi(),ki(),ji()}}),Qu={};function Xu(e,t){return ea(["add",e,t])}function Zu(e){return ea(["init",...e])}function ea(e){const t=[...e];return"submodule"!==t[0]&&t.unshift("submodule"),Lr(t)}function ta(e){return ea(["update",...e])}un(Qu,{addSubModuleTask:()=>Xu,initSubModuleTask:()=>Zu,subModuleTask:()=>ea,updateSubModuleTask:()=>ta});var na,ra,sa=on({"src/lib/tasks/sub-module.ts"(){Wr()}});function ia(e,t){return e===t?0:e>t?1:-1}function oa(e){return e.trim()}function ua(e){return"string"==typeof e&&parseInt(e.replace(/^\D+/g,""),10)||0}var aa=on({"src/lib/responses/TagList.ts"(){na=class{constructor(e,t){this.all=e,this.latest=t}},ra=function(e,t=!1){const n=e.split("\n").map(oa).filter(Boolean);t||n.sort(function(e,t){const n=e.split("."),r=t.split(".");if(1===n.length||1===r.length)return function(e,t){const n=Number.isNaN(e);return n!==Number.isNaN(t)?n?1:-1:n?ia(e,t):0}(ua(n[0]),ua(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){const t=ia(ua(n[e]),ua(r[e]));if(t)return t}return 0});const r=t?n[0]:[...n].reverse().find(e=>e.indexOf(".")>=0);return new na(n,r)}}}),la={};function ca(e=[]){const t=e.some(e=>/^--sort=/.test(e));return{format:"utf-8",commands:["tag","-l",...e],parser:e=>ra(e,t)}}function ha(e){return{format:"utf-8",commands:["tag",e],parser:()=>({name:e})}}function Da(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser:()=>({name:e})}}un(la,{addAnnotatedTagTask:()=>Da,addTagTask:()=>ha,tagListTask:()=>ca});var pa,da,fa=on({"src/lib/tasks/tag.ts"(){aa()}}),ma=(pa={"src/git.js"(e,t){var{GitExecutor:n}=(js(),an(Ms)),{SimpleGitApi:r}=(Lo(),an($o)),{Scheduler:s}=(Io(),an(Po)),{configurationErrorTask:i}=(Wr(),an($r)),{asArray:o,filterArray:u,filterPrimitives:a,filterString:l,filterStringOrStringArray:c,filterType:h,getTrailingOptions:D,trailingFunctionArgument:p,trailingOptionsArgument:d}=(yr(),an(Fr)),{applyPatchTask:f}=(Go(),an(Uo)),{branchTask:m,branchLocalTask:g,deleteBranchesTask:F,deleteBranchTask:C}=(cu(),an(ru)),{checkIgnoreTask:b}=(fu(),an(pu)),{checkIsRepoTask:E}=(Tr(),an(wr)),{cloneTask:y,cloneMirrorTask:w}=(Eu(),an(mu)),{cleanWithOptionsTask:v,isCleanOptionsArray:_}=(Zr(),an(zr)),{diffSummaryTask:O}=(ki(),an(vi)),{fetchTask:B}=(ku(),an(vu)),{moveTask:k}=(Ru(),an(Tu)),{pullTask:A}=(ju(),an($u)),{pushTagsTask:x}=(Do(),an(lo)),{addRemoteTask:T,getRemotesTask:S,listRemotesTask:R,remoteTask:$,removeRemoteTask:M}=(zu(),an(Nu)),{getResetMode:j,resetTask:L}=(vs(),an(bs)),{stashListTask:P}=(Ju(),an(Yu)),{addSubModuleTask:I,initSubModuleTask:U,subModuleTask:N,updateSubModuleTask:H}=(sa(),an(Qu)),{addAnnotatedTagTask:G,addTagTask:V,tagListTask:q}=(fa(),an(la)),{straightThroughBufferTask:W,straightThroughStringTask:z}=(Wr(),an($r));function Y(e,t){this._plugins=t,this._executor=new n(e.baseDir,new s(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}function K(e,t,n,r){return"string"!=typeof n?i(`git.${e}() requires a string 'repoPath'`):t(n,h(r,l),D(arguments))}(Y.prototype=Object.create(r.prototype)).constructor=Y,Y.prototype.customBinary=function(e){return this._plugins.reconfigure("binary",e),this},Y.prototype.env=function(e,t){return 1===arguments.length&&"object"==typeof e?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},Y.prototype.stashList=function(e){return this._runTask(P(d(arguments)||{},u(e)&&e||[]),p(arguments))},Y.prototype.clone=function(){return this._runTask(K("clone",y,...arguments),p(arguments))},Y.prototype.mirror=function(){return this._runTask(K("mirror",w,...arguments),p(arguments))},Y.prototype.mv=function(e,t){return this._runTask(k(e,t),p(arguments))},Y.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(n,r){t.checkout(r.latest,e)})})},Y.prototype.pull=function(e,t,n,r){return this._runTask(A(h(e,l),h(t,l),D(arguments)),p(arguments))},Y.prototype.fetch=function(e,t){return this._runTask(B(h(e,l),h(t,l),D(arguments)),p(arguments))},Y.prototype.silent=function(e){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},Y.prototype.tags=function(e,t){return this._runTask(q(D(arguments)),p(arguments))},Y.prototype.rebase=function(){return this._runTask(z(["rebase",...D(arguments)]),p(arguments))},Y.prototype.reset=function(e){return this._runTask(L(j(e),D(arguments)),p(arguments))},Y.prototype.revert=function(e){const t=p(arguments);return"string"!=typeof e?this._runTask(i("Commit must be a string"),t):this._runTask(z(["revert",...D(arguments,0,!0),e]),t)},Y.prototype.addTag=function(e){const t="string"==typeof e?V(e):i("Git.addTag requires a tag name");return this._runTask(t,p(arguments))},Y.prototype.addAnnotatedTag=function(e,t){return this._runTask(G(e,t),p(arguments))},Y.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(C(e,"boolean"==typeof t&&t),p(arguments))},Y.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(F(e,"boolean"==typeof t&&t),p(arguments))},Y.prototype.branch=function(e,t){return this._runTask(m(D(arguments)),p(arguments))},Y.prototype.branchLocal=function(e){return this._runTask(g(),p(arguments))},Y.prototype.raw=function(e){const t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!a(n[e])){n.splice(e,n.length-e);break}n.push(...D(arguments,0,!0));var r=p(arguments);return n.length?this._runTask(z(n,this._trimmed),r):this._runTask(i("Raw: must supply one or more command to execute"),r)},Y.prototype.submoduleAdd=function(e,t,n){return this._runTask(I(e,t),p(arguments))},Y.prototype.submoduleUpdate=function(e,t){return this._runTask(H(D(arguments,!0)),p(arguments))},Y.prototype.submoduleInit=function(e,t){return this._runTask(U(D(arguments,!0)),p(arguments))},Y.prototype.subModule=function(e,t){return this._runTask(N(D(arguments)),p(arguments))},Y.prototype.listRemote=function(){return this._runTask(R(D(arguments)),p(arguments))},Y.prototype.addRemote=function(e,t,n){return this._runTask(T(e,t,D(arguments)),p(arguments))},Y.prototype.removeRemote=function(e,t){return this._runTask(M(e),p(arguments))},Y.prototype.getRemotes=function(e,t){return this._runTask(S(!0===e),p(arguments))},Y.prototype.remote=function(e,t){return this._runTask($(D(arguments)),p(arguments))},Y.prototype.tag=function(e,t){const n=D(arguments);return"tag"!==n[0]&&n.unshift("tag"),this._runTask(z(n),p(arguments))},Y.prototype.updateServerInfo=function(e){return this._runTask(z(["update-server-info"]),p(arguments))},Y.prototype.pushTags=function(e,t){const n=x({remote:h(e,l)},D(arguments));return this._runTask(n,p(arguments))},Y.prototype.rm=function(e){return this._runTask(z(["rm","-f",...o(e)]),p(arguments))},Y.prototype.rmKeepLocal=function(e){return this._runTask(z(["rm","--cached",...o(e)]),p(arguments))},Y.prototype.catFile=function(e,t){return this._catFile("utf-8",arguments)},Y.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},Y.prototype._catFile=function(e,t){var n=p(t),r=["cat-file"],s=t[0];if("string"==typeof s)return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),n);Array.isArray(s)&&r.push.apply(r,s);const o="buffer"===e?W(r):z(r);return this._runTask(o,n)},Y.prototype.diff=function(e,t){const n=l(e)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):z(["diff",...D(arguments)]);return this._runTask(n,p(arguments))},Y.prototype.diffSummary=function(){return this._runTask(O(D(arguments,1)),p(arguments))},Y.prototype.applyPatch=function(e){const t=c(e)?f(o(e),D([].slice.call(arguments,1))):i("git.applyPatch requires one or more string patches as the first argument");return this._runTask(t,p(arguments))},Y.prototype.revparse=function(){const e=["rev-parse",...D(arguments,!0)];return this._runTask(z(e,!0),p(arguments))},Y.prototype.clean=function(e,t,n){const r=_(e),s=r&&e.join("")||h(e,l)||"",i=D([].slice.call(arguments,r?1:0));return this._runTask(v(s,i),p(arguments))},Y.prototype.exec=function(e){const t={commands:[],format:"utf-8",parser(){"function"==typeof e&&e()}};return this._runTask(t)},Y.prototype.clearQueue=function(){return this},Y.prototype.checkIgnore=function(e,t){return this._runTask(b(o(h(e,c,[]))),p(arguments))},Y.prototype.checkIsRepo=function(e,t){return this._runTask(E(h(e,l)),p(arguments))},t.exports=Y}},function(){return da||(0,pa[rn(pa)[0]])((da={exports:{}}).exports,da),da.exports});gn(),Fn();var ga=class extends hn{constructor(e,t){super(void 0,t),this.config=e}};Fn(),Fn();var Fa=class extends hn{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};function Ca({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action:(n,r)=>(n.forEach((s,i)=>{const o=i<n.length?n[i+1]:"";e||function(e,t){if(function(e){return"string"==typeof e&&"-c"===e.trim().toLowerCase()}(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new Fa(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}(s,o),t||function(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new Fa(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if("clone"===t&&/^\s*-u\b/.test(e))throw new Fa(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if("push"===t&&/^\s*--exec\b/.test(e))throw new Fa(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}(s,r.method)}),n)}}Cn(),bn(),Tr(),Zr(),ls(),fs(),Cs(),vs(),yr(),yr();var ba=en.deferred().promise;function Ea({onClose:e=!0,onExit:t=50}={}){function n(e,t,n){!1!==e&&(!0===e?t.promise:t.promise.then(()=>Un(e))).then(n.done)}return{type:"spawn.after",async action(r,{spawned:s,close:i}){const o=function(){let r=-1;const s={close:en.deferred(),closeTimeout:en.deferred(),exit:en.deferred(),exitTimeout:en.deferred()},i=Promise.race([!1===e?ba:s.closeTimeout.promise,!1===t?ba:s.exitTimeout.promise]);return n(e,s.close,s.closeTimeout),n(t,s.exit,s.exitTimeout),{close(e){r=e,s.close.done()},exit(e){r=e,s.exit.done()},get exitCode(){return r},result:i}}();let u=!0,a=()=>{u=!1};s.stdout?.on("data",a),s.stderr?.on("data",a),s.on("error",a),s.on("close",e=>o.close(e)),s.on("exit",e=>o.exit(e));try{await o.result,u&&await Un(50),i(o.exitCode)}catch(e){i(o.exitCode,e)}}}}yr();var ya="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function wa(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function va(e,t){if(e.length<1||e.length>2)throw new Fa(void 0,"binary","Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings");if(e.some(wa)){if(!t)throw new Fa(void 0,"binary",ya);console.warn(ya)}const[n,r]=e;return{binary:n,prefix:r}}function _a(e){return!(!e.exitCode||!e.stdErr.length)}function Oa(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Ba(e=!1,t=_a,n=Oa){return(r,s)=>!e&&r||!t(s)?r:n(s)}function ka(e){return{type:"task.error",action(t,n){const r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new hn(void 0,r.toString("utf-8"))}:{error:r}}}}Fn(),yr();var Aa=class{constructor(){this.plugins=new Set,this.events=new e.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){const n=xn(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){const t=[];return Rn(e).forEach(e=>e&&this.plugins.add(xn(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,n){let r=t;const s=Object.freeze(Object.create(n));for(const t of this.plugins)t.type===e&&(r=t.action(r,s));return r}};function xa(e){return String(e.toLowerCase().split(" ",1))||"unknown"}yr(),yr(),gn(),yr();var Ta=ma();Cn();var Sa,Ra,$a,Ma,ja,La,Pa,Ia,Ua,Na,Ha,Ga,Va,qa,Wa,za=function(e,t){const n=new Aa,r=ar(e&&("string"==typeof e?{baseDir:e}:e)||{},t);if(!An(r.baseDir))throw new ga(r,"Cannot use simple-git on a directory that does not exist");return Array.isArray(r.config)&&n.add(function(e){const t=Ln(e,"-c");return{type:"spawn.args",action:e=>[...t,...e]}}(r.config)),n.add(Ca(r.unsafe)),n.add({type:"spawn.args",action(e){const t=[];let n;function r(e){(n=n||[]).push(...e)}for(let n=0;n<e.length;n++){const s=e[n];if(ln(s))r(cn(s));else{if("--"===s){r(e.slice(n+1).flatMap(e=>ln(e)&&cn(e)||e));break}t.push(s)}}return n?[...t,"--",...n.map(String)]:t}}),n.add(Ea(r.completion)),r.abort&&n.add(function(e){if(!e)return;const t={type:"spawn.after",action(t,n){function r(){n.kill(new Fa(void 0,"abort","Abort signal received"))}e.addEventListener("abort",r),n.spawned.on("close",()=>e.removeEventListener("abort",r))}};return[{type:"spawn.before",action(t,n){e.aborted&&n.kill(new Fa(void 0,"abort","Abort already signaled"))}},t]}(r.abort)),r.progress&&n.add(function(e){const t="--progress",n=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action:(e,r)=>n.includes(r.method)?Tn(e,t):e},{type:"spawn.after",action(n,r){r.commands.includes(t)&&r.spawned.stderr?.on("data",t=>{const n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString("utf8"));n&&e({method:r.method,stage:xa(n[1]),progress:jn(n[2]),processed:jn(n[3]),total:jn(n[4])})})}}]}(r.progress)),r.timeout&&n.add(function({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:"spawn.after",action(r,s){let i;function o(){i&&clearTimeout(i),i=setTimeout(a,e)}function u(){s.spawned.stdout?.off("data",o),s.spawned.stderr?.off("data",o),s.spawned.off("exit",u),s.spawned.off("close",u),i&&clearTimeout(i)}function a(){u(),s.kill(new Fa(void 0,"timeout","block timeout reached"))}n&&s.spawned.stdout?.on("data",o),t&&s.spawned.stderr?.on("data",o),s.spawned.on("exit",u),s.spawned.on("close",u),o()}}}(r.timeout)),r.spawnOptions&&n.add(function(e){const t=In(e,["uid","gid"]);return{type:"spawn.options",action:e=>({...t,...e})}}(r.spawnOptions)),n.add(ka(Ba(!0))),r.errors&&n.add(ka(r.errors)),function(e,t=["git"],n=!1){let r=va(Rn(t),n);e.on("binary",e=>{r=va(Rn(e),n)}),e.append("spawn.binary",()=>r.binary),e.append("spawn.args",e=>r.prefix?[r.prefix,...e]:e)}(n,r.binary,r.unsafe?.allowUnsafeCustomBinary),new Ta(r,n)},Ya={exports:{}};function Ka(){if(Ma)return $a;Ma=1;const e=Ra?Sa:(Ra=1,Sa={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]}),t={};for(const n of Object.keys(e))t[e[n]]=n;const n={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"]}};$a=n;for(const e of Object.keys(n)){if(!("channels"in n[e]))throw new Error("missing channels property: "+e);if(!("labels"in n[e]))throw new Error("missing channel labels property: "+e);if(n[e].labels.length!==n[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=n[e];delete n[e].channels,delete n[e].labels,Object.defineProperty(n[e],"channels",{value:t}),Object.defineProperty(n[e],"labels",{value:r})}function r(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}return n.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(t,n,r),i=Math.max(t,n,r),o=i-s;let u,a;i===s?u=0:t===i?u=(n-r)/o:n===i?u=2+(r-t)/o:r===i&&(u=4+(t-n)/o),u=Math.min(60*u,360),u<0&&(u+=360);const l=(s+i)/2;return a=i===s?0:l<=.5?o/(i+s):o/(2-i-s),[u,100*a,100*l]},n.rgb.hsv=function(e){let t,n,r,s,i;const o=e[0]/255,u=e[1]/255,a=e[2]/255,l=Math.max(o,u,a),c=l-Math.min(o,u,a),h=function(e){return(l-e)/6/c+.5};return 0===c?(s=0,i=0):(i=c/l,t=h(o),n=h(u),r=h(a),o===l?s=r-n:u===l?s=1/3+t-r:a===l&&(s=2/3+n-t),s<0?s+=1:s>1&&(s-=1)),[360*s,100*i,100*l]},n.rgb.hwb=function(e){const t=e[0],r=e[1];let s=e[2];const i=n.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,s));return s=1-1/255*Math.max(t,Math.max(r,s)),[i,100*o,100*s]},n.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.min(1-t,1-n,1-r);return[100*((1-t-s)/(1-s)||0),100*((1-n-s)/(1-s)||0),100*((1-r-s)/(1-s)||0),100*s]},n.rgb.keyword=function(n){const s=t[n];if(s)return s;let i,o=1/0;for(const t of Object.keys(e)){const s=r(n,e[t]);s<o&&(o=s,i=t)}return i},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},n.rgb.lab=function(e){const t=n.rgb.xyz(e);let r=t[0],s=t[1],i=t[2];r/=95.047,s/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*s-16,500*(r-s),200*(s-i)]},n.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let s,i,o;if(0===n)return o=255*r,[o,o,o];s=r<.5?r*(1+n):r+n-r*n;const u=2*r-s,a=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,o=6*i<1?u+6*(s-u)*i:2*i<1?s:3*i<2?u+(s-u)*(2/3-i)*6:u,a[e]=255*o;return a},n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,s=n;const i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,s*=i<=1?i:2-i;return[t,100*(0===r?2*s/(i+s):2*n/(r+n)),100*((r+n)/2)]},n.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const s=Math.floor(t)%6,i=t-Math.floor(t),o=255*r*(1-n),u=255*r*(1-n*i),a=255*r*(1-n*(1-i));switch(r*=255,s){case 0:return[r,a,o];case 1:return[u,r,o];case 2:return[o,r,a];case 3:return[o,u,r];case 4:return[a,o,r];case 5:return[r,o,u]}},n.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,s=Math.max(r,.01);let i,o;o=(2-n)*r;const u=(2-n)*s;return i=n*s,i/=u<=1?u:2-u,i=i||0,o/=2,[t,100*i,100*o]},n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const s=n+r;let i;s>1&&(n/=s,r/=s);const o=Math.floor(6*t),u=1-r;i=6*t-o,1&o&&(i=1-i);const a=n+i*(u-n);let l,c,h;switch(o){default:case 6:case 0:l=u,c=a,h=n;break;case 1:l=a,c=u,h=n;break;case 2:l=n,c=u,h=a;break;case 3:l=n,c=a,h=u;break;case 4:l=a,c=n,h=u;break;case 5:l=u,c=n,h=a}return[255*l,255*c,255*h]},n.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,s=e[3]/100;return[255*(1-Math.min(1,t*(1-s)+s)),255*(1-Math.min(1,n*(1-s)+s)),255*(1-Math.min(1,r*(1-s)+s))]},n.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let s,i,o;return s=3.2406*t+-1.5372*n+-.4986*r,i=-.9689*t+1.8758*n+.0415*r,o=.0557*t+-.204*n+1.057*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[255*s,255*i,255*o]},n.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},n.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const s=n**3,i=t**3,o=r**3;return n=s>.008856?s:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},n.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let s;s=360*Math.atan2(r,n)/2/Math.PI,s<0&&(s+=360);return[t,Math.sqrt(n*n+r*r),s]},n.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},n.rgb.ansi16=function(e,t=null){const[r,s,i]=e;let o=null===t?n.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let u=30+(Math.round(i/255)<<2|Math.round(s/255)<<1|Math.round(r/255));return 2===o&&(u+=60),u},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},n.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},n.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,s=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),o=s-i;let u,a;return u=o<1?i/(1-o):0,a=o<=0?0:s===t?(n-r)/o%6:s===n?2+(r-t)/o:4+(t-n)/o,a/=6,a%=1,[360*a,100*o,100*u]},n.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let s=0;return r<1&&(s=(n-.5*r)/(1-r)),[e[0],100*r,100*s]},n.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let s=0;return r<1&&(s=(n-r)/(1-r)),[e[0],100*r,100*s]},n.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const s=[0,0,0],i=t%1*6,o=i%1,u=1-o;let a=0;switch(Math.floor(i)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=u,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=u,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=u}return a=(1-n)*r,[255*(n*s[0]+a),255*(n*s[1]+a),255*(n*s[2]+a)]},n.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},n.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},n.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},n.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let s=0;return r<1&&(s=(n-r)/(1-r)),[e[0],100*r,100*s]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=function(e){return[0,0,e[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},$a}function Ja(){if(La)return ja;La=1;const e=Ka();function t(t){const n=function(){const t={},n=Object.keys(e);for(let e=n.length,r=0;r<e;r++)t[n[r]]={distance:-1,parent:null};return t}(),r=[t];for(n[t].distance=0;r.length;){const t=r.pop(),s=Object.keys(e[t]);for(let e=s.length,i=0;i<e;i++){const e=s[i],o=n[e];-1===o.distance&&(o.distance=n[t].distance+1,o.parent=t,r.unshift(e))}}return n}function n(e,t){return function(n){return t(e(n))}}function r(t,r){const s=[r[t].parent,t];let i=e[r[t].parent][t],o=r[t].parent;for(;r[o].parent;)s.unshift(r[o].parent),i=n(e[r[o].parent][o],i),o=r[o].parent;return i.conversion=s,i}return ja=function(e){const n=t(e),s={},i=Object.keys(n);for(let e=i.length,t=0;t<e;t++){const e=i[t];null!==n[e].parent&&(s[e]=r(e,n))}return s}}function Qa(){if(Ia)return Pa;Ia=1;const e=Ka(),t=Ja(),n={};return Object.keys(e).forEach(r=>{n[r]={},Object.defineProperty(n[r],"channels",{value:e[r].channels}),Object.defineProperty(n[r],"labels",{value:e[r].labels});const s=t(r);Object.keys(s).forEach(e=>{const t=s[e];n[r][e]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(t),n[r][e].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)})}),Pa=n}function Xa(){return Ua||(Ua=1,function(e){const t=(e,t)=>(...n)=>`[${e(...n)+t}m`,n=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},s=e=>e,i=(e,t,n)=>[e,t,n],o=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let u;const a=(e,t,n,r)=>{void 0===u&&(u=Qa());const s=r?10:0,i={};for(const[r,o]of Object.entries(u)){const u="ansi16"===r?"ansi":r;r===t?i[u]=e(n,s):"object"==typeof o&&(i[u]=e(o[t],s))}return i};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,u={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]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(const[t,n]of Object.entries(u)){for(const[t,r]of Object.entries(n))u[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=u[t],e.set(r[0],r[1]);Object.defineProperty(u,t,{value:n,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="[39m",u.bgColor.close="[49m",o(u.color,"ansi",()=>a(t,"ansi16",s,!1)),o(u.color,"ansi256",()=>a(n,"ansi256",s,!1)),o(u.color,"ansi16m",()=>a(r,"rgb",i,!1)),o(u.bgColor,"ansi",()=>a(t,"ansi16",s,!0)),o(u.bgColor,"ansi256",()=>a(n,"ansi256",s,!0)),o(u.bgColor,"ansi16m",()=>a(r,"rgb",i,!0)),u}})}(Ya)),Ya.exports}var Za=function(){if(Wa)return qa;Wa=1;const e=Xa(),{stdout:t,stderr:n}=Vt(),{stringReplaceAll:r,stringEncaseCRLFWithFirstIndex:s}=Ha?Na:(Ha=1,Na={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const s=t.length;let i=0,o="";do{o+=e.substr(i,r-i)+t+n,i=r+s,r=e.indexOf(t,i)}while(-1!==r);return o+=e.substr(i),o},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let s=0,i="";do{const o="\r"===e[r-1];i+=e.substr(s,(o?r-1:r)-s)+t+(o?"\r\n":"\n")+n,s=r+1,r=e.indexOf("\n",s)}while(-1!==r);return i+=e.substr(s),i}}),{isArray:i}=Array,o=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null);class a{constructor(e){return l(e)}}const l=e=>{const n={};return((e,n={})=>{if(n.level&&!(Number.isInteger(n.level)&&n.level>=0&&n.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=t?t.level:0;e.level=void 0===n.level?r:n.level})(n,e),n.template=(...e)=>g(n.template,...e),Object.setPrototypeOf(n,c.prototype),Object.setPrototypeOf(n.template,n),n.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},n.template.Instance=a,n.template};function c(e){return l(e)}for(const[t,n]of Object.entries(e))u[t]={get(){const e=d(this,p(n.open,n.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:e}),e}};u.visible={get(){const e=d(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const h=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of h)u[t]={get(){const{level:n}=this;return function(...r){const s=p(e.color[o[n]][t](...r),e.color.close,this._styler);return d(this,s,this._isEmpty)}}};for(const t of h){u["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:n}=this;return function(...r){const s=p(e.bgColor[o[n]][t](...r),e.bgColor.close,this._styler);return d(this,s,this._isEmpty)}}}}const D=Object.defineProperties(()=>{},{...u,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),p=(e,t,n)=>{let r,s;return void 0===n?(r=e,s=t):(r=n.openAll+e,s=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:s,parent:n}},d=(e,t,n)=>{const r=(...e)=>i(e[0])&&i(e[0].raw)?f(r,g(r,...e)):f(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,D),r._generator=e,r._styler=t,r._isEmpty=n,r},f=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:i,closeAll:o}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=r(t,n.close,n.open),n=n.parent;const u=t.indexOf("\n");return-1!==u&&(t=s(t,o,i,u)),i+t+o};let m;const g=(e,...t)=>{const[n]=t;if(!i(n)||!i(n.raw))return t.join(" ");const r=t.slice(1),s=[n.raw[0]];for(let e=1;e<n.length;e++)s.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]));return void 0===m&&(m=function(){if(Va)return Ga;Va=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,s=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function i(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):s.get(e)||e}function o(e,t){const s=[],o=t.trim().split(/\s*,\s*/g);let u;for(const t of o){const o=Number(t);if(Number.isNaN(o)){if(!(u=t.match(n)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);s.push(u[2].replace(r,(e,t,n)=>t?i(t):n))}else s.push(o)}return s}function u(e){t.lastIndex=0;const n=[];let r;for(;null!==(r=t.exec(e));){const e=r[1];if(r[2]){const t=o(e,r[2]);n.push([e].concat(t))}else n.push([e])}return n}function a(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}return Ga=(t,n)=>{const r=[],s=[];let o=[];if(n.replace(e,(e,n,l,c,h,D)=>{if(n)o.push(i(n));else if(c){const e=o.join("");o=[],s.push(0===r.length?e:a(t,r)(e)),r.push({inverse:l,styles:u(c)})}else if(h){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");s.push(a(t,r)(o.join(""))),o=[],r.pop()}else o.push(D)}),s.push(o.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return s.join("")},Ga}()),m(e,s.join(""))};Object.defineProperties(c.prototype,u);const F=c();return F.supportsColor=t,F.stderr=c({level:n?n.level:0}),F.stderr.supportsColor=n,qa=F}(),el=d(Za);const tl=require("progress-estimator")({spinner:{interval:100,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(e=>el.gray(e))}}),nl={baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:6};async function rl(e){const t=Array.from(yt).map(e=>{const[t,n]=e;return{name:t,value:t,description:n.description}});e||(e=await Ft({message:"Please enter the project name."}));const s=n.resolve(process.cwd(),e);if(r.existsSync(s)){if(!await(i=e,console.warn(`${i} already exists. Do you want to overwrite it?`),Et({message:'if you want to overwrite it, please select "yes".',choices:[{name:"yes",value:!0},{name:"no",value:!1}]})))return;await r.rm(s,{recursive:!0,force:!0},t=>{t?console.error(t):console.log(`${e} has been deleted.`)})}var i;const o=await Et({message:"Please select the project template.",choices:t}),u=yt.get(o);u&&(async(e,t,n)=>{const r=za(nl);try{await tl(r.clone(e,t,n),`Scaffolding project in ${process.cwd()}`,{estimate:3e4}),console.log(el.green("Done.")),console.log(el.blackBright("===================================")),console.log(el.whiteBright("Now you can run:")),console.log(`cd ${el.blueBright(t)}`),console.log(`${el.yellow("npm")} install`)}catch(e){console.error(el.red("clone error"),e)}})(u.downloadUrl,e,["-b",u.branch]),console.log("create",e)}const sl=new G("codenest");sl.version("0.0.1","-v, --version"),sl.command("create").description("Create a new project").argument("[name]","<project-name>").action(async e=>{e?rl(e):console.log("Please specify the project name. For example: codenest create <project-name>")}),sl.parse();
|
|
1
|
+
"use strict";var e=require("node:events"),t=require("node:child_process"),r=require("node:path"),n=require("node:fs"),s=require("node:process"),o=require("node:buffer"),i=require("node:tty"),u=require("node:util"),a=require("node:os"),l=require("node:assert"),c=require("node:crypto"),h=require("node:readline"),p=require("node:async_hooks"),D=require("node:stream");function d(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var f=d(h),m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var F,b,C={},_={},y={};function E(){if(F)return y;F=1;class e extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}return y.CommanderError=e,y.InvalidArgumentError=class extends e{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}},y}function v(){if(b)return _;b=1;const{InvalidArgumentError:e}=E();return _.Argument=class{constructor(e,t){switch(this.description=t||"",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}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?(t.push(e),t):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},_.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"},_}var w,k={},O={};function x(){if(w)return O;w=1;const{humanReadableArgName:e}=v();function t(e){return e.replace(/\x1b\[\d*(;\d*)*m/g,"")}return O.Help=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){const t=e.commands.filter(e=>!e._hidden),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){const r=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){const t=e.options.filter(e=>!e.hidden),r=e._getHelpOption();if(r&&!r.hidden){const n=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);n||s?r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!n&&t.push(e.createOption(r.short,r.description)):t.push(r)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let r=e.parent;r;r=r.parent){const e=r.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description)?e.registeredArguments:[]}subcommandTerm(t){const r=t.registeredArguments.map(t=>e(t)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(r)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(r)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleOptionTerm(t.optionTerm(r)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,r)=>Math.max(e,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(r)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let t=e.parent;t;t=t.parent)r=t.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0){const r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return 0===t.length?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){const n=new Map;return e.forEach(e=>{const t=r(e);n.has(t)||n.set(t,[])}),t.forEach(e=>{const t=r(e);n.has(t)||n.set(t,[]),n.get(t).push(e)}),n}formatHelp(e,t){const r=t.padWidth(e,t),n=t.helpWidth??80;function s(e,n){return t.formatItem(e,r,n,t)}let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""];const i=t.commandDescription(e);i.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(i),n),""]));const u=t.visibleArguments(e).map(e=>s(t.styleArgumentTerm(t.argumentTerm(e)),t.styleArgumentDescription(t.argumentDescription(e))));o=o.concat(this.formatItemList("Arguments:",u,t));const a=this.groupItems(e.options,t.visibleOptions(e),e=>e.helpGroupHeading??"Options:");if(a.forEach((e,r)=>{const n=e.map(e=>s(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));o=o.concat(this.formatItemList(r,n,t))}),t.showGlobalOptions){const r=t.visibleGlobalOptions(e).map(e=>s(t.styleOptionTerm(t.optionTerm(e)),t.styleOptionDescription(t.optionDescription(e))));o=o.concat(this.formatItemList("Global Options:",r,t))}return this.groupItems(e.commands,t.visibleCommands(e),e=>e.helpGroup()||"Commands:").forEach((e,r)=>{const n=e.map(e=>s(t.styleSubcommandTerm(t.subcommandTerm(e)),t.styleSubcommandDescription(t.subcommandDescription(e))));o=o.concat(this.formatItemList(r,n,t))}),o.join("\n")}displayWidth(e){return t(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"[command]"===e?this.styleSubcommandText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleCommandText(e)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(e=>"[options]"===e?this.styleOptionText(e):"["===e[0]||"<"===e[0]?this.styleArgumentText(e):this.styleSubcommandText(e)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){const s=" ".repeat(2);if(!r)return s+e;const o=e.padEnd(t+e.length-n.displayWidth(e)),i=(this.helpWidth??80)-t-2-2;let u;if(i<this.minWidthToWrap||n.preformatted(r))u=r;else{u=n.boxWrap(r,i).replace(/\n/g,"\n"+" ".repeat(t+2))}return s+o+" ".repeat(2)+u.replace(/\n/g,`\n${s}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;const r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,s=[];return r.forEach(e=>{const r=e.match(n);if(null===r)return void s.push("");let o=[r.shift()],i=this.displayWidth(o[0]);r.forEach(e=>{const r=this.displayWidth(e);if(i+r<=t)return o.push(e),void(i+=r);s.push(o.join(""));const n=e.trimStart();o=[n],i=this.displayWidth(n)}),s.push(o.join(""))}),s.join("\n")}},O.stripColor=t,O}var B,A={};function T(){if(B)return A;B=1;const{InvalidArgumentError:e}=E();function t(e){return e.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}return A.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const r=function(e){let t,r;const n=/^-[^-]$/,s=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");n.test(o[0])&&(t=o.shift());s.test(o[0])&&(r=o.shift());!t&&n.test(o[0])&&(t=o.shift());!t&&s.test(o[0])&&(t=r,r=o.shift());if(o[0].startsWith("-")){const t=o[0],r=`option creation failed due to '${t}' in option flags '${e}'`;if(/^-[^-][^-]/.test(t))throw new Error(`${r}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(n.test(t))throw new Error(`${r}\n- too many short flags`);if(s.test(t))throw new Error(`${r}\n- too many long flags`);throw new Error(`${r}\n- unrecognised flag format`)}if(void 0===t&&void 0===r)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}(e);this.short=r.shortFlag,this.long=r.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,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),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}_collectValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?(t.push(e),t):[e]}choices(t){return this.argChoices=t.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new e(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?t(this.name().replace(/^no-/,"")):t(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},A.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){const r=t.attributeName();if(!this.dualOptions.has(r))return!0;const n=this.negativeOptions.get(r).presetArg,s=void 0!==n&&n;return t.negate===(s===e)}},A}var S,M,R,$={};function j(){if(S)return $;S=1;return $.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let n=[],s=3;return t.forEach(t=>{if(t.length<=1)return;const r=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const r=[];for(let t=0;t<=e.length;t++)r[t]=[t];for(let e=0;e<=t.length;e++)r[0][e]=e;for(let n=1;n<=t.length;n++)for(let s=1;s<=e.length;s++){let o=1;o=e[s-1]===t[n-1]?0:1,r[s][n]=Math.min(r[s-1][n]+1,r[s][n-1]+1,r[s-1][n-1]+o),s>1&&n>1&&e[s-1]===t[n-2]&&e[s-2]===t[n-1]&&(r[s][n]=Math.min(r[s][n],r[s-2][n-2]+1))}return r[e.length][t.length]}(e,t),o=Math.max(e.length,t.length);(o-r)/o>.4&&(r<s?(s=r,n=[t]):r===s&&n.push(t))}),n.sort((e,t)=>e.localeCompare(t)),r&&(n=n.map(e=>`--${e}`)),n.length>1?`\n(Did you mean one of ${n.join(", ")}?)`:1===n.length?`\n(Did you mean ${n[0]}?)`:""},$}var P=function(){if(R)return C;R=1;const{Argument:o}=v(),{Command:i}=function(){if(M)return k;M=1;const o=e.EventEmitter,i=t,u=r,a=n,l=s,{Argument:c,humanReadableArgName:h}=v(),{CommanderError:p}=E(),{Help:D,stripColor:d}=x(),{Option:f,DualOptions:m}=T(),{suggestSimilar:g}=j();class F extends o{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,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._savedState=null,this._outputConfiguration={writeOut:e=>l.stdout.write(e),writeErr:e=>l.stderr.write(e),outputError:(e,t)=>t(e),getOutHelpWidth:()=>l.stdout.isTTY?l.stdout.columns:void 0,getErrHelpWidth:()=>l.stderr.isTTY?l.stderr.columns:void 0,getOutHasColors:()=>C()??(l.stdout.isTTY&&l.stdout.hasColors?.()),getErrHasColors:()=>C()??(l.stderr.isTTY&&l.stderr.hasColors?.()),stripColor:e=>d(e)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,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(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,s=r;"object"==typeof n&&null!==n&&(s=n,n=null),s=s||{};const[,o,i]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(o);return n&&(u.description(n),u._executableHandler=!0),s.isDefault&&(this._defaultCommandName=u._name),u._hidden=!(!s.noHelp&&!s.hidden),u._executableFile=s.executableFile||null,i&&u.arguments(i),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n?this:u}createCommand(e){return new F(e)}createHelp(){return Object.assign(new D,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new c(e,t)}argument(e,t,r,n){const s=this.createArgument(e,t);return"function"==typeof r?s.default(n).argParser(r):s.default(r),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(e=>{this.argument(e)}),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if("boolean"==typeof e)return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;const r=e??"help [command]",[,n,s]=r.match(/([^ ]+) *(.*)/),o=t??"display help for command",i=this.createCommand(n);return i.helpOption(!1),s&&i.arguments(s),o&&i.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=i,(e||t)&&this._initCommandGroup(i),this}addHelpCommand(e,t){return"object"!=typeof e?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(void 0===this._helpCommand&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){const r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new p(e,t,r)),l.exit(e)}action(e){return this._actionHandler=t=>{const r=this.registeredArguments.length,n=t.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),e.apply(this,n)},this}createOption(e,t){return new f(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(e){if("commander.invalidArgument"===e.code){const t=`${n} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}_registerOption(e){const t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){const r=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'\n- already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){const t=e=>[e.name()].concat(e.aliases()),r=t(e).find(e=>this._findCommand(e));if(r){const n=t(this._findCommand(r)).join("|"),s=t(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);const t=e.name(),r=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(r,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(r,e.defaultValue,"default");const n=(t,n,s)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const o=this.getOptionValue(r);null!==t&&e.parseArg?t=this._callParseArg(e,t,o,n):null!==t&&e.variadic&&(t=e._collectValue(t,o)),null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(r,t,s)};return this.on("option:"+t,t=>{const r=`error: option '${e.flags}' argument '${t}' is invalid.`;n(t,r,"cli")}),e.envVar&&this.on("optionEnv:"+t,t=>{const r=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;n(t,r,"env")}),this}_optionEx(e,t,r,n,s){if("object"==typeof t&&t instanceof f)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const o=this.createOption(t,r);if(o.makeOptionMandatory(!!e.mandatory),"function"==typeof n)o.default(s).argParser(n);else if(n instanceof RegExp){const e=n;n=(t,r)=>{const n=e.exec(t);return n?n[0]:r},o.default(s).argParser(n)}else o.default(n);return this.addOption(o)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,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){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach(r=>{void 0!==r.getOptionValueSource(e)&&(t=r.getOptionValueSource(e))}),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(t=t||{},void 0===e&&void 0===t.from){l.versions?.electron&&(t.from="electron");const e=l.execArgv??[];(e.includes("-e")||e.includes("--eval")||e.includes("-p")||e.includes("--print"))&&(t.from="eval")}let r;switch(void 0===e&&(e=l.argv),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":l.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){this._prepareForParse();const r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();const r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){null===this._savedState?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error("Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties");this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(!a.existsSync(e))throw new Error(`'${e}' does not exist\n - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`)}_executeSubCommand(e,t){t=t.slice();let r=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function s(e,t){const r=u.resolve(e,t);if(a.existsSync(r))return r;if(n.includes(u.extname(t)))return;const s=n.find(e=>a.existsSync(`${r}${e}`));return s?`${r}${s}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o,c=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch{e=this._scriptPath}h=u.resolve(u.dirname(e),h)}if(h){let t=s(h,c);if(!t&&!e._executableFile&&this._scriptPath){const r=u.basename(this._scriptPath,u.extname(this._scriptPath));r!==this._name&&(t=s(h,`${r}-${e._name}`))}c=t||c}r=n.includes(u.extname(c)),"win32"!==l.platform?r?(t.unshift(c),t=b(l.execArgv).concat(t),o=i.spawn(l.argv[0],t,{stdio:"inherit"})):o=i.spawn(c,t,{stdio:"inherit"}):(this._checkForMissingExecutable(c,h,e._name),t.unshift(c),t=b(l.execArgv).concat(t),o=i.spawn(l.execPath,t,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(e=>{l.on(e,()=>{!1===o.killed&&null===o.exitCode&&o.kill(e)})});const D=this._exitCallback;o.on("close",e=>{e=e??1,D?D(new p(e,"commander.executeSubCommandAsync","(close)")):l.exit(e)}),o.on("error",t=>{if("ENOENT"===t.code)this._checkForMissingExecutable(c,h,e._name);else if("EACCES"===t.code)throw new Error(`'${c}' not executable`);if(D){const e=new p(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,D(e)}else l.exit(1)}),this.runningCommand=o}_dispatchSubcommand(e,t,r){const n=this._findCommand(e);let s;return n||this.help({error:!0}),n._prepareForParse(),s=this._chainOrCallSubCommandHook(s,n,"preSubcommand"),s=this._chainOrCall(s,()=>{if(!n._executableHandler)return n._parseCommand(t,r);this._executeSubCommand(n,t.concat(r))}),s}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,t)=>{e.required&&null==this.args[t]&&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(){const e=(e,t,r)=>{let n=t;if(null!==t&&e.parseArg){const s=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;n=this._callParseArg(e,t,r,s)}return n};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach((r,n)=>{let s=r.defaultValue;r.variadic?n<this.args.length?(s=this.args.slice(n),r.parseArg&&(s=s.reduce((t,n)=>e(r,n,t),r.defaultValue))):void 0===s&&(s=[]):n<this.args.length&&(s=this.args[n],r.parseArg&&(s=e(r,s,r.defaultValue))),t[n]=s}),this.processedArgs=t}_chainOrCall(e,t){return e?.then&&"function"==typeof e.then?e.then(()=>t()):t()}_chainOrCallHooks(e,t){let r=e;const n=[];return this._getCommandAndAncestors().reverse().filter(e=>void 0!==e._lifeCycleHooks[t]).forEach(e=>{e._lifeCycleHooks[t].forEach(t=>{n.push({hookedCommand:e,callback:t})})}),"postAction"===t&&n.reverse(),n.forEach(e=>{r=this._chainOrCall(r,()=>e.callback(e.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;return void 0!==this._lifeCycleHooks[r]&&this._lifeCycleHooks[r].forEach(e=>{n=this._chainOrCall(n,()=>e(this,t))}),n}_parseCommand(e,t){const r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},s=`command:${this.name()}`;if(this._actionHandler){let r;return n(),this._processArguments(),r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,()=>this._actionHandler(this.processedArgs)),this.parent&&(r=this._chainOrCall(r,()=>{this.parent.emit(s,e,t)})),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent?.listenerCount(s))n(),this._processArguments(),this.parent.emit(s,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):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(t=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find(t=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){const e=this.options.filter(e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)}),t=e.filter(e=>e.conflictsWith.length>0);t.forEach(t=>{const r=e.find(e=>t.conflictsWith.includes(e.attributeName()));r&&this._conflictingOption(t,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){const t=[],r=[];let n=t;function s(e){return e.length>1&&"-"===e[0]}const o=e=>!!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(e)&&!this._getCommandAndAncestors().some(e=>e.options.map(e=>e.short).some(e=>/^-\d$/.test(e)));let i=null,u=null,a=0;for(;a<e.length||u;){const l=u??e[a++];if(u=null,"--"===l){n===r&&n.push(l),n.push(...e.slice(a));break}if(!i||s(l)&&!o(l)){if(i=null,s(l)){const t=this._findOption(l);if(t){if(t.required){const r=e[a++];void 0===r&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,r)}else if(t.optional){let r=null;a<e.length&&(!s(e[a])||o(e[a]))&&(r=e[a++]),this.emit(`option:${t.name()}`,r)}else this.emit(`option:${t.name()}`);i=t.variadic?t:null;continue}}if(l.length>2&&"-"===l[0]&&"-"!==l[1]){const e=this._findOption(`-${l[1]}`);if(e){e.required||e.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${e.name()}`,l.slice(2)):(this.emit(`option:${e.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){const e=l.indexOf("="),t=this._findOption(l.slice(0,e));if(t&&(t.required||t.optional)){this.emit(`option:${t.name()}`,l.slice(e+1));continue}}if(n!==t||!s(l)||0===this.commands.length&&o(l)||(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===r.length){if(this._findCommand(l)){t.push(l),r.push(...e.slice(a));break}if(this._getHelpCommand()&&l===this._getHelpCommand().name()){t.push(l,...e.slice(a));break}if(this._defaultCommandName){r.push(l,...e.slice(a));break}}if(this._passThroughOptions){n.push(l,...e.slice(a));break}n.push(l)}else this.emit(`option:${i.name()}`,l)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let r=0;r<t;r++){const t=this.options[r].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const r=t||{},n=r.exitCode||1,s=r.code||"commander.error";this._exit(n,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in l.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,l.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){const e=new m(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter(r=>void 0!==r.implied&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(e=>{Object.keys(e.implied).filter(e=>!t(e)).forEach(t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")})})}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const r=e=>{const t=e.attributeName(),r=this.getOptionValue(t),n=this.options.find(e=>e.negate&&t===e.attributeName()),s=this.options.find(e=>!e.negate&&t===e.attributeName());return n&&(void 0===n.presetArg&&!1===r||void 0!==n.presetArg&&r===n.presetArg)?n:s||e},n=e=>{const t=r(e),n=t.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},s=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{const e=n.createHelp().visibleOptions(n).filter(e=>e.long).map(e=>e.long);r=r.concat(e),n=n.parent}while(n&&!n._enablePositionalOptions);t=g(e,r)}const r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,r=1===t?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const r=[];this.createHelp().visibleCommands(this).forEach(e=>{r.push(e.name()),e.alias()&&r.push(e.alias())}),t=g(e,r)}const r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";const n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)}),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");const r=this.parent?._findCommand(e);if(r){const t=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${t}'`)}return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach(e=>this.alias(e)),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map(e=>h(e));return[].concat(this.options.length||null!==this._helpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}helpGroup(e){return void 0===e?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return void 0===e?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return void 0===e?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=u.basename(e,u.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});const n=t.formatHelp(this,t);return r.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){const t=!!(e=e||{}).error;let r,n,s;return t?(r=e=>this._outputConfiguration.writeErr(e),n=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(r=e=>this._outputConfiguration.writeOut(e),n=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:e=>(n||(e=this._outputConfiguration.stripColor(e)),r(e)),hasColors:n,helpWidth:s}}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(e=>e.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let s=this.helpInformation({error:r.error});if(t&&(s=t(s),"string"!=typeof s&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(e=>e.emit("afterAllHelp",n))}helpOption(e,t){return"boolean"==typeof e?(e?(null===this._helpOption&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return void 0===this._helpOption&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(l.exitCode??0);0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${r.join("', '")}'`);const n=`${e}Help`;return this.on(n,e=>{let r;r="function"==typeof t?t({error:e.error,command:e.command}):t,r&&e.write(`${r}\n`)}),this}_outputHelpIfRequested(e){const t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function b(e){return e.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r,n="127.0.0.1",s="9229";return null!==(r=e.match(/^(--inspect(-brk)?)$/))?t=r[1]:null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=r[1],/^\d+$/.test(r[3])?s=r[3]:n=r[3]):null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=r[1],n=r[3],s=r[4]),t&&"0"!==s?`${t}=${n}:${parseInt(s)+1}`:e})}function C(){return!l.env.NO_COLOR&&"0"!==l.env.FORCE_COLOR&&"false"!==l.env.FORCE_COLOR&&(!(!l.env.FORCE_COLOR&&void 0===l.env.CLICOLOR_FORCE)||void 0)}return k.Command=F,k.useColor=C,k}(),{CommanderError:u,InvalidArgumentError:a}=E(),{Help:l}=x(),{Option:c}=T();return C.program=new i,C.createCommand=e=>new i(e),C.createOption=(e,t)=>new c(e,t),C.createArgument=(e,t)=>new o(e,t),C.Command=i,C.Option=c,C.Argument=o,C.Help=l,C.CommanderError=u,C.InvalidArgumentError=a,C.InvalidOptionArgumentError=a,C}(),I=g(P);const{program:L,createCommand:U,createArgument:N,createOption:G,CommanderError:H,InvalidArgumentError:V,InvalidOptionArgumentError:q,Command:W,Argument:z,Option:Y,Help:K}=I;const J=(e,t=[])=>"up"===e.name||t.includes("vim")&&"k"===e.name||t.includes("emacs")&&e.ctrl&&"p"===e.name,Q=(e,t=[])=>"down"===e.name||t.includes("vim")&&"j"===e.name||t.includes("emacs")&&e.ctrl&&"n"===e.name,Z=e=>"backspace"===e.name,X=e=>"enter"===e.name||"return"===e.name;class ee extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}}class te extends Error{name="CancelPromptError";message="Prompt was canceled"}class re extends Error{name="ExitPromptError"}class ne extends Error{name="HookError"}class se extends Error{name="ValidationError"}const oe=new p.AsyncLocalStorage;function ie(){const e=oe.getStore();if(!e)throw new ne("[Inquirer] Hook functions can only be called from within a prompt");return e}function ue(){return ie().rl}function ae(e){return p.AsyncResource.bind((...t)=>{const r=ie();let n=!1;const s=r.handleChange;r.handleChange=()=>{n=!0};const o=e(...t);return n&&s(),r.handleChange=s,o})}function le(e){const t=ie(),{index:r}=t,n=e({get:()=>t.hooks[r],set(e){t.hooks[r]=e},initialized:r in t.hooks});return t.index++,n}const ce={queue(e){const t=ie(),{index:r}=t;t.hooksEffect.push(()=>{t.hooksCleanup[r]?.();const n=e(ue());if(null!=n&&"function"!=typeof n)throw new se("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[r]=n})},run(){const e=ie();ae(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){const e=ie();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function he(e){return le(t=>{const r=p.AsyncResource.bind(function(e){t.get()!==e&&(t.set(e),ie().handleChange())});if(t.initialized)return[t.get(),r];const n="function"==typeof e?e():e;return t.set(n),[n,r]})}function pe(e,t){le(r=>{const n=r.get();(!Array.isArray(n)||t.some((e,t)=>!Object.is(e,n[t])))&&ce.queue(e),r.set(t)})}const De={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},de={...De,tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},fe={...De,tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},me=("win32"!==s.platform?"linux"!==s.env.TERM:Boolean(s.env.WT_SESSION)||Boolean(s.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===s.env.ConEmuTask||"Terminus-Sublime"===s.env.TERM_PROGRAM||"vscode"===s.env.TERM_PROGRAM||"xterm-256color"===s.env.TERM||"alacritty"===s.env.TERM||"JetBrains-JediTerm"===s.env.TERMINAL_EMULATOR)?de:fe,ge={prefix:{idle:u.styleText("blue","?"),done:u.styleText("green",me.tick)},spinner:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(e=>u.styleText("yellow",e))},style:{answer:e=>u.styleText("cyan",e),message:e=>u.styleText("bold",e),error:e=>u.styleText("red",`> ${e}`),defaultAnswer:e=>u.styleText("dim",`(${e})`),help:e=>u.styleText("dim",e),highlight:e=>u.styleText("cyan",e),key:e=>u.styleText("cyan",u.styleText("bold",`<${e}>`))}};function Fe(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function be(...e){const t={};for(const r of e)for(const[e,n]of Object.entries(r)){const r=t[e];t[e]=Fe(r)&&Fe(n)?be(r,n):n}return t}function Ce(...e){return be(...[ge,...e.filter(e=>null!=e)])}function _e({status:e="idle",theme:t}){const[r,n]=he(!1),[s,o]=he(0),{prefix:i,spinner:u}=Ce(t);if(pe(()=>{if("loading"===e){let e,t=-1;const r=setTimeout(()=>{n(!0),e=setInterval(()=>{t+=1,o(t%u.frames.length)},u.interval)},300);return()=>{clearTimeout(r),clearInterval(e)}}n(!1)},[e]),r)return u.frames[s];return"string"==typeof i?i:i["loading"===e?"idle":e]??i.idle}function ye(e,t){return le(r=>{const n=r.get();if(!n||n.dependencies.length!==t.length||n.dependencies.some((e,r)=>e!==t[r])){const n=e();return r.set({value:n,dependencies:t}),n}return n.value})}function Ee(e){return he({current:e})[0]}function ve(e){const t=Ee(e);t.current=e,pe(e=>{let r=!1;const n=ae((n,s)=>{r||t.current(s,e)});return e.input.on("keypress",n),()=>{r=!0,e.input.removeListener("keypress",n)}},[])}var we,ke;var Oe=g(ke?we:(ke=1,we=function(e){const t=function(e){const t={defaultWidth:0,output:process.stdout,tty:i};return e?(Object.keys(t).forEach(function(r){e[r]||(e[r]=t[r])}),e):t}(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){const e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&0!==e)return e}return t.defaultWidth}));const xe=function({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function Be(e){if("string"!=typeof e)throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(xe,"")}function Ae(e,{ambiguousAsWide:t=!1}={}){return function(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}(e),12288===(r=e)||r>=65281&&r<=65376||r>=65504&&r<=65510||function(e){return e>=4352&&e<=4447||8986===e||8987===e||9001===e||9002===e||e>=9193&&e<=9196||9200===e||9203===e||9725===e||9726===e||9748===e||9749===e||e>=9776&&e<=9783||e>=9800&&e<=9811||9855===e||e>=9866&&e<=9871||9875===e||9889===e||9898===e||9899===e||9917===e||9918===e||9924===e||9925===e||9934===e||9940===e||9962===e||9970===e||9971===e||9973===e||9978===e||9981===e||9989===e||9994===e||9995===e||10024===e||10060===e||10062===e||e>=10067&&e<=10069||10071===e||e>=10133&&e<=10135||10160===e||10175===e||11035===e||11036===e||11088===e||11093===e||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||110589===e||110590===e||e>=110592&&e<=110882||110898===e||e>=110928&&e<=110930||110933===e||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||126980===e||127183===e||127374===e||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||127568===e||127569===e||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||127988===e||e>=127992&&e<=128062||128064===e||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||128378===e||128405===e||128406===e||128420===e||e>=128507&&e<=128591||e>=128640&&e<=128709||128716===e||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||128747===e||128748===e||e>=128756&&e<=128764||e>=128992&&e<=129003||129008===e||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||129736===e||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}(e)||t&&function(e){return 161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}(e)?2:1;var r}var Te=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;const Se=new Intl.Segmenter,Me=/^\p{Default_Ignorable_Code_Point}$/u;function Re(e,t={}){if("string"!=typeof e||0===e.length)return 0;const{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=Be(e)),0===e.length)return 0;let s=0;const o={ambiguousAsWide:!r};for(const{segment:t}of Se.segment(e)){const e=t.codePointAt(0);e<=31||e>=127&&e<=159||(e>=8203&&e<=8207||65279===e||e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=55296&&e<=57343||e>=65024&&e<=65039||Me.test(t)||(Te().test(t)?s+=2:s+=Ae(e,o)))}return s}const $e=(e=0)=>t=>`[${t+e}m`,je=(e=0)=>t=>`[${38+e};5;${t}m`,Pe=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`,Ie={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ie.modifier);Object.keys(Ie.color),Object.keys(Ie.bgColor);const Le=function(){const e=new Map;for(const[t,r]of Object.entries(Ie)){for(const[t,n]of Object.entries(r))Ie[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=Ie[t],e.set(n[0],n[1]);Object.defineProperty(Ie,t,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:e,enumerable:!1}),Ie.color.close="[39m",Ie.bgColor.close="[49m",Ie.color.ansi=$e(),Ie.color.ansi256=je(),Ie.color.ansi16m=Pe(),Ie.bgColor.ansi=$e(10),Ie.bgColor.ansi256=je(10),Ie.bgColor.ansi16m=Pe(10),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,n;if(e>=232)t=(10*(e-232)+8)/255,r=t,n=t;else{const s=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(s/6)/5,n=s%6/5}const s=2*Math.max(t,r,n);if(0===s)return 30;let o=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return 2===s&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}(),Ue=new Set(["",""]),Ne="]8;;",Ge=e=>`${Ue.values().next().value}[${e}m`,He=e=>`${Ue.values().next().value}${Ne}${e}`,Ve=(e,t,r)=>{const n=[...t];let s=!1,o=!1,i=Re(Be(e.at(-1)));for(const[t,u]of n.entries()){const a=Re(u);if(i+a<=r?e[e.length-1]+=u:(e.push(u),i=0),Ue.has(u)){s=!0;o=n.slice(t+1,t+1+4).join("")===Ne}s?o?""===u&&(s=!1,o=!1):"m"===u&&(s=!1):(i+=a,i===r&&t<n.length-1&&(e.push(""),i=0))}!i&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},qe=(e,t,r={})=>{if(!1!==r.trim&&""===e.trim())return"";let n,s,o="";const i=(e=>e.split(" ").map(e=>Re(e)))(e);let u=[""];for(const[n,s]of e.split(" ").entries()){!1!==r.trim&&(u[u.length-1]=u.at(-1).trimStart());let e=Re(u.at(-1));if(0!==n&&(e>=t&&(!1===r.wordWrap||!1===r.trim)&&(u.push(""),e=0),(e>0||!1===r.trim)&&(u[u.length-1]+=" ",e++)),r.hard&&i[n]>t){const r=t-e,o=1+Math.floor((i[n]-r-1)/t);Math.floor((i[n]-1)/t)<o&&u.push(""),Ve(u,s,t);continue}if(e+i[n]>t&&e>0&&i[n]>0){if(!1===r.wordWrap&&e<t){Ve(u,s,t);continue}u.push("")}e+i[n]>t&&!1===r.wordWrap?Ve(u,s,t):u[u.length-1]+=s}!1!==r.trim&&(u=u.map(e=>(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&!(Re(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")})(e)));const a=u.join("\n"),l=[...a];let c=0;for(const[e,t]of l.entries()){if(o+=t,Ue.has(t)){const{groups:e}=new RegExp(`(?:\\[(?<code>\\d+)m|\\${Ne}(?<uri>.*))`).exec(a.slice(c))||{groups:{}};if(void 0!==e.code){const t=Number.parseFloat(e.code);n=39===t?void 0:t}else void 0!==e.uri&&(s=0===e.uri.length?void 0:e.uri)}const r=Le.codes.get(Number(n));"\n"===l[e+1]?(s&&(o+=He("")),n&&r&&(o+=Ge(r))):"\n"===t&&(n&&r&&(o+=Ge(n)),s&&(o+=He(s))),c+=t.length}return o};function We(e,t){return e.split("\n").flatMap(e=>{return(r=e,n=t,s={trim:!1,hard:!0},String(r).normalize().replaceAll("\r\n","\n").split("\n").map(e=>qe(e,n,s)).join("\n")).split("\n").map(e=>e.trimEnd());var r,n,s}).join("\n")}function ze(){return Oe({defaultWidth:80,output:ue().output})}function Ye({items:e,active:t,renderItem:r,pageSize:n,loop:s=!0}){const o=ze(),i=t=>(t%e.length+e.length)%e.length,u=e.map((e,n)=>null==e?[]:We(r({item:e,index:n,isActive:n===t}),o).split("\n")),a=u.reduce((e,t)=>e+t.length,0),l=e=>u[e]??[],c=function({active:e,renderedItems:t,pageSize:r,loop:n}){const s=Ee({lastPointer:e,lastActive:void 0}),{lastPointer:o,lastActive:i}=s.current,u=Math.floor(r/2),a=t.reduce((e,t)=>e+t.length,0),l=t.slice(0,e).reduce((e,t)=>e+t.length,0);let c=l;if(a>r)if(n)c=o,null!=i&&i<e&&e-i<r&&(c=Math.min(u,1===Math.abs(e-i)?Math.min(o+(t[i]?.length??0),Math.max(l,o)):o+e-i));else{const n=t.slice(e).reduce((e,t)=>e+t.length,0);c=n<r-u?r-n:Math.min(l,u)}return s.current.lastPointer=c,s.current.lastActive=e,c}({active:t,renderedItems:u,pageSize:n,loop:s}),h=l(t).slice(0,n),p=c+h.length<=n?c:n-h.length,D=Array.from({length:n});D.splice(p,h.length,...h);const d=new Set([t]);let f=p+h.length,m=i(t+1);for(;f<n&&!d.has(m)&&(s&&a>n?m!==t:m>t);){const e=l(m).slice(0,n-f);D.splice(f,e.length,...e),d.add(m),f+=e.length,m=i(m+1)}for(f=p-1,m=i(t-1);f>=0&&!d.has(m)&&(s&&a>n?m!==t:m<t);){const e=l(m),t=e.slice(Math.max(0,e.length-f-1));D.splice(f-t.length+1,t.length,...t),d.add(m),f-=t.length,m=i(m-1)}return D.filter(e=>"string"==typeof e).join("\n")}var Ke,Je;var Qe=function(){if(Je)return Ke;Je=1;const e=D;return Ke=class extends e{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#r(e,...t){"function"==typeof this._dest?.[e]&&this._dest[e](...t),"function"==typeof this._src?.[e]&&this._src[e](...t)}get isTTY(){return null!==this.#e?this.#e:this.#t("isTTY",!1)}set isTTY(e){this.#e=e}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return 0===e.indexOf(this._prompt)&&(e=(e=e.slice(this._prompt.length)).replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&0===e.indexOf(this._prompt)&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e=e&&this.replace?e.toString().replace(/./g,this.replace):null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#r("destroy",...e)}destroySoon(...e){return this.#r("destroySoon",...e)}close(...e){return this.#r("close",...e)}},Ke}(),Ze=g(Qe);const Xe=[];Xe.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&Xe.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&Xe.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const et=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,tt=Symbol.for("signal-exit emitter"),rt=globalThis,nt=Object.defineProperty.bind(Object);class st{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(rt[tt])return rt[tt];nt(rt,tt,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e],n=r.indexOf(t);-1!==n&&(0===n&&1===r.length?r.length=0:r.splice(n,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let n=!1;for(const s of this.listeners[e])n=!0===s(t,r)||n;return"exit"===e&&(n=this.emit("afterExit",t,r)||n),n}}class ot{}const it=globalThis.process,{onExit:ut}=(at=et(it)?new class extends ot{#n="win32"===it.platform?"SIGINT":"SIGHUP";#s=new st;#o;#i;#u;#a={};#l=!1;constructor(e){super(),this.#o=e,this.#a={};for(const t of Xe)this.#a[t]=()=>{const r=this.#o.listeners(t);let{count:n}=this.#s;const s=e;if("object"==typeof s.__signal_exit_emitter__&&"number"==typeof s.__signal_exit_emitter__.count&&(n+=s.__signal_exit_emitter__.count),r.length===n){this.unload();const r=this.#s.emit("exit",null,t),n="SIGHUP"===t?this.#n:t;r||e.kill(e.pid,n)}};this.#u=e.reallyExit,this.#i=e.emit}onExit(e,t){if(!et(this.#o))return()=>{};!1===this.#l&&this.load();const r=t?.alwaysLast?"afterExit":"exit";return this.#s.on(r,e),()=>{this.#s.removeListener(r,e),0===this.#s.listeners.exit.length&&0===this.#s.listeners.afterExit.length&&this.unload()}}load(){if(!this.#l){this.#l=!0,this.#s.count+=1;for(const e of Xe)try{const t=this.#a[e];t&&this.#o.on(e,t)}catch(e){}this.#o.emit=(e,...t)=>this.#c(e,...t),this.#o.reallyExit=e=>this.#h(e)}}unload(){this.#l&&(this.#l=!1,Xe.forEach(e=>{const t=this.#a[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#o.removeListener(e,t)}catch(e){}}),this.#o.emit=this.#i,this.#o.reallyExit=this.#u,this.#s.count-=1)}#h(e){return et(this.#o)?(this.#o.exitCode=e||0,this.#s.emit("exit",this.#o.exitCode,null),this.#u.call(this.#o,this.#o.exitCode)):0}#c(e,...t){const r=this.#i;if("exit"===e&&et(this.#o)){"number"==typeof t[0]&&(this.#o.exitCode=t[0]);const n=r.call(this.#o,e,...t);return this.#s.emit("exit",this.#o.exitCode,null),n}return r.call(this.#o,e,...t)}}(it):new class extends ot{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>at.onExit(e,t),load:()=>at.load(),unload:()=>at.unload()});var at;const lt="[",ct=(e=1)=>e>0?`${lt}${e}A`:"",ht=(e=1)=>e>0?`${lt}${e}B`:"",pt=(e,t)=>`${lt}${e+1}G`,Dt="[2K",dt=e=>e>0?(Dt+ct(1)).repeat(e-1)+Dt+"[G":"",ft=e=>e.split("\n").length;class mt{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,t=""){const r=(e=>e.split("\n").pop()??"")(e),n=u.stripVTControlCharacters(r);let s=n;this.rl.line.length>0&&(s=s.slice(0,-this.rl.line.length)),this.rl.setPrompt(s),this.cursorPos=this.rl.getCursorPos();const o=ze();e=We(e,o),t=We(t,o),n.length%o===0&&(e+="\n");let i=e+(t?"\n"+t:"");const a=Math.floor(n.length/o)-this.cursorPos.rows+(t?ft(t):0);a>0&&(i+=ct(a)),i+=pt(this.cursorPos.cols),this.write(ht(this.extraLinesUnderPrompt)+dt(this.height)+i),this.extraLinesUnderPrompt=a,this.height=ft(i)}checkCursorPos(){const e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(pt(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let t=ht(this.extraLinesUnderPrompt);t+=e?dt(this.height):"\n",t+="[?25h",this.write(t),this.rl.close()}}class gt extends Promise{static withResolver(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}}}function Ft(e){const t=function(){const e=Error.prepareStackTrace;let t=[];try{Error.prepareStackTrace=(e,r)=>{const n=r.slice(1);return t=n,n},(new Error).stack}catch{return t}return Error.prepareStackTrace=e,t}();return(r,n={})=>{const{input:s=process.stdin,signal:o}=n,i=new Set,u=new Ze;u.pipe(n.output??process.stdout);const a=f.createInterface({terminal:!0,input:s,output:u}),l=new mt(a),{promise:c,resolve:h,reject:D}=gt.withResolver(),d=()=>D(new te);if(o){const e=()=>D(new ee({cause:o.reason}));if(o.aborted)return e(),Object.assign(c,{cancel:d});o.addEventListener("abort",e),i.add(()=>o.removeEventListener("abort",e))}i.add(ut((e,t)=>{D(new re(`User force closed the prompt with ${e} ${t}`))}));const m=()=>D(new re("User force closed the prompt with SIGINT"));a.on("SIGINT",m),i.add(()=>a.removeListener("SIGINT",m));const g=()=>l.checkCursorPos();return a.input.on("keypress",g),i.add(()=>a.input.removeListener("keypress",g)),function(e,t){const r=function(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}(e);return oe.run(r,()=>t(function(e){r.handleChange=()=>{r.index=0,e()},r.handleChange()}))}(a,s=>{const o=p.AsyncResource.bind(()=>ce.clearAll());return a.on("close",o),i.add(()=>a.removeListener("close",o)),s(()=>{try{const n=e(r,e=>{setImmediate(()=>h(e))});if(void 0===n){const e=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.\n at ${e}`)}const[s,o]="string"==typeof n?[n]:n;l.render(s,o),ce.run()}catch(e){D(e)}}),Object.assign(c.then(e=>(ce.clearAll(),e),e=>{throw ce.clearAll(),e}).finally(()=>{i.forEach(e=>e()),l.done({clearContent:Boolean(n.clearPromptOnDone)}),u.end()}).then(()=>c),{cancel:d})})}}class bt{separator=u.styleText("dim",Array.from({length:15}).join(me.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return Boolean(e&&"object"==typeof e&&"type"in e&&"separator"===e.type)}}const Ct={validationFailureMode:"keep"};var _t=Ft((e,t)=>{const{prefill:r="tab"}=e,n=Ce(Ct,e.theme),[s,o]=he("idle"),[i="",u]=he(e.default),[a,l]=he(),[c,h]=he(""),p=_e({status:s,theme:n});ve(async(r,a)=>{if("idle"===s)if(X(r)){const r=c||i;o("loading");const s=await async function(t){const{required:r,pattern:n,patternError:s="Invalid input"}=e;return r&&!t?"You must provide a value":n&&!n.test(t)?s:"function"!=typeof e.validate||await e.validate(t)||"You must provide a valid value"}(r);!0===s?(h(r),o("done"),t(r)):("clear"===n.validationFailureMode?h(""):a.write(c),l(s),o("idle"))}else Z(r)&&!c?u(void 0):(e=>"tab"===e.name)(r)&&!c?(u(void 0),a.clearLine(0),a.write(i),h(i)):(h(a.line),l(void 0))}),pe(e=>{"editable"===r&&i&&(e.write(i),h(i))},[]);const D=n.style.message(e.message,s);let d,f=c;"function"==typeof e.transformer?f=e.transformer(c,{isFinal:"done"===s}):"done"===s&&(f=n.style.answer(c)),i&&"done"!==s&&!c&&(d=n.style.defaultAnswer(i));let m="";return a&&(m=n.style.error(a)),[[p,D,d,f].filter(e=>void 0!==e).join(" "),m]});const yt={icon:{cursor:me.pointer},style:{disabled:e=>u.styleText("dim",`- ${e}`),description:e=>u.styleText("cyan",e),keysHelpTip:e=>e.map(([e,t])=>`${u.styleText("bold",e)} ${u.styleText("dim",t)}`).join(u.styleText("dim"," • "))},indexMode:"hidden",keybindings:[]};function Et(e){return!bt.isSeparator(e)&&!e.disabled}var vt=Ft((e,t)=>{const{loop:r=!0,pageSize:n=7}=e,s=Ce(yt,e.theme),{keybindings:o}=s,[i,u]=he("idle"),a=_e({status:i,theme:s}),l=Ee(),c=!o.includes("vim"),h=ye(()=>e.choices.map(e=>{if(bt.isSeparator(e))return e;if("object"!=typeof e||null===e||!("value"in e)){const t=String(e);return{value:e,name:t,short:t,disabled:!1}}const t=e.name??String(e.value),r={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(r.description=e.description),r}),[e.choices]),p=ye(()=>{const e=h.findIndex(Et),t=h.findLastIndex(Et);if(-1===e)throw new se("[select prompt] No selectable choices. All choices are disabled.");return{first:e,last:t}},[h]),D=ye(()=>"default"in e?h.findIndex(t=>Et(t)&&t.value===e.default):-1,[e.default,h]),[d,f]=he(-1===D?p.first:D),m=h[d];ve((e,n)=>{if(clearTimeout(l.current),X(e))u("done"),t(m.value);else if(J(e,o)||Q(e,o)){if(n.clearLine(0),r||J(e,o)&&d!==p.first||Q(e,o)&&d!==p.last){const t=J(e,o)?-1:1;let r=d;do{r=(r+t+h.length)%h.length}while(!Et(h[r]));f(r)}}else if((e=>"1234567890".includes(e.name))(e)&&!Number.isNaN(Number(n.line))){const e=Number(n.line)-1;let t=-1;const r=h.findIndex(r=>!bt.isSeparator(r)&&(t++,t===e)),s=h[r];null!=s&&Et(s)&&f(r),l.current=setTimeout(()=>{n.clearLine(0)},700)}else if(Z(e))n.clearLine(0);else if(c){const e=n.line.toLowerCase(),t=h.findIndex(t=>!(bt.isSeparator(t)||!Et(t))&&t.name.toLowerCase().startsWith(e));-1!==t&&f(t),l.current=setTimeout(()=>{n.clearLine(0)},700)}}),pe(()=>()=>{clearTimeout(l.current)},[]);const g=s.style.message(e.message,i),F=s.style.keysHelpTip([["↑↓","navigate"],["⏎","select"]]);let b=0;const C=Ye({items:h,active:d,renderItem({item:e,isActive:t,index:r}){if(bt.isSeparator(e))return b++,` ${e.separator}`;const n="number"===s.indexMode?r+1-b+". ":"";if(e.disabled){const t="string"==typeof e.disabled?e.disabled:"(disabled)";return s.style.disabled(`${n}${e.name} ${t}`)}return(t?s.style.highlight:e=>e)(`${t?s.icon.cursor:" "} ${n}${e.name}`)},pageSize:n,loop:r});if("done"===i)return[a,g,s.style.answer(m.short)].filter(Boolean).join(" ");const{description:_}=m;return`${[[a,g].filter(Boolean).join(" "),C," ",_?s.style.description(_):"",F].filter(Boolean).join("\n").trimEnd()}[?25l`});const wt=new Map([["elpis",{name:"elpis",downloadUrl:"https://github.com/wshiqyuan/elpis-demo.git",description:"elpis 框架项目模板",branch:"develop"}]]);var kt,Ot,xt,Bt,At,Tt={},St={},Mt={exports:{}},Rt={exports:{}};function $t(){if(Ot)return kt;Ot=1;var e=1e3,t=60*e,r=60*t,n=24*r,s=7*n,o=365.25*n;function i(e,t,r,n){var s=t>=1.5*r;return Math.round(e/r)+" "+n+(s?"s":"")}return kt=function(u,a){a=a||{};var l=typeof u;if("string"===l&&u.length>0)return function(i){if((i=String(i)).length>100)return;var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!u)return;var a=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(u);if("number"===l&&isFinite(u))return a.long?function(s){var o=Math.abs(s);if(o>=n)return i(s,o,n,"day");if(o>=r)return i(s,o,r,"hour");if(o>=t)return i(s,o,t,"minute");if(o>=e)return i(s,o,e,"second");return s+" ms"}(u):function(s){var o=Math.abs(s);if(o>=n)return Math.round(s/n)+"d";if(o>=r)return Math.round(s/r)+"h";if(o>=t)return Math.round(s/t)+"m";if(o>=e)return Math.round(s/e)+"s";return s+"ms"}(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))}}function jt(){if(Bt)return xt;return Bt=1,xt=function(e){function t(e){let n,s,o,i=null;function u(...e){if(!u.enabled)return;const r=u,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";i++;const o=t.formatters[s];if("function"==typeof o){const t=e[i];n=o.call(r,t),e.splice(i,1),i--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return u.namespace=e,u.useColors=t.useColors(),u.color=t.selectColor(e),u.extend=r,u.destroy=t.destroy,Object.defineProperty(u,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(u),u}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,s=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(s=n,o=r,n++):(r++,n++);else{if(-1===s)return!1;n=s+1,o++,r=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=$t(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},xt}var Pt,It,Lt,Ut,Nt,Gt,Ht,Vt,qt={exports:{}};function Wt(){if(Ut)return Lt;Ut=1;const e=a,t=i,r=It?Pt:(It=1,Pt=(e,t=process.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n<s)}),{env:n}=process;let s;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function u(t,o){if(0===s)return 0;if(r("color=16m")||r("color=full")||r("color=truecolor"))return 3;if(r("color=256"))return 2;if(t&&!o&&void 0===s)return 0;const i=s||0;if("dumb"===n.TERM)return i;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in n)||"codeship"===n.CI_NAME?1:i;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if("truecolor"===n.COLORTERM)return 3;if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:i}return r("no-color")||r("no-colors")||r("color=false")||r("color=never")?s=0:(r("color")||r("colors")||r("color=true")||r("color=always"))&&(s=1),"FORCE_COLOR"in n&&(s="true"===n.FORCE_COLOR?1:"false"===n.FORCE_COLOR?0:0===n.FORCE_COLOR.length?1:Math.min(parseInt(n.FORCE_COLOR,10),3)),Lt={supportsColor:function(e){return o(u(e,e&&e.isTTY))},stdout:o(u(!0,t.isatty(1))),stderr:o(u(!0,t.isatty(2)))}}function zt(){return Nt||(Nt=1,function(e,t){const r=i,n=u;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:s}=this;if(s){const t=this.color,s="[3"+(t<8?t:"8;5;"+t),o=` ${s};1m${n} [0m`;r[0]=o+r[0].split("\n").join("\n"+o),r.push(s+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=Wt();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e},{}),e.exports=jt()(t);const{formatters:s}=e.exports;s.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},s.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}}(qt,qt.exports)),qt.exports}function Yt(){return Gt||(Gt=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Mt.exports=(At||(At=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(s=n))}),t.splice(s,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=jt()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Rt,Rt.exports)),Rt.exports):Mt.exports=zt()),Mt.exports}function Kt(){return Ht||(Ht=1,function(e){var t=St&&St.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});const r=n,s=t(Yt()).default("@kwsites/file-exists");e.exists=function(t,n=e.READABLE){return function(e,t,n){s("checking %s",e);try{const o=r.statSync(e);return o.isFile()&&t?(s("[OK] path represents a file"),!0):o.isDirectory()&&n?(s("[OK] path represents a directory"),!0):(s("[FAIL] path represents something other than a file or directory"),!1)}catch(e){if("ENOENT"===e.code)return s("[FAIL] path is not accessible: %o",e),!1;throw s("[FATAL] %o",e),e}}(t,(n&e.FILE)>0,(n&e.FOLDER)>0)},e.FILE=1,e.FOLDER=2,e.READABLE=e.FILE+e.FOLDER}(St)),St}var Jt,Qt,Zt=(Vt||(Vt=1,Jt=Tt,Object.defineProperty(Jt,"__esModule",{value:!0}),function(e){for(var t in e)Jt.hasOwnProperty(t)||(Jt[t]=e[t])}(Kt())),Tt),Xt=g(Yt()),er={};var tr,rr=function(){if(Qt)return er;function e(){let e,t,r="pending";return{promise:new Promise((r,n)=>{e=r,t=n}),done(t){"pending"===r&&(r="resolved",e(t))},fail(e){"pending"===r&&(r="rejected",t(e))},get fulfilled(){return"pending"!==r},get status(){return r}}}return Qt=1,Object.defineProperty(er,"__esModule",{value:!0}),er.createDeferred=er.deferred=void 0,er.deferred=e,er.createDeferred=e,er.default=e,er}(),nr=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,or=Object.getOwnPropertyNames,ir=Object.prototype.hasOwnProperty,ur=(e,t)=>function(){return e&&(t=(0,e[or(e)[0]])(e=0)),t},ar=(e,t)=>{for(var r in t)nr(e,r,{get:t[r],enumerable:!0})},lr=e=>((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of or(t))ir.call(e,s)||s===r||nr(e,s,{get:()=>t[s],enumerable:!(n=sr(t,s))||n.enumerable});return e})(nr({},"__esModule",{value:!0}),e);function cr(e){return e instanceof String&&tr.has(e)}function hr(e){return tr.get(e)||[]}var pr,Dr,dr,fr,mr,gr,Fr=ur({"src/lib/args/pathspec.ts"(){tr=new WeakMap}}),br=ur({"src/lib/errors/git-error.ts"(){pr=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),Cr=ur({"src/lib/errors/git-response-error.ts"(){br(),Dr=class extends pr{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),_r=ur({"src/lib/errors/task-configuration-error.ts"(){br(),dr=class extends pr{constructor(e){super(void 0,e)}}}});function yr(e){return"function"!=typeof e?mr:e}function Er(e){return"function"==typeof e&&e!==mr}function vr(e,t){const r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function wr(e,t=0){return Or(e)&&e.length>t?e[t]:void 0}function kr(e,t=0){if(Or(e)&&e.length>t)return e[e.length-1-t]}function Or(e){return zr(e)}function xr(e="",t=!0,r="\n"){return e.split(r).reduce((e,r)=>{const n=t?r.trim():r;return n&&e.push(n),e},[])}function Br(e,t){return xr(e,!0).map(e=>t(e))}function Ar(e){return Zt.exists(e,Zt.FOLDER)}function Tr(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Sr(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Mr(e,t){if(Array.isArray(e)){const r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Rr(e){return Array.isArray(e)?e:[e]}function $r(e){return e.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function jr(e){return Rr(e).map(e=>e instanceof String?e:String(e))}function Pr(e,t=0){if(null==e)return t;const r=parseInt(e,10);return Number.isNaN(r)?t:r}function Ir(e,t){const r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function Lr(e){return(Array.isArray(e)?o.Buffer.concat(e):e).toString("utf-8")}function Ur(e,t){const r={};return t.forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r}function Nr(e=0){return new Promise(t=>setTimeout(t,e))}function Gr(e){if(!1!==e)return e}var Hr,Vr,qr,Wr,zr,Yr=ur({"src/lib/utils/util.ts"(){nn(),fr="\0",mr=()=>{},gr=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Kr(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Jr(e,t){const r=cr(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Qr(e){return!!e&&"[object Object]"===gr(e)}function Zr(e){return"function"==typeof e}var Xr,en,tn,rn,nn=ur({"src/lib/utils/argument-filters.ts"(){Fr(),Yr(),Hr=e=>Array.isArray(e),Vr=e=>"number"==typeof e,qr=e=>"string"==typeof e,Wr=e=>qr(e)||Array.isArray(e)&&e.every(qr),zr=e=>null!=e&&!"number|boolean|function".includes(typeof e)&&"number"==typeof e.length}}),sn=ur({"src/lib/utils/exit-codes.ts"(){Xr=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Xr||{})}}),on=ur({"src/lib/utils/git-output-streams.ts"(){en=class e{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new e(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function un(){throw new Error("LineParser:useMatches not implemented")}var an,ln=ur({"src/lib/utils/line-parser.ts"(){tn=class{constructor(e,t){this.matches=[],this.useMatches=un,this.parse=(e,t)=>(this.resetMatches(),!!this._regExp.every((t,r)=>this.addMatch(t,r,e(r)))&&!1!==this.useMatches(t,this.prepareMatches())),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){const n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},rn=class extends tn{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function cn(...e){const t=process.cwd(),r=Object.assign({baseDir:t,...an},...e.filter(e=>"object"==typeof e&&e));return r.baseDir=r.baseDir||t,r.trimmed=!0===r.trimmed,r}var hn=ur({"src/lib/utils/simple-git-options.ts"(){an={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function pn(e,t=[]){return Qr(e)?Object.keys(e).reduce((t,r)=>{const n=e[r];if(cr(n))t.push(n);else if(Jr(n,["boolean"]))t.push(r+"="+n);else if(Array.isArray(n))for(const e of n)Jr(e,["string","number"])||t.push(r+"="+e);else t.push(r);return t},t):t}function Dn(e,t=0,r=!1){const n=[];for(let r=0,s=t<0?e.length:t;r<s;r++)"string|number".includes(typeof e[r])&&n.push(String(e[r]));return pn(dn(e),n),r||n.push(...function(e){const t="function"==typeof kr(e);return jr(Kr(kr(e,t?1:0),Hr,[]))}(e)),n}function dn(e){const t=Zr(kr(e));return Kr(kr(e,t?1:0),Qr)}function fn(e,t=!0){const r=yr(kr(e));return t||Er(r)?r:void 0}var mn=ur({"src/lib/utils/task-options.ts"(){nn(),Yr(),Fr()}});function gn(e,t){return e(t.stdOut,t.stdErr)}function Fn(e,t,r,n=!0){return Rr(r).forEach(r=>{for(let s=xr(r,n),o=0,i=s.length;o<i;o++){const r=(e=0)=>{if(!(o+e>=i))return s[o+e]};t.some(({parse:t})=>t(r,e))}}),e}var bn=ur({"src/lib/utils/task-parser.ts"(){Yr()}}),Cn={};ar(Cn,{ExitCodes:()=>Xr,GitOutputStreams:()=>en,LineParser:()=>tn,NOOP:()=>mr,NULL:()=>fr,RemoteLineParser:()=>rn,append:()=>Tr,appendTaskOptions:()=>pn,asArray:()=>Rr,asCamelCase:()=>$r,asFunction:()=>yr,asNumber:()=>Pr,asStringArray:()=>jr,bufferToString:()=>Lr,callTaskParser:()=>gn,createInstanceConfig:()=>cn,delay:()=>Nr,filterArray:()=>Hr,filterFunction:()=>Zr,filterHasLength:()=>zr,filterNumber:()=>Vr,filterPlainObject:()=>Qr,filterPrimitives:()=>Jr,filterString:()=>qr,filterStringOrStringArray:()=>Wr,filterType:()=>Kr,first:()=>wr,folderExists:()=>Ar,forEachLineWithContent:()=>Br,getTrailingOptions:()=>Dn,including:()=>Sr,isUserFunction:()=>Er,last:()=>kr,objectToString:()=>gr,orVoid:()=>Gr,parseStringResponse:()=>Fn,pick:()=>Ur,prefixedArray:()=>Ir,remove:()=>Mr,splitOn:()=>vr,toLinesWithContent:()=>xr,trailingFunctionArgument:()=>fn,trailingOptionsArgument:()=>dn});var _n,yn,En,vn=ur({"src/lib/utils/index.ts"(){nn(),sn(),on(),ln(),hn(),mn(),bn(),Yr()}}),wn={};function kn(e){switch(e){case"bare":return xn();case"root":return On()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:yn,parser:En}}function On(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:yn,parser:e=>/^\.(git)?$/.test(e.trim())}}function xn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:yn,parser:En}}ar(wn,{CheckRepoActions:()=>_n,checkIsBareRepoTask:()=>xn,checkIsRepoRootTask:()=>On,checkIsRepoTask:()=>kn});var Bn,An,Tn,Sn,Mn=ur({"src/lib/tasks/check-is-repo.ts"(){vn(),_n=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(_n||{}),yn=({exitCode:e},t,r,n)=>{if(128===e&&function(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}(t))return r(Buffer.from("false"));n(t)},En=e=>"true"===e.trim()}});var Rn,$n=ur({"src/lib/responses/CleanSummary.ts"(){vn(),Bn=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},An=/^[a-z]+\s*/i,Tn=/^[a-z]+\s+[a-z]+\s*/i,Sn=/\/$/}}),jn={};function Pn(e){return{commands:Rn,format:"empty",parser:e}}function In(e){return{commands:Rn,format:"empty",parser(){throw"string"==typeof e?new dr(e):e}}}function Ln(e,t=!1){return{commands:e,format:"utf-8",parser:e=>t?String(e).trim():e}}function Un(e){return{commands:e,format:"buffer",parser:e=>e}}function Nn(e){return"buffer"===e.format}function Gn(e){return"empty"===e.format||!e.commands.length}ar(jn,{EMPTY_COMMANDS:()=>Rn,adhocExecTask:()=>Pn,configurationErrorTask:()=>In,isBufferTask:()=>Nn,isEmptyTask:()=>Gn,straightThroughBufferTask:()=>Un,straightThroughStringTask:()=>Ln});var Hn,Vn,qn,Wn,zn,Yn=ur({"src/lib/tasks/task.ts"(){_r(),Rn=[]}}),Kn={};function Jn(e,t){const{cleanMode:r,options:n,valid:s}=function(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(e=>{!function(e){return"f"===e||"n"===e}(e)?n.options=n.options&&function(e){return/^-[a-z]$/i.test(e)&&zn.has(e.charAt(1))}(r[r.length]=`-${e}`):(t=e,n.cleanMode=!0)}),{cleanMode:t,options:r,valid:n}}(e);return r?s.options?(n.push(...t),n.some(Xn)?In(Hn):Qn(r,n)):In(qn+JSON.stringify(e)):In(Vn)}function Qn(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser:t=>function(e,t){const r=new Bn(e),n=e?Tn:An;return xr(t).forEach(e=>{const t=e.replace(n,"");r.paths.push(t),(Sn.test(t)?r.folders:r.files).push(t)}),r}("n"===e,t)}}function Zn(e){return Array.isArray(e)&&e.every(e=>zn.has(e))}function Xn(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:"--interactive"===e}ar(Kn,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Hn,CONFIG_ERROR_MODE_REQUIRED:()=>Vn,CONFIG_ERROR_UNKNOWN_OPTION:()=>qn,CleanOptions:()=>Wn,cleanTask:()=>Qn,cleanWithOptionsTask:()=>Jn,isCleanOptionsArray:()=>Zn});var es,ts=ur({"src/lib/tasks/clean.ts"(){$n(),vn(),Yn(),Hn="Git clean interactive mode is not supported",Vn='Git clean mode parameter ("n" or "f") is required',qn="Git clean unknown option found in: ",Wn=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(Wn||{}),zn=new Set(["i",...jr(Object.values(Wn))])}});function rs(e){return e.replace(/^(file):/,"")}function*ns(e,t=null){const r=e.split("\0");for(let e=0,n=r.length-1;e<n;){const n=rs(r[e++]);let s=r[e++],o=t;if(s.includes("\n")){const e=vr(s,"\n");o=e[0],s=e[1]}yield{file:n,key:o,value:s}}}var ss,os=ur({"src/lib/responses/ConfigList.ts"(){vn(),es=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){const t=kr(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){const n=this.addFile(e);Object.hasOwn(n,t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function is(e,t){return"string"==typeof e&&Object.hasOwn(ss,e)?e:t}function us(e,t){const r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser:t=>function(e,t){let r=null;const n=[],s=new Map;for(const o of ns(e,t))o.key===t&&(n.push(r=o.value),s.has(o.file)||s.set(o.file,[]),s.get(o.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}(t,e)}}function as(e){const t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser:e=>function(e){const t=new es;for(const r of ns(e))t.addValue(r.file,String(r.key),r.value);return t}(e)}}var ls,cs,hs=ur({"src/lib/tasks/config.ts"(){os(),vn(),ss=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(ss||{})}});function ps(e){return cs.has(e)}var Ds,ds,fs,ms,gs=ur({"src/lib/tasks/diff-name-status.ts"(){ls=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(ls||{}),cs=new Set(Object.values(ls))}});function Fs(){return{grep(e){const t=fn(arguments),r=Dn(arguments);for(const e of Ds)if(r.includes(e))return this._runTask(In(`git.grep: use of "${e}" is not supported.`),t);"string"==typeof e&&(e=function(...e){return(new ms).param(...e)}().param(e));const n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser:e=>function(e){const t=new Set,r={};return Br(e,e=>{const[n,s,o]=e.split(fr);t.add(n),(r[n]=r[n]||[]).push({line:Pr(s),path:n,preview:o})}),{paths:t,results:r}}(e)},t)}}}var bs,Cs,_s=ur({"src/lib/tasks/grep.ts"(){vn(),Yn(),Ds=["-h"],ds=Symbol("grepQuery"),ms=class{constructor(){this[fs]=[]}*[(fs=ds,Symbol.iterator)](){for(const e of this[ds])yield e}and(...e){return e.length&&this[ds].push("--and","(",...Ir(e,"-e"),")"),this}param(...e){return this[ds].push(...Ir(e,"-e")),this}}}}),ys={};function Es(e,t){const r=["reset"];return ws(e)&&r.push(`--${e}`),r.push(...t),Ln(r)}function vs(e){if(ws(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function ws(e){return"string"==typeof e&&Cs.includes(e)}ar(ys,{ResetMode:()=>bs,getResetMode:()=>vs,resetTask:()=>Es});var ks=ur({"src/lib/tasks/reset.ts"(){vn(),Yn(),bs=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(bs||{}),Cs=jr(Object.values(bs))}});function Os(e,t,r){return t&&String(t).replace(/\s*/,"")?(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}:r?(t,...n)=>{e(t,...n),r(t,...n)}:e}function xs(e,t,r,n=function(){return Xt("simple-git")}()){const s=e&&`[${e}]`||"",o=[],i="string"==typeof t?n.extend(t):t,u=function(e,t,{namespace:r}){if("string"==typeof e)return e;const n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}(Kr(t,qr),i,n);return function t(r){const o=r&&`[${r}]`||"",u=i&&Os(i,o)||mr,l=Os(n,`${s} ${o}`,u);return Object.assign(i?u:l,{label:e,sibling:a,info:l,step:t})}(r);function a(t,r){return Tr(o,xs(e,u.replace(/^[^:]+/,t),r,n))}}var Bs,As,Ts=ur({"src/lib/git-logger.ts"(){vn(),Xt.formatters.L=e=>String(zr(e)?e.length:"-"),Xt.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):gr(e)}}),Ss=ur({"src/lib/runners/tasks-pending-queue.ts"(){br(),Ts(),Bs=class e{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(t){const r=e.getName(t.commands[0]);return{task:t,logger:xs(this.logLabel,r),name:r}}push(e){const t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(const[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(0!==this._queue.size)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){const t=this.withProgress(e);if(!t)throw new pr(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(t="empty"){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function Ms(e,t){return{method:wr(e.commands)||"",commands:t}}function Rs(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var $s,js=ur({"src/lib/runners/git-executor-chain.ts"(){br(),Yn(),vn(),Ss(),As=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Bs}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){const t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{const{logger:t}=this._queue.attempt(e);return await(Gn(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t))}catch(t){throw this.onFatalException(e,t)}finally{r(),t()}}onFatalException(e,t){const r=t instanceof pr?Object.assign(t,{task:e}):new pr(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){const r=this._plugins.exec("spawn.binary","",Ms(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],Ms(e,e.commands)),s=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),o=await this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),Nn(e)?gn(e.parser,o):gn(e.parser,o.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){const{exitCode:s,rejection:o,stdOut:i,stdErr:u}=r;return new Promise((a,l)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);const{error:c}=this._plugins.exec("task.error",{error:o},{...Ms(e,t),...r});return c&&e.onError?(n.info("exitCode=%s handling with custom error handler"),e.onError(r,c,e=>{n.info("custom error handler treated as success"),n("custom error returned a %s",gr(e)),a(new en(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(u)))},l)):c?(n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,u.length,o),l(c)):(n.info("retrieving task output complete"),void a(new en(Buffer.concat(i),Buffer.concat(u))))})}async gitResponse(e,r,n,s,o){const i=o.sibling("output"),u=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ms(e,e.commands));return new Promise(a=>{const l=[],c=[];o.info("%s %o",r,n),o("%O",u);let h=this._beforeSpawn(e,n);if(h)return a({stdOut:l,stdErr:c,exitCode:9901,rejection:h});this._plugins.exec("spawn.before",void 0,{...Ms(e,n),kill(e){h=e||h}});const p=t.spawn(r,n,u);p.stdout.on("data",Rs(l,"stdOut",o,i.step("stdOut"))),p.stderr.on("data",Rs(c,"stdErr",o,i.step("stdErr"))),p.on("error",function(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}(c,o)),s&&(o("Passing child process stdOut/stdErr to custom outputHandler"),s(r,p.stdout,p.stderr,[...n])),this._plugins.exec("spawn.after",void 0,{...Ms(e,n),spawned:p,close(e,t){a({stdOut:l,stdErr:c,exitCode:e,rejection:h||t})},kill(e){p.killed||(h=e,p.kill("SIGINT"))}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...Ms(e,t),kill(e){r=e||r}}),r}}}}),Ps={};ar(Ps,{GitExecutor:()=>$s});var Is=ur({"src/lib/runners/git-executor.ts"(){js(),$s=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new As(this,this._scheduler,this._plugins)}chain(){return new As(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function Ls(e,t,r=mr){t.then(e=>{r(null,e)},t=>{t?.task===e&&r(t instanceof Dr?function(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=mr};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(r,n){return n in e||(r[n]={enumerable:!1,configurable:!1,get:()=>(t(n),e.git[n])}),r}}(t):t,void 0)})}var Us=ur({"src/lib/task-callback.ts"(){Cr(),vn()}});function Ns(e,t){return Pn(r=>{if(!Ar(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var Gs=ur({"src/lib/tasks/change-working-directory.ts"(){vn(),Yn()}});function Hs(e){const t=["checkout",...e];return"-b"===t[1]&&t.includes("-B")&&(t[1]=Mr(t,"-B")),Ln(t)}var Vs,qs=ur({"src/lib/tasks/checkout.ts"(){vn(),Yn()}});var Ws,zs=ur({"src/lib/tasks/count-objects.ts"(){vn(),Vs=new tn(/([a-z-]+): (\d+)$/,(e,[t,r])=>{const n=$r(t);Object.hasOwn(e,n)&&(e[n]=Pr(r))})}});function Ys(e){return Fn({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Ws,e)}var Ks=ur({"src/lib/parsers/parse-commit.ts"(){vn(),Ws=[new tn(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new tn(/\s*Author:\s(.+)/i,(e,[t])=>{const r=t.split("<"),n=r.pop();n&&n.includes("@")&&(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new tn(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new tn(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;const s=parseInt(r,10)||0;"-"===n?e.summary.deletions=s:"+"===n&&(e.summary.insertions=s)})]}});function Js(){return{commit(e,...t){const r=fn(arguments),n=function(e){return!Wr(e)&&In("git.commit: requires the commit message to be supplied as a string/string[]")}(e)||function(e,t,r){return{commands:["-c","core.abbrev=40","commit",...Ir(e,"-m"),...t,...r],format:"utf-8",parser:Ys}}(Rr(e),Rr(Kr(t[0],Wr,[])),[...jr(Kr(t[1],Hr,[])),...Dn(arguments,0,!0)]);return this._runTask(n,r)}}}var Qs=ur({"src/lib/tasks/commit.ts"(){Ks(),vn(),Yn()}});var Zs=ur({"src/lib/tasks/first-commit.ts"(){vn(),Yn()}});var Xs,eo,to,ro=ur({"src/lib/tasks/hash-object.ts"(){Yn()}});var no,so=ur({"src/lib/responses/InitSummary.ts"(){Xs=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},eo=/^Init.+ repository in (.+)$/,to=/^Rein.+ in (.+)$/}});function oo(e=!1,t,r){const n=["init",...r];return e&&!function(e){return e.includes(no)}(n)&&n.splice(1,0,no),{commands:n,format:"utf-8",parser:e=>function(e,t,r){const n=String(r).trim();let s;if(s=eo.exec(n))return new Xs(e,t,!1,s[1]);if(s=to.exec(n))return new Xs(e,t,!0,s[1]);let o="";const i=n.split(" ");for(;i.length;)if("in"===i.shift()){o=i.join(" ");break}return new Xs(e,t,/^re/i.test(n),o)}(n.includes("--bare"),t,e)}}var io,uo=ur({"src/lib/tasks/init.ts"(){so(),no="--bare"}});function ao(e){for(let t=0;t<e.length;t++){const r=io.exec(e[t]);if(r)return`--${r[1]}`}return""}function lo(e){return io.test(e)}var co,ho,po,Do,fo,mo,go=ur({"src/lib/args/log-format.ts"(){io=/^--(stat|numstat|name-only|name-status)(=|$)/}}),Fo=ur({"src/lib/responses/DiffSummary.ts"(){co=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function bo(e=""){const t=mo[e];return e=>Fn(new co,t,e,!1)}var Co,_o,yo,Eo,vo=ur({"src/lib/parsers/parse-diff-summary.ts"(){go(),Fo(),gs(),vn(),ho=[new tn(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:Pr(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new tn(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:Pr(r),after:Pr(n),binary:!0})}),new tn(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{const n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=Pr(t),e.insertions=Pr(n?.[1]),e.deletions=Pr(s?.[1])})],po=[new tn(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{const s=Pr(t),o=Pr(r);e.changed++,e.insertions+=s,e.deletions+=o,e.files.push({file:n,changes:s+o,insertions:s,deletions:o,binary:!1})}),new tn(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Do=[new tn(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],fo=[new tn(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,o])=>{e.changed++,e.files.push({file:o??n,changes:0,insertions:0,deletions:0,binary:!1,status:Gr(ps(t)&&t),from:Gr(!!o&&n!==o&&n),similarity:Pr(r)})})],mo={"":ho,"--stat":ho,"--numstat":po,"--name-status":fo,"--name-only":Do}}});function wo(e=yo,t=Eo,r=""){const n=bo(r);return function(r){const s=xr(r.trim(),!1,Co).map(function(r){const s=r.split(_o),o=function(e,t){return t.reduce((t,r,n)=>(t[r]=e[n]||"",t),Object.create({diff:null}))}(s[0].split(e),t);return s.length>1&&s[1].trim()&&(o.diff=n(s[1])),o});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var ko=ur({"src/lib/parsers/parse-list-log-summary.ts"(){vn(),vo(),go(),Co="òòòòòò ",_o=" òò",yo=" ò ",Eo=["hash","date","message","refs","author_name","author_email"]}}),Oo={};function xo(e){let t=ao(e);const r=["diff"];return""===t&&(t="--stat",r.push("--stat=4096")),r.push(...e),Bo(r)||{commands:r,format:"utf-8",parser:bo(t)}}function Bo(e){const t=e.filter(lo);return t.length>1?In(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`):t.length&&e.includes("-z")?In(`Summary flag ${t} parsing is not compatible with null termination option '-z'`):void 0}ar(Oo,{diffSummaryTask:()=>xo,validateLogFormatConfig:()=>Bo});var Ao,To=ur({"src/lib/tasks/diff.ts"(){go(),vo(),Yn()}});function So(e={},t=[]){const r=Kr(e.splitter,qr,yo),n=Qr(e.format)?e.format:{hash:"%H",date:!1===e.strictDate?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:!1!==e.mailMap?"%aN":"%an",author_email:!1!==e.mailMap?"%aE":"%ae"},[s,o]=function(e,t){const r=[],n=[];return Object.keys(e).forEach(t=>{r.push(t),n.push(String(e[t]))}),[r,n.join(t)]}(n,r),i=[],u=[`--pretty=format:${Co}${o}${_o}`,...t],a=e.n||e["max-count"]||e.maxCount;if(a&&u.push(`--max-count=${a}`),e.from||e.to){const t=!1!==e.symmetric?"...":"..";i.push(`${e.from||""}${t}${e.to||""}`)}return qr(e.file)&&u.push("--follow",function(...e){const t=new String(e);return tr.set(t,e),t}(e.file)),pn(function(e){return Object.keys(e).reduce((t,r)=>(r in Ao||(t[r]=e[r]),t),{})}(e),u),{fields:s,splitter:r,commands:[...u,...i]}}function Mo(){return{log(...e){const t=fn(arguments),r=So(dn(arguments),jr(Kr(arguments[0],Hr,[]))),n=function(e,t){return qr(e)&&qr(t)&&In("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}(...e)||Bo(r.commands)||function(e){return function(e,t,r){const n=wo(e,t,ao(r));return{commands:["log",...r],format:"utf-8",parser:n}}(e.splitter,e.fields,e.commands)}(r);return this._runTask(n,t)}}}var Ro,$o,jo,Po,Io,Lo=ur({"src/lib/tasks/log.ts"(){go(),Fr(),ko(),vn(),Yn(),To(),Ao=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Ao||{})}}),Uo=ur({"src/lib/responses/MergeSummary.ts"(){Ro=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},$o=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),No=ur({"src/lib/responses/PullSummary.ts"(){jo=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Po=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Go(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Ho(e){const t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:Pr(t&&t[1]||"0"),delta:Pr(r&&r[1]||"0")}}var Vo,qo,Wo=ur({"src/lib/parsers/parse-remote-objects.ts"(){vn(),Io=[new rn(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{const n=t.toLowerCase(),s=Go(e.remoteMessages);Object.assign(s,{[n]:Pr(r)})}),new rn(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{const n=t.toLowerCase(),s=Go(e.remoteMessages);Object.assign(s,{[n]:Pr(r)})}),new rn(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{const s=Go(e.remoteMessages);s.total=Ho(t),s.reused=Ho(r),s.packReused=Pr(n)})]}});function zo(e,t){return Fn({remoteMessages:new qo},Vo,t)}var Yo,Ko,Jo,Qo,Zo,Xo,ei=ur({"src/lib/parsers/parse-remote-messages.ts"(){vn(),Wo(),Vo=[new rn(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Io,new rn([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new rn([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:Pr(t),summary:r,url:n}})],qo=class{constructor(){this.all=[]}}}});var ti,ri,ni,si=ur({"src/lib/parsers/parse-pull.ts"(){No(),vn(),ei(),Yo=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Ko=/^(create|delete) mode \d+ (.+)/,Jo=[new tn(/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new tn(Yo,(e,[t,,r,,n])=>(void 0!==r||void 0!==n)&&(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0)),new tn(Ko,(e,[t,r])=>{Tr(e.files,r),Tr("create"===t?e.created:e.deleted,r)})],Qo=[new tn(/^from\s(.+)$/i,(e,[t])=>{e.remote=t}),new tn(/^fatal:\s(.+)$/,(e,[t])=>{e.message=t}),new tn(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],Zo=(e,t)=>Fn(new jo,Jo,[e,t]),Xo=(e,t)=>Object.assign(new jo,Zo(e,t),zo(0,t))}}),oi=ur({"src/lib/parsers/parse-merge.ts"(){Uo(),vn(),si(),ti=[new tn(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new tn(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Ro(t,r))}),new tn(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Ro(t,r,{deleteRef:n}))}),new tn(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Ro(t,null))}),new tn(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],ri=(e,t)=>Object.assign(ni(e,t),Xo(e,t)),ni=e=>Fn(new $o,ti,e)}});function ii(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(e,t){const r=ri(e,t);if(r.failed)throw new Dr(r);return r}}:In("Git.merge requires at least one option")}var ui,ai,li,ci=ur({"src/lib/tasks/merge.ts"(){Cr(),oi(),Yn()}});var hi=ur({"src/lib/parsers/parse-push.ts"(){vn(),ei(),ui=[new tn(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new tn(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new tn(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(function(e,t,r){const n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!o,alreadyUpdated:o,local:e,remote:t}}(t,r,n))}),new tn(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new tn(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],ai=(e,t)=>({...li(e,t),...zo(0,t)}),li=(e,t)=>Fn({pushed:[]},ui,[e,t])}}),pi={};function Di(e={},t){return Tr(t,"--tags"),di(e,t)}function di(e={},t){const r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),Mr(r,"-v"),Tr(r,"--verbose"),Tr(r,"--porcelain"),{commands:r,format:"utf-8",parser:ai}}ar(pi,{pushTagsTask:()=>Di,pushTask:()=>di});var fi=ur({"src/lib/tasks/push.ts"(){hi(),vn()}});var mi,gi,Fi,bi,Ci,_i=ur({"src/lib/tasks/show.ts"(){vn(),Yn()}}),yi=ur({"src/lib/responses/FileStatusSummary.ts"(){mi=/^(.+)\0(.+)$/,gi=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,"R"===t||"R"===r){const t=mi.exec(e)||[null,e,e];this.from=t[2]||"",this.path=t[1]||""}}}}});function Ei(e){const[t,r]=e.split(fr);return{from:r||t,to:t}}function vi(e,t,r){return[`${e}${t}`,r]}function wi(e,...t){return t.map(t=>vi(e,t,(e,t)=>Tr(e.conflicted,t)))}function ki(e,t){const r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(t,r,n){const s=`${t}${r}`,o=bi.get(s);o&&o(e,n),"##"!==s&&"!!"!==s&&e.files.push(new gi(n,t,r))}}var Oi,xi=ur({"src/lib/responses/StatusSummary.ts"(){vn(),yi(),Fi=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},bi=new Map([vi(" ","A",(e,t)=>Tr(e.created,t)),vi(" ","D",(e,t)=>Tr(e.deleted,t)),vi(" ","M",(e,t)=>Tr(e.modified,t)),vi("A"," ",(e,t)=>Tr(e.created,t)&&Tr(e.staged,t)),vi("A","M",(e,t)=>Tr(e.created,t)&&Tr(e.staged,t)&&Tr(e.modified,t)),vi("D"," ",(e,t)=>Tr(e.deleted,t)&&Tr(e.staged,t)),vi("M"," ",(e,t)=>Tr(e.modified,t)&&Tr(e.staged,t)),vi("M","M",(e,t)=>Tr(e.modified,t)&&Tr(e.staged,t)),vi("R"," ",(e,t)=>{Tr(e.renamed,Ei(t))}),vi("R","M",(e,t)=>{const r=Ei(t);Tr(e.renamed,r),Tr(e.modified,r.to)}),vi("!","!",(e,t)=>{Tr(e.ignored=e.ignored||[],t)}),vi("?","?",(e,t)=>Tr(e.not_added,t)),...wi("A","A","U"),...wi("D","D","U"),...wi("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/.exec(t);e.ahead=r&&+r[1]||0,r=/behind (\d+)/.exec(t),e.behind=r&&+r[1]||0,r=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(t),e.current=Kr(r?.[1],qr,null),r=/\.{3}(\S*)/.exec(t),e.tracking=Kr(r?.[1],qr,null),r=/\son\s(\S+?)(?=\.{3}|$)/.exec(t),r&&(e.current=Kr(r?.[1],qr,e.current)),e.detached=/\(no branch\)/.test(t)}]]),Ci=function(e){const t=e.split(fr),r=new Fi;for(let e=0,n=t.length;e<n;){let n=t[e++].trim();n&&("R"===n.charAt(0)&&(n+=fr+(t[e++]||"")),ki(r,n))}return r}}});var Bi,Ai,Ti=ur({"src/lib/tasks/status.ts"(){xi(),Oi=["--null","-z"]}});function Si(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Mi(e){return e===Bi?Si(0,0,0,"",!1):Fn(Si(0,0,0,e),Ai,e)}var Ri,$i=ur({"src/lib/tasks/version.ts"(){vn(),Bi="installed=false",Ai=[new tn(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,Si(Pr(t),Pr(r),Pr(n),s))}),new tn(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,Si(Pr(t),Pr(r),n,s))})]}}),ji={};ar(ji,{SimpleGitApi:()=>Ri});var Pi,Ii,Li=ur({"src/lib/simple-git-api.ts"(){Us(),Gs(),qs(),zs(),Qs(),hs(),Zs(),_s(),ro(),uo(),Lo(),ci(),fi(),_i(),Ti(),Yn(),$i(),vn(),Ri=class{constructor(e){this._executor=e}_runTask(e,t){const r=this._executor.chain(),n=r.push(e);return t&&Ls(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(Ln(["add",...Rr(e)]),fn(arguments))}cwd(e){const t=fn(arguments);return"string"==typeof e?this._runTask(Ns(e,this._executor),t):"string"==typeof e?.path?this._runTask(Ns(e.path,e.root&&this._executor||void 0),t):this._runTask(In("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(function(e,t){const r=["hash-object",e];return t&&r.push("-w"),Ln(r,!0)}(e,!0===t),fn(arguments))}init(e){return this._runTask(oo(!0===e,this._executor.cwd,Dn(arguments)),fn(arguments))}merge(){return this._runTask(ii(Dn(arguments)),fn(arguments))}mergeFromTo(e,t){return qr(e)&&qr(t)?this._runTask(ii([e,t,...Dn(arguments)]),fn(arguments,!1)):this._runTask(In("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){const e=di({remote:Kr(arguments[0],qr),branch:Kr(arguments[1],qr)},Dn(arguments));return this._runTask(e,fn(arguments))}stash(){return this._runTask(Ln(["stash",...Dn(arguments)]),fn(arguments))}status(){return this._runTask({format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...Dn(arguments).filter(e=>!Oi.includes(e))],parser:e=>Ci(e)},fn(arguments))}},Object.assign(Ri.prototype,{checkout(){return this._runTask(Hs(Dn(arguments,1)),fn(arguments))},checkoutBranch(e,t){return this._runTask(Hs(["-b",e,t,...Dn(arguments)]),fn(arguments))},checkoutLocalBranch(e){return this._runTask(Hs(["-b",e,...Dn(arguments)]),fn(arguments))}},Js(),{addConfig(e,t,...r){return this._runTask(function(e,t,r,n){const s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser:e=>e}}(e,t,!0===r[0],is(r[1],"local")),fn(arguments))},getConfig(e,t){return this._runTask(us(e,is(t,void 0)),fn(arguments))},listConfig(...e){return this._runTask(as(is(e[0],void 0)),fn(arguments))}},{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser:e=>Fn({count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0},[Vs],e)})}},{firstCommit(){return this._runTask(Ln(["rev-list","--max-parents=0","HEAD"],!0),fn(arguments))}},Fs(),Mo(),{showBuffer(){const e=["show",...Dn(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(Un(e),fn(arguments))},show(){const e=["show",...Dn(arguments,1)];return this._runTask(Ln(e),fn(arguments))}},{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Mi,onError(e,t,r,n){if(-2===e.exitCode)return r(Buffer.from(Bi));n(t)}})}})}}),Ui={};ar(Ui,{Scheduler:()=>Ii});var Ni=ur({"src/lib/runners/scheduler.ts"(){vn(),Ts(),Pi=(()=>{let e=0;return()=>{e++;const{promise:t,done:r}=rr.createDeferred();return{promise:t,done:r,id:e}}})(),Ii=class{constructor(e=2){this.concurrency=e,this.logger=xs("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency)return void this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);const e=Tr(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Mr(this.running,e),this.schedule()})}next(){const{promise:e,id:t}=Tr(this.pending,Pi());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),Gi={};function Hi(e,t){return Ln(["apply",...t,...e])}ar(Gi,{applyPatchTask:()=>Hi});var Vi,qi=ur({"src/lib/tasks/apply-patch.ts"(){Yn()}});var Wi,zi,Yi,Ki=ur({"src/lib/responses/BranchDeleteSummary.ts"(){Vi=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Ji(e,t){return 1===t&&Wi.test(e)}var Qi,Zi,Xi,eu=ur({"src/lib/parsers/parse-branch-delete.ts"(){Ki(),vn(),Wi=/^error[^']+'([^']+)'/m,zi=[new tn(/(\S+)\s+\(\S+\s([^)]+)\)/,(e,[t,r])=>{const n=function(e,t){return{branch:e,hash:t,success:!0}}(t,r);e.all.push(n),e.branches[t]=n}),new tn(Wi,(e,[t])=>{const r=function(e){return{branch:e,hash:null,success:!1}}(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Yi=(e,t)=>Fn(new Vi,zi,[e,t])}}),tu=ur({"src/lib/responses/BranchSummary.ts"(){Qi=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){"*"===e&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:"*"===e,linkedWorkTree:"+"===e,name:r,commit:n,label:s}}}}});function ru(e){return e?e.charAt(0):""}function nu(e,t=!1){return Fn(new Qi,t?[Xi]:Zi,e)}var su=ur({"src/lib/parsers/parse-branch.ts"(){tu(),vn(),Zi=[new tn(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(ru(t),!0,r,n,s)}),new tn(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,s])=>{e.push(ru(t),!1,r,n,s)})],Xi=new tn(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),ou={};function iu(e){const t=["-d","-D","--delete"];return e.some(e=>t.includes(e))}function uu(e){const t=iu(e),r=e.includes("--show-current"),n=["branch",...e];return 1===n.length&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser:(e,n)=>t?Yi(e,n).all[0]:nu(e,r)}}function au(){return{format:"utf-8",commands:["branch","-v"],parser:e=>nu(e)}}function lu(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser:(e,t)=>Yi(e,t),onError({exitCode:e,stdOut:t},r,n,s){if(!Ji(String(r),e))return s(r);n(t)}}}function cu(e,t=!1){const r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser:(t,r)=>Yi(t,r).branches[e],onError({exitCode:e,stdErr:t,stdOut:n},s,o,i){if(!Ji(String(s),e))return i(s);throw new Dr(r.parser(Lr(n),Lr(t)),String(s))}};return r}ar(ou,{branchLocalTask:()=>au,branchTask:()=>uu,containsDeleteBranchCommand:()=>iu,deleteBranchTask:()=>cu,deleteBranchesTask:()=>lu});var hu,pu=ur({"src/lib/tasks/branch.ts"(){Cr(),eu(),su(),vn()}});function Du(e){const t=e.trim().replace(/^["']|["']$/g,"");return t&&r.normalize(t)}var du=ur({"src/lib/responses/CheckIgnore.ts"(){hu=e=>e.split(/\n/g).map(Du).filter(Boolean)}}),fu={};function mu(e){return{commands:["check-ignore",...e],format:"utf-8",parser:hu}}ar(fu,{checkIgnoreTask:()=>mu});var gu=ur({"src/lib/tasks/check-ignore.ts"(){du()}}),Fu={};function bu(e){return/^--upload-pack(=|$)/.test(e)}function Cu(e,t,r){const n=["clone",...r];qr(e)&&n.push(e),qr(t)&&n.push(t);return n.find(bu)?In("git.fetch: potential exploit argument blocked."):Ln(n)}function _u(e,t,r){return Tr(r,"--mirror"),Cu(e,t,r)}ar(Fu,{cloneMirrorTask:()=>_u,cloneTask:()=>Cu});var yu,Eu=ur({"src/lib/tasks/clone.ts"(){Yn(),vn()}});function vu(e,t){return Fn({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},yu,[e,t])}var wu=ur({"src/lib/parsers/parse-fetch.ts"(){vn(),yu=[new tn(/From (.+)$/,(e,[t])=>{e.remote=t}),new tn(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new tn(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new tn(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new tn(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),ku={};function Ou(e){return/^--upload-pack(=|$)/.test(e)}function xu(e,t,r){const n=["fetch",...r];e&&t&&n.push(e,t);return n.find(Ou)?In("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:vu}}ar(ku,{fetchTask:()=>xu});var Bu,Au=ur({"src/lib/tasks/fetch.ts"(){wu(),Yn()}});function Tu(e){return Fn({moves:[]},Bu,e)}var Su=ur({"src/lib/parsers/parse-move.ts"(){vn(),Bu=[new tn(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),Mu={};function Ru(e,t){return{commands:["mv","-v",...Rr(e),t],format:"utf-8",parser:Tu}}ar(Mu,{moveTask:()=>Ru});var $u=ur({"src/lib/tasks/move.ts"(){Su(),vn()}}),ju={};function Pu(e,t,r){const n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser:(e,t)=>Xo(e,t),onError(e,t,r,n){const s=function(e,t){const r=Fn(new Po,Qo,[e,t]);return r.message&&r}(Lr(e.stdOut),Lr(e.stdErr));if(s)return n(new Dr(s));n(t)}}}ar(ju,{pullTask:()=>Pu});var Iu=ur({"src/lib/tasks/pull.ts"(){Cr(),si(),vn()}});function Lu(e){const t={};return Nu(e,([e])=>t[e]={name:e}),Object.values(t)}function Uu(e){const t={};return Nu(e,([e,r,n])=>{Object.hasOwn(t,e)||(t[e]={name:e,refs:{fetch:"",push:""}}),n&&r&&(t[e].refs[n.replace(/[^a-z]/g,"")]=r)}),Object.values(t)}function Nu(e,t){Br(e,e=>t(e.split(/\s+/)))}var Gu=ur({"src/lib/responses/GetRemoteSummary.ts"(){vn()}}),Hu={};function Vu(e,t,r){return Ln(["remote","add",...r,e,t])}function qu(e){const t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Uu:Lu}}function Wu(e){const t=[...e];return"ls-remote"!==t[0]&&t.unshift("ls-remote"),Ln(t)}function zu(e){const t=[...e];return"remote"!==t[0]&&t.unshift("remote"),Ln(t)}function Yu(e){return Ln(["remote","remove",e])}ar(Hu,{addRemoteTask:()=>Vu,getRemotesTask:()=>qu,listRemotesTask:()=>Wu,remoteTask:()=>zu,removeRemoteTask:()=>Yu});var Ku=ur({"src/lib/tasks/remote.ts"(){Gu(),Yn()}}),Ju={};function Qu(e={},t){const r=So(e),n=["stash","list",...r.commands,...t],s=wo(r.splitter,r.fields,ao(n));return Bo(n)||{commands:n,format:"utf-8",parser:s}}ar(Ju,{stashListTask:()=>Qu});var Zu=ur({"src/lib/tasks/stash-list.ts"(){go(),ko(),To(),Lo()}}),Xu={};function ea(e,t){return ra(["add",e,t])}function ta(e){return ra(["init",...e])}function ra(e){const t=[...e];return"submodule"!==t[0]&&t.unshift("submodule"),Ln(t)}function na(e){return ra(["update",...e])}ar(Xu,{addSubModuleTask:()=>ea,initSubModuleTask:()=>ta,subModuleTask:()=>ra,updateSubModuleTask:()=>na});var sa,oa,ia=ur({"src/lib/tasks/sub-module.ts"(){Yn()}});function ua(e,t){return e===t?0:e>t?1:-1}function aa(e){return e.trim()}function la(e){return"string"==typeof e&&parseInt(e.replace(/^\D+/g,""),10)||0}var ca=ur({"src/lib/responses/TagList.ts"(){sa=class{constructor(e,t){this.all=e,this.latest=t}},oa=function(e,t=!1){const r=e.split("\n").map(aa).filter(Boolean);t||r.sort(function(e,t){const r=e.split("."),n=t.split(".");if(1===r.length||1===n.length)return function(e,t){const r=Number.isNaN(e);return r!==Number.isNaN(t)?r?1:-1:r?ua(e,t):0}(la(r[0]),la(n[0]));for(let e=0,t=Math.max(r.length,n.length);e<t;e++){const t=ua(la(r[e]),la(n[e]));if(t)return t}return 0});const n=t?r[0]:[...r].reverse().find(e=>e.indexOf(".")>=0);return new sa(r,n)}}}),ha={};function pa(e=[]){const t=e.some(e=>/^--sort=/.test(e));return{format:"utf-8",commands:["tag","-l",...e],parser:e=>oa(e,t)}}function Da(e){return{format:"utf-8",commands:["tag",e],parser:()=>({name:e})}}function da(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser:()=>({name:e})}}ar(ha,{addAnnotatedTagTask:()=>da,addTagTask:()=>Da,tagListTask:()=>pa});var fa,ma,ga=ur({"src/lib/tasks/tag.ts"(){ca()}}),Fa=(fa={"src/git.js"(e,t){var{GitExecutor:r}=(Is(),lr(Ps)),{SimpleGitApi:n}=(Li(),lr(ji)),{Scheduler:s}=(Ni(),lr(Ui)),{configurationErrorTask:o}=(Yn(),lr(jn)),{asArray:i,filterArray:u,filterPrimitives:a,filterString:l,filterStringOrStringArray:c,filterType:h,getTrailingOptions:p,trailingFunctionArgument:D,trailingOptionsArgument:d}=(vn(),lr(Cn)),{applyPatchTask:f}=(qi(),lr(Gi)),{branchTask:m,branchLocalTask:g,deleteBranchesTask:F,deleteBranchTask:b}=(pu(),lr(ou)),{checkIgnoreTask:C}=(gu(),lr(fu)),{checkIsRepoTask:_}=(Mn(),lr(wn)),{cloneTask:y,cloneMirrorTask:E}=(Eu(),lr(Fu)),{cleanWithOptionsTask:v,isCleanOptionsArray:w}=(ts(),lr(Kn)),{diffSummaryTask:k}=(To(),lr(Oo)),{fetchTask:O}=(Au(),lr(ku)),{moveTask:x}=($u(),lr(Mu)),{pullTask:B}=(Iu(),lr(ju)),{pushTagsTask:A}=(fi(),lr(pi)),{addRemoteTask:T,getRemotesTask:S,listRemotesTask:M,remoteTask:R,removeRemoteTask:$}=(Ku(),lr(Hu)),{getResetMode:j,resetTask:P}=(ks(),lr(ys)),{stashListTask:I}=(Zu(),lr(Ju)),{addSubModuleTask:L,initSubModuleTask:U,subModuleTask:N,updateSubModuleTask:G}=(ia(),lr(Xu)),{addAnnotatedTagTask:H,addTagTask:V,tagListTask:q}=(ga(),lr(ha)),{straightThroughBufferTask:W,straightThroughStringTask:z}=(Yn(),lr(jn));function Y(e,t){this._plugins=t,this._executor=new r(e.baseDir,new s(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}function K(e,t,r,n){return"string"!=typeof r?o(`git.${e}() requires a string 'repoPath'`):t(r,h(n,l),p(arguments))}(Y.prototype=Object.create(n.prototype)).constructor=Y,Y.prototype.customBinary=function(e){return this._plugins.reconfigure("binary",e),this},Y.prototype.env=function(e,t){return 1===arguments.length&&"object"==typeof e?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},Y.prototype.stashList=function(e){return this._runTask(I(d(arguments)||{},u(e)&&e||[]),D(arguments))},Y.prototype.clone=function(){return this._runTask(K("clone",y,...arguments),D(arguments))},Y.prototype.mirror=function(){return this._runTask(K("mirror",E,...arguments),D(arguments))},Y.prototype.mv=function(e,t){return this._runTask(x(e,t),D(arguments))},Y.prototype.checkoutLatestTag=function(e){var t=this;return this.pull(function(){t.tags(function(r,n){t.checkout(n.latest,e)})})},Y.prototype.pull=function(e,t,r,n){return this._runTask(B(h(e,l),h(t,l),p(arguments)),D(arguments))},Y.prototype.fetch=function(e,t){return this._runTask(O(h(e,l),h(t,l),p(arguments)),D(arguments))},Y.prototype.silent=function(e){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},Y.prototype.tags=function(e,t){return this._runTask(q(p(arguments)),D(arguments))},Y.prototype.rebase=function(){return this._runTask(z(["rebase",...p(arguments)]),D(arguments))},Y.prototype.reset=function(e){return this._runTask(P(j(e),p(arguments)),D(arguments))},Y.prototype.revert=function(e){const t=D(arguments);return"string"!=typeof e?this._runTask(o("Commit must be a string"),t):this._runTask(z(["revert",...p(arguments,0,!0),e]),t)},Y.prototype.addTag=function(e){const t="string"==typeof e?V(e):o("Git.addTag requires a tag name");return this._runTask(t,D(arguments))},Y.prototype.addAnnotatedTag=function(e,t){return this._runTask(H(e,t),D(arguments))},Y.prototype.deleteLocalBranch=function(e,t,r){return this._runTask(b(e,"boolean"==typeof t&&t),D(arguments))},Y.prototype.deleteLocalBranches=function(e,t,r){return this._runTask(F(e,"boolean"==typeof t&&t),D(arguments))},Y.prototype.branch=function(e,t){return this._runTask(m(p(arguments)),D(arguments))},Y.prototype.branchLocal=function(e){return this._runTask(g(),D(arguments))},Y.prototype.raw=function(e){const t=!Array.isArray(e),r=[].slice.call(t?arguments:e,0);for(let e=0;e<r.length&&t;e++)if(!a(r[e])){r.splice(e,r.length-e);break}r.push(...p(arguments,0,!0));var n=D(arguments);return r.length?this._runTask(z(r,this._trimmed),n):this._runTask(o("Raw: must supply one or more command to execute"),n)},Y.prototype.submoduleAdd=function(e,t,r){return this._runTask(L(e,t),D(arguments))},Y.prototype.submoduleUpdate=function(e,t){return this._runTask(G(p(arguments,!0)),D(arguments))},Y.prototype.submoduleInit=function(e,t){return this._runTask(U(p(arguments,!0)),D(arguments))},Y.prototype.subModule=function(e,t){return this._runTask(N(p(arguments)),D(arguments))},Y.prototype.listRemote=function(){return this._runTask(M(p(arguments)),D(arguments))},Y.prototype.addRemote=function(e,t,r){return this._runTask(T(e,t,p(arguments)),D(arguments))},Y.prototype.removeRemote=function(e,t){return this._runTask($(e),D(arguments))},Y.prototype.getRemotes=function(e,t){return this._runTask(S(!0===e),D(arguments))},Y.prototype.remote=function(e,t){return this._runTask(R(p(arguments)),D(arguments))},Y.prototype.tag=function(e,t){const r=p(arguments);return"tag"!==r[0]&&r.unshift("tag"),this._runTask(z(r),D(arguments))},Y.prototype.updateServerInfo=function(e){return this._runTask(z(["update-server-info"]),D(arguments))},Y.prototype.pushTags=function(e,t){const r=A({remote:h(e,l)},p(arguments));return this._runTask(r,D(arguments))},Y.prototype.rm=function(e){return this._runTask(z(["rm","-f",...i(e)]),D(arguments))},Y.prototype.rmKeepLocal=function(e){return this._runTask(z(["rm","--cached",...i(e)]),D(arguments))},Y.prototype.catFile=function(e,t){return this._catFile("utf-8",arguments)},Y.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},Y.prototype._catFile=function(e,t){var r=D(t),n=["cat-file"],s=t[0];if("string"==typeof s)return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),r);Array.isArray(s)&&n.push.apply(n,s);const i="buffer"===e?W(n):z(n);return this._runTask(i,r)},Y.prototype.diff=function(e,t){const r=l(e)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):z(["diff",...p(arguments)]);return this._runTask(r,D(arguments))},Y.prototype.diffSummary=function(){return this._runTask(k(p(arguments,1)),D(arguments))},Y.prototype.applyPatch=function(e){const t=c(e)?f(i(e),p([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(t,D(arguments))},Y.prototype.revparse=function(){const e=["rev-parse",...p(arguments,!0)];return this._runTask(z(e,!0),D(arguments))},Y.prototype.clean=function(e,t,r){const n=w(e),s=n&&e.join("")||h(e,l)||"",o=p([].slice.call(arguments,n?1:0));return this._runTask(v(s,o),D(arguments))},Y.prototype.exec=function(e){const t={commands:[],format:"utf-8",parser(){"function"==typeof e&&e()}};return this._runTask(t)},Y.prototype.clearQueue=function(){return this},Y.prototype.checkIgnore=function(e,t){return this._runTask(C(i(h(e,c,[]))),D(arguments))},Y.prototype.checkIsRepo=function(e,t){return this._runTask(_(h(e,l)),D(arguments))},t.exports=Y}},function(){return ma||(0,fa[or(fa)[0]])((ma={exports:{}}).exports,ma),ma.exports});Fr(),br();var ba=class extends pr{constructor(e,t){super(void 0,t),this.config=e}};br(),br();var Ca=class extends pr{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};function _a({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action:(r,n)=>(r.forEach((s,o)=>{const i=o<r.length?r[o+1]:"";e||function(e,t){if(function(e){return"string"==typeof e&&"-c"===e.trim().toLowerCase()}(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new Ca(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}(s,i),t||function(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new Ca(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if("clone"===t&&/^\s*-u\b/.test(e))throw new Ca(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if("push"===t&&/^\s*--exec\b/.test(e))throw new Ca(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}(s,n.method)}),r)}}Cr(),_r(),Mn(),ts(),hs(),gs(),_s(),ks(),vn(),vn();var ya=rr.deferred().promise;function Ea({onClose:e=!0,onExit:t=50}={}){function r(e,t,r){!1!==e&&(!0===e?t.promise:t.promise.then(()=>Nr(e))).then(r.done)}return{type:"spawn.after",async action(n,{spawned:s,close:o}){const i=function(){let n=-1;const s={close:rr.deferred(),closeTimeout:rr.deferred(),exit:rr.deferred(),exitTimeout:rr.deferred()},o=Promise.race([!1===e?ya:s.closeTimeout.promise,!1===t?ya:s.exitTimeout.promise]);return r(e,s.close,s.closeTimeout),r(t,s.exit,s.exitTimeout),{close(e){n=e,s.close.done()},exit(e){n=e,s.exit.done()},get exitCode(){return n},result:o}}();let u=!0,a=()=>{u=!1};s.stdout?.on("data",a),s.stderr?.on("data",a),s.on("error",a),s.on("close",e=>i.close(e)),s.on("exit",e=>i.exit(e));try{await i.result,u&&await Nr(50),o(i.exitCode)}catch(e){o(i.exitCode,e)}}}}vn();var va="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function wa(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function ka(e,t){if(e.length<1||e.length>2)throw new Ca(void 0,"binary","Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings");if(e.some(wa)){if(!t)throw new Ca(void 0,"binary",va);console.warn(va)}const[r,n]=e;return{binary:r,prefix:n}}function Oa(e){return!(!e.exitCode||!e.stdErr.length)}function xa(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function Ba(e=!1,t=Oa,r=xa){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Aa(e){return{type:"task.error",action(t,r){const n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new pr(void 0,n.toString("utf-8"))}:{error:n}}}}br(),vn();var Ta=class{constructor(){this.plugins=new Set,this.events=new e.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){const r=Tr(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){const t=[];return Rr(e).forEach(e=>e&&this.plugins.add(Tr(t,e))),()=>{t.forEach(e=>this.plugins.delete(e))}}exec(e,t,r){let n=t;const s=Object.freeze(Object.create(r));for(const t of this.plugins)t.type===e&&(n=t.action(n,s));return n}};function Sa(e){return String(e.toLowerCase().split(" ",1))||"unknown"}vn(),vn(),Fr(),vn();var Ma=Fa();Cr();var Ra,$a,ja=function(e,t){const r=new Ta,n=cn(e&&("string"==typeof e?{baseDir:e}:e)||{},t);if(!Ar(n.baseDir))throw new ba(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(function(e){const t=Ir(e,"-c");return{type:"spawn.args",action:e=>[...t,...e]}}(n.config)),r.add(_a(n.unsafe)),r.add({type:"spawn.args",action(e){const t=[];let r;function n(e){(r=r||[]).push(...e)}for(let r=0;r<e.length;r++){const s=e[r];if(cr(s))n(hr(s));else{if("--"===s){n(e.slice(r+1).flatMap(e=>cr(e)&&hr(e)||e));break}t.push(s)}}return r?[...t,"--",...r.map(String)]:t}}),r.add(Ea(n.completion)),n.abort&&r.add(function(e){if(!e)return;const t={type:"spawn.after",action(t,r){function n(){r.kill(new Ca(void 0,"abort","Abort signal received"))}e.addEventListener("abort",n),r.spawned.on("close",()=>e.removeEventListener("abort",n))}};return[{type:"spawn.before",action(t,r){e.aborted&&r.kill(new Ca(void 0,"abort","Abort already signaled"))}},t]}(n.abort)),n.progress&&r.add(function(e){const t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action:(e,n)=>r.includes(n.method)?Sr(e,t):e},{type:"spawn.after",action(r,n){n.commands.includes(t)&&n.spawned.stderr?.on("data",t=>{const r=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString("utf8"));r&&e({method:n.method,stage:Sa(r[1]),progress:Pr(r[2]),processed:Pr(r[3]),total:Pr(r[4])})})}}]}(n.progress)),n.timeout&&r.add(function({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){let o;function i(){o&&clearTimeout(o),o=setTimeout(a,e)}function u(){s.spawned.stdout?.off("data",i),s.spawned.stderr?.off("data",i),s.spawned.off("exit",u),s.spawned.off("close",u),o&&clearTimeout(o)}function a(){u(),s.kill(new Ca(void 0,"timeout","block timeout reached"))}r&&s.spawned.stdout?.on("data",i),t&&s.spawned.stderr?.on("data",i),s.spawned.on("exit",u),s.spawned.on("close",u),i()}}}(n.timeout)),n.spawnOptions&&r.add(function(e){const t=Ur(e,["uid","gid"]);return{type:"spawn.options",action:e=>({...t,...e})}}(n.spawnOptions)),r.add(Aa(Ba(!0))),n.errors&&r.add(Aa(n.errors)),function(e,t=["git"],r=!1){let n=ka(Rr(t),r);e.on("binary",e=>{n=ka(Rr(e),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",e=>n.prefix?[n.prefix,...e]:e)}(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Ma(n,r)},Pa={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","❤️ "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]}};var Ia,La={exports:{}},Ua={exports:{}};function Na(){return Ia||(Ia=1,function(){const e=Ua.exports,t="[",r="]",n="",s=";",o="Apple_Terminal"===process.env.TERM_PROGRAM;e.cursorTo=(e,r)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");return"number"!=typeof r?t+(e+1)+"G":t+(r+1)+";"+(e+1)+"H"},e.cursorMove=(e,r)=>{if("number"!=typeof e)throw new TypeError("The `x` argument is required");let n="";return e<0?n+=t+-e+"D":e>0&&(n+=t+e+"C"),r<0?n+=t+-r+"A":r>0&&(n+=t+r+"B"),n},e.cursorUp=e=>t+("number"==typeof e?e:1)+"A",e.cursorDown=e=>t+("number"==typeof e?e:1)+"B",e.cursorForward=e=>t+("number"==typeof e?e:1)+"C",e.cursorBackward=e=>t+("number"==typeof e?e:1)+"D",e.cursorLeft="[G",e.cursorSavePosition=t+(o?"7":"s"),e.cursorRestorePosition=t+(o?"8":"u"),e.cursorGetPosition="[6n",e.cursorNextLine="[E",e.cursorPrevLine="[F",e.cursorHide="[?25l",e.cursorShow="[?25h",e.eraseLines=t=>{let r="";for(let n=0;n<t;n++)r+=e.eraseLine+(n<t-1?e.cursorUp():"");return t&&(r+=e.cursorLeft),r},e.eraseEndLine="[K",e.eraseStartLine="[1K",e.eraseLine="[2K",e.eraseDown="[J",e.eraseUp="[1J",e.eraseScreen="[2J",e.scrollUp="[S",e.scrollDown="[T",e.clearScreen="c",e.clearTerminal="win32"===process.platform?`${e.eraseScreen}${t}0f`:`${e.eraseScreen}${t}3J${t}H`,e.beep=n,e.link=(e,t)=>[r,"8",s,s,t,n,e,r,"8",s,s,n].join(""),e.image=(e,t)=>{let s=r+"1337;File=inline=1";return(t=t||{}).width&&(s+=`;width=${t.width}`),t.height&&(s+=`;height=${t.height}`),!1===t.preserveAspectRatio&&(s+=";preserveAspectRatio=0"),s+":"+e.toString("base64")+n},e.iTerm={},e.iTerm.setCwd=e=>r+"50;CurrentDir="+(e||process.cwd())+n}()),Ua.exports}var Ga,Ha,Va,qa,Wa={};function za(){return Ha?Ga:(Ha=1,Ga=(e,t)=>{for(const r of Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t)))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e})}function Ya(){if(qa)return Va;qa=1;const e=za();return Va=(t,r)=>{if(!0===r)throw new TypeError("The second argument is now an options object");if("function"!=typeof t)throw new TypeError("Expected a function");let n;r=r||{};let s=!1;const o=t.displayName||t.name||"<anonymous>",i=function(){if(s){if(!0===r.throw)throw new Error(`Function \`${o}\` can only be called once`);return n}return s=!0,n=t.apply(this,arguments),t=null,n};return e(i,t),i},Va}var Ka,Ja,Qa,Za,Xa,el,tl,rl,nl,sl,ol,il,ul,al,ll,cl,hl,pl,Dl,dl,fl,ml,gl,Fl,bl={exports:{}},Cl={exports:{}};function _l(){return Ka||(Ka=1,(e=Cl).exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")),Cl.exports;var e}function yl(){if(Ja)return bl.exports;Ja=1;var t=m.process;const r=function(e){return e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on};if(r(t)){var n,s=l,o=_l(),i=/^win/i.test(t.platform),u=e;"function"!=typeof u&&(u=u.EventEmitter),t.__signal_exit_emitter__?n=t.__signal_exit_emitter__:((n=t.__signal_exit_emitter__=new u).count=0,n.emitted={}),n.infinite||(n.setMaxListeners(1/0),n.infinite=!0),bl.exports=function(e,t){if(!r(m.process))return function(){};s.equal(typeof e,"function","a callback must be provided for exit handler"),!1===p&&D();var o="exit";t&&t.alwaysLast&&(o="afterexit");return n.on(o,e),function(){n.removeListener(o,e),0===n.listeners("exit").length&&0===n.listeners("afterexit").length&&a()}};var a=function(){p&&r(m.process)&&(p=!1,o.forEach(function(e){try{t.removeListener(e,h[e])}catch(e){}}),t.emit=g,t.reallyExit=d,n.count-=1)};bl.exports.unload=a;var c=function(e,t,r){n.emitted[e]||(n.emitted[e]=!0,n.emit(e,t,r))},h={};o.forEach(function(e){h[e]=function(){r(m.process)&&(t.listeners(e).length===n.count&&(a(),c("exit",null,e),c("afterexit",null,e),i&&"SIGHUP"===e&&(e="SIGINT"),t.kill(t.pid,e)))}}),bl.exports.signals=function(){return o};var p=!1,D=function(){!p&&r(m.process)&&(p=!0,n.count+=1,o=o.filter(function(e){try{return t.on(e,h[e]),!0}catch(e){return!1}}),t.emit=F,t.reallyExit=f)};bl.exports.load=D;var d=t.reallyExit,f=function(e){r(m.process)&&(t.exitCode=e||0,c("exit",t.exitCode,null),c("afterexit",t.exitCode,null),d.call(t,t.exitCode))},g=t.emit,F=function(e,n){if("exit"===e&&r(m.process)){void 0!==n&&(t.exitCode=n);var s=g.apply(this,arguments);return c("exit",t.exitCode,null),c("afterexit",t.exitCode,null),s}return g.apply(this,arguments)}}else bl.exports=function(){return function(){}};return bl.exports}function El(){if(Za)return Qa;Za=1;const e=Ya(),t=yl();return Qa=e(()=>{t(()=>{process.stderr.write("[?25h")},{alwaysLast:!0})})}function vl(){return Xa||(Xa=1,function(e){const t=El();let r=!1;e.show=e=>{const t=e||process.stderr;t.isTTY&&(r=!1,t.write("[?25h"))},e.hide=e=>{const n=e||process.stderr;n.isTTY&&(t(),r=!0,n.write("[?25l"))},e.toggle=(t,n)=>{void 0!==t&&(r=t),r?e.show(n):e.hide(n)}}(Wa)),Wa}function wl(){return tl?el:(tl=1,el=()=>{const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");return new RegExp(e,"g")})}function kl(){if(nl)return rl;nl=1;const e=wl();return rl=t=>"string"==typeof t?t.replace(e(),""):t,rl}function Ol(){return ol?sl:(ol=1,sl=e=>!Number.isNaN(e)&&(e>=4352&&(e<=4447||9001===e||9002===e||11904<=e&&e<=12871&&12351!==e||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141)))}function xl(){if(ul)return il;ul=1;const e=kl(),t=Ol();return il=r=>{if("string"!=typeof r||0===r.length)return 0;r=e(r);let n=0;for(let e=0;e<r.length;e++){const s=r.codePointAt(e);s<=31||s>=127&&s<=159||(s>=768&&s<=879||(s>65535&&e++,n+=t(s)?2:1))}return n}}function Bl(){if(ll)return al;ll=1;const e=xl(),t=kl(),r=new Set(["",""]),n=new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[90,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49]]),s=e=>`${r.values().next().value}[${e}m`,o=(n,s,o)=>{const i=Array.from(s);let u=!1,a=e(t(n[n.length-1]));for(const t of i.entries()){const s=t[0],l=t[1],c=e(l);if(a+c<=o?n[n.length-1]+=l:(n.push(l),a=0),r.has(l))u=!0;else if(u&&"m"===l){u=!1;continue}u||(a+=c,a===o&&s<i.length-1&&(n.push(""),a=0))}!a&&n[n.length-1].length>0&&n.length>1&&(n[n.length-2]+=n.pop())},i=(t,i,u)=>{const a=u||{};if(""===t.trim())return!1===a.trim?t:t.trim();let l,c="",h="";const p=(t=>t.split(" ").map(t=>e(t)))(t),D=t.split(" "),d=[""];for(const t of Array.from(D).entries()){const r=t[0],n=t[1];d[d.length-1]=!1===a.trim?d[d.length-1]:d[d.length-1].trim();let s=e(d[d.length-1]);if((s||""===n)&&(s===i&&!1===a.wordWrap&&(d.push(""),s=0),d[d.length-1]+=" ",s++),p[r]>i&&a.hard)s&&d.push(""),o(d,n,i);else{if(s+p[r]>i&&s>0){if(!1===a.wordWrap&&s<i){o(d,n,i);continue}d.push("")}s+p[r]>i&&!1===a.wordWrap?o(d,n,i):d[d.length-1]+=n}}c=d.map(e=>!1===a.trim?e:e.trim()).join("\n");for(const e of Array.from(c).entries()){const t=e[0],o=e[1];if(h+=o,r.has(o)){const e=parseFloat(/\d[^m]*/.exec(c.slice(t,t+4)));l=39===e?null:e}const i=n.get(Number(l));l&&i&&("\n"===c[t+1]?h+=s(i):"\n"===o&&(h+=s(l)))}return h};return al=(e,t,r)=>String(e).normalize().split("\n").map(e=>i(e,t,r)).join("\n"),al}function Al(){if(cl)return La.exports;cl=1;const e=Na(),t=vl(),r=Bl(),n=(n,s)=>{s=Object.assign({showCursor:!1},s);let o=0;const i=function(){s.showCursor||t.hide();let i=[].join.call(arguments," ")+"\n";i=r(i,(e=>{const t=e.columns;return t?"win32"===process.platform?t-1:t:80})(n),{trim:!1,hard:!0,wordWrap:!1}),n.write(e.eraseLines(o)+i),o=i.split("\n").length};return i.clear=()=>{n.write(e.eraseLines(o)),o=0},i.done=()=>{o=0,s.showCursor||t.show()},i};return La.exports=n(process.stdout),La.exports.stderr=n(process.stderr),La.exports.create=n,La.exports}function Tl(){if(Fl)return gl;Fl=1;const{createHash:e}=c,{humanizeActual:t,humanizeRemaining:s}=function(){if(pl)return hl;pl=1;const e=1e3,t=6e4,r=36e5;return hl={humanizeActual:n=>{let s;return n<e?(n=Math.round(n),s="ms"):n<t?(n=(n/e).toFixed(1),s="secs"):n<r?(n=(n/t).toFixed(1),s="mins"):(n=(n/r).toFixed(1),s="hours"),n%1==0?`${Math.round(n)} ${s}`:`${n} ${s}`},humanizeRemaining:(n,s)=>{let o;return s<e?(n=Math.round(n),s=Math.round(s),o="ms"):s<t?(n=(n/e).toFixed(1),s=(s/e).toFixed(1),o="s"):s<r?(n=(n/t).toFixed(1),s=(s/t).toFixed(1),o="m"):(n=(n/r).toFixed(1),s=(s/r).toFixed(1),o="h"),`${n}${o}, estimated ${s}${o}`}}}(),{getEstimate:o,updateEstimate:i}=function(){if(dl)return Dl;dl=1;const{existsSync:e,mkdirSync:t,readFileSync:s,writeFileSync:o}=n,{join:i}=r,u=(t,r)=>{const n=i(r,t);return e(n)?s(n,"utf8").split("\n").filter(e=>e).map(e=>Number.parseInt(e,10)):[]};return Dl={getEstimate:(e,t,r)=>{const n=u(e,r);return n.length<3&&t&&n.push(t),n.length>0?n.reduce((e,t)=>e+t,0)/n.length:t},updateEstimate:(r,n,s)=>{e(s)||t(s);const a=u(r,s);a.push(n),a.length>10&&a.shift();const l=i(s,r);o(l,a.join("\n"))}},Dl}(),{getProgressBar:u}=ml?fl:(ml=1,fl={getProgressBar:(e,t,r=20)=>{e=Math.max(0,Math.min(.99,e));const n=` ${Math.round(100*e)}%`.padEnd(r);let s="";for(let o=0;o<r;o++){const i=n.charAt(o);s+=e>0&&o/r<=e?t.progressForeground(i):t.progressBackground(i)}return s}});return gl=r=>{const{logFunction:n,spinner:a,storagePath:l,theme:c}=r;return async(r,h,p)=>{let D,{estimate:d,id:f}=p||{};if(!f){const t=e("sha1");t.update(h),f=t.digest("hex")}try{d=o(f,d,l);const e=Date.now(),{frames:p,interval:m}=a;let g=0;D=setInterval(()=>{g=++g%p.length;let t=c`{asciiInProgress ${p[g]}} {label ${h}}`;if(d>0){const r=Date.now()-e,n=d-r;let o=s(r,d);o=n<0?c.estimateExceeded(o):c.estimate(o);const i=u(r/d,c);t+=c` ${i} {estimate ${o}}`}n(t)},m);const F=await r,b=Date.now()-e;i(f,b,l);const C=t(b);return n(c`{asciiCompleted ✓} {label ${h}} {estimate ${C}}`),n.done(),F}catch(e){throw n.clear(),e}finally{clearInterval(D)}}},gl}var Sl,Ml,Rl={exports:{}};function $l(){if(Ml)return Sl;Ml=1;var e=/[|\\{}()[\]^$+*?.]/g;return Sl=function(t){if("string"!=typeof t)throw new TypeError("Expected a string");return t.replace(e,"\\$&")}}var jl,Pl,Il,Ll,Ul,Nl,Gl,Hl,Vl,ql,Wl,zl,Yl,Kl,Jl,Ql,Zl,Xl,ec,tc={exports:{}},rc={exports:{}};function nc(){if(Il)return rc.exports;Il=1;var e=Pl?jl:(Pl=1,jl={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]}),t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);var n=rc.exports={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"]}};for(var s in n)if(n.hasOwnProperty(s)){if(!("channels"in n[s]))throw new Error("missing channels property: "+s);if(!("labels"in n[s]))throw new Error("missing channel labels property: "+s);if(n[s].labels.length!==n[s].channels)throw new Error("channel and label counts mismatch: "+s);var o=n[s].channels,i=n[s].labels;delete n[s].channels,delete n[s].labels,Object.defineProperty(n[s],"channels",{value:o}),Object.defineProperty(n[s],"labels",{value:i})}function u(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}return n.rgb.hsl=function(e){var t,r,n=e[0]/255,s=e[1]/255,o=e[2]/255,i=Math.min(n,s,o),u=Math.max(n,s,o),a=u-i;return u===i?t=0:n===u?t=(s-o)/a:s===u?t=2+(o-n)/a:o===u&&(t=4+(n-s)/a),(t=Math.min(60*t,360))<0&&(t+=360),r=(i+u)/2,[t,100*(u===i?0:r<=.5?a/(u+i):a/(2-u-i)),100*r]},n.rgb.hsv=function(e){var t,r,n,s,o,i=e[0]/255,u=e[1]/255,a=e[2]/255,l=Math.max(i,u,a),c=l-Math.min(i,u,a),h=function(e){return(l-e)/6/c+.5};return 0===c?s=o=0:(o=c/l,t=h(i),r=h(u),n=h(a),i===l?s=n-r:u===l?s=1/3+t-n:a===l&&(s=2/3+r-t),s<0?s+=1:s>1&&(s-=1)),[360*s,100*o,100*l]},n.rgb.hwb=function(e){var t=e[0],r=e[1],s=e[2];return[n.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,s))),100*(s=1-1/255*Math.max(t,Math.max(r,s)))]},n.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,s=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-s)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-s-t)/(1-t)||0),100*t]},n.rgb.keyword=function(r){var n=t[r];if(n)return n;var s,o=1/0;for(var i in e)if(e.hasOwnProperty(i)){var a=u(r,e[i]);a<o&&(o=a,s=i)}return s},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},n.rgb.lab=function(e){var t=n.rgb.xyz(e),r=t[0],s=t[1],o=t[2];return s/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(s=s>.008856?Math.pow(s,1/3):7.787*s+16/116)-16,500*(r-s),200*(s-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},n.hsl.rgb=function(e){var t,r,n,s,o,i=e[0]/360,u=e[1]/100,a=e[2]/100;if(0===u)return[o=255*a,o,o];t=2*a-(r=a<.5?a*(1+u):a+u-a*u),s=[0,0,0];for(var l=0;l<3;l++)(n=i+1/3*-(l-1))<0&&n++,n>1&&n--,o=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,s[l]=255*o;return s},n.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,s=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,s*=o<=1?o:2-o,[t,100*(0===n?2*s/(o+s):2*r/(n+r)),100*((n+r)/2)]},n.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,s=Math.floor(t)%6,o=t-Math.floor(t),i=255*n*(1-r),u=255*n*(1-r*o),a=255*n*(1-r*(1-o));switch(n*=255,s){case 0:return[n,a,i];case 1:return[u,n,i];case 2:return[i,n,a];case 3:return[i,u,n];case 4:return[a,i,n];case 5:return[n,i,u]}},n.hsv.hsl=function(e){var t,r,n,s=e[0],o=e[1]/100,i=e[2]/100,u=Math.max(i,.01);return n=(2-o)*i,r=o*u,[s,100*(r=(r/=(t=(2-o)*u)<=1?t:2-t)||0),100*(n/=2)]},n.hwb.rgb=function(e){var t,r,n,s,o,i,u,a=e[0]/360,l=e[1]/100,c=e[2]/100,h=l+c;switch(h>1&&(l/=h,c/=h),n=6*a-(t=Math.floor(6*a)),1&t&&(n=1-n),s=l+n*((r=1-c)-l),t){default:case 6:case 0:o=r,i=s,u=l;break;case 1:o=s,i=r,u=l;break;case 2:o=l,i=r,u=s;break;case 3:o=l,i=s,u=r;break;case 4:o=s,i=l,u=r;break;case 5:o=r,i=l,u=s}return[255*o,255*i,255*u]},n.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,n=e[2]/100,s=e[3]/100;return[255*(1-Math.min(1,t*(1-s)+s)),255*(1-Math.min(1,r*(1-s)+s)),255*(1-Math.min(1,n*(1-s)+s))]},n.xyz.rgb=function(e){var t,r,n,s=e[0]/100,o=e[1]/100,i=e[2]/100;return r=-.9689*s+1.8758*o+.0415*i,n=.0557*s+-.204*o+1.057*i,t=(t=3.2406*s+-1.5372*o+-.4986*i)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},n.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},n.lab.xyz=function(e){var t,r,n,s=e[0];t=e[1]/500+(r=(s+16)/116),n=r-e[2]/200;var o=Math.pow(r,3),i=Math.pow(t,3),u=Math.pow(n,3);return r=o>.008856?o:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=u>.008856?u:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},n.lab.lch=function(e){var t,r=e[0],n=e[1],s=e[2];return(t=360*Math.atan2(s,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+s*s),t]},n.lch.lab=function(e){var t,r=e[0],n=e[1];return t=e[2]/360*2*Math.PI,[r,n*Math.cos(t),n*Math.sin(t)]},n.rgb.ansi16=function(e){var t=e[0],r=e[1],s=e[2],o=1 in arguments?arguments[1]:n.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var i=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===o&&(i+=60),i},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){var t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},n.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},n.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},n.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map(function(e){return e+e}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},n.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,s=e[2]/255,o=Math.max(Math.max(r,n),s),i=Math.min(Math.min(r,n),s),u=o-i;return t=u<=0?0:o===r?(n-s)/u%6:o===n?2+(s-r)/u:4+(r-n)/u+4,t/=6,[360*(t%=1),100*u,100*(u<1?i/(1-u):0)]},n.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=1,s=0;return(n=r<.5?2*t*r:2*t*(1-r))<1&&(s=(r-.5*n)/(1-n)),[e[0],100*n,100*s]},n.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,n=t*r,s=0;return n<1&&(s=(r-n)/(1-n)),[e[0],100*n,100*s]},n.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];var s,o=[0,0,0],i=t%1*6,u=i%1,a=1-u;switch(Math.floor(i)){case 0:o[0]=1,o[1]=u,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=u;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=u,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return s=(1-r)*n,[255*(r*o[0]+s),255*(r*o[1]+s),255*(r*o[2]+s)]},n.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},n.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},n.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},n.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,n=r-t,s=0;return n<1&&(s=(r-n)/(1-n)),[e[0],100*n,100*s]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=n.gray.hsv=function(e){return[0,0,e[0]]},n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},rc.exports}function sc(){if(Ul)return Ll;Ul=1;var e=nc();function t(t){var r=function(){for(var t={},r=Object.keys(e),n=r.length,s=0;s<n;s++)t[r[s]]={distance:-1,parent:null};return t}(),n=[t];for(r[t].distance=0;n.length;)for(var s=n.pop(),o=Object.keys(e[s]),i=o.length,u=0;u<i;u++){var a=o[u],l=r[a];-1===l.distance&&(l.distance=r[s].distance+1,l.parent=s,n.unshift(a))}return r}function r(e,t){return function(r){return t(e(r))}}function n(t,n){for(var s=[n[t].parent,t],o=e[n[t].parent][t],i=n[t].parent;n[i].parent;)s.unshift(n[i].parent),o=r(e[n[i].parent][i],o),i=n[i].parent;return o.conversion=s,o}return Ll=function(e){for(var r=t(e),s={},o=Object.keys(r),i=o.length,u=0;u<i;u++){var a=o[u];null!==r[a].parent&&(s[a]=n(a,r))}return s}}function oc(){if(Gl)return Nl;Gl=1;var e=nc(),t=sc(),r={};return Object.keys(e).forEach(function(n){r[n]={},Object.defineProperty(r[n],"channels",{value:e[n].channels}),Object.defineProperty(r[n],"labels",{value:e[n].labels});var s=t(n);Object.keys(s).forEach(function(e){var t=s[e];r[n][e]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,s=0;s<n;s++)r[s]=Math.round(r[s]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(t),r[n][e].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)})}),Nl=r}function ic(){return ql?Vl:(ql=1,Vl=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return-1!==n&&(-1===s||n<s)})}function uc(){if(zl)return Wl;zl=1;const e=a,t=ic(),r=process.env;let n;function s(s){const o=function(s){if(!1===n)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(s&&!s.isTTY&&!0!==n)return 0;const o=n?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in r)||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(s);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return t("no-color")||t("no-colors")||t("color=false")?n=!1:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(n=!0),"FORCE_COLOR"in r&&(n=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),Wl={supportsColor:s,stdout:s(process.stdout),stderr:s(process.stderr)}}function ac(){return Jl||(Jl=1,function(e){const t=$l(),r=(Hl||(Hl=1,function(e){const t=oc(),r=(e,r)=>function(){return`[${e.apply(t,arguments)+r}m`},n=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};5;${n}m`},s=(e,r)=>function(){const n=e.apply(t,arguments);return`[${38+r};2;${n[0]};${n[1]};${n[2]}m`};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,o={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],gray:[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]}};o.color.grey=o.color.gray;for(const t of Object.keys(o)){const r=o[t];for(const t of Object.keys(r)){const n=r[t];o[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=o[t],e.set(n[0],n[1])}Object.defineProperty(o,t,{value:r,enumerable:!1}),Object.defineProperty(o,"codes",{value:e,enumerable:!1})}const i=e=>e,u=(e,t,r)=>[e,t,r];o.color.close="[39m",o.bgColor.close="[49m",o.color.ansi={ansi:r(i,0)},o.color.ansi256={ansi256:n(i,0)},o.color.ansi16m={rgb:s(u,0)},o.bgColor.ansi={ansi:r(i,10)},o.bgColor.ansi256={ansi256:n(i,10)},o.bgColor.ansi16m={rgb:s(u,10)};for(let e of Object.keys(t)){if("object"!=typeof t[e])continue;const i=t[e];"ansi16"===e&&(e="ansi"),"ansi16"in i&&(o.color.ansi[e]=r(i.ansi16,0),o.bgColor.ansi[e]=r(i.ansi16,10)),"ansi256"in i&&(o.color.ansi256[e]=n(i.ansi256,0),o.bgColor.ansi256[e]=n(i.ansi256,10)),"rgb"in i&&(o.color.ansi16m[e]=s(i.rgb,0),o.bgColor.ansi16m[e]=s(i.rgb,10))}return o}})}(tc)),tc.exports),n=uc().stdout,s=function(){if(Kl)return Yl;Kl=1;const e=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,s=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function o(e){return"u"===e[0]&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):s.get(e)||e}function i(e,t){const s=[],i=t.trim().split(/\s*,\s*/g);let u;for(const t of i)if(isNaN(t)){if(!(u=t.match(r)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);s.push(u[2].replace(n,(e,t,r)=>t?o(t):r))}else s.push(Number(t));return s}function u(e){t.lastIndex=0;const r=[];let n;for(;null!==(n=t.exec(e));){const e=n[1];if(n[2]){const t=i(e,n[2]);r.push([e].concat(t))}else r.push([e])}return r}function a(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const e of Object.keys(r))if(Array.isArray(r[e])){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=r[e].length>0?n[e].apply(n,r[e]):n[e]}return n}return Yl=(t,r)=>{const n=[],s=[];let i=[];if(r.replace(e,(e,r,l,c,h,p)=>{if(r)i.push(o(r));else if(c){const e=i.join("");i=[],s.push(0===n.length?e:a(t,n)(e)),n.push({inverse:l,styles:u(c)})}else if(h){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");s.push(a(t,n)(i.join(""))),i=[],n.pop()}else i.push(p)}),s.push(i.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return s.join("")},Yl}(),o="win32"===process.platform&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),i=["ansi","ansi","ansi256","ansi16m"],u=new Set(["gray"]),a=Object.create(null);function l(e,t){t=t||{};const r=n?n.level:0;e.level=void 0===t.level?r:t.level,e.enabled="enabled"in t?t.enabled:e.level>0}function c(e){if(!this||!(this instanceof c)||this.template){const t={};return l(t,e),t.template=function(){const e=[].slice.call(arguments);return d.apply(null,[t.template].concat(e))},Object.setPrototypeOf(t,c.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=c,t.template}l(this,e)}o&&(r.blue.open="[94m");for(const e of Object.keys(r))r[e].closeRe=new RegExp(t(r[e].close),"g"),a[e]={get(){const t=r[e];return p.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}};a.visible={get(){return p.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(t(r.color.close),"g");for(const e of Object.keys(r.color.ansi))u.has(e)||(a[e]={get(){const t=this.level;return function(){const n={open:r.color[i[t]][e].apply(null,arguments),close:r.color.close,closeRe:r.color.closeRe};return p.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});r.bgColor.closeRe=new RegExp(t(r.bgColor.close),"g");for(const e of Object.keys(r.bgColor.ansi)){if(u.has(e))continue;a["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const t=this.level;return function(){const n={open:r.bgColor[i[t]][e].apply(null,arguments),close:r.bgColor.close,closeRe:r.bgColor.closeRe};return p.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}}}const h=Object.defineProperties(()=>{},a);function p(e,t,r){const n=function(){return D.apply(n,arguments)};n._styles=e,n._empty=t;const s=this;return Object.defineProperty(n,"level",{enumerable:!0,get:()=>s.level,set(e){s.level=e}}),Object.defineProperty(n,"enabled",{enumerable:!0,get:()=>s.enabled,set(e){s.enabled=e}}),n.hasGrey=this.hasGrey||"gray"===r||"grey"===r,n.__proto__=h,n}function D(){const e=arguments,t=e.length;let n=String(arguments[0]);if(0===t)return"";if(t>1)for(let r=1;r<t;r++)n+=" "+e[r];if(!this.enabled||this.level<=0||!n)return this._empty?"":n;const s=r.dim.open;o&&this.hasGrey&&(r.dim.open="");for(const e of this._styles.slice().reverse())n=e.open+n.replace(e.closeRe,e.open)+e.close,n=n.replace(/\r?\n/g,`${e.close}$&${e.open}`);return r.dim.open=s,n}function d(e,t){if(!Array.isArray(t))return[].slice.call(arguments,1).join(" ");const r=[].slice.call(arguments,2),n=[t.raw[0]];for(let e=1;e<t.length;e++)n.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(t.raw[e]));return s(e,n.join(""))}Object.defineProperties(c.prototype,a),e.exports=c(),e.exports.supportsColor=n,e.exports.default=e.exports}(Rl)),Rl.exports}function lc(){if(Zl)return Ql;Zl=1;const e="#171717",t="#757575",r="#00de6d",n="#007272",s="#cf000b",o="#ffdd00",i="#ffffff",u=ac().constructor();return u.asciiCompleted=u.hex(r),u.asciiInProgress=u.hex(o),u.estimate=u.hex(t),u.estimateExceeded=u.hex(s),u.label=u,u.percentage=u,u.progressBackground=u.bgHex(n).hex(i),u.progressForeground=u.bgHex(r).hex(e),Ql=u}var cc,hc,pc,Dc,dc,fc,mc,gc,Fc,bc,Cc,_c,yc,Ec,vc,wc=function(){if(ec)return Xl;ec=1;const{dots:e}=$a?Ra:($a=1,Ra=Pa),t=Al(),{tmpdir:r}=a,n=Tl(),s={logFunction:t,spinner:e,storagePath:`${r()}/progress-estimator`,theme:lc()};return Xl=e=>n({...s,...e})}(),kc=g(wc),Oc={exports:{}};function xc(){if(Dc)return pc;Dc=1;const e=hc?cc:(hc=1,cc={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]}),t={};for(const r of Object.keys(e))t[e[r]]=r;const r={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"]}};pc=r;for(const e of Object.keys(r)){if(!("channels"in r[e]))throw new Error("missing channels property: "+e);if(!("labels"in r[e]))throw new Error("missing channel labels property: "+e);if(r[e].labels.length!==r[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=r[e];delete r[e].channels,delete r[e].labels,Object.defineProperty(r[e],"channels",{value:t}),Object.defineProperty(r[e],"labels",{value:n})}function n(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}return r.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,s=Math.min(t,r,n),o=Math.max(t,r,n),i=o-s;let u,a;o===s?u=0:t===o?u=(r-n)/i:r===o?u=2+(n-t)/i:n===o&&(u=4+(t-r)/i),u=Math.min(60*u,360),u<0&&(u+=360);const l=(s+o)/2;return a=o===s?0:l<=.5?i/(o+s):i/(2-o-s),[u,100*a,100*l]},r.rgb.hsv=function(e){let t,r,n,s,o;const i=e[0]/255,u=e[1]/255,a=e[2]/255,l=Math.max(i,u,a),c=l-Math.min(i,u,a),h=function(e){return(l-e)/6/c+.5};return 0===c?(s=0,o=0):(o=c/l,t=h(i),r=h(u),n=h(a),i===l?s=n-r:u===l?s=1/3+t-n:a===l&&(s=2/3+r-t),s<0?s+=1:s>1&&(s-=1)),[360*s,100*o,100*l]},r.rgb.hwb=function(e){const t=e[0],n=e[1];let s=e[2];const o=r.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(n,s));return s=1-1/255*Math.max(t,Math.max(n,s)),[o,100*i,100*s]},r.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,s=Math.min(1-t,1-r,1-n);return[100*((1-t-s)/(1-s)||0),100*((1-r-s)/(1-s)||0),100*((1-n-s)/(1-s)||0),100*s]},r.rgb.keyword=function(r){const s=t[r];if(s)return s;let o,i=1/0;for(const t of Object.keys(e)){const s=n(r,e[t]);s<i&&(i=s,o=t)}return o},r.keyword.rgb=function(t){return e[t]},r.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;return[100*(.4124*t+.3576*r+.1805*n),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},r.rgb.lab=function(e){const t=r.rgb.xyz(e);let n=t[0],s=t[1],o=t[2];n/=95.047,s/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;return[116*s-16,500*(n-s),200*(s-o)]},r.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let s,o,i;if(0===r)return i=255*n,[i,i,i];s=n<.5?n*(1+r):n+r-n*r;const u=2*n-s,a=[0,0,0];for(let e=0;e<3;e++)o=t+1/3*-(e-1),o<0&&o++,o>1&&o--,i=6*o<1?u+6*(s-u)*o:2*o<1?s:3*o<2?u+(s-u)*(2/3-o)*6:u,a[e]=255*i;return a},r.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,s=r;const o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,s*=o<=1?o:2-o;return[t,100*(0===n?2*s/(o+s):2*r/(n+r)),100*((n+r)/2)]},r.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const s=Math.floor(t)%6,o=t-Math.floor(t),i=255*n*(1-r),u=255*n*(1-r*o),a=255*n*(1-r*(1-o));switch(n*=255,s){case 0:return[n,a,i];case 1:return[u,n,i];case 2:return[i,n,a];case 3:return[i,u,n];case 4:return[a,i,n];case 5:return[n,i,u]}},r.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,s=Math.max(n,.01);let o,i;i=(2-r)*n;const u=(2-r)*s;return o=r*s,o/=u<=1?u:2-u,o=o||0,i/=2,[t,100*o,100*i]},r.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const s=r+n;let o;s>1&&(r/=s,n/=s);const i=Math.floor(6*t),u=1-n;o=6*t-i,1&i&&(o=1-o);const a=r+o*(u-r);let l,c,h;switch(i){default:case 6:case 0:l=u,c=a,h=r;break;case 1:l=a,c=u,h=r;break;case 2:l=r,c=u,h=a;break;case 3:l=r,c=a,h=u;break;case 4:l=a,c=r,h=u;break;case 5:l=u,c=r,h=a}return[255*l,255*c,255*h]},r.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,s=e[3]/100;return[255*(1-Math.min(1,t*(1-s)+s)),255*(1-Math.min(1,r*(1-s)+s)),255*(1-Math.min(1,n*(1-s)+s))]},r.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let s,o,i;return s=3.2406*t+-1.5372*r+-.4986*n,o=-.9689*t+1.8758*r+.0415*n,i=.0557*t+-.204*r+1.057*n,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),[255*s,255*o,255*i]},r.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;return[116*r-16,500*(t-r),200*(r-n)]},r.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const s=r**3,o=t**3,i=n**3;return r=s>.008856?s:(r-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,n=i>.008856?i:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},r.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let s;s=360*Math.atan2(n,r)/2/Math.PI,s<0&&(s+=360);return[t,Math.sqrt(r*r+n*n),s]},r.lch.lab=function(e){const t=e[0],r=e[1],n=e[2]/360*2*Math.PI;return[t,r*Math.cos(n),r*Math.sin(n)]},r.rgb.ansi16=function(e,t=null){const[n,s,o]=e;let i=null===t?r.rgb.hsv(e)[2]:t;if(i=Math.round(i/50),0===i)return 30;let u=30+(Math.round(o/255)<<2|Math.round(s/255)<<1|Math.round(n/255));return 2===i&&(u+=60),u},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];if(t===r&&r===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},r.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},r.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},r.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));const n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},r.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,s=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),i=s-o;let u,a;return u=i<1?o/(1-i):0,a=i<=0?0:s===t?(r-n)/i%6:s===r?2+(n-t)/i:4+(t-r)/i,a/=6,a%=1,[360*a,100*i,100*u]},r.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let s=0;return n<1&&(s=(r-.5*n)/(1-n)),[e[0],100*n,100*s]},r.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let s=0;return n<1&&(s=(r-n)/(1-n)),[e[0],100*n,100*s]},r.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];const s=[0,0,0],o=t%1*6,i=o%1,u=1-i;let a=0;switch(Math.floor(o)){case 0:s[0]=1,s[1]=i,s[2]=0;break;case 1:s[0]=u,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=i;break;case 3:s[0]=0,s[1]=u,s[2]=1;break;case 4:s[0]=i,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=u}return a=(1-r)*n,[255*(r*s[0]+a),255*(r*s[1]+a),255*(r*s[2]+a)]},r.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},r.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},r.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},r.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,n=r-t;let s=0;return n<1&&(s=(r-n)/(1-n)),[e[0],100*n,100*s]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=function(e){return[0,0,e[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},pc}function Bc(){if(fc)return dc;fc=1;const e=xc();function t(t){const r=function(){const t={},r=Object.keys(e);for(let e=r.length,n=0;n<e;n++)t[r[n]]={distance:-1,parent:null};return t}(),n=[t];for(r[t].distance=0;n.length;){const t=n.pop(),s=Object.keys(e[t]);for(let e=s.length,o=0;o<e;o++){const e=s[o],i=r[e];-1===i.distance&&(i.distance=r[t].distance+1,i.parent=t,n.unshift(e))}}return r}function r(e,t){return function(r){return t(e(r))}}function n(t,n){const s=[n[t].parent,t];let o=e[n[t].parent][t],i=n[t].parent;for(;n[i].parent;)s.unshift(n[i].parent),o=r(e[n[i].parent][i],o),i=n[i].parent;return o.conversion=s,o}return dc=function(e){const r=t(e),s={},o=Object.keys(r);for(let e=o.length,t=0;t<e;t++){const e=o[t];null!==r[e].parent&&(s[e]=n(e,r))}return s}}function Ac(){if(gc)return mc;gc=1;const e=xc(),t=Bc(),r={};return Object.keys(e).forEach(n=>{r[n]={},Object.defineProperty(r[n],"channels",{value:e[n].channels}),Object.defineProperty(r[n],"labels",{value:e[n].labels});const s=t(n);Object.keys(s).forEach(e=>{const t=s[e];r[n][e]=function(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let e=n.length,t=0;t<e;t++)n[t]=Math.round(n[t]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(t),r[n][e].raw=function(e){const t=function(...t){const r=t[0];return null==r?r:(r.length>1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)})}),mc=r}function Tc(){return Fc||(Fc=1,function(e){const t=(e,t)=>(...r)=>`[${e(...r)+t}m`,r=(e,t)=>(...r)=>{const n=e(...r);return`[${38+t};5;${n}m`},n=(e,t)=>(...r)=>{const n=e(...r);return`[${38+t};2;${n[0]};${n[1]};${n[2]}m`},s=e=>e,o=(e,t,r)=>[e,t,r],i=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{const n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})};let u;const a=(e,t,r,n)=>{void 0===u&&(u=Ac());const s=n?10:0,o={};for(const[n,i]of Object.entries(u)){const u="ansi16"===n?"ansi":n;n===t?o[u]=e(r,s):"object"==typeof i&&(o[u]=e(i[t],s))}return o};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,u={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]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(const[t,r]of Object.entries(u)){for(const[t,n]of Object.entries(r))u[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=u[t],e.set(n[0],n[1]);Object.defineProperty(u,t,{value:r,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="[39m",u.bgColor.close="[49m",i(u.color,"ansi",()=>a(t,"ansi16",s,!1)),i(u.color,"ansi256",()=>a(r,"ansi256",s,!1)),i(u.color,"ansi16m",()=>a(n,"rgb",o,!1)),i(u.bgColor,"ansi",()=>a(t,"ansi16",s,!0)),i(u.bgColor,"ansi256",()=>a(r,"ansi256",s,!0)),i(u.bgColor,"ansi16m",()=>a(n,"rgb",o,!0)),u}})}(Oc)),Oc.exports}var Sc=function(){if(vc)return Ec;vc=1;const e=Tc(),{stdout:t,stderr:r}=Wt(),{stringReplaceAll:n,stringEncaseCRLFWithFirstIndex:s}=Cc?bc:(Cc=1,bc={stringReplaceAll:(e,t,r)=>{let n=e.indexOf(t);if(-1===n)return e;const s=t.length;let o=0,i="";do{i+=e.substr(o,n-o)+t+r,o=n+s,n=e.indexOf(t,o)}while(-1!==n);return i+=e.substr(o),i},stringEncaseCRLFWithFirstIndex:(e,t,r,n)=>{let s=0,o="";do{const i="\r"===e[n-1];o+=e.substr(s,(i?n-1:n)-s)+t+(i?"\r\n":"\n")+r,s=n+1,n=e.indexOf("\n",s)}while(-1!==n);return o+=e.substr(s),o}}),{isArray:o}=Array,i=["ansi","ansi","ansi256","ansi16m"],u=Object.create(null);class a{constructor(e){return l(e)}}const l=e=>{const r={};return((e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=t?t.level:0;e.level=void 0===r.level?n:r.level})(r,e),r.template=(...e)=>g(r.template,...e),Object.setPrototypeOf(r,c.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},r.template.Instance=a,r.template};function c(e){return l(e)}for(const[t,r]of Object.entries(e))u[t]={get(){const e=d(this,D(r.open,r.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:e}),e}};u.visible={get(){const e=d(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const h=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of h)u[t]={get(){const{level:r}=this;return function(...n){const s=D(e.color[i[r]][t](...n),e.color.close,this._styler);return d(this,s,this._isEmpty)}}};for(const t of h){u["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:r}=this;return function(...n){const s=D(e.bgColor[i[r]][t](...n),e.bgColor.close,this._styler);return d(this,s,this._isEmpty)}}}}const p=Object.defineProperties(()=>{},{...u,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),D=(e,t,r)=>{let n,s;return void 0===r?(n=e,s=t):(n=r.openAll+e,s=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:s,parent:r}},d=(e,t,r)=>{const n=(...e)=>o(e[0])&&o(e[0].raw)?f(n,g(n,...e)):f(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,p),n._generator=e,n._styler=t,n._isEmpty=r,n},f=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(void 0===r)return t;const{openAll:o,closeAll:i}=r;if(-1!==t.indexOf(""))for(;void 0!==r;)t=n(t,r.close,r.open),r=r.parent;const u=t.indexOf("\n");return-1!==u&&(t=s(t,i,o,u)),o+t+i};let m;const g=(e,...t)=>{const[r]=t;if(!o(r)||!o(r.raw))return t.join(" ");const n=t.slice(1),s=[r.raw[0]];for(let e=1;e<r.length;e++)s.push(String(n[e-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[e]));return void 0===m&&(m=function(){if(yc)return _c;yc=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,s=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function o(e){const t="u"===e[0],r="{"===e[1];return t&&!r&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):s.get(e)||e}function i(e,t){const s=[],i=t.trim().split(/\s*,\s*/g);let u;for(const t of i){const i=Number(t);if(Number.isNaN(i)){if(!(u=t.match(r)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);s.push(u[2].replace(n,(e,t,r)=>t?o(t):r))}else s.push(i)}return s}function u(e){t.lastIndex=0;const r=[];let n;for(;null!==(n=t.exec(e));){const e=n[1];if(n[2]){const t=i(e,n[2]);r.push([e].concat(t))}else r.push([e])}return r}function a(e,t){const r={};for(const e of t)for(const t of e.styles)r[t[0]]=e.inverse?null:t.slice(1);let n=e;for(const[e,t]of Object.entries(r))if(Array.isArray(t)){if(!(e in n))throw new Error(`Unknown Chalk style: ${e}`);n=t.length>0?n[e](...t):n[e]}return n}return _c=(t,r)=>{const n=[],s=[];let i=[];if(r.replace(e,(e,r,l,c,h,p)=>{if(r)i.push(o(r));else if(c){const e=i.join("");i=[],s.push(0===n.length?e:a(t,n)(e)),n.push({inverse:l,styles:u(c)})}else if(h){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");s.push(a(t,n)(i.join(""))),i=[],n.pop()}else i.push(p)}),s.push(i.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return s.join("")},_c}()),m(e,s.join(""))};Object.defineProperties(c.prototype,u);const F=c();return F.supportsColor=t,F.stderr=c({level:r?r.level:0}),F.stderr.supportsColor=r,Ec=F}(),Mc=g(Sc);const Rc=kc({spinner:{interval:100,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(e=>Mc.gray(e))}}),$c={baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:6};async function jc(e){const t=Array.from(wt).map(e=>{const[t,r]=e;return{name:t,value:t,description:r.description}});e||(e=await _t({message:"Please enter the project name."}));const s=r.resolve(process.cwd(),e);if(n.existsSync(s)){if(!await(o=e,console.warn(`${o} already exists. Do you want to overwrite it?`),vt({message:'if you want to overwrite it, please select "yes".',choices:[{name:"yes",value:!0},{name:"no",value:!1}]})))return;await n.rm(s,{recursive:!0,force:!0},t=>{t?console.error(t):console.log(`${e} has been deleted.`)})}var o;const i=await vt({message:"Please select the project template.",choices:t}),u=wt.get(i);u&&(async(e,t,r)=>{const n=ja($c);try{await Rc(n.clone(e,t,r),`Scaffolding project in ${process.cwd()}`,{estimate:3e4}),console.log(Mc.green("Done.")),console.log(Mc.blackBright("===================================")),console.log(Mc.whiteBright("Now you can run:")),console.log(`cd ${Mc.blueBright(t)}`),console.log(`${Mc.yellow("npm")} install`)}catch(e){console.error(Mc.red("clone error"),e)}})(u.downloadUrl,e,["-b",u.branch]),console.log("create",e)}const Pc=new W("codenest");Pc.version("0.0.1","-v, --version"),Pc.command("create").description("Create a new project").argument("[name]","<project-name>").action(async e=>{e?jc(e):console.log("Please specify the project name. For example: codenest create <project-name>")}),Pc.parse();
|
package/package.json
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codenest-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "codenest-cli 脚手架",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
8
|
"build": "rollup -c rollup.config.js"
|
|
9
9
|
},
|
|
10
|
-
"keywords": [
|
|
10
|
+
"keywords": [
|
|
11
|
+
"Webpack",
|
|
12
|
+
"Vue",
|
|
13
|
+
"nodejs",
|
|
14
|
+
"Element Plus",
|
|
15
|
+
"koa"
|
|
16
|
+
],
|
|
11
17
|
"author": "wshiqyuan",
|
|
12
18
|
"bin": {
|
|
13
19
|
"codenest": "bin/index.js"
|
|
@@ -34,4 +40,4 @@
|
|
|
34
40
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
35
41
|
"simple-git": "^3.30.0"
|
|
36
42
|
}
|
|
37
|
-
}
|
|
43
|
+
}
|