@ninhache/probe 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2894 @@
1
+ import { createRequire as __createRequire } from "node:module";
2
+ const require = __createRequire(import.meta.url);
3
+ import "./chunk-M3ASEG5F.js";
4
+
5
+ // node_modules/.pnpm/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
6
+ import { styleText } from "util";
7
+ import { stdout, stdin } from "process";
8
+ import * as f$1 from "readline";
9
+ import f__default from "readline";
10
+
11
+ // node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
12
+ var getCodePointsLength = /* @__PURE__ */ (() => {
13
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
14
+ return (input) => {
15
+ let surrogatePairsNr = 0;
16
+ SURROGATE_PAIR_RE.lastIndex = 0;
17
+ while (SURROGATE_PAIR_RE.test(input)) {
18
+ surrogatePairsNr += 1;
19
+ }
20
+ return input.length - surrogatePairsNr;
21
+ };
22
+ })();
23
+ var isFullWidth = (x2) => {
24
+ return x2 === 12288 || x2 >= 65281 && x2 <= 65376 || x2 >= 65504 && x2 <= 65510;
25
+ };
26
+ var isWideNotCJKTNotEmoji = (x2) => {
27
+ return x2 === 8987 || x2 === 9001 || x2 >= 12272 && x2 <= 12287 || x2 >= 12289 && x2 <= 12350 || x2 >= 12441 && x2 <= 12543 || x2 >= 12549 && x2 <= 12591 || x2 >= 12593 && x2 <= 12686 || x2 >= 12688 && x2 <= 12771 || x2 >= 12783 && x2 <= 12830 || x2 >= 12832 && x2 <= 12871 || x2 >= 12880 && x2 <= 19903 || x2 >= 65040 && x2 <= 65049 || x2 >= 65072 && x2 <= 65106 || x2 >= 65108 && x2 <= 65126 || x2 >= 65128 && x2 <= 65131 || x2 >= 127488 && x2 <= 127490 || x2 >= 127504 && x2 <= 127547 || x2 >= 127552 && x2 <= 127560 || x2 >= 131072 && x2 <= 196605 || x2 >= 196608 && x2 <= 262141;
28
+ };
29
+
30
+ // node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
31
+ var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
32
+ var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
33
+ var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
34
+ var TAB_RE = /\t{1,1000}/y;
35
+ var EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
36
+ var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
37
+ var MODIFIER_RE = new RegExp("\\p{M}+", "gu");
38
+ var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
39
+ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
40
+ const LIMIT = truncationOptions.limit ?? Infinity;
41
+ const ELLIPSIS = truncationOptions.ellipsis ?? "";
42
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
43
+ const ANSI_WIDTH = 0;
44
+ const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
45
+ const TAB_WIDTH = widthOptions.tabWidth ?? 8;
46
+ const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
47
+ const FULL_WIDTH_WIDTH = 2;
48
+ const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
49
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
50
+ const PARSE_BLOCKS = [
51
+ [LATIN_RE, REGULAR_WIDTH],
52
+ [ANSI_RE, ANSI_WIDTH],
53
+ [CONTROL_RE, CONTROL_WIDTH],
54
+ [TAB_RE, TAB_WIDTH],
55
+ [EMOJI_RE, EMOJI_WIDTH],
56
+ [CJKT_WIDE_RE, WIDE_WIDTH]
57
+ ];
58
+ let indexPrev = 0;
59
+ let index = 0;
60
+ let length = input.length;
61
+ let lengthExtra = 0;
62
+ let truncationEnabled = false;
63
+ let truncationIndex = length;
64
+ let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
65
+ let unmatchedStart = 0;
66
+ let unmatchedEnd = 0;
67
+ let width = 0;
68
+ let widthExtra = 0;
69
+ outer: while (true) {
70
+ if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
71
+ const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
72
+ lengthExtra = 0;
73
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
74
+ const codePoint = char.codePointAt(0) || 0;
75
+ if (isFullWidth(codePoint)) {
76
+ widthExtra = FULL_WIDTH_WIDTH;
77
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
78
+ widthExtra = WIDE_WIDTH;
79
+ } else {
80
+ widthExtra = REGULAR_WIDTH;
81
+ }
82
+ if (width + widthExtra > truncationLimit) {
83
+ truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
84
+ }
85
+ if (width + widthExtra > LIMIT) {
86
+ truncationEnabled = true;
87
+ break outer;
88
+ }
89
+ lengthExtra += char.length;
90
+ width += widthExtra;
91
+ }
92
+ unmatchedStart = unmatchedEnd = 0;
93
+ }
94
+ if (index >= length) {
95
+ break outer;
96
+ }
97
+ for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
98
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
99
+ BLOCK_RE.lastIndex = index;
100
+ if (BLOCK_RE.test(input)) {
101
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
102
+ widthExtra = lengthExtra * BLOCK_WIDTH;
103
+ if (width + widthExtra > truncationLimit) {
104
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
105
+ }
106
+ if (width + widthExtra > LIMIT) {
107
+ truncationEnabled = true;
108
+ break outer;
109
+ }
110
+ width += widthExtra;
111
+ unmatchedStart = indexPrev;
112
+ unmatchedEnd = index;
113
+ index = indexPrev = BLOCK_RE.lastIndex;
114
+ continue outer;
115
+ }
116
+ }
117
+ index += 1;
118
+ }
119
+ return {
120
+ width: truncationEnabled ? truncationLimit : width,
121
+ index: truncationEnabled ? truncationIndex : length,
122
+ truncated: truncationEnabled,
123
+ ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
124
+ };
125
+ };
126
+ var dist_default = getStringTruncatedWidth;
127
+
128
+ // node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
129
+ var NO_TRUNCATION2 = {
130
+ limit: Infinity,
131
+ ellipsis: "",
132
+ ellipsisWidth: 0
133
+ };
134
+ var fastStringWidth = (input, options = {}) => {
135
+ return dist_default(input, NO_TRUNCATION2, options).width;
136
+ };
137
+ var dist_default2 = fastStringWidth;
138
+
139
+ // node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
140
+ var ESC = "\x1B";
141
+ var CSI = "\x9B";
142
+ var END_CODE = 39;
143
+ var ANSI_ESCAPE_BELL = "\x07";
144
+ var ANSI_CSI = "[";
145
+ var ANSI_OSC = "]";
146
+ var ANSI_SGR_TERMINATOR = "m";
147
+ var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
148
+ var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
149
+ var getClosingCode = (openingCode) => {
150
+ if (openingCode >= 30 && openingCode <= 37)
151
+ return 39;
152
+ if (openingCode >= 90 && openingCode <= 97)
153
+ return 39;
154
+ if (openingCode >= 40 && openingCode <= 47)
155
+ return 49;
156
+ if (openingCode >= 100 && openingCode <= 107)
157
+ return 49;
158
+ if (openingCode === 1 || openingCode === 2)
159
+ return 22;
160
+ if (openingCode === 3)
161
+ return 23;
162
+ if (openingCode === 4)
163
+ return 24;
164
+ if (openingCode === 7)
165
+ return 27;
166
+ if (openingCode === 8)
167
+ return 28;
168
+ if (openingCode === 9)
169
+ return 29;
170
+ if (openingCode === 0)
171
+ return 0;
172
+ return void 0;
173
+ };
174
+ var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
175
+ var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
176
+ var wrapWord = (rows, word, columns) => {
177
+ const characters = word[Symbol.iterator]();
178
+ let isInsideEscape = false;
179
+ let isInsideLinkEscape = false;
180
+ let lastRow = rows.at(-1);
181
+ let visible = lastRow === void 0 ? 0 : dist_default2(lastRow);
182
+ let currentCharacter = characters.next();
183
+ let nextCharacter = characters.next();
184
+ let rawCharacterIndex = 0;
185
+ while (!currentCharacter.done) {
186
+ const character = currentCharacter.value;
187
+ const characterLength = dist_default2(character);
188
+ if (visible + characterLength <= columns) {
189
+ rows[rows.length - 1] += character;
190
+ } else {
191
+ rows.push(character);
192
+ visible = 0;
193
+ }
194
+ if (character === ESC || character === CSI) {
195
+ isInsideEscape = true;
196
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
197
+ }
198
+ if (isInsideEscape) {
199
+ if (isInsideLinkEscape) {
200
+ if (character === ANSI_ESCAPE_BELL) {
201
+ isInsideEscape = false;
202
+ isInsideLinkEscape = false;
203
+ }
204
+ } else if (character === ANSI_SGR_TERMINATOR) {
205
+ isInsideEscape = false;
206
+ }
207
+ } else {
208
+ visible += characterLength;
209
+ if (visible === columns && !nextCharacter.done) {
210
+ rows.push("");
211
+ visible = 0;
212
+ }
213
+ }
214
+ currentCharacter = nextCharacter;
215
+ nextCharacter = characters.next();
216
+ rawCharacterIndex += character.length;
217
+ }
218
+ lastRow = rows.at(-1);
219
+ if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) {
220
+ rows[rows.length - 2] += rows.pop();
221
+ }
222
+ };
223
+ var stringVisibleTrimSpacesRight = (string) => {
224
+ const words = string.split(" ");
225
+ let last = words.length;
226
+ while (last) {
227
+ if (dist_default2(words[last - 1])) {
228
+ break;
229
+ }
230
+ last--;
231
+ }
232
+ if (last === words.length) {
233
+ return string;
234
+ }
235
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
236
+ };
237
+ var exec = (string, columns, options = {}) => {
238
+ if (options.trim !== false && string.trim() === "") {
239
+ return "";
240
+ }
241
+ let returnValue = "";
242
+ let escapeCode;
243
+ let escapeUrl;
244
+ const words = string.split(" ");
245
+ let rows = [""];
246
+ let rowLength = 0;
247
+ for (let index = 0; index < words.length; index++) {
248
+ const word = words[index];
249
+ if (options.trim !== false) {
250
+ const row = rows.at(-1) ?? "";
251
+ const trimmed = row.trimStart();
252
+ if (row.length !== trimmed.length) {
253
+ rows[rows.length - 1] = trimmed;
254
+ rowLength = dist_default2(trimmed);
255
+ }
256
+ }
257
+ if (index !== 0) {
258
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
259
+ rows.push("");
260
+ rowLength = 0;
261
+ }
262
+ if (rowLength || options.trim === false) {
263
+ rows[rows.length - 1] += " ";
264
+ rowLength++;
265
+ }
266
+ }
267
+ const wordLength = dist_default2(word);
268
+ if (options.hard && wordLength > columns) {
269
+ const remainingColumns = columns - rowLength;
270
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
271
+ const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
272
+ if (breaksStartingNextLine < breaksStartingThisLine) {
273
+ rows.push("");
274
+ }
275
+ wrapWord(rows, word, columns);
276
+ rowLength = dist_default2(rows.at(-1) ?? "");
277
+ continue;
278
+ }
279
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
280
+ if (options.wordWrap === false && rowLength < columns) {
281
+ wrapWord(rows, word, columns);
282
+ rowLength = dist_default2(rows.at(-1) ?? "");
283
+ continue;
284
+ }
285
+ rows.push("");
286
+ rowLength = 0;
287
+ }
288
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
289
+ wrapWord(rows, word, columns);
290
+ rowLength = dist_default2(rows.at(-1) ?? "");
291
+ continue;
292
+ }
293
+ rows[rows.length - 1] += word;
294
+ rowLength += wordLength;
295
+ }
296
+ if (options.trim !== false) {
297
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
298
+ }
299
+ const preString = rows.join("\n");
300
+ let inSurrogate = false;
301
+ for (let i2 = 0; i2 < preString.length; i2++) {
302
+ const character = preString[i2];
303
+ returnValue += character;
304
+ if (!inSurrogate) {
305
+ inSurrogate = character >= "\uD800" && character <= "\uDBFF";
306
+ if (inSurrogate) {
307
+ continue;
308
+ }
309
+ } else {
310
+ inSurrogate = false;
311
+ }
312
+ if (character === ESC || character === CSI) {
313
+ GROUP_REGEX.lastIndex = i2 + 1;
314
+ const groupsResult = GROUP_REGEX.exec(preString);
315
+ const groups = groupsResult?.groups;
316
+ if (groups?.code !== void 0) {
317
+ const code = Number.parseFloat(groups.code);
318
+ escapeCode = code === END_CODE ? void 0 : code;
319
+ } else if (groups?.uri !== void 0) {
320
+ escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
321
+ }
322
+ }
323
+ if (preString[i2 + 1] === "\n") {
324
+ if (escapeUrl) {
325
+ returnValue += wrapAnsiHyperlink("");
326
+ }
327
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
328
+ if (escapeCode && closingCode) {
329
+ returnValue += wrapAnsiCode(closingCode);
330
+ }
331
+ } else if (character === "\n") {
332
+ if (escapeCode && getClosingCode(escapeCode)) {
333
+ returnValue += wrapAnsiCode(escapeCode);
334
+ }
335
+ if (escapeUrl) {
336
+ returnValue += wrapAnsiHyperlink(escapeUrl);
337
+ }
338
+ }
339
+ }
340
+ return returnValue;
341
+ };
342
+ var CRLF_OR_LF = /\r?\n/;
343
+ function wrapAnsi(string, columns, options) {
344
+ return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
345
+ }
346
+
347
+ // node_modules/.pnpm/sisteransi@2.0.0/node_modules/sisteransi/dist/index.js
348
+ var ESC2 = "\x1B";
349
+ var CSI2 = `${ESC2}[`;
350
+ var cursor = {
351
+ to(x2, y) {
352
+ if (!y)
353
+ return `${CSI2}${x2 + 1}G`;
354
+ return `${CSI2}${y + 1};${x2 + 1}H`;
355
+ },
356
+ move(x2, y) {
357
+ let ret = "";
358
+ if (x2 < 0)
359
+ ret += `${CSI2}${-x2}D`;
360
+ else if (x2 > 0)
361
+ ret += `${CSI2}${x2}C`;
362
+ if (y < 0)
363
+ ret += `${CSI2}${-y}A`;
364
+ else if (y > 0)
365
+ ret += `${CSI2}${y}B`;
366
+ return ret;
367
+ },
368
+ up: (count = 1) => `${CSI2}${count}A`,
369
+ down: (count = 1) => `${CSI2}${count}B`,
370
+ forward: (count = 1) => `${CSI2}${count}C`,
371
+ backward: (count = 1) => `${CSI2}${count}D`,
372
+ nextLine: (count = 1) => `${CSI2}E`.repeat(count),
373
+ prevLine: (count = 1) => `${CSI2}F`.repeat(count),
374
+ left: `${CSI2}G`,
375
+ hide: `${CSI2}?25l`,
376
+ show: `${CSI2}?25h`,
377
+ save: `${ESC2}7`,
378
+ restore: `${ESC2}8`
379
+ };
380
+ var erase = {
381
+ screen: `${CSI2}2J`,
382
+ up: (count = 1) => `${CSI2}1J`.repeat(count),
383
+ down: (count = 1) => `${CSI2}J`.repeat(count),
384
+ line: `${CSI2}2K`,
385
+ lineEnd: `${CSI2}K`,
386
+ lineStart: `${CSI2}1K`,
387
+ lines(count) {
388
+ let clear2 = "";
389
+ for (let i2 = 0; i2 < count; i2++)
390
+ clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
391
+ if (count)
392
+ clear2 += cursor.left;
393
+ return clear2;
394
+ }
395
+ };
396
+ var clear = {
397
+ screen: `${ESC2}c`
398
+ };
399
+
400
+ // node_modules/.pnpm/@clack+core@1.6.0/node_modules/@clack/core/dist/index.mjs
401
+ import { ReadStream } from "tty";
402
+ function findCursor(o2, s, l) {
403
+ if (!l.some((r2) => !r2.disabled))
404
+ return o2;
405
+ const t2 = o2 + s, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
406
+ return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
407
+ }
408
+ function findTextCursor(o2, s, l, i2) {
409
+ const t2 = i2.split(`
410
+ `);
411
+ let n3 = 0, e = o2;
412
+ for (const r2 of t2) {
413
+ if (e <= r2.length)
414
+ break;
415
+ e -= r2.length + 1, n3++;
416
+ }
417
+ for (n3 = Math.max(0, Math.min(t2.length - 1, n3 + l)), e = Math.min(e, t2[n3].length) + s; e < 0 && n3 > 0; )
418
+ n3--, e += t2[n3].length + 1;
419
+ for (; e > t2[n3].length && n3 < t2.length - 1; )
420
+ e -= t2[n3].length + 1, n3++;
421
+ e = Math.max(0, Math.min(t2[n3].length, e));
422
+ let h2 = 0;
423
+ for (let r2 = 0; r2 < n3; r2++)
424
+ h2 += t2[r2].length + 1;
425
+ return h2 + e;
426
+ }
427
+ var a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
428
+ var t = [
429
+ "January",
430
+ "February",
431
+ "March",
432
+ "April",
433
+ "May",
434
+ "June",
435
+ "July",
436
+ "August",
437
+ "September",
438
+ "October",
439
+ "November",
440
+ "December"
441
+ ];
442
+ var settings = {
443
+ actions: new Set(a$1),
444
+ aliases: /* @__PURE__ */ new Map([
445
+ // vim support
446
+ ["k", "up"],
447
+ ["j", "down"],
448
+ ["h", "left"],
449
+ ["l", "right"],
450
+ ["", "cancel"],
451
+ // opinionated defaults!
452
+ ["escape", "cancel"]
453
+ ]),
454
+ messages: {
455
+ cancel: "Canceled",
456
+ error: "Something went wrong"
457
+ },
458
+ withGuide: true,
459
+ accessible: void 0,
460
+ date: {
461
+ monthNames: [...t],
462
+ messages: {
463
+ required: "Please enter a valid date",
464
+ invalidMonth: "There are only 12 months in a year",
465
+ invalidDay: (n3, e) => `There are only ${n3} days in ${e}`,
466
+ afterMin: (n3) => `Date must be on or after ${n3.toISOString().slice(0, 10)}`,
467
+ beforeMax: (n3) => `Date must be on or before ${n3.toISOString().slice(0, 10)}`
468
+ }
469
+ }
470
+ };
471
+ function updateSettings(n3) {
472
+ if (n3.aliases !== void 0) {
473
+ const e = n3.aliases;
474
+ for (const s in e) {
475
+ if (!Object.hasOwn(e, s)) continue;
476
+ const i2 = e[s];
477
+ i2 === void 0 || !settings.actions.has(i2) || settings.aliases.has(s) || settings.aliases.set(s, i2);
478
+ }
479
+ }
480
+ if (n3.messages !== void 0) {
481
+ const e = n3.messages;
482
+ e.cancel !== void 0 && (settings.messages.cancel = e.cancel), e.error !== void 0 && (settings.messages.error = e.error);
483
+ }
484
+ if (n3.withGuide !== void 0 && (settings.withGuide = n3.withGuide !== false), n3.accessible !== void 0 && (settings.accessible = n3.accessible === true), n3.date !== void 0) {
485
+ const e = n3.date;
486
+ e.monthNames !== void 0 && (settings.date.monthNames = [...e.monthNames]), e.messages !== void 0 && (e.messages.required !== void 0 && (settings.date.messages.required = e.messages.required), e.messages.invalidMonth !== void 0 && (settings.date.messages.invalidMonth = e.messages.invalidMonth), e.messages.invalidDay !== void 0 && (settings.date.messages.invalidDay = e.messages.invalidDay), e.messages.afterMin !== void 0 && (settings.date.messages.afterMin = e.messages.afterMin), e.messages.beforeMax !== void 0 && (settings.date.messages.beforeMax = e.messages.beforeMax));
487
+ }
488
+ }
489
+ function isAccessible(n3) {
490
+ if (n3 !== void 0) return n3;
491
+ if (settings.accessible !== void 0) return settings.accessible;
492
+ const e = process.env.ACCESSIBLE;
493
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
494
+ }
495
+ function isActionKey(n3, e) {
496
+ if (typeof n3 == "string")
497
+ return settings.aliases.get(n3) === e;
498
+ for (const s of n3)
499
+ if (s !== void 0 && isActionKey(s, e))
500
+ return true;
501
+ return false;
502
+ }
503
+ function diffLines(i2, s) {
504
+ if (i2 === s) return;
505
+ const e = i2.split(`
506
+ `), t2 = s.split(`
507
+ `), r2 = Math.max(e.length, t2.length), f2 = [];
508
+ for (let n3 = 0; n3 < r2; n3++)
509
+ e[n3] !== t2[n3] && f2.push(n3);
510
+ return {
511
+ lines: f2,
512
+ numLinesBefore: e.length,
513
+ numLinesAfter: t2.length,
514
+ numLines: r2
515
+ };
516
+ }
517
+ var R = globalThis.process.platform.startsWith("win");
518
+ var CANCEL_SYMBOL = /* @__PURE__ */ Symbol("clack:cancel");
519
+ function isCancel(e) {
520
+ return e === CANCEL_SYMBOL;
521
+ }
522
+ function setRawMode(e, r2) {
523
+ const o2 = e;
524
+ o2.isTTY && o2.setRawMode(r2);
525
+ }
526
+ function block({
527
+ input: e = stdin,
528
+ output: r2 = stdout,
529
+ overwrite: o2 = true,
530
+ hideCursor: n3 = true
531
+ } = {}) {
532
+ const s = f$1.createInterface({
533
+ input: e,
534
+ output: r2,
535
+ prompt: "",
536
+ tabSize: 1
537
+ });
538
+ f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
539
+ const t2 = (l, { name: i2, sequence: p3 }) => {
540
+ const w = String(l);
541
+ if (isActionKey([w, i2, p3], "cancel")) {
542
+ n3 && r2.write(cursor.show), process.exit(0);
543
+ return;
544
+ }
545
+ if (!o2) return;
546
+ const c3 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
547
+ f$1.moveCursor(r2, c3, a2, () => {
548
+ f$1.clearLine(r2, 1, () => {
549
+ e.once("keypress", t2);
550
+ });
551
+ });
552
+ };
553
+ return n3 && r2.write(cursor.hide), e.once("keypress", t2), () => {
554
+ e.off("keypress", t2), n3 && r2.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
555
+ };
556
+ }
557
+ var getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
558
+ var getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
559
+ function wrapTextWithPrefix(e, r2, o2, n3 = o2, s = o2, t2) {
560
+ const l = getColumns(e ?? stdout), i2 = dist_default2(o2);
561
+ return wrapAnsi(r2, l - i2, {
562
+ hard: true,
563
+ trim: false
564
+ }).split(`
565
+ `).map((c3, a2, g2) => {
566
+ const m3 = t2 ? t2(c3, a2) : c3;
567
+ return a2 === 0 ? `${n3}${m3}` : a2 === g2.length - 1 ? `${s}${m3}` : `${o2}${m3}`;
568
+ }).join(`
569
+ `);
570
+ }
571
+ function runValidation(e, a2) {
572
+ if ("~standard" in e) {
573
+ const n3 = e["~standard"].validate(a2);
574
+ return n3 instanceof Promise ? n3.then((r2) => r2.issues?.at(0)?.message) : n3.issues?.at(0)?.message;
575
+ }
576
+ return e(a2);
577
+ }
578
+ var C$1 = class C {
579
+ input;
580
+ output;
581
+ _abortSignal;
582
+ rl;
583
+ opts;
584
+ _render;
585
+ _track = false;
586
+ _prevFrame = "";
587
+ _subscribers = /* @__PURE__ */ new Map();
588
+ _cursor = 0;
589
+ state = "initial";
590
+ error = "";
591
+ value;
592
+ userInput = "";
593
+ /**
594
+ * Whether accessible (static, screen-reader friendly) output is enabled for
595
+ * this prompt, resolved from the `accessible` option, the global setting,
596
+ * and the `ACCESSIBLE` env var.
597
+ */
598
+ get accessible() {
599
+ return isAccessible(this.opts.accessible);
600
+ }
601
+ constructor(t2, e = true) {
602
+ const { input: i2 = stdin, output: s = stdout, render: r2, signal: n3, ...o2 } = t2;
603
+ this.opts = o2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n3, this.input = i2, this.output = s;
604
+ }
605
+ /**
606
+ * Unsubscribe all listeners
607
+ */
608
+ unsubscribe() {
609
+ this._subscribers.clear();
610
+ }
611
+ /**
612
+ * Set a subscriber with opts
613
+ * @param event - The event name
614
+ */
615
+ setSubscriber(t2, e) {
616
+ const i2 = this._subscribers.get(t2) ?? [];
617
+ i2.push(e), this._subscribers.set(t2, i2);
618
+ }
619
+ /**
620
+ * Subscribe to an event
621
+ * @param event - The event name
622
+ * @param cb - The callback
623
+ */
624
+ on(t2, e) {
625
+ this.setSubscriber(t2, { cb: e });
626
+ }
627
+ /**
628
+ * Subscribe to an event once
629
+ * @param event - The event name
630
+ * @param cb - The callback
631
+ */
632
+ once(t2, e) {
633
+ this.setSubscriber(t2, { cb: e, once: true });
634
+ }
635
+ /**
636
+ * Emit an event with data
637
+ * @param event - The event name
638
+ * @param data - The data to pass to the callback
639
+ */
640
+ emit(t2, ...e) {
641
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
642
+ for (const r2 of i2)
643
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
644
+ for (const r2 of s)
645
+ r2();
646
+ }
647
+ prompt() {
648
+ return new Promise((t2) => {
649
+ if (this._abortSignal) {
650
+ if (this._abortSignal.aborted)
651
+ return this.state = "cancel", this.close(), t2(CANCEL_SYMBOL);
652
+ this._abortSignal.addEventListener(
653
+ "abort",
654
+ () => {
655
+ this.state = "cancel", this.close();
656
+ },
657
+ { once: true }
658
+ );
659
+ }
660
+ this.rl = f__default.createInterface({
661
+ input: this.input,
662
+ tabSize: 2,
663
+ prompt: "",
664
+ escapeCodeTimeout: 50,
665
+ terminal: true
666
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
667
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
668
+ }), this.once("cancel", () => {
669
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
670
+ });
671
+ });
672
+ }
673
+ _isActionKey(t2, e) {
674
+ return t2 === " ";
675
+ }
676
+ _shouldSubmit(t2, e) {
677
+ return true;
678
+ }
679
+ _setValue(t2) {
680
+ this.value = t2, this.emit("value", this.value);
681
+ }
682
+ _setUserInput(t2, e) {
683
+ this.userInput = t2 ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
684
+ }
685
+ _clearUserInput() {
686
+ this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
687
+ }
688
+ async onKeypress(t2, e) {
689
+ if (this.state !== "validating") {
690
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
691
+ if (this.opts.validate) {
692
+ const i2 = runValidation(this.opts.validate, this.value);
693
+ let s;
694
+ i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
695
+ }
696
+ this.state !== "error" && (this.state = "submit");
697
+ }
698
+ isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
699
+ }
700
+ }
701
+ close() {
702
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
703
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
704
+ }
705
+ restoreCursor() {
706
+ const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
707
+ `).length - 1;
708
+ this.output.write(cursor.move(-999, t2 * -1));
709
+ }
710
+ render() {
711
+ const t2 = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
712
+ hard: true,
713
+ trim: false
714
+ });
715
+ if (t2 !== this._prevFrame) {
716
+ if (this.state === "initial")
717
+ this.output.write(cursor.hide);
718
+ else {
719
+ const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
720
+ if (this.restoreCursor(), e) {
721
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
722
+ let n3 = e.lines.find((o2) => o2 >= s);
723
+ if (n3 === void 0) {
724
+ this._prevFrame = t2;
725
+ return;
726
+ }
727
+ if (e.lines.length === 1) {
728
+ this.output.write(cursor.move(0, n3 - r2)), this.output.write(erase.lines(1));
729
+ const o2 = t2.split(`
730
+ `);
731
+ this.output.write(o2[n3]), this._prevFrame = t2, this.output.write(cursor.move(0, o2.length - n3 - 1));
732
+ return;
733
+ } else if (e.lines.length > 1) {
734
+ if (s < r2)
735
+ n3 = s;
736
+ else {
737
+ const h2 = n3 - r2;
738
+ h2 > 0 && this.output.write(cursor.move(0, h2));
739
+ }
740
+ this.output.write(erase.down());
741
+ const m3 = t2.split(`
742
+ `).slice(n3);
743
+ this.output.write(m3.join(`
744
+ `)), this._prevFrame = t2;
745
+ return;
746
+ }
747
+ }
748
+ this.output.write(erase.down());
749
+ }
750
+ this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
751
+ }
752
+ }
753
+ };
754
+ function p$1(l, e) {
755
+ if (l === void 0 || e.length === 0)
756
+ return 0;
757
+ const i2 = e.findIndex((s) => s.value === l);
758
+ return i2 !== -1 ? i2 : 0;
759
+ }
760
+ function m(l, e) {
761
+ return (e.label ?? String(e.value)).toLowerCase().includes(l.toLowerCase());
762
+ }
763
+ function g(l, e) {
764
+ if (e)
765
+ return l ? e : e[0];
766
+ }
767
+ var T$1 = class T extends C$1 {
768
+ filteredOptions;
769
+ multiple;
770
+ isNavigating = false;
771
+ selectedValues = [];
772
+ focusedValue;
773
+ #e = 0;
774
+ #s = "";
775
+ #t;
776
+ #i;
777
+ #n;
778
+ #l;
779
+ get cursor() {
780
+ return this.#e;
781
+ }
782
+ get userInputWithCursor() {
783
+ if (!this.userInput)
784
+ return styleText(["inverse", "hidden"], "_");
785
+ if (this._cursor >= this.userInput.length)
786
+ return `${this.userInput}\u2588`;
787
+ const e = this.userInput.slice(0, this.cursor), t2 = this.userInput.slice(this.cursor, this.cursor + 1), i2 = this.userInput.slice(this.cursor + 1);
788
+ return `${e}${styleText("inverse", t2)}${i2}`;
789
+ }
790
+ get options() {
791
+ return typeof this.#i == "function" ? this.#i() : this.#i;
792
+ }
793
+ constructor(e) {
794
+ super(e), this.#i = e.options, this.#n = e.placeholder, this.#l = e.completeOnTab === true;
795
+ const t2 = this.options;
796
+ this.filteredOptions = [...t2], this.multiple = e.multiple === true, this.#t = typeof e.options == "function" ? e.filter : e.filter ?? m;
797
+ let i2;
798
+ if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i2 = e.initialValue : i2 = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i2 = [this.options[0]?.value]), i2)
799
+ for (const s of i2) {
800
+ const n3 = t2.findIndex((r2) => r2.value === s);
801
+ n3 !== -1 && (this.toggleSelected(s), this.#e = n3);
802
+ }
803
+ this.focusedValue = this.options[this.#e]?.value, this.on("key", (s, n3) => this.#u(s, n3)), this.on("userInput", (s) => this.#o(s));
804
+ }
805
+ _isActionKey(e, t2) {
806
+ return e === " " || this.multiple && this.isNavigating && t2.name === "space" && e !== void 0 && e !== "";
807
+ }
808
+ #u(e, t2) {
809
+ const i2 = t2.name === "up", s = t2.name === "down", n3 = t2.name === "return", r2 = this.userInput === "" || this.userInput === " ", u4 = this.#n, d = this.options, c3 = u4 !== void 0 && u4 !== "" && d.some(
810
+ (o2) => !o2.disabled && (this.#t ? this.#t(u4, o2) : true)
811
+ );
812
+ if (t2.name === "tab" && r2 && c3) {
813
+ this.userInput === " " && this._clearUserInput(), this._setUserInput(u4, true), this.isNavigating = false;
814
+ return;
815
+ }
816
+ if (t2.name === "tab" && this.#l && !this.multiple && this.focusedValue !== void 0) {
817
+ const o2 = String(this.focusedValue);
818
+ this._clearUserInput(), this._setUserInput(o2, true), this.isNavigating = false;
819
+ return;
820
+ }
821
+ i2 || s ? (this.#e = findCursor(this.#e, i2 ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = true) : n3 ? this.value = g(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== void 0 && (t2.name === "tab" || this.isNavigating && t2.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = false : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = false);
822
+ }
823
+ deselectAll() {
824
+ this.selectedValues = [];
825
+ }
826
+ toggleSelected(e) {
827
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((t2) => t2 !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);
828
+ }
829
+ #o(e) {
830
+ if (e !== this.#s) {
831
+ this.#s = e;
832
+ const t2 = this.options;
833
+ e && this.#t ? this.filteredOptions = t2.filter((n3) => this.#t?.(e, n3)) : this.filteredOptions = [...t2];
834
+ const i2 = p$1(this.focusedValue, this.filteredOptions);
835
+ this.#e = findCursor(i2, 0, this.filteredOptions);
836
+ const s = this.filteredOptions[this.#e];
837
+ s && !s.disabled ? this.focusedValue = s.value : this.focusedValue = void 0, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
838
+ }
839
+ }
840
+ };
841
+ var r = class extends C$1 {
842
+ get cursor() {
843
+ return this.value ? 0 : 1;
844
+ }
845
+ get _value() {
846
+ return this.cursor === 0;
847
+ }
848
+ constructor(t2) {
849
+ super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
850
+ this.value = this._value;
851
+ }), this.on("confirm", (i2) => {
852
+ this.output.write(cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
853
+ }), this.on("cursor", () => {
854
+ this.value = !this.value;
855
+ });
856
+ }
857
+ };
858
+ var _ = {
859
+ Y: { type: "year", len: 4 },
860
+ M: { type: "month", len: 2 },
861
+ D: { type: "day", len: 2 }
862
+ };
863
+ function M(r2) {
864
+ return [...r2].map((t2) => _[t2]);
865
+ }
866
+ function P(r2) {
867
+ const i2 = new Intl.DateTimeFormat(r2, {
868
+ year: "numeric",
869
+ month: "2-digit",
870
+ day: "2-digit"
871
+ }).formatToParts(new Date(2e3, 0, 15)), s = [];
872
+ let n3 = "/";
873
+ for (const e of i2)
874
+ e.type === "literal" ? n3 = e.value.trim() || e.value : (e.type === "year" || e.type === "month" || e.type === "day") && s.push({ type: e.type, len: e.type === "year" ? 4 : 2 });
875
+ return { segments: s, separator: n3 };
876
+ }
877
+ function p(r2) {
878
+ return Number.parseInt((r2 || "0").replace(/_/g, "0"), 10) || 0;
879
+ }
880
+ function f(r2) {
881
+ return {
882
+ year: p(r2.year),
883
+ month: p(r2.month),
884
+ day: p(r2.day)
885
+ };
886
+ }
887
+ function c$1(r2, t2) {
888
+ return new Date(r2 || 2001, t2 || 1, 0).getDate();
889
+ }
890
+ function b(r2) {
891
+ const { year: t2, month: i2, day: s } = f(r2);
892
+ if (!t2 || t2 < 0 || t2 > 9999 || !i2 || i2 < 1 || i2 > 12 || !s || s < 1) return;
893
+ const n3 = new Date(Date.UTC(t2, i2 - 1, s));
894
+ if (!(n3.getUTCFullYear() !== t2 || n3.getUTCMonth() !== i2 - 1 || n3.getUTCDate() !== s))
895
+ return { year: t2, month: i2, day: s };
896
+ }
897
+ function C2(r2) {
898
+ const t2 = b(r2);
899
+ return t2 ? new Date(Date.UTC(t2.year, t2.month - 1, t2.day)) : void 0;
900
+ }
901
+ function T2(r2, t2, i2, s) {
902
+ const n3 = i2 ? {
903
+ year: i2.getUTCFullYear(),
904
+ month: i2.getUTCMonth() + 1,
905
+ day: i2.getUTCDate()
906
+ } : null, e = s ? {
907
+ year: s.getUTCFullYear(),
908
+ month: s.getUTCMonth() + 1,
909
+ day: s.getUTCDate()
910
+ } : null;
911
+ return r2 === "year" ? { min: n3?.year ?? 1, max: e?.year ?? 9999 } : r2 === "month" ? {
912
+ min: n3 && t2.year === n3.year ? n3.month : 1,
913
+ max: e && t2.year === e.year ? e.month : 12
914
+ } : {
915
+ min: n3 && t2.year === n3.year && t2.month === n3.month ? n3.day : 1,
916
+ max: e && t2.year === e.year && t2.month === e.month ? e.day : c$1(t2.year, t2.month)
917
+ };
918
+ }
919
+ var U = class extends C$1 {
920
+ #i;
921
+ #o;
922
+ #t;
923
+ #h;
924
+ #u;
925
+ #e = { segmentIndex: 0, positionInSegment: 0 };
926
+ #n = true;
927
+ #s = null;
928
+ inlineError = "";
929
+ get segmentCursor() {
930
+ return { ...this.#e };
931
+ }
932
+ get segmentValues() {
933
+ return { ...this.#t };
934
+ }
935
+ get segments() {
936
+ return this.#i;
937
+ }
938
+ get separator() {
939
+ return this.#o;
940
+ }
941
+ get formattedValue() {
942
+ return this.#l(this.#t);
943
+ }
944
+ #l(t2) {
945
+ return this.#i.map((i2) => t2[i2.type]).join(this.#o);
946
+ }
947
+ #r() {
948
+ this._setUserInput(this.#l(this.#t)), this._setValue(C2(this.#t) ?? void 0);
949
+ }
950
+ constructor(t2) {
951
+ const i2 = t2.format ? { segments: M(t2.format), separator: t2.separator ?? "/" } : P(t2.locale), s = t2.separator ?? i2.separator, n3 = t2.format ? M(t2.format) : i2.segments, e = t2.initialValue ?? t2.defaultValue, m3 = e ? {
952
+ year: String(e.getUTCFullYear()).padStart(4, "0"),
953
+ month: String(e.getUTCMonth() + 1).padStart(2, "0"),
954
+ day: String(e.getUTCDate()).padStart(2, "0")
955
+ } : { year: "____", month: "__", day: "__" }, o2 = n3.map((a2) => m3[a2.type]).join(s);
956
+ super({ ...t2, initialUserInput: o2 }, false), this.#i = n3, this.#o = s, this.#t = m3, this.#h = t2.minDate, this.#u = t2.maxDate, this.#r(), this.on("cursor", (a2) => this.#f(a2)), this.on("key", (a2, u4) => this.#y(a2, u4)), this.on("finalize", () => this.#p(t2));
957
+ }
958
+ #a() {
959
+ const t2 = Math.max(0, Math.min(this.#e.segmentIndex, this.#i.length - 1)), i2 = this.#i[t2];
960
+ if (i2)
961
+ return this.#e.positionInSegment = Math.max(
962
+ 0,
963
+ Math.min(this.#e.positionInSegment, i2.len - 1)
964
+ ), { segment: i2, index: t2 };
965
+ }
966
+ #m(t2) {
967
+ this.inlineError = "", this.#s = null;
968
+ const i2 = this.#a();
969
+ i2 && (this.#e.segmentIndex = Math.max(
970
+ 0,
971
+ Math.min(this.#i.length - 1, i2.index + t2)
972
+ ), this.#e.positionInSegment = 0, this.#n = true);
973
+ }
974
+ #d(t2) {
975
+ const i2 = this.#a();
976
+ if (!i2) return;
977
+ const { segment: s } = i2, n3 = this.#t[s.type], e = !n3 || n3.replace(/_/g, "") === "", m3 = Number.parseInt((n3 || "0").replace(/_/g, "0"), 10) || 0, o2 = T2(
978
+ s.type,
979
+ f(this.#t),
980
+ this.#h,
981
+ this.#u
982
+ );
983
+ let a2;
984
+ e ? a2 = t2 === 1 ? o2.min : o2.max : a2 = Math.max(Math.min(o2.max, m3 + t2), o2.min), this.#t = {
985
+ ...this.#t,
986
+ [s.type]: a2.toString().padStart(s.len, "0")
987
+ }, this.#n = true, this.#s = null, this.#r();
988
+ }
989
+ #f(t2) {
990
+ if (t2)
991
+ switch (t2) {
992
+ case "right":
993
+ return this.#m(1);
994
+ case "left":
995
+ return this.#m(-1);
996
+ case "up":
997
+ return this.#d(1);
998
+ case "down":
999
+ return this.#d(-1);
1000
+ }
1001
+ }
1002
+ #y(t2, i2) {
1003
+ if (i2?.name === "backspace" || i2?.sequence === "\x7F" || i2?.sequence === "\b" || t2 === "\x7F" || t2 === "\b") {
1004
+ this.inlineError = "";
1005
+ const n3 = this.#a();
1006
+ if (!n3) return;
1007
+ if (!this.#t[n3.segment.type].replace(/_/g, "")) {
1008
+ this.#m(-1);
1009
+ return;
1010
+ }
1011
+ this.#t[n3.segment.type] = "_".repeat(n3.segment.len), this.#n = true, this.#e.positionInSegment = 0, this.#r();
1012
+ return;
1013
+ }
1014
+ if (i2?.name === "tab") {
1015
+ this.inlineError = "";
1016
+ const n3 = this.#a();
1017
+ if (!n3) return;
1018
+ const e = i2.shift ? -1 : 1, m3 = n3.index + e;
1019
+ m3 >= 0 && m3 < this.#i.length && (this.#e.segmentIndex = m3, this.#e.positionInSegment = 0, this.#n = true);
1020
+ return;
1021
+ }
1022
+ if (t2 && /^[0-9]$/.test(t2)) {
1023
+ const n3 = this.#a();
1024
+ if (!n3) return;
1025
+ const { segment: e } = n3, m3 = !this.#t[e.type].replace(/_/g, "");
1026
+ if (this.#n && this.#s !== null && !m3) {
1027
+ const h2 = this.#s + t2, d = { ...this.#t, [e.type]: h2 }, g2 = this.#g(d, e);
1028
+ if (g2) {
1029
+ this.inlineError = g2, this.#s = null, this.#n = false;
1030
+ return;
1031
+ }
1032
+ this.inlineError = "", this.#t[e.type] = h2, this.#s = null, this.#n = false, this.#r(), n3.index < this.#i.length - 1 && (this.#e.segmentIndex = n3.index + 1, this.#e.positionInSegment = 0, this.#n = true);
1033
+ return;
1034
+ }
1035
+ this.#n && !m3 && (this.#t[e.type] = "_".repeat(e.len), this.#e.positionInSegment = 0), this.#n = false, this.#s = null;
1036
+ const o2 = this.#t[e.type], a2 = o2.indexOf("_"), u4 = a2 >= 0 ? a2 : Math.min(this.#e.positionInSegment, e.len - 1);
1037
+ if (u4 < 0 || u4 >= e.len) return;
1038
+ let l = o2.slice(0, u4) + t2 + o2.slice(u4 + 1), D = false;
1039
+ if (u4 === 0 && o2 === "__" && (e.type === "month" || e.type === "day")) {
1040
+ const h2 = Number.parseInt(t2, 10);
1041
+ l = `0${t2}`, D = h2 <= (e.type === "month" ? 1 : 2);
1042
+ }
1043
+ if (e.type === "year" && (l = (o2.replace(/_/g, "") + t2).padStart(e.len, "_")), !l.includes("_")) {
1044
+ const h2 = { ...this.#t, [e.type]: l }, d = this.#g(h2, e);
1045
+ if (d) {
1046
+ this.inlineError = d;
1047
+ return;
1048
+ }
1049
+ }
1050
+ this.inlineError = "", this.#t[e.type] = l;
1051
+ const y = l.includes("_") ? void 0 : b(this.#t);
1052
+ if (y) {
1053
+ const { year: h2, month: d } = y, g2 = c$1(h2, d);
1054
+ this.#t = {
1055
+ year: String(Math.max(0, Math.min(9999, h2))).padStart(4, "0"),
1056
+ month: String(Math.max(1, Math.min(12, d))).padStart(2, "0"),
1057
+ day: String(Math.max(1, Math.min(g2, y.day))).padStart(2, "0")
1058
+ };
1059
+ }
1060
+ this.#r();
1061
+ const S = l.indexOf("_");
1062
+ D ? (this.#n = true, this.#s = t2) : S >= 0 ? this.#e.positionInSegment = S : a2 >= 0 && n3.index < this.#i.length - 1 ? (this.#e.segmentIndex = n3.index + 1, this.#e.positionInSegment = 0, this.#n = true) : this.#e.positionInSegment = Math.min(u4 + 1, e.len - 1);
1063
+ }
1064
+ }
1065
+ #g(t2, i2) {
1066
+ const { month: s, day: n3 } = f(t2);
1067
+ if (i2.type === "month" && (s < 0 || s > 12))
1068
+ return settings.date.messages.invalidMonth;
1069
+ if (i2.type === "day" && (n3 < 0 || n3 > 31))
1070
+ return settings.date.messages.invalidDay(31, "any month");
1071
+ }
1072
+ #p(t2) {
1073
+ const { year: i2, month: s, day: n3 } = f(this.#t);
1074
+ if (i2 && s && n3) {
1075
+ const e = c$1(i2, s);
1076
+ this.#t = {
1077
+ ...this.#t,
1078
+ day: String(Math.min(n3, e)).padStart(2, "0")
1079
+ };
1080
+ }
1081
+ this.value = C2(this.#t) ?? t2.defaultValue ?? void 0;
1082
+ }
1083
+ };
1084
+ var u$1 = class u extends C$1 {
1085
+ options;
1086
+ cursor = 0;
1087
+ #e;
1088
+ getGroupItems(t2) {
1089
+ return this.options.filter((i2) => i2.group === t2);
1090
+ }
1091
+ isGroupSelected(t2) {
1092
+ const i2 = this.getGroupItems(t2), e = this.value;
1093
+ return e === void 0 ? false : i2.every((s) => e.includes(s.value));
1094
+ }
1095
+ toggleValue() {
1096
+ const t2 = this.options[this.cursor];
1097
+ if (t2 !== void 0)
1098
+ if (this.value === void 0 && (this.value = []), t2.group === true) {
1099
+ const i2 = t2.value, e = this.getGroupItems(i2);
1100
+ this.isGroupSelected(i2) ? this.value = this.value.filter(
1101
+ (s) => e.findIndex((r2) => r2.value === s) === -1
1102
+ ) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));
1103
+ } else {
1104
+ const i2 = this.value.includes(t2.value);
1105
+ this.value = i2 ? this.value.filter((e) => e !== t2.value) : [...this.value, t2.value];
1106
+ }
1107
+ }
1108
+ constructor(t2) {
1109
+ super(t2, false);
1110
+ const { options: i2 } = t2;
1111
+ this.#e = t2.selectableGroups !== false, this.options = Object.entries(i2).flatMap(([e, s]) => [
1112
+ { value: e, group: true, label: e },
1113
+ ...s.map((r2) => ({ ...r2, group: e }))
1114
+ ]), this.value = [...t2.initialValues ?? []], this.cursor = Math.max(
1115
+ this.options.findIndex(({ value: e }) => e === t2.cursorAt),
1116
+ this.#e ? 0 : 1
1117
+ ), this.on("key", (e, s) => {
1118
+ s.name === void 0 && e === "\u3000" && this.toggleValue();
1119
+ }), this.on("cursor", (e) => {
1120
+ switch (e) {
1121
+ case "left":
1122
+ case "up": {
1123
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1124
+ const s = this.options[this.cursor]?.group === true;
1125
+ !this.#e && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1126
+ break;
1127
+ }
1128
+ case "down":
1129
+ case "right": {
1130
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1131
+ const s = this.options[this.cursor]?.group === true;
1132
+ !this.#e && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1133
+ break;
1134
+ }
1135
+ case "space":
1136
+ this.toggleValue();
1137
+ break;
1138
+ }
1139
+ });
1140
+ }
1141
+ };
1142
+ var o = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
1143
+ var h = class extends C$1 {
1144
+ #t = false;
1145
+ #s;
1146
+ focused = "editor";
1147
+ get userInputWithCursor() {
1148
+ if (this.state === "submit")
1149
+ return this.userInput;
1150
+ const t2 = this.userInput;
1151
+ if (this.cursor >= t2.length)
1152
+ return `${t2}\u2588`;
1153
+ const s = t2.slice(0, this.cursor), r2 = t2.slice(this.cursor, this.cursor + 1), i2 = t2.slice(this.cursor + 1);
1154
+ return r2 === `
1155
+ ` ? `${s}\u2588
1156
+ ${i2}` : `${s}${styleText("inverse", r2)}${i2}`;
1157
+ }
1158
+ get cursor() {
1159
+ return this._cursor;
1160
+ }
1161
+ #r(t2) {
1162
+ if (this.userInput.length === 0) {
1163
+ this._setUserInput(t2);
1164
+ return;
1165
+ }
1166
+ this._setUserInput(
1167
+ this.userInput.slice(0, this.cursor) + t2 + this.userInput.slice(this.cursor)
1168
+ );
1169
+ }
1170
+ #i(t2) {
1171
+ const s = this.value ?? "";
1172
+ switch (t2) {
1173
+ case "up":
1174
+ this._cursor = findTextCursor(this._cursor, 0, -1, s);
1175
+ return;
1176
+ case "down":
1177
+ this._cursor = findTextCursor(this._cursor, 0, 1, s);
1178
+ return;
1179
+ case "left":
1180
+ this._cursor = findTextCursor(this._cursor, -1, 0, s);
1181
+ return;
1182
+ case "right":
1183
+ this._cursor = findTextCursor(this._cursor, 1, 0, s);
1184
+ return;
1185
+ }
1186
+ }
1187
+ _shouldSubmit(t2, s) {
1188
+ if (this.#s)
1189
+ return this.focused === "submit" ? true : (this.#r(`
1190
+ `), this._cursor++, false);
1191
+ const r2 = this.#t;
1192
+ return this.#t = true, r2 && this.cursor === this.userInput.length ? (this.userInput[this.cursor - 1] === `
1193
+ ` && (this._setUserInput(
1194
+ this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)
1195
+ ), this._cursor--), true) : (this.#r(`
1196
+ `), this._cursor++, false);
1197
+ }
1198
+ constructor(t2) {
1199
+ const s = t2.initialUserInput ?? t2.initialValue;
1200
+ super(
1201
+ {
1202
+ ...t2,
1203
+ initialUserInput: s
1204
+ },
1205
+ false
1206
+ ), s !== void 0 && (this._cursor = s.length), this.#s = t2.showSubmit ?? false, this.on("key", (r2, i2) => {
1207
+ if (i2?.name && o.has(i2.name)) {
1208
+ this.#t = false, this.#i(i2.name);
1209
+ return;
1210
+ }
1211
+ if (r2 === " " && this.#s) {
1212
+ this.focused = this.focused === "editor" ? "submit" : "editor";
1213
+ return;
1214
+ }
1215
+ if (i2?.name !== "return") {
1216
+ if (this.#t = false, i2?.name === "backspace" && this.cursor > 0) {
1217
+ this._setUserInput(
1218
+ this.userInput.slice(0, this.cursor - 1) + this.userInput.slice(this.cursor)
1219
+ ), this._cursor--;
1220
+ return;
1221
+ }
1222
+ if (i2?.name === "delete" && this.cursor < this.userInput.length) {
1223
+ this._setUserInput(
1224
+ this.userInput.slice(0, this.cursor) + this.userInput.slice(this.cursor + 1)
1225
+ );
1226
+ return;
1227
+ }
1228
+ r2 && (this.#s && this.focused === "submit" && (this.focused = "editor"), this.#r(r2 ?? ""), this._cursor++);
1229
+ }
1230
+ }), this.on("userInput", (r2) => {
1231
+ this._setValue(r2);
1232
+ }), this.on("finalize", () => {
1233
+ this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
1234
+ });
1235
+ }
1236
+ };
1237
+ var a = class extends C$1 {
1238
+ options;
1239
+ cursor = 0;
1240
+ get _value() {
1241
+ return this.options[this.cursor]?.value;
1242
+ }
1243
+ get _enabledOptions() {
1244
+ return this.options.filter((e) => e.disabled !== true);
1245
+ }
1246
+ toggleAll() {
1247
+ const e = this._enabledOptions, i2 = this.value !== void 0 && this.value.length === e.length;
1248
+ this.value = i2 ? [] : e.map((t2) => t2.value);
1249
+ }
1250
+ toggleInvert() {
1251
+ const e = this.value;
1252
+ if (!e)
1253
+ return;
1254
+ const i2 = this._enabledOptions.filter((t2) => !e.includes(t2.value));
1255
+ this.value = i2.map((t2) => t2.value);
1256
+ }
1257
+ toggleValue() {
1258
+ this.value === void 0 && (this.value = []);
1259
+ const e = this.value.includes(this._value);
1260
+ this.value = e ? this.value.filter((i2) => i2 !== this._value) : [...this.value, this._value];
1261
+ }
1262
+ constructor(e) {
1263
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
1264
+ const i2 = Math.max(
1265
+ this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt),
1266
+ 0
1267
+ );
1268
+ this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, s) => {
1269
+ s.name === "a" && this.toggleAll(), s.name === "i" && this.toggleInvert(), s.name === void 0 && t2 === "\u3000" && this.toggleValue();
1270
+ }), this.on("cursor", (t2) => {
1271
+ switch (t2) {
1272
+ case "left":
1273
+ case "up":
1274
+ this.cursor = findCursor(this.cursor, -1, this.options);
1275
+ break;
1276
+ case "down":
1277
+ case "right":
1278
+ this.cursor = findCursor(this.cursor, 1, this.options);
1279
+ break;
1280
+ case "space":
1281
+ this.toggleValue();
1282
+ break;
1283
+ }
1284
+ });
1285
+ }
1286
+ };
1287
+ var u2 = class extends C$1 {
1288
+ _mask = "\u2022";
1289
+ get cursor() {
1290
+ return this._cursor;
1291
+ }
1292
+ get masked() {
1293
+ return this.userInput.replaceAll(/./g, this._mask);
1294
+ }
1295
+ get userInputWithCursor() {
1296
+ if (this.state === "submit" || this.state === "cancel")
1297
+ return this.masked;
1298
+ const t2 = this.userInput;
1299
+ if (this.cursor >= t2.length)
1300
+ return `${this.masked}${styleText(["inverse", "hidden"], "_")}`;
1301
+ const s = this.masked, r2 = s.slice(0, this.cursor), i2 = s.slice(this.cursor, this.cursor + 1), o2 = s.slice(this.cursor + 1);
1302
+ return `${r2}${styleText("inverse", i2)}${o2}`;
1303
+ }
1304
+ clear() {
1305
+ this._clearUserInput();
1306
+ }
1307
+ constructor({ mask: t2, ...s }) {
1308
+ super(s), this._mask = t2 ?? "\u2022", this.on("userInput", (r2) => {
1309
+ this._setValue(r2);
1310
+ }), this.on("finalize", () => {
1311
+ this.value === void 0 && (this.value = "");
1312
+ });
1313
+ }
1314
+ };
1315
+ var n$1 = class n extends C$1 {
1316
+ options;
1317
+ cursor = 0;
1318
+ get _selectedValue() {
1319
+ return this.options[this.cursor];
1320
+ }
1321
+ changeValue() {
1322
+ const e = this._selectedValue;
1323
+ this.value = e === void 0 ? void 0 : e.value;
1324
+ }
1325
+ constructor(e) {
1326
+ super(e, false), this.options = e.options;
1327
+ const o2 = this.options.findIndex(({ value: s }) => s === e.initialValue), t2 = o2 === -1 ? 0 : o2;
1328
+ this.cursor = this.options[t2]?.disabled ? findCursor(t2, 1, this.options) : t2, this.changeValue(), this.on("cursor", (s) => {
1329
+ switch (s) {
1330
+ case "left":
1331
+ case "up":
1332
+ this.cursor = findCursor(this.cursor, -1, this.options);
1333
+ break;
1334
+ case "down":
1335
+ case "right":
1336
+ this.cursor = findCursor(this.cursor, 1, this.options);
1337
+ break;
1338
+ }
1339
+ this.changeValue();
1340
+ });
1341
+ }
1342
+ };
1343
+ var c = class extends C$1 {
1344
+ options;
1345
+ cursor = 0;
1346
+ constructor(t2) {
1347
+ super(t2, false), this.options = t2.options;
1348
+ const s = t2.caseSensitive === true, i2 = this.options.map(({ value: [e] }) => s ? e : e?.toLowerCase()), n3 = Math.max(i2.indexOf(t2.initialValue), 0);
1349
+ this.cursor = this.options[n3]?.disabled ? 0 : n3, this.on("key", (e) => {
1350
+ if (!e)
1351
+ return;
1352
+ const o2 = s ? e : e.toLowerCase();
1353
+ if (!i2.includes(o2))
1354
+ return;
1355
+ const r2 = this.options.find(({ value: [a2], disabled: u4 }) => u4 ? false : s ? a2 === o2 : a2?.toLowerCase() === o2);
1356
+ r2 && (this.value = r2.value, this.state = "submit", this.emit("submit"));
1357
+ });
1358
+ }
1359
+ };
1360
+ var n2 = class extends C$1 {
1361
+ get userInputWithCursor() {
1362
+ if (this.state === "submit")
1363
+ return this.userInput;
1364
+ const t2 = this.userInput;
1365
+ if (this.cursor >= t2.length)
1366
+ return `${this.userInput}\u2588`;
1367
+ const r2 = t2.slice(0, this.cursor), s = t2.slice(this.cursor, this.cursor + 1), e = t2.slice(this.cursor + 1);
1368
+ return `${r2}${styleText("inverse", s)}${e}`;
1369
+ }
1370
+ get cursor() {
1371
+ return this._cursor;
1372
+ }
1373
+ constructor(t2) {
1374
+ super({
1375
+ ...t2,
1376
+ initialUserInput: t2.initialUserInput ?? t2.initialValue
1377
+ }), this.on("userInput", (r2) => {
1378
+ this._setValue(r2);
1379
+ }), this.on("finalize", () => {
1380
+ this.value || (this.value = t2.defaultValue), this.value === void 0 && (this.value = "");
1381
+ });
1382
+ }
1383
+ };
1384
+
1385
+ // node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.mjs
1386
+ import { styleText as styleText2, stripVTControlCharacters } from "util";
1387
+ import process$1 from "process";
1388
+ import { existsSync, lstatSync, readdirSync } from "fs";
1389
+ import { dirname, join } from "path";
1390
+ function isUnicodeSupported() {
1391
+ if (process$1.platform !== "win32") {
1392
+ return process$1.env.TERM !== "linux";
1393
+ }
1394
+ 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";
1395
+ }
1396
+ var unicode = isUnicodeSupported();
1397
+ var isCI = () => process.env.CI === "true";
1398
+ var isTTY = (e) => e.isTTY === true;
1399
+ var unicodeOr = (e, o2) => unicode ? e : o2;
1400
+ var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
1401
+ var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
1402
+ var S_STEP_ERROR = unicodeOr("\u25B2", "x");
1403
+ var S_STEP_SUBMIT = unicodeOr("\u25C7", "o");
1404
+ var S_BAR_START = unicodeOr("\u250C", "T");
1405
+ var S_BAR = unicodeOr("\u2502", "|");
1406
+ var S_BAR_END = unicodeOr("\u2514", "\u2014");
1407
+ var S_BAR_START_RIGHT = unicodeOr("\u2510", "T");
1408
+ var S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014");
1409
+ var S_RADIO_ACTIVE = unicodeOr("\u25CF", ">");
1410
+ var S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
1411
+ var S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
1412
+ var S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
1413
+ var S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
1414
+ var S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
1415
+ var S_BAR_H = unicodeOr("\u2500", "-");
1416
+ var S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+");
1417
+ var S_CONNECT_LEFT = unicodeOr("\u251C", "+");
1418
+ var S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+");
1419
+ var S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+");
1420
+ var S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+");
1421
+ var S_INFO = unicodeOr("\u25CF", "\u2022");
1422
+ var S_SUCCESS = unicodeOr("\u25C6", "*");
1423
+ var S_WARN = unicodeOr("\u25B2", "!");
1424
+ var S_ERROR = unicodeOr("\u25A0", "x");
1425
+ var symbol = (e) => {
1426
+ switch (e) {
1427
+ case "initial":
1428
+ case "active":
1429
+ return styleText2("cyan", S_STEP_ACTIVE);
1430
+ case "cancel":
1431
+ return styleText2("red", S_STEP_CANCEL);
1432
+ case "error":
1433
+ return styleText2("yellow", S_STEP_ERROR);
1434
+ case "submit":
1435
+ return styleText2("green", S_STEP_SUBMIT);
1436
+ case "validating":
1437
+ return styleText2("dim", S_STEP_ACTIVE);
1438
+ }
1439
+ };
1440
+ var symbolBar = (e) => {
1441
+ switch (e) {
1442
+ case "initial":
1443
+ case "active":
1444
+ return styleText2("cyan", S_BAR);
1445
+ case "cancel":
1446
+ return styleText2("red", S_BAR);
1447
+ case "error":
1448
+ return styleText2("yellow", S_BAR);
1449
+ case "submit":
1450
+ return styleText2("green", S_BAR);
1451
+ }
1452
+ };
1453
+ function formatInstructionFooter(e, o2, r2) {
1454
+ const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n3 = wrapTextWithPrefix(e, o2.join(" \u2022 "), s).split(`
1455
+ `);
1456
+ return r2 && n3.push(styleText2("cyan", S_BAR_END)), n3;
1457
+ }
1458
+ var E$1 = (l, e, w, p3, b3, C4 = false) => {
1459
+ let r2 = e, O = 0;
1460
+ if (C4)
1461
+ for (let i2 = p3 - 1; i2 >= w; i2--) {
1462
+ const m3 = l[i2];
1463
+ if (m3 && (r2 -= m3.length), O++, r2 <= b3) break;
1464
+ }
1465
+ else
1466
+ for (let i2 = w; i2 < p3; i2++) {
1467
+ const m3 = l[i2];
1468
+ if (m3 && (r2 -= m3.length), O++, r2 <= b3) break;
1469
+ }
1470
+ return { lineCount: r2, removals: O };
1471
+ };
1472
+ var limitOptions = ({
1473
+ cursor: l,
1474
+ options: e,
1475
+ style: w,
1476
+ output: p3 = process.stdout,
1477
+ maxItems: b3 = Number.POSITIVE_INFINITY,
1478
+ columnPadding: C4 = 0,
1479
+ rowPadding: r2 = 4
1480
+ }) => {
1481
+ const i2 = getColumns(p3) - C4, m3 = getRows(p3), M2 = styleText2("dim", "..."), v = Math.max(m3 - r2, 0), a2 = Math.max(Math.min(b3, v), 5);
1482
+ let f2 = 0;
1483
+ l >= a2 - 3 && (f2 = Math.max(
1484
+ Math.min(l - a2 + 3, e.length - a2),
1485
+ 0
1486
+ ));
1487
+ let d = a2 < e.length && f2 > 0, c3 = a2 < e.length && f2 + a2 < e.length;
1488
+ const I = Math.min(
1489
+ f2 + a2,
1490
+ e.length
1491
+ ), s = [];
1492
+ let g2 = 0;
1493
+ d && g2++, c3 && g2++;
1494
+ const T3 = f2 + (d ? 1 : 0), W2 = I - (c3 ? 1 : 0);
1495
+ for (let t2 = T3; t2 < W2; t2++) {
1496
+ const n3 = e[t2], o2 = n3 !== void 0 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o2, i2, {
1497
+ hard: true,
1498
+ trim: false
1499
+ }).split(`
1500
+ `);
1501
+ s.push(h2), g2 += h2.length;
1502
+ }
1503
+ if (g2 > v) {
1504
+ let t2 = 0, n3 = 0, o2 = g2;
1505
+ const h2 = l - T3;
1506
+ let u4 = v;
1507
+ const L = () => E$1(s, o2, 0, h2, u4), y = () => E$1(
1508
+ s,
1509
+ o2,
1510
+ h2 + 1,
1511
+ s.length,
1512
+ u4,
1513
+ true
1514
+ );
1515
+ d ? ({ lineCount: o2, removals: t2 } = L(), o2 > u4 && (c3 || (u4 -= 1), { lineCount: o2, removals: n3 } = y())) : (c3 || (u4 -= 1), { lineCount: o2, removals: n3 } = y(), o2 > u4 && (u4 -= 1, { lineCount: o2, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c3 = true, s.splice(s.length - n3, n3));
1516
+ }
1517
+ const x2 = [];
1518
+ d && x2.push(M2);
1519
+ for (const t2 of s)
1520
+ for (const n3 of t2)
1521
+ x2.push(n3);
1522
+ return c3 && x2.push(M2), x2;
1523
+ };
1524
+ function E(t2) {
1525
+ return t2.label ?? String(t2.value ?? "");
1526
+ }
1527
+ function P2(t2, c3) {
1528
+ if (!t2)
1529
+ return true;
1530
+ const n3 = (c3.label ?? String(c3.value ?? "")).toLowerCase(), i2 = (c3.hint ?? "").toLowerCase(), r2 = String(c3.value).toLowerCase(), o2 = t2.toLowerCase();
1531
+ return n3.includes(o2) || i2.includes(o2) || r2.includes(o2);
1532
+ }
1533
+ function j(t2, c3) {
1534
+ const n3 = [];
1535
+ for (const i2 of c3)
1536
+ t2.includes(i2.value) && n3.push(i2);
1537
+ return n3;
1538
+ }
1539
+ var autocomplete = (t2) => new T$1({
1540
+ options: t2.options,
1541
+ initialValue: t2.initialValue !== void 0 ? [t2.initialValue] : void 0,
1542
+ initialUserInput: t2.initialUserInput,
1543
+ placeholder: t2.placeholder,
1544
+ completeOnTab: t2.completeOnTab,
1545
+ filter: t2.filter ?? ((n3, i2) => P2(n3, i2)),
1546
+ signal: t2.signal,
1547
+ input: t2.input,
1548
+ output: t2.output,
1549
+ validate: t2.validate,
1550
+ render() {
1551
+ const n3 = t2.withGuide ?? settings.withGuide, i2 = n3 ? [`${styleText2("gray", S_BAR)}`, `${symbol(this.state)} ${t2.message}`] : [`${symbol(this.state)} ${t2.message}`], r2 = this.userInput, o2 = this.options, m3 = t2.placeholder, p3 = r2 === "" && m3 !== void 0, $ = (l, s) => {
1552
+ const a2 = E(l), u4 = l.hint && l.value === this.focusedValue ? styleText2("dim", ` (${l.hint})`) : "";
1553
+ switch (s) {
1554
+ case "active":
1555
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${a2}${u4}`;
1556
+ case "inactive":
1557
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`;
1558
+ case "disabled":
1559
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${styleText2(["strikethrough", "gray"], a2)}`;
1560
+ }
1561
+ };
1562
+ switch (this.state) {
1563
+ case "submit": {
1564
+ const l = j(this.selectedValues, o2), s = l.length > 0 ? ` ${styleText2("dim", l.map(E).join(", "))}` : "", a2 = n3 ? styleText2("gray", S_BAR) : "";
1565
+ return `${i2.join(`
1566
+ `)}
1567
+ ${a2}${s}`;
1568
+ }
1569
+ case "cancel": {
1570
+ const l = r2 ? ` ${styleText2(["strikethrough", "dim"], r2)}` : "", s = n3 ? styleText2("gray", S_BAR) : "";
1571
+ return `${i2.join(`
1572
+ `)}
1573
+ ${s}${l}`;
1574
+ }
1575
+ default: {
1576
+ const l = this.state === "error" ? "yellow" : "cyan", s = n3 ? `${styleText2(l, S_BAR)} ` : "", a2 = n3 ? styleText2(l, S_BAR_END) : "";
1577
+ let u4 = "";
1578
+ if (this.isNavigating || p3) {
1579
+ const d = p3 ? m3 : r2;
1580
+ u4 = d !== "" ? ` ${styleText2("dim", d)}` : "";
1581
+ } else
1582
+ u4 = ` ${this.userInputWithCursor}`;
1583
+ const V = this.filteredOptions.length !== o2.length ? styleText2(
1584
+ "dim",
1585
+ ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`
1586
+ ) : "", b3 = this.filteredOptions.length === 0 && r2 ? [`${s}${styleText2("yellow", "No matches found")}`] : [], y = this.state === "error" ? [`${s}${styleText2("yellow", this.error)}`] : [];
1587
+ n3 && i2.push(`${s.trimEnd()}`), i2.push(
1588
+ `${s}${styleText2("dim", "Search:")}${u4}${V}`,
1589
+ ...b3,
1590
+ ...y
1591
+ );
1592
+ const S = [
1593
+ `${styleText2("dim", "\u2191/\u2193")} to select`,
1594
+ ...t2.completeOnTab ? [`${styleText2("dim", "Tab:")} complete`] : [],
1595
+ `${styleText2("dim", "Enter:")} confirm`,
1596
+ `${styleText2("dim", "Type:")} to search`
1597
+ ], g2 = [`${s}${S.join(" \u2022 ")}`, a2], O = this.filteredOptions.length === 0 ? [] : limitOptions({
1598
+ cursor: this.cursor,
1599
+ options: this.filteredOptions,
1600
+ columnPadding: n3 ? 3 : 0,
1601
+ // for `| ` when guide is shown
1602
+ rowPadding: i2.length + g2.length,
1603
+ style: (d, f2) => $(
1604
+ d,
1605
+ d.disabled ? "disabled" : f2 ? "active" : "inactive"
1606
+ ),
1607
+ maxItems: t2.maxItems,
1608
+ output: t2.output
1609
+ });
1610
+ return [
1611
+ ...i2,
1612
+ ...O.map((d) => `${s}${d}`),
1613
+ ...g2
1614
+ ].join(`
1615
+ `);
1616
+ }
1617
+ }
1618
+ }
1619
+ }).prompt();
1620
+ var autocompleteMultiselect = (t2) => {
1621
+ const c3 = (i2, r2, o2, m3) => {
1622
+ const p3 = o2.includes(i2.value), $ = i2.label ?? String(i2.value ?? ""), l = i2.hint && m3 !== void 0 && i2.value === m3 ? styleText2("dim", ` (${i2.hint})`) : "", s = p3 ? styleText2("green", S_CHECKBOX_SELECTED) : styleText2("dim", S_CHECKBOX_INACTIVE);
1623
+ return i2.disabled ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${styleText2(["strikethrough", "gray"], $)}` : r2 ? `${s} ${$}${l}` : `${s} ${styleText2("dim", $)}`;
1624
+ }, n3 = new T$1({
1625
+ options: t2.options,
1626
+ multiple: true,
1627
+ placeholder: t2.placeholder,
1628
+ filter: t2.filter ?? ((i2, r2) => P2(i2, r2)),
1629
+ validate: () => {
1630
+ if (t2.required && n3.selectedValues.length === 0)
1631
+ return "Please select at least one item";
1632
+ },
1633
+ initialValue: t2.initialValues,
1634
+ signal: t2.signal,
1635
+ input: t2.input,
1636
+ output: t2.output,
1637
+ render() {
1638
+ const i2 = t2.withGuide ?? settings.withGuide, r2 = `${i2 ? `${styleText2("gray", S_BAR)}
1639
+ ` : ""}${symbol(this.state)} ${t2.message}
1640
+ `, o2 = this.userInput, m3 = t2.placeholder, p3 = o2 === "" && m3 !== void 0, $ = this.isNavigating || p3 ? styleText2("dim", p3 ? m3 : o2) : this.userInputWithCursor, l = this.options, s = this.filteredOptions.length !== l.length ? styleText2(
1641
+ "dim",
1642
+ ` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`
1643
+ ) : "";
1644
+ switch (this.state) {
1645
+ case "submit":
1646
+ return `${r2}${i2 ? `${styleText2("gray", S_BAR)} ` : ""}${styleText2(
1647
+ "dim",
1648
+ `${this.selectedValues.length} items selected`
1649
+ )}`;
1650
+ case "cancel":
1651
+ return `${r2}${i2 ? `${styleText2("gray", S_BAR)} ` : ""}${styleText2(
1652
+ ["strikethrough", "dim"],
1653
+ o2
1654
+ )}`;
1655
+ default: {
1656
+ const a2 = this.state === "error" ? "yellow" : "cyan", u4 = i2 ? `${styleText2(a2, S_BAR)} ` : "", V = i2 ? styleText2(a2, S_BAR_END) : "", b3 = [
1657
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1658
+ `${styleText2("dim", this.isNavigating ? "Space/Tab:" : "Tab:")} select`,
1659
+ `${styleText2("dim", "Enter:")} confirm`,
1660
+ `${styleText2("dim", "Type:")} to search`
1661
+ ], y = this.filteredOptions.length === 0 && o2 ? [`${u4}${styleText2("yellow", "No matches found")}`] : [], S = this.state === "error" ? [`${u4}${styleText2("yellow", this.error)}`] : [], g2 = [
1662
+ ...`${r2}${i2 ? styleText2(a2, S_BAR) : ""}`.split(`
1663
+ `),
1664
+ `${u4}${styleText2("dim", "Search:")} ${$}${s}`,
1665
+ ...y,
1666
+ ...S
1667
+ ], O = [`${u4}${b3.join(" \u2022 ")}`, V], d = limitOptions({
1668
+ cursor: this.cursor,
1669
+ options: this.filteredOptions,
1670
+ style: (f2, L) => c3(f2, L, this.selectedValues, this.focusedValue),
1671
+ maxItems: t2.maxItems,
1672
+ output: t2.output,
1673
+ rowPadding: g2.length + O.length
1674
+ });
1675
+ return [
1676
+ ...g2,
1677
+ ...d.map((f2) => `${u4}${f2}`),
1678
+ ...O
1679
+ ].join(`
1680
+ `);
1681
+ }
1682
+ }
1683
+ }
1684
+ });
1685
+ return n3.prompt();
1686
+ };
1687
+ var K = [
1688
+ S_CORNER_TOP_LEFT,
1689
+ S_CORNER_TOP_RIGHT,
1690
+ S_CORNER_BOTTOM_LEFT,
1691
+ S_CORNER_BOTTOM_RIGHT
1692
+ ];
1693
+ var Q = [S_BAR_START, S_BAR_START_RIGHT, S_BAR_END, S_BAR_END_RIGHT];
1694
+ function A$1(n3, e, t2, o2) {
1695
+ let i2 = t2, f2 = t2;
1696
+ return o2 === "center" ? i2 = Math.floor((e - n3) / 2) : o2 === "right" && (i2 = e - n3 - t2), f2 = e - i2 - n3, [i2, f2];
1697
+ }
1698
+ var U2 = (n3) => n3;
1699
+ var box = (n3 = "", e = "", t2) => {
1700
+ const o2 = t2?.output ?? process.stdout, i2 = getColumns(o2), R2 = 1 * 2, u4 = t2?.titlePadding ?? 1, h2 = t2?.contentPadding ?? 2, w = t2?.width === void 0 || t2.width === "auto" ? 1 : Math.min(1, t2.width), m3 = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)} ` : "", b3 = t2?.formatBorder ?? U2, a2 = (t2?.rounded ? K : Q).map(b3), _2 = b3(S_BAR_H), p3 = b3(S_BAR), x2 = dist_default2(m3), B = dist_default2(e), y = i2 - x2;
1701
+ let r2 = Math.floor(i2 * w) - x2;
1702
+ if (t2?.width === "auto") {
1703
+ const c3 = n3.split(`
1704
+ `);
1705
+ let s = B + u4 * 2;
1706
+ for (const G of c3) {
1707
+ const P3 = dist_default2(G) + h2 * 2;
1708
+ P3 > s && (s = P3);
1709
+ }
1710
+ const g2 = s + R2;
1711
+ g2 < r2 && (r2 = g2);
1712
+ }
1713
+ r2 % 2 !== 0 && (r2 < y ? r2++ : r2--);
1714
+ const d = r2 - R2, T3 = d - u4 * 2, S = B > T3 ? `${e.slice(0, T3 - 3)}...` : e, [O, W2] = A$1(
1715
+ dist_default2(S),
1716
+ d,
1717
+ u4,
1718
+ t2?.titleAlign
1719
+ ), L = wrapAnsi(n3, d - h2 * 2, {
1720
+ hard: true,
1721
+ trim: false
1722
+ });
1723
+ o2.write(
1724
+ `${m3}${a2[0]}${_2.repeat(O)}${S}${_2.repeat(W2)}${a2[1]}
1725
+ `
1726
+ );
1727
+ const E2 = L.split(`
1728
+ `);
1729
+ for (const c3 of E2) {
1730
+ const [s, g2] = A$1(
1731
+ dist_default2(c3),
1732
+ d,
1733
+ h2,
1734
+ t2?.contentAlign
1735
+ );
1736
+ o2.write(
1737
+ `${m3}${p3}${" ".repeat(s)}${c3}${" ".repeat(g2)}${p3}
1738
+ `
1739
+ );
1740
+ }
1741
+ o2.write(`${m3}${a2[2]}${_2.repeat(d)}${a2[3]}
1742
+ `);
1743
+ };
1744
+ var confirm = (e) => {
1745
+ const a2 = e.active ?? "Yes", o2 = e.inactive ?? "No";
1746
+ return new r({
1747
+ active: a2,
1748
+ inactive: o2,
1749
+ signal: e.signal,
1750
+ input: e.input,
1751
+ output: e.output,
1752
+ initialValue: e.initialValue ?? true,
1753
+ render() {
1754
+ const i2 = e.withGuide ?? settings.withGuide, u4 = `${symbol(this.state)} `, l = i2 ? `${styleText2("gray", S_BAR)} ` : "", f2 = wrapTextWithPrefix(
1755
+ e.output,
1756
+ e.message,
1757
+ l,
1758
+ u4
1759
+ ), s = `${i2 ? `${styleText2("gray", S_BAR)}
1760
+ ` : ""}${f2}
1761
+ `, c3 = this.value ? a2 : o2;
1762
+ switch (this.state) {
1763
+ case "submit": {
1764
+ const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1765
+ return `${s}${r2}${styleText2("dim", c3)}`;
1766
+ }
1767
+ case "cancel": {
1768
+ const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
1769
+ return `${s}${r2}${styleText2(["strikethrough", "dim"], c3)}${i2 ? `
1770
+ ${styleText2("gray", S_BAR)}` : ""}`;
1771
+ }
1772
+ default: {
1773
+ const r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", g2 = i2 ? styleText2("cyan", S_BAR_END) : "";
1774
+ return `${s}${r2}${this.value ? `${styleText2("green", S_RADIO_ACTIVE)} ${a2}` : `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", a2)}`}${e.vertical ? i2 ? `
1775
+ ${styleText2("cyan", S_BAR)} ` : `
1776
+ ` : ` ${styleText2("dim", "/")} `}${this.value ? `${styleText2("dim", S_RADIO_INACTIVE)} ${styleText2("dim", o2)}` : `${styleText2("green", S_RADIO_ACTIVE)} ${o2}`}
1777
+ ${g2}
1778
+ `;
1779
+ }
1780
+ }
1781
+ }
1782
+ }).prompt();
1783
+ };
1784
+ var date = (e) => {
1785
+ const r2 = e.validate;
1786
+ return new U({
1787
+ ...e,
1788
+ validate(t2) {
1789
+ if (t2 === void 0)
1790
+ return e.defaultValue !== void 0 ? void 0 : r2 ? runValidation(r2, t2) : settings.date.messages.required;
1791
+ const o2 = (i2) => i2.toISOString().slice(0, 10);
1792
+ if (e.minDate && o2(t2) < o2(e.minDate))
1793
+ return settings.date.messages.afterMin(e.minDate);
1794
+ if (e.maxDate && o2(t2) > o2(e.maxDate))
1795
+ return settings.date.messages.beforeMax(e.maxDate);
1796
+ if (r2) return runValidation(r2, t2);
1797
+ },
1798
+ render() {
1799
+ const t2 = (e?.withGuide ?? settings.withGuide) !== false, i2 = `${`${t2 ? `${styleText2("gray", S_BAR)}
1800
+ ` : ""}${symbol(this.state)} `}${e.message}
1801
+ `, l = this.state !== "initial" ? this.state : "active", d = b2(this, l), c3 = this.value instanceof Date ? this.formattedValue : "";
1802
+ switch (this.state) {
1803
+ case "error": {
1804
+ const a2 = this.error ? ` ${styleText2("yellow", this.error)}` : "", s = t2 ? `${styleText2("yellow", S_BAR)} ` : "", f2 = t2 ? styleText2("yellow", S_BAR_END) : "";
1805
+ return `${i2.trim()}
1806
+ ${s}${d}
1807
+ ${f2}${a2}
1808
+ `;
1809
+ }
1810
+ case "submit": {
1811
+ const a2 = c3 ? ` ${styleText2("dim", c3)}` : "", s = t2 ? styleText2("gray", S_BAR) : "";
1812
+ return `${i2}${s}${a2}`;
1813
+ }
1814
+ case "cancel": {
1815
+ const a2 = c3 ? ` ${styleText2(["strikethrough", "dim"], c3)}` : "", s = t2 ? styleText2("gray", S_BAR) : "";
1816
+ return `${i2}${s}${a2}${c3.trim() ? `
1817
+ ${s}` : ""}`;
1818
+ }
1819
+ default: {
1820
+ const a2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", s = t2 ? styleText2("cyan", S_BAR_END) : "", f2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", g2 = this.inlineError ? `
1821
+ ${f2}${styleText2("yellow", this.inlineError)}` : "";
1822
+ return `${i2}${a2}${d}${g2}
1823
+ ${s}
1824
+ `;
1825
+ }
1826
+ }
1827
+ }
1828
+ }).prompt();
1829
+ };
1830
+ function b2(e, r2) {
1831
+ const t2 = e.segmentValues, o2 = e.segmentCursor;
1832
+ if (r2 === "submit" || r2 === "cancel")
1833
+ return e.formattedValue;
1834
+ const i2 = styleText2("gray", e.separator);
1835
+ return e.segments.map((l, d) => {
1836
+ const c3 = d === o2.segmentIndex && !["submit", "cancel"].includes(r2), a2 = p2[l.type];
1837
+ return x(t2[l.type], { isActive: c3, label: a2 });
1838
+ }).join(i2);
1839
+ }
1840
+ function x(e, r2) {
1841
+ const t2 = !e || e.replace(/_/g, "") === "";
1842
+ return r2.isActive ? styleText2("inverse", t2 ? r2.label : e.replace(/_/g, " ")) : t2 ? styleText2("dim", r2.label) : e.replace(/_/g, styleText2("dim", " "));
1843
+ }
1844
+ var p2 = {
1845
+ year: "yyyy",
1846
+ month: "mm",
1847
+ day: "dd"
1848
+ };
1849
+ var group = async (o2, r2) => {
1850
+ const t2 = {}, p3 = Object.keys(o2);
1851
+ for (const e of p3) {
1852
+ const i2 = o2[e], n3 = await i2({ results: t2 })?.catch((a2) => {
1853
+ throw a2;
1854
+ });
1855
+ if (typeof r2?.onCancel == "function" && isCancel(n3)) {
1856
+ t2[e] = "canceled", r2.onCancel({ results: t2 });
1857
+ continue;
1858
+ }
1859
+ t2[e] = n3;
1860
+ }
1861
+ return t2;
1862
+ };
1863
+ var MULTISELECT_INSTRUCTIONS = [
1864
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
1865
+ `${styleText2("dim", "Space:")} select`,
1866
+ `${styleText2("dim", "Enter:")} confirm`
1867
+ ];
1868
+ var m2 = (n3, u4) => n3.split(`
1869
+ `).map((d) => u4(d)).join(`
1870
+ `);
1871
+ var multiselect = (n3) => {
1872
+ const u4 = (t2, a2) => {
1873
+ const r2 = t2.label ?? String(t2.value);
1874
+ return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m2(r2, (o2) => styleText2(["strikethrough", "gray"], o2))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m2(r2, (o2) => styleText2("dim", o2))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m2(r2, (o2) => styleText2(["strikethrough", "dim"], o2))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m2(r2, (o2) => styleText2("dim", o2))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m2(r2, (o2) => styleText2("dim", o2))}`;
1875
+ }, d = n3.required ?? true, x2 = n3.showInstructions ?? true;
1876
+ return new a({
1877
+ options: n3.options,
1878
+ signal: n3.signal,
1879
+ input: n3.input,
1880
+ output: n3.output,
1881
+ initialValues: n3.initialValues,
1882
+ required: d,
1883
+ cursorAt: n3.cursorAt,
1884
+ validate(t2) {
1885
+ if (d && (t2 === void 0 || t2.length === 0))
1886
+ return `Please select at least one option.
1887
+ ${styleText2(
1888
+ "reset",
1889
+ styleText2(
1890
+ "dim",
1891
+ `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2(
1892
+ "gray",
1893
+ styleText2("bgWhite", styleText2("inverse", " enter "))
1894
+ )} to submit`
1895
+ )
1896
+ )}`;
1897
+ },
1898
+ render() {
1899
+ const t2 = n3.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
1900
+ n3.output,
1901
+ n3.message,
1902
+ t2 ? `${symbolBar(this.state)} ` : "",
1903
+ `${symbol(this.state)} `
1904
+ ), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
1905
+ ` : ""}${a2}
1906
+ `, o2 = this.value ?? [], g2 = (i2, l) => {
1907
+ if (i2.disabled)
1908
+ return u4(i2, "disabled");
1909
+ const s = o2.includes(i2.value);
1910
+ return l && s ? u4(i2, "active-selected") : s ? u4(i2, "selected") : u4(i2, l ? "active" : "inactive");
1911
+ };
1912
+ switch (this.state) {
1913
+ case "submit": {
1914
+ const i2 = this.options.filter(({ value: s }) => o2.includes(s)).map((s) => u4(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l = wrapTextWithPrefix(
1915
+ n3.output,
1916
+ i2,
1917
+ t2 ? `${styleText2("gray", S_BAR)} ` : ""
1918
+ );
1919
+ return `${r2}${l}`;
1920
+ }
1921
+ case "cancel": {
1922
+ const i2 = this.options.filter(({ value: s }) => o2.includes(s)).map((s) => u4(s, "cancelled")).join(styleText2("dim", ", "));
1923
+ if (i2.trim() === "")
1924
+ return `${r2}${styleText2("gray", S_BAR)}`;
1925
+ const l = wrapTextWithPrefix(
1926
+ n3.output,
1927
+ i2,
1928
+ t2 ? `${styleText2("gray", S_BAR)} ` : ""
1929
+ );
1930
+ return `${r2}${l}${t2 ? `
1931
+ ${styleText2("gray", S_BAR)}` : ""}`;
1932
+ }
1933
+ case "error": {
1934
+ const i2 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l = this.error.split(`
1935
+ `).map(
1936
+ ($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
1937
+ ).join(`
1938
+ `), s = r2.split(`
1939
+ `).length, h2 = l.split(`
1940
+ `).length + 1;
1941
+ return `${r2}${i2}${limitOptions({
1942
+ output: n3.output,
1943
+ options: this.options,
1944
+ cursor: this.cursor,
1945
+ maxItems: n3.maxItems,
1946
+ columnPadding: i2.length,
1947
+ rowPadding: s + h2,
1948
+ style: g2
1949
+ }).join(`
1950
+ ${i2}`)}
1951
+ ${l}
1952
+ `;
1953
+ }
1954
+ default: {
1955
+ const i2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l = r2.split(`
1956
+ `).length, s = x2 ? formatInstructionFooter(n3.output, MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
1957
+ `), $ = s.length + 1;
1958
+ return `${r2}${i2}${limitOptions({
1959
+ output: n3.output,
1960
+ options: this.options,
1961
+ cursor: this.cursor,
1962
+ maxItems: n3.maxItems,
1963
+ columnPadding: i2.length,
1964
+ rowPadding: l + $,
1965
+ style: g2
1966
+ }).join(`
1967
+ ${i2}`)}
1968
+ ${h2}
1969
+ `;
1970
+ }
1971
+ }
1972
+ }
1973
+ }).prompt();
1974
+ };
1975
+ var groupMultiselect = (r2) => {
1976
+ const { selectableGroups: f2 = true, groupSpacing: x2 = 0 } = r2, d = (n3, l, p3 = []) => {
1977
+ const a2 = n3.label ?? String(n3.value), t2 = typeof n3.group == "string", u4 = t2 && (p3[p3.indexOf(n3) + 1] ?? { group: true }), s = t2 && u4 && u4.group === true;
1978
+ let o2 = "", c3 = "";
1979
+ t2 && (f2 ? (o2 = s ? `${S_BAR_END} ` : `${S_BAR} `, c3 = s ? " " : `${S_BAR} `) : o2 = " ");
1980
+ let i2 = "";
1981
+ if (x2 > 0 && !t2 && (i2 = `
1982
+ `.repeat(x2)), l === "active")
1983
+ return wrapTextWithPrefix(
1984
+ r2.output,
1985
+ `${a2}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`,
1986
+ `${i2}${styleText2("dim", o2)} `,
1987
+ `${i2}${styleText2("dim", o2)}${styleText2("cyan", S_CHECKBOX_ACTIVE)} `,
1988
+ `${i2}${styleText2("dim", c3)} `
1989
+ );
1990
+ if (l === "group-active")
1991
+ return wrapTextWithPrefix(
1992
+ r2.output,
1993
+ a2,
1994
+ `${i2}${o2} `,
1995
+ `${i2}${o2}${styleText2("cyan", S_CHECKBOX_ACTIVE)} `,
1996
+ `${i2}${c3} `,
1997
+ (m3) => styleText2("dim", m3)
1998
+ );
1999
+ if (l === "group-active-selected")
2000
+ return wrapTextWithPrefix(
2001
+ r2.output,
2002
+ a2,
2003
+ `${i2}${o2} `,
2004
+ `${i2}${o2}${styleText2("green", S_CHECKBOX_SELECTED)} `,
2005
+ `${i2}${c3} `,
2006
+ (m3) => styleText2("dim", m3)
2007
+ );
2008
+ if (l === "selected") {
2009
+ const m3 = t2 || f2 ? styleText2("green", S_CHECKBOX_SELECTED) : "";
2010
+ return wrapTextWithPrefix(
2011
+ r2.output,
2012
+ `${a2}${n3.hint ? ` (${n3.hint})` : ""}`,
2013
+ `${i2}${styleText2("dim", o2)} `,
2014
+ `${i2}${styleText2("dim", o2)}${m3} `,
2015
+ `${i2}${styleText2("dim", c3)} `,
2016
+ (I) => styleText2("dim", I)
2017
+ );
2018
+ }
2019
+ if (l === "cancelled")
2020
+ return `${styleText2(["strikethrough", "dim"], a2)}`;
2021
+ if (l === "active-selected")
2022
+ return wrapTextWithPrefix(
2023
+ r2.output,
2024
+ `${a2}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`,
2025
+ `${i2}${styleText2("dim", o2)} `,
2026
+ `${i2}${styleText2("dim", o2)}${styleText2("green", S_CHECKBOX_SELECTED)} `,
2027
+ `${i2}${styleText2("dim", c3)} `
2028
+ );
2029
+ if (l === "submitted")
2030
+ return `${styleText2("dim", a2)}`;
2031
+ const h2 = t2 || f2 ? styleText2("dim", S_CHECKBOX_INACTIVE) : "";
2032
+ return wrapTextWithPrefix(
2033
+ r2.output,
2034
+ a2,
2035
+ `${i2}${styleText2("dim", o2)} `,
2036
+ `${i2}${styleText2("dim", o2)}${h2} `,
2037
+ `${i2}${styleText2("dim", c3)} `,
2038
+ (m3) => styleText2("dim", m3)
2039
+ );
2040
+ }, y = r2.required ?? true, S = r2.showInstructions ?? true;
2041
+ return new u$1({
2042
+ options: r2.options,
2043
+ signal: r2.signal,
2044
+ input: r2.input,
2045
+ output: r2.output,
2046
+ initialValues: r2.initialValues,
2047
+ required: y,
2048
+ cursorAt: r2.cursorAt,
2049
+ selectableGroups: f2,
2050
+ validate(n3) {
2051
+ if (y && (n3 === void 0 || n3.length === 0))
2052
+ return `Please select at least one option.
2053
+ ${styleText2(
2054
+ "reset",
2055
+ styleText2(
2056
+ "dim",
2057
+ `Press ${styleText2(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText2(
2058
+ "gray",
2059
+ styleText2(["bgWhite", "inverse"], " enter ")
2060
+ )} to submit`
2061
+ )
2062
+ )}`;
2063
+ },
2064
+ render() {
2065
+ const n3 = r2.withGuide ?? settings.withGuide, l = `${n3 ? `${styleText2("gray", S_BAR)}
2066
+ ` : ""}${symbol(this.state)} ${r2.message}
2067
+ `, p3 = this.value ?? [], a2 = (t2, u4) => {
2068
+ const s = this.options, o2 = p3.includes(t2.value) || t2.group === true && this.isGroupSelected(`${t2.value}`);
2069
+ return !u4 && typeof t2.group == "string" && this.options[this.cursor]?.value === t2.group ? d(t2, o2 ? "group-active-selected" : "group-active", s) : u4 && o2 ? d(t2, "active-selected", s) : o2 ? d(t2, "selected", s) : d(t2, u4 ? "active" : "inactive", s);
2070
+ };
2071
+ switch (this.state) {
2072
+ case "submit": {
2073
+ const t2 = this.options.filter(({ value: s }) => p3.includes(s)).map((s) => d(s, "submitted")), u4 = t2.length === 0 ? "" : ` ${t2.join(styleText2("dim", ", "))}`;
2074
+ return `${l}${n3 ? styleText2("gray", S_BAR) : ""}${u4}`;
2075
+ }
2076
+ case "cancel": {
2077
+ const t2 = this.options.filter(({ value: u4 }) => p3.includes(u4)).map((u4) => d(u4, "cancelled")).join(styleText2("dim", ", "));
2078
+ return `${l}${n3 ? `${styleText2("gray", S_BAR)} ` : ""}${t2.trim() ? `${t2}${n3 ? `
2079
+ ${styleText2("gray", S_BAR)}` : ""}` : ""}`;
2080
+ }
2081
+ case "error": {
2082
+ const t2 = n3 ? `${styleText2("yellow", S_BAR)} ` : "", u4 = this.error.split(`
2083
+ `).map(
2084
+ (i2, h2) => h2 === 0 ? `${n3 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", i2)}` : ` ${i2}`
2085
+ ).join(`
2086
+ `), s = l.split(`
2087
+ `).length, o2 = u4.split(`
2088
+ `).length + 1, c3 = limitOptions({
2089
+ output: r2.output,
2090
+ options: this.options,
2091
+ cursor: this.cursor,
2092
+ maxItems: r2.maxItems,
2093
+ columnPadding: t2.length,
2094
+ rowPadding: s + o2,
2095
+ style: a2
2096
+ }).join(`
2097
+ ${t2}`);
2098
+ return `${l}${t2}${c3}
2099
+ ${u4}
2100
+ `;
2101
+ }
2102
+ default: {
2103
+ const t2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", u4 = l.split(`
2104
+ `).length, s = S ? formatInstructionFooter(r2.output, MULTISELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], o2 = s.join(`
2105
+ `), c3 = s.length + 1, i2 = limitOptions({
2106
+ output: r2.output,
2107
+ options: this.options,
2108
+ cursor: this.cursor,
2109
+ maxItems: r2.maxItems,
2110
+ columnPadding: t2.length,
2111
+ rowPadding: u4 + c3,
2112
+ style: a2
2113
+ }).join(`
2114
+ ${t2}`);
2115
+ return `${l}${t2}${i2}
2116
+ ${o2}
2117
+ `;
2118
+ }
2119
+ }
2120
+ }
2121
+ }).prompt();
2122
+ };
2123
+ var log = {
2124
+ message: (s = [], {
2125
+ symbol: e = styleText2("gray", S_BAR),
2126
+ secondarySymbol: r2 = styleText2("gray", S_BAR),
2127
+ output: m3 = process.stdout,
2128
+ spacing: l = 1,
2129
+ withGuide: c3
2130
+ } = {}) => {
2131
+ const t2 = [], o2 = c3 ?? settings.withGuide, f2 = o2 ? r2 : "", O = o2 ? `${e} ` : "", u4 = o2 ? `${r2} ` : "";
2132
+ for (let i2 = 0; i2 < l; i2++)
2133
+ t2.push(f2);
2134
+ const g2 = Array.isArray(s) ? s : s.split(`
2135
+ `);
2136
+ if (g2.length > 0) {
2137
+ const [i2, ...y] = g2;
2138
+ i2.length > 0 ? t2.push(`${O}${i2}`) : t2.push(o2 ? e : "");
2139
+ for (const p3 of y)
2140
+ p3.length > 0 ? t2.push(`${u4}${p3}`) : t2.push(o2 ? r2 : "");
2141
+ }
2142
+ m3.write(`${t2.join(`
2143
+ `)}
2144
+ `);
2145
+ },
2146
+ info: (s, e) => {
2147
+ log.message(s, { ...e, symbol: styleText2("blue", S_INFO) });
2148
+ },
2149
+ success: (s, e) => {
2150
+ log.message(s, { ...e, symbol: styleText2("green", S_SUCCESS) });
2151
+ },
2152
+ step: (s, e) => {
2153
+ log.message(s, { ...e, symbol: styleText2("green", S_STEP_SUBMIT) });
2154
+ },
2155
+ warn: (s, e) => {
2156
+ log.message(s, { ...e, symbol: styleText2("yellow", S_WARN) });
2157
+ },
2158
+ /** alias for `log.warn()`. */
2159
+ warning: (s, e) => {
2160
+ log.warn(s, e);
2161
+ },
2162
+ error: (s, e) => {
2163
+ log.message(s, { ...e, symbol: styleText2("red", S_ERROR) });
2164
+ }
2165
+ };
2166
+ var cancel = (o2 = "", t2) => {
2167
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_END)} ` : "";
2168
+ i2.write(`${e}${styleText2("red", o2)}
2169
+
2170
+ `);
2171
+ };
2172
+ var intro = (o2 = "", t2) => {
2173
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR_START)} ` : "";
2174
+ i2.write(`${e}${o2}
2175
+ `);
2176
+ };
2177
+ var outro = (o2 = "", t2) => {
2178
+ const i2 = t2?.output ?? process.stdout, e = t2?.withGuide ?? settings.withGuide ? `${styleText2("gray", S_BAR)}
2179
+ ${styleText2("gray", S_BAR_END)} ` : "";
2180
+ i2.write(`${e}${o2}
2181
+
2182
+ `);
2183
+ };
2184
+ var multiline = (e) => new h({
2185
+ validate: e.validate,
2186
+ placeholder: e.placeholder,
2187
+ defaultValue: e.defaultValue,
2188
+ initialValue: e.initialValue,
2189
+ showSubmit: e.showSubmit,
2190
+ output: e.output,
2191
+ signal: e.signal,
2192
+ input: e.input,
2193
+ render() {
2194
+ const i2 = e?.withGuide ?? settings.withGuide, o2 = `${`${i2 ? `${styleText2("gray", S_BAR)}
2195
+ ` : ""}${symbol(this.state)} `}${e.message}
2196
+ `, h2 = e.placeholder && e.placeholder.length > 0 ? (
2197
+ // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
2198
+ styleText2("inverse", e.placeholder[0]) + styleText2("dim", e.placeholder.slice(1))
2199
+ ) : styleText2(["inverse", "hidden"], "_"), a2 = this.userInput ? this.userInputWithCursor : h2, l = this.value ?? "", d = e.showSubmit ? `
2200
+ ${styleText2(this.focused === "submit" ? "cyan" : "dim", "[ submit ]")}` : "";
2201
+ switch (this.state) {
2202
+ case "error": {
2203
+ const n3 = `${styleText2("yellow", S_BAR)} `, r2 = i2 ? wrapTextWithPrefix(e.output, a2, n3, void 0) : a2, u4 = styleText2("yellow", S_BAR_END);
2204
+ return `${o2}${r2}
2205
+ ${u4} ${styleText2("yellow", this.error)}${d}
2206
+ `;
2207
+ }
2208
+ case "submit": {
2209
+ const n3 = `${styleText2("gray", S_BAR)} `, r2 = i2 ? wrapTextWithPrefix(
2210
+ e.output,
2211
+ l,
2212
+ n3,
2213
+ void 0,
2214
+ void 0,
2215
+ (u4) => styleText2("dim", u4)
2216
+ ) : l ? styleText2("dim", l) : "";
2217
+ return `${o2}${r2}`;
2218
+ }
2219
+ case "cancel": {
2220
+ const n3 = `${styleText2("gray", S_BAR)} `, r2 = i2 ? wrapTextWithPrefix(
2221
+ e.output,
2222
+ l,
2223
+ n3,
2224
+ void 0,
2225
+ void 0,
2226
+ (u4) => styleText2(["strikethrough", "dim"], u4)
2227
+ ) : l ? styleText2(["strikethrough", "dim"], l) : "";
2228
+ return `${o2}${r2}`;
2229
+ }
2230
+ default: {
2231
+ const n3 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", r2 = i2 ? styleText2("cyan", S_BAR_END) : "", u4 = i2 ? wrapTextWithPrefix(e.output, a2, n3) : a2;
2232
+ return `${o2}${u4}
2233
+ ${r2}${d}
2234
+ `;
2235
+ }
2236
+ }
2237
+ }
2238
+ }).prompt();
2239
+ var W = (o2) => o2;
2240
+ var C3 = (o2, e, s) => {
2241
+ const a2 = {
2242
+ hard: true,
2243
+ trim: false
2244
+ }, i2 = wrapAnsi(o2, e, a2).split(`
2245
+ `), c3 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u4 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g2 = e - (u4 - c3);
2246
+ return wrapAnsi(o2, g2, a2);
2247
+ };
2248
+ var note = (o2 = "", e = "", s) => {
2249
+ const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c3 = s?.format ?? W, g2 = ["", ...C3(o2, getColumns(a2) - 6, c3).split(`
2250
+ `).map(c3), ""], n3 = dist_default2(e), t2 = Math.max(
2251
+ g2.reduce((m3, F) => {
2252
+ const O = dist_default2(F);
2253
+ return O > m3 ? O : m3;
2254
+ }, 0),
2255
+ n3
2256
+ ) + 2, h2 = g2.map(
2257
+ (m3) => `${styleText2("gray", S_BAR)} ${m3}${" ".repeat(t2 - dist_default2(m3))}${styleText2("gray", S_BAR)}`
2258
+ ).join(`
2259
+ `), T3 = i2 ? `${styleText2("gray", S_BAR)}
2260
+ ` : "", l$1 = i2 ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
2261
+ a2.write(
2262
+ `${T3}${styleText2("green", S_STEP_SUBMIT)} ${styleText2("reset", e)} ${styleText2(
2263
+ "gray",
2264
+ S_BAR_H.repeat(Math.max(t2 - n3 - 1, 1)) + S_CORNER_TOP_RIGHT
2265
+ )}
2266
+ ${h2}
2267
+ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
2268
+ `
2269
+ );
2270
+ };
2271
+ var password = (e) => new u2({
2272
+ validate: e.validate,
2273
+ mask: e.mask ?? S_PASSWORD_MASK,
2274
+ signal: e.signal,
2275
+ input: e.input,
2276
+ output: e.output,
2277
+ render() {
2278
+ const r2 = e.withGuide ?? settings.withGuide, o2 = `${r2 ? `${styleText2("gray", S_BAR)}
2279
+ ` : ""}${symbol(this.state)} ${e.message}
2280
+ `, m3 = this.userInputWithCursor, i2 = this.masked;
2281
+ switch (this.state) {
2282
+ case "error": {
2283
+ const s = r2 ? `${styleText2("yellow", S_BAR)} ` : "", n3 = r2 ? `${styleText2("yellow", S_BAR_END)} ` : "", d = i2 ?? "";
2284
+ return e.clearOnError && this.clear(), `${o2.trim()}
2285
+ ${s}${d}
2286
+ ${n3}${styleText2("yellow", this.error)}
2287
+ `;
2288
+ }
2289
+ case "submit": {
2290
+ const s = r2 ? `${styleText2("gray", S_BAR)} ` : "", n3 = i2 ? styleText2("dim", i2) : "";
2291
+ return `${o2}${s}${n3}`;
2292
+ }
2293
+ case "cancel": {
2294
+ const s = r2 ? `${styleText2("gray", S_BAR)} ` : "", n3 = i2 ? styleText2(["strikethrough", "dim"], i2) : "";
2295
+ return `${o2}${s}${n3}${i2 && r2 ? `
2296
+ ${styleText2("gray", S_BAR)}` : ""}`;
2297
+ }
2298
+ default: {
2299
+ const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n3 = r2 ? styleText2("cyan", S_BAR_END) : "";
2300
+ return `${o2}${s}${m3}
2301
+ ${n3}
2302
+ `;
2303
+ }
2304
+ }
2305
+ }
2306
+ }).prompt();
2307
+ var path = (e) => {
2308
+ const a2 = e.validate;
2309
+ return autocomplete({
2310
+ ...e,
2311
+ initialUserInput: e.initialValue ?? e.root ?? process.cwd(),
2312
+ maxItems: 5,
2313
+ completeOnTab: true,
2314
+ validate(t2) {
2315
+ if (!Array.isArray(t2)) {
2316
+ if (!t2)
2317
+ return "Please select a path";
2318
+ if (a2)
2319
+ return runValidation(a2, t2);
2320
+ }
2321
+ },
2322
+ options() {
2323
+ const t2 = this.userInput;
2324
+ if (t2 === "")
2325
+ return [];
2326
+ try {
2327
+ let i2;
2328
+ const o2 = t2.endsWith("/") || t2.endsWith("\\");
2329
+ existsSync(t2) ? lstatSync(t2).isDirectory() && (!e.directory || o2) ? i2 = t2 : i2 = dirname(t2) : i2 = dirname(t2);
2330
+ const m3 = t2.length > 1 && o2 ? t2.slice(0, -1) : t2;
2331
+ return readdirSync(i2).map((r2) => {
2332
+ const n3 = join(i2, r2), l = lstatSync(n3);
2333
+ return {
2334
+ name: r2,
2335
+ path: n3,
2336
+ isDirectory: l.isDirectory()
2337
+ };
2338
+ }).filter(
2339
+ ({ path: r2, isDirectory: n3 }) => r2.startsWith(m3) && (n3 || !e.directory)
2340
+ ).map((r2) => ({
2341
+ value: r2.path
2342
+ }));
2343
+ } catch {
2344
+ return [];
2345
+ }
2346
+ }
2347
+ });
2348
+ };
2349
+ var Y = 3e4;
2350
+ var Z = (c3) => styleText2("magenta", c3);
2351
+ var spinner = ({
2352
+ indicator: c3 = "dots",
2353
+ onCancel: b3,
2354
+ output: n3 = process.stdout,
2355
+ cancelMessage: _2,
2356
+ errorMessage: C4,
2357
+ frames: M2 = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
2358
+ delay: O = unicode ? 80 : 120,
2359
+ signal: g2,
2360
+ ...E2
2361
+ } = {}) => {
2362
+ const u4 = isCI(), h2 = isAccessible(E2.accessible);
2363
+ let x2, I, p3 = false, l = false, r2 = "", v, w = performance.now();
2364
+ const y = getColumns(n3), F = E2?.styleFrame ?? Z, S = (e) => {
2365
+ const s = e > 1 ? C4 ?? settings.messages.error : _2 ?? settings.messages.cancel;
2366
+ l = e === 1, p3 && (m3(s, e), l && typeof b3 == "function" && b3());
2367
+ }, $ = () => S(2), a2 = () => S(1), H = () => {
2368
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g2 && g2.addEventListener("abort", a2);
2369
+ }, B = () => {
2370
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g2 && g2.removeEventListener("abort", a2);
2371
+ }, R2 = () => {
2372
+ if (v === void 0) return;
2373
+ u4 && n3.write(`
2374
+ `);
2375
+ const s = wrapAnsi(v, y, {
2376
+ hard: true,
2377
+ trim: false
2378
+ }).split(`
2379
+ `);
2380
+ s.length > 1 && n3.write(cursor.up(s.length - 1)), n3.write(cursor.to(0)), n3.write(erase.down());
2381
+ }, L = (e) => e.replace(/\.+$/, ""), T3 = (e) => {
2382
+ const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
2383
+ return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
2384
+ }, N = E2.withGuide ?? settings.withGuide, P3 = (e = "") => {
2385
+ if (p3 = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
2386
+ r2 !== "" && n3.write(`${r2}
2387
+ `), I = setInterval(() => {
2388
+ n3.write(r2 === "" ? `still working
2389
+ ` : `still working: ${r2}
2390
+ `);
2391
+ }, Y);
2392
+ return;
2393
+ }
2394
+ x2 = block({ output: n3 }), N && n3.write(`${styleText2("gray", S_BAR)}
2395
+ `);
2396
+ let s = 0, i2 = 0;
2397
+ I = setInterval(() => {
2398
+ if (u4 && r2 === v)
2399
+ return;
2400
+ R2(), v = r2;
2401
+ const t2 = F(M2[s]);
2402
+ let o2;
2403
+ if (u4)
2404
+ o2 = `${t2} ${r2}...`;
2405
+ else if (c3 === "timer")
2406
+ o2 = `${t2} ${r2} ${T3(w)}`;
2407
+ else {
2408
+ const j2 = ".".repeat(Math.floor(i2)).slice(0, 3);
2409
+ o2 = `${t2} ${r2}${j2}`;
2410
+ }
2411
+ const D = wrapAnsi(o2, y, {
2412
+ hard: true,
2413
+ trim: false
2414
+ });
2415
+ n3.write(D), s = s + 1 < M2.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
2416
+ }, O);
2417
+ }, m3 = (e = "", s = 0, i2 = false) => {
2418
+ if (p3) {
2419
+ if (p3 = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
2420
+ if (h2) {
2421
+ const t2 = s === 1 ? _2 ?? settings.messages.cancel : s === 2 ? C4 ?? settings.messages.error : "Done", o2 = r2 || t2;
2422
+ c3 === "timer" ? n3.write(`${o2} ${T3(w)}
2423
+ `) : n3.write(`${o2}
2424
+ `);
2425
+ } else {
2426
+ const t2 = s === 0 ? styleText2("green", S_STEP_SUBMIT) : s === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
2427
+ c3 === "timer" ? n3.write(`${t2} ${r2} ${T3(w)}
2428
+ `) : n3.write(`${t2} ${r2}
2429
+ `);
2430
+ }
2431
+ B(), x2?.();
2432
+ }
2433
+ };
2434
+ return {
2435
+ start: P3,
2436
+ stop: (e = "") => m3(e, 0),
2437
+ message: (e = "") => {
2438
+ r2 = L(e ?? r2);
2439
+ },
2440
+ cancel: (e = "") => m3(e, 1),
2441
+ error: (e = "") => m3(e, 2),
2442
+ clear: () => m3("", 0, true),
2443
+ get isCancelled() {
2444
+ return l;
2445
+ }
2446
+ };
2447
+ };
2448
+ var u3 = {
2449
+ light: unicodeOr("\u2500", "-"),
2450
+ heavy: unicodeOr("\u2501", "="),
2451
+ block: unicodeOr("\u2588", "#")
2452
+ };
2453
+ function progress({
2454
+ style: o2 = "heavy",
2455
+ max: d = 100,
2456
+ size: v = 40,
2457
+ ...x2
2458
+ } = {}) {
2459
+ const r2 = spinner(x2);
2460
+ let a2 = 0, n3 = "";
2461
+ const c3 = Math.max(1, d), l = Math.max(1, v), S = (t2) => {
2462
+ switch (t2) {
2463
+ case "initial":
2464
+ case "active":
2465
+ return (e) => styleText2("magenta", e);
2466
+ case "error":
2467
+ case "cancel":
2468
+ return (e) => styleText2("red", e);
2469
+ case "submit":
2470
+ return (e) => styleText2("green", e);
2471
+ default:
2472
+ return (e) => styleText2("magenta", e);
2473
+ }
2474
+ }, p3 = (t2, e) => {
2475
+ const m3 = Math.floor(a2 / c3 * l);
2476
+ return `${S(t2)(u3[o2].repeat(m3))}${styleText2("dim", u3[o2].repeat(l - m3))} ${e}`;
2477
+ }, h2 = (t2 = "") => {
2478
+ n3 = t2, r2.start(p3("initial", t2));
2479
+ }, g2 = (t2 = 1, e) => {
2480
+ a2 = Math.min(c3, t2 + a2), r2.message(p3("active", e ?? n3)), n3 = e ?? n3;
2481
+ };
2482
+ return {
2483
+ start: h2,
2484
+ stop: r2.stop,
2485
+ cancel: r2.cancel,
2486
+ error: r2.error,
2487
+ clear: r2.clear,
2488
+ advance: g2,
2489
+ get isCancelled() {
2490
+ return r2.isCancelled;
2491
+ },
2492
+ message: (t2) => g2(0, t2)
2493
+ };
2494
+ }
2495
+ var SELECT_INSTRUCTIONS = [
2496
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
2497
+ `${styleText2("dim", "Enter:")} confirm`
2498
+ ];
2499
+ var c2 = (t2, o2) => t2.includes(`
2500
+ `) ? t2.split(`
2501
+ `).map((d) => o2(d)).join(`
2502
+ `) : o2(t2);
2503
+ var select = (t2) => {
2504
+ const o2 = (n3, m3) => {
2505
+ if (n3 === void 0)
2506
+ return "";
2507
+ const s = n3.label ?? String(n3.value);
2508
+ switch (m3) {
2509
+ case "disabled":
2510
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
2511
+ case "selected":
2512
+ return `${c2(s, (i2) => styleText2("dim", i2))}`;
2513
+ case "active":
2514
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
2515
+ case "cancelled":
2516
+ return `${c2(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
2517
+ default:
2518
+ return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("dim", i2))}`;
2519
+ }
2520
+ }, d = t2.showInstructions ?? true;
2521
+ return new n$1({
2522
+ options: t2.options,
2523
+ signal: t2.signal,
2524
+ input: t2.input,
2525
+ output: t2.output,
2526
+ initialValue: t2.initialValue,
2527
+ render() {
2528
+ const n3 = t2.withGuide ?? settings.withGuide, m3 = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, i2 = wrapTextWithPrefix(
2529
+ t2.output,
2530
+ t2.message,
2531
+ s,
2532
+ m3
2533
+ ), u4 = `${n3 ? `${styleText2("gray", S_BAR)}
2534
+ ` : ""}${i2}
2535
+ `;
2536
+ switch (this.state) {
2537
+ case "submit": {
2538
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
2539
+ t2.output,
2540
+ o2(this.options[this.cursor], "selected"),
2541
+ r2
2542
+ );
2543
+ return `${u4}${a2}`;
2544
+ }
2545
+ case "cancel": {
2546
+ const r2 = n3 ? `${styleText2("gray", S_BAR)} ` : "", a2 = wrapTextWithPrefix(
2547
+ t2.output,
2548
+ o2(this.options[this.cursor], "cancelled"),
2549
+ r2
2550
+ );
2551
+ return `${u4}${a2}${n3 ? `
2552
+ ${styleText2("gray", S_BAR)}` : ""}`;
2553
+ }
2554
+ default: {
2555
+ const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u4.split(`
2556
+ `).length, p3 = d ? formatInstructionFooter(t2.output, SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f2 = p3.join(`
2557
+ `), b3 = p3.length + 1;
2558
+ return `${u4}${r2}${limitOptions({
2559
+ output: t2.output,
2560
+ cursor: this.cursor,
2561
+ options: this.options,
2562
+ maxItems: t2.maxItems,
2563
+ columnPadding: r2.length,
2564
+ rowPadding: a2 + b3,
2565
+ style: (g2, x2) => o2(g2, g2.disabled ? "disabled" : x2 ? "active" : "inactive")
2566
+ }).join(`
2567
+ ${r2}`)}
2568
+ ${f2}
2569
+ `;
2570
+ }
2571
+ }
2572
+ }
2573
+ }).prompt();
2574
+ };
2575
+ var selectKey = (i2) => {
2576
+ const c3 = (e, a2 = "inactive") => {
2577
+ if (e === void 0)
2578
+ return "";
2579
+ const n3 = e.label ?? String(e.value);
2580
+ return a2 === "disabled" ? `${styleText2("dim", ` ${e.value} `)} ${styleText2("gray", n3)}${e.hint ? ` ${styleText2("dim", `(${e.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("dim", n3)}` : a2 === "cancelled" ? `${styleText2(["strikethrough", "dim"], n3)}` : a2 === "active" ? `${styleText2(["bgCyan", "gray"], ` ${e.value} `)} ${n3}${e.hint ? ` ${styleText2("dim", `(${e.hint})`)}` : ""}` : `${styleText2(["gray", "bgWhite", "inverse"], ` ${e.value} `)} ${n3}${e.hint ? ` ${styleText2("dim", `(${e.hint})`)}` : ""}`;
2581
+ };
2582
+ return new c({
2583
+ options: i2.options,
2584
+ signal: i2.signal,
2585
+ input: i2.input,
2586
+ output: i2.output,
2587
+ initialValue: i2.initialValue,
2588
+ caseSensitive: i2.caseSensitive,
2589
+ render() {
2590
+ const e = i2.withGuide ?? settings.withGuide, a2 = `${e ? `${styleText2("gray", S_BAR)}
2591
+ ` : ""}${symbol(this.state)} ${i2.message}
2592
+ `;
2593
+ switch (this.state) {
2594
+ case "submit": {
2595
+ const n3 = e ? `${styleText2("gray", S_BAR)} ` : "", r2 = this.options.find((l) => l.value === this.value) ?? i2.options[0], u4 = wrapTextWithPrefix(
2596
+ i2.output,
2597
+ c3(r2, "selected"),
2598
+ n3
2599
+ );
2600
+ return `${a2}${u4}`;
2601
+ }
2602
+ case "cancel": {
2603
+ const n3 = e ? `${styleText2("gray", S_BAR)} ` : "", r2 = wrapTextWithPrefix(
2604
+ i2.output,
2605
+ c3(this.options[0], "cancelled"),
2606
+ n3
2607
+ );
2608
+ return `${a2}${r2}${e ? `
2609
+ ${styleText2("gray", S_BAR)}` : ""}`;
2610
+ }
2611
+ default: {
2612
+ const n3 = e ? `${styleText2("cyan", S_BAR)} ` : "", r2 = e ? styleText2("cyan", S_BAR_END) : "", u4 = this.options.map(
2613
+ (l, $) => wrapTextWithPrefix(
2614
+ i2.output,
2615
+ c3(
2616
+ l,
2617
+ l.disabled ? "disabled" : $ === this.cursor ? "active" : "inactive"
2618
+ ),
2619
+ n3
2620
+ )
2621
+ ).join(`
2622
+ `);
2623
+ return `${a2}${u4}
2624
+ ${r2}
2625
+ `;
2626
+ }
2627
+ }
2628
+ }
2629
+ }).prompt();
2630
+ };
2631
+ var i = `${styleText2("gray", S_BAR)} `;
2632
+ var stream = {
2633
+ message: async (e, { symbol: l = styleText2("gray", S_BAR) } = {}) => {
2634
+ process.stdout.write(`${styleText2("gray", S_BAR)}
2635
+ ${l} `);
2636
+ let s = 3;
2637
+ for await (let r2 of e) {
2638
+ r2 = r2.replace(/\n/g, `
2639
+ ${i}`), r2.includes(`
2640
+ `) && (s = 3 + stripVTControlCharacters(r2.slice(r2.lastIndexOf(`
2641
+ `))).length);
2642
+ const o2 = stripVTControlCharacters(r2).length;
2643
+ s + o2 < process.stdout.columns ? (s += o2, process.stdout.write(r2)) : (process.stdout.write(`
2644
+ ${i}${r2.trimStart()}`), s = 3 + stripVTControlCharacters(r2.trimStart()).length);
2645
+ }
2646
+ process.stdout.write(`
2647
+ `);
2648
+ },
2649
+ info: (e) => stream.message(e, { symbol: styleText2("blue", S_INFO) }),
2650
+ success: (e) => stream.message(e, { symbol: styleText2("green", S_SUCCESS) }),
2651
+ step: (e) => stream.message(e, { symbol: styleText2("green", S_STEP_SUBMIT) }),
2652
+ warn: (e) => stream.message(e, { symbol: styleText2("yellow", S_WARN) }),
2653
+ /** alias for `log.warn()`. */
2654
+ warning: (e) => stream.warn(e),
2655
+ error: (e) => stream.message(e, { symbol: styleText2("red", S_ERROR) })
2656
+ };
2657
+ var tasks = async (o2, e) => {
2658
+ for (const t2 of o2) {
2659
+ if (t2.enabled === false) continue;
2660
+ const s = spinner(e);
2661
+ s.start(t2.title);
2662
+ const n3 = await t2.task(s.message);
2663
+ s.stop(n3 || t2.title);
2664
+ }
2665
+ };
2666
+ var A = (l) => l.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "");
2667
+ var taskLog = (l) => {
2668
+ const r2 = l.output ?? process.stdout, O = getColumns(r2), i2 = styleText2("gray", S_BAR), p3 = l.spacing ?? 1, k = 3, m3 = l.retainLog === true, d = !isCI() && isTTY(r2);
2669
+ r2.write(`${i2}
2670
+ `), r2.write(`${styleText2("green", S_STEP_SUBMIT)} ${l.title}
2671
+ `);
2672
+ for (let e = 0; e < p3; e++)
2673
+ r2.write(`${i2}
2674
+ `);
2675
+ const n3 = [
2676
+ {
2677
+ value: "",
2678
+ full: ""
2679
+ }
2680
+ ];
2681
+ let v = false;
2682
+ const f2 = (e) => {
2683
+ if (n3.length === 0)
2684
+ return;
2685
+ let s = 0;
2686
+ e && (s += p3 + 2);
2687
+ for (const t2 of n3) {
2688
+ const { value: o2, result: a2 } = t2;
2689
+ let g2 = a2?.message ?? o2;
2690
+ if (g2.length === 0)
2691
+ continue;
2692
+ a2 === void 0 && t2.header !== void 0 && t2.header !== "" && (g2 += `
2693
+ ${t2.header}`);
2694
+ const E2 = g2.split(`
2695
+ `).reduce((b3, w) => w === "" ? b3 + 1 : b3 + Math.ceil((w.length + k) / O), 0);
2696
+ s += E2;
2697
+ }
2698
+ s > 0 && (s += 1, r2.write(erase.lines(s)));
2699
+ }, h2 = (e, s, t2) => {
2700
+ const o2 = t2 ? `${e.full}
2701
+ ${e.value}` : e.value;
2702
+ e.header !== void 0 && e.header !== "" && log.message(
2703
+ e.header.split(`
2704
+ `).map((a2) => styleText2("bold", a2)),
2705
+ {
2706
+ output: r2,
2707
+ secondarySymbol: i2,
2708
+ symbol: i2,
2709
+ spacing: 0
2710
+ }
2711
+ ), log.message(
2712
+ o2.split(`
2713
+ `).map((a2) => styleText2("dim", a2)),
2714
+ {
2715
+ output: r2,
2716
+ secondarySymbol: i2,
2717
+ symbol: i2,
2718
+ spacing: s ?? p3
2719
+ }
2720
+ );
2721
+ }, T3 = () => {
2722
+ for (const e of n3) {
2723
+ const { header: s, value: t2, full: o2 } = e;
2724
+ (s === void 0 || s.length === 0) && t2.length === 0 || h2(e, void 0, m3 === true && o2.length > 0);
2725
+ }
2726
+ }, L = (e, s, t2) => {
2727
+ if (f2(false), (t2?.raw !== true || !v) && e.value !== "" && (e.value += `
2728
+ `), e.value += A(s), v = t2?.raw === true, l.limit !== void 0) {
2729
+ const o2 = e.value.split(`
2730
+ `), a2 = o2.length - l.limit;
2731
+ if (a2 > 0) {
2732
+ const g2 = o2.splice(0, a2);
2733
+ m3 && (e.full += (e.full === "" ? "" : `
2734
+ `) + g2.join(`
2735
+ `));
2736
+ }
2737
+ e.value = o2.join(`
2738
+ `);
2739
+ }
2740
+ d && y();
2741
+ }, y = () => {
2742
+ for (const e of n3)
2743
+ e.result ? e.result.status === "error" ? log.error(e.result.message, { output: r2, secondarySymbol: i2, spacing: 0 }) : log.success(e.result.message, { output: r2, secondarySymbol: i2, spacing: 0 }) : e.value !== "" && h2(e, 0);
2744
+ }, B = (e, s) => {
2745
+ f2(false), e.result = s, d && y();
2746
+ };
2747
+ return {
2748
+ message(e, s) {
2749
+ L(n3[0], e, s);
2750
+ },
2751
+ group(e) {
2752
+ const s = {
2753
+ header: e,
2754
+ value: "",
2755
+ full: ""
2756
+ };
2757
+ return n3.push(s), {
2758
+ message(t2, o2) {
2759
+ L(s, t2, o2);
2760
+ },
2761
+ error(t2) {
2762
+ B(s, {
2763
+ status: "error",
2764
+ message: t2
2765
+ });
2766
+ },
2767
+ success(t2) {
2768
+ B(s, {
2769
+ status: "success",
2770
+ message: t2
2771
+ });
2772
+ }
2773
+ };
2774
+ },
2775
+ error(e, s) {
2776
+ f2(true), log.error(e, { output: r2, secondarySymbol: i2, spacing: 1 }), s?.showLog !== false && T3(), n3.splice(1, n3.length - 1), n3[0].value = "", n3[0].full = "";
2777
+ },
2778
+ success(e, s) {
2779
+ f2(true), log.success(e, { output: r2, secondarySymbol: i2, spacing: 1 }), s?.showLog === true && T3(), n3.splice(1, n3.length - 1), n3[0].value = "", n3[0].full = "";
2780
+ }
2781
+ };
2782
+ };
2783
+ var text = (t2) => new n2({
2784
+ validate: t2.validate,
2785
+ placeholder: t2.placeholder,
2786
+ defaultValue: t2.defaultValue,
2787
+ initialValue: t2.initialValue,
2788
+ output: t2.output,
2789
+ signal: t2.signal,
2790
+ input: t2.input,
2791
+ render() {
2792
+ const r2 = t2?.withGuide ?? settings.withGuide, l = `${`${r2 ? `${styleText2("gray", S_BAR)}
2793
+ ` : ""}${symbol(this.state)} `}${t2.message}
2794
+ `, d = t2.placeholder && t2.placeholder.length > 0 ? (
2795
+ // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
2796
+ styleText2("inverse", t2.placeholder[0]) + styleText2("dim", t2.placeholder.slice(1))
2797
+ ) : styleText2(["inverse", "hidden"], "_"), o2 = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
2798
+ switch (this.state) {
2799
+ case "validating": {
2800
+ const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "", c3 = styleText2("dim", o2), $ = styleText2("dim", "Validating...");
2801
+ return `${l}${n3}${c3}
2802
+ ${i2} ${$}
2803
+ `;
2804
+ }
2805
+ case "error": {
2806
+ const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "", c3 = r2 ? styleText2("yellow", S_BAR_END) : "";
2807
+ return `${l.trim()}
2808
+ ${i2}${o2}
2809
+ ${c3}${n3}
2810
+ `;
2811
+ }
2812
+ case "submit": {
2813
+ const n3 = s ? `${r2 ? " " : ""}${styleText2("dim", s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
2814
+ return `${l}${i2}${n3}`;
2815
+ }
2816
+ case "cancel": {
2817
+ const n3 = s ? ` ${styleText2(["strikethrough", "dim"], s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
2818
+ return `${l}${i2}${n3}${s.trim() ? `
2819
+ ${i2}` : ""}`;
2820
+ }
2821
+ default: {
2822
+ const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "";
2823
+ return `${l}${n3}${o2}
2824
+ ${i2}
2825
+ `;
2826
+ }
2827
+ }
2828
+ }
2829
+ }).prompt();
2830
+ export {
2831
+ CANCEL_SYMBOL,
2832
+ MULTISELECT_INSTRUCTIONS,
2833
+ SELECT_INSTRUCTIONS,
2834
+ S_BAR,
2835
+ S_BAR_END,
2836
+ S_BAR_END_RIGHT,
2837
+ S_BAR_H,
2838
+ S_BAR_START,
2839
+ S_BAR_START_RIGHT,
2840
+ S_CHECKBOX_ACTIVE,
2841
+ S_CHECKBOX_INACTIVE,
2842
+ S_CHECKBOX_SELECTED,
2843
+ S_CONNECT_LEFT,
2844
+ S_CORNER_BOTTOM_LEFT,
2845
+ S_CORNER_BOTTOM_RIGHT,
2846
+ S_CORNER_TOP_LEFT,
2847
+ S_CORNER_TOP_RIGHT,
2848
+ S_ERROR,
2849
+ S_INFO,
2850
+ S_PASSWORD_MASK,
2851
+ S_RADIO_ACTIVE,
2852
+ S_RADIO_INACTIVE,
2853
+ S_STEP_ACTIVE,
2854
+ S_STEP_CANCEL,
2855
+ S_STEP_ERROR,
2856
+ S_STEP_SUBMIT,
2857
+ S_SUCCESS,
2858
+ S_WARN,
2859
+ autocomplete,
2860
+ autocompleteMultiselect,
2861
+ box,
2862
+ cancel,
2863
+ confirm,
2864
+ date,
2865
+ formatInstructionFooter,
2866
+ group,
2867
+ groupMultiselect,
2868
+ intro,
2869
+ isCI,
2870
+ isCancel,
2871
+ isTTY,
2872
+ limitOptions,
2873
+ log,
2874
+ multiline,
2875
+ multiselect,
2876
+ note,
2877
+ outro,
2878
+ password,
2879
+ path,
2880
+ progress,
2881
+ select,
2882
+ selectKey,
2883
+ settings,
2884
+ spinner,
2885
+ stream,
2886
+ symbol,
2887
+ symbolBar,
2888
+ taskLog,
2889
+ tasks,
2890
+ text,
2891
+ unicode,
2892
+ unicodeOr,
2893
+ updateSettings
2894
+ };