@kubb/core 3.0.0-alpha.9 → 3.0.0-beta.2

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.
Files changed (91) hide show
  1. package/README.md +14 -5
  2. package/dist/{FileManager-B0GJlthB.d.cts → FileManager-C9aZTwst.d.ts} +94 -77
  3. package/dist/{FileManager-BFycBDqG.d.ts → FileManager-ibNoWwHN.d.cts} +94 -77
  4. package/dist/chunk-2EU7DMPM.js +2 -3
  5. package/dist/chunk-2EU7DMPM.js.map +1 -1
  6. package/dist/{chunk-DID47EQD.cjs → chunk-2TOEDZ2U.cjs} +6 -7
  7. package/dist/chunk-2TOEDZ2U.cjs.map +1 -0
  8. package/dist/{chunk-A6PCLWEY.cjs → chunk-4GJEWGQN.cjs} +30 -31
  9. package/dist/chunk-4GJEWGQN.cjs.map +1 -0
  10. package/dist/{chunk-SEH6NUCX.cjs → chunk-72BWXKV4.cjs} +10 -10
  11. package/dist/chunk-72BWXKV4.cjs.map +1 -0
  12. package/dist/{chunk-4X5FFJPJ.js → chunk-BQXM32UO.js} +11 -16
  13. package/dist/chunk-BQXM32UO.js.map +1 -0
  14. package/dist/{chunk-27CPVXAT.js → chunk-DXGMSPTW.js} +174 -231
  15. package/dist/chunk-DXGMSPTW.js.map +1 -0
  16. package/dist/{chunk-SCR3LUXT.js → chunk-E6CN2CZC.js} +38 -27
  17. package/dist/chunk-E6CN2CZC.js.map +1 -0
  18. package/dist/chunk-HBQM723K.js +12 -26
  19. package/dist/chunk-HBQM723K.js.map +1 -1
  20. package/dist/{chunk-5E2I6KH4.cjs → chunk-KXT7F2WS.cjs} +54 -37
  21. package/dist/chunk-KXT7F2WS.cjs.map +1 -0
  22. package/dist/{chunk-IPZQXBA2.cjs → chunk-MVWRVN66.cjs} +57 -34
  23. package/dist/chunk-MVWRVN66.cjs.map +1 -0
  24. package/dist/{chunk-5IGANEGE.cjs → chunk-SQBOUPF4.cjs} +268 -301
  25. package/dist/chunk-SQBOUPF4.cjs.map +1 -0
  26. package/dist/index.cjs +223 -241
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +4 -6
  29. package/dist/index.d.ts +4 -6
  30. package/dist/index.js +106 -148
  31. package/dist/index.js.map +1 -1
  32. package/dist/{logger-BWFeedRk.d.cts → logger-DvbHXjIO.d.cts} +10 -8
  33. package/dist/{logger-BWFeedRk.d.ts → logger-DvbHXjIO.d.ts} +10 -8
  34. package/dist/logger.cjs +25 -14
  35. package/dist/logger.cjs.map +1 -1
  36. package/dist/logger.d.cts +1 -1
  37. package/dist/logger.d.ts +1 -1
  38. package/dist/logger.js +3 -13
  39. package/dist/logger.js.map +1 -1
  40. package/dist/mocks.cjs +29 -24
  41. package/dist/mocks.cjs.map +1 -1
  42. package/dist/mocks.d.cts +4 -3
  43. package/dist/mocks.d.ts +4 -3
  44. package/dist/mocks.js +22 -25
  45. package/dist/mocks.js.map +1 -1
  46. package/dist/{prompt-DVQN7JTN.cjs → prompt-FODZPXQF.cjs} +89 -89
  47. package/dist/prompt-FODZPXQF.cjs.map +1 -0
  48. package/dist/prompt-WQQUN22Z.js +8 -13
  49. package/dist/prompt-WQQUN22Z.js.map +1 -1
  50. package/dist/transformers.cjs +63 -52
  51. package/dist/transformers.cjs.map +1 -1
  52. package/dist/transformers.d.cts +1 -1
  53. package/dist/transformers.d.ts +1 -1
  54. package/dist/transformers.js +10 -37
  55. package/dist/transformers.js.map +1 -1
  56. package/dist/utils.cjs +65 -34
  57. package/dist/utils.cjs.map +1 -1
  58. package/dist/utils.d.cts +6 -8
  59. package/dist/utils.d.ts +6 -8
  60. package/dist/utils.js +3 -33
  61. package/dist/utils.js.map +1 -1
  62. package/package.json +10 -13
  63. package/src/BarrelManager.ts +76 -74
  64. package/src/FileManager.ts +55 -60
  65. package/src/PluginManager.ts +61 -61
  66. package/src/PromiseManager.ts +1 -1
  67. package/src/__snapshots__/barrel.json +11 -29
  68. package/src/__snapshots__/grouped.json +18 -12
  69. package/src/__snapshots__/ordered.json +18 -12
  70. package/src/build.ts +24 -11
  71. package/src/config.ts +2 -4
  72. package/src/index.ts +1 -1
  73. package/src/logger.ts +41 -7
  74. package/src/plugin.ts +0 -3
  75. package/src/transformers/escape.ts +0 -10
  76. package/src/transformers/stringify.ts +1 -1
  77. package/src/types.ts +70 -38
  78. package/src/utils/TreeNode.ts +31 -56
  79. package/src/utils/executeStrategies.ts +2 -2
  80. package/src/utils/parser.ts +38 -39
  81. package/dist/chunk-27CPVXAT.js.map +0 -1
  82. package/dist/chunk-4X5FFJPJ.js.map +0 -1
  83. package/dist/chunk-5E2I6KH4.cjs.map +0 -1
  84. package/dist/chunk-5IGANEGE.cjs.map +0 -1
  85. package/dist/chunk-A6PCLWEY.cjs.map +0 -1
  86. package/dist/chunk-DID47EQD.cjs.map +0 -1
  87. package/dist/chunk-IPZQXBA2.cjs.map +0 -1
  88. package/dist/chunk-SCR3LUXT.js.map +0 -1
  89. package/dist/chunk-SEH6NUCX.cjs.map +0 -1
  90. package/dist/prompt-DVQN7JTN.cjs.map +0 -1
  91. package/src/utils/cache.ts +0 -35
package/dist/mocks.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ResolvedFile, File } from '@kubb/fs/types';
2
- import { a as PluginManager } from './FileManager-BFycBDqG.js';
3
- import { L as Logger } from './logger-BWFeedRk.js';
2
+ import { a as PluginManager } from './FileManager-C9aZTwst.js';
3
+ import { L as Logger } from './logger-DvbHXjIO.js';
4
4
  import '@kubb/fs';
5
5
  import '@kubb/types';
6
6
  import 'consola';
7
7
 
8
8
  declare const mockedLogger: Logger;
9
+ declare const createMockedPluginManager: (name?: string) => PluginManager;
9
10
  declare const mockedPluginManager: PluginManager;
10
11
  declare function matchFiles(files: Array<ResolvedFile | File> | undefined): Promise<undefined>;
11
12
 
12
- export { matchFiles, mockedLogger, mockedPluginManager };
13
+ export { createMockedPluginManager, matchFiles, mockedLogger, mockedPluginManager };
package/dist/mocks.js CHANGED
@@ -1,12 +1,7 @@
1
- import {
2
- getSource
3
- } from "./chunk-27CPVXAT.js";
4
- import {
5
- camelCase,
6
- pascalCase
7
- } from "./chunk-4X5FFJPJ.js";
1
+ import { getSource, createFile } from './chunk-DXGMSPTW.js';
2
+ import { camelCase, pascalCase } from './chunk-BQXM32UO.js';
3
+ import path from 'node:path';
8
4
 
9
- // mocks/index.ts
10
5
  var mockedLogger = {
11
6
  emit(type, message) {
12
7
  },
@@ -14,15 +9,18 @@ var mockedLogger = {
14
9
  },
15
10
  consola: {}
16
11
  };
17
- var mockedPluginManager = {
18
- resolveName: ({ name, type }) => {
19
- if (type === "type") {
20
- return pascalCase(name);
12
+ var createMockedPluginManager = (name) => ({
13
+ resolveName: (result) => {
14
+ if (result.type === "file") {
15
+ return camelCase(name || result.name);
21
16
  }
22
- if (type === "function") {
23
- return camelCase(name);
17
+ if (result.type === "type") {
18
+ return pascalCase(result.name);
24
19
  }
25
- return camelCase(name);
20
+ if (result.type === "function") {
21
+ return camelCase(result.name);
22
+ }
23
+ return camelCase(result.name);
26
24
  },
27
25
  config: {
28
26
  output: {
@@ -38,8 +36,8 @@ var mockedPluginManager = {
38
36
  },
39
37
  logLevel: 3
40
38
  },
41
- getFile: ({ name, extName, pluginKey }) => {
42
- const baseName = `${name}${extName}`;
39
+ getFile: ({ name: name2, extname, pluginKey }) => {
40
+ const baseName = `${name2}${extname}`;
43
41
  return {
44
42
  path: baseName,
45
43
  baseName,
@@ -48,19 +46,18 @@ var mockedPluginManager = {
48
46
  }
49
47
  };
50
48
  }
51
- };
49
+ });
50
+ var mockedPluginManager = createMockedPluginManager("");
52
51
  async function matchFiles(files) {
53
52
  if (!files) {
54
53
  return void 0;
55
54
  }
56
55
  for (const file of files) {
57
- const source = await getSource(file, { logger: mockedLogger });
58
- expect(source).toMatchSnapshot();
56
+ const source = await getSource(createFile(file), { logger: mockedLogger });
57
+ expect(source).toMatchFileSnapshot(path.join("__snapshots__", file.path));
59
58
  }
60
59
  }
61
- export {
62
- matchFiles,
63
- mockedLogger,
64
- mockedPluginManager
65
- };
60
+
61
+ export { createMockedPluginManager, matchFiles, mockedLogger, mockedPluginManager };
62
+ //# sourceMappingURL=mocks.js.map
66
63
  //# sourceMappingURL=mocks.js.map
package/dist/mocks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../mocks/index.ts"],"sourcesContent":["import { camelCase, pascalCase } from '../src/transformers/casing.ts'\n\nimport type { File, ResolvedFile } from '@kubb/fs/types'\nimport { getSource } from '../src/FileManager'\nimport type { PluginManager } from '../src/PluginManager.ts'\nimport type { Logger } from '../src/logger'\n\nexport const mockedLogger = {\n emit(type, message) {},\n on(type, message) {},\n consola: {},\n} as Logger\n\nexport const mockedPluginManager = {\n resolveName: ({ name, type }) => {\n if (type === 'type') {\n return pascalCase(name)\n }\n\n if (type === 'function') {\n return camelCase(name)\n }\n\n return camelCase(name)\n },\n config: {\n output: {\n path: './path',\n },\n },\n resolvePath: ({ baseName }) => baseName,\n logger: {\n emit(message) {\n console.log(message)\n },\n on(eventName, args) {},\n logLevel: 3,\n },\n getFile: ({ name, extName, pluginKey }) => {\n const baseName = `${name}${extName}`\n\n return {\n path: baseName,\n baseName,\n meta: {\n pluginKey,\n },\n }\n },\n} as PluginManager\n\nexport async function matchFiles(files: Array<ResolvedFile | File> | undefined) {\n if (!files) {\n return undefined\n }\n\n for (const file of files) {\n const source = await getSource(file as ResolvedFile, { logger: mockedLogger })\n expect(source).toMatchSnapshot()\n }\n}\n"],"mappings":";;;;;;;;;AAOO,IAAM,eAAe;AAAA,EAC1B,KAAK,MAAM,SAAS;AAAA,EAAC;AAAA,EACrB,GAAG,MAAM,SAAS;AAAA,EAAC;AAAA,EACnB,SAAS,CAAC;AACZ;AAEO,IAAM,sBAAsB;AAAA,EACjC,aAAa,CAAC,EAAE,MAAM,KAAK,MAAM;AAC/B,QAAI,SAAS,QAAQ;AACnB,aAAO,WAAW,IAAI;AAAA,IACxB;AAEA,QAAI,SAAS,YAAY;AACvB,aAAO,UAAU,IAAI;AAAA,IACvB;AAEA,WAAO,UAAU,IAAI;AAAA,EACvB;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,aAAa,CAAC,EAAE,SAAS,MAAM;AAAA,EAC/B,QAAQ;AAAA,IACN,KAAK,SAAS;AACZ,cAAQ,IAAI,OAAO;AAAA,IACrB;AAAA,IACA,GAAG,WAAW,MAAM;AAAA,IAAC;AAAA,IACrB,UAAU;AAAA,EACZ;AAAA,EACA,SAAS,CAAC,EAAE,MAAM,SAAS,UAAU,MAAM;AACzC,UAAM,WAAW,GAAG,IAAI,GAAG,OAAO;AAElC,WAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,MACA,MAAM;AAAA,QACJ;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,eAAsB,WAAW,OAA+C;AAC9E,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,aAAW,QAAQ,OAAO;AACxB,UAAM,SAAS,MAAM,UAAU,MAAsB,EAAE,QAAQ,aAAa,CAAC;AAC7E,WAAO,MAAM,EAAE,gBAAgB;AAAA,EACjC;AACF;","names":[]}
1
+ {"version":3,"sources":["../mocks/index.ts"],"names":["name"],"mappings":";;;;AASO,IAAM,YAAe,GAAA;AAAA,EAC1B,IAAA,CAAK,MAAM,OAAS,EAAA;AAAA,GAAC;AAAA,EACrB,EAAA,CAAG,MAAM,OAAS,EAAA;AAAA,GAAC;AAAA,EACnB,SAAS,EAAC;AACZ,EAAA;AAEa,IAAA,yBAAA,GAA4B,CAAC,IACvC,MAAA;AAAA,EACC,WAAA,EAAa,CAAC,MAAW,KAAA;AACvB,IAAI,IAAA,MAAA,CAAO,SAAS,MAAQ,EAAA;AAC1B,MAAO,OAAA,SAAA,CAAU,IAAQ,IAAA,MAAA,CAAO,IAAI,CAAA,CAAA;AAAA,KACtC;AAEA,IAAI,IAAA,MAAA,CAAO,SAAS,MAAQ,EAAA;AAC1B,MAAO,OAAA,UAAA,CAAW,OAAO,IAAI,CAAA,CAAA;AAAA,KAC/B;AAEA,IAAI,IAAA,MAAA,CAAO,SAAS,UAAY,EAAA;AAC9B,MAAO,OAAA,SAAA,CAAU,OAAO,IAAI,CAAA,CAAA;AAAA,KAC9B;AAEA,IAAO,OAAA,SAAA,CAAU,OAAO,IAAI,CAAA,CAAA;AAAA,GAC9B;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,QAAA;AAAA,KACR;AAAA,GACF;AAAA,EACA,WAAa,EAAA,CAAC,EAAE,QAAA,EAAe,KAAA,QAAA;AAAA,EAC/B,MAAQ,EAAA;AAAA,IACN,KAAK,OAAS,EAAA;AACZ,MAAA,OAAA,CAAQ,IAAI,OAAO,CAAA,CAAA;AAAA,KACrB;AAAA,IACA,EAAA,CAAG,WAAW,IAAM,EAAA;AAAA,KAAC;AAAA,IACrB,QAAU,EAAA,CAAA;AAAA,GACZ;AAAA,EACA,SAAS,CAAC,EAAE,MAAAA,KAAM,EAAA,OAAA,EAAS,WAAgB,KAAA;AACzC,IAAA,MAAM,QAAW,GAAA,CAAA,EAAGA,KAAI,CAAA,EAAG,OAAO,CAAA,CAAA,CAAA;AAElC,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,QAAA;AAAA,MACN,QAAA;AAAA,MACA,IAAM,EAAA;AAAA,QACJ,SAAA;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAA,EAAA;AAEW,IAAA,mBAAA,GAAsB,0BAA0B,EAAE,EAAA;AAE/D,eAAsB,WAAW,KAA+C,EAAA;AAC9E,EAAA,IAAI,CAAC,KAAO,EAAA;AACV,IAAO,OAAA,KAAA,CAAA,CAAA;AAAA,GACT;AAEA,EAAA,KAAA,MAAW,QAAQ,KAAO,EAAA;AACxB,IAAM,MAAA,MAAA,GAAS,MAAM,SAAU,CAAA,UAAA,CAAW,IAAI,CAAG,EAAA,EAAE,MAAQ,EAAA,YAAA,EAAc,CAAA,CAAA;AACzE,IAAO,MAAA,CAAA,MAAM,EAAE,mBAAoB,CAAA,IAAA,CAAK,KAAK,eAAiB,EAAA,IAAA,CAAK,IAAI,CAAC,CAAA,CAAA;AAAA,GAC1E;AACF","file":"mocks.js","sourcesContent":["import { camelCase, pascalCase } from '../src/transformers/casing.ts'\n\nimport path from 'node:path'\nimport type { File, ResolvedFile } from '@kubb/fs/types'\nimport { getSource } from '../src/FileManager'\nimport type { PluginManager } from '../src/PluginManager.ts'\nimport type { Logger } from '../src/logger'\nimport { createFile } from '../src/utils'\n\nexport const mockedLogger = {\n emit(type, message) {},\n on(type, message) {},\n consola: {},\n} as Logger\n\nexport const createMockedPluginManager = (name?: string) =>\n ({\n resolveName: (result) => {\n if (result.type === 'file') {\n return camelCase(name || result.name)\n }\n\n if (result.type === 'type') {\n return pascalCase(result.name)\n }\n\n if (result.type === 'function') {\n return camelCase(result.name)\n }\n\n return camelCase(result.name)\n },\n config: {\n output: {\n path: './path',\n },\n },\n resolvePath: ({ baseName }) => baseName,\n logger: {\n emit(message) {\n console.log(message)\n },\n on(eventName, args) {},\n logLevel: 3,\n },\n getFile: ({ name, extname, pluginKey }) => {\n const baseName = `${name}${extname}`\n\n return {\n path: baseName,\n baseName,\n meta: {\n pluginKey,\n },\n }\n },\n }) as PluginManager\n\nexport const mockedPluginManager = createMockedPluginManager('')\n\nexport async function matchFiles(files: Array<ResolvedFile | File> | undefined) {\n if (!files) {\n return undefined\n }\n\n for (const file of files) {\n const source = await getSource(createFile(file), { logger: mockedLogger })\n expect(source).toMatchFileSnapshot(path.join('__snapshots__', file.path))\n }\n}\n"]}
@@ -1,20 +1,20 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
1
+ 'use strict';
2
2
 
3
+ var chunkKXT7F2WS_cjs = require('./chunk-KXT7F2WS.cjs');
4
+ var chunk72BWXKV4_cjs = require('./chunk-72BWXKV4.cjs');
5
+ var process$1 = require('process');
6
+ var f = require('readline');
7
+ var require$$0 = require('tty');
8
+ require('util');
9
+ require('path');
3
10
 
11
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
4
12
 
5
- var _chunk5E2I6KH4cjs = require('./chunk-5E2I6KH4.cjs');
6
-
7
-
8
- var _chunkSEH6NUCXcjs = require('./chunk-SEH6NUCX.cjs');
13
+ var f__default = /*#__PURE__*/_interopDefault(f);
14
+ var require$$0__default = /*#__PURE__*/_interopDefault(require$$0);
9
15
 
10
16
  // ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
11
- _chunkSEH6NUCXcjs.init_cjs_shims.call(void 0, );
12
- var _process = require('process');
13
- var _readline = require('readline'); var _readline2 = _interopRequireDefault(_readline);
14
- var _tty = require('tty'); var _tty2 = _interopRequireDefault(_tty);
15
-
16
- require('util');
17
- require('path');
17
+ chunk72BWXKV4_cjs.init_cjs_shims();
18
18
  var ESC = "\x1B";
19
19
  var CSI = `${ESC}[`;
20
20
  var beep = "\x07";
@@ -65,7 +65,7 @@ var erase = {
65
65
  };
66
66
  var src = { cursor, scroll, erase, beep };
67
67
  var picocolors = { exports: {} };
68
- var tty = _tty2.default;
68
+ var tty = require$$0__default.default;
69
69
  var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
70
70
  var formatter = (open, close, replace = open) => (input) => {
71
71
  let string = "" + input;
@@ -109,7 +109,7 @@ var createColors = (enabled = isColorSupported) => ({
109
109
  picocolors.exports = createColors();
110
110
  picocolors.exports.createColors = createColors;
111
111
  var picocolorsExports = picocolors.exports;
112
- var l = /* @__PURE__ */ _chunk5E2I6KH4cjs.getDefaultExportFromCjs.call(void 0, picocolorsExports);
112
+ var l = /* @__PURE__ */ chunkKXT7F2WS_cjs.getDefaultExportFromCjs(picocolorsExports);
113
113
  function z({ onlyFirst: t = false } = {}) {
114
114
  const u = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
115
115
  return new RegExp(u, t ? void 0 : "g");
@@ -309,14 +309,14 @@ function g(t, u) {
309
309
  var V = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
310
310
  var tD = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
311
311
  var h = class {
312
- constructor({ render: u, input: F = _process.stdin, output: e = _process.stdout, ...s2 }, C = true) {
312
+ constructor({ render: u, input: F = process$1.stdin, output: e = process$1.stdout, ...s2 }, C = true) {
313
313
  this._track = false, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = /* @__PURE__ */ new Map(), this._prevFrame = "", this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
314
314
  }
315
315
  prompt() {
316
- const u = new (0, _tty.WriteStream)(0);
316
+ const u = new require$$0.WriteStream(0);
317
317
  return u._write = (F, e, s2) => {
318
318
  this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
319
- }, this.input.pipe(u), this.rl = _readline2.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), _readline2.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
319
+ }, this.input.pipe(u), this.rl = f__default.default.createInterface({ input: this.input, output: u, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), f__default.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), g(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F, e) => {
320
320
  this.once("submit", () => {
321
321
  this.output.write(src.cursor.show), this.output.off("resize", this.render), g(this.input, false), F(this.value);
322
322
  }), this.once("cancel", () => {
@@ -325,15 +325,15 @@ var h = class {
325
325
  });
326
326
  }
327
327
  on(u, F) {
328
- const e = _nullishCoalesce(this.subscribers.get(u), () => ( []));
328
+ const e = this.subscribers.get(u) ?? [];
329
329
  e.push({ cb: F }), this.subscribers.set(u, e);
330
330
  }
331
331
  once(u, F) {
332
- const e = _nullishCoalesce(this.subscribers.get(u), () => ( []));
332
+ const e = this.subscribers.get(u) ?? [];
333
333
  e.push({ cb: F, once: true }), this.subscribers.set(u, e);
334
334
  }
335
335
  emit(u, ...F) {
336
- const e = _nullishCoalesce(this.subscribers.get(u), () => ( [])), s2 = [];
336
+ const e = this.subscribers.get(u) ?? [], s2 = [];
337
337
  for (const C of e) C.cb(...F), C.once && s2.push(() => e.splice(e.indexOf(C), 1));
338
338
  for (const C of s2) C();
339
339
  }
@@ -341,7 +341,7 @@ var h = class {
341
341
  this.subscribers.clear();
342
342
  }
343
343
  onKeypress(u, F) {
344
- if (this.state === "error" && (this.state = "active"), _optionalChain([F, 'optionalAccess', _2 => _2.name]) && !this._track && V.has(F.name) && this.emit("cursor", V.get(F.name)), _optionalChain([F, 'optionalAccess', _3 => _3.name]) && tD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), _optionalChain([F, 'optionalAccess', _4 => _4.name]) === "return") {
344
+ if (this.state === "error" && (this.state = "active"), F?.name && !this._track && V.has(F.name) && this.emit("cursor", V.get(F.name)), F?.name && tD.has(F.name) && this.emit("cursor", F.name), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u && this.emit("key", u.toLowerCase()), F?.name === "return") {
345
345
  if (this.opts.validate) {
346
346
  const e = this.opts.validate(this.value);
347
347
  e && (this.error = e, this.state = "error", this.rl.write(this.value));
@@ -360,19 +360,19 @@ var h = class {
360
360
  this.output.write(src.cursor.move(-999, u * -1));
361
361
  }
362
362
  render() {
363
- const u = P(_nullishCoalesce(this._render(this), () => ( "")), process.stdout.columns, { hard: true });
363
+ const u = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
364
364
  if (u !== this._prevFrame) {
365
365
  if (this.state === "initial") this.output.write(src.cursor.hide);
366
366
  else {
367
367
  const F = FD(this._prevFrame, u);
368
- if (this.restoreCursor(), F && _optionalChain([F, 'optionalAccess', _5 => _5.length]) === 1) {
368
+ if (this.restoreCursor(), F && F?.length === 1) {
369
369
  const e = F[0];
370
370
  this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.lines(1));
371
371
  const s2 = u.split(`
372
372
  `);
373
373
  this.output.write(s2[e]), this._prevFrame = u, this.output.write(src.cursor.move(0, s2.length - e - 1));
374
374
  return;
375
- } else if (F && _optionalChain([F, 'optionalAccess', _6 => _6.length]) > 1) {
375
+ } else if (F && F?.length > 1) {
376
376
  const e = F[0];
377
377
  this.output.write(src.cursor.move(0, e)), this.output.write(src.erase.down());
378
378
  const C = u.split(`
@@ -406,7 +406,7 @@ var sD = class extends h {
406
406
  };
407
407
  var iD = class extends h {
408
408
  constructor(u) {
409
- super(u, false), this.cursor = 0, this.options = u.options, this.value = [..._nullishCoalesce(u.initialValues, () => ( []))], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
409
+ super(u, false), this.cursor = 0, this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), 0), this.on("key", (F) => {
410
410
  F === "a" && this.toggleAll();
411
411
  }), this.on("cursor", (F) => {
412
412
  switch (F) {
@@ -475,7 +475,7 @@ var oD = class extends h {
475
475
  return this._cursor;
476
476
  }
477
477
  };
478
- var unicode = _chunk5E2I6KH4cjs.isUnicodeSupported.call(void 0, );
478
+ var unicode = chunkKXT7F2WS_cjs.isUnicodeSupported();
479
479
  var s = (c2, fallback) => unicode ? c2 : fallback;
480
480
  var S_STEP_ACTIVE = s("\u276F", ">");
481
481
  var S_STEP_CANCEL = s("\u25A0", "x");
@@ -492,16 +492,16 @@ var symbol = (state) => {
492
492
  switch (state) {
493
493
  case "initial":
494
494
  case "active": {
495
- return _chunk5E2I6KH4cjs.colors.cyan(S_STEP_ACTIVE);
495
+ return chunkKXT7F2WS_cjs.colors.cyan(S_STEP_ACTIVE);
496
496
  }
497
497
  case "cancel": {
498
- return _chunk5E2I6KH4cjs.colors.red(S_STEP_CANCEL);
498
+ return chunkKXT7F2WS_cjs.colors.red(S_STEP_CANCEL);
499
499
  }
500
500
  case "error": {
501
- return _chunk5E2I6KH4cjs.colors.yellow(S_STEP_ERROR);
501
+ return chunkKXT7F2WS_cjs.colors.yellow(S_STEP_ERROR);
502
502
  }
503
503
  case "submit": {
504
- return _chunk5E2I6KH4cjs.colors.green(S_STEP_SUBMIT);
504
+ return chunkKXT7F2WS_cjs.colors.green(S_STEP_SUBMIT);
505
505
  }
506
506
  }
507
507
  };
@@ -512,35 +512,35 @@ var text = (opts) => {
512
512
  defaultValue: opts.defaultValue,
513
513
  initialValue: opts.initialValue,
514
514
  render() {
515
- const title = `${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}
515
+ const title = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
516
516
  ${symbol(this.state)} ${opts.message}
517
517
  `;
518
- const placeholder = opts.placeholder ? _chunk5E2I6KH4cjs.colors.inverse(opts.placeholder[0]) + _chunk5E2I6KH4cjs.colors.dim(opts.placeholder.slice(1)) : _chunk5E2I6KH4cjs.colors.inverse(_chunk5E2I6KH4cjs.colors.hidden("_"));
518
+ const placeholder = opts.placeholder ? chunkKXT7F2WS_cjs.colors.inverse(opts.placeholder[0]) + chunkKXT7F2WS_cjs.colors.dim(opts.placeholder.slice(1)) : chunkKXT7F2WS_cjs.colors.inverse(chunkKXT7F2WS_cjs.colors.hidden("_"));
519
519
  const value = this.value ? this.valueWithCursor : placeholder;
520
520
  switch (this.state) {
521
521
  case "error": {
522
522
  return `${title.trim()}
523
- ${_chunk5E2I6KH4cjs.colors.yellow(
523
+ ${chunkKXT7F2WS_cjs.colors.yellow(
524
524
  S_BAR
525
525
  )} ${value}
526
- ${_chunk5E2I6KH4cjs.colors.yellow(S_BAR_END)} ${_chunk5E2I6KH4cjs.colors.yellow(
526
+ ${chunkKXT7F2WS_cjs.colors.yellow(S_BAR_END)} ${chunkKXT7F2WS_cjs.colors.yellow(
527
527
  this.error
528
528
  )}
529
529
  `;
530
530
  }
531
531
  case "submit": {
532
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${_chunk5E2I6KH4cjs.colors.dim(
532
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.dim(
533
533
  this.value || opts.placeholder
534
534
  )}`;
535
535
  }
536
536
  case "cancel": {
537
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${_chunk5E2I6KH4cjs.colors.strikethrough(
538
- _chunk5E2I6KH4cjs.colors.dim(_nullishCoalesce(this.value, () => ( "")))
539
- )}${_optionalChain([this, 'access', _7 => _7.value, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9()]) ? "\n" + _chunk5E2I6KH4cjs.colors.gray(S_BAR) : ""}`;
537
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.strikethrough(
538
+ chunkKXT7F2WS_cjs.colors.dim(this.value ?? "")
539
+ )}${this.value?.trim() ? "\n" + chunkKXT7F2WS_cjs.colors.gray(S_BAR) : ""}`;
540
540
  }
541
541
  default: {
542
- return `${title}${_chunk5E2I6KH4cjs.colors.cyan(S_BAR)} ${value}
543
- ${_chunk5E2I6KH4cjs.colors.cyan(
542
+ return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${value}
543
+ ${chunkKXT7F2WS_cjs.colors.cyan(
544
544
  S_BAR_END
545
545
  )}
546
546
  `;
@@ -550,30 +550,30 @@ ${_chunk5E2I6KH4cjs.colors.cyan(
550
550
  }).prompt();
551
551
  };
552
552
  var confirm = (opts) => {
553
- const active = _nullishCoalesce(opts.active, () => ( "Yes"));
554
- const inactive = _nullishCoalesce(opts.inactive, () => ( "No"));
553
+ const active = opts.active ?? "Yes";
554
+ const inactive = opts.inactive ?? "No";
555
555
  return new sD({
556
556
  active,
557
557
  inactive,
558
- initialValue: _nullishCoalesce(opts.initialValue, () => ( true)),
558
+ initialValue: opts.initialValue ?? true,
559
559
  render() {
560
- const title = `${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}
560
+ const title = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
561
561
  ${symbol(this.state)} ${opts.message}
562
562
  `;
563
563
  const value = this.value ? active : inactive;
564
564
  switch (this.state) {
565
565
  case "submit": {
566
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${_chunk5E2I6KH4cjs.colors.dim(value)}`;
566
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.dim(value)}`;
567
567
  }
568
568
  case "cancel": {
569
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${_chunk5E2I6KH4cjs.colors.strikethrough(
570
- _chunk5E2I6KH4cjs.colors.dim(value)
569
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${chunkKXT7F2WS_cjs.colors.strikethrough(
570
+ chunkKXT7F2WS_cjs.colors.dim(value)
571
571
  )}
572
- ${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}`;
572
+ ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}`;
573
573
  }
574
574
  default: {
575
- return `${title}${_chunk5E2I6KH4cjs.colors.cyan(S_BAR)} ${this.value ? `${_chunk5E2I6KH4cjs.colors.green(S_RADIO_ACTIVE)} ${active}` : `${_chunk5E2I6KH4cjs.colors.dim(S_RADIO_INACTIVE)} ${_chunk5E2I6KH4cjs.colors.dim(active)}`} ${_chunk5E2I6KH4cjs.colors.dim("/")} ${this.value ? `${_chunk5E2I6KH4cjs.colors.dim(S_RADIO_INACTIVE)} ${_chunk5E2I6KH4cjs.colors.dim(inactive)}` : `${_chunk5E2I6KH4cjs.colors.green(S_RADIO_ACTIVE)} ${inactive}`}
576
- ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR_END)}
575
+ return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${this.value ? `${chunkKXT7F2WS_cjs.colors.green(S_RADIO_ACTIVE)} ${active}` : `${chunkKXT7F2WS_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(active)}`} ${chunkKXT7F2WS_cjs.colors.dim("/")} ${this.value ? `${chunkKXT7F2WS_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(inactive)}` : `${chunkKXT7F2WS_cjs.colors.green(S_RADIO_ACTIVE)} ${inactive}`}
576
+ ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR_END)}
577
577
  `;
578
578
  }
579
579
  }
@@ -582,47 +582,47 @@ ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR_END)}
582
582
  };
583
583
  var select = (opts) => {
584
584
  const opt = (option, state) => {
585
- const label = _nullishCoalesce(option.label, () => ( String(option.value)));
585
+ const label = option.label ?? String(option.value);
586
586
  switch (state) {
587
587
  case "active": {
588
- return `${_chunk5E2I6KH4cjs.colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? _chunk5E2I6KH4cjs.colors.dim(`(${option.hint})`) : ""}`;
588
+ return `${chunkKXT7F2WS_cjs.colors.green(S_RADIO_ACTIVE)} ${label} ${option.hint ? chunkKXT7F2WS_cjs.colors.dim(`(${option.hint})`) : ""}`;
589
589
  }
590
590
  case "selected": {
591
- return `${_chunk5E2I6KH4cjs.colors.dim(label)}`;
591
+ return `${chunkKXT7F2WS_cjs.colors.dim(label)}`;
592
592
  }
593
593
  case "cancelled": {
594
- return `${_chunk5E2I6KH4cjs.colors.strikethrough(_chunk5E2I6KH4cjs.colors.dim(label))}`;
594
+ return `${chunkKXT7F2WS_cjs.colors.strikethrough(chunkKXT7F2WS_cjs.colors.dim(label))}`;
595
595
  }
596
596
  }
597
- return `${_chunk5E2I6KH4cjs.colors.dim(S_RADIO_INACTIVE)} ${_chunk5E2I6KH4cjs.colors.dim(label)}`;
597
+ return `${chunkKXT7F2WS_cjs.colors.dim(S_RADIO_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(label)}`;
598
598
  };
599
599
  return new ED({
600
600
  options: opts.options,
601
601
  initialValue: opts.initialValue,
602
602
  render() {
603
- const title = `${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}
603
+ const title = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
604
604
  ${symbol(this.state)} ${opts.message}
605
605
  `;
606
606
  switch (this.state) {
607
607
  case "submit": {
608
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${opt(
608
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${opt(
609
609
  this.options[this.cursor],
610
610
  "selected"
611
611
  )}`;
612
612
  }
613
613
  case "cancel": {
614
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${opt(
614
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${opt(
615
615
  this.options[this.cursor],
616
616
  "cancelled"
617
617
  )}
618
- ${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}`;
618
+ ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}`;
619
619
  }
620
620
  default: {
621
- return `${title}${_chunk5E2I6KH4cjs.colors.cyan(S_BAR)} ${this.options.map(
621
+ return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${this.options.map(
622
622
  (option, i) => opt(option, i === this.cursor ? "active" : "inactive")
623
623
  ).join(`
624
- ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR)} `)}
625
- ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR_END)}
624
+ ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} `)}
625
+ ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR_END)}
626
626
  `;
627
627
  }
628
628
  }
@@ -631,63 +631,63 @@ ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR_END)}
631
631
  };
632
632
  var multiselect = (opts) => {
633
633
  const opt = (option, state) => {
634
- const label = _nullishCoalesce(option.label, () => ( String(option.value)));
634
+ const label = option.label ?? String(option.value);
635
635
  switch (state) {
636
636
  case "active": {
637
- return `${_chunk5E2I6KH4cjs.colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? _chunk5E2I6KH4cjs.colors.dim(`(${option.hint})`) : ""}`;
637
+ return `${chunkKXT7F2WS_cjs.colors.cyan(S_CHECKBOX_ACTIVE)} ${label} ${option.hint ? chunkKXT7F2WS_cjs.colors.dim(`(${option.hint})`) : ""}`;
638
638
  }
639
639
  case "selected": {
640
- return `${_chunk5E2I6KH4cjs.colors.green(S_CHECKBOX_SELECTED)} ${_chunk5E2I6KH4cjs.colors.dim(label)}`;
640
+ return `${chunkKXT7F2WS_cjs.colors.green(S_CHECKBOX_SELECTED)} ${chunkKXT7F2WS_cjs.colors.dim(label)}`;
641
641
  }
642
642
  case "cancelled": {
643
- return `${_chunk5E2I6KH4cjs.colors.strikethrough(_chunk5E2I6KH4cjs.colors.dim(label))}`;
643
+ return `${chunkKXT7F2WS_cjs.colors.strikethrough(chunkKXT7F2WS_cjs.colors.dim(label))}`;
644
644
  }
645
645
  case "active-selected": {
646
- return `${_chunk5E2I6KH4cjs.colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? _chunk5E2I6KH4cjs.colors.dim(`(${option.hint})`) : ""}`;
646
+ return `${chunkKXT7F2WS_cjs.colors.green(S_CHECKBOX_SELECTED)} ${label} ${option.hint ? chunkKXT7F2WS_cjs.colors.dim(`(${option.hint})`) : ""}`;
647
647
  }
648
648
  case "submitted": {
649
- return `${_chunk5E2I6KH4cjs.colors.dim(label)}`;
649
+ return `${chunkKXT7F2WS_cjs.colors.dim(label)}`;
650
650
  }
651
651
  }
652
- return `${_chunk5E2I6KH4cjs.colors.dim(S_CHECKBOX_INACTIVE)} ${_chunk5E2I6KH4cjs.colors.dim(label)}`;
652
+ return `${chunkKXT7F2WS_cjs.colors.dim(S_CHECKBOX_INACTIVE)} ${chunkKXT7F2WS_cjs.colors.dim(label)}`;
653
653
  };
654
654
  return new iD({
655
655
  options: opts.options,
656
656
  initialValues: opts.initialValues,
657
- required: _nullishCoalesce(opts.required, () => ( true)),
657
+ required: opts.required ?? true,
658
658
  cursorAt: opts.cursorAt,
659
659
  validate(selected) {
660
660
  if (this.required && selected.length === 0) {
661
661
  return `Please select at least one option.
662
- ${_chunk5E2I6KH4cjs.colors.reset(
663
- _chunk5E2I6KH4cjs.colors.dim(
664
- `Press ${_chunk5E2I6KH4cjs.colors.gray(
665
- _chunk5E2I6KH4cjs.colors.bgWhite(_chunk5E2I6KH4cjs.colors.inverse(" space "))
666
- )} to select, ${_chunk5E2I6KH4cjs.colors.gray(
667
- _chunk5E2I6KH4cjs.colors.bgWhite(_chunk5E2I6KH4cjs.colors.inverse(" enter "))
662
+ ${chunkKXT7F2WS_cjs.colors.reset(
663
+ chunkKXT7F2WS_cjs.colors.dim(
664
+ `Press ${chunkKXT7F2WS_cjs.colors.gray(
665
+ chunkKXT7F2WS_cjs.colors.bgWhite(chunkKXT7F2WS_cjs.colors.inverse(" space "))
666
+ )} to select, ${chunkKXT7F2WS_cjs.colors.gray(
667
+ chunkKXT7F2WS_cjs.colors.bgWhite(chunkKXT7F2WS_cjs.colors.inverse(" enter "))
668
668
  )} to submit`
669
669
  )
670
670
  )}`;
671
671
  }
672
672
  },
673
673
  render() {
674
- const title = `${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}
674
+ const title = `${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}
675
675
  ${symbol(this.state)} ${opts.message}
676
676
  `;
677
677
  switch (this.state) {
678
678
  case "submit": {
679
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(_chunk5E2I6KH4cjs.colors.dim(", ")) || _chunk5E2I6KH4cjs.colors.dim("none")}`;
679
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "submitted")).join(chunkKXT7F2WS_cjs.colors.dim(", ")) || chunkKXT7F2WS_cjs.colors.dim("none")}`;
680
680
  }
681
681
  case "cancel": {
682
- const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(_chunk5E2I6KH4cjs.colors.dim(", "));
683
- return `${title}${_chunk5E2I6KH4cjs.colors.gray(S_BAR)} ${label.trim() ? `${label}
684
- ${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}` : ""}`;
682
+ const label = this.options.filter(({ value }) => this.value.includes(value)).map((option) => opt(option, "cancelled")).join(chunkKXT7F2WS_cjs.colors.dim(", "));
683
+ return `${title}${chunkKXT7F2WS_cjs.colors.gray(S_BAR)} ${label.trim() ? `${label}
684
+ ${chunkKXT7F2WS_cjs.colors.gray(S_BAR)}` : ""}`;
685
685
  }
686
686
  case "error": {
687
687
  const footer = this.error.split("\n").map(
688
- (ln, i) => i === 0 ? `${_chunk5E2I6KH4cjs.colors.yellow(S_BAR_END)} ${_chunk5E2I6KH4cjs.colors.yellow(ln)}` : ` ${ln}`
688
+ (ln, i) => i === 0 ? `${chunkKXT7F2WS_cjs.colors.yellow(S_BAR_END)} ${chunkKXT7F2WS_cjs.colors.yellow(ln)}` : ` ${ln}`
689
689
  ).join("\n");
690
- return title + _chunk5E2I6KH4cjs.colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
690
+ return title + chunkKXT7F2WS_cjs.colors.yellow(S_BAR) + " " + this.options.map((option, i) => {
691
691
  const selected = this.value.includes(option.value);
692
692
  const active = i === this.cursor;
693
693
  if (active && selected) {
@@ -698,10 +698,10 @@ ${_chunk5E2I6KH4cjs.colors.gray(S_BAR)}` : ""}`;
698
698
  }
699
699
  return opt(option, active ? "active" : "inactive");
700
700
  }).join(`
701
- ${_chunk5E2I6KH4cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
701
+ ${chunkKXT7F2WS_cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
702
702
  }
703
703
  default: {
704
- return `${title}${_chunk5E2I6KH4cjs.colors.cyan(S_BAR)} ${this.options.map((option, i) => {
704
+ return `${title}${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} ${this.options.map((option, i) => {
705
705
  const selected = this.value.includes(option.value);
706
706
  const active = i === this.cursor;
707
707
  if (active && selected) {
@@ -712,8 +712,8 @@ ${_chunk5E2I6KH4cjs.colors.yellow(S_BAR)} `) + "\n" + footer + "\n";
712
712
  }
713
713
  return opt(option, active ? "active" : "inactive");
714
714
  }).join(`
715
- ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR)} `)}
716
- ${_chunk5E2I6KH4cjs.colors.cyan(S_BAR_END)}
715
+ ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR)} `)}
716
+ ${chunkKXT7F2WS_cjs.colors.cyan(S_BAR_END)}
717
717
  `;
718
718
  }
719
719
  }
@@ -755,6 +755,6 @@ async function prompt(message, opts = {}) {
755
755
  throw new Error(`Unknown prompt type: ${opts.type}`);
756
756
  }
757
757
 
758
-
759
758
  exports.prompt = prompt;
760
- //# sourceMappingURL=prompt-DVQN7JTN.cjs.map
759
+ //# sourceMappingURL=prompt-FODZPXQF.cjs.map
760
+ //# sourceMappingURL=prompt-FODZPXQF.cjs.map