@stacksjs/logging 0.63.0 → 0.63.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,1843 +1,44 @@
1
1
  // @bun
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true,
8
- configurable: true,
9
- set: (newValue) => all[name] = () => newValue
10
- });
11
- };
12
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
13
-
14
- // ../../../../node_modules/consola/dist/core.mjs
15
- function isObject(value) {
16
- return value !== null && typeof value === "object";
17
- }
18
- function _defu(baseObject, defaults, namespace = ".", merger) {
19
- if (!isObject(defaults)) {
20
- return _defu(baseObject, {}, namespace, merger);
21
- }
22
- const object = Object.assign({}, defaults);
23
- for (const key in baseObject) {
24
- if (key === "__proto__" || key === "constructor") {
25
- continue;
26
- }
27
- const value = baseObject[key];
28
- if (value === null || value === undefined) {
29
- continue;
30
- }
31
- if (merger && merger(object, key, value, namespace)) {
32
- continue;
33
- }
34
- if (Array.isArray(value) && Array.isArray(object[key])) {
35
- object[key] = [...value, ...object[key]];
36
- } else if (isObject(value) && isObject(object[key])) {
37
- object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
38
- } else {
39
- object[key] = value;
40
- }
41
- }
42
- return object;
43
- }
44
- function createDefu(merger) {
45
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
46
- }
47
- function isPlainObject(obj) {
48
- return Object.prototype.toString.call(obj) === "[object Object]";
49
- }
50
- function isLogObj(arg) {
51
- if (!isPlainObject(arg)) {
52
- return false;
53
- }
54
- if (!arg.message && !arg.args) {
55
- return false;
56
- }
57
- if (arg.stack) {
58
- return false;
59
- }
60
- return true;
61
- }
62
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
63
- if (input === undefined) {
64
- return defaultLevel;
65
- }
66
- if (typeof input === "number") {
67
- return input;
68
- }
69
- if (types[input] && types[input].level !== undefined) {
70
- return types[input].level;
71
- }
72
- return defaultLevel;
73
- }
74
- function createConsola(options = {}) {
75
- return new Consola(options);
76
- }
77
-
78
- class Consola {
79
- constructor(options = {}) {
80
- const types = options.types || LogTypes;
81
- this.options = defu({
82
- ...options,
83
- defaults: { ...options.defaults },
84
- level: _normalizeLogLevel(options.level, types),
85
- reporters: [...options.reporters || []]
86
- }, {
87
- types: LogTypes,
88
- throttle: 1000,
89
- throttleMin: 5,
90
- formatOptions: {
91
- date: true,
92
- colors: false,
93
- compact: true
94
- }
95
- });
96
- for (const type in types) {
97
- const defaults = {
98
- type,
99
- ...this.options.defaults,
100
- ...types[type]
101
- };
102
- this[type] = this._wrapLogFn(defaults);
103
- this[type].raw = this._wrapLogFn(defaults, true);
104
- }
105
- if (this.options.mockFn) {
106
- this.mockTypes();
107
- }
108
- this._lastLog = {};
109
- }
110
- get level() {
111
- return this.options.level;
112
- }
113
- set level(level) {
114
- this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
115
- }
116
- prompt(message, opts) {
117
- if (!this.options.prompt) {
118
- throw new Error("prompt is not supported!");
119
- }
120
- return this.options.prompt(message, opts);
121
- }
122
- create(options) {
123
- const instance = new Consola({
124
- ...this.options,
125
- ...options
126
- });
127
- if (this._mockFn) {
128
- instance.mockTypes(this._mockFn);
129
- }
130
- return instance;
131
- }
132
- withDefaults(defaults) {
133
- return this.create({
134
- ...this.options,
135
- defaults: {
136
- ...this.options.defaults,
137
- ...defaults
138
- }
139
- });
140
- }
141
- withTag(tag) {
142
- return this.withDefaults({
143
- tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag
144
- });
145
- }
146
- addReporter(reporter) {
147
- this.options.reporters.push(reporter);
148
- return this;
149
- }
150
- removeReporter(reporter) {
151
- if (reporter) {
152
- const i = this.options.reporters.indexOf(reporter);
153
- if (i >= 0) {
154
- return this.options.reporters.splice(i, 1);
155
- }
156
- } else {
157
- this.options.reporters.splice(0);
158
- }
159
- return this;
160
- }
161
- setReporters(reporters) {
162
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
163
- return this;
164
- }
165
- wrapAll() {
166
- this.wrapConsole();
167
- this.wrapStd();
168
- }
169
- restoreAll() {
170
- this.restoreConsole();
171
- this.restoreStd();
172
- }
173
- wrapConsole() {
174
- for (const type in this.options.types) {
175
- if (!console["__" + type]) {
176
- console["__" + type] = console[type];
177
- }
178
- console[type] = this[type].raw;
179
- }
180
- }
181
- restoreConsole() {
182
- for (const type in this.options.types) {
183
- if (console["__" + type]) {
184
- console[type] = console["__" + type];
185
- delete console["__" + type];
186
- }
187
- }
188
- }
189
- wrapStd() {
190
- this._wrapStream(this.options.stdout, "log");
191
- this._wrapStream(this.options.stderr, "log");
192
- }
193
- _wrapStream(stream, type) {
194
- if (!stream) {
195
- return;
196
- }
197
- if (!stream.__write) {
198
- stream.__write = stream.write;
199
- }
200
- stream.write = (data) => {
201
- this[type].raw(String(data).trim());
202
- };
203
- }
204
- restoreStd() {
205
- this._restoreStream(this.options.stdout);
206
- this._restoreStream(this.options.stderr);
207
- }
208
- _restoreStream(stream) {
209
- if (!stream) {
210
- return;
211
- }
212
- if (stream.__write) {
213
- stream.write = stream.__write;
214
- delete stream.__write;
215
- }
216
- }
217
- pauseLogs() {
218
- paused = true;
219
- }
220
- resumeLogs() {
221
- paused = false;
222
- const _queue = queue.splice(0);
223
- for (const item of _queue) {
224
- item[0]._logFn(item[1], item[2]);
225
- }
226
- }
227
- mockTypes(mockFn) {
228
- const _mockFn = mockFn || this.options.mockFn;
229
- this._mockFn = _mockFn;
230
- if (typeof _mockFn !== "function") {
231
- return;
232
- }
233
- for (const type in this.options.types) {
234
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
235
- this[type].raw = this[type];
236
- }
237
- }
238
- _wrapLogFn(defaults, isRaw) {
239
- return (...args) => {
240
- if (paused) {
241
- queue.push([this, defaults, args, isRaw]);
242
- return;
243
- }
244
- return this._logFn(defaults, args, isRaw);
245
- };
246
- }
247
- _logFn(defaults, args, isRaw) {
248
- if ((defaults.level || 0) > this.level) {
249
- return false;
250
- }
251
- const logObj = {
252
- date: /* @__PURE__ */ new Date,
253
- args: [],
254
- ...defaults,
255
- level: _normalizeLogLevel(defaults.level, this.options.types)
256
- };
257
- if (!isRaw && args.length === 1 && isLogObj(args[0])) {
258
- Object.assign(logObj, args[0]);
259
- } else {
260
- logObj.args = [...args];
261
- }
262
- if (logObj.message) {
263
- logObj.args.unshift(logObj.message);
264
- delete logObj.message;
265
- }
266
- if (logObj.additional) {
267
- if (!Array.isArray(logObj.additional)) {
268
- logObj.additional = logObj.additional.split("\n");
269
- }
270
- logObj.args.push("\n" + logObj.additional.join("\n"));
271
- delete logObj.additional;
272
- }
273
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
274
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
275
- const resolveLog = (newLog = false) => {
276
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
277
- if (this._lastLog.object && repeated > 0) {
278
- const args2 = [...this._lastLog.object.args];
279
- if (repeated > 1) {
280
- args2.push(`(repeated ${repeated} times)`);
281
- }
282
- this._log({ ...this._lastLog.object, args: args2 });
283
- this._lastLog.count = 1;
284
- }
285
- if (newLog) {
286
- this._lastLog.object = logObj;
287
- this._log(logObj);
288
- }
289
- };
290
- clearTimeout(this._lastLog.timeout);
291
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
292
- this._lastLog.time = logObj.date;
293
- if (diffTime < this.options.throttle) {
294
- try {
295
- const serializedLog = JSON.stringify([
296
- logObj.type,
297
- logObj.tag,
298
- logObj.args
299
- ]);
300
- const isSameLog = this._lastLog.serialized === serializedLog;
301
- this._lastLog.serialized = serializedLog;
302
- if (isSameLog) {
303
- this._lastLog.count = (this._lastLog.count || 0) + 1;
304
- if (this._lastLog.count > this.options.throttleMin) {
305
- this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
306
- return;
307
- }
308
- }
309
- } catch {
310
- }
311
- }
312
- resolveLog(true);
313
- }
314
- _log(logObj) {
315
- for (const reporter of this.options.reporters) {
316
- reporter.log(logObj, {
317
- options: this.options
318
- });
319
- }
320
- }
321
- }
322
- var LogLevels, LogTypes, defu, paused = false, queue;
323
- var init_core = __esm(() => {
324
- LogLevels = {
325
- silent: Number.NEGATIVE_INFINITY,
326
- fatal: 0,
327
- error: 0,
328
- warn: 1,
329
- log: 2,
330
- info: 3,
331
- success: 3,
332
- fail: 3,
333
- ready: 3,
334
- start: 3,
335
- box: 3,
336
- debug: 4,
337
- trace: 5,
338
- verbose: Number.POSITIVE_INFINITY
339
- };
340
- LogTypes = {
341
- silent: {
342
- level: -1
343
- },
344
- fatal: {
345
- level: LogLevels.fatal
346
- },
347
- error: {
348
- level: LogLevels.error
349
- },
350
- warn: {
351
- level: LogLevels.warn
352
- },
353
- log: {
354
- level: LogLevels.log
355
- },
356
- info: {
357
- level: LogLevels.info
358
- },
359
- success: {
360
- level: LogLevels.success
361
- },
362
- fail: {
363
- level: LogLevels.fail
364
- },
365
- ready: {
366
- level: LogLevels.info
367
- },
368
- start: {
369
- level: LogLevels.info
370
- },
371
- box: {
372
- level: LogLevels.info
373
- },
374
- debug: {
375
- level: LogLevels.debug
376
- },
377
- trace: {
378
- level: LogLevels.trace
379
- },
380
- verbose: {
381
- level: LogLevels.verbose
382
- }
383
- };
384
- defu = createDefu();
385
- queue = [];
386
- Consola.prototype.add = Consola.prototype.addReporter;
387
- Consola.prototype.remove = Consola.prototype.removeReporter;
388
- Consola.prototype.clear = Consola.prototype.removeReporter;
389
- Consola.prototype.withScope = Consola.prototype.withTag;
390
- Consola.prototype.mock = Consola.prototype.mockTypes;
391
- Consola.prototype.pause = Consola.prototype.pauseLogs;
392
- Consola.prototype.resume = Consola.prototype.resumeLogs;
393
- });
394
-
395
- // ../../../../node_modules/consola/dist/shared/consola.06ad8a64.mjs
396
- import {formatWithOptions} from "util";
397
- import {sep} from "path";
398
- function parseStack(stack) {
399
- const cwd = process.cwd() + sep;
400
- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
401
- return lines;
402
- }
403
- function writeStream(data, stream) {
404
- const write = stream.__write || stream.write;
405
- return write.call(stream, data);
406
- }
407
-
408
- class BasicReporter {
409
- formatStack(stack, opts) {
410
- return " " + parseStack(stack).join("\n ");
411
- }
412
- formatArgs(args, opts) {
413
- const _args = args.map((arg) => {
414
- if (arg && typeof arg.stack === "string") {
415
- return arg.message + "\n" + this.formatStack(arg.stack, opts);
416
- }
417
- return arg;
418
- });
419
- return formatWithOptions(opts, ..._args);
420
- }
421
- formatDate(date, opts) {
422
- return opts.date ? date.toLocaleTimeString() : "";
423
- }
424
- filterAndJoin(arr) {
425
- return arr.filter(Boolean).join(" ");
426
- }
427
- formatLogObj(logObj, opts) {
428
- const message = this.formatArgs(logObj.args, opts);
429
- if (logObj.type === "box") {
430
- return "\n" + [
431
- bracket(logObj.tag),
432
- logObj.title && logObj.title,
433
- ...message.split("\n")
434
- ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
435
- }
436
- return this.filterAndJoin([
437
- bracket(logObj.type),
438
- bracket(logObj.tag),
439
- message
440
- ]);
441
- }
442
- log(logObj, ctx) {
443
- const line = this.formatLogObj(logObj, {
444
- columns: ctx.options.stdout.columns || 0,
445
- ...ctx.options.formatOptions
446
- });
447
- return writeStream(line + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
448
- }
449
- }
450
- var bracket = (x) => x ? `[${x}]` : "";
451
- var init_consola_06ad8a64 = () => {
452
- };
453
-
454
- // ../../../../node_modules/consola/dist/utils.mjs
455
- import * as tty from "tty";
456
- 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)) {
457
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
458
- }
459
- function clearBleed(index, string, open, close, replace) {
460
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
461
- }
462
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
463
- return (string) => string || !(string === "" || string === undefined) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
464
- }
465
- function init(open, close, replace) {
466
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
467
- }
468
- function createColors(useColor = isColorSupported) {
469
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
470
- }
471
- function getColor(color, fallback = "reset") {
472
- return colors[color] || colors[fallback];
473
- }
474
- function stripAnsi(text) {
475
- return text.replace(new RegExp(ansiRegex, "g"), "");
476
- }
477
- function box(text, _opts = {}) {
478
- const opts = {
479
- ..._opts,
480
- style: {
481
- ...defaultStyle,
482
- ..._opts.style
483
- }
484
- };
485
- const textLines = text.split("\n");
486
- const boxLines = [];
487
- const _color = getColor(opts.style.borderColor);
488
- const borderStyle = {
489
- ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
490
- };
491
- if (_color) {
492
- for (const key in borderStyle) {
493
- borderStyle[key] = _color(borderStyle[key]);
494
- }
495
- }
496
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
497
- const height = textLines.length + paddingOffset;
498
- const width = Math.max(...textLines.map((line) => line.length)) + paddingOffset;
499
- const widthOffset = width + paddingOffset;
500
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
501
- if (opts.style.marginTop > 0) {
502
- boxLines.push("".repeat(opts.style.marginTop));
503
- }
504
- if (opts.title) {
505
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi(opts.title).length) / 2));
506
- const right = borderStyle.h.repeat(width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset);
507
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${opts.title}${right}${borderStyle.tr}`);
508
- } else {
509
- boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
510
- }
511
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
512
- for (let i = 0;i < height; i++) {
513
- if (i < valignOffset || i >= valignOffset + textLines.length) {
514
- boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
515
- } else {
516
- const line = textLines[i - valignOffset];
517
- const left = " ".repeat(paddingOffset);
518
- const right = " ".repeat(width - stripAnsi(line).length);
519
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
520
- }
521
- }
522
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
523
- if (opts.style.marginBottom > 0) {
524
- boxLines.push("".repeat(opts.style.marginBottom));
525
- }
526
- return boxLines.join("\n");
527
- }
528
- var env, argv, platform, isDisabled, isForced, isWindows, isDumbTerminal, isCompatibleTerminal, isCI, isColorSupported, colorDefs, colors, ansiRegex, boxStylePresets, defaultStyle;
529
- var init_utils = __esm(() => {
530
- ({
531
- env = {},
532
- argv = [],
533
- platform = ""
534
- } = typeof process === "undefined" ? {} : process);
535
- isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
536
- isForced = "FORCE_COLOR" in env || argv.includes("--color");
537
- isWindows = platform === "win32";
538
- isDumbTerminal = env.TERM === "dumb";
539
- isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
540
- isCI = "CI" in env && (("GITHUB_ACTIONS" in env) || ("GITLAB_CI" in env) || ("CIRCLECI" in env));
541
- isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
542
- colorDefs = {
543
- reset: init(0, 0),
544
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
545
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
546
- italic: init(3, 23),
547
- underline: init(4, 24),
548
- inverse: init(7, 27),
549
- hidden: init(8, 28),
550
- strikethrough: init(9, 29),
551
- black: init(30, 39),
552
- red: init(31, 39),
553
- green: init(32, 39),
554
- yellow: init(33, 39),
555
- blue: init(34, 39),
556
- magenta: init(35, 39),
557
- cyan: init(36, 39),
558
- white: init(37, 39),
559
- gray: init(90, 39),
560
- bgBlack: init(40, 49),
561
- bgRed: init(41, 49),
562
- bgGreen: init(42, 49),
563
- bgYellow: init(43, 49),
564
- bgBlue: init(44, 49),
565
- bgMagenta: init(45, 49),
566
- bgCyan: init(46, 49),
567
- bgWhite: init(47, 49),
568
- blackBright: init(90, 39),
569
- redBright: init(91, 39),
570
- greenBright: init(92, 39),
571
- yellowBright: init(93, 39),
572
- blueBright: init(94, 39),
573
- magentaBright: init(95, 39),
574
- cyanBright: init(96, 39),
575
- whiteBright: init(97, 39),
576
- bgBlackBright: init(100, 49),
577
- bgRedBright: init(101, 49),
578
- bgGreenBright: init(102, 49),
579
- bgYellowBright: init(103, 49),
580
- bgBlueBright: init(104, 49),
581
- bgMagentaBright: init(105, 49),
582
- bgCyanBright: init(106, 49),
583
- bgWhiteBright: init(107, 49)
584
- };
585
- colors = createColors();
586
- ansiRegex = [
587
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
588
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
589
- ].join("|");
590
- boxStylePresets = {
591
- solid: {
592
- tl: "\u250C",
593
- tr: "\u2510",
594
- bl: "\u2514",
595
- br: "\u2518",
596
- h: "\u2500",
597
- v: "\u2502"
598
- },
599
- double: {
600
- tl: "\u2554",
601
- tr: "\u2557",
602
- bl: "\u255A",
603
- br: "\u255D",
604
- h: "\u2550",
605
- v: "\u2551"
606
- },
607
- doubleSingle: {
608
- tl: "\u2553",
609
- tr: "\u2556",
610
- bl: "\u2559",
611
- br: "\u255C",
612
- h: "\u2500",
613
- v: "\u2551"
614
- },
615
- doubleSingleRounded: {
616
- tl: "\u256D",
617
- tr: "\u256E",
618
- bl: "\u2570",
619
- br: "\u256F",
620
- h: "\u2500",
621
- v: "\u2551"
622
- },
623
- singleThick: {
624
- tl: "\u250F",
625
- tr: "\u2513",
626
- bl: "\u2517",
627
- br: "\u251B",
628
- h: "\u2501",
629
- v: "\u2503"
630
- },
631
- singleDouble: {
632
- tl: "\u2552",
633
- tr: "\u2555",
634
- bl: "\u2558",
635
- br: "\u255B",
636
- h: "\u2550",
637
- v: "\u2502"
638
- },
639
- singleDoubleRounded: {
640
- tl: "\u256D",
641
- tr: "\u256E",
642
- bl: "\u2570",
643
- br: "\u256F",
644
- h: "\u2550",
645
- v: "\u2502"
646
- },
647
- rounded: {
648
- tl: "\u256D",
649
- tr: "\u256E",
650
- bl: "\u2570",
651
- br: "\u256F",
652
- h: "\u2500",
653
- v: "\u2502"
654
- }
655
- };
656
- defaultStyle = {
657
- borderColor: "white",
658
- borderStyle: "rounded",
659
- valign: "center",
660
- padding: 2,
661
- marginLeft: 1,
662
- marginTop: 1,
663
- marginBottom: 1
664
- };
665
- });
666
-
667
- // ../../../../node_modules/consola/dist/chunks/prompt.mjs
668
- var exports_prompt = {};
669
- __export(exports_prompt, {
670
- prompt: () => prompt
671
- });
672
- import {stdin, stdout} from "process";
673
- import f from "readline";
674
- import {WriteStream} from "tty";
675
- import require$$0 from "tty";
676
- function z({ onlyFirst: t = false } = {}) {
677
- 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("|");
678
- return new RegExp(u, t ? undefined : "g");
679
- }
680
- function $(t) {
681
- if (typeof t != "string")
682
- throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
683
- return t.replace(z(), "");
684
- }
685
- function c(t, u = {}) {
686
- if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $(t), t.length === 0))
687
- return 0;
688
- t = t.replace(Y(), " ");
689
- const F = u.ambiguousIsNarrow ? 1 : 2;
690
- let e = 0;
691
- for (const s of t) {
692
- const C = s.codePointAt(0);
693
- if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879)
694
- continue;
695
- switch (K.eastAsianWidth(s)) {
696
- case "F":
697
- case "W":
698
- e += 2;
699
- break;
700
- case "A":
701
- e += F;
702
- break;
703
- default:
704
- e += 1;
705
- }
706
- }
707
- return e;
708
- }
709
- function U() {
710
- const t = new Map;
711
- for (const [u, F] of Object.entries(r)) {
712
- for (const [e, s] of Object.entries(F))
713
- r[e] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, F[e] = r[e], t.set(s[0], s[1]);
714
- Object.defineProperty(r, u, { value: F, enumerable: false });
715
- }
716
- return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e) => u === F && F === e ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
717
- const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
718
- if (!F)
719
- return [0, 0, 0];
720
- let [e] = F;
721
- e.length === 3 && (e = [...e].map((C) => C + C).join(""));
722
- const s = Number.parseInt(e, 16);
723
- return [s >> 16 & 255, s >> 8 & 255, s & 255];
724
- }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
725
- if (u < 8)
726
- return 30 + u;
727
- if (u < 16)
728
- return 90 + (u - 8);
729
- let F, e, s;
730
- if (u >= 232)
731
- F = ((u - 232) * 10 + 8) / 255, e = F, s = F;
732
- else {
733
- u -= 16;
734
- const i = u % 36;
735
- F = Math.floor(u / 36) / 5, e = Math.floor(i / 6) / 5, s = i % 6 / 5;
736
- }
737
- const C = Math.max(F, e, s) * 2;
738
- if (C === 0)
739
- return 30;
740
- let D = 30 + (Math.round(s) << 2 | Math.round(e) << 1 | Math.round(F));
741
- return C === 2 && (D += 60), D;
742
- }, enumerable: false }, rgbToAnsi: { value: (u, F, e) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
743
- }
744
- function P(t, u, F) {
745
- return String(t).normalize().replace(/\r\n/g, `
2
+ var Fu=Object.defineProperty;var Cu=(u,F)=>{for(var C in F)Fu(u,C,{get:F[C],enumerable:!0,configurable:!0,set:(r)=>F[C]=()=>r})};var k=(u,F)=>()=>(u&&(F=u(u=0)),F);function L(u){return u!==null&&typeof u==="object"}function P(u,F,C=".",r){if(!L(F))return P(u,{},C,r);const E=Object.assign({},F);for(let t in u){if(t==="__proto__"||t==="constructor")continue;const D=u[t];if(D===null||D===void 0)continue;if(r&&r(E,t,D,C))continue;if(Array.isArray(D)&&Array.isArray(E[t]))E[t]=[...D,...E[t]];else if(L(D)&&L(E[t]))E[t]=P(D,E[t],(C?`${C}.`:"")+t.toString(),r);else E[t]=D}return E}function ru(u){return(...F)=>F.reduce((C,r)=>P(C,r,"",u),{})}function tu(u){return Object.prototype.toString.call(u)==="[object Object]"}function su(u){if(!tu(u))return!1;if(!u.message&&!u.args)return!1;if(u.stack)return!1;return!0}function j(u,F={},C=3){if(u===void 0)return C;if(typeof u==="number")return u;if(F[u]&&F[u].level!==void 0)return F[u].level;return C}function vD(u={}){return new v(u)}class v{constructor(u={}){const F=u.types||d;this.options=Eu({...u,defaults:{...u.defaults},level:j(u.level,F),reporters:[...u.reporters||[]]},{types:d,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let C in F){const r={type:C,...this.options.defaults,...F[C]};this[C]=this._wrapLogFn(r),this[C].raw=this._wrapLogFn(r,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(u){this.options.level=j(u,this.options.types,this.options.level)}prompt(u,F){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(u,F)}create(u){const F=new v({...this.options,...u});if(this._mockFn)F.mockTypes(this._mockFn);return F}withDefaults(u){return this.create({...this.options,defaults:{...this.options.defaults,...u}})}withTag(u){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+u:u})}addReporter(u){return this.options.reporters.push(u),this}removeReporter(u){if(u){const F=this.options.reporters.indexOf(u);if(F>=0)return this.options.reporters.splice(F,1)}else this.options.reporters.splice(0);return this}setReporters(u){return this.options.reporters=Array.isArray(u)?u:[u],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let u in this.options.types){if(!console["__"+u])console["__"+u]=console[u];console[u]=this[u].raw}}restoreConsole(){for(let u in this.options.types)if(console["__"+u])console[u]=console["__"+u],delete console["__"+u]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(u,F){if(!u)return;if(!u.__write)u.__write=u.write;u.write=(C)=>{this[F].raw(String(C).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(u){if(!u)return;if(u.__write)u.write=u.__write,delete u.__write}pauseLogs(){O=!0}resumeLogs(){O=!1;const u=bD.splice(0);for(let F of u)F[0]._logFn(F[1],F[2])}mockTypes(u){const F=u||this.options.mockFn;if(this._mockFn=F,typeof F!=="function")return;for(let C in this.options.types)this[C]=F(C,this.options.types[C])||this[C],this[C].raw=this[C]}_wrapLogFn(u,F){return(...C)=>{if(O){bD.push([this,u,C,F]);return}return this._logFn(u,C,F)}}_logFn(u,F,C){if((u.level||0)>this.level)return!1;const r={date:new Date,args:[],...u,level:j(u.level,this.options.types)};if(!C&&F.length===1&&su(F[0]))Object.assign(r,F[0]);else r.args=[...F];if(r.message)r.args.unshift(r.message),delete r.message;if(r.additional){if(!Array.isArray(r.additional))r.additional=r.additional.split("\n");r.args.push("\n"+r.additional.join("\n")),delete r.additional}r.type=typeof r.type==="string"?r.type.toLowerCase():"log",r.tag=typeof r.tag==="string"?r.tag:"";const E=(D=!1)=>{const h=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&h>0){const l=[...this._lastLog.object.args];if(h>1)l.push(`(repeated ${h} times)`);this._log({...this._lastLog.object,args:l}),this._lastLog.count=1}if(D)this._lastLog.object=r,this._log(r)};clearTimeout(this._lastLog.timeout);const t=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,t<this.options.throttle)try{const D=JSON.stringify([r.type,r.tag,r.args]),h=this._lastLog.serialized===D;if(this._lastLog.serialized=D,h){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout(E,this.options.throttle);return}}}catch{}E(!0)}_log(u){for(let F of this.options.reporters)F.log(u,{options:this.options})}}var b,d,Eu,O=!1,bD;var N=k(()=>{b={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},d={silent:{level:-1},fatal:{level:b.fatal},error:{level:b.error},warn:{level:b.warn},log:{level:b.log},info:{level:b.info},success:{level:b.success},fail:{level:b.fail},ready:{level:b.info},start:{level:b.info},box:{level:b.info},debug:{level:b.debug},trace:{level:b.trace},verbose:{level:b.verbose}},Eu=ru(),bD=[];v.prototype.add=v.prototype.addReporter;v.prototype.remove=v.prototype.removeReporter;v.prototype.clear=v.prototype.removeReporter;v.prototype.withScope=v.prototype.withTag;v.prototype.mock=v.prototype.mockTypes;v.prototype.pause=v.prototype.pauseLogs;v.prototype.resume=v.prototype.resumeLogs});import{formatWithOptions as hu}from"util";import{sep as Bu}from"path";function DD(u){const F=process.cwd()+Bu;return u.split("\n").splice(1).map((r)=>r.trim().replace("file://","").replace(F,""))}function iu(u,F){return(F.__write||F.write).call(F,u)}class z{formatStack(u,F){return" "+DD(u).join("\n ")}formatArgs(u,F){const C=u.map((r)=>{if(r&&typeof r.stack==="string")return r.message+"\n"+this.formatStack(r.stack,F);return r});return hu(F,...C)}formatDate(u,F){return F.date?u.toLocaleTimeString():""}filterAndJoin(u){return u.filter(Boolean).join(" ")}formatLogObj(u,F){const C=this.formatArgs(u.args,F);if(u.type==="box")return"\n"+[o(u.tag),u.title&&u.title,...C.split("\n")].filter(Boolean).map((r)=>" > "+r).join("\n")+"\n";return this.filterAndJoin([o(u.type),o(u.tag),C])}log(u,F){const C=this.formatLogObj(u,{columns:F.options.stdout.columns||0,...F.options.formatOptions});return iu(C+"\n",u.level<2?F.options.stderr||process.stderr:F.options.stdout||process.stdout)}}var o=(u)=>u?`[${u}]`:"";var Z=()=>{};import*as H from"tty";function SD(u,F,C,r,E=F.slice(0,Math.max(0,u))+r,t=F.slice(Math.max(0,u+C.length)),D=t.indexOf(C)){return E+(D<0?t:SD(D,t,C,r))}function mu(u,F,C,r,E){return u<0?C+F+r:C+SD(u,F,r,E)+r}function bu(u,F,C=u,r=u.length+1){return(E)=>E||!(E===""||E===void 0)?mu((""+E).indexOf(F,r),E,u,F,C):""}function B(u,F,C){return bu(`\x1B[${u}m`,`\x1B[${F}m`,C)}function vu(u=fu){return u?xD:Object.fromEntries(Object.keys(xD).map((F)=>[F,String]))}function xu(u,F="reset"){return s[u]||s[F]}function M(u){return u.replace(new RegExp(pu,"g"),"")}function gD(u,F={}){const C={...F,style:{...wu,...F.style}},r=u.split("\n"),E=[],t=xu(C.style.borderColor),D={...typeof C.style.borderStyle==="string"?pD[C.style.borderStyle]||pD.solid:C.style.borderStyle};if(t)for(let m in D)D[m]=t(D[m]);const h=C.style.padding%2===0?C.style.padding:C.style.padding+1,l=r.length+h,i=Math.max(...r.map((m)=>m.length))+h,f=i+h,e=C.style.marginLeft>0?" ".repeat(C.style.marginLeft):"";if(C.style.marginTop>0)E.push("".repeat(C.style.marginTop));if(C.title){const m=D.h.repeat(Math.floor((i-M(C.title).length)/2)),K=D.h.repeat(i-M(C.title).length-M(m).length+h);E.push(`${e}${D.tl}${m}${C.title}${K}${D.tr}`)}else E.push(`${e}${D.tl}${D.h.repeat(f)}${D.tr}`);const x=C.style.valign==="center"?Math.floor((l-r.length)/2):C.style.valign==="top"?l-r.length-h:l-r.length;for(let m=0;m<l;m++)if(m<x||m>=x+r.length)E.push(`${e}${D.v}${" ".repeat(f)}${D.v}`);else{const K=r[m-x],Du=" ".repeat(h),uu=" ".repeat(i-M(K).length);E.push(`${e}${D.v}${Du}${K}${uu}${D.v}`)}if(E.push(`${e}${D.bl}${D.h.repeat(f)}${D.br}`),C.style.marginBottom>0)E.push("".repeat(C.style.marginBottom));return E.join("\n")}var g,wD,eu,lu,Au,au,yD,nu,$u,fu,xD,s,pu,pD,wu;var q=k(()=>{({env:g={},argv:wD=[],platform:eu=""}=typeof process==="undefined"?{}:process),lu="NO_COLOR"in g||wD.includes("--no-color"),Au="FORCE_COLOR"in g||wD.includes("--color"),au=eu==="win32",yD=g.TERM==="dumb",nu=H&&H.isatty&&H.isatty(1)&&g.TERM&&!yD,$u="CI"in g&&(("GITHUB_ACTIONS"in g)||("GITLAB_CI"in g)||("CIRCLECI"in g)),fu=!lu&&(Au||au&&!yD||nu||$u),xD={reset:B(0,0),bold:B(1,22,"\x1B[22m\x1B[1m"),dim:B(2,22,"\x1B[22m\x1B[2m"),italic:B(3,23),underline:B(4,24),inverse:B(7,27),hidden:B(8,28),strikethrough:B(9,29),black:B(30,39),red:B(31,39),green:B(32,39),yellow:B(33,39),blue:B(34,39),magenta:B(35,39),cyan:B(36,39),white:B(37,39),gray:B(90,39),bgBlack:B(40,49),bgRed:B(41,49),bgGreen:B(42,49),bgYellow:B(43,49),bgBlue:B(44,49),bgMagenta:B(45,49),bgCyan:B(46,49),bgWhite:B(47,49),blackBright:B(90,39),redBright:B(91,39),greenBright:B(92,39),yellowBright:B(93,39),blueBright:B(94,39),magentaBright:B(95,39),cyanBright:B(96,39),whiteBright:B(97,39),bgBlackBright:B(100,49),bgRedBright:B(101,49),bgGreenBright:B(102,49),bgYellowBright:B(103,49),bgBlueBright:B(104,49),bgMagentaBright:B(105,49),bgCyanBright:B(106,49),bgWhiteBright:B(107,49)},s=vu(),pu=["[\\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("|"),pD={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"}},wu={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1}});var QD={};Cu(QD,{prompt:()=>s2});import{stdin as yu,stdout as Su}from"process";import _D from"readline";import{WriteStream as gu}from"tty";import _u from"tty";function Ru({onlyFirst:u=!1}={}){const F=["[\\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(F,u?void 0:"g")}function zD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Ru(),"")}function I(u,F={}){if(typeof u!="string"||u.length===0||(F={ambiguousIsNarrow:!0,...F},u=zD(u),u.length===0))return 0;u=u.replace(Nu()," ");const C=F.ambiguousIsNarrow?1:2;let r=0;for(let E of u){const t=E.codePointAt(0);if(t<=31||t>=127&&t<=159||t>=768&&t<=879)continue;switch(Ku.eastAsianWidth(E)){case"F":case"W":r+=2;break;case"A":r+=C;break;default:r+=1}}return r}function Hu(){const u=new Map;for(let[F,C]of Object.entries(n)){for(let[r,E]of Object.entries(C))n[r]={open:`\x1B[${E[0]}m`,close:`\x1B[${E[1]}m`},C[r]=n[r],u.set(E[0],E[1]);Object.defineProperty(n,F,{value:C,enumerable:!1})}return Object.defineProperty(n,"codes",{value:u,enumerable:!1}),n.color.close="\x1B[39m",n.bgColor.close="\x1B[49m",n.color.ansi=MD(),n.color.ansi256=VD(),n.color.ansi16m=TD(),n.bgColor.ansi=MD(FD),n.bgColor.ansi256=VD(FD),n.bgColor.ansi16m=TD(FD),Object.defineProperties(n,{rgbToAnsi256:{value:(F,C,r)=>F===C&&C===r?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(C/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:(F)=>{const C=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!C)return[0,0,0];let[r]=C;r.length===3&&(r=[...r].map((t)=>t+t).join(""));const E=Number.parseInt(r,16);return[E>>16&255,E>>8&255,E&255]},enumerable:!1},hexToAnsi256:{value:(F)=>n.rgbToAnsi256(...n.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value:(F)=>{if(F<8)return 30+F;if(F<16)return 90+(F-8);let C,r,E;if(F>=232)C=((F-232)*10+8)/255,r=C,E=C;else{F-=16;const h=F%36;C=Math.floor(F/36)/5,r=Math.floor(h/6)/5,E=h%6/5}const t=Math.max(C,r,E)*2;if(t===0)return 30;let D=30+(Math.round(E)<<2|Math.round(r)<<1|Math.round(C));return t===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(F,C,r)=>n.ansi256ToAnsi(n.rgbToAnsi256(F,C,r)),enumerable:!1},hexToAnsi:{value:(F)=>n.ansi256ToAnsi(n.hexToAnsi256(F)),enumerable:!1}}),n}function WD(u,F,C){return String(u).normalize().replace(/\r\n/g,`
746
3
  `).split(`
747
- `).map((e) => uD(e, u, F)).join(`
748
- `);
749
- }
750
- function FD(t, u) {
751
- if (t === u)
752
- return;
753
- const F = t.split(`
754
- `), e = u.split(`
755
- `), s = [];
756
- for (let C = 0;C < Math.max(F.length, e.length); C++)
757
- F[C] !== e[C] && s.push(C);
758
- return s;
759
- }
760
- function g(t, u) {
761
- t.isTTY && t.setRawMode(u);
762
- }
763
- async function prompt(message, opts = {}) {
764
- if (!opts.type || opts.type === "text") {
765
- return await text({
766
- message,
767
- defaultValue: opts.default,
768
- placeholder: opts.placeholder,
769
- initialValue: opts.initial
770
- });
771
- }
772
- if (opts.type === "confirm") {
773
- return await confirm({
774
- message,
775
- initialValue: opts.initial
776
- });
777
- }
778
- if (opts.type === "select") {
779
- return await select({
780
- message,
781
- options: opts.options.map((o) => typeof o === "string" ? { value: o, label: o } : o)
782
- });
783
- }
784
- if (opts.type === "multiselect") {
785
- return await multiselect({
786
- message,
787
- options: opts.options.map((o) => typeof o === "string" ? { value: o, label: o } : o),
788
- required: opts.required
789
- });
790
- }
791
- throw new Error(`Unknown prompt type: ${opts.type}`);
792
- }
793
-
794
- class h {
795
- constructor({ render: u, input: F = stdin, output: e = stdout, ...s }, C = true) {
796
- this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = new Map, this._prevFrame = "", this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
797
- }
798
- prompt() {
799
- const u = new WriteStream(0);
800
- return u._write = (F, e, s) => {
801
- this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
802
- }, this.input.pipe(u), this.rl = f.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== undefined && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
803
- this.once("submit", () => {
804
- this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(this.value);
805
- }), this.once("cancel", () => {
806
- this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(R);
807
- });
808
- });
809
- }
810
- on(u, F) {
811
- const e = this.subscribers.get(u) ?? [];
812
- e.push({ cb: F }), this.subscribers.set(u, e);
813
- }
814
- once(u, F) {
815
- const e = this.subscribers.get(u) ?? [];
816
- e.push({ cb: F, once: true }), this.subscribers.set(u, e);
817
- }
818
- emit(u, ...F) {
819
- const e = this.subscribers.get(u) ?? [], s = [];
820
- for (const C of e)
821
- C.cb(...F), C.once && s.push(() => e.splice(e.indexOf(C), 1));
822
- for (const C of s)
823
- C();
824
- }
825
- unsubscribe() {
826
- this.subscribers.clear();
827
- }
828
- onKeypress(u, F) {
829
- if (this.state === "error" && (this.state = "active"), F?.name && !this._track && V.has(F.name) && this.emit("cursor", V.get(F.name)), F?.name && tD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
830
- if (this.opts.validate) {
831
- const e = this.opts.validate(this.value);
832
- e && (this.error = e, this.state = "error", this.rl.write(this.value));
833
- }
834
- this.state !== "error" && (this.state = "submit");
835
- }
836
- u === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
837
- }
838
- close() {
839
- this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
840
- `), g(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
841
- }
842
- restoreCursor() {
843
- const u = P(this._prevFrame, process.stdout.columns, { hard: true }).split(`
844
- `).length - 1;
845
- this.output.write(src.cursor.move(-999, u * -1));
846
- }
847
- render() {
848
- const u = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
849
- if (u !== this._prevFrame) {
850
- if (this.state === "initial")
851
- this.output.write(src.cursor.hide);
852
- else {
853
- const F = FD(this._prevFrame, u);
854
- if (this.restoreCursor(), F && F?.length === 1) {
855
- const e = F[0];
856
- this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.lines(1));
857
- const s = u.split(`
858
- `);
859
- this.output.write(s[e]), this._prevFrame = u, this.output.write(src.cursor.move(0, s.length - e - 1));
860
- return;
861
- } else if (F && F?.length > 1) {
862
- const e = F[0];
863
- this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.down());
864
- const C = u.split(`
865
- `).slice(e);
866
- this.output.write(C.join(`
867
- `)), this._prevFrame = u;
868
- return;
869
- }
870
- this.output.write(src.erase.down());
871
- }
872
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
873
- }
874
- }
875
- }
876
- var ESC = "\x1B", CSI, beep = "\x07", cursor, scroll, erase, src, picocolors, tty2, isColorSupported2, formatter = (open, close, replace = open) => (input) => {
877
- let string = "" + input;
878
- let index = string.indexOf(close, open.length);
879
- return ~index ? open + replaceClose2(string, close, replace, index) + close : open + string + close;
880
- }, replaceClose2 = (string, close, replace, index) => {
881
- let start = string.substring(0, index) + replace;
882
- let end = string.substring(index + close.length);
883
- let nextIndex = end.indexOf(close);
884
- return ~nextIndex ? start + replaceClose2(end, close, replace, nextIndex) : start + end;
885
- }, createColors2 = (enabled = isColorSupported2) => ({
886
- isColorSupported: enabled,
887
- reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
888
- bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
889
- dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
890
- italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
891
- underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
892
- inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
893
- hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
894
- strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
895
- black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
896
- red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
897
- green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
898
- yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
899
- blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
900
- magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
901
- cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
902
- white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
903
- gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
904
- bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
905
- bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
906
- bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
907
- bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
908
- bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
909
- bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
910
- bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
911
- bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
912
- }), picocolorsExports, l, m, G, K, Y = function() {
913
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
914
- }, v = 10, L = (t = 0) => (u) => `\x1B[${u + t}m`, M = (t = 0) => (u) => `\x1B[${38 + t};5;${u}m`, T = (t = 0) => (u, F, e) => `\x1B[${38 + t};2;${u};${F};${e}m`, r, Z, H, q, p, J = 39, b = "\x07", W = "[", Q = "]", I = "m", w, N = (t) => `${p.values().next().value}${W}${t}${I}`, j = (t) => `${p.values().next().value}${w}${t}${b}`, X = (t) => t.split(" ").map((u) => c(u)), _ = (t, u, F) => {
915
- const e = [...u];
916
- let s = false, C = false, D = c($(t[t.length - 1]));
917
- for (const [i, o] of e.entries()) {
918
- const E = c(o);
919
- if (D + E <= F ? t[t.length - 1] += o : (t.push(o), D = 0), p.has(o) && (s = true, C = e.slice(i + 1).join("").startsWith(w)), s) {
920
- C ? o === b && (s = false, C = false) : o === I && (s = false);
921
- continue;
922
- }
923
- D += E, D === F && i < e.length - 1 && (t.push(""), D = 0);
924
- }
925
- !D && t[t.length - 1].length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
926
- }, DD = (t) => {
927
- const u = t.split(" ");
928
- let F = u.length;
929
- for (;F > 0 && !(c(u[F - 1]) > 0); )
930
- F--;
931
- return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
932
- }, uD = (t, u, F = {}) => {
933
- if (F.trim !== false && t.trim() === "")
934
- return "";
935
- let e = "", s, C;
936
- const D = X(t);
937
- let i = [""];
938
- for (const [E, a] of t.split(" ").entries()) {
939
- F.trim !== false && (i[i.length - 1] = i[i.length - 1].trimStart());
940
- let n = c(i[i.length - 1]);
941
- if (E !== 0 && (n >= u && (F.wordWrap === false || F.trim === false) && (i.push(""), n = 0), (n > 0 || F.trim === false) && (i[i.length - 1] += " ", n++)), F.hard && D[E] > u) {
942
- const B = u - n, A = 1 + Math.floor((D[E] - B - 1) / u);
943
- Math.floor((D[E] - 1) / u) < A && i.push(""), _(i, a, u);
944
- continue;
945
- }
946
- if (n + D[E] > u && n > 0 && D[E] > 0) {
947
- if (F.wordWrap === false && n < u) {
948
- _(i, a, u);
949
- continue;
950
- }
951
- i.push("");
952
- }
953
- if (n + D[E] > u && F.wordWrap === false) {
954
- _(i, a, u);
955
- continue;
956
- }
957
- i[i.length - 1] += a;
958
- }
959
- F.trim !== false && (i = i.map((E) => DD(E)));
960
- const o = [...i.join(`
961
- `)];
962
- for (const [E, a] of o.entries()) {
963
- if (e += a, p.has(a)) {
964
- const { groups: B } = new RegExp(`(?:\\${W}(?<code>\\d+)m|\\${w}(?<uri>.*)${b})`).exec(o.slice(E).join("")) || { groups: {} };
965
- if (B.code !== undefined) {
966
- const A = Number.parseFloat(B.code);
967
- s = A === J ? undefined : A;
968
- } else
969
- B.uri !== undefined && (C = B.uri.length === 0 ? undefined : B.uri);
970
- }
971
- const n = q.codes.get(Number(s));
972
- o[E + 1] === `
973
- ` ? (C && (e += j("")), s && n && (e += N(n))) : a === `
974
- ` && (s && n && (e += N(s)), C && (e += j(C)));
975
- }
976
- return e;
977
- }, R, V, tD, sD, iD, ED, oD, unicode, s = (c2, fallback) => unicode ? c2 : fallback, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_BAR = "", S_BAR_END = "", S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_CHECKBOX_ACTIVE, S_CHECKBOX_SELECTED, S_CHECKBOX_INACTIVE, symbol = (state) => {
978
- switch (state) {
979
- case "initial":
980
- case "active": {
981
- return colors.cyan(S_STEP_ACTIVE);
982
- }
983
- case "cancel": {
984
- return colors.red(S_STEP_CANCEL);
985
- }
986
- case "error": {
987
- return colors.yellow(S_STEP_ERROR);
988
- }
989
- case "submit": {
990
- return colors.green(S_STEP_SUBMIT);
991
- }
992
- }
993
- }, text = (opts) => {
994
- return new oD({
995
- validate: opts.validate,
996
- placeholder: opts.placeholder,
997
- defaultValue: opts.defaultValue,
998
- initialValue: opts.initialValue,
999
- render() {
1000
- const title = `${colors.gray(S_BAR)}
1001
- ${symbol(this.state)} ${opts.message}
1002
- `;
1003
- const placeholder = opts.placeholder ? colors.inverse(opts.placeholder[0]) + colors.dim(opts.placeholder.slice(1)) : colors.inverse(colors.hidden("_"));
1004
- const value = this.value ? this.valueWithCursor : placeholder;
1005
- switch (this.state) {
1006
- case "error": {
1007
- return `${title.trim()}
1008
- ${colors.yellow(S_BAR)} ${value}
1009
- ${colors.yellow(S_BAR_END)} ${colors.yellow(this.error)}
1010
- `;
1011
- }
1012
- case "submit": {
1013
- return `${title}${colors.gray(S_BAR)} ${colors.dim(this.value || opts.placeholder)}`;
1014
- }
1015
- case "cancel": {
1016
- return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(colors.dim(this.value ?? ""))}${this.value?.trim() ? "\n" + colors.gray(S_BAR) : ""}`;
1017
- }
1018
- default: {
1019
- return `${title}${colors.cyan(S_BAR)} ${value}
1020
- ${colors.cyan(S_BAR_END)}
1021
- `;
1022
- }
1023
- }
1024
- }
1025
- }).prompt();
1026
- }, confirm = (opts) => {
1027
- const active = opts.active ?? "Yes";
1028
- const inactive = opts.inactive ?? "No";
1029
- return new sD({
1030
- active,
1031
- inactive,
1032
- initialValue: opts.initialValue ?? true,
1033
- render() {
1034
- const title = `${colors.gray(S_BAR)}
1035
- ${symbol(this.state)} ${opts.message}
1036
- `;
1037
- const value = this.value ? active : inactive;
1038
- switch (this.state) {
1039
- case "submit": {
1040
- return `${title}${colors.gray(S_BAR)} ${colors.dim(value)}`;
1041
- }
1042
- case "cancel": {
1043
- return `${title}${colors.gray(S_BAR)} ${colors.strikethrough(colors.dim(value))}
1044
- ${colors.gray(S_BAR)}`;
1045
- }
1046
- default: {
1047
- return `${title}${colors.cyan(S_BAR)} ${this.value ? `${colors.green(S_RADIO_ACTIVE)} ${active}` : `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(active)}`} ${colors.dim("/")} ${this.value ? `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(inactive)}` : `${colors.green(S_RADIO_ACTIVE)} ${inactive}`}
1048
- ${colors.cyan(S_BAR_END)}
1049
- `;
1050
- }
1051
- }
1052
- }
1053
- }).prompt();
1054
- }, select = (opts) => {
1055
- const opt = (option, state) => {
1056
- const label = option.label ?? String(option.value);
1057
- switch (state) {
1058
- case "active": {
1059
- return `${colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1060
- }
1061
- case "selected": {
1062
- return `${colors.dim(label)}`;
1063
- }
1064
- case "cancelled": {
1065
- return `${colors.strikethrough(colors.dim(label))}`;
1066
- }
1067
- }
1068
- return `${colors.dim(S_RADIO_INACTIVE)} ${colors.dim(label)}`;
1069
- };
1070
- return new ED({
1071
- options: opts.options,
1072
- initialValue: opts.initialValue,
1073
- render() {
1074
- const title = `${colors.gray(S_BAR)}
1075
- ${symbol(this.state)} ${opts.message}
1076
- `;
1077
- switch (this.state) {
1078
- case "submit": {
1079
- return `${title}${colors.gray(S_BAR)} ${opt(this.options[this.cursor], "selected")}`;
1080
- }
1081
- case "cancel": {
1082
- return `${title}${colors.gray(S_BAR)} ${opt(this.options[this.cursor], "cancelled")}
1083
- ${colors.gray(S_BAR)}`;
1084
- }
1085
- default: {
1086
- return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => opt(option, i === this.cursor ? "active" : "inactive")).join(`
1087
- ${colors.cyan(S_BAR)} `)}
1088
- ${colors.cyan(S_BAR_END)}
1089
- `;
1090
- }
1091
- }
1092
- }
1093
- }).prompt();
1094
- }, multiselect = (opts) => {
1095
- const opt = (option, state) => {
1096
- const label = option.label ?? String(option.value);
1097
- switch (state) {
1098
- case "active": {
1099
- return `${colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1100
- }
1101
- case "selected": {
1102
- return `${colors.green(S_CHECKBOX_SELECTED)} ${colors.dim(label)}`;
1103
- }
1104
- case "cancelled": {
1105
- return `${colors.strikethrough(colors.dim(label))}`;
1106
- }
1107
- case "active-selected": {
1108
- return `${colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? colors.dim(`(${option.hint})`) : ""}`;
1109
- }
1110
- case "submitted": {
1111
- return `${colors.dim(label)}`;
1112
- }
1113
- }
1114
- return `${colors.dim(S_CHECKBOX_INACTIVE)} ${colors.dim(label)}`;
1115
- };
1116
- return new iD({
1117
- options: opts.options,
1118
- initialValues: opts.initialValues,
1119
- required: opts.required ?? true,
1120
- cursorAt: opts.cursorAt,
1121
- validate(selected) {
1122
- if (this.required && selected.length === 0) {
1123
- return `Please select at least one option.
1124
- ${colors.reset(colors.dim(`Press ${colors.gray(colors.bgWhite(colors.inverse(" space ")))} to select, ${colors.gray(colors.bgWhite(colors.inverse(" enter ")))} to submit`))}`;
1125
- }
1126
- },
1127
- render() {
1128
- const title = `${colors.gray(S_BAR)}
1129
- ${symbol(this.state)} ${opts.message}
1130
- `;
1131
- switch (this.state) {
1132
- case "submit": {
1133
- return `${title}${colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(colors.dim(", ")) || colors.dim("none")}`;
1134
- }
1135
- case "cancel": {
1136
- const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(colors.dim(", "));
1137
- return `${title}${colors.gray(S_BAR)} ${label.trim() ? `${label}
1138
- ${colors.gray(S_BAR)}` : ""}`;
1139
- }
1140
- case "error": {
1141
- const footer = this.error.split("\n").map((ln, i) => i === 0 ? `${colors.yellow(S_BAR_END)} ${colors.yellow(ln)}` : ` ${ln}`).join("\n");
1142
- return title + colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
1143
- const selected = this.value.includes(option.value);
1144
- const active = i === this.cursor;
1145
- if (active && selected) {
1146
- return opt(option, "active-selected");
1147
- }
1148
- if (selected) {
1149
- return opt(option, "selected");
1150
- }
1151
- return opt(option, active ? "active" : "inactive");
1152
- }).join(`
1153
- ${colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
1154
- }
1155
- default: {
1156
- return `${title}${colors.cyan(S_BAR)} ${this.options.map((option, i) => {
1157
- const selected = this.value.includes(option.value);
1158
- const active = i === this.cursor;
1159
- if (active && selected) {
1160
- return opt(option, "active-selected");
1161
- }
1162
- if (selected) {
1163
- return opt(option, "selected");
1164
- }
1165
- return opt(option, active ? "active" : "inactive");
1166
- }).join(`
1167
- ${colors.cyan(S_BAR)} `)}
1168
- ${colors.cyan(S_BAR_END)}
1169
- `;
1170
- }
1171
- }
1172
- }
1173
- }).prompt();
1174
- };
1175
- var init_prompt = __esm(() => {
1176
- init_consola_36c0034f();
1177
- init_utils();
1178
- init_core();
1179
- init_consola_06ad8a64();
1180
- CSI = `${ESC}[`;
1181
- cursor = {
1182
- to(x, y) {
1183
- if (!y)
1184
- return `${CSI}${x + 1}G`;
1185
- return `${CSI}${y + 1};${x + 1}H`;
1186
- },
1187
- move(x, y) {
1188
- let ret = "";
1189
- if (x < 0)
1190
- ret += `${CSI}${-x}D`;
1191
- else if (x > 0)
1192
- ret += `${CSI}${x}C`;
1193
- if (y < 0)
1194
- ret += `${CSI}${-y}A`;
1195
- else if (y > 0)
1196
- ret += `${CSI}${y}B`;
1197
- return ret;
1198
- },
1199
- up: (count = 1) => `${CSI}${count}A`,
1200
- down: (count = 1) => `${CSI}${count}B`,
1201
- forward: (count = 1) => `${CSI}${count}C`,
1202
- backward: (count = 1) => `${CSI}${count}D`,
1203
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
1204
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
1205
- left: `${CSI}G`,
1206
- hide: `${CSI}?25l`,
1207
- show: `${CSI}?25h`,
1208
- save: `${ESC}7`,
1209
- restore: `${ESC}8`
1210
- };
1211
- scroll = {
1212
- up: (count = 1) => `${CSI}S`.repeat(count),
1213
- down: (count = 1) => `${CSI}T`.repeat(count)
1214
- };
1215
- erase = {
1216
- screen: `${CSI}2J`,
1217
- up: (count = 1) => `${CSI}1J`.repeat(count),
1218
- down: (count = 1) => `${CSI}J`.repeat(count),
1219
- line: `${CSI}2K`,
1220
- lineEnd: `${CSI}K`,
1221
- lineStart: `${CSI}1K`,
1222
- lines(count) {
1223
- let clear = "";
1224
- for (let i = 0;i < count; i++)
1225
- clear += this.line + (i < count - 1 ? cursor.up() : "");
1226
- if (count)
1227
- clear += cursor.left;
1228
- return clear;
1229
- }
1230
- };
1231
- src = { cursor, scroll, erase, beep };
1232
- picocolors = { exports: {} };
1233
- tty2 = require$$0;
1234
- isColorSupported2 = !(("NO_COLOR" in process.env) || process.argv.includes("--no-color")) && (("FORCE_COLOR" in process.env) || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || ("CI" in process.env));
1235
- picocolors.exports = createColors2();
1236
- picocolors.exports.createColors = createColors2;
1237
- picocolorsExports = picocolors.exports;
1238
- l = /* @__PURE__ */ getDefaultExportFromCjs(picocolorsExports);
1239
- m = {};
1240
- G = { get exports() {
1241
- return m;
1242
- }, set exports(t) {
1243
- m = t;
1244
- } };
1245
- (function(t) {
1246
- var u = {};
1247
- t.exports = u, u.eastAsianWidth = function(e) {
1248
- var s = e.charCodeAt(0), C = e.length == 2 ? e.charCodeAt(1) : 0, D = s;
1249
- return 55296 <= s && s <= 56319 && 56320 <= C && C <= 57343 && (s &= 1023, C &= 1023, D = s << 10 | C, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && 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 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
1250
- }, u.characterLength = function(e) {
1251
- var s = this.eastAsianWidth(e);
1252
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
1253
- };
1254
- function F(e) {
1255
- return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1256
- }
1257
- u.length = function(e) {
1258
- for (var s = F(e), C = 0, D = 0;D < s.length; D++)
1259
- C = C + this.characterLength(s[D]);
1260
- return C;
1261
- }, u.slice = function(e, s, C) {
1262
- textLen = u.length(e), s = s || 0, C = C || 1, s < 0 && (s = textLen + s), C < 0 && (C = textLen + C);
1263
- for (var D = "", i = 0, o = F(e), E = 0;E < o.length; E++) {
1264
- var a = o[E], n = u.length(a);
1265
- if (i >= s - (n == 2 ? 1 : 0))
1266
- if (i + n <= C)
1267
- D += a;
1268
- else
1269
- break;
1270
- i += n;
1271
- }
1272
- return D;
1273
- };
1274
- })(G);
1275
- K = m;
1276
- r = { 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] } };
1277
- Object.keys(r.modifier);
1278
- Z = Object.keys(r.color);
1279
- H = Object.keys(r.bgColor);
1280
- [...Z];
1281
- q = U();
1282
- p = new Set(["\x1B", "\x9B"]);
1283
- w = `${Q}8;;`;
1284
- R = Symbol("clack:cancel");
1285
- V = new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
1286
- tD = new Set(["up", "down", "left", "right", "space", "enter"]);
1287
- sD = class sD extends h {
1288
- get cursor() {
1289
- return this.value ? 0 : 1;
1290
- }
1291
- get _value() {
1292
- return this.cursor === 0;
1293
- }
1294
- constructor(u) {
1295
- super(u, false), this.value = !!u.initialValue, this.on("value", () => {
1296
- this.value = this._value;
1297
- }), this.on("confirm", (F) => {
1298
- this.output.write(src.cursor.move(0, -1)), this.value = F, this.state = "submit", this.close();
1299
- }), this.on("cursor", () => {
1300
- this.value = !this.value;
1301
- });
1302
- }
1303
- };
1304
- iD = class iD extends h {
1305
- constructor(u) {
1306
- super(u, false), this.cursor = 0, this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
1307
- F === "a" && this.toggleAll();
1308
- }), this.on("cursor", (F) => {
1309
- switch (F) {
1310
- case "left":
1311
- case "up":
1312
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1313
- break;
1314
- case "down":
1315
- case "right":
1316
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1317
- break;
1318
- case "space":
1319
- this.toggleValue();
1320
- break;
1321
- }
1322
- });
1323
- }
1324
- get _value() {
1325
- return this.options[this.cursor].value;
1326
- }
1327
- toggleAll() {
1328
- const u = this.value.length === this.options.length;
1329
- this.value = u ? [] : this.options.map((F) => F.value);
1330
- }
1331
- toggleValue() {
1332
- const u = this.value.includes(this._value);
1333
- this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
1334
- }
1335
- };
1336
- ED = class ED extends h {
1337
- constructor(u) {
1338
- super(u, false), this.cursor = 0, this.options = u.options, this.cursor = this.options.findIndex(({ value: F }) => F === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F) => {
1339
- switch (F) {
1340
- case "left":
1341
- case "up":
1342
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1343
- break;
1344
- case "down":
1345
- case "right":
1346
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1347
- break;
1348
- }
1349
- this.changeValue();
1350
- });
1351
- }
1352
- get _value() {
1353
- return this.options[this.cursor];
1354
- }
1355
- changeValue() {
1356
- this.value = this._value.value;
1357
- }
1358
- };
1359
- oD = class oD extends h {
1360
- constructor(u) {
1361
- super(u), this.valueWithCursor = "", this.on("finalize", () => {
1362
- this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
1363
- }), this.on("value", () => {
1364
- if (this.cursor >= this.value.length)
1365
- this.valueWithCursor = `${this.value}${l.inverse(l.hidden("_"))}`;
1366
- else {
1367
- const F = this.value.slice(0, this.cursor), e = this.value.slice(this.cursor);
1368
- this.valueWithCursor = `${F}${l.inverse(e[0])}${e.slice(1)}`;
1369
- }
1370
- });
1371
- }
1372
- get cursor() {
1373
- return this._cursor;
1374
- }
1375
- };
1376
- unicode = isUnicodeSupported();
1377
- S_STEP_ACTIVE = s("\u276F", ">");
1378
- S_STEP_CANCEL = s("\u25A0", "x");
1379
- S_STEP_ERROR = s("\u25B2", "x");
1380
- S_STEP_SUBMIT = s("\u2714", "\u221A");
1381
- S_RADIO_ACTIVE = s("\u25CF", ">");
1382
- S_RADIO_INACTIVE = s("\u25CB", " ");
1383
- S_CHECKBOX_ACTIVE = s("\u25FB", "[\u2022]");
1384
- S_CHECKBOX_SELECTED = s("\u25FC", "[+]");
1385
- S_CHECKBOX_INACTIVE = s("\u25FB", "[ ]");
1386
- });
1387
-
1388
- // ../../../../node_modules/consola/dist/shared/consola.36c0034f.mjs
1389
- import process$1 from "process";
1390
- function detectProvider(env2) {
1391
- for (const provider of providers) {
1392
- const envName = provider[1] || provider[0];
1393
- if (env2[envName]) {
1394
- return {
1395
- name: provider[0].toLowerCase(),
1396
- ...provider[2]
1397
- };
1398
- }
1399
- }
1400
- if (env2.SHELL && env2.SHELL === "/bin/jsh") {
1401
- return {
1402
- name: "stackblitz",
1403
- ci: false
1404
- };
1405
- }
1406
- return {
1407
- name: "",
1408
- ci: false
1409
- };
1410
- }
1411
- function toBoolean(val) {
1412
- return val ? val !== "false" : false;
1413
- }
1414
- function ansiRegex2({ onlyFirst = false } = {}) {
1415
- const pattern = [
1416
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
1417
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
1418
- ].join("|");
1419
- return new RegExp(pattern, onlyFirst ? undefined : "g");
1420
- }
1421
- function stripAnsi2(string) {
1422
- if (typeof string !== "string") {
1423
- throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
1424
- }
1425
- return string.replace(regex, "");
1426
- }
1427
- function getDefaultExportFromCjs(x) {
1428
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1429
- }
1430
- function stringWidth$1(string, options) {
1431
- if (typeof string !== "string" || string.length === 0) {
1432
- return 0;
1433
- }
1434
- options = {
1435
- ambiguousIsNarrow: true,
1436
- countAnsiEscapeCodes: false,
1437
- ...options
1438
- };
1439
- if (!options.countAnsiEscapeCodes) {
1440
- string = stripAnsi2(string);
1441
- }
1442
- if (string.length === 0) {
1443
- return 0;
1444
- }
1445
- const ambiguousCharacterWidth = options.ambiguousIsNarrow ? 1 : 2;
1446
- let width = 0;
1447
- for (const { segment: character } of new Intl.Segmenter().segment(string)) {
1448
- const codePoint = character.codePointAt(0);
1449
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
1450
- continue;
1451
- }
1452
- if (codePoint >= 768 && codePoint <= 879) {
1453
- continue;
1454
- }
1455
- if (emojiRegex().test(character)) {
1456
- width += 2;
1457
- continue;
1458
- }
1459
- const code = eastAsianWidth.eastAsianWidth(character);
1460
- switch (code) {
1461
- case "F":
1462
- case "W": {
1463
- width += 2;
1464
- break;
1465
- }
1466
- case "A": {
1467
- width += ambiguousCharacterWidth;
1468
- break;
1469
- }
1470
- default: {
1471
- width += 1;
1472
- }
1473
- }
1474
- }
1475
- return width;
1476
- }
1477
- function isUnicodeSupported() {
1478
- if (process$1.platform !== "win32") {
1479
- return process$1.env.TERM !== "linux";
1480
- }
1481
- return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
1482
- }
1483
- function stringWidth(str) {
1484
- if (!Intl.Segmenter) {
1485
- return stripAnsi(str).length;
1486
- }
1487
- return stringWidth$1(str);
1488
- }
1489
- function characterFormat(str) {
1490
- return str.replace(/`([^`]+)`/gm, (_2, m2) => colors.cyan(m2)).replace(/\s+_([^_]+)_\s+/gm, (_2, m2) => ` ${colors.underline(m2)} `);
1491
- }
1492
- function getColor2(color = "white") {
1493
- return colors[color] || colors.white;
1494
- }
1495
- function getBgColor(color = "bgWhite") {
1496
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
1497
- }
1498
- function createConsola2(options = {}) {
1499
- let level = _getDefaultLogLevel();
1500
- if (process.env.CONSOLA_LEVEL) {
1501
- level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
1502
- }
1503
- const consola2 = createConsola({
1504
- level,
1505
- defaults: { level },
1506
- stdout: process.stdout,
1507
- stderr: process.stderr,
1508
- prompt: (...args) => Promise.resolve().then(() => (init_prompt(), exports_prompt)).then((m2) => m2.prompt(...args)),
1509
- reporters: options.reporters || [
1510
- options.fancy ?? !(isCI2 || isTest) ? new FancyReporter : new BasicReporter
1511
- ],
1512
- ...options
1513
- });
1514
- return consola2;
1515
- }
1516
- function _getDefaultLogLevel() {
1517
- if (isDebug) {
1518
- return LogLevels.debug;
1519
- }
1520
- if (isTest) {
1521
- return LogLevels.warn;
1522
- }
1523
- return LogLevels.info;
1524
- }
1525
- var providers, processShim, envShim, providerInfo, nodeENV, isCI2, hasTTY, isDebug, isTest, regex, eastasianwidth, eastasianwidthExports, eastAsianWidth, emojiRegex = () => {
1526
- 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\u26D3\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]|\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])?|[\uDFC3\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-\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]|\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(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\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-\uDEB6](?:\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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?)?)|\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])?|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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;
1527
- }, TYPE_COLOR_MAP, LEVEL_COLOR_MAP, unicode2, s2 = (c2, fallback) => unicode2 ? c2 : fallback, TYPE_ICONS, FancyReporter, consola;
1528
- var init_consola_36c0034f = __esm(() => {
1529
- init_core();
1530
- init_consola_06ad8a64();
1531
- init_utils();
1532
- providers = [
1533
- ["APPVEYOR"],
1534
- ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
1535
- ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
1536
- ["APPCIRCLE", "AC_APPCIRCLE"],
1537
- ["BAMBOO", "bamboo_planKey"],
1538
- ["BITBUCKET", "BITBUCKET_COMMIT"],
1539
- ["BITRISE", "BITRISE_IO"],
1540
- ["BUDDY", "BUDDY_WORKSPACE_ID"],
1541
- ["BUILDKITE"],
1542
- ["CIRCLE", "CIRCLECI"],
1543
- ["CIRRUS", "CIRRUS_CI"],
1544
- ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }],
1545
- ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
1546
- ["CODEFRESH", "CF_BUILD_ID"],
1547
- ["DRONE"],
1548
- ["DRONE", "DRONE_BUILD_EVENT"],
1549
- ["DSARI"],
1550
- ["GITHUB_ACTIONS"],
1551
- ["GITLAB", "GITLAB_CI"],
1552
- ["GITLAB", "CI_MERGE_REQUEST_ID"],
1553
- ["GOCD", "GO_PIPELINE_LABEL"],
1554
- ["LAYERCI"],
1555
- ["HUDSON", "HUDSON_URL"],
1556
- ["JENKINS", "JENKINS_URL"],
1557
- ["MAGNUM"],
1558
- ["NETLIFY"],
1559
- ["NETLIFY", "NETLIFY_LOCAL", { ci: false }],
1560
- ["NEVERCODE"],
1561
- ["RENDER"],
1562
- ["SAIL", "SAILCI"],
1563
- ["SEMAPHORE"],
1564
- ["SCREWDRIVER"],
1565
- ["SHIPPABLE"],
1566
- ["SOLANO", "TDDIUM"],
1567
- ["STRIDER"],
1568
- ["TEAMCITY", "TEAMCITY_VERSION"],
1569
- ["TRAVIS"],
1570
- ["VERCEL", "NOW_BUILDER"],
1571
- ["APPCENTER", "APPCENTER_BUILD_ID"],
1572
- ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }],
1573
- ["STACKBLITZ"],
1574
- ["STORMKIT"],
1575
- ["CLEAVR"]
1576
- ];
1577
- processShim = typeof process !== "undefined" ? process : {};
1578
- envShim = processShim.env || {};
1579
- providerInfo = detectProvider(envShim);
1580
- nodeENV = typeof process !== "undefined" && process.env && "development" || "";
1581
- processShim.platform;
1582
- providerInfo.name;
1583
- isCI2 = toBoolean(envShim.CI) || providerInfo.ci !== false;
1584
- hasTTY = toBoolean(processShim.stdout && processShim.stdout.isTTY);
1585
- isDebug = toBoolean(envShim.DEBUG);
1586
- isTest = nodeENV === "test" || toBoolean(envShim.TEST);
1587
- toBoolean(envShim.MINIMAL);
1588
- regex = ansiRegex2();
1589
- eastasianwidth = { exports: {} };
1590
- (function(module) {
1591
- var eaw = {};
1592
- {
1593
- module.exports = eaw;
1594
- }
1595
- eaw.eastAsianWidth = function(character) {
1596
- var x = character.charCodeAt(0);
1597
- var y = character.length == 2 ? character.charCodeAt(1) : 0;
1598
- var codePoint = x;
1599
- if (55296 <= x && x <= 56319 && (56320 <= y && y <= 57343)) {
1600
- x &= 1023;
1601
- y &= 1023;
1602
- codePoint = x << 10 | y;
1603
- codePoint += 65536;
1604
- }
1605
- if (codePoint == 12288 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510) {
1606
- return "F";
1607
- }
1608
- if (codePoint == 8361 || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518) {
1609
- return "H";
1610
- }
1611
- if (4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141) {
1612
- return "W";
1613
- }
1614
- if (32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || codePoint == 172 || codePoint == 175 || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630) {
1615
- return "Na";
1616
- }
1617
- if (codePoint == 161 || codePoint == 164 || 167 <= codePoint && codePoint <= 168 || codePoint == 170 || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || codePoint == 198 || codePoint == 208 || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || codePoint == 230 || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || codePoint == 240 || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || codePoint == 252 || codePoint == 254 || codePoint == 257 || codePoint == 273 || codePoint == 275 || codePoint == 283 || 294 <= codePoint && codePoint <= 295 || codePoint == 299 || 305 <= codePoint && codePoint <= 307 || codePoint == 312 || 319 <= codePoint && codePoint <= 322 || codePoint == 324 || 328 <= codePoint && codePoint <= 331 || codePoint == 333 || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || codePoint == 363 || codePoint == 462 || codePoint == 464 || codePoint == 466 || codePoint == 468 || codePoint == 470 || codePoint == 472 || codePoint == 474 || codePoint == 476 || codePoint == 593 || codePoint == 609 || codePoint == 708 || codePoint == 711 || 713 <= codePoint && codePoint <= 715 || codePoint == 717 || codePoint == 720 || 728 <= codePoint && codePoint <= 731 || codePoint == 733 || codePoint == 735 || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || codePoint == 1025 || 1040 <= codePoint && codePoint <= 1103 || codePoint == 1105 || codePoint == 8208 || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || codePoint == 8240 || 8242 <= codePoint && codePoint <= 8243 || codePoint == 8245 || codePoint == 8251 || codePoint == 8254 || codePoint == 8308 || codePoint == 8319 || 8321 <= codePoint && codePoint <= 8324 || codePoint == 8364 || codePoint == 8451 || codePoint == 8453 || codePoint == 8457 || codePoint == 8467 || codePoint == 8470 || 8481 <= codePoint && codePoint <= 8482 || codePoint == 8486 || codePoint == 8491 || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || codePoint == 8585 || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || codePoint == 8658 || codePoint == 8660 || codePoint == 8679 || codePoint == 8704 || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || codePoint == 8715 || codePoint == 8719 || codePoint == 8721 || codePoint == 8725 || codePoint == 8730 || 8733 <= codePoint && codePoint <= 8736 || codePoint == 8739 || codePoint == 8741 || 8743 <= codePoint && codePoint <= 8748 || codePoint == 8750 || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || codePoint == 8776 || codePoint == 8780 || codePoint == 8786 || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || codePoint == 8853 || codePoint == 8857 || codePoint == 8869 || codePoint == 8895 || codePoint == 8978 || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || codePoint == 9675 || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || codePoint == 9711 || 9733 <= codePoint && codePoint <= 9734 || codePoint == 9737 || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || codePoint == 9756 || codePoint == 9758 || codePoint == 9792 || codePoint == 9794 || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || codePoint == 9839 || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || codePoint == 9955 || 9960 <= codePoint && codePoint <= 9983 || codePoint == 10045 || codePoint == 10071 || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || codePoint == 65533 || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109) {
1618
- return "A";
1619
- }
1620
- return "N";
1621
- };
1622
- eaw.characterLength = function(character) {
1623
- var code = this.eastAsianWidth(character);
1624
- if (code == "F" || code == "W" || code == "A") {
1625
- return 2;
1626
- } else {
1627
- return 1;
1628
- }
1629
- };
1630
- function stringToArray(string) {
1631
- return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1632
- }
1633
- eaw.length = function(string) {
1634
- var characters = stringToArray(string);
1635
- var len = 0;
1636
- for (var i = 0;i < characters.length; i++) {
1637
- len = len + this.characterLength(characters[i]);
1638
- }
1639
- return len;
1640
- };
1641
- eaw.slice = function(text2, start, end) {
1642
- textLen = eaw.length(text2);
1643
- start = start ? start : 0;
1644
- end = end ? end : 1;
1645
- if (start < 0) {
1646
- start = textLen + start;
1647
- }
1648
- if (end < 0) {
1649
- end = textLen + end;
1650
- }
1651
- var result = "";
1652
- var eawLen = 0;
1653
- var chars = stringToArray(text2);
1654
- for (var i = 0;i < chars.length; i++) {
1655
- var char = chars[i];
1656
- var charLen = eaw.length(char);
1657
- if (eawLen >= start - (charLen == 2 ? 1 : 0)) {
1658
- if (eawLen + charLen <= end) {
1659
- result += char;
1660
- } else {
1661
- break;
1662
- }
1663
- }
1664
- eawLen += charLen;
1665
- }
1666
- return result;
1667
- };
1668
- })(eastasianwidth);
1669
- eastasianwidthExports = eastasianwidth.exports;
1670
- eastAsianWidth = /* @__PURE__ */ getDefaultExportFromCjs(eastasianwidthExports);
1671
- TYPE_COLOR_MAP = {
1672
- info: "cyan",
1673
- fail: "red",
1674
- success: "green",
1675
- ready: "green",
1676
- start: "magenta"
1677
- };
1678
- LEVEL_COLOR_MAP = {
1679
- 0: "red",
1680
- 1: "yellow"
1681
- };
1682
- unicode2 = isUnicodeSupported();
1683
- TYPE_ICONS = {
1684
- error: s2("\u2716", "\xD7"),
1685
- fatal: s2("\u2716", "\xD7"),
1686
- ready: s2("\u2714", "\u221A"),
1687
- warn: s2("\u26A0", "\u203C"),
1688
- info: s2("\u2139", "i"),
1689
- success: s2("\u2714", "\u221A"),
1690
- debug: s2("\u2699", "D"),
1691
- trace: s2("\u2192", "\u2192"),
1692
- fail: s2("\u2716", "\xD7"),
1693
- start: s2("\u25D0", "o"),
1694
- log: ""
1695
- };
1696
- FancyReporter = class FancyReporter extends BasicReporter {
1697
- formatStack(stack) {
1698
- return "\n" + parseStack(stack).map((line) => " " + line.replace(/^at +/, (m2) => colors.gray(m2)).replace(/\((.+)\)/, (_2, m2) => `(${colors.cyan(m2)})`)).join("\n");
1699
- }
1700
- formatType(logObj, isBadge, opts) {
1701
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
1702
- if (isBadge) {
1703
- return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
1704
- }
1705
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
1706
- return _type ? getColor2(typeColor)(_type) : "";
1707
- }
1708
- formatLogObj(logObj, opts) {
1709
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
1710
- if (logObj.type === "box") {
1711
- return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
1712
- title: logObj.title ? characterFormat(logObj.title) : undefined,
1713
- style: logObj.style
1714
- });
1715
- }
1716
- const date = this.formatDate(logObj.date, opts);
1717
- const coloredDate = date && colors.gray(date);
1718
- const isBadge = logObj.badge ?? logObj.level < 2;
1719
- const type = this.formatType(logObj, isBadge, opts);
1720
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
1721
- let line;
1722
- const left = this.filterAndJoin([type, characterFormat(message)]);
1723
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
1724
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
1725
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
1726
- line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
1727
- if (logObj.type === "trace") {
1728
- const _err = new Error("Trace: " + logObj.message);
1729
- line += this.formatStack(_err.stack || "");
1730
- }
1731
- return isBadge ? "\n" + line + "\n" : line;
1732
- }
1733
- };
1734
- consola = createConsola2();
1735
- });
1736
-
1737
- // src/index.ts
1738
- import {access, appendFile, mkdir} from "fs/promises";
1739
- import {dirname} from "path";
1740
- import process2 from "process";
1741
- import {buddyOptions, prompt as getPrompt} from "@stacksjs/cli";
1742
- import {handleError} from "@stacksjs/error-handling";
1743
- import {logsPath} from "@stacksjs/path";
1744
- import {ExitCode} from "@stacksjs/types";
1745
- import {isString} from "@stacksjs/validation";
1746
-
1747
- // ../../../../node_modules/consola/dist/index.mjs
1748
- init_consola_36c0034f();
1749
- init_core();
1750
- init_consola_06ad8a64();
1751
- init_utils();
1752
-
1753
- // src/index.ts
1754
- async function logLevel() {
1755
- const verboseRegex = /--verbose(?!(\s*=\s*false|\s+false))(\s+|=true)?($|\s)/;
1756
- const opts = buddyOptions();
1757
- if (verboseRegex.test(opts))
1758
- return 4;
1759
- return 3;
1760
- }
1761
- async function writeToLogFile(message) {
1762
- const formattedMessage = `[${new Date().toISOString()}] ${message}\n`;
1763
- try {
1764
- const logFilePath = logsPath("console.log");
1765
- try {
1766
- await access(logFilePath);
1767
- } catch {
1768
- await mkdir(dirname(logFilePath), { recursive: true });
1769
- }
1770
- await appendFile(logFilePath, formattedMessage);
1771
- } catch (error) {
1772
- console.error("Failed to write to log file:", error);
1773
- }
1774
- }
1775
- function dump(...args) {
1776
- args.forEach((arg) => log.debug(arg));
1777
- }
1778
- function dd(...args) {
1779
- args.forEach((arg) => log.debug(arg));
1780
- process2.exit(ExitCode.FatalError);
1781
- }
1782
- function echo(...args) {
1783
- console.log(...args);
1784
- }
1785
- var logger = createConsola2({
1786
- level: await logLevel()
1787
- });
1788
- var log = {
1789
- async info(...arg) {
1790
- logger.info(...arg);
1791
- await writeToLogFile(`INFO: ${arg}`);
1792
- },
1793
- async success(msg) {
1794
- logger.success(msg);
1795
- await writeToLogFile(`SUCCESS: ${msg}`);
1796
- },
1797
- async error(err, options) {
1798
- if (err instanceof Error)
1799
- handleError(err, options);
1800
- else if (options instanceof Error)
1801
- handleError(options);
1802
- else
1803
- handleError(err, options);
1804
- await writeToLogFile(`ERROR: ${err}`);
1805
- },
1806
- async warn(arg) {
1807
- logger.warn(arg);
1808
- await writeToLogFile(`WARN: ${arg}`);
1809
- },
1810
- async debug(...arg) {
1811
- if (process2.env.APP_ENV === "production" || process2.env.APP_ENV === "prod")
1812
- return await writeToLogFile(`DEBUG: ${arg}`);
1813
- logger.debug(arg);
1814
- if (isString(arg))
1815
- await writeToLogFile(`DEBUG: ${arg}`);
1816
- else
1817
- await writeToLogFile(`DEBUG: ${JSON.stringify(arg)}`);
1818
- },
1819
- async start(...arg) {
1820
- logger.start(arg);
1821
- await writeToLogFile(`START: ${arg}`);
1822
- },
1823
- box: logger.box,
1824
- get prompt() {
1825
- return getPrompt();
1826
- },
1827
- dump,
1828
- dd,
1829
- echo
1830
- };
1831
- export {
1832
- writeToLogFile,
1833
- logger,
1834
- logLevel,
1835
- log,
1836
- echo,
1837
- dump,
1838
- dd,
1839
- consola
1840
- };
1841
-
1842
- //# debugId=CC9F625EB090170E64756E2164756E21
4
+ `).map((r)=>Uu(r,F,C)).join(`
5
+ `)}function cu(u,F){if(u===F)return;const C=u.split(`
6
+ `),r=F.split(`
7
+ `),E=[];for(let t=0;t<Math.max(C.length,r.length);t++)C[t]!==r[t]&&E.push(t);return E}function J(u,F){u.isTTY&&u.setRawMode(F)}async function s2(u,F={}){if(!F.type||F.type==="text")return await C2({message:u,defaultValue:F.default,placeholder:F.placeholder,initialValue:F.initial});if(F.type==="confirm")return await r2({message:u,initialValue:F.initial});if(F.type==="select")return await E2({message:u,options:F.options.map((C)=>typeof C==="string"?{value:C,label:C}:C)});if(F.type==="multiselect")return await t2({message:u,options:F.options.map((C)=>typeof C==="string"?{value:C,label:C}:C),required:F.required});throw new Error(`Unknown prompt type: ${F.type}`)}class W{constructor({render:u,input:F=yu,output:C=Su,...r},E=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=E,this.input=F,this.output=C}prompt(){const u=new gu(0);return u._write=(F,C,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(u),this.rl=_D.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),_D.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),J(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((F,C)=>{this.once("submit",()=>{this.output.write(p.cursor.show),this.output.off("resize",this.render),J(this.input,!1),F(this.value)}),this.once("cancel",()=>{this.output.write(p.cursor.show),this.output.off("resize",this.render),J(this.input,!1),F(Lu)})})}on(u,F){const C=this.subscribers.get(u)??[];C.push({cb:F}),this.subscribers.set(u,C)}once(u,F){const C=this.subscribers.get(u)??[];C.push({cb:F,once:!0}),this.subscribers.set(u,C)}emit(u,...F){const C=this.subscribers.get(u)??[],r=[];for(let E of C)E.cb(...F),E.once&&r.push(()=>C.splice(C.indexOf(E),1));for(let E of r)E()}unsubscribe(){this.subscribers.clear()}onKeypress(u,F){if(this.state==="error"&&(this.state="active"),F?.name&&!this._track&&RD.has(F.name)&&this.emit("cursor",RD.get(F.name)),F?.name&&Ou.has(F.name)&&this.emit("cursor",F.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u&&this.emit("key",u.toLowerCase()),F?.name==="return"){if(this.opts.validate){const C=this.opts.validate(this.value);C&&(this.error=C,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
8
+ `),J(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const u=WD(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
9
+ `).length-1;this.output.write(p.cursor.move(-999,u*-1))}render(){const u=WD(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(p.cursor.hide);else{const F=cu(this._prevFrame,u);if(this.restoreCursor(),F&&F?.length===1){const C=F[0];this.output.write(p.cursor.move(0,C)),this.output.write(p.erase.lines(1));const r=u.split(`
10
+ `);this.output.write(r[C]),this._prevFrame=u,this.output.write(p.cursor.move(0,r.length-C-1));return}else if(F&&F?.length>1){const C=F[0];this.output.write(p.cursor.move(0,C)),this.output.write(p.erase.down());const r=u.split(`
11
+ `).slice(C);this.output.write(r.join(`
12
+ `)),this._prevFrame=u;return}this.output.write(p.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}var rD="\x1B",$,Mu="\x07",ED,Vu,Tu,p,BD,ku,Iu,a=(u,F,C=u)=>(r)=>{let E=""+r,t=E.indexOf(F,u.length);return~t?u+KD(E,F,C,t)+F:u+E+F},KD=(u,F,C,r)=>{let E=u.substring(0,r)+C,t=u.substring(r+F.length),D=t.indexOf(F);return~D?E+KD(t,F,C,D):E+t},ND=(u=Iu)=>({isColorSupported:u,reset:u?(F)=>`\x1B[0m${F}\x1B[0m`:String,bold:u?a("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:u?a("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:u?a("\x1B[3m","\x1B[23m"):String,underline:u?a("\x1B[4m","\x1B[24m"):String,inverse:u?a("\x1B[7m","\x1B[27m"):String,hidden:u?a("\x1B[8m","\x1B[28m"):String,strikethrough:u?a("\x1B[9m","\x1B[29m"):String,black:u?a("\x1B[30m","\x1B[39m"):String,red:u?a("\x1B[31m","\x1B[39m"):String,green:u?a("\x1B[32m","\x1B[39m"):String,yellow:u?a("\x1B[33m","\x1B[39m"):String,blue:u?a("\x1B[34m","\x1B[39m"):String,magenta:u?a("\x1B[35m","\x1B[39m"):String,cyan:u?a("\x1B[36m","\x1B[39m"):String,white:u?a("\x1B[37m","\x1B[39m"):String,gray:u?a("\x1B[90m","\x1B[39m"):String,bgBlack:u?a("\x1B[40m","\x1B[49m"):String,bgRed:u?a("\x1B[41m","\x1B[49m"):String,bgGreen:u?a("\x1B[42m","\x1B[49m"):String,bgYellow:u?a("\x1B[43m","\x1B[49m"):String,bgBlue:u?a("\x1B[44m","\x1B[49m"):String,bgMagenta:u?a("\x1B[45m","\x1B[49m"):String,bgCyan:u?a("\x1B[46m","\x1B[49m"):String,bgWhite:u?a("\x1B[47m","\x1B[49m"):String}),Wu,uD,tD,Gu,Ku,Nu=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},FD=10,MD=(u=0)=>(F)=>`\x1B[${F+u}m`,VD=(u=0)=>(F)=>`\x1B[${38+u};5;${F}m`,TD=(u=0)=>(F,C,r)=>`\x1B[${38+u};2;${F};${C};${r}m`,n,zu,Zu,qu,X,Ju=39,iD="\x07",ZD="[",Xu="]",HD="m",eD,kD=(u)=>`${X.values().next().value}${ZD}${u}${HD}`,ID=(u)=>`${X.values().next().value}${eD}${u}${iD}`,Yu=(u)=>u.split(" ").map((F)=>I(F)),CD=(u,F,C)=>{const r=[...F];let E=!1,t=!1,D=I(zD(u[u.length-1]));for(let[h,l]of r.entries()){const i=I(l);if(D+i<=C?u[u.length-1]+=l:(u.push(l),D=0),X.has(l)&&(E=!0,t=r.slice(h+1).join("").startsWith(eD)),E){t?l===iD&&(E=!1,t=!1):l===HD&&(E=!1);continue}D+=i,D===C&&h<r.length-1&&(u.push(""),D=0)}!D&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},Qu=(u)=>{const F=u.split(" ");let C=F.length;for(;C>0&&!(I(F[C-1])>0);)C--;return C===F.length?u:F.slice(0,C).join(" ")+F.slice(C).join("")},Uu=(u,F,C={})=>{if(C.trim!==!1&&u.trim()==="")return"";let r="",E,t;const D=Yu(u);let h=[""];for(let[i,f]of u.split(" ").entries()){C.trim!==!1&&(h[h.length-1]=h[h.length-1].trimStart());let e=I(h[h.length-1]);if(i!==0&&(e>=F&&(C.wordWrap===!1||C.trim===!1)&&(h.push(""),e=0),(e>0||C.trim===!1)&&(h[h.length-1]+=" ",e++)),C.hard&&D[i]>F){const x=F-e,m=1+Math.floor((D[i]-x-1)/F);Math.floor((D[i]-1)/F)<m&&h.push(""),CD(h,f,F);continue}if(e+D[i]>F&&e>0&&D[i]>0){if(C.wordWrap===!1&&e<F){CD(h,f,F);continue}h.push("")}if(e+D[i]>F&&C.wordWrap===!1){CD(h,f,F);continue}h[h.length-1]+=f}C.trim!==!1&&(h=h.map((i)=>Qu(i)));const l=[...h.join(`
13
+ `)];for(let[i,f]of l.entries()){if(r+=f,X.has(f)){const{groups:x}=new RegExp(`(?:\\${ZD}(?<code>\\d+)m|\\${eD}(?<uri>.*)${iD})`).exec(l.slice(i).join(""))||{groups:{}};if(x.code!==void 0){const m=Number.parseFloat(x.code);E=m===Ju?void 0:m}else x.uri!==void 0&&(t=x.uri.length===0?void 0:x.uri)}const e=qu.codes.get(Number(E));l[i+1]===`
14
+ `?(t&&(r+=ID("")),E&&e&&(r+=kD(e))):f===`
15
+ `&&(E&&e&&(r+=kD(E)),t&&(r+=ID(t)))}return r},Lu,RD,Ou,qD,JD,XD,YD,ju,S=(u,F)=>ju?u:F,du,Pu,ou,D2,A="",V="",sD,hD,u2,GD,F2,Y=(u)=>{switch(u){case"initial":case"active":return s.cyan(du);case"cancel":return s.red(Pu);case"error":return s.yellow(ou);case"submit":return s.green(D2)}},C2=(u)=>{return new YD({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const F=`${s.gray(A)}
16
+ ${Y(this.state)} ${u.message}
17
+ `,C=u.placeholder?s.inverse(u.placeholder[0])+s.dim(u.placeholder.slice(1)):s.inverse(s.hidden("_")),r=this.value?this.valueWithCursor:C;switch(this.state){case"error":return`${F.trim()}
18
+ ${s.yellow(A)} ${r}
19
+ ${s.yellow(V)} ${s.yellow(this.error)}
20
+ `;case"submit":return`${F}${s.gray(A)} ${s.dim(this.value||u.placeholder)}`;case"cancel":return`${F}${s.gray(A)} ${s.strikethrough(s.dim(this.value??""))}${this.value?.trim()?"\n"+s.gray(A):""}`;default:return`${F}${s.cyan(A)} ${r}
21
+ ${s.cyan(V)}
22
+ `}}}).prompt()},r2=(u)=>{const F=u.active??"Yes",C=u.inactive??"No";return new qD({active:F,inactive:C,initialValue:u.initialValue??!0,render(){const r=`${s.gray(A)}
23
+ ${Y(this.state)} ${u.message}
24
+ `,E=this.value?F:C;switch(this.state){case"submit":return`${r}${s.gray(A)} ${s.dim(E)}`;case"cancel":return`${r}${s.gray(A)} ${s.strikethrough(s.dim(E))}
25
+ ${s.gray(A)}`;default:return`${r}${s.cyan(A)} ${this.value?`${s.green(sD)} ${F}`:`${s.dim(hD)} ${s.dim(F)}`} ${s.dim("/")} ${this.value?`${s.dim(hD)} ${s.dim(C)}`:`${s.green(sD)} ${C}`}
26
+ ${s.cyan(V)}
27
+ `}}}).prompt()},E2=(u)=>{const F=(C,r)=>{const E=C.label??String(C.value);switch(r){case"active":return`${s.green(sD)} ${E} ${C.hint?s.dim(`(${C.hint})`):""}`;case"selected":return`${s.dim(E)}`;case"cancelled":return`${s.strikethrough(s.dim(E))}`}return`${s.dim(hD)} ${s.dim(E)}`};return new XD({options:u.options,initialValue:u.initialValue,render(){const C=`${s.gray(A)}
28
+ ${Y(this.state)} ${u.message}
29
+ `;switch(this.state){case"submit":return`${C}${s.gray(A)} ${F(this.options[this.cursor],"selected")}`;case"cancel":return`${C}${s.gray(A)} ${F(this.options[this.cursor],"cancelled")}
30
+ ${s.gray(A)}`;default:return`${C}${s.cyan(A)} ${this.options.map((r,E)=>F(r,E===this.cursor?"active":"inactive")).join(`
31
+ ${s.cyan(A)} `)}
32
+ ${s.cyan(V)}
33
+ `}}}).prompt()},t2=(u)=>{const F=(C,r)=>{const E=C.label??String(C.value);switch(r){case"active":return`${s.cyan(u2)} ${E} ${C.hint?s.dim(`(${C.hint})`):""}`;case"selected":return`${s.green(GD)} ${s.dim(E)}`;case"cancelled":return`${s.strikethrough(s.dim(E))}`;case"active-selected":return`${s.green(GD)} ${E} ${C.hint?s.dim(`(${C.hint})`):""}`;case"submitted":return`${s.dim(E)}`}return`${s.dim(F2)} ${s.dim(E)}`};return new JD({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(C){if(this.required&&C.length===0)return`Please select at least one option.
34
+ ${s.reset(s.dim(`Press ${s.gray(s.bgWhite(s.inverse(" space ")))} to select, ${s.gray(s.bgWhite(s.inverse(" enter ")))} to submit`))}`},render(){const C=`${s.gray(A)}
35
+ ${Y(this.state)} ${u.message}
36
+ `;switch(this.state){case"submit":return`${C}${s.gray(A)} ${this.options.filter(({value:r})=>this.value.includes(r)).map((r)=>F(r,"submitted")).join(s.dim(", "))||s.dim("none")}`;case"cancel":{const r=this.options.filter(({value:E})=>this.value.includes(E)).map((E)=>F(E,"cancelled")).join(s.dim(", "));return`${C}${s.gray(A)} ${r.trim()?`${r}
37
+ ${s.gray(A)}`:""}`}case"error":{const r=this.error.split("\n").map((E,t)=>t===0?`${s.yellow(V)} ${s.yellow(E)}`:` ${E}`).join("\n");return C+s.yellow(A)+" "+this.options.map((E,t)=>{const D=this.value.includes(E.value),h=t===this.cursor;if(h&&D)return F(E,"active-selected");if(D)return F(E,"selected");return F(E,h?"active":"inactive")}).join(`
38
+ ${s.yellow(A)} `)+"\n"+r+"\n"}default:return`${C}${s.cyan(A)} ${this.options.map((r,E)=>{const t=this.value.includes(r.value),D=E===this.cursor;if(D&&t)return F(r,"active-selected");if(t)return F(r,"selected");return F(r,D?"active":"inactive")}).join(`
39
+ ${s.cyan(A)} `)}
40
+ ${s.cyan(V)}
41
+ `}}}).prompt()};var UD=k(()=>{aD();q();N();Z();$=`${rD}[`,ED={to(u,F){if(!F)return`${$}${u+1}G`;return`${$}${F+1};${u+1}H`},move(u,F){let C="";if(u<0)C+=`${$}${-u}D`;else if(u>0)C+=`${$}${u}C`;if(F<0)C+=`${$}${-F}A`;else if(F>0)C+=`${$}${F}B`;return C},up:(u=1)=>`${$}${u}A`,down:(u=1)=>`${$}${u}B`,forward:(u=1)=>`${$}${u}C`,backward:(u=1)=>`${$}${u}D`,nextLine:(u=1)=>`${$}E`.repeat(u),prevLine:(u=1)=>`${$}F`.repeat(u),left:`${$}G`,hide:`${$}?25l`,show:`${$}?25h`,save:`${rD}7`,restore:`${rD}8`},Vu={up:(u=1)=>`${$}S`.repeat(u),down:(u=1)=>`${$}T`.repeat(u)},Tu={screen:`${$}2J`,up:(u=1)=>`${$}1J`.repeat(u),down:(u=1)=>`${$}J`.repeat(u),line:`${$}2K`,lineEnd:`${$}K`,lineStart:`${$}1K`,lines(u){let F="";for(let C=0;C<u;C++)F+=this.line+(C<u-1?ED.up():"");if(u)F+=ED.left;return F}},p={cursor:ED,scroll:Vu,erase:Tu,beep:Mu},BD={exports:{}},ku=_u,Iu=!(("NO_COLOR"in process.env)||process.argv.includes("--no-color"))&&(("FORCE_COLOR"in process.env)||process.argv.includes("--color")||process.platform==="win32"||ku.isatty(1)&&process.env.TERM!=="dumb"||("CI"in process.env));BD.exports=ND();BD.exports.createColors=ND;Wu=BD.exports,uD=lD(Wu),tD={},Gu={get exports(){return tD},set exports(u){tD=u}};(function(u){var F={};u.exports=F,F.eastAsianWidth=function(r){var E=r.charCodeAt(0),t=r.length==2?r.charCodeAt(1):0,D=E;return 55296<=E&&E<=56319&&56320<=t&&t<=57343&&(E&=1023,t&=1023,D=E<<10|t,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&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||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},F.characterLength=function(r){var E=this.eastAsianWidth(r);return E=="F"||E=="W"||E=="A"?2:1};function C(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}F.length=function(r){for(var E=C(r),t=0,D=0;D<E.length;D++)t=t+this.characterLength(E[D]);return t},F.slice=function(r,E,t){textLen=F.length(r),E=E||0,t=t||1,E<0&&(E=textLen+E),t<0&&(t=textLen+t);for(var D="",h=0,l=C(r),i=0;i<l.length;i++){var f=l[i],e=F.length(f);if(h>=E-(e==2?1:0))if(h+e<=t)D+=f;else break;h+=e}return D}})(Gu);Ku=tD,n={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(n.modifier);zu=Object.keys(n.color),Zu=Object.keys(n.bgColor);[...zu];qu=Hu(),X=new Set(["\x1B","\x9B"]),eD=`${Xu}8;;`,Lu=Symbol("clack:cancel"),RD=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),Ou=new Set(["up","down","left","right","space","enter"]);qD=class qD extends W{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(F)=>{this.output.write(p.cursor.move(0,-1)),this.value=F,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};JD=class JD extends W{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:F})=>F===u.cursorAt),0),this.on("key",(F)=>{F==="a"&&this.toggleAll()}),this.on("cursor",(F)=>{switch(F){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map((F)=>F.value)}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter((F)=>F!==this._value):[...this.value,this._value]}};XD=class XD extends W{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.cursor=this.options.findIndex(({value:F})=>F===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(F)=>{switch(F){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};YD=class YD extends W{constructor(u){super(u),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=u.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${uD.inverse(uD.hidden("_"))}`;else{const F=this.value.slice(0,this.cursor),C=this.value.slice(this.cursor);this.valueWithCursor=`${F}${uD.inverse(C[0])}${C.slice(1)}`}})}get cursor(){return this._cursor}};ju=AD(),du=S("\u276F",">"),Pu=S("\u25A0","x"),ou=S("\u25B2","x"),D2=S("\u2714","\u221A"),sD=S("\u25CF",">"),hD=S("\u25CB"," "),u2=S("\u25FB","[\u2022]"),GD=S("\u25FC","[+]"),F2=S("\u25FB","[ ]")});import w from"process";function B2(u){for(let F of h2){const C=F[1]||F[0];if(u[C])return{name:F[0].toLowerCase(),...F[2]}}if(u.SHELL&&u.SHELL==="/bin/jsh")return{name:"stackblitz",ci:!1};return{name:"",ci:!1}}function G(u){return u?u!=="false":!1}function A2({onlyFirst:u=!1}={}){const F=["[\\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(F,u?void 0:"g")}function n2(u){if(typeof u!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(a2,"")}function lD(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function b2(u,F){if(typeof u!=="string"||u.length===0)return 0;if(F={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...F},!F.countAnsiEscapeCodes)u=n2(u);if(u.length===0)return 0;const C=F.ambiguousIsNarrow?1:2;let r=0;for(let{segment:E}of new Intl.Segmenter().segment(u)){const t=E.codePointAt(0);if(t<=31||t>=127&&t<=159)continue;if(t>=768&&t<=879)continue;if(m2().test(E)){r+=2;continue}switch(f2.eastAsianWidth(E)){case"F":case"W":{r+=2;break}case"A":{r+=C;break}default:r+=1}}return r}function AD(){if(w.platform!=="win32")return w.env.TERM!=="linux";return Boolean(w.env.CI)||Boolean(w.env.WT_SESSION)||Boolean(w.env.TERMINUS_SUBLIME)||w.env.ConEmuTask==="{cmd::Cmder}"||w.env.TERM_PROGRAM==="Terminus-Sublime"||w.env.TERM_PROGRAM==="vscode"||w.env.TERM==="xterm-256color"||w.env.TERM==="alacritty"||w.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function LD(u){if(!Intl.Segmenter)return M(u).length;return b2(u)}function Q(u){return u.replace(/`([^`]+)`/gm,(F,C)=>s.cyan(C)).replace(/\s+_([^_]+)_\s+/gm,(F,C)=>` ${s.underline(C)} `)}function w2(u="white"){return s[u]||s.white}function y2(u="bgWhite"){return s[`bg${u[0].toUpperCase()}${u.slice(1)}`]||s.bgWhite}function c(u={}){let F=S2();if(process.env.CONSOLA_LEVEL)F=Number.parseInt(process.env.CONSOLA_LEVEL)??F;return vD({level:F,defaults:{level:F},stdout:process.stdout,stderr:process.stderr,prompt:(...r)=>Promise.resolve().then(() => (UD(),QD)).then((E)=>E.prompt(...r)),reporters:u.reporters||[u.fancy??!(jD||nD)?new PD:new z],...u})}function S2(){if(l2)return b.debug;if(nD)return b.warn;return b.info}var h2,U,R,OD,i2,jD,e2,l2,nD,a2,dD,$2,f2,m2=()=>{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\u26D3\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]|\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])?|[\uDFC3\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-\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]|\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(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\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-\uDEB6](?:\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD])|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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?)?)|\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])?|\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-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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-\uDDB3\uDDBC\uDDBD]|\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},v2,x2,p2,y=(u,F)=>p2?u:F,cD,PD,$D;var aD=k(()=>{N();Z();q();h2=[["APPVEYOR"],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"]],U=typeof process!=="undefined"?process:{},R=U.env||{},OD=B2(R),i2=typeof process!=="undefined"&&process.env&&"development"||"";U.platform;OD.name;jD=G(R.CI)||OD.ci!==!1,e2=G(U.stdout&&U.stdout.isTTY),l2=G(R.DEBUG),nD=i2==="test"||G(R.TEST);G(R.MINIMAL);a2=A2(),dD={exports:{}};(function(u){var F={};u.exports=F,F.eastAsianWidth=function(r){var E=r.charCodeAt(0),t=r.length==2?r.charCodeAt(1):0,D=E;if(55296<=E&&E<=56319&&(56320<=t&&t<=57343))E&=1023,t&=1023,D=E<<10|t,D+=65536;if(D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510)return"F";if(D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518)return"H";if(4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141)return"W";if(32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630)return"Na";if(D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&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||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109)return"A";return"N"},F.characterLength=function(r){var E=this.eastAsianWidth(r);if(E=="F"||E=="W"||E=="A")return 2;else return 1};function C(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}F.length=function(r){var E=C(r),t=0;for(var D=0;D<E.length;D++)t=t+this.characterLength(E[D]);return t},F.slice=function(r,E,t){if(textLen=F.length(r),E=E?E:0,t=t?t:1,E<0)E=textLen+E;if(t<0)t=textLen+t;var D="",h=0,l=C(r);for(var i=0;i<l.length;i++){var f=l[i],e=F.length(f);if(h>=E-(e==2?1:0))if(h+e<=t)D+=f;else break;h+=e}return D}})(dD);$2=dD.exports,f2=lD($2),v2={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},x2={0:"red",1:"yellow"},p2=AD(),cD={error:y("\u2716","\xD7"),fatal:y("\u2716","\xD7"),ready:y("\u2714","\u221A"),warn:y("\u26A0","\u203C"),info:y("\u2139","i"),success:y("\u2714","\u221A"),debug:y("\u2699","D"),trace:y("\u2192","\u2192"),fail:y("\u2716","\xD7"),start:y("\u25D0","o"),log:""};PD=class PD extends z{formatStack(u){return"\n"+DD(u).map((F)=>" "+F.replace(/^at +/,(C)=>s.gray(C)).replace(/\((.+)\)/,(C,r)=>`(${s.cyan(r)})`)).join("\n")}formatType(u,F,C){const r=v2[u.type]||x2[u.level]||"gray";if(F)return y2(r)(s.black(` ${u.type.toUpperCase()} `));const E=typeof cD[u.type]==="string"?cD[u.type]:u.icon||u.type;return E?w2(r)(E):""}formatLogObj(u,F){const[C,...r]=this.formatArgs(u.args,F).split("\n");if(u.type==="box")return gD(Q(C+(r.length>0?"\n"+r.join("\n"):"")),{title:u.title?Q(u.title):void 0,style:u.style});const E=this.formatDate(u.date,F),t=E&&s.gray(E),D=u.badge??u.level<2,h=this.formatType(u,D,F),l=u.tag?s.gray(u.tag):"";let i;const f=this.filterAndJoin([h,Q(C)]),e=this.filterAndJoin(F.columns?[l,t]:[l]),x=(F.columns||0)-LD(f)-LD(e)-2;if(i=x>0&&(F.columns||0)>=80?f+" ".repeat(x)+e:(e?`${s.gray(`[${e}]`)} `:"")+f,i+=Q(r.length>0?"\n"+r.join("\n"):""),u.type==="trace"){const m=new Error("Trace: "+u.message);i+=this.formatStack(m.stack||"")}return D?"\n"+i+"\n":i}};$D=c()});import{access as g2,appendFile as _2,mkdir as M2}from"fs/promises";import{dirname as V2}from"path";import mD from"process";import{buddyOptions as T2,prompt as k2}from"@stacksjs/cli";import{handleError as fD}from"@stacksjs/error-handling";import{logsPath as I2}from"@stacksjs/path";import{ExitCode as W2}from"@stacksjs/types";import{isString as R2}from"@stacksjs/validation";aD();N();Z();q();async function G2(){const u=/--verbose(?!(\s*=\s*false|\s+false))(\s+|=true)?($|\s)/,F=T2();if(u.test(F))return 4;return 3}async function _(u){const F=`[${new Date().toISOString()}] ${u}\n`;try{const C=I2("console.log");try{await g2(C)}catch{await M2(V2(C),{recursive:!0})}await _2(C,F)}catch(C){console.error("Failed to write to log file:",C)}}function K2(...u){u.forEach((F)=>oD.debug(F))}function N2(...u){u.forEach((F)=>oD.debug(F)),mD.exit(W2.FatalError)}function z2(...u){console.log(...u)}var T=c({level:await G2()});var oD={async info(...u){T.info(...u),await _(`INFO: ${u}`)},async success(u){T.success(u),await _(`SUCCESS: ${u}`)},async error(u,F){if(u instanceof Error)fD(u,F);else if(F instanceof Error)fD(F);else fD(u,F);await _(`ERROR: ${u}`)},async warn(u){T.warn(u),await _(`WARN: ${u}`)},async debug(...u){if(mD.env.APP_ENV==="production"||mD.env.APP_ENV==="prod")return await _(`DEBUG: ${u}`);if(T.debug(u),R2(u))await _(`DEBUG: ${u}`);else await _(`DEBUG: ${JSON.stringify(u)}`)},async start(...u){T.start(u),await _(`START: ${u}`)},box:T.box,get prompt(){return k2()},dump:K2,dd:N2,echo:z2};export{_ as writeToLogFile,T as logger,G2 as logLevel,oD as log,z2 as echo,K2 as dump,N2 as dd,$D as consola};
42
+
43
+ //# debugId=9A05531E7BDFD8D464756E2164756E21
1843
44
  //# sourceMappingURL=index.js.map