@stacksjs/cli 0.63.0 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,832 +1,20 @@
1
1
  // @bun
2
- // src/actions/install.ts
3
- import {installPackage as installPkg} from "@antfu/install-pkg";
4
- async function installPackage(name, options) {
5
- if (options)
6
- return await installPkg(name, options);
7
- return await installPkg(name, { silent: true });
8
- }
9
- async function installStack(name, options) {
10
- if (options)
11
- return await installPkg(`@stacksjs/${name}`, options);
12
- return await installPkg(`@stacksjs/${name}`, { silent: true });
13
- }
14
- // src/cli.ts
15
- import {CAC} from "cac";
16
- function cli(name, options) {
17
- if (typeof name === "object") {
18
- options = name;
19
- name = options.name;
20
- }
21
- return new CAC(name || "buddy");
22
- }
23
- // src/run.ts
24
- import {ExitCode as ExitCode2} from "@stacksjs/types";
25
-
26
- // src/console.ts
27
- import {log, logger} from "@stacksjs/logging";
28
- import prompts from "prompts";
29
-
30
- class Prompt {
31
- required;
32
- constructor() {
33
- this.required = false;
34
- }
35
- require() {
36
- this.required = true;
37
- return this;
38
- }
39
- isRequired() {
40
- return this.required;
41
- }
42
- async select(message, options) {
43
- if (this.isRequired())
44
- return logger.prompt(message, {
45
- ...options,
46
- type: "select",
47
- required: true
48
- });
49
- return logger.prompt(message, { ...options, type: "select" });
50
- }
51
- async checkbox(message, options) {
52
- if (this.isRequired())
53
- return logger.prompt(message, {
54
- ...options,
55
- type: "multiselect",
56
- required: true
57
- });
58
- return logger.prompt(message, { ...options, type: "multiselect" });
59
- }
60
- async confirm(message, options) {
61
- if (this.isRequired())
62
- return logger.prompt(message, {
63
- ...options,
64
- type: "confirm",
65
- required: true
66
- });
67
- return logger.prompt(message, { ...options, type: "confirm" });
68
- }
69
- async input(message, options) {
70
- if (this.isRequired())
71
- return logger.prompt(message, {
72
- ...options,
73
- type: "text",
74
- required: true
75
- });
76
- return logger.prompt(message, { ...options, type: "text" });
77
- }
78
- async password(message, options) {
79
- if (this.isRequired())
80
- return logger.prompt(message, {
81
- ...options,
82
- type: "password",
83
- required: true
84
- });
85
- return logger.prompt(message, { ...options, type: "password" });
86
- }
87
- async number(message, options) {
88
- if (this.isRequired())
89
- return logger.prompt(message, {
90
- ...options,
91
- type: "numeral",
92
- required: true
93
- });
94
- return logger.prompt(message, { ...options, type: "numeral" });
95
- }
96
- async multiselect(message, options) {
97
- if (this.isRequired())
98
- return logger.prompt(message, {
99
- ...options,
100
- type: "multiselect",
101
- required: true
102
- });
103
- return logger.prompt(message, { ...options, type: "multiselect" });
104
- }
105
- async autocomplete(message, options) {
106
- if (this.isRequired())
107
- return logger.prompt(message, {
108
- ...options,
109
- type: "autocomplete",
110
- required: true
111
- });
112
- return logger.prompt(message, { ...options, type: "autocomplete" });
113
- }
114
- }
115
- var prompt = () => new Prompt;
116
-
117
- // src/exec.ts
118
- import process2 from "process";
119
- import {err, handleError, ok} from "@stacksjs/error-handling";
120
- import {ExitCode} from "@stacksjs/types";
121
- async function exec(command, options) {
122
- const cmd = Array.isArray(command) ? command : command.match(/(?:[^\s"]+|"[^"]*")+/g);
123
- if (!cmd)
124
- return err(handleError(`Failed to parse command: ${cmd}`, options));
125
- log.debug("exec:", Array.isArray(command) ? command.join(" ") : command);
126
- log.debug("cmd:", cmd);
127
- log.debug("exec options:", options);
128
- const cwd = options?.cwd || process2.cwd();
129
- const proc = Bun.spawn(cmd, {
130
- ...options,
131
- stdout: options?.silent || options?.quiet ? "ignore" : options?.stdin ? options.stdin : options?.stdout || "inherit",
132
- stderr: options?.silent || options?.quiet ? "ignore" : options?.stderr || "inherit",
133
- detached: options?.background || false,
134
- cwd,
135
- onExit(subprocess, exitCode, signalCode, error) {
136
- exitHandler("spawn", subprocess, exitCode, signalCode, error);
137
- }
138
- });
139
- if (options?.stdin === "pipe" && options.input) {
140
- if (proc.stdin) {
141
- proc.stdin.write(options.input);
142
- proc.stdin.end();
143
- }
144
- }
145
- const exited = await proc.exited;
146
- if (exited === ExitCode.Success)
147
- return ok(proc);
148
- return err(handleError(`Failed to execute command: ${cmd.join(" ")}`));
149
- }
150
- async function execSync(command, options) {
151
- log.debug("Running ExecSync:", command);
152
- log.debug("ExecSync Options:", options);
153
- const cmd = Array.isArray(command) ? command : command.match(/(?:[^\s"]+|"[^"]*")+/g);
154
- if (!cmd) {
155
- log.error(`Failed to parse command: ${cmd}`, options);
156
- process2.exit(ExitCode.FatalError);
157
- }
158
- const proc = Bun.spawnSync(cmd, {
159
- ...options,
160
- stdin: options?.stdin ?? "inherit",
161
- stdout: options?.stdout ?? "pipe",
162
- stderr: options?.stderr ?? "inherit",
163
- cwd: options?.cwd ?? process2.cwd(),
164
- onExit(subprocess, exitCode, signalCode, error) {
165
- exitHandler("spawnSync", subprocess, exitCode, signalCode, error);
166
- }
167
- });
168
- return proc.stdout.toString();
169
- }
170
- function exitHandler(type, subprocess, exitCode, signalCode, error) {
171
- log.debug(`exitHandler: ${type}`);
172
- log.debug("subprocess", subprocess);
173
- log.debug("exitCode", exitCode);
174
- log.debug("signalCode", signalCode);
175
- if (error) {
176
- log.error(error);
177
- process2.exit(ExitCode.FatalError);
178
- }
179
- if (exitCode !== ExitCode.Success && exitCode)
180
- process2.exit(exitCode);
181
- }
182
-
183
- // src/utils.ts
184
- import {collect} from "@stacksjs/collections";
185
- import * as kolorist from "kolorist";
186
-
187
- // ../../../../node_modules/consola/dist/utils.mjs
188
- import * as tty from "tty";
189
- function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
190
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
191
- }
192
- function clearBleed(index, string, open, close, replace) {
193
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
194
- }
195
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
196
- return (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
197
- }
198
- function init(open, close, replace) {
199
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
200
- }
201
- function createColors(useColor = isColorSupported) {
202
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
203
- }
204
- function getColor(color, fallback = "reset") {
205
- return colors[color] || colors[fallback];
206
- }
207
- function colorize(color, text) {
208
- return getColor(color)(text);
209
- }
210
- function stripAnsi(text) {
211
- return text.replace(new RegExp(ansiRegex, "g"), "");
212
- }
213
- function centerAlign(str, len, space = " ") {
214
- const free = len - str.length;
215
- if (free <= 0) {
216
- return str;
217
- }
218
- const freeLeft = Math.floor(free / 2);
219
- let _str = "";
220
- for (let i = 0;i < len; i++) {
221
- _str += i < freeLeft || i >= freeLeft + str.length ? space : str[i - freeLeft];
222
- }
223
- return _str;
224
- }
225
- function rightAlign(str, len, space = " ") {
226
- const free = len - str.length;
227
- if (free <= 0) {
228
- return str;
229
- }
230
- let _str = "";
231
- for (let i = 0;i < len; i++) {
232
- _str += i < free ? space : str[i - free];
233
- }
234
- return _str;
235
- }
236
- function leftAlign(str, len, space = " ") {
237
- let _str = "";
238
- for (let i = 0;i < len; i++) {
239
- _str += i < str.length ? str[i] : space;
240
- }
241
- return _str;
242
- }
243
- function align(alignment, str, len, space = " ") {
244
- switch (alignment) {
245
- case "left": {
246
- return leftAlign(str, len, space);
247
- }
248
- case "right": {
249
- return rightAlign(str, len, space);
250
- }
251
- case "center": {
252
- return centerAlign(str, len, space);
253
- }
254
- default: {
255
- return str;
256
- }
257
- }
258
- }
259
- function box(text, _opts = {}) {
260
- const opts = {
261
- ..._opts,
262
- style: {
263
- ...defaultStyle,
264
- ..._opts.style
265
- }
266
- };
267
- const textLines = text.split("\n");
268
- const boxLines = [];
269
- const _color = getColor(opts.style.borderColor);
270
- const borderStyle = {
271
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
272
- };
273
- if (_color) {
274
- for (const key in borderStyle) {
275
- borderStyle[key] = _color(borderStyle[key]);
276
- }
277
- }
278
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
279
- const height = textLines.length + paddingOffset;
280
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
281
- const widthOffset = width + paddingOffset;
282
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
283
- if (opts.style.marginTop > 0) {
284
- boxLines.push("".repeat(opts.style.marginTop));
285
- }
286
- if (opts.title) {
287
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
288
- const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
289
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
290
- } else {
291
- boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
292
- }
293
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
294
- for (let i = 0;i < height; i++) {
295
- if (i < valignOffset || i >= valignOffset + textLines.length) {
296
- boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
297
- } else {
298
- const line = textLines[i - valignOffset];
299
- const left = " ".repeat(paddingOffset);
300
- const right = " ".repeat(width - stripAnsi(line).length);
301
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
302
- }
303
- }
304
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
305
- if (opts.style.marginBottom > 0) {
306
- boxLines.push("".repeat(opts.style.marginBottom));
307
- }
308
- return boxLines.join("\n");
309
- }
310
- var {
311
- env = {},
312
- argv = [],
313
- platform = ""
314
- } = typeof process === "undefined" ? {} : process;
315
- var isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
316
- var isForced = "FORCE_COLOR" in env || argv.includes("--color");
317
- var isWindows = platform === "win32";
318
- var isDumbTerminal = env.TERM === "dumb";
319
- var isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
320
- var isCI = "CI" in env && (("GITHUB_ACTIONS" in env) || ("GITLAB_CI" in env) || ("CIRCLECI" in env));
321
- var isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
322
- var colorDefs = {
323
- reset: init(0, 0),
324
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
325
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
326
- italic: init(3, 23),
327
- underline: init(4, 24),
328
- inverse: init(7, 27),
329
- hidden: init(8, 28),
330
- strikethrough: init(9, 29),
331
- black: init(30, 39),
332
- red: init(31, 39),
333
- green: init(32, 39),
334
- yellow: init(33, 39),
335
- blue: init(34, 39),
336
- magenta: init(35, 39),
337
- cyan: init(36, 39),
338
- white: init(37, 39),
339
- gray: init(90, 39),
340
- bgBlack: init(40, 49),
341
- bgRed: init(41, 49),
342
- bgGreen: init(42, 49),
343
- bgYellow: init(43, 49),
344
- bgBlue: init(44, 49),
345
- bgMagenta: init(45, 49),
346
- bgCyan: init(46, 49),
347
- bgWhite: init(47, 49),
348
- blackBright: init(90, 39),
349
- redBright: init(91, 39),
350
- greenBright: init(92, 39),
351
- yellowBright: init(93, 39),
352
- blueBright: init(94, 39),
353
- magentaBright: init(95, 39),
354
- cyanBright: init(96, 39),
355
- whiteBright: init(97, 39),
356
- bgBlackBright: init(100, 49),
357
- bgRedBright: init(101, 49),
358
- bgGreenBright: init(102, 49),
359
- bgYellowBright: init(103, 49),
360
- bgBlueBright: init(104, 49),
361
- bgMagentaBright: init(105, 49),
362
- bgCyanBright: init(106, 49),
363
- bgWhiteBright: init(107, 49)
364
- };
365
- var colors = createColors();
366
- var ansiRegex = [
367
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
368
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
369
- ].join("|");
370
- var boxStylePresets = {
371
- solid: {
372
- tl: "\u250C",
373
- tr: "\u2510",
374
- bl: "\u2514",
375
- br: "\u2518",
376
- h: "\u2500",
377
- v: "\u2502"
378
- },
379
- double: {
380
- tl: "\u2554",
381
- tr: "\u2557",
382
- bl: "\u255A",
383
- br: "\u255D",
384
- h: "\u2550",
385
- v: "\u2551"
386
- },
387
- doubleSingle: {
388
- tl: "\u2553",
389
- tr: "\u2556",
390
- bl: "\u2559",
391
- br: "\u255C",
392
- h: "\u2500",
393
- v: "\u2551"
394
- },
395
- doubleSingleRounded: {
396
- tl: "\u256D",
397
- tr: "\u256E",
398
- bl: "\u2570",
399
- br: "\u256F",
400
- h: "\u2500",
401
- v: "\u2551"
402
- },
403
- singleThick: {
404
- tl: "\u250F",
405
- tr: "\u2513",
406
- bl: "\u2517",
407
- br: "\u251B",
408
- h: "\u2501",
409
- v: "\u2503"
410
- },
411
- singleDouble: {
412
- tl: "\u2552",
413
- tr: "\u2555",
414
- bl: "\u2558",
415
- br: "\u255B",
416
- h: "\u2550",
417
- v: "\u2502"
418
- },
419
- singleDoubleRounded: {
420
- tl: "\u256D",
421
- tr: "\u256E",
422
- bl: "\u2570",
423
- br: "\u256F",
424
- h: "\u2550",
425
- v: "\u2502"
426
- },
427
- rounded: {
428
- tl: "\u256D",
429
- tr: "\u256E",
430
- bl: "\u2570",
431
- br: "\u256F",
432
- h: "\u2500",
433
- v: "\u2502"
434
- }
435
- };
436
- var defaultStyle = {
437
- borderColor: "white",
438
- borderStyle: "rounded",
439
- valign: "center",
440
- padding: 2,
441
- marginLeft: 1,
442
- marginTop: 1,
443
- marginBottom: 1
444
- };
445
-
446
- // src/utils.ts
447
- import {
448
- ansi256Bg,
449
- bgBlack,
450
- bgBlue,
451
- bgCyan,
452
- bgGray,
453
- bgGreen,
454
- bgLightBlue,
455
- bgLightCyan,
456
- bgLightGray,
457
- bgLightGreen,
458
- bgLightMagenta,
459
- bgLightRed,
460
- bgLightYellow,
461
- bgMagenta,
462
- bgRed,
463
- bgWhite,
464
- bgYellow,
465
- black,
466
- blue,
467
- bold,
468
- cyan,
469
- dim,
470
- gray,
471
- green,
472
- hidden,
473
- inverse,
474
- italic,
475
- lightBlue,
476
- lightCyan,
477
- lightGray,
478
- lightGreen,
479
- lightMagenta,
480
- lightRed,
481
- lightYellow,
482
- link,
483
- magenta,
484
- red,
485
- reset,
486
- strikethrough,
487
- underline,
488
- white,
489
- yellow,
490
- ansi256,
491
- trueColor,
492
- trueColorBg,
493
- stripColors
494
- } from "kolorist";
495
- var quotes = collect([
496
- "The best way to get started is to quit talking and begin doing.",
497
- "The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.",
498
- "Don\u2019t let yesterday take up too much of today.",
499
- "You learn more from failure than from success. Don\u2019t let it stop you. Failure builds character.",
500
- "It\u2019s not whether you get knocked down, it\u2019s whether you get up.",
501
- "If you are working on something that you really care about, you don\u2019t have to be pushed. The vision pulls you.",
502
- "People who are crazy enough to think they can change the world, are the ones who do.",
503
- "Failure will never overtake me if my determination to succeed is strong enough.",
504
- "Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That\u2019s the classic entrepreneur.",
505
- "We may encounter many defeats but we must not be defeated.",
506
- "Knowing is not enough; we must apply. Wishing is not enough; we must do.",
507
- "Imagine your life is perfect in every respect; what would it look like?",
508
- "We generate fears while we sit. We overcome them by action.",
509
- "Whether you think you can or think you can\u2019t, you\u2019re right.",
510
- "Security is mostly a superstition. Life is either a daring adventure or nothing."
511
- ]);
512
-
513
- // src/run.ts
514
- async function runCommand(command, options) {
515
- log.debug("runCommand:", command);
516
- log.debug("options:", options);
517
- return await exec(command, options);
518
- }
519
- async function runProcess(command, options) {
520
- log.debug("runProcess:", italic(command));
521
- log.debug("runProcess Options:", options);
522
- return await exec(command, options);
523
- }
524
- async function runCommandSync(command, options) {
525
- log.debug("runCommandSync:", italic(command));
526
- log.debug("runCommandSync Options:", options);
527
- const result = await execSync(command, options);
528
- return result;
529
- }
530
- async function runCommands(commands, options) {
531
- const results = [];
532
- for (const command of commands) {
533
- const result = await runCommand(command, options);
534
- if (result.isErr()) {
535
- log.error(result.error);
536
- process.exit(ExitCode2.FatalError);
537
- }
538
- results.push(result);
539
- }
540
- return results;
541
- }
542
-
543
- // src/command.ts
544
- class Command {
545
- name;
546
- description;
547
- options;
548
- run;
549
- onFail;
550
- onSuccess;
551
- constructor({ name, description, options, run: run2, onFail, onSuccess }) {
552
- this.name = name;
553
- this.description = description;
554
- this.options = options;
555
- this.run = run2;
556
- this.onFail = onFail;
557
- this.onSuccess = onSuccess;
558
- }
559
- }
560
- var command = {
561
- run: async (command2, options) => {
562
- return await runCommand(command2, options);
563
- },
564
- runSync: async (command2, options) => {
565
- return await runCommand(command2, options);
566
- }
567
- };
568
- // src/helpers.ts
569
- import {handleError as handleError2} from "@stacksjs/error-handling";
570
- import {log as log2} from "@stacksjs/logging";
571
- import {ExitCode as ExitCode3} from "@stacksjs/types";
572
- import {bgCyan as bgCyan2, bold as bold2, cyan as cyan2, dim as dim2, gray as gray2, green as green2, italic as italic2} from "kolorist";
573
- // package.json
574
- var version = "0.63.0";
575
-
576
- // src/helpers.ts
577
- async function intro(command2, options) {
578
- return new Promise((resolve) => {
579
- if (options?.quiet === false) {
580
- console.log();
581
- console.log(cyan2(bold2("Stacks CLI")) + dim2(` v${version}`));
582
- console.log();
583
- }
584
- log2.info(`Running ${bgCyan2(italic2(bold2(` ${command2} `)))}`);
585
- if (options?.showPerformance === false || options?.quiet)
586
- return resolve(0);
587
- return resolve(performance.now());
588
- });
589
- }
590
- function outro(text, options, error) {
591
- const opts = {
592
- type: "success",
593
- useSeconds: true,
594
- ...options
595
- };
596
- opts.message = options?.message || text;
597
- return new Promise((resolve) => {
598
- if (error)
599
- return handleError2(error);
600
- if (opts?.startTime) {
601
- let time = performance.now() - opts.startTime;
602
- if (opts.useSeconds) {
603
- time = time / 1000;
604
- time = Math.round(time * 100) / 100;
605
- }
606
- if (opts.quiet === true)
607
- return resolve(ExitCode3.Success);
608
- if (error)
609
- log2.error(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}] Failed`);
610
- else if (opts.type === "info")
611
- log2.info(`${dim2(gray2(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}]`))} ${opts.message ?? "Complete"}`);
612
- else
613
- log2.success(`${dim2(gray2(bold2(`[${time.toFixed(2)}${opts.useSeconds ? "s" : "ms"}]`)))} ${bold2(green2(opts.message ?? "Complete"))}`);
614
- } else {
615
- if (opts?.type === "info")
616
- log2.info(text);
617
- else if (opts?.type === "success" && opts?.quiet !== true)
618
- log2.success(text);
619
- }
620
- return resolve(ExitCode3.Success);
621
- });
622
- }
623
- // src/parse.ts
624
- import process3 from "process";
625
- import {log as log3} from "@stacksjs/logging";
626
- function isLongOption(arg) {
627
- if (!arg)
628
- return false;
629
- return arg.startsWith("--");
630
- }
631
- function isShortOption(arg) {
632
- return arg.startsWith("-") && !isLongOption(arg);
633
- }
634
- function parseValue(value) {
635
- if (value === "true")
636
- return true;
637
- if (value === "false")
638
- return false;
639
- const numberValue = Number.parseFloat(value);
640
- if (!Number.isNaN(numberValue))
641
- return numberValue;
642
- return value.replace(/"/g, "");
643
- }
644
- function parseLongOption(arg, argv2, index, options) {
645
- const [key, value] = arg.slice(2).split("=");
646
- if (value !== undefined) {
647
- options[key] = parseValue(value);
648
- } else if (index + 1 < argv2.length && !argv2[index + 1]?.startsWith("-")) {
649
- options[key] = argv2[index + 1];
650
- index++;
651
- } else {
652
- options[key] = true;
653
- }
654
- return index;
655
- }
656
- function parseShortOption(arg, argv2, index, options) {
657
- const [key, value] = arg.slice(1).split("=");
658
- if (key === undefined)
659
- return index;
660
- if (value !== undefined && key !== undefined) {
661
- for (let j = 0;j < key.length; j++)
662
- options[key[j]] = parseValue(value);
663
- } else {
664
- for (let j = 0;j < key.length; j++) {
665
- if (index + 1 < argv2.length && j === key.length - 1 && !argv2[index + 1]?.startsWith("-")) {
666
- options[key[j]] = parseValue(argv2[index + 1]);
667
- index++;
668
- } else {
669
- options[key[j]] = true;
670
- }
671
- }
672
- }
673
- return index;
674
- }
675
- function parseArgv(argv2) {
676
- if (argv2 === undefined)
677
- argv2 = process3.argv.slice(2);
678
- const args = [];
679
- const options = {};
680
- for (let i = 0;i < argv2.length; i++) {
681
- const arg = argv2[i];
682
- if (!arg)
683
- continue;
684
- if (isLongOption(arg))
685
- i = parseLongOption(arg, argv2, i, options);
686
- else if (isShortOption(arg))
687
- i = parseShortOption(arg, argv2, i, options);
688
- else
689
- args.push(arg);
690
- }
691
- return { args, options };
692
- }
693
- function parseArgs(argv2) {
694
- if (argv2 === undefined)
695
- argv2 = process3.argv.slice(2);
696
- return parseArgv(argv2).args;
697
- }
698
- function parseOptions(options) {
699
- options = options || {};
700
- const args = process3.argv.slice(2);
701
- for (let i = 0;i < args.length; i++) {
702
- const arg = args[i];
703
- if (arg?.startsWith("--")) {
704
- const key = arg.substring(2);
705
- const camelCaseKey = key.replace(/-([a-z])/gi, (g) => g[1] ? g[1].toUpperCase() : "");
706
- if (i + 1 < args.length) {
707
- if (args[i + 1] === "true" || args[i + 1] === "false") {
708
- options[camelCaseKey] = args[i + 1] === "true";
709
- i++;
710
- } else {
711
- options[camelCaseKey] = args[i + 1];
712
- i++;
713
- }
714
- } else {
715
- options[camelCaseKey] = true;
716
- }
717
- }
718
- }
719
- if (Object.keys(options).length === 0)
720
- return { dryRun: false, quiet: false, verbose: false };
721
- Object.keys(options).forEach((key) => {
722
- if (!options)
723
- return { dryRun: false, quiet: false, verbose: false };
724
- const value = options[key];
725
- if (value === "true" || value === "false")
726
- options[key] = value === "true";
727
- });
728
- return options;
729
- }
730
- function buddyOptions(options) {
731
- if (!options) {
732
- options = process3.argv.slice(2);
733
- options = Array.from(new Set(options));
734
- if (options[0] && !options[0].startsWith("-"))
735
- options.shift();
736
- }
737
- if (options?.verbose) {
738
- log3.debug("process.argv", process3.argv);
739
- log3.debug("process.argv.slice(2)", process3.argv.slice(2));
740
- log3.debug("options inside buddyOptions", options);
741
- }
742
- return options.join(" ");
743
- }
744
- // src/spinner.ts
745
- import ora from "ora";
746
- var spinner = ora;
747
- export {
748
- yellow,
749
- white,
750
- underline,
751
- trueColorBg,
752
- trueColor,
753
- stripColors,
754
- stripAnsi,
755
- strikethrough,
756
- spinner,
757
- runProcess,
758
- runCommands,
759
- runCommandSync,
760
- runCommand,
761
- rightAlign,
762
- reset,
763
- red,
764
- quotes,
765
- prompts,
766
- prompt,
767
- parseOptions,
768
- parseArgv,
769
- parseArgs,
770
- outro,
771
- magenta,
772
- logger,
773
- log,
774
- link,
775
- lightYellow,
776
- lightRed,
777
- lightMagenta,
778
- lightGreen,
779
- lightGray,
780
- lightCyan,
781
- lightBlue,
782
- leftAlign,
783
- kolorist,
784
- italic,
785
- inverse,
786
- intro,
787
- installStack,
788
- installPackage,
789
- hidden,
790
- green,
791
- gray,
792
- getColor,
793
- execSync,
794
- exec,
795
- dim,
796
- cyan,
797
- command,
798
- colors,
799
- colorize,
800
- cli,
801
- centerAlign,
802
- buddyOptions,
803
- box,
804
- bold,
805
- blue,
806
- black,
807
- bgYellow,
808
- bgWhite,
809
- bgRed,
810
- bgMagenta,
811
- bgLightYellow,
812
- bgLightRed,
813
- bgLightMagenta,
814
- bgLightGreen,
815
- bgLightGray,
816
- bgLightCyan,
817
- bgLightBlue,
818
- bgGreen,
819
- bgGray,
820
- bgCyan,
821
- bgBlue,
822
- bgBlack,
823
- ansi256Bg,
824
- ansi256,
825
- align,
826
- Prompt,
827
- Command,
828
- CAC
829
- };
830
-
831
- //# debugId=1F7BAC6072E4FA6E64756E2164756E21
2
+ var fE=Object.create;var{getPrototypeOf:JE,defineProperty:lu,getOwnPropertyNames:KE}=Object;var QE=Object.prototype.hasOwnProperty;var iu=(D,u,F)=>{F=D!=null?fE(JE(D)):{};const C=u||!D||!D.__esModule?lu(F,"default",{value:D,enumerable:!0}):F;for(let E of KE(D))if(!QE.call(C,E))lu(C,E,{get:()=>D[E],enumerable:!0});return C};var O=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports);var XE=(D,u)=>{for(var F in u)lu(D,F,{get:u[F],enumerable:!0,configurable:!0,set:(C)=>u[F]=()=>C})};var W=O((b5,ZF)=>{function OF(D,u){let F=0,C,E="",B="";for(;F<D.length;F++)if(C=D[F],E+=C.open,B+=C.close,u.includes(C.close))u=u.replace(C.rgx,C.close+C.open);return E+u+B}function I6(D,u){let F={has:D,keys:u};return F.reset=K.reset.bind(F),F.bold=K.bold.bind(F),F.dim=K.dim.bind(F),F.italic=K.italic.bind(F),F.underline=K.underline.bind(F),F.inverse=K.inverse.bind(F),F.hidden=K.hidden.bind(F),F.strikethrough=K.strikethrough.bind(F),F.black=K.black.bind(F),F.red=K.red.bind(F),F.green=K.green.bind(F),F.yellow=K.yellow.bind(F),F.blue=K.blue.bind(F),F.magenta=K.magenta.bind(F),F.cyan=K.cyan.bind(F),F.white=K.white.bind(F),F.gray=K.gray.bind(F),F.grey=K.grey.bind(F),F.bgBlack=K.bgBlack.bind(F),F.bgRed=K.bgRed.bind(F),F.bgGreen=K.bgGreen.bind(F),F.bgYellow=K.bgYellow.bind(F),F.bgBlue=K.bgBlue.bind(F),F.bgMagenta=K.bgMagenta.bind(F),F.bgCyan=K.bgCyan.bind(F),F.bgWhite=K.bgWhite.bind(F),F}function Q(D,u){let F={open:`\x1B[${D}m`,close:`\x1B[${u}m`,rgx:new RegExp(`\\x1b\\[${u}m`,"g")};return function(C){if(this!==void 0&&this.has!==void 0)return this.has.includes(D)||(this.has.push(D),this.keys.push(F)),C===void 0?this:K.enabled?OF(this.keys,C+""):C+"";return C===void 0?I6([D],[F]):K.enabled?OF([F],C+""):C+""}}var{FORCE_COLOR:L6,NODE_DISABLE_COLORS:w6,TERM:q6}=process.env,K={enabled:!w6&&q6!=="dumb"&&L6!=="0",reset:Q(0,0),bold:Q(1,22),dim:Q(2,22),italic:Q(3,23),underline:Q(4,24),inverse:Q(7,27),hidden:Q(8,28),strikethrough:Q(9,29),black:Q(30,39),red:Q(31,39),green:Q(32,39),yellow:Q(33,39),blue:Q(34,39),magenta:Q(35,39),cyan:Q(36,39),white:Q(37,39),gray:Q(90,39),grey:Q(90,39),bgBlack:Q(40,49),bgRed:Q(41,49),bgGreen:Q(42,49),bgYellow:Q(43,49),bgBlue:Q(44,49),bgMagenta:Q(45,49),bgCyan:Q(46,49),bgWhite:Q(47,49)};ZF.exports=K});var fF=O((k5,zF)=>{zF.exports=(D,u)=>{if(D.meta&&D.name!=="escape")return;if(D.ctrl){if(D.name==="a")return"first";if(D.name==="c")return"abort";if(D.name==="d")return"abort";if(D.name==="e")return"last";if(D.name==="g")return"reset"}if(u){if(D.name==="j")return"down";if(D.name==="k")return"up"}if(D.name==="return")return"submit";if(D.name==="enter")return"submit";if(D.name==="backspace")return"delete";if(D.name==="delete")return"deleteForward";if(D.name==="abort")return"abort";if(D.name==="escape")return"exit";if(D.name==="tab")return"next";if(D.name==="pagedown")return"nextPage";if(D.name==="pageup")return"prevPage";if(D.name==="home")return"home";if(D.name==="end")return"end";if(D.name==="up")return"up";if(D.name==="down")return"down";if(D.name==="right")return"right";if(D.name==="left")return"left";return!1}});var _u=O((d5,JF)=>{JF.exports=(D)=>{const u=["[\\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("|"),F=new RegExp(u,"g");return typeof D==="string"?D.replace(F,""):D}});var N=O((x5,KF)=>{var R=`${"\x1B"}[`,eu={to(D,u){if(!u)return`${R}${D+1}G`;return`${R}${u+1};${D+1}H`},move(D,u){let F="";if(D<0)F+=`${R}${-D}D`;else if(D>0)F+=`${R}${D}C`;if(u<0)F+=`${R}${-u}A`;else if(u>0)F+=`${R}${u}B`;return F},up:(D=1)=>`${R}${D}A`,down:(D=1)=>`${R}${D}B`,forward:(D=1)=>`${R}${D}C`,backward:(D=1)=>`${R}${D}D`,nextLine:(D=1)=>`${R}E`.repeat(D),prevLine:(D=1)=>`${R}F`.repeat(D),left:`${R}G`,hide:`${R}?25l`,show:`${R}?25h`,save:`${"\x1B"}7`,restore:`${"\x1B"}8`},j6={up:(D=1)=>`${R}S`.repeat(D),down:(D=1)=>`${R}T`.repeat(D)},S6={screen:`${R}2J`,up:(D=1)=>`${R}1J`.repeat(D),down:(D=1)=>`${R}J`.repeat(D),line:`${R}2K`,lineEnd:`${R}K`,lineStart:`${R}1K`,lines(D){let u="";for(let F=0;F<D;F++)u+=this.line+(F<D-1?eu.up():"");if(D)u+=eu.left;return u}};KF.exports={cursor:eu,scroll:j6,erase:S6,beep:"\x07"}});var WF=O((v5,YF)=>{function P6(D,u){var F=typeof Symbol!=="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(!F){if(Array.isArray(D)||(F=T6(D))||u&&D&&typeof D.length==="number"){if(F)D=F;var C=0,E=function $(){};return{s:E,n:function $(){if(C>=D.length)return{done:!0};return{done:!1,value:D[C++]}},e:function $(_){throw _},f:E}}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 B=!0,A=!1,h;return{s:function $(){F=F.call(D)},n:function $(){var _=F.next();return B=_.done,_},e:function $(_){A=!0,h=_},f:function $(){try{if(!B&&F.return!=null)F.return()}finally{if(A)throw h}}}}function T6(D,u){if(!D)return;if(typeof D==="string")return QF(D,u);var F=Object.prototype.toString.call(D).slice(8,-1);if(F==="Object"&&D.constructor)F=D.constructor.name;if(F==="Map"||F==="Set")return Array.from(D);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return QF(D,u)}function QF(D,u){if(u==null||u>D.length)u=D.length;for(var F=0,C=new Array(u);F<u;F++)C[F]=D[F];return C}var b6=_u(),GF=N(),XF=GF.erase,k6=GF.cursor,d6=(D)=>[...b6(D)].length;YF.exports=function(D,u){if(!u)return XF.line+k6.to(0);let F=0;const C=D.split(/\r?\n/);var E=P6(C),B;try{for(E.s();!(B=E.n()).done;){let A=B.value;F+=1+Math.floor(Math.max(d6(A)-1,0)/u)}}catch(A){E.e(A)}finally{E.f()}return XF.lines(F)}});var D0=O((g5,RF)=>{var xD={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},x6={arrowUp:xD.arrowUp,arrowDown:xD.arrowDown,arrowLeft:xD.arrowLeft,arrowRight:xD.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},v6=process.platform==="win32"?x6:xD;RF.exports=v6});var VF=O((y5,NF)=>{var WD=W(),ZD=D0(),u0=Object.freeze({password:{scale:1,render:(D)=>"*".repeat(D.length)},emoji:{scale:2,render:(D)=>"\uD83D\uDE03".repeat(D.length)},invisible:{scale:0,render:(D)=>""},default:{scale:1,render:(D)=>`${D}`}}),g6=(D)=>u0[D]||u0.default,vD=Object.freeze({aborted:WD.red(ZD.cross),done:WD.green(ZD.tick),exited:WD.yellow(ZD.cross),default:WD.cyan("?")}),y6=(D,u,F)=>u?vD.aborted:F?vD.exited:D?vD.done:vD.default,c6=(D)=>WD.gray(D?ZD.ellipsis:ZD.pointerSmall),m6=(D,u)=>WD.gray(D?u?ZD.pointerSmall:"+":ZD.line);NF.exports={styles:u0,render:g6,symbols:vD,symbol:y6,delimiter:c6,item:m6}});var wF=O((c5,LF)=>{var n6=_u();LF.exports=function(D,u){let F=String(n6(D)||"").split(/\r?\n/);if(!u)return F.length;return F.map((C)=>Math.ceil(C.length/u)).reduce((C,E)=>C+E)}});var IF=O((m5,qF)=>{qF.exports=(D,u={})=>{const F=Number.isSafeInteger(parseInt(u.margin))?new Array(parseInt(u.margin)).fill(" ").join(""):u.margin||"",C=u.width;return(D||"").split(/\r?\n/g).map((E)=>E.split(/\s+/g).reduce((B,A)=>{if(A.length+F.length>=C||B[B.length-1].length+A.length+1<C)B[B.length-1]+=` ${A}`;else B.push(`${F}${A}`);return B},[F]).join("\n")).join("\n")}});var SF=O((n5,jF)=>{jF.exports=(D,u,F)=>{F=F||u;let C=Math.min(u-F,D-Math.floor(F/2));if(C<0)C=0;let E=Math.min(C+F,u);return{startIndex:C,endIndex:E}}});var v=O((l5,PF)=>{PF.exports={action:fF(),clear:WF(),style:VF(),strip:_u(),figures:D0(),lines:wF(),wrap:IF(),entriesToDisplay:SF()}});var e=O((i5,dF)=>{var TF=import.meta.require("readline"),l6=v(),i6=l6.action,a6=import.meta.require("events"),bF=N(),p6=bF.beep,t6=bF.cursor,r6=W();class kF extends a6{constructor(D={}){super();this.firstRender=!0,this.in=D.stdin||process.stdin,this.out=D.stdout||process.stdout,this.onRender=(D.onRender||(()=>{return})).bind(this);const u=TF.createInterface({input:this.in,escapeCodeTimeout:50});if(TF.emitKeypressEvents(this.in,u),this.in.isTTY)this.in.setRawMode(!0);const F=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,C=(E,B)=>{let A=i6(B,F);if(A===!1)this._&&this._(E,B);else if(typeof this[A]==="function")this[A](B);else this.bell()};this.close=()=>{if(this.out.write(t6.show),this.in.removeListener("keypress",C),this.in.isTTY)this.in.setRawMode(!1);u.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",C)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(p6)}render(){if(this.onRender(r6),this.firstRender)this.firstRender=!1}}dF.exports=kF});var mF=O((a5,cF)=>{function xF(D,u,F,C,E,B,A){try{var h=D[B](A),$=h.value}catch(_){F(_);return}if(h.done)u($);else Promise.resolve($).then(C,E)}function vF(D){return function(){var u=this,F=arguments;return new Promise(function(C,E){var B=D.apply(u,F);function A($){xF(B,C,E,A,h,"next",$)}function h($){xF(B,C,E,A,h,"throw",$)}A(void 0)})}}var Uu=W(),s6=e(),gF=N(),o6=gF.erase,gD=gF.cursor,Mu=v(),F0=Mu.style,C0=Mu.clear,e6=Mu.lines,DB=Mu.figures;class yF extends s6{constructor(D={}){super(D);this.transform=F0.render(D.style),this.scale=this.transform.scale,this.msg=D.message,this.initial=D.initial||"",this.validator=D.validate||(()=>!0),this.value="",this.errorMsg=D.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=C0("",this.out.columns),this.render()}set value(D){if(!D&&this.initial)this.placeholder=!0,this.rendered=Uu.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(D);this._value=D,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=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var D=this;return vF(function*(){let u=yield D.validator(D.value);if(typeof u==="string")D.errorMsg=u,u=!1;D.error=!u})()}submit(){var D=this;return vF(function*(){if(D.value=D.value||D.initial,D.cursorOffset=0,D.cursor=D.rendered.length,yield D.validate(),D.error){D.red=!0,D.fire(),D.render();return}D.done=!0,D.aborted=!1,D.fire(),D.render(),D.out.write("\n"),D.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(D){if(this.placeholder)return;this.cursor=this.cursor+D,this.cursorOffset+=D}_(D,u){let F=this.value.slice(0,this.cursor),C=this.value.slice(this.cursor);this.value=`${F}${D}${C}`,this.red=!1,this.cursor=this.placeholder?0:F.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let D=this.value.slice(0,this.cursor-1),u=this.value.slice(this.cursor);if(this.value=`${D}${u}`,this.red=!1,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 D=this.value.slice(0,this.cursor),u=this.value.slice(this.cursor+1);if(this.value=`${D}${u}`,this.red=!1,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(gD.down(e6(this.outputError,this.out.columns)-1)+C0(this.outputError,this.out.columns));this.out.write(C0(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[F0.symbol(this.done,this.aborted),Uu.bold(this.msg),F0.delimiter(this.done),this.red?Uu.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,u,F)=>D+`\n${F?" ":DB.pointerSmall} ${Uu.red().italic(u)}`,"");this.out.write(o6.line+gD.to(0)+this.outputText+gD.save+this.outputError+gD.restore+gD.move(this.cursorOffset,0))}}cF.exports=yF});var pF=O((p5,aF)=>{var DD=W(),uB=e(),yD=v(),nF=yD.style,lF=yD.clear,Hu=yD.figures,FB=yD.wrap,CB=yD.entriesToDisplay,EB=N(),BB=EB.cursor;class iF extends uB{constructor(D={}){super(D);this.msg=D.message,this.hint=D.hint||"- Use arrow-keys. Return to submit.",this.warn=D.warn||"- This option is disabled",this.cursor=D.initial||0,this.choices=D.choices.map((u,F)=>{if(typeof u==="string")u={title:u,value:F};return{title:u&&(u.title||u.value||u),value:u&&(u.value===void 0?F:u.value),description:u&&u.description,selected:u&&u.selected,disabled:u&&u.disabled}}),this.optionsPerPage=D.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=lF("",this.out.columns),this.render()}moveCursor(D){this.cursor=D,this.value=this.choices[D].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,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()}_(D,u){if(D===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(BB.hide);else this.out.write(lF(this.outputText,this.out.columns));super.render();let D=CB(this.cursor,this.choices.length,this.optionsPerPage),u=D.startIndex,F=D.endIndex;if(this.outputText=[nF.symbol(this.done,this.aborted),DD.bold(this.msg),nF.delimiter(!1),this.done?this.selection.title:this.selection.disabled?DD.yellow(this.warn):DD.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let C=u;C<F;C++){let E,B,A="",h=this.choices[C];if(C===u&&u>0)B=Hu.arrowUp;else if(C===F-1&&F<this.choices.length)B=Hu.arrowDown;else B=" ";if(h.disabled)E=this.cursor===C?DD.gray().underline(h.title):DD.strikethrough().gray(h.title),B=(this.cursor===C?DD.bold().gray(Hu.pointer)+" ":" ")+B;else if(E=this.cursor===C?DD.cyan().underline(h.title):h.title,B=(this.cursor===C?DD.cyan(Hu.pointer)+" ":" ")+B,h.description&&this.cursor===C){if(A=` - ${h.description}`,B.length+E.length+A.length>=this.out.columns||h.description.split(/\r?\n/).length>1)A="\n"+FB(h.description,{margin:3,width:this.out.columns})}this.outputText+=`${B} ${E}${DD.gray(A)}\n`}}this.out.write(this.outputText)}}aF.exports=iF});var u2=O((t5,D2)=>{var Ou=W(),AB=e(),sF=v(),tF=sF.style,hB=sF.clear,oF=N(),rF=oF.cursor,$B=oF.erase;class eF extends AB{constructor(D={}){super(D);this.msg=D.message,this.value=!!D.initial,this.active=D.active||"on",this.inactive=D.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=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,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()}_(D,u){if(D===" ")this.value=!this.value;else if(D==="1")this.value=!0;else if(D==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(rF.hide);else this.out.write(hB(this.outputText,this.out.columns));super.render(),this.outputText=[tF.symbol(this.done,this.aborted),Ou.bold(this.msg),tF.delimiter(this.done),this.value?this.inactive:Ou.cyan().underline(this.inactive),Ou.gray("/"),this.value?Ou.cyan().underline(this.active):this.active].join(" "),this.out.write($B.line+rF.to(0)+this.outputText)}}D2.exports=eF});var n=O((r5,F2)=>{class Zu{constructor({token:D,date:u,parts:F,locales:C}){this.token=D,this.date=u||new Date,this.parts=F||[this],this.locales=C||{}}up(){}down(){}next(){const D=this.parts.indexOf(this);return this.parts.find((u,F)=>F>D&&u instanceof Zu)}setTo(D){}prev(){let D=[].concat(this.parts).reverse();const u=D.indexOf(this);return D.find((F,C)=>C>u&&F instanceof Zu)}toString(){return String(this.date)}}F2.exports=Zu});var B2=O((s5,E2)=>{var _B=n();class C2 extends _B{constructor(D={}){super(D)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let D=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?D.toUpperCase():D}}E2.exports=C2});var $2=O((o5,h2)=>{var UB=n(),MB=(D)=>{return D=D%10,D===1?"st":D===2?"nd":D===3?"rd":"th"};class A2 extends UB{constructor(D={}){super(D)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(D){this.date.setDate(parseInt(D.substr(-2)))}toString(){let D=this.date.getDate(),u=this.date.getDay();return this.token==="DD"?String(D).padStart(2,"0"):this.token==="Do"?D+MB(D):this.token==="d"?u+1:this.token==="ddd"?this.locales.weekdaysShort[u]:this.token==="dddd"?this.locales.weekdays[u]:D}}h2.exports=A2});var M2=O((e5,U2)=>{var HB=n();class _2 extends HB{constructor(D={}){super(D)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(D){this.date.setHours(parseInt(D.substr(-2)))}toString(){let D=this.date.getHours();if(/h/.test(this.token))D=D%12||12;return this.token.length>1?String(D).padStart(2,"0"):D}}U2.exports=_2});var Z2=O((DA,O2)=>{var OB=n();class H2 extends OB{constructor(D={}){super(D)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(D){this.date.setMilliseconds(parseInt(D.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}O2.exports=H2});var J2=O((uA,f2)=>{var ZB=n();class z2 extends ZB{constructor(D={}){super(D)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(D){this.date.setMinutes(parseInt(D.substr(-2)))}toString(){let D=this.date.getMinutes();return this.token.length>1?String(D).padStart(2,"0"):D}}f2.exports=z2});var X2=O((FA,Q2)=>{var zB=n();class K2 extends zB{constructor(D={}){super(D)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(D){D=parseInt(D.substr(-2))-1,this.date.setMonth(D<0?0:D)}toString(){let D=this.date.getMonth(),u=this.token.length;return u===2?String(D+1).padStart(2,"0"):u===3?this.locales.monthsShort[D]:u===4?this.locales.months[D]:String(D+1)}}Q2.exports=K2});var W2=O((CA,Y2)=>{var fB=n();class G2 extends fB{constructor(D={}){super(D)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(D){this.date.setSeconds(parseInt(D.substr(-2)))}toString(){let D=this.date.getSeconds();return this.token.length>1?String(D).padStart(2,"0"):D}}Y2.exports=G2});var V2=O((EA,N2)=>{var JB=n();class R2 extends JB{constructor(D={}){super(D)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(D){this.date.setFullYear(D.substr(-4))}toString(){let D=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?D.substr(-2):D}}N2.exports=R2});var w2=O((BA,L2)=>{L2.exports={DatePart:n(),Meridiem:B2(),Day:$2(),Hours:M2(),Milliseconds:Z2(),Minutes:J2(),Month:X2(),Seconds:W2(),Year:V2()}});var v2=O((AA,x2)=>{function q2(D,u,F,C,E,B,A){try{var h=D[B](A),$=h.value}catch(_){F(_);return}if(h.done)u($);else Promise.resolve($).then(C,E)}function I2(D){return function(){var u=this,F=arguments;return new Promise(function(C,E){var B=D.apply(u,F);function A($){q2(B,C,E,A,h,"next",$)}function h($){q2(B,C,E,A,h,"throw",$)}A(void 0)})}}var E0=W(),KB=e(),B0=v(),j2=B0.style,S2=B0.clear,QB=B0.figures,k2=N(),XB=k2.erase,P2=k2.cursor,uD=w2(),T2=uD.DatePart,GB=uD.Meridiem,YB=uD.Day,WB=uD.Hours,RB=uD.Milliseconds,NB=uD.Minutes,VB=uD.Month,LB=uD.Seconds,wB=uD.Year,qB=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,b2={1:({token:D})=>D.replace(/\\(.)/g,"$1"),2:(D)=>new YB(D),3:(D)=>new VB(D),4:(D)=>new wB(D),5:(D)=>new GB(D),6:(D)=>new WB(D),7:(D)=>new NB(D),8:(D)=>new LB(D),9:(D)=>new RB(D)},IB={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 d2 extends KB{constructor(D={}){super(D);this.msg=D.message,this.cursor=0,this.typed="",this.locales=Object.assign(IB,D.locales),this._date=D.initial||new Date,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.mask=D.mask||"YYYY-MM-DD HH:mm:ss",this.clear=S2("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(D){if(D)this._date.setTime(D.getTime())}set mask(D){let u;this.parts=[];while(u=qB.exec(D)){let C=u.shift(),E=u.findIndex((B)=>B!=null);this.parts.push(E in b2?b2[E]({token:u[E]||C,date:this.date,parts:this.parts,locales:this.locales}):u[E]||C)}let F=this.parts.reduce((C,E)=>{if(typeof E==="string"&&typeof C[C.length-1]==="string")C[C.length-1]+=E;else C.push(E);return C},[]);this.parts.splice(0),this.parts.push(...F),this.reset()}moveCursor(D){this.typed="",this.cursor=D,this.fire()}reset(){this.moveCursor(this.parts.findIndex((D)=>D instanceof T2)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var D=this;return I2(function*(){let u=yield D.validator(D.value);if(typeof u==="string")D.errorMsg=u,u=!1;D.error=!u})()}submit(){var D=this;return I2(function*(){if(yield D.validate(),D.error){D.color="red",D.fire(),D.render();return}D.done=!0,D.aborted=!1,D.fire(),D.render(),D.out.write("\n"),D.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let D=this.parts[this.cursor].prev();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}right(){let D=this.parts[this.cursor].next();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}next(){let D=this.parts[this.cursor].next();this.moveCursor(D?this.parts.indexOf(D):this.parts.findIndex((u)=>u instanceof T2)),this.render()}_(D){if(/\d/.test(D))this.typed+=D,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(P2.hide);else this.out.write(S2(this.outputText,this.out.columns));if(super.render(),this.outputText=[j2.symbol(this.done,this.aborted),E0.bold(this.msg),j2.delimiter(!1),this.parts.reduce((D,u,F)=>D.concat(F===this.cursor&&!this.done?E0.cyan().underline(u.toString()):u),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split("\n").reduce((D,u,F)=>D+`\n${F?" ":QB.pointerSmall} ${E0.red().italic(u)}`,"");this.out.write(XB.line+P2.to(0)+this.outputText)}}x2.exports=d2});var a2=O((hA,i2)=>{function g2(D,u,F,C,E,B,A){try{var h=D[B](A),$=h.value}catch(_){F(_);return}if(h.done)u($);else Promise.resolve($).then(C,E)}function y2(D){return function(){var u=this,F=arguments;return new Promise(function(C,E){var B=D.apply(u,F);function A($){g2(B,C,E,A,h,"next",$)}function h($){g2(B,C,E,A,h,"throw",$)}A(void 0)})}}var zu=W(),jB=e(),n2=N(),fu=n2.cursor,SB=n2.erase,Ju=v(),A0=Ju.style,PB=Ju.figures,c2=Ju.clear,TB=Ju.lines,bB=/[0-9]/,h0=(D)=>D!==void 0,m2=(D,u)=>{let F=Math.pow(10,u);return Math.round(D*F)/F};class l2 extends jB{constructor(D={}){super(D);this.transform=A0.render(D.style),this.msg=D.message,this.initial=h0(D.initial)?D.initial:"",this.float=!!D.float,this.round=D.round||2,this.inc=D.increment||1,this.min=h0(D.min)?D.min:-1/0,this.max=h0(D.max)?D.max:1/0,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(D){if(!D&&D!==0)this.placeholder=!0,this.rendered=zu.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${m2(D,this.round)}`),this._value=m2(D,this.round);this.fire()}get value(){return this._value}parse(D){return this.float?parseFloat(D):parseInt(D)}valid(D){return D==="-"||D==="."&&this.float||bB.test(D)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let D=this.value;this.value=D!==""?D:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var D=this;return y2(function*(){let u=yield D.validator(D.value);if(typeof u==="string")D.errorMsg=u,u=!1;D.error=!u})()}submit(){var D=this;return y2(function*(){if(yield D.validate(),D.error){D.color="red",D.fire(),D.render();return}let u=D.value;D.value=u!==""?u:D.initial,D.done=!0,D.aborted=!1,D.error=!1,D.fire(),D.render(),D.out.write("\n"),D.close()})()}up(){if(this.typed="",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(){if(this.typed="",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 D=this.value.toString();if(D.length===0)return this.bell();if(this.value=this.parse(D=D.slice(0,-1))||"",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()}_(D,u){if(!this.valid(D))return this.bell();const F=Date.now();if(F-this.lastHit>1000)this.typed="";if(this.typed+=D,this.lastHit=F,this.color="cyan",D===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),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(fu.down(TB(this.outputError,this.out.columns)-1)+c2(this.outputError,this.out.columns));this.out.write(c2(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[A0.symbol(this.done,this.aborted),zu.bold(this.msg),A0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?zu[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,u,F)=>D+`\n${F?" ":PB.pointerSmall} ${zu.red().italic(u)}`,"");this.out.write(SB.line+fu.to(0)+this.outputText+fu.save+this.outputError+fu.restore)}}i2.exports=l2});var $0=O(($A,s2)=>{var l=W(),kB=N(),dB=kB.cursor,xB=e(),cD=v(),p2=cD.clear,$D=cD.figures,t2=cD.style,vB=cD.wrap,gB=cD.entriesToDisplay;class r2 extends xB{constructor(D={}){super(D);if(this.msg=D.message,this.cursor=D.cursor||0,this.scrollIndex=D.cursor||0,this.hint=D.hint||"",this.warn=D.warn||"- This option is disabled -",this.minSelected=D.min,this.showMinError=!1,this.maxChoices=D.max,this.instructions=D.instructions,this.optionsPerPage=D.optionsPerPage||10,this.value=D.choices.map((u,F)=>{if(typeof u==="string")u={title:u,value:F};return{title:u&&(u.title||u.value||u),description:u&&u.description,value:u&&(u.value===void 0?F:u.value),selected:u&&u.selected,disabled:u&&u.disabled}}),this.clear=p2("",this.out.columns),!D.overrideRender)this.render()}reset(){this.value.map((D)=>!D.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((D)=>D.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const D=this.value.filter((u)=>u.selected);if(this.minSelected&&D.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,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=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const D=this.value[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((u)=>u.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const D=!this.value[this.cursor].selected;this.value.filter((u)=>!u.disabled).forEach((u)=>u.selected=D),this.render()}_(D,u){if(D===" ")this.handleSpaceToggle();else if(D==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||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===void 0?" a: Toggle all\n":"")+" enter/return: Complete answer"}return""}renderOption(D,u,F,C){const E=(u.selected?l.green($D.radioOn):$D.radioOff)+" "+C+" ";let B,A;if(u.disabled)B=D===F?l.gray().underline(u.title):l.strikethrough().gray(u.title);else if(B=D===F?l.cyan().underline(u.title):u.title,D===F&&u.description){if(A=` - ${u.description}`,E.length+B.length+A.length>=this.out.columns||u.description.split(/\r?\n/).length>1)A="\n"+vB(u.description,{margin:E.length,width:this.out.columns})}return E+B+l.gray(A||"")}paginateOptions(D){if(D.length===0)return l.red("No matches for this query.");let u=gB(this.cursor,D.length,this.optionsPerPage),F=u.startIndex,C=u.endIndex,E,B=[];for(let A=F;A<C;A++){if(A===F&&F>0)E=$D.arrowUp;else if(A===C-1&&C<D.length)E=$D.arrowDown;else E=" ";B.push(this.renderOption(this.cursor,D[A],A,E))}return"\n"+B.join("\n")}renderOptions(D){if(!this.done)return this.paginateOptions(D);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((u)=>u.selected).map((u)=>u.title).join(", ");const D=[l.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)D.push(l.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(dB.hide);super.render();let D=[t2.symbol(this.done,this.aborted),l.bold(this.msg),t2.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=l.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.value),this.out.write(this.clear+D),this.clear=p2(D,this.out.columns)}}s2.exports=r2});var B1=O((_A,E1)=>{function o2(D,u,F,C,E,B,A){try{var h=D[B](A),$=h.value}catch(_){F(_);return}if(h.done)u($);else Promise.resolve($).then(C,E)}function yB(D){return function(){var u=this,F=arguments;return new Promise(function(C,E){var B=D.apply(u,F);function A($){o2(B,C,E,A,h,"next",$)}function h($){o2(B,C,E,A,h,"throw",$)}A(void 0)})}}var mD=W(),cB=e(),F1=N(),mB=F1.erase,e2=F1.cursor,nD=v(),_0=nD.style,D1=nD.clear,U0=nD.figures,nB=nD.wrap,lB=nD.entriesToDisplay,u1=(D,u)=>D[u]&&(D[u].value||D[u].title||D[u]),iB=(D,u)=>D[u]&&(D[u].title||D[u].value||D[u]),aB=(D,u)=>{const F=D.findIndex((C)=>C.value===u||C.title===u);return F>-1?F:void 0};class C1 extends cB{constructor(D={}){super(D);this.msg=D.message,this.suggest=D.suggest,this.choices=D.choices,this.initial=typeof D.initial==="number"?D.initial:aB(D.choices,D.initial),this.select=this.initial||D.cursor||0,this.i18n={noMatches:D.noMatches||"no matches found"},this.fallback=D.fallback||this.initial,this.clearFirst=D.clearFirst||!1,this.suggestions=[],this.input="",this.limit=D.limit||10,this.cursor=0,this.transform=_0.render(D.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=D1("",this.out.columns),this.complete(this.render),this.render()}set fallback(D){this._fb=Number.isSafeInteger(parseInt(D))?parseInt(D):D}get fallback(){let D;if(typeof this._fb==="number")D=this.choices[this._fb];else if(typeof this._fb==="string")D={title:this._fb};return D||this._fb||{title:this.i18n.noMatches}}moveSelect(D){if(this.select=D,this.suggestions.length>0)this.value=u1(this.suggestions,D);else this.value=this.fallback.value;this.fire()}complete(D){var u=this;return yB(function*(){const F=u.completing=u.suggest(u.input,u.choices),C=yield F;if(u.completing!==F)return;u.suggestions=C.map((B,A,h)=>({title:iB(h,A),value:u1(h,A),description:B.description})),u.completing=!1;const E=Math.max(C.length-1,0);u.moveSelect(Math.min(E,u.select)),D&&D()})()}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=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,u){let F=this.input.slice(0,this.cursor),C=this.input.slice(this.cursor);this.input=`${F}${D}${C}`,this.cursor=F.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let D=this.input.slice(0,this.cursor-1),u=this.input.slice(this.cursor);this.input=`${D}${u}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let D=this.input.slice(0,this.cursor),u=this.input.slice(this.cursor+1);this.input=`${D}${u}`,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(D,u,F,C){let E,B=F?U0.arrowUp:C?U0.arrowDown:" ",A=u?mD.cyan().underline(D.title):D.title;if(B=(u?mD.cyan(U0.pointer)+" ":" ")+B,D.description){if(E=` - ${D.description}`,B.length+A.length+E.length>=this.out.columns||D.description.split(/\r?\n/).length>1)E="\n"+nB(D.description,{margin:3,width:this.out.columns})}return B+" "+A+mD.gray(E||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(e2.hide);else this.out.write(D1(this.outputText,this.out.columns));super.render();let D=lB(this.select,this.choices.length,this.limit),u=D.startIndex,F=D.endIndex;if(this.outputText=[_0.symbol(this.done,this.aborted,this.exited),mD.bold(this.msg),_0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const C=this.suggestions.slice(u,F).map((E,B)=>this.renderOption(E,this.select===B+u,B===0&&u>0,B+u===F-1&&F<this.choices.length)).join("\n");this.outputText+="\n"+(C||mD.gray(this.fallback.title))}this.out.write(mB.line+e2.to(0)+this.outputText)}}E1.exports=C1});var U1=O((UA,_1)=>{var FD=W(),pB=N(),tB=pB.cursor,rB=$0(),M0=v(),A1=M0.clear,h1=M0.style,RD=M0.figures;class $1 extends rB{constructor(D={}){D.overrideRender=!0;super(D);this.inputValue="",this.clear=A1("",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=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){const D=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((F)=>{if(this.inputValue){if(typeof F.title==="string"){if(F.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof F.value==="string"){if(F.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});const u=this.filteredOptions.findIndex((F)=>F===D);this.cursor=u<0?0:u,this.render()}handleSpaceToggle(){const D=this.filteredOptions[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((u)=>u.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}handleInputChange(D){this.inputValue=this.inputValue+D,this.updateFilteredOptions()}_(D,u){if(D===" ")this.handleSpaceToggle();else this.handleInputChange(D)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
3
+ Instructions:
4
+ ${RD.arrowUp}/${RD.arrowDown}: Highlight option
5
+ ${RD.arrowLeft}/${RD.arrowRight}/[space]: Toggle selection
6
+ [a,b,c]/delete: Filter choices
7
+ enter/return: Complete answer
8
+ `}return""}renderCurrentInput(){return`
9
+ Filtered results for: ${this.inputValue?this.inputValue:FD.gray("Enter something to filter")}\n`}renderOption(D,u,F){let C;if(u.disabled)C=D===F?FD.gray().underline(u.title):FD.strikethrough().gray(u.title);else C=D===F?FD.cyan().underline(u.title):u.title;return(u.selected?FD.green(RD.radioOn):RD.radioOff)+" "+C}renderDoneOrInstructions(){if(this.done)return this.value.filter((u)=>u.selected).map((u)=>u.title).join(", ");const D=[FD.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)D.push(FD.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(tB.hide);super.render();let D=[h1.symbol(this.done,this.aborted),FD.bold(this.msg),h1.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=FD.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+D),this.clear=A1(D,this.out.columns)}}_1.exports=$1});var K1=O((MA,J1)=>{var M1=W(),sB=e(),Z1=v(),H1=Z1.style,oB=Z1.clear,z1=N(),eB=z1.erase,O1=z1.cursor;class f1 extends sB{constructor(D={}){super(D);this.msg=D.message,this.value=D.initial,this.initialValue=!!D.initial,this.yesMsg=D.yes||"yes",this.yesOption=D.yesOption||"(Y/n)",this.noMsg=D.no||"no",this.noOption=D.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,u){if(D.toLowerCase()==="y")return this.value=!0,this.submit();if(D.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(O1.hide);else this.out.write(oB(this.outputText,this.out.columns));super.render(),this.outputText=[H1.symbol(this.done,this.aborted),M1.bold(this.msg),H1.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:M1.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(eB.line+O1.to(0)+this.outputText)}}J1.exports=f1});var X1=O((HA,Q1)=>{Q1.exports={TextPrompt:mF(),SelectPrompt:pF(),TogglePrompt:u2(),DatePrompt:v2(),NumberPrompt:a2(),MultiselectPrompt:$0(),AutocompletePrompt:B1(),AutocompleteMultiselectPrompt:U1(),ConfirmPrompt:K1()}});var Y1=O((G1)=>{function i(D,u,F={}){return new Promise((C,E)=>{const B=new D7[D](u),A=F.onAbort||Ku,h=F.onSubmit||Ku,$=F.onExit||Ku;B.on("state",u.onState||Ku),B.on("submit",(_)=>C(h(_))),B.on("exit",(_)=>C($(_))),B.on("abort",(_)=>E(A(_)))})}var S=G1,D7=X1(),Ku=(D)=>D;S.text=(D)=>i("TextPrompt",D);S.password=(D)=>{return D.style="password",S.text(D)};S.invisible=(D)=>{return D.style="invisible",S.text(D)};S.number=(D)=>i("NumberPrompt",D);S.date=(D)=>i("DatePrompt",D);S.confirm=(D)=>i("ConfirmPrompt",D);S.list=(D)=>{const u=D.separator||",";return i("TextPrompt",D,{onSubmit:(F)=>F.split(u).map((C)=>C.trim())})};S.toggle=(D)=>i("TogglePrompt",D);S.select=(D)=>i("SelectPrompt",D);S.multiselect=(D)=>{D.choices=[].concat(D.choices||[]);const u=(F)=>F.filter((C)=>C.selected).map((C)=>C.value);return i("MultiselectPrompt",D,{onAbort:u,onSubmit:u})};S.autocompleteMultiselect=(D)=>{D.choices=[].concat(D.choices||[]);const u=(F)=>F.filter((C)=>C.selected).map((C)=>C.value);return i("AutocompleteMultiselectPrompt",D,{onAbort:u,onSubmit:u})};var u7=(D,u)=>Promise.resolve(u.filter((F)=>F.title.slice(0,D.length).toLowerCase()===D.toLowerCase()));S.autocomplete=(D)=>{return D.suggest=D.suggest||u7,D.choices=[].concat(D.choices||[]),i("AutocompletePrompt",D)}});var I1=O((ZA,q1)=>{function W1(D,u){var F=Object.keys(D);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(D);if(u)C=C.filter(function(E){return Object.getOwnPropertyDescriptor(D,E).enumerable});F.push.apply(F,C)}return F}function R1(D){for(var u=1;u<arguments.length;u++){var F=arguments[u]!=null?arguments[u]:{};if(u%2)W1(Object(F),!0).forEach(function(C){F7(D,C,F[C])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(D,Object.getOwnPropertyDescriptors(F));else W1(Object(F)).forEach(function(C){Object.defineProperty(D,C,Object.getOwnPropertyDescriptor(F,C))})}return D}function F7(D,u,F){if(u in D)Object.defineProperty(D,u,{value:F,enumerable:!0,configurable:!0,writable:!0});else D[u]=F;return D}function C7(D,u){var F=typeof Symbol!=="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(!F){if(Array.isArray(D)||(F=E7(D))||u&&D&&typeof D.length==="number"){if(F)D=F;var C=0,E=function $(){};return{s:E,n:function $(){if(C>=D.length)return{done:!0};return{done:!1,value:D[C++]}},e:function $(_){throw _},f:E}}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 B=!0,A=!1,h;return{s:function $(){F=F.call(D)},n:function $(){var _=F.next();return B=_.done,_},e:function $(_){A=!0,h=_},f:function $(){try{if(!B&&F.return!=null)F.return()}finally{if(A)throw h}}}}function E7(D,u){if(!D)return;if(typeof D==="string")return N1(D,u);var F=Object.prototype.toString.call(D).slice(8,-1);if(F==="Object"&&D.constructor)F=D.constructor.name;if(F==="Map"||F==="Set")return Array.from(D);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return N1(D,u)}function N1(D,u){if(u==null||u>D.length)u=D.length;for(var F=0,C=new Array(u);F<u;F++)C[F]=D[F];return C}function V1(D,u,F,C,E,B,A){try{var h=D[B](A),$=h.value}catch(_){F(_);return}if(h.done)u($);else Promise.resolve($).then(C,E)}function L1(D){return function(){var u=this,F=arguments;return new Promise(function(C,E){var B=D.apply(u,F);function A($){V1(B,C,E,A,h,"next",$)}function h($){V1(B,C,E,A,h,"throw",$)}A(void 0)})}}function _D(){return O0.apply(this,arguments)}function O0(){return O0=L1(function*(D=[],{onSubmit:u=w1,onCancel:F=w1}={}){const C={},E=_D._override||{};D=[].concat(D);let B,A,h,$,_,M;const H=function(){var w=L1(function*(q,b,j=!1){if(!j&&q.validate&&q.validate(b)!==!0)return;return q.format?yield q.format(b,C):b});return function q(b,j){return w.apply(this,arguments)}}();var U=C7(D),Z;try{for(U.s();!(Z=U.n()).done;){A=Z.value;var J=A;if($=J.name,_=J.type,typeof _==="function")_=yield _(B,R1({},C),A),A.type=_;if(!_)continue;for(let w in A){if(B7.includes(w))continue;let q=A[w];A[w]=typeof q==="function"?yield q(B,R1({},C),M):q}if(M=A,typeof A.message!=="string")throw new Error("prompt message is required");var X=A;if($=X.name,_=X.type,H0[_]===void 0)throw new Error(`prompt type (${_}) is not defined`);if(E[A.name]!==void 0){if(B=yield H(A,E[A.name]),B!==void 0){C[$]=B;continue}}try{B=_D._injected?A7(_D._injected,A.initial):yield H0[_](A),C[$]=B=yield H(A,B,!0),h=yield u(A,B,C)}catch(w){h=!(yield F(A,C))}if(h)return C}}catch(w){U.e(w)}finally{U.f()}return C}),O0.apply(this,arguments)}function A7(D,u){const F=D.shift();if(F instanceof Error)throw F;return F===void 0?u:F}function h7(D){_D._injected=(_D._injected||[]).concat(D)}function $7(D){_D._override=Object.assign({},D)}var H0=Y1(),B7=["suggest","format","onState","validate","onRender","type"],w1=()=>{};q1.exports=Object.assign(_D,{prompt:_D,prompts:H0,inject:h7,override:$7})});var S1=O((zA,j1)=>{j1.exports=(D,u)=>{if(D.meta&&D.name!=="escape")return;if(D.ctrl){if(D.name==="a")return"first";if(D.name==="c")return"abort";if(D.name==="d")return"abort";if(D.name==="e")return"last";if(D.name==="g")return"reset"}if(u){if(D.name==="j")return"down";if(D.name==="k")return"up"}if(D.name==="return")return"submit";if(D.name==="enter")return"submit";if(D.name==="backspace")return"delete";if(D.name==="delete")return"deleteForward";if(D.name==="abort")return"abort";if(D.name==="escape")return"exit";if(D.name==="tab")return"next";if(D.name==="pagedown")return"nextPage";if(D.name==="pageup")return"prevPage";if(D.name==="home")return"home";if(D.name==="end")return"end";if(D.name==="up")return"up";if(D.name==="down")return"down";if(D.name==="right")return"right";if(D.name==="left")return"left";return!1}});var Qu=O((fA,P1)=>{P1.exports=(D)=>{const u=["[\\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("|"),F=new RegExp(u,"g");return typeof D==="string"?D.replace(F,""):D}});var k1=O((JA,b1)=>{var _7=Qu(),{erase:T1,cursor:U7}=N(),M7=(D)=>[..._7(D)].length;b1.exports=function(D,u){if(!u)return T1.line+U7.to(0);let F=0;const C=D.split(/\r?\n/);for(let E of C)F+=1+Math.floor(Math.max(M7(E)-1,0)/u);return T1.lines(F)}});var Z0=O((KA,d1)=>{var lD={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},H7={arrowUp:lD.arrowUp,arrowDown:lD.arrowDown,arrowLeft:lD.arrowLeft,arrowRight:lD.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},O7=process.platform==="win32"?H7:lD;d1.exports=O7});var v1=O((QA,x1)=>{var ND=W(),zD=Z0(),z0=Object.freeze({password:{scale:1,render:(D)=>"*".repeat(D.length)},emoji:{scale:2,render:(D)=>"\uD83D\uDE03".repeat(D.length)},invisible:{scale:0,render:(D)=>""},default:{scale:1,render:(D)=>`${D}`}}),Z7=(D)=>z0[D]||z0.default,iD=Object.freeze({aborted:ND.red(zD.cross),done:ND.green(zD.tick),exited:ND.yellow(zD.cross),default:ND.cyan("?")}),z7=(D,u,F)=>u?iD.aborted:F?iD.exited:D?iD.done:iD.default,f7=(D)=>ND.gray(D?zD.ellipsis:zD.pointerSmall),J7=(D,u)=>ND.gray(D?u?zD.pointerSmall:"+":zD.line);x1.exports={styles:z0,render:Z7,symbols:iD,symbol:z7,delimiter:f7,item:J7}});var y1=O((XA,g1)=>{var K7=Qu();g1.exports=function(D,u){let F=String(K7(D)||"").split(/\r?\n/);if(!u)return F.length;return F.map((C)=>Math.ceil(C.length/u)).reduce((C,E)=>C+E)}});var m1=O((GA,c1)=>{c1.exports=(D,u={})=>{const F=Number.isSafeInteger(parseInt(u.margin))?new Array(parseInt(u.margin)).fill(" ").join(""):u.margin||"",C=u.width;return(D||"").split(/\r?\n/g).map((E)=>E.split(/\s+/g).reduce((B,A)=>{if(A.length+F.length>=C||B[B.length-1].length+A.length+1<C)B[B.length-1]+=` ${A}`;else B.push(`${F}${A}`);return B},[F]).join("\n")).join("\n")}});var l1=O((YA,n1)=>{n1.exports=(D,u,F)=>{F=F||u;let C=Math.min(u-F,D-Math.floor(F/2));if(C<0)C=0;let E=Math.min(C+F,u);return{startIndex:C,endIndex:E}}});var g=O((WA,i1)=>{i1.exports={action:S1(),clear:k1(),style:v1(),strip:Qu(),figures:Z0(),lines:y1(),wrap:m1(),entriesToDisplay:l1()}});var CD=O((RA,t1)=>{var a1=import.meta.require("readline"),{action:Q7}=g(),X7=import.meta.require("events"),{beep:G7,cursor:Y7}=N(),W7=W();class p1 extends X7{constructor(D={}){super();this.firstRender=!0,this.in=D.stdin||process.stdin,this.out=D.stdout||process.stdout,this.onRender=(D.onRender||(()=>{return})).bind(this);const u=a1.createInterface({input:this.in,escapeCodeTimeout:50});if(a1.emitKeypressEvents(this.in,u),this.in.isTTY)this.in.setRawMode(!0);const F=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,C=(E,B)=>{let A=Q7(B,F);if(A===!1)this._&&this._(E,B);else if(typeof this[A]==="function")this[A](B);else this.bell()};this.close=()=>{if(this.out.write(Y7.show),this.in.removeListener("keypress",C),this.in.isTTY)this.in.setRawMode(!1);u.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",C)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(G7)}render(){if(this.onRender(W7),this.firstRender)this.firstRender=!1}}t1.exports=p1});var o1=O((NA,s1)=>{var Xu=W(),R7=CD(),{erase:N7,cursor:aD}=N(),{style:f0,clear:J0,lines:V7,figures:L7}=g();class r1 extends R7{constructor(D={}){super(D);this.transform=f0.render(D.style),this.scale=this.transform.scale,this.msg=D.message,this.initial=D.initial||"",this.validator=D.validate||(()=>!0),this.value="",this.errorMsg=D.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=J0("",this.out.columns),this.render()}set value(D){if(!D&&this.initial)this.placeholder=!0,this.rendered=Xu.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(D);this._value=D,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=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let D=await this.validator(this.value);if(typeof D==="string")this.errorMsg=D,D=!1;this.error=!D}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,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(D){if(this.placeholder)return;this.cursor=this.cursor+D,this.cursorOffset+=D}_(D,u){let F=this.value.slice(0,this.cursor),C=this.value.slice(this.cursor);this.value=`${F}${D}${C}`,this.red=!1,this.cursor=this.placeholder?0:F.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let D=this.value.slice(0,this.cursor-1),u=this.value.slice(this.cursor);if(this.value=`${D}${u}`,this.red=!1,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 D=this.value.slice(0,this.cursor),u=this.value.slice(this.cursor+1);if(this.value=`${D}${u}`,this.red=!1,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(aD.down(V7(this.outputError,this.out.columns)-1)+J0(this.outputError,this.out.columns));this.out.write(J0(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[f0.symbol(this.done,this.aborted),Xu.bold(this.msg),f0.delimiter(this.done),this.red?Xu.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,u,F)=>D+`\n${F?" ":L7.pointerSmall} ${Xu.red().italic(u)}`,"");this.out.write(N7.line+aD.to(0)+this.outputText+aD.save+this.outputError+aD.restore+aD.move(this.cursorOffset,0))}}s1.exports=r1});var C3=O((VA,F3)=>{var ED=W(),w7=CD(),{style:e1,clear:D3,figures:Gu,wrap:q7,entriesToDisplay:I7}=g(),{cursor:j7}=N();class u3 extends w7{constructor(D={}){super(D);this.msg=D.message,this.hint=D.hint||"- Use arrow-keys. Return to submit.",this.warn=D.warn||"- This option is disabled",this.cursor=D.initial||0,this.choices=D.choices.map((u,F)=>{if(typeof u==="string")u={title:u,value:F};return{title:u&&(u.title||u.value||u),value:u&&(u.value===void 0?F:u.value),description:u&&u.description,selected:u&&u.selected,disabled:u&&u.disabled}}),this.optionsPerPage=D.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=D3("",this.out.columns),this.render()}moveCursor(D){this.cursor=D,this.value=this.choices[D].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,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()}_(D,u){if(D===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(j7.hide);else this.out.write(D3(this.outputText,this.out.columns));super.render();let{startIndex:D,endIndex:u}=I7(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[e1.symbol(this.done,this.aborted),ED.bold(this.msg),e1.delimiter(!1),this.done?this.selection.title:this.selection.disabled?ED.yellow(this.warn):ED.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let F=D;F<u;F++){let C,E,B="",A=this.choices[F];if(F===D&&D>0)E=Gu.arrowUp;else if(F===u-1&&u<this.choices.length)E=Gu.arrowDown;else E=" ";if(A.disabled)C=this.cursor===F?ED.gray().underline(A.title):ED.strikethrough().gray(A.title),E=(this.cursor===F?ED.bold().gray(Gu.pointer)+" ":" ")+E;else if(C=this.cursor===F?ED.cyan().underline(A.title):A.title,E=(this.cursor===F?ED.cyan(Gu.pointer)+" ":" ")+E,A.description&&this.cursor===F){if(B=` - ${A.description}`,E.length+C.length+B.length>=this.out.columns||A.description.split(/\r?\n/).length>1)B="\n"+q7(A.description,{margin:3,width:this.out.columns})}this.outputText+=`${E} ${C}${ED.gray(B)}\n`}}this.out.write(this.outputText)}}F3.exports=u3});var $3=O((LA,h3)=>{var Yu=W(),S7=CD(),{style:E3,clear:P7}=g(),{cursor:B3,erase:T7}=N();class A3 extends S7{constructor(D={}){super(D);this.msg=D.message,this.value=!!D.initial,this.active=D.active||"on",this.inactive=D.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=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,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()}_(D,u){if(D===" ")this.value=!this.value;else if(D==="1")this.value=!0;else if(D==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(B3.hide);else this.out.write(P7(this.outputText,this.out.columns));super.render(),this.outputText=[E3.symbol(this.done,this.aborted),Yu.bold(this.msg),E3.delimiter(this.done),this.value?this.inactive:Yu.cyan().underline(this.inactive),Yu.gray("/"),this.value?Yu.cyan().underline(this.active):this.active].join(" "),this.out.write(T7.line+B3.to(0)+this.outputText)}}h3.exports=A3});var a=O((wA,_3)=>{class Wu{constructor({token:D,date:u,parts:F,locales:C}){this.token=D,this.date=u||new Date,this.parts=F||[this],this.locales=C||{}}up(){}down(){}next(){const D=this.parts.indexOf(this);return this.parts.find((u,F)=>F>D&&u instanceof Wu)}setTo(D){}prev(){let D=[].concat(this.parts).reverse();const u=D.indexOf(this);return D.find((F,C)=>C>u&&F instanceof Wu)}toString(){return String(this.date)}}_3.exports=Wu});var H3=O((qA,M3)=>{var b7=a();class U3 extends b7{constructor(D={}){super(D)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let D=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?D.toUpperCase():D}}M3.exports=U3});var z3=O((IA,Z3)=>{var k7=a(),d7=(D)=>{return D=D%10,D===1?"st":D===2?"nd":D===3?"rd":"th"};class O3 extends k7{constructor(D={}){super(D)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(D){this.date.setDate(parseInt(D.substr(-2)))}toString(){let D=this.date.getDate(),u=this.date.getDay();return this.token==="DD"?String(D).padStart(2,"0"):this.token==="Do"?D+d7(D):this.token==="d"?u+1:this.token==="ddd"?this.locales.weekdaysShort[u]:this.token==="dddd"?this.locales.weekdays[u]:D}}Z3.exports=O3});var K3=O((jA,J3)=>{var x7=a();class f3 extends x7{constructor(D={}){super(D)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(D){this.date.setHours(parseInt(D.substr(-2)))}toString(){let D=this.date.getHours();if(/h/.test(this.token))D=D%12||12;return this.token.length>1?String(D).padStart(2,"0"):D}}J3.exports=f3});var G3=O((SA,X3)=>{var v7=a();class Q3 extends v7{constructor(D={}){super(D)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(D){this.date.setMilliseconds(parseInt(D.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}X3.exports=Q3});var R3=O((PA,W3)=>{var g7=a();class Y3 extends g7{constructor(D={}){super(D)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(D){this.date.setMinutes(parseInt(D.substr(-2)))}toString(){let D=this.date.getMinutes();return this.token.length>1?String(D).padStart(2,"0"):D}}W3.exports=Y3});var L3=O((TA,V3)=>{var y7=a();class N3 extends y7{constructor(D={}){super(D)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(D){D=parseInt(D.substr(-2))-1,this.date.setMonth(D<0?0:D)}toString(){let D=this.date.getMonth(),u=this.token.length;return u===2?String(D+1).padStart(2,"0"):u===3?this.locales.monthsShort[D]:u===4?this.locales.months[D]:String(D+1)}}V3.exports=N3});var I3=O((bA,q3)=>{var c7=a();class w3 extends c7{constructor(D={}){super(D)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(D){this.date.setSeconds(parseInt(D.substr(-2)))}toString(){let D=this.date.getSeconds();return this.token.length>1?String(D).padStart(2,"0"):D}}q3.exports=w3});var P3=O((kA,S3)=>{var m7=a();class j3 extends m7{constructor(D={}){super(D)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(D){this.date.setFullYear(D.substr(-4))}toString(){let D=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?D.substr(-2):D}}S3.exports=j3});var b3=O((dA,T3)=>{T3.exports={DatePart:a(),Meridiem:H3(),Day:z3(),Hours:K3(),Milliseconds:G3(),Minutes:R3(),Month:L3(),Seconds:I3(),Year:P3()}});var m3=O((xA,c3)=>{var K0=W(),n7=CD(),{style:k3,clear:d3,figures:l7}=g(),{erase:i7,cursor:x3}=N(),{DatePart:v3,Meridiem:a7,Day:p7,Hours:t7,Milliseconds:r7,Minutes:s7,Month:o7,Seconds:e7,Year:D4}=b3(),u4=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,g3={1:({token:D})=>D.replace(/\\(.)/g,"$1"),2:(D)=>new p7(D),3:(D)=>new o7(D),4:(D)=>new D4(D),5:(D)=>new a7(D),6:(D)=>new t7(D),7:(D)=>new s7(D),8:(D)=>new e7(D),9:(D)=>new r7(D)},F4={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 y3 extends n7{constructor(D={}){super(D);this.msg=D.message,this.cursor=0,this.typed="",this.locales=Object.assign(F4,D.locales),this._date=D.initial||new Date,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.mask=D.mask||"YYYY-MM-DD HH:mm:ss",this.clear=d3("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(D){if(D)this._date.setTime(D.getTime())}set mask(D){let u;this.parts=[];while(u=u4.exec(D)){let C=u.shift(),E=u.findIndex((B)=>B!=null);this.parts.push(E in g3?g3[E]({token:u[E]||C,date:this.date,parts:this.parts,locales:this.locales}):u[E]||C)}let F=this.parts.reduce((C,E)=>{if(typeof E==="string"&&typeof C[C.length-1]==="string")C[C.length-1]+=E;else C.push(E);return C},[]);this.parts.splice(0),this.parts.push(...F),this.reset()}moveCursor(D){this.typed="",this.cursor=D,this.fire()}reset(){this.moveCursor(this.parts.findIndex((D)=>D instanceof v3)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let D=await this.validator(this.value);if(typeof D==="string")this.errorMsg=D,D=!1;this.error=!D}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,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 D=this.parts[this.cursor].prev();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}right(){let D=this.parts[this.cursor].next();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}next(){let D=this.parts[this.cursor].next();this.moveCursor(D?this.parts.indexOf(D):this.parts.findIndex((u)=>u instanceof v3)),this.render()}_(D){if(/\d/.test(D))this.typed+=D,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(x3.hide);else this.out.write(d3(this.outputText,this.out.columns));if(super.render(),this.outputText=[k3.symbol(this.done,this.aborted),K0.bold(this.msg),k3.delimiter(!1),this.parts.reduce((D,u,F)=>D.concat(F===this.cursor&&!this.done?K0.cyan().underline(u.toString()):u),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split("\n").reduce((D,u,F)=>D+`\n${F?" ":l7.pointerSmall} ${K0.red().italic(u)}`,"");this.out.write(i7.line+x3.to(0)+this.outputText)}}c3.exports=y3});var p3=O((vA,a3)=>{var Ru=W(),C4=CD(),{cursor:Nu,erase:E4}=N(),{style:Q0,figures:B4,clear:n3,lines:A4}=g(),h4=/[0-9]/,X0=(D)=>D!==void 0,l3=(D,u)=>{let F=Math.pow(10,u);return Math.round(D*F)/F};class i3 extends C4{constructor(D={}){super(D);this.transform=Q0.render(D.style),this.msg=D.message,this.initial=X0(D.initial)?D.initial:"",this.float=!!D.float,this.round=D.round||2,this.inc=D.increment||1,this.min=X0(D.min)?D.min:-1/0,this.max=X0(D.max)?D.max:1/0,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(D){if(!D&&D!==0)this.placeholder=!0,this.rendered=Ru.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${l3(D,this.round)}`),this._value=l3(D,this.round);this.fire()}get value(){return this._value}parse(D){return this.float?parseFloat(D):parseInt(D)}valid(D){return D==="-"||D==="."&&this.float||h4.test(D)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let D=this.value;this.value=D!==""?D:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let D=await this.validator(this.value);if(typeof D==="string")this.errorMsg=D,D=!1;this.error=!D}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let D=this.value;this.value=D!==""?D:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){if(this.typed="",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(){if(this.typed="",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 D=this.value.toString();if(D.length===0)return this.bell();if(this.value=this.parse(D=D.slice(0,-1))||"",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()}_(D,u){if(!this.valid(D))return this.bell();const F=Date.now();if(F-this.lastHit>1000)this.typed="";if(this.typed+=D,this.lastHit=F,this.color="cyan",D===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),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(Nu.down(A4(this.outputError,this.out.columns)-1)+n3(this.outputError,this.out.columns));this.out.write(n3(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[Q0.symbol(this.done,this.aborted),Ru.bold(this.msg),Q0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Ru[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,u,F)=>D+`\n${F?" ":B4.pointerSmall} ${Ru.red().italic(u)}`,"");this.out.write(E4.line+Nu.to(0)+this.outputText+Nu.save+this.outputError+Nu.restore)}}a3.exports=i3});var G0=O((gA,o3)=>{var p=W(),{cursor:$4}=N(),_4=CD(),{clear:t3,figures:UD,style:r3,wrap:U4,entriesToDisplay:M4}=g();class s3 extends _4{constructor(D={}){super(D);if(this.msg=D.message,this.cursor=D.cursor||0,this.scrollIndex=D.cursor||0,this.hint=D.hint||"",this.warn=D.warn||"- This option is disabled -",this.minSelected=D.min,this.showMinError=!1,this.maxChoices=D.max,this.instructions=D.instructions,this.optionsPerPage=D.optionsPerPage||10,this.value=D.choices.map((u,F)=>{if(typeof u==="string")u={title:u,value:F};return{title:u&&(u.title||u.value||u),description:u&&u.description,value:u&&(u.value===void 0?F:u.value),selected:u&&u.selected,disabled:u&&u.disabled}}),this.clear=t3("",this.out.columns),!D.overrideRender)this.render()}reset(){this.value.map((D)=>!D.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((D)=>D.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const D=this.value.filter((u)=>u.selected);if(this.minSelected&&D.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,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=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const D=this.value[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((u)=>u.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const D=!this.value[this.cursor].selected;this.value.filter((u)=>!u.disabled).forEach((u)=>u.selected=D),this.render()}_(D,u){if(D===" ")this.handleSpaceToggle();else if(D==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`\nInstructions:\n ${UD.arrowUp}/${UD.arrowDown}: Highlight option\n ${UD.arrowLeft}/${UD.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?" a: Toggle all\n":"")+" enter/return: Complete answer"}return""}renderOption(D,u,F,C){const E=(u.selected?p.green(UD.radioOn):UD.radioOff)+" "+C+" ";let B,A;if(u.disabled)B=D===F?p.gray().underline(u.title):p.strikethrough().gray(u.title);else if(B=D===F?p.cyan().underline(u.title):u.title,D===F&&u.description){if(A=` - ${u.description}`,E.length+B.length+A.length>=this.out.columns||u.description.split(/\r?\n/).length>1)A="\n"+U4(u.description,{margin:E.length,width:this.out.columns})}return E+B+p.gray(A||"")}paginateOptions(D){if(D.length===0)return p.red("No matches for this query.");let{startIndex:u,endIndex:F}=M4(this.cursor,D.length,this.optionsPerPage),C,E=[];for(let B=u;B<F;B++){if(B===u&&u>0)C=UD.arrowUp;else if(B===F-1&&F<D.length)C=UD.arrowDown;else C=" ";E.push(this.renderOption(this.cursor,D[B],B,C))}return"\n"+E.join("\n")}renderOptions(D){if(!this.done)return this.paginateOptions(D);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((u)=>u.selected).map((u)=>u.title).join(", ");const D=[p.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)D.push(p.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write($4.hide);super.render();let D=[r3.symbol(this.done,this.aborted),p.bold(this.msg),r3.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=p.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.value),this.out.write(this.clear+D),this.clear=t3(D,this.out.columns)}}o3.exports=s3});var E8=O((yA,C8)=>{var pD=W(),H4=CD(),{erase:O4,cursor:e3}=N(),{style:Y0,clear:D8,figures:W0,wrap:Z4,entriesToDisplay:z4}=g(),u8=(D,u)=>D[u]&&(D[u].value||D[u].title||D[u]),f4=(D,u)=>D[u]&&(D[u].title||D[u].value||D[u]),J4=(D,u)=>{const F=D.findIndex((C)=>C.value===u||C.title===u);return F>-1?F:void 0};class F8 extends H4{constructor(D={}){super(D);this.msg=D.message,this.suggest=D.suggest,this.choices=D.choices,this.initial=typeof D.initial==="number"?D.initial:J4(D.choices,D.initial),this.select=this.initial||D.cursor||0,this.i18n={noMatches:D.noMatches||"no matches found"},this.fallback=D.fallback||this.initial,this.clearFirst=D.clearFirst||!1,this.suggestions=[],this.input="",this.limit=D.limit||10,this.cursor=0,this.transform=Y0.render(D.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=D8("",this.out.columns),this.complete(this.render),this.render()}set fallback(D){this._fb=Number.isSafeInteger(parseInt(D))?parseInt(D):D}get fallback(){let D;if(typeof this._fb==="number")D=this.choices[this._fb];else if(typeof this._fb==="string")D={title:this._fb};return D||this._fb||{title:this.i18n.noMatches}}moveSelect(D){if(this.select=D,this.suggestions.length>0)this.value=u8(this.suggestions,D);else this.value=this.fallback.value;this.fire()}async complete(D){const u=this.completing=this.suggest(this.input,this.choices),F=await u;if(this.completing!==u)return;this.suggestions=F.map((E,B,A)=>({title:f4(A,B),value:u8(A,B),description:E.description})),this.completing=!1;const C=Math.max(F.length-1,0);this.moveSelect(Math.min(C,this.select)),D&&D()}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=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,u){let F=this.input.slice(0,this.cursor),C=this.input.slice(this.cursor);this.input=`${F}${D}${C}`,this.cursor=F.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let D=this.input.slice(0,this.cursor-1),u=this.input.slice(this.cursor);this.input=`${D}${u}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let D=this.input.slice(0,this.cursor),u=this.input.slice(this.cursor+1);this.input=`${D}${u}`,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(D,u,F,C){let E,B=F?W0.arrowUp:C?W0.arrowDown:" ",A=u?pD.cyan().underline(D.title):D.title;if(B=(u?pD.cyan(W0.pointer)+" ":" ")+B,D.description){if(E=` - ${D.description}`,B.length+A.length+E.length>=this.out.columns||D.description.split(/\r?\n/).length>1)E="\n"+Z4(D.description,{margin:3,width:this.out.columns})}return B+" "+A+pD.gray(E||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(e3.hide);else this.out.write(D8(this.outputText,this.out.columns));super.render();let{startIndex:D,endIndex:u}=z4(this.select,this.choices.length,this.limit);if(this.outputText=[Y0.symbol(this.done,this.aborted,this.exited),pD.bold(this.msg),Y0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const F=this.suggestions.slice(D,u).map((C,E)=>this.renderOption(C,this.select===E+D,E===0&&D>0,E+D===u-1&&u<this.choices.length)).join("\n");this.outputText+="\n"+(F||pD.gray(this.fallback.title))}this.out.write(O4.line+e3.to(0)+this.outputText)}}C8.exports=F8});var _8=O((cA,$8)=>{var BD=W(),{cursor:K4}=N(),Q4=G0(),{clear:B8,style:A8,figures:VD}=g();class h8 extends Q4{constructor(D={}){D.overrideRender=!0;super(D);this.inputValue="",this.clear=B8("",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=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){const D=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((F)=>{if(this.inputValue){if(typeof F.title==="string"){if(F.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof F.value==="string"){if(F.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});const u=this.filteredOptions.findIndex((F)=>F===D);this.cursor=u<0?0:u,this.render()}handleSpaceToggle(){const D=this.filteredOptions[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((u)=>u.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}handleInputChange(D){this.inputValue=this.inputValue+D,this.updateFilteredOptions()}_(D,u){if(D===" ")this.handleSpaceToggle();else this.handleInputChange(D)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
10
+ Instructions:
11
+ ${VD.arrowUp}/${VD.arrowDown}: Highlight option
12
+ ${VD.arrowLeft}/${VD.arrowRight}/[space]: Toggle selection
13
+ [a,b,c]/delete: Filter choices
14
+ enter/return: Complete answer
15
+ `}return""}renderCurrentInput(){return`
16
+ Filtered results for: ${this.inputValue?this.inputValue:BD.gray("Enter something to filter")}\n`}renderOption(D,u,F){let C;if(u.disabled)C=D===F?BD.gray().underline(u.title):BD.strikethrough().gray(u.title);else C=D===F?BD.cyan().underline(u.title):u.title;return(u.selected?BD.green(VD.radioOn):VD.radioOff)+" "+C}renderDoneOrInstructions(){if(this.done)return this.value.filter((u)=>u.selected).map((u)=>u.title).join(", ");const D=[BD.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)D.push(BD.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(K4.hide);super.render();let D=[A8.symbol(this.done,this.aborted),BD.bold(this.msg),A8.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=BD.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+D),this.clear=B8(D,this.out.columns)}}$8.exports=h8});var z8=O((mA,Z8)=>{var U8=W(),X4=CD(),{style:M8,clear:G4}=g(),{erase:Y4,cursor:H8}=N();class O8 extends X4{constructor(D={}){super(D);this.msg=D.message,this.value=D.initial,this.initialValue=!!D.initial,this.yesMsg=D.yes||"yes",this.yesOption=D.yesOption||"(Y/n)",this.noMsg=D.no||"no",this.noOption=D.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,u){if(D.toLowerCase()==="y")return this.value=!0,this.submit();if(D.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(H8.hide);else this.out.write(G4(this.outputText,this.out.columns));super.render(),this.outputText=[M8.symbol(this.done,this.aborted),U8.bold(this.msg),M8.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:U8.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Y4.line+H8.to(0)+this.outputText)}}Z8.exports=O8});var J8=O((nA,f8)=>{f8.exports={TextPrompt:o1(),SelectPrompt:C3(),TogglePrompt:$3(),DatePrompt:m3(),NumberPrompt:p3(),MultiselectPrompt:G0(),AutocompletePrompt:E8(),AutocompleteMultiselectPrompt:_8(),ConfirmPrompt:z8()}});var Q8=O((K8)=>{function t(D,u,F={}){return new Promise((C,E)=>{const B=new W4[D](u),A=F.onAbort||Vu,h=F.onSubmit||Vu,$=F.onExit||Vu;B.on("state",u.onState||Vu),B.on("submit",(_)=>C(h(_))),B.on("exit",(_)=>C($(_))),B.on("abort",(_)=>E(A(_)))})}var P=K8,W4=J8(),Vu=(D)=>D;P.text=(D)=>t("TextPrompt",D);P.password=(D)=>{return D.style="password",P.text(D)};P.invisible=(D)=>{return D.style="invisible",P.text(D)};P.number=(D)=>t("NumberPrompt",D);P.date=(D)=>t("DatePrompt",D);P.confirm=(D)=>t("ConfirmPrompt",D);P.list=(D)=>{const u=D.separator||",";return t("TextPrompt",D,{onSubmit:(F)=>F.split(u).map((C)=>C.trim())})};P.toggle=(D)=>t("TogglePrompt",D);P.select=(D)=>t("SelectPrompt",D);P.multiselect=(D)=>{D.choices=[].concat(D.choices||[]);const u=(F)=>F.filter((C)=>C.selected).map((C)=>C.value);return t("MultiselectPrompt",D,{onAbort:u,onSubmit:u})};P.autocompleteMultiselect=(D)=>{D.choices=[].concat(D.choices||[]);const u=(F)=>F.filter((C)=>C.selected).map((C)=>C.value);return t("AutocompleteMultiselectPrompt",D,{onAbort:u,onSubmit:u})};var R4=(D,u)=>Promise.resolve(u.filter((F)=>F.title.slice(0,D.length).toLowerCase()===D.toLowerCase()));P.autocomplete=(D)=>{return D.suggest=D.suggest||R4,D.choices=[].concat(D.choices||[]),t("AutocompletePrompt",D)}});var Y8=O((iA,G8)=>{async function MD(D=[],{onSubmit:u=X8,onCancel:F=X8}={}){const C={},E=MD._override||{};D=[].concat(D);let B,A,h,$,_,M;const H=async(U,Z,J=!1)=>{if(!J&&U.validate&&U.validate(Z)!==!0)return;return U.format?await U.format(Z,C):Z};for(A of D){if({name:$,type:_}=A,typeof _==="function")_=await _(B,{...C},A),A.type=_;if(!_)continue;for(let U in A){if(N4.includes(U))continue;let Z=A[U];A[U]=typeof Z==="function"?await Z(B,{...C},M):Z}if(M=A,typeof A.message!=="string")throw new Error("prompt message is required");if({name:$,type:_}=A,R0[_]===void 0)throw new Error(`prompt type (${_}) is not defined`);if(E[A.name]!==void 0){if(B=await H(A,E[A.name]),B!==void 0){C[$]=B;continue}}try{B=MD._injected?V4(MD._injected,A.initial):await R0[_](A),C[$]=B=await H(A,B,!0),h=await u(A,B,C)}catch(U){h=!await F(A,C)}if(h)return C}return C}function V4(D,u){const F=D.shift();if(F instanceof Error)throw F;return F===void 0?u:F}function L4(D){MD._injected=(MD._injected||[]).concat(D)}function w4(D){MD._override=Object.assign({},D)}var R0=Q8(),N4=["suggest","format","onState","validate","onRender","type"],X8=()=>{};G8.exports=Object.assign(MD,{prompt:MD,prompts:R0,inject:L4,override:w4})});var R8=O((aA,W8)=>{function q4(D){D=(Array.isArray(D)?D:D.split(".")).map(Number);let u=0,F=process.versions.node.split(".").map(Number);for(;u<D.length;u++){if(F[u]>D[u])return!1;if(D[u]>F[u])return!0}return!1}W8.exports=q4("8.6.0")?I1():Y8()});var pC=O((h$,L9)=>{L9.exports={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","❤️ "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\____________▌","▐_|\___________▌","▐__|\__________▌","▐___|\_________▌","▐____|\________▌","▐_____|\_______▌","▐______|\______▌","▐_______|\_____▌","▐________|\____▌","▐_________|\___▌","▐__________|\__▌","▐___________|\_▌","▐____________|\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]}}});var c0=O(($$,rC)=>{var vu=Object.assign({},pC()),tC=Object.keys(vu);Object.defineProperty(vu,"random",{get(){const D=Math.floor(Math.random()*tC.length),u=tC[D];return vu[u]}});rC.exports=vu});import M6 from"process";import GE from"fs";import YE from"fs/promises";import GD from"path";import WE from"process";var DF=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun"],au={"bun.lockb":"bun","pnpm-lock.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"};async function FF({cwd:D,onUnknown:u}={}){for(let F of RE(D)){for(let E of Object.keys(au))if(await CF(GD.join(F,E))){const B=au[E],A=await uF(GD.join(F,"package.json"),u);if(A)return A;else return{name:B,agent:B}}const C=await uF(GD.join(F,"package.json"),u);if(C)return C}return null}function*RE(D=WE.cwd()){let u=GD.resolve(D);const{root:F}=GD.parse(u);while(u&&u!==F)yield u,u=GD.dirname(u)}async function uF(D,u){if(!D||!await CF(D))return null;try{const F=JSON.parse(GE.readFileSync(D,"utf8"));let C;if(typeof F.packageManager==="string"){const[E,B]=F.packageManager.replace(/^\^/,"").split("@");let A=B;if(E==="yarn"&&Number.parseInt(B)>1)return C="yarn@berry",A="berry",{name:E,agent:C,version:A};else if(E==="pnpm"&&Number.parseInt(B)<7)return C="pnpm@6",{name:E,agent:C,version:A};else if(DF.includes(E))return C=E,{name:E,agent:C,version:A};else return u?.(F.packageManager)??null}}catch{}return null}async function CF(D){try{if((await YE.stat(D)).isFile())return!0}catch{}return!1}async function H6(D=M6.cwd()){return(await FF({cwd:D,onUnknown(F){console.warn("[@antfu/install-pkg] Unknown packageManager:",F);return}}))?.agent||null}import{existsSync as O6}from"fs";import Z6 from"process";import{resolve as z6}from"path";import{createRequire as NE}from"module";import{spawn as iE}from"child_process";import{normalize as aE}from"path";import{cwd as pE}from"process";import{delimiter as EF,resolve as tE,dirname as rE}from"path";function oE(D){for(let u in D){if(!Object.prototype.hasOwnProperty.call(D,u)||!sE.test(u))continue;let F=D[u];return F?{key:u,value:F}:BF}return BF}function eE(D,u){let F=u.value.split(EF),C=D,E;do F.push(tE(C,"node_modules",".bin")),E=C,C=rE(C);while(C!==E);return{key:u.key,value:F.join(EF)}}function D6(D,u){let F={...process.env,...u},C=eE(D,oE(F));return F[C.key]=C.value,F}import{PassThrough as u6}from"stream";import E6 from"readline";function h6(D,u){return{command:aE(D),args:u??[]}}function $6(D){let u=new AbortController;for(let F of D){if(F.aborted)return u.abort(),F;let C=()=>{u.abort(F.reason)};F.addEventListener("abort",C,{signal:u.signal})}return u.signal}var YD=NE(import.meta.url),VE=Object.create,hF=Object.defineProperty,LE=Object.getOwnPropertyDescriptor,wE=Object.getOwnPropertyNames,qE=Object.getPrototypeOf,IE=Object.prototype.hasOwnProperty,hD=((D)=>typeof YD<"u"?YD:typeof Proxy<"u"?new Proxy(D,{get:(u,F)=>(typeof YD<"u"?YD:u)[F]}):D)(function(D){if(typeof YD<"u")return YD.apply(this,arguments);throw Error('Dynamic require of "'+D+'" is not supported')}),T=(D,u)=>()=>(u||D((u={exports:{}}).exports,u),u.exports),jE=(D,u,F,C)=>{if(u&&typeof u=="object"||typeof u=="function")for(let E of wE(u))!IE.call(D,E)&&E!==F&&hF(D,E,{get:()=>u[E],enumerable:!(C=LE(u,E))||C.enumerable});return D},SE=(D,u,F)=>(F=D!=null?VE(qE(D)):{},jE(u||!D||!D.__esModule?hF(F,"default",{value:D,enumerable:!0}):F,D)),PE=T((D,u)=>{u.exports=B,B.sync=A;var F=hD("fs");function C(h,$){var _=$.pathExt!==void 0?$.pathExt:process.env.PATHEXT;if(!_||(_=_.split(";"),_.indexOf("")!==-1))return!0;for(var M=0;M<_.length;M++){var H=_[M].toLowerCase();if(H&&h.substr(-H.length).toLowerCase()===H)return!0}return!1}function E(h,$,_){return!h.isSymbolicLink()&&!h.isFile()?!1:C($,_)}function B(h,$,_){F.stat(h,function(M,H){_(M,M?!1:E(H,h,$))})}function A(h,$){return E(F.statSync(h),h,$)}}),TE=T((D,u)=>{u.exports=C,C.sync=E;var F=hD("fs");function C(h,$,_){F.stat(h,function(M,H){_(M,M?!1:B(H,$))})}function E(h,$){return B(F.statSync(h),$)}function B(h,$){return h.isFile()&&A(h,$)}function A(h,$){var{mode:_,uid:M,gid:H}=h,U=$.uid!==void 0?$.uid:process.getuid&&process.getuid(),Z=$.gid!==void 0?$.gid:process.getgid&&process.getgid(),J=parseInt("100",8),X=parseInt("010",8),w=parseInt("001",8),q=J|X,b=_&w||_&X&&H===Z||_&J&&M===U||_&q&&U===0;return b}}),bE=T((D,u)=>{var F=hD("fs"),C;process.platform==="win32"||global.TESTING_WINDOWS?C=PE():C=TE(),u.exports=E,E.sync=B;function E(A,h,$){if(typeof h=="function"&&($=h,h={}),!$){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(_,M){E(A,h||{},function(H,U){H?M(H):_(U)})})}C(A,h||{},function(_,M){_&&(_.code==="EACCES"||h&&h.ignoreErrors)&&(_=null,M=!1),$(_,M)})}function B(A,h){try{return C.sync(A,h||{})}catch($){if(h&&h.ignoreErrors||$.code==="EACCES")return!1;throw $}}}),kE=T((D,u)=>{var F=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",C=hD("path"),E=F?";":":",B=bE(),A=(M)=>Object.assign(new Error(`not found: ${M}`),{code:"ENOENT"}),h=(M,H)=>{let U=H.colon||E,Z=M.match(/\//)||F&&M.match(/\\/)?[""]:[...F?[process.cwd()]:[],...(H.path||"/home/runner/work/stacks/stacks/storage/framework/core/cli/node_modules/.bin:/home/runner/work/stacks/stacks/storage/framework/core/cli/node_modules/.bin:/home/runner/work/stacks/stacks/storage/framework/core/node_modules/.bin:/home/runner/work/stacks/stacks/storage/framework/node_modules/.bin:/home/runner/work/stacks/stacks/storage/node_modules/.bin:/home/runner/work/stacks/stacks/node_modules/.bin:/home/runner/work/stacks/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/runner/work/stacks/stacks/storage/framework/core/cli/node_modules/.bin:/home/runner/work/stacks/stacks/storage/framework/core/node_modules/.bin:/home/runner/work/stacks/stacks/storage/framework/node_modules/.bin:/home/runner/work/stacks/stacks/storage/node_modules/.bin:/home/runner/work/stacks/stacks/node_modules/.bin:/home/runner/work/stacks/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.17.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/.bun/bin:/opt/hostedtoolcache/node/20.17.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(U)],J=F?H.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=F?J.split(U):[""];return F&&M.indexOf(".")!==-1&&X[0]!==""&&X.unshift(""),{pathEnv:Z,pathExt:X,pathExtExe:J}},$=(M,H,U)=>{typeof H=="function"&&(U=H,H={}),H||(H={});let{pathEnv:Z,pathExt:J,pathExtExe:X}=h(M,H),w=[],q=(j)=>new Promise((OD,o)=>{if(j===Z.length)return H.all&&w.length?OD(w):o(A(M));let x=Z[j],mu=/^".*"$/.test(x)?x.slice(1,-1):x,XD=C.join(mu,M),nu=!mu&&/^\.[\\\/]/.test(M)?M.slice(0,2)+XD:XD;OD(b(nu,j,0))}),b=(j,OD,o)=>new Promise((x,mu)=>{if(o===J.length)return x(q(OD+1));let XD=J[o];B(j+XD,{pathExt:X},(nu,zE)=>{if(!nu&&zE)if(H.all)w.push(j+XD);else return x(j+XD);return x(b(j,OD,o+1))})});return U?q(0).then((j)=>U(null,j),U):q(0)},_=(M,H)=>{H=H||{};let{pathEnv:U,pathExt:Z,pathExtExe:J}=h(M,H),X=[];for(let w=0;w<U.length;w++){let q=U[w],b=/^".*"$/.test(q)?q.slice(1,-1):q,j=C.join(b,M),OD=!b&&/^\.[\\\/]/.test(M)?M.slice(0,2)+j:j;for(let o=0;o<Z.length;o++){let x=OD+Z[o];try{if(B.sync(x,{pathExt:J}))if(H.all)X.push(x);else return x}catch{}}}if(H.all&&X.length)return X;if(H.nothrow)return null;throw A(M)};u.exports=$,$.sync=_}),dE=T((D,u)=>{var F=(C={})=>{let E=C.env||process.env;return(C.platform||process.platform)!=="win32"?"PATH":Object.keys(E).reverse().find((B)=>B.toUpperCase()==="PATH")||"Path"};u.exports=F,u.exports.default=F}),xE=T((D,u)=>{var F=hD("path"),C=kE(),E=dE();function B(h,$){let _=h.options.env||process.env,M=process.cwd(),H=h.options.cwd!=null,U=H&&process.chdir!==void 0&&!process.chdir.disabled;if(U)try{process.chdir(h.options.cwd)}catch{}let Z;try{Z=C.sync(h.command,{path:_[E({env:_})],pathExt:$?F.delimiter:void 0})}catch{}finally{U&&process.chdir(M)}return Z&&(Z=F.resolve(H?h.options.cwd:"",Z)),Z}function A(h){return B(h)||B(h,!0)}u.exports=A}),vE=T((D,u)=>{var F=/([()\][%!^"`<>&|;, *?])/g;function C(B){return B=B.replace(F,"^$1"),B}function E(B,A){return B=`${B}`,B=B.replace(/(\\*)"/g,'$1$1\\"'),B=B.replace(/(\\*)$/,"$1$1"),B=`"${B}"`,B=B.replace(F,"^$1"),A&&(B=B.replace(F,"^$1")),B}u.exports.command=C,u.exports.argument=E}),gE=T((D,u)=>{u.exports=/^#!(.*)/}),yE=T((D,u)=>{var F=gE();u.exports=(C="")=>{let E=C.match(F);if(!E)return null;let[B,A]=E[0].replace(/#! ?/,"").split(" "),h=B.split("/").pop();return h==="env"?A:A?`${h} ${A}`:h}}),cE=T((D,u)=>{var F=hD("fs"),C=yE();function E(B){let A=Buffer.alloc(150),h;try{h=F.openSync(B,"r"),F.readSync(h,A,0,150,0),F.closeSync(h)}catch{}return C(A.toString())}u.exports=E}),mE=T((D,u)=>{var F=hD("path"),C=xE(),E=vE(),B=cE(),A=process.platform==="win32",h=/\.(?:com|exe)$/i,$=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function _(U){U.file=C(U);let Z=U.file&&B(U.file);return Z?(U.args.unshift(U.file),U.command=Z,C(U)):U.file}function M(U){if(!A)return U;let Z=_(U),J=!h.test(Z);if(U.options.forceShell||J){let X=$.test(Z);U.command=F.normalize(U.command),U.command=E.command(U.command),U.args=U.args.map((q)=>E.argument(q,X));let w=[U.command].concat(U.args).join(" ");U.args=["/d","/s","/c",`"${w}"`],U.command=process.env.comspec||"cmd.exe",U.options.windowsVerbatimArguments=!0}return U}function H(U,Z,J){Z&&!Array.isArray(Z)&&(J=Z,Z=null),Z=Z?Z.slice(0):[],J=Object.assign({},J);let X={command:U,args:Z,options:J,file:void 0,original:{command:U,args:Z}};return J.shell?X:M(X)}u.exports=H}),nE=T((D,u)=>{var F=process.platform==="win32";function C(h,$){return Object.assign(new Error(`${$} ${h.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${$} ${h.command}`,path:h.command,spawnargs:h.args})}function E(h,$){if(!F)return;let _=h.emit;h.emit=function(M,H){if(M==="exit"){let U=B(H,$,"spawn");if(U)return _.call(h,"error",U)}return _.apply(h,arguments)}}function B(h,$){return F&&h===1&&!$.file?C($.original,"spawn"):null}function A(h,$){return F&&h===1&&!$.file?C($.original,"spawnSync"):null}u.exports={hookChildProcess:E,verifyENOENT:B,verifyENOENTSync:A,notFoundError:C}}),lE=T((D,u)=>{var F=hD("child_process"),C=mE(),E=nE();function B(h,$,_){let M=C(h,$,_),H=F.spawn(M.command,M.args,M.options);return E.hookChildProcess(H,M),H}function A(h,$,_){let M=C(h,$,_),H=F.spawnSync(M.command,M.args,M.options);return H.error=H.error||E.verifyENOENTSync(H.status,M),H}u.exports=B,u.exports.spawn=B,u.exports.sync=A,u.exports._parse=C,u.exports._enoent=E}),sE=/^path$/i,BF={key:"PATH",value:""},F6=(D)=>{let u=D.length,F=new u6,C=()=>{--u===0&&F.emit("end")};for(let E of D)E.pipe(F,{end:!1}),E.on("end",C);return F},C6=SE(lE(),1),AF=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(D,u){super(`Process exited with non-zero status (${D.exitCode})`),this.result=D,this.output=u}},B6={timeout:void 0,persist:!1},A6={windowsHide:!0},_6=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(D,u,F){this._options={...B6,...F},this._command=D,this._args=u??[],this._processClosed=new Promise((C)=>{this._resolveClose=C})}kill(D){return this._process?.kill(D)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(D,u,F){return U6(D,u,{...F,stdin:this})}async*[Symbol.asyncIterator](){let D=this._process;if(!D)return;let u=[];this._streamErr&&u.push(this._streamErr),this._streamOut&&u.push(this._streamOut);let F=F6(u),C=E6.createInterface({input:F});for await(let E of C)yield E.toString();if(await this._processClosed,D.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new AF(this)}async _waitForOutput(){let D=this._process;if(!D)throw new Error("No process was started");let u="",F="";if(this._streamErr)for await(let E of this._streamErr)u+=E.toString();if(this._streamOut)for await(let E of this._streamOut)F+=E.toString();if(await this._processClosed,this._options?.stdin&&await this._options.stdin,D.removeAllListeners(),this._thrownError)throw this._thrownError;let C={stderr:u,stdout:F};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new AF(this,C);return C}then(D,u){return this._waitForOutput().then(D,u)}_streamOut;_streamErr;spawn(){let D=pE(),u=this._options,F={...A6,...u.nodeOptions},C=[];this._resetState(),u.timeout!==void 0&&C.push(AbortSignal.timeout(u.timeout)),u.signal!==void 0&&C.push(u.signal),u.persist===!0&&(F.detached=!0),C.length>0&&(F.signal=$6(C)),F.env=D6(D,F.env);let{command:E,args:B}=h6(this._command,this._args),A=C6._parse(E,B,F),h=iE(A.command,A.args,A.options);if(h.stderr&&(this._streamErr=h.stderr),h.stdout&&(this._streamOut=h.stdout),this._process=h,h.once("error",this._onError),h.once("close",this._onClose),u.stdin!==void 0&&h.stdin&&u.stdin.process){let{stdout:$}=u.stdin.process;$&&$.pipe(h.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise((D)=>{this._resolveClose=D}),this._thrownError=void 0}_onError=(D)=>{if(D.name==="AbortError"&&(!(D.cause instanceof Error)||D.cause.name!=="TimeoutError")){this._aborted=!0;return}this._thrownError=D};_onClose=()=>{this._resolveClose&&this._resolveClose()}},pu=(D,u,F)=>{let C=new _6(D,u,F);return C.spawn(),C},U6=pu;async function dD(D,u={}){const F=u.packageManager||await H6(u.cwd)||"npm",[C]=F.split("@");if(!Array.isArray(D))D=[D];const E=u.additionalArgs||[];if(u.preferOffline)if(F==="yarn@berry")E.unshift("--cached");else E.unshift("--prefer-offline");if(C==="pnpm"&&O6(z6(u.cwd??Z6.cwd(),"pnpm-workspace.yaml")))E.unshift("-w");return pu(C,[C==="yarn"?"add":"install",u.dev?"-D":"",...E,...D].filter(Boolean),{nodeOptions:{stdio:u.silent?"ignore":"inherit",cwd:u.cwd},throwOnError:!0})}async function N5(D,u){if(u)return await dD(D,u);return await dD(D,{silent:!0})}async function V5(D,u){if(u)return await dD(`@stacksjs/${D}`,u);return await dD(`@stacksjs/${D}`,{silent:!0})}import{EventEmitter as f6}from"events";function tu(D){return D==null?[]:Array.isArray(D)?D:[D]}function J6(D,u,F,C){var E,B=D[u],A=~C.string.indexOf(u)?F==null||F===!0?"":String(F):typeof F==="boolean"?F:~C.boolean.indexOf(u)?F==="false"?!1:F==="true"||(D._.push((E=+F,E*0===0)?E:F),!!F):(E=+F,E*0===0)?E:F;D[u]=B==null?A:Array.isArray(B)?B.concat(A):[B,A]}function K6(D,u){D=D||[],u=u||{};var F,C,E,B,A,h={_:[]},$=0,_=0,M=0,H=D.length;const U=u.alias!==void 0,Z=u.unknown!==void 0,J=u.default!==void 0;if(u.alias=u.alias||{},u.string=tu(u.string),u.boolean=tu(u.boolean),U)for(F in u.alias){C=u.alias[F]=tu(u.alias[F]);for($=0;$<C.length;$++)(u.alias[C[$]]=C.concat(F)).splice($,1)}for($=u.boolean.length;$-- >0;){C=u.alias[u.boolean[$]]||[];for(_=C.length;_-- >0;)u.boolean.push(C[_])}for($=u.string.length;$-- >0;){C=u.alias[u.string[$]]||[];for(_=C.length;_-- >0;)u.string.push(C[_])}if(J){for(F in u.default)if(B=typeof u.default[F],C=u.alias[F]=u.alias[F]||[],u[B]!==void 0){u[B].push(F);for($=0;$<C.length;$++)u[B].push(C[$])}}const X=Z?Object.keys(u.alias):[];for($=0;$<H;$++){if(E=D[$],E==="--"){h._=h._.concat(D.slice(++$));break}for(_=0;_<E.length;_++)if(E.charCodeAt(_)!==45)break;if(_===0)h._.push(E);else if(E.substring(_,_+3)==="no-"){if(B=E.substring(_+3),Z&&!~X.indexOf(B))return u.unknown(E);h[B]=!1}else{for(M=_+1;M<E.length;M++)if(E.charCodeAt(M)===61)break;B=E.substring(_,M),A=E.substring(++M)||($+1===H||(""+D[$+1]).charCodeAt(0)===45||D[++$]),C=_===2?[B]:B;for(M=0;M<C.length;M++){if(B=C[M],Z&&!~X.indexOf(B))return u.unknown("-".repeat(_)+B);J6(h,B,M+1<C.length||A,u)}}}if(J){for(F in u.default)if(h[F]===void 0)h[F]=u.default[F]}if(U)for(F in h){C=u.alias[F]||[];while(C.length>0)h[C.shift()]=h[F]}return h}var UF=(D)=>D.replace(/[<[].+/,"").trim(),Q6=(D)=>{const u=/<([^>]+)>/g,F=/\[([^\]]+)\]/g,C=[],E=(h)=>{let $=!1,_=h[1];if(_.startsWith("..."))_=_.slice(3),$=!0;return{required:h[0].startsWith("<"),value:_,variadic:$}};let B;while(B=u.exec(D))C.push(E(B));let A;while(A=F.exec(D))C.push(E(A));return C},X6=(D)=>{const u={alias:{},boolean:[]};for(let[F,C]of D.entries()){if(C.names.length>1)u.alias[C.names[0]]=C.names.slice(1);if(C.isBoolean)if(C.negated){if(!D.some((B,A)=>{return A!==F&&B.names.some((h)=>C.names.includes(h))&&typeof B.required==="boolean"}))u.boolean.push(C.names[0])}else u.boolean.push(C.names[0])}return u},$F=(D)=>{return D.sort((u,F)=>{return u.length>F.length?-1:1})[0]},_F=(D,u)=>{return D.length>=u?D:`${D}${" ".repeat(u-D.length)}`},G6=(D)=>{return D.replace(/([a-z])-([a-z])/g,(u,F,C)=>{return F+C.toUpperCase()})},Y6=(D,u,F)=>{let C=0,E=u.length,B=D,A;for(;C<E;++C)A=B[u[C]],B=B[u[C]]=C===E-1?F:A!=null?A:!!~u[C+1].indexOf(".")||!(+u[C+1]>-1)?{}:[]},W6=(D,u)=>{for(let F of Object.keys(u)){const C=u[F];if(C.shouldTransform){if(D[F]=Array.prototype.concat.call([],D[F]),typeof C.transformFunction==="function")D[F]=D[F].map(C.transformFunction)}}},R6=(D)=>{const u=/([^\\\/]+)$/.exec(D);return u?u[1]:""},MF=(D)=>{return D.split(".").map((u,F)=>{return F===0?G6(u):u}).join(".")};class $u extends Error{constructor(D){super(D);if(this.name=this.constructor.name,typeof Error.captureStackTrace==="function")Error.captureStackTrace(this,this.constructor);else this.stack=new Error(D).stack}}class HF{constructor(D,u,F){if(this.rawName=D,this.description=u,this.config=Object.assign({},F),D=D.replace(/\.\*/g,""),this.negated=!1,this.names=UF(D).split(",").map((C)=>{let E=C.trim().replace(/^-{1,2}/,"");if(E.startsWith("no-"))this.negated=!0,E=E.replace(/^no-/,"");return MF(E)}).sort((C,E)=>C.length>E.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null)this.config.default=!0;if(D.includes("<"))this.required=!0;else if(D.includes("["))this.required=!1;else this.isBoolean=!0}}var N6=process.argv,V6=`${process.platform}-${process.arch} node-${process.version}`;class ru{constructor(D,u,F={},C){this.rawName=D,this.description=u,this.config=F,this.cli=C,this.options=[],this.aliasNames=[],this.name=UF(D),this.args=Q6(D),this.examples=[]}usage(D){return this.usageText=D,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(D,u="-v, --version"){return this.versionNumber=D,this.option(u,"Display version number"),this}example(D){return this.examples.push(D),this}option(D,u,F){const C=new HF(D,u,F);return this.options.push(C),this}alias(D){return this.aliasNames.push(D),this}action(D){return this.commandAction=D,this}isMatched(D){return this.name===D||this.aliasNames.includes(D)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof su}hasOption(D){return D=D.split(".")[0],this.options.find((u)=>{return u.names.includes(D)})}outputHelp(){const{name:D,commands:u}=this.cli,{versionNumber:F,options:C,helpCallback:E}=this.cli.globalCommand;let B=[{body:`${D}${F?`/${F}`:""}`}];if(B.push({title:"Usage",body:` \$ ${D} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&u.length>0){const $=$F(u.map((_)=>_.rawName));B.push({title:"Commands",body:u.map((_)=>{return` ${_F(_.rawName,$.length)} ${_.description}`}).join("\n")}),B.push({title:"For more info, run any command with the \`--help\` flag",body:u.map((_)=>` \$ ${D}${_.name===""?"":` ${_.name}`} --help`).join("\n")})}let h=this.isGlobalCommand?C:[...this.options,...C||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand)h=h.filter(($)=>$.name!=="version");if(h.length>0){const $=$F(h.map((_)=>_.rawName));B.push({title:"Options",body:h.map((_)=>{return` ${_F(_.rawName,$.length)} ${_.description} ${_.config.default===void 0?"":`(default: ${_.config.default})`}`}).join("\n")})}if(this.examples.length>0)B.push({title:"Examples",body:this.examples.map(($)=>{if(typeof $==="function")return $(D);return $}).join("\n")});if(E)B=E(B)||B;console.log(B.map(($)=>{return $.title?`${$.title}:
17
+ ${$.body}`:$.body}).join("\n\n"))}outputVersion(){const{name:D}=this.cli,{versionNumber:u}=this.cli.globalCommand;if(u)console.log(`${D}/${u} ${V6}`)}checkRequiredArgs(){const D=this.args.filter((u)=>u.required).length;if(this.cli.args.length<D)throw new $u(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){const{options:D,globalCommand:u}=this.cli;if(!this.config.allowUnknownOptions){for(let F of Object.keys(D))if(F!=="--"&&!this.hasOption(F)&&!u.hasOption(F))throw new $u(`Unknown option \`${F.length>1?`--${F}`:`-${F}`}\``)}}checkOptionValue(){const{options:D,globalCommand:u}=this.cli,F=[...u.options,...this.options];for(let C of F){const E=D[C.name.split(".")[0]];if(C.required){const B=F.some((A)=>A.negated&&A.names.includes(C.name));if(E===!0||E===!1&&!B)throw new $u(`option \`${C.rawName}\` value is missing`)}}}}class su extends ru{constructor(D){super("@@global@@","",{},D)}}var hu=Object.assign;class ou extends f6{constructor(D=""){super();this.name=D,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new su(this),this.globalCommand.usage("<command> [options]")}usage(D){return this.globalCommand.usage(D),this}command(D,u,F){const C=new ru(D,u||"",F,this);return C.globalCommand=this.globalCommand,this.commands.push(C),C}option(D,u,F){return this.globalCommand.option(D,u,F),this}help(D){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=D,this.showHelpOnExit=!0,this}version(D,u="-v, --version"){return this.globalCommand.version(D,u),this.showVersionOnExit=!0,this}example(D){return this.globalCommand.example(D),this}outputHelp(){if(this.matchedCommand)this.matchedCommand.outputHelp();else this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:D,options:u},F,C){if(this.args=D,this.options=u,F)this.matchedCommand=F;if(C)this.matchedCommandName=C;return this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(D=N6,{run:u=!0}={}){if(this.rawArgs=D,!this.name)this.name=D[1]?R6(D[1]):"cli";let F=!0;for(let E of this.commands){const B=this.mri(D.slice(2),E),A=B.args[0];if(E.isMatched(A)){F=!1;const h=hu(hu({},B),{args:B.args.slice(1)});this.setParsedInfo(h,E,A),this.emit(`command:${A}`,E)}}if(F){for(let E of this.commands)if(E.name===""){F=!1;const B=this.mri(D.slice(2),E);this.setParsedInfo(B,E),this.emit("command:!",E)}}if(F){const E=this.mri(D.slice(2));this.setParsedInfo(E)}if(this.options.help&&this.showHelpOnExit)this.outputHelp(),u=!1,this.unsetMatchedCommand();if(this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null)this.outputVersion(),u=!1,this.unsetMatchedCommand();const C={args:this.args,options:this.options};if(u)this.runMatchedCommand();if(!this.matchedCommand&&this.args[0])this.emit("command:*");return C}mri(D,u){const F=[...this.globalCommand.options,...u?u.options:[]],C=X6(F);let E=[];const B=D.indexOf("--");if(B>-1)E=D.slice(B+1),D=D.slice(0,B);let A=K6(D,C);A=Object.keys(A).reduce((H,U)=>{return hu(hu({},H),{[MF(U)]:A[U]})},{_:[]});const h=A._,$={"--":E},_=u&&u.config.ignoreOptionDefaultValue?u.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue;let M=Object.create(null);for(let H of F){if(!_&&H.config.default!==void 0)for(let U of H.names)$[U]=H.config.default;if(Array.isArray(H.config.type)){if(M[H.name]===void 0)M[H.name]=Object.create(null),M[H.name].shouldTransform=!0,M[H.name].transformFunction=H.config.type[0]}}for(let H of Object.keys(A))if(H!=="_"){const U=H.split(".");Y6($,U,A[H]),W6($,M)}return{args:h,options:$}}runMatchedCommand(){const{args:D,options:u,matchedCommand:F}=this;if(!F||!F.commandAction)return;F.checkUnknownOptions(),F.checkOptionValue(),F.checkRequiredArgs();const C=[];return F.args.forEach((E,B)=>{if(E.variadic)C.push(D.slice(B));else C.push(D[B])}),C.push(u),F.commandAction.apply(this,C)}}function P5(D,u){if(typeof D==="object")u=D,D=u.name;return new ou(D||"buddy")}import{ExitCode as p4}from"@stacksjs/types";var I4=iu(R8(),1);import{log as I}from"@stacksjs/logging";import tD from"process";import{err as N8,handleError as V8,ok as j4}from"@stacksjs/error-handling";import{ExitCode as rD}from"@stacksjs/types";async function N0(D,u){const F=Array.isArray(D)?D:D.match(/(?:[^\s"]+|"[^"]*")+/g);if(!F)return N8(V8(`Failed to parse command: ${F}`,u));I.debug("exec:",Array.isArray(D)?D.join(" "):D),I.debug("cmd:",F),I.debug("exec options:",u);const C=u?.cwd||tD.cwd(),E=Bun.spawn(F,{...u,stdout:u?.silent||u?.quiet?"ignore":u?.stdin?u.stdin:u?.stdout||"inherit",stderr:u?.silent||u?.quiet?"ignore":u?.stderr||"inherit",detached:u?.background||!1,cwd:C,onExit(A,h,$,_){w8("spawn",A,h,$,_)}});if(u?.stdin==="pipe"&&u.input){if(E.stdin)E.stdin.write(u.input),E.stdin.end()}if(await E.exited===rD.Success)return j4(E);return N8(V8(`Failed to execute command: ${F.join(" ")}`))}async function L8(D,u){I.debug("Running ExecSync:",D),I.debug("ExecSync Options:",u);const F=Array.isArray(D)?D:D.match(/(?:[^\s"]+|"[^"]*")+/g);if(!F)I.error(`Failed to parse command: ${F}`,u),tD.exit(rD.FatalError);return Bun.spawnSync(F,{...u,stdin:u?.stdin??"inherit",stdout:u?.stdout??"pipe",stderr:u?.stderr??"inherit",cwd:u?.cwd??tD.cwd(),onExit(E,B,A,h){w8("spawnSync",E,B,A,h)}}).stdout.toString()}function w8(D,u,F,C,E){if(I.debug(`exitHandler: ${D}`),I.debug("subprocess",u),I.debug("exitCode",F),I.debug("signalCode",C),E)I.error(E),tD.exit(rD.FatalError);if(F!==rD.Success&&F)tD.exit(F)}import{collect as a4}from"@stacksjs/collections";var zC={};XE(zC,{yellow:()=>g8,white:()=>m8,underline:()=>T8,trueColorBg:()=>OC,trueColor:()=>HC,stripColors:()=>S8,strikethrough:()=>d8,reset:()=>P8,red:()=>v8,options:()=>wD,magenta:()=>c8,link:()=>ZC,lightYellow:()=>a8,lightRed:()=>l8,lightMagenta:()=>t8,lightGreen:()=>i8,lightGray:()=>n8,lightCyan:()=>r8,lightBlue:()=>p8,italic:()=>KD,inverse:()=>b8,hidden:()=>k8,green:()=>wu,gray:()=>oD,dim:()=>qD,cyan:()=>qu,bold:()=>JD,blue:()=>y8,black:()=>x8,bgYellow:()=>DC,bgWhite:()=>CC,bgRed:()=>o8,bgMagenta:()=>FC,bgLightYellow:()=>hC,bgLightRed:()=>BC,bgLightMagenta:()=>_C,bgLightGreen:()=>AC,bgLightGray:()=>MC,bgLightCyan:()=>UC,bgLightBlue:()=>$C,bgGreen:()=>e8,bgGray:()=>EC,bgCyan:()=>Iu,bgBlue:()=>uC,bgBlack:()=>s8,ansi256Bg:()=>L0,ansi256:()=>V0});function z(D,u,F=1){const C=`\x1B[${D}m`,E=`\x1B[${u}m`,B=new RegExp(`\\x1b\\[${u}m`,"g");return(A)=>{return wD.enabled&&wD.supportLevel>=F?C+(""+A).replace(B,C)+E:""+A}}function j8(D,u,F){if(D>>4===u>>4&&u>>4===F>>4){if(D<8)return 16;if(D>248)return 231;return Math.round((D-8)/247*24)+232}return 16+36*Math.round(D/255*5)+6*Math.round(u/255*5)+Math.round(F/255*5)}function S8(D){return(""+D).replace(/\x1b\[[0-9;]+m/g,"").replace(/\x1b\]8;;.*?\x07(.*?)\x1b\]8;;\x07/g,(u,F)=>F)}function ZC(D,u){return wD.enabled?q8+"8"+Lu+Lu+u+I8+D+q8+"8"+Lu+Lu+I8:`${D} (\u200B${u}\u200B)`}var fD=!0,LD=typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{},sD=0;if(LD.process&&LD.process.env&&LD.process.stdout){const{FORCE_COLOR:D,NODE_DISABLE_COLORS:u,NO_COLOR:F,TERM:C,COLORTERM:E}=LD.process.env;if(u||F||D==="0")fD=!1;else if(D==="1"||D==="2"||D==="3")fD=!0;else if(C==="dumb")fD=!1;else if("CI"in LD.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((B)=>(B in LD.process.env)))fD=!0;else fD=process.stdout.isTTY;if(fD)if(process.platform==="win32")sD=3;else if(E&&(E==="truecolor"||E==="24bit"))sD=3;else if(C&&(C.endsWith("-256color")||C.endsWith("256")))sD=2;else sD=1}var wD={enabled:fD,supportLevel:sD},P8=z(0,0),JD=z(1,22),qD=z(2,22),KD=z(3,23),T8=z(4,24),b8=z(7,27),k8=z(8,28),d8=z(9,29),x8=z(30,39),v8=z(31,39),wu=z(32,39),g8=z(33,39),y8=z(34,39),c8=z(35,39),qu=z(36,39),m8=z(97,39),oD=z(90,39),n8=z(37,39),l8=z(91,39),i8=z(92,39),a8=z(93,39),p8=z(94,39),t8=z(95,39),r8=z(96,39),s8=z(40,49),o8=z(41,49),e8=z(42,49),DC=z(43,49),uC=z(44,49),FC=z(45,49),Iu=z(46,49),CC=z(107,49),EC=z(100,49),BC=z(101,49),AC=z(102,49),hC=z(103,49),$C=z(104,49),_C=z(105,49),UC=z(106,49),MC=z(47,49),V0=(D)=>z("38;5;"+D,0,2),L0=(D)=>z("48;5;"+D,0,2),HC=(D,u,F)=>{return wD.supportLevel===2?V0(j8(D,u,F)):z(`38;2;${D};${u};${F}`,0,3)},OC=(D,u,F)=>{return wD.supportLevel===2?L0(j8(D,u,F)):z(`48;2;${D};${u};${F}`,0,3)},q8="\x1B]",I8="\x07",Lu=";";import*as ju from"tty";function XC(D,u,F,C,E=u.slice(0,Math.max(0,D))+C,B=u.slice(Math.max(0,D+F.length)),A=B.indexOf(F)){return E+(A<0?B:XC(A,B,F,C))}function v4(D,u,F,C,E){return D<0?F+u+C:F+XC(D,u,C,E)+C}function g4(D,u,F=D,C=D.length+1){return(E)=>E||!(E===""||E===void 0)?v4((""+E).indexOf(u,C),E,D,u,F):""}function f(D,u,F){return g4(`\x1B[${D}m`,`\x1B[${u}m`,F)}function y4(D=x4){return D?fC:Object.fromEntries(Object.keys(fC).map((u)=>[u,String]))}function q0(D,u="reset"){return w0[D]||w0[u]}function c4(D,u){return q0(D)(u)}function eD(D){return D.replace(new RegExp(m4,"g"),"")}function GC(D,u,F=" "){const C=u-D.length;if(C<=0)return D;const E=Math.floor(C/2);let B="";for(let A=0;A<u;A++)B+=A<E||A>=E+D.length?F:D[A-E];return B}function YC(D,u,F=" "){const C=u-D.length;if(C<=0)return D;let E="";for(let B=0;B<u;B++)E+=B<C?F:D[B-C];return E}function WC(D,u,F=" "){let C="";for(let E=0;E<u;E++)C+=E<D.length?D[E]:F;return C}function n4(D,u,F,C=" "){switch(D){case"left":return WC(u,F,C);case"right":return YC(u,F,C);case"center":return GC(u,F,C);default:return u}}function i4(D,u={}){const F={...u,style:{...l4,...u.style}},C=D.split("\n"),E=[],B=q0(F.style.borderColor),A={...typeof F.style.borderStyle==="string"?JC[F.style.borderStyle]||JC.solid:F.style.borderStyle};if(B)for(let Z in A)A[Z]=B(A[Z]);const h=F.style.padding%2===0?F.style.padding:F.style.padding+1,$=C.length+h,_=Math.max(...C.map((Z)=>Z.length))+h,M=_+h,H=F.style.marginLeft>0?" ".repeat(F.style.marginLeft):"";if(F.style.marginTop>0)E.push("".repeat(F.style.marginTop));if(F.title){const Z=A.h.repeat(Math.floor((_-eD(F.title).length)/2)),J=A.h.repeat(_-eD(F.title).length-eD(Z).length+h);E.push(`${H}${A.tl}${Z}${F.title}${J}${A.tr}`)}else E.push(`${H}${A.tl}${A.h.repeat(M)}${A.tr}`);const U=F.style.valign==="center"?Math.floor(($-C.length)/2):F.style.valign==="top"?$-C.length-h:$-C.length;for(let Z=0;Z<$;Z++)if(Z<U||Z>=U+C.length)E.push(`${H}${A.v}${" ".repeat(M)}${A.v}`);else{const J=C[Z-U],X=" ".repeat(h),w=" ".repeat(_-eD(J).length);E.push(`${H}${A.v}${X}${J}${w}${A.v}`)}if(E.push(`${H}${A.bl}${A.h.repeat(M)}${A.br}`),F.style.marginBottom>0)E.push("".repeat(F.style.marginBottom));return E.join("\n")}var{env:HD={},argv:KC=[],platform:S4=""}=typeof process==="undefined"?{}:process,P4="NO_COLOR"in HD||KC.includes("--no-color"),T4="FORCE_COLOR"in HD||KC.includes("--color"),b4=S4==="win32",QC=HD.TERM==="dumb",k4=ju&&ju.isatty&&ju.isatty(1)&&HD.TERM&&!QC,d4="CI"in HD&&(("GITHUB_ACTIONS"in HD)||("GITLAB_CI"in HD)||("CIRCLECI"in HD)),x4=!P4&&(T4||b4&&!QC||k4||d4),fC={reset:f(0,0),bold:f(1,22,"\x1B[22m\x1B[1m"),dim:f(2,22,"\x1B[22m\x1B[2m"),italic:f(3,23),underline:f(4,24),inverse:f(7,27),hidden:f(8,28),strikethrough:f(9,29),black:f(30,39),red:f(31,39),green:f(32,39),yellow:f(33,39),blue:f(34,39),magenta:f(35,39),cyan:f(36,39),white:f(37,39),gray:f(90,39),bgBlack:f(40,49),bgRed:f(41,49),bgGreen:f(42,49),bgYellow:f(43,49),bgBlue:f(44,49),bgMagenta:f(45,49),bgCyan:f(46,49),bgWhite:f(47,49),blackBright:f(90,39),redBright:f(91,39),greenBright:f(92,39),yellowBright:f(93,39),blueBright:f(94,39),magentaBright:f(95,39),cyanBright:f(96,39),whiteBright:f(97,39),bgBlackBright:f(100,49),bgRedBright:f(101,49),bgGreenBright:f(102,49),bgYellowBright:f(103,49),bgBlueBright:f(104,49),bgMagentaBright:f(105,49),bgCyanBright:f(106,49),bgWhiteBright:f(107,49)},w0=y4(),m4=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),JC={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},l4={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};var Ch=a4(["The best way to get started is to quit talking and begin doing.","The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.","Don\u2019t let yesterday take up too much of today.","You learn more from failure than from success. Don\u2019t let it stop you. Failure builds character.","It\u2019s not whether you get knocked down, it\u2019s whether you get up.","If you are working on something that you really care about, you don\u2019t have to be pushed. The vision pulls you.","People who are crazy enough to think they can change the world, are the ones who do.","Failure will never overtake me if my determination to succeed is strong enough.","Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That\u2019s the classic entrepreneur.","We may encounter many defeats but we must not be defeated.","Knowing is not enough; we must apply. Wishing is not enough; we must do.","Imagine your life is perfect in every respect; what would it look like?","We generate fears while we sit. We overcome them by action.","Whether you think you can or think you can\u2019t, you\u2019re right.","Security is mostly a superstition. Life is either a daring adventure or nothing."]);async function Su(D,u){return I.debug("runCommand:",D),I.debug("options:",u),await N0(D,u)}async function Mh(D,u){return I.debug("runProcess:",KD(D)),I.debug("runProcess Options:",u),await N0(D,u)}async function Hh(D,u){return I.debug("runCommandSync:",KD(D)),I.debug("runCommandSync Options:",u),await L8(D,u)}async function Oh(D,u){const F=[];for(let C of D){const E=await Su(C,u);if(E.isErr())I.error(E.error),process.exit(p4.FatalError);F.push(E)}return F}class t4{name;description;options;run;onFail;onSuccess;constructor({name:D,description:u,options:F,run:C,onFail:E,onSuccess:B}){this.name=D,this.description=u,this.options=F,this.run=C,this.onFail=E,this.onSuccess=B}}var fh={run:async(D,u)=>{return await Su(D,u)},runSync:async(D,u)=>{return await Su(D,u)}};import{handleError as s4}from"@stacksjs/error-handling";import{log as ID}from"@stacksjs/logging";import{ExitCode as NC}from"@stacksjs/types";var RC="0.64.0";async function Rh(D,u){return new Promise((F)=>{if(u?.quiet===!1)console.log(),console.log(qu(JD("Stacks CLI"))+qD(` v${RC}`)),console.log();if(ID.info(`Running ${Iu(KD(JD(` ${D} `)))}`,{styled:!1}),u?.showPerformance===!1||u?.quiet)return F(0);return F(performance.now())})}function Nh(D,u,F){const C={type:"success",useSeconds:!0,...u};return C.message=u?.message||D,new Promise((E)=>{if(F)return s4(F);if(C?.startTime){let B=performance.now()-C.startTime;if(C.useSeconds)B=B/1000,B=Math.round(B*100)/100;if(C.quiet===!0)return E(NC.Success);if(F)ID.error(`[${B.toFixed(2)}${C.useSeconds?"s":"ms"}] Failed`);else if(C.type==="info")ID.info(`${qD(oD(`[${B.toFixed(2)}${C.useSeconds?"s":"ms"}]`))} ${C.message??"Complete"}`);else ID.success(`${qD(oD(JD(`[${B.toFixed(2)}${C.useSeconds?"s":"ms"}]`)))} ${JD(wu(C.message??"Complete"))}`)}else if(C?.type==="info")ID.info(D);else if(C?.type==="success"&&C?.quiet!==!0)ID.success(D);return E(NC.Success)})}import jD from"process";import{log as I0}from"@stacksjs/logging";function VC(D){if(!D)return!1;return D.startsWith("--")}function o4(D){return D.startsWith("-")&&!VC(D)}function j0(D){if(D==="true")return!0;if(D==="false")return!1;const u=Number.parseFloat(D);if(!Number.isNaN(u))return u;return D.replace(/"/g,"")}function e4(D,u,F,C){const[E,B]=D.slice(2).split("=");if(B!==void 0)C[E]=j0(B);else if(F+1<u.length&&!u[F+1]?.startsWith("-"))C[E]=u[F+1],F++;else C[E]=!0;return F}function D9(D,u,F,C){const[E,B]=D.slice(1).split("=");if(E===void 0)return F;if(B!==void 0&&E!==void 0)for(let A=0;A<E.length;A++)C[E[A]]=j0(B);else for(let A=0;A<E.length;A++)if(F+1<u.length&&A===E.length-1&&!u[F+1]?.startsWith("-"))C[E[A]]=j0(u[F+1]),F++;else C[E[A]]=!0;return F}function u9(D){if(D===void 0)D=jD.argv.slice(2);const u=[],F={};for(let C=0;C<D.length;C++){const E=D[C];if(!E)continue;if(VC(E))C=e4(E,D,C,F);else if(o4(E))C=D9(E,D,C,F);else u.push(E)}return{args:u,options:F}}function qh(D){if(D===void 0)D=jD.argv.slice(2);return u9(D).args}function Ih(D){D=D||{};const u=jD.argv.slice(2);for(let F=0;F<u.length;F++){const C=u[F];if(C?.startsWith("--")){const B=C.substring(2).replace(/-([a-z])/gi,(A)=>A[1]?A[1].toUpperCase():"");if(F+1<u.length)if(u[F+1]==="true"||u[F+1]==="false")D[B]=u[F+1]==="true",F++;else D[B]=u[F+1],F++;else D[B]=!0}}if(Object.keys(D).length===0)return{dryRun:!1,quiet:!1,verbose:!1};return Object.keys(D).forEach((F)=>{if(!D)return{dryRun:!1,quiet:!1,verbose:!1};const C=D[F];if(C==="true"||C==="false")D[F]=C==="true"}),D}function jh(D){if(!D){if(D=jD.argv.slice(2),D=Array.from(new Set(D)),D[0]&&!D[0].startsWith("-"))D.shift()}if(D?.verbose)I0.debug("process.argv",jD.argv),I0.debug("process.argv.slice(2)",jD.argv.slice(2)),I0.debug("options inside buddyOptions",D);return D.join(" ")}import cu from"process";function E9(){const D=new Map;for(let[u,F]of Object.entries(G)){for(let[C,E]of Object.entries(F))G[C]={open:`\x1B[${E[0]}m`,close:`\x1B[${E[1]}m`},F[C]=G[C],D.set(E[0],E[1]);Object.defineProperty(G,u,{value:F,enumerable:!1})}return Object.defineProperty(G,"codes",{value:D,enumerable:!1}),G.color.close="\x1B[39m",G.bgColor.close="\x1B[49m",G.color.ansi=LC(),G.color.ansi256=wC(),G.color.ansi16m=qC(),G.bgColor.ansi=LC(10),G.bgColor.ansi256=wC(10),G.bgColor.ansi16m=qC(10),Object.defineProperties(G,{rgbToAnsi256:{value(u,F,C){if(u===F&&F===C){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(C/255*5)},enumerable:!1},hexToRgb:{value(u){const F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[C]=F;if(C.length===3)C=[...C].map((B)=>B+B).join("");const E=Number.parseInt(C,16);return[E>>16&255,E>>8&255,E&255]},enumerable:!1},hexToAnsi256:{value:(u)=>G.rgbToAnsi256(...G.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,C,E;if(u>=232)F=((u-232)*10+8)/255,C=F,E=F;else{u-=16;const h=u%36;F=Math.floor(u/36)/5,C=Math.floor(h/6)/5,E=h%6/5}const B=Math.max(F,C,E)*2;if(B===0)return 30;let A=30+(Math.round(E)<<2|Math.round(C)<<1|Math.round(F));if(B===2)A+=60;return A},enumerable:!1},rgbToAnsi:{value:(u,F,C)=>G.ansi256ToAnsi(G.rgbToAnsi256(u,F,C)),enumerable:!1},hexToAnsi:{value:(u)=>G.ansi256ToAnsi(G.hexToAnsi256(u)),enumerable:!1}}),G}var LC=(D=0)=>(u)=>`\x1B[${u+D}m`,wC=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,qC=(D=0)=>(u,F,C)=>`\x1B[${38+D};2;${u};${F};${C}m`,G={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Ph=Object.keys(G.modifier),F9=Object.keys(G.color),C9=Object.keys(G.bgColor),Th=[...F9,...C9],B9=E9(),y=B9;import S0 from"process";import A9 from"os";import IC from"tty";function k(D,u=globalThis.Deno?globalThis.Deno.args:S0.argv){const F=D.startsWith("-")?"":D.length===1?"-":"--",C=u.indexOf(F+D),E=u.indexOf("--");return C!==-1&&(E===-1||C<E)}function h9(){if("FORCE_COLOR"in V){if(V.FORCE_COLOR==="true")return 1;if(V.FORCE_COLOR==="false")return 0;return V.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(V.FORCE_COLOR,10),3)}}function $9(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function _9(D,{streamIsTTY:u,sniffFlags:F=!0}={}){const C=h9();if(C!==void 0)Pu=C;const E=F?Pu:C;if(E===0)return 0;if(F){if(k("color=16m")||k("color=full")||k("color=truecolor"))return 3;if(k("color=256"))return 2}if("TF_BUILD"in V&&"AGENT_NAME"in V)return 1;if(D&&!u&&E===void 0)return 0;const B=E||0;if(V.TERM==="dumb")return B;if(S0.platform==="win32"){const A=A9.release().split(".");if(Number(A[0])>=10&&Number(A[2])>=10586)return Number(A[2])>=14931?3:2;return 1}if("CI"in V){if("GITHUB_ACTIONS"in V||"GITEA_ACTIONS"in V)return 3;if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((A)=>(A in V))||V.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in V)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(V.TEAMCITY_VERSION)?1:0;if(V.COLORTERM==="truecolor")return 3;if(V.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in V){const A=Number.parseInt((V.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(V.TERM_PROGRAM){case"iTerm.app":return A>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(V.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(V.TERM))return 1;if("COLORTERM"in V)return 1;return B}function jC(D,u={}){const F=_9(D,{streamIsTTY:D&&D.isTTY,...u});return $9(F)}var{env:V}=S0,Pu;if(k("no-color")||k("no-colors")||k("color=false")||k("color=never"))Pu=0;else if(k("color")||k("colors")||k("color=true")||k("color=always"))Pu=1;var U9={stdout:jC({isTTY:IC.isatty(1)}),stderr:jC({isTTY:IC.isatty(2)})},SC=U9;function PC(D,u,F){let C=D.indexOf(u);if(C===-1)return D;const E=u.length;let B=0,A="";do A+=D.slice(B,C)+u+F,B=C+E,C=D.indexOf(u,B);while(C!==-1);return A+=D.slice(B),A}function TC(D,u,F,C){let E=0,B="";do{const A=D[C-1]==="\r";B+=D.slice(E,A?C-1:C)+u+(A?"\r\n":"\n")+F,E=C+1,C=D.indexOf("\n",E)}while(C!==-1);return B+=D.slice(E),B}function uu(D){return H9(D)}var{stdout:bC,stderr:kC}=SC,P0=Symbol("GENERATOR"),SD=Symbol("STYLER"),Du=Symbol("IS_EMPTY"),dC=["ansi","ansi","ansi256","ansi16m"],PD=Object.create(null),M9=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const F=bC?bC.level:0;D.level=u.level===void 0?F:u.level};var H9=(D)=>{const u=(...F)=>F.join(" ");return M9(u,D),Object.setPrototypeOf(u,uu.prototype),u};Object.setPrototypeOf(uu.prototype,Function.prototype);for(let[D,u]of Object.entries(y))PD[D]={get(){const F=Tu(this,b0(u.open,u.close,this[SD]),this[Du]);return Object.defineProperty(this,D,{value:F}),F}};PD.visible={get(){const D=Tu(this,this[SD],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var T0=(D,u,F,...C)=>{if(D==="rgb"){if(u==="ansi16m")return y[F].ansi16m(...C);if(u==="ansi256")return y[F].ansi256(y.rgbToAnsi256(...C));return y[F].ansi(y.rgbToAnsi(...C))}if(D==="hex")return T0("rgb",u,F,...y.hexToRgb(...C));return y[F][D](...C)},O9=["rgb","hex","ansi256"];for(let D of O9){PD[D]={get(){const{level:F}=this;return function(...C){const E=b0(T0(D,dC[F],"color",...C),y.color.close,this[SD]);return Tu(this,E,this[Du])}}};const u="bg"+D[0].toUpperCase()+D.slice(1);PD[u]={get(){const{level:F}=this;return function(...C){const E=b0(T0(D,dC[F],"bgColor",...C),y.bgColor.close,this[SD]);return Tu(this,E,this[Du])}}}}var Z9=Object.defineProperties(()=>{},{...PD,level:{enumerable:!0,get(){return this[P0].level},set(D){this[P0].level=D}}}),b0=(D,u,F)=>{let C,E;if(F===void 0)C=D,E=u;else C=F.openAll+D,E=u+F.closeAll;return{open:D,close:u,openAll:C,closeAll:E,parent:F}},Tu=(D,u,F)=>{const C=(...E)=>z9(C,E.length===1?""+E[0]:E.join(" "));return Object.setPrototypeOf(C,Z9),C[P0]=D,C[SD]=u,C[Du]=F,C},z9=(D,u)=>{if(D.level<=0||!u)return D[Du]?"":u;let F=D[SD];if(F===void 0)return u;const{openAll:C,closeAll:E}=F;if(u.includes("\x1B"))while(F!==void 0)u=PC(u,F.close,F.open),F=F.parent;const B=u.indexOf("\n");if(B!==-1)u=TC(u,E,C,B);return C+u+E};Object.defineProperties(uu.prototype,PD);var f9=uu(),nh=uu({level:kC?kC.level:0});var xC=f9;import aC from"process";import du from"process";var J9=(D,u,F,C)=>{if(F==="length"||F==="prototype")return;if(F==="arguments"||F==="caller")return;const E=Object.getOwnPropertyDescriptor(D,F),B=Object.getOwnPropertyDescriptor(u,F);if(!K9(E,B)&&C)return;Object.defineProperty(D,F,B)},K9=function(D,u){return D===void 0||D.configurable||D.writable===u.writable&&D.enumerable===u.enumerable&&D.configurable===u.configurable&&(D.writable||D.value===u.value)},Q9=(D,u)=>{const F=Object.getPrototypeOf(u);if(F===Object.getPrototypeOf(D))return;Object.setPrototypeOf(D,F)},X9=(D,u)=>`/* Wrapped ${D}*/\n${u}`,G9=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Y9=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),W9=(D,u,F)=>{const C=F===""?"":`with ${F.trim()}() `,E=X9.bind(null,C,u.toString());Object.defineProperty(E,"name",Y9);const{writable:B,enumerable:A,configurable:h}=G9;Object.defineProperty(D,"toString",{value:E,writable:B,enumerable:A,configurable:h})};function k0(D,u,{ignoreNonConfigurable:F=!1}={}){const{name:C}=D;for(let E of Reflect.ownKeys(u))J9(D,u,E,F);return Q9(D,u),W9(D,u,C),D}var bu=new WeakMap,vC=(D,u={})=>{if(typeof D!=="function")throw new TypeError("Expected a function");let F,C=0;const E=D.displayName||D.name||"<anonymous>",B=function(...A){if(bu.set(B,++C),C===1)F=D.apply(this,A),D=void 0;else if(u.throw===!0)throw new Error(`Function \`${E}\` can only be called once`);return F};return k0(B,D),bu.set(B,C),B};vC.callCount=(D)=>{if(!bu.has(D))throw new Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return bu.get(D)};var gC=vC;var QD=[];QD.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")QD.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")QD.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ku=(D)=>!!D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function",d0=Symbol.for("signal-exit emitter"),x0=globalThis,R9=Object.defineProperty.bind(Object);class yC{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(x0[d0])return x0[d0];R9(x0,d0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(D,u){this.listeners[D].push(u)}removeListener(D,u){const F=this.listeners[D],C=F.indexOf(u);if(C===-1)return;if(C===0&&F.length===1)F.length=0;else F.splice(C,1)}emit(D,u,F){if(this.emitted[D])return!1;this.emitted[D]=!0;let C=!1;for(let E of this.listeners[D])C=E(u,F)===!0||C;if(D==="exit")C=this.emit("afterExit",u,F)||C;return C}}class g0{}var N9=(D)=>{return{onExit(u,F){return D.onExit(u,F)},load(){return D.load()},unload(){return D.unload()}}};class cC extends g0{onExit(){return()=>{}}load(){}unload(){}}class mC extends g0{#E=v0.platform==="win32"?"SIGINT":"SIGHUP";#C=new yC;#D;#B;#u;#A={};#F=!1;constructor(D){super();this.#D=D,this.#A={};for(let u of QD)this.#A[u]=()=>{const F=this.#D.listeners(u);let{count:C}=this.#C;const E=D;if(typeof E.__signal_exit_emitter__==="object"&&typeof E.__signal_exit_emitter__.count==="number")C+=E.__signal_exit_emitter__.count;if(F.length===C){this.unload();const B=this.#C.emit("exit",null,u),A=u==="SIGHUP"?this.#E:u;if(!B)D.kill(D.pid,A)}};this.#u=D.reallyExit,this.#B=D.emit}onExit(D,u){if(!ku(this.#D))return()=>{};if(this.#F===!1)this.load();const F=u?.alwaysLast?"afterExit":"exit";return this.#C.on(F,D),()=>{if(this.#C.removeListener(F,D),this.#C.listeners.exit.length===0&&this.#C.listeners.afterExit.length===0)this.unload()}}load(){if(this.#F)return;this.#F=!0,this.#C.count+=1;for(let D of QD)try{const u=this.#A[D];if(u)this.#D.on(D,u)}catch(u){}this.#D.emit=(D,...u)=>{return this.#O(D,...u)},this.#D.reallyExit=(D)=>{return this.#H(D)}}unload(){if(!this.#F)return;this.#F=!1,QD.forEach((D)=>{const u=this.#A[D];if(!u)throw new Error("Listener not defined for signal: "+D);try{this.#D.removeListener(D,u)}catch(F){}}),this.#D.emit=this.#B,this.#D.reallyExit=this.#u,this.#C.count-=1}#H(D){if(!ku(this.#D))return 0;return this.#D.exitCode=D||0,this.#C.emit("exit",this.#D.exitCode,null),this.#u.call(this.#D,this.#D.exitCode)}#O(D,...u){const F=this.#B;if(D==="exit"&&ku(this.#D)){if(typeof u[0]==="number")this.#D.exitCode=u[0];const C=F.call(this.#D,D,...u);return this.#C.emit("exit",this.#D.exitCode,null),C}else return F.call(this.#D,D,...u)}}var v0=globalThis.process,{onExit:nC,load:sh,unload:oh}=N9(ku(v0)?new mC(v0):new cC);var lC=du.stderr.isTTY?du.stderr:du.stdout.isTTY?du.stdout:void 0,V9=lC?gC(()=>{nC(()=>{lC.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},iC=V9;var xu=!1,TD={};TD.show=(D=aC.stderr)=>{if(!D.isTTY)return;xu=!1,D.write("\x1B[?25h")};TD.hide=(D=aC.stderr)=>{if(!D.isTTY)return;iC(),xu=!0,D.write("\x1B[?25l")};TD.toggle=(D,u)=>{if(D!==void 0)xu=D;if(xu)TD.show(u);else TD.hide(u)};var y0=TD;var Au=iu(c0(),1);function I9(){const D=new Map;for(let[u,F]of Object.entries(Y)){for(let[C,E]of Object.entries(F))Y[C]={open:`\x1B[${E[0]}m`,close:`\x1B[${E[1]}m`},F[C]=Y[C],D.set(E[0],E[1]);Object.defineProperty(Y,u,{value:F,enumerable:!1})}return Object.defineProperty(Y,"codes",{value:D,enumerable:!1}),Y.color.close="\x1B[39m",Y.bgColor.close="\x1B[49m",Y.color.ansi=sC(),Y.color.ansi256=oC(),Y.color.ansi16m=eC(),Y.bgColor.ansi=sC(10),Y.bgColor.ansi256=oC(10),Y.bgColor.ansi16m=eC(10),Object.defineProperties(Y,{rgbToAnsi256:{value(u,F,C){if(u===F&&F===C){if(u<8)return 16;if(u>248)return 231;return Math.round((u-8)/247*24)+232}return 16+36*Math.round(u/255*5)+6*Math.round(F/255*5)+Math.round(C/255*5)},enumerable:!1},hexToRgb:{value(u){const F=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!F)return[0,0,0];let[C]=F;if(C.length===3)C=[...C].map((B)=>B+B).join("");const E=Number.parseInt(C,16);return[E>>16&255,E>>8&255,E&255]},enumerable:!1},hexToAnsi256:{value:(u)=>Y.rgbToAnsi256(...Y.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value(u){if(u<8)return 30+u;if(u<16)return 90+(u-8);let F,C,E;if(u>=232)F=((u-232)*10+8)/255,C=F,E=F;else{u-=16;const h=u%36;F=Math.floor(u/36)/5,C=Math.floor(h/6)/5,E=h%6/5}const B=Math.max(F,C,E)*2;if(B===0)return 30;let A=30+(Math.round(E)<<2|Math.round(C)<<1|Math.round(F));if(B===2)A+=60;return A},enumerable:!1},rgbToAnsi:{value:(u,F,C)=>Y.ansi256ToAnsi(Y.rgbToAnsi256(u,F,C)),enumerable:!1},hexToAnsi:{value:(u)=>Y.ansi256ToAnsi(Y.hexToAnsi256(u)),enumerable:!1}}),Y}var sC=(D=0)=>(u)=>`\x1B[${u+D}m`,oC=(D=0)=>(u)=>`\x1B[${38+D};5;${u}m`,eC=(D=0)=>(u,F,C)=>`\x1B[${38+D};2;${u};${F};${C}m`,Y={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},_$=Object.keys(Y.modifier),w9=Object.keys(Y.color),q9=Object.keys(Y.bgColor),U$=[...w9,...q9],j9=I9(),c=j9;import m0 from"process";import S9 from"os";import DE from"tty";function d(D,u=globalThis.Deno?globalThis.Deno.args:m0.argv){const F=D.startsWith("-")?"":D.length===1?"-":"--",C=u.indexOf(F+D),E=u.indexOf("--");return C!==-1&&(E===-1||C<E)}function P9(){if("FORCE_COLOR"in L){if(L.FORCE_COLOR==="true")return 1;if(L.FORCE_COLOR==="false")return 0;return L.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(L.FORCE_COLOR,10),3)}}function T9(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function b9(D,{streamIsTTY:u,sniffFlags:F=!0}={}){const C=P9();if(C!==void 0)gu=C;const E=F?gu:C;if(E===0)return 0;if(F){if(d("color=16m")||d("color=full")||d("color=truecolor"))return 3;if(d("color=256"))return 2}if("TF_BUILD"in L&&"AGENT_NAME"in L)return 1;if(D&&!u&&E===void 0)return 0;const B=E||0;if(L.TERM==="dumb")return B;if(m0.platform==="win32"){const A=S9.release().split(".");if(Number(A[0])>=10&&Number(A[2])>=10586)return Number(A[2])>=14931?3:2;return 1}if("CI"in L){if("GITHUB_ACTIONS"in L||"GITEA_ACTIONS"in L)return 3;if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((A)=>(A in L))||L.CI_NAME==="codeship")return 1;return B}if("TEAMCITY_VERSION"in L)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(L.TEAMCITY_VERSION)?1:0;if(L.COLORTERM==="truecolor")return 3;if(L.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in L){const A=Number.parseInt((L.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(L.TERM_PROGRAM){case"iTerm.app":return A>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(L.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(L.TERM))return 1;if("COLORTERM"in L)return 1;return B}function uE(D,u={}){const F=b9(D,{streamIsTTY:D&&D.isTTY,...u});return T9(F)}var{env:L}=m0,gu;if(d("no-color")||d("no-colors")||d("color=false")||d("color=never"))gu=0;else if(d("color")||d("colors")||d("color=true")||d("color=always"))gu=1;var k9={stdout:uE({isTTY:DE.isatty(1)}),stderr:uE({isTTY:DE.isatty(2)})},FE=k9;function CE(D,u,F){let C=D.indexOf(u);if(C===-1)return D;const E=u.length;let B=0,A="";do A+=D.slice(B,C)+u+F,B=C+E,C=D.indexOf(u,B);while(C!==-1);return A+=D.slice(B),A}function EE(D,u,F,C){let E=0,B="";do{const A=D[C-1]==="\r";B+=D.slice(E,A?C-1:C)+u+(A?"\r\n":"\n")+F,E=C+1,C=D.indexOf("\n",E)}while(C!==-1);return B+=D.slice(E),B}function Cu(D){return x9(D)}var{stdout:BE,stderr:AE}=FE,n0=Symbol("GENERATOR"),bD=Symbol("STYLER"),Fu=Symbol("IS_EMPTY"),hE=["ansi","ansi","ansi256","ansi16m"],kD=Object.create(null),d9=(D,u={})=>{if(u.level&&!(Number.isInteger(u.level)&&u.level>=0&&u.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const F=BE?BE.level:0;D.level=u.level===void 0?F:u.level};var x9=(D)=>{const u=(...F)=>F.join(" ");return d9(u,D),Object.setPrototypeOf(u,Cu.prototype),u};Object.setPrototypeOf(Cu.prototype,Function.prototype);for(let[D,u]of Object.entries(c))kD[D]={get(){const F=yu(this,i0(u.open,u.close,this[bD]),this[Fu]);return Object.defineProperty(this,D,{value:F}),F}};kD.visible={get(){const D=yu(this,this[bD],!0);return Object.defineProperty(this,"visible",{value:D}),D}};var l0=(D,u,F,...C)=>{if(D==="rgb"){if(u==="ansi16m")return c[F].ansi16m(...C);if(u==="ansi256")return c[F].ansi256(c.rgbToAnsi256(...C));return c[F].ansi(c.rgbToAnsi(...C))}if(D==="hex")return l0("rgb",u,F,...c.hexToRgb(...C));return c[F][D](...C)},v9=["rgb","hex","ansi256"];for(let D of v9){kD[D]={get(){const{level:F}=this;return function(...C){const E=i0(l0(D,hE[F],"color",...C),c.color.close,this[bD]);return yu(this,E,this[Fu])}}};const u="bg"+D[0].toUpperCase()+D.slice(1);kD[u]={get(){const{level:F}=this;return function(...C){const E=i0(l0(D,hE[F],"bgColor",...C),c.bgColor.close,this[bD]);return yu(this,E,this[Fu])}}}}var g9=Object.defineProperties(()=>{},{...kD,level:{enumerable:!0,get(){return this[n0].level},set(D){this[n0].level=D}}}),i0=(D,u,F)=>{let C,E;if(F===void 0)C=D,E=u;else C=F.openAll+D,E=u+F.closeAll;return{open:D,close:u,openAll:C,closeAll:E,parent:F}},yu=(D,u,F)=>{const C=(...E)=>y9(C,E.length===1?""+E[0]:E.join(" "));return Object.setPrototypeOf(C,g9),C[n0]=D,C[bD]=u,C[Fu]=F,C},y9=(D,u)=>{if(D.level<=0||!u)return D[Fu]?"":u;let F=D[bD];if(F===void 0)return u;const{openAll:C,closeAll:E}=F;if(u.includes("\x1B"))while(F!==void 0)u=CE(u,F.close,F.open),F=F.parent;const B=u.indexOf("\n");if(B!==-1)u=EE(u,E,C,B);return C+u+E};Object.defineProperties(Cu.prototype,kD);var c9=Cu(),X$=Cu({level:AE?AE.level:0});var AD=c9;import m from"process";function a0(){if(m.platform!=="win32")return m.env.TERM!=="linux";return Boolean(m.env.CI)||Boolean(m.env.WT_SESSION)||Boolean(m.env.TERMINUS_SUBLIME)||m.env.ConEmuTask==="{cmd::Cmder}"||m.env.TERM_PROGRAM==="Terminus-Sublime"||m.env.TERM_PROGRAM==="vscode"||m.env.TERM==="xterm-256color"||m.env.TERM==="alacritty"||m.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var m9={info:AD.blue("\u2139"),success:AD.green("\u2714"),warning:AD.yellow("\u26A0"),error:AD.red("\u2716")},n9={info:AD.blue("i"),success:AD.green("\u221A"),warning:AD.yellow("\u203C"),error:AD.red("\xD7")},l9=a0()?m9:n9,Eu=l9;function p0({onlyFirst:D=!1}={}){const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,D?void 0:"g")}var i9=p0();function Bu(D){if(typeof D!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(i9,"")}function $E(D){return D===161||D===164||D===167||D===168||D===170||D===173||D===174||D>=176&&D<=180||D>=182&&D<=186||D>=188&&D<=191||D===198||D===208||D===215||D===216||D>=222&&D<=225||D===230||D>=232&&D<=234||D===236||D===237||D===240||D===242||D===243||D>=247&&D<=250||D===252||D===254||D===257||D===273||D===275||D===283||D===294||D===295||D===299||D>=305&&D<=307||D===312||D>=319&&D<=322||D===324||D>=328&&D<=331||D===333||D===338||D===339||D===358||D===359||D===363||D===462||D===464||D===466||D===468||D===470||D===472||D===474||D===476||D===593||D===609||D===708||D===711||D>=713&&D<=715||D===717||D===720||D>=728&&D<=731||D===733||D===735||D>=768&&D<=879||D>=913&&D<=929||D>=931&&D<=937||D>=945&&D<=961||D>=963&&D<=969||D===1025||D>=1040&&D<=1103||D===1105||D===8208||D>=8211&&D<=8214||D===8216||D===8217||D===8220||D===8221||D>=8224&&D<=8226||D>=8228&&D<=8231||D===8240||D===8242||D===8243||D===8245||D===8251||D===8254||D===8308||D===8319||D>=8321&&D<=8324||D===8364||D===8451||D===8453||D===8457||D===8467||D===8470||D===8481||D===8482||D===8486||D===8491||D===8531||D===8532||D>=8539&&D<=8542||D>=8544&&D<=8555||D>=8560&&D<=8569||D===8585||D>=8592&&D<=8601||D===8632||D===8633||D===8658||D===8660||D===8679||D===8704||D===8706||D===8707||D===8711||D===8712||D===8715||D===8719||D===8721||D===8725||D===8730||D>=8733&&D<=8736||D===8739||D===8741||D>=8743&&D<=8748||D===8750||D>=8756&&D<=8759||D===8764||D===8765||D===8776||D===8780||D===8786||D===8800||D===8801||D>=8804&&D<=8807||D===8810||D===8811||D===8814||D===8815||D===8834||D===8835||D===8838||D===8839||D===8853||D===8857||D===8869||D===8895||D===8978||D>=9312&&D<=9449||D>=9451&&D<=9547||D>=9552&&D<=9587||D>=9600&&D<=9615||D>=9618&&D<=9621||D===9632||D===9633||D>=9635&&D<=9641||D===9650||D===9651||D===9654||D===9655||D===9660||D===9661||D===9664||D===9665||D>=9670&&D<=9672||D===9675||D>=9678&&D<=9681||D>=9698&&D<=9701||D===9711||D===9733||D===9734||D===9737||D===9742||D===9743||D===9756||D===9758||D===9792||D===9794||D===9824||D===9825||D>=9827&&D<=9829||D>=9831&&D<=9834||D===9836||D===9837||D===9839||D===9886||D===9887||D===9919||D>=9926&&D<=9933||D>=9935&&D<=9939||D>=9941&&D<=9953||D===9955||D===9960||D===9961||D>=9963&&D<=9969||D===9972||D>=9974&&D<=9977||D===9979||D===9980||D===9982||D===9983||D===10045||D>=10102&&D<=10111||D>=11094&&D<=11097||D>=12872&&D<=12879||D>=57344&&D<=63743||D>=65024&&D<=65039||D===65533||D>=127232&&D<=127242||D>=127248&&D<=127277||D>=127280&&D<=127337||D>=127344&&D<=127373||D===127375||D===127376||D>=127387&&D<=127404||D>=917760&&D<=917999||D>=983040&&D<=1048573||D>=1048576&&D<=1114109}function _E(D){return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510}function UE(D){return D>=4352&&D<=4447||D===8986||D===8987||D===9001||D===9002||D>=9193&&D<=9196||D===9200||D===9203||D===9725||D===9726||D===9748||D===9749||D>=9800&&D<=9811||D===9855||D===9875||D===9889||D===9898||D===9899||D===9917||D===9918||D===9924||D===9925||D===9934||D===9940||D===9962||D===9970||D===9971||D===9973||D===9978||D===9981||D===9989||D===9994||D===9995||D===10024||D===10060||D===10062||D>=10067&&D<=10069||D===10071||D>=10133&&D<=10135||D===10160||D===10175||D===11035||D===11036||D===11088||D===11093||D>=11904&&D<=11929||D>=11931&&D<=12019||D>=12032&&D<=12245||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12353&&D<=12438||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=19968&&D<=42124||D>=42128&&D<=42182||D>=43360&&D<=43388||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=94176&&D<=94180||D===94192||D===94193||D>=94208&&D<=100343||D>=100352&&D<=101589||D>=101632&&D<=101640||D>=110576&&D<=110579||D>=110581&&D<=110587||D===110589||D===110590||D>=110592&&D<=110882||D===110898||D>=110928&&D<=110930||D===110933||D>=110948&&D<=110951||D>=110960&&D<=111355||D===126980||D===127183||D===127374||D>=127377&&D<=127386||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D===127568||D===127569||D>=127584&&D<=127589||D>=127744&&D<=127776||D>=127789&&D<=127797||D>=127799&&D<=127868||D>=127870&&D<=127891||D>=127904&&D<=127946||D>=127951&&D<=127955||D>=127968&&D<=127984||D===127988||D>=127992&&D<=128062||D===128064||D>=128066&&D<=128252||D>=128255&&D<=128317||D>=128331&&D<=128334||D>=128336&&D<=128359||D===128378||D===128405||D===128406||D===128420||D>=128507&&D<=128591||D>=128640&&D<=128709||D===128716||D>=128720&&D<=128722||D>=128725&&D<=128727||D>=128732&&D<=128735||D===128747||D===128748||D>=128756&&D<=128764||D>=128992&&D<=129003||D===129008||D>=129292&&D<=129338||D>=129340&&D<=129349||D>=129351&&D<=129535||D>=129648&&D<=129660||D>=129664&&D<=129672||D>=129680&&D<=129725||D>=129727&&D<=129733||D>=129742&&D<=129755||D>=129760&&D<=129768||D>=129776&&D<=129784||D>=131072&&D<=196605||D>=196608&&D<=262141}function a9(D){if(!Number.isSafeInteger(D))throw new TypeError(`Expected a code point, got \`${typeof D}\`.`)}function ME(D,{ambiguousAsWide:u=!1}={}){if(a9(D),_E(D)||UE(D)||u&&$E(D))return 2;return 1}var HE=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g};var p9=new Intl.Segmenter,t9=/^\p{Default_Ignorable_Code_Point}$/u;function t0(D,u={}){if(typeof D!=="string"||D.length===0)return 0;const{ambiguousIsNarrow:F=!0,countAnsiEscapeCodes:C=!1}=u;if(!C)D=Bu(D);if(D.length===0)return 0;let E=0;const B={ambiguousAsWide:!F};for(let{segment:A}of p9.segment(D)){const h=A.codePointAt(0);if(h<=31||h>=127&&h<=159)continue;if(h>=8203&&h<=8207||h===65279)continue;if(h>=768&&h<=879||h>=6832&&h<=6911||h>=7616&&h<=7679||h>=8400&&h<=8447||h>=65056&&h<=65071)continue;if(h>=55296&&h<=57343)continue;if(h>=65024&&h<=65039)continue;if(t9.test(A))continue;if(HE().test(A)){E+=2;continue}E+=ME(h,B)}return E}function r0({stream:D=process.stdout}={}){return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import r from"process";function s0(){if(r.platform!=="win32")return r.env.TERM!=="linux";return Boolean(r.env.WT_SESSION)||Boolean(r.env.TERMINUS_SUBLIME)||r.env.ConEmuTask==="{cmd::Cmder}"||r.env.TERM_PROGRAM==="Terminus-Sublime"||r.env.TERM_PROGRAM==="vscode"||r.env.TERM==="xterm-256color"||r.env.TERM==="alacritty"||r.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}import s from"process";var r9=3;class OE{#E=0;start(){if(this.#E++,this.#E===1)this.#C()}stop(){if(this.#E<=0)throw new Error("`stop` called more times than `start`");if(this.#E--,this.#E===0)this.#D()}#C(){if(s.platform==="win32"||!s.stdin.isTTY)return;s.stdin.setRawMode(!0),s.stdin.on("data",this.#B),s.stdin.resume()}#D(){if(!s.stdin.isTTY)return;s.stdin.off("data",this.#B),s.stdin.pause(),s.stdin.setRawMode(!1)}#B(D){if(D[0]===r9)s.emit("SIGINT")}}var s9=new OE,o0=s9;var o9=iu(c0(),1);class ZE{#E=0;#C=!1;#D=0;#B=0;#u;#A;#F;#H;#O;#_;#U;#M;#z;#h;#$;color;constructor(D){if(typeof D==="string")D={text:D};if(this.#u={color:"cyan",stream:cu.stderr,discardStdin:!0,hideCursor:!0,...D},this.color=this.#u.color,this.spinner=this.#u.spinner,this.#O=this.#u.interval,this.#F=this.#u.stream,this.#_=typeof this.#u.isEnabled==="boolean"?this.#u.isEnabled:r0({stream:this.#F}),this.#U=typeof this.#u.isSilent==="boolean"?this.#u.isSilent:!1,this.text=this.#u.text,this.prefixText=this.#u.prefixText,this.suffixText=this.#u.suffixText,this.indent=this.#u.indent,cu.env.NODE_ENV==="test")this._stream=this.#F,this._isEnabled=this.#_,Object.defineProperty(this,"_linesToClear",{get(){return this.#E},set(u){this.#E=u}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#B}}),Object.defineProperty(this,"_lineCount",{get(){return this.#D}})}get indent(){return this.#M}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw new Error("The `indent` option must be an integer from 0 and up");this.#M=D,this.#Z()}get interval(){return this.#O??this.#A.interval??100}get spinner(){return this.#A}set spinner(D){if(this.#B=0,this.#O=void 0,typeof D==="object"){if(D.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#A=D}else if(!s0())this.#A=Au.default.line;else if(D===void 0)this.#A=Au.default.dots;else if(D!=="default"&&Au.default[D])this.#A=Au.default[D];else throw new Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#z}set text(D=""){this.#z=D,this.#Z()}get prefixText(){return this.#h}set prefixText(D=""){this.#h=D,this.#Z()}get suffixText(){return this.#$}set suffixText(D=""){this.#$=D,this.#Z()}get isSpinning(){return this.#H!==void 0}#f(D=this.#h,u=" "){if(typeof D==="string"&&D!=="")return D+u;if(typeof D==="function")return D()+u;return""}#J(D=this.#$,u=" "){if(typeof D==="string"&&D!=="")return u+D;if(typeof D==="function")return u+D();return""}#Z(){const D=this.#F.columns??80,u=this.#f(this.#h,"-"),F=this.#J(this.#$,"-"),C=" ".repeat(this.#M)+u+"--"+this.#z+"--"+F;this.#D=0;for(let E of Bu(C).split("\n"))this.#D+=Math.max(1,Math.ceil(t0(E,{countAnsiEscapeCodes:!0})/D))}get isEnabled(){return this.#_&&!this.#U}set isEnabled(D){if(typeof D!=="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#_=D}get isSilent(){return this.#U}set isSilent(D){if(typeof D!=="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#U=D}frame(){const{frames:D}=this.#A;let u=D[this.#B];if(this.color)u=xC[this.color](u);this.#B=++this.#B%D.length;const F=typeof this.#h==="string"&&this.#h!==""?this.#h+" ":"",C=typeof this.text==="string"?" "+this.text:"",E=typeof this.#$==="string"&&this.#$!==""?" "+this.#$:"";return F+u+C+E}clear(){if(!this.#_||!this.#F.isTTY)return this;this.#F.cursorTo(0);for(let D=0;D<this.#E;D++){if(D>0)this.#F.moveCursor(0,-1);this.#F.clearLine(1)}if(this.#M||this.lastIndent!==this.#M)this.#F.cursorTo(this.#M);return this.lastIndent=this.#M,this.#E=0,this}render(){if(this.#U)return this;return this.clear(),this.#F.write(this.frame()),this.#E=this.#D,this}start(D){if(D)this.text=D;if(this.#U)return this;if(!this.#_){if(this.text)this.#F.write(`- ${this.text}\n`);return this}if(this.isSpinning)return this;if(this.#u.hideCursor)y0.hide(this.#F);if(this.#u.discardStdin&&cu.stdin.isTTY)this.#C=!0,o0.start();return this.render(),this.#H=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#_)return this;if(clearInterval(this.#H),this.#H=void 0,this.#B=0,this.clear(),this.#u.hideCursor)y0.show(this.#F);if(this.#u.discardStdin&&cu.stdin.isTTY&&this.#C)o0.stop(),this.#C=!1;return this}succeed(D){return this.stopAndPersist({symbol:Eu.success,text:D})}fail(D){return this.stopAndPersist({symbol:Eu.error,text:D})}warn(D){return this.stopAndPersist({symbol:Eu.warning,text:D})}info(D){return this.stopAndPersist({symbol:Eu.info,text:D})}stopAndPersist(D={}){if(this.#U)return this;const u=D.prefixText??this.#h,F=this.#f(u," "),C=D.symbol??" ",E=D.text??this.text,B=typeof E==="string"?" "+E:"",A=D.suffixText??this.#$,h=this.#J(A," "),$=F+C+B+h+"\n";return this.stop(),this.#F.write($),this}}function e0(D){return new ZE(D)}var u_=e0;var export_prompts=I4.default;export{g8 as yellow,m8 as white,T8 as underline,OC as trueColorBg,HC as trueColor,S8 as stripColors,eD as stripAnsi,d8 as strikethrough,u_ as spinner,Mh as runProcess,Oh as runCommands,Hh as runCommandSync,Su as runCommand,YC as rightAlign,P8 as reset,v8 as red,Ch as quotes,export_prompts as prompts,Ih as parseOptions,u9 as parseArgv,qh as parseArgs,Nh as outro,c8 as magenta,I as log,ZC as link,a8 as lightYellow,l8 as lightRed,t8 as lightMagenta,i8 as lightGreen,n8 as lightGray,r8 as lightCyan,p8 as lightBlue,WC as leftAlign,zC as kolorist,KD as italic,b8 as inverse,Rh as intro,V5 as installStack,N5 as installPackage,k8 as hidden,wu as green,oD as gray,q0 as getColor,L8 as execSync,N0 as exec,qD as dim,qu as cyan,fh as command,w0 as colors,c4 as colorize,P5 as cli,GC as centerAlign,jh as buddyOptions,i4 as box,JD as bold,y8 as blue,x8 as black,DC as bgYellow,CC as bgWhite,o8 as bgRed,FC as bgMagenta,hC as bgLightYellow,BC as bgLightRed,_C as bgLightMagenta,AC as bgLightGreen,MC as bgLightGray,UC as bgLightCyan,$C as bgLightBlue,e8 as bgGreen,EC as bgGray,Iu as bgCyan,uC as bgBlue,s8 as bgBlack,L0 as ansi256Bg,V0 as ansi256,n4 as align,t4 as Command,ou as CAC};
18
+
19
+ //# debugId=0EFA53D1D453291264756E2164756E21
832
20
  //# sourceMappingURL=index.js.map