@umijs/utils 3.5.17 → 4.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/compiled/address/index.js +1 -0
- package/compiled/address/lib/address.d.ts +28 -0
- package/compiled/address/package.json +1 -0
- package/compiled/axios/LICENSE +19 -0
- package/compiled/axios/index.d.ts +206 -0
- package/compiled/axios/index.js +1 -0
- package/compiled/axios/package.json +1 -0
- package/compiled/chalk/LICENSE +9 -0
- package/compiled/chalk/index.d.ts +415 -0
- package/compiled/chalk/index.js +1 -0
- package/compiled/chalk/package.json +1 -0
- package/compiled/cheerio/LICENSE +21 -0
- package/compiled/cheerio/domelementtype/lib/index.d.ts +48 -0
- package/compiled/cheerio/domhandler/lib/index.d.ts +85 -0
- package/compiled/cheerio/domhandler/lib/node.d.ts +169 -0
- package/compiled/cheerio/htmlparser2/lib/Parser.d.ts +159 -0
- package/compiled/cheerio/htmlparser2/lib/Tokenizer.d.ts +182 -0
- package/compiled/cheerio/htmlparser2/lib/index.d.ts +39 -0
- package/compiled/cheerio/index.js +16 -0
- package/compiled/cheerio/lib/api/attributes.d.ts +317 -0
- package/compiled/cheerio/lib/api/css.d.ts +41 -0
- package/compiled/cheerio/lib/api/forms.d.ts +31 -0
- package/compiled/cheerio/lib/api/manipulation.d.ts +496 -0
- package/compiled/cheerio/lib/api/traversing.d.ts +644 -0
- package/compiled/cheerio/lib/cheerio.d.ts +53 -0
- package/compiled/cheerio/lib/index.d.ts +91 -0
- package/compiled/cheerio/lib/load.d.ts +73 -0
- package/compiled/cheerio/lib/options.d.ts +31 -0
- package/compiled/cheerio/lib/static.d.ts +88 -0
- package/compiled/cheerio/lib/types.d.ts +20 -0
- package/compiled/cheerio/package.json +1 -0
- package/compiled/color/LICENSE +21 -0
- package/compiled/color/color-convert/conversions.d.ts +149 -0
- package/compiled/color/color-convert/index.d.ts +113 -0
- package/compiled/color/color-convert/route.d.ts +294 -0
- package/compiled/color/color-name/index.d.ts +161 -0
- package/compiled/color/index.d.ts +142 -0
- package/compiled/color/index.js +1 -0
- package/compiled/color/package.json +4 -0
- package/compiled/cross-spawn/LICENSE +21 -0
- package/compiled/cross-spawn/index.d.ts +36 -0
- package/compiled/cross-spawn/index.js +1 -0
- package/compiled/cross-spawn/package.json +1 -0
- package/compiled/debug/LICENSE +19 -0
- package/compiled/debug/index.d.ts +54 -0
- package/compiled/debug/index.js +1 -0
- package/compiled/debug/ms/index.d.ts +25 -0
- package/compiled/debug/package.json +1 -0
- package/compiled/fs-extra/LICENSE +15 -0
- package/compiled/fs-extra/index.d.ts +332 -0
- package/compiled/fs-extra/index.js +1 -0
- package/compiled/fs-extra/package.json +1 -0
- package/compiled/glob/LICENSE +21 -0
- package/compiled/glob/index.d.ts +89 -0
- package/compiled/glob/index.js +1 -0
- package/compiled/glob/minimatch/index.d.ts +204 -0
- package/compiled/glob/package.json +1 -0
- package/compiled/import-lazy/LICENSE +9 -0
- package/compiled/import-lazy/index.d.ts +26 -0
- package/compiled/import-lazy/index.js +1 -0
- package/compiled/import-lazy/package.json +1 -0
- package/compiled/lodash/LICENSE +47 -0
- package/compiled/lodash/common/array.d.ts +2126 -0
- package/compiled/lodash/common/collection.d.ts +1930 -0
- package/compiled/lodash/common/common.d.ts +280 -0
- package/compiled/lodash/common/date.d.ts +23 -0
- package/compiled/lodash/common/function.d.ts +1430 -0
- package/compiled/lodash/common/lang.d.ts +1692 -0
- package/compiled/lodash/common/math.d.ts +405 -0
- package/compiled/lodash/common/number.d.ts +131 -0
- package/compiled/lodash/common/object.d.ts +2519 -0
- package/compiled/lodash/common/seq.d.ts +210 -0
- package/compiled/lodash/common/string.d.ts +788 -0
- package/compiled/lodash/common/util.d.ts +1219 -0
- package/compiled/lodash/index.d.ts +46 -0
- package/compiled/lodash/index.js +9 -0
- package/compiled/lodash/package.json +1 -0
- package/compiled/mustache/LICENSE +11 -0
- package/compiled/mustache/index.d.ts +437 -0
- package/compiled/mustache/index.js +5 -0
- package/compiled/mustache/package.json +1 -0
- package/compiled/pkg-up/LICENSE +9 -0
- package/compiled/pkg-up/index.d.ts +48 -0
- package/compiled/pkg-up/index.js +1 -0
- package/compiled/pkg-up/package.json +1 -0
- package/compiled/portfinder/LICENSE +22 -0
- package/compiled/portfinder/index.js +1 -0
- package/compiled/portfinder/lib/portfinder.d.ts +47 -0
- package/compiled/portfinder/package.json +1 -0
- package/compiled/prettier/LICENSE +7 -0
- package/compiled/prettier/index.d.ts +867 -0
- package/compiled/prettier/index.js +475 -0
- package/compiled/prettier/package.json +5 -0
- package/compiled/prompts/LICENSE +21 -0
- package/compiled/prompts/index.d.ts +120 -0
- package/compiled/prompts/index.js +1 -0
- package/compiled/prompts/package.json +1 -0
- package/compiled/resolve/LICENSE +21 -0
- package/compiled/resolve/index.d.ts +166 -0
- package/compiled/resolve/index.js +1 -0
- package/compiled/resolve/package.json +1 -0
- package/compiled/rimraf/LICENSE +15 -0
- package/compiled/rimraf/glob/index.d.ts +89 -0
- package/compiled/rimraf/index.d.ts +49 -0
- package/compiled/rimraf/index.js +1 -0
- package/compiled/rimraf/minimatch/index.d.ts +204 -0
- package/compiled/rimraf/package.json +1 -0
- package/compiled/semver/LICENSE +15 -0
- package/compiled/semver/classes/comparator.d.ts +17 -0
- package/compiled/semver/classes/range.d.ts +21 -0
- package/compiled/semver/classes/semver.d.ts +62 -0
- package/compiled/semver/functions/clean.d.ts +8 -0
- package/compiled/semver/functions/cmp.d.ts +16 -0
- package/compiled/semver/functions/coerce.d.ts +12 -0
- package/compiled/semver/functions/compare-build.d.ts +16 -0
- package/compiled/semver/functions/compare-loose.d.ts +5 -0
- package/compiled/semver/functions/compare.d.ts +20 -0
- package/compiled/semver/functions/diff.d.ts +13 -0
- package/compiled/semver/functions/eq.d.ts +9 -0
- package/compiled/semver/functions/gt.d.ts +9 -0
- package/compiled/semver/functions/gte.d.ts +9 -0
- package/compiled/semver/functions/inc.d.ts +15 -0
- package/compiled/semver/functions/lt.d.ts +9 -0
- package/compiled/semver/functions/lte.d.ts +8 -0
- package/compiled/semver/functions/major.d.ts +9 -0
- package/compiled/semver/functions/minor.d.ts +9 -0
- package/compiled/semver/functions/neq.d.ts +9 -0
- package/compiled/semver/functions/parse.d.ts +12 -0
- package/compiled/semver/functions/patch.d.ts +9 -0
- package/compiled/semver/functions/prerelease.d.ts +12 -0
- package/compiled/semver/functions/rcompare.d.ts +15 -0
- package/compiled/semver/functions/rsort.d.ts +9 -0
- package/compiled/semver/functions/satisfies.d.ts +14 -0
- package/compiled/semver/functions/sort.d.ts +9 -0
- package/compiled/semver/functions/valid.d.ts +11 -0
- package/compiled/semver/index.d.ts +133 -0
- package/compiled/semver/index.js +1 -0
- package/compiled/semver/internals/identifiers.d.ts +13 -0
- package/compiled/semver/package.json +1 -0
- package/compiled/semver/ranges/gtr.d.ts +14 -0
- package/compiled/semver/ranges/intersects.d.ts +13 -0
- package/compiled/semver/ranges/ltr.d.ts +14 -0
- package/compiled/semver/ranges/max-satisfying.d.ts +14 -0
- package/compiled/semver/ranges/min-satisfying.d.ts +14 -0
- package/compiled/semver/ranges/min-version.d.ts +10 -0
- package/compiled/semver/ranges/outside.d.ts +15 -0
- package/compiled/semver/ranges/simplify.d.ts +14 -0
- package/compiled/semver/ranges/subset.d.ts +13 -0
- package/compiled/semver/ranges/to-comparators.d.ts +9 -0
- package/compiled/semver/ranges/valid.d.ts +12 -0
- package/compiled/strip-ansi/LICENSE +9 -0
- package/compiled/strip-ansi/index.d.ts +17 -0
- package/compiled/strip-ansi/index.js +1 -0
- package/compiled/strip-ansi/package.json +1 -0
- package/compiled/yargs-parser/index.d.ts +112 -0
- package/compiled/yargs-parser/index.js +1 -0
- package/compiled/yargs-parser/package.json +1 -0
- package/dist/BaseGenerator/BaseGenerator.d.ts +18 -0
- package/dist/BaseGenerator/BaseGenerator.js +58 -0
- package/{lib → dist}/Generator/Generator.d.ts +3 -3
- package/dist/Generator/Generator.js +74 -0
- package/dist/importLazy.d.ts +6 -0
- package/dist/importLazy.js +17 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +79 -0
- package/dist/logger.d.ts +14 -0
- package/dist/logger.js +39 -0
- package/dist/randomColor/randomColor.d.ts +6 -0
- package/dist/randomColor/randomColor.js +19 -0
- package/dist/register.d.ts +6 -0
- package/dist/register.js +47 -0
- package/dist/winPath.d.ts +1 -0
- package/dist/winPath.js +11 -0
- package/package.json +92 -12
- package/lib/BabelRegister/BabelRegister.d.ts +0 -9
- package/lib/BabelRegister/BabelRegister.js +0 -66
- package/lib/Generator/Generator.js +0 -120
- package/lib/cheerio/cheerio.d.ts +0 -2
- package/lib/cheerio/cheerio.js +0 -37
- package/lib/cleanRequireCache/cleanRequireCache.d.ts +0 -1
- package/lib/cleanRequireCache/cleanRequireCache.js +0 -40
- package/lib/compatESModuleRequire/compatESModuleRequire.d.ts +0 -7
- package/lib/compatESModuleRequire/compatESModuleRequire.js +0 -22
- package/lib/delay/delay.d.ts +0 -1
- package/lib/delay/delay.js +0 -22
- package/lib/getFile/getFile.d.ts +0 -22
- package/lib/getFile/getFile.js +0 -85
- package/lib/index.d.ts +0 -66
- package/lib/index.js +0 -619
- package/lib/isLernaPackage/isLernaPackage.d.ts +0 -1
- package/lib/isLernaPackage/isLernaPackage.js +0 -42
- package/lib/mergeConfig/mergeConfig.d.ts +0 -8
- package/lib/mergeConfig/mergeConfig.js +0 -42
- package/lib/parseRequireDeps/parseRequireDeps.d.ts +0 -1
- package/lib/parseRequireDeps/parseRequireDeps.js +0 -98
- package/lib/randomColor/randomColor.d.ts +0 -6
- package/lib/randomColor/randomColor.js +0 -42
- package/lib/routes.d.ts +0 -11
- package/lib/routes.js +0 -53
- package/lib/ssr.d.ts +0 -12
- package/lib/ssr.js +0 -41
- package/lib/types.d.ts +0 -7
- package/lib/types.js +0 -17
- package/lib/winEOL/winEOL.d.ts +0 -7
- package/lib/winEOL/winEOL.js +0 -39
- package/lib/winPath/winPath.d.ts +0 -1
- package/lib/winPath/winPath.js +0 -28
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Terkel Gjervig Nielsen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Type definitions for prompts 2.0
|
|
2
|
+
// Project: https://github.com/terkelg/prompts
|
|
3
|
+
// Definitions by: Berkay GURSOY <https://github.com/Berkays>
|
|
4
|
+
// Daniel Perez Alvarez <https://github.com/unindented>
|
|
5
|
+
// Kamontat Chantrachirathumrong <https://github.com/kamontat>
|
|
6
|
+
// theweirdone <https://github.com/theweirdone>
|
|
7
|
+
// whoaa512 <https://github.com/whoaa512>
|
|
8
|
+
// John Reilly <https://github.com/johnnyreilly>
|
|
9
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
10
|
+
// TypeScript Version: 2.9
|
|
11
|
+
|
|
12
|
+
/// <reference types="node" />
|
|
13
|
+
|
|
14
|
+
export = prompts;
|
|
15
|
+
|
|
16
|
+
import { Readable, Writable } from 'stream';
|
|
17
|
+
|
|
18
|
+
declare function prompts<T extends string = string>(
|
|
19
|
+
questions: prompts.PromptObject<T> | Array<prompts.PromptObject<T>>,
|
|
20
|
+
options?: prompts.Options
|
|
21
|
+
): Promise<prompts.Answers<T>>;
|
|
22
|
+
|
|
23
|
+
declare namespace prompts {
|
|
24
|
+
// Circular reference from prompts
|
|
25
|
+
const prompt: any;
|
|
26
|
+
|
|
27
|
+
function inject(arr: ReadonlyArray<any>): void;
|
|
28
|
+
|
|
29
|
+
namespace inject {
|
|
30
|
+
const prototype: {};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function override(obj: { [key: string]: any }): void;
|
|
34
|
+
|
|
35
|
+
namespace override {
|
|
36
|
+
const prototype: {};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
namespace prompts {
|
|
40
|
+
function autocomplete(args: PromptObject): any;
|
|
41
|
+
|
|
42
|
+
function confirm(args: PromptObject): void;
|
|
43
|
+
|
|
44
|
+
function date(args: PromptObject): any;
|
|
45
|
+
|
|
46
|
+
function invisible(args: PromptObject): any;
|
|
47
|
+
|
|
48
|
+
function list(args: PromptObject): any;
|
|
49
|
+
|
|
50
|
+
function multiselect(args: PromptObject): any;
|
|
51
|
+
|
|
52
|
+
function number(args: PromptObject): void;
|
|
53
|
+
|
|
54
|
+
function password(args: PromptObject): any;
|
|
55
|
+
|
|
56
|
+
function select(args: PromptObject): void;
|
|
57
|
+
|
|
58
|
+
function text(args: PromptObject): void;
|
|
59
|
+
|
|
60
|
+
function toggle(args: PromptObject): void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Based upon: https://github.com/terkelg/prompts/blob/d7d2c37a0009e3235b2e88a7d5cdbb114ac271b2/lib/elements/select.js#L29
|
|
64
|
+
interface Choice {
|
|
65
|
+
title: string;
|
|
66
|
+
value?: any;
|
|
67
|
+
disabled?: boolean | undefined;
|
|
68
|
+
selected?: boolean | undefined;
|
|
69
|
+
description?: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface Options {
|
|
73
|
+
onSubmit?: ((prompt: PromptObject, answer: any, answers: any[]) => void) | undefined;
|
|
74
|
+
onCancel?: ((prompt: PromptObject, answers: any) => void) | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface PromptObject<T extends string = string> {
|
|
78
|
+
type: PromptType | Falsy | PrevCaller<T, PromptType | Falsy>;
|
|
79
|
+
name: ValueOrFunc<T>;
|
|
80
|
+
message?: ValueOrFunc<string> | undefined;
|
|
81
|
+
initial?: InitialReturnValue | PrevCaller<T, InitialReturnValue | Promise<InitialReturnValue>> | undefined;
|
|
82
|
+
style?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
83
|
+
format?: PrevCaller<T, void> | undefined;
|
|
84
|
+
validate?: PrevCaller<T, boolean | string | Promise<boolean | string>> | undefined;
|
|
85
|
+
onState?: PrevCaller<T, void> | undefined;
|
|
86
|
+
min?: number | PrevCaller<T, number | Falsy> | undefined;
|
|
87
|
+
max?: number | PrevCaller<T, number | Falsy> | undefined;
|
|
88
|
+
float?: boolean | PrevCaller<T, boolean | Falsy> | undefined;
|
|
89
|
+
round?: number | PrevCaller<T, number | Falsy> | undefined;
|
|
90
|
+
instructions?: string | boolean | undefined;
|
|
91
|
+
increment?: number | PrevCaller<T, number | Falsy> | undefined;
|
|
92
|
+
separator?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
93
|
+
active?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
94
|
+
inactive?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
95
|
+
choices?: Choice[] | PrevCaller<T, Choice[] | Falsy> | undefined;
|
|
96
|
+
hint?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
97
|
+
warn?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
98
|
+
suggest?: ((input: any, choices: Choice[]) => Promise<any>) | undefined;
|
|
99
|
+
limit?: number | PrevCaller<T, number | Falsy> | undefined;
|
|
100
|
+
mask?: string | PrevCaller<T, string | Falsy> | undefined;
|
|
101
|
+
stdout?: Writable | undefined;
|
|
102
|
+
stdin?: Readable | undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type Answers<T extends string> = { [id in T]: any };
|
|
106
|
+
|
|
107
|
+
type PrevCaller<T extends string, R = T> = (
|
|
108
|
+
prev: any,
|
|
109
|
+
values: Answers<T>,
|
|
110
|
+
prompt: PromptObject
|
|
111
|
+
) => R;
|
|
112
|
+
|
|
113
|
+
type Falsy = false | null | undefined;
|
|
114
|
+
|
|
115
|
+
type PromptType = "text" | "password" | "invisible" | "number" | "confirm" | "list" | "toggle" | "select" | "multiselect" | "autocomplete" | "date" | "autocompleteMultiselect";
|
|
116
|
+
|
|
117
|
+
type ValueOrFunc<T extends string> = T | PrevCaller<T>;
|
|
118
|
+
|
|
119
|
+
type InitialReturnValue = string | number | boolean | Date;
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){var t={8188:function(t){"use strict";const{FORCE_COLOR:i,NODE_DISABLE_COLORS:r,TERM:o}=process.env;const h={enabled:!r&&o!=="dumb"&&i!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(t,i){let r=0,o,h="",l="";for(;r<t.length;r++){o=t[r];h+=o.open;l+=o.close;if(i.includes(o.close)){i=i.replace(o.rgx,o.close+o.open)}}return h+i+l}function chain(t,i){let r={has:t,keys:i};r.reset=h.reset.bind(r);r.bold=h.bold.bind(r);r.dim=h.dim.bind(r);r.italic=h.italic.bind(r);r.underline=h.underline.bind(r);r.inverse=h.inverse.bind(r);r.hidden=h.hidden.bind(r);r.strikethrough=h.strikethrough.bind(r);r.black=h.black.bind(r);r.red=h.red.bind(r);r.green=h.green.bind(r);r.yellow=h.yellow.bind(r);r.blue=h.blue.bind(r);r.magenta=h.magenta.bind(r);r.cyan=h.cyan.bind(r);r.white=h.white.bind(r);r.gray=h.gray.bind(r);r.grey=h.grey.bind(r);r.bgBlack=h.bgBlack.bind(r);r.bgRed=h.bgRed.bind(r);r.bgGreen=h.bgGreen.bind(r);r.bgYellow=h.bgYellow.bind(r);r.bgBlue=h.bgBlue.bind(r);r.bgMagenta=h.bgMagenta.bind(r);r.bgCyan=h.bgCyan.bind(r);r.bgWhite=h.bgWhite.bind(r);return r}function init(t,i){let r={open:`[${t}m`,close:`[${i}m`,rgx:new RegExp(`\\x1b\\[${i}m`,"g")};return function(i){if(this!==void 0&&this.has!==void 0){this.has.includes(t)||(this.has.push(t),this.keys.push(r));return i===void 0?this:h.enabled?run(this.keys,i+""):i+""}return i===void 0?chain([t],[r]):h.enabled?run([r],i+""):i+""}}t.exports=h},1048:function(t){"use strict";class DatePart{constructor({token:t,date:i,parts:r,locales:o}){this.token=t;this.date=i||new Date;this.parts=r||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((i,r)=>r>t&&i instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const i=t.indexOf(this);return t.find(((t,r)=>r>i&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},834:function(t,i,r){"use strict";const o=r(1048);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let i=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?i+1:this.token==="ddd"?this.locales.weekdaysShort[i]:this.token==="dddd"?this.locales.weekdays[i]:t}}t.exports=Day},3092:function(t,i,r){"use strict";const o=r(1048);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},1512:function(t,i,r){"use strict";t.exports={DatePart:r(1048),Meridiem:r(5502),Day:r(834),Hours:r(3092),Milliseconds:r(2758),Minutes:r(5501),Month:r(7956),Seconds:r(3472),Year:r(2576)}},5502:function(t,i,r){"use strict";const o=r(1048);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},2758:function(t,i,r){"use strict";const o=r(1048);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},5501:function(t,i,r){"use strict";const o=r(1048);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},7956:function(t,i,r){"use strict";const o=r(1048);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let i=this.token.length;return i===2?String(t+1).padStart(2,"0"):i===3?this.locales.monthsShort[t]:i===4?this.locales.months[t]:String(t+1)}}t.exports=Month},3472:function(t,i,r){"use strict";const o=r(1048);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},2576:function(t,i,r){"use strict";const o=r(1048);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},4604:function(t,i,r){"use strict";function asyncGeneratorStep(t,i,r,o,h,l,u){try{var a=t[l](u);var c=a.value}catch(t){r(t);return}if(a.done){i(c)}else{Promise.resolve(c).then(o,h)}}function _asyncToGenerator(t){return function(){var i=this,r=arguments;return new Promise((function(o,h){var l=t.apply(i,r);function _next(t){asyncGeneratorStep(l,o,h,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,h,_next,_throw,"throw",t)}_next(undefined)}))}}const o=r(8188);const h=r(8738);const l=r(6420),u=l.erase,a=l.cursor;const c=r(7140),d=c.style,p=c.clear,m=c.figures,g=c.wrap,v=c.entriesToDisplay;const getVal=(t,i)=>t[i]&&(t[i].value||t[i].title||t[i]);const getTitle=(t,i)=>t[i]&&(t[i].title||t[i].value||t[i]);const getIndex=(t,i)=>{const r=t.findIndex((t=>t.value===i||t.title===i));return r>-1?r:undefined};class AutocompletePrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=d.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=p("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}complete(t){var i=this;return _asyncToGenerator((function*(){const r=i.completing=i.suggest(i.input,i.choices);const o=yield r;if(i.completing!==r)return;i.suggestions=o.map(((t,i,r)=>({title:getTitle(r,i),value:getVal(r,i),description:t.description})));i.completing=false;const h=Math.max(o.length-1,0);i.moveSelect(Math.min(h,i.select));t&&t()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,i){let r=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${r}${t}${o}`;this.cursor=r.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let i=this.input.slice(this.cursor);this.input=`${t}${i}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let i=this.input.slice(this.cursor+1);this.input=`${t}${i}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,i,r,h){let l;let u=r?m.arrowUp:h?m.arrowDown:" ";let a=i?o.cyan().underline(t.title):t.title;u=(i?o.cyan(m.pointer)+" ":" ")+u;if(t.description){l=` - ${t.description}`;if(u.length+a.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1){l="\n"+g(t.description,{margin:3,width:this.out.columns})}}return u+" "+a+o.gray(l||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);else this.out.write(p(this.outputText,this.out.columns));super.render();let t=v(this.select,this.choices.length,this.limit),i=t.startIndex,r=t.endIndex;this.outputText=[d.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),d.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const t=this.suggestions.slice(i,r).map(((t,o)=>this.renderOption(t,this.select===o+i,o===0&&i>0,o+i===r-1&&r<this.choices.length))).join("\n");this.outputText+=`\n`+(t||o.gray(this.fallback.title))}this.out.write(u.line+a.to(0)+this.outputText)}}t.exports=AutocompletePrompt},7477:function(t,i,r){"use strict";const o=r(8188);const h=r(6420),l=h.cursor;const u=r(4637);const a=r(7140),c=a.clear,d=a.style,p=a.figures;class AutocompleteMultiselectPrompt extends u{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=c("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const i=this.filteredOptions.findIndex((i=>i===t));this.cursor=i<0?0:i;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,i){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${p.arrowUp}/${p.arrowDown}: Highlight option\n ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,i,r){let h;if(i.disabled)h=t===r?o.gray().underline(i.title):o.strikethrough().gray(i.title);else h=t===r?o.cyan().underline(i.title):i.title;return(i.selected?o.green(p.radioOn):p.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let t=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=c(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},6822:function(t,i,r){"use strict";const o=r(8188);const h=r(8738);const l=r(7140),u=l.style,a=l.clear;const c=r(6420),d=c.erase,p=c.cursor;class ConfirmPrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,i){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(a(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(d.line+p.to(0)+this.outputText)}}t.exports=ConfirmPrompt},3465:function(t,i,r){"use strict";function asyncGeneratorStep(t,i,r,o,h,l,u){try{var a=t[l](u);var c=a.value}catch(t){r(t);return}if(a.done){i(c)}else{Promise.resolve(c).then(o,h)}}function _asyncToGenerator(t){return function(){var i=this,r=arguments;return new Promise((function(o,h){var l=t.apply(i,r);function _next(t){asyncGeneratorStep(l,o,h,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,h,_next,_throw,"throw",t)}_next(undefined)}))}}const o=r(8188);const h=r(8738);const l=r(7140),u=l.style,a=l.clear,c=l.figures;const d=r(6420),p=d.erase,m=d.cursor;const g=r(1512),v=g.DatePart,b=g.Meridiem,y=g.Day,w=g.Hours,x=g.Milliseconds,S=g.Minutes,M=g.Month,P=g.Seconds,_=g.Year;const O=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const T={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new y(t),3:t=>new M(t),4:t=>new _(t),5:t=>new b(t),6:t=>new w(t),7:t=>new S(t),8:t=>new P(t),9:t=>new x(t)};const $={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign($,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=a("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let i;this.parts=[];while(i=O.exec(t)){let t=i.shift();let r=i.findIndex((t=>t!=null));this.parts.push(r in T?T[r]({token:i[r]||t,date:this.date,parts:this.parts,locales:this.locales}):i[r]||t)}let r=this.parts.reduce(((t,i)=>{if(typeof i==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=i;else t.push(i);return t}),[]);this.parts.splice(0);this.parts.push(...r);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof v)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let i=yield t.validator(t.value);if(typeof i==="string"){t.errorMsg=i;i=false}t.error=!i}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color="red";t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof v)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(a(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.parts.reduce(((t,i,r)=>t.concat(r===this.cursor&&!this.done?o.cyan().underline(i.toString()):i)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,i,r)=>t+`\n${r?` `:c.pointerSmall} ${o.red().italic(i)}`),``)}this.out.write(p.line+m.to(0)+this.outputText)}}t.exports=DatePrompt},9605:function(t,i,r){"use strict";t.exports={TextPrompt:r(943),SelectPrompt:r(21),TogglePrompt:r(8493),DatePrompt:r(3465),NumberPrompt:r(4539),MultiselectPrompt:r(4637),AutocompletePrompt:r(4604),AutocompleteMultiselectPrompt:r(7477),ConfirmPrompt:r(6822)}},4637:function(t,i,r){"use strict";const o=r(8188);const h=r(6420),l=h.cursor;const u=r(8738);const a=r(7140),c=a.clear,d=a.figures,p=a.style,m=a.wrap,g=a.entriesToDisplay;class MultiselectPrompt extends u{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,i)=>{if(typeof t==="string")t={title:t,value:i};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?i:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=c("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((i=>i.selected=t));this.render()}_(t,i){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${d.arrowUp}/${d.arrowDown}: Highlight option\n`+` ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,i,r,h){const l=(i.selected?o.green(d.radioOn):d.radioOff)+" "+h+" ";let u,a;if(i.disabled){u=t===r?o.gray().underline(i.title):o.strikethrough().gray(i.title)}else{u=t===r?o.cyan().underline(i.title):i.title;if(t===r&&i.description){a=` - ${i.description}`;if(l.length+u.length+a.length>=this.out.columns||i.description.split(/\r?\n/).length>1){a="\n"+m(i.description,{margin:l.length,width:this.out.columns})}}}return l+u+o.gray(a||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let i=g(this.cursor,t.length,this.optionsPerPage),r=i.startIndex,h=i.endIndex;let l,u=[];for(let i=r;i<h;i++){if(i===r&&r>0){l=d.arrowUp}else if(i===h-1&&h<t.length){l=d.arrowDown}else{l=" "}u.push(this.renderOption(this.cursor,t[i],i,l))}return"\n"+u.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);super.render();let t=[p.symbol(this.done,this.aborted),o.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=c(t,this.out.columns)}}t.exports=MultiselectPrompt},4539:function(t,i,r){"use strict";function asyncGeneratorStep(t,i,r,o,h,l,u){try{var a=t[l](u);var c=a.value}catch(t){r(t);return}if(a.done){i(c)}else{Promise.resolve(c).then(o,h)}}function _asyncToGenerator(t){return function(){var i=this,r=arguments;return new Promise((function(o,h){var l=t.apply(i,r);function _next(t){asyncGeneratorStep(l,o,h,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,h,_next,_throw,"throw",t)}_next(undefined)}))}}const o=r(8188);const h=r(8738);const l=r(6420),u=l.cursor,a=l.erase;const c=r(7140),d=c.style,p=c.figures,m=c.clear,g=c.lines;const v=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,i)=>{let r=Math.pow(10,i);return Math.round(t*r)/r};class NumberPrompt extends h{constructor(t={}){super(t);this.transform=d.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||v.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let i=yield t.validator(t.value);if(typeof i===`string`){t.errorMsg=i;i=false}t.error=!i}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color=`red`;t.fire();t.render();return}let i=t.value;t.value=i!==``?i:t.initial;t.done=true;t.aborted=false;t.error=false;t.fire();t.render();t.out.write(`\n`);t.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,i){if(!this.valid(t))return this.bell();const r=Date.now();if(r-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=r;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(g(this.outputError,this.out.columns)-1)+m(this.outputError,this.out.columns));this.out.write(m(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,i,r)=>t+`\n${r?` `:p.pointerSmall} ${o.red().italic(i)}`),``)}this.out.write(a.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore)}}t.exports=NumberPrompt},8738:function(t,i,r){"use strict";const o=r(1058);const h=r(7140),l=h.action;const u=r(8614);const a=r(6420),c=a.beep,d=a.cursor;const p=r(8188);class Prompt extends u{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const i=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,i);if(this.in.isTTY)this.in.setRawMode(true);const r=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,i)=>{let o=l(i,r);if(o===false){this._&&this._(t,i)}else if(typeof this[o]==="function"){this[o](i)}else{this.bell()}};this.close=()=>{this.out.write(d.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);i.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(c)}render(){this.onRender(p);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},21:function(t,i,r){"use strict";const o=r(8188);const h=r(8738);const l=r(7140),u=l.style,a=l.clear,c=l.figures,d=l.wrap,p=l.entriesToDisplay;const m=r(6420),g=m.cursor;class SelectPrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,i)=>{if(typeof t==="string")t={title:t,value:i};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?i:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=a("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,i){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(g.hide);else this.out.write(a(this.outputText,this.out.columns));super.render();let t=p(this.cursor,this.choices.length,this.optionsPerPage),i=t.startIndex,r=t.endIndex;this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let t=i;t<r;t++){let h,l,u="",a=this.choices[t];if(t===i&&i>0){l=c.arrowUp}else if(t===r-1&&r<this.choices.length){l=c.arrowDown}else{l=" "}if(a.disabled){h=this.cursor===t?o.gray().underline(a.title):o.strikethrough().gray(a.title);l=(this.cursor===t?o.bold().gray(c.pointer)+" ":" ")+l}else{h=this.cursor===t?o.cyan().underline(a.title):a.title;l=(this.cursor===t?o.cyan(c.pointer)+" ":" ")+l;if(a.description&&this.cursor===t){u=` - ${a.description}`;if(l.length+h.length+u.length>=this.out.columns||a.description.split(/\r?\n/).length>1){u="\n"+d(a.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${l} ${h}${o.gray(u)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},943:function(t,i,r){"use strict";function asyncGeneratorStep(t,i,r,o,h,l,u){try{var a=t[l](u);var c=a.value}catch(t){r(t);return}if(a.done){i(c)}else{Promise.resolve(c).then(o,h)}}function _asyncToGenerator(t){return function(){var i=this,r=arguments;return new Promise((function(o,h){var l=t.apply(i,r);function _next(t){asyncGeneratorStep(l,o,h,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,h,_next,_throw,"throw",t)}_next(undefined)}))}}const o=r(8188);const h=r(8738);const l=r(6420),u=l.erase,a=l.cursor;const c=r(7140),d=c.style,p=c.clear,m=c.lines,g=c.figures;class TextPrompt extends h{constructor(t={}){super(t);this.transform=d.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=p(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let i=yield t.validator(t.value);if(typeof i===`string`){t.errorMsg=i;i=false}t.error=!i}))()}submit(){var t=this;return _asyncToGenerator((function*(){t.value=t.value||t.initial;t.cursorOffset=0;t.cursor=t.rendered.length;yield t.validate();if(t.error){t.red=true;t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,i){let r=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${r}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:r.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let i=this.value.slice(this.cursor);this.value=`${t}${i}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let i=this.value.slice(this.cursor+1);this.value=`${t}${i}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(a.down(m(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,i,r)=>t+`\n${r?" ":g.pointerSmall} ${o.red().italic(i)}`),``)}this.out.write(u.line+a.to(0)+this.outputText+a.save+this.outputError+a.restore+a.move(this.cursorOffset,0))}}t.exports=TextPrompt},8493:function(t,i,r){"use strict";const o=r(8188);const h=r(8738);const l=r(7140),u=l.style,a=l.clear;const c=r(6420),d=c.cursor,p=c.erase;class TogglePrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,i){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(a(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(p.line+d.to(0)+this.outputText)}}t.exports=TogglePrompt},9513:function(t,i,r){"use strict";function ownKeys(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(i){o=o.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))}r.push.apply(r,o)}return r}function _objectSpread(t){for(var i=1;i<arguments.length;i++){var r=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(r),true).forEach((function(i){_defineProperty(t,i,r[i])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))}else{ownKeys(Object(r)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))}))}}return t}function _defineProperty(t,i,r){if(i in t){Object.defineProperty(t,i,{value:r,enumerable:true,configurable:true,writable:true})}else{t[i]=r}return t}function _createForOfIteratorHelper(t,i){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_unsupportedIterableToArray(t))||i&&t&&typeof t.length==="number"){if(r)t=r;var o=0;var h=function F(){};return{s:h,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:h}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,u=false,a;return{s:function s(){r=r.call(t)},n:function n(){var t=r.next();l=t.done;return t},e:function e(t){u=true;a=t},f:function f(){try{if(!l&&r.return!=null)r.return()}finally{if(u)throw a}}}}function _unsupportedIterableToArray(t,i){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(t,i)}function _arrayLikeToArray(t,i){if(i==null||i>t.length)i=t.length;for(var r=0,o=new Array(i);r<i;r++)o[r]=t[r];return o}function asyncGeneratorStep(t,i,r,o,h,l,u){try{var a=t[l](u);var c=a.value}catch(t){r(t);return}if(a.done){i(c)}else{Promise.resolve(c).then(o,h)}}function _asyncToGenerator(t){return function(){var i=this,r=arguments;return new Promise((function(o,h){var l=t.apply(i,r);function _next(t){asyncGeneratorStep(l,o,h,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,o,h,_next,_throw,"throw",t)}_next(undefined)}))}}const o=r(1776);const h=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(t=[],{onSubmit:i=noop,onCancel:r=noop}={}){const l={};const u=prompt._override||{};t=[].concat(t);let a,c,d,p,m,g;const v=function(){var t=_asyncToGenerator((function*(t,i,r=false){if(!r&&t.validate&&t.validate(i)!==true){return}return t.format?yield t.format(i,l):i}));return function getFormattedAnswer(i,r){return t.apply(this,arguments)}}();var b=_createForOfIteratorHelper(t),y;try{for(b.s();!(y=b.n()).done;){c=y.value;var w=c;p=w.name;m=w.type;if(typeof m==="function"){m=yield m(a,_objectSpread({},l),c);c["type"]=m}if(!m)continue;for(let t in c){if(h.includes(t))continue;let i=c[t];c[t]=typeof i==="function"?yield i(a,_objectSpread({},l),g):i}g=c;if(typeof c.message!=="string"){throw new Error("prompt message is required")}var x=c;p=x.name;m=x.type;if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(u[c.name]!==undefined){a=yield v(c,u[c.name]);if(a!==undefined){l[p]=a;continue}}try{a=prompt._injected?getInjectedAnswer(prompt._injected,c.initial):yield o[m](c);l[p]=a=yield v(c,a,true);d=yield i(c,a,l)}catch(t){d=!(yield r(c,l))}if(d)return l}}catch(t){b.e(t)}finally{b.f()}return l}));return _prompt.apply(this,arguments)}function getInjectedAnswer(t,i){const r=t.shift();if(r instanceof Error){throw r}return r===undefined?i:r}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},1776:function(t,i,r){"use strict";const o=i;const h=r(9605);const noop=t=>t;function toPrompt(t,i,r={}){return new Promise(((o,l)=>{const u=new h[t](i);const a=r.onAbort||noop;const c=r.onSubmit||noop;const d=r.onExit||noop;u.on("state",i.onState||noop);u.on("submit",(t=>o(c(t))));u.on("exit",(t=>o(d(t))));u.on("abort",(t=>l(a(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const i=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(i).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,i)=>Promise.resolve(i.filter((i=>i.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},9475:function(t){"use strict";t.exports=(t,i)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(i){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},3933:function(t,i,r){"use strict";function _createForOfIteratorHelper(t,i){var r=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_unsupportedIterableToArray(t))||i&&t&&typeof t.length==="number"){if(r)t=r;var o=0;var h=function F(){};return{s:h,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:h}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l=true,u=false,a;return{s:function s(){r=r.call(t)},n:function n(){var t=r.next();l=t.done;return t},e:function e(t){u=true;a=t},f:function f(){try{if(!l&&r.return!=null)r.return()}finally{if(u)throw a}}}}function _unsupportedIterableToArray(t,i){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(t,i)}function _arrayLikeToArray(t,i){if(i==null||i>t.length)i=t.length;for(var r=0,o=new Array(i);r<i;r++)o[r]=t[r];return o}const o=r(1251);const h=r(6420),l=h.erase,u=h.cursor;const width=t=>[...o(t)].length;t.exports=function(t,i){if(!i)return l.line+u.to(0);let r=0;const o=t.split(/\r?\n/);var h=_createForOfIteratorHelper(o),a;try{for(h.s();!(a=h.n()).done;){let t=a.value;r+=1+Math.floor(Math.max(width(t)-1,0)/i)}}catch(t){h.e(t)}finally{h.f()}return l.lines(r)}},7840:function(t){"use strict";t.exports=(t,i,r)=>{r=r||i;let o=Math.min(i-r,t-Math.floor(r/2));if(o<0)o=0;let h=Math.min(o+r,i);return{startIndex:o,endIndex:h}}},7383:function(t){"use strict";const i={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const r={arrowUp:i.arrowUp,arrowDown:i.arrowDown,arrowLeft:i.arrowLeft,arrowRight:i.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?r:i;t.exports=o},7140:function(t,i,r){"use strict";t.exports={action:r(9475),clear:r(3933),style:r(2596),strip:r(1251),figures:r(7383),lines:r(7350),wrap:r(9620),entriesToDisplay:r(7840)}},7350:function(t,i,r){"use strict";const o=r(1251);t.exports=function(t,i){let r=String(o(t)||"").split(/\r?\n/);if(!i)return r.length;return r.map((t=>Math.ceil(t.length/i))).reduce(((t,i)=>t+i))}},1251:function(t){"use strict";t.exports=t=>{const i=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const r=new RegExp(i,"g");return typeof t==="string"?t.replace(r,""):t}},2596:function(t,i,r){"use strict";const o=r(8188);const h=r(7383);const l=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>l[t]||l.default;const u=Object.freeze({aborted:o.red(h.cross),done:o.green(h.tick),exited:o.yellow(h.cross),default:o.cyan("?")});const symbol=(t,i,r)=>i?u.aborted:r?u.exited:t?u.done:u.default;const delimiter=t=>o.gray(t?h.ellipsis:h.pointerSmall);const item=(t,i)=>o.gray(t?i?h.pointerSmall:"+":h.line);t.exports={styles:l,render:render,symbols:u,symbol:symbol,delimiter:delimiter,item:item}},9620:function(t){"use strict";t.exports=(t,i={})=>{const r=Number.isSafeInteger(parseInt(i.margin))?new Array(parseInt(i.margin)).fill(" ").join(""):i.margin||"";const o=i.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,i)=>{if(i.length+r.length>=o||t[t.length-1].length+i.length+1<o)t[t.length-1]+=` ${i}`;else t.push(`${r}${i}`);return t}),[r]).join("\n"))).join("\n")}},7787:function(t,i,r){function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let i=0,r=process.versions.node.split(".").map(Number);for(;i<t.length;i++){if(r[i]>t[i])return false;if(t[i]>r[i])return true}return false}t.exports=isNodeLT("8.6.0")?r(9513):r(726)},9378:function(t){"use strict";class DatePart{constructor({token:t,date:i,parts:r,locales:o}){this.token=t;this.date=i||new Date;this.parts=r||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((i,r)=>r>t&&i instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const i=t.indexOf(this);return t.find(((t,r)=>r>i&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},2096:function(t,i,r){"use strict";const o=r(9378);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let i=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?i+1:this.token==="ddd"?this.locales.weekdaysShort[i]:this.token==="dddd"?this.locales.weekdays[i]:t}}t.exports=Day},6699:function(t,i,r){"use strict";const o=r(9378);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},8228:function(t,i,r){"use strict";t.exports={DatePart:r(9378),Meridiem:r(3361),Day:r(2096),Hours:r(6699),Milliseconds:r(1219),Minutes:r(8380),Month:r(5431),Seconds:r(6550),Year:r(2867)}},3361:function(t,i,r){"use strict";const o=r(9378);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},1219:function(t,i,r){"use strict";const o=r(9378);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},8380:function(t,i,r){"use strict";const o=r(9378);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},5431:function(t,i,r){"use strict";const o=r(9378);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let i=this.token.length;return i===2?String(t+1).padStart(2,"0"):i===3?this.locales.monthsShort[t]:i===4?this.locales.months[t]:String(t+1)}}t.exports=Month},6550:function(t,i,r){"use strict";const o=r(9378);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},2867:function(t,i,r){"use strict";const o=r(9378);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},7035:function(t,i,r){"use strict";const o=r(8188);const h=r(2194);const{erase:l,cursor:u}=r(6420);const{style:a,clear:c,figures:d,wrap:p,entriesToDisplay:m}=r(2275);const getVal=(t,i)=>t[i]&&(t[i].value||t[i].title||t[i]);const getTitle=(t,i)=>t[i]&&(t[i].title||t[i].value||t[i]);const getIndex=(t,i)=>{const r=t.findIndex((t=>t.value===i||t.title===i));return r>-1?r:undefined};class AutocompletePrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=a.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=c("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}async complete(t){const i=this.completing=this.suggest(this.input,this.choices);const r=await i;if(this.completing!==i)return;this.suggestions=r.map(((t,i,r)=>({title:getTitle(r,i),value:getVal(r,i),description:t.description})));this.completing=false;const o=Math.max(r.length-1,0);this.moveSelect(Math.min(o,this.select));t&&t()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,i){let r=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${r}${t}${o}`;this.cursor=r.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let i=this.input.slice(this.cursor);this.input=`${t}${i}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let i=this.input.slice(this.cursor+1);this.input=`${t}${i}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,i,r,h){let l;let u=r?d.arrowUp:h?d.arrowDown:" ";let a=i?o.cyan().underline(t.title):t.title;u=(i?o.cyan(d.pointer)+" ":" ")+u;if(t.description){l=` - ${t.description}`;if(u.length+a.length+l.length>=this.out.columns||t.description.split(/\r?\n/).length>1){l="\n"+p(t.description,{margin:3,width:this.out.columns})}}return u+" "+a+o.gray(l||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:i}=m(this.select,this.choices.length,this.limit);this.outputText=[a.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),a.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const r=this.suggestions.slice(t,i).map(((r,o)=>this.renderOption(r,this.select===o+t,o===0&&t>0,o+t===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(r||o.gray(this.fallback.title))}this.out.write(l.line+u.to(0)+this.outputText)}}t.exports=AutocompletePrompt},8580:function(t,i,r){"use strict";const o=r(8188);const{cursor:h}=r(6420);const l=r(3401);const{clear:u,style:a,figures:c}=r(2275);class AutocompleteMultiselectPrompt extends l{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=u("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const i=this.filteredOptions.findIndex((i=>i===t));this.cursor=i<0?0:i;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,i){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${c.arrowUp}/${c.arrowDown}: Highlight option\n ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,i,r){let h;if(i.disabled)h=t===r?o.gray().underline(i.title):o.strikethrough().gray(i.title);else h=t===r?o.cyan().underline(i.title):i.title;return(i.selected?o.green(c.radioOn):c.radioOff)+" "+h}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);super.render();let t=[a.symbol(this.done,this.aborted),o.bold(this.msg),a.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=u(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},7845:function(t,i,r){const o=r(8188);const h=r(2194);const{style:l,clear:u}=r(2275);const{erase:a,cursor:c}=r(6420);class ConfirmPrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,i){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(a.line+c.to(0)+this.outputText)}}t.exports=ConfirmPrompt},3419:function(t,i,r){"use strict";const o=r(8188);const h=r(2194);const{style:l,clear:u,figures:a}=r(2275);const{erase:c,cursor:d}=r(6420);const{DatePart:p,Meridiem:m,Day:g,Hours:v,Milliseconds:b,Minutes:y,Month:w,Seconds:x,Year:S}=r(8228);const M=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const P={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new g(t),3:t=>new w(t),4:t=>new S(t),5:t=>new m(t),6:t=>new v(t),7:t=>new y(t),8:t=>new x(t),9:t=>new b(t)};const _={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(_,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=u("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let i;this.parts=[];while(i=M.exec(t)){let t=i.shift();let r=i.findIndex((t=>t!=null));this.parts.push(r in P?P[r]({token:i[r]||t,date:this.date,parts:this.parts,locales:this.locales}):i[r]||t)}let r=this.parts.reduce(((t,i)=>{if(typeof i==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=i;else t.push(i);return t}),[]);this.parts.splice(0);this.parts.push(...r);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof p)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t==="string"){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof p)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.parts.reduce(((t,i,r)=>t.concat(r===this.cursor&&!this.done?o.cyan().underline(i.toString()):i)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,i,r)=>t+`\n${r?` `:a.pointerSmall} ${o.red().italic(i)}`),``)}this.out.write(c.line+d.to(0)+this.outputText)}}t.exports=DatePrompt},5087:function(t,i,r){"use strict";t.exports={TextPrompt:r(4122),SelectPrompt:r(8561),TogglePrompt:r(5635),DatePrompt:r(3419),NumberPrompt:r(3826),MultiselectPrompt:r(3401),AutocompletePrompt:r(7035),AutocompleteMultiselectPrompt:r(8580),ConfirmPrompt:r(7845)}},3401:function(t,i,r){"use strict";const o=r(8188);const{cursor:h}=r(6420);const l=r(2194);const{clear:u,figures:a,style:c,wrap:d,entriesToDisplay:p}=r(2275);class MultiselectPrompt extends l{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,i)=>{if(typeof t==="string")t={title:t,value:i};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?i:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=u("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((i=>i.selected=t));this.render()}_(t,i){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${a.arrowUp}/${a.arrowDown}: Highlight option\n`+` ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,i,r,h){const l=(i.selected?o.green(a.radioOn):a.radioOff)+" "+h+" ";let u,c;if(i.disabled){u=t===r?o.gray().underline(i.title):o.strikethrough().gray(i.title)}else{u=t===r?o.cyan().underline(i.title):i.title;if(t===r&&i.description){c=` - ${i.description}`;if(l.length+u.length+c.length>=this.out.columns||i.description.split(/\r?\n/).length>1){c="\n"+d(i.description,{margin:l.length,width:this.out.columns})}}}return l+u+o.gray(c||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let{startIndex:i,endIndex:r}=p(this.cursor,t.length,this.optionsPerPage);let h,l=[];for(let o=i;o<r;o++){if(o===i&&i>0){h=a.arrowUp}else if(o===r-1&&r<t.length){h=a.arrowDown}else{h=" "}l.push(this.renderOption(this.cursor,t[o],o,h))}return"\n"+l.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);super.render();let t=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=u(t,this.out.columns)}}t.exports=MultiselectPrompt},3826:function(t,i,r){const o=r(8188);const h=r(2194);const{cursor:l,erase:u}=r(6420);const{style:a,figures:c,clear:d,lines:p}=r(2275);const m=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,i)=>{let r=Math.pow(10,i);return Math.round(t*r)/r};class NumberPrompt extends h{constructor(t={}){super(t);this.transform=a.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||m.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let t=this.value;this.value=t!==``?t:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,i){if(!this.valid(t))return this.bell();const r=Date.now();if(r-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=r;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[a.symbol(this.done,this.aborted),o.bold(this.msg),a.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,i,r)=>t+`\n${r?` `:c.pointerSmall} ${o.red().italic(i)}`),``)}this.out.write(u.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore)}}t.exports=NumberPrompt},2194:function(t,i,r){"use strict";const o=r(1058);const{action:h}=r(2275);const l=r(8614);const{beep:u,cursor:a}=r(6420);const c=r(8188);class Prompt extends l{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const i=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,i);if(this.in.isTTY)this.in.setRawMode(true);const r=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,i)=>{let o=h(i,r);if(o===false){this._&&this._(t,i)}else if(typeof this[o]==="function"){this[o](i)}else{this.bell()}};this.close=()=>{this.out.write(a.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);i.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(u)}render(){this.onRender(c);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},8561:function(t,i,r){"use strict";const o=r(8188);const h=r(2194);const{style:l,clear:u,figures:a,wrap:c,entriesToDisplay:d}=r(2275);const{cursor:p}=r(6420);class SelectPrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,i)=>{if(typeof t==="string")t={title:t,value:i};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?i:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=u("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,i){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:i}=d(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let r=t;r<i;r++){let h,l,u="",d=this.choices[r];if(r===t&&t>0){l=a.arrowUp}else if(r===i-1&&i<this.choices.length){l=a.arrowDown}else{l=" "}if(d.disabled){h=this.cursor===r?o.gray().underline(d.title):o.strikethrough().gray(d.title);l=(this.cursor===r?o.bold().gray(a.pointer)+" ":" ")+l}else{h=this.cursor===r?o.cyan().underline(d.title):d.title;l=(this.cursor===r?o.cyan(a.pointer)+" ":" ")+l;if(d.description&&this.cursor===r){u=` - ${d.description}`;if(l.length+h.length+u.length>=this.out.columns||d.description.split(/\r?\n/).length>1){u="\n"+c(d.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${l} ${h}${o.gray(u)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},4122:function(t,i,r){const o=r(8188);const h=r(2194);const{erase:l,cursor:u}=r(6420);const{style:a,clear:c,lines:d,figures:p}=r(2275);class TextPrompt extends h{constructor(t={}){super(t);this.transform=a.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=c(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,i){let r=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${r}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:r.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let i=this.value.slice(this.cursor);this.value=`${t}${i}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let i=this.value.slice(this.cursor+1);this.value=`${t}${i}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(d(this.outputError,this.out.columns)-1)+c(this.outputError,this.out.columns));this.out.write(c(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[a.symbol(this.done,this.aborted),o.bold(this.msg),a.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,i,r)=>t+`\n${r?" ":p.pointerSmall} ${o.red().italic(i)}`),``)}this.out.write(l.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore+u.move(this.cursorOffset,0))}}t.exports=TextPrompt},5635:function(t,i,r){const o=r(8188);const h=r(2194);const{style:l,clear:u}=r(2275);const{cursor:a,erase:c}=r(6420);class TogglePrompt extends h{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,i){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);else this.out.write(u(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(c.line+a.to(0)+this.outputText)}}t.exports=TogglePrompt},726:function(t,i,r){"use strict";const o=r(4494);const h=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(t=[],{onSubmit:i=noop,onCancel:r=noop}={}){const l={};const u=prompt._override||{};t=[].concat(t);let a,c,d,p,m,g;const getFormattedAnswer=async(t,i,r=false)=>{if(!r&&t.validate&&t.validate(i)!==true){return}return t.format?await t.format(i,l):i};for(c of t){({name:p,type:m}=c);if(typeof m==="function"){m=await m(a,{...l},c);c["type"]=m}if(!m)continue;for(let t in c){if(h.includes(t))continue;let i=c[t];c[t]=typeof i==="function"?await i(a,{...l},g):i}g=c;if(typeof c.message!=="string"){throw new Error("prompt message is required")}({name:p,type:m}=c);if(o[m]===void 0){throw new Error(`prompt type (${m}) is not defined`)}if(u[c.name]!==undefined){a=await getFormattedAnswer(c,u[c.name]);if(a!==undefined){l[p]=a;continue}}try{a=prompt._injected?getInjectedAnswer(prompt._injected,c.initial):await o[m](c);l[p]=a=await getFormattedAnswer(c,a,true);d=await i(c,a,l)}catch(t){d=!await r(c,l)}if(d)return l}return l}function getInjectedAnswer(t,i){const r=t.shift();if(r instanceof Error){throw r}return r===undefined?i:r}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},4494:function(t,i,r){"use strict";const o=i;const h=r(5087);const noop=t=>t;function toPrompt(t,i,r={}){return new Promise(((o,l)=>{const u=new h[t](i);const a=r.onAbort||noop;const c=r.onSubmit||noop;const d=r.onExit||noop;u.on("state",i.onState||noop);u.on("submit",(t=>o(c(t))));u.on("exit",(t=>o(d(t))));u.on("abort",(t=>l(a(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const i=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(i).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,i)=>Promise.resolve(i.filter((i=>i.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},4331:function(t){"use strict";t.exports=(t,i)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(i){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},4421:function(t,i,r){"use strict";const o=r(7250);const{erase:h,cursor:l}=r(6420);const width=t=>[...o(t)].length;t.exports=function(t,i){if(!i)return h.line+l.to(0);let r=0;const o=t.split(/\r?\n/);for(let t of o){r+=1+Math.floor(Math.max(width(t)-1,0)/i)}return h.lines(r)}},9995:function(t){"use strict";t.exports=(t,i,r)=>{r=r||i;let o=Math.min(i-r,t-Math.floor(r/2));if(o<0)o=0;let h=Math.min(o+r,i);return{startIndex:o,endIndex:h}}},5556:function(t){"use strict";const i={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const r={arrowUp:i.arrowUp,arrowDown:i.arrowDown,arrowLeft:i.arrowLeft,arrowRight:i.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?r:i;t.exports=o},2275:function(t,i,r){"use strict";t.exports={action:r(4331),clear:r(4421),style:r(388),strip:r(7250),figures:r(5556),lines:r(840),wrap:r(285),entriesToDisplay:r(9995)}},840:function(t,i,r){"use strict";const o=r(7250);t.exports=function(t,i){let r=String(o(t)||"").split(/\r?\n/);if(!i)return r.length;return r.map((t=>Math.ceil(t.length/i))).reduce(((t,i)=>t+i))}},7250:function(t){"use strict";t.exports=t=>{const i=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const r=new RegExp(i,"g");return typeof t==="string"?t.replace(r,""):t}},388:function(t,i,r){"use strict";const o=r(8188);const h=r(5556);const l=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>l[t]||l.default;const u=Object.freeze({aborted:o.red(h.cross),done:o.green(h.tick),exited:o.yellow(h.cross),default:o.cyan("?")});const symbol=(t,i,r)=>i?u.aborted:r?u.exited:t?u.done:u.default;const delimiter=t=>o.gray(t?h.ellipsis:h.pointerSmall);const item=(t,i)=>o.gray(t?i?h.pointerSmall:"+":h.line);t.exports={styles:l,render:render,symbols:u,symbol:symbol,delimiter:delimiter,item:item}},285:function(t){"use strict";t.exports=(t,i={})=>{const r=Number.isSafeInteger(parseInt(i.margin))?new Array(parseInt(i.margin)).fill(" ").join(""):i.margin||"";const o=i.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,i)=>{if(i.length+r.length>=o||t[t.length-1].length+i.length+1<o)t[t.length-1]+=` ${i}`;else t.push(`${r}${i}`);return t}),[r]).join("\n"))).join("\n")}},6420:function(t){"use strict";const i="";const r=`${i}[`;const o="";const h={to(t,i){if(!i)return`${r}${t+1}G`;return`${r}${i+1};${t+1}H`},move(t,i){let o="";if(t<0)o+=`${r}${-t}D`;else if(t>0)o+=`${r}${t}C`;if(i<0)o+=`${r}${-i}A`;else if(i>0)o+=`${r}${i}B`;return o},up:(t=1)=>`${r}${t}A`,down:(t=1)=>`${r}${t}B`,forward:(t=1)=>`${r}${t}C`,backward:(t=1)=>`${r}${t}D`,nextLine:(t=1)=>`${r}E`.repeat(t),prevLine:(t=1)=>`${r}F`.repeat(t),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${i}7`,restore:`${i}8`};const l={up:(t=1)=>`${r}S`.repeat(t),down:(t=1)=>`${r}T`.repeat(t)};const u={screen:`${r}2J`,up:(t=1)=>`${r}1J`.repeat(t),down:(t=1)=>`${r}J`.repeat(t),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(t){let i="";for(let r=0;r<t;r++)i+=this.line+(r<t-1?h.up():"");if(t)i+=h.left;return i}};t.exports={cursor:h,scroll:l,erase:u,beep:o}},8614:function(t){"use strict";t.exports=require("events")},1058:function(t){"use strict";t.exports=require("readline")}};var i={};function __nccwpck_require__(r){var o=i[r];if(o!==undefined){return o.exports}var h=i[r]={exports:{}};var l=true;try{t[r](h,h.exports,__nccwpck_require__);l=false}finally{if(l)delete i[r]}return h.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(7787);module.exports=r})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"prompts","author":{"name":"Terkel Gjervig","email":"terkel@terkel.com","url":"https://terkel.com"},"license":"MIT"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 James Halliday
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// Type definitions for resolve 1.20.0
|
|
2
|
+
// Project: https://github.com/browserify/resolve
|
|
3
|
+
// Definitions by: Mario Nebl <https://github.com/marionebl>
|
|
4
|
+
// Klaus Meinhardt <https://github.com/ajafff>
|
|
5
|
+
// Jordan Harband <https://github.com/ljharb>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
|
|
8
|
+
interface PackageMeta {
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ToString {
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type StringOrToString = string | ToString;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Callback invoked when resolving asynchronously
|
|
22
|
+
*
|
|
23
|
+
* @param error
|
|
24
|
+
* @param resolved Absolute path to resolved identifier
|
|
25
|
+
*/
|
|
26
|
+
type resolveCallback = (err: Error | null, resolved?: string, pkg?: PackageMeta) => void;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Callback invoked when checking if a file or directory exists
|
|
30
|
+
*
|
|
31
|
+
* @param error
|
|
32
|
+
* @param exists If the given file or directory exists
|
|
33
|
+
*/
|
|
34
|
+
type existsCallback = (err: Error | null, isFile?: boolean) => void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Callback invoked when reading a file
|
|
38
|
+
*
|
|
39
|
+
* @param error
|
|
40
|
+
* @param isFile If the given file exists
|
|
41
|
+
*/
|
|
42
|
+
type readFileCallback = (err: Error | null, file?: StringOrToString) => void;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Callback invoked when resolving a potential symlink
|
|
46
|
+
*
|
|
47
|
+
* @param error
|
|
48
|
+
* @param resolved Absolute path to the resolved file
|
|
49
|
+
*/
|
|
50
|
+
type realpathCallback = (err: Error | null, resolved?: string) => void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Callback invoked when reading and parsing a package.json file
|
|
54
|
+
*
|
|
55
|
+
* @param error
|
|
56
|
+
* @param resolved Absolute path to the resolved file
|
|
57
|
+
*/
|
|
58
|
+
type readPackageCallback = (err: Error | null, package?: Record<string, unknown>) => void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
|
|
62
|
+
*
|
|
63
|
+
* @param id Identifier to resolve
|
|
64
|
+
* @param callback
|
|
65
|
+
*/
|
|
66
|
+
declare function resolve(id: string, cb: resolveCallback): void;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json
|
|
70
|
+
*
|
|
71
|
+
* @param id Identifier to resolve
|
|
72
|
+
* @param options Options to use for resolving, optional.
|
|
73
|
+
* @param callback
|
|
74
|
+
*/
|
|
75
|
+
declare function resolve(id: string, opts: resolve.AsyncOpts, cb: resolveCallback): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Synchronously resolve the module path string id, returning the result and throwing an error when id can't be resolved.
|
|
79
|
+
*
|
|
80
|
+
* @param id Identifier to resolve
|
|
81
|
+
* @param options Options to use for resolving, optional.
|
|
82
|
+
*/
|
|
83
|
+
declare function resolveSync(id: string, opts?: resolve.SyncOpts): string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Return whether a package is in core
|
|
87
|
+
*/
|
|
88
|
+
declare function resolveIsCore(id: string): boolean | undefined;
|
|
89
|
+
|
|
90
|
+
declare namespace resolve {
|
|
91
|
+
interface Opts {
|
|
92
|
+
/** directory to begin resolving from (defaults to __dirname) */
|
|
93
|
+
basedir?: string | undefined;
|
|
94
|
+
/** package.json data applicable to the module being loaded */
|
|
95
|
+
package?: any;
|
|
96
|
+
/** set to false to exclude node core modules (e.g. fs) from the search */
|
|
97
|
+
includeCoreModules?: boolean | undefined;
|
|
98
|
+
/** array of file extensions to search in order (defaults to ['.js']) */
|
|
99
|
+
extensions?: string | ReadonlyArray<string> | undefined;
|
|
100
|
+
/** transform the parsed package.json contents before looking at the "main" field */
|
|
101
|
+
packageFilter?: ((pkg: any, pkgfile: string) => any) | undefined;
|
|
102
|
+
/** transform a path within a package */
|
|
103
|
+
pathFilter?: ((pkg: any, path: string, relativePath: string) => string) | undefined;
|
|
104
|
+
/** require.paths array to use if nothing is found on the normal node_modules recursive walk (probably don't use this) */
|
|
105
|
+
paths?: string | ReadonlyArray<string> | undefined;
|
|
106
|
+
/** return the list of candidate paths where the packages sources may be found (probably don't use this) */
|
|
107
|
+
packageIterator?: ((request: string, start: string, getPackageCandidates: () => string[], opts: Opts) => string[]) | undefined;
|
|
108
|
+
/** directory (or directories) in which to recursively look for modules. (default to 'node_modules') */
|
|
109
|
+
moduleDirectory?: string | ReadonlyArray<string> | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* if true, doesn't resolve `basedir` to real path before resolving.
|
|
112
|
+
* This is the way Node resolves dependencies when executed with the --preserve-symlinks flag.
|
|
113
|
+
*
|
|
114
|
+
* Note: this property is currently true by default but it will be changed to false in the next major version because Node's resolution
|
|
115
|
+
* algorithm does not preserve symlinks by default.
|
|
116
|
+
*/
|
|
117
|
+
preserveSymlinks?: boolean | undefined;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface BaseAsyncOpts extends Opts {
|
|
121
|
+
/** function to asynchronously test whether a file exists */
|
|
122
|
+
isFile?: ((file: string, cb: existsCallback) => void) | undefined;
|
|
123
|
+
/** function to asynchronously test whether a directory exists */
|
|
124
|
+
isDirectory?: ((directory: string, cb: existsCallback) => void) | undefined;
|
|
125
|
+
/** function to asynchronously resolve a potential symlink to its real path */
|
|
126
|
+
realpath?: ((file: string, cb: realpathCallback) => void) | undefined;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type AsyncOpts = BaseAsyncOpts & ({
|
|
130
|
+
/** how to read files asynchronously (defaults to fs.readFile) */
|
|
131
|
+
readFile?: ((file: string, cb: readFileCallback) => void) | undefined;
|
|
132
|
+
/** function to asynchronously read and parse a package.json file */
|
|
133
|
+
readPackage?: never | undefined;
|
|
134
|
+
} | {
|
|
135
|
+
/** how to read files asynchronously (defaults to fs.readFile) */
|
|
136
|
+
readFile?: never | undefined
|
|
137
|
+
/** function to asynchronously read and parse a package.json file */
|
|
138
|
+
readPackage?: ((readFile: (file: string, cb: readFileCallback) => void, pkgfile: string, cb: readPackageCallback) => void) | undefined;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
interface BaseSyncOpts extends Opts {
|
|
142
|
+
/** function to synchronously test whether a file exists */
|
|
143
|
+
isFile?: ((file: string) => boolean) | undefined;
|
|
144
|
+
/** function to synchronously test whether a directory exists */
|
|
145
|
+
isDirectory?: ((directory: string) => boolean) | undefined;
|
|
146
|
+
/** function to synchronously resolve a potential symlink to its real path */
|
|
147
|
+
realpathSync?: ((file: string) => string) | undefined;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type SyncOpts = BaseSyncOpts & ({
|
|
151
|
+
/** how to read files synchronously (defaults to fs.readFileSync) */
|
|
152
|
+
readFileSync?: ((file: string) => StringOrToString) | undefined;
|
|
153
|
+
/** function to synchronously read and parse a package.json file */
|
|
154
|
+
readPackageSync?: never | undefined;
|
|
155
|
+
} | {
|
|
156
|
+
/** how to read files synchronously (defaults to fs.readFileSync) */
|
|
157
|
+
readFileSync?: never | undefined;
|
|
158
|
+
/** function to synchronously read and parse a package.json file */
|
|
159
|
+
readPackageSync?: ((readFileSync: (file: string) => StringOrToString, pkgfile: string) => Record<string, unknown> | undefined) | undefined;
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
export var sync: typeof resolveSync;
|
|
163
|
+
export var isCore: typeof resolveIsCore;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export = resolve;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){var e={46:function(e){"use strict";var r="Function.prototype.bind called on incompatible ";var t=Array.prototype.slice;var n=Object.prototype.toString;var o="[object Function]";e.exports=function bind(e){var a=this;if(typeof a!=="function"||n.call(a)!==o){throw new TypeError(r+a)}var i=t.call(arguments,1);var s;var binder=function(){if(this instanceof s){var r=a.apply(this,i.concat(t.call(arguments)));if(Object(r)===r){return r}return this}else{return a.apply(e,i.concat(t.call(arguments)))}};var u=Math.max(0,a.length-i.length);var l=[];for(var c=0;c<u;c++){l.push("$"+c)}s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(binder);if(a.prototype){var f=function Empty(){};f.prototype=a.prototype;s.prototype=new f;f.prototype=null}return s}},766:function(e,r,t){"use strict";var n=t(46);e.exports=Function.prototype.bind||n},213:function(e,r,t){"use strict";var n=t(766);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},137:function(e,r,t){"use strict";var n=t(213);function specifierIncluded(e,r){var t=e.split(".");var n=r.split(" ");var o=n.length>1?n[0]:"=";var a=(n.length>1?n[1]:n[0]).split(".");for(var i=0;i<3;++i){var s=parseInt(t[i]||0,10);var u=parseInt(a[i]||0,10);if(s===u){continue}if(o==="<"){return s<u}if(o===">="){return s>=u}return false}return o===">="}function matchesRange(e,r){var t=r.split(/ ?&& ?/);if(t.length===0){return false}for(var n=0;n<t.length;++n){if(!specifierIncluded(e,t[n])){return false}}return true}function versionIncluded(e,r){if(typeof r==="boolean"){return r}var t=typeof e==="undefined"?process.versions&&process.versions.node:e;if(typeof t!=="string"){throw new TypeError(typeof e==="undefined"?"Unable to determine current node version":"If provided, a valid node version is required")}if(r&&typeof r==="object"){for(var n=0;n<r.length;++n){if(matchesRange(t,r[n])){return true}}return false}return matchesRange(t,r)}var o=t(290);e.exports=function isCore(e,r){return n(o,e)&&versionIncluded(r,o[e])}},85:function(e){"use strict";var r=process.platform==="win32";var t=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;var n={};function win32SplitPath(e){return t.exec(e).slice(1)}n.parse=function(e){if(typeof e!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e)}var r=win32SplitPath(e);if(!r||r.length!==5){throw new TypeError("Invalid path '"+e+"'")}return{root:r[1],dir:r[0]===r[1]?r[0]:r[0].slice(0,-1),base:r[2],ext:r[4],name:r[3]}};var o=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;var a={};function posixSplitPath(e){return o.exec(e).slice(1)}a.parse=function(e){if(typeof e!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e)}var r=posixSplitPath(e);if(!r||r.length!==5){throw new TypeError("Invalid path '"+e+"'")}return{root:r[1],dir:r[0].slice(0,-1),base:r[2],ext:r[4],name:r[3]}};if(r)e.exports=n.parse;else e.exports=a.parse;e.exports.posix=a.parse;e.exports.win32=n.parse},259:function(e,r,t){var n=t(780);n.core=t(921);n.isCore=t(969);n.sync=t(26);e.exports=n},780:function(e,r,t){var n=t(747);var o=t(622);var a=t(735);var i=t(850);var s=t(807);var u=t(137);var l=n.realpath&&typeof n.realpath.native==="function"?n.realpath.native:n.realpath;var c=function isFile(e,r){n.stat(e,(function(e,t){if(!e){return r(null,t.isFile()||t.isFIFO())}if(e.code==="ENOENT"||e.code==="ENOTDIR")return r(null,false);return r(e)}))};var f=function isDirectory(e,r){n.stat(e,(function(e,t){if(!e){return r(null,t.isDirectory())}if(e.code==="ENOENT"||e.code==="ENOTDIR")return r(null,false);return r(e)}))};var p=function realpath(e,r){l(e,(function(t,n){if(t&&t.code!=="ENOENT")r(t);else r(null,t?e:n)}))};var d=function maybeRealpath(e,r,t,n){if(t&&t.preserveSymlinks===false){e(r,n)}else{n(null,r)}};var v=function defaultReadPackage(e,r,t){e(r,(function(e,r){if(e)t(e);else{try{var n=JSON.parse(r);t(null,n)}catch(e){t(null)}}}))};var _=function getPackageCandidates(e,r,t){var n=i(r,t,e);for(var a=0;a<n.length;a++){n[a]=o.join(n[a],e)}return n};e.exports=function resolve(e,r,t){var i=t;var l=r;if(typeof r==="function"){i=l;l={}}if(typeof e!=="string"){var m=new TypeError("Path must be a string.");return process.nextTick((function(){i(m)}))}l=s(e,l);var h=l.isFile||c;var y=l.isDirectory||f;var g=l.readFile||n.readFile;var k=l.realpath||p;var w=l.readPackage||v;if(l.readFile&&l.readPackage){var b=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick((function(){i(b)}))}var x=l.packageIterator;var F=l.extensions||[".js"];var S=l.includeCoreModules!==false;var E=l.basedir||o.dirname(a());var N=l.filename||E;l.paths=l.paths||[];var A=o.resolve(E);d(k,A,l,(function(e,r){if(e)i(e);else init(r)}));var D;function init(r){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){D=o.resolve(r,e);if(e==="."||e===".."||e.slice(-1)==="/")D+="/";if(/\/$/.test(e)&&D===r){loadAsDirectory(D,l.package,onfile)}else loadAsFile(D,l.package,onfile)}else if(S&&u(e)){return i(null,e)}else loadNodeModules(e,r,(function(r,t,n){if(r)i(r);else if(t){return d(k,t,l,(function(e,r){if(e){i(e)}else{i(null,r,n)}}))}else{var o=new Error("Cannot find module '"+e+"' from '"+N+"'");o.code="MODULE_NOT_FOUND";i(o)}}))}function onfile(r,t,n){if(r)i(r);else if(t)i(null,t,n);else loadAsDirectory(D,(function(r,t,n){if(r)i(r);else if(t){d(k,t,l,(function(e,r){if(e){i(e)}else{i(null,r,n)}}))}else{var o=new Error("Cannot find module '"+e+"' from '"+N+"'");o.code="MODULE_NOT_FOUND";i(o)}}))}function loadAsFile(e,r,t){var n=r;var a=t;if(typeof n==="function"){a=n;n=undefined}var i=[""].concat(F);load(i,e,n);function load(e,r,t){if(e.length===0)return a(null,undefined,t);var n=r+e[0];var i=t;if(i)onpkg(null,i);else loadpkg(o.dirname(n),onpkg);function onpkg(t,s,u){i=s;if(t)return a(t);if(u&&i&&l.pathFilter){var c=o.relative(u,n);var f=c.slice(0,c.length-e[0].length);var p=l.pathFilter(i,r,f);if(p)return load([""].concat(F.slice()),o.resolve(u,p),i)}h(n,onex)}function onex(t,o){if(t)return a(t);if(o)return a(null,n,i);load(e.slice(1),r,i)}}}function loadpkg(e,r){if(e===""||e==="/")return r(null);if(process.platform==="win32"&&/^\w:[/\\]*$/.test(e)){return r(null)}if(/[/\\]node_modules[/\\]*$/.test(e))return r(null);d(k,e,l,(function(t,n){if(t)return loadpkg(o.dirname(e),r);var a=o.join(n,"package.json");h(a,(function(t,n){if(!n)return loadpkg(o.dirname(e),r);w(g,a,(function(t,n){if(t)r(t);var o=n;if(o&&l.packageFilter){o=l.packageFilter(o,a)}r(null,o,e)}))}))}))}function loadAsDirectory(e,r,t){var n=t;var a=r;if(typeof a==="function"){n=a;a=l.package}d(k,e,l,(function(r,t){if(r)return n(r);var i=o.join(t,"package.json");h(i,(function(r,t){if(r)return n(r);if(!t)return loadAsFile(o.join(e,"index"),a,n);w(g,i,(function(r,t){if(r)return n(r);var a=t;if(a&&l.packageFilter){a=l.packageFilter(a,i)}if(a&&a.main){if(typeof a.main!=="string"){var s=new TypeError("package “"+a.name+"” `main` must be a string");s.code="INVALID_PACKAGE_MAIN";return n(s)}if(a.main==="."||a.main==="./"){a.main="index"}loadAsFile(o.resolve(e,a.main),a,(function(r,t,a){if(r)return n(r);if(t)return n(null,t,a);if(!a)return loadAsFile(o.join(e,"index"),a,n);var i=o.resolve(e,a.main);loadAsDirectory(i,a,(function(r,t,a){if(r)return n(r);if(t)return n(null,t,a);loadAsFile(o.join(e,"index"),a,n)}))}));return}loadAsFile(o.join(e,"/index"),a,n)}))}))}))}function processDirs(e,r){if(r.length===0)return e(null,undefined);var t=r[0];y(o.dirname(t),isdir);function isdir(n,o){if(n)return e(n);if(!o)return processDirs(e,r.slice(1));loadAsFile(t,l.package,onfile)}function onfile(r,n,o){if(r)return e(r);if(n)return e(null,n,o);loadAsDirectory(t,l.package,ondir)}function ondir(t,n,o){if(t)return e(t);if(n)return e(null,n,o);processDirs(e,r.slice(1))}}function loadNodeModules(e,r,t){var thunk=function(){return _(e,r,l)};processDirs(t,x?x(e,r,thunk,l):thunk())}}},735:function(e){e.exports=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,r){return r};var r=(new Error).stack;Error.prepareStackTrace=e;return r[2].getFileName()}},921:function(e,r,t){var n=process.versions&&process.versions.node&&process.versions.node.split(".")||[];function specifierIncluded(e){var r=e.split(" ");var t=r.length>1?r[0]:"=";var o=(r.length>1?r[1]:r[0]).split(".");for(var a=0;a<3;++a){var i=parseInt(n[a]||0,10);var s=parseInt(o[a]||0,10);if(i===s){continue}if(t==="<"){return i<s}else if(t===">="){return i>=s}else{return false}}return t===">="}function matchesRange(e){var r=e.split(/ ?&& ?/);if(r.length===0){return false}for(var t=0;t<r.length;++t){if(!specifierIncluded(r[t])){return false}}return true}function versionIncluded(e){if(typeof e==="boolean"){return e}if(e&&typeof e==="object"){for(var r=0;r<e.length;++r){if(matchesRange(e[r])){return true}}return false}return matchesRange(e)}var o=t(680);var a={};for(var i in o){if(Object.prototype.hasOwnProperty.call(o,i)){a[i]=versionIncluded(o[i])}}e.exports=a},969:function(e,r,t){var n=t(137);e.exports=function isCore(e){return n(e)}},850:function(e,r,t){var n=t(622);var o=n.parse||t(85);var a=function getNodeModulesDirs(e,r){var t="/";if(/^([A-Za-z]:)/.test(e)){t=""}else if(/^\\\\/.test(e)){t="\\\\"}var a=[e];var i=o(e);while(i.dir!==a[a.length-1]){a.push(i.dir);i=o(i.dir)}return a.reduce((function(e,o){return e.concat(r.map((function(e){return n.resolve(t,o,e)})))}),[])};e.exports=function nodeModulesPaths(e,r,t){var n=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths==="function"){return r.paths(t,e,(function(){return a(e,n)}),r)}var o=a(e,n);return r&&r.paths?o.concat(r.paths):o}},807:function(e){e.exports=function(e,r){return r||{}}},26:function(e,r,t){var n=t(137);var o=t(747);var a=t(622);var i=t(735);var s=t(850);var u=t(807);var l=o.realpathSync&&typeof o.realpathSync.native==="function"?o.realpathSync.native:o.realpathSync;var c=function isFile(e){try{var r=o.statSync(e)}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR"))return false;throw e}return r.isFile()||r.isFIFO()};var f=function isDirectory(e){try{var r=o.statSync(e)}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR"))return false;throw e}return r.isDirectory()};var p=function realpathSync(e){try{return l(e)}catch(e){if(e.code!=="ENOENT"){throw e}}return e};var d=function maybeRealpathSync(e,r,t){if(t&&t.preserveSymlinks===false){return e(r)}return r};var v=function defaultReadPackageSync(e,r){var t=e(r);try{var n=JSON.parse(t);return n}catch(e){}};var _=function getPackageCandidates(e,r,t){var n=s(r,t,e);for(var o=0;o<n.length;o++){n[o]=a.join(n[o],e)}return n};e.exports=function resolveSync(e,r){if(typeof e!=="string"){throw new TypeError("Path must be a string.")}var t=u(e,r);var s=t.isFile||c;var l=t.readFileSync||o.readFileSync;var m=t.isDirectory||f;var h=t.realpathSync||p;var y=t.readPackageSync||v;if(t.readFileSync&&t.readPackageSync){throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.")}var g=t.packageIterator;var k=t.extensions||[".js"];var w=t.includeCoreModules!==false;var b=t.basedir||a.dirname(i());var x=t.filename||b;t.paths=t.paths||[];var F=d(h,a.resolve(b),t);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var S=a.resolve(F,e);if(e==="."||e===".."||e.slice(-1)==="/")S+="/";var E=loadAsFileSync(S)||loadAsDirectorySync(S);if(E)return d(h,E,t)}else if(w&&n(e)){return e}else{var N=loadNodeModulesSync(e,F);if(N)return d(h,N,t)}var A=new Error("Cannot find module '"+e+"' from '"+x+"'");A.code="MODULE_NOT_FOUND";throw A;function loadAsFileSync(e){var r=loadpkg(a.dirname(e));if(r&&r.dir&&r.pkg&&t.pathFilter){var n=a.relative(r.dir,e);var o=t.pathFilter(r.pkg,e,n);if(o){e=a.resolve(r.dir,o)}}if(s(e)){return e}for(var i=0;i<k.length;i++){var u=e+k[i];if(s(u)){return u}}}function loadpkg(e){if(e===""||e==="/")return;if(process.platform==="win32"&&/^\w:[/\\]*$/.test(e)){return}if(/[/\\]node_modules[/\\]*$/.test(e))return;var r=a.join(d(h,e,t),"package.json");if(!s(r)){return loadpkg(a.dirname(e))}var n=y(l,r);if(n&&t.packageFilter){n=t.packageFilter(n,e)}return{pkg:n,dir:e}}function loadAsDirectorySync(e){var r=a.join(d(h,e,t),"/package.json");if(s(r)){try{var n=y(l,r)}catch(e){}if(n&&t.packageFilter){n=t.packageFilter(n,e)}if(n&&n.main){if(typeof n.main!=="string"){var o=new TypeError("package “"+n.name+"” `main` must be a string");o.code="INVALID_PACKAGE_MAIN";throw o}if(n.main==="."||n.main==="./"){n.main="index"}try{var i=loadAsFileSync(a.resolve(e,n.main));if(i)return i;var u=loadAsDirectorySync(a.resolve(e,n.main));if(u)return u}catch(e){}}}return loadAsFileSync(a.join(e,"/index"))}function loadNodeModulesSync(e,r){var thunk=function(){return _(e,r,t)};var n=g?g(e,r,thunk,t):thunk();for(var o=0;o<n.length;o++){var i=n[o];if(m(a.dirname(i))){var s=loadAsFileSync(i);if(s)return s;var u=loadAsDirectorySync(i);if(u)return u}}}}},290:function(e){"use strict";e.exports=JSON.parse('{"assert":true,"node:assert":">= 16","assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":">= 16","buffer_ieee754":"< 0.9.7","buffer":true,"node:buffer":">= 16","child_process":true,"node:child_process":">= 16","cluster":true,"node:cluster":">= 16","console":true,"node:console":">= 16","constants":true,"node:constants":">= 16","crypto":true,"node:crypto":">= 16","_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":">= 16","diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":">= 16","dns":true,"node:dns":">= 16","dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":">= 16","events":true,"node:events":">= 16","freelist":"< 6","fs":true,"node:fs":">= 16","fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":">= 16","_http_agent":">= 0.11.1","node:_http_agent":">= 16","_http_client":">= 0.11.1","node:_http_client":">= 16","_http_common":">= 0.11.1","node:_http_common":">= 16","_http_incoming":">= 0.11.1","node:_http_incoming":">= 16","_http_outgoing":">= 0.11.1","node:_http_outgoing":">= 16","_http_server":">= 0.11.1","node:_http_server":">= 16","http":true,"node:http":">= 16","http2":">= 8.8","node:http2":">= 16","https":true,"node:https":">= 16","inspector":">= 8","node:inspector":">= 16","_linklist":"< 8","module":true,"node:module":">= 16","net":true,"node:net":">= 16","node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":">= 16","path":true,"node:path":">= 16","path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":">= 16","process":">= 1","node:process":">= 16","punycode":true,"node:punycode":">= 16","querystring":true,"node:querystring":">= 16","readline":true,"node:readline":">= 16","repl":true,"node:repl":">= 16","smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","node:_stream_duplex":">= 16","_stream_transform":">= 0.9.4","node:_stream_transform":">= 16","_stream_wrap":">= 1.4.1","node:_stream_wrap":">= 16","_stream_passthrough":">= 0.9.4","node:_stream_passthrough":">= 16","_stream_readable":">= 0.9.4","node:_stream_readable":">= 16","_stream_writable":">= 0.9.4","node:_stream_writable":">= 16","stream":true,"node:stream":">= 16","stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":">= 16","sys":[">= 0.6 && < 0.7",">= 0.8"],"node:sys":">= 16","timers":true,"node:timers":">= 16","timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":">= 16","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":">= 16","tls":true,"node:tls":">= 16","trace_events":">= 10","node:trace_events":">= 16","tty":true,"node:tty":">= 16","url":true,"node:url":">= 16","util":true,"node:util":">= 16","util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":">= 16","vm":true,"node:vm":">= 16","wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","node:worker_threads":">= 16","zlib":true,"node:zlib":">= 16"}')},680:function(e){"use strict";e.exports=JSON.parse('{"assert":true,"assert/strict":">= 15","async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"diagnostics_channel":">= 15.1","dns":true,"dns/promises":">= 15","domain":">= 0.7.12","events":true,"freelist":"< 6","fs":true,"fs/promises":[">= 10 && < 10.1",">= 14"],"_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6.0 && < 12","os":true,"path":true,"path/posix":">= 15.3","path/win32":">= 15.3","perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"stream/promises":">= 15","string_decoder":true,"sys":[">= 0.6 && < 0.7",">= 0.8"],"timers":true,"timers/promises":">= 15","_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"util/types":">= 15.3","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8":">= 1","vm":true,"wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","zlib":true}')},747:function(e){"use strict";e.exports=require("fs")},622:function(e){"use strict";e.exports=require("path")}};var r={};function __nccwpck_require__(t){var n=r[t];if(n!==undefined){return n.exports}var o=r[t]={exports:{}};var a=true;try{e[t](o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete r[t]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var t=__nccwpck_require__(259);module.exports=t})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"resolve","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT"}
|