create-vue 3.21.1 → 3.22.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.
Files changed (31) hide show
  1. package/LICENSE +24 -24
  2. package/bundle.js +1559 -888
  3. package/locales/en-US.json +1 -1
  4. package/locales/fr-FR.json +1 -1
  5. package/locales/tr-TR.json +1 -1
  6. package/locales/zh-Hans.json +1 -1
  7. package/locales/zh-Hant.json +1 -1
  8. package/package.json +7 -7
  9. package/template/base/package.json +1 -1
  10. package/template/config/cypress/package.json +2 -2
  11. package/template/config/cypress-ct/package.json +2 -2
  12. package/template/config/jsx/package.json +1 -1
  13. package/template/config/nightwatch/package.json +1 -1
  14. package/template/config/nightwatch-ct/package.json +1 -1
  15. package/template/config/pinia/package.json +1 -1
  16. package/template/config/router/package.json +2 -2
  17. package/template/config/typescript/package.json +2 -2
  18. package/template/config/vitest/package.json +1 -1
  19. package/template/formatting/oxfmt/package.json +1 -1
  20. package/template/linting/base/package.json +1 -1
  21. package/template/linting/core/js/package.json +2 -2
  22. package/template/linting/core/ts/package.json +2 -2
  23. package/template/linting/cypress/package.json +1 -1
  24. package/template/linting/oxlint/package.json +2 -2
  25. package/template/linting/playwright/package.json +1 -1
  26. package/template/tsconfig/base/tsconfig.app.json +8 -2
  27. package/template/tsconfig/base/tsconfig.node.json +13 -4
  28. package/template/tsconfig/cypress-ct/tsconfig.cypress-ct.json +2 -0
  29. package/template/tsconfig/nightwatch-ct/tsconfig.app.json +8 -2
  30. package/template/tsconfig/vitest/package.json +1 -1
  31. package/template/tsconfig/vitest/tsconfig.vitest.json +11 -3
package/bundle.js CHANGED
@@ -1,14 +1,16 @@
1
1
  #!/usr/bin/env node
2
- /*! create-vue v3.21.1 | MIT */
2
+ /*! create-vue v3.22.0 | MIT */
3
3
  import { createRequire } from "node:module";
4
4
  import * as fs from "node:fs";
5
+ import { existsSync, lstatSync, readdirSync } from "node:fs";
5
6
  import * as path$1 from "node:path";
7
+ import { dirname, join } from "node:path";
6
8
  import { fileURLToPath, pathToFileURL } from "node:url";
7
9
  import { parseArgs, stripVTControlCharacters } from "node:util";
8
- import y, { stdin, stdout } from "node:process";
9
- import * as g from "node:readline";
10
- import O from "node:readline";
11
- import { Writable } from "node:stream";
10
+ import N, { stdin, stdout } from "node:process";
11
+ import * as k from "node:readline";
12
+ import ot from "node:readline";
13
+ import { ReadStream } from "node:tty";
12
14
  import * as path from "path";
13
15
 
14
16
  //#region \0rolldown/runtime.js
@@ -39,63 +41,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
41
  }) : target, mod));
40
42
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
43
 
42
- //#endregion
43
- //#region node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
44
- var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45
- const ESC = "\x1B";
46
- const CSI = `${ESC}[`;
47
- const beep = "\x07";
48
- const cursor = {
49
- to(x, y) {
50
- if (!y) return `${CSI}${x + 1}G`;
51
- return `${CSI}${y + 1};${x + 1}H`;
52
- },
53
- move(x, y) {
54
- let ret = "";
55
- if (x < 0) ret += `${CSI}${-x}D`;
56
- else if (x > 0) ret += `${CSI}${x}C`;
57
- if (y < 0) ret += `${CSI}${-y}A`;
58
- else if (y > 0) ret += `${CSI}${y}B`;
59
- return ret;
60
- },
61
- up: (count = 1) => `${CSI}${count}A`,
62
- down: (count = 1) => `${CSI}${count}B`,
63
- forward: (count = 1) => `${CSI}${count}C`,
64
- backward: (count = 1) => `${CSI}${count}D`,
65
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
66
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
67
- left: `${CSI}G`,
68
- hide: `${CSI}?25l`,
69
- show: `${CSI}?25h`,
70
- save: `${ESC}7`,
71
- restore: `${ESC}8`
72
- };
73
- const scroll = {
74
- up: (count = 1) => `${CSI}S`.repeat(count),
75
- down: (count = 1) => `${CSI}T`.repeat(count)
76
- };
77
- const erase = {
78
- screen: `${CSI}2J`,
79
- up: (count = 1) => `${CSI}1J`.repeat(count),
80
- down: (count = 1) => `${CSI}J`.repeat(count),
81
- line: `${CSI}2K`,
82
- lineEnd: `${CSI}K`,
83
- lineStart: `${CSI}1K`,
84
- lines(count) {
85
- let clear = "";
86
- for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
87
- if (count) clear += cursor.left;
88
- return clear;
89
- }
90
- };
91
- module.exports = {
92
- cursor,
93
- scroll,
94
- erase,
95
- beep
96
- };
97
- }));
98
-
99
44
  //#endregion
100
45
  //#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
101
46
  var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -166,273 +111,222 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
166
111
  }));
167
112
 
168
113
  //#endregion
169
- //#region node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
170
- var import_src = require_src();
171
- var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
172
- function DD({ onlyFirst: e = !1 } = {}) {
173
- const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
174
- return new RegExp(t, e ? void 0 : "g");
175
- }
176
- const uD = DD();
177
- function P$1(e) {
178
- if (typeof e != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
179
- return e.replace(uD, "");
180
- }
181
- function L$1(e) {
182
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
183
- }
184
- var W$1 = { exports: {} };
185
- (function(e) {
186
- var u = {};
187
- e.exports = u, u.eastAsianWidth = function(F) {
188
- var s = F.charCodeAt(0), i = F.length == 2 ? F.charCodeAt(1) : 0, D = s;
189
- return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D = s << 10 | i, D += 65536), D == 12288 || 65281 <= D && D <= 65376 || 65504 <= D && D <= 65510 ? "F" : D == 8361 || 65377 <= D && D <= 65470 || 65474 <= D && D <= 65479 || 65482 <= D && D <= 65487 || 65490 <= D && D <= 65495 || 65498 <= D && D <= 65500 || 65512 <= D && D <= 65518 ? "H" : 4352 <= D && D <= 4447 || 4515 <= D && D <= 4519 || 4602 <= D && D <= 4607 || 9001 <= D && D <= 9002 || 11904 <= D && D <= 11929 || 11931 <= D && D <= 12019 || 12032 <= D && D <= 12245 || 12272 <= D && D <= 12283 || 12289 <= D && D <= 12350 || 12353 <= D && D <= 12438 || 12441 <= D && D <= 12543 || 12549 <= D && D <= 12589 || 12593 <= D && D <= 12686 || 12688 <= D && D <= 12730 || 12736 <= D && D <= 12771 || 12784 <= D && D <= 12830 || 12832 <= D && D <= 12871 || 12880 <= D && D <= 13054 || 13056 <= D && D <= 19903 || 19968 <= D && D <= 42124 || 42128 <= D && D <= 42182 || 43360 <= D && D <= 43388 || 44032 <= D && D <= 55203 || 55216 <= D && D <= 55238 || 55243 <= D && D <= 55291 || 63744 <= D && D <= 64255 || 65040 <= D && D <= 65049 || 65072 <= D && D <= 65106 || 65108 <= D && D <= 65126 || 65128 <= D && D <= 65131 || 110592 <= D && D <= 110593 || 127488 <= D && D <= 127490 || 127504 <= D && D <= 127546 || 127552 <= D && D <= 127560 || 127568 <= D && D <= 127569 || 131072 <= D && D <= 194367 || 177984 <= D && D <= 196605 || 196608 <= D && D <= 262141 ? "W" : 32 <= D && D <= 126 || 162 <= D && D <= 163 || 165 <= D && D <= 166 || D == 172 || D == 175 || 10214 <= D && D <= 10221 || 10629 <= D && D <= 10630 ? "Na" : D == 161 || D == 164 || 167 <= D && D <= 168 || D == 170 || 173 <= D && D <= 174 || 176 <= D && D <= 180 || 182 <= D && D <= 186 || 188 <= D && D <= 191 || D == 198 || D == 208 || 215 <= D && D <= 216 || 222 <= D && D <= 225 || D == 230 || 232 <= D && D <= 234 || 236 <= D && D <= 237 || D == 240 || 242 <= D && D <= 243 || 247 <= D && D <= 250 || D == 252 || D == 254 || D == 257 || D == 273 || D == 275 || D == 283 || 294 <= D && D <= 295 || D == 299 || 305 <= D && D <= 307 || D == 312 || 319 <= D && D <= 322 || D == 324 || 328 <= D && D <= 331 || D == 333 || 338 <= D && D <= 339 || 358 <= D && D <= 359 || D == 363 || D == 462 || D == 464 || D == 466 || D == 468 || D == 470 || D == 472 || D == 474 || D == 476 || D == 593 || D == 609 || D == 708 || D == 711 || 713 <= D && D <= 715 || D == 717 || D == 720 || 728 <= D && D <= 731 || D == 733 || D == 735 || 768 <= D && D <= 879 || 913 <= D && D <= 929 || 931 <= D && D <= 937 || 945 <= D && D <= 961 || 963 <= D && D <= 969 || D == 1025 || 1040 <= D && D <= 1103 || D == 1105 || D == 8208 || 8211 <= D && D <= 8214 || 8216 <= D && D <= 8217 || 8220 <= D && D <= 8221 || 8224 <= D && D <= 8226 || 8228 <= D && D <= 8231 || D == 8240 || 8242 <= D && D <= 8243 || D == 8245 || D == 8251 || D == 8254 || D == 8308 || D == 8319 || 8321 <= D && D <= 8324 || D == 8364 || D == 8451 || D == 8453 || D == 8457 || D == 8467 || D == 8470 || 8481 <= D && D <= 8482 || D == 8486 || D == 8491 || 8531 <= D && D <= 8532 || 8539 <= D && D <= 8542 || 8544 <= D && D <= 8555 || 8560 <= D && D <= 8569 || D == 8585 || 8592 <= D && D <= 8601 || 8632 <= D && D <= 8633 || D == 8658 || D == 8660 || D == 8679 || D == 8704 || 8706 <= D && D <= 8707 || 8711 <= D && D <= 8712 || D == 8715 || D == 8719 || D == 8721 || D == 8725 || D == 8730 || 8733 <= D && D <= 8736 || D == 8739 || D == 8741 || 8743 <= D && D <= 8748 || D == 8750 || 8756 <= D && D <= 8759 || 8764 <= D && D <= 8765 || D == 8776 || D == 8780 || D == 8786 || 8800 <= D && D <= 8801 || 8804 <= D && D <= 8807 || 8810 <= D && D <= 8811 || 8814 <= D && D <= 8815 || 8834 <= D && D <= 8835 || 8838 <= D && D <= 8839 || D == 8853 || D == 8857 || D == 8869 || D == 8895 || D == 8978 || 9312 <= D && D <= 9449 || 9451 <= D && D <= 9547 || 9552 <= D && D <= 9587 || 9600 <= D && D <= 9615 || 9618 <= D && D <= 9621 || 9632 <= D && D <= 9633 || 9635 <= D && D <= 9641 || 9650 <= D && D <= 9651 || 9654 <= D && D <= 9655 || 9660 <= D && D <= 9661 || 9664 <= D && D <= 9665 || 9670 <= D && D <= 9672 || D == 9675 || 9678 <= D && D <= 9681 || 9698 <= D && D <= 9701 || D == 9711 || 9733 <= D && D <= 9734 || D == 9737 || 9742 <= D && D <= 9743 || 9748 <= D && D <= 9749 || D == 9756 || D == 9758 || D == 9792 || D == 9794 || 9824 <= D && D <= 9825 || 9827 <= D && D <= 9829 || 9831 <= D && D <= 9834 || 9836 <= D && D <= 9837 || D == 9839 || 9886 <= D && D <= 9887 || 9918 <= D && D <= 9919 || 9924 <= D && D <= 9933 || 9935 <= D && D <= 9953 || D == 9955 || 9960 <= D && D <= 9983 || D == 10045 || D == 10071 || 10102 <= D && D <= 10111 || 11093 <= D && D <= 11097 || 12872 <= D && D <= 12879 || 57344 <= D && D <= 63743 || 65024 <= D && D <= 65039 || D == 65533 || 127232 <= D && D <= 127242 || 127248 <= D && D <= 127277 || 127280 <= D && D <= 127337 || 127344 <= D && D <= 127386 || 917760 <= D && D <= 917999 || 983040 <= D && D <= 1048573 || 1048576 <= D && D <= 1114109 ? "A" : "N";
190
- }, u.characterLength = function(F) {
191
- var s = this.eastAsianWidth(F);
192
- return s == "F" || s == "W" || s == "A" ? 2 : 1;
114
+ //#region node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
115
+ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
116
+ const ESC = "\x1B";
117
+ const CSI = `${ESC}[`;
118
+ const beep = "\x07";
119
+ const cursor = {
120
+ to(x, y) {
121
+ if (!y) return `${CSI}${x + 1}G`;
122
+ return `${CSI}${y + 1};${x + 1}H`;
123
+ },
124
+ move(x, y) {
125
+ let ret = "";
126
+ if (x < 0) ret += `${CSI}${-x}D`;
127
+ else if (x > 0) ret += `${CSI}${x}C`;
128
+ if (y < 0) ret += `${CSI}${-y}A`;
129
+ else if (y > 0) ret += `${CSI}${y}B`;
130
+ return ret;
131
+ },
132
+ up: (count = 1) => `${CSI}${count}A`,
133
+ down: (count = 1) => `${CSI}${count}B`,
134
+ forward: (count = 1) => `${CSI}${count}C`,
135
+ backward: (count = 1) => `${CSI}${count}D`,
136
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
137
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
138
+ left: `${CSI}G`,
139
+ hide: `${CSI}?25l`,
140
+ show: `${CSI}?25h`,
141
+ save: `${ESC}7`,
142
+ restore: `${ESC}8`
193
143
  };
194
- function t(F) {
195
- return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
196
- }
197
- u.length = function(F) {
198
- for (var s = t(F), i = 0, D = 0; D < s.length; D++) i = i + this.characterLength(s[D]);
199
- return i;
200
- }, u.slice = function(F, s, i) {
201
- textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
202
- for (var D = "", C = 0, n = t(F), E = 0; E < n.length; E++) {
203
- var a = n[E], o = u.length(a);
204
- if (C >= s - (o == 2 ? 1 : 0)) if (C + o <= i) D += a;
205
- else break;
206
- C += o;
207
- }
208
- return D;
144
+ const scroll = {
145
+ up: (count = 1) => `${CSI}S`.repeat(count),
146
+ down: (count = 1) => `${CSI}T`.repeat(count)
209
147
  };
210
- })(W$1);
211
- var tD = W$1.exports;
212
- const eD = L$1(tD);
213
- var FD = function() {
214
- return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
215
- };
216
- const sD = L$1(FD);
217
- function p(e, u = {}) {
218
- if (typeof e != "string" || e.length === 0 || (u = {
219
- ambiguousIsNarrow: !0,
220
- ...u
221
- }, e = P$1(e), e.length === 0)) return 0;
222
- e = e.replace(sD(), " ");
223
- const t = u.ambiguousIsNarrow ? 1 : 2;
224
- let F = 0;
225
- for (const s of e) {
226
- const i = s.codePointAt(0);
227
- if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
228
- switch (eD.eastAsianWidth(s)) {
229
- case "F":
230
- case "W":
231
- F += 2;
232
- break;
233
- case "A":
234
- F += t;
235
- break;
236
- default: F += 1;
148
+ const erase = {
149
+ screen: `${CSI}2J`,
150
+ up: (count = 1) => `${CSI}1J`.repeat(count),
151
+ down: (count = 1) => `${CSI}J`.repeat(count),
152
+ line: `${CSI}2K`,
153
+ lineEnd: `${CSI}K`,
154
+ lineStart: `${CSI}1K`,
155
+ lines(count) {
156
+ let clear = "";
157
+ for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
158
+ if (count) clear += cursor.left;
159
+ return clear;
237
160
  }
238
- }
239
- return F;
161
+ };
162
+ module.exports = {
163
+ cursor,
164
+ scroll,
165
+ erase,
166
+ beep
167
+ };
168
+ }));
169
+
170
+ //#endregion
171
+ //#region node_modules/.pnpm/@clack+core@1.0.1/node_modules/@clack/core/dist/index.mjs
172
+ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
173
+ var import_src = require_src();
174
+ function B(t, e, s) {
175
+ if (!s.some((u) => !u.disabled)) return t;
176
+ const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
177
+ return s[n].disabled ? B(n, e < 0 ? -1 : 1, s) : n;
240
178
  }
241
- const w = 10, N = (e = 0) => (u) => `\x1B[${u + e}m`, I = (e = 0) => (u) => `\x1B[${38 + e};5;${u}m`, R = (e = 0) => (u, t, F) => `\x1B[${38 + e};2;${u};${t};${F}m`, r = {
242
- modifier: {
243
- reset: [0, 0],
244
- bold: [1, 22],
245
- dim: [2, 22],
246
- italic: [3, 23],
247
- underline: [4, 24],
248
- overline: [53, 55],
249
- inverse: [7, 27],
250
- hidden: [8, 28],
251
- strikethrough: [9, 29]
252
- },
253
- color: {
254
- black: [30, 39],
255
- red: [31, 39],
256
- green: [32, 39],
257
- yellow: [33, 39],
258
- blue: [34, 39],
259
- magenta: [35, 39],
260
- cyan: [36, 39],
261
- white: [37, 39],
262
- blackBright: [90, 39],
263
- gray: [90, 39],
264
- grey: [90, 39],
265
- redBright: [91, 39],
266
- greenBright: [92, 39],
267
- yellowBright: [93, 39],
268
- blueBright: [94, 39],
269
- magentaBright: [95, 39],
270
- cyanBright: [96, 39],
271
- whiteBright: [97, 39]
272
- },
273
- bgColor: {
274
- bgBlack: [40, 49],
275
- bgRed: [41, 49],
276
- bgGreen: [42, 49],
277
- bgYellow: [43, 49],
278
- bgBlue: [44, 49],
279
- bgMagenta: [45, 49],
280
- bgCyan: [46, 49],
281
- bgWhite: [47, 49],
282
- bgBlackBright: [100, 49],
283
- bgGray: [100, 49],
284
- bgGrey: [100, 49],
285
- bgRedBright: [101, 49],
286
- bgGreenBright: [102, 49],
287
- bgYellowBright: [103, 49],
288
- bgBlueBright: [104, 49],
289
- bgMagentaBright: [105, 49],
290
- bgCyanBright: [106, 49],
291
- bgWhiteBright: [107, 49]
292
- }
293
- };
294
- Object.keys(r.modifier);
295
- const iD = Object.keys(r.color), CD = Object.keys(r.bgColor);
296
- [...iD, ...CD];
297
- function rD() {
298
- const e = /* @__PURE__ */ new Map();
299
- for (const [u, t] of Object.entries(r)) {
300
- for (const [F, s] of Object.entries(t)) r[F] = {
301
- open: `\x1B[${s[0]}m`,
302
- close: `\x1B[${s[1]}m`
303
- }, t[F] = r[F], e.set(s[0], s[1]);
304
- Object.defineProperty(r, u, {
305
- value: t,
306
- enumerable: !1
307
- });
308
- }
309
- return Object.defineProperty(r, "codes", {
310
- value: e,
311
- enumerable: !1
312
- }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, {
313
- rgbToAnsi256: {
314
- value: (u, t, F) => u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5),
315
- enumerable: !1
316
- },
317
- hexToRgb: {
318
- value: (u) => {
319
- const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
320
- if (!t) return [
321
- 0,
322
- 0,
323
- 0
324
- ];
325
- let [F] = t;
326
- F.length === 3 && (F = [...F].map((i) => i + i).join(""));
327
- const s = Number.parseInt(F, 16);
328
- return [
329
- s >> 16 & 255,
330
- s >> 8 & 255,
331
- s & 255
332
- ];
333
- },
334
- enumerable: !1
335
- },
336
- hexToAnsi256: {
337
- value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)),
338
- enumerable: !1
339
- },
340
- ansi256ToAnsi: {
341
- value: (u) => {
342
- if (u < 8) return 30 + u;
343
- if (u < 16) return 90 + (u - 8);
344
- let t, F, s;
345
- if (u >= 232) t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
346
- else {
347
- u -= 16;
348
- const C = u % 36;
349
- t = Math.floor(u / 36) / 5, F = Math.floor(C / 6) / 5, s = C % 6 / 5;
179
+ const at$1 = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109, lt$1 = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510, ht$1 = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141, O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, L = /\t{1,1000}/y, P = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy, M$1 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, ct$1 = /\p{M}+/gu, ft$1 = {
180
+ limit: Infinity,
181
+ ellipsis: ""
182
+ }, X$1 = (t, e = {}, s = {}) => {
183
+ const i = e.limit ?? Infinity, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? X$1(r, ft$1, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
184
+ let h = 0, o = 0, p = t.length, v = 0, F = !1, d = p, b = Math.max(0, i - n), C = 0, w = 0, c = 0, f = 0;
185
+ t: for (;;) {
186
+ if (w > C || o >= p && o > h) {
187
+ const ut = t.slice(C, w) || t.slice(h, o);
188
+ v = 0;
189
+ for (const Y of ut.replaceAll(ct$1, "")) {
190
+ const $ = Y.codePointAt(0) || 0;
191
+ if (lt$1($) ? f = m : ht$1($) ? f = V : E !== A && at$1($) ? f = E : f = A, c + f > b && (d = Math.min(d, Math.max(C, h) + v)), c + f > i) {
192
+ F = !0;
193
+ break t;
350
194
  }
351
- const i = Math.max(t, F, s) * 2;
352
- if (i === 0) return 30;
353
- let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
354
- return i === 2 && (D += 60), D;
355
- },
356
- enumerable: !1
357
- },
358
- rgbToAnsi: {
359
- value: (u, t, F) => r.ansi256ToAnsi(r.rgbToAnsi256(u, t, F)),
360
- enumerable: !1
361
- },
362
- hexToAnsi: {
363
- value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)),
364
- enumerable: !1
195
+ v += Y.length, c += f;
196
+ }
197
+ C = w = 0;
365
198
  }
366
- }), r;
367
- }
368
- const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e) => `${d$1.values().next().value}${V$1}${e}${G$1}`, K$1 = (e) => `${d$1.values().next().value}${_$1}${e}${y$1}`, aD = (e) => e.split(" ").map((u) => p(u)), k$1 = (e, u, t) => {
369
- const F = [...u];
370
- let s = !1, i = !1, D = p(P$1(e[e.length - 1]));
371
- for (const [C, n] of F.entries()) {
372
- const E = p(n);
373
- if (D + E <= t ? e[e.length - 1] += n : (e.push(n), D = 0), d$1.has(n) && (s = !0, i = F.slice(C + 1).join("").startsWith(_$1)), s) {
374
- i ? n === y$1 && (s = !1, i = !1) : n === G$1 && (s = !1);
199
+ if (o >= p) break;
200
+ if (M$1.lastIndex = o, M$1.test(t)) {
201
+ if (v = M$1.lastIndex - o, f = v * A, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + f > i) {
202
+ F = !0;
203
+ break;
204
+ }
205
+ c += f, C = h, w = o, o = h = M$1.lastIndex;
206
+ continue;
207
+ }
208
+ if (O.lastIndex = o, O.test(t)) {
209
+ if (c + u > b && (d = Math.min(d, o)), c + u > i) {
210
+ F = !0;
211
+ break;
212
+ }
213
+ c += u, C = h, w = o, o = h = O.lastIndex;
214
+ continue;
215
+ }
216
+ if (y.lastIndex = o, y.test(t)) {
217
+ if (v = y.lastIndex - o, f = v * a, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + f > i) {
218
+ F = !0;
219
+ break;
220
+ }
221
+ c += f, C = h, w = o, o = h = y.lastIndex;
222
+ continue;
223
+ }
224
+ if (L.lastIndex = o, L.test(t)) {
225
+ if (v = L.lastIndex - o, f = v * l, c + f > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + f > i) {
226
+ F = !0;
227
+ break;
228
+ }
229
+ c += f, C = h, w = o, o = h = L.lastIndex;
230
+ continue;
231
+ }
232
+ if (P.lastIndex = o, P.test(t)) {
233
+ if (c + g > b && (d = Math.min(d, o)), c + g > i) {
234
+ F = !0;
235
+ break;
236
+ }
237
+ c += g, C = h, w = o, o = h = P.lastIndex;
375
238
  continue;
376
239
  }
377
- D += E, D === t && C < F.length - 1 && (e.push(""), D = 0);
378
- }
379
- !D && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
380
- }, hD = (e) => {
381
- const u = e.split(" ");
382
- let t = u.length;
383
- for (; t > 0 && !(p(u[t - 1]) > 0);) t--;
384
- return t === u.length ? e : u.slice(0, t).join(" ") + u.slice(t).join("");
385
- }, lD = (e, u, t = {}) => {
386
- if (t.trim !== !1 && e.trim() === "") return "";
387
- let F = "", s, i;
388
- const D = aD(e);
389
- let C = [""];
390
- for (const [E, a] of e.split(" ").entries()) {
391
- t.trim !== !1 && (C[C.length - 1] = C[C.length - 1].trimStart());
392
- let o = p(C[C.length - 1]);
393
- if (E !== 0 && (o >= u && (t.wordWrap === !1 || t.trim === !1) && (C.push(""), o = 0), (o > 0 || t.trim === !1) && (C[C.length - 1] += " ", o++)), t.hard && D[E] > u) {
394
- const c = u - o, f = 1 + Math.floor((D[E] - c - 1) / u);
395
- Math.floor((D[E] - 1) / u) < f && C.push(""), k$1(C, a, u);
240
+ o += 1;
241
+ }
242
+ return {
243
+ width: F ? b : c,
244
+ index: F ? d : p,
245
+ truncated: F,
246
+ ellipsed: F && i >= n
247
+ };
248
+ }, pt$1 = {
249
+ limit: Infinity,
250
+ ellipsis: "",
251
+ ellipsisWidth: 0
252
+ }, S = (t, e = {}) => X$1(t, pt$1, e).width, W$1 = "\x1B", Z$1 = "›", Ft$1 = 39, j = "\x07", Q$1 = "[", dt$1 = "]", tt = "m", U$1 = `${dt$1}8;;`, et$1 = new RegExp(`(?:\\${Q$1}(?<code>\\d+)m|\\${U$1}(?<uri>.*)${j})`, "y"), mt$1 = (t) => {
253
+ if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
254
+ if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
255
+ if (t === 1 || t === 2) return 22;
256
+ if (t === 3) return 23;
257
+ if (t === 4) return 24;
258
+ if (t === 7) return 27;
259
+ if (t === 8) return 28;
260
+ if (t === 9) return 29;
261
+ if (t === 0) return 0;
262
+ }, st$1 = (t) => `${W$1}${Q$1}${t}${tt}`, it$1 = (t) => `${W$1}${U$1}${t}${j}`, gt$1 = (t) => t.map((e) => S(e)), G = (t, e, s) => {
263
+ const i = e[Symbol.iterator]();
264
+ let r = !1, n = !1, u = t.at(-1), a = u === void 0 ? 0 : S(u), l = i.next(), E = i.next(), g = 0;
265
+ for (; !l.done;) {
266
+ const m = l.value, A = S(m);
267
+ a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === W$1 || m === Z$1) && (r = !0, n = e.startsWith(U$1, g + 1)), r ? n ? m === j && (r = !1, n = !1) : m === tt && (r = !1) : (a += A, a === s && !E.done && (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
268
+ }
269
+ u = t.at(-1), !a && u !== void 0 && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
270
+ }, vt$1 = (t) => {
271
+ const e = t.split(" ");
272
+ let s = e.length;
273
+ for (; s > 0 && !(S(e[s - 1]) > 0);) s--;
274
+ return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
275
+ }, Et$1 = (t, e, s = {}) => {
276
+ if (s.trim !== !1 && t.trim() === "") return "";
277
+ let i = "", r, n;
278
+ const u = t.split(" "), a = gt$1(u);
279
+ let l = [""];
280
+ for (const [h, o] of u.entries()) {
281
+ s.trim !== !1 && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
282
+ let p = S(l.at(-1) ?? "");
283
+ if (h !== 0 && (p >= e && (s.wordWrap === !1 || s.trim === !1) && (l.push(""), p = 0), (p > 0 || s.trim === !1) && (l[l.length - 1] += " ", p++)), s.hard && a[h] > e) {
284
+ const v = e - p, F = 1 + Math.floor((a[h] - v - 1) / e);
285
+ Math.floor((a[h] - 1) / e) < F && l.push(""), G(l, o, e);
396
286
  continue;
397
287
  }
398
- if (o + D[E] > u && o > 0 && D[E] > 0) {
399
- if (t.wordWrap === !1 && o < u) {
400
- k$1(C, a, u);
288
+ if (p + a[h] > e && p > 0 && a[h] > 0) {
289
+ if (s.wordWrap === !1 && p < e) {
290
+ G(l, o, e);
401
291
  continue;
402
292
  }
403
- C.push("");
293
+ l.push("");
404
294
  }
405
- if (o + D[E] > u && t.wordWrap === !1) {
406
- k$1(C, a, u);
295
+ if (p + a[h] > e && s.wordWrap === !1) {
296
+ G(l, o, e);
407
297
  continue;
408
298
  }
409
- C[C.length - 1] += a;
410
- }
411
- t.trim !== !1 && (C = C.map((E) => hD(E)));
412
- const n = [...C.join(`
413
- `)];
414
- for (const [E, a] of n.entries()) {
415
- if (F += a, d$1.has(a)) {
416
- const { groups: c } = new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`).exec(n.slice(E).join("")) || { groups: {} };
417
- if (c.code !== void 0) {
418
- const f = Number.parseFloat(c.code);
419
- s = f === oD ? void 0 : f;
420
- } else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
421
- }
422
- const o = ED.codes.get(Number(s));
423
- n[E + 1] === `
424
- ` ? (i && (F += K$1("")), s && o && (F += z(o))) : a === `
425
- ` && (s && o && (F += z(s)), i && (F += K$1(i)));
426
- }
427
- return F;
299
+ l[l.length - 1] += o;
300
+ }
301
+ s.trim !== !1 && (l = l.map((h) => vt$1(h)));
302
+ const E = l.join(`
303
+ `), g = E[Symbol.iterator]();
304
+ let m = g.next(), A = g.next(), V = 0;
305
+ for (; !m.done;) {
306
+ const h = m.value, o = A.value;
307
+ if (i += h, h === W$1 || h === Z$1) {
308
+ et$1.lastIndex = V + 1;
309
+ const F = et$1.exec(E)?.groups;
310
+ if (F?.code !== void 0) {
311
+ const d = Number.parseFloat(F.code);
312
+ r = d === Ft$1 ? void 0 : d;
313
+ } else F?.uri !== void 0 && (n = F.uri.length === 0 ? void 0 : F.uri);
314
+ }
315
+ const p = r ? mt$1(r) : void 0;
316
+ o === `
317
+ ` ? (n && (i += it$1("")), r && p && (i += st$1(p))) : h === `
318
+ ` && (r && p && (i += st$1(r)), n && (i += it$1(n))), V += h.length, m = A, A = g.next();
319
+ }
320
+ return i;
428
321
  };
429
- function Y$1(e, u, t) {
430
- return String(e).normalize().replace(/\r\n/g, `
322
+ function K$1(t, e, s) {
323
+ return String(t).normalize().replaceAll(`\r
324
+ `, `
431
325
  `).split(`
432
- `).map((F) => lD(F, u, t)).join(`
326
+ `).map((i) => Et$1(i, e, s)).join(`
433
327
  `);
434
328
  }
435
- const B = {
329
+ const _ = {
436
330
  actions: new Set([
437
331
  "up",
438
332
  "down",
@@ -449,221 +343,351 @@ const B = {
449
343
  ["l", "right"],
450
344
  ["", "cancel"],
451
345
  ["escape", "cancel"]
452
- ])
346
+ ]),
347
+ messages: {
348
+ cancel: "Canceled",
349
+ error: "Something went wrong"
350
+ },
351
+ withGuide: !0
453
352
  };
454
- function $(e, u) {
455
- if (typeof e == "string") return B.aliases.get(e) === u;
456
- for (const t of e) if (t !== void 0 && $(t, u)) return !0;
353
+ function H$1(t, e) {
354
+ if (typeof t == "string") return _.aliases.get(t) === e;
355
+ for (const s of t) if (s !== void 0 && H$1(s, e)) return !0;
457
356
  return !1;
458
357
  }
459
- function BD(e, u) {
460
- if (e === u) return;
461
- const t = e.split(`
462
- `), F = u.split(`
463
- `), s = [];
464
- for (let i = 0; i < Math.max(t.length, F.length); i++) t[i] !== F[i] && s.push(i);
465
- return s;
358
+ function _t(t, e) {
359
+ if (t === e) return;
360
+ const s = t.split(`
361
+ `), i = e.split(`
362
+ `), r = Math.max(s.length, i.length), n = [];
363
+ for (let u = 0; u < r; u++) s[u] !== i[u] && n.push(u);
364
+ return {
365
+ lines: n,
366
+ numLinesBefore: s.length,
367
+ numLinesAfter: i.length,
368
+ numLines: r
369
+ };
466
370
  }
467
- const AD = globalThis.process.platform.startsWith("win"), S = Symbol("clack:cancel");
468
- function pD(e) {
469
- return e === S;
371
+ const bt$1 = globalThis.process.platform.startsWith("win"), z = Symbol("clack:cancel");
372
+ function Ct$1(t) {
373
+ return t === z;
470
374
  }
471
- function m(e, u) {
472
- const t = e;
473
- t.isTTY && t.setRawMode(u);
375
+ function T(t, e) {
376
+ const s = t;
377
+ s.isTTY && s.setRawMode(e);
474
378
  }
475
- function fD({ input: e = stdin, output: u = stdout, overwrite: t = !0, hideCursor: F = !0 } = {}) {
476
- const s = g.createInterface({
477
- input: e,
478
- output: u,
379
+ function Bt({ input: t = stdin, output: e = stdout, overwrite: s = !0, hideCursor: i = !0 } = {}) {
380
+ const r = k.createInterface({
381
+ input: t,
382
+ output: e,
479
383
  prompt: "",
480
384
  tabSize: 1
481
385
  });
482
- g.emitKeypressEvents(e, s), e.isTTY && e.setRawMode(!0);
483
- const i = (D, { name: C, sequence: n }) => {
484
- if ($([
485
- String(D),
486
- C,
487
- n
386
+ k.emitKeypressEvents(t, r), t instanceof ReadStream && t.isTTY && t.setRawMode(!0);
387
+ const n = (u, { name: a, sequence: l }) => {
388
+ if (H$1([
389
+ String(u),
390
+ a,
391
+ l
488
392
  ], "cancel")) {
489
- F && u.write(import_src.cursor.show), process.exit(0);
393
+ i && e.write(import_src.cursor.show), process.exit(0);
490
394
  return;
491
395
  }
492
- if (!t) return;
493
- const a = C === "return" ? 0 : -1, o = C === "return" ? -1 : 0;
494
- g.moveCursor(u, a, o, () => {
495
- g.clearLine(u, 1, () => {
496
- e.once("keypress", i);
396
+ if (!s) return;
397
+ const g = a === "return" ? 0 : -1, m = a === "return" ? -1 : 0;
398
+ k.moveCursor(e, g, m, () => {
399
+ k.clearLine(e, 1, () => {
400
+ t.once("keypress", n);
497
401
  });
498
402
  });
499
403
  };
500
- return F && u.write(import_src.cursor.hide), e.once("keypress", i), () => {
501
- e.off("keypress", i), F && u.write(import_src.cursor.show), e.isTTY && !AD && e.setRawMode(!1), s.terminal = !1, s.close();
404
+ return i && e.write(import_src.cursor.hide), t.once("keypress", n), () => {
405
+ t.off("keypress", n), i && e.write(import_src.cursor.show), t instanceof ReadStream && t.isTTY && !bt$1 && t.setRawMode(!1), r.terminal = !1, r.close();
502
406
  };
503
407
  }
504
- var gD = Object.defineProperty, vD = (e, u, t) => u in e ? gD(e, u, {
505
- enumerable: !0,
506
- configurable: !0,
507
- writable: !0,
508
- value: t
509
- }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t);
408
+ const rt$1 = (t) => "columns" in t && typeof t.columns == "number" ? t.columns : 80, nt$1 = (t) => "rows" in t && typeof t.rows == "number" ? t.rows : 20;
409
+ function xt(t, e, s, i = s) {
410
+ return K$1(e, rt$1(t ?? stdout) - s.length, {
411
+ hard: !0,
412
+ trim: !1
413
+ }).split(`
414
+ `).map((n, u) => `${u === 0 ? i : s}${n}`).join(`
415
+ `);
416
+ }
510
417
  var x$1 = class {
511
- constructor(u, t = !0) {
512
- h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", !1), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
513
- const { input: F = stdin, output: s = stdout, render: i, signal: D, ...C } = u;
514
- this.opts = C, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D, this.input = F, this.output = s;
418
+ input;
419
+ output;
420
+ _abortSignal;
421
+ rl;
422
+ opts;
423
+ _render;
424
+ _track = !1;
425
+ _prevFrame = "";
426
+ _subscribers = /* @__PURE__ */ new Map();
427
+ _cursor = 0;
428
+ state = "initial";
429
+ error = "";
430
+ value;
431
+ userInput = "";
432
+ constructor(e, s = !0) {
433
+ const { input: i = stdin, output: r = stdout, render: n, signal: u, ...a } = e;
434
+ this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = u, this.input = i, this.output = r;
515
435
  }
516
436
  unsubscribe() {
517
437
  this._subscribers.clear();
518
438
  }
519
- setSubscriber(u, t) {
520
- const F = this._subscribers.get(u) ?? [];
521
- F.push(t), this._subscribers.set(u, F);
439
+ setSubscriber(e, s) {
440
+ const i = this._subscribers.get(e) ?? [];
441
+ i.push(s), this._subscribers.set(e, i);
522
442
  }
523
- on(u, t) {
524
- this.setSubscriber(u, { cb: t });
443
+ on(e, s) {
444
+ this.setSubscriber(e, { cb: s });
525
445
  }
526
- once(u, t) {
527
- this.setSubscriber(u, {
528
- cb: t,
446
+ once(e, s) {
447
+ this.setSubscriber(e, {
448
+ cb: s,
529
449
  once: !0
530
450
  });
531
451
  }
532
- emit(u, ...t) {
533
- const F = this._subscribers.get(u) ?? [], s = [];
534
- for (const i of F) i.cb(...t), i.once && s.push(() => F.splice(F.indexOf(i), 1));
535
- for (const i of s) i();
452
+ emit(e, ...s) {
453
+ const i = this._subscribers.get(e) ?? [], r = [];
454
+ for (const n of i) n.cb(...s), n.once && r.push(() => i.splice(i.indexOf(n), 1));
455
+ for (const n of r) n();
536
456
  }
537
457
  prompt() {
538
- return new Promise((u, t) => {
458
+ return new Promise((e) => {
539
459
  if (this._abortSignal) {
540
- if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u(S);
460
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(z);
541
461
  this._abortSignal.addEventListener("abort", () => {
542
462
  this.state = "cancel", this.close();
543
463
  }, { once: !0 });
544
464
  }
545
- const F = new Writable();
546
- F._write = (s, i, D) => {
547
- this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
548
- }, this.input.pipe(F), this.rl = O.createInterface({
465
+ this.rl = ot.createInterface({
549
466
  input: this.input,
550
- output: F,
551
467
  tabSize: 2,
552
468
  prompt: "",
553
469
  escapeCodeTimeout: 50,
554
470
  terminal: !0
555
- }), O.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), m(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
556
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u(this.value);
471
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), T(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
472
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), T(this.input, !1), e(this.value);
557
473
  }), this.once("cancel", () => {
558
- this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u(S);
474
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), T(this.input, !1), e(z);
559
475
  });
560
476
  });
561
477
  }
562
- onKeypress(u, t) {
563
- if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u && (u.toLowerCase() === "y" || u.toLowerCase() === "n") && this.emit("confirm", u.toLowerCase() === "y"), u === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u && this.emit("key", u.toLowerCase()), t?.name === "return") {
478
+ _isActionKey(e, s) {
479
+ return e === " ";
480
+ }
481
+ _setValue(e) {
482
+ this.value = e, this.emit("value", this.value);
483
+ }
484
+ _setUserInput(e, s) {
485
+ this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
486
+ }
487
+ _clearUserInput() {
488
+ this.rl?.write(null, {
489
+ ctrl: !0,
490
+ name: "u"
491
+ }), this._setUserInput("");
492
+ }
493
+ onKeypress(e, s) {
494
+ if (this._track && s.name !== "return" && (s.name && this._isActionKey(e, s) && this.rl?.write(null, {
495
+ ctrl: !0,
496
+ name: "h"
497
+ }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && _.aliases.has(s.name) && this.emit("cursor", _.aliases.get(s.name)), _.actions.has(s.name) && this.emit("cursor", s.name)), e && (e.toLowerCase() === "y" || e.toLowerCase() === "n") && this.emit("confirm", e.toLowerCase() === "y"), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
564
498
  if (this.opts.validate) {
565
- const F = this.opts.validate(this.value);
566
- F && (this.error = F instanceof Error ? F.message : F, this.state = "error", this.rl?.write(this.value));
499
+ const i = this.opts.validate(this.value);
500
+ i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
567
501
  }
568
502
  this.state !== "error" && (this.state = "submit");
569
503
  }
570
- $([
571
- u,
572
- t?.name,
573
- t?.sequence
504
+ H$1([
505
+ e,
506
+ s?.name,
507
+ s?.sequence
574
508
  ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
575
509
  }
576
510
  close() {
577
511
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
578
- `), m(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
512
+ `), T(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
579
513
  }
580
514
  restoreCursor() {
581
- const u = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
515
+ const e = K$1(this._prevFrame, process.stdout.columns, {
516
+ hard: !0,
517
+ trim: !1
518
+ }).split(`
582
519
  `).length - 1;
583
- this.output.write(import_src.cursor.move(-999, u * -1));
520
+ this.output.write(import_src.cursor.move(-999, e * -1));
584
521
  }
585
522
  render() {
586
- const u = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
587
- if (u !== this._prevFrame) {
523
+ const e = K$1(this._render(this) ?? "", process.stdout.columns, {
524
+ hard: !0,
525
+ trim: !1
526
+ });
527
+ if (e !== this._prevFrame) {
588
528
  if (this.state === "initial") this.output.write(import_src.cursor.hide);
589
529
  else {
590
- const t = BD(this._prevFrame, u);
591
- if (this.restoreCursor(), t && t?.length === 1) {
592
- const F = t[0];
593
- this.output.write(import_src.cursor.move(0, F)), this.output.write(import_src.erase.lines(1));
594
- const s = u.split(`
530
+ const s = _t(this._prevFrame, e), i = nt$1(this.output);
531
+ if (this.restoreCursor(), s) {
532
+ const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
533
+ let u = s.lines.find((a) => a >= r);
534
+ if (u === void 0) {
535
+ this._prevFrame = e;
536
+ return;
537
+ }
538
+ if (s.lines.length === 1) {
539
+ this.output.write(import_src.cursor.move(0, u - n)), this.output.write(import_src.erase.lines(1));
540
+ const a = e.split(`
595
541
  `);
596
- this.output.write(s[F]), this._prevFrame = u, this.output.write(import_src.cursor.move(0, s.length - F - 1));
597
- return;
598
- }
599
- if (t && t?.length > 1) {
600
- const F = t[0];
601
- this.output.write(import_src.cursor.move(0, F)), this.output.write(import_src.erase.down());
602
- const s = u.split(`
603
- `).slice(F);
604
- this.output.write(s.join(`
605
- `)), this._prevFrame = u;
606
- return;
542
+ this.output.write(a[u]), this._prevFrame = e, this.output.write(import_src.cursor.move(0, a.length - u - 1));
543
+ return;
544
+ } else if (s.lines.length > 1) {
545
+ if (r < n) u = r;
546
+ else {
547
+ const l = u - n;
548
+ l > 0 && this.output.write(import_src.cursor.move(0, l));
549
+ }
550
+ this.output.write(import_src.erase.down());
551
+ const a = e.split(`
552
+ `).slice(u);
553
+ this.output.write(a.join(`
554
+ `)), this._prevFrame = e;
555
+ return;
556
+ }
607
557
  }
608
558
  this.output.write(import_src.erase.down());
609
559
  }
610
- this.output.write(u), this.state === "initial" && (this.state = "active"), this._prevFrame = u;
560
+ this.output.write(e), this.state === "initial" && (this.state = "active"), this._prevFrame = e;
611
561
  }
612
562
  }
613
563
  };
614
- var dD = class extends x$1 {
564
+ function wt$1(t, e) {
565
+ if (t === void 0 || e.length === 0) return 0;
566
+ const s = e.findIndex((i) => i.value === t);
567
+ return s !== -1 ? s : 0;
568
+ }
569
+ function Dt$1(t, e) {
570
+ return (e.label ?? String(e.value)).toLowerCase().includes(t.toLowerCase());
571
+ }
572
+ function St$1(t, e) {
573
+ if (e) return t ? e : e[0];
574
+ }
575
+ var Vt$1 = class extends x$1 {
576
+ filteredOptions;
577
+ multiple;
578
+ isNavigating = !1;
579
+ selectedValues = [];
580
+ focusedValue;
581
+ #t = 0;
582
+ #s = "";
583
+ #i;
584
+ #e;
585
+ get cursor() {
586
+ return this.#t;
587
+ }
588
+ get userInputWithCursor() {
589
+ if (!this.userInput) return import_picocolors.default.inverse(import_picocolors.default.hidden("_"));
590
+ if (this._cursor >= this.userInput.length) return `${this.userInput}\u2588`;
591
+ const e = this.userInput.slice(0, this._cursor), [s, ...i] = this.userInput.slice(this._cursor);
592
+ return `${e}${import_picocolors.default.inverse(s)}${i.join("")}`;
593
+ }
594
+ get options() {
595
+ return typeof this.#e == "function" ? this.#e() : this.#e;
596
+ }
597
+ constructor(e) {
598
+ super(e), this.#e = e.options;
599
+ const s = this.options;
600
+ this.filteredOptions = [...s], this.multiple = e.multiple === !0, this.#i = e.filter ?? Dt$1;
601
+ let i;
602
+ if (e.initialValue && Array.isArray(e.initialValue) ? this.multiple ? i = e.initialValue : i = e.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (i = [this.options[0].value]), i) for (const r of i) {
603
+ const n = s.findIndex((u) => u.value === r);
604
+ n !== -1 && (this.toggleSelected(r), this.#t = n);
605
+ }
606
+ this.focusedValue = this.options[this.#t]?.value, this.on("key", (r, n) => this.#r(r, n)), this.on("userInput", (r) => this.#n(r));
607
+ }
608
+ _isActionKey(e, s) {
609
+ return e === " " || this.multiple && this.isNavigating && s.name === "space" && e !== void 0 && e !== "";
610
+ }
611
+ #r(e, s) {
612
+ const i = s.name === "up", r = s.name === "down", n = s.name === "return";
613
+ i || r ? (this.#t = B(this.#t, i ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#t]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = !0) : n ? this.value = St$1(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== void 0 && (s.name === "tab" || this.isNavigating && s.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = !1);
614
+ }
615
+ deselectAll() {
616
+ this.selectedValues = [];
617
+ }
618
+ toggleSelected(e) {
619
+ this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(e) ? this.selectedValues = this.selectedValues.filter((s) => s !== e) : this.selectedValues = [...this.selectedValues, e] : this.selectedValues = [e]);
620
+ }
621
+ #n(e) {
622
+ if (e !== this.#s) {
623
+ this.#s = e;
624
+ const s = this.options;
625
+ e ? this.filteredOptions = s.filter((n) => this.#i(e, n)) : this.filteredOptions = [...s];
626
+ this.#t = B(wt$1(this.focusedValue, this.filteredOptions), 0, this.filteredOptions);
627
+ const r = this.filteredOptions[this.#t];
628
+ r && !r.disabled ? this.focusedValue = r.value : this.focusedValue = void 0, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
629
+ }
630
+ }
631
+ };
632
+ var kt$1 = class extends x$1 {
615
633
  get cursor() {
616
634
  return this.value ? 0 : 1;
617
635
  }
618
636
  get _value() {
619
637
  return this.cursor === 0;
620
638
  }
621
- constructor(u) {
622
- super(u, !1), this.value = !!u.initialValue, this.on("value", () => {
639
+ constructor(e) {
640
+ super(e, !1), this.value = !!e.initialValue, this.on("userInput", () => {
623
641
  this.value = this._value;
624
- }), this.on("confirm", (t) => {
625
- this.output.write(import_src.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
642
+ }), this.on("confirm", (s) => {
643
+ this.output.write(import_src.cursor.move(0, -1)), this.value = s, this.state = "submit", this.close();
626
644
  }), this.on("cursor", () => {
627
645
  this.value = !this.value;
628
646
  });
629
647
  }
630
648
  };
631
- var mD = Object.defineProperty, bD = (e, u, t) => u in e ? mD(e, u, {
632
- enumerable: !0,
633
- configurable: !0,
634
- writable: !0,
635
- value: t
636
- }) : e[u] = t, Z = (e, u, t) => (bD(e, typeof u != "symbol" ? u + "" : u, t), t), q$1 = (e, u, t) => {
637
- if (!u.has(e)) throw TypeError("Cannot " + t);
638
- }, T$1 = (e, u, t) => (q$1(e, u, "read from private field"), t ? t.call(e) : u.get(e)), wD = (e, u, t) => {
639
- if (u.has(e)) throw TypeError("Cannot add the same private member more than once");
640
- u instanceof WeakSet ? u.add(e) : u.set(e, t);
641
- }, yD = (e, u, t, F) => (q$1(e, u, "write to private field"), F ? F.call(e, t) : u.set(e, t), t), A$1;
642
- let _D = class extends x$1 {
643
- constructor(u) {
644
- super(u, !1), Z(this, "options"), Z(this, "cursor", 0), wD(this, A$1, void 0);
645
- const { options: t } = u;
646
- yD(this, A$1, u.selectableGroups !== !1), this.options = Object.entries(t).flatMap(([F, s]) => [{
647
- value: F,
649
+ var yt$1 = class extends x$1 {
650
+ options;
651
+ cursor = 0;
652
+ #t;
653
+ getGroupItems(e) {
654
+ return this.options.filter((s) => s.group === e);
655
+ }
656
+ isGroupSelected(e) {
657
+ const s = this.getGroupItems(e), i = this.value;
658
+ return i === void 0 ? !1 : s.every((r) => i.includes(r.value));
659
+ }
660
+ toggleValue() {
661
+ const e = this.options[this.cursor];
662
+ if (this.value === void 0 && (this.value = []), e.group === !0) {
663
+ const s = e.value, i = this.getGroupItems(s);
664
+ this.isGroupSelected(s) ? this.value = this.value.filter((r) => i.findIndex((n) => n.value === r) === -1) : this.value = [...this.value, ...i.map((r) => r.value)], this.value = Array.from(new Set(this.value));
665
+ } else this.value = this.value.includes(e.value) ? this.value.filter((i) => i !== e.value) : [...this.value, e.value];
666
+ }
667
+ constructor(e) {
668
+ super(e, !1);
669
+ const { options: s } = e;
670
+ this.#t = e.selectableGroups !== !1, this.options = Object.entries(s).flatMap(([i, r]) => [{
671
+ value: i,
648
672
  group: !0,
649
- label: F
650
- }, ...s.map((i) => ({
651
- ...i,
652
- group: F
653
- }))]), this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), T$1(this, A$1) ? 0 : 1), this.on("cursor", (F) => {
654
- switch (F) {
673
+ label: i
674
+ }, ...r.map((n) => ({
675
+ ...n,
676
+ group: i
677
+ }))]), this.value = [...e.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), this.#t ? 0 : 1), this.on("cursor", (i) => {
678
+ switch (i) {
655
679
  case "left":
656
680
  case "up": {
657
681
  this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
658
- const s = this.options[this.cursor]?.group === !0;
659
- !T$1(this, A$1) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
682
+ const r = this.options[this.cursor]?.group === !0;
683
+ !this.#t && r && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
660
684
  break;
661
685
  }
662
686
  case "down":
663
687
  case "right": {
664
688
  this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
665
- const s = this.options[this.cursor]?.group === !0;
666
- !T$1(this, A$1) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
689
+ const r = this.options[this.cursor]?.group === !0;
690
+ !this.#t && r && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
667
691
  break;
668
692
  }
669
693
  case "space":
@@ -672,40 +696,43 @@ let _D = class extends x$1 {
672
696
  }
673
697
  });
674
698
  }
675
- getGroupItems(u) {
676
- return this.options.filter((t) => t.group === u);
699
+ };
700
+ var Lt$1 = class extends x$1 {
701
+ options;
702
+ cursor = 0;
703
+ get _value() {
704
+ return this.options[this.cursor].value;
705
+ }
706
+ get _enabledOptions() {
707
+ return this.options.filter((e) => e.disabled !== !0);
677
708
  }
678
- isGroupSelected(u) {
679
- return this.getGroupItems(u).every((t) => this.value.includes(t.value));
709
+ toggleAll() {
710
+ const e = this._enabledOptions;
711
+ this.value = this.value !== void 0 && this.value.length === e.length ? [] : e.map((i) => i.value);
680
712
  }
681
- toggleValue() {
682
- const u = this.options[this.cursor];
683
- if (u.group === !0) {
684
- const t = u.value, F = this.getGroupItems(t);
685
- this.isGroupSelected(t) ? this.value = this.value.filter((s) => F.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F.map((s) => s.value)], this.value = Array.from(new Set(this.value));
686
- } else this.value = this.value.includes(u.value) ? this.value.filter((F) => F !== u.value) : [...this.value, u.value];
713
+ toggleInvert() {
714
+ const e = this.value;
715
+ if (!e) return;
716
+ this.value = this._enabledOptions.filter((i) => !e.includes(i.value)).map((i) => i.value);
687
717
  }
688
- };
689
- A$1 = /* @__PURE__ */ new WeakMap();
690
- var kD = Object.defineProperty, $D = (e, u, t) => u in e ? kD(e, u, {
691
- enumerable: !0,
692
- configurable: !0,
693
- writable: !0,
694
- value: t
695
- }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t);
696
- let SD = class extends x$1 {
697
- constructor(u) {
698
- super(u, !1), H(this, "options"), H(this, "cursor", 0), this.options = u.options, this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u.cursorAt), 0), this.on("key", (t) => {
699
- t === "a" && this.toggleAll();
700
- }), this.on("cursor", (t) => {
701
- switch (t) {
718
+ toggleValue() {
719
+ this.value === void 0 && (this.value = []);
720
+ this.value = this.value.includes(this._value) ? this.value.filter((s) => s !== this._value) : [...this.value, this._value];
721
+ }
722
+ constructor(e) {
723
+ super(e, !1), this.options = e.options, this.value = [...e.initialValues ?? []];
724
+ const s = Math.max(this.options.findIndex(({ value: i }) => i === e.cursorAt), 0);
725
+ this.cursor = this.options[s].disabled ? B(s, 1, this.options) : s, this.on("key", (i) => {
726
+ i === "a" && this.toggleAll(), i === "i" && this.toggleInvert();
727
+ }), this.on("cursor", (i) => {
728
+ switch (i) {
702
729
  case "left":
703
730
  case "up":
704
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
731
+ this.cursor = B(this.cursor, -1, this.options);
705
732
  break;
706
733
  case "down":
707
734
  case "right":
708
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
735
+ this.cursor = B(this.cursor, 1, this.options);
709
736
  break;
710
737
  case "space":
711
738
  this.toggleValue();
@@ -713,517 +740,1164 @@ let SD = class extends x$1 {
713
740
  }
714
741
  });
715
742
  }
716
- get _value() {
717
- return this.options[this.cursor].value;
718
- }
719
- toggleAll() {
720
- this.value = this.value.length === this.options.length ? [] : this.options.map((t) => t.value);
721
- }
722
- toggleValue() {
723
- this.value = this.value.includes(this._value) ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
724
- }
725
743
  };
726
- var TD = Object.defineProperty, jD = (e, u, t) => u in e ? TD(e, u, {
727
- enumerable: !0,
728
- configurable: !0,
729
- writable: !0,
730
- value: t
731
- }) : e[u] = t, U$1 = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t);
732
- var MD = class extends x$1 {
733
- constructor({ mask: u, ...t }) {
734
- super(t), U$1(this, "valueWithCursor", ""), U$1(this, "_mask", "•"), this._mask = u ?? "•", this.on("finalize", () => {
735
- this.valueWithCursor = this.masked;
736
- }), this.on("value", () => {
737
- if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
738
- else {
739
- const F = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
740
- this.valueWithCursor = `${F}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
741
- }
742
- });
743
- }
744
+ let Mt$1 = class extends x$1 {
745
+ _mask = "•";
744
746
  get cursor() {
745
747
  return this._cursor;
746
748
  }
747
749
  get masked() {
748
- return this.value.replaceAll(/./g, this._mask);
750
+ return this.userInput.replaceAll(/./g, this._mask);
751
+ }
752
+ get userInputWithCursor() {
753
+ if (this.state === "submit" || this.state === "cancel") return this.masked;
754
+ const e = this.userInput;
755
+ if (this.cursor >= e.length) return `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
756
+ const s = this.masked, i = s.slice(0, this.cursor), r = s.slice(this.cursor);
757
+ return `${i}${import_picocolors.default.inverse(r[0])}${r.slice(1)}`;
758
+ }
759
+ clear() {
760
+ this._clearUserInput();
761
+ }
762
+ constructor({ mask: e, ...s }) {
763
+ super(s), this._mask = e ?? "•", this.on("userInput", (i) => {
764
+ this._setValue(i);
765
+ });
749
766
  }
750
767
  };
751
- var OD = Object.defineProperty, PD = (e, u, t) => u in e ? OD(e, u, {
752
- enumerable: !0,
753
- configurable: !0,
754
- writable: !0,
755
- value: t
756
- }) : e[u] = t, J$1 = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t);
757
- var LD = class extends x$1 {
758
- constructor(u) {
759
- super(u, !1), J$1(this, "options"), J$1(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
760
- switch (t) {
768
+ var Wt$1 = class extends x$1 {
769
+ options;
770
+ cursor = 0;
771
+ get _selectedValue() {
772
+ return this.options[this.cursor];
773
+ }
774
+ changeValue() {
775
+ this.value = this._selectedValue.value;
776
+ }
777
+ constructor(e) {
778
+ super(e, !1), this.options = e.options;
779
+ const s = this.options.findIndex(({ value: r }) => r === e.initialValue), i = s === -1 ? 0 : s;
780
+ this.cursor = this.options[i].disabled ? B(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r) => {
781
+ switch (r) {
761
782
  case "left":
762
783
  case "up":
763
- this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
784
+ this.cursor = B(this.cursor, -1, this.options);
764
785
  break;
765
786
  case "down":
766
787
  case "right":
767
- this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
788
+ this.cursor = B(this.cursor, 1, this.options);
768
789
  break;
769
790
  }
770
791
  this.changeValue();
771
792
  });
772
793
  }
773
- get _value() {
774
- return this.options[this.cursor];
775
- }
776
- changeValue() {
777
- this.value = this._value.value;
778
- }
779
794
  };
780
- var WD = Object.defineProperty, ND = (e, u, t) => u in e ? WD(e, u, {
781
- enumerable: !0,
782
- configurable: !0,
783
- writable: !0,
784
- value: t
785
- }) : e[u] = t, Q = (e, u, t) => (ND(e, typeof u != "symbol" ? u + "" : u, t), t);
786
- var ID = class extends x$1 {
787
- constructor(u) {
788
- super(u, !1), Q(this, "options"), Q(this, "cursor", 0), this.options = u.options;
789
- const t = this.options.map(({ value: [F] }) => F?.toLowerCase());
790
- this.cursor = Math.max(t.indexOf(u.initialValue), 0), this.on("key", (F) => {
791
- if (!t.includes(F)) return;
792
- const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F);
793
- s && (this.value = s.value, this.state = "submit", this.emit("submit"));
795
+ var Tt$1 = class extends x$1 {
796
+ options;
797
+ cursor = 0;
798
+ constructor(e) {
799
+ super(e, !1), this.options = e.options;
800
+ const s = e.caseSensitive === !0, i = this.options.map(({ value: [r] }) => s ? r : r?.toLowerCase());
801
+ this.cursor = Math.max(i.indexOf(e.initialValue), 0), this.on("key", (r, n) => {
802
+ if (!r) return;
803
+ const u = s && n.shift ? r.toUpperCase() : r;
804
+ if (!i.includes(u)) return;
805
+ const a = this.options.find(({ value: [l] }) => s ? l === u : l?.toLowerCase() === r);
806
+ a && (this.value = a.value, this.state = "submit", this.emit("submit"));
794
807
  });
795
808
  }
796
809
  };
797
- var RD = class extends x$1 {
798
- get valueWithCursor() {
799
- if (this.state === "submit") return this.value;
800
- if (this.cursor >= this.value.length) return `${this.value}\u2588`;
801
- const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
802
- return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
810
+ var $t$1 = class extends x$1 {
811
+ get userInputWithCursor() {
812
+ if (this.state === "submit") return this.userInput;
813
+ const e = this.userInput;
814
+ if (this.cursor >= e.length) return `${this.userInput}\u2588`;
815
+ const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
816
+ return `${s}${import_picocolors.default.inverse(i)}${r.join("")}`;
803
817
  }
804
818
  get cursor() {
805
819
  return this._cursor;
806
820
  }
807
- constructor(u) {
808
- super(u), this.on("finalize", () => {
809
- this.value || (this.value = u.defaultValue);
821
+ constructor(e) {
822
+ super({
823
+ ...e,
824
+ initialUserInput: e.initialUserInput ?? e.initialValue
825
+ }), this.on("userInput", (s) => {
826
+ this._setValue(s);
827
+ }), this.on("finalize", () => {
828
+ this.value || (this.value = e.defaultValue), this.value === void 0 && (this.value = "");
810
829
  });
811
830
  }
812
831
  };
813
832
 
814
833
  //#endregion
815
- //#region node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
816
- function ce() {
817
- return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
834
+ //#region node_modules/.pnpm/@clack+prompts@1.0.1/node_modules/@clack/prompts/dist/index.mjs
835
+ function me() {
836
+ return N.platform !== "win32" ? N.env.TERM !== "linux" : !!N.env.CI || !!N.env.WT_SESSION || !!N.env.TERMINUS_SUBLIME || N.env.ConEmuTask === "{cmd::Cmder}" || N.env.TERM_PROGRAM === "Terminus-Sublime" || N.env.TERM_PROGRAM === "vscode" || N.env.TERM === "xterm-256color" || N.env.TERM === "alacritty" || N.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
818
837
  }
819
- const V = ce(), u = (t, n) => V ? t : n, le = u("◆", "*"), L = u("■", "x"), W = u("▲", "x"), C = u("◇", "o"), ue = u("┌", "T"), o = u("│", "|"), d = u("└", "—"), k = u("●", ">"), P = u("○", " "), A = u("◻", "[•]"), T = u("◼", "[+]"), F = u("◻", "[ ]"), $e = u("▪", "•"), _ = u("─", "-"), me = u("╮", "+"), de = u("├", "+"), pe = u("╯", "+"), q = u("●", "•"), D = u("◆", "*"), U = u("▲", "!"), K = u("■", "x"), b = (t) => {
838
+ const et = me(), ct = () => process.env.CI === "true", Mt = (t) => t.isTTY === !0, C = (t, r) => et ? t : r, Rt = C("◆", "*"), dt = C("■", "x"), $t = C("▲", "x"), V = C("◇", "o"), ht = C("┌", "T"), d = C("│", "|"), x = C("└", "—"), Ot = C("┐", "T"), Pt = C("┘", "—"), Q = C("●", ">"), H = C("○", " "), st = C("◻", "[•]"), U = C("◼", "[+]"), q = C("◻", "[ ]"), Nt = C("▪", "•"), rt = C("─", "-"), mt = C("╮", "+"), Wt = C("├", "+"), pt = C("╯", "+"), gt = C("╰", "+"), Lt = C("╭", "+"), ft = C("●", "•"), Ft = C("◆", "*"), yt = C("▲", "!"), Et = C("■", "x"), W = (t) => {
820
839
  switch (t) {
821
840
  case "initial":
822
- case "active": return import_picocolors.default.cyan(le);
823
- case "cancel": return import_picocolors.default.red(L);
824
- case "error": return import_picocolors.default.yellow(W);
825
- case "submit": return import_picocolors.default.green(C);
826
- }
827
- }, G = (t) => {
828
- const { cursor: n, options: r, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
829
- let l = 0;
830
- n >= l + a - 3 ? l = Math.max(Math.min(n - a + 3, r.length - a), 0) : n < l + 2 && (l = Math.max(n - 2, 0));
831
- const $ = a < r.length && l > 0, g = a < r.length && l + a < r.length;
832
- return r.slice(l, l + a).map((p, v, f) => {
833
- const j = v === 0 && $, E = v === f.length - 1 && g;
834
- return j || E ? import_picocolors.default.dim("...") : i(p, v + l === n);
835
- });
836
- }, he = (t) => new RD({
837
- validate: t.validate,
838
- placeholder: t.placeholder,
839
- defaultValue: t.defaultValue,
840
- initialValue: t.initialValue,
841
- render() {
842
- const n = `${import_picocolors.default.gray(o)}
843
- ${b(this.state)} ${t.message}
844
- `, r = t.placeholder ? import_picocolors.default.inverse(t.placeholder[0]) + import_picocolors.default.dim(t.placeholder.slice(1)) : import_picocolors.default.inverse(import_picocolors.default.hidden("_")), i = this.value ? this.valueWithCursor : r;
845
- switch (this.state) {
846
- case "error": return `${n.trim()}
847
- ${import_picocolors.default.yellow(o)} ${i}
848
- ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
849
- `;
850
- case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t.placeholder)}`;
851
- case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
852
- ${import_picocolors.default.gray(o)}` : ""}`;
853
- default: return `${n}${import_picocolors.default.cyan(o)} ${i}
854
- ${import_picocolors.default.cyan(d)}
855
- `;
841
+ case "active": return import_picocolors.default.cyan(Rt);
842
+ case "cancel": return import_picocolors.default.red(dt);
843
+ case "error": return import_picocolors.default.yellow($t);
844
+ case "submit": return import_picocolors.default.green(V);
845
+ }
846
+ }, vt = (t) => {
847
+ switch (t) {
848
+ case "initial":
849
+ case "active": return import_picocolors.default.cyan(d);
850
+ case "cancel": return import_picocolors.default.red(d);
851
+ case "error": return import_picocolors.default.yellow(d);
852
+ case "submit": return import_picocolors.default.green(d);
853
+ }
854
+ }, pe = (t) => t === 161 || t === 164 || t === 167 || t === 168 || t === 170 || t === 173 || t === 174 || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || t === 198 || t === 208 || t === 215 || t === 216 || t >= 222 && t <= 225 || t === 230 || t >= 232 && t <= 234 || t === 236 || t === 237 || t === 240 || t === 242 || t === 243 || t >= 247 && t <= 250 || t === 252 || t === 254 || t === 257 || t === 273 || t === 275 || t === 283 || t === 294 || t === 295 || t === 299 || t >= 305 && t <= 307 || t === 312 || t >= 319 && t <= 322 || t === 324 || t >= 328 && t <= 331 || t === 333 || t === 338 || t === 339 || t === 358 || t === 359 || t === 363 || t === 462 || t === 464 || t === 466 || t === 468 || t === 470 || t === 472 || t === 474 || t === 476 || t === 593 || t === 609 || t === 708 || t === 711 || t >= 713 && t <= 715 || t === 717 || t === 720 || t >= 728 && t <= 731 || t === 733 || t === 735 || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || t === 1025 || t >= 1040 && t <= 1103 || t === 1105 || t === 8208 || t >= 8211 && t <= 8214 || t === 8216 || t === 8217 || t === 8220 || t === 8221 || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || t === 8240 || t === 8242 || t === 8243 || t === 8245 || t === 8251 || t === 8254 || t === 8308 || t === 8319 || t >= 8321 && t <= 8324 || t === 8364 || t === 8451 || t === 8453 || t === 8457 || t === 8467 || t === 8470 || t === 8481 || t === 8482 || t === 8486 || t === 8491 || t === 8531 || t === 8532 || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || t === 8585 || t >= 8592 && t <= 8601 || t === 8632 || t === 8633 || t === 8658 || t === 8660 || t === 8679 || t === 8704 || t === 8706 || t === 8707 || t === 8711 || t === 8712 || t === 8715 || t === 8719 || t === 8721 || t === 8725 || t === 8730 || t >= 8733 && t <= 8736 || t === 8739 || t === 8741 || t >= 8743 && t <= 8748 || t === 8750 || t >= 8756 && t <= 8759 || t === 8764 || t === 8765 || t === 8776 || t === 8780 || t === 8786 || t === 8800 || t === 8801 || t >= 8804 && t <= 8807 || t === 8810 || t === 8811 || t === 8814 || t === 8815 || t === 8834 || t === 8835 || t === 8838 || t === 8839 || t === 8853 || t === 8857 || t === 8869 || t === 8895 || t === 8978 || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || t === 9632 || t === 9633 || t >= 9635 && t <= 9641 || t === 9650 || t === 9651 || t === 9654 || t === 9655 || t === 9660 || t === 9661 || t === 9664 || t === 9665 || t >= 9670 && t <= 9672 || t === 9675 || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || t === 9711 || t === 9733 || t === 9734 || t === 9737 || t === 9742 || t === 9743 || t === 9756 || t === 9758 || t === 9792 || t === 9794 || t === 9824 || t === 9825 || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || t === 9836 || t === 9837 || t === 9839 || t === 9886 || t === 9887 || t === 9919 || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || t === 9955 || t === 9960 || t === 9961 || t >= 9963 && t <= 9969 || t === 9972 || t >= 9974 && t <= 9977 || t === 9979 || t === 9980 || t === 9982 || t === 9983 || t === 10045 || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || t === 65533 || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || t === 127375 || t === 127376 || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109, ge = (t) => t === 12288 || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510, fe = (t) => t >= 4352 && t <= 4447 || t === 8986 || t === 8987 || t === 9001 || t === 9002 || t >= 9193 && t <= 9196 || t === 9200 || t === 9203 || t === 9725 || t === 9726 || t === 9748 || t === 9749 || t >= 9800 && t <= 9811 || t === 9855 || t === 9875 || t === 9889 || t === 9898 || t === 9899 || t === 9917 || t === 9918 || t === 9924 || t === 9925 || t === 9934 || t === 9940 || t === 9962 || t === 9970 || t === 9971 || t === 9973 || t === 9978 || t === 9981 || t === 9989 || t === 9994 || t === 9995 || t === 10024 || t === 10060 || t === 10062 || t >= 10067 && t <= 10069 || t === 10071 || t >= 10133 && t <= 10135 || t === 10160 || t === 10175 || t === 11035 || t === 11036 || t === 11088 || t === 11093 || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || t === 94192 || t === 94193 || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || t === 110589 || t === 110590 || t >= 110592 && t <= 110882 || t === 110898 || t >= 110928 && t <= 110930 || t === 110933 || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || t === 126980 || t === 127183 || t === 127374 || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || t === 127568 || t === 127569 || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || t === 127988 || t >= 127992 && t <= 128062 || t === 128064 || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || t === 128378 || t === 128405 || t === 128406 || t === 128420 || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || t === 128716 || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || t === 128747 || t === 128748 || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || t === 129008 || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141, At = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, it = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, nt = /\t{1,1000}/y, wt = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy, at = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, Fe = /\p{M}+/gu, ye = {
855
+ limit: Infinity,
856
+ ellipsis: ""
857
+ }, jt = (t, r = {}, s = {}) => {
858
+ const i = r.limit ?? Infinity, a = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (a ? jt(a, ye, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, n = s.tabWidth ?? 8, c = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, F = s.fullWidthWidth ?? 2, p = s.regularWidth ?? 1, E = s.wideWidth ?? 2;
859
+ let $ = 0, m = 0, h = t.length, y = 0, f = !1, v = h, S = Math.max(0, i - o), I = 0, B = 0, A = 0, w = 0;
860
+ t: for (;;) {
861
+ if (B > I || m >= h && m > $) {
862
+ const _ = t.slice(I, B) || t.slice($, m);
863
+ y = 0;
864
+ for (const D of _.replaceAll(Fe, "")) {
865
+ const T = D.codePointAt(0) || 0;
866
+ if (ge(T) ? w = F : fe(T) ? w = E : c !== p && pe(T) ? w = c : w = p, A + w > S && (v = Math.min(v, Math.max(I, $) + y)), A + w > i) {
867
+ f = !0;
868
+ break t;
869
+ }
870
+ y += D.length, A += w;
871
+ }
872
+ I = B = 0;
873
+ }
874
+ if (m >= h) break;
875
+ if (at.lastIndex = m, at.test(t)) {
876
+ if (y = at.lastIndex - m, w = y * p, A + w > S && (v = Math.min(v, m + Math.floor((S - A) / p))), A + w > i) {
877
+ f = !0;
878
+ break;
879
+ }
880
+ A += w, I = $, B = m, m = $ = at.lastIndex;
881
+ continue;
882
+ }
883
+ if (At.lastIndex = m, At.test(t)) {
884
+ if (A + u > S && (v = Math.min(v, m)), A + u > i) {
885
+ f = !0;
886
+ break;
887
+ }
888
+ A += u, I = $, B = m, m = $ = At.lastIndex;
889
+ continue;
890
+ }
891
+ if (it.lastIndex = m, it.test(t)) {
892
+ if (y = it.lastIndex - m, w = y * l, A + w > S && (v = Math.min(v, m + Math.floor((S - A) / l))), A + w > i) {
893
+ f = !0;
894
+ break;
895
+ }
896
+ A += w, I = $, B = m, m = $ = it.lastIndex;
897
+ continue;
898
+ }
899
+ if (nt.lastIndex = m, nt.test(t)) {
900
+ if (y = nt.lastIndex - m, w = y * n, A + w > S && (v = Math.min(v, m + Math.floor((S - A) / n))), A + w > i) {
901
+ f = !0;
902
+ break;
903
+ }
904
+ A += w, I = $, B = m, m = $ = nt.lastIndex;
905
+ continue;
906
+ }
907
+ if (wt.lastIndex = m, wt.test(t)) {
908
+ if (A + g > S && (v = Math.min(v, m)), A + g > i) {
909
+ f = !0;
910
+ break;
911
+ }
912
+ A += g, I = $, B = m, m = $ = wt.lastIndex;
913
+ continue;
856
914
  }
915
+ m += 1;
916
+ }
917
+ return {
918
+ width: f ? S : A,
919
+ index: f ? v : h,
920
+ truncated: f,
921
+ ellipsed: f && i >= o
922
+ };
923
+ }, Ee = {
924
+ limit: Infinity,
925
+ ellipsis: "",
926
+ ellipsisWidth: 0
927
+ }, M = (t, r = {}) => jt(t, Ee, r).width, ot$1 = "\x1B", Gt = "›", ve = 39, Ct = "\x07", kt = "[", Ae = "]", Vt = "m", St = `${Ae}8;;`, Ht = new RegExp(`(?:\\${kt}(?<code>\\d+)m|\\${St}(?<uri>.*)${Ct})`, "y"), we = (t) => {
928
+ if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
929
+ if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
930
+ if (t === 1 || t === 2) return 22;
931
+ if (t === 3) return 23;
932
+ if (t === 4) return 24;
933
+ if (t === 7) return 27;
934
+ if (t === 8) return 28;
935
+ if (t === 9) return 29;
936
+ if (t === 0) return 0;
937
+ }, Ut = (t) => `${ot$1}${kt}${t}${Vt}`, Kt = (t) => `${ot$1}${St}${t}${Ct}`, Ce = (t) => t.map((r) => M(r)), It = (t, r, s) => {
938
+ const i = r[Symbol.iterator]();
939
+ let a = !1, o = !1, u = t.at(-1), l = u === void 0 ? 0 : M(u), n = i.next(), c = i.next(), g = 0;
940
+ for (; !n.done;) {
941
+ const F = n.value, p = M(F);
942
+ l + p <= s ? t[t.length - 1] += F : (t.push(F), l = 0), (F === ot$1 || F === Gt) && (a = !0, o = r.startsWith(St, g + 1)), a ? o ? F === Ct && (a = !1, o = !1) : F === Vt && (a = !1) : (l += p, l === s && !c.done && (t.push(""), l = 0)), n = c, c = i.next(), g += F.length;
943
+ }
944
+ u = t.at(-1), !l && u !== void 0 && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
945
+ }, Se = (t) => {
946
+ const r = t.split(" ");
947
+ let s = r.length;
948
+ for (; s > 0 && !(M(r[s - 1]) > 0);) s--;
949
+ return s === r.length ? t : r.slice(0, s).join(" ") + r.slice(s).join("");
950
+ }, Ie = (t, r, s = {}) => {
951
+ if (s.trim !== !1 && t.trim() === "") return "";
952
+ let i = "", a, o;
953
+ const u = t.split(" "), l = Ce(u);
954
+ let n = [""];
955
+ for (const [$, m] of u.entries()) {
956
+ s.trim !== !1 && (n[n.length - 1] = (n.at(-1) ?? "").trimStart());
957
+ let h = M(n.at(-1) ?? "");
958
+ if ($ !== 0 && (h >= r && (s.wordWrap === !1 || s.trim === !1) && (n.push(""), h = 0), (h > 0 || s.trim === !1) && (n[n.length - 1] += " ", h++)), s.hard && l[$] > r) {
959
+ const y = r - h, f = 1 + Math.floor((l[$] - y - 1) / r);
960
+ Math.floor((l[$] - 1) / r) < f && n.push(""), It(n, m, r);
961
+ continue;
962
+ }
963
+ if (h + l[$] > r && h > 0 && l[$] > 0) {
964
+ if (s.wordWrap === !1 && h < r) {
965
+ It(n, m, r);
966
+ continue;
967
+ }
968
+ n.push("");
969
+ }
970
+ if (h + l[$] > r && s.wordWrap === !1) {
971
+ It(n, m, r);
972
+ continue;
973
+ }
974
+ n[n.length - 1] += m;
975
+ }
976
+ s.trim !== !1 && (n = n.map(($) => Se($)));
977
+ const c = n.join(`
978
+ `), g = c[Symbol.iterator]();
979
+ let F = g.next(), p = g.next(), E = 0;
980
+ for (; !F.done;) {
981
+ const $ = F.value, m = p.value;
982
+ if (i += $, $ === ot$1 || $ === Gt) {
983
+ Ht.lastIndex = E + 1;
984
+ const f = Ht.exec(c)?.groups;
985
+ if (f?.code !== void 0) {
986
+ const v = Number.parseFloat(f.code);
987
+ a = v === ve ? void 0 : v;
988
+ } else f?.uri !== void 0 && (o = f.uri.length === 0 ? void 0 : f.uri);
989
+ }
990
+ const h = a ? we(a) : void 0;
991
+ m === `
992
+ ` ? (o && (i += Kt("")), a && h && (i += Ut(h))) : $ === `
993
+ ` && (a && h && (i += Ut(a)), o && (i += Kt(o))), E += $.length, F = p, p = g.next();
994
+ }
995
+ return i;
996
+ };
997
+ function J(t, r, s) {
998
+ return String(t).normalize().replaceAll(`\r
999
+ `, `
1000
+ `).split(`
1001
+ `).map((i) => Ie(i, r, s)).join(`
1002
+ `);
1003
+ }
1004
+ const be = (t, r, s, i, a) => {
1005
+ let o = r, u = 0;
1006
+ for (let l = s; l < i; l++) {
1007
+ const n = t[l];
1008
+ if (o = o - n.length, u++, o <= a) break;
1009
+ }
1010
+ return {
1011
+ lineCount: o,
1012
+ removals: u
1013
+ };
1014
+ }, X = (t) => {
1015
+ const { cursor: r, options: s, style: i } = t, a = t.output ?? process.stdout, o = rt$1(a), u = t.columnPadding ?? 0, l = t.rowPadding ?? 4, n = o - u, c = nt$1(a), g = import_picocolors.default.dim("..."), F = t.maxItems ?? Number.POSITIVE_INFINITY, p = Math.max(c - l, 0), E = Math.max(Math.min(F, p), 5);
1016
+ let $ = 0;
1017
+ r >= E - 3 && ($ = Math.max(Math.min(r - E + 3, s.length - E), 0));
1018
+ let m = E < s.length && $ > 0, h = E < s.length && $ + E < s.length;
1019
+ const y = Math.min($ + E, s.length), f = [];
1020
+ let v = 0;
1021
+ m && v++, h && v++;
1022
+ const S = $ + (m ? 1 : 0), I = y - (h ? 1 : 0);
1023
+ for (let A = S; A < I; A++) {
1024
+ const w = J(i(s[A], A === r), n, {
1025
+ hard: !0,
1026
+ trim: !1
1027
+ }).split(`
1028
+ `);
1029
+ f.push(w), v += w.length;
1030
+ }
1031
+ if (v > p) {
1032
+ let A = 0, w = 0, _ = v;
1033
+ const D = r - S, T = (Y, L) => be(f, _, Y, L, p);
1034
+ m ? ({lineCount: _, removals: A} = T(0, D), _ > p && ({lineCount: _, removals: w} = T(D + 1, f.length))) : ({lineCount: _, removals: w} = T(D + 1, f.length), _ > p && ({lineCount: _, removals: A} = T(0, D))), A > 0 && (m = !0, f.splice(0, A)), w > 0 && (h = !0, f.splice(f.length - w, w));
857
1035
  }
858
- }).prompt(), ge = (t) => new MD({
1036
+ const B = [];
1037
+ m && B.push(g);
1038
+ for (const A of f) for (const w of A) B.push(w);
1039
+ return h && B.push(g), B;
1040
+ };
1041
+ function qt(t) {
1042
+ return t.label ?? String(t.value ?? "");
1043
+ }
1044
+ function Jt(t, r) {
1045
+ if (!t) return !0;
1046
+ const s = (r.label ?? String(r.value ?? "")).toLowerCase(), i = (r.hint ?? "").toLowerCase(), a = String(r.value).toLowerCase(), o = t.toLowerCase();
1047
+ return s.includes(o) || i.includes(o) || a.includes(o);
1048
+ }
1049
+ function Be(t, r) {
1050
+ const s = [];
1051
+ for (const i of r) t.includes(i.value) && s.push(i);
1052
+ return s;
1053
+ }
1054
+ const Xt = (t) => new Vt$1({
1055
+ options: t.options,
1056
+ initialValue: t.initialValue ? [t.initialValue] : void 0,
1057
+ initialUserInput: t.initialUserInput,
1058
+ filter: t.filter ?? ((r, s) => Jt(r, s)),
1059
+ signal: t.signal,
1060
+ input: t.input,
1061
+ output: t.output,
859
1062
  validate: t.validate,
860
- mask: t.mask ?? $e,
861
1063
  render() {
862
- const n = `${import_picocolors.default.gray(o)}
863
- ${b(this.state)} ${t.message}
864
- `, r = this.valueWithCursor, i = this.masked;
1064
+ const r = t.withGuide ?? _.withGuide, s = r ? [`${import_picocolors.default.gray(d)}`, `${W(this.state)} ${t.message}`] : [`${W(this.state)} ${t.message}`], i = this.userInput, a = this.options, o = t.placeholder, u = i === "" && o !== void 0, l = (n, c) => {
1065
+ const g = qt(n), F = n.hint && n.value === this.focusedValue ? import_picocolors.default.dim(` (${n.hint})`) : "";
1066
+ switch (c) {
1067
+ case "active": return `${import_picocolors.default.green(Q)} ${g}${F}`;
1068
+ case "inactive": return `${import_picocolors.default.dim(H)} ${import_picocolors.default.dim(g)}`;
1069
+ case "disabled": return `${import_picocolors.default.gray(H)} ${import_picocolors.default.strikethrough(import_picocolors.default.gray(g))}`;
1070
+ }
1071
+ };
865
1072
  switch (this.state) {
866
- case "error": return `${n.trim()}
867
- ${import_picocolors.default.yellow(o)} ${i}
868
- ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
869
- `;
870
- case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(i)}`;
871
- case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i ?? ""))}${i ? `
872
- ${import_picocolors.default.gray(o)}` : ""}`;
873
- default: return `${n}${import_picocolors.default.cyan(o)} ${r}
874
- ${import_picocolors.default.cyan(d)}
875
- `;
1073
+ case "submit": {
1074
+ const n = Be(this.selectedValues, a), c = n.length > 0 ? ` ${import_picocolors.default.dim(n.map(qt).join(", "))}` : "", g = r ? import_picocolors.default.gray(d) : "";
1075
+ return `${s.join(`
1076
+ `)}
1077
+ ${g}${c}`;
1078
+ }
1079
+ case "cancel": {
1080
+ const n = i ? ` ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i))}` : "", c = r ? import_picocolors.default.gray(d) : "";
1081
+ return `${s.join(`
1082
+ `)}
1083
+ ${c}${n}`;
1084
+ }
1085
+ default: {
1086
+ const n = this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.cyan, c = r ? `${n(d)} ` : "", g = r ? n(x) : "";
1087
+ let F = "";
1088
+ if (this.isNavigating || u) {
1089
+ const f = u ? o : i;
1090
+ F = f !== "" ? ` ${import_picocolors.default.dim(f)}` : "";
1091
+ } else F = ` ${this.userInputWithCursor}`;
1092
+ const p = this.filteredOptions.length !== a.length ? import_picocolors.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "", E = this.filteredOptions.length === 0 && i ? [`${c}${import_picocolors.default.yellow("No matches found")}`] : [], $ = this.state === "error" ? [`${c}${import_picocolors.default.yellow(this.error)}`] : [];
1093
+ r && s.push(`${c.trimEnd()}`), s.push(`${c}${import_picocolors.default.dim("Search:")}${F}${p}`, ...E, ...$);
1094
+ const h = [`${c}${[
1095
+ `${import_picocolors.default.dim("↑/↓")} to select`,
1096
+ `${import_picocolors.default.dim("Enter:")} confirm`,
1097
+ `${import_picocolors.default.dim("Type:")} to search`
1098
+ ].join(" • ")}`, g], y = this.filteredOptions.length === 0 ? [] : X({
1099
+ cursor: this.cursor,
1100
+ options: this.filteredOptions,
1101
+ columnPadding: r ? 3 : 0,
1102
+ rowPadding: s.length + h.length,
1103
+ style: (f, v) => l(f, f.disabled ? "disabled" : v ? "active" : "inactive"),
1104
+ maxItems: t.maxItems,
1105
+ output: t.output
1106
+ });
1107
+ return [
1108
+ ...s,
1109
+ ...y.map((f) => `${c}${f}`),
1110
+ ...h
1111
+ ].join(`
1112
+ `);
1113
+ }
876
1114
  }
877
1115
  }
878
- }).prompt(), ye = (t) => {
879
- const n = t.active ?? "Yes", r = t.inactive ?? "No";
880
- return new dD({
881
- active: n,
882
- inactive: r,
883
- initialValue: t.initialValue ?? !0,
1116
+ }).prompt(), xe = (t) => {
1117
+ const r = (i, a, o, u) => {
1118
+ const l = o.includes(i.value), n = i.label ?? String(i.value ?? ""), c = i.hint && u !== void 0 && i.value === u ? import_picocolors.default.dim(` (${i.hint})`) : "", g = l ? import_picocolors.default.green(U) : import_picocolors.default.dim(q);
1119
+ return i.disabled ? `${import_picocolors.default.gray(q)} ${import_picocolors.default.strikethrough(import_picocolors.default.gray(n))}` : a ? `${g} ${n}${c}` : `${g} ${import_picocolors.default.dim(n)}`;
1120
+ }, s = new Vt$1({
1121
+ options: t.options,
1122
+ multiple: !0,
1123
+ filter: t.filter ?? ((i, a) => Jt(i, a)),
1124
+ validate: () => {
1125
+ if (t.required && s.selectedValues.length === 0) return "Please select at least one item";
1126
+ },
1127
+ initialValue: t.initialValues,
1128
+ signal: t.signal,
1129
+ input: t.input,
1130
+ output: t.output,
884
1131
  render() {
885
- const i = `${import_picocolors.default.gray(o)}
886
- ${b(this.state)} ${t.message}
887
- `, s = this.value ? n : r;
1132
+ const i = `${import_picocolors.default.gray(d)}
1133
+ ${W(this.state)} ${t.message}
1134
+ `, a = this.userInput, o = t.placeholder, u = a === "" && o !== void 0, l = this.isNavigating || u ? import_picocolors.default.dim(u ? o : a) : this.userInputWithCursor, n = this.options, c = this.filteredOptions.length !== n.length ? import_picocolors.default.dim(` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`) : "";
888
1135
  switch (this.state) {
889
- case "submit": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s)}`;
890
- case "cancel": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}
891
- ${import_picocolors.default.gray(o)}`;
892
- default: return `${i}${import_picocolors.default.cyan(o)} ${this.value ? `${import_picocolors.default.green(k)} ${n}` : `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(n)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(r)}` : `${import_picocolors.default.green(k)} ${r}`}
893
- ${import_picocolors.default.cyan(d)}
894
- `;
1136
+ case "submit": return `${i}${import_picocolors.default.gray(d)} ${import_picocolors.default.dim(`${this.selectedValues.length} items selected`)}`;
1137
+ case "cancel": return `${i}${import_picocolors.default.gray(d)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}`;
1138
+ default: {
1139
+ const g = this.state === "error" ? import_picocolors.default.yellow : import_picocolors.default.cyan, F = [
1140
+ `${import_picocolors.default.dim("↑/↓")} to navigate`,
1141
+ `${import_picocolors.default.dim(this.isNavigating ? "Space/Tab:" : "Tab:")} select`,
1142
+ `${import_picocolors.default.dim("Enter:")} confirm`,
1143
+ `${import_picocolors.default.dim("Type:")} to search`
1144
+ ], p = this.filteredOptions.length === 0 && a ? [`${g(d)} ${import_picocolors.default.yellow("No matches found")}`] : [], E = this.state === "error" ? [`${g(d)} ${import_picocolors.default.yellow(this.error)}`] : [], $ = [
1145
+ ...`${i}${g(d)}`.split(`
1146
+ `),
1147
+ `${g(d)} ${import_picocolors.default.dim("Search:")} ${l}${c}`,
1148
+ ...p,
1149
+ ...E
1150
+ ], m = [`${g(d)} ${F.join(" • ")}`, `${g(x)}`], h = X({
1151
+ cursor: this.cursor,
1152
+ options: this.filteredOptions,
1153
+ style: (y, f) => r(y, f, this.selectedValues, this.focusedValue),
1154
+ maxItems: t.maxItems,
1155
+ output: t.output,
1156
+ rowPadding: $.length + m.length
1157
+ });
1158
+ return [
1159
+ ...$,
1160
+ ...h.map((y) => `${g(d)} ${y}`),
1161
+ ...m
1162
+ ].join(`
1163
+ `);
1164
+ }
895
1165
  }
896
1166
  }
897
- }).prompt();
898
- }, ve = (t) => {
899
- const n = (r, i) => {
900
- const s = r.label ?? String(r.value);
901
- switch (i) {
902
- case "selected": return `${import_picocolors.default.dim(s)}`;
903
- case "active": return `${import_picocolors.default.green(k)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}`;
904
- case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
905
- default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
1167
+ });
1168
+ return s.prompt();
1169
+ }, _e = [
1170
+ Lt,
1171
+ mt,
1172
+ gt,
1173
+ pt
1174
+ ], De = [
1175
+ ht,
1176
+ Ot,
1177
+ x,
1178
+ Pt
1179
+ ];
1180
+ function Yt(t, r, s, i) {
1181
+ let a = s, o = s;
1182
+ return i === "center" ? a = Math.floor((r - t) / 2) : i === "right" && (a = r - t - s), o = r - a - t, [a, o];
1183
+ }
1184
+ const Te = (t) => t, Me = (t = "", r = "", s) => {
1185
+ const i = s?.output ?? process.stdout, a = rt$1(i), o = 2, u = s?.titlePadding ?? 1, l = s?.contentPadding ?? 2, n = s?.width === void 0 || s.width === "auto" ? 1 : Math.min(1, s.width), c = s?.withGuide ?? _.withGuide ? `${d} ` : "", g = s?.formatBorder ?? Te, F = (s?.rounded ? _e : De).map(g), p = g(rt), E = g(d), $ = M(c), m = M(r), h = a - $;
1186
+ let y = Math.floor(a * n) - $;
1187
+ if (s?.width === "auto") {
1188
+ const _ = t.split(`
1189
+ `);
1190
+ let D = m + u * 2;
1191
+ for (const Y of _) {
1192
+ const L = M(Y) + l * 2;
1193
+ L > D && (D = L);
906
1194
  }
907
- };
908
- return new LD({
909
- options: t.options,
910
- initialValue: t.initialValue,
1195
+ const T = D + o;
1196
+ T < y && (y = T);
1197
+ }
1198
+ y % 2 !== 0 && (y < h ? y++ : y--);
1199
+ const f = y - o, v = f - u * 2, S = m > v ? `${r.slice(0, v - 3)}...` : r, [I, B] = Yt(M(S), f, u, s?.titleAlign), A = J(t, f - l * 2, {
1200
+ hard: !0,
1201
+ trim: !1
1202
+ });
1203
+ i.write(`${c}${F[0]}${p.repeat(I)}${S}${p.repeat(B)}${F[1]}
1204
+ `);
1205
+ const w = A.split(`
1206
+ `);
1207
+ for (const _ of w) {
1208
+ const [D, T] = Yt(M(_), f, l, s?.contentAlign);
1209
+ i.write(`${c}${E}${" ".repeat(D)}${_}${" ".repeat(T)}${E}
1210
+ `);
1211
+ }
1212
+ i.write(`${c}${F[2]}${p.repeat(f)}${F[3]}
1213
+ `);
1214
+ }, Re = (t) => {
1215
+ const r = t.active ?? "Yes", s = t.inactive ?? "No";
1216
+ return new kt$1({
1217
+ active: r,
1218
+ inactive: s,
1219
+ signal: t.signal,
1220
+ input: t.input,
1221
+ output: t.output,
1222
+ initialValue: t.initialValue ?? !0,
911
1223
  render() {
912
- const r = `${import_picocolors.default.gray(o)}
913
- ${b(this.state)} ${t.message}
914
- `;
1224
+ const i = t.withGuide ?? _.withGuide, a = `${i ? `${import_picocolors.default.gray(d)}
1225
+ ` : ""}${W(this.state)} ${t.message}
1226
+ `, o = this.value ? r : s;
915
1227
  switch (this.state) {
916
- case "submit": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
917
- case "cancel": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
918
- ${import_picocolors.default.gray(o)}`;
919
- default: return `${r}${import_picocolors.default.cyan(o)} ${G({
920
- cursor: this.cursor,
921
- options: this.options,
922
- maxItems: t.maxItems,
923
- style: (i, s) => n(i, s ? "active" : "inactive")
924
- }).join(`
925
- ${import_picocolors.default.cyan(o)} `)}
926
- ${import_picocolors.default.cyan(d)}
1228
+ case "submit": return `${a}${i ? `${import_picocolors.default.gray(d)} ` : ""}${import_picocolors.default.dim(o)}`;
1229
+ case "cancel": return `${a}${i ? `${import_picocolors.default.gray(d)} ` : ""}${import_picocolors.default.strikethrough(import_picocolors.default.dim(o))}${i ? `
1230
+ ${import_picocolors.default.gray(d)}` : ""}`;
1231
+ default: {
1232
+ const u = i ? `${import_picocolors.default.cyan(d)} ` : "", l = i ? import_picocolors.default.cyan(x) : "";
1233
+ return `${a}${u}${this.value ? `${import_picocolors.default.green(Q)} ${r}` : `${import_picocolors.default.dim(H)} ${import_picocolors.default.dim(r)}`}${t.vertical ? i ? `
1234
+ ${import_picocolors.default.cyan(d)} ` : `
1235
+ ` : ` ${import_picocolors.default.dim("/")} `}${this.value ? `${import_picocolors.default.dim(H)} ${import_picocolors.default.dim(s)}` : `${import_picocolors.default.green(Q)} ${s}`}
1236
+ ${l}
927
1237
  `;
1238
+ }
928
1239
  }
929
1240
  }
930
1241
  }).prompt();
931
- }, we = (t) => {
932
- const n = (r, i = "inactive") => {
933
- const s = r.label ?? String(r.value);
934
- return i === "selected" ? `${import_picocolors.default.dim(s)}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active" ? `${import_picocolors.default.bgCyan(import_picocolors.default.gray(` ${r.value} `))} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : `${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(` ${r.value} `)))} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}`;
935
- };
936
- return new ID({
937
- options: t.options,
938
- initialValue: t.initialValue,
939
- render() {
940
- const r = `${import_picocolors.default.gray(o)}
941
- ${b(this.state)} ${t.message}
942
- `;
943
- switch (this.state) {
944
- case "submit": return `${r}${import_picocolors.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
945
- case "cancel": return `${r}${import_picocolors.default.gray(o)} ${n(this.options[0], "cancelled")}
946
- ${import_picocolors.default.gray(o)}`;
947
- default: return `${r}${import_picocolors.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
948
- ${import_picocolors.default.cyan(o)} `)}
949
- ${import_picocolors.default.cyan(d)}
950
- `;
951
- }
1242
+ }, Oe = async (t, r) => {
1243
+ const s = {}, i = Object.keys(t);
1244
+ for (const a of i) {
1245
+ const o = t[a], u = await o({ results: s })?.catch((l) => {
1246
+ throw l;
1247
+ });
1248
+ if (typeof r?.onCancel == "function" && Ct$1(u)) {
1249
+ s[a] = "canceled", r.onCancel({ results: s });
1250
+ continue;
952
1251
  }
953
- }).prompt();
954
- }, fe = (t) => {
955
- const n = (r, i) => {
956
- const s = r.label ?? String(r.value);
957
- return i === "active" ? `${import_picocolors.default.cyan(A)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "selected" ? `${import_picocolors.default.green(T)} ${import_picocolors.default.dim(s)} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active-selected" ? `${import_picocolors.default.green(T)} ${s} ${r.hint ? import_picocolors.default.dim(`(${r.hint})`) : ""}` : i === "submitted" ? `${import_picocolors.default.dim(s)}` : `${import_picocolors.default.dim(F)} ${import_picocolors.default.dim(s)}`;
958
- };
959
- return new SD({
1252
+ s[a] = u;
1253
+ }
1254
+ return s;
1255
+ }, Pe = (t) => {
1256
+ const { selectableGroups: r = !0, groupSpacing: s = 0 } = t, i = (o, u, l = []) => {
1257
+ const n = o.label ?? String(o.value), c = typeof o.group == "string", g = c && (l[l.indexOf(o) + 1] ?? { group: !0 }), F = c && g && g.group === !0, p = c ? r ? `${F ? x : d} ` : " " : "";
1258
+ let E = "";
1259
+ if (s > 0 && !c) {
1260
+ const m = `
1261
+ ${import_picocolors.default.cyan(d)}`;
1262
+ E = `${m.repeat(s - 1)}${m} `;
1263
+ }
1264
+ if (u === "active") return `${E}${import_picocolors.default.dim(p)}${import_picocolors.default.cyan(st)} ${n}${o.hint ? ` ${import_picocolors.default.dim(`(${o.hint})`)}` : ""}`;
1265
+ if (u === "group-active") return `${E}${p}${import_picocolors.default.cyan(st)} ${import_picocolors.default.dim(n)}`;
1266
+ if (u === "group-active-selected") return `${E}${p}${import_picocolors.default.green(U)} ${import_picocolors.default.dim(n)}`;
1267
+ if (u === "selected") {
1268
+ const m = c || r ? import_picocolors.default.green(U) : "";
1269
+ return `${E}${import_picocolors.default.dim(p)}${m} ${import_picocolors.default.dim(n)}${o.hint ? ` ${import_picocolors.default.dim(`(${o.hint})`)}` : ""}`;
1270
+ }
1271
+ if (u === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(n))}`;
1272
+ if (u === "active-selected") return `${E}${import_picocolors.default.dim(p)}${import_picocolors.default.green(U)} ${n}${o.hint ? ` ${import_picocolors.default.dim(`(${o.hint})`)}` : ""}`;
1273
+ if (u === "submitted") return `${import_picocolors.default.dim(n)}`;
1274
+ const $ = c || r ? import_picocolors.default.dim(q) : "";
1275
+ return `${E}${import_picocolors.default.dim(p)}${$} ${import_picocolors.default.dim(n)}`;
1276
+ }, a = t.required ?? !0;
1277
+ return new yt$1({
960
1278
  options: t.options,
1279
+ signal: t.signal,
1280
+ input: t.input,
1281
+ output: t.output,
961
1282
  initialValues: t.initialValues,
962
- required: t.required ?? !0,
1283
+ required: a,
963
1284
  cursorAt: t.cursorAt,
964
- validate(r) {
965
- if (this.required && r.length === 0) return `Please select at least one option.
1285
+ selectableGroups: r,
1286
+ validate(o) {
1287
+ if (a && (o === void 0 || o.length === 0)) return `Please select at least one option.
966
1288
  ${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
967
1289
  },
968
1290
  render() {
969
- const r = `${import_picocolors.default.gray(o)}
970
- ${b(this.state)} ${t.message}
971
- `, i = (s, c) => {
972
- const a = this.value.includes(s.value);
973
- return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
974
- };
1291
+ const o = `${import_picocolors.default.gray(d)}
1292
+ ${W(this.state)} ${t.message}
1293
+ `, u = this.value ?? [];
975
1294
  switch (this.state) {
976
- case "submit": return `${r}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => n(s, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`;
1295
+ case "submit": {
1296
+ const l = this.options.filter(({ value: c }) => u.includes(c)).map((c) => i(c, "submitted")), n = l.length === 0 ? "" : ` ${l.join(import_picocolors.default.dim(", "))}`;
1297
+ return `${o}${import_picocolors.default.gray(d)}${n}`;
1298
+ }
977
1299
  case "cancel": {
978
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors.default.dim(", "));
979
- return `${r}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
980
- ${import_picocolors.default.gray(o)}` : ""}`;
1300
+ const l = this.options.filter(({ value: n }) => u.includes(n)).map((n) => i(n, "cancelled")).join(import_picocolors.default.dim(", "));
1301
+ return `${o}${import_picocolors.default.gray(d)} ${l.trim() ? `${l}
1302
+ ${import_picocolors.default.gray(d)}` : ""}`;
981
1303
  }
982
1304
  case "error": {
983
- const s = this.error.split(`
984
- `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
1305
+ const l = this.error.split(`
1306
+ `).map((n, c) => c === 0 ? `${import_picocolors.default.yellow(x)} ${import_picocolors.default.yellow(n)}` : ` ${n}`).join(`
985
1307
  `);
986
- return `${r + import_picocolors.default.yellow(o)} ${G({
987
- options: this.options,
988
- cursor: this.cursor,
989
- maxItems: t.maxItems,
990
- style: i
1308
+ return `${o}${import_picocolors.default.yellow(d)} ${this.options.map((n, c, g) => {
1309
+ const F = u.includes(n.value) || n.group === !0 && this.isGroupSelected(`${n.value}`), p = c === this.cursor;
1310
+ return !p && typeof n.group == "string" && this.options[this.cursor].value === n.group ? i(n, F ? "group-active-selected" : "group-active", g) : p && F ? i(n, "active-selected", g) : F ? i(n, "selected", g) : i(n, p ? "active" : "inactive", g);
991
1311
  }).join(`
992
- ${import_picocolors.default.yellow(o)} `)}
993
- ${s}
1312
+ ${import_picocolors.default.yellow(d)} `)}
1313
+ ${l}
994
1314
  `;
995
1315
  }
996
- default: return `${r}${import_picocolors.default.cyan(o)} ${G({
997
- options: this.options,
998
- cursor: this.cursor,
999
- maxItems: t.maxItems,
1000
- style: i
1001
- }).join(`
1002
- ${import_picocolors.default.cyan(o)} `)}
1003
- ${import_picocolors.default.cyan(d)}
1316
+ default: {
1317
+ const l = this.options.map((c, g, F) => {
1318
+ const p = u.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), E = g === this.cursor, $ = !E && typeof c.group == "string" && this.options[this.cursor].value === c.group;
1319
+ let m = "";
1320
+ return $ ? m = i(c, p ? "group-active-selected" : "group-active", F) : E && p ? m = i(c, "active-selected", F) : p ? m = i(c, "selected", F) : m = i(c, E ? "active" : "inactive", F), `${g !== 0 && !m.startsWith(`
1321
+ `) ? " " : ""}${m}`;
1322
+ }).join(`
1323
+ ${import_picocolors.default.cyan(d)}`), n = l.startsWith(`
1324
+ `) ? "" : " ";
1325
+ return `${o}${import_picocolors.default.cyan(d)}${n}${l}
1326
+ ${import_picocolors.default.cyan(x)}
1004
1327
  `;
1328
+ }
1005
1329
  }
1006
1330
  }
1007
1331
  }).prompt();
1008
- }, be = (t) => {
1009
- const { selectableGroups: n = !0 } = t, r = (i, s, c = []) => {
1010
- const a = i.label ?? String(i.value), l = typeof i.group == "string", $ = l && (c[c.indexOf(i) + 1] ?? { group: !0 }), g = l && $.group === !0, p = l ? n ? `${g ? d : o} ` : " " : "";
1011
- if (s === "active") return `${import_picocolors.default.dim(p)}${import_picocolors.default.cyan(A)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1012
- if (s === "group-active") return `${p}${import_picocolors.default.cyan(A)} ${import_picocolors.default.dim(a)}`;
1013
- if (s === "group-active-selected") return `${p}${import_picocolors.default.green(T)} ${import_picocolors.default.dim(a)}`;
1014
- if (s === "selected") {
1015
- const f = l || n ? import_picocolors.default.green(T) : "";
1016
- return `${import_picocolors.default.dim(p)}${f} ${import_picocolors.default.dim(a)} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1017
- }
1018
- if (s === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}`;
1019
- if (s === "active-selected") return `${import_picocolors.default.dim(p)}${import_picocolors.default.green(T)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1020
- if (s === "submitted") return `${import_picocolors.default.dim(a)}`;
1021
- const v = l || n ? import_picocolors.default.dim(F) : "";
1022
- return `${import_picocolors.default.dim(p)}${v} ${import_picocolors.default.dim(a)}`;
1023
- };
1024
- return new _D({
1332
+ }, R = {
1333
+ message: (t = [], { symbol: r = import_picocolors.default.gray(d), secondarySymbol: s = import_picocolors.default.gray(d), output: i = process.stdout, spacing: a = 1, withGuide: o } = {}) => {
1334
+ const u = [], l = o ?? _.withGuide, n = l ? s : "", c = l ? `${r} ` : "", g = l ? `${s} ` : "";
1335
+ for (let p = 0; p < a; p++) u.push(n);
1336
+ const F = Array.isArray(t) ? t : t.split(`
1337
+ `);
1338
+ if (F.length > 0) {
1339
+ const [p, ...E] = F;
1340
+ p.length > 0 ? u.push(`${c}${p}`) : u.push(l ? r : "");
1341
+ for (const $ of E) $.length > 0 ? u.push(`${g}${$}`) : u.push(l ? s : "");
1342
+ }
1343
+ i.write(`${u.join(`
1344
+ `)}
1345
+ `);
1346
+ },
1347
+ info: (t, r) => {
1348
+ R.message(t, {
1349
+ ...r,
1350
+ symbol: import_picocolors.default.blue(ft)
1351
+ });
1352
+ },
1353
+ success: (t, r) => {
1354
+ R.message(t, {
1355
+ ...r,
1356
+ symbol: import_picocolors.default.green(Ft)
1357
+ });
1358
+ },
1359
+ step: (t, r) => {
1360
+ R.message(t, {
1361
+ ...r,
1362
+ symbol: import_picocolors.default.green(V)
1363
+ });
1364
+ },
1365
+ warn: (t, r) => {
1366
+ R.message(t, {
1367
+ ...r,
1368
+ symbol: import_picocolors.default.yellow(yt)
1369
+ });
1370
+ },
1371
+ warning: (t, r) => {
1372
+ R.warn(t, r);
1373
+ },
1374
+ error: (t, r) => {
1375
+ R.message(t, {
1376
+ ...r,
1377
+ symbol: import_picocolors.default.red(Et)
1378
+ });
1379
+ }
1380
+ }, Ne = (t = "", r) => {
1381
+ (r?.output ?? process.stdout).write(`${import_picocolors.default.gray(x)} ${import_picocolors.default.red(t)}
1382
+
1383
+ `);
1384
+ }, We = (t = "", r) => {
1385
+ (r?.output ?? process.stdout).write(`${import_picocolors.default.gray(ht)} ${t}
1386
+ `);
1387
+ }, Le = (t = "", r) => {
1388
+ (r?.output ?? process.stdout).write(`${import_picocolors.default.gray(d)}
1389
+ ${import_picocolors.default.gray(x)} ${t}
1390
+
1391
+ `);
1392
+ }, Z = (t, r) => t.split(`
1393
+ `).map((s) => r(s)).join(`
1394
+ `), je = (t) => {
1395
+ const r = (i, a) => {
1396
+ const o = i.label ?? String(i.value);
1397
+ return a === "disabled" ? `${import_picocolors.default.gray(q)} ${Z(o, (u) => import_picocolors.default.strikethrough(import_picocolors.default.gray(u)))}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${import_picocolors.default.cyan(st)} ${o}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint})`)}` : ""}` : a === "selected" ? `${import_picocolors.default.green(U)} ${Z(o, import_picocolors.default.dim)}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint})`)}` : ""}` : a === "cancelled" ? `${Z(o, (u) => import_picocolors.default.strikethrough(import_picocolors.default.dim(u)))}` : a === "active-selected" ? `${import_picocolors.default.green(U)} ${o}${i.hint ? ` ${import_picocolors.default.dim(`(${i.hint})`)}` : ""}` : a === "submitted" ? `${Z(o, import_picocolors.default.dim)}` : `${import_picocolors.default.dim(q)} ${Z(o, import_picocolors.default.dim)}`;
1398
+ }, s = t.required ?? !0;
1399
+ return new Lt$1({
1025
1400
  options: t.options,
1401
+ signal: t.signal,
1402
+ input: t.input,
1403
+ output: t.output,
1026
1404
  initialValues: t.initialValues,
1027
- required: t.required ?? !0,
1405
+ required: s,
1028
1406
  cursorAt: t.cursorAt,
1029
- selectableGroups: n,
1030
1407
  validate(i) {
1031
- if (this.required && i.length === 0) return `Please select at least one option.
1408
+ if (s && (i === void 0 || i.length === 0)) return `Please select at least one option.
1032
1409
  ${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`;
1033
1410
  },
1034
1411
  render() {
1035
- const i = `${import_picocolors.default.gray(o)}
1036
- ${b(this.state)} ${t.message}
1037
- `;
1412
+ const i = xt(t.output, t.message, `${vt(this.state)} `, `${W(this.state)} `), a = `${import_picocolors.default.gray(d)}
1413
+ ${i}
1414
+ `, o = this.value ?? [], u = (l, n) => {
1415
+ if (l.disabled) return r(l, "disabled");
1416
+ const c = o.includes(l.value);
1417
+ return n && c ? r(l, "active-selected") : c ? r(l, "selected") : r(l, n ? "active" : "inactive");
1418
+ };
1038
1419
  switch (this.state) {
1039
- case "submit": return `${i}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r(s, "submitted")).join(import_picocolors.default.dim(", "))}`;
1420
+ case "submit": {
1421
+ const l = this.options.filter(({ value: c }) => o.includes(c)).map((c) => r(c, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none");
1422
+ return `${a}${xt(t.output, l, `${import_picocolors.default.gray(d)} `)}`;
1423
+ }
1040
1424
  case "cancel": {
1041
- const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors.default.dim(", "));
1042
- return `${i}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
1043
- ${import_picocolors.default.gray(o)}` : ""}`;
1425
+ const l = this.options.filter(({ value: c }) => o.includes(c)).map((c) => r(c, "cancelled")).join(import_picocolors.default.dim(", "));
1426
+ if (l.trim() === "") return `${a}${import_picocolors.default.gray(d)}`;
1427
+ return `${a}${xt(t.output, l, `${import_picocolors.default.gray(d)} `)}
1428
+ ${import_picocolors.default.gray(d)}`;
1044
1429
  }
1045
1430
  case "error": {
1046
- const s = this.error.split(`
1047
- `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
1048
- `);
1049
- return `${i}${import_picocolors.default.yellow(o)} ${this.options.map((c, a, l) => {
1050
- const $ = this.value.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), g = a === this.cursor;
1051
- return !g && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r(c, $ ? "group-active-selected" : "group-active", l) : g && $ ? r(c, "active-selected", l) : $ ? r(c, "selected", l) : r(c, g ? "active" : "inactive", l);
1431
+ const l = `${import_picocolors.default.yellow(d)} `, n = this.error.split(`
1432
+ `).map((F, p) => p === 0 ? `${import_picocolors.default.yellow(x)} ${import_picocolors.default.yellow(F)}` : ` ${F}`).join(`
1433
+ `), c = a.split(`
1434
+ `).length, g = n.split(`
1435
+ `).length + 1;
1436
+ return `${a}${l}${X({
1437
+ output: t.output,
1438
+ options: this.options,
1439
+ cursor: this.cursor,
1440
+ maxItems: t.maxItems,
1441
+ columnPadding: l.length,
1442
+ rowPadding: c + g,
1443
+ style: u
1052
1444
  }).join(`
1053
- ${import_picocolors.default.yellow(o)} `)}
1054
- ${s}
1445
+ ${l}`)}
1446
+ ${n}
1055
1447
  `;
1056
1448
  }
1057
- default: return `${i}${import_picocolors.default.cyan(o)} ${this.options.map((s, c, a) => {
1058
- const l = this.value.includes(s.value) || s.group === !0 && this.isGroupSelected(`${s.value}`), $ = c === this.cursor;
1059
- return !$ && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r(s, l ? "group-active-selected" : "group-active", a) : $ && l ? r(s, "active-selected", a) : l ? r(s, "selected", a) : r(s, $ ? "active" : "inactive", a);
1060
- }).join(`
1061
- ${import_picocolors.default.cyan(o)} `)}
1062
- ${import_picocolors.default.cyan(d)}
1449
+ default: {
1450
+ const l = `${import_picocolors.default.cyan(d)} `, n = a.split(`
1451
+ `).length;
1452
+ return `${a}${l}${X({
1453
+ output: t.output,
1454
+ options: this.options,
1455
+ cursor: this.cursor,
1456
+ maxItems: t.maxItems,
1457
+ columnPadding: l.length,
1458
+ rowPadding: n + 2,
1459
+ style: u
1460
+ }).join(`
1461
+ ${l}`)}
1462
+ ${import_picocolors.default.cyan(x)}
1063
1463
  `;
1464
+ }
1064
1465
  }
1065
1466
  }
1066
1467
  }).prompt();
1067
- }, Me = (t = "", n = "") => {
1068
- const r = `
1069
- ${t}
1070
- `.split(`
1071
- `), i = stripVTControlCharacters(n).length, s = Math.max(r.reduce((a, l) => {
1072
- const $ = stripVTControlCharacters(l);
1073
- return $.length > a ? $.length : a;
1074
- }, 0), i) + 2, c = r.map((a) => `${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors.default.gray(o)}`).join(`
1075
- `);
1076
- process.stdout.write(`${import_picocolors.default.gray(o)}
1077
- ${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
1468
+ }, Ge = (t) => import_picocolors.default.dim(t), ke = (t, r, s) => {
1469
+ const i = {
1470
+ hard: !0,
1471
+ trim: !1
1472
+ }, a = J(t, r, i).split(`
1473
+ `), o = a.reduce((n, c) => Math.max(M(c), n), 0);
1474
+ return J(t, r - (a.map(s).reduce((n, c) => Math.max(M(c), n), 0) - o), i);
1475
+ }, Ve = (t = "", r = "", s) => {
1476
+ const i = s?.output ?? N.stdout, a = s?.withGuide ?? _.withGuide, o = s?.format ?? Ge, u = [
1477
+ "",
1478
+ ...ke(t, rt$1(i) - 6, o).split(`
1479
+ `).map(o),
1480
+ ""
1481
+ ], l = M(r), n = Math.max(u.reduce((p, E) => {
1482
+ const $ = M(E);
1483
+ return $ > p ? $ : p;
1484
+ }, 0), l) + 2, c = u.map((p) => `${import_picocolors.default.gray(d)} ${p}${" ".repeat(n - M(p))}${import_picocolors.default.gray(d)}`).join(`
1485
+ `), g = a ? `${import_picocolors.default.gray(d)}
1486
+ ` : "", F = a ? Wt : gt;
1487
+ i.write(`${g}${import_picocolors.default.green(V)} ${import_picocolors.default.reset(r)} ${import_picocolors.default.gray(rt.repeat(Math.max(n - l - 1, 1)) + mt)}
1078
1488
  ${c}
1079
- ${import_picocolors.default.gray(de + _.repeat(s + 2) + pe)}
1080
- `);
1081
- }, xe = (t = "") => {
1082
- process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
1083
-
1489
+ ${import_picocolors.default.gray(F + rt.repeat(n + 2) + pt)}
1084
1490
  `);
1085
- }, Ie = (t = "") => {
1086
- process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
1491
+ }, He = (t) => new Mt$1({
1492
+ validate: t.validate,
1493
+ mask: t.mask ?? Nt,
1494
+ signal: t.signal,
1495
+ input: t.input,
1496
+ output: t.output,
1497
+ render() {
1498
+ const r = t.withGuide ?? _.withGuide, s = `${r ? `${import_picocolors.default.gray(d)}
1499
+ ` : ""}${W(this.state)} ${t.message}
1500
+ `, i = this.userInputWithCursor, a = this.masked;
1501
+ switch (this.state) {
1502
+ case "error": {
1503
+ const o = r ? `${import_picocolors.default.yellow(d)} ` : "", u = r ? `${import_picocolors.default.yellow(x)} ` : "", l = a ?? "";
1504
+ return t.clearOnError && this.clear(), `${s.trim()}
1505
+ ${o}${l}
1506
+ ${u}${import_picocolors.default.yellow(this.error)}
1507
+ `;
1508
+ }
1509
+ case "submit": return `${s}${r ? `${import_picocolors.default.gray(d)} ` : ""}${a ? import_picocolors.default.dim(a) : ""}`;
1510
+ case "cancel": return `${s}${r ? `${import_picocolors.default.gray(d)} ` : ""}${a ? import_picocolors.default.strikethrough(import_picocolors.default.dim(a)) : ""}${a && r ? `
1511
+ ${import_picocolors.default.gray(d)}` : ""}`;
1512
+ default: return `${s}${r ? `${import_picocolors.default.cyan(d)} ` : ""}${i}
1513
+ ${r ? import_picocolors.default.cyan(x) : ""}
1514
+ `;
1515
+ }
1516
+ }
1517
+ }).prompt(), Ue = (t) => {
1518
+ const r = t.validate;
1519
+ return Xt({
1520
+ ...t,
1521
+ initialUserInput: t.initialValue ?? t.root ?? process.cwd(),
1522
+ maxItems: 5,
1523
+ validate(s) {
1524
+ if (!Array.isArray(s)) {
1525
+ if (!s) return "Please select a path";
1526
+ if (r) return r(s);
1527
+ }
1528
+ },
1529
+ options() {
1530
+ const s = this.userInput;
1531
+ if (s === "") return [];
1532
+ try {
1533
+ let i;
1534
+ return existsSync(s) ? lstatSync(s).isDirectory() ? i = s : i = dirname(s) : i = dirname(s), readdirSync(i).map((a) => {
1535
+ const o = join(i, a);
1536
+ return {
1537
+ name: a,
1538
+ path: o,
1539
+ isDirectory: lstatSync(o).isDirectory()
1540
+ };
1541
+ }).filter(({ path: a, isDirectory: o }) => a.startsWith(s) && (t.directory || !o)).map((a) => ({ value: a.path }));
1542
+ } catch {
1543
+ return [];
1544
+ }
1545
+ }
1546
+ });
1547
+ }, Ke = import_picocolors.default.magenta, bt = ({ indicator: t = "dots", onCancel: r, output: s = process.stdout, cancelMessage: i, errorMessage: a, frames: o = et ? [
1548
+ "◒",
1549
+ "◐",
1550
+ "◓",
1551
+ "◑"
1552
+ ] : [
1553
+ "•",
1554
+ "o",
1555
+ "O",
1556
+ "0"
1557
+ ], delay: u = et ? 80 : 120, signal: l, ...n } = {}) => {
1558
+ const c = ct();
1559
+ let g, F, p = !1, E = !1, $ = "", m, h = performance.now();
1560
+ const y = rt$1(s), f = n?.styleFrame ?? Ke, v = (b) => {
1561
+ const O = b > 1 ? a ?? _.messages.error : i ?? _.messages.cancel;
1562
+ E = b === 1, p && (L(O, b), E && typeof r == "function" && r());
1563
+ }, S = () => v(2), I = () => v(1), B = () => {
1564
+ process.on("uncaughtExceptionMonitor", S), process.on("unhandledRejection", S), process.on("SIGINT", I), process.on("SIGTERM", I), process.on("exit", v), l && l.addEventListener("abort", I);
1565
+ }, A = () => {
1566
+ process.removeListener("uncaughtExceptionMonitor", S), process.removeListener("unhandledRejection", S), process.removeListener("SIGINT", I), process.removeListener("SIGTERM", I), process.removeListener("exit", v), l && l.removeEventListener("abort", I);
1567
+ }, w = () => {
1568
+ if (m === void 0) return;
1569
+ c && s.write(`
1087
1570
  `);
1088
- }, Se = (t = "") => {
1089
- process.stdout.write(`${import_picocolors.default.gray(o)}
1090
- ${import_picocolors.default.gray(d)} ${t}
1091
-
1571
+ const b = J(m, y, {
1572
+ hard: !0,
1573
+ trim: !1
1574
+ }).split(`
1092
1575
  `);
1093
- }, M = {
1094
- message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
1095
- const r = [`${import_picocolors.default.gray(o)}`];
1096
- if (t) {
1097
- const [i, ...s] = t.split(`
1576
+ b.length > 1 && s.write(import_src.cursor.up(b.length - 1)), s.write(import_src.cursor.to(0)), s.write(import_src.erase.down());
1577
+ }, _$1 = (b) => b.replace(/\.+$/, ""), D = (b) => {
1578
+ const O = (performance.now() - b) / 1e3, j = Math.floor(O / 60), G = Math.floor(O % 60);
1579
+ return j > 0 ? `[${j}m ${G}s]` : `[${G}s]`;
1580
+ }, T = n.withGuide ?? _.withGuide, Y = (b = "") => {
1581
+ p = !0, g = Bt({ output: s }), $ = _$1(b), h = performance.now(), T && s.write(`${import_picocolors.default.gray(d)}
1098
1582
  `);
1099
- r.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
1583
+ let O = 0, j = 0;
1584
+ B(), F = setInterval(() => {
1585
+ if (c && $ === m) return;
1586
+ w(), m = $;
1587
+ const G = f(o[O]);
1588
+ let tt;
1589
+ if (c) tt = `${G} ${$}...`;
1590
+ else if (t === "timer") tt = `${G} ${$} ${D(h)}`;
1591
+ else {
1592
+ const te = ".".repeat(Math.floor(j)).slice(0, 3);
1593
+ tt = `${G} ${$}${te}`;
1594
+ }
1595
+ const Zt = J(tt, y, {
1596
+ hard: !0,
1597
+ trim: !1
1598
+ });
1599
+ s.write(Zt), O = O + 1 < o.length ? O + 1 : 0, j = j < 4 ? j + .125 : 0;
1600
+ }, u);
1601
+ }, L = (b = "", O = 0, j = !1) => {
1602
+ if (!p) return;
1603
+ p = !1, clearInterval(F), w();
1604
+ const G = O === 0 ? import_picocolors.default.green(V) : O === 1 ? import_picocolors.default.red(dt) : import_picocolors.default.red($t);
1605
+ $ = b ?? $, j || (t === "timer" ? s.write(`${G} ${$} ${D(h)}
1606
+ `) : s.write(`${G} ${$}
1607
+ `)), A(), g();
1608
+ };
1609
+ return {
1610
+ start: Y,
1611
+ stop: (b = "") => L(b, 0),
1612
+ message: (b = "") => {
1613
+ $ = _$1(b ?? $);
1614
+ },
1615
+ cancel: (b = "") => L(b, 1),
1616
+ error: (b = "") => L(b, 2),
1617
+ clear: () => L("", 0, !0),
1618
+ get isCancelled() {
1619
+ return E;
1100
1620
  }
1101
- process.stdout.write(`${r.join(`
1621
+ };
1622
+ }, zt = {
1623
+ light: C("─", "-"),
1624
+ heavy: C("━", "="),
1625
+ block: C("█", "#")
1626
+ };
1627
+ const lt = (t, r) => t.includes(`
1628
+ `) ? t.split(`
1629
+ `).map((s) => r(s)).join(`
1630
+ `) : r(t), Je = (t) => {
1631
+ const r = (s, i) => {
1632
+ const a = s.label ?? String(s.value);
1633
+ switch (i) {
1634
+ case "disabled": return `${import_picocolors.default.gray(H)} ${lt(a, import_picocolors.default.gray)}${s.hint ? ` ${import_picocolors.default.dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
1635
+ case "selected": return `${lt(a, import_picocolors.default.dim)}`;
1636
+ case "active": return `${import_picocolors.default.green(Q)} ${a}${s.hint ? ` ${import_picocolors.default.dim(`(${s.hint})`)}` : ""}`;
1637
+ case "cancelled": return `${lt(a, (o) => import_picocolors.default.strikethrough(import_picocolors.default.dim(o)))}`;
1638
+ default: return `${import_picocolors.default.dim(H)} ${lt(a, import_picocolors.default.dim)}`;
1639
+ }
1640
+ };
1641
+ return new Wt$1({
1642
+ options: t.options,
1643
+ signal: t.signal,
1644
+ input: t.input,
1645
+ output: t.output,
1646
+ initialValue: t.initialValue,
1647
+ render() {
1648
+ const s = t.withGuide ?? _.withGuide, i = `${W(this.state)} `, a = `${vt(this.state)} `, o = xt(t.output, t.message, a, i), u = `${s ? `${import_picocolors.default.gray(d)}
1649
+ ` : ""}${o}
1650
+ `;
1651
+ switch (this.state) {
1652
+ case "submit": {
1653
+ const l = s ? `${import_picocolors.default.gray(d)} ` : "";
1654
+ return `${u}${xt(t.output, r(this.options[this.cursor], "selected"), l)}`;
1655
+ }
1656
+ case "cancel": {
1657
+ const l = s ? `${import_picocolors.default.gray(d)} ` : "";
1658
+ return `${u}${xt(t.output, r(this.options[this.cursor], "cancelled"), l)}${s ? `
1659
+ ${import_picocolors.default.gray(d)}` : ""}`;
1660
+ }
1661
+ default: {
1662
+ const l = s ? `${import_picocolors.default.cyan(d)} ` : "", n = s ? import_picocolors.default.cyan(x) : "", c = u.split(`
1663
+ `).length, g = s ? 2 : 1;
1664
+ return `${u}${l}${X({
1665
+ output: t.output,
1666
+ cursor: this.cursor,
1667
+ options: this.options,
1668
+ maxItems: t.maxItems,
1669
+ columnPadding: l.length,
1670
+ rowPadding: c + g,
1671
+ style: (F, p) => r(F, F.disabled ? "disabled" : p ? "active" : "inactive")
1672
+ }).join(`
1673
+ ${l}`)}
1674
+ ${n}
1675
+ `;
1676
+ }
1677
+ }
1678
+ }
1679
+ }).prompt();
1680
+ }, Xe = (t) => {
1681
+ const r = (s, i = "inactive") => {
1682
+ const a = s.label ?? String(s.value);
1683
+ return i === "selected" ? `${import_picocolors.default.dim(a)}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}` : i === "active" ? `${import_picocolors.default.bgCyan(import_picocolors.default.gray(` ${s.value} `))} ${a}${s.hint ? ` ${import_picocolors.default.dim(`(${s.hint})`)}` : ""}` : `${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(` ${s.value} `)))} ${a}${s.hint ? ` ${import_picocolors.default.dim(`(${s.hint})`)}` : ""}`;
1684
+ };
1685
+ return new Tt$1({
1686
+ options: t.options,
1687
+ signal: t.signal,
1688
+ input: t.input,
1689
+ output: t.output,
1690
+ initialValue: t.initialValue,
1691
+ caseSensitive: t.caseSensitive,
1692
+ render() {
1693
+ const s = t.withGuide ?? _.withGuide, i = `${s ? `${import_picocolors.default.gray(d)}
1694
+ ` : ""}${W(this.state)} ${t.message}
1695
+ `;
1696
+ switch (this.state) {
1697
+ case "submit": {
1698
+ const a = s ? `${import_picocolors.default.gray(d)} ` : "", o = this.options.find((l) => l.value === this.value) ?? t.options[0];
1699
+ return `${i}${xt(t.output, r(o, "selected"), a)}`;
1700
+ }
1701
+ case "cancel": {
1702
+ const a = s ? `${import_picocolors.default.gray(d)} ` : "";
1703
+ return `${i}${xt(t.output, r(this.options[0], "cancelled"), a)}${s ? `
1704
+ ${import_picocolors.default.gray(d)}` : ""}`;
1705
+ }
1706
+ default: {
1707
+ const a = s ? `${import_picocolors.default.cyan(d)} ` : "", o = s ? import_picocolors.default.cyan(x) : "";
1708
+ return `${i}${this.options.map((l, n) => xt(t.output, r(l, n === this.cursor ? "active" : "inactive"), a)).join(`
1102
1709
  `)}
1103
- `);
1104
- },
1105
- info: (t) => {
1106
- M.message(t, { symbol: import_picocolors.default.blue(q) });
1107
- },
1108
- success: (t) => {
1109
- M.message(t, { symbol: import_picocolors.default.green(D) });
1110
- },
1111
- step: (t) => {
1112
- M.message(t, { symbol: import_picocolors.default.green(C) });
1113
- },
1114
- warn: (t) => {
1115
- M.message(t, { symbol: import_picocolors.default.yellow(U) });
1116
- },
1117
- warning: (t) => {
1118
- M.warn(t);
1119
- },
1120
- error: (t) => {
1121
- M.message(t, { symbol: import_picocolors.default.red(K) });
1122
- }
1123
- }, J = `${import_picocolors.default.gray(o)} `, x = {
1124
- message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
1125
- process.stdout.write(`${import_picocolors.default.gray(o)}
1126
- ${n} `);
1127
- let r = 3;
1710
+ ${o}
1711
+ `;
1712
+ }
1713
+ }
1714
+ }
1715
+ }).prompt();
1716
+ }, Qt = `${import_picocolors.default.gray(d)} `, K = {
1717
+ message: async (t, { symbol: r = import_picocolors.default.gray(d) } = {}) => {
1718
+ process.stdout.write(`${import_picocolors.default.gray(d)}
1719
+ ${r} `);
1720
+ let s = 3;
1128
1721
  for await (let i of t) {
1129
1722
  i = i.replace(/\n/g, `
1130
- ${J}`), i.includes(`
1131
- `) && (r = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
1723
+ ${Qt}`), i.includes(`
1724
+ `) && (s = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
1132
1725
  `))).length);
1133
- const s = stripVTControlCharacters(i).length;
1134
- r + s < process.stdout.columns ? (r += s, process.stdout.write(i)) : (process.stdout.write(`
1135
- ${J}${i.trimStart()}`), r = 3 + stripVTControlCharacters(i.trimStart()).length);
1726
+ const a = stripVTControlCharacters(i).length;
1727
+ s + a < process.stdout.columns ? (s += a, process.stdout.write(i)) : (process.stdout.write(`
1728
+ ${Qt}${i.trimStart()}`), s = 3 + stripVTControlCharacters(i.trimStart()).length);
1136
1729
  }
1137
1730
  process.stdout.write(`
1138
1731
  `);
1139
1732
  },
1140
- info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
1141
- success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
1142
- step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
1143
- warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
1144
- warning: (t) => x.warn(t),
1145
- error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
1146
- }, Y = ({ indicator: t = "dots" } = {}) => {
1147
- const n = V ? [
1148
- "◒",
1149
- "◐",
1150
- "◓",
1151
- "◑"
1152
- ] : [
1153
- "•",
1154
- "o",
1155
- "O",
1156
- "0"
1157
- ], r = V ? 80 : 120, i = process.env.CI === "true";
1158
- let s, c, a = !1, l = "", $, g = performance.now();
1159
- const p = (m) => {
1160
- a && N(m > 1 ? "Something went wrong" : "Canceled", m);
1161
- }, v = () => p(2), f = () => p(1), j = () => {
1162
- process.on("uncaughtExceptionMonitor", v), process.on("unhandledRejection", v), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p);
1163
- }, E = () => {
1164
- process.removeListener("uncaughtExceptionMonitor", v), process.removeListener("unhandledRejection", v), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p);
1165
- }, B = () => {
1166
- if ($ === void 0) return;
1167
- i && process.stdout.write(`
1733
+ info: (t) => K.message(t, { symbol: import_picocolors.default.blue(ft) }),
1734
+ success: (t) => K.message(t, { symbol: import_picocolors.default.green(Ft) }),
1735
+ step: (t) => K.message(t, { symbol: import_picocolors.default.green(V) }),
1736
+ warn: (t) => K.message(t, { symbol: import_picocolors.default.yellow(yt) }),
1737
+ warning: (t) => K.warn(t),
1738
+ error: (t) => K.message(t, { symbol: import_picocolors.default.red(Et) })
1739
+ }, Ye = async (t, r) => {
1740
+ for (const s of t) {
1741
+ if (s.enabled === !1) continue;
1742
+ const i = bt(r);
1743
+ i.start(s.title);
1744
+ const a = await s.task(i.message);
1745
+ i.stop(a || s.title);
1746
+ }
1747
+ }, ze = (t) => t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, ""), Qe = (t) => {
1748
+ const r = t.output ?? process.stdout, s = rt$1(r), i = import_picocolors.default.gray(d), a = t.spacing ?? 1, o = 3, u = t.retainLog === !0, l = !ct() && Mt(r);
1749
+ r.write(`${i}
1750
+ `), r.write(`${import_picocolors.default.green(V)} ${t.title}
1168
1751
  `);
1169
- const m = $.split(`
1752
+ for (let h = 0; h < a; h++) r.write(`${i}
1170
1753
  `);
1171
- process.stdout.write(import_src.cursor.move(-999, m.length - 1)), process.stdout.write(import_src.erase.down(m.length));
1172
- }, R = (m) => m.replace(/\.+$/, ""), O = (m) => {
1173
- const h = (performance.now() - m) / 1e3, w = Math.floor(h / 60), I = Math.floor(h % 60);
1174
- return w > 0 ? `[${w}m ${I}s]` : `[${I}s]`;
1175
- }, H = (m = "") => {
1176
- a = !0, s = fD(), l = R(m), g = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
1177
- `);
1178
- let h = 0, w = 0;
1179
- j(), c = setInterval(() => {
1180
- if (i && l === $) return;
1181
- B(), $ = l;
1182
- const I = import_picocolors.default.magenta(n[h]);
1183
- if (i) process.stdout.write(`${I} ${l}...`);
1184
- else if (t === "timer") process.stdout.write(`${I} ${l} ${O(g)}`);
1185
- else {
1186
- const z = ".".repeat(Math.floor(w)).slice(0, 3);
1187
- process.stdout.write(`${I} ${l}${z}`);
1754
+ const n = [{
1755
+ value: "",
1756
+ full: ""
1757
+ }];
1758
+ let c = !1;
1759
+ const g = (h) => {
1760
+ if (n.length === 0) return;
1761
+ let y = 0;
1762
+ h && (y += a + 2);
1763
+ for (const f of n) {
1764
+ const { value: v, result: S } = f;
1765
+ let I = S?.message ?? v;
1766
+ if (I.length === 0) continue;
1767
+ S === void 0 && f.header !== void 0 && f.header !== "" && (I += `
1768
+ ${f.header}`);
1769
+ const B = I.split(`
1770
+ `).reduce((A, w) => w === "" ? A + 1 : A + Math.ceil((w.length + o) / s), 0);
1771
+ y += B;
1772
+ }
1773
+ y > 0 && (y += 1, r.write(import_src.erase.lines(y)));
1774
+ }, F = (h, y, f) => {
1775
+ const v = f ? `${h.full}
1776
+ ${h.value}` : h.value;
1777
+ h.header !== void 0 && h.header !== "" && R.message(h.header.split(`
1778
+ `).map(import_picocolors.default.bold), {
1779
+ output: r,
1780
+ secondarySymbol: i,
1781
+ symbol: i,
1782
+ spacing: 0
1783
+ }), R.message(v.split(`
1784
+ `).map(import_picocolors.default.dim), {
1785
+ output: r,
1786
+ secondarySymbol: i,
1787
+ symbol: i,
1788
+ spacing: y ?? a
1789
+ });
1790
+ }, p = () => {
1791
+ for (const h of n) {
1792
+ const { header: y, value: f, full: v } = h;
1793
+ (y === void 0 || y.length === 0) && f.length === 0 || F(h, void 0, u === !0 && v.length > 0);
1794
+ }
1795
+ }, E = (h, y, f) => {
1796
+ if (g(!1), (f?.raw !== !0 || !c) && h.value !== "" && (h.value += `
1797
+ `), h.value += ze(y), c = f?.raw === !0, t.limit !== void 0) {
1798
+ const v = h.value.split(`
1799
+ `), S = v.length - t.limit;
1800
+ if (S > 0) {
1801
+ const I = v.splice(0, S);
1802
+ u && (h.full += (h.full === "" ? "" : `
1803
+ `) + I.join(`
1804
+ `));
1188
1805
  }
1189
- h = h + 1 < n.length ? h + 1 : 0, w = w < n.length ? w + .125 : 0;
1190
- }, r);
1191
- }, N = (m = "", h = 0) => {
1192
- a = !1, clearInterval(c), B();
1193
- const w = h === 0 ? import_picocolors.default.green(C) : h === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
1194
- l = R(m ?? l), t === "timer" ? process.stdout.write(`${w} ${l} ${O(g)}
1195
- `) : process.stdout.write(`${w} ${l}
1196
- `), E(), s();
1806
+ h.value = v.join(`
1807
+ `);
1808
+ }
1809
+ l && $();
1810
+ }, $ = () => {
1811
+ for (const h of n) h.result ? h.result.status === "error" ? R.error(h.result.message, {
1812
+ output: r,
1813
+ secondarySymbol: i,
1814
+ spacing: 0
1815
+ }) : R.success(h.result.message, {
1816
+ output: r,
1817
+ secondarySymbol: i,
1818
+ spacing: 0
1819
+ }) : h.value !== "" && F(h, 0);
1820
+ }, m = (h, y) => {
1821
+ g(!1), h.result = y, l && $();
1197
1822
  };
1198
1823
  return {
1199
- start: H,
1200
- stop: N,
1201
- message: (m = "") => {
1202
- l = R(m ?? l);
1824
+ message(h, y) {
1825
+ E(n[0], h, y);
1826
+ },
1827
+ group(h) {
1828
+ const y = {
1829
+ header: h,
1830
+ value: "",
1831
+ full: ""
1832
+ };
1833
+ return n.push(y), {
1834
+ message(f, v) {
1835
+ E(y, f, v);
1836
+ },
1837
+ error(f) {
1838
+ m(y, {
1839
+ status: "error",
1840
+ message: f
1841
+ });
1842
+ },
1843
+ success(f) {
1844
+ m(y, {
1845
+ status: "success",
1846
+ message: f
1847
+ });
1848
+ }
1849
+ };
1850
+ },
1851
+ error(h, y) {
1852
+ g(!0), R.error(h, {
1853
+ output: r,
1854
+ secondarySymbol: i,
1855
+ spacing: 1
1856
+ }), y?.showLog !== !1 && p(), n.splice(1, n.length - 1), n[0].value = "", n[0].full = "";
1857
+ },
1858
+ success(h, y) {
1859
+ g(!0), R.success(h, {
1860
+ output: r,
1861
+ secondarySymbol: i,
1862
+ spacing: 1
1863
+ }), y?.showLog === !0 && p(), n.splice(1, n.length - 1), n[0].value = "", n[0].full = "";
1203
1864
  }
1204
1865
  };
1205
- }, Ce = async (t, n) => {
1206
- const r = {}, i = Object.keys(t);
1207
- for (const s of i) {
1208
- const c = t[s], a = await c({ results: r })?.catch((l) => {
1209
- throw l;
1210
- });
1211
- if (typeof n?.onCancel == "function" && pD(a)) {
1212
- r[s] = "canceled", n.onCancel({ results: r });
1213
- continue;
1866
+ }, Ze = (t) => new $t$1({
1867
+ validate: t.validate,
1868
+ placeholder: t.placeholder,
1869
+ defaultValue: t.defaultValue,
1870
+ initialValue: t.initialValue,
1871
+ output: t.output,
1872
+ signal: t.signal,
1873
+ input: t.input,
1874
+ render() {
1875
+ const r = t?.withGuide ?? _.withGuide, s = `${`${r ? `${import_picocolors.default.gray(d)}
1876
+ ` : ""}${W(this.state)} `}${t.message}
1877
+ `, i = t.placeholder ? import_picocolors.default.inverse(t.placeholder[0]) + import_picocolors.default.dim(t.placeholder.slice(1)) : import_picocolors.default.inverse(import_picocolors.default.hidden("_")), a = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
1878
+ switch (this.state) {
1879
+ case "error": {
1880
+ const u = this.error ? ` ${import_picocolors.default.yellow(this.error)}` : "", l = r ? `${import_picocolors.default.yellow(d)} ` : "", n = r ? import_picocolors.default.yellow(x) : "";
1881
+ return `${s.trim()}
1882
+ ${l}${a}
1883
+ ${n}${u}
1884
+ `;
1885
+ }
1886
+ case "submit": {
1887
+ const u = o ? ` ${import_picocolors.default.dim(o)}` : "";
1888
+ return `${s}${r ? import_picocolors.default.gray(d) : ""}${u}`;
1889
+ }
1890
+ case "cancel": {
1891
+ const u = o ? ` ${import_picocolors.default.strikethrough(import_picocolors.default.dim(o))}` : "", l = r ? import_picocolors.default.gray(d) : "";
1892
+ return `${s}${l}${u}${o.trim() ? `
1893
+ ${l}` : ""}`;
1894
+ }
1895
+ default: return `${s}${r ? `${import_picocolors.default.cyan(d)} ` : ""}${a}
1896
+ ${r ? import_picocolors.default.cyan(x) : ""}
1897
+ `;
1214
1898
  }
1215
- r[s] = a;
1216
- }
1217
- return r;
1218
- }, Te = async (t) => {
1219
- for (const n of t) {
1220
- if (n.enabled === !1) continue;
1221
- const r = Y();
1222
- r.start(n.title);
1223
- const i = await n.task(r.message);
1224
- r.stop(i || n.title);
1225
1899
  }
1226
- };
1900
+ }).prompt();
1227
1901
 
1228
1902
  //#endregion
1229
1903
  //#region node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/utils.js
@@ -2546,7 +3220,7 @@ function getPackageManagerOptions(preferred) {
2546
3220
  //#endregion
2547
3221
  //#region package.json
2548
3222
  var name = "create-vue";
2549
- var version = "3.21.1";
3223
+ var version = "3.22.0";
2550
3224
 
2551
3225
  //#endregion
2552
3226
  //#region index.ts
@@ -2574,10 +3248,6 @@ const FEATURE_FLAGS = [
2574
3248
  "vue-beta"
2575
3249
  ];
2576
3250
  const FEATURE_OPTIONS = [
2577
- {
2578
- value: "typescript",
2579
- label: language.needsTypeScript.message
2580
- },
2581
3251
  {
2582
3252
  value: "jsx",
2583
3253
  label: language.needsJsx.message
@@ -2643,8 +3313,8 @@ function emptyDir(dir) {
2643
3313
  }
2644
3314
  async function unwrapPrompt(maybeCancelPromise) {
2645
3315
  const result = await maybeCancelPromise;
2646
- if (pD(result)) {
2647
- xe((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
3316
+ if (Ct$1(result)) {
3317
+ Ne((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
2648
3318
  process.exit(0);
2649
3319
  }
2650
3320
  return result;
@@ -2748,37 +3418,41 @@ async function init() {
2748
3418
  experimentFeatures: [],
2749
3419
  needsBareboneTemplates: false
2750
3420
  };
2751
- Ie(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
2752
- if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(he({
3421
+ We(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
3422
+ if (!targetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(Ze({
2753
3423
  message: language.projectName.message,
2754
3424
  placeholder: defaultProjectName,
2755
3425
  defaultValue: defaultProjectName,
2756
3426
  validate: (value) => value.length === 0 || value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
2757
3427
  }))).trim();
2758
3428
  if (!canSkipEmptying(targetDir) && !forceOverwrite) {
2759
- result.shouldOverwrite = await unwrapPrompt(ye({
3429
+ result.shouldOverwrite = await unwrapPrompt(Re({
2760
3430
  message: `${targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`} ${language.shouldOverwrite.message}`,
2761
3431
  initialValue: false
2762
3432
  }));
2763
3433
  if (!result.shouldOverwrite) {
2764
- xe((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
3434
+ Ne((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
2765
3435
  process.exit(0);
2766
3436
  }
2767
3437
  }
2768
- if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(he({
3438
+ if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(Ze({
2769
3439
  message: language.packageName.message,
2770
3440
  initialValue: toValidPackageName(targetDir),
2771
3441
  validate: (value) => isValidPackageName(value) ? void 0 : language.packageName.invalidMessage
2772
3442
  }));
2773
3443
  if (!isFeatureFlagsUsed) {
2774
- result.features = await unwrapPrompt(fe({
3444
+ result.needsTypeScript = await unwrapPrompt(Re({
3445
+ message: language.needsTypeScript.message,
3446
+ initialValue: true
3447
+ }));
3448
+ result.features = await unwrapPrompt(je({
2775
3449
  message: `${language.featureSelection.message} ${(0, import_picocolors.dim)(language.featureSelection.hint)}`,
2776
3450
  options: FEATURE_OPTIONS,
2777
3451
  required: false
2778
3452
  }));
2779
3453
  if (result.features.includes("e2e")) {
2780
3454
  const hasVitest = result.features.includes("vitest");
2781
- result.e2eFramework = await unwrapPrompt(ve({
3455
+ result.e2eFramework = await unwrapPrompt(Je({
2782
3456
  message: `${language.e2eSelection.message} ${(0, import_picocolors.dim)(language.e2eSelection.hint)}`,
2783
3457
  options: [
2784
3458
  {
@@ -2799,7 +3473,7 @@ async function init() {
2799
3473
  ]
2800
3474
  }));
2801
3475
  }
2802
- result.experimentFeatures = await unwrapPrompt(fe({
3476
+ result.experimentFeatures = await unwrapPrompt(je({
2803
3477
  message: `${language.needsExperimentalFeatures.message} ${(0, import_picocolors.dim)(language.needsExperimentalFeatures.hint)}`,
2804
3478
  options: EXPERIMENTAL_FEATURE_OPTIONS,
2805
3479
  required: false
@@ -2809,19 +3483,19 @@ async function init() {
2809
3483
  value: pm,
2810
3484
  label: pm
2811
3485
  }));
2812
- result.packageManager = await unwrapPrompt(ve({
3486
+ result.packageManager = await unwrapPrompt(Je({
2813
3487
  message: `${language.packageManagerSelection.message} ${(0, import_picocolors.dim)(language.packageManagerSelection.hint)}`,
2814
3488
  options: packageManagerOptions
2815
3489
  }));
2816
3490
  }
2817
3491
  }
2818
3492
  if (argv.bare) result.needsBareboneTemplates = true;
2819
- else if (!isFeatureFlagsUsed) result.needsBareboneTemplates = await unwrapPrompt(ye({
3493
+ else if (!isFeatureFlagsUsed) result.needsBareboneTemplates = await unwrapPrompt(Re({
2820
3494
  message: language.needsBareboneTemplates.message,
2821
3495
  initialValue: false
2822
3496
  }));
2823
3497
  const { features, experimentFeatures, needsBareboneTemplates } = result;
2824
- const needsTypeScript = argv.ts || argv.typescript || features.includes("typescript");
3498
+ const needsTypeScript = argv.ts || argv.typescript || result.needsTypeScript;
2825
3499
  const needsJsx = argv.jsx || features.includes("jsx");
2826
3500
  const needsRouter = argv.router || argv["vue-router"] || features.includes("router");
2827
3501
  const needsPinia = argv.pinia || features.includes("pinia");
@@ -2874,10 +3548,7 @@ async function init() {
2874
3548
  files: [],
2875
3549
  references: [{ path: "./tsconfig.node.json" }, { path: "./tsconfig.app.json" }]
2876
3550
  };
2877
- if (needsCypress) {
2878
- render("tsconfig/cypress");
2879
- rootTsConfig.compilerOptions = { module: "NodeNext" };
2880
- }
3551
+ if (needsCypress) render("tsconfig/cypress");
2881
3552
  if (needsCypressCT) {
2882
3553
  render("tsconfig/cypress-ct");
2883
3554
  rootTsConfig.references.push({ path: "./tsconfig.cypress-ct.json" });
@@ -2988,7 +3659,7 @@ async function init() {
2988
3659
  ${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
2989
3660
 
2990
3661
  ${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
2991
- Se(outroMessage);
3662
+ Le(outroMessage);
2992
3663
  }
2993
3664
  init().catch((e) => {
2994
3665
  console.error(e);