create-ts-monorepo-starter 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -7,8 +7,8 @@ import { constants, tmpdir } from 'node:os';
7
7
  import { readFileSync, existsSync, lstatSync, readdirSync, rmSync } from 'node:fs';
8
8
  import { fileURLToPath } from 'node:url';
9
9
  import process$1, { stdout, stdin } from 'node:process';
10
- import * as l from 'node:readline';
11
- import l__default from 'node:readline';
10
+ import * as f$1 from 'node:readline';
11
+ import f$1__default from 'node:readline';
12
12
  import { ReadStream } from 'node:tty';
13
13
  import { randomBytes } from 'node:crypto';
14
14
 
@@ -796,8 +796,8 @@ const fastStringWidth = (input, options = {}) => {
796
796
  return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
797
797
  };
798
798
 
799
- const ESC = '\x1B';
800
- const CSI = '\x9B';
799
+ const ESC$1 = '\x1B';
800
+ const CSI$1 = '\x9B';
801
801
  const END_CODE = 39;
802
802
  const ANSI_ESCAPE_BELL = '\u0007';
803
803
  const ANSI_CSI = '[';
@@ -830,8 +830,8 @@ const getClosingCode = (openingCode) => {
830
830
  return 0;
831
831
  return undefined;
832
832
  };
833
- const wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
834
- const wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
833
+ const wrapAnsiCode = (code) => `${ESC$1}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
834
+ const wrapAnsiHyperlink = (url) => `${ESC$1}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
835
835
  const wrapWord = (rows, word, columns) => {
836
836
  const characters = word[Symbol.iterator]();
837
837
  let isInsideEscape = false;
@@ -851,7 +851,7 @@ const wrapWord = (rows, word, columns) => {
851
851
  rows.push(character);
852
852
  visible = 0;
853
853
  }
854
- if (character === ESC || character === CSI) {
854
+ if (character === ESC$1 || character === CSI$1) {
855
855
  isInsideEscape = true;
856
856
  isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
857
857
  }
@@ -973,7 +973,7 @@ const exec = (string, columns, options = {}) => {
973
973
  else {
974
974
  inSurrogate = false;
975
975
  }
976
- if (character === ESC || character === CSI) {
976
+ if (character === ESC$1 || character === CSI$1) {
977
977
  GROUP_REGEX.lastIndex = i + 1;
978
978
  const groupsResult = GROUP_REGEX.exec(preString);
979
979
  const groups = groupsResult?.groups;
@@ -1014,90 +1014,71 @@ function wrapAnsi(string, columns, options) {
1014
1014
  .join('\n');
1015
1015
  }
1016
1016
 
1017
- var src;
1018
- var hasRequiredSrc;
1019
-
1020
- function requireSrc () {
1021
- if (hasRequiredSrc) return src;
1022
- hasRequiredSrc = 1;
1023
-
1024
- const ESC = '\x1B';
1025
- const CSI = `${ESC}[`;
1026
- const beep = '\u0007';
1027
-
1028
- const cursor = {
1029
- to(x, y) {
1030
- if (!y) return `${CSI}${x + 1}G`;
1031
- return `${CSI}${y + 1};${x + 1}H`;
1032
- },
1033
- move(x, y) {
1034
- let ret = '';
1035
-
1036
- if (x < 0) ret += `${CSI}${-x}D`;
1037
- else if (x > 0) ret += `${CSI}${x}C`;
1038
-
1039
- if (y < 0) ret += `${CSI}${-y}A`;
1040
- else if (y > 0) ret += `${CSI}${y}B`;
1041
-
1042
- return ret;
1043
- },
1044
- up: (count = 1) => `${CSI}${count}A`,
1045
- down: (count = 1) => `${CSI}${count}B`,
1046
- forward: (count = 1) => `${CSI}${count}C`,
1047
- backward: (count = 1) => `${CSI}${count}D`,
1048
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
1049
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
1050
- left: `${CSI}G`,
1051
- hide: `${CSI}?25l`,
1052
- show: `${CSI}?25h`,
1053
- save: `${ESC}7`,
1054
- restore: `${ESC}8`
1055
- };
1056
-
1057
- const scroll = {
1058
- up: (count = 1) => `${CSI}S`.repeat(count),
1059
- down: (count = 1) => `${CSI}T`.repeat(count)
1060
- };
1061
-
1062
- const erase = {
1063
- screen: `${CSI}2J`,
1064
- up: (count = 1) => `${CSI}1J`.repeat(count),
1065
- down: (count = 1) => `${CSI}J`.repeat(count),
1066
- line: `${CSI}2K`,
1067
- lineEnd: `${CSI}K`,
1068
- lineStart: `${CSI}1K`,
1069
- lines(count) {
1070
- let clear = '';
1071
- for (let i = 0; i < count; i++)
1072
- clear += this.line + (i < count - 1 ? cursor.up() : '');
1073
- if (count)
1074
- clear += cursor.left;
1075
- return clear;
1076
- }
1077
- };
1078
-
1079
- src = { cursor, scroll, erase, beep };
1080
- return src;
1081
- }
1082
-
1083
- var srcExports = requireSrc();
1017
+ const ESC = '\x1B';
1018
+ const CSI = `${ESC}[`;
1019
+ const cursor = {
1020
+ to(x, y) {
1021
+ if (!y)
1022
+ return `${CSI}${x + 1}G`;
1023
+ return `${CSI}${y + 1};${x + 1}H`;
1024
+ },
1025
+ move(x, y) {
1026
+ let ret = '';
1027
+ if (x < 0)
1028
+ ret += `${CSI}${-x}D`;
1029
+ else if (x > 0)
1030
+ ret += `${CSI}${x}C`;
1031
+ if (y < 0)
1032
+ ret += `${CSI}${-y}A`;
1033
+ else if (y > 0)
1034
+ ret += `${CSI}${y}B`;
1035
+ return ret;
1036
+ },
1037
+ up: (count = 1) => `${CSI}${count}A`,
1038
+ down: (count = 1) => `${CSI}${count}B`,
1039
+ forward: (count = 1) => `${CSI}${count}C`,
1040
+ backward: (count = 1) => `${CSI}${count}D`,
1041
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
1042
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
1043
+ left: `${CSI}G`,
1044
+ hide: `${CSI}?25l`,
1045
+ show: `${CSI}?25h`,
1046
+ save: `${ESC}7`,
1047
+ restore: `${ESC}8`
1048
+ };
1049
+ const erase = {
1050
+ screen: `${CSI}2J`,
1051
+ up: (count = 1) => `${CSI}1J`.repeat(count),
1052
+ down: (count = 1) => `${CSI}J`.repeat(count),
1053
+ line: `${CSI}2K`,
1054
+ lineEnd: `${CSI}K`,
1055
+ lineStart: `${CSI}1K`,
1056
+ lines(count) {
1057
+ let clear = '';
1058
+ for (let i = 0; i < count; i++)
1059
+ clear += this.line + (i < count - 1 ? cursor.up() : '');
1060
+ if (count)
1061
+ clear += cursor.left;
1062
+ return clear;
1063
+ }
1064
+ };
1084
1065
 
1085
- function findCursor(s, o, l) {
1066
+ function findCursor(o, s, l) {
1086
1067
  if (!l.some((r) => !r.disabled))
1087
- return s;
1088
- const t = s + o, n = Math.max(l.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;
1089
- return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
1068
+ return o;
1069
+ const t = o + s, n = Math.max(l.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;
1070
+ return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
1090
1071
  }
1091
- function findTextCursor(s, o, l, i) {
1072
+ function findTextCursor(o, s, l, i) {
1092
1073
  const t = i.split(`
1093
1074
  `);
1094
- let n = 0, e = s;
1075
+ let n = 0, e = o;
1095
1076
  for (const r of t) {
1096
1077
  if (e <= r.length)
1097
1078
  break;
1098
1079
  e -= r.length + 1, n++;
1099
1080
  }
1100
- for (n = Math.max(0, Math.min(t.length - 1, n + l)), e = Math.min(e, t[n].length) + o; e < 0 && n > 0; )
1081
+ for (n = Math.max(0, Math.min(t.length - 1, n + l)), e = Math.min(e, t[n].length) + s; e < 0 && n > 0; )
1101
1082
  n--, e += t[n].length + 1;
1102
1083
  for (; e > t[n].length && n < t.length - 1; )
1103
1084
  e -= t[n].length + 1, n++;
@@ -1214,41 +1195,41 @@ function block({
1214
1195
  overwrite: o = true,
1215
1196
  hideCursor: n = true
1216
1197
  } = {}) {
1217
- const s = l.createInterface({
1198
+ const s = f$1.createInterface({
1218
1199
  input: e,
1219
1200
  output: r,
1220
1201
  prompt: "",
1221
1202
  tabSize: 1
1222
1203
  });
1223
- l.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
1224
- const t = (f, { name: a, sequence: w }) => {
1225
- const c = String(f);
1226
- if (isActionKey([c, a, w], "cancel")) {
1227
- n && r.write(srcExports.cursor.show), process.exit(0);
1204
+ f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
1205
+ const t = (l, { name: i, sequence: p }) => {
1206
+ const w = String(l);
1207
+ if (isActionKey([w, i, p], "cancel")) {
1208
+ n && r.write(cursor.show), process.exit(0);
1228
1209
  return;
1229
1210
  }
1230
1211
  if (!o) return;
1231
- const i = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
1232
- l.moveCursor(r, i, m, () => {
1233
- l.clearLine(r, 1, () => {
1212
+ const c = i === "return" ? 0 : -1, a = i === "return" ? -1 : 0;
1213
+ f$1.moveCursor(r, c, a, () => {
1214
+ f$1.clearLine(r, 1, () => {
1234
1215
  e.once("keypress", t);
1235
1216
  });
1236
1217
  });
1237
1218
  };
1238
- return n && r.write(srcExports.cursor.hide), e.once("keypress", t), () => {
1239
- e.off("keypress", t), n && r.write(srcExports.cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
1219
+ return n && r.write(cursor.hide), e.once("keypress", t), () => {
1220
+ e.off("keypress", t), n && r.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
1240
1221
  };
1241
1222
  }
1242
1223
  const getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80, getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
1243
1224
  function wrapTextWithPrefix(e, r, o, n = o, s = o, t) {
1244
- const f = getColumns(e ?? stdout);
1245
- return wrapAnsi(r, f - o.length, {
1225
+ const l = getColumns(e ?? stdout), i = fastStringWidth(o);
1226
+ return wrapAnsi(r, l - i, {
1246
1227
  hard: true,
1247
1228
  trim: false
1248
1229
  }).split(`
1249
- `).map((c, i, m) => {
1250
- const d = t ? t(c, i) : c;
1251
- return i === 0 ? `${n}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;
1230
+ `).map((c, a, g) => {
1231
+ const m = t ? t(c, a) : c;
1232
+ return a === 0 ? `${n}${m}` : a === g.length - 1 ? `${s}${m}` : `${o}${m}`;
1252
1233
  }).join(`
1253
1234
  `);
1254
1235
  }
@@ -1261,7 +1242,7 @@ function runValidation(e, a) {
1261
1242
  return e(a);
1262
1243
  }
1263
1244
 
1264
- class y {
1245
+ let C$1 = class C {
1265
1246
  input;
1266
1247
  output;
1267
1248
  _abortSignal;
@@ -1343,16 +1324,16 @@ class y {
1343
1324
  { once: true }
1344
1325
  );
1345
1326
  }
1346
- this.rl = l__default.createInterface({
1327
+ this.rl = f$1__default.createInterface({
1347
1328
  input: this.input,
1348
1329
  tabSize: 2,
1349
1330
  prompt: "",
1350
1331
  escapeCodeTimeout: 50,
1351
1332
  terminal: true
1352
1333
  }), 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", () => {
1353
- this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(this.value);
1334
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(this.value);
1354
1335
  }), this.once("cancel", () => {
1355
- this.output.write(srcExports.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(CANCEL_SYMBOL);
1336
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(CANCEL_SYMBOL);
1356
1337
  });
1357
1338
  });
1358
1339
  }
@@ -1389,18 +1370,18 @@ class y {
1389
1370
  `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
1390
1371
  }
1391
1372
  restoreCursor() {
1392
- const t = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
1373
+ const t = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
1393
1374
  `).length - 1;
1394
- this.output.write(srcExports.cursor.move(-999, t * -1));
1375
+ this.output.write(cursor.move(-999, t * -1));
1395
1376
  }
1396
1377
  render() {
1397
- const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
1378
+ const t = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
1398
1379
  hard: true,
1399
1380
  trim: false
1400
1381
  });
1401
1382
  if (t !== this._prevFrame) {
1402
1383
  if (this.state === "initial")
1403
- this.output.write(srcExports.cursor.hide);
1384
+ this.output.write(cursor.hide);
1404
1385
  else {
1405
1386
  const e = diffLines(this._prevFrame, t), i = getRows(this.output);
1406
1387
  if (this.restoreCursor(), e) {
@@ -1411,32 +1392,32 @@ class y {
1411
1392
  return;
1412
1393
  }
1413
1394
  if (e.lines.length === 1) {
1414
- this.output.write(srcExports.cursor.move(0, n - r)), this.output.write(srcExports.erase.lines(1));
1395
+ this.output.write(cursor.move(0, n - r)), this.output.write(erase.lines(1));
1415
1396
  const o = t.split(`
1416
1397
  `);
1417
- this.output.write(o[n]), this._prevFrame = t, this.output.write(srcExports.cursor.move(0, o.length - n - 1));
1398
+ this.output.write(o[n]), this._prevFrame = t, this.output.write(cursor.move(0, o.length - n - 1));
1418
1399
  return;
1419
1400
  } else if (e.lines.length > 1) {
1420
1401
  if (s < r)
1421
1402
  n = s;
1422
1403
  else {
1423
1404
  const h = n - r;
1424
- h > 0 && this.output.write(srcExports.cursor.move(0, h));
1405
+ h > 0 && this.output.write(cursor.move(0, h));
1425
1406
  }
1426
- this.output.write(srcExports.erase.down());
1427
- const f = t.split(`
1407
+ this.output.write(erase.down());
1408
+ const m = t.split(`
1428
1409
  `).slice(n);
1429
- this.output.write(f.join(`
1410
+ this.output.write(m.join(`
1430
1411
  `)), this._prevFrame = t;
1431
1412
  return;
1432
1413
  }
1433
1414
  }
1434
- this.output.write(srcExports.erase.down());
1415
+ this.output.write(erase.down());
1435
1416
  }
1436
1417
  this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
1437
1418
  }
1438
1419
  }
1439
- }
1420
+ };
1440
1421
 
1441
1422
  function p$1$1(l, e) {
1442
1423
  if (l === void 0 || e.length === 0)
@@ -1451,7 +1432,7 @@ function g(l, e) {
1451
1432
  if (e)
1452
1433
  return l ? e : e[0];
1453
1434
  }
1454
- let T$1 = class T extends y {
1435
+ let T$1 = class T extends C$1 {
1455
1436
  filteredOptions;
1456
1437
  multiple;
1457
1438
  isNavigating = false;
@@ -1526,7 +1507,7 @@ let T$1 = class T extends y {
1526
1507
  }
1527
1508
  };
1528
1509
 
1529
- class r extends y {
1510
+ class r extends C$1 {
1530
1511
  get cursor() {
1531
1512
  return this.value ? 0 : 1;
1532
1513
  }
@@ -1537,7 +1518,7 @@ class r extends y {
1537
1518
  super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
1538
1519
  this.value = this._value;
1539
1520
  }), this.on("confirm", (i) => {
1540
- this.output.write(srcExports.cursor.move(0, -1)), this.value = i, this.state = "submit", this.close();
1521
+ this.output.write(cursor.move(0, -1)), this.value = i, this.state = "submit", this.close();
1541
1522
  }), this.on("cursor", () => {
1542
1523
  this.value = !this.value;
1543
1524
  });
@@ -1583,7 +1564,7 @@ function b$1(r) {
1583
1564
  if (!(n.getUTCFullYear() !== t || n.getUTCMonth() !== i - 1 || n.getUTCDate() !== s))
1584
1565
  return { year: t, month: i, day: s };
1585
1566
  }
1586
- function C$1(r) {
1567
+ function C$2(r) {
1587
1568
  const t = b$1(r);
1588
1569
  return t ? new Date(Date.UTC(t.year, t.month - 1, t.day)) : void 0;
1589
1570
  }
@@ -1605,7 +1586,7 @@ function T(r, t, i, s) {
1605
1586
  max: e && t.year === e.year && t.month === e.month ? e.day : c$1(t.year, t.month)
1606
1587
  };
1607
1588
  }
1608
- let U$1 = class U extends y {
1589
+ let U$1 = class U extends C$1 {
1609
1590
  #i;
1610
1591
  #o;
1611
1592
  #t;
@@ -1634,7 +1615,7 @@ let U$1 = class U extends y {
1634
1615
  return this.#i.map((i) => t[i.type]).join(this.#o);
1635
1616
  }
1636
1617
  #r() {
1637
- this._setUserInput(this.#l(this.#t)), this._setValue(C$1(this.#t) ?? void 0);
1618
+ this._setUserInput(this.#l(this.#t)), this._setValue(C$2(this.#t) ?? void 0);
1638
1619
  }
1639
1620
  constructor(t) {
1640
1621
  const i = t.format ? { segments: M(t.format), separator: t.separator ?? "/" } : P$1(t.locale), s = t.separator ?? i.separator, n = t.format ? M(t.format) : i.segments, e = t.initialValue ?? t.defaultValue, m = e ? {
@@ -1767,57 +1748,59 @@ let U$1 = class U extends y {
1767
1748
  day: String(Math.min(n, e)).padStart(2, "0")
1768
1749
  };
1769
1750
  }
1770
- this.value = C$1(this.#t) ?? t.defaultValue ?? void 0;
1751
+ this.value = C$2(this.#t) ?? t.defaultValue ?? void 0;
1771
1752
  }
1772
1753
  };
1773
1754
 
1774
- let u$2 = class u extends y {
1755
+ let u$1 = class u extends C$1 {
1775
1756
  options;
1776
1757
  cursor = 0;
1777
- #t;
1758
+ #e;
1778
1759
  getGroupItems(t) {
1779
- return this.options.filter((r) => r.group === t);
1760
+ return this.options.filter((i) => i.group === t);
1780
1761
  }
1781
1762
  isGroupSelected(t) {
1782
- const r = this.getGroupItems(t), e = this.value;
1783
- return e === void 0 ? false : r.every((s) => e.includes(s.value));
1763
+ const i = this.getGroupItems(t), e = this.value;
1764
+ return e === void 0 ? false : i.every((s) => e.includes(s.value));
1784
1765
  }
1785
1766
  toggleValue() {
1786
1767
  const t = this.options[this.cursor];
1787
1768
  if (t !== void 0)
1788
1769
  if (this.value === void 0 && (this.value = []), t.group === true) {
1789
- const r = t.value, e = this.getGroupItems(r);
1790
- this.isGroupSelected(r) ? this.value = this.value.filter(
1791
- (s) => e.findIndex((i) => i.value === s) === -1
1770
+ const i = t.value, e = this.getGroupItems(i);
1771
+ this.isGroupSelected(i) ? this.value = this.value.filter(
1772
+ (s) => e.findIndex((r) => r.value === s) === -1
1792
1773
  ) : this.value = [...this.value, ...e.map((s) => s.value)], this.value = Array.from(new Set(this.value));
1793
1774
  } else {
1794
- const r = this.value.includes(t.value);
1795
- this.value = r ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
1775
+ const i = this.value.includes(t.value);
1776
+ this.value = i ? this.value.filter((e) => e !== t.value) : [...this.value, t.value];
1796
1777
  }
1797
1778
  }
1798
1779
  constructor(t) {
1799
1780
  super(t, false);
1800
- const { options: r } = t;
1801
- this.#t = t.selectableGroups !== false, this.options = Object.entries(r).flatMap(([e, s]) => [
1781
+ const { options: i } = t;
1782
+ this.#e = t.selectableGroups !== false, this.options = Object.entries(i).flatMap(([e, s]) => [
1802
1783
  { value: e, group: true, label: e },
1803
- ...s.map((i) => ({ ...i, group: e }))
1784
+ ...s.map((r) => ({ ...r, group: e }))
1804
1785
  ]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(
1805
1786
  this.options.findIndex(({ value: e }) => e === t.cursorAt),
1806
- this.#t ? 0 : 1
1807
- ), this.on("cursor", (e) => {
1787
+ this.#e ? 0 : 1
1788
+ ), this.on("key", (e, s) => {
1789
+ s.name === void 0 && e === "\u3000" && this.toggleValue();
1790
+ }), this.on("cursor", (e) => {
1808
1791
  switch (e) {
1809
1792
  case "left":
1810
1793
  case "up": {
1811
1794
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1812
1795
  const s = this.options[this.cursor]?.group === true;
1813
- !this.#t && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1796
+ !this.#e && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1814
1797
  break;
1815
1798
  }
1816
1799
  case "down":
1817
1800
  case "right": {
1818
1801
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1819
1802
  const s = this.options[this.cursor]?.group === true;
1820
- !this.#t && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1803
+ !this.#e && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1821
1804
  break;
1822
1805
  }
1823
1806
  case "space":
@@ -1829,7 +1812,7 @@ let u$2 = class u extends y {
1829
1812
  };
1830
1813
 
1831
1814
  const o = /* @__PURE__ */ new Set(["up", "down", "left", "right"]);
1832
- class h extends y {
1815
+ class h extends C$1 {
1833
1816
  #t = false;
1834
1817
  #s;
1835
1818
  focused = "editor";
@@ -1924,7 +1907,7 @@ ${i}` : `${s}${styleText("inverse", r)}${i}`;
1924
1907
  }
1925
1908
  }
1926
1909
 
1927
- class a extends y {
1910
+ class a extends C$1 {
1928
1911
  options;
1929
1912
  cursor = 0;
1930
1913
  get _value() {
@@ -1955,8 +1938,8 @@ class a extends y {
1955
1938
  this.options.findIndex(({ value: t }) => t === e.cursorAt),
1956
1939
  0
1957
1940
  );
1958
- this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t, l) => {
1959
- l.name === "a" && this.toggleAll(), l.name === "i" && this.toggleInvert();
1941
+ this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t, s) => {
1942
+ s.name === "a" && this.toggleAll(), s.name === "i" && this.toggleInvert(), s.name === void 0 && t === "\u3000" && this.toggleValue();
1960
1943
  }), this.on("cursor", (t) => {
1961
1944
  switch (t) {
1962
1945
  case "left":
@@ -1975,7 +1958,7 @@ class a extends y {
1975
1958
  }
1976
1959
  }
1977
1960
 
1978
- let u$1 = class u extends y {
1961
+ let u$2 = class u extends C$1 {
1979
1962
  _mask = "\u2022";
1980
1963
  get cursor() {
1981
1964
  return this._cursor;
@@ -2004,7 +1987,7 @@ let u$1 = class u extends y {
2004
1987
  }
2005
1988
  };
2006
1989
 
2007
- let n$1 = class n extends y {
1990
+ let n$1 = class n extends C$1 {
2008
1991
  options;
2009
1992
  cursor = 0;
2010
1993
  get _selectedValue() {
@@ -2033,25 +2016,25 @@ let n$1 = class n extends y {
2033
2016
  }
2034
2017
  };
2035
2018
 
2036
- let u$3 = class u extends y {
2019
+ let c$2 = class c extends C$1 {
2037
2020
  options;
2038
2021
  cursor = 0;
2039
2022
  constructor(t) {
2040
2023
  super(t, false), this.options = t.options;
2041
- const s = t.caseSensitive === true, i = this.options.map(({ value: [e] }) => s ? e : e?.toLowerCase());
2042
- this.cursor = Math.max(i.indexOf(t.initialValue), 0), this.on("key", (e) => {
2024
+ const s = t.caseSensitive === true, i = this.options.map(({ value: [e] }) => s ? e : e?.toLowerCase()), n = Math.max(i.indexOf(t.initialValue), 0);
2025
+ this.cursor = this.options[n]?.disabled ? 0 : n, this.on("key", (e) => {
2043
2026
  if (!e)
2044
2027
  return;
2045
2028
  const o = s ? e : e.toLowerCase();
2046
2029
  if (!i.includes(o))
2047
2030
  return;
2048
- const n = this.options.find(({ value: [r] }) => s ? r === o : r?.toLowerCase() === o);
2049
- n && (this.value = n.value, this.state = "submit", this.emit("submit"));
2031
+ const r = this.options.find(({ value: [a], disabled: u }) => u ? false : s ? a === o : a?.toLowerCase() === o);
2032
+ r && (this.value = r.value, this.state = "submit", this.emit("submit"));
2050
2033
  });
2051
2034
  }
2052
2035
  };
2053
2036
 
2054
- class n extends y {
2037
+ class n extends C$1 {
2055
2038
  get userInputWithCursor() {
2056
2039
  if (this.state === "submit")
2057
2040
  return this.userInput;
@@ -2092,8 +2075,8 @@ function isUnicodeSupported() {
2092
2075
  || process$1.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
2093
2076
  }
2094
2077
 
2095
- const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", isTTY = (o) => o.isTTY === true, unicodeOr = (o, e) => unicode ? o : e, S_STEP_ACTIVE = unicodeOr("\u25C6", "*"), S_STEP_CANCEL = unicodeOr("\u25A0", "x"), S_STEP_ERROR = unicodeOr("\u25B2", "x"), S_STEP_SUBMIT = unicodeOr("\u25C7", "o"), S_BAR_START = unicodeOr("\u250C", "T"), S_BAR = unicodeOr("\u2502", "|"), S_BAR_END = unicodeOr("\u2514", "\u2014"), S_BAR_START_RIGHT = unicodeOr("\u2510", "T"), S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014"), S_RADIO_ACTIVE = unicodeOr("\u25CF", ">"), S_RADIO_INACTIVE = unicodeOr("\u25CB", " "), S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]"), S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]"), S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]"), S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022"), S_BAR_H = unicodeOr("\u2500", "-"), S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+"), S_CONNECT_LEFT = unicodeOr("\u251C", "+"), S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+"), S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+"), S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+"), S_INFO = unicodeOr("\u25CF", "\u2022"), S_SUCCESS = unicodeOr("\u25C6", "*"), S_WARN = unicodeOr("\u25B2", "!"), S_ERROR = unicodeOr("\u25A0", "x"), symbol = (o) => {
2096
- switch (o) {
2078
+ const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", isTTY = (e) => e.isTTY === true, unicodeOr = (e, o) => unicode ? e : o, S_STEP_ACTIVE = unicodeOr("\u25C6", "*"), S_STEP_CANCEL = unicodeOr("\u25A0", "x"), S_STEP_ERROR = unicodeOr("\u25B2", "x"), S_STEP_SUBMIT = unicodeOr("\u25C7", "o"), S_BAR_START = unicodeOr("\u250C", "T"), S_BAR = unicodeOr("\u2502", "|"), S_BAR_END = unicodeOr("\u2514", "\u2014"), S_BAR_START_RIGHT = unicodeOr("\u2510", "T"), S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014"), S_RADIO_ACTIVE = unicodeOr("\u25CF", ">"), S_RADIO_INACTIVE = unicodeOr("\u25CB", " "), S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]"), S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]"), S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]"), S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022"), S_BAR_H = unicodeOr("\u2500", "-"), S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+"), S_CONNECT_LEFT = unicodeOr("\u251C", "+"), S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+"), S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+"), S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+"), S_INFO = unicodeOr("\u25CF", "\u2022"), S_SUCCESS = unicodeOr("\u25C6", "*"), S_WARN = unicodeOr("\u25B2", "!"), S_ERROR = unicodeOr("\u25A0", "x"), symbol = (e) => {
2079
+ switch (e) {
2097
2080
  case "initial":
2098
2081
  case "active":
2099
2082
  return styleText("cyan", S_STEP_ACTIVE);
@@ -2106,8 +2089,8 @@ const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", is
2106
2089
  case "validating":
2107
2090
  return styleText("dim", S_STEP_ACTIVE);
2108
2091
  }
2109
- }, symbolBar = (o) => {
2110
- switch (o) {
2092
+ }, symbolBar = (e) => {
2093
+ switch (e) {
2111
2094
  case "initial":
2112
2095
  case "active":
2113
2096
  return styleText("cyan", S_BAR);
@@ -2119,12 +2102,13 @@ const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", is
2119
2102
  return styleText("green", S_BAR);
2120
2103
  }
2121
2104
  };
2122
- function formatInstructionFooter(o, e) {
2123
- const r = [`${e ? `${styleText("cyan", S_BAR)} ` : ""}${o.join(" \u2022 ")}`];
2124
- return e && r.push(styleText("cyan", S_BAR_END)), r;
2105
+ function formatInstructionFooter(e, o, r) {
2106
+ const s = r ? `${styleText("cyan", S_BAR)} ` : "", n = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
2107
+ `);
2108
+ return r && n.push(styleText("cyan", S_BAR_END)), n;
2125
2109
  }
2126
2110
 
2127
- const I = (l, e, w, p, b, C = false) => {
2111
+ const E$1 = (l, e, w, p, b, C = false) => {
2128
2112
  let r = e, O = 0;
2129
2113
  if (C)
2130
2114
  for (let i = p - 1; i >= w; i--) {
@@ -2154,15 +2138,15 @@ const limitOptions = ({
2154
2138
  0
2155
2139
  ));
2156
2140
  let d = a < e.length && f > 0, c = a < e.length && f + a < e.length;
2157
- const W = Math.min(
2141
+ const I = Math.min(
2158
2142
  f + a,
2159
2143
  e.length
2160
2144
  ), s = [];
2161
2145
  let g = 0;
2162
2146
  d && g++, c && g++;
2163
- const T = f + (d ? 1 : 0), y = W - (c ? 1 : 0);
2164
- for (let t = T; t < y; t++) {
2165
- const n = e[t], o = n ? w(n, t === l) : "", h = wrapAnsi(o, i, {
2147
+ const T = f + (d ? 1 : 0), W = I - (c ? 1 : 0);
2148
+ for (let t = T; t < W; t++) {
2149
+ const n = e[t], o = n !== void 0 ? w(n, t === l) : "", h = wrapAnsi(o, i, {
2166
2150
  hard: true,
2167
2151
  trim: false
2168
2152
  }).split(`
@@ -2173,7 +2157,7 @@ const limitOptions = ({
2173
2157
  let t = 0, n = 0, o = g;
2174
2158
  const h = l - T;
2175
2159
  let u = v;
2176
- const L = () => I(s, o, 0, h, u), E = () => I(
2160
+ const L = () => E$1(s, o, 0, h, u), y = () => E$1(
2177
2161
  s,
2178
2162
  o,
2179
2163
  h + 1,
@@ -2181,7 +2165,7 @@ const limitOptions = ({
2181
2165
  u,
2182
2166
  true
2183
2167
  );
2184
- d ? ({ lineCount: o, removals: t } = L(), o > u && (c || (u -= 1), { lineCount: o, removals: n } = E())) : (c || (u -= 1), { lineCount: o, removals: n } = E(), o > u && (u -= 1, { lineCount: o, removals: t } = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));
2168
+ d ? ({ lineCount: o, removals: t } = L(), o > u && (c || (u -= 1), { lineCount: o, removals: n } = y())) : (c || (u -= 1), { lineCount: o, removals: n } = y(), o > u && (u -= 1, { lineCount: o, removals: t } = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));
2185
2169
  }
2186
2170
  const x = [];
2187
2171
  d && x.push(M);
@@ -2208,7 +2192,7 @@ function j(t, c) {
2208
2192
  }
2209
2193
  const autocomplete = (t) => new T$1({
2210
2194
  options: t.options,
2211
- initialValue: t.initialValue ? [t.initialValue] : void 0,
2195
+ initialValue: t.initialValue !== void 0 ? [t.initialValue] : void 0,
2212
2196
  initialUserInput: t.initialUserInput,
2213
2197
  placeholder: t.placeholder,
2214
2198
  completeOnTab: t.completeOnTab,
@@ -2538,22 +2522,22 @@ const MULTISELECT_INSTRUCTIONS = [
2538
2522
  `${styleText("dim", "Space:")} select`,
2539
2523
  `${styleText("dim", "Enter:")} confirm`
2540
2524
  ];
2541
- const m = (i, u) => i.split(`
2525
+ const m = (n, u) => n.split(`
2542
2526
  `).map((d) => u(d)).join(`
2543
2527
  `);
2544
- const multiselect = (i) => {
2528
+ const multiselect = (n) => {
2545
2529
  const u = (t, a) => {
2546
2530
  const r = t.label ?? String(t.value);
2547
2531
  return a === "disabled" ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText(["strikethrough", "gray"], o))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${m(r, (o) => styleText("dim", o))}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "cancelled" ? `${m(r, (o) => styleText(["strikethrough", "dim"], o))}` : a === "active-selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "submitted" ? `${m(r, (o) => styleText("dim", o))}` : `${styleText("dim", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText("dim", o))}`;
2548
- }, d = i.required ?? true, x = i.showInstructions ?? true;
2532
+ }, d = n.required ?? true, x = n.showInstructions ?? true;
2549
2533
  return new a({
2550
- options: i.options,
2551
- signal: i.signal,
2552
- input: i.input,
2553
- output: i.output,
2554
- initialValues: i.initialValues,
2534
+ options: n.options,
2535
+ signal: n.signal,
2536
+ input: n.input,
2537
+ output: n.output,
2538
+ initialValues: n.initialValues,
2555
2539
  required: d,
2556
- cursorAt: i.cursorAt,
2540
+ cursorAt: n.cursorAt,
2557
2541
  validate(t) {
2558
2542
  if (d && (t === void 0 || t.length === 0))
2559
2543
  return `Please select at least one option.
@@ -2569,75 +2553,75 @@ ${styleText(
2569
2553
  )}`;
2570
2554
  },
2571
2555
  render() {
2572
- const t = i.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(
2573
- i.output,
2574
- i.message,
2556
+ const t = n.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(
2557
+ n.output,
2558
+ n.message,
2575
2559
  t ? `${symbolBar(this.state)} ` : "",
2576
2560
  `${symbol(this.state)} `
2577
2561
  ), r = `${t ? `${styleText("gray", S_BAR)}
2578
2562
  ` : ""}${a}
2579
- `, o = this.value ?? [], g = (n, l) => {
2580
- if (n.disabled)
2581
- return u(n, "disabled");
2582
- const s = o.includes(n.value);
2583
- return l && s ? u(n, "active-selected") : s ? u(n, "selected") : u(n, l ? "active" : "inactive");
2563
+ `, o = this.value ?? [], g = (i, l) => {
2564
+ if (i.disabled)
2565
+ return u(i, "disabled");
2566
+ const s = o.includes(i.value);
2567
+ return l && s ? u(i, "active-selected") : s ? u(i, "selected") : u(i, l ? "active" : "inactive");
2584
2568
  };
2585
2569
  switch (this.state) {
2586
2570
  case "submit": {
2587
- const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = wrapTextWithPrefix(
2588
- i.output,
2589
- n,
2571
+ const i = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l = wrapTextWithPrefix(
2572
+ n.output,
2573
+ i,
2590
2574
  t ? `${styleText("gray", S_BAR)} ` : ""
2591
2575
  );
2592
2576
  return `${r}${l}`;
2593
2577
  }
2594
2578
  case "cancel": {
2595
- const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "cancelled")).join(styleText("dim", ", "));
2596
- if (n.trim() === "")
2579
+ const i = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "cancelled")).join(styleText("dim", ", "));
2580
+ if (i.trim() === "")
2597
2581
  return `${r}${styleText("gray", S_BAR)}`;
2598
2582
  const l = wrapTextWithPrefix(
2599
- i.output,
2600
- n,
2583
+ n.output,
2584
+ i,
2601
2585
  t ? `${styleText("gray", S_BAR)} ` : ""
2602
2586
  );
2603
2587
  return `${r}${l}${t ? `
2604
2588
  ${styleText("gray", S_BAR)}` : ""}`;
2605
2589
  }
2606
2590
  case "error": {
2607
- const n = t ? `${styleText("yellow", S_BAR)} ` : "", l = this.error.split(`
2591
+ const i = t ? `${styleText("yellow", S_BAR)} ` : "", l = this.error.split(`
2608
2592
  `).map(
2609
2593
  ($, v) => v === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", $)}` : ` ${$}`
2610
2594
  ).join(`
2611
2595
  `), s = r.split(`
2612
2596
  `).length, h = l.split(`
2613
2597
  `).length + 1;
2614
- return `${r}${n}${limitOptions({
2615
- output: i.output,
2598
+ return `${r}${i}${limitOptions({
2599
+ output: n.output,
2616
2600
  options: this.options,
2617
2601
  cursor: this.cursor,
2618
- maxItems: i.maxItems,
2619
- columnPadding: n.length,
2602
+ maxItems: n.maxItems,
2603
+ columnPadding: i.length,
2620
2604
  rowPadding: s + h,
2621
2605
  style: g
2622
2606
  }).join(`
2623
- ${n}`)}
2607
+ ${i}`)}
2624
2608
  ${l}
2625
2609
  `;
2626
2610
  }
2627
2611
  default: {
2628
- const n = t ? `${styleText("cyan", S_BAR)} ` : "", l = r.split(`
2629
- `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
2612
+ const i = t ? `${styleText("cyan", S_BAR)} ` : "", l = r.split(`
2613
+ `).length, s = x ? formatInstructionFooter(n.output, MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
2630
2614
  `), $ = s.length + 1;
2631
- return `${r}${n}${limitOptions({
2632
- output: i.output,
2615
+ return `${r}${i}${limitOptions({
2616
+ output: n.output,
2633
2617
  options: this.options,
2634
2618
  cursor: this.cursor,
2635
- maxItems: i.maxItems,
2636
- columnPadding: n.length,
2619
+ maxItems: n.maxItems,
2620
+ columnPadding: i.length,
2637
2621
  rowPadding: l + $,
2638
2622
  style: g
2639
2623
  }).join(`
2640
- ${n}`)}
2624
+ ${i}`)}
2641
2625
  ${h}
2642
2626
  `;
2643
2627
  }
@@ -2646,46 +2630,46 @@ ${h}
2646
2630
  }).prompt();
2647
2631
  };
2648
2632
 
2649
- const groupMultiselect = (o) => {
2650
- const { selectableGroups: f = true, groupSpacing: x = 0 } = o, d = (n, l, p = []) => {
2651
- const a = n.label ?? String(n.value), t = typeof n.group == "string", s = t && (p[p.indexOf(n) + 1] ?? { group: true }), u = t && s && s.group === true;
2652
- let r = "", c = "";
2653
- t && (f ? (r = u ? `${S_BAR_END} ` : `${S_BAR} `, c = u ? " " : `${S_BAR} `) : r = " ");
2633
+ const groupMultiselect = (r) => {
2634
+ const { selectableGroups: f = true, groupSpacing: x = 0 } = r, d = (n, l, p = []) => {
2635
+ const a = n.label ?? String(n.value), t = typeof n.group == "string", u = t && (p[p.indexOf(n) + 1] ?? { group: true }), s = t && u && u.group === true;
2636
+ let o = "", c = "";
2637
+ t && (f ? (o = s ? `${S_BAR_END} ` : `${S_BAR} `, c = s ? " " : `${S_BAR} `) : o = " ");
2654
2638
  let i = "";
2655
2639
  if (x > 0 && !t && (i = `
2656
2640
  `.repeat(x)), l === "active")
2657
2641
  return wrapTextWithPrefix(
2658
- o.output,
2642
+ r.output,
2659
2643
  `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`,
2660
- `${i}${styleText("dim", r)} `,
2661
- `${i}${styleText("dim", r)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
2644
+ `${i}${styleText("dim", o)} `,
2645
+ `${i}${styleText("dim", o)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
2662
2646
  `${i}${styleText("dim", c)} `
2663
2647
  );
2664
2648
  if (l === "group-active")
2665
2649
  return wrapTextWithPrefix(
2666
- o.output,
2650
+ r.output,
2667
2651
  a,
2668
- `${i}${r} `,
2669
- `${i}${r}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
2652
+ `${i}${o} `,
2653
+ `${i}${o}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
2670
2654
  `${i}${c} `,
2671
2655
  (m) => styleText("dim", m)
2672
2656
  );
2673
2657
  if (l === "group-active-selected")
2674
2658
  return wrapTextWithPrefix(
2675
- o.output,
2659
+ r.output,
2676
2660
  a,
2677
- `${i}${r} `,
2678
- `${i}${r}${styleText("green", S_CHECKBOX_SELECTED)} `,
2661
+ `${i}${o} `,
2662
+ `${i}${o}${styleText("green", S_CHECKBOX_SELECTED)} `,
2679
2663
  `${i}${c} `,
2680
2664
  (m) => styleText("dim", m)
2681
2665
  );
2682
2666
  if (l === "selected") {
2683
2667
  const m = t || f ? styleText("green", S_CHECKBOX_SELECTED) : "";
2684
2668
  return wrapTextWithPrefix(
2685
- o.output,
2669
+ r.output,
2686
2670
  `${a}${n.hint ? ` (${n.hint})` : ""}`,
2687
- `${i}${styleText("dim", r)} `,
2688
- `${i}${styleText("dim", r)}${m} `,
2671
+ `${i}${styleText("dim", o)} `,
2672
+ `${i}${styleText("dim", o)}${m} `,
2689
2673
  `${i}${styleText("dim", c)} `,
2690
2674
  (I) => styleText("dim", I)
2691
2675
  );
@@ -2694,32 +2678,32 @@ const groupMultiselect = (o) => {
2694
2678
  return `${styleText(["strikethrough", "dim"], a)}`;
2695
2679
  if (l === "active-selected")
2696
2680
  return wrapTextWithPrefix(
2697
- o.output,
2681
+ r.output,
2698
2682
  `${a}${n.hint ? ` ${styleText("dim", `(${n.hint})`)}` : ""}`,
2699
- `${i}${styleText("dim", r)} `,
2700
- `${i}${styleText("dim", r)}${styleText("green", S_CHECKBOX_SELECTED)} `,
2683
+ `${i}${styleText("dim", o)} `,
2684
+ `${i}${styleText("dim", o)}${styleText("green", S_CHECKBOX_SELECTED)} `,
2701
2685
  `${i}${styleText("dim", c)} `
2702
2686
  );
2703
2687
  if (l === "submitted")
2704
2688
  return `${styleText("dim", a)}`;
2705
2689
  const h = t || f ? styleText("dim", S_CHECKBOX_INACTIVE) : "";
2706
2690
  return wrapTextWithPrefix(
2707
- o.output,
2691
+ r.output,
2708
2692
  a,
2709
- `${i}${styleText("dim", r)} `,
2710
- `${i}${styleText("dim", r)}${h} `,
2693
+ `${i}${styleText("dim", o)} `,
2694
+ `${i}${styleText("dim", o)}${h} `,
2711
2695
  `${i}${styleText("dim", c)} `,
2712
2696
  (m) => styleText("dim", m)
2713
2697
  );
2714
- }, y = o.required ?? true, S = o.showInstructions ?? true;
2715
- return new u$2({
2716
- options: o.options,
2717
- signal: o.signal,
2718
- input: o.input,
2719
- output: o.output,
2720
- initialValues: o.initialValues,
2698
+ }, y = r.required ?? true, S = r.showInstructions ?? true;
2699
+ return new u$1({
2700
+ options: r.options,
2701
+ signal: r.signal,
2702
+ input: r.input,
2703
+ output: r.output,
2704
+ initialValues: r.initialValues,
2721
2705
  required: y,
2722
- cursorAt: o.cursorAt,
2706
+ cursorAt: r.cursorAt,
2723
2707
  selectableGroups: f,
2724
2708
  validate(n) {
2725
2709
  if (y && (n === void 0 || n.length === 0))
@@ -2736,58 +2720,58 @@ ${styleText(
2736
2720
  )}`;
2737
2721
  },
2738
2722
  render() {
2739
- const n = o.withGuide ?? settings.withGuide, l = `${n ? `${styleText("gray", S_BAR)}
2740
- ` : ""}${symbol(this.state)} ${o.message}
2741
- `, p = this.value ?? [], a = (t, s) => {
2742
- const u = this.options, r = p.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
2743
- return !s && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? d(t, r ? "group-active-selected" : "group-active", u) : s && r ? d(t, "active-selected", u) : r ? d(t, "selected", u) : d(t, s ? "active" : "inactive", u);
2723
+ const n = r.withGuide ?? settings.withGuide, l = `${n ? `${styleText("gray", S_BAR)}
2724
+ ` : ""}${symbol(this.state)} ${r.message}
2725
+ `, p = this.value ?? [], a = (t, u) => {
2726
+ const s = this.options, o = p.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
2727
+ return !u && typeof t.group == "string" && this.options[this.cursor]?.value === t.group ? d(t, o ? "group-active-selected" : "group-active", s) : u && o ? d(t, "active-selected", s) : o ? d(t, "selected", s) : d(t, u ? "active" : "inactive", s);
2744
2728
  };
2745
2729
  switch (this.state) {
2746
2730
  case "submit": {
2747
- const t = this.options.filter(({ value: u }) => p.includes(u)).map((u) => d(u, "submitted")), s = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
2748
- return `${l}${n ? styleText("gray", S_BAR) : ""}${s}`;
2731
+ const t = this.options.filter(({ value: s }) => p.includes(s)).map((s) => d(s, "submitted")), u = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
2732
+ return `${l}${n ? styleText("gray", S_BAR) : ""}${u}`;
2749
2733
  }
2750
2734
  case "cancel": {
2751
- const t = this.options.filter(({ value: s }) => p.includes(s)).map((s) => d(s, "cancelled")).join(styleText("dim", ", "));
2735
+ const t = this.options.filter(({ value: u }) => p.includes(u)).map((u) => d(u, "cancelled")).join(styleText("dim", ", "));
2752
2736
  return `${l}${n ? `${styleText("gray", S_BAR)} ` : ""}${t.trim() ? `${t}${n ? `
2753
2737
  ${styleText("gray", S_BAR)}` : ""}` : ""}`;
2754
2738
  }
2755
2739
  case "error": {
2756
- const t = n ? `${styleText("yellow", S_BAR)} ` : "", s = this.error.split(`
2740
+ const t = n ? `${styleText("yellow", S_BAR)} ` : "", u = this.error.split(`
2757
2741
  `).map(
2758
2742
  (i, h) => h === 0 ? `${n ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", i)}` : ` ${i}`
2759
2743
  ).join(`
2760
- `), u = l.split(`
2761
- `).length, r = s.split(`
2744
+ `), s = l.split(`
2745
+ `).length, o = u.split(`
2762
2746
  `).length + 1, c = limitOptions({
2763
- output: o.output,
2747
+ output: r.output,
2764
2748
  options: this.options,
2765
2749
  cursor: this.cursor,
2766
- maxItems: o.maxItems,
2750
+ maxItems: r.maxItems,
2767
2751
  columnPadding: t.length,
2768
- rowPadding: u + r,
2752
+ rowPadding: s + o,
2769
2753
  style: a
2770
2754
  }).join(`
2771
2755
  ${t}`);
2772
2756
  return `${l}${t}${c}
2773
- ${s}
2757
+ ${u}
2774
2758
  `;
2775
2759
  }
2776
2760
  default: {
2777
- const t = n ? `${styleText("cyan", S_BAR)} ` : "", s = l.split(`
2778
- `).length, u = S ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], r = u.join(`
2779
- `), c = u.length + 1, i = limitOptions({
2780
- output: o.output,
2761
+ const t = n ? `${styleText("cyan", S_BAR)} ` : "", u = l.split(`
2762
+ `).length, s = S ? formatInstructionFooter(r.output, MULTISELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], o = s.join(`
2763
+ `), c = s.length + 1, i = limitOptions({
2764
+ output: r.output,
2781
2765
  options: this.options,
2782
2766
  cursor: this.cursor,
2783
- maxItems: o.maxItems,
2767
+ maxItems: r.maxItems,
2784
2768
  columnPadding: t.length,
2785
- rowPadding: s + c,
2769
+ rowPadding: u + c,
2786
2770
  style: a
2787
2771
  }).join(`
2788
2772
  ${t}`);
2789
2773
  return `${l}${t}${i}
2790
- ${r}
2774
+ ${o}
2791
2775
  `;
2792
2776
  }
2793
2777
  }
@@ -2912,7 +2896,7 @@ ${r}${d}
2912
2896
  }
2913
2897
  }).prompt();
2914
2898
 
2915
- const W$1 = (o) => o, C = (o, e, s) => {
2899
+ const W = (o) => o, C = (o, e, s) => {
2916
2900
  const a = {
2917
2901
  hard: true,
2918
2902
  trim: false
@@ -2921,7 +2905,7 @@ const W$1 = (o) => o, C = (o, e, s) => {
2921
2905
  return wrapAnsi(o, g, a);
2922
2906
  };
2923
2907
  const note = (o = "", e = "", s) => {
2924
- const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = ["", ...C(o, getColumns(a) - 6, c).split(`
2908
+ const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W, g = ["", ...C(o, getColumns(a) - 6, c).split(`
2925
2909
  `).map(c), ""], n = fastStringWidth(e), t = Math.max(
2926
2910
  g.reduce((m, F) => {
2927
2911
  const O = fastStringWidth(F);
@@ -2944,7 +2928,7 @@ ${styleText("gray", l$1 + S_BAR_H.repeat(t + 2) + S_CORNER_BOTTOM_RIGHT)}
2944
2928
  );
2945
2929
  };
2946
2930
 
2947
- const password = (e) => new u$1({
2931
+ const password = (e) => new u$2({
2948
2932
  validate: e.validate,
2949
2933
  mask: e.mask ?? S_PASSWORD_MASK,
2950
2934
  signal: e.signal,
@@ -3002,17 +2986,18 @@ const path = (e) => {
3002
2986
  return [];
3003
2987
  try {
3004
2988
  let i;
3005
- existsSync(t) ? lstatSync(t).isDirectory() && (!e.directory || t.endsWith("/")) ? i = t : i = dirname(t) : i = dirname(t);
3006
- const c = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
2989
+ const o = t.endsWith("/") || t.endsWith("\\");
2990
+ existsSync(t) ? lstatSync(t).isDirectory() && (!e.directory || o) ? i = t : i = dirname(t) : i = dirname(t);
2991
+ const m = t.length > 1 && o ? t.slice(0, -1) : t;
3007
2992
  return readdirSync(i).map((r) => {
3008
- const n = join(i, r), m = lstatSync(n);
2993
+ const n = join(i, r), l = lstatSync(n);
3009
2994
  return {
3010
2995
  name: r,
3011
2996
  path: n,
3012
- isDirectory: m.isDirectory()
2997
+ isDirectory: l.isDirectory()
3013
2998
  };
3014
2999
  }).filter(
3015
- ({ path: r, isDirectory: n }) => r.startsWith(c) && (n || !e.directory)
3000
+ ({ path: r, isDirectory: n }) => r.startsWith(m) && (n || !e.directory)
3016
3001
  ).map((r) => ({
3017
3002
  value: r.path
3018
3003
  }));
@@ -3023,83 +3008,101 @@ const path = (e) => {
3023
3008
  });
3024
3009
  };
3025
3010
 
3026
- const W = (l) => styleText("magenta", l);
3011
+ const Y = 3e4, Z = (c) => styleText("magenta", c);
3027
3012
  const spinner = ({
3028
- indicator: l = "dots",
3029
- onCancel: h,
3013
+ indicator: c = "dots",
3014
+ onCancel: b,
3030
3015
  output: n = process.stdout,
3031
- cancelMessage: G,
3032
- errorMessage: O,
3033
- frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
3034
- delay: F = unicode ? 80 : 120,
3035
- signal: m,
3036
- ...I
3016
+ cancelMessage: _,
3017
+ errorMessage: C,
3018
+ frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
3019
+ delay: O = unicode ? 80 : 120,
3020
+ signal: g,
3021
+ ...E
3037
3022
  } = {}) => {
3038
- const u = isCI();
3039
- let M, T, d = false, S = false, s = "", p, w = performance.now();
3040
- const x = getColumns(n), k = I?.styleFrame ?? W, g = (e) => {
3041
- const r = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
3042
- S = e === 1, d && (a(r, e), S && typeof h == "function" && h());
3043
- }, f = () => g(2), i = () => g(1), A = () => {
3044
- process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i), process.on("SIGTERM", i), process.on("exit", g), m && m.addEventListener("abort", i);
3045
- }, H = () => {
3046
- process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i), process.removeListener("SIGTERM", i), process.removeListener("exit", g), m && m.removeEventListener("abort", i);
3047
- }, y = () => {
3048
- if (p === void 0) return;
3023
+ const u = isCI(), h = isAccessible(E.accessible);
3024
+ let x, I, p = false, l = false, r = "", v, w = performance.now();
3025
+ const y = getColumns(n), F = E?.styleFrame ?? Z, S = (e) => {
3026
+ const s = e > 1 ? C ?? settings.messages.error : _ ?? settings.messages.cancel;
3027
+ l = e === 1, p && (m(s, e), l && typeof b == "function" && b());
3028
+ }, $ = () => S(2), a = () => S(1), H = () => {
3029
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a), process.on("SIGTERM", a), process.on("exit", S), g && g.addEventListener("abort", a);
3030
+ }, B = () => {
3031
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a), process.removeListener("SIGTERM", a), process.removeListener("exit", S), g && g.removeEventListener("abort", a);
3032
+ }, R = () => {
3033
+ if (v === void 0) return;
3049
3034
  u && n.write(`
3050
3035
  `);
3051
- const r = wrapAnsi(p, x, {
3036
+ const s = wrapAnsi(v, y, {
3052
3037
  hard: true,
3053
3038
  trim: false
3054
3039
  }).split(`
3055
3040
  `);
3056
- r.length > 1 && n.write(srcExports.cursor.up(r.length - 1)), n.write(srcExports.cursor.to(0)), n.write(srcExports.erase.down());
3057
- }, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
3058
- const r = (performance.now() - e) / 1e3, t = Math.floor(r / 60), o = Math.floor(r % 60);
3059
- return t > 0 ? `[${t}m ${o}s]` : `[${o}s]`;
3060
- }, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
3061
- d = true, M = block({ output: n }), s = C(e), w = performance.now(), N && n.write(`${styleText("gray", S_BAR)}
3041
+ s.length > 1 && n.write(cursor.up(s.length - 1)), n.write(cursor.to(0)), n.write(erase.down());
3042
+ }, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
3043
+ const s = (performance.now() - e) / 1e3, i = Math.floor(s / 60), t = Math.floor(s % 60);
3044
+ return i > 0 ? `[${i}m ${t}s]` : `[${t}s]`;
3045
+ }, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
3046
+ if (p = true, l = false, r = L(e), w = performance.now(), H(), h) {
3047
+ r !== "" && n.write(`${r}
3048
+ `), I = setInterval(() => {
3049
+ n.write(r === "" ? `still working
3050
+ ` : `still working: ${r}
3051
+ `);
3052
+ }, Y);
3053
+ return;
3054
+ }
3055
+ x = block({ output: n }), N && n.write(`${styleText("gray", S_BAR)}
3062
3056
  `);
3063
- let r = 0, t = 0;
3064
- A(), T = setInterval(() => {
3065
- if (u && s === p)
3057
+ let s = 0, i = 0;
3058
+ I = setInterval(() => {
3059
+ if (u && r === v)
3066
3060
  return;
3067
- y(), p = s;
3068
- const o = k(E[r]);
3069
- let v;
3061
+ R(), v = r;
3062
+ const t = F(M[s]);
3063
+ let o;
3070
3064
  if (u)
3071
- v = `${o} ${s}...`;
3072
- else if (l === "timer")
3073
- v = `${o} ${s} ${_(w)}`;
3065
+ o = `${t} ${r}...`;
3066
+ else if (c === "timer")
3067
+ o = `${t} ${r} ${T(w)}`;
3074
3068
  else {
3075
- const B = ".".repeat(Math.floor(t)).slice(0, 3);
3076
- v = `${o} ${s}${B}`;
3069
+ const j = ".".repeat(Math.floor(i)).slice(0, 3);
3070
+ o = `${t} ${r}${j}`;
3077
3071
  }
3078
- const j = wrapAnsi(v, x, {
3072
+ const D = wrapAnsi(o, y, {
3079
3073
  hard: true,
3080
3074
  trim: false
3081
3075
  });
3082
- n.write(j), r = r + 1 < E.length ? r + 1 : 0, t = t < 4 ? t + 0.125 : 0;
3083
- }, F);
3084
- }, a = (e = "", r = 0, t = false) => {
3085
- if (!d) return;
3086
- d = false, clearInterval(T), y();
3087
- const o = r === 0 ? styleText("green", S_STEP_SUBMIT) : r === 1 ? styleText("red", S_STEP_CANCEL) : styleText("red", S_STEP_ERROR);
3088
- s = e ?? s, t || (l === "timer" ? n.write(`${o} ${s} ${_(w)}
3089
- `) : n.write(`${o} ${s}
3090
- `)), H(), M();
3076
+ n.write(D), s = s + 1 < M.length ? s + 1 : 0, i = i < 4 ? i + 0.125 : 0;
3077
+ }, O);
3078
+ }, m = (e = "", s = 0, i = false) => {
3079
+ if (p) {
3080
+ if (p = false, l = s === 1, clearInterval(I), h || R(), r = e ?? r, !i)
3081
+ if (h) {
3082
+ const t = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C ?? settings.messages.error : "Done", o = r || t;
3083
+ c === "timer" ? n.write(`${o} ${T(w)}
3084
+ `) : n.write(`${o}
3085
+ `);
3086
+ } else {
3087
+ const t = s === 0 ? styleText("green", S_STEP_SUBMIT) : s === 1 ? styleText("red", S_STEP_CANCEL) : styleText("red", S_STEP_ERROR);
3088
+ c === "timer" ? n.write(`${t} ${r} ${T(w)}
3089
+ `) : n.write(`${t} ${r}
3090
+ `);
3091
+ }
3092
+ B(), x?.();
3093
+ }
3091
3094
  };
3092
3095
  return {
3093
3096
  start: P,
3094
- stop: (e = "") => a(e, 0),
3097
+ stop: (e = "") => m(e, 0),
3095
3098
  message: (e = "") => {
3096
- s = C(e ?? s);
3099
+ r = L(e ?? r);
3097
3100
  },
3098
- cancel: (e = "") => a(e, 1),
3099
- error: (e = "") => a(e, 2),
3100
- clear: () => a("", 0, true),
3101
+ cancel: (e = "") => m(e, 1),
3102
+ error: (e = "") => m(e, 2),
3103
+ clear: () => m("", 0, true),
3101
3104
  get isCancelled() {
3102
- return S;
3105
+ return l;
3103
3106
  }
3104
3107
  };
3105
3108
  };
@@ -3145,7 +3148,9 @@ function progress({
3145
3148
  error: r.error,
3146
3149
  clear: r.clear,
3147
3150
  advance: g,
3148
- isCancelled: r.isCancelled,
3151
+ get isCancelled() {
3152
+ return r.isCancelled;
3153
+ },
3149
3154
  message: (t) => g(0, t)
3150
3155
  };
3151
3156
  }
@@ -3211,7 +3216,7 @@ ${styleText("gray", S_BAR)}` : ""}`;
3211
3216
  }
3212
3217
  default: {
3213
3218
  const r = n ? `${styleText("cyan", S_BAR)} ` : "", a = u.split(`
3214
- `).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], f = p.join(`
3219
+ `).length, p = d ? formatInstructionFooter(t.output, SELECT_INSTRUCTIONS, n) : n ? [styleText("cyan", S_BAR_END)] : [], f = p.join(`
3215
3220
  `), b = p.length + 1;
3216
3221
  return `${u}${r}${limitOptions({
3217
3222
  output: t.output,
@@ -3231,36 +3236,36 @@ ${f}
3231
3236
  }).prompt();
3232
3237
  };
3233
3238
 
3234
- const selectKey = (t) => {
3239
+ const selectKey = (i) => {
3235
3240
  const c = (e, a = "inactive") => {
3236
3241
  if (e === void 0)
3237
3242
  return "";
3238
3243
  const n = e.label ?? String(e.value);
3239
- return a === "selected" ? `${styleText("dim", n)}` : a === "cancelled" ? `${styleText(["strikethrough", "dim"], n)}` : a === "active" ? `${styleText(["bgCyan", "gray"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : `${styleText(["gray", "bgWhite", "inverse"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}`;
3244
+ return a === "disabled" ? `${styleText("dim", ` ${e.value} `)} ${styleText("gray", n)}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : a === "selected" ? `${styleText("dim", n)}` : a === "cancelled" ? `${styleText(["strikethrough", "dim"], n)}` : a === "active" ? `${styleText(["bgCyan", "gray"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : `${styleText(["gray", "bgWhite", "inverse"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}`;
3240
3245
  };
3241
- return new u$3({
3242
- options: t.options,
3243
- signal: t.signal,
3244
- input: t.input,
3245
- output: t.output,
3246
- initialValue: t.initialValue,
3247
- caseSensitive: t.caseSensitive,
3246
+ return new c$2({
3247
+ options: i.options,
3248
+ signal: i.signal,
3249
+ input: i.input,
3250
+ output: i.output,
3251
+ initialValue: i.initialValue,
3252
+ caseSensitive: i.caseSensitive,
3248
3253
  render() {
3249
- const e = t.withGuide ?? settings.withGuide, a = `${e ? `${styleText("gray", S_BAR)}
3250
- ` : ""}${symbol(this.state)} ${t.message}
3254
+ const e = i.withGuide ?? settings.withGuide, a = `${e ? `${styleText("gray", S_BAR)}
3255
+ ` : ""}${symbol(this.state)} ${i.message}
3251
3256
  `;
3252
3257
  switch (this.state) {
3253
3258
  case "submit": {
3254
- const n = e ? `${styleText("gray", S_BAR)} ` : "", r = this.options.find((u) => u.value === this.value) ?? t.options[0], l = wrapTextWithPrefix(
3255
- t.output,
3259
+ const n = e ? `${styleText("gray", S_BAR)} ` : "", r = this.options.find((l) => l.value === this.value) ?? i.options[0], u = wrapTextWithPrefix(
3260
+ i.output,
3256
3261
  c(r, "selected"),
3257
3262
  n
3258
3263
  );
3259
- return `${a}${l}`;
3264
+ return `${a}${u}`;
3260
3265
  }
3261
3266
  case "cancel": {
3262
3267
  const n = e ? `${styleText("gray", S_BAR)} ` : "", r = wrapTextWithPrefix(
3263
- t.output,
3268
+ i.output,
3264
3269
  c(this.options[0], "cancelled"),
3265
3270
  n
3266
3271
  );
@@ -3268,15 +3273,18 @@ const selectKey = (t) => {
3268
3273
  ${styleText("gray", S_BAR)}` : ""}`;
3269
3274
  }
3270
3275
  default: {
3271
- const n = e ? `${styleText("cyan", S_BAR)} ` : "", r = e ? styleText("cyan", S_BAR_END) : "", l = this.options.map(
3272
- (u, d) => wrapTextWithPrefix(
3273
- t.output,
3274
- c(u, d === this.cursor ? "active" : "inactive"),
3276
+ const n = e ? `${styleText("cyan", S_BAR)} ` : "", r = e ? styleText("cyan", S_BAR_END) : "", u = this.options.map(
3277
+ (l, $) => wrapTextWithPrefix(
3278
+ i.output,
3279
+ c(
3280
+ l,
3281
+ l.disabled ? "disabled" : $ === this.cursor ? "active" : "inactive"
3282
+ ),
3275
3283
  n
3276
3284
  )
3277
3285
  ).join(`
3278
3286
  `);
3279
- return `${a}${l}
3287
+ return `${a}${u}
3280
3288
  ${r}
3281
3289
  `;
3282
3290
  }
@@ -3354,7 +3362,7 @@ ${t.header}`);
3354
3362
  `).reduce((b, w) => w === "" ? b + 1 : b + Math.ceil((w.length + k) / O), 0);
3355
3363
  s += E;
3356
3364
  }
3357
- s > 0 && (s += 1, r.write(srcExports.erase.lines(s)));
3365
+ s > 0 && (s += 1, r.write(erase.lines(s)));
3358
3366
  }, h = (e, s, t) => {
3359
3367
  const o = t ? `${e.full}
3360
3368
  ${e.value}` : e.value;