@abhi-arya1/wt 0.0.5 → 0.0.6

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.
Files changed (3) hide show
  1. package/LICENSE +7 -0
  2. package/dist/index.js +12 -12
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2026 Abhigyan Arya
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var k3=Object.create;var{getPrototypeOf:h3,defineProperty:AF,getOwnPropertyNames:b3}=Object;var v3=Object.prototype.hasOwnProperty;var rD=(D,u,F)=>{F=D!=null?k3(h3(D)):{};let E=u||!D||!D.__esModule?AF(F,"default",{value:D,enumerable:!0}):F;for(let C of b3(D))if(!v3.call(E,C))AF(E,C,{get:()=>D[C],enumerable:!0});return E};var v=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var o=import.meta.require;var pD=v((m3)=>{class nu extends Error{constructor(D,u,F){super(F);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=u,this.exitCode=D,this.nestedError=void 0}}class HF extends nu{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}m3.CommanderError=nu;m3.InvalidArgumentError=HF});var xu=v((t3)=>{var{InvalidArgumentError:n3}=pD();class xF{constructor(D,u){switch(this.description=u||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.push(D),u}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new n3(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(u,F);return u},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function c3(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}t3.Argument=xF;t3.humanReadableArgName=c3});var cu=v((i3)=>{var{humanReadableArgName:p3}=xu();class JF{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let u=D.commands.filter((E)=>!E._hidden),F=D._getHelpCommand();if(F&&!F._hidden)u.push(F);if(this.sortSubcommands)u.sort((E,C)=>{return E.name().localeCompare(C.name())});return u}compareOptions(D,u){let F=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return F(D).localeCompare(F(u))}visibleOptions(D){let u=D.options.filter((E)=>!E.hidden),F=D._getHelpOption();if(F&&!F.hidden){let E=F.short&&D._findOption(F.short),C=F.long&&D._findOption(F.long);if(!E&&!C)u.push(F);else if(F.long&&!C)u.push(D.createOption(F.long,F.description));else if(F.short&&!E)u.push(D.createOption(F.short,F.description))}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let u=[];for(let F=D.parent;F;F=F.parent){let E=F.options.filter((C)=>!C.hidden);u.push(...E)}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((u)=>{u.description=u.description||D._argsDescription[u.name()]||""});if(D.registeredArguments.find((u)=>u.description))return D.registeredArguments;return[]}subcommandTerm(D){let u=D.registeredArguments.map((F)=>p3(F)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,u){return u.visibleCommands(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleSubcommandTerm(u.subcommandTerm(E))))},0)}longestOptionTermLength(D,u){return u.visibleOptions(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleOptionTerm(u.optionTerm(E))))},0)}longestGlobalOptionTermLength(D,u){return u.visibleGlobalOptions(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleOptionTerm(u.optionTerm(E))))},0)}longestArgumentTermLength(D,u){return u.visibleArguments(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleArgumentTerm(u.argumentTerm(E))))},0)}commandUsage(D){let u=D._name;if(D._aliases[0])u=u+"|"+D._aliases[0];let F="";for(let E=D.parent;E;E=E.parent)F=E.name()+" "+F;return F+u+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)u.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)u.push(`env: ${D.envVar}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}argumentDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0)u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}formatItemList(D,u,F){if(u.length===0)return[];return[F.styleTitle(D),...u,""]}groupItems(D,u,F){let E=new Map;return D.forEach((C)=>{let B=F(C);if(!E.has(B))E.set(B,[])}),u.forEach((C)=>{let B=F(C);if(!E.has(B))E.set(B,[]);E.get(B).push(C)}),E}formatHelp(D,u){let F=u.padWidth(D,u),E=u.helpWidth??80;function C(H,J){return u.formatItem(H,F,J,u)}let B=[`${u.styleTitle("Usage:")} ${u.styleUsage(u.commandUsage(D))}`,""],$=u.commandDescription(D);if($.length>0)B=B.concat([u.boxWrap(u.styleCommandDescription($),E),""]);let A=u.visibleArguments(D).map((H)=>{return C(u.styleArgumentTerm(u.argumentTerm(H)),u.styleArgumentDescription(u.argumentDescription(H)))});if(B=B.concat(this.formatItemList("Arguments:",A,u)),this.groupItems(D.options,u.visibleOptions(D),(H)=>H.helpGroupHeading??"Options:").forEach((H,J)=>{let T=H.map((_)=>{return C(u.styleOptionTerm(u.optionTerm(_)),u.styleOptionDescription(u.optionDescription(_)))});B=B.concat(this.formatItemList(J,T,u))}),u.showGlobalOptions){let H=u.visibleGlobalOptions(D).map((J)=>{return C(u.styleOptionTerm(u.optionTerm(J)),u.styleOptionDescription(u.optionDescription(J)))});B=B.concat(this.formatItemList("Global Options:",H,u))}return this.groupItems(D.commands,u.visibleCommands(D),(H)=>H.helpGroup()||"Commands:").forEach((H,J)=>{let T=H.map((_)=>{return C(u.styleSubcommandTerm(u.subcommandTerm(_)),u.styleSubcommandDescription(u.subcommandDescription(_)))});B=B.concat(this.formatItemList(J,T,u))}),B.join(`
3
+ var k3=Object.create;var{getPrototypeOf:h3,defineProperty:AF,getOwnPropertyNames:b3}=Object;var v3=Object.prototype.hasOwnProperty;var rD=(D,u,F)=>{F=D!=null?k3(h3(D)):{};let E=u||!D||!D.__esModule?AF(F,"default",{value:D,enumerable:!0}):F;for(let C of b3(D))if(!v3.call(E,C))AF(E,C,{get:()=>D[C],enumerable:!0});return E};var v=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var o=import.meta.require;var pD=v((m3)=>{class du extends Error{constructor(D,u,F){super(F);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=u,this.exitCode=D,this.nestedError=void 0}}class HF extends du{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}m3.CommanderError=du;m3.InvalidArgumentError=HF});var xu=v((t3)=>{var{InvalidArgumentError:d3}=pD();class xF{constructor(D,u){switch(this.description=u||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(D,u){if(u===this.defaultValue||!Array.isArray(u))return[D];return u.push(D),u}default(D,u){return this.defaultValue=D,this.defaultValueDescription=u,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(u,F)=>{if(!this.argChoices.includes(u))throw new d3(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(u,F);return u},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function c3(D){let u=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+u+">":"["+u+"]"}t3.Argument=xF;t3.humanReadableArgName=c3});var cu=v((i3)=>{var{humanReadableArgName:p3}=xu();class JF{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(D){this.helpWidth=this.helpWidth??D.helpWidth??80}visibleCommands(D){let u=D.commands.filter((E)=>!E._hidden),F=D._getHelpCommand();if(F&&!F._hidden)u.push(F);if(this.sortSubcommands)u.sort((E,C)=>{return E.name().localeCompare(C.name())});return u}compareOptions(D,u){let F=(E)=>{return E.short?E.short.replace(/^-/,""):E.long.replace(/^--/,"")};return F(D).localeCompare(F(u))}visibleOptions(D){let u=D.options.filter((E)=>!E.hidden),F=D._getHelpOption();if(F&&!F.hidden){let E=F.short&&D._findOption(F.short),C=F.long&&D._findOption(F.long);if(!E&&!C)u.push(F);else if(F.long&&!C)u.push(D.createOption(F.long,F.description));else if(F.short&&!E)u.push(D.createOption(F.short,F.description))}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let u=[];for(let F=D.parent;F;F=F.parent){let E=F.options.filter((C)=>!C.hidden);u.push(...E)}if(this.sortOptions)u.sort(this.compareOptions);return u}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((u)=>{u.description=u.description||D._argsDescription[u.name()]||""});if(D.registeredArguments.find((u)=>u.description))return D.registeredArguments;return[]}subcommandTerm(D){let u=D.registeredArguments.map((F)=>p3(F)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,u){return u.visibleCommands(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleSubcommandTerm(u.subcommandTerm(E))))},0)}longestOptionTermLength(D,u){return u.visibleOptions(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleOptionTerm(u.optionTerm(E))))},0)}longestGlobalOptionTermLength(D,u){return u.visibleGlobalOptions(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleOptionTerm(u.optionTerm(E))))},0)}longestArgumentTermLength(D,u){return u.visibleArguments(D).reduce((F,E)=>{return Math.max(F,this.displayWidth(u.styleArgumentTerm(u.argumentTerm(E))))},0)}commandUsage(D){let u=D._name;if(D._aliases[0])u=u+"|"+D._aliases[0];let F="";for(let E=D.parent;E;E=E.parent)F=E.name()+" "+F;return F+u+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)u.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)u.push(`env: ${D.envVar}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}argumentDescription(D){let u=[];if(D.argChoices)u.push(`choices: ${D.argChoices.map((F)=>JSON.stringify(F)).join(", ")}`);if(D.defaultValue!==void 0)u.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(u.length>0){let F=`(${u.join(", ")})`;if(D.description)return`${D.description} ${F}`;return F}return D.description}formatItemList(D,u,F){if(u.length===0)return[];return[F.styleTitle(D),...u,""]}groupItems(D,u,F){let E=new Map;return D.forEach((C)=>{let B=F(C);if(!E.has(B))E.set(B,[])}),u.forEach((C)=>{let B=F(C);if(!E.has(B))E.set(B,[]);E.get(B).push(C)}),E}formatHelp(D,u){let F=u.padWidth(D,u),E=u.helpWidth??80;function C(H,J){return u.formatItem(H,F,J,u)}let B=[`${u.styleTitle("Usage:")} ${u.styleUsage(u.commandUsage(D))}`,""],$=u.commandDescription(D);if($.length>0)B=B.concat([u.boxWrap(u.styleCommandDescription($),E),""]);let A=u.visibleArguments(D).map((H)=>{return C(u.styleArgumentTerm(u.argumentTerm(H)),u.styleArgumentDescription(u.argumentDescription(H)))});if(B=B.concat(this.formatItemList("Arguments:",A,u)),this.groupItems(D.options,u.visibleOptions(D),(H)=>H.helpGroupHeading??"Options:").forEach((H,J)=>{let T=H.map((_)=>{return C(u.styleOptionTerm(u.optionTerm(_)),u.styleOptionDescription(u.optionDescription(_)))});B=B.concat(this.formatItemList(J,T,u))}),u.showGlobalOptions){let H=u.visibleGlobalOptions(D).map((J)=>{return C(u.styleOptionTerm(u.optionTerm(J)),u.styleOptionDescription(u.optionDescription(J)))});B=B.concat(this.formatItemList("Global Options:",H,u))}return this.groupItems(D.commands,u.visibleCommands(D),(H)=>H.helpGroup()||"Commands:").forEach((H,J)=>{let T=H.map((_)=>{return C(u.styleSubcommandTerm(u.subcommandTerm(_)),u.styleSubcommandDescription(u.subcommandDescription(_)))});B=B.concat(this.formatItemList(J,T,u))}),B.join(`
4
4
  `)}displayWidth(D){return NF(D).length}styleTitle(D){return D}styleUsage(D){return D.split(" ").map((u)=>{if(u==="[options]")return this.styleOptionText(u);if(u==="[command]")return this.styleSubcommandText(u);if(u[0]==="["||u[0]==="<")return this.styleArgumentText(u);return this.styleCommandText(u)}).join(" ")}styleCommandDescription(D){return this.styleDescriptionText(D)}styleOptionDescription(D){return this.styleDescriptionText(D)}styleSubcommandDescription(D){return this.styleDescriptionText(D)}styleArgumentDescription(D){return this.styleDescriptionText(D)}styleDescriptionText(D){return D}styleOptionTerm(D){return this.styleOptionText(D)}styleSubcommandTerm(D){return D.split(" ").map((u)=>{if(u==="[options]")return this.styleOptionText(u);if(u[0]==="["||u[0]==="<")return this.styleArgumentText(u);return this.styleSubcommandText(u)}).join(" ")}styleArgumentTerm(D){return this.styleArgumentText(D)}styleOptionText(D){return D}styleArgumentText(D){return D}styleSubcommandText(D){return D}styleCommandText(D){return D}padWidth(D,u){return Math.max(u.longestOptionTermLength(D,u),u.longestGlobalOptionTermLength(D,u),u.longestSubcommandTermLength(D,u),u.longestArgumentTermLength(D,u))}preformatted(D){return/\n[^\S\r\n]/.test(D)}formatItem(D,u,F,E){let B=" ".repeat(2);if(!F)return B+D;let $=D.padEnd(u+D.length-E.displayWidth(D)),A=2,x=(this.helpWidth??80)-u-A-2,H;if(x<this.minWidthToWrap||E.preformatted(F))H=F;else H=E.boxWrap(F,x).replace(/\n/g,`
5
5
  `+" ".repeat(u+A));return B+$+" ".repeat(A)+H.replace(/\n/g,`
6
6
  ${B}`)}boxWrap(D,u){if(u<this.minWidthToWrap)return D;let F=D.split(/\r\n|\n/),E=/[\s]*[^\s]+/g,C=[];return F.forEach((B)=>{let $=B.match(E);if($===null){C.push("");return}let A=[$.shift()],R=this.displayWidth(A[0]);$.forEach((x)=>{let H=this.displayWidth(x);if(R+H<=u){A.push(x),R+=H;return}C.push(A.join(""));let J=x.trimStart();A=[J],R=this.displayWidth(J)}),C.push(A.join(""))}),C.join(`
@@ -25,12 +25,12 @@ Expecting one of '${F.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycl
25
25
  `),this.outputHelp({error:!0});let F=u||{},E=F.exitCode||1,C=F.code||"commander.error";this._exit(E,C,D)}_parseOptionsEnv(){this.options.forEach((D)=>{if(D.envVar&&D.envVar in Y.env){let u=D.attributeName();if(this.getOptionValue(u)===void 0||["default","config","env"].includes(this.getOptionValueSource(u)))if(D.required||D.optional)this.emit(`optionEnv:${D.name()}`,Y.env[D.envVar]);else this.emit(`optionEnv:${D.name()}`)}})}_parseOptionsImplied(){let D=new RE(this.options),u=(F)=>{return this.getOptionValue(F)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(F))};this.options.filter((F)=>F.implied!==void 0&&u(F.attributeName())&&D.valueFromOption(this.getOptionValue(F.attributeName()),F)).forEach((F)=>{Object.keys(F.implied).filter((E)=>!u(E)).forEach((E)=>{this.setOptionValueWithSource(E,F.implied[E],"implied")})})}missingArgument(D){let u=`error: missing required argument '${D}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(D){let u=`error: option '${D.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(D){let u=`error: required option '${D.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(D,u){let F=(B)=>{let $=B.attributeName(),A=this.getOptionValue($),R=this.options.find((H)=>H.negate&&$===H.attributeName()),x=this.options.find((H)=>!H.negate&&$===H.attributeName());if(R&&(R.presetArg===void 0&&A===!1||R.presetArg!==void 0&&A===R.presetArg))return R;return x||B},E=(B)=>{let $=F(B),A=$.attributeName();if(this.getOptionValueSource(A)==="env")return`environment variable '${$.envVar}'`;return`option '${$.flags}'`},C=`error: ${E(D)} cannot be used with ${E(u)}`;this.error(C,{code:"commander.conflictingOption"})}unknownOption(D){if(this._allowUnknownOption)return;let u="";if(D.startsWith("--")&&this._showSuggestionAfterError){let E=[],C=this;do{let B=C.createHelp().visibleOptions(C).filter(($)=>$.long).map(($)=>$.long);E=E.concat(B),C=C.parent}while(C&&!C._enablePositionalOptions);u=jF(D,E)}let F=`error: unknown option '${D}'${u}`;this.error(F,{code:"commander.unknownOption"})}_excessArguments(D){if(this._allowExcessArguments)return;let u=this.registeredArguments.length,F=u===1?"":"s",C=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${u} argument${F} but got ${D.length}.`;this.error(C,{code:"commander.excessArguments"})}unknownCommand(){let D=this.args[0],u="";if(this._showSuggestionAfterError){let E=[];this.createHelp().visibleCommands(this).forEach((C)=>{if(E.push(C.name()),C.alias())E.push(C.alias())}),u=jF(D,E)}let F=`error: unknown command '${D}'${u}`;this.error(F,{code:"commander.unknownCommand"})}version(D,u,F){if(D===void 0)return this._version;this._version=D,u=u||"-V, --version",F=F||"output the version number";let E=this.createOption(u,F);return this._versionOptionName=E.attributeName(),this._registerOption(E),this.on("option:"+E.name(),()=>{this._outputConfiguration.writeOut(`${D}
26
26
  `),this._exit(0,"commander.version",D)}),this}description(D,u){if(D===void 0&&u===void 0)return this._description;if(this._description=D,u)this._argsDescription=u;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)u=this.commands[this.commands.length-1];if(D===u._name)throw Error("Command alias can't be the same as its name");let F=this.parent?._findCommand(D);if(F){let E=[F.name()].concat(F.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${E}'`)}return u._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((u)=>this.alias(u)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let u=this.registeredArguments.map((F)=>{return xE(F)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?u:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}helpGroup(D){if(D===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=D,this}commandsGroup(D){if(D===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=D,this}optionsGroup(D){if(D===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=D,this}_initOptionGroup(D){if(this._defaultOptionGroup&&!D.helpGroupHeading)D.helpGroup(this._defaultOptionGroup)}_initCommandGroup(D){if(this._defaultCommandGroup&&!D.helpGroup())D.helpGroup(this._defaultCommandGroup)}nameFromFilename(D){return this._name=xD.basename(D,xD.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let u=this.createHelp(),F=this._getOutputContext(D);u.prepareContext({error:F.error,helpWidth:F.helpWidth,outputHasColors:F.hasColors});let E=u.formatHelp(this,u);if(F.hasColors)return E;return this._outputConfiguration.stripColor(E)}_getOutputContext(D){D=D||{};let u=!!D.error,F,E,C;if(u)F=($)=>this._outputConfiguration.writeErr($),E=this._outputConfiguration.getErrHasColors(),C=this._outputConfiguration.getErrHelpWidth();else F=($)=>this._outputConfiguration.writeOut($),E=this._outputConfiguration.getOutHasColors(),C=this._outputConfiguration.getOutHelpWidth();return{error:u,write:($)=>{if(!E)$=this._outputConfiguration.stripColor($);return F($)},hasColors:E,helpWidth:C}}outputHelp(D){let u;if(typeof D==="function")u=D,D=void 0;let F=this._getOutputContext(D),E={error:F.error,write:F.write,command:this};this._getCommandAndAncestors().reverse().forEach((B)=>B.emit("beforeAllHelp",E)),this.emit("beforeHelp",E);let C=this.helpInformation({error:F.error});if(u){if(C=u(C),typeof C!=="string"&&!Buffer.isBuffer(C))throw Error("outputHelp callback must return a string or a Buffer")}if(F.write(C),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",E),this._getCommandAndAncestors().forEach((B)=>B.emit("afterAllHelp",E))}helpOption(D,u){if(typeof D==="boolean"){if(D){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(D??"-h, --help",u??"display help for command"),D||u)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this._initOptionGroup(D),this}help(D){this.outputHelp(D);let u=Number(Y.exitCode??0);if(u===0&&D&&typeof D!=="function"&&D.error)u=1;this._exit(u,"commander.help","(outputHelp)")}addHelpText(D,u){let F=["beforeAll","before","after","afterAll"];if(!F.includes(D))throw Error(`Unexpected value for position to addHelpText.
27
27
  Expecting one of '${F.join("', '")}'`);let E=`${D}Help`;return this.on(E,(C)=>{let B;if(typeof u==="function")B=u({error:C.error,command:C.command});else B=u;if(B)C.write(`${B}
28
- `)}),this}_outputHelpIfRequested(D){let u=this._getHelpOption();if(u&&D.find((E)=>u.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function OF(D){return D.map((u)=>{if(!u.startsWith("--inspect"))return u;let F,E="127.0.0.1",C="9229",B;if((B=u.match(/^(--inspect(-brk)?)$/))!==null)F=B[1];else if((B=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(F=B[1],/^\d+$/.test(B[3]))C=B[3];else E=B[3];else if((B=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)F=B[1],E=B[3],C=B[4];if(F&&C!=="0")return`${F}=${E}:${parseInt(C)+1}`;return u})}function pu(){if(Y.env.NO_COLOR||Y.env.FORCE_COLOR==="0"||Y.env.FORCE_COLOR==="false")return!1;if(Y.env.FORCE_COLOR||Y.env.CLICOLOR_FORCE!==void 0)return!0;return}_E.Command=iu;_E.useColor=pu});var ZF=v((OE)=>{var{Argument:zF}=xu(),{Command:ou}=SF(),{CommanderError:GE,InvalidArgumentError:IF}=pD(),{Help:jE}=cu(),{Option:UF}=tu();OE.program=new ou;OE.createCommand=(D)=>new ou(D);OE.createOption=(D,u)=>new UF(D,u);OE.createArgument=(D,u)=>new zF(D,u);OE.Command=ou;OE.Option=UF;OE.Argument=zF;OE.Help=jE;OE.CommanderError=GE;OE.InvalidArgumentError=IF;OE.InvalidOptionArgumentError=IF});var pF=v((n6,rF)=>{rF.exports=FC;function uC(D){let u={defaultWidth:0,output:process.stdout,tty:o("tty")};if(!D)return u;return Object.keys(u).forEach(function(F){if(!D[F])D[F]=u[F]}),D}function FC(D){let u=uC(D);if(u.output.getWindowSize)return u.output.getWindowSize()[0]||u.defaultWidth;if(u.tty.getWindowSize)return u.tty.getWindowSize()[1]||u.defaultWidth;if(u.output.columns)return u.output.columns;if(process.env.CLI_WIDTH){let F=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(F)&&F!==0)return F}return u.defaultWidth}});var R2=v((R1,N2)=>{var GC=o("stream");class J2 extends GC{#F=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#u(D,u){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return u}#D(D,...u){if(typeof this._dest?.[D]==="function")this._dest[D](...u);if(typeof this._src?.[D]==="function")this._src[D](...u)}get isTTY(){if(this.#F!==null)return this.#F;return this.#u("isTTY",!1)}set isTTY(D){this.#F=D}get rows(){return this.#u("rows")}get columns(){return this.#u("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,u){return this._dest=D,super.pipe(D,u)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}N2.exports=J2});var M2=v((e1,Y2)=>{var TD=o("constants"),MC=process.cwd,Ou=null,qC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Ou)Ou=MC.call(process);return Ou};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(Su=process.chdir,process.chdir=function(D){Ou=null,Su.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,Su)}var Su;Y2.exports=QC;function QC(D){if(TD.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))u(D);if(!D.lutimes)F(D);if(D.chown=B(D.chown),D.fchown=B(D.fchown),D.lchown=B(D.lchown),D.chmod=E(D.chmod),D.fchmod=E(D.fchmod),D.lchmod=E(D.lchmod),D.chownSync=$(D.chownSync),D.fchownSync=$(D.fchownSync),D.lchownSync=$(D.lchownSync),D.chmodSync=C(D.chmodSync),D.fchmodSync=C(D.fchmodSync),D.lchmodSync=C(D.lchmodSync),D.stat=A(D.stat),D.fstat=A(D.fstat),D.lstat=A(D.lstat),D.statSync=R(D.statSync),D.fstatSync=R(D.fstatSync),D.lstatSync=R(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(H,J,T){if(T)process.nextTick(T)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(H,J,T,_){if(_)process.nextTick(_)},D.lchownSync=function(){};if(qC==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(H){function J(T,_,X){var j=Date.now(),O=0;H(T,_,function I(U){if(U&&(U.code==="EACCES"||U.code==="EPERM"||U.code==="EBUSY")&&Date.now()-j<60000){if(setTimeout(function(){D.stat(_,function(z,n){if(z&&z.code==="ENOENT")H(T,_,I);else X(U)})},O),O<100)O+=10;return}if(X)X(U)})}if(Object.setPrototypeOf)Object.setPrototypeOf(J,H);return J}(D.rename);D.read=typeof D.read!=="function"?D.read:function(H){function J(T,_,X,j,O,I){var U;if(I&&typeof I==="function"){var z=0;U=function(n,DD,_D){if(n&&n.code==="EAGAIN"&&z<10)return z++,H.call(D,T,_,X,j,O,U);I.apply(this,arguments)}}return H.call(D,T,_,X,j,O,U)}if(Object.setPrototypeOf)Object.setPrototypeOf(J,H);return J}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(H){return function(J,T,_,X,j){var O=0;while(!0)try{return H.call(D,J,T,_,X,j)}catch(I){if(I.code==="EAGAIN"&&O<10){O++;continue}throw I}}}(D.readSync);function u(H){H.lchmod=function(J,T,_){H.open(J,TD.O_WRONLY|TD.O_SYMLINK,T,function(X,j){if(X){if(_)_(X);return}H.fchmod(j,T,function(O){H.close(j,function(I){if(_)_(O||I)})})})},H.lchmodSync=function(J,T){var _=H.openSync(J,TD.O_WRONLY|TD.O_SYMLINK,T),X=!0,j;try{j=H.fchmodSync(_,T),X=!1}finally{if(X)try{H.closeSync(_)}catch(O){}else H.closeSync(_)}return j}}function F(H){if(TD.hasOwnProperty("O_SYMLINK")&&H.futimes)H.lutimes=function(J,T,_,X){H.open(J,TD.O_SYMLINK,function(j,O){if(j){if(X)X(j);return}H.futimes(O,T,_,function(I){H.close(O,function(U){if(X)X(I||U)})})})},H.lutimesSync=function(J,T,_){var X=H.openSync(J,TD.O_SYMLINK),j,O=!0;try{j=H.futimesSync(X,T,_),O=!1}finally{if(O)try{H.closeSync(X)}catch(I){}else H.closeSync(X)}return j};else if(H.futimes)H.lutimes=function(J,T,_,X){if(X)process.nextTick(X)},H.lutimesSync=function(){}}function E(H){if(!H)return H;return function(J,T,_){return H.call(D,J,T,function(X){if(x(X))X=null;if(_)_.apply(this,arguments)})}}function C(H){if(!H)return H;return function(J,T){try{return H.call(D,J,T)}catch(_){if(!x(_))throw _}}}function B(H){if(!H)return H;return function(J,T,_,X){return H.call(D,J,T,_,function(j){if(x(j))j=null;if(X)X.apply(this,arguments)})}}function $(H){if(!H)return H;return function(J,T,_){try{return H.call(D,J,T,_)}catch(X){if(!x(X))throw X}}}function A(H){if(!H)return H;return function(J,T,_){if(typeof T==="function")_=T,T=null;function X(j,O){if(O){if(O.uid<0)O.uid+=4294967296;if(O.gid<0)O.gid+=4294967296}if(_)_.apply(this,arguments)}return T?H.call(D,J,T,X):H.call(D,J,X)}}function R(H){if(!H)return H;return function(J,T){var _=T?H.call(D,J,T):H.call(D,J);if(_){if(_.uid<0)_.uid+=4294967296;if(_.gid<0)_.gid+=4294967296}return _}}function x(H){if(!H)return!0;if(H.code==="ENOSYS")return!0;var J=!process.getuid||process.getuid()!==0;if(J){if(H.code==="EINVAL"||H.code==="EPERM")return!0}return!1}}});var K2=v((DB,Q2)=>{var q2=o("stream").Stream;Q2.exports=KC;function KC(D){return{ReadStream:u,WriteStream:F};function u(E,C){if(!(this instanceof u))return new u(E,C);q2.call(this);var B=this;this.path=E,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,C=C||{};var $=Object.keys(C);for(var A=0,R=$.length;A<R;A++){var x=$[A];this[x]=C[x]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){B._read()});return}D.open(this.path,this.flags,this.mode,function(H,J){if(H){B.emit("error",H),B.readable=!1;return}B.fd=J,B.emit("open",J),B._read()})}function F(E,C){if(!(this instanceof F))return new F(E,C);q2.call(this),this.path=E,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,C=C||{};var B=Object.keys(C);for(var $=0,A=B.length;$<A;$++){var R=B[$];this[R]=C[R]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var L2=v((uB,W2)=>{W2.exports=LC;var WC=Object.getPrototypeOf||function(D){return D.__proto__};function LC(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var u={__proto__:WC(D)};else var u=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(F){Object.defineProperty(u,F,Object.getOwnPropertyDescriptor(D,F))}),u}});var q0=v((FB,M0)=>{var k=o("fs"),wC=M2(),VC=K2(),fC=L2(),zu=o("util"),r,Uu;if(typeof Symbol==="function"&&typeof Symbol.for==="function")r=Symbol.for("graceful-fs.queue"),Uu=Symbol.for("graceful-fs.previous");else r="___graceful-fs.queue",Uu="___graceful-fs.previous";function yC(){}function V2(D,u){Object.defineProperty(D,r,{get:function(){return u}})}var MD=yC;if(zu.debuglog)MD=zu.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))MD=function(){var D=zu.format.apply(zu,arguments);D="GFS4: "+D.split(/\n/).join(`
29
- GFS4: `),console.error(D)};if(!k[r]){if(U0=global[r]||[],V2(k,U0),k.close=function(D){function u(F,E){return D.call(k,F,function(C){if(!C)w2();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(u,Uu,{value:D}),u}(k.close),k.closeSync=function(D){function u(F){D.apply(k,arguments),w2()}return Object.defineProperty(u,Uu,{value:D}),u}(k.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){MD(k[r]),o("assert").equal(k[r].length,0)})}var U0;if(!global[r])V2(global,k[r]);M0.exports=Z0(fC(k));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!k.__patched)M0.exports=Z0(k),k.__patched=!0;function Z0(D){wC(D),D.gracefulify=Z0,D.createReadStream=DD,D.createWriteStream=_D;var u=D.readFile;D.readFile=F;function F(S,q,Z){if(typeof q==="function")Z=q,q=null;return c(S,q,Z);function c(t,d,P,b){return u(t,d,function(K){if(K&&(K.code==="EMFILE"||K.code==="ENFILE"))yD([c,[t,d,P],K,b||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var E=D.writeFile;D.writeFile=C;function C(S,q,Z,c){if(typeof Z==="function")c=Z,Z=null;return t(S,q,Z,c);function t(d,P,b,K,l){return E(d,P,b,function(L){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[d,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}var B=D.appendFile;if(B)D.appendFile=$;function $(S,q,Z,c){if(typeof Z==="function")c=Z,Z=null;return t(S,q,Z,c);function t(d,P,b,K,l){return B(d,P,b,function(L){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[d,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}var A=D.copyFile;if(A)D.copyFile=R;function R(S,q,Z,c){if(typeof Z==="function")c=Z,Z=0;return t(S,q,Z,c);function t(d,P,b,K,l){return A(d,P,b,function(L){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[d,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}var x=D.readdir;D.readdir=J;var H=/^v[0-5]\./;function J(S,q,Z){if(typeof q==="function")Z=q,q=null;var c=H.test(process.version)?function(P,b,K,l){return x(P,t(P,b,K,l))}:function(P,b,K,l){return x(P,b,t(P,b,K,l))};return c(S,q,Z);function t(d,P,b,K){return function(l,L){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))yD([c,[d,P,b],l,K||Date.now(),Date.now()]);else{if(L&&L.sort)L.sort();if(typeof b==="function")b.call(this,l,L)}}}}if(process.version.substr(0,4)==="v0.8"){var T=VC(D);I=T.ReadStream,z=T.WriteStream}var _=D.ReadStream;if(_)I.prototype=Object.create(_.prototype),I.prototype.open=U;var X=D.WriteStream;if(X)z.prototype=Object.create(X.prototype),z.prototype.open=n;Object.defineProperty(D,"ReadStream",{get:function(){return I},set:function(S){I=S},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return z},set:function(S){z=S},enumerable:!0,configurable:!0});var j=I;Object.defineProperty(D,"FileReadStream",{get:function(){return j},set:function(S){j=S},enumerable:!0,configurable:!0});var O=z;Object.defineProperty(D,"FileWriteStream",{get:function(){return O},set:function(S){O=S},enumerable:!0,configurable:!0});function I(S,q){if(this instanceof I)return _.apply(this,arguments),this;else return I.apply(Object.create(I.prototype),arguments)}function U(){var S=this;du(S.path,S.flags,S.mode,function(q,Z){if(q){if(S.autoClose)S.destroy();S.emit("error",q)}else S.fd=Z,S.emit("open",Z),S.read()})}function z(S,q){if(this instanceof z)return X.apply(this,arguments),this;else return z.apply(Object.create(z.prototype),arguments)}function n(){var S=this;du(S.path,S.flags,S.mode,function(q,Z){if(q)S.destroy(),S.emit("error",q);else S.fd=Z,S.emit("open",Z)})}function DD(S,q){return new D.ReadStream(S,q)}function _D(S,q){return new D.WriteStream(S,q)}var lD=D.open;D.open=du;function du(S,q,Z,c){if(typeof Z==="function")c=Z,Z=null;return t(S,q,Z,c);function t(d,P,b,K,l){return lD(d,P,b,function(L,k8){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[d,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}return D}function yD(D){MD("ENQUEUE",D[0].name,D[1]),k[r].push(D),Y0()}var Iu;function w2(){var D=Date.now();for(var u=0;u<k[r].length;++u)if(k[r][u].length>2)k[r][u][3]=D,k[r][u][4]=D;Y0()}function Y0(){if(clearTimeout(Iu),Iu=void 0,k[r].length===0)return;var D=k[r].shift(),u=D[0],F=D[1],E=D[2],C=D[3],B=D[4];if(C===void 0)MD("RETRY",u.name,F),u.apply(null,F);else if(Date.now()-C>=60000){MD("TIMEOUT",u.name,F);var $=F.pop();if(typeof $==="function")$.call(null,E)}else{var A=Date.now()-B,R=Math.max(B-C,1),x=Math.min(R*1.2,100);if(A>=x)MD("RETRY",u.name,F),u.apply(null,F.concat([C]));else k[r].push(D)}if(Iu===void 0)Iu=setTimeout(Y0,0)}});var y2=v((EB,f2)=>{function ED(D,u){if(typeof u==="boolean")u={forever:u};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=u||{},this._maxRetryTime=u&&u.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}f2.exports=ED;ED.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};ED.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};ED.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var u=new Date().getTime();if(D&&u-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var F=this._timeouts.shift();if(F===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),F=this._timeouts.shift();else return!1;var E=this,C=setTimeout(function(){if(E._attempts++,E._operationTimeoutCb){if(E._timeout=setTimeout(function(){E._operationTimeoutCb(E._attempts)},E._operationTimeout),E._options.unref)E._timeout.unref()}E._fn(E._attempts)},F);if(this._options.unref)C.unref();return!0};ED.prototype.attempt=function(D,u){if(this._fn=D,u){if(u.timeout)this._operationTimeout=u.timeout;if(u.cb)this._operationTimeoutCb=u.cb}var F=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){F._operationTimeoutCb()},F._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};ED.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};ED.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};ED.prototype.start=ED.prototype.try;ED.prototype.errors=function(){return this._errors};ED.prototype.attempts=function(){return this._attempts};ED.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},u=null,F=0;for(var E=0;E<this._errors.length;E++){var C=this._errors[E],B=C.message,$=(D[B]||0)+1;if(D[B]=$,$>=F)u=C,F=$}return u}});var k2=v((kC)=>{var PC=y2();kC.operation=function(D){var u=kC.timeouts(D);return new PC(u,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};kC.timeouts=function(D){if(D instanceof Array)return[].concat(D);var u={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var F in D)u[F]=D[F];if(u.minTimeout>u.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var E=[];for(var C=0;C<u.retries;C++)E.push(this.createTimeout(C,u));if(D&&D.forever&&!E.length)E.push(this.createTimeout(C,u));return E.sort(function(B,$){return B-$}),E};kC.createTimeout=function(D,u){var F=u.randomize?Math.random()+1:1,E=Math.round(F*u.minTimeout*Math.pow(u.factor,D));return E=Math.min(E,u.maxTimeout),E};kC.wrap=function(D,u,F){if(u instanceof Array)F=u,u=null;if(!F){F=[];for(var E in D)if(typeof D[E]==="function")F.push(E)}for(var C=0;C<F.length;C++){var B=F[C],$=D[B];D[B]=function(R){var x=kC.operation(u),H=Array.prototype.slice.call(arguments,1),J=H.pop();H.push(function(T){if(x.retry(T))return;if(T)arguments[0]=x.mainError();J.apply(this,arguments)}),x.attempt(function(){R.apply(D,H)})}.bind(D,$),D[B].options=u}}});var h2=v((BB,Zu)=>{Zu.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")Zu.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Zu.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var b2=v(($B,kD)=>{var y=global.process,qD=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!qD(y))kD.exports=function(){return function(){}};else{if(Q0=o("assert"),QD=h2(),K0=/^win/i.test(y.platform),PD=o("events"),typeof PD!=="function")PD=PD.EventEmitter;if(y.__signal_exit_emitter__)g=y.__signal_exit_emitter__;else g=y.__signal_exit_emitter__=new PD,g.count=0,g.emitted={};if(!g.infinite)g.setMaxListeners(1/0),g.infinite=!0;kD.exports=function(D,u){if(!qD(global.process))return function(){};if(Q0.equal(typeof D,"function","a callback must be provided for exit handler"),KD===!1)Yu();var F="exit";if(u&&u.alwaysLast)F="afterexit";var E=function(){if(g.removeListener(F,D),g.listeners("exit").length===0&&g.listeners("afterexit").length===0)Cu()};return g.on(F,D),E},Cu=function(){if(!KD||!qD(global.process))return;KD=!1,QD.forEach(function(u){try{y.removeListener(u,Bu[u])}catch(F){}}),y.emit=$u,y.reallyExit=Mu,g.count-=1},kD.exports.unload=Cu,XD=function(u,F,E){if(g.emitted[u])return;g.emitted[u]=!0,g.emit(u,F,E)},Bu={},QD.forEach(function(D){Bu[D]=function(){if(!qD(global.process))return;var F=y.listeners(D);if(F.length===g.count){if(Cu(),XD("exit",null,D),XD("afterexit",null,D),K0&&D==="SIGHUP")D="SIGINT";y.kill(y.pid,D)}}}),kD.exports.signals=function(){return QD},KD=!1,Yu=function(){if(KD||!qD(global.process))return;KD=!0,g.count+=1,QD=QD.filter(function(u){try{return y.on(u,Bu[u]),!0}catch(F){return!1}}),y.emit=L0,y.reallyExit=W0},kD.exports.load=Yu,Mu=y.reallyExit,W0=function(u){if(!qD(global.process))return;y.exitCode=u||0,XD("exit",y.exitCode,null),XD("afterexit",y.exitCode,null),Mu.call(y,y.exitCode)},$u=y.emit,L0=function(u,F){if(u==="exit"&&qD(global.process)){if(F!==void 0)y.exitCode=F;var E=$u.apply(this,arguments);return XD("exit",y.exitCode,null),XD("afterexit",y.exitCode,null),E}else return $u.apply(this,arguments)}}var Q0,QD,K0,PD,g,Cu,XD,Bu,KD,Yu,Mu,W0,$u,L0});var m2=v((dC,w0)=>{var v2=Symbol();function mC(D,u,F){let E=u[v2];if(E)return u.stat(D,(B,$)=>{if(B)return F(B);F(null,$.mtime,E)});let C=new Date(Math.ceil(Date.now()/1000)*1000+5);u.utimes(D,C,C,(B)=>{if(B)return F(B);u.stat(D,($,A)=>{if($)return F($);let R=A.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(u,v2,{value:R}),F(null,A.mtime,R)})})}function gC(D){let u=Date.now();if(D==="s")u=Math.ceil(u/1000)*1000;return new Date(u)}dC.probe=mC;dC.getMtime=gC});var t2=v((aC,Hu)=>{var tC=o("path"),y0=q0(),lC=k2(),rC=b2(),g2=m2(),JD={};function Au(D,u){return u.lockfilePath||`${D}.lock`}function P0(D,u,F){if(!u.realpath)return F(null,tC.resolve(D));u.fs.realpath(D,F)}function f0(D,u,F){let E=Au(D,u);u.fs.mkdir(E,(C)=>{if(!C)return g2.probe(E,u.fs,(B,$,A)=>{if(B)return u.fs.rmdir(E,()=>{}),F(B);F(null,$,A)});if(C.code!=="EEXIST")return F(C);if(u.stale<=0)return F(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));u.fs.stat(E,(B,$)=>{if(B){if(B.code==="ENOENT")return f0(D,{...u,stale:0},F);return F(B)}if(!d2($,u))return F(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));n2(D,u,(A)=>{if(A)return F(A);f0(D,{...u,stale:0},F)})})})}function d2(D,u){return D.mtime.getTime()<Date.now()-u.stale}function n2(D,u,F){u.fs.rmdir(Au(D,u),(E)=>{if(E&&E.code!=="ENOENT")return F(E);F()})}function qu(D,u){let F=JD[D];if(F.updateTimeout)return;if(F.updateDelay=F.updateDelay||u.update,F.updateTimeout=setTimeout(()=>{F.updateTimeout=null,u.fs.stat(F.lockfilePath,(E,C)=>{let B=F.lastUpdate+u.stale<Date.now();if(E){if(E.code==="ENOENT"||B)return V0(D,F,Object.assign(E,{code:"ECOMPROMISED"}));return F.updateDelay=1000,qu(D,u)}if(F.mtime.getTime()!==C.mtime.getTime())return V0(D,F,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let A=g2.getMtime(F.mtimePrecision);u.fs.utimes(F.lockfilePath,A,A,(R)=>{let x=F.lastUpdate+u.stale<Date.now();if(F.released)return;if(R){if(R.code==="ENOENT"||x)return V0(D,F,Object.assign(R,{code:"ECOMPROMISED"}));return F.updateDelay=1000,qu(D,u)}F.mtime=A,F.lastUpdate=Date.now(),F.updateDelay=null,qu(D,u)})})},F.updateDelay),F.updateTimeout.unref)F.updateTimeout.unref()}function V0(D,u,F){if(u.released=!0,u.updateTimeout)clearTimeout(u.updateTimeout);if(JD[D]===u)delete JD[D];u.options.onCompromised(F)}function pC(D,u,F){u={stale:1e4,update:null,realpath:!0,retries:0,fs:y0,onCompromised:(E)=>{throw E},...u},u.retries=u.retries||0,u.retries=typeof u.retries==="number"?{retries:u.retries}:u.retries,u.stale=Math.max(u.stale||0,2000),u.update=u.update==null?u.stale/2:u.update||0,u.update=Math.max(Math.min(u.update,u.stale/2),1000),P0(D,u,(E,C)=>{if(E)return F(E);let B=lC.operation(u.retries);B.attempt(()=>{f0(C,u,($,A,R)=>{if(B.retry($))return;if($)return F(B.mainError());let x=JD[C]={lockfilePath:Au(C,u),mtime:A,mtimePrecision:R,options:u,lastUpdate:Date.now()};qu(C,u),F(null,(H)=>{if(x.released)return H&&H(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));c2(C,{...u,realpath:!1},H)})})})})}function c2(D,u,F){u={fs:y0,realpath:!0,...u},P0(D,u,(E,C)=>{if(E)return F(E);let B=JD[C];if(!B)return F(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));B.updateTimeout&&clearTimeout(B.updateTimeout),B.released=!0,delete JD[C],n2(C,u,F)})}function iC(D,u,F){u={stale:1e4,realpath:!0,fs:y0,...u},u.stale=Math.max(u.stale||0,2000),P0(D,u,(E,C)=>{if(E)return F(E);u.fs.stat(Au(C,u),(B,$)=>{if(B)return B.code==="ENOENT"?F(null,!1):F(B);return F(null,!d2($,u))})})}function oC(){return JD}rC(()=>{for(let D in JD){let u=JD[D].options;try{u.fs.rmdirSync(Au(D,u))}catch(F){}}});aC.lock=pC;aC.unlock=c2;aC.check=iC;aC.getLocks=oC});var r2=v((AB,l2)=>{var F8=q0();function E8(D){let u=["mkdir","realpath","stat","rmdir","utimes"],F={...D};return u.forEach((E)=>{F[E]=(...C)=>{let B=C.pop(),$;try{$=D[`${E}Sync`](...C)}catch(A){return B(A)}B(null,$)}}),F}function C8(D){return(...u)=>new Promise((F,E)=>{u.push((C,B)=>{if(C)E(C);else F(B)}),D(...u)})}function B8(D){return(...u)=>{let F,E;if(u.push((C,B)=>{F=C,E=B}),D(...u),F)throw F;return E}}function $8(D){if(D={...D},D.fs=E8(D.fs||F8),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}l2.exports={toPromise:C8,toSync:B8,toSyncOptions:$8}});var i2=v((HB,GD)=>{var hD=t2(),{toPromise:Qu,toSync:Ku,toSyncOptions:k0}=r2();async function p2(D,u){let F=await Qu(hD.lock)(D,u);return Qu(F)}function A8(D,u){let F=Ku(hD.lock)(D,k0(u));return Ku(F)}function H8(D,u){return Qu(hD.unlock)(D,u)}function x8(D,u){return Ku(hD.unlock)(D,k0(u))}function J8(D,u){return Qu(hD.check)(D,u)}function N8(D,u){return Ku(hD.check)(D,k0(u))}GD.exports=p2;GD.exports.lock=p2;GD.exports.unlock=H8;GD.exports.lockSync=A8;GD.exports.unlockSync=x8;GD.exports.check=J8;GD.exports.checkSync=N8});var Q3=v((Z4,q3)=>{var nD=1000,cD=nD*60,tD=cD*60,wD=tD*24,q8=wD*7,Q8=wD*365.25;q3.exports=function(D,u){u=u||{};var F=typeof D;if(F==="string"&&D.length>0)return K8(D);else if(F==="number"&&isFinite(D))return u.long?L8(D):W8(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function K8(D){if(D=String(D),D.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(D);if(!u)return;var F=parseFloat(u[1]),E=(u[2]||"ms").toLowerCase();switch(E){case"years":case"year":case"yrs":case"yr":case"y":return F*Q8;case"weeks":case"week":case"w":return F*q8;case"days":case"day":case"d":return F*wD;case"hours":case"hour":case"hrs":case"hr":case"h":return F*tD;case"minutes":case"minute":case"mins":case"min":case"m":return F*cD;case"seconds":case"second":case"secs":case"sec":case"s":return F*nD;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return F;default:return}}function W8(D){var u=Math.abs(D);if(u>=wD)return Math.round(D/wD)+"d";if(u>=tD)return Math.round(D/tD)+"h";if(u>=cD)return Math.round(D/cD)+"m";if(u>=nD)return Math.round(D/nD)+"s";return D+"ms"}function L8(D){var u=Math.abs(D);if(u>=wD)return gu(D,u,wD,"day");if(u>=tD)return gu(D,u,tD,"hour");if(u>=cD)return gu(D,u,cD,"minute");if(u>=nD)return gu(D,u,nD,"second");return D+" ms"}function gu(D,u,F,E){var C=u>=F*1.5;return Math.round(D/F)+" "+E+(C?"s":"")}});var YF=rD(ZF(),1),{program:t8,createCommand:l8,createArgument:r8,createOption:p8,CommanderError:i8,InvalidArgumentError:o8,InvalidOptionArgumentError:a8,Command:MF,Argument:s8,Option:e8,Help:D6}=YF.default;var qF=(D=0)=>(u)=>`\x1B[${u+D}m`,QF=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,KF=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,w={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]}},F6=Object.keys(w.modifier),LE=Object.keys(w.color),wE=Object.keys(w.bgColor),E6=[...LE,...wE];function VE(){let D=new Map;for(let[u,F]of Object.entries(w)){for(let[E,C]of Object.entries(F))w[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=w[E],D.set(C[0],C[1]);Object.defineProperty(w,u,{value:F,enumerable:!1})}return Object.defineProperty(w,"codes",{value:D,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.color.ansi=qF(),w.color.ansi256=QF(),w.color.ansi16m=KF(),w.bgColor.ansi=qF(10),w.bgColor.ansi256=QF(10),w.bgColor.ansi16m=KF(10),Object.defineProperties(w,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((B)=>B+B).join("");let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>w.rgbToAnsi256(...w.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let A=u%36;F=Math.floor(u/36)/5,E=Math.floor(A/6)/5,C=A%6/5}let B=Math.max(F,E,C)*2;if(B===0)return 30;let $=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));if(B===2)$+=60;return $},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>w.ansi256ToAnsi(w.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>w.ansi256ToAnsi(w.hexToAnsi256(u)),enumerable:!1}}),w}var fE=VE(),CD=fE;import au from"process";import yE from"os";import WF from"tty";function uD(D,u=globalThis.Deno?globalThis.Deno.args:au.argv){let F=D.startsWith("-")?"":D.length===1?"-":"--",E=u.indexOf(F+D),C=u.indexOf("--");return E!==-1&&(C===-1||E<C)}var{env:V}=au,Nu;if(uD("no-color")||uD("no-colors")||uD("color=false")||uD("color=never"))Nu=0;else if(uD("color")||uD("colors")||uD("color=true")||uD("color=always"))Nu=1;function PE(){if("FORCE_COLOR"in V){if(V.FORCE_COLOR==="true")return 1;if(V.FORCE_COLOR==="false")return 0;return V.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(V.FORCE_COLOR,10),3)}}function kE(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function hE(D,{streamIsTTY:u,sniffFlags:F=!0}={}){let E=PE();if(E!==void 0)Nu=E;let C=F?Nu:E;if(C===0)return 0;if(F){if(uD("color=16m")||uD("color=full")||uD("color=truecolor"))return 3;if(uD("color=256"))return 2}if("TF_BUILD"in V&&"AGENT_NAME"in V)return 1;if(D&&!u&&C===void 0)return 0;let B=C||0;if(V.TERM==="dumb")return B;if(au.platform==="win32"){let $=yE.release().split(".");if(Number($[0])>=10&&Number($[2])>=10586)return Number($[2])>=14931?3:2;return 1}if("CI"in V){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(($)=>($ in V)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(($)=>($ in V))||V.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in V)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(V.TEAMCITY_VERSION)?1:0;if(V.COLORTERM==="truecolor")return 3;if(V.TERM==="xterm-kitty")return 3;if(V.TERM==="xterm-ghostty")return 3;if(V.TERM==="wezterm")return 3;if("TERM_PROGRAM"in V){let $=Number.parseInt((V.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(V.TERM_PROGRAM){case"iTerm.app":return $>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(V.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(V.TERM))return 1;if("COLORTERM"in V)return 1;return B}function LF(D,u={}){let F=hE(D,{streamIsTTY:D&&D.isTTY,...u});return kE(F)}var bE={stdout:LF({isTTY:WF.isatty(1)}),stderr:LF({isTTY:WF.isatty(2)})},wF=bE;function VF(D,u,F){let E=D.indexOf(u);if(E===-1)return D;let C=u.length,B=0,$="";do $+=D.slice(B,E)+u+F,B=E+C,E=D.indexOf(u,B);while(E!==-1);return $+=D.slice(B),$}function fF(D,u,F,E){let C=0,B="";do{let $=D[E-1]==="\r";B+=D.slice(C,$?E-1:E)+u+($?`\r
28
+ `)}),this}_outputHelpIfRequested(D){let u=this._getHelpOption();if(u&&D.find((E)=>u.is(E)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function OF(D){return D.map((u)=>{if(!u.startsWith("--inspect"))return u;let F,E="127.0.0.1",C="9229",B;if((B=u.match(/^(--inspect(-brk)?)$/))!==null)F=B[1];else if((B=u.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(F=B[1],/^\d+$/.test(B[3]))C=B[3];else E=B[3];else if((B=u.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)F=B[1],E=B[3],C=B[4];if(F&&C!=="0")return`${F}=${E}:${parseInt(C)+1}`;return u})}function pu(){if(Y.env.NO_COLOR||Y.env.FORCE_COLOR==="0"||Y.env.FORCE_COLOR==="false")return!1;if(Y.env.FORCE_COLOR||Y.env.CLICOLOR_FORCE!==void 0)return!0;return}_E.Command=iu;_E.useColor=pu});var ZF=v((OE)=>{var{Argument:zF}=xu(),{Command:ou}=SF(),{CommanderError:GE,InvalidArgumentError:IF}=pD(),{Help:jE}=cu(),{Option:UF}=tu();OE.program=new ou;OE.createCommand=(D)=>new ou(D);OE.createOption=(D,u)=>new UF(D,u);OE.createArgument=(D,u)=>new zF(D,u);OE.Command=ou;OE.Option=UF;OE.Argument=zF;OE.Help=jE;OE.CommanderError=GE;OE.InvalidArgumentError=IF;OE.InvalidOptionArgumentError=IF});var pF=v((d6,rF)=>{rF.exports=FC;function uC(D){let u={defaultWidth:0,output:process.stdout,tty:o("tty")};if(!D)return u;return Object.keys(u).forEach(function(F){if(!D[F])D[F]=u[F]}),D}function FC(D){let u=uC(D);if(u.output.getWindowSize)return u.output.getWindowSize()[0]||u.defaultWidth;if(u.tty.getWindowSize)return u.tty.getWindowSize()[1]||u.defaultWidth;if(u.output.columns)return u.output.columns;if(process.env.CLI_WIDTH){let F=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(F)&&F!==0)return F}return u.defaultWidth}});var R2=v((R1,N2)=>{var GC=o("stream");class J2 extends GC{#F=null;constructor(D={}){super(D);this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=D.replace,this._prompt=D.prompt||null,this._hadControl=!1}#u(D,u){if(this._dest)return this._dest[D];if(this._src)return this._src[D];return u}#D(D,...u){if(typeof this._dest?.[D]==="function")this._dest[D](...u);if(typeof this._src?.[D]==="function")this._src[D](...u)}get isTTY(){if(this.#F!==null)return this.#F;return this.#u("isTTY",!1)}set isTTY(D){this.#F=D}get rows(){return this.#u("rows")}get columns(){return this.#u("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(D){this._src=D}pipe(D,u){return this._dest=D,super.pipe(D,u)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(D){if(this.muted){if(!this.replace)return!0;if(D.match(/^\u001b/)){if(D.indexOf(this._prompt)===0)D=D.slice(this._prompt.length),D=D.replace(/./g,this.replace),D=this._prompt+D;return this._hadControl=!0,this.emit("data",D)}else{if(this._prompt&&this._hadControl&&D.indexOf(this._prompt)===0)this._hadControl=!1,this.emit("data",this._prompt),D=D.slice(this._prompt.length);D=D.toString().replace(/./g,this.replace)}}this.emit("data",D)}end(D){if(this.muted)if(D&&this.replace)D=D.toString().replace(/./g,this.replace);else D=null;if(D)this.emit("data",D);this.emit("end")}destroy(...D){return this.#D("destroy",...D)}destroySoon(...D){return this.#D("destroySoon",...D)}close(...D){return this.#D("close",...D)}}N2.exports=J2});var M2=v((e1,Y2)=>{var TD=o("constants"),MC=process.cwd,Ou=null,qC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Ou)Ou=MC.call(process);return Ou};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(Su=process.chdir,process.chdir=function(D){Ou=null,Su.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,Su)}var Su;Y2.exports=QC;function QC(D){if(TD.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))u(D);if(!D.lutimes)F(D);if(D.chown=B(D.chown),D.fchown=B(D.fchown),D.lchown=B(D.lchown),D.chmod=E(D.chmod),D.fchmod=E(D.fchmod),D.lchmod=E(D.lchmod),D.chownSync=$(D.chownSync),D.fchownSync=$(D.fchownSync),D.lchownSync=$(D.lchownSync),D.chmodSync=C(D.chmodSync),D.fchmodSync=C(D.fchmodSync),D.lchmodSync=C(D.lchmodSync),D.stat=A(D.stat),D.fstat=A(D.fstat),D.lstat=A(D.lstat),D.statSync=R(D.statSync),D.fstatSync=R(D.fstatSync),D.lstatSync=R(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(H,J,T){if(T)process.nextTick(T)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(H,J,T,_){if(_)process.nextTick(_)},D.lchownSync=function(){};if(qC==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(H){function J(T,_,X){var j=Date.now(),O=0;H(T,_,function I(U){if(U&&(U.code==="EACCES"||U.code==="EPERM"||U.code==="EBUSY")&&Date.now()-j<60000){if(setTimeout(function(){D.stat(_,function(z,d){if(z&&z.code==="ENOENT")H(T,_,I);else X(U)})},O),O<100)O+=10;return}if(X)X(U)})}if(Object.setPrototypeOf)Object.setPrototypeOf(J,H);return J}(D.rename);D.read=typeof D.read!=="function"?D.read:function(H){function J(T,_,X,j,O,I){var U;if(I&&typeof I==="function"){var z=0;U=function(d,DD,_D){if(d&&d.code==="EAGAIN"&&z<10)return z++,H.call(D,T,_,X,j,O,U);I.apply(this,arguments)}}return H.call(D,T,_,X,j,O,U)}if(Object.setPrototypeOf)Object.setPrototypeOf(J,H);return J}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(H){return function(J,T,_,X,j){var O=0;while(!0)try{return H.call(D,J,T,_,X,j)}catch(I){if(I.code==="EAGAIN"&&O<10){O++;continue}throw I}}}(D.readSync);function u(H){H.lchmod=function(J,T,_){H.open(J,TD.O_WRONLY|TD.O_SYMLINK,T,function(X,j){if(X){if(_)_(X);return}H.fchmod(j,T,function(O){H.close(j,function(I){if(_)_(O||I)})})})},H.lchmodSync=function(J,T){var _=H.openSync(J,TD.O_WRONLY|TD.O_SYMLINK,T),X=!0,j;try{j=H.fchmodSync(_,T),X=!1}finally{if(X)try{H.closeSync(_)}catch(O){}else H.closeSync(_)}return j}}function F(H){if(TD.hasOwnProperty("O_SYMLINK")&&H.futimes)H.lutimes=function(J,T,_,X){H.open(J,TD.O_SYMLINK,function(j,O){if(j){if(X)X(j);return}H.futimes(O,T,_,function(I){H.close(O,function(U){if(X)X(I||U)})})})},H.lutimesSync=function(J,T,_){var X=H.openSync(J,TD.O_SYMLINK),j,O=!0;try{j=H.futimesSync(X,T,_),O=!1}finally{if(O)try{H.closeSync(X)}catch(I){}else H.closeSync(X)}return j};else if(H.futimes)H.lutimes=function(J,T,_,X){if(X)process.nextTick(X)},H.lutimesSync=function(){}}function E(H){if(!H)return H;return function(J,T,_){return H.call(D,J,T,function(X){if(x(X))X=null;if(_)_.apply(this,arguments)})}}function C(H){if(!H)return H;return function(J,T){try{return H.call(D,J,T)}catch(_){if(!x(_))throw _}}}function B(H){if(!H)return H;return function(J,T,_,X){return H.call(D,J,T,_,function(j){if(x(j))j=null;if(X)X.apply(this,arguments)})}}function $(H){if(!H)return H;return function(J,T,_){try{return H.call(D,J,T,_)}catch(X){if(!x(X))throw X}}}function A(H){if(!H)return H;return function(J,T,_){if(typeof T==="function")_=T,T=null;function X(j,O){if(O){if(O.uid<0)O.uid+=4294967296;if(O.gid<0)O.gid+=4294967296}if(_)_.apply(this,arguments)}return T?H.call(D,J,T,X):H.call(D,J,X)}}function R(H){if(!H)return H;return function(J,T){var _=T?H.call(D,J,T):H.call(D,J);if(_){if(_.uid<0)_.uid+=4294967296;if(_.gid<0)_.gid+=4294967296}return _}}function x(H){if(!H)return!0;if(H.code==="ENOSYS")return!0;var J=!process.getuid||process.getuid()!==0;if(J){if(H.code==="EINVAL"||H.code==="EPERM")return!0}return!1}}});var K2=v((DB,Q2)=>{var q2=o("stream").Stream;Q2.exports=KC;function KC(D){return{ReadStream:u,WriteStream:F};function u(E,C){if(!(this instanceof u))return new u(E,C);q2.call(this);var B=this;this.path=E,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,C=C||{};var $=Object.keys(C);for(var A=0,R=$.length;A<R;A++){var x=$[A];this[x]=C[x]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){B._read()});return}D.open(this.path,this.flags,this.mode,function(H,J){if(H){B.emit("error",H),B.readable=!1;return}B.fd=J,B.emit("open",J),B._read()})}function F(E,C){if(!(this instanceof F))return new F(E,C);q2.call(this),this.path=E,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,C=C||{};var B=Object.keys(C);for(var $=0,A=B.length;$<A;$++){var R=B[$];this[R]=C[R]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var L2=v((uB,W2)=>{W2.exports=LC;var WC=Object.getPrototypeOf||function(D){return D.__proto__};function LC(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var u={__proto__:WC(D)};else var u=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(F){Object.defineProperty(u,F,Object.getOwnPropertyDescriptor(D,F))}),u}});var q0=v((FB,M0)=>{var k=o("fs"),wC=M2(),VC=K2(),fC=L2(),zu=o("util"),r,Uu;if(typeof Symbol==="function"&&typeof Symbol.for==="function")r=Symbol.for("graceful-fs.queue"),Uu=Symbol.for("graceful-fs.previous");else r="___graceful-fs.queue",Uu="___graceful-fs.previous";function yC(){}function V2(D,u){Object.defineProperty(D,r,{get:function(){return u}})}var MD=yC;if(zu.debuglog)MD=zu.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))MD=function(){var D=zu.format.apply(zu,arguments);D="GFS4: "+D.split(/\n/).join(`
29
+ GFS4: `),console.error(D)};if(!k[r]){if(U0=global[r]||[],V2(k,U0),k.close=function(D){function u(F,E){return D.call(k,F,function(C){if(!C)w2();if(typeof E==="function")E.apply(this,arguments)})}return Object.defineProperty(u,Uu,{value:D}),u}(k.close),k.closeSync=function(D){function u(F){D.apply(k,arguments),w2()}return Object.defineProperty(u,Uu,{value:D}),u}(k.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){MD(k[r]),o("assert").equal(k[r].length,0)})}var U0;if(!global[r])V2(global,k[r]);M0.exports=Z0(fC(k));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!k.__patched)M0.exports=Z0(k),k.__patched=!0;function Z0(D){wC(D),D.gracefulify=Z0,D.createReadStream=DD,D.createWriteStream=_D;var u=D.readFile;D.readFile=F;function F(S,q,Z){if(typeof q==="function")Z=q,q=null;return c(S,q,Z);function c(t,n,P,b){return u(t,n,function(K){if(K&&(K.code==="EMFILE"||K.code==="ENFILE"))yD([c,[t,n,P],K,b||Date.now(),Date.now()]);else if(typeof P==="function")P.apply(this,arguments)})}}var E=D.writeFile;D.writeFile=C;function C(S,q,Z,c){if(typeof Z==="function")c=Z,Z=null;return t(S,q,Z,c);function t(n,P,b,K,l){return E(n,P,b,function(L){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[n,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}var B=D.appendFile;if(B)D.appendFile=$;function $(S,q,Z,c){if(typeof Z==="function")c=Z,Z=null;return t(S,q,Z,c);function t(n,P,b,K,l){return B(n,P,b,function(L){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[n,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}var A=D.copyFile;if(A)D.copyFile=R;function R(S,q,Z,c){if(typeof Z==="function")c=Z,Z=0;return t(S,q,Z,c);function t(n,P,b,K,l){return A(n,P,b,function(L){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[n,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}var x=D.readdir;D.readdir=J;var H=/^v[0-5]\./;function J(S,q,Z){if(typeof q==="function")Z=q,q=null;var c=H.test(process.version)?function(P,b,K,l){return x(P,t(P,b,K,l))}:function(P,b,K,l){return x(P,b,t(P,b,K,l))};return c(S,q,Z);function t(n,P,b,K){return function(l,L){if(l&&(l.code==="EMFILE"||l.code==="ENFILE"))yD([c,[n,P,b],l,K||Date.now(),Date.now()]);else{if(L&&L.sort)L.sort();if(typeof b==="function")b.call(this,l,L)}}}}if(process.version.substr(0,4)==="v0.8"){var T=VC(D);I=T.ReadStream,z=T.WriteStream}var _=D.ReadStream;if(_)I.prototype=Object.create(_.prototype),I.prototype.open=U;var X=D.WriteStream;if(X)z.prototype=Object.create(X.prototype),z.prototype.open=d;Object.defineProperty(D,"ReadStream",{get:function(){return I},set:function(S){I=S},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return z},set:function(S){z=S},enumerable:!0,configurable:!0});var j=I;Object.defineProperty(D,"FileReadStream",{get:function(){return j},set:function(S){j=S},enumerable:!0,configurable:!0});var O=z;Object.defineProperty(D,"FileWriteStream",{get:function(){return O},set:function(S){O=S},enumerable:!0,configurable:!0});function I(S,q){if(this instanceof I)return _.apply(this,arguments),this;else return I.apply(Object.create(I.prototype),arguments)}function U(){var S=this;nu(S.path,S.flags,S.mode,function(q,Z){if(q){if(S.autoClose)S.destroy();S.emit("error",q)}else S.fd=Z,S.emit("open",Z),S.read()})}function z(S,q){if(this instanceof z)return X.apply(this,arguments),this;else return z.apply(Object.create(z.prototype),arguments)}function d(){var S=this;nu(S.path,S.flags,S.mode,function(q,Z){if(q)S.destroy(),S.emit("error",q);else S.fd=Z,S.emit("open",Z)})}function DD(S,q){return new D.ReadStream(S,q)}function _D(S,q){return new D.WriteStream(S,q)}var lD=D.open;D.open=nu;function nu(S,q,Z,c){if(typeof Z==="function")c=Z,Z=null;return t(S,q,Z,c);function t(n,P,b,K,l){return lD(n,P,b,function(L,k8){if(L&&(L.code==="EMFILE"||L.code==="ENFILE"))yD([t,[n,P,b,K],L,l||Date.now(),Date.now()]);else if(typeof K==="function")K.apply(this,arguments)})}}return D}function yD(D){MD("ENQUEUE",D[0].name,D[1]),k[r].push(D),Y0()}var Iu;function w2(){var D=Date.now();for(var u=0;u<k[r].length;++u)if(k[r][u].length>2)k[r][u][3]=D,k[r][u][4]=D;Y0()}function Y0(){if(clearTimeout(Iu),Iu=void 0,k[r].length===0)return;var D=k[r].shift(),u=D[0],F=D[1],E=D[2],C=D[3],B=D[4];if(C===void 0)MD("RETRY",u.name,F),u.apply(null,F);else if(Date.now()-C>=60000){MD("TIMEOUT",u.name,F);var $=F.pop();if(typeof $==="function")$.call(null,E)}else{var A=Date.now()-B,R=Math.max(B-C,1),x=Math.min(R*1.2,100);if(A>=x)MD("RETRY",u.name,F),u.apply(null,F.concat([C]));else k[r].push(D)}if(Iu===void 0)Iu=setTimeout(Y0,0)}});var y2=v((EB,f2)=>{function ED(D,u){if(typeof u==="boolean")u={forever:u};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=u||{},this._maxRetryTime=u&&u.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}f2.exports=ED;ED.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};ED.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};ED.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var u=new Date().getTime();if(D&&u-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var F=this._timeouts.shift();if(F===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),F=this._timeouts.shift();else return!1;var E=this,C=setTimeout(function(){if(E._attempts++,E._operationTimeoutCb){if(E._timeout=setTimeout(function(){E._operationTimeoutCb(E._attempts)},E._operationTimeout),E._options.unref)E._timeout.unref()}E._fn(E._attempts)},F);if(this._options.unref)C.unref();return!0};ED.prototype.attempt=function(D,u){if(this._fn=D,u){if(u.timeout)this._operationTimeout=u.timeout;if(u.cb)this._operationTimeoutCb=u.cb}var F=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){F._operationTimeoutCb()},F._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};ED.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};ED.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};ED.prototype.start=ED.prototype.try;ED.prototype.errors=function(){return this._errors};ED.prototype.attempts=function(){return this._attempts};ED.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},u=null,F=0;for(var E=0;E<this._errors.length;E++){var C=this._errors[E],B=C.message,$=(D[B]||0)+1;if(D[B]=$,$>=F)u=C,F=$}return u}});var k2=v((kC)=>{var PC=y2();kC.operation=function(D){var u=kC.timeouts(D);return new PC(u,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};kC.timeouts=function(D){if(D instanceof Array)return[].concat(D);var u={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var F in D)u[F]=D[F];if(u.minTimeout>u.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var E=[];for(var C=0;C<u.retries;C++)E.push(this.createTimeout(C,u));if(D&&D.forever&&!E.length)E.push(this.createTimeout(C,u));return E.sort(function(B,$){return B-$}),E};kC.createTimeout=function(D,u){var F=u.randomize?Math.random()+1:1,E=Math.round(F*u.minTimeout*Math.pow(u.factor,D));return E=Math.min(E,u.maxTimeout),E};kC.wrap=function(D,u,F){if(u instanceof Array)F=u,u=null;if(!F){F=[];for(var E in D)if(typeof D[E]==="function")F.push(E)}for(var C=0;C<F.length;C++){var B=F[C],$=D[B];D[B]=function(R){var x=kC.operation(u),H=Array.prototype.slice.call(arguments,1),J=H.pop();H.push(function(T){if(x.retry(T))return;if(T)arguments[0]=x.mainError();J.apply(this,arguments)}),x.attempt(function(){R.apply(D,H)})}.bind(D,$),D[B].options=u}}});var h2=v((BB,Zu)=>{Zu.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")Zu.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Zu.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var b2=v(($B,kD)=>{var y=global.process,qD=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!qD(y))kD.exports=function(){return function(){}};else{if(Q0=o("assert"),QD=h2(),K0=/^win/i.test(y.platform),PD=o("events"),typeof PD!=="function")PD=PD.EventEmitter;if(y.__signal_exit_emitter__)g=y.__signal_exit_emitter__;else g=y.__signal_exit_emitter__=new PD,g.count=0,g.emitted={};if(!g.infinite)g.setMaxListeners(1/0),g.infinite=!0;kD.exports=function(D,u){if(!qD(global.process))return function(){};if(Q0.equal(typeof D,"function","a callback must be provided for exit handler"),KD===!1)Yu();var F="exit";if(u&&u.alwaysLast)F="afterexit";var E=function(){if(g.removeListener(F,D),g.listeners("exit").length===0&&g.listeners("afterexit").length===0)Cu()};return g.on(F,D),E},Cu=function(){if(!KD||!qD(global.process))return;KD=!1,QD.forEach(function(u){try{y.removeListener(u,Bu[u])}catch(F){}}),y.emit=$u,y.reallyExit=Mu,g.count-=1},kD.exports.unload=Cu,XD=function(u,F,E){if(g.emitted[u])return;g.emitted[u]=!0,g.emit(u,F,E)},Bu={},QD.forEach(function(D){Bu[D]=function(){if(!qD(global.process))return;var F=y.listeners(D);if(F.length===g.count){if(Cu(),XD("exit",null,D),XD("afterexit",null,D),K0&&D==="SIGHUP")D="SIGINT";y.kill(y.pid,D)}}}),kD.exports.signals=function(){return QD},KD=!1,Yu=function(){if(KD||!qD(global.process))return;KD=!0,g.count+=1,QD=QD.filter(function(u){try{return y.on(u,Bu[u]),!0}catch(F){return!1}}),y.emit=L0,y.reallyExit=W0},kD.exports.load=Yu,Mu=y.reallyExit,W0=function(u){if(!qD(global.process))return;y.exitCode=u||0,XD("exit",y.exitCode,null),XD("afterexit",y.exitCode,null),Mu.call(y,y.exitCode)},$u=y.emit,L0=function(u,F){if(u==="exit"&&qD(global.process)){if(F!==void 0)y.exitCode=F;var E=$u.apply(this,arguments);return XD("exit",y.exitCode,null),XD("afterexit",y.exitCode,null),E}else return $u.apply(this,arguments)}}var Q0,QD,K0,PD,g,Cu,XD,Bu,KD,Yu,Mu,W0,$u,L0});var m2=v((nC,w0)=>{var v2=Symbol();function mC(D,u,F){let E=u[v2];if(E)return u.stat(D,(B,$)=>{if(B)return F(B);F(null,$.mtime,E)});let C=new Date(Math.ceil(Date.now()/1000)*1000+5);u.utimes(D,C,C,(B)=>{if(B)return F(B);u.stat(D,($,A)=>{if($)return F($);let R=A.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty(u,v2,{value:R}),F(null,A.mtime,R)})})}function gC(D){let u=Date.now();if(D==="s")u=Math.ceil(u/1000)*1000;return new Date(u)}nC.probe=mC;nC.getMtime=gC});var t2=v((aC,Hu)=>{var tC=o("path"),y0=q0(),lC=k2(),rC=b2(),g2=m2(),JD={};function Au(D,u){return u.lockfilePath||`${D}.lock`}function P0(D,u,F){if(!u.realpath)return F(null,tC.resolve(D));u.fs.realpath(D,F)}function f0(D,u,F){let E=Au(D,u);u.fs.mkdir(E,(C)=>{if(!C)return g2.probe(E,u.fs,(B,$,A)=>{if(B)return u.fs.rmdir(E,()=>{}),F(B);F(null,$,A)});if(C.code!=="EEXIST")return F(C);if(u.stale<=0)return F(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));u.fs.stat(E,(B,$)=>{if(B){if(B.code==="ENOENT")return f0(D,{...u,stale:0},F);return F(B)}if(!n2($,u))return F(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));d2(D,u,(A)=>{if(A)return F(A);f0(D,{...u,stale:0},F)})})})}function n2(D,u){return D.mtime.getTime()<Date.now()-u.stale}function d2(D,u,F){u.fs.rmdir(Au(D,u),(E)=>{if(E&&E.code!=="ENOENT")return F(E);F()})}function qu(D,u){let F=JD[D];if(F.updateTimeout)return;if(F.updateDelay=F.updateDelay||u.update,F.updateTimeout=setTimeout(()=>{F.updateTimeout=null,u.fs.stat(F.lockfilePath,(E,C)=>{let B=F.lastUpdate+u.stale<Date.now();if(E){if(E.code==="ENOENT"||B)return V0(D,F,Object.assign(E,{code:"ECOMPROMISED"}));return F.updateDelay=1000,qu(D,u)}if(F.mtime.getTime()!==C.mtime.getTime())return V0(D,F,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let A=g2.getMtime(F.mtimePrecision);u.fs.utimes(F.lockfilePath,A,A,(R)=>{let x=F.lastUpdate+u.stale<Date.now();if(F.released)return;if(R){if(R.code==="ENOENT"||x)return V0(D,F,Object.assign(R,{code:"ECOMPROMISED"}));return F.updateDelay=1000,qu(D,u)}F.mtime=A,F.lastUpdate=Date.now(),F.updateDelay=null,qu(D,u)})})},F.updateDelay),F.updateTimeout.unref)F.updateTimeout.unref()}function V0(D,u,F){if(u.released=!0,u.updateTimeout)clearTimeout(u.updateTimeout);if(JD[D]===u)delete JD[D];u.options.onCompromised(F)}function pC(D,u,F){u={stale:1e4,update:null,realpath:!0,retries:0,fs:y0,onCompromised:(E)=>{throw E},...u},u.retries=u.retries||0,u.retries=typeof u.retries==="number"?{retries:u.retries}:u.retries,u.stale=Math.max(u.stale||0,2000),u.update=u.update==null?u.stale/2:u.update||0,u.update=Math.max(Math.min(u.update,u.stale/2),1000),P0(D,u,(E,C)=>{if(E)return F(E);let B=lC.operation(u.retries);B.attempt(()=>{f0(C,u,($,A,R)=>{if(B.retry($))return;if($)return F(B.mainError());let x=JD[C]={lockfilePath:Au(C,u),mtime:A,mtimePrecision:R,options:u,lastUpdate:Date.now()};qu(C,u),F(null,(H)=>{if(x.released)return H&&H(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));c2(C,{...u,realpath:!1},H)})})})})}function c2(D,u,F){u={fs:y0,realpath:!0,...u},P0(D,u,(E,C)=>{if(E)return F(E);let B=JD[C];if(!B)return F(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));B.updateTimeout&&clearTimeout(B.updateTimeout),B.released=!0,delete JD[C],d2(C,u,F)})}function iC(D,u,F){u={stale:1e4,realpath:!0,fs:y0,...u},u.stale=Math.max(u.stale||0,2000),P0(D,u,(E,C)=>{if(E)return F(E);u.fs.stat(Au(C,u),(B,$)=>{if(B)return B.code==="ENOENT"?F(null,!1):F(B);return F(null,!n2($,u))})})}function oC(){return JD}rC(()=>{for(let D in JD){let u=JD[D].options;try{u.fs.rmdirSync(Au(D,u))}catch(F){}}});aC.lock=pC;aC.unlock=c2;aC.check=iC;aC.getLocks=oC});var r2=v((AB,l2)=>{var F8=q0();function E8(D){let u=["mkdir","realpath","stat","rmdir","utimes"],F={...D};return u.forEach((E)=>{F[E]=(...C)=>{let B=C.pop(),$;try{$=D[`${E}Sync`](...C)}catch(A){return B(A)}B(null,$)}}),F}function C8(D){return(...u)=>new Promise((F,E)=>{u.push((C,B)=>{if(C)E(C);else F(B)}),D(...u)})}function B8(D){return(...u)=>{let F,E;if(u.push((C,B)=>{F=C,E=B}),D(...u),F)throw F;return E}}function $8(D){if(D={...D},D.fs=E8(D.fs||F8),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}l2.exports={toPromise:C8,toSync:B8,toSyncOptions:$8}});var i2=v((HB,GD)=>{var hD=t2(),{toPromise:Qu,toSync:Ku,toSyncOptions:k0}=r2();async function p2(D,u){let F=await Qu(hD.lock)(D,u);return Qu(F)}function A8(D,u){let F=Ku(hD.lock)(D,k0(u));return Ku(F)}function H8(D,u){return Qu(hD.unlock)(D,u)}function x8(D,u){return Ku(hD.unlock)(D,k0(u))}function J8(D,u){return Qu(hD.check)(D,u)}function N8(D,u){return Ku(hD.check)(D,k0(u))}GD.exports=p2;GD.exports.lock=p2;GD.exports.unlock=H8;GD.exports.lockSync=A8;GD.exports.unlockSync=x8;GD.exports.check=J8;GD.exports.checkSync=N8});var Q3=v((Z4,q3)=>{var dD=1000,cD=dD*60,tD=cD*60,wD=tD*24,q8=wD*7,Q8=wD*365.25;q3.exports=function(D,u){u=u||{};var F=typeof D;if(F==="string"&&D.length>0)return K8(D);else if(F==="number"&&isFinite(D))return u.long?L8(D):W8(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function K8(D){if(D=String(D),D.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(D);if(!u)return;var F=parseFloat(u[1]),E=(u[2]||"ms").toLowerCase();switch(E){case"years":case"year":case"yrs":case"yr":case"y":return F*Q8;case"weeks":case"week":case"w":return F*q8;case"days":case"day":case"d":return F*wD;case"hours":case"hour":case"hrs":case"hr":case"h":return F*tD;case"minutes":case"minute":case"mins":case"min":case"m":return F*cD;case"seconds":case"second":case"secs":case"sec":case"s":return F*dD;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return F;default:return}}function W8(D){var u=Math.abs(D);if(u>=wD)return Math.round(D/wD)+"d";if(u>=tD)return Math.round(D/tD)+"h";if(u>=cD)return Math.round(D/cD)+"m";if(u>=dD)return Math.round(D/dD)+"s";return D+"ms"}function L8(D){var u=Math.abs(D);if(u>=wD)return gu(D,u,wD,"day");if(u>=tD)return gu(D,u,tD,"hour");if(u>=cD)return gu(D,u,cD,"minute");if(u>=dD)return gu(D,u,dD,"second");return D+" ms"}function gu(D,u,F,E){var C=u>=F*1.5;return Math.round(D/F)+" "+E+(C?"s":"")}});var YF=rD(ZF(),1),{program:t8,createCommand:l8,createArgument:r8,createOption:p8,CommanderError:i8,InvalidArgumentError:o8,InvalidOptionArgumentError:a8,Command:MF,Argument:s8,Option:e8,Help:D6}=YF.default;var qF=(D=0)=>(u)=>`\x1B[${u+D}m`,QF=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,KF=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,w={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]}},F6=Object.keys(w.modifier),LE=Object.keys(w.color),wE=Object.keys(w.bgColor),E6=[...LE,...wE];function VE(){let D=new Map;for(let[u,F]of Object.entries(w)){for(let[E,C]of Object.entries(F))w[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=w[E],D.set(C[0],C[1]);Object.defineProperty(w,u,{value:F,enumerable:!1})}return Object.defineProperty(w,"codes",{value:D,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.color.ansi=qF(),w.color.ansi256=QF(),w.color.ansi16m=KF(),w.bgColor.ansi=qF(10),w.bgColor.ansi256=QF(10),w.bgColor.ansi16m=KF(10),Object.defineProperties(w,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((B)=>B+B).join("");let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>w.rgbToAnsi256(...w.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let A=u%36;F=Math.floor(u/36)/5,E=Math.floor(A/6)/5,C=A%6/5}let B=Math.max(F,E,C)*2;if(B===0)return 30;let $=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));if(B===2)$+=60;return $},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>w.ansi256ToAnsi(w.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>w.ansi256ToAnsi(w.hexToAnsi256(u)),enumerable:!1}}),w}var fE=VE(),CD=fE;import au from"process";import yE from"os";import WF from"tty";function uD(D,u=globalThis.Deno?globalThis.Deno.args:au.argv){let F=D.startsWith("-")?"":D.length===1?"-":"--",E=u.indexOf(F+D),C=u.indexOf("--");return E!==-1&&(C===-1||E<C)}var{env:V}=au,Nu;if(uD("no-color")||uD("no-colors")||uD("color=false")||uD("color=never"))Nu=0;else if(uD("color")||uD("colors")||uD("color=true")||uD("color=always"))Nu=1;function PE(){if("FORCE_COLOR"in V){if(V.FORCE_COLOR==="true")return 1;if(V.FORCE_COLOR==="false")return 0;return V.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(V.FORCE_COLOR,10),3)}}function kE(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function hE(D,{streamIsTTY:u,sniffFlags:F=!0}={}){let E=PE();if(E!==void 0)Nu=E;let C=F?Nu:E;if(C===0)return 0;if(F){if(uD("color=16m")||uD("color=full")||uD("color=truecolor"))return 3;if(uD("color=256"))return 2}if("TF_BUILD"in V&&"AGENT_NAME"in V)return 1;if(D&&!u&&C===void 0)return 0;let B=C||0;if(V.TERM==="dumb")return B;if(au.platform==="win32"){let $=yE.release().split(".");if(Number($[0])>=10&&Number($[2])>=10586)return Number($[2])>=14931?3:2;return 1}if("CI"in V){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(($)=>($ in V)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(($)=>($ in V))||V.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in V)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(V.TEAMCITY_VERSION)?1:0;if(V.COLORTERM==="truecolor")return 3;if(V.TERM==="xterm-kitty")return 3;if(V.TERM==="xterm-ghostty")return 3;if(V.TERM==="wezterm")return 3;if("TERM_PROGRAM"in V){let $=Number.parseInt((V.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(V.TERM_PROGRAM){case"iTerm.app":return $>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(V.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(V.TERM))return 1;if("COLORTERM"in V)return 1;return B}function LF(D,u={}){let F=hE(D,{streamIsTTY:D&&D.isTTY,...u});return kE(F)}var bE={stdout:LF({isTTY:WF.isatty(1)}),stderr:LF({isTTY:WF.isatty(2)})},wF=bE;function VF(D,u,F){let E=D.indexOf(u);if(E===-1)return D;let C=u.length,B=0,$="";do $+=D.slice(B,E)+u+F,B=E+C,E=D.indexOf(u,B);while(E!==-1);return $+=D.slice(B),$}function fF(D,u,F,E){let C=0,B="";do{let $=D[E-1]==="\r";B+=D.slice(C,$?E-1:E)+u+($?`\r
30
30
  `:`
31
31
  `)+F,C=E+1,E=D.indexOf(`
32
- `,C)}while(E!==-1);return B+=D.slice(C),B}var{stdout:yF,stderr:PF}=wF,su=Symbol("GENERATOR"),VD=Symbol("STYLER"),iD=Symbol("IS_EMPTY"),kF=["ansi","ansi","ansi256","ansi16m"],fD=Object.create(null),vE=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let F=yF?yF.level:0;D.level=u.level===void 0?F:u.level};var mE=(D)=>{let u=(...F)=>F.join(" ");return vE(u,D),Object.setPrototypeOf(u,oD.prototype),u};function oD(D){return mE(D)}Object.setPrototypeOf(oD.prototype,Function.prototype);for(let[D,u]of Object.entries(CD))fD[D]={get(){let F=Ru(this,D0(u.open,u.close,this[VD]),this[iD]);return Object.defineProperty(this,D,{value:F}),F}};fD.visible={get(){let D=Ru(this,this[VD],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var eu=(D,u,F,...E)=>{if(D==="rgb"){if(u==="ansi16m")return CD[F].ansi16m(...E);if(u==="ansi256")return CD[F].ansi256(CD.rgbToAnsi256(...E));return CD[F].ansi(CD.rgbToAnsi(...E))}if(D==="hex")return eu("rgb",u,F,...CD.hexToRgb(...E));return CD[F][D](...E)},gE=["rgb","hex","ansi256"];for(let D of gE){fD[D]={get(){let{level:F}=this;return function(...E){let C=D0(eu(D,kF[F],"color",...E),CD.color.close,this[VD]);return Ru(this,C,this[iD])}}};let u="bg"+D[0].toUpperCase()+D.slice(1);fD[u]={get(){let{level:F}=this;return function(...E){let C=D0(eu(D,kF[F],"bgColor",...E),CD.bgColor.close,this[VD]);return Ru(this,C,this[iD])}}}}var dE=Object.defineProperties(()=>{},{...fD,level:{enumerable:!0,get(){return this[su].level},set(D){this[su].level=D}}}),D0=(D,u,F)=>{let E,C;if(F===void 0)E=D,C=u;else E=F.openAll+D,C=u+F.closeAll;return{open:D,close:u,openAll:E,closeAll:C,parent:F}},Ru=(D,u,F)=>{let E=(...C)=>nE(E,C.length===1?""+C[0]:C.join(" "));return Object.setPrototypeOf(E,dE),E[su]=D,E[VD]=u,E[iD]=F,E},nE=(D,u)=>{if(D.level<=0||!u)return D[iD]?"":u;let F=D[VD];if(F===void 0)return u;let{openAll:E,closeAll:C}=F;if(u.includes("\x1B"))while(F!==void 0)u=VF(u,F.close,F.open),F=F.parent;let B=u.indexOf(`
33
- `);if(B!==-1)u=fF(u,C,E,B);return E+u+C};Object.defineProperties(oD.prototype,fD);var cE=oD(),_6=oD({level:PF?PF.level:0});var N=cE;var u0=(D)=>D.name==="backspace",aD=(D)=>D.name==="tab";var sD=(D)=>D.name==="enter"||D.name==="return";class F0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class E0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class FD extends Error{name="ExitPromptError"}class C0 extends Error{name="HookError"}class B0 extends Error{name="ValidationError"}import{AsyncResource as pE}from"async_hooks";import{AsyncLocalStorage as tE,AsyncResource as lE}from"async_hooks";var hF=new tE;function rE(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function bF(D,u){let F=rE(D);return hF.run(F,()=>{function E(C){F.handleChange=()=>{F.index=0,C()},F.handleChange()}return u(E)})}function SD(){let D=hF.getStore();if(!D)throw new C0("[Inquirer] Hook functions can only be called from within a prompt");return D}function $0(){return SD().rl}function A0(D){let u=(...F)=>{let E=SD(),C=!1,B=E.handleChange;E.handleChange=()=>{C=!0};let $=D(...F);if(C)B();return E.handleChange=B,$};return lE.bind(u)}function _u(D){let u=SD(),{index:F}=u,E={get(){return u.hooks[F]},set(B){u.hooks[F]=B},initialized:F in u.hooks},C=D(E);return u.index++,C}function vF(){SD().handleChange()}var zD={queue(D){let u=SD(),{index:F}=u;u.hooksEffect.push(()=>{u.hooksCleanup[F]?.();let E=D($0());if(E!=null&&typeof E!=="function")throw new B0("useEffect return value must be a cleanup function or nothing.");u.hooksCleanup[F]=E})},run(){let D=SD();A0(()=>{D.hooksEffect.forEach((u)=>{u()}),D.hooksEffect.length=0})()},clearAll(){let D=SD();D.hooksCleanup.forEach((u)=>{u?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function s(D){return _u((u)=>{let F=pE.bind(function(B){if(u.get()!==B)u.set(B),vF()});if(u.initialized)return[u.get(),F];let E=typeof D==="function"?D():D;return u.set(E),[E,F]})}function ID(D,u){_u((F)=>{let E=F.get();if(!Array.isArray(E)||u.some((B,$)=>!Object.is(B,E[$])))zD.queue(D);F.set(u)})}import{styleText as BD}from"util";import $D from"process";function iE(){if($D.platform!=="win32")return $D.env.TERM!=="linux";return Boolean($D.env.WT_SESSION)||Boolean($D.env.TERMINUS_SUBLIME)||$D.env.ConEmuTask==="{cmd::Cmder}"||$D.env.TERM_PROGRAM==="Terminus-Sublime"||$D.env.TERM_PROGRAM==="vscode"||$D.env.TERM==="xterm-256color"||$D.env.TERM==="alacritty"||$D.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var mF={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},gF={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},oE={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},aE={...mF,...gF},sE={...mF,...oE},eE=iE(),DC=eE?aE:sE,dF=DC,q6=Object.entries(gF);var nF={prefix:{idle:BD("blue","?"),done:BD("green",dF.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>BD("yellow",D))},style:{answer:(D)=>BD("cyan",D),message:(D)=>BD("bold",D),error:(D)=>BD("red",`> ${D}`),defaultAnswer:(D)=>BD("dim",`(${D})`),help:(D)=>BD("dim",D),highlight:(D)=>BD("cyan",D),key:(D)=>BD("cyan",BD("bold",`<${D}>`))}};function cF(D){if(typeof D!=="object"||D===null)return!1;let u=D;while(Object.getPrototypeOf(u)!==null)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(D)===u}function tF(...D){let u={};for(let F of D)for(let[E,C]of Object.entries(F)){let B=u[E];u[E]=cF(B)&&cF(C)?tF(B,C):C}return u}function UD(...D){let u=[nF,...D.filter((F)=>F!=null)];return tF(...u)}function eD({status:D="idle",theme:u}){let[F,E]=s(!1),[C,B]=s(0),{prefix:$,spinner:A}=UD(u);if(ID(()=>{if(D==="loading"){let x,H=-1,J=setTimeout(()=>{E(!0),x=setInterval(()=>{H=H+1,B(H%A.frames.length)},A.interval)},300);return()=>{clearTimeout(J),clearInterval(x)}}else E(!1)},[D]),F)return A.frames[C];return typeof $==="string"?$:$[D==="loading"?"idle":D]??$.idle}function lF(D){return s({current:D})[0]}function Du(D){let u=lF(D);u.current=D,ID((F)=>{let E=!1,C=A0((B,$)=>{if(E)return;u.current($,F)});return F.input.on("keypress",C),()=>{E=!0,F.input.removeListener("keypress",C)}},[])}var H2=rD(pF(),1);function H0({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var EC=H0();function uu(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(EC,"")}function iF(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function oF(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function aF(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function CC(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function sF(D,{ambiguousAsWide:u=!1}={}){if(CC(D),oF(D)||aF(D)||u&&iF(D))return 2;return 1}var eF=()=>{return/[#*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};var BC=new Intl.Segmenter,$C=/^\p{Default_Ignorable_Code_Point}$/u;function ZD(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:E=!1}=u;if(!E)D=uu(D);if(D.length===0)return 0;let C=0,B={ambiguousAsWide:!F};for(let{segment:$}of BC.segment(D)){let A=$.codePointAt(0);if(A<=31||A>=127&&A<=159)continue;if(A>=8203&&A<=8207||A===65279)continue;if(A>=768&&A<=879||A>=6832&&A<=6911||A>=7616&&A<=7679||A>=8400&&A<=8447||A>=65056&&A<=65071)continue;if(A>=55296&&A<=57343)continue;if(A>=65024&&A<=65039)continue;if($C.test($))continue;if(eF().test($)){C+=2;continue}C+=sF(A,B)}return C}var D2=(D=0)=>(u)=>`\x1B[${u+D}m`,u2=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,F2=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,f={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]}},F1=Object.keys(f.modifier),AC=Object.keys(f.color),HC=Object.keys(f.bgColor),E1=[...AC,...HC];function xC(){let D=new Map;for(let[u,F]of Object.entries(f)){for(let[E,C]of Object.entries(F))f[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=f[E],D.set(C[0],C[1]);Object.defineProperty(f,u,{value:F,enumerable:!1})}return Object.defineProperty(f,"codes",{value:D,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",f.color.ansi=D2(),f.color.ansi256=u2(),f.color.ansi16m=F2(),f.bgColor.ansi=D2(10),f.bgColor.ansi256=u2(10),f.bgColor.ansi16m=F2(10),Object.defineProperties(f,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((B)=>B+B).join("");let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>f.rgbToAnsi256(...f.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let A=u%36;F=Math.floor(u/36)/5,E=Math.floor(A/6)/5,C=A%6/5}let B=Math.max(F,E,C)*2;if(B===0)return 30;let $=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));if(B===2)$+=60;return $},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>f.ansi256ToAnsi(f.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>f.ansi256ToAnsi(f.hexToAnsi256(u)),enumerable:!1}}),f}var JC=xC(),E2=JC;var Xu=new Set(["\x1B","\x9B"]),NC=39,J0="\x07",$2="[",RC="]",A2="m",Tu=`${RC}8;;`,C2=(D)=>`${Xu.values().next().value}${$2}${D}${A2}`,B2=(D)=>`${Xu.values().next().value}${Tu}${D}${J0}`,_C=(D)=>D.split(" ").map((u)=>ZD(u)),x0=(D,u,F)=>{let E=[...u],C=!1,B=!1,$=ZD(uu(D.at(-1)));for(let[A,R]of E.entries()){let x=ZD(R);if($+x<=F)D[D.length-1]+=R;else D.push(R),$=0;if(Xu.has(R))C=!0,B=E.slice(A+1,A+1+Tu.length).join("")===Tu;if(C){if(B){if(R===J0)C=!1,B=!1}else if(R===A2)C=!1;continue}if($+=x,$===F&&A<E.length-1)D.push(""),$=0}if(!$&&D.at(-1).length>0&&D.length>1)D[D.length-2]+=D.pop()},TC=(D)=>{let u=D.split(" "),F=u.length;while(F>0){if(ZD(u[F-1])>0)break;F--}if(F===u.length)return D;return u.slice(0,F).join(" ")+u.slice(F).join("")},XC=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let E="",C,B,$=_C(D),A=[""];for(let[J,T]of D.split(" ").entries()){if(F.trim!==!1)A[A.length-1]=A.at(-1).trimStart();let _=ZD(A.at(-1));if(J!==0){if(_>=u&&(F.wordWrap===!1||F.trim===!1))A.push(""),_=0;if(_>0||F.trim===!1)A[A.length-1]+=" ",_++}if(F.hard&&$[J]>u){let X=u-_,j=1+Math.floor(($[J]-X-1)/u);if(Math.floor(($[J]-1)/u)<j)A.push("");x0(A,T,u);continue}if(_+$[J]>u&&_>0&&$[J]>0){if(F.wordWrap===!1&&_<u){x0(A,T,u);continue}A.push("")}if(_+$[J]>u&&F.wordWrap===!1){x0(A,T,u);continue}A[A.length-1]+=T}if(F.trim!==!1)A=A.map((J)=>TC(J));let R=A.join(`
32
+ `,C)}while(E!==-1);return B+=D.slice(C),B}var{stdout:yF,stderr:PF}=wF,su=Symbol("GENERATOR"),VD=Symbol("STYLER"),iD=Symbol("IS_EMPTY"),kF=["ansi","ansi","ansi256","ansi16m"],fD=Object.create(null),vE=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let F=yF?yF.level:0;D.level=u.level===void 0?F:u.level};var mE=(D)=>{let u=(...F)=>F.join(" ");return vE(u,D),Object.setPrototypeOf(u,oD.prototype),u};function oD(D){return mE(D)}Object.setPrototypeOf(oD.prototype,Function.prototype);for(let[D,u]of Object.entries(CD))fD[D]={get(){let F=Ru(this,D0(u.open,u.close,this[VD]),this[iD]);return Object.defineProperty(this,D,{value:F}),F}};fD.visible={get(){let D=Ru(this,this[VD],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var eu=(D,u,F,...E)=>{if(D==="rgb"){if(u==="ansi16m")return CD[F].ansi16m(...E);if(u==="ansi256")return CD[F].ansi256(CD.rgbToAnsi256(...E));return CD[F].ansi(CD.rgbToAnsi(...E))}if(D==="hex")return eu("rgb",u,F,...CD.hexToRgb(...E));return CD[F][D](...E)},gE=["rgb","hex","ansi256"];for(let D of gE){fD[D]={get(){let{level:F}=this;return function(...E){let C=D0(eu(D,kF[F],"color",...E),CD.color.close,this[VD]);return Ru(this,C,this[iD])}}};let u="bg"+D[0].toUpperCase()+D.slice(1);fD[u]={get(){let{level:F}=this;return function(...E){let C=D0(eu(D,kF[F],"bgColor",...E),CD.bgColor.close,this[VD]);return Ru(this,C,this[iD])}}}}var nE=Object.defineProperties(()=>{},{...fD,level:{enumerable:!0,get(){return this[su].level},set(D){this[su].level=D}}}),D0=(D,u,F)=>{let E,C;if(F===void 0)E=D,C=u;else E=F.openAll+D,C=u+F.closeAll;return{open:D,close:u,openAll:E,closeAll:C,parent:F}},Ru=(D,u,F)=>{let E=(...C)=>dE(E,C.length===1?""+C[0]:C.join(" "));return Object.setPrototypeOf(E,nE),E[su]=D,E[VD]=u,E[iD]=F,E},dE=(D,u)=>{if(D.level<=0||!u)return D[iD]?"":u;let F=D[VD];if(F===void 0)return u;let{openAll:E,closeAll:C}=F;if(u.includes("\x1B"))while(F!==void 0)u=VF(u,F.close,F.open),F=F.parent;let B=u.indexOf(`
33
+ `);if(B!==-1)u=fF(u,C,E,B);return E+u+C};Object.defineProperties(oD.prototype,fD);var cE=oD(),_6=oD({level:PF?PF.level:0});var N=cE;var u0=(D)=>D.name==="backspace",aD=(D)=>D.name==="tab";var sD=(D)=>D.name==="enter"||D.name==="return";class F0 extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(D){super();this.cause=D?.cause}}class E0 extends Error{name="CancelPromptError";message="Prompt was canceled"}class FD extends Error{name="ExitPromptError"}class C0 extends Error{name="HookError"}class B0 extends Error{name="ValidationError"}import{AsyncResource as pE}from"async_hooks";import{AsyncLocalStorage as tE,AsyncResource as lE}from"async_hooks";var hF=new tE;function rE(D){return{rl:D,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function bF(D,u){let F=rE(D);return hF.run(F,()=>{function E(C){F.handleChange=()=>{F.index=0,C()},F.handleChange()}return u(E)})}function SD(){let D=hF.getStore();if(!D)throw new C0("[Inquirer] Hook functions can only be called from within a prompt");return D}function $0(){return SD().rl}function A0(D){let u=(...F)=>{let E=SD(),C=!1,B=E.handleChange;E.handleChange=()=>{C=!0};let $=D(...F);if(C)B();return E.handleChange=B,$};return lE.bind(u)}function _u(D){let u=SD(),{index:F}=u,E={get(){return u.hooks[F]},set(B){u.hooks[F]=B},initialized:F in u.hooks},C=D(E);return u.index++,C}function vF(){SD().handleChange()}var zD={queue(D){let u=SD(),{index:F}=u;u.hooksEffect.push(()=>{u.hooksCleanup[F]?.();let E=D($0());if(E!=null&&typeof E!=="function")throw new B0("useEffect return value must be a cleanup function or nothing.");u.hooksCleanup[F]=E})},run(){let D=SD();A0(()=>{D.hooksEffect.forEach((u)=>{u()}),D.hooksEffect.length=0})()},clearAll(){let D=SD();D.hooksCleanup.forEach((u)=>{u?.()}),D.hooksEffect.length=0,D.hooksCleanup.length=0}};function s(D){return _u((u)=>{let F=pE.bind(function(B){if(u.get()!==B)u.set(B),vF()});if(u.initialized)return[u.get(),F];let E=typeof D==="function"?D():D;return u.set(E),[E,F]})}function ID(D,u){_u((F)=>{let E=F.get();if(!Array.isArray(E)||u.some((B,$)=>!Object.is(B,E[$])))zD.queue(D);F.set(u)})}import{styleText as BD}from"util";import $D from"process";function iE(){if($D.platform!=="win32")return $D.env.TERM!=="linux";return Boolean($D.env.WT_SESSION)||Boolean($D.env.TERMINUS_SUBLIME)||$D.env.ConEmuTask==="{cmd::Cmder}"||$D.env.TERM_PROGRAM==="Terminus-Sublime"||$D.env.TERM_PROGRAM==="vscode"||$D.env.TERM==="xterm-256color"||$D.env.TERM==="alacritty"||$D.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var mF={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},gF={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},oE={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},aE={...mF,...gF},sE={...mF,...oE},eE=iE(),DC=eE?aE:sE,nF=DC,q6=Object.entries(gF);var dF={prefix:{idle:BD("blue","?"),done:BD("green",nF.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map((D)=>BD("yellow",D))},style:{answer:(D)=>BD("cyan",D),message:(D)=>BD("bold",D),error:(D)=>BD("red",`> ${D}`),defaultAnswer:(D)=>BD("dim",`(${D})`),help:(D)=>BD("dim",D),highlight:(D)=>BD("cyan",D),key:(D)=>BD("cyan",BD("bold",`<${D}>`))}};function cF(D){if(typeof D!=="object"||D===null)return!1;let u=D;while(Object.getPrototypeOf(u)!==null)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(D)===u}function tF(...D){let u={};for(let F of D)for(let[E,C]of Object.entries(F)){let B=u[E];u[E]=cF(B)&&cF(C)?tF(B,C):C}return u}function UD(...D){let u=[dF,...D.filter((F)=>F!=null)];return tF(...u)}function eD({status:D="idle",theme:u}){let[F,E]=s(!1),[C,B]=s(0),{prefix:$,spinner:A}=UD(u);if(ID(()=>{if(D==="loading"){let x,H=-1,J=setTimeout(()=>{E(!0),x=setInterval(()=>{H=H+1,B(H%A.frames.length)},A.interval)},300);return()=>{clearTimeout(J),clearInterval(x)}}else E(!1)},[D]),F)return A.frames[C];return typeof $==="string"?$:$[D==="loading"?"idle":D]??$.idle}function lF(D){return s({current:D})[0]}function Du(D){let u=lF(D);u.current=D,ID((F)=>{let E=!1,C=A0((B,$)=>{if(E)return;u.current($,F)});return F.input.on("keypress",C),()=>{E=!0,F.input.removeListener("keypress",C)}},[])}var H2=rD(pF(),1);function H0({onlyFirst:D=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",D?void 0:"g")}var EC=H0();function uu(D){if(typeof D!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(EC,"")}function iF(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function oF(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function aF(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9776&&D<=9783||D>=9800&&D<=9811||D===9855||D>=9866&&D<=9871||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12773||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D>=94192&&D<=94198||D>=94208&&D<=101589||D>=101631&&D<=101662||D>=101760&&D<=101874||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D>=119552&&D<=119638||D>=119648&&D<=119670||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128728||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129674||D>=129678&&D<=129734||D===129736||D>=129741&&D<=129756||D>=129759&&D<=129770||D>=129775&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function CC(D){if(!Number.isSafeInteger(D))throw TypeError(`Expected a code point, got \`${typeof D}\`.`)}function sF(D,{ambiguousAsWide:u=!1}={}){if(CC(D),oF(D)||aF(D)||u&&iF(D))return 2;return 1}var eF=()=>{return/[#*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};var BC=new Intl.Segmenter,$C=/^\p{Default_Ignorable_Code_Point}$/u;function ZD(D,u={}){if(typeof D!=="string"||D.length===0)return 0;let{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:E=!1}=u;if(!E)D=uu(D);if(D.length===0)return 0;let C=0,B={ambiguousAsWide:!F};for(let{segment:$}of BC.segment(D)){let A=$.codePointAt(0);if(A<=31||A>=127&&A<=159)continue;if(A>=8203&&A<=8207||A===65279)continue;if(A>=768&&A<=879||A>=6832&&A<=6911||A>=7616&&A<=7679||A>=8400&&A<=8447||A>=65056&&A<=65071)continue;if(A>=55296&&A<=57343)continue;if(A>=65024&&A<=65039)continue;if($C.test($))continue;if(eF().test($)){C+=2;continue}C+=sF(A,B)}return C}var D2=(D=0)=>(u)=>`\x1B[${u+D}m`,u2=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,F2=(D=0)=>(u,F,E)=>`\x1B[${38+D};2;${u};${F};${E}m`,f={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]}},F1=Object.keys(f.modifier),AC=Object.keys(f.color),HC=Object.keys(f.bgColor),E1=[...AC,...HC];function xC(){let D=new Map;for(let[u,F]of Object.entries(f)){for(let[E,C]of Object.entries(F))f[E]={open:`\x1B[${C[0]}m`,close:`\x1B[${C[1]}m`},F[E]=f[E],D.set(C[0],C[1]);Object.defineProperty(f,u,{value:F,enumerable:!1})}return Object.defineProperty(f,"codes",{value:D,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",f.color.ansi=D2(),f.color.ansi256=u2(),f.color.ansi16m=F2(),f.bgColor.ansi=D2(10),f.bgColor.ansi256=u2(10),f.bgColor.ansi16m=F2(10),Object.defineProperties(f,{rgbToAnsi256:{value(u,F,E){if(u===F&&F===E){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(E/255*5)},enumerable:!1},hexToRgb:{value(u){let F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[E]=F;if(E.length===3)E=[...E].map((B)=>B+B).join("");let C=Number.parseInt(E,16);return[C>>16&255,C>>8&255,C&255]},enumerable:!1},hexToAnsi256:{value:(u)=>f.rgbToAnsi256(...f.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,E,C;if(u>=232)F=((u-232)*10+8)/255,E=F,C=F;else{u-=16;let A=u%36;F=Math.floor(u/36)/5,E=Math.floor(A/6)/5,C=A%6/5}let B=Math.max(F,E,C)*2;if(B===0)return 30;let $=30+(Math.round(C)<<2|Math.round(E)<<1|Math.round(F));if(B===2)$+=60;return $},enumerable:!1},rgbToAnsi:{value:(u,F,E)=>f.ansi256ToAnsi(f.rgbToAnsi256(u,F,E)),enumerable:!1},hexToAnsi:{value:(u)=>f.ansi256ToAnsi(f.hexToAnsi256(u)),enumerable:!1}}),f}var JC=xC(),E2=JC;var Xu=new Set(["\x1B","\x9B"]),NC=39,J0="\x07",$2="[",RC="]",A2="m",Tu=`${RC}8;;`,C2=(D)=>`${Xu.values().next().value}${$2}${D}${A2}`,B2=(D)=>`${Xu.values().next().value}${Tu}${D}${J0}`,_C=(D)=>D.split(" ").map((u)=>ZD(u)),x0=(D,u,F)=>{let E=[...u],C=!1,B=!1,$=ZD(uu(D.at(-1)));for(let[A,R]of E.entries()){let x=ZD(R);if($+x<=F)D[D.length-1]+=R;else D.push(R),$=0;if(Xu.has(R))C=!0,B=E.slice(A+1,A+1+Tu.length).join("")===Tu;if(C){if(B){if(R===J0)C=!1,B=!1}else if(R===A2)C=!1;continue}if($+=x,$===F&&A<E.length-1)D.push(""),$=0}if(!$&&D.at(-1).length>0&&D.length>1)D[D.length-2]+=D.pop()},TC=(D)=>{let u=D.split(" "),F=u.length;while(F>0){if(ZD(u[F-1])>0)break;F--}if(F===u.length)return D;return u.slice(0,F).join(" ")+u.slice(F).join("")},XC=(D,u,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let E="",C,B,$=_C(D),A=[""];for(let[J,T]of D.split(" ").entries()){if(F.trim!==!1)A[A.length-1]=A.at(-1).trimStart();let _=ZD(A.at(-1));if(J!==0){if(_>=u&&(F.wordWrap===!1||F.trim===!1))A.push(""),_=0;if(_>0||F.trim===!1)A[A.length-1]+=" ",_++}if(F.hard&&$[J]>u){let X=u-_,j=1+Math.floor(($[J]-X-1)/u);if(Math.floor(($[J]-1)/u)<j)A.push("");x0(A,T,u);continue}if(_+$[J]>u&&_>0&&$[J]>0){if(F.wordWrap===!1&&_<u){x0(A,T,u);continue}A.push("")}if(_+$[J]>u&&F.wordWrap===!1){x0(A,T,u);continue}A[A.length-1]+=T}if(F.trim!==!1)A=A.map((J)=>TC(J));let R=A.join(`
34
34
  `),x=[...R],H=0;for(let[J,T]of x.entries()){if(E+=T,Xu.has(T)){let{groups:X}=new RegExp(`(?:\\${$2}(?<code>\\d+)m|\\${Tu}(?<uri>.*)${J0})`).exec(R.slice(H))||{groups:{}};if(X.code!==void 0){let j=Number.parseFloat(X.code);C=j===NC?void 0:j}else if(X.uri!==void 0)B=X.uri.length===0?void 0:X.uri}let _=E2.codes.get(Number(C));if(x[J+1]===`
35
35
  `){if(B)E+=B2("");if(C&&_)E+=C2(_)}else if(T===`
36
36
  `){if(C&&_)E+=C2(C);if(B)E+=B2(B)}H+=T.length}return E};function N0(D,u,F){return String(D).normalize().replaceAll(`\r
@@ -46,20 +46,20 @@ GFS4: `),console.error(D)};if(!k[r]){if(U0=global[r]||[],V2(k,U0),k.close=functi
46
46
  `;let $=D+(u?`
47
47
  `+u:""),R=Math.floor(E.length/B)-this.cursorPos.rows+(u?S2(u):0);if(R>0)$+=j0(R);$+=S0(this.cursorPos.cols),this.write(O0(this.extraLinesUnderPrompt)+z0(this.height)+$),this.extraLinesUnderPrompt=R,this.height=S2($)}checkCursorPos(){let D=this.rl.getCursorPos();if(D.cols!==this.cursorPos.cols)this.write(S0(D.cols)),this.cursorPos=D}done({clearContent:D}){this.rl.setPrompt("");let u=O0(this.extraLinesUnderPrompt);u+=D?z0(this.height):`
48
48
  `,u+=O2,this.write(u),this.rl.close()}}class I0 extends Promise{static withResolver(){let D,u;return{promise:new Promise((E,C)=>{D=E,u=C}),resolve:D,reject:u}}}function ZC(){let D=Error.prepareStackTrace,u=[];try{Error.prepareStackTrace=(F,E)=>{let C=E.slice(1);return u=C,C},Error().stack}catch{return u}return Error.prepareStackTrace=D,u}function Fu(D){let u=ZC();return(E,C={})=>{let{input:B=process.stdin,signal:$}=C,A=new Set,R=new I2.default;R.pipe(C.output??process.stdout);let x=z2.createInterface({terminal:!0,input:B,output:R}),H=new ju(x),{promise:J,resolve:T,reject:_}=I0.withResolver(),X=()=>_(new E0);if($){let I=()=>_(new F0({cause:$.reason}));if($.aborted)return I(),Object.assign(J,{cancel:X});$.addEventListener("abort",I),A.add(()=>$.removeEventListener("abort",I))}A.add(G2((I,U)=>{_(new FD(`User force closed the prompt with ${I} ${U}`))}));let j=()=>_(new FD("User force closed the prompt with SIGINT"));x.on("SIGINT",j),A.add(()=>x.removeListener("SIGINT",j));let O=()=>H.checkCursorPos();return x.input.on("keypress",O),A.add(()=>x.input.removeListener("keypress",O)),bF(x,(I)=>{let U=UC.bind(()=>zD.clearAll());return x.on("close",U),A.add(()=>x.removeListener("close",U)),I(()=>{try{let z=D(E,(_D)=>{setImmediate(()=>T(_D))});if(z===void 0){let _D=u[1]?.getFileName();throw Error(`Prompt functions must return a string.
49
- at ${_D}`)}let[n,DD]=typeof z==="string"?[z]:z;H.render(n,DD),zD.run()}catch(z){_(z)}}),Object.assign(J.then((z)=>{return zD.clearAll(),z},(z)=>{throw zD.clearAll(),z}).finally(()=>{A.forEach((z)=>z()),H.done({clearContent:Boolean(C.clearPromptOnDone)}),R.end()}).then(()=>J),{cancel:X})})}}function U2(D,u){let F=u!==!1;if(/^(y|yes)/i.test(D))F=!0;else if(/^(n|no)/i.test(D))F=!1;return F}function Z2(D){return D?"Yes":"No"}var AD=Fu((D,u)=>{let{transformer:F=Z2}=D,[E,C]=s("idle"),[B,$]=s(""),A=UD(D.theme),R=eD({status:E,theme:A});Du((T,_)=>{if(E!=="idle")return;if(sD(T)){let X=U2(B,D.default);$(F(X)),C("done"),u(X)}else if(aD(T)){let X=Z2(!U2(B,D.default));_.clearLine(0),_.write(X),$(X)}else $(_.line)});let x=B,H="";if(E==="done")x=A.style.answer(B);else H=` ${A.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let J=A.style.message(D.message,E);return`${R} ${J}${H} ${x}`});var YC={validationFailureMode:"keep"},Eu=Fu((D,u)=>{let{prefill:F="tab"}=D,E=UD(YC,D.theme),[C,B]=s("idle"),[$="",A]=s(D.default),[R,x]=s(),[H,J]=s(""),T=eD({status:C,theme:E});async function _(U){let{required:z,pattern:n,patternError:DD="Invalid input"}=D;if(z&&!U)return"You must provide a value";if(n&&!n.test(U))return DD;if(typeof D.validate==="function")return await D.validate(U)||"You must provide a valid value";return!0}Du(async(U,z)=>{if(C!=="idle")return;if(sD(U)){let n=H||$;B("loading");let DD=await _(n);if(DD===!0)J(n),B("done"),u(n);else{if(E.validationFailureMode==="clear")J("");else z.write(H);x(DD),B("idle")}}else if(u0(U)&&!H)A(void 0);else if(aD(U)&&!H)A(void 0),z.clearLine(0),z.write($),J($);else J(z.line),x(void 0)}),ID((U)=>{if(F==="editable"&&$)U.write($),J($)},[]);let X=E.style.message(D.message,C),j=H;if(typeof D.transformer==="function")j=D.transformer(H,{isFinal:C==="done"});else if(C==="done")j=E.style.answer(H);let O;if($&&C!=="done"&&!H)O=E.style.defaultAnswer($);let I="";if(R)I=E.style.error(R);return[[T,X,O,j].filter((U)=>U!==void 0).join(" "),I]});class m extends Error{code;constructor(D,u){super(u);this.code=D;this.name="HostError"}}var o2=rD(i2(),1),W="local",R8={stale:5000,retries:{retries:5,minTimeout:100,maxTimeout:1000,factor:2}};function Wu(){return`${Bun.env.HOME||Bun.env.USERPROFILE||"~"}/.config/wt/config.json`}function a2(){let D=new Date().toISOString();return{name:W,ssh:"",root:"",connectTimeout:10,labels:{},createdAt:D,updatedAt:D,lastCheckedAt:D,lastStatus:"ok"}}function s2(){return{version:1,defaultHost:W,hosts:{[W]:a2()},sandboxes:{}}}async function a(){let D=Wu(),u=Bun.file(D);if(!await u.exists())return s2();try{let F=await u.json();if(F.version!==1)throw Error(`Unsupported config version: ${F.version}`);if(!F.sandboxes)F.sandboxes={};if(!F.hosts[W])F.hosts[W]=a2();if(!F.defaultHost)F.defaultHost=W;return F}catch(F){if(F instanceof SyntaxError)throw Error(`Invalid config file at ${D}: ${F.message}`);throw F}}async function e2(D){let u=Wu(),F=u.slice(0,u.lastIndexOf("/"));await Bun.$`mkdir -p ${F} && chmod 700 ${F}`.quiet();let E=JSON.stringify(D,null,2);await Bun.write(u,E),await Bun.$`chmod 600 ${u}`.quiet()}async function e(D){let u=Wu(),F=u.slice(0,u.lastIndexOf("/"));if(await Bun.$`mkdir -p ${F} && chmod 700 ${F}`.quiet(),!await Bun.file(u).exists())await Bun.write(u,JSON.stringify(s2(),null,2)),await Bun.$`chmod 600 ${u}`.quiet();let C=await o2.default.lock(u,R8);try{let B=await a(),$=await D(B);return await e2(B),$}finally{await C()}}async function p(D){return(await a()).hosts[D]}async function WD(){let D=await a();if(!D.defaultHost)return;return D.hosts[D.defaultHost]}async function h0(D){return e((u)=>{if(!u.hosts[D])return!1;if(delete u.hosts[D],u.defaultHost===D)u.defaultHost=null;return!0})}class G extends Error{code;constructor(D,u){super(u);this.code=D;this.name="SandboxError"}}var _8=/^[a-z][a-z0-9_-]{0,31}$/,T8=/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/,b0=/[;`|&$(){}*?<>!\\"\n\r]/;function D3(D){if(!D)throw new m("VALIDATION_ERROR","Host name is required");if(!_8.test(D))throw new m("VALIDATION_ERROR","Host name must match pattern: starts with a-z, followed by 0-31 chars of a-z, 0-9, _, or -")}function wu(D){if(!D)throw new G("VALIDATION_ERROR","Sandbox name is required");if(!T8.test(D))throw new G("VALIDATION_ERROR","Sandbox name must start with an alphanumeric character, contain only alphanumeric characters, dots, underscores, or hyphens, and be at most 64 characters");if(D==="."||D==="..")throw new G("VALIDATION_ERROR",'Sandbox name cannot be "." or ".."')}function v0(D){if(!D)return;if(b0.test(D))throw new G("VALIDATION_ERROR",`Git ref contains invalid characters: ${D}`)}function u3(D){if(!D||D.trim()==="")throw new m("VALIDATION_ERROR","SSH target is required");if(b0.test(D))throw new m("VALIDATION_ERROR","SSH target contains invalid characters (shell metacharacters are not allowed)")}function F3(D){if(!D)throw new m("VALIDATION_ERROR","Root path is required");if(!D.startsWith("/"))throw new m("VALIDATION_ERROR","Root path must be absolute (start with /)");if(b0.test(D))throw new m("VALIDATION_ERROR","Root path contains invalid characters (shell metacharacters are not allowed)")}function E3(D){if(D===void 0)return;if(!Number.isInteger(D)||D<1||D>65535)throw new m("VALIDATION_ERROR","Port must be an integer between 1 and 65535")}function C3(D){if(D===void 0)return;if(!Number.isInteger(D)||D<1||D>300)throw new m("VALIDATION_ERROR","Connect timeout must be an integer between 1 and 300 seconds")}function m0(D){if(!D)return{};let u={},F=D.split(",");for(let E of F){let C=E.trim();if(!C)continue;let B=C.indexOf("=");if(B===-1)throw new m("VALIDATION_ERROR",`Invalid label format "${C}": expected key=value`);let $=C.slice(0,B).trim(),A=C.slice(B+1).trim();if(!$)throw new m("VALIDATION_ERROR",`Invalid label: empty key in "${C}"`);u[$]=A}return u}function g0(D){D3(D.name),u3(D.ssh),F3(D.root),E3(D.port),C3(D.connectTimeout)}function M(D){return`'${D.replace(/'/g,"'\\''")}'`}function bD(D){let u=[];if(D.connectTimeout)u.push("-o",`ConnectTimeout=${D.connectTimeout}`);if(u.push("-o","BatchMode=yes"),u.push("-o","StrictHostKeyChecking=accept-new"),D.port)u.push("-p",String(D.port));if(D.identity)u.push("-i",D.identity);return u.push(D.ssh),u}function ND(D){return{ssh:D.ssh,port:D.port,identity:D.identity,connectTimeout:D.connectTimeout}}async function Q(D,u){let F=bD(D);F.push(u);try{let E=await Bun.$`ssh ${F}`.quiet().nothrow();return{ok:E.exitCode===0,exitCode:E.exitCode,stdout:E.stdout.toString().trim(),stderr:E.stderr.toString().trim()}}catch(E){return{ok:!1,exitCode:-1,stdout:"",stderr:E instanceof Error?E.message:String(E)}}}async function Vu(D){return Q(D,"echo ok")}async function B3(D){return Q(D,"git --version")}async function $3(D){return Q(D,"node --version")}async function A3(D,u){let F=["mirrors","sandboxes","meta"],C=[`mkdir -p ${F.map((B)=>M(`${u}/${B}`)).join(" ")}`,...F.map((B)=>`test -w ${M(`${u}/${B}`)}`)].join(" && ");return Q(D,C)}function X8(D){let u=D.match(/git version (\d+\.\d+(?:\.\d+)?)/);return u?u[1]:null}function G8(D){let u=D.match(/v?(\d+\.\d+\.\d+)/);return u?u[1]:null}function j8(D){let[u,F]=D.split(".").map(Number);return u>2||u===2&&F>=5}async function H3(D){let F=(await a()).hosts[D];if(!F)throw new m("HOST_NOT_FOUND",`Host "${D}" not found`);return fu(F)}async function fu(D){let u=ND(D),F=[],E=[],C={ok:!1,host:D.name,checks:{ssh:{ok:!1},directories:{ok:!1},git:{ok:!1},node:{ok:!1}},errors:F,warnings:E},B=await Vu(u);if(B.ok)C.checks.ssh={ok:!0};else return C.checks.ssh={ok:!1,error:B.stderr||"Connection failed"},F.push(`SSH connection failed: ${B.stderr||"unknown error"}`),C;let $=await A3(u,D.root);if($.ok)C.checks.directories={ok:!0};else C.checks.directories={ok:!1,error:$.stderr||"Failed to create directories"},F.push(`Directory check failed: ${$.stderr||"unknown error"}`);let A=await B3(u);if(A.ok){let x=X8(A.stdout);if(x)if(j8(x))C.checks.git={ok:!0,version:x};else C.checks.git={ok:!1,version:x,error:`Git ${x} does not support worktrees (need 2.5+)`},F.push(`Git ${x} does not support worktrees (need 2.5+)`);else C.checks.git={ok:!1,error:"Could not parse git version"},F.push("Could not parse git version")}else C.checks.git={ok:!1,error:"git not found"},F.push("git not found on remote");let R=await $3(u);if(R.ok){let x=G8(R.stdout);if(x)C.checks.node={ok:!0,version:x};else C.checks.node={ok:!0,warning:!0},E.push("Could not parse node version")}else C.checks.node={ok:!1,warning:!0,error:"not found"},E.push("node not found (optional)");return C.ok=C.checks.ssh.ok&&C.checks.directories.ok&&C.checks.git.ok,C}async function O8(D,u){await e((F)=>{let E=F.hosts[D];if(!E)throw new m("HOST_NOT_FOUND",`Host "${D}" not found`);E.lastCheckedAt=new Date().toISOString(),E.lastStatus=u.ok?"ok":"error",E.updatedAt=new Date().toISOString()})}async function d0(D){let u=await H3(D);return await O8(D,u),u}var S8=10;async function n0(D){g0({name:D.name,ssh:D.ssh,root:D.root,port:D.port,connectTimeout:D.connectTimeout});let{host:u,action:F}=await e((C)=>{let B=C.hosts[D.name],$=new Date().toISOString(),A={name:D.name,ssh:D.ssh,root:D.root,port:D.port,identity:D.identity,connectTimeout:D.connectTimeout??S8,labels:D.labels??{},createdAt:B?.createdAt??$,updatedAt:$,lastCheckedAt:B?.lastCheckedAt??null,lastStatus:B?.lastStatus??"unchecked"},R=B?"updated":"created";if(C.hosts[D.name]=A,D.setDefault)C.defaultHost=D.name;return{host:A,action:R}}),E;if(!D.skipCheck)E=await fu(u),await e((C)=>{let B=C.hosts[D.name];if(B)B.lastCheckedAt=new Date().toISOString(),B.lastStatus=E.ok?"ok":"error",B.updatedAt=new Date().toISOString()}),u.lastCheckedAt=new Date().toISOString(),u.lastStatus=E.ok?"ok":"error";return{ok:!0,action:F,host:u,checkResult:E}}async function c0(){let D=await a(),u=Object.values(D.hosts).sort((F,E)=>F.name.localeCompare(E.name));return{defaultHost:D.defaultHost,hosts:u}}function z8(D){let u=[];if(D.checks.ssh.ok)u.push(` ${N.green("\u2713")} SSH connection`);else return u.push(` ${N.red("\u2717")} SSH connection: ${D.checks.ssh.error}`),u.join(`
49
+ at ${_D}`)}let[d,DD]=typeof z==="string"?[z]:z;H.render(d,DD),zD.run()}catch(z){_(z)}}),Object.assign(J.then((z)=>{return zD.clearAll(),z},(z)=>{throw zD.clearAll(),z}).finally(()=>{A.forEach((z)=>z()),H.done({clearContent:Boolean(C.clearPromptOnDone)}),R.end()}).then(()=>J),{cancel:X})})}}function U2(D,u){let F=u!==!1;if(/^(y|yes)/i.test(D))F=!0;else if(/^(n|no)/i.test(D))F=!1;return F}function Z2(D){return D?"Yes":"No"}var AD=Fu((D,u)=>{let{transformer:F=Z2}=D,[E,C]=s("idle"),[B,$]=s(""),A=UD(D.theme),R=eD({status:E,theme:A});Du((T,_)=>{if(E!=="idle")return;if(sD(T)){let X=U2(B,D.default);$(F(X)),C("done"),u(X)}else if(aD(T)){let X=Z2(!U2(B,D.default));_.clearLine(0),_.write(X),$(X)}else $(_.line)});let x=B,H="";if(E==="done")x=A.style.answer(B);else H=` ${A.style.defaultAnswer(D.default===!1?"y/N":"Y/n")}`;let J=A.style.message(D.message,E);return`${R} ${J}${H} ${x}`});var YC={validationFailureMode:"keep"},Eu=Fu((D,u)=>{let{prefill:F="tab"}=D,E=UD(YC,D.theme),[C,B]=s("idle"),[$="",A]=s(D.default),[R,x]=s(),[H,J]=s(""),T=eD({status:C,theme:E});async function _(U){let{required:z,pattern:d,patternError:DD="Invalid input"}=D;if(z&&!U)return"You must provide a value";if(d&&!d.test(U))return DD;if(typeof D.validate==="function")return await D.validate(U)||"You must provide a valid value";return!0}Du(async(U,z)=>{if(C!=="idle")return;if(sD(U)){let d=H||$;B("loading");let DD=await _(d);if(DD===!0)J(d),B("done"),u(d);else{if(E.validationFailureMode==="clear")J("");else z.write(H);x(DD),B("idle")}}else if(u0(U)&&!H)A(void 0);else if(aD(U)&&!H)A(void 0),z.clearLine(0),z.write($),J($);else J(z.line),x(void 0)}),ID((U)=>{if(F==="editable"&&$)U.write($),J($)},[]);let X=E.style.message(D.message,C),j=H;if(typeof D.transformer==="function")j=D.transformer(H,{isFinal:C==="done"});else if(C==="done")j=E.style.answer(H);let O;if($&&C!=="done"&&!H)O=E.style.defaultAnswer($);let I="";if(R)I=E.style.error(R);return[[T,X,O,j].filter((U)=>U!==void 0).join(" "),I]});class m extends Error{code;constructor(D,u){super(u);this.code=D;this.name="HostError"}}var o2=rD(i2(),1),W="local",R8={stale:5000,retries:{retries:5,minTimeout:100,maxTimeout:1000,factor:2}};function Wu(){return`${Bun.env.HOME||Bun.env.USERPROFILE||"~"}/.config/wt/config.json`}function a2(){let D=new Date().toISOString();return{name:W,ssh:"",root:"",connectTimeout:10,labels:{},createdAt:D,updatedAt:D,lastCheckedAt:D,lastStatus:"ok"}}function s2(){return{version:1,defaultHost:W,hosts:{[W]:a2()},sandboxes:{}}}async function a(){let D=Wu(),u=Bun.file(D);if(!await u.exists())return s2();try{let F=await u.json();if(F.version!==1)throw Error(`Unsupported config version: ${F.version}`);if(!F.sandboxes)F.sandboxes={};if(!F.hosts[W])F.hosts[W]=a2();if(!F.defaultHost)F.defaultHost=W;return F}catch(F){if(F instanceof SyntaxError)throw Error(`Invalid config file at ${D}: ${F.message}`);throw F}}async function e2(D){let u=Wu(),F=u.slice(0,u.lastIndexOf("/"));await Bun.$`mkdir -p ${F} && chmod 700 ${F}`.quiet();let E=JSON.stringify(D,null,2);await Bun.write(u,E),await Bun.$`chmod 600 ${u}`.quiet()}async function e(D){let u=Wu(),F=u.slice(0,u.lastIndexOf("/"));if(await Bun.$`mkdir -p ${F} && chmod 700 ${F}`.quiet(),!await Bun.file(u).exists())await Bun.write(u,JSON.stringify(s2(),null,2)),await Bun.$`chmod 600 ${u}`.quiet();let C=await o2.default.lock(u,R8);try{let B=await a(),$=await D(B);return await e2(B),$}finally{await C()}}async function p(D){return(await a()).hosts[D]}async function WD(){let D=await a();if(!D.defaultHost)return;return D.hosts[D.defaultHost]}async function h0(D){return e((u)=>{if(!u.hosts[D])return!1;if(delete u.hosts[D],u.defaultHost===D)u.defaultHost=null;return!0})}class G extends Error{code;constructor(D,u){super(u);this.code=D;this.name="SandboxError"}}var _8=/^[a-z][a-z0-9_-]{0,31}$/,T8=/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$/,b0=/[;`|&$(){}*?<>!\\"\n\r]/;function D3(D){if(!D)throw new m("VALIDATION_ERROR","Host name is required");if(!_8.test(D))throw new m("VALIDATION_ERROR","Host name must match pattern: starts with a-z, followed by 0-31 chars of a-z, 0-9, _, or -")}function wu(D){if(!D)throw new G("VALIDATION_ERROR","Sandbox name is required");if(!T8.test(D))throw new G("VALIDATION_ERROR","Sandbox name must start with an alphanumeric character, contain only alphanumeric characters, dots, underscores, or hyphens, and be at most 64 characters");if(D==="."||D==="..")throw new G("VALIDATION_ERROR",'Sandbox name cannot be "." or ".."')}function v0(D){if(!D)return;if(b0.test(D))throw new G("VALIDATION_ERROR",`Git ref contains invalid characters: ${D}`)}function u3(D){if(!D||D.trim()==="")throw new m("VALIDATION_ERROR","SSH target is required");if(b0.test(D))throw new m("VALIDATION_ERROR","SSH target contains invalid characters (shell metacharacters are not allowed)")}function F3(D){if(!D)throw new m("VALIDATION_ERROR","Root path is required");if(!D.startsWith("/")&&!D.startsWith("~/"))throw new m("VALIDATION_ERROR","Root path must be absolute (start with / or ~/)");if(b0.test(D))throw new m("VALIDATION_ERROR","Root path contains invalid characters (shell metacharacters are not allowed)")}function E3(D){if(D===void 0)return;if(!Number.isInteger(D)||D<1||D>65535)throw new m("VALIDATION_ERROR","Port must be an integer between 1 and 65535")}function C3(D){if(D===void 0)return;if(!Number.isInteger(D)||D<1||D>300)throw new m("VALIDATION_ERROR","Connect timeout must be an integer between 1 and 300 seconds")}function m0(D){if(!D)return{};let u={},F=D.split(",");for(let E of F){let C=E.trim();if(!C)continue;let B=C.indexOf("=");if(B===-1)throw new m("VALIDATION_ERROR",`Invalid label format "${C}": expected key=value`);let $=C.slice(0,B).trim(),A=C.slice(B+1).trim();if(!$)throw new m("VALIDATION_ERROR",`Invalid label: empty key in "${C}"`);u[$]=A}return u}function g0(D){D3(D.name),u3(D.ssh),F3(D.root),E3(D.port),C3(D.connectTimeout)}function M(D){if(D.startsWith("~/"))return`~/'${D.slice(2).replace(/'/g,"'\\''")}'`;return`'${D.replace(/'/g,"'\\''")}'`}function bD(D){let u=[];if(D.connectTimeout)u.push("-o",`ConnectTimeout=${D.connectTimeout}`);if(u.push("-o","BatchMode=yes"),u.push("-o","StrictHostKeyChecking=accept-new"),D.port)u.push("-p",String(D.port));if(D.identity)u.push("-i",D.identity);return u.push(D.ssh),u}function ND(D){return{ssh:D.ssh,port:D.port,identity:D.identity,connectTimeout:D.connectTimeout}}async function Q(D,u){let F=bD(D);F.push(u);try{let E=await Bun.$`ssh ${F}`.quiet().nothrow();return{ok:E.exitCode===0,exitCode:E.exitCode,stdout:E.stdout.toString().trim(),stderr:E.stderr.toString().trim()}}catch(E){return{ok:!1,exitCode:-1,stdout:"",stderr:E instanceof Error?E.message:String(E)}}}async function Vu(D){return Q(D,"echo ok")}async function B3(D){return Q(D,"git --version")}async function $3(D){return Q(D,"node --version")}async function A3(D,u){let F=["mirrors","sandboxes","meta"],C=[`mkdir -p ${F.map((B)=>M(`${u}/${B}`)).join(" ")}`,...F.map((B)=>`test -w ${M(`${u}/${B}`)}`)].join(" && ");return Q(D,C)}function X8(D){let u=D.match(/git version (\d+\.\d+(?:\.\d+)?)/);return u?u[1]:null}function G8(D){let u=D.match(/v?(\d+\.\d+\.\d+)/);return u?u[1]:null}function j8(D){let[u,F]=D.split(".").map(Number);return u>2||u===2&&F>=5}async function H3(D){let F=(await a()).hosts[D];if(!F)throw new m("HOST_NOT_FOUND",`Host "${D}" not found`);return fu(F)}async function fu(D){let u=ND(D),F=[],E=[],C={ok:!1,host:D.name,checks:{ssh:{ok:!1},directories:{ok:!1},git:{ok:!1},node:{ok:!1}},errors:F,warnings:E},B=await Vu(u);if(B.ok)C.checks.ssh={ok:!0};else return C.checks.ssh={ok:!1,error:B.stderr||"Connection failed"},F.push(`SSH connection failed: ${B.stderr||"unknown error"}`),C;let $=await A3(u,D.root);if($.ok)C.checks.directories={ok:!0};else C.checks.directories={ok:!1,error:$.stderr||"Failed to create directories"},F.push(`Directory check failed: ${$.stderr||"unknown error"}`);let A=await B3(u);if(A.ok){let x=X8(A.stdout);if(x)if(j8(x))C.checks.git={ok:!0,version:x};else C.checks.git={ok:!1,version:x,error:`Git ${x} does not support worktrees (need 2.5+)`},F.push(`Git ${x} does not support worktrees (need 2.5+)`);else C.checks.git={ok:!1,error:"Could not parse git version"},F.push("Could not parse git version")}else C.checks.git={ok:!1,error:"git not found"},F.push("git not found on remote");let R=await $3(u);if(R.ok){let x=G8(R.stdout);if(x)C.checks.node={ok:!0,version:x};else C.checks.node={ok:!0,warning:!0},E.push("Could not parse node version")}else C.checks.node={ok:!1,warning:!0,error:"not found"},E.push("node not found (optional)");return C.ok=C.checks.ssh.ok&&C.checks.directories.ok&&C.checks.git.ok,C}async function O8(D,u){await e((F)=>{let E=F.hosts[D];if(!E)throw new m("HOST_NOT_FOUND",`Host "${D}" not found`);E.lastCheckedAt=new Date().toISOString(),E.lastStatus=u.ok?"ok":"error",E.updatedAt=new Date().toISOString()})}async function n0(D){let u=await H3(D);return await O8(D,u),u}var S8=10;async function d0(D){g0({name:D.name,ssh:D.ssh,root:D.root,port:D.port,connectTimeout:D.connectTimeout});let{host:u,action:F}=await e((C)=>{let B=C.hosts[D.name],$=new Date().toISOString(),A={name:D.name,ssh:D.ssh,root:D.root,port:D.port,identity:D.identity,connectTimeout:D.connectTimeout??S8,labels:D.labels??{},createdAt:B?.createdAt??$,updatedAt:$,lastCheckedAt:B?.lastCheckedAt??null,lastStatus:B?.lastStatus??"unchecked"},R=B?"updated":"created";if(C.hosts[D.name]=A,D.setDefault)C.defaultHost=D.name;return{host:A,action:R}}),E;if(!D.skipCheck)E=await fu(u),await e((C)=>{let B=C.hosts[D.name];if(B)B.lastCheckedAt=new Date().toISOString(),B.lastStatus=E.ok?"ok":"error",B.updatedAt=new Date().toISOString()}),u.lastCheckedAt=new Date().toISOString(),u.lastStatus=E.ok?"ok":"error";return{ok:!0,action:F,host:u,checkResult:E}}async function c0(){let D=await a(),u=Object.values(D.hosts).sort((F,E)=>F.name.localeCompare(E.name));return{defaultHost:D.defaultHost,hosts:u}}function z8(D){let u=[];if(D.checks.ssh.ok)u.push(` ${N.green("\u2713")} SSH connection`);else return u.push(` ${N.red("\u2717")} SSH connection: ${D.checks.ssh.error}`),u.join(`
50
50
  `);if(D.checks.directories.ok)u.push(` ${N.green("\u2713")} Directory structure`);else u.push(` ${N.red("\u2717")} Directory structure: ${D.checks.directories.error||"failed"}`);if(D.checks.git.ok)u.push(` ${N.green("\u2713")} git ${D.checks.git.version}`);else u.push(` ${N.red("\u2717")} git: ${D.checks.git.error||"not found"}`);if(D.checks.node.ok)u.push(` ${N.green("\u2713")} node ${D.checks.node.version}`);else u.push(` ${N.yellow("\u26A0")} node not found (optional)`);return u.join(`
51
51
  `)}async function I8(){console.log(N.cyan(`
52
52
  Add a new host
53
- `));let D=await Eu({message:"Host name:",validate:(B)=>{if(!B)return"Host name is required";if(!/^[a-z][a-z0-9_-]{0,31}$/.test(B))return"Must start with a-z, followed by a-z, 0-9, _, or - (max 32 chars)";return!0}}),u=await Eu({message:"SSH target (alias or user@host):",validate:(B)=>B?!0:"SSH target is required"}),F=await Eu({message:"Remote base directory:",default:"/srv/wt",validate:(B)=>{if(!B)return"Root path is required";if(!B.startsWith("/"))return"Must be an absolute path (start with /)";return!0}}),E=await AD({message:"Set as default host?",default:!0}),C=await AD({message:"Run connectivity check?",default:!0});return{name:D,ssh:u,root:F,setDefault:E,skipCheck:!C,runCheck:C}}function x3(D){D.command("add").description("Register or update a remote host").argument("[name]","Host identifier (a-z, 0-9, _, - ; max 32 chars)").option("-s, --ssh <target>","SSH target (alias, user@host, or ssh://user@host:port)").option("-r, --root <path>","Remote base directory (absolute path)").option("-d, --default","Set as default host").option("-p, --port <number>","SSH port (overrides target/config)").option("-i, --identity <path>","Path to SSH identity file").option("-t, --connect-timeout <seconds>","Connection timeout in seconds","10").option("--no-check","Skip connectivity check after adding").option("-l, --labels <k=v,...>","Comma-separated key=value labels").option("--json","Output result as JSON").action(async(u,F)=>{try{let E,C=!u||!F.ssh||!F.root;if(C&&F.json)console.log(JSON.stringify({ok:!1,error:"Missing required arguments (name, --ssh, --root) and --json prevents interactive mode"},null,2)),process.exit(1);if(C)E=await I8();else E={name:u,ssh:F.ssh,root:F.root,setDefault:F.default,port:F.port?parseInt(F.port,10):void 0,identity:F.identity,connectTimeout:F.connectTimeout?parseInt(F.connectTimeout,10):void 0,skipCheck:F.check===!1,labels:m0(F.labels)};if(!E.skipCheck&&!F.json)console.log(`
54
- Checking ${E.name} (${E.ssh}:${E.root})...`);let B=await n0(E);if(F.json)console.log(JSON.stringify(B,null,2));else{if(B.checkResult)console.log(z8(B.checkResult)),console.log();let $=E.setDefault?N.dim(" (default)"):"",A=B.action==="created"?"Added":"Updated";if(B.checkResult?.ok===!1)console.log(N.yellow(`${A} host "${B.host.name}"${$}, but check failed.`));else console.log(N.green(`${A} host "${B.host.name}"${$}`))}if(B.checkResult&&!B.checkResult.ok)process.exit(2)}catch(E){if(E instanceof FD)console.log(N.dim(`
53
+ `));let D=await Eu({message:"Host name:",validate:(B)=>{if(!B)return"Host name is required";if(!/^[a-z][a-z0-9_-]{0,31}$/.test(B))return"Must start with a-z, followed by a-z, 0-9, _, or - (max 32 chars)";return!0}}),u=await Eu({message:"SSH target (alias or user@host):",validate:(B)=>B?!0:"SSH target is required"}),F=await Eu({message:"Remote base directory:",default:"~/.wt",validate:(B)=>{if(!B)return"Root path is required";if(!B.startsWith("/")&&!B.startsWith("~/"))return"Must be an absolute path (start with / or ~/)";return!0}}),E=await AD({message:"Set as default host?",default:!0}),C=await AD({message:"Run connectivity check?",default:!0});return{name:D,ssh:u,root:F,setDefault:E,skipCheck:!C,runCheck:C}}function x3(D){D.command("add").description("Register or update a remote host").argument("[name]","Host identifier (a-z, 0-9, _, - ; max 32 chars)").option("-s, --ssh <target>","SSH target (alias, user@host, or ssh://user@host:port)").option("-r, --root <path>","Remote base directory (absolute path)").option("-d, --default","Set as default host").option("-p, --port <number>","SSH port (overrides target/config)").option("-i, --identity <path>","Path to SSH identity file").option("-t, --connect-timeout <seconds>","Connection timeout in seconds","10").option("--no-check","Skip connectivity check after adding").option("-l, --labels <k=v,...>","Comma-separated key=value labels").option("--json","Output result as JSON").action(async(u,F)=>{try{let E,C=!u||!F.ssh||!F.root;if(C&&F.json)console.log(JSON.stringify({ok:!1,error:"Missing required arguments (name, --ssh, --root) and --json prevents interactive mode"},null,2)),process.exit(1);if(C)E=await I8();else E={name:u,ssh:F.ssh,root:F.root,setDefault:F.default,port:F.port?parseInt(F.port,10):void 0,identity:F.identity,connectTimeout:F.connectTimeout?parseInt(F.connectTimeout,10):void 0,skipCheck:F.check===!1,labels:m0(F.labels)};if(!E.skipCheck&&!F.json)console.log(`
54
+ Checking ${E.name} (${E.ssh}:${E.root})...`);let B=await d0(E);if(F.json)console.log(JSON.stringify(B,null,2));else{if(B.checkResult)console.log(z8(B.checkResult)),console.log();let $=E.setDefault?N.dim(" (default)"):"",A=B.action==="created"?"Added":"Updated";if(B.checkResult?.ok===!1)console.log(N.yellow(`${A} host "${B.host.name}"${$}, but check failed.`));else console.log(N.green(`${A} host "${B.host.name}"${$}`))}if(B.checkResult&&!B.checkResult.ok)process.exit(2)}catch(E){if(E instanceof FD)console.log(N.dim(`
55
55
  Cancelled.`)),process.exit(130);if(E instanceof m){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(E.code==="VALIDATION_ERROR"?1:1)}throw E}})}function U8(D){switch(D){case"ok":return N.green("ok");case"error":return N.red("error");default:return N.dim("unchecked")}}function OD(D,u){return D.padEnd(u)}function J3(D){D.command("ls").description("List all configured hosts").option("--json","Output as JSON").action(async(u)=>{let F=await c0();if(u.json){console.log(JSON.stringify(F,null,2));return}if(F.hosts.length===0){console.log(N.dim("No hosts configured. Run `wt host add` to add one."));return}let E=Math.max(4,...F.hosts.map(($)=>$.name.length))+2,C=Math.max(3,...F.hosts.map(($)=>$.ssh.length))+2,B=Math.max(4,...F.hosts.map(($)=>$.root.length))+2;console.log(N.bold(OD("NAME",E)+OD("SSH",C)+OD("ROOT",B)+OD("DEFAULT",9)+"STATUS"));for(let $ of F.hosts){let R=$.name===F.defaultHost?N.cyan("*"):N.dim("-");console.log(OD($.name,E)+OD($.ssh,C)+OD($.root,B)+OD(R,9)+U8($.lastStatus))}})}function Z8(D,u,F){let E=[];if(E.push(`Checking ${D.host} (${u}:${F})...`),D.checks.ssh.ok)E.push(` ${N.green("\u2713")} SSH connection`);else E.push(` ${N.red("\u2717")} SSH connection: ${D.checks.ssh.error}`);if(D.checks.ssh.ok){if(D.checks.directories.ok)E.push(` ${N.green("\u2713")} Directory structure`);else E.push(` ${N.red("\u2717")} Directory structure: ${D.checks.directories.error||"failed"}`);if(D.checks.git.ok)E.push(` ${N.green("\u2713")} git ${D.checks.git.version}`);else E.push(` ${N.red("\u2717")} git: ${D.checks.git.error||"not found"}`);if(D.checks.node.ok)E.push(` ${N.green("\u2713")} node ${D.checks.node.version}`);else E.push(` ${N.yellow("\u26A0")} node not found (optional)`)}return E.join(`
56
- `)}function N3(D){D.command("check").description("Test connectivity and capabilities of a host").argument("<name>","Host to check").option("--json","Output result as JSON").action(async(u,F)=>{try{let E=await p(u);if(!E){if(F.json)console.log(JSON.stringify({ok:!1,error:`Host "${u}" not found`},null,2));else console.error(N.red(`Error: Host "${u}" not found`));process.exit(1)}let C=await d0(u);if(F.json)console.log(JSON.stringify(C,null,2));else if(console.log(Z8(C,E.ssh,E.root)),console.log(),C.ok)console.log(N.green(`Host "${u}" is ready.`));else console.log(N.red(`Host "${u}" check failed.`));if(!C.ok){if(!C.checks.ssh.ok)process.exit(2);process.exit(3)}}catch(E){if(E instanceof m){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(E.code==="HOST_NOT_FOUND"?1:1)}throw E}})}function R3(D){D.command("rm").description("Remove a host configuration").argument("<name>","Host to remove").option("-y, --yes","Skip confirmation prompt").option("--json","Output result as JSON").action(async(u,F)=>{let E=await p(u);if(!E){if(F.json)console.log(JSON.stringify({ok:!1,error:`Host "${u}" not found`},null,2));else console.error(N.red(`Error: Host "${u}" not found`));process.exit(1)}try{if(!F.yes&&!F.json){if(!await AD({message:`Remove host "${u}" (${E.ssh})?`,default:!1})){console.log(N.dim("Cancelled."));return}}}catch(B){if(B instanceof FD)console.log(N.dim(`
56
+ `)}function N3(D){D.command("check").description("Test connectivity and capabilities of a host").argument("<name>","Host to check").option("--json","Output result as JSON").action(async(u,F)=>{try{let E=await p(u);if(!E){if(F.json)console.log(JSON.stringify({ok:!1,error:`Host "${u}" not found`},null,2));else console.error(N.red(`Error: Host "${u}" not found`));process.exit(1)}let C=await n0(u);if(F.json)console.log(JSON.stringify(C,null,2));else if(console.log(Z8(C,E.ssh,E.root)),console.log(),C.ok)console.log(N.green(`Host "${u}" is ready.`));else console.log(N.red(`Host "${u}" check failed.`));if(!C.ok){if(!C.checks.ssh.ok)process.exit(2);process.exit(3)}}catch(E){if(E instanceof m){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(E.code==="HOST_NOT_FOUND"?1:1)}throw E}})}function R3(D){D.command("rm").description("Remove a host configuration").argument("<name>","Host to remove").option("-y, --yes","Skip confirmation prompt").option("--json","Output result as JSON").action(async(u,F)=>{let E=await p(u);if(!E){if(F.json)console.log(JSON.stringify({ok:!1,error:`Host "${u}" not found`},null,2));else console.error(N.red(`Error: Host "${u}" not found`));process.exit(1)}try{if(!F.yes&&!F.json){if(!await AD({message:`Remove host "${u}" (${E.ssh})?`,default:!1})){console.log(N.dim("Cancelled."));return}}}catch(B){if(B instanceof FD)console.log(N.dim(`
57
57
  Cancelled.`)),process.exit(130);throw B}let C=await h0(u);if(F.json)console.log(JSON.stringify({ok:C,removed:u},null,2));else console.log(N.green(`Removed host "${u}"`))})}function t0(D){let u=D.command("host").description("Manage remote compute hosts");x3(u),J3(u),N3(u),R3(u)}async function _3(){try{let D=await Bun.$`git remote get-url origin`.quiet().nothrow();if(D.exitCode!==0)throw new G("GIT_ERROR","No git remote 'origin' found");return D.stdout.toString().trim()}catch(D){if(D instanceof G)throw D;throw new G("NOT_IN_GIT_REPO","Not inside a git repository")}}async function T3(){let D=await Bun.$`git rev-parse HEAD`.quiet().nothrow();if(D.exitCode!==0)throw new G("GIT_ERROR","Failed to resolve HEAD");return D.stdout.toString().trim()}async function yu(){let D=await Bun.$`git rev-parse --show-toplevel`.quiet().nothrow();if(D.exitCode!==0)throw new G("NOT_IN_GIT_REPO","Not inside a git repository");return D.stdout.toString().trim()}async function Pu(){return(await Bun.$`git rev-parse --is-inside-work-tree`.quiet().nothrow()).exitCode===0}async function vD(){let D=await Bun.$`git rev-parse --abbrev-ref HEAD`.quiet().nothrow();if(D.exitCode!==0)return null;let u=D.stdout.toString().trim();return u==="HEAD"?null:u}function ku(D){let u=D.replace(/\/+/g,"-").replace(/[^a-zA-Z0-9._-]/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");if(!u||u==="."||u==="..")return"sandbox";return u}function X3(D){try{let u=new URL(D);if(u.username||u.password)return u.username="",u.password="",u.toString();return D}catch{return D}}import{webcrypto as j3}from"crypto";var G3="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Y8=128,LD,mD;function M8(D){if(!LD||LD.length<D)LD=Buffer.allocUnsafe(D*Y8),j3.getRandomValues(LD),mD=0;else if(mD+D>LD.length)j3.getRandomValues(LD),mD=0;mD+=D}function O3(D=21){M8(D|=0);let u="";for(let F=mD-D;F<mD;F++)u+=G3[LD[F]&63];return u}function S3(){return O3(12)}async function z3(D){let u=D.replace(/\.git$/,"").toLowerCase().trim(),F=new TextEncoder().encode(u);return new Bun.CryptoHasher("sha256").update(F).digest("hex").slice(0,16)}class hu{async ensureLayout(D){await Bun.$`mkdir -p ${D}/mirrors ${D}/sandboxes ${D}/meta`.quiet()}async ensureMirror(D,u,F){let E=`${D}/mirrors/${u}.git`;if(!await Bun.file(`${E}/HEAD`).exists()){let $=await Bun.$`git clone --bare --mirror ${F} ${E}`.quiet().nothrow();if($.exitCode!==0)throw Error(`Failed to create mirror: ${$.stderr.toString().trim()}`)}else await Bun.$`git -C ${E} fetch --prune origin`.quiet().nothrow();let B=await yu();return await Bun.$`git -C ${E} fetch ${B} '+refs/heads/*:refs/heads/*'`.quiet().nothrow(),E}async createWorktree(D,u,F,E){let C=E?await Bun.$`git -C ${D} worktree add -B ${E} ${u}`.quiet().nothrow():await Bun.$`git -C ${D} worktree add --detach ${u} ${F}`.quiet().nothrow();if(C.exitCode!==0)throw Error(`Failed to create worktree: ${C.stderr.toString().trim()}`);await Bun.$`git -C ${u} config --unset remote.origin.mirror`.quiet().nothrow(),await Bun.$`git -C ${u} config remote.origin.push refs/heads/*:refs/heads/*`.quiet().nothrow()}async writeMeta(D,u,F){let E=`${D}/meta/${u}.json`;await Bun.write(E,JSON.stringify(F,null,2))}async removeSandboxDir(D){await Bun.$`rm -rf ${D}`.quiet().nothrow()}async pruneWorktrees(D){await Bun.$`git -C ${D} worktree prune`.quiet().nothrow()}async removeMeta(D,u){let F=`${D}/meta/${u}.json`;await Bun.$`rm -f ${F}`.quiet().nothrow()}async dirExists(D){return Bun.file(`${D}/.git`).exists()}async exec(D,u){let[F,...E]=u,C=await Bun.$`${F} ${E}`.cwd(D).quiet().nothrow();return{exitCode:C.exitCode,stdout:C.stdout.toString().trim(),stderr:C.stderr.toString().trim()}}async execStream(D,u){return Bun.spawn(u,{cwd:D,stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited}async execInteractive(D,u){let F=Bun.env.SHELL||"/bin/sh",C=await Bun.spawn([F,"-l"],{cwd:D,stdin:"inherit",stdout:"inherit",stderr:"inherit",env:{...process.env,...u}}).exited;process.exit(C)}async execTmux(D,u){let E=await Bun.spawn(["tmux","new-session","-A","-s",u,"-c",D],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited;process.exit(E)}async listTmuxSessions(){let D=await Bun.$`tmux ls -F '#{session_name}\t#{session_attached}'`.quiet().nothrow();if(D.exitCode!==0)return[];return D.stdout.toString().trim().split(`
58
58
  `).filter(Boolean).map((F)=>{let[E,C]=F.split("\t");return{name:E,attached:C==="1"}}).filter((F)=>F.name.startsWith("wt-"))}async copyEnvFiles(D,u){let F=new Bun.Glob(".env*");for await(let E of F.scan({cwd:D,onlyFiles:!0,dot:!0})){let C=Bun.file(`${D}/${E}`);await Bun.write(`${u}/${E}`,C)}}async checkGit(){let D=await Bun.$`git --version`.quiet().nothrow();if(D.exitCode!==0)return{name:"git",ok:!1,detail:"not found"};return{name:"git",ok:!0,detail:D.stdout.toString().trim()}}async checkTmux(){let D=await Bun.$`tmux -V`.quiet().nothrow();if(D.exitCode!==0)return{name:"tmux",ok:!1,detail:"not found"};return{name:"tmux",ok:!0,detail:D.stdout.toString().trim()}}async checkRuntime(){let D=await Bun.$`bun --version`.quiet().nothrow();if(D.exitCode===0)return{name:"bun",ok:!0,detail:D.stdout.toString().trim()};let u=await Bun.$`node --version`.quiet().nothrow();if(u.exitCode===0)return{name:"node",ok:!0,detail:u.stdout.toString().trim()};return{name:"runtime",ok:!1,detail:"neither bun nor node found"}}}function l0(D){let u=[];for(let F=0;F<D.length;F++){if(D[F]==="-o"&&D[F+1]?.startsWith("BatchMode")){F++;continue}u.push(D[F])}return u}class bu{host;constructor(D){this.host=D}get sshOpts(){return ND(this.host)}async ensureLayout(D){let u=["mirrors","sandboxes","meta"].map((E)=>M(`${D}/${E}`)).join(" "),F=await Q(this.sshOpts,`mkdir -p ${u}`);if(!F.ok)throw Error(`Failed to create remote layout: ${F.stderr}`)}async ensureMirror(D,u,F){let E=`${D}/mirrors/${u}.git`;if(!(await Q(this.sshOpts,`test -f ${M(E)}/HEAD`)).ok){let B=await Q(this.sshOpts,`git clone --bare --mirror ${M(F)} ${M(E)}`);if(!B.ok)throw Error(`Failed to create remote mirror: ${B.stderr}`)}else await Q(this.sshOpts,`git -C ${M(E)} fetch --prune origin`);return E}async createWorktree(D,u,F,E){let C=E?`git -C ${M(D)} worktree add -B ${M(E)} ${M(u)}`:`git -C ${M(D)} worktree add --detach ${M(u)} ${M(F)}`,B=await Q(this.sshOpts,C);if(!B.ok)throw Error(`Failed to create remote worktree: ${B.stderr}`);await Q(this.sshOpts,`git -C ${M(u)} config --unset remote.origin.mirror`),await Q(this.sshOpts,`git -C ${M(u)} config remote.origin.push refs/heads/*:refs/heads/*`)}async writeMeta(D,u,F){let E=`${D}/meta/${u}.json`,B=JSON.stringify(F,null,2).replace(/'/g,"'\\''"),$=await Q(this.sshOpts,`printf '%s' '${B}' > ${M(E)}`);if(!$.ok)throw Error(`Failed to write remote meta: ${$.stderr}`)}async removeSandboxDir(D){await Q(this.sshOpts,`rm -rf ${M(D)}`)}async pruneWorktrees(D){await Q(this.sshOpts,`git -C ${M(D)} worktree prune`)}async removeMeta(D,u){await Q(this.sshOpts,`rm -f ${M(`${D}/meta/${u}.json`)}`)}async dirExists(D){return(await Q(this.sshOpts,`test -d ${M(D)}`)).ok}async exec(D,u){let F=u.map((C)=>`'${C.replace(/'/g,"'\\''")}'`).join(" "),E=await Q(this.sshOpts,`cd ${M(D)} && ${F}`);return{exitCode:E.exitCode,stdout:E.stdout,stderr:E.stderr}}async execStream(D,u){let F=u.map(($)=>`'${$.replace(/'/g,"'\\''")}'`).join(" "),E=l0(bD(this.sshOpts)),C=`cd ${M(D)} && ${F}`;return Bun.spawn(["ssh","-t",...E,C],{stdin:"inherit",stdout:"inherit",stderr:"inherit"}).exited}async execInteractive(D,u){let F=l0(bD(this.sshOpts)),E=`cd ${M(D)} && exec $SHELL -l`,B=await Bun.spawn(["ssh","-t",...F,E],{stdin:"inherit",stdout:"inherit",stderr:"inherit",env:process.env}).exited;process.exit(B)}async execTmux(D,u){let F=l0(bD(this.sshOpts)),E=`cd ${M(D)} && tmux new-session -A -s ${M(u)}`,B=await Bun.spawn(["ssh","-t",...F,E],{stdin:"inherit",stdout:"inherit",stderr:"inherit",env:process.env}).exited;process.exit(B)}async listTmuxSessions(){let D=await Q(this.sshOpts,"tmux ls -F '#{session_name}\t#{session_attached}'");if(!D.ok)return[];return D.stdout.trim().split(`
59
- `).filter(Boolean).map((F)=>{let[E,C]=F.split("\t");return{name:E,attached:C==="1"}}).filter((F)=>F.name.startsWith("wt-"))}async copyEnvFiles(D,u){let F=new Bun.Glob(".env*"),E=[];for await(let A of F.scan({cwd:D,onlyFiles:!0,dot:!0}))E.push(A);if(E.length===0)return;let C=bD(this.sshOpts),B=C.pop(),$=[];for(let A=0;A<C.length;A++)if(C[A]==="-p")$.push("-P",C[A+1]),A++;else if(C[A]==="-i")$.push("-i",C[A+1]),A++;else if(C[A]==="-o")$.push("-o",C[A+1]),A++;for(let A of E){let R=`${D}/${A}`,x=`${B}:${u}/${A}`;await Bun.$`scp ${$} ${R} ${x}`.quiet().nothrow()}}async checkGit(){let D=await Q(this.sshOpts,"git --version");if(!D.ok)return{name:"git",ok:!1,detail:"not found"};return{name:"git",ok:!0,detail:D.stdout.trim()}}async checkTmux(){let D=await Q(this.sshOpts,"tmux -V");if(!D.ok)return{name:"tmux",ok:!1,detail:"not found"};return{name:"tmux",ok:!0,detail:D.stdout.trim()}}async checkRuntime(){let D=await Q(this.sshOpts,"bun --version");if(D.ok)return{name:"bun",ok:!0,detail:D.stdout.trim()};let u=await Q(this.sshOpts,"node --version");if(u.ok)return{name:"node",ok:!0,detail:u.stdout.trim()};return{name:"runtime",ok:!1,detail:"neither bun nor node found"}}}async function h(D){if(D===W)return new hu;let u=await p(D);if(!u)throw new G("HOST_NOT_FOUND",`Host "${D}" not found`);return new bu(u)}async function HD(D){if(D===W)return`${await yu()}/.wt`;let u=await p(D);if(!u)throw new G("HOST_NOT_FOUND",`Host "${D}" not found`);return u.root}async function r0(D){return(await a()).sandboxes[D]}async function I3(D){await e((u)=>{u.sandboxes[D.name]=D})}async function U3(){let D=await a();return Object.values(D.sandboxes).sort((u,F)=>u.name.localeCompare(F.name))}async function RD(D){let u=await r0(D);if(!u)throw new G("SANDBOX_NOT_FOUND",`Sandbox "${D}" not found`);return u}async function Z3(D,u){wu(u);let F=await e((E)=>{let C=E.sandboxes[D];if(!C)throw new G("SANDBOX_NOT_FOUND",`Sandbox "${D}" not found`);if(E.sandboxes[u])throw new G("SANDBOX_EXISTS",`Sandbox "${u}" already exists`);let B={...C,name:u};return delete E.sandboxes[D],E.sandboxes[u]=B,B});try{let E=await h(F.host),C=await HD(F.host);await E.writeMeta(C,F.id,F)}catch{}return F}async function vu(D){if(wu(D.name),D.ref)v0(D.ref);if(D.branch)v0(D.branch);let u=await _3(),F=await z3(u),E=!D.branch&&!D.ref?await vD():null,C=D.branch??E??void 0,B=C??D.ref??await T3(),$=await h(D.hostName),A=await HD(D.hostName),R=await r0(D.name);if(R){if(R.host===D.hostName&&R.repoId===F){if(await $.dirExists(R.path))return{entry:R,isIdempotent:!0}}throw new G("SANDBOX_EXISTS",`Sandbox "${D.name}" already exists (host=${R.host}, repoId=${R.repoId})`)}let x=S3(),H=`${A}/sandboxes/${D.name}`;try{await $.ensureLayout(A);let J=await $.ensureMirror(A,F,u);await $.createWorktree(J,H,B,C),await $.copyEnvFiles(process.cwd(),H);let T={name:D.name,id:x,host:D.hostName,origin:X3(u),repoId:F,ref:B,path:H,createdAt:new Date().toISOString()};return await $.writeMeta(A,x,T),await I3(T),{entry:T,isIdempotent:!1}}catch(J){if(J instanceof G)throw J;throw new G("CREATION_FAILED",J instanceof Error?J.message:String(J))}}async function gD(D){let u=await RD(D),F=await h(u.host);if(!await F.dirExists(u.path))throw new G("PATH_MISSING",`Sandbox path does not exist: ${u.path}`);return F.execInteractive(u.path,{WT_SANDBOX:u.name,WT_SANDBOX_ID:u.id})}async function dD(D){let u=await RD(D),F=await h(u.host);if(!await F.dirExists(u.path))throw new G("PATH_MISSING",`Sandbox path does not exist: ${u.path}`);if(!(await F.checkTmux()).ok)throw new G("CREATION_FAILED","tmux not found on host. Run: wt bootstrap --tmux --host <host>");let B=`wt-${u.id}`;return F.execTmux(u.path,B)}function mu(D,u){if(D.host===W)return`wt enter ${D.name}`;if(!u)return`wt enter ${D.name}`;let F=["ssh","-t"];if(u.port)F.push("-p",String(u.port));if(u.identity)F.push("-i",u.identity);return F.push(u.ssh,`'cd ${D.path} && exec $SHELL -l'`),F.join(" ")}function p0(D){D.command("up").description("Create a sandbox worktree on a host").argument("[name]","Sandbox name (defaults to branch name from -b/--ref or current branch)").option("-H, --host <hostName>","Target host (defaults to configured default)").option("-b, --branch <name>","Create or use a branch with this name").option("-r, --ref <ref>","Git ref to check out (branch, tag, or sha that must exist)").option("-e, --enter","Enter the sandbox after creating it").option("--tmux","Use tmux when entering (implies --enter)").option("--json","Output result as JSON").action(async(u,F)=>{try{if(!await Pu()){if(F.json)console.log(JSON.stringify({ok:!1,error:"Not inside a git repository"},null,2));else console.error(N.red("Error: Not inside a git repository"));process.exit(1)}if(F.branch&&F.ref){if(F.json)console.log(JSON.stringify({ok:!1,error:"Cannot use both --branch and --ref"},null,2));else console.error(N.red("Error: Cannot use both --branch and --ref"));process.exit(1)}let{ref:E,branch:C}=F,B=u;if(!B){let H=C??E??await vD();if(H)B=ku(H);else{if(F.json)console.log(JSON.stringify({ok:!1,error:"No name provided and could not determine branch name"},null,2));else console.error(N.red("Error: No name provided and could not determine branch name"));process.exit(1)}}let $;if(F.host){if($=F.host,$!==W){if(!await p($)){if(F.json)console.log(JSON.stringify({ok:!1,error:`Host "${$}" not found`},null,2));else console.error(N.red(`Error: Host "${$}" not found`));process.exit(1)}}}else $=(await WD())?.name??W;let A=await vu({name:B,hostName:$,ref:E,branch:C});if(F.json){console.log(JSON.stringify(A.entry,null,2));return}if(A.isIdempotent)console.log(N.dim(`Sandbox "${B}" already exists`));else console.log(N.green(`Created sandbox "${B}"`));if(F.enter||F.tmux){if(F.tmux)await dD(B);else await gD(B);return}let R=$!==W?await p($):void 0,x=mu(A.entry,R??void 0);if(process.stdout.isTTY)console.log(`Enter with: ${N.cyan(x)}`);else console.log(x)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function i0(D){D.command("local").description("Create a local sandbox worktree").argument("[name]","Sandbox name (defaults to branch name from -b/--ref or current branch)").option("-b, --branch <name>","Create or use a branch with this name").option("-r, --ref <ref>","Git ref to check out (branch, tag, or sha that must exist)").option("-e, --enter","Enter the sandbox after creating it").option("--tmux","Use tmux when entering (implies --enter)").option("--json","Output result as JSON").action(async(u,F)=>{try{if(!await Pu()){if(F.json)console.log(JSON.stringify({ok:!1,error:"Not inside a git repository"},null,2));else console.error(N.red("Error: Not inside a git repository"));process.exit(1)}if(F.branch&&F.ref){if(F.json)console.log(JSON.stringify({ok:!1,error:"Cannot use both --branch and --ref"},null,2));else console.error(N.red("Error: Cannot use both --branch and --ref"));process.exit(1)}let{ref:E,branch:C}=F,B=u;if(!B){let R=C??E??await vD();if(R)B=ku(R);else{if(F.json)console.log(JSON.stringify({ok:!1,error:"No name provided and could not determine branch name"},null,2));else console.error(N.red("Error: No name provided and could not determine branch name"));process.exit(1)}}let $=await vu({name:B,hostName:W,ref:E,branch:C});if(F.json){console.log(JSON.stringify($.entry,null,2));return}if($.isIdempotent)console.log(N.dim(`Sandbox "${B}" already exists`));else console.log(N.green(`Created sandbox "${B}"`));if(F.enter||F.tmux){if(F.tmux)await dD(B);else await gD(B);return}let A=mu($.entry);if(process.stdout.isTTY)console.log(`Enter with: ${N.cyan(A)}`);else console.log(A)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function o0(D){D.command("enter").description("Enter an existing sandbox").argument("<name>","Sandbox name").option("--json","Output sandbox record as JSON without entering").option("--tmux","Attach or create a tmux session in the sandbox").action(async(u,F)=>{try{if(F.json){let E=await RD(u);console.log(JSON.stringify(E,null,2));return}if(F.tmux)await dD(u);else await gD(u)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}async function Y3(D,u,F){let E=await RD(D),C=await h(E.host);if(!await C.dirExists(E.path))throw new G("PATH_MISSING",`Sandbox path does not exist: ${E.path}`);if(F.capture){let A=await C.exec(E.path,u);return{name:E.name,id:E.id,host:E.host,path:E.path,command:u,exitCode:A.exitCode,stdout:A.stdout,stderr:A.stderr}}let $=await C.execStream(E.path,u);return{name:E.name,id:E.id,host:E.host,path:E.path,command:u,exitCode:$,stdout:"",stderr:""}}function a0(D){D.command("run").description("Run a command in a sandbox").argument("<name>","Sandbox name").argument("<cmd...>","Command to run").option("--json","Capture output and return as JSON").option("--quiet","Suppress non-error output").passThroughOptions().action(async(u,F,E)=>{try{let C=F[0]==="--"?F.slice(1):F;if(C.length===0)console.error(N.red("Error: No command specified")),process.exit(1);let B=await Y3(u,C,{capture:!!E.json});if(E.json)console.log(JSON.stringify(B,null,2)),process.exit(B.exitCode);process.exit(B.exitCode)}catch(C){if(C instanceof G){if(E.json)console.log(JSON.stringify({ok:!1,error:C.message},null,2));else if(!E.quiet)console.error(N.red(`Error: ${C.message}`));process.exit(1)}throw C}})}async function M3(D){let u=await h(D);if(!(await u.checkTmux()).ok)return{host:D,sessions:[],ok:!0,warnings:["tmux not installed"]};let E=await u.listTmuxSessions();return{host:D,sessions:E,ok:!0,warnings:[]}}function s0(D){D.command("sessions").description("List running tmux sessions for wt sandboxes").option("-H, --host <hostName>","Target host").option("--json","Output as JSON").action(async(u)=>{let F;if(u.host)F=u.host;else F=(await WD())?.name??W;let E=await M3(F);if(u.json){console.log(JSON.stringify(E,null,2));return}if(E.warnings.length>0)for(let C of E.warnings)console.error(N.yellow(`Warning: ${C}`));if(E.sessions.length===0){console.log(N.dim("No active sessions."));return}for(let C of E.sessions){let B=C.attached?N.green("attached"):N.dim("detached");console.log(`${C.name} ${B}`)}})}var K3=rD(Q3(),1);async function e0(D){let u=K3.default(D.olderThan);if(u===void 0||u<=0)throw Error(`Invalid duration: ${D.olderThan}`);let F=await a(),C=Date.now()-u,B=Object.values(F.sandboxes),$=D.hostName?B.filter((J)=>J.host===D.hostName):B,A=[],R=[],x=[],H=new Set;for(let J of $){let _=new Date(J.createdAt).getTime()<C;if(!_)try{if(!await(await h(J.host)).dirExists(J.path))_=!0}catch{_=!0}if(!_){R.push(J);continue}if(D.dryRun){A.push(J);continue}try{let X=await h(J.host),j=await HD(J.host);await X.removeSandboxDir(J.path),await X.removeMeta(j,J.id),H.add(`${J.host}:${j}/mirrors/${J.repoId}.git`),A.push(J)}catch(X){x.push({sandbox:J.name,error:X instanceof Error?X.message:String(X)})}}if(!D.dryRun&&A.length>0)await e((J)=>{for(let T of A)delete J.sandboxes[T.name]});if(!D.dryRun)for(let J of H){let[T,_]=J.split(":",2);try{await(await h(T)).pruneWorktrees(_)}catch{}}return{deleted:A,kept:R,errors:x}}function DF(D){D.command("gc").description("Remove stale sandboxes").option("-H, --host <hostName>","Target host (omit for all hosts)").option("--older-than <duration>","Age threshold (e.g. 7d, 24h, 1w)","7d").option("--dry-run","Show what would be deleted without deleting").option("-y, --yes","Skip confirmation prompt").option("--json","Output as JSON").action(async(u)=>{try{let F=await e0({hostName:u.host,olderThan:u.olderThan,dryRun:!0});if(u.json&&u.dryRun){console.log(JSON.stringify(F,null,2));return}if(F.deleted.length===0&&F.errors.length===0){if(u.json)console.log(JSON.stringify(F,null,2));else console.log(N.dim("Nothing to clean up."));return}if(u.dryRun){if(F.deleted.length>0){console.log(`Would delete ${F.deleted.length} sandbox(es)`);for(let C of F.deleted)console.log(` ${N.red("-")} ${C.name} (${C.host})`)}return}if(!u.json){console.log(`Found ${F.deleted.length} sandbox(es) to delete:`);for(let C of F.deleted)console.log(` ${N.red("-")} ${C.name} (${C.host})`)}if(!u.yes&&!u.json){if(!await AD({message:`Delete ${F.deleted.length} sandbox(es)?`,default:!1})){console.log(N.dim("Cancelled."));return}}let E=await e0({hostName:u.host,olderThan:u.olderThan,dryRun:!1});if(u.json){console.log(JSON.stringify(E,null,2));return}if(E.deleted.length>0)console.log(`Deleted ${E.deleted.length} sandbox(es)`);if(E.errors.length>0){for(let C of E.errors)console.error(N.red(`Error (${C.sandbox}): ${C.error}`));process.exit(1)}}catch(F){if(F instanceof FD)console.log(N.dim(`
60
- Cancelled.`)),process.exit(130);if(u.json)console.log(JSON.stringify({ok:!1,error:F instanceof Error?F.message:String(F)},null,2));else console.error(N.red(`Error: ${F instanceof Error?F.message:String(F)}`));process.exit(1)}})}async function W3(D){let u=[],F=[],E=[];if(D!==W){let x=await p(D);if(!x)return{ok:!1,host:D,checks:[{name:"host",ok:!1,detail:"not found in config"}],warnings:[],errors:[`Host "${D}" not found`]};let H=await Vu(ND(x)),J=H.ok?{name:"ssh",ok:!0,detail:"connected"}:{name:"ssh",ok:!1,detail:H.stderr||"connection failed"};if(u.push(J),!J.ok)return E.push(`SSH connection failed: ${J.detail}`),{ok:!1,host:D,checks:u,warnings:F,errors:E}}let C=await h(D),B=await C.checkGit();if(u.push(B),!B.ok)E.push(`git: ${B.detail}`);let $=await C.checkRuntime();if(u.push($),!$.ok)F.push(`runtime: ${$.detail}`);let A=await C.checkTmux();if(u.push(A),!A.ok)F.push(`tmux: ${A.detail}`);return{ok:u.every((x)=>x.ok||x.name==="tmux"||x.name==="runtime"),host:D,checks:u,warnings:F,errors:E}}function uF(D){D.command("doctor").description("Check system prerequisites and host health").option("-H, --host <hostName>","Target host").option("--json","Output as JSON").action(async(u)=>{let F;if(u.host)F=u.host;else F=(await WD())?.name??W;let E=await W3(F);if(u.json){console.log(JSON.stringify(E,null,2));return}for(let C of E.checks)if(C.ok)console.log(` ${N.green("\u2713")} ${C.name}${C.detail?` (${C.detail})`:""}`);else console.log(` ${N.red("\u2717")} ${C.name}${C.detail?`: ${C.detail}`:""}`);if(E.warnings.length>0)for(let C of E.warnings)console.log(` ${N.yellow("\u26A0")} ${C}`);if(console.log(),E.ok)console.log(N.green(`Host "${F}" is healthy.`));else console.log(N.red(`Host "${F}" has issues.`)),process.exit(1)})}var w8=/^[a-zA-Z0-9._-]+$/;async function V8(D){let u=await p(D);if(!u)return null;let F=ND(u);for(let E of["apt-get","apk","dnf","yum","brew"])if((await Q(F,`command -v ${M(E)}`)).ok)return E;return null}function f8(D,u){switch(u){case"apt-get":return`sudo apt-get install -y ${D}`;case"apk":return`sudo apk add ${D}`;case"dnf":return`sudo dnf install -y ${D}`;case"yum":return`sudo yum install -y ${D}`;case"brew":return`brew install ${D}`;default:return`install ${D} manually`}}async function L3(D){let u=[],F=[],E=[],C=D.hostName===W,B=await h(D.hostName),$=await B.checkGit();if(u.push($),!$.ok)F.push("git");let A=await B.checkRuntime();if(u.push(A),!A.ok)F.push("bun or node");if(D.tmux){let x=await B.checkTmux();if(u.push(x),!x.ok)F.push("tmux")}if(!C){let x=await p(D.hostName);if(!x)throw new G("HOST_NOT_FOUND",`Host "${D.hostName}" not found`);let H=ND(x);for(let J of["bash","curl"]){let _=(await Q(H,`command -v ${M(J)}`)).ok?{name:J,ok:!0}:{name:J,ok:!1,detail:"not found"};if(u.push(_),!_.ok)F.push(J)}for(let J of D.agents){if(!w8.test(J))throw new G("VALIDATION_ERROR",`Invalid agent name "${J}": must contain only alphanumeric characters, dots, underscores, or hyphens`);let _=(await Q(H,`command -v ${M(J)}`)).ok?{name:J,ok:!0}:{name:J,ok:!1,detail:"not found"};if(u.push(_),!_.ok)F.push(J)}if(F.length>0){let J=await V8(D.hostName);if(J)for(let T of F)if(T==="bun or node")E.push("curl -fsSL https://bun.sh/install | bash");else if(T==="claude"||T==="opencode")E.push(`npm install -g ${T}`);else E.push(f8(T,J));else E.push(`No package manager found. Install manually: ${F.join(", ")}`)}}else if(F.length>0)for(let x of F)if(x==="bun or node")E.push("curl -fsSL https://bun.sh/install | bash");else E.push(`Install ${x} using your system package manager`);try{let x=await HD(D.hostName);await B.ensureLayout(x),u.push({name:"layout",ok:!0})}catch(x){u.push({name:"layout",ok:!1,detail:x instanceof Error?x.message:String(x)})}let R=F.length===0&&u.every((x)=>x.ok);return{host:D.hostName,ok:R,checks:u,missing:F,instructions:E}}function FF(D){D.command("bootstrap").description("Check host readiness and report missing packages").requiredOption("-H, --host <hostName>","Target host").option("--tmux","Include tmux in checks").option("--agents <list>","Comma-separated agent CLIs to check (e.g. claude,opencode)").option("--json","Output as JSON").action(async(u)=>{try{let F=u.agents?u.agents.split(",").map((C)=>C.trim()).filter(Boolean):[],E=await L3({hostName:u.host,tmux:!!u.tmux,agents:F});if(u.json){if(console.log(JSON.stringify(E,null,2)),!E.ok)process.exit(1);return}for(let C of E.checks)if(C.ok)console.log(` ${N.green("\u2713")} ${C.name}${C.detail?` (${C.detail})`:""}`);else console.log(` ${N.red("\u2717")} ${C.name}${C.detail?`: ${C.detail}`:""}`);if(E.missing.length>0)console.log(),console.log(N.yellow(`Missing: ${E.missing.join(", ")}`));if(E.instructions.length>0){console.log(),console.log(N.dim("Install instructions:"));for(let C of E.instructions)console.log(` ${C}`)}if(console.log(),E.ok)console.log(N.green(`Host "${u.host}" is ready.`));else console.log(N.red(`Host "${u.host}" is not ready.`)),process.exit(1)}catch(F){if(F instanceof G){if(u.json)console.log(JSON.stringify({ok:!1,error:F.message},null,2));else console.error(N.red(`Error: ${F.message}`));process.exit(1)}throw F}})}async function w3(D){let u=await U3(),F=D.hostName?u.filter((E)=>E.host===D.hostName):u;return{sandboxes:F,total:F.length}}function EF(D){D.command("ls").description("List sandboxes").option("-H, --host <hostName>","Filter by host").option("--json","Output as JSON").action(async(u)=>{try{let F=await w3({hostName:u.host});if(u.json){console.log(JSON.stringify(F,null,2));return}if(F.total===0){console.log(N.dim("No sandboxes found."));return}let E=Math.max(...F.sandboxes.map(($)=>$.name.length),4),C=Math.max(...F.sandboxes.map(($)=>$.host.length),4),B=Math.max(...F.sandboxes.map(($)=>$.ref.substring(0,8).length),3);console.log(N.bold(`${"NAME".padEnd(E)} ${"HOST".padEnd(C)} ${"REF".padEnd(B)} CREATED`));for(let $ of F.sandboxes){let A=$.ref.substring(0,8),R=new Date($.createdAt).toLocaleDateString();console.log(`${N.cyan($.name.padEnd(E))} ${$.host.padEnd(C)} ${N.yellow(A.padEnd(B))} ${N.dim(R)}`)}console.log(N.dim(`
59
+ `).filter(Boolean).map((F)=>{let[E,C]=F.split("\t");return{name:E,attached:C==="1"}}).filter((F)=>F.name.startsWith("wt-"))}async copyEnvFiles(D,u){let F=new Bun.Glob(".env*"),E=[];for await(let A of F.scan({cwd:D,onlyFiles:!0,dot:!0}))E.push(A);if(E.length===0)return;let C=bD(this.sshOpts),B=C.pop(),$=[];for(let A=0;A<C.length;A++)if(C[A]==="-p")$.push("-P",C[A+1]),A++;else if(C[A]==="-i")$.push("-i",C[A+1]),A++;else if(C[A]==="-o")$.push("-o",C[A+1]),A++;for(let A of E){let R=`${D}/${A}`,x=`${B}:${u}/${A}`;await Bun.$`scp ${$} ${R} ${x}`.quiet().nothrow()}}async checkGit(){let D=await Q(this.sshOpts,"git --version");if(!D.ok)return{name:"git",ok:!1,detail:"not found"};return{name:"git",ok:!0,detail:D.stdout.trim()}}async checkTmux(){let D=await Q(this.sshOpts,"tmux -V");if(!D.ok)return{name:"tmux",ok:!1,detail:"not found"};return{name:"tmux",ok:!0,detail:D.stdout.trim()}}async checkRuntime(){let D=await Q(this.sshOpts,"bun --version");if(D.ok)return{name:"bun",ok:!0,detail:D.stdout.trim()};let u=await Q(this.sshOpts,"node --version");if(u.ok)return{name:"node",ok:!0,detail:u.stdout.trim()};return{name:"runtime",ok:!1,detail:"neither bun nor node found"}}}async function h(D){if(D===W)return new hu;let u=await p(D);if(!u)throw new G("HOST_NOT_FOUND",`Host "${D}" not found`);return new bu(u)}async function HD(D){if(D===W)return`${await yu()}/.wt`;let u=await p(D);if(!u)throw new G("HOST_NOT_FOUND",`Host "${D}" not found`);return u.root}async function r0(D){return(await a()).sandboxes[D]}async function I3(D){await e((u)=>{u.sandboxes[D.name]=D})}async function U3(){let D=await a();return Object.values(D.sandboxes).sort((u,F)=>u.name.localeCompare(F.name))}async function RD(D){let u=await r0(D);if(!u)throw new G("SANDBOX_NOT_FOUND",`Sandbox "${D}" not found`);return u}async function Z3(D,u){wu(u);let F=await e((E)=>{let C=E.sandboxes[D];if(!C)throw new G("SANDBOX_NOT_FOUND",`Sandbox "${D}" not found`);if(E.sandboxes[u])throw new G("SANDBOX_EXISTS",`Sandbox "${u}" already exists`);let B={...C,name:u};return delete E.sandboxes[D],E.sandboxes[u]=B,B});try{let E=await h(F.host),C=await HD(F.host);await E.writeMeta(C,F.id,F)}catch{}return F}async function vu(D){if(wu(D.name),D.ref)v0(D.ref);if(D.branch)v0(D.branch);let u=await _3(),F=await z3(u),E=!D.branch&&!D.ref?await vD():null,C=D.branch??E??void 0,B=C??D.ref??await T3(),$=await h(D.hostName),A=await HD(D.hostName),R=await r0(D.name);if(R){if(R.host===D.hostName&&R.repoId===F){if(await $.dirExists(R.path))return{entry:R,isIdempotent:!0}}throw new G("SANDBOX_EXISTS",`Sandbox "${D.name}" already exists (host=${R.host}, repoId=${R.repoId})`)}let x=S3(),H=`${A}/sandboxes/${D.name}`;try{await $.ensureLayout(A);let J=await $.ensureMirror(A,F,u);await $.createWorktree(J,H,B,C),await $.copyEnvFiles(process.cwd(),H);let T={name:D.name,id:x,host:D.hostName,origin:X3(u),repoId:F,ref:B,path:H,createdAt:new Date().toISOString()};return await $.writeMeta(A,x,T),await I3(T),{entry:T,isIdempotent:!1}}catch(J){if(J instanceof G)throw J;throw new G("CREATION_FAILED",J instanceof Error?J.message:String(J))}}async function gD(D){let u=await RD(D),F=await h(u.host);if(!await F.dirExists(u.path))throw new G("PATH_MISSING",`Sandbox path does not exist: ${u.path}`);return F.execInteractive(u.path,{WT_SANDBOX:u.name,WT_SANDBOX_ID:u.id})}async function nD(D){let u=await RD(D),F=await h(u.host);if(!await F.dirExists(u.path))throw new G("PATH_MISSING",`Sandbox path does not exist: ${u.path}`);if(!(await F.checkTmux()).ok)throw new G("CREATION_FAILED","tmux not found on host. Run: wt bootstrap --tmux --host <host>");let B=`wt-${u.id}`;return F.execTmux(u.path,B)}function mu(D,u){if(D.host===W)return`wt enter ${D.name}`;if(!u)return`wt enter ${D.name}`;let F=["ssh","-t"];if(u.port)F.push("-p",String(u.port));if(u.identity)F.push("-i",u.identity);return F.push(u.ssh,`'cd ${D.path} && exec $SHELL -l'`),F.join(" ")}function p0(D){D.command("up").description("Create a sandbox worktree on a host").argument("[name]","Sandbox name (defaults to branch name from -b/--ref or current branch)").option("-H, --host <hostName>","Target host (defaults to configured default)").option("-b, --branch <name>","Create or use a branch with this name").option("-r, --ref <ref>","Git ref to check out (branch, tag, or sha that must exist)").option("-e, --enter","Enter the sandbox after creating it").option("--tmux","Use tmux when entering (implies --enter)").option("--json","Output result as JSON").action(async(u,F)=>{try{if(!await Pu()){if(F.json)console.log(JSON.stringify({ok:!1,error:"Not inside a git repository"},null,2));else console.error(N.red("Error: Not inside a git repository"));process.exit(1)}if(F.branch&&F.ref){if(F.json)console.log(JSON.stringify({ok:!1,error:"Cannot use both --branch and --ref"},null,2));else console.error(N.red("Error: Cannot use both --branch and --ref"));process.exit(1)}let{ref:E,branch:C}=F,B=u;if(!B){let H=C??E??await vD();if(H)B=ku(H);else{if(F.json)console.log(JSON.stringify({ok:!1,error:"No name provided and could not determine branch name"},null,2));else console.error(N.red("Error: No name provided and could not determine branch name"));process.exit(1)}}let $;if(F.host){if($=F.host,$!==W){if(!await p($)){if(F.json)console.log(JSON.stringify({ok:!1,error:`Host "${$}" not found`},null,2));else console.error(N.red(`Error: Host "${$}" not found`));process.exit(1)}}}else $=(await WD())?.name??W;let A=await vu({name:B,hostName:$,ref:E,branch:C});if(F.json){console.log(JSON.stringify(A.entry,null,2));return}if(A.isIdempotent)console.log(N.dim(`Sandbox "${B}" already exists`));else console.log(N.green(`Created sandbox "${B}"`));if(F.enter||F.tmux){if(F.tmux)await nD(B);else await gD(B);return}let R=$!==W?await p($):void 0,x=mu(A.entry,R??void 0);if(process.stdout.isTTY)console.log(`Enter with: ${N.cyan(x)}`);else console.log(x)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function i0(D){D.command("local").description("Create a local sandbox worktree").argument("[name]","Sandbox name (defaults to branch name from -b/--ref or current branch)").option("-b, --branch <name>","Create or use a branch with this name").option("-r, --ref <ref>","Git ref to check out (branch, tag, or sha that must exist)").option("-e, --enter","Enter the sandbox after creating it").option("--tmux","Use tmux when entering (implies --enter)").option("--json","Output result as JSON").action(async(u,F)=>{try{if(!await Pu()){if(F.json)console.log(JSON.stringify({ok:!1,error:"Not inside a git repository"},null,2));else console.error(N.red("Error: Not inside a git repository"));process.exit(1)}if(F.branch&&F.ref){if(F.json)console.log(JSON.stringify({ok:!1,error:"Cannot use both --branch and --ref"},null,2));else console.error(N.red("Error: Cannot use both --branch and --ref"));process.exit(1)}let{ref:E,branch:C}=F,B=u;if(!B){let R=C??E??await vD();if(R)B=ku(R);else{if(F.json)console.log(JSON.stringify({ok:!1,error:"No name provided and could not determine branch name"},null,2));else console.error(N.red("Error: No name provided and could not determine branch name"));process.exit(1)}}let $=await vu({name:B,hostName:W,ref:E,branch:C});if(F.json){console.log(JSON.stringify($.entry,null,2));return}if($.isIdempotent)console.log(N.dim(`Sandbox "${B}" already exists`));else console.log(N.green(`Created sandbox "${B}"`));if(F.enter||F.tmux){if(F.tmux)await nD(B);else await gD(B);return}let A=mu($.entry);if(process.stdout.isTTY)console.log(`Enter with: ${N.cyan(A)}`);else console.log(A)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function o0(D){D.command("enter").description("Enter an existing sandbox").argument("<name>","Sandbox name").option("--json","Output sandbox record as JSON without entering").option("--tmux","Attach or create a tmux session in the sandbox").action(async(u,F)=>{try{if(F.json){let E=await RD(u);console.log(JSON.stringify(E,null,2));return}if(F.tmux)await nD(u);else await gD(u)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}async function Y3(D,u,F){let E=await RD(D),C=await h(E.host);if(!await C.dirExists(E.path))throw new G("PATH_MISSING",`Sandbox path does not exist: ${E.path}`);if(F.capture){let A=await C.exec(E.path,u);return{name:E.name,id:E.id,host:E.host,path:E.path,command:u,exitCode:A.exitCode,stdout:A.stdout,stderr:A.stderr}}let $=await C.execStream(E.path,u);return{name:E.name,id:E.id,host:E.host,path:E.path,command:u,exitCode:$,stdout:"",stderr:""}}function a0(D){D.command("run").description("Run a command in a sandbox").argument("<name>","Sandbox name").argument("<cmd...>","Command to run").option("--json","Capture output and return as JSON").option("--quiet","Suppress non-error output").passThroughOptions().action(async(u,F,E)=>{try{let C=F[0]==="--"?F.slice(1):F;if(C.length===0)console.error(N.red("Error: No command specified")),process.exit(1);let B=await Y3(u,C,{capture:!!E.json});if(E.json)console.log(JSON.stringify(B,null,2)),process.exit(B.exitCode);process.exit(B.exitCode)}catch(C){if(C instanceof G){if(E.json)console.log(JSON.stringify({ok:!1,error:C.message},null,2));else if(!E.quiet)console.error(N.red(`Error: ${C.message}`));process.exit(1)}throw C}})}async function M3(D){let u=await h(D);if(!(await u.checkTmux()).ok)return{host:D,sessions:[],ok:!0,warnings:["tmux not installed"]};let E=await u.listTmuxSessions();return{host:D,sessions:E,ok:!0,warnings:[]}}function s0(D){D.command("sessions").description("List running tmux sessions for wt sandboxes").option("-H, --host <hostName>","Target host").option("--json","Output as JSON").action(async(u)=>{let F;if(u.host)F=u.host;else F=(await WD())?.name??W;let E=await M3(F);if(u.json){console.log(JSON.stringify(E,null,2));return}if(E.warnings.length>0)for(let C of E.warnings)console.error(N.yellow(`Warning: ${C}`));if(E.sessions.length===0){console.log(N.dim("No active sessions."));return}for(let C of E.sessions){let B=C.attached?N.green("attached"):N.dim("detached");console.log(`${C.name} ${B}`)}})}var K3=rD(Q3(),1);async function e0(D){let u=K3.default(D.olderThan);if(u===void 0||u<=0)throw Error(`Invalid duration: ${D.olderThan}`);let F=await a(),C=Date.now()-u,B=Object.values(F.sandboxes),$=D.hostName?B.filter((J)=>J.host===D.hostName):B,A=[],R=[],x=[],H=new Set;for(let J of $){let _=new Date(J.createdAt).getTime()<C;if(!_)try{if(!await(await h(J.host)).dirExists(J.path))_=!0}catch{_=!0}if(!_){R.push(J);continue}if(D.dryRun){A.push(J);continue}try{let X=await h(J.host),j=await HD(J.host);await X.removeSandboxDir(J.path),await X.removeMeta(j,J.id),H.add(`${J.host}:${j}/mirrors/${J.repoId}.git`),A.push(J)}catch(X){x.push({sandbox:J.name,error:X instanceof Error?X.message:String(X)})}}if(!D.dryRun&&A.length>0)await e((J)=>{for(let T of A)delete J.sandboxes[T.name]});if(!D.dryRun)for(let J of H){let[T,_]=J.split(":",2);try{await(await h(T)).pruneWorktrees(_)}catch{}}return{deleted:A,kept:R,errors:x}}function DF(D){D.command("gc").description("Remove stale sandboxes").option("-H, --host <hostName>","Target host (omit for all hosts)").option("--older-than <duration>","Age threshold (e.g. 7d, 24h, 1w)","7d").option("--dry-run","Show what would be deleted without deleting").option("-y, --yes","Skip confirmation prompt").option("--json","Output as JSON").action(async(u)=>{try{let F=await e0({hostName:u.host,olderThan:u.olderThan,dryRun:!0});if(u.json&&u.dryRun){console.log(JSON.stringify(F,null,2));return}if(F.deleted.length===0&&F.errors.length===0){if(u.json)console.log(JSON.stringify(F,null,2));else console.log(N.dim("Nothing to clean up."));return}if(u.dryRun){if(F.deleted.length>0){console.log(`Would delete ${F.deleted.length} sandbox(es)`);for(let C of F.deleted)console.log(` ${N.red("-")} ${C.name} (${C.host})`)}return}if(!u.json){console.log(`Found ${F.deleted.length} sandbox(es) to delete:`);for(let C of F.deleted)console.log(` ${N.red("-")} ${C.name} (${C.host})`)}if(!u.yes&&!u.json){if(!await AD({message:`Delete ${F.deleted.length} sandbox(es)?`,default:!1})){console.log(N.dim("Cancelled."));return}}let E=await e0({hostName:u.host,olderThan:u.olderThan,dryRun:!1});if(u.json){console.log(JSON.stringify(E,null,2));return}if(E.deleted.length>0)console.log(`Deleted ${E.deleted.length} sandbox(es)`);if(E.errors.length>0){for(let C of E.errors)console.error(N.red(`Error (${C.sandbox}): ${C.error}`));process.exit(1)}}catch(F){if(F instanceof FD)console.log(N.dim(`
60
+ Cancelled.`)),process.exit(130);if(u.json)console.log(JSON.stringify({ok:!1,error:F instanceof Error?F.message:String(F)},null,2));else console.error(N.red(`Error: ${F instanceof Error?F.message:String(F)}`));process.exit(1)}})}async function W3(D){let u=[],F=[],E=[];if(D!==W){let x=await p(D);if(!x)return{ok:!1,host:D,checks:[{name:"host",ok:!1,detail:"not found in config"}],warnings:[],errors:[`Host "${D}" not found`]};let H=await Vu(ND(x)),J=H.ok?{name:"ssh",ok:!0,detail:"connected"}:{name:"ssh",ok:!1,detail:H.stderr||"connection failed"};if(u.push(J),!J.ok)return E.push(`SSH connection failed: ${J.detail}`),{ok:!1,host:D,checks:u,warnings:F,errors:E}}let C=await h(D),B=await C.checkGit();if(u.push(B),!B.ok)E.push(`git: ${B.detail}`);let $=await C.checkRuntime();if(u.push($),!$.ok)F.push(`runtime: ${$.detail}`);let A=await C.checkTmux();if(u.push(A),!A.ok)F.push(`tmux: ${A.detail}`);return{ok:u.every((x)=>x.ok||x.name==="tmux"||x.name==="runtime"),host:D,checks:u,warnings:F,errors:E}}function uF(D){D.command("doctor").description("Check system prerequisites and host health").option("-H, --host <hostName>","Target host").option("--json","Output as JSON").action(async(u)=>{let F;if(u.host)F=u.host;else F=(await WD())?.name??W;let E=await W3(F);if(u.json){console.log(JSON.stringify(E,null,2));return}for(let C of E.checks)if(C.ok)console.log(` ${N.green("\u2713")} ${C.name}${C.detail?` (${C.detail})`:""}`);else console.log(` ${N.red("\u2717")} ${C.name}${C.detail?`: ${C.detail}`:""}`);if(E.warnings.length>0)for(let C of E.warnings)console.log(` ${N.yellow("\u26A0")} ${C}`);if(console.log(),E.ok)console.log(N.green(`Host "${F}" is healthy.`));else console.log(N.red(`Host "${F}" has issues.`)),process.exit(1)})}var w8=/^[a-zA-Z0-9._-]+$/;async function V8(D){let u=await p(D);if(!u)return null;let F=ND(u);for(let E of["apt-get","apk","dnf","yum","brew"])if((await Q(F,`command -v ${M(E)}`)).ok)return E;return null}function f8(D,u){switch(u){case"apt-get":return`sudo apt-get install -y ${D}`;case"apk":return`sudo apk add ${D}`;case"dnf":return`sudo dnf install -y ${D}`;case"yum":return`sudo yum install -y ${D}`;case"brew":return`brew install ${D}`;default:return`install ${D} manually`}}async function L3(D){let u=[],F=[],E=[],C=D.hostName===W,B=await h(D.hostName),$=await B.checkGit();if(u.push($),!$.ok)F.push("git");let A=await B.checkRuntime();if(u.push(A),!A.ok)F.push("bun or node");if(D.tmux){let x=await B.checkTmux();if(u.push(x),!x.ok)F.push("tmux")}if(!C){let x=await p(D.hostName);if(!x)throw new G("HOST_NOT_FOUND",`Host "${D.hostName}" not found`);let H=ND(x);for(let J of["bash","curl"]){let _=(await Q(H,`command -v ${M(J)}`)).ok?{name:J,ok:!0}:{name:J,ok:!1,detail:"not found"};if(u.push(_),!_.ok)F.push(J)}for(let J of D.agents){if(!w8.test(J))throw new G("VALIDATION_ERROR",`Invalid agent name "${J}": must contain only alphanumeric characters, dots, underscores, or hyphens`);let _=(await Q(H,`command -v ${M(J)}`)).ok?{name:J,ok:!0}:{name:J,ok:!1,detail:"not found"};if(u.push(_),!_.ok)F.push(J)}if(F.length>0){let J=await V8(D.hostName);if(J)for(let T of F)if(T==="bun or node")E.push("curl -fsSL https://bun.sh/install | bash");else if(T==="claude"||T==="opencode")E.push(`npm install -g ${T}`);else E.push(f8(T,J));else E.push(`No package manager found. Install manually: ${F.join(", ")}`)}}else if(F.length>0)for(let x of F)if(x==="bun or node")E.push("curl -fsSL https://bun.sh/install | bash");else E.push(`Install ${x} using your system package manager`);try{let x=await HD(D.hostName);await B.ensureLayout(x),u.push({name:"layout",ok:!0})}catch(x){u.push({name:"layout",ok:!1,detail:x instanceof Error?x.message:String(x)})}let R=F.length===0&&u.every((x)=>x.ok);return{host:D.hostName,ok:R,checks:u,missing:F,instructions:E}}function FF(D){D.command("bootstrap").description("Check host readiness and report missing packages").requiredOption("-H, --host <hostName>","Target host").option("--tmux","Include tmux in checks").option("--agents <list>","Comma-separated agent CLIs to check (e.g. claude,opencode)").option("--json","Output as JSON").action(async(u)=>{try{let F=u.agents?u.agents.split(",").map((C)=>C.trim()).filter(Boolean):[],E=await L3({hostName:u.host,tmux:!!u.tmux,agents:F});if(u.json){if(console.log(JSON.stringify(E,null,2)),!E.ok)process.exit(1);return}for(let C of E.checks)if(C.ok)console.log(` ${N.green("\u2713")} ${C.name}${C.detail?` (${C.detail})`:""}`);else console.log(` ${N.red("\u2717")} ${C.name}${C.detail?`: ${C.detail}`:""}`);if(E.missing.length>0)console.log(),console.log(N.yellow(`Missing: ${E.missing.join(", ")}`));if(E.instructions.length>0){console.log(),console.log(N.dim("Install instructions:"));for(let C of E.instructions)console.log(` ${C}`)}if(console.log(),E.ok)console.log(N.green(`Host "${u.host}" is ready.`));else console.log(N.red(`Host "${u.host}" is not ready.`)),process.exit(1)}catch(F){if(F instanceof G){if(u.json)console.log(JSON.stringify({ok:!1,error:F.message},null,2));else console.error(N.red(`Error: ${F.message}`));process.exit(1)}throw F}})}async function w3(D){let u=await U3(),F=D.hostName?u.filter((E)=>E.host===D.hostName):u;return{sandboxes:F,total:F.length}}function EF(D){D.command("ls").description("List sandboxes").option("-H, --host <hostName>","Filter by host").option("--json","Output as JSON").action(async(u)=>{try{let F=await w3({hostName:u.host});if(u.json){console.log(JSON.stringify(F,null,2));return}if(F.total===0){console.log(N.dim("No sandboxes found."));return}let E=Math.max(...F.sandboxes.map((A)=>A.name.length),4),C=Math.max(...F.sandboxes.map((A)=>A.host.length),4),B=(A,R=20)=>A.length>R?A.substring(0,R-3)+"...":A,$=Math.max(...F.sandboxes.map((A)=>B(A.ref).length),3);console.log(N.bold(`${"NAME".padEnd(E)} ${"HOST".padEnd(C)} ${"REF".padEnd($)} CREATED`));for(let A of F.sandboxes){let R=B(A.ref),x=new Date(A.createdAt).toLocaleDateString();console.log(`${N.cyan(A.name.padEnd(E))} ${A.host.padEnd(C)} ${N.yellow(R.padEnd($))} ${N.dim(x)}`)}console.log(N.dim(`
61
61
  ${F.total} sandbox(es)`))}catch(F){if(u.json)console.log(JSON.stringify({ok:!1,error:F instanceof Error?F.message:String(F)},null,2));else console.error(N.red(`Error: ${F instanceof Error?F.message:String(F)}`));process.exit(1)}})}async function V3(D){let F=(await a()).sandboxes[D];if(!F)throw new G("SANDBOX_NOT_FOUND",`Sandbox "${D}" not found`);let E=await h(F.host),C=await HD(F.host),B={dir:!1,meta:!1,config:!1};try{await E.removeSandboxDir(F.path),B.dir=!0}catch{}try{await E.removeMeta(C,F.id),B.meta=!0}catch{}await e(($)=>{delete $.sandboxes[D]}),B.config=!0;try{let $=`${C}/mirrors/${F.repoId}.git`;await E.pruneWorktrees($)}catch{}return{entry:F,cleaned:B}}function CF(D){D.command("rm").description("Remove a sandbox").argument("<name>","Sandbox name").option("-y, --yes","Skip confirmation prompt").option("--json","Output as JSON").action(async(u,F)=>{try{if(!F.yes&&!F.json){if(!await AD({message:`Remove sandbox "${u}"?`,default:!1})){console.log(N.dim("Cancelled."));return}}let E=await V3(u);if(F.json){console.log(JSON.stringify(E,null,2));return}console.log(`Removed sandbox ${N.cyan(E.entry.name)}`);let C=[];if(!E.cleaned.dir)C.push("directory");if(!E.cleaned.meta)C.push("metadata");if(C.length>0)console.log(N.yellow(` Warning: could not clean ${C.join(", ")}`))}catch(E){if(E instanceof FD)console.log(N.dim(`
62
- Cancelled.`)),process.exit(130);if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function y8(D){let u=Date.now()-new Date(D).getTime(),F=Math.floor(u/1000);if(F<60)return`${F}s`;let E=Math.floor(F/60);if(E<60)return`${E}m`;let C=Math.floor(E/60);if(C<24)return`${C}h`;return`${Math.floor(C/24)}d`}async function f3(D){let u=await RD(D),F=await h(u.host),E=!1;try{E=await F.dirExists(u.path)}catch{}let C=null;try{let B=await F.listTmuxSessions(),$=`wt-${u.id}`,A=B.find((R)=>R.name===$);if(A)C=A.name}catch{}return{entry:u,dirExists:E,tmuxSession:C,age:y8(u.createdAt)}}function BF(D){D.command("status").description("Show sandbox status").argument("<name>","Sandbox name").option("--json","Output as JSON").action(async(u,F)=>{try{let E=await f3(u);if(F.json){console.log(JSON.stringify(E,null,2));return}let{entry:C,dirExists:B,tmuxSession:$,age:A}=E;console.log(N.bold(C.name)),console.log(` ${"ID".padEnd(10)} ${N.dim(C.id)}`),console.log(` ${"Host".padEnd(10)} ${C.host}`),console.log(` ${"Ref".padEnd(10)} ${N.yellow(C.ref.substring(0,8))}`),console.log(` ${"Origin".padEnd(10)} ${N.dim(C.origin)}`),console.log(` ${"Path".padEnd(10)} ${C.path}`),console.log(` ${"Age".padEnd(10)} ${A}`);let R=B?N.green("exists"):N.red("missing");console.log(` ${"Dir".padEnd(10)} ${R}`);let x=$?N.green($):N.dim("none");console.log(` ${"Tmux".padEnd(10)} ${x}`)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function $F(D){D.command("rename").description("Rename a sandbox").argument("<old>","Current sandbox name").argument("<new>","New sandbox name").option("--json","Output result as JSON").action(async(u,F,E)=>{try{let C=await Z3(u,F);if(E.json){console.log(JSON.stringify(C,null,2));return}console.log(N.green(`Renamed "${u}" -> "${F}"`))}catch(C){if(C instanceof G){if(E.json)console.log(JSON.stringify({ok:!1,error:C.message},null,2));else console.error(N.red(`Error: ${C.message}`));process.exit(1)}throw C}})}var i=new MF,y3="0.0.5";function P8(D,u=""){let F=[],E=D.name(),C=D.registeredArguments.map((A)=>A.required?`<${A.name()}>`:`[${A.name()}]`).join(" "),B=C?`${E} ${C}`:E;F.push(`${u}${B}`);let $=D.commands.filter((A)=>A.name()!=="help");return $.forEach((A,R)=>{let x=R===$.length-1,H=x?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",J=u+(x?" ":"\u2502 "),T=A.name(),_=A.registeredArguments.map((O)=>O.required?`<${O.name()}>`:`[${O.name()}]`).join(" "),X=_?`${T} ${_}`:T,j=A.commands.filter((O)=>O.name()!=="help");if(j.length>0)F.push(`${u}${H}${X}`),j.forEach((O,I)=>{let z=I===j.length-1?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",n=O.name(),DD=O.registeredArguments.map((lD)=>lD.required?`<${lD.name()}>`:`[${lD.name()}]`).join(" "),_D=DD?`${n} ${DD}`:n;F.push(`${J}${z}${_D}`)});else F.push(`${u}${H}${X}`)}),F}i.name("wt").enablePositionalOptions().description("Run worktrees, coding agents, and more all from the cloud. SSH included, agents too!").version(y3,"-v, --version").option("--tree","Show command tree").action((D)=>{if(D.tree){console.log(P8(i).join(`
62
+ Cancelled.`)),process.exit(130);if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function y8(D){let u=Date.now()-new Date(D).getTime(),F=Math.floor(u/1000);if(F<60)return`${F}s`;let E=Math.floor(F/60);if(E<60)return`${E}m`;let C=Math.floor(E/60);if(C<24)return`${C}h`;return`${Math.floor(C/24)}d`}async function f3(D){let u=await RD(D),F=await h(u.host),E=!1;try{E=await F.dirExists(u.path)}catch{}let C=null;try{let B=await F.listTmuxSessions(),$=`wt-${u.id}`,A=B.find((R)=>R.name===$);if(A)C=A.name}catch{}return{entry:u,dirExists:E,tmuxSession:C,age:y8(u.createdAt)}}function BF(D){D.command("status").description("Show sandbox status").argument("<name>","Sandbox name").option("--json","Output as JSON").action(async(u,F)=>{try{let E=await f3(u);if(F.json){console.log(JSON.stringify(E,null,2));return}let{entry:C,dirExists:B,tmuxSession:$,age:A}=E;console.log(N.bold(C.name)),console.log(` ${"ID".padEnd(10)} ${N.dim(C.id)}`),console.log(` ${"Host".padEnd(10)} ${C.host}`),console.log(` ${"Ref".padEnd(10)} ${N.yellow(C.ref.substring(0,8))}`),console.log(` ${"Origin".padEnd(10)} ${N.dim(C.origin)}`),console.log(` ${"Path".padEnd(10)} ${C.path}`),console.log(` ${"Age".padEnd(10)} ${A}`);let R=B?N.green("exists"):N.red("missing");console.log(` ${"Dir".padEnd(10)} ${R}`);let x=$?N.green($):N.dim("none");console.log(` ${"Tmux".padEnd(10)} ${x}`)}catch(E){if(E instanceof G){if(F.json)console.log(JSON.stringify({ok:!1,error:E.message},null,2));else console.error(N.red(`Error: ${E.message}`));process.exit(1)}throw E}})}function $F(D){D.command("rename").description("Rename a sandbox").argument("<old>","Current sandbox name").argument("<new>","New sandbox name").option("--json","Output result as JSON").action(async(u,F,E)=>{try{let C=await Z3(u,F);if(E.json){console.log(JSON.stringify(C,null,2));return}console.log(N.green(`Renamed "${u}" -> "${F}"`))}catch(C){if(C instanceof G){if(E.json)console.log(JSON.stringify({ok:!1,error:C.message},null,2));else console.error(N.red(`Error: ${C.message}`));process.exit(1)}throw C}})}var i=new MF,y3="0.0.6";function P8(D,u=""){let F=[],E=D.name(),C=D.registeredArguments.map((A)=>A.required?`<${A.name()}>`:`[${A.name()}]`).join(" "),B=C?`${E} ${C}`:E;F.push(`${u}${B}`);let $=D.commands.filter((A)=>A.name()!=="help");return $.forEach((A,R)=>{let x=R===$.length-1,H=x?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",J=u+(x?" ":"\u2502 "),T=A.name(),_=A.registeredArguments.map((O)=>O.required?`<${O.name()}>`:`[${O.name()}]`).join(" "),X=_?`${T} ${_}`:T,j=A.commands.filter((O)=>O.name()!=="help");if(j.length>0)F.push(`${u}${H}${X}`),j.forEach((O,I)=>{let z=I===j.length-1?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ",d=O.name(),DD=O.registeredArguments.map((lD)=>lD.required?`<${lD.name()}>`:`[${lD.name()}]`).join(" "),_D=DD?`${d} ${DD}`:d;F.push(`${J}${z}${_D}`)});else F.push(`${u}${H}${X}`)}),F}i.name("wt").enablePositionalOptions().description("Run worktrees, coding agents, and more all from the cloud. SSH included, agents too!").version(y3,"-v, --version").option("--tree","Show command tree").action((D)=>{if(D.tree){console.log(P8(i).join(`
63
63
  `));return}let u=`
64
64
  __
65
65
  /\\ \\__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abhi-arya1/wt",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Git worktree sandboxes, locally or on remote hosts over SSH.",
5
5
  "module": "index.ts",
6
6
  "type": "module",