create-vite-react-cli 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,2597 @@
1
+ import { createRequire } from "node:module";
2
+ import * as path$1 from "node:path";
3
+ import { parseArgs, stripVTControlCharacters } from "node:util";
4
+ import y, { stdin, stdout } from "node:process";
5
+ import * as g from "node:readline";
6
+ import O from "node:readline";
7
+ import { Writable } from "node:stream";
8
+ import { fileURLToPath, pathToFileURL } from "node:url";
9
+ import * as fs$1 from "node:fs";
10
+
11
+ //#region rolldown:runtime
12
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf;
17
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
18
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
22
+ key = keys[i];
23
+ if (!__hasOwnProp.call(to, key) && key !== except) {
24
+ __defProp(to, key, {
25
+ get: ((k$2) => from[k$2]).bind(null, key),
26
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
+ });
28
+ }
29
+ }
30
+ }
31
+ return to;
32
+ };
33
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
34
+ value: mod,
35
+ enumerable: true
36
+ }) : target, mod));
37
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
38
+
39
+ //#endregion
40
+ //#region node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
41
+ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
42
+ const ESC = "\x1B";
43
+ const CSI = `${ESC}[`;
44
+ const beep = "\x07";
45
+ const cursor = {
46
+ to(x$2, y$2) {
47
+ if (!y$2) return `${CSI}${x$2 + 1}G`;
48
+ return `${CSI}${y$2 + 1};${x$2 + 1}H`;
49
+ },
50
+ move(x$2, y$2) {
51
+ let ret = "";
52
+ if (x$2 < 0) ret += `${CSI}${-x$2}D`;
53
+ else if (x$2 > 0) ret += `${CSI}${x$2}C`;
54
+ if (y$2 < 0) ret += `${CSI}${-y$2}A`;
55
+ else if (y$2 > 0) ret += `${CSI}${y$2}B`;
56
+ return ret;
57
+ },
58
+ up: (count = 1) => `${CSI}${count}A`,
59
+ down: (count = 1) => `${CSI}${count}B`,
60
+ forward: (count = 1) => `${CSI}${count}C`,
61
+ backward: (count = 1) => `${CSI}${count}D`,
62
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
63
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
64
+ left: `${CSI}G`,
65
+ hide: `${CSI}?25l`,
66
+ show: `${CSI}?25h`,
67
+ save: `${ESC}7`,
68
+ restore: `${ESC}8`
69
+ };
70
+ const scroll = {
71
+ up: (count = 1) => `${CSI}S`.repeat(count),
72
+ down: (count = 1) => `${CSI}T`.repeat(count)
73
+ };
74
+ const erase = {
75
+ screen: `${CSI}2J`,
76
+ up: (count = 1) => `${CSI}1J`.repeat(count),
77
+ down: (count = 1) => `${CSI}J`.repeat(count),
78
+ line: `${CSI}2K`,
79
+ lineEnd: `${CSI}K`,
80
+ lineStart: `${CSI}1K`,
81
+ lines(count) {
82
+ let clear = "";
83
+ for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
84
+ if (count) clear += cursor.left;
85
+ return clear;
86
+ }
87
+ };
88
+ module.exports = {
89
+ cursor,
90
+ scroll,
91
+ erase,
92
+ beep
93
+ };
94
+ }));
95
+
96
+ //#endregion
97
+ //#region node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
98
+ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
99
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
100
+ let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
101
+ let formatter = (open, close, replace = open) => (input) => {
102
+ let string = "" + input, index = string.indexOf(close, open.length);
103
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
104
+ };
105
+ let replaceClose = (string, close, replace, index) => {
106
+ let result = "", cursor = 0;
107
+ do {
108
+ result += string.substring(cursor, index) + replace;
109
+ cursor = index + close.length;
110
+ index = string.indexOf(close, cursor);
111
+ } while (~index);
112
+ return result + string.substring(cursor);
113
+ };
114
+ let createColors = (enabled = isColorSupported) => {
115
+ let f = enabled ? formatter : () => String;
116
+ return {
117
+ isColorSupported: enabled,
118
+ reset: f("\x1B[0m", "\x1B[0m"),
119
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
120
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
121
+ italic: f("\x1B[3m", "\x1B[23m"),
122
+ underline: f("\x1B[4m", "\x1B[24m"),
123
+ inverse: f("\x1B[7m", "\x1B[27m"),
124
+ hidden: f("\x1B[8m", "\x1B[28m"),
125
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
126
+ black: f("\x1B[30m", "\x1B[39m"),
127
+ red: f("\x1B[31m", "\x1B[39m"),
128
+ green: f("\x1B[32m", "\x1B[39m"),
129
+ yellow: f("\x1B[33m", "\x1B[39m"),
130
+ blue: f("\x1B[34m", "\x1B[39m"),
131
+ magenta: f("\x1B[35m", "\x1B[39m"),
132
+ cyan: f("\x1B[36m", "\x1B[39m"),
133
+ white: f("\x1B[37m", "\x1B[39m"),
134
+ gray: f("\x1B[90m", "\x1B[39m"),
135
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
136
+ bgRed: f("\x1B[41m", "\x1B[49m"),
137
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
138
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
139
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
140
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
141
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
142
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
143
+ blackBright: f("\x1B[90m", "\x1B[39m"),
144
+ redBright: f("\x1B[91m", "\x1B[39m"),
145
+ greenBright: f("\x1B[92m", "\x1B[39m"),
146
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
147
+ blueBright: f("\x1B[94m", "\x1B[39m"),
148
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
149
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
150
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
151
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
152
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
153
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
154
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
155
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
156
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
157
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
158
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
159
+ };
160
+ };
161
+ module.exports = createColors();
162
+ module.exports.createColors = createColors;
163
+ }));
164
+
165
+ //#endregion
166
+ //#region node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
167
+ var import_src = require_src();
168
+ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
169
+ function DD({ onlyFirst: e$1 = !1 } = {}) {
170
+ 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("|");
171
+ return new RegExp(t, e$1 ? void 0 : "g");
172
+ }
173
+ const uD = DD();
174
+ function P$1(e$1) {
175
+ if (typeof e$1 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e$1}\``);
176
+ return e$1.replace(uD, "");
177
+ }
178
+ function L$1(e$1) {
179
+ return e$1 && e$1.__esModule && Object.prototype.hasOwnProperty.call(e$1, "default") ? e$1.default : e$1;
180
+ }
181
+ var W$1 = { exports: {} };
182
+ (function(e$1) {
183
+ var u$1 = {};
184
+ e$1.exports = u$1, u$1.eastAsianWidth = function(F$1) {
185
+ var s = F$1.charCodeAt(0), i = F$1.length == 2 ? F$1.charCodeAt(1) : 0, D$1 = s;
186
+ return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D$1 = s << 10 | i, D$1 += 65536), D$1 == 12288 || 65281 <= D$1 && D$1 <= 65376 || 65504 <= D$1 && D$1 <= 65510 ? "F" : D$1 == 8361 || 65377 <= D$1 && D$1 <= 65470 || 65474 <= D$1 && D$1 <= 65479 || 65482 <= D$1 && D$1 <= 65487 || 65490 <= D$1 && D$1 <= 65495 || 65498 <= D$1 && D$1 <= 65500 || 65512 <= D$1 && D$1 <= 65518 ? "H" : 4352 <= D$1 && D$1 <= 4447 || 4515 <= D$1 && D$1 <= 4519 || 4602 <= D$1 && D$1 <= 4607 || 9001 <= D$1 && D$1 <= 9002 || 11904 <= D$1 && D$1 <= 11929 || 11931 <= D$1 && D$1 <= 12019 || 12032 <= D$1 && D$1 <= 12245 || 12272 <= D$1 && D$1 <= 12283 || 12289 <= D$1 && D$1 <= 12350 || 12353 <= D$1 && D$1 <= 12438 || 12441 <= D$1 && D$1 <= 12543 || 12549 <= D$1 && D$1 <= 12589 || 12593 <= D$1 && D$1 <= 12686 || 12688 <= D$1 && D$1 <= 12730 || 12736 <= D$1 && D$1 <= 12771 || 12784 <= D$1 && D$1 <= 12830 || 12832 <= D$1 && D$1 <= 12871 || 12880 <= D$1 && D$1 <= 13054 || 13056 <= D$1 && D$1 <= 19903 || 19968 <= D$1 && D$1 <= 42124 || 42128 <= D$1 && D$1 <= 42182 || 43360 <= D$1 && D$1 <= 43388 || 44032 <= D$1 && D$1 <= 55203 || 55216 <= D$1 && D$1 <= 55238 || 55243 <= D$1 && D$1 <= 55291 || 63744 <= D$1 && D$1 <= 64255 || 65040 <= D$1 && D$1 <= 65049 || 65072 <= D$1 && D$1 <= 65106 || 65108 <= D$1 && D$1 <= 65126 || 65128 <= D$1 && D$1 <= 65131 || 110592 <= D$1 && D$1 <= 110593 || 127488 <= D$1 && D$1 <= 127490 || 127504 <= D$1 && D$1 <= 127546 || 127552 <= D$1 && D$1 <= 127560 || 127568 <= D$1 && D$1 <= 127569 || 131072 <= D$1 && D$1 <= 194367 || 177984 <= D$1 && D$1 <= 196605 || 196608 <= D$1 && D$1 <= 262141 ? "W" : 32 <= D$1 && D$1 <= 126 || 162 <= D$1 && D$1 <= 163 || 165 <= D$1 && D$1 <= 166 || D$1 == 172 || D$1 == 175 || 10214 <= D$1 && D$1 <= 10221 || 10629 <= D$1 && D$1 <= 10630 ? "Na" : D$1 == 161 || D$1 == 164 || 167 <= D$1 && D$1 <= 168 || D$1 == 170 || 173 <= D$1 && D$1 <= 174 || 176 <= D$1 && D$1 <= 180 || 182 <= D$1 && D$1 <= 186 || 188 <= D$1 && D$1 <= 191 || D$1 == 198 || D$1 == 208 || 215 <= D$1 && D$1 <= 216 || 222 <= D$1 && D$1 <= 225 || D$1 == 230 || 232 <= D$1 && D$1 <= 234 || 236 <= D$1 && D$1 <= 237 || D$1 == 240 || 242 <= D$1 && D$1 <= 243 || 247 <= D$1 && D$1 <= 250 || D$1 == 252 || D$1 == 254 || D$1 == 257 || D$1 == 273 || D$1 == 275 || D$1 == 283 || 294 <= D$1 && D$1 <= 295 || D$1 == 299 || 305 <= D$1 && D$1 <= 307 || D$1 == 312 || 319 <= D$1 && D$1 <= 322 || D$1 == 324 || 328 <= D$1 && D$1 <= 331 || D$1 == 333 || 338 <= D$1 && D$1 <= 339 || 358 <= D$1 && D$1 <= 359 || D$1 == 363 || D$1 == 462 || D$1 == 464 || D$1 == 466 || D$1 == 468 || D$1 == 470 || D$1 == 472 || D$1 == 474 || D$1 == 476 || D$1 == 593 || D$1 == 609 || D$1 == 708 || D$1 == 711 || 713 <= D$1 && D$1 <= 715 || D$1 == 717 || D$1 == 720 || 728 <= D$1 && D$1 <= 731 || D$1 == 733 || D$1 == 735 || 768 <= D$1 && D$1 <= 879 || 913 <= D$1 && D$1 <= 929 || 931 <= D$1 && D$1 <= 937 || 945 <= D$1 && D$1 <= 961 || 963 <= D$1 && D$1 <= 969 || D$1 == 1025 || 1040 <= D$1 && D$1 <= 1103 || D$1 == 1105 || D$1 == 8208 || 8211 <= D$1 && D$1 <= 8214 || 8216 <= D$1 && D$1 <= 8217 || 8220 <= D$1 && D$1 <= 8221 || 8224 <= D$1 && D$1 <= 8226 || 8228 <= D$1 && D$1 <= 8231 || D$1 == 8240 || 8242 <= D$1 && D$1 <= 8243 || D$1 == 8245 || D$1 == 8251 || D$1 == 8254 || D$1 == 8308 || D$1 == 8319 || 8321 <= D$1 && D$1 <= 8324 || D$1 == 8364 || D$1 == 8451 || D$1 == 8453 || D$1 == 8457 || D$1 == 8467 || D$1 == 8470 || 8481 <= D$1 && D$1 <= 8482 || D$1 == 8486 || D$1 == 8491 || 8531 <= D$1 && D$1 <= 8532 || 8539 <= D$1 && D$1 <= 8542 || 8544 <= D$1 && D$1 <= 8555 || 8560 <= D$1 && D$1 <= 8569 || D$1 == 8585 || 8592 <= D$1 && D$1 <= 8601 || 8632 <= D$1 && D$1 <= 8633 || D$1 == 8658 || D$1 == 8660 || D$1 == 8679 || D$1 == 8704 || 8706 <= D$1 && D$1 <= 8707 || 8711 <= D$1 && D$1 <= 8712 || D$1 == 8715 || D$1 == 8719 || D$1 == 8721 || D$1 == 8725 || D$1 == 8730 || 8733 <= D$1 && D$1 <= 8736 || D$1 == 8739 || D$1 == 8741 || 8743 <= D$1 && D$1 <= 8748 || D$1 == 8750 || 8756 <= D$1 && D$1 <= 8759 || 8764 <= D$1 && D$1 <= 8765 || D$1 == 8776 || D$1 == 8780 || D$1 == 8786 || 8800 <= D$1 && D$1 <= 8801 || 8804 <= D$1 && D$1 <= 8807 || 8810 <= D$1 && D$1 <= 8811 || 8814 <= D$1 && D$1 <= 8815 || 8834 <= D$1 && D$1 <= 8835 || 8838 <= D$1 && D$1 <= 8839 || D$1 == 8853 || D$1 == 8857 || D$1 == 8869 || D$1 == 8895 || D$1 == 8978 || 9312 <= D$1 && D$1 <= 9449 || 9451 <= D$1 && D$1 <= 9547 || 9552 <= D$1 && D$1 <= 9587 || 9600 <= D$1 && D$1 <= 9615 || 9618 <= D$1 && D$1 <= 9621 || 9632 <= D$1 && D$1 <= 9633 || 9635 <= D$1 && D$1 <= 9641 || 9650 <= D$1 && D$1 <= 9651 || 9654 <= D$1 && D$1 <= 9655 || 9660 <= D$1 && D$1 <= 9661 || 9664 <= D$1 && D$1 <= 9665 || 9670 <= D$1 && D$1 <= 9672 || D$1 == 9675 || 9678 <= D$1 && D$1 <= 9681 || 9698 <= D$1 && D$1 <= 9701 || D$1 == 9711 || 9733 <= D$1 && D$1 <= 9734 || D$1 == 9737 || 9742 <= D$1 && D$1 <= 9743 || 9748 <= D$1 && D$1 <= 9749 || D$1 == 9756 || D$1 == 9758 || D$1 == 9792 || D$1 == 9794 || 9824 <= D$1 && D$1 <= 9825 || 9827 <= D$1 && D$1 <= 9829 || 9831 <= D$1 && D$1 <= 9834 || 9836 <= D$1 && D$1 <= 9837 || D$1 == 9839 || 9886 <= D$1 && D$1 <= 9887 || 9918 <= D$1 && D$1 <= 9919 || 9924 <= D$1 && D$1 <= 9933 || 9935 <= D$1 && D$1 <= 9953 || D$1 == 9955 || 9960 <= D$1 && D$1 <= 9983 || D$1 == 10045 || D$1 == 10071 || 10102 <= D$1 && D$1 <= 10111 || 11093 <= D$1 && D$1 <= 11097 || 12872 <= D$1 && D$1 <= 12879 || 57344 <= D$1 && D$1 <= 63743 || 65024 <= D$1 && D$1 <= 65039 || D$1 == 65533 || 127232 <= D$1 && D$1 <= 127242 || 127248 <= D$1 && D$1 <= 127277 || 127280 <= D$1 && D$1 <= 127337 || 127344 <= D$1 && D$1 <= 127386 || 917760 <= D$1 && D$1 <= 917999 || 983040 <= D$1 && D$1 <= 1048573 || 1048576 <= D$1 && D$1 <= 1114109 ? "A" : "N";
187
+ }, u$1.characterLength = function(F$1) {
188
+ var s = this.eastAsianWidth(F$1);
189
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
190
+ };
191
+ function t(F$1) {
192
+ return F$1.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
193
+ }
194
+ u$1.length = function(F$1) {
195
+ for (var s = t(F$1), i = 0, D$1 = 0; D$1 < s.length; D$1++) i = i + this.characterLength(s[D$1]);
196
+ return i;
197
+ }, u$1.slice = function(F$1, s, i) {
198
+ textLen = u$1.length(F$1), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
199
+ for (var D$1 = "", C$1 = 0, n = t(F$1), E = 0; E < n.length; E++) {
200
+ var a = n[E], o$1 = u$1.length(a);
201
+ if (C$1 >= s - (o$1 == 2 ? 1 : 0)) if (C$1 + o$1 <= i) D$1 += a;
202
+ else break;
203
+ C$1 += o$1;
204
+ }
205
+ return D$1;
206
+ };
207
+ })(W$1);
208
+ var tD = W$1.exports;
209
+ const eD = L$1(tD);
210
+ var FD = function() {
211
+ 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;
212
+ };
213
+ const sD = L$1(FD);
214
+ function p(e$1, u$1 = {}) {
215
+ if (typeof e$1 != "string" || e$1.length === 0 || (u$1 = {
216
+ ambiguousIsNarrow: !0,
217
+ ...u$1
218
+ }, e$1 = P$1(e$1), e$1.length === 0)) return 0;
219
+ e$1 = e$1.replace(sD(), " ");
220
+ const t = u$1.ambiguousIsNarrow ? 1 : 2;
221
+ let F$1 = 0;
222
+ for (const s of e$1) {
223
+ const i = s.codePointAt(0);
224
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
225
+ switch (eD.eastAsianWidth(s)) {
226
+ case "F":
227
+ case "W":
228
+ F$1 += 2;
229
+ break;
230
+ case "A":
231
+ F$1 += t;
232
+ break;
233
+ default: F$1 += 1;
234
+ }
235
+ }
236
+ return F$1;
237
+ }
238
+ const w = 10, N = (e$1 = 0) => (u$1) => `\x1B[${u$1 + e$1}m`, I = (e$1 = 0) => (u$1) => `\x1B[${38 + e$1};5;${u$1}m`, R = (e$1 = 0) => (u$1, t, F$1) => `\x1B[${38 + e$1};2;${u$1};${t};${F$1}m`, r = {
239
+ modifier: {
240
+ reset: [0, 0],
241
+ bold: [1, 22],
242
+ dim: [2, 22],
243
+ italic: [3, 23],
244
+ underline: [4, 24],
245
+ overline: [53, 55],
246
+ inverse: [7, 27],
247
+ hidden: [8, 28],
248
+ strikethrough: [9, 29]
249
+ },
250
+ color: {
251
+ black: [30, 39],
252
+ red: [31, 39],
253
+ green: [32, 39],
254
+ yellow: [33, 39],
255
+ blue: [34, 39],
256
+ magenta: [35, 39],
257
+ cyan: [36, 39],
258
+ white: [37, 39],
259
+ blackBright: [90, 39],
260
+ gray: [90, 39],
261
+ grey: [90, 39],
262
+ redBright: [91, 39],
263
+ greenBright: [92, 39],
264
+ yellowBright: [93, 39],
265
+ blueBright: [94, 39],
266
+ magentaBright: [95, 39],
267
+ cyanBright: [96, 39],
268
+ whiteBright: [97, 39]
269
+ },
270
+ bgColor: {
271
+ bgBlack: [40, 49],
272
+ bgRed: [41, 49],
273
+ bgGreen: [42, 49],
274
+ bgYellow: [43, 49],
275
+ bgBlue: [44, 49],
276
+ bgMagenta: [45, 49],
277
+ bgCyan: [46, 49],
278
+ bgWhite: [47, 49],
279
+ bgBlackBright: [100, 49],
280
+ bgGray: [100, 49],
281
+ bgGrey: [100, 49],
282
+ bgRedBright: [101, 49],
283
+ bgGreenBright: [102, 49],
284
+ bgYellowBright: [103, 49],
285
+ bgBlueBright: [104, 49],
286
+ bgMagentaBright: [105, 49],
287
+ bgCyanBright: [106, 49],
288
+ bgWhiteBright: [107, 49]
289
+ }
290
+ };
291
+ Object.keys(r.modifier);
292
+ const iD = Object.keys(r.color), CD = Object.keys(r.bgColor);
293
+ [...iD, ...CD];
294
+ function rD() {
295
+ const e$1 = /* @__PURE__ */ new Map();
296
+ for (const [u$1, t] of Object.entries(r)) {
297
+ for (const [F$1, s] of Object.entries(t)) r[F$1] = {
298
+ open: `\x1B[${s[0]}m`,
299
+ close: `\x1B[${s[1]}m`
300
+ }, t[F$1] = r[F$1], e$1.set(s[0], s[1]);
301
+ Object.defineProperty(r, u$1, {
302
+ value: t,
303
+ enumerable: !1
304
+ });
305
+ }
306
+ return Object.defineProperty(r, "codes", {
307
+ value: e$1,
308
+ enumerable: !1
309
+ }), 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, {
310
+ rgbToAnsi256: {
311
+ value: (u$1, t, F$1) => u$1 === t && t === F$1 ? u$1 < 8 ? 16 : u$1 > 248 ? 231 : Math.round((u$1 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u$1 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F$1 / 255 * 5),
312
+ enumerable: !1
313
+ },
314
+ hexToRgb: {
315
+ value: (u$1) => {
316
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u$1.toString(16));
317
+ if (!t) return [
318
+ 0,
319
+ 0,
320
+ 0
321
+ ];
322
+ let [F$1] = t;
323
+ F$1.length === 3 && (F$1 = [...F$1].map((i) => i + i).join(""));
324
+ const s = Number.parseInt(F$1, 16);
325
+ return [
326
+ s >> 16 & 255,
327
+ s >> 8 & 255,
328
+ s & 255
329
+ ];
330
+ },
331
+ enumerable: !1
332
+ },
333
+ hexToAnsi256: {
334
+ value: (u$1) => r.rgbToAnsi256(...r.hexToRgb(u$1)),
335
+ enumerable: !1
336
+ },
337
+ ansi256ToAnsi: {
338
+ value: (u$1) => {
339
+ if (u$1 < 8) return 30 + u$1;
340
+ if (u$1 < 16) return 90 + (u$1 - 8);
341
+ let t, F$1, s;
342
+ if (u$1 >= 232) t = ((u$1 - 232) * 10 + 8) / 255, F$1 = t, s = t;
343
+ else {
344
+ u$1 -= 16;
345
+ const C$1 = u$1 % 36;
346
+ t = Math.floor(u$1 / 36) / 5, F$1 = Math.floor(C$1 / 6) / 5, s = C$1 % 6 / 5;
347
+ }
348
+ const i = Math.max(t, F$1, s) * 2;
349
+ if (i === 0) return 30;
350
+ let D$1 = 30 + (Math.round(s) << 2 | Math.round(F$1) << 1 | Math.round(t));
351
+ return i === 2 && (D$1 += 60), D$1;
352
+ },
353
+ enumerable: !1
354
+ },
355
+ rgbToAnsi: {
356
+ value: (u$1, t, F$1) => r.ansi256ToAnsi(r.rgbToAnsi256(u$1, t, F$1)),
357
+ enumerable: !1
358
+ },
359
+ hexToAnsi: {
360
+ value: (u$1) => r.ansi256ToAnsi(r.hexToAnsi256(u$1)),
361
+ enumerable: !1
362
+ }
363
+ }), r;
364
+ }
365
+ const ED = rD(), d$1 = new Set(["\x1B", "›"]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$1) => p(u$1)), k$1 = (e$1, u$1, t) => {
366
+ const F$1 = [...u$1];
367
+ let s = !1, i = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
368
+ for (const [C$1, n] of F$1.entries()) {
369
+ const E = p(n);
370
+ if (D$1 + E <= t ? e$1[e$1.length - 1] += n : (e$1.push(n), D$1 = 0), d$1.has(n) && (s = !0, i = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
371
+ i ? n === y$1 && (s = !1, i = !1) : n === G$1 && (s = !1);
372
+ continue;
373
+ }
374
+ D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
375
+ }
376
+ !D$1 && e$1[e$1.length - 1].length > 0 && e$1.length > 1 && (e$1[e$1.length - 2] += e$1.pop());
377
+ }, hD = (e$1) => {
378
+ const u$1 = e$1.split(" ");
379
+ let t = u$1.length;
380
+ for (; t > 0 && !(p(u$1[t - 1]) > 0);) t--;
381
+ return t === u$1.length ? e$1 : u$1.slice(0, t).join(" ") + u$1.slice(t).join("");
382
+ }, lD = (e$1, u$1, t = {}) => {
383
+ if (t.trim !== !1 && e$1.trim() === "") return "";
384
+ let F$1 = "", s, i;
385
+ const D$1 = aD(e$1);
386
+ let C$1 = [""];
387
+ for (const [E, a] of e$1.split(" ").entries()) {
388
+ t.trim !== !1 && (C$1[C$1.length - 1] = C$1[C$1.length - 1].trimStart());
389
+ let o$1 = p(C$1[C$1.length - 1]);
390
+ if (E !== 0 && (o$1 >= u$1 && (t.wordWrap === !1 || t.trim === !1) && (C$1.push(""), o$1 = 0), (o$1 > 0 || t.trim === !1) && (C$1[C$1.length - 1] += " ", o$1++)), t.hard && D$1[E] > u$1) {
391
+ const c = u$1 - o$1, f = 1 + Math.floor((D$1[E] - c - 1) / u$1);
392
+ Math.floor((D$1[E] - 1) / u$1) < f && C$1.push(""), k$1(C$1, a, u$1);
393
+ continue;
394
+ }
395
+ if (o$1 + D$1[E] > u$1 && o$1 > 0 && D$1[E] > 0) {
396
+ if (t.wordWrap === !1 && o$1 < u$1) {
397
+ k$1(C$1, a, u$1);
398
+ continue;
399
+ }
400
+ C$1.push("");
401
+ }
402
+ if (o$1 + D$1[E] > u$1 && t.wordWrap === !1) {
403
+ k$1(C$1, a, u$1);
404
+ continue;
405
+ }
406
+ C$1[C$1.length - 1] += a;
407
+ }
408
+ t.trim !== !1 && (C$1 = C$1.map((E) => hD(E)));
409
+ const n = [...C$1.join(`
410
+ `)];
411
+ for (const [E, a] of n.entries()) {
412
+ if (F$1 += a, d$1.has(a)) {
413
+ const { groups: c } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n.slice(E).join("")) || { groups: {} };
414
+ if (c.code !== void 0) {
415
+ const f = Number.parseFloat(c.code);
416
+ s = f === oD ? void 0 : f;
417
+ } else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
418
+ }
419
+ const o$1 = ED.codes.get(Number(s));
420
+ n[E + 1] === `
421
+ ` ? (i && (F$1 += K$1("")), s && o$1 && (F$1 += z(o$1))) : a === `
422
+ ` && (s && o$1 && (F$1 += z(s)), i && (F$1 += K$1(i)));
423
+ }
424
+ return F$1;
425
+ };
426
+ function Y$1(e$1, u$1, t) {
427
+ return String(e$1).normalize().replace(/\r\n/g, `
428
+ `).split(`
429
+ `).map((F$1) => lD(F$1, u$1, t)).join(`
430
+ `);
431
+ }
432
+ const B = {
433
+ actions: new Set([
434
+ "up",
435
+ "down",
436
+ "left",
437
+ "right",
438
+ "space",
439
+ "enter",
440
+ "cancel"
441
+ ]),
442
+ aliases: new Map([
443
+ ["k", "up"],
444
+ ["j", "down"],
445
+ ["h", "left"],
446
+ ["l", "right"],
447
+ ["", "cancel"],
448
+ ["escape", "cancel"]
449
+ ])
450
+ };
451
+ function $(e$1, u$1) {
452
+ if (typeof e$1 == "string") return B.aliases.get(e$1) === u$1;
453
+ for (const t of e$1) if (t !== void 0 && $(t, u$1)) return !0;
454
+ return !1;
455
+ }
456
+ function BD(e$1, u$1) {
457
+ if (e$1 === u$1) return;
458
+ const t = e$1.split(`
459
+ `), F$1 = u$1.split(`
460
+ `), s = [];
461
+ for (let i = 0; i < Math.max(t.length, F$1.length); i++) t[i] !== F$1[i] && s.push(i);
462
+ return s;
463
+ }
464
+ const AD = globalThis.process.platform.startsWith("win"), S = Symbol("clack:cancel");
465
+ function pD(e$1) {
466
+ return e$1 === S;
467
+ }
468
+ function m(e$1, u$1) {
469
+ const t = e$1;
470
+ t.isTTY && t.setRawMode(u$1);
471
+ }
472
+ function fD({ input: e$1 = stdin, output: u$1 = stdout, overwrite: t = !0, hideCursor: F$1 = !0 } = {}) {
473
+ const s = g.createInterface({
474
+ input: e$1,
475
+ output: u$1,
476
+ prompt: "",
477
+ tabSize: 1
478
+ });
479
+ g.emitKeypressEvents(e$1, s), e$1.isTTY && e$1.setRawMode(!0);
480
+ const i = (D$1, { name: C$1, sequence: n }) => {
481
+ if ($([
482
+ String(D$1),
483
+ C$1,
484
+ n
485
+ ], "cancel")) {
486
+ F$1 && u$1.write(import_src.cursor.show), process.exit(0);
487
+ return;
488
+ }
489
+ if (!t) return;
490
+ const a = C$1 === "return" ? 0 : -1, o$1 = C$1 === "return" ? -1 : 0;
491
+ g.moveCursor(u$1, a, o$1, () => {
492
+ g.clearLine(u$1, 1, () => {
493
+ e$1.once("keypress", i);
494
+ });
495
+ });
496
+ };
497
+ return F$1 && u$1.write(import_src.cursor.hide), e$1.once("keypress", i), () => {
498
+ e$1.off("keypress", i), F$1 && u$1.write(import_src.cursor.show), e$1.isTTY && !AD && e$1.setRawMode(!1), s.terminal = !1, s.close();
499
+ };
500
+ }
501
+ var gD = Object.defineProperty, vD = (e$1, u$1, t) => u$1 in e$1 ? gD(e$1, u$1, {
502
+ enumerable: !0,
503
+ configurable: !0,
504
+ writable: !0,
505
+ value: t
506
+ }) : e$1[u$1] = t, h = (e$1, u$1, t) => (vD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
507
+ var x$1 = class {
508
+ constructor(u$1, t = !0) {
509
+ 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");
510
+ const { input: F$1 = stdin, output: s = stdout, render: i, signal: D$1, ...C$1 } = u$1;
511
+ this.opts = C$1, 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$1, this.input = F$1, this.output = s;
512
+ }
513
+ unsubscribe() {
514
+ this._subscribers.clear();
515
+ }
516
+ setSubscriber(u$1, t) {
517
+ const F$1 = this._subscribers.get(u$1) ?? [];
518
+ F$1.push(t), this._subscribers.set(u$1, F$1);
519
+ }
520
+ on(u$1, t) {
521
+ this.setSubscriber(u$1, { cb: t });
522
+ }
523
+ once(u$1, t) {
524
+ this.setSubscriber(u$1, {
525
+ cb: t,
526
+ once: !0
527
+ });
528
+ }
529
+ emit(u$1, ...t) {
530
+ const F$1 = this._subscribers.get(u$1) ?? [], s = [];
531
+ for (const i of F$1) i.cb(...t), i.once && s.push(() => F$1.splice(F$1.indexOf(i), 1));
532
+ for (const i of s) i();
533
+ }
534
+ prompt() {
535
+ return new Promise((u$1, t) => {
536
+ if (this._abortSignal) {
537
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u$1(S);
538
+ this._abortSignal.addEventListener("abort", () => {
539
+ this.state = "cancel", this.close();
540
+ }, { once: !0 });
541
+ }
542
+ const F$1 = new Writable();
543
+ F$1._write = (s, i, D$1) => {
544
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D$1();
545
+ }, this.input.pipe(F$1), this.rl = O.createInterface({
546
+ input: this.input,
547
+ output: F$1,
548
+ tabSize: 2,
549
+ prompt: "",
550
+ escapeCodeTimeout: 50,
551
+ terminal: !0
552
+ }), 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", () => {
553
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(this.value);
554
+ }), this.once("cancel", () => {
555
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$1(S);
556
+ });
557
+ });
558
+ }
559
+ onKeypress(u$1, t) {
560
+ 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$1 && (u$1.toLowerCase() === "y" || u$1.toLowerCase() === "n") && this.emit("confirm", u$1.toLowerCase() === "y"), u$1 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$1 && this.emit("key", u$1.toLowerCase()), t?.name === "return") {
561
+ if (this.opts.validate) {
562
+ const F$1 = this.opts.validate(this.value);
563
+ F$1 && (this.error = F$1 instanceof Error ? F$1.message : F$1, this.state = "error", this.rl?.write(this.value));
564
+ }
565
+ this.state !== "error" && (this.state = "submit");
566
+ }
567
+ $([
568
+ u$1,
569
+ t?.name,
570
+ t?.sequence
571
+ ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
572
+ }
573
+ close() {
574
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
575
+ `), m(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
576
+ }
577
+ restoreCursor() {
578
+ const u$1 = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
579
+ `).length - 1;
580
+ this.output.write(import_src.cursor.move(-999, u$1 * -1));
581
+ }
582
+ render() {
583
+ const u$1 = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
584
+ if (u$1 !== this._prevFrame) {
585
+ if (this.state === "initial") this.output.write(import_src.cursor.hide);
586
+ else {
587
+ const t = BD(this._prevFrame, u$1);
588
+ if (this.restoreCursor(), t && t?.length === 1) {
589
+ const F$1 = t[0];
590
+ this.output.write(import_src.cursor.move(0, F$1)), this.output.write(import_src.erase.lines(1));
591
+ const s = u$1.split(`
592
+ `);
593
+ this.output.write(s[F$1]), this._prevFrame = u$1, this.output.write(import_src.cursor.move(0, s.length - F$1 - 1));
594
+ return;
595
+ }
596
+ if (t && t?.length > 1) {
597
+ const F$1 = t[0];
598
+ this.output.write(import_src.cursor.move(0, F$1)), this.output.write(import_src.erase.down());
599
+ const s = u$1.split(`
600
+ `).slice(F$1);
601
+ this.output.write(s.join(`
602
+ `)), this._prevFrame = u$1;
603
+ return;
604
+ }
605
+ this.output.write(import_src.erase.down());
606
+ }
607
+ this.output.write(u$1), this.state === "initial" && (this.state = "active"), this._prevFrame = u$1;
608
+ }
609
+ }
610
+ };
611
+ var dD = class extends x$1 {
612
+ get cursor() {
613
+ return this.value ? 0 : 1;
614
+ }
615
+ get _value() {
616
+ return this.cursor === 0;
617
+ }
618
+ constructor(u$1) {
619
+ super(u$1, !1), this.value = !!u$1.initialValue, this.on("value", () => {
620
+ this.value = this._value;
621
+ }), this.on("confirm", (t) => {
622
+ this.output.write(import_src.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
623
+ }), this.on("cursor", () => {
624
+ this.value = !this.value;
625
+ });
626
+ }
627
+ };
628
+ var mD = Object.defineProperty, bD = (e$1, u$1, t) => u$1 in e$1 ? mD(e$1, u$1, {
629
+ enumerable: !0,
630
+ configurable: !0,
631
+ writable: !0,
632
+ value: t
633
+ }) : e$1[u$1] = t, Z = (e$1, u$1, t) => (bD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t), q$1 = (e$1, u$1, t) => {
634
+ if (!u$1.has(e$1)) throw TypeError("Cannot " + t);
635
+ }, T$1 = (e$1, u$1, t) => (q$1(e$1, u$1, "read from private field"), t ? t.call(e$1) : u$1.get(e$1)), wD = (e$1, u$1, t) => {
636
+ if (u$1.has(e$1)) throw TypeError("Cannot add the same private member more than once");
637
+ u$1 instanceof WeakSet ? u$1.add(e$1) : u$1.set(e$1, t);
638
+ }, yD = (e$1, u$1, t, F$1) => (q$1(e$1, u$1, "write to private field"), F$1 ? F$1.call(e$1, t) : u$1.set(e$1, t), t), A$1;
639
+ let _D = class extends x$1 {
640
+ constructor(u$1) {
641
+ super(u$1, !1), Z(this, "options"), Z(this, "cursor", 0), wD(this, A$1, void 0);
642
+ const { options: t } = u$1;
643
+ yD(this, A$1, u$1.selectableGroups !== !1), this.options = Object.entries(t).flatMap(([F$1, s]) => [{
644
+ value: F$1,
645
+ group: !0,
646
+ label: F$1
647
+ }, ...s.map((i) => ({
648
+ ...i,
649
+ group: F$1
650
+ }))]), this.value = [...u$1.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F$1 }) => F$1 === u$1.cursorAt), T$1(this, A$1) ? 0 : 1), this.on("cursor", (F$1) => {
651
+ switch (F$1) {
652
+ case "left":
653
+ case "up": {
654
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
655
+ const s = this.options[this.cursor]?.group === !0;
656
+ !T$1(this, A$1) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
657
+ break;
658
+ }
659
+ case "down":
660
+ case "right": {
661
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
662
+ const s = this.options[this.cursor]?.group === !0;
663
+ !T$1(this, A$1) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
664
+ break;
665
+ }
666
+ case "space":
667
+ this.toggleValue();
668
+ break;
669
+ }
670
+ });
671
+ }
672
+ getGroupItems(u$1) {
673
+ return this.options.filter((t) => t.group === u$1);
674
+ }
675
+ isGroupSelected(u$1) {
676
+ return this.getGroupItems(u$1).every((t) => this.value.includes(t.value));
677
+ }
678
+ toggleValue() {
679
+ const u$1 = this.options[this.cursor];
680
+ if (u$1.group === !0) {
681
+ const t = u$1.value, F$1 = this.getGroupItems(t);
682
+ this.isGroupSelected(t) ? this.value = this.value.filter((s) => F$1.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F$1.map((s) => s.value)], this.value = Array.from(new Set(this.value));
683
+ } else this.value = this.value.includes(u$1.value) ? this.value.filter((F$1) => F$1 !== u$1.value) : [...this.value, u$1.value];
684
+ }
685
+ };
686
+ A$1 = /* @__PURE__ */ new WeakMap();
687
+ var kD = Object.defineProperty, $D = (e$1, u$1, t) => u$1 in e$1 ? kD(e$1, u$1, {
688
+ enumerable: !0,
689
+ configurable: !0,
690
+ writable: !0,
691
+ value: t
692
+ }) : e$1[u$1] = t, H = (e$1, u$1, t) => ($D(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
693
+ let SD = class extends x$1 {
694
+ constructor(u$1) {
695
+ super(u$1, !1), H(this, "options"), H(this, "cursor", 0), this.options = u$1.options, this.value = [...u$1.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t }) => t === u$1.cursorAt), 0), this.on("key", (t) => {
696
+ t === "a" && this.toggleAll();
697
+ }), this.on("cursor", (t) => {
698
+ switch (t) {
699
+ case "left":
700
+ case "up":
701
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
702
+ break;
703
+ case "down":
704
+ case "right":
705
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
706
+ break;
707
+ case "space":
708
+ this.toggleValue();
709
+ break;
710
+ }
711
+ });
712
+ }
713
+ get _value() {
714
+ return this.options[this.cursor].value;
715
+ }
716
+ toggleAll() {
717
+ this.value = this.value.length === this.options.length ? [] : this.options.map((t) => t.value);
718
+ }
719
+ toggleValue() {
720
+ this.value = this.value.includes(this._value) ? this.value.filter((t) => t !== this._value) : [...this.value, this._value];
721
+ }
722
+ };
723
+ var TD = Object.defineProperty, jD = (e$1, u$1, t) => u$1 in e$1 ? TD(e$1, u$1, {
724
+ enumerable: !0,
725
+ configurable: !0,
726
+ writable: !0,
727
+ value: t
728
+ }) : e$1[u$1] = t, U$1 = (e$1, u$1, t) => (jD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
729
+ var MD = class extends x$1 {
730
+ constructor({ mask: u$1, ...t }) {
731
+ super(t), U$1(this, "valueWithCursor", ""), U$1(this, "_mask", "•"), this._mask = u$1 ?? "•", this.on("finalize", () => {
732
+ this.valueWithCursor = this.masked;
733
+ }), this.on("value", () => {
734
+ if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
735
+ else {
736
+ const F$1 = this.masked.slice(0, this.cursor), s = this.masked.slice(this.cursor);
737
+ this.valueWithCursor = `${F$1}${import_picocolors.default.inverse(s[0])}${s.slice(1)}`;
738
+ }
739
+ });
740
+ }
741
+ get cursor() {
742
+ return this._cursor;
743
+ }
744
+ get masked() {
745
+ return this.value.replaceAll(/./g, this._mask);
746
+ }
747
+ };
748
+ var OD = Object.defineProperty, PD = (e$1, u$1, t) => u$1 in e$1 ? OD(e$1, u$1, {
749
+ enumerable: !0,
750
+ configurable: !0,
751
+ writable: !0,
752
+ value: t
753
+ }) : e$1[u$1] = t, J$1 = (e$1, u$1, t) => (PD(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
754
+ var LD = class extends x$1 {
755
+ constructor(u$1) {
756
+ super(u$1, !1), J$1(this, "options"), J$1(this, "cursor", 0), this.options = u$1.options, this.cursor = this.options.findIndex(({ value: t }) => t === u$1.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
757
+ switch (t) {
758
+ case "left":
759
+ case "up":
760
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
761
+ break;
762
+ case "down":
763
+ case "right":
764
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
765
+ break;
766
+ }
767
+ this.changeValue();
768
+ });
769
+ }
770
+ get _value() {
771
+ return this.options[this.cursor];
772
+ }
773
+ changeValue() {
774
+ this.value = this._value.value;
775
+ }
776
+ };
777
+ var WD = Object.defineProperty, ND = (e$1, u$1, t) => u$1 in e$1 ? WD(e$1, u$1, {
778
+ enumerable: !0,
779
+ configurable: !0,
780
+ writable: !0,
781
+ value: t
782
+ }) : e$1[u$1] = t, Q = (e$1, u$1, t) => (ND(e$1, typeof u$1 != "symbol" ? u$1 + "" : u$1, t), t);
783
+ var ID = class extends x$1 {
784
+ constructor(u$1) {
785
+ super(u$1, !1), Q(this, "options"), Q(this, "cursor", 0), this.options = u$1.options;
786
+ const t = this.options.map(({ value: [F$1] }) => F$1?.toLowerCase());
787
+ this.cursor = Math.max(t.indexOf(u$1.initialValue), 0), this.on("key", (F$1) => {
788
+ if (!t.includes(F$1)) return;
789
+ const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F$1);
790
+ s && (this.value = s.value, this.state = "submit", this.emit("submit"));
791
+ });
792
+ }
793
+ };
794
+ var RD = class extends x$1 {
795
+ get valueWithCursor() {
796
+ if (this.state === "submit") return this.value;
797
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
798
+ const u$1 = this.value.slice(0, this.cursor), [t, ...F$1] = this.value.slice(this.cursor);
799
+ return `${u$1}${import_picocolors.default.inverse(t)}${F$1.join("")}`;
800
+ }
801
+ get cursor() {
802
+ return this._cursor;
803
+ }
804
+ constructor(u$1) {
805
+ super(u$1), this.on("finalize", () => {
806
+ this.value || (this.value = u$1.defaultValue);
807
+ });
808
+ }
809
+ };
810
+
811
+ //#endregion
812
+ //#region node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
813
+ function ce() {
814
+ 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";
815
+ }
816
+ 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) => {
817
+ switch (t) {
818
+ case "initial":
819
+ case "active": return import_picocolors.default.cyan(le);
820
+ case "cancel": return import_picocolors.default.red(L);
821
+ case "error": return import_picocolors.default.yellow(W);
822
+ case "submit": return import_picocolors.default.green(C);
823
+ }
824
+ }, G = (t) => {
825
+ const { cursor: n, options: r$1, 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));
826
+ let l$1 = 0;
827
+ n >= l$1 + a - 3 ? l$1 = Math.max(Math.min(n - a + 3, r$1.length - a), 0) : n < l$1 + 2 && (l$1 = Math.max(n - 2, 0));
828
+ const $$1 = a < r$1.length && l$1 > 0, g$1 = a < r$1.length && l$1 + a < r$1.length;
829
+ return r$1.slice(l$1, l$1 + a).map((p$1, v$1, f) => {
830
+ const j = v$1 === 0 && $$1, E = v$1 === f.length - 1 && g$1;
831
+ return j || E ? import_picocolors.default.dim("...") : i(p$1, v$1 + l$1 === n);
832
+ });
833
+ }, he = (t) => new RD({
834
+ validate: t.validate,
835
+ placeholder: t.placeholder,
836
+ defaultValue: t.defaultValue,
837
+ initialValue: t.initialValue,
838
+ render() {
839
+ const n = `${import_picocolors.default.gray(o)}
840
+ ${b(this.state)} ${t.message}
841
+ `, r$1 = 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$1;
842
+ switch (this.state) {
843
+ case "error": return `${n.trim()}
844
+ ${import_picocolors.default.yellow(o)} ${i}
845
+ ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
846
+ `;
847
+ case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t.placeholder)}`;
848
+ case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
849
+ ${import_picocolors.default.gray(o)}` : ""}`;
850
+ default: return `${n}${import_picocolors.default.cyan(o)} ${i}
851
+ ${import_picocolors.default.cyan(d)}
852
+ `;
853
+ }
854
+ }
855
+ }).prompt(), ge = (t) => new MD({
856
+ validate: t.validate,
857
+ mask: t.mask ?? $e,
858
+ render() {
859
+ const n = `${import_picocolors.default.gray(o)}
860
+ ${b(this.state)} ${t.message}
861
+ `, r$1 = this.valueWithCursor, i = this.masked;
862
+ switch (this.state) {
863
+ case "error": return `${n.trim()}
864
+ ${import_picocolors.default.yellow(o)} ${i}
865
+ ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
866
+ `;
867
+ case "submit": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(i)}`;
868
+ case "cancel": return `${n}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i ?? ""))}${i ? `
869
+ ${import_picocolors.default.gray(o)}` : ""}`;
870
+ default: return `${n}${import_picocolors.default.cyan(o)} ${r$1}
871
+ ${import_picocolors.default.cyan(d)}
872
+ `;
873
+ }
874
+ }
875
+ }).prompt(), ye = (t) => {
876
+ const n = t.active ?? "Yes", r$1 = t.inactive ?? "No";
877
+ return new dD({
878
+ active: n,
879
+ inactive: r$1,
880
+ initialValue: t.initialValue ?? !0,
881
+ render() {
882
+ const i = `${import_picocolors.default.gray(o)}
883
+ ${b(this.state)} ${t.message}
884
+ `, s = this.value ? n : r$1;
885
+ switch (this.state) {
886
+ case "submit": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s)}`;
887
+ case "cancel": return `${i}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}
888
+ ${import_picocolors.default.gray(o)}`;
889
+ 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$1)}` : `${import_picocolors.default.green(k)} ${r$1}`}
890
+ ${import_picocolors.default.cyan(d)}
891
+ `;
892
+ }
893
+ }
894
+ }).prompt();
895
+ }, ve = (t) => {
896
+ const n = (r$1, i) => {
897
+ const s = r$1.label ?? String(r$1.value);
898
+ switch (i) {
899
+ case "selected": return `${import_picocolors.default.dim(s)}`;
900
+ case "active": return `${import_picocolors.default.green(k)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}`;
901
+ case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}`;
902
+ default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s)}`;
903
+ }
904
+ };
905
+ return new LD({
906
+ options: t.options,
907
+ initialValue: t.initialValue,
908
+ render() {
909
+ const r$1 = `${import_picocolors.default.gray(o)}
910
+ ${b(this.state)} ${t.message}
911
+ `;
912
+ switch (this.state) {
913
+ case "submit": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
914
+ case "cancel": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
915
+ ${import_picocolors.default.gray(o)}`;
916
+ default: return `${r$1}${import_picocolors.default.cyan(o)} ${G({
917
+ cursor: this.cursor,
918
+ options: this.options,
919
+ maxItems: t.maxItems,
920
+ style: (i, s) => n(i, s ? "active" : "inactive")
921
+ }).join(`
922
+ ${import_picocolors.default.cyan(o)} `)}
923
+ ${import_picocolors.default.cyan(d)}
924
+ `;
925
+ }
926
+ }
927
+ }).prompt();
928
+ }, we = (t) => {
929
+ const n = (r$1, i = "inactive") => {
930
+ const s = r$1.label ?? String(r$1.value);
931
+ 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$1.value} `))} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : `${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(` ${r$1.value} `)))} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}`;
932
+ };
933
+ return new ID({
934
+ options: t.options,
935
+ initialValue: t.initialValue,
936
+ render() {
937
+ const r$1 = `${import_picocolors.default.gray(o)}
938
+ ${b(this.state)} ${t.message}
939
+ `;
940
+ switch (this.state) {
941
+ case "submit": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
942
+ case "cancel": return `${r$1}${import_picocolors.default.gray(o)} ${n(this.options[0], "cancelled")}
943
+ ${import_picocolors.default.gray(o)}`;
944
+ default: return `${r$1}${import_picocolors.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
945
+ ${import_picocolors.default.cyan(o)} `)}
946
+ ${import_picocolors.default.cyan(d)}
947
+ `;
948
+ }
949
+ }
950
+ }).prompt();
951
+ }, fe = (t) => {
952
+ const n = (r$1, i) => {
953
+ const s = r$1.label ?? String(r$1.value);
954
+ return i === "active" ? `${import_picocolors.default.cyan(A)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : i === "selected" ? `${import_picocolors.default.green(T)} ${import_picocolors.default.dim(s)} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s))}` : i === "active-selected" ? `${import_picocolors.default.green(T)} ${s} ${r$1.hint ? import_picocolors.default.dim(`(${r$1.hint})`) : ""}` : i === "submitted" ? `${import_picocolors.default.dim(s)}` : `${import_picocolors.default.dim(F)} ${import_picocolors.default.dim(s)}`;
955
+ };
956
+ return new SD({
957
+ options: t.options,
958
+ initialValues: t.initialValues,
959
+ required: t.required ?? !0,
960
+ cursorAt: t.cursorAt,
961
+ validate(r$1) {
962
+ if (this.required && r$1.length === 0) return `Please select at least one option.
963
+ ${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`))}`;
964
+ },
965
+ render() {
966
+ const r$1 = `${import_picocolors.default.gray(o)}
967
+ ${b(this.state)} ${t.message}
968
+ `, i = (s, c) => {
969
+ const a = this.value.includes(s.value);
970
+ return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
971
+ };
972
+ switch (this.state) {
973
+ case "submit": return `${r$1}${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")}`;
974
+ case "cancel": {
975
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => n(c, "cancelled")).join(import_picocolors.default.dim(", "));
976
+ return `${r$1}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
977
+ ${import_picocolors.default.gray(o)}` : ""}`;
978
+ }
979
+ case "error": {
980
+ const s = this.error.split(`
981
+ `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
982
+ `);
983
+ return `${r$1 + import_picocolors.default.yellow(o)} ${G({
984
+ options: this.options,
985
+ cursor: this.cursor,
986
+ maxItems: t.maxItems,
987
+ style: i
988
+ }).join(`
989
+ ${import_picocolors.default.yellow(o)} `)}
990
+ ${s}
991
+ `;
992
+ }
993
+ default: return `${r$1}${import_picocolors.default.cyan(o)} ${G({
994
+ options: this.options,
995
+ cursor: this.cursor,
996
+ maxItems: t.maxItems,
997
+ style: i
998
+ }).join(`
999
+ ${import_picocolors.default.cyan(o)} `)}
1000
+ ${import_picocolors.default.cyan(d)}
1001
+ `;
1002
+ }
1003
+ }
1004
+ }).prompt();
1005
+ }, be = (t) => {
1006
+ const { selectableGroups: n = !0 } = t, r$1 = (i, s, c = []) => {
1007
+ const a = i.label ?? String(i.value), l$1 = typeof i.group == "string", $$1 = l$1 && (c[c.indexOf(i) + 1] ?? { group: !0 }), g$1 = l$1 && $$1.group === !0, p$1 = l$1 ? n ? `${g$1 ? d : o} ` : " " : "";
1008
+ if (s === "active") return `${import_picocolors.default.dim(p$1)}${import_picocolors.default.cyan(A)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1009
+ if (s === "group-active") return `${p$1}${import_picocolors.default.cyan(A)} ${import_picocolors.default.dim(a)}`;
1010
+ if (s === "group-active-selected") return `${p$1}${import_picocolors.default.green(T)} ${import_picocolors.default.dim(a)}`;
1011
+ if (s === "selected") {
1012
+ const f = l$1 || n ? import_picocolors.default.green(T) : "";
1013
+ return `${import_picocolors.default.dim(p$1)}${f} ${import_picocolors.default.dim(a)} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1014
+ }
1015
+ if (s === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a))}`;
1016
+ if (s === "active-selected") return `${import_picocolors.default.dim(p$1)}${import_picocolors.default.green(T)} ${a} ${i.hint ? import_picocolors.default.dim(`(${i.hint})`) : ""}`;
1017
+ if (s === "submitted") return `${import_picocolors.default.dim(a)}`;
1018
+ const v$1 = l$1 || n ? import_picocolors.default.dim(F) : "";
1019
+ return `${import_picocolors.default.dim(p$1)}${v$1} ${import_picocolors.default.dim(a)}`;
1020
+ };
1021
+ return new _D({
1022
+ options: t.options,
1023
+ initialValues: t.initialValues,
1024
+ required: t.required ?? !0,
1025
+ cursorAt: t.cursorAt,
1026
+ selectableGroups: n,
1027
+ validate(i) {
1028
+ if (this.required && i.length === 0) return `Please select at least one option.
1029
+ ${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`))}`;
1030
+ },
1031
+ render() {
1032
+ const i = `${import_picocolors.default.gray(o)}
1033
+ ${b(this.state)} ${t.message}
1034
+ `;
1035
+ switch (this.state) {
1036
+ case "submit": return `${i}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r$1(s, "submitted")).join(import_picocolors.default.dim(", "))}`;
1037
+ case "cancel": {
1038
+ const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r$1(c, "cancelled")).join(import_picocolors.default.dim(", "));
1039
+ return `${i}${import_picocolors.default.gray(o)} ${s.trim() ? `${s}
1040
+ ${import_picocolors.default.gray(o)}` : ""}`;
1041
+ }
1042
+ case "error": {
1043
+ const s = this.error.split(`
1044
+ `).map((c, a) => a === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c)}` : ` ${c}`).join(`
1045
+ `);
1046
+ return `${i}${import_picocolors.default.yellow(o)} ${this.options.map((c, a, l$1) => {
1047
+ const $$1 = this.value.includes(c.value) || c.group === !0 && this.isGroupSelected(`${c.value}`), g$1 = a === this.cursor;
1048
+ return !g$1 && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r$1(c, $$1 ? "group-active-selected" : "group-active", l$1) : g$1 && $$1 ? r$1(c, "active-selected", l$1) : $$1 ? r$1(c, "selected", l$1) : r$1(c, g$1 ? "active" : "inactive", l$1);
1049
+ }).join(`
1050
+ ${import_picocolors.default.yellow(o)} `)}
1051
+ ${s}
1052
+ `;
1053
+ }
1054
+ default: return `${i}${import_picocolors.default.cyan(o)} ${this.options.map((s, c, a) => {
1055
+ const l$1 = this.value.includes(s.value) || s.group === !0 && this.isGroupSelected(`${s.value}`), $$1 = c === this.cursor;
1056
+ return !$$1 && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r$1(s, l$1 ? "group-active-selected" : "group-active", a) : $$1 && l$1 ? r$1(s, "active-selected", a) : l$1 ? r$1(s, "selected", a) : r$1(s, $$1 ? "active" : "inactive", a);
1057
+ }).join(`
1058
+ ${import_picocolors.default.cyan(o)} `)}
1059
+ ${import_picocolors.default.cyan(d)}
1060
+ `;
1061
+ }
1062
+ }
1063
+ }).prompt();
1064
+ }, Me = (t = "", n = "") => {
1065
+ const r$1 = `
1066
+ ${t}
1067
+ `.split(`
1068
+ `), i = stripVTControlCharacters(n).length, s = Math.max(r$1.reduce((a, l$1) => {
1069
+ const $$1 = stripVTControlCharacters(l$1);
1070
+ return $$1.length > a ? $$1.length : a;
1071
+ }, 0), i) + 2, c = r$1.map((a) => `${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(a)}${" ".repeat(s - stripVTControlCharacters(a).length)}${import_picocolors.default.gray(o)}`).join(`
1072
+ `);
1073
+ process.stdout.write(`${import_picocolors.default.gray(o)}
1074
+ ${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n)} ${import_picocolors.default.gray(_.repeat(Math.max(s - i - 1, 1)) + me)}
1075
+ ${c}
1076
+ ${import_picocolors.default.gray(de + _.repeat(s + 2) + pe)}
1077
+ `);
1078
+ }, xe = (t = "") => {
1079
+ process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t)}
1080
+
1081
+ `);
1082
+ }, Ie = (t = "") => {
1083
+ process.stdout.write(`${import_picocolors.default.gray(ue)} ${t}
1084
+ `);
1085
+ }, Se = (t = "") => {
1086
+ process.stdout.write(`${import_picocolors.default.gray(o)}
1087
+ ${import_picocolors.default.gray(d)} ${t}
1088
+
1089
+ `);
1090
+ }, M = {
1091
+ message: (t = "", { symbol: n = import_picocolors.default.gray(o) } = {}) => {
1092
+ const r$1 = [`${import_picocolors.default.gray(o)}`];
1093
+ if (t) {
1094
+ const [i, ...s] = t.split(`
1095
+ `);
1096
+ r$1.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors.default.gray(o)} ${c}`));
1097
+ }
1098
+ process.stdout.write(`${r$1.join(`
1099
+ `)}
1100
+ `);
1101
+ },
1102
+ info: (t) => {
1103
+ M.message(t, { symbol: import_picocolors.default.blue(q) });
1104
+ },
1105
+ success: (t) => {
1106
+ M.message(t, { symbol: import_picocolors.default.green(D) });
1107
+ },
1108
+ step: (t) => {
1109
+ M.message(t, { symbol: import_picocolors.default.green(C) });
1110
+ },
1111
+ warn: (t) => {
1112
+ M.message(t, { symbol: import_picocolors.default.yellow(U) });
1113
+ },
1114
+ warning: (t) => {
1115
+ M.warn(t);
1116
+ },
1117
+ error: (t) => {
1118
+ M.message(t, { symbol: import_picocolors.default.red(K) });
1119
+ }
1120
+ }, J = `${import_picocolors.default.gray(o)} `, x = {
1121
+ message: async (t, { symbol: n = import_picocolors.default.gray(o) } = {}) => {
1122
+ process.stdout.write(`${import_picocolors.default.gray(o)}
1123
+ ${n} `);
1124
+ let r$1 = 3;
1125
+ for await (let i of t) {
1126
+ i = i.replace(/\n/g, `
1127
+ ${J}`), i.includes(`
1128
+ `) && (r$1 = 3 + stripVTControlCharacters(i.slice(i.lastIndexOf(`
1129
+ `))).length);
1130
+ const s = stripVTControlCharacters(i).length;
1131
+ r$1 + s < process.stdout.columns ? (r$1 += s, process.stdout.write(i)) : (process.stdout.write(`
1132
+ ${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length);
1133
+ }
1134
+ process.stdout.write(`
1135
+ `);
1136
+ },
1137
+ info: (t) => x.message(t, { symbol: import_picocolors.default.blue(q) }),
1138
+ success: (t) => x.message(t, { symbol: import_picocolors.default.green(D) }),
1139
+ step: (t) => x.message(t, { symbol: import_picocolors.default.green(C) }),
1140
+ warn: (t) => x.message(t, { symbol: import_picocolors.default.yellow(U) }),
1141
+ warning: (t) => x.warn(t),
1142
+ error: (t) => x.message(t, { symbol: import_picocolors.default.red(K) })
1143
+ }, Y = ({ indicator: t = "dots" } = {}) => {
1144
+ const n = V ? [
1145
+ "◒",
1146
+ "◐",
1147
+ "◓",
1148
+ "◑"
1149
+ ] : [
1150
+ "•",
1151
+ "o",
1152
+ "O",
1153
+ "0"
1154
+ ], r$1 = V ? 80 : 120, i = process.env.CI === "true";
1155
+ let s, c, a = !1, l$1 = "", $$1, g$1 = performance.now();
1156
+ const p$1 = (m$1) => {
1157
+ a && N$1(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
1158
+ }, v$1 = () => p$1(2), f = () => p$1(1), j = () => {
1159
+ process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p$1);
1160
+ }, E = () => {
1161
+ process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p$1);
1162
+ }, B$1 = () => {
1163
+ if ($$1 === void 0) return;
1164
+ i && process.stdout.write(`
1165
+ `);
1166
+ const m$1 = $$1.split(`
1167
+ `);
1168
+ process.stdout.write(import_src.cursor.move(-999, m$1.length - 1)), process.stdout.write(import_src.erase.down(m$1.length));
1169
+ }, R$1 = (m$1) => m$1.replace(/\.+$/, ""), O$1 = (m$1) => {
1170
+ const h$1 = (performance.now() - m$1) / 1e3, w$1 = Math.floor(h$1 / 60), I$1 = Math.floor(h$1 % 60);
1171
+ return w$1 > 0 ? `[${w$1}m ${I$1}s]` : `[${I$1}s]`;
1172
+ }, H$1 = (m$1 = "") => {
1173
+ a = !0, s = fD(), l$1 = R$1(m$1), g$1 = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
1174
+ `);
1175
+ let h$1 = 0, w$1 = 0;
1176
+ j(), c = setInterval(() => {
1177
+ if (i && l$1 === $$1) return;
1178
+ B$1(), $$1 = l$1;
1179
+ const I$1 = import_picocolors.default.magenta(n[h$1]);
1180
+ if (i) process.stdout.write(`${I$1} ${l$1}...`);
1181
+ else if (t === "timer") process.stdout.write(`${I$1} ${l$1} ${O$1(g$1)}`);
1182
+ else {
1183
+ const z$1 = ".".repeat(Math.floor(w$1)).slice(0, 3);
1184
+ process.stdout.write(`${I$1} ${l$1}${z$1}`);
1185
+ }
1186
+ h$1 = h$1 + 1 < n.length ? h$1 + 1 : 0, w$1 = w$1 < n.length ? w$1 + .125 : 0;
1187
+ }, r$1);
1188
+ }, N$1 = (m$1 = "", h$1 = 0) => {
1189
+ a = !1, clearInterval(c), B$1();
1190
+ const w$1 = h$1 === 0 ? import_picocolors.default.green(C) : h$1 === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
1191
+ l$1 = R$1(m$1 ?? l$1), t === "timer" ? process.stdout.write(`${w$1} ${l$1} ${O$1(g$1)}
1192
+ `) : process.stdout.write(`${w$1} ${l$1}
1193
+ `), E(), s();
1194
+ };
1195
+ return {
1196
+ start: H$1,
1197
+ stop: N$1,
1198
+ message: (m$1 = "") => {
1199
+ l$1 = R$1(m$1 ?? l$1);
1200
+ }
1201
+ };
1202
+ }, Ce = async (t, n) => {
1203
+ const r$1 = {}, i = Object.keys(t);
1204
+ for (const s of i) {
1205
+ const c = t[s], a = await c({ results: r$1 })?.catch((l$1) => {
1206
+ throw l$1;
1207
+ });
1208
+ if (typeof n?.onCancel == "function" && pD(a)) {
1209
+ r$1[s] = "canceled", n.onCancel({ results: r$1 });
1210
+ continue;
1211
+ }
1212
+ r$1[s] = a;
1213
+ }
1214
+ return r$1;
1215
+ }, Te = async (t) => {
1216
+ for (const n of t) {
1217
+ if (n.enabled === !1) continue;
1218
+ const r$1 = Y();
1219
+ r$1.start(n.title);
1220
+ const i = await n.task(r$1.message);
1221
+ r$1.stop(i || n.title);
1222
+ }
1223
+ };
1224
+
1225
+ //#endregion
1226
+ //#region src/utils/cli/getLanguage.ts
1227
+ function linkLocale(locale) {
1228
+ if (locale === "C") return "en-US";
1229
+ let linkedLocale = locale;
1230
+ try {
1231
+ linkedLocale = Intl.getCanonicalLocales(locale)[0];
1232
+ } catch (error) {
1233
+ console.log(`${error.toString()}, invalid language tag: "${locale}"\n`);
1234
+ }
1235
+ switch (linkedLocale) {
1236
+ case "zh-CN":
1237
+ case "zh-SG":
1238
+ linkedLocale = "zh-Hans";
1239
+ break;
1240
+ default: linkedLocale = locale;
1241
+ }
1242
+ return linkedLocale;
1243
+ }
1244
+ function getLocale() {
1245
+ return linkLocale((process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || Intl.DateTimeFormat().resolvedOptions().locale || "en-US").split(".")[0].replace("_", "-"));
1246
+ }
1247
+ async function loadLanguageFile(filePath) {
1248
+ return await fs$1.promises.readFile(filePath, "utf-8").then((data) => {
1249
+ const parsedData = JSON.parse(data);
1250
+ if (parsedData) return parsedData;
1251
+ });
1252
+ }
1253
+ async function getLanguage(localesRoot) {
1254
+ const locale = getLocale();
1255
+ const languageFilePath = path$1.resolve(localesRoot, `${locale}.json`);
1256
+ const fallbackPath = path$1.resolve(localesRoot, "en-US.json");
1257
+ return fs$1.existsSync(languageFilePath) ? await loadLanguageFile(languageFilePath) : await loadLanguageFile(fallbackPath);
1258
+ }
1259
+
1260
+ //#endregion
1261
+ //#region src/locales.ts
1262
+ const language = await getLanguage(fileURLToPath(new URL("../locales", import.meta.url)));
1263
+
1264
+ //#endregion
1265
+ //#region src/cli/help.ts
1266
+ const helpMessage = `\
1267
+ Usage: create-vite-react-cli [FEATURE_FLAGS...] [OPTIONS...] [DIRECTORY]
1268
+
1269
+ Create a new Vite React project.
1270
+ Start the CLI in interactive mode when no FEATURE_FLAGS is provided, or if the DIRECTORY argument is not a valid package name.
1271
+
1272
+ Options:
1273
+ --force
1274
+ Create the project even if the directory is not empty.
1275
+ --help
1276
+ Display this help message.
1277
+ --version
1278
+ Display the version number of this CLI.
1279
+
1280
+ Available feature flags:
1281
+ --default
1282
+ Create a project with the default configuration without any additional features.
1283
+ --ts, --typescript
1284
+ Add TypeScript support.
1285
+ --eslint
1286
+ Add ESLint for code quality.
1287
+ --eslint-with-prettier (Deprecated in favor of ${(0, import_picocolors.cyan)("--eslint --prettier")})
1288
+ Add Prettier for code formatting in addition to ESLint.
1289
+ --prettier
1290
+ Add Prettier for code formatting.
1291
+ `;
1292
+
1293
+ //#endregion
1294
+ //#region src/constants.ts
1295
+ const DEFAULT_PROJECT_NAME = "my-vite-react-app";
1296
+ const TEMPLATE_ROOT = fileURLToPath(new URL("../templates", import.meta.url));
1297
+ const FEATURE_FLAGS = [
1298
+ "default",
1299
+ "ts",
1300
+ "typescript",
1301
+ "eslint",
1302
+ "prettier",
1303
+ "eslint-with-prettier"
1304
+ ];
1305
+ const FEATURE_OPTIONS = [
1306
+ {
1307
+ value: "typescript",
1308
+ label: language.needsTypeScript.message
1309
+ },
1310
+ {
1311
+ value: "eslint",
1312
+ label: language.needsEslint.message
1313
+ },
1314
+ {
1315
+ value: "prettier",
1316
+ label: language.needsPrettier.message
1317
+ }
1318
+ ];
1319
+
1320
+ //#endregion
1321
+ //#region src/utils/cli/banners.ts
1322
+ const defaultBanner = "React.js - The library for web and native user interfaces";
1323
+ /**
1324
+ * Generates a gradient banner string with ANSI color codes.
1325
+ */
1326
+ const gradientBanner = (() => {
1327
+ const startColor = [
1328
+ 97,
1329
+ 218,
1330
+ 251
1331
+ ];
1332
+ const endColor = [
1333
+ 30,
1334
+ 144,
1335
+ 255
1336
+ ];
1337
+ const length = 57;
1338
+ let result = "";
1339
+ for (let i = 0; i < length; i++) {
1340
+ const r$1 = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i / (length - 1));
1341
+ const g$1 = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i / (length - 1));
1342
+ const b$2 = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i / (length - 1));
1343
+ result += `\x1B[38;2;${r$1};${g$1};${b$2}m${defaultBanner[i]}\x1B[39m`;
1344
+ }
1345
+ return result;
1346
+ })();
1347
+
1348
+ //#endregion
1349
+ //#region src/utils/cli/getCommand.ts
1350
+ function getCommand(packageManager, scriptName, args) {
1351
+ if (scriptName === "install") return packageManager === "yarn" ? "yarn" : `${packageManager} install`;
1352
+ if (scriptName === "build") return packageManager === "npm" || packageManager === "bun" ? `${packageManager} run build` : `${packageManager} build`;
1353
+ if (args) return packageManager === "npm" ? `npm run ${scriptName} -- ${args}` : `${packageManager} ${scriptName} ${args}`;
1354
+ else return packageManager === "npm" ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
1355
+ }
1356
+
1357
+ //#endregion
1358
+ //#region src/utils/fs/directoryTraverse.ts
1359
+ function preOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
1360
+ for (const filename of fs$1.readdirSync(dir)) {
1361
+ if (filename === ".git") continue;
1362
+ const fullpath = path$1.resolve(dir, filename);
1363
+ if (fs$1.lstatSync(fullpath).isDirectory()) {
1364
+ dirCallback(fullpath);
1365
+ if (fs$1.existsSync(fullpath)) preOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
1366
+ continue;
1367
+ }
1368
+ fileCallback(fullpath);
1369
+ }
1370
+ }
1371
+ const dotGitDirectoryState = { hasDotGitDirectory: false };
1372
+ function postOrderDirectoryTraverse(dir, dirCallback, fileCallback) {
1373
+ for (const filename of fs$1.readdirSync(dir)) {
1374
+ if (filename === ".git") {
1375
+ dotGitDirectoryState.hasDotGitDirectory = true;
1376
+ continue;
1377
+ }
1378
+ const fullpath = path$1.resolve(dir, filename);
1379
+ if (fs$1.lstatSync(fullpath).isDirectory()) {
1380
+ postOrderDirectoryTraverse(fullpath, dirCallback, fileCallback);
1381
+ dirCallback(fullpath);
1382
+ continue;
1383
+ }
1384
+ fileCallback(fullpath);
1385
+ }
1386
+ }
1387
+
1388
+ //#endregion
1389
+ //#region src/utils/cli/prompt.ts
1390
+ async function unwrapPrompt(maybeCancelPromise) {
1391
+ const result = await maybeCancelPromise;
1392
+ if (pD(result)) {
1393
+ xe((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
1394
+ process.exit(0);
1395
+ }
1396
+ return result;
1397
+ }
1398
+
1399
+ //#endregion
1400
+ //#region src/utils/helpers/package.ts
1401
+ function isValidPackageName(projectName) {
1402
+ return /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(projectName);
1403
+ }
1404
+ function toValidPackageName(projectName) {
1405
+ return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
1406
+ }
1407
+
1408
+ //#endregion
1409
+ //#region src/utils/fs/directory.ts
1410
+ function canSkipEmptying(dir) {
1411
+ if (!fs$1.existsSync(dir)) return true;
1412
+ const files = fs$1.readdirSync(dir);
1413
+ if (files.length === 0) return true;
1414
+ if (files.length === 1 && files[0] === ".git") {
1415
+ dotGitDirectoryState.hasDotGitDirectory = true;
1416
+ return true;
1417
+ }
1418
+ return false;
1419
+ }
1420
+ function emptyDir(dir) {
1421
+ if (!fs$1.existsSync(dir)) return;
1422
+ postOrderDirectoryTraverse(dir, (dir$1) => fs$1.rmdirSync(dir$1), (file) => fs$1.unlinkSync(file));
1423
+ }
1424
+
1425
+ //#endregion
1426
+ //#region src/cli/prompts.ts
1427
+ async function collectOptions(initialTargetDir, defaultProjectName, forceOverwrite, isFeatureFlagsUsed) {
1428
+ let targetDir = initialTargetDir || defaultProjectName;
1429
+ const result = {
1430
+ projectName: initialTargetDir || defaultProjectName,
1431
+ shouldOverwrite: forceOverwrite,
1432
+ packageName: initialTargetDir || defaultProjectName,
1433
+ features: []
1434
+ };
1435
+ if (!initialTargetDir) targetDir = result.projectName = result.packageName = (await unwrapPrompt(he({
1436
+ message: language.projectName.message,
1437
+ placeholder: defaultProjectName,
1438
+ defaultValue: defaultProjectName,
1439
+ validate: (value) => value.length === 0 || value.trim().length > 0 ? void 0 : language.projectName.invalidMessage
1440
+ }))).trim();
1441
+ if (!canSkipEmptying(targetDir) && !forceOverwrite) {
1442
+ result.shouldOverwrite = await unwrapPrompt(ye({
1443
+ message: `${targetDir === "." ? language.shouldOverwrite.dirForPrompts.current : `${language.shouldOverwrite.dirForPrompts.target} "${targetDir}"`} ${language.shouldOverwrite.message}`,
1444
+ initialValue: false
1445
+ }));
1446
+ if (!result.shouldOverwrite) {
1447
+ xe((0, import_picocolors.red)("✖") + ` ${language.errors.operationCancelled}`);
1448
+ process.exit(0);
1449
+ }
1450
+ }
1451
+ if (!isValidPackageName(targetDir)) result.packageName = await unwrapPrompt(he({
1452
+ message: language.packageName.message,
1453
+ initialValue: toValidPackageName(targetDir),
1454
+ validate: (value) => isValidPackageName(value) ? void 0 : language.packageName.invalidMessage
1455
+ }));
1456
+ if (!isFeatureFlagsUsed) result.features = await unwrapPrompt(fe({
1457
+ message: `${language.featureSelection.message} ${(0, import_picocolors.dim)(language.featureSelection.hint)}`,
1458
+ options: FEATURE_OPTIONS,
1459
+ required: false
1460
+ }));
1461
+ return {
1462
+ targetDir,
1463
+ result
1464
+ };
1465
+ }
1466
+
1467
+ //#endregion
1468
+ //#region node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/utils.js
1469
+ /**
1470
+ * Private utility functions
1471
+ * @module utils
1472
+ * @private
1473
+ */
1474
+ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
1475
+ var regExpChars = /[|\\{}()[\]^$+*?.]/g;
1476
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1477
+ var hasOwn = function(obj, key) {
1478
+ return hasOwnProperty.apply(obj, [key]);
1479
+ };
1480
+ /**
1481
+ * Escape characters reserved in regular expressions.
1482
+ *
1483
+ * If `string` is `undefined` or `null`, the empty string is returned.
1484
+ *
1485
+ * @param {String} string Input string
1486
+ * @return {String} Escaped string
1487
+ * @static
1488
+ * @private
1489
+ */
1490
+ exports.escapeRegExpChars = function(string) {
1491
+ // istanbul ignore if
1492
+ if (!string) return "";
1493
+ return String(string).replace(regExpChars, "\\$&");
1494
+ };
1495
+ var _ENCODE_HTML_RULES = {
1496
+ "&": "&amp;",
1497
+ "<": "&lt;",
1498
+ ">": "&gt;",
1499
+ "\"": "&#34;",
1500
+ "'": "&#39;"
1501
+ };
1502
+ var _MATCH_HTML = /[&<>'"]/g;
1503
+ function encode_char(c) {
1504
+ return _ENCODE_HTML_RULES[c] || c;
1505
+ }
1506
+ /**
1507
+ * Stringified version of constants used by {@link module:utils.escapeXML}.
1508
+ *
1509
+ * It is used in the process of generating {@link ClientFunction}s.
1510
+ *
1511
+ * @readonly
1512
+ * @type {String}
1513
+ */
1514
+ var escapeFuncStr = "var _ENCODE_HTML_RULES = {\n \"&\": \"&amp;\"\n , \"<\": \"&lt;\"\n , \">\": \"&gt;\"\n , '\"': \"&#34;\"\n , \"'\": \"&#39;\"\n }\n , _MATCH_HTML = /[&<>'\"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n";
1515
+ /**
1516
+ * Escape characters reserved in XML.
1517
+ *
1518
+ * If `markup` is `undefined` or `null`, the empty string is returned.
1519
+ *
1520
+ * @implements {EscapeCallback}
1521
+ * @param {String} markup Input string
1522
+ * @return {String} Escaped string
1523
+ * @static
1524
+ * @private
1525
+ */
1526
+ exports.escapeXML = function(markup) {
1527
+ return markup == void 0 ? "" : String(markup).replace(_MATCH_HTML, encode_char);
1528
+ };
1529
+ function escapeXMLToString() {
1530
+ return Function.prototype.toString.call(this) + ";\n" + escapeFuncStr;
1531
+ }
1532
+ try {
1533
+ if (typeof Object.defineProperty === "function") Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString });
1534
+ else exports.escapeXML.toString = escapeXMLToString;
1535
+ } catch (err) {
1536
+ console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
1537
+ }
1538
+ /**
1539
+ * Naive copy of properties from one object to another.
1540
+ * Does not recurse into non-scalar properties
1541
+ * Does not check to see if the property has a value before copying
1542
+ *
1543
+ * @param {Object} to Destination object
1544
+ * @param {Object} from Source object
1545
+ * @return {Object} Destination object
1546
+ * @static
1547
+ * @private
1548
+ */
1549
+ exports.shallowCopy = function(to, from) {
1550
+ from = from || {};
1551
+ if (to !== null && to !== void 0) for (var p$1 in from) {
1552
+ if (!hasOwn(from, p$1)) continue;
1553
+ if (p$1 === "__proto__" || p$1 === "constructor") continue;
1554
+ to[p$1] = from[p$1];
1555
+ }
1556
+ return to;
1557
+ };
1558
+ /**
1559
+ * Naive copy of a list of key names, from one object to another.
1560
+ * Only copies property if it is actually defined
1561
+ * Does not recurse into non-scalar properties
1562
+ *
1563
+ * @param {Object} to Destination object
1564
+ * @param {Object} from Source object
1565
+ * @param {Array} list List of properties to copy
1566
+ * @return {Object} Destination object
1567
+ * @static
1568
+ * @private
1569
+ */
1570
+ exports.shallowCopyFromList = function(to, from, list) {
1571
+ list = list || [];
1572
+ from = from || {};
1573
+ if (to !== null && to !== void 0) for (var i = 0; i < list.length; i++) {
1574
+ var p$1 = list[i];
1575
+ if (typeof from[p$1] != "undefined") {
1576
+ if (!hasOwn(from, p$1)) continue;
1577
+ if (p$1 === "__proto__" || p$1 === "constructor") continue;
1578
+ to[p$1] = from[p$1];
1579
+ }
1580
+ }
1581
+ return to;
1582
+ };
1583
+ /**
1584
+ * Simple in-process cache implementation. Does not implement limits of any
1585
+ * sort.
1586
+ *
1587
+ * @implements {Cache}
1588
+ * @static
1589
+ * @private
1590
+ */
1591
+ exports.cache = {
1592
+ _data: {},
1593
+ set: function(key, val) {
1594
+ this._data[key] = val;
1595
+ },
1596
+ get: function(key) {
1597
+ return this._data[key];
1598
+ },
1599
+ remove: function(key) {
1600
+ delete this._data[key];
1601
+ },
1602
+ reset: function() {
1603
+ this._data = {};
1604
+ }
1605
+ };
1606
+ /**
1607
+ * Transforms hyphen case variable into camel case.
1608
+ *
1609
+ * @param {String} string Hyphen case string
1610
+ * @return {String} Camel case string
1611
+ * @static
1612
+ * @private
1613
+ */
1614
+ exports.hyphenToCamel = function(str) {
1615
+ return str.replace(/-[a-z]/g, function(match) {
1616
+ return match[1].toUpperCase();
1617
+ });
1618
+ };
1619
+ /**
1620
+ * Returns a null-prototype object in runtimes that support it
1621
+ *
1622
+ * @return {Object} Object, prototype will be set to null where possible
1623
+ * @static
1624
+ * @private
1625
+ */
1626
+ exports.createNullProtoObjWherePossible = (function() {
1627
+ if (typeof Object.create == "function") return function() {
1628
+ return Object.create(null);
1629
+ };
1630
+ if (!({ __proto__: null } instanceof Object)) return function() {
1631
+ return { __proto__: null };
1632
+ };
1633
+ return function() {
1634
+ return {};
1635
+ };
1636
+ })();
1637
+ exports.hasOwnOnlyObject = function(obj) {
1638
+ var o$1 = exports.createNullProtoObjWherePossible();
1639
+ for (var p$1 in obj) if (hasOwn(obj, p$1)) o$1[p$1] = obj[p$1];
1640
+ return o$1;
1641
+ };
1642
+ }));
1643
+
1644
+ //#endregion
1645
+ //#region node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/package.json
1646
+ var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1647
+ module.exports = {
1648
+ "name": "ejs",
1649
+ "description": "Embedded JavaScript templates",
1650
+ "keywords": [
1651
+ "template",
1652
+ "engine",
1653
+ "ejs"
1654
+ ],
1655
+ "version": "3.1.10",
1656
+ "author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
1657
+ "license": "Apache-2.0",
1658
+ "bin": { "ejs": "./bin/cli.js" },
1659
+ "main": "./lib/ejs.js",
1660
+ "jsdelivr": "ejs.min.js",
1661
+ "unpkg": "ejs.min.js",
1662
+ "repository": {
1663
+ "type": "git",
1664
+ "url": "git://github.com/mde/ejs.git"
1665
+ },
1666
+ "bugs": "https://github.com/mde/ejs/issues",
1667
+ "homepage": "https://github.com/mde/ejs",
1668
+ "dependencies": { "jake": "^10.8.5" },
1669
+ "devDependencies": {
1670
+ "browserify": "^16.5.1",
1671
+ "eslint": "^6.8.0",
1672
+ "git-directory-deploy": "^1.5.1",
1673
+ "jsdoc": "^4.0.2",
1674
+ "lru-cache": "^4.0.1",
1675
+ "mocha": "^10.2.0",
1676
+ "uglify-js": "^3.3.16"
1677
+ },
1678
+ "engines": { "node": ">=0.10.0" },
1679
+ "scripts": { "test": "npx jake test" }
1680
+ };
1681
+ }));
1682
+
1683
+ //#endregion
1684
+ //#region node_modules/.pnpm/ejs@3.1.10/node_modules/ejs/lib/ejs.js
1685
+ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
1686
+ /**
1687
+ * @file Embedded JavaScript templating engine. {@link http://ejs.co}
1688
+ * @author Matthew Eernisse <mde@fleegix.org>
1689
+ * @author Tiancheng "Timothy" Gu <timothygu99@gmail.com>
1690
+ * @project EJS
1691
+ * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
1692
+ */
1693
+ /**
1694
+ * EJS internal functions.
1695
+ *
1696
+ * Technically this "module" lies in the same file as {@link module:ejs}, for
1697
+ * the sake of organization all the private functions re grouped into this
1698
+ * module.
1699
+ *
1700
+ * @module ejs-internal
1701
+ * @private
1702
+ */
1703
+ /**
1704
+ * Embedded JavaScript templating engine.
1705
+ *
1706
+ * @module ejs
1707
+ * @public
1708
+ */
1709
+ var fs = __require("fs");
1710
+ var path = __require("path");
1711
+ var utils = require_utils();
1712
+ var scopeOptionWarned = false;
1713
+ /** @type {string} */
1714
+ var _VERSION_STRING = require_package().version;
1715
+ var _DEFAULT_OPEN_DELIMITER = "<";
1716
+ var _DEFAULT_CLOSE_DELIMITER = ">";
1717
+ var _DEFAULT_DELIMITER = "%";
1718
+ var _DEFAULT_LOCALS_NAME = "locals";
1719
+ var _NAME = "ejs";
1720
+ var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
1721
+ var _OPTS_PASSABLE_WITH_DATA = [
1722
+ "delimiter",
1723
+ "scope",
1724
+ "context",
1725
+ "debug",
1726
+ "compileDebug",
1727
+ "client",
1728
+ "_with",
1729
+ "rmWhitespace",
1730
+ "strict",
1731
+ "filename",
1732
+ "async"
1733
+ ];
1734
+ var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
1735
+ var _BOM = /^\uFEFF/;
1736
+ var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
1737
+ /**
1738
+ * EJS template function cache. This can be a LRU object from lru-cache NPM
1739
+ * module. By default, it is {@link module:utils.cache}, a simple in-process
1740
+ * cache that grows continuously.
1741
+ *
1742
+ * @type {Cache}
1743
+ */
1744
+ exports.cache = utils.cache;
1745
+ /**
1746
+ * Custom file loader. Useful for template preprocessing or restricting access
1747
+ * to a certain part of the filesystem.
1748
+ *
1749
+ * @type {fileLoader}
1750
+ */
1751
+ exports.fileLoader = fs.readFileSync;
1752
+ /**
1753
+ * Name of the object containing the locals.
1754
+ *
1755
+ * This variable is overridden by {@link Options}`.localsName` if it is not
1756
+ * `undefined`.
1757
+ *
1758
+ * @type {String}
1759
+ * @public
1760
+ */
1761
+ exports.localsName = _DEFAULT_LOCALS_NAME;
1762
+ /**
1763
+ * Promise implementation -- defaults to the native implementation if available
1764
+ * This is mostly just for testability
1765
+ *
1766
+ * @type {PromiseConstructorLike}
1767
+ * @public
1768
+ */
1769
+ exports.promiseImpl = new Function("return this;")().Promise;
1770
+ /**
1771
+ * Get the path to the included file from the parent file path and the
1772
+ * specified path.
1773
+ *
1774
+ * @param {String} name specified path
1775
+ * @param {String} filename parent file path
1776
+ * @param {Boolean} [isDir=false] whether the parent file path is a directory
1777
+ * @return {String}
1778
+ */
1779
+ exports.resolveInclude = function(name$1, filename, isDir) {
1780
+ var dirname = path.dirname;
1781
+ var extname = path.extname;
1782
+ var resolve = path.resolve;
1783
+ var includePath = resolve(isDir ? filename : dirname(filename), name$1);
1784
+ if (!extname(name$1)) includePath += ".ejs";
1785
+ return includePath;
1786
+ };
1787
+ /**
1788
+ * Try to resolve file path on multiple directories
1789
+ *
1790
+ * @param {String} name specified path
1791
+ * @param {Array<String>} paths list of possible parent directory paths
1792
+ * @return {String}
1793
+ */
1794
+ function resolvePaths(name$1, paths) {
1795
+ var filePath;
1796
+ if (paths.some(function(v$1) {
1797
+ filePath = exports.resolveInclude(name$1, v$1, true);
1798
+ return fs.existsSync(filePath);
1799
+ })) return filePath;
1800
+ }
1801
+ /**
1802
+ * Get the path to the included file by Options
1803
+ *
1804
+ * @param {String} path specified path
1805
+ * @param {Options} options compilation options
1806
+ * @return {String}
1807
+ */
1808
+ function getIncludePath(path$2, options) {
1809
+ var includePath;
1810
+ var filePath;
1811
+ var views = options.views;
1812
+ var match = /^[A-Za-z]+:\\|^\//.exec(path$2);
1813
+ if (match && match.length) {
1814
+ path$2 = path$2.replace(/^\/*/, "");
1815
+ if (Array.isArray(options.root)) includePath = resolvePaths(path$2, options.root);
1816
+ else includePath = exports.resolveInclude(path$2, options.root || "/", true);
1817
+ } else {
1818
+ if (options.filename) {
1819
+ filePath = exports.resolveInclude(path$2, options.filename);
1820
+ if (fs.existsSync(filePath)) includePath = filePath;
1821
+ }
1822
+ if (!includePath && Array.isArray(views)) includePath = resolvePaths(path$2, views);
1823
+ if (!includePath && typeof options.includer !== "function") throw new Error("Could not find the include file \"" + options.escapeFunction(path$2) + "\"");
1824
+ }
1825
+ return includePath;
1826
+ }
1827
+ /**
1828
+ * Get the template from a string or a file, either compiled on-the-fly or
1829
+ * read from cache (if enabled), and cache the template if needed.
1830
+ *
1831
+ * If `template` is not set, the file specified in `options.filename` will be
1832
+ * read.
1833
+ *
1834
+ * If `options.cache` is true, this function reads the file from
1835
+ * `options.filename` so it must be set prior to calling this function.
1836
+ *
1837
+ * @memberof module:ejs-internal
1838
+ * @param {Options} options compilation options
1839
+ * @param {String} [template] template source
1840
+ * @return {(TemplateFunction|ClientFunction)}
1841
+ * Depending on the value of `options.client`, either type might be returned.
1842
+ * @static
1843
+ */
1844
+ function handleCache(options, template) {
1845
+ var func;
1846
+ var filename = options.filename;
1847
+ var hasTemplate = arguments.length > 1;
1848
+ if (options.cache) {
1849
+ if (!filename) throw new Error("cache option requires a filename");
1850
+ func = exports.cache.get(filename);
1851
+ if (func) return func;
1852
+ if (!hasTemplate) template = fileLoader(filename).toString().replace(_BOM, "");
1853
+ } else if (!hasTemplate) {
1854
+ // istanbul ignore if: should not happen at all
1855
+ if (!filename) throw new Error("Internal EJS error: no file name or template provided");
1856
+ template = fileLoader(filename).toString().replace(_BOM, "");
1857
+ }
1858
+ func = exports.compile(template, options);
1859
+ if (options.cache) exports.cache.set(filename, func);
1860
+ return func;
1861
+ }
1862
+ /**
1863
+ * Try calling handleCache with the given options and data and call the
1864
+ * callback with the result. If an error occurs, call the callback with
1865
+ * the error. Used by renderFile().
1866
+ *
1867
+ * @memberof module:ejs-internal
1868
+ * @param {Options} options compilation options
1869
+ * @param {Object} data template data
1870
+ * @param {RenderFileCallback} cb callback
1871
+ * @static
1872
+ */
1873
+ function tryHandleCache(options, data, cb) {
1874
+ var result;
1875
+ if (!cb) if (typeof exports.promiseImpl == "function") return new exports.promiseImpl(function(resolve, reject) {
1876
+ try {
1877
+ result = handleCache(options)(data);
1878
+ resolve(result);
1879
+ } catch (err) {
1880
+ reject(err);
1881
+ }
1882
+ });
1883
+ else throw new Error("Please provide a callback function");
1884
+ else {
1885
+ try {
1886
+ result = handleCache(options)(data);
1887
+ } catch (err) {
1888
+ return cb(err);
1889
+ }
1890
+ cb(null, result);
1891
+ }
1892
+ }
1893
+ /**
1894
+ * fileLoader is independent
1895
+ *
1896
+ * @param {String} filePath ejs file path.
1897
+ * @return {String} The contents of the specified file.
1898
+ * @static
1899
+ */
1900
+ function fileLoader(filePath) {
1901
+ return exports.fileLoader(filePath);
1902
+ }
1903
+ /**
1904
+ * Get the template function.
1905
+ *
1906
+ * If `options.cache` is `true`, then the template is cached.
1907
+ *
1908
+ * @memberof module:ejs-internal
1909
+ * @param {String} path path for the specified file
1910
+ * @param {Options} options compilation options
1911
+ * @return {(TemplateFunction|ClientFunction)}
1912
+ * Depending on the value of `options.client`, either type might be returned
1913
+ * @static
1914
+ */
1915
+ function includeFile(path$2, options) {
1916
+ var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
1917
+ opts.filename = getIncludePath(path$2, opts);
1918
+ if (typeof options.includer === "function") {
1919
+ var includerResult = options.includer(path$2, opts.filename);
1920
+ if (includerResult) {
1921
+ if (includerResult.filename) opts.filename = includerResult.filename;
1922
+ if (includerResult.template) return handleCache(opts, includerResult.template);
1923
+ }
1924
+ }
1925
+ return handleCache(opts);
1926
+ }
1927
+ /**
1928
+ * Re-throw the given `err` in context to the `str` of ejs, `filename`, and
1929
+ * `lineno`.
1930
+ *
1931
+ * @implements {RethrowCallback}
1932
+ * @memberof module:ejs-internal
1933
+ * @param {Error} err Error object
1934
+ * @param {String} str EJS source
1935
+ * @param {String} flnm file name of the EJS file
1936
+ * @param {Number} lineno line number of the error
1937
+ * @param {EscapeCallback} esc
1938
+ * @static
1939
+ */
1940
+ function rethrow(err, str, flnm, lineno, esc) {
1941
+ var lines = str.split("\n");
1942
+ var start = Math.max(lineno - 3, 0);
1943
+ var end = Math.min(lines.length, lineno + 3);
1944
+ var filename = esc(flnm);
1945
+ var context = lines.slice(start, end).map(function(line, i) {
1946
+ var curr = i + start + 1;
1947
+ return (curr == lineno ? " >> " : " ") + curr + "| " + line;
1948
+ }).join("\n");
1949
+ err.path = filename;
1950
+ err.message = (filename || "ejs") + ":" + lineno + "\n" + context + "\n\n" + err.message;
1951
+ throw err;
1952
+ }
1953
+ function stripSemi(str) {
1954
+ return str.replace(/;(\s*$)/, "$1");
1955
+ }
1956
+ /**
1957
+ * Compile the given `str` of ejs into a template function.
1958
+ *
1959
+ * @param {String} template EJS template
1960
+ *
1961
+ * @param {Options} [opts] compilation options
1962
+ *
1963
+ * @return {(TemplateFunction|ClientFunction)}
1964
+ * Depending on the value of `opts.client`, either type might be returned.
1965
+ * Note that the return type of the function also depends on the value of `opts.async`.
1966
+ * @public
1967
+ */
1968
+ exports.compile = function compile(template, opts) {
1969
+ var templ;
1970
+ if (opts && opts.scope) {
1971
+ if (!scopeOptionWarned) {
1972
+ console.warn("`scope` option is deprecated and will be removed in EJS 3");
1973
+ scopeOptionWarned = true;
1974
+ }
1975
+ if (!opts.context) opts.context = opts.scope;
1976
+ delete opts.scope;
1977
+ }
1978
+ templ = new Template(template, opts);
1979
+ return templ.compile();
1980
+ };
1981
+ /**
1982
+ * Render the given `template` of ejs.
1983
+ *
1984
+ * If you would like to include options but not data, you need to explicitly
1985
+ * call this function with `data` being an empty object or `null`.
1986
+ *
1987
+ * @param {String} template EJS template
1988
+ * @param {Object} [data={}] template data
1989
+ * @param {Options} [opts={}] compilation and rendering options
1990
+ * @return {(String|Promise<String>)}
1991
+ * Return value type depends on `opts.async`.
1992
+ * @public
1993
+ */
1994
+ exports.render = function(template, d$2, o$1) {
1995
+ var data = d$2 || utils.createNullProtoObjWherePossible();
1996
+ var opts = o$1 || utils.createNullProtoObjWherePossible();
1997
+ if (arguments.length == 2) utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
1998
+ return handleCache(opts, template)(data);
1999
+ };
2000
+ /**
2001
+ * Render an EJS file at the given `path` and callback `cb(err, str)`.
2002
+ *
2003
+ * If you would like to include options but not data, you need to explicitly
2004
+ * call this function with `data` being an empty object or `null`.
2005
+ *
2006
+ * @param {String} path path to the EJS file
2007
+ * @param {Object} [data={}] template data
2008
+ * @param {Options} [opts={}] compilation and rendering options
2009
+ * @param {RenderFileCallback} cb callback
2010
+ * @public
2011
+ */
2012
+ exports.renderFile = function() {
2013
+ var args = Array.prototype.slice.call(arguments);
2014
+ var filename = args.shift();
2015
+ var cb;
2016
+ var opts = { filename };
2017
+ var data;
2018
+ var viewOpts;
2019
+ if (typeof arguments[arguments.length - 1] == "function") cb = args.pop();
2020
+ if (args.length) {
2021
+ data = args.shift();
2022
+ if (args.length) utils.shallowCopy(opts, args.pop());
2023
+ else {
2024
+ if (data.settings) {
2025
+ if (data.settings.views) opts.views = data.settings.views;
2026
+ if (data.settings["view cache"]) opts.cache = true;
2027
+ viewOpts = data.settings["view options"];
2028
+ if (viewOpts) utils.shallowCopy(opts, viewOpts);
2029
+ }
2030
+ utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
2031
+ }
2032
+ opts.filename = filename;
2033
+ } else data = utils.createNullProtoObjWherePossible();
2034
+ return tryHandleCache(opts, data, cb);
2035
+ };
2036
+ /**
2037
+ * Clear intermediate JavaScript cache. Calls {@link Cache#reset}.
2038
+ * @public
2039
+ */
2040
+ /**
2041
+ * EJS template class
2042
+ * @public
2043
+ */
2044
+ exports.Template = Template;
2045
+ exports.clearCache = function() {
2046
+ exports.cache.reset();
2047
+ };
2048
+ function Template(text, optsParam) {
2049
+ var opts = utils.hasOwnOnlyObject(optsParam);
2050
+ var options = utils.createNullProtoObjWherePossible();
2051
+ this.templateText = text;
2052
+ /** @type {string | null} */
2053
+ this.mode = null;
2054
+ this.truncate = false;
2055
+ this.currentLine = 1;
2056
+ this.source = "";
2057
+ options.client = opts.client || false;
2058
+ options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
2059
+ options.compileDebug = opts.compileDebug !== false;
2060
+ options.debug = !!opts.debug;
2061
+ options.filename = opts.filename;
2062
+ options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;
2063
+ options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
2064
+ options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
2065
+ options.strict = opts.strict || false;
2066
+ options.context = opts.context;
2067
+ options.cache = opts.cache || false;
2068
+ options.rmWhitespace = opts.rmWhitespace;
2069
+ options.root = opts.root;
2070
+ options.includer = opts.includer;
2071
+ options.outputFunctionName = opts.outputFunctionName;
2072
+ options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
2073
+ options.views = opts.views;
2074
+ options.async = opts.async;
2075
+ options.destructuredLocals = opts.destructuredLocals;
2076
+ options.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
2077
+ if (options.strict) options._with = false;
2078
+ else options._with = typeof opts._with != "undefined" ? opts._with : true;
2079
+ this.opts = options;
2080
+ this.regex = this.createRegex();
2081
+ }
2082
+ Template.modes = {
2083
+ EVAL: "eval",
2084
+ ESCAPED: "escaped",
2085
+ RAW: "raw",
2086
+ COMMENT: "comment",
2087
+ LITERAL: "literal"
2088
+ };
2089
+ Template.prototype = {
2090
+ createRegex: function() {
2091
+ var str = _REGEX_STRING;
2092
+ var delim = utils.escapeRegExpChars(this.opts.delimiter);
2093
+ var open = utils.escapeRegExpChars(this.opts.openDelimiter);
2094
+ var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
2095
+ str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
2096
+ return new RegExp(str);
2097
+ },
2098
+ compile: function() {
2099
+ /** @type {string} */
2100
+ var src;
2101
+ /** @type {ClientFunction} */
2102
+ var fn;
2103
+ var opts = this.opts;
2104
+ var prepended = "";
2105
+ var appended = "";
2106
+ /** @type {EscapeCallback} */
2107
+ var escapeFn = opts.escapeFunction;
2108
+ /** @type {FunctionConstructor} */
2109
+ var ctor;
2110
+ /** @type {string} */
2111
+ var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
2112
+ if (!this.source) {
2113
+ this.generateSource();
2114
+ prepended += " var __output = \"\";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n";
2115
+ if (opts.outputFunctionName) {
2116
+ if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) throw new Error("outputFunctionName is not a valid JS identifier.");
2117
+ prepended += " var " + opts.outputFunctionName + " = __append;\n";
2118
+ }
2119
+ if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) throw new Error("localsName is not a valid JS identifier.");
2120
+ if (opts.destructuredLocals && opts.destructuredLocals.length) {
2121
+ var destructuring = " var __locals = (" + opts.localsName + " || {}),\n";
2122
+ for (var i = 0; i < opts.destructuredLocals.length; i++) {
2123
+ var name$1 = opts.destructuredLocals[i];
2124
+ if (!_JS_IDENTIFIER.test(name$1)) throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
2125
+ if (i > 0) destructuring += ",\n ";
2126
+ destructuring += name$1 + " = __locals." + name$1;
2127
+ }
2128
+ prepended += destructuring + ";\n";
2129
+ }
2130
+ if (opts._with !== false) {
2131
+ prepended += " with (" + opts.localsName + " || {}) {\n";
2132
+ appended += " }\n";
2133
+ }
2134
+ appended += " return __output;\n";
2135
+ this.source = prepended + this.source + appended;
2136
+ }
2137
+ if (opts.compileDebug) src = "var __line = 1\n , __lines = " + JSON.stringify(this.templateText) + "\n , __filename = " + sanitizedFilename + ";\ntry {\n" + this.source + "} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n";
2138
+ else src = this.source;
2139
+ if (opts.client) {
2140
+ src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src;
2141
+ if (opts.compileDebug) src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src;
2142
+ }
2143
+ if (opts.strict) src = "\"use strict\";\n" + src;
2144
+ if (opts.debug) console.log(src);
2145
+ if (opts.compileDebug && opts.filename) src = src + "\n//# sourceURL=" + sanitizedFilename + "\n";
2146
+ try {
2147
+ if (opts.async) try {
2148
+ ctor = new Function("return (async function(){}).constructor;")();
2149
+ } catch (e$1) {
2150
+ if (e$1 instanceof SyntaxError) throw new Error("This environment does not support async/await");
2151
+ else throw e$1;
2152
+ }
2153
+ else ctor = Function;
2154
+ fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
2155
+ } catch (e$1) {
2156
+ // istanbul ignore else
2157
+ if (e$1 instanceof SyntaxError) {
2158
+ if (opts.filename) e$1.message += " in " + opts.filename;
2159
+ e$1.message += " while compiling ejs\n\n";
2160
+ e$1.message += "If the above error is not helpful, you may want to try EJS-Lint:\n";
2161
+ e$1.message += "https://github.com/RyanZim/EJS-Lint";
2162
+ if (!opts.async) {
2163
+ e$1.message += "\n";
2164
+ e$1.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
2165
+ }
2166
+ }
2167
+ throw e$1;
2168
+ }
2169
+ var returnedFn = opts.client ? fn : function anonymous(data) {
2170
+ var include = function(path$2, includeData) {
2171
+ var d$2 = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
2172
+ if (includeData) d$2 = utils.shallowCopy(d$2, includeData);
2173
+ return includeFile(path$2, opts)(d$2);
2174
+ };
2175
+ return fn.apply(opts.context, [
2176
+ data || utils.createNullProtoObjWherePossible(),
2177
+ escapeFn,
2178
+ include,
2179
+ rethrow
2180
+ ]);
2181
+ };
2182
+ if (opts.filename && typeof Object.defineProperty === "function") {
2183
+ var filename = opts.filename;
2184
+ var basename = path.basename(filename, path.extname(filename));
2185
+ try {
2186
+ Object.defineProperty(returnedFn, "name", {
2187
+ value: basename,
2188
+ writable: false,
2189
+ enumerable: false,
2190
+ configurable: true
2191
+ });
2192
+ } catch (e$1) {}
2193
+ }
2194
+ return returnedFn;
2195
+ },
2196
+ generateSource: function() {
2197
+ if (this.opts.rmWhitespace) this.templateText = this.templateText.replace(/[\r\n]+/g, "\n").replace(/^\s+|\s+$/gm, "");
2198
+ this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
2199
+ var self = this;
2200
+ var matches = this.parseTemplateText();
2201
+ var d$2 = this.opts.delimiter;
2202
+ var o$1 = this.opts.openDelimiter;
2203
+ var c = this.opts.closeDelimiter;
2204
+ if (matches && matches.length) matches.forEach(function(line, index) {
2205
+ var closing;
2206
+ if (line.indexOf(o$1 + d$2) === 0 && line.indexOf(o$1 + d$2 + d$2) !== 0) {
2207
+ closing = matches[index + 2];
2208
+ if (!(closing == d$2 + c || closing == "-" + d$2 + c || closing == "_" + d$2 + c)) throw new Error("Could not find matching close tag for \"" + line + "\".");
2209
+ }
2210
+ self.scanLine(line);
2211
+ });
2212
+ },
2213
+ parseTemplateText: function() {
2214
+ var str = this.templateText;
2215
+ var pat = this.regex;
2216
+ var result = pat.exec(str);
2217
+ var arr = [];
2218
+ var firstPos;
2219
+ while (result) {
2220
+ firstPos = result.index;
2221
+ if (firstPos !== 0) {
2222
+ arr.push(str.substring(0, firstPos));
2223
+ str = str.slice(firstPos);
2224
+ }
2225
+ arr.push(result[0]);
2226
+ str = str.slice(result[0].length);
2227
+ result = pat.exec(str);
2228
+ }
2229
+ if (str) arr.push(str);
2230
+ return arr;
2231
+ },
2232
+ _addOutput: function(line) {
2233
+ if (this.truncate) {
2234
+ line = line.replace(/^(?:\r\n|\r|\n)/, "");
2235
+ this.truncate = false;
2236
+ }
2237
+ if (!line) return line;
2238
+ line = line.replace(/\\/g, "\\\\");
2239
+ line = line.replace(/\n/g, "\\n");
2240
+ line = line.replace(/\r/g, "\\r");
2241
+ line = line.replace(/"/g, "\\\"");
2242
+ this.source += " ; __append(\"" + line + "\")\n";
2243
+ },
2244
+ scanLine: function(line) {
2245
+ var self = this;
2246
+ var d$2 = this.opts.delimiter;
2247
+ var o$1 = this.opts.openDelimiter;
2248
+ var c = this.opts.closeDelimiter;
2249
+ var newLineCount = 0;
2250
+ newLineCount = line.split("\n").length - 1;
2251
+ switch (line) {
2252
+ case o$1 + d$2:
2253
+ case o$1 + d$2 + "_":
2254
+ this.mode = Template.modes.EVAL;
2255
+ break;
2256
+ case o$1 + d$2 + "=":
2257
+ this.mode = Template.modes.ESCAPED;
2258
+ break;
2259
+ case o$1 + d$2 + "-":
2260
+ this.mode = Template.modes.RAW;
2261
+ break;
2262
+ case o$1 + d$2 + "#":
2263
+ this.mode = Template.modes.COMMENT;
2264
+ break;
2265
+ case o$1 + d$2 + d$2:
2266
+ this.mode = Template.modes.LITERAL;
2267
+ this.source += " ; __append(\"" + line.replace(o$1 + d$2 + d$2, o$1 + d$2) + "\")\n";
2268
+ break;
2269
+ case d$2 + d$2 + c:
2270
+ this.mode = Template.modes.LITERAL;
2271
+ this.source += " ; __append(\"" + line.replace(d$2 + d$2 + c, d$2 + c) + "\")\n";
2272
+ break;
2273
+ case d$2 + c:
2274
+ case "-" + d$2 + c:
2275
+ case "_" + d$2 + c:
2276
+ if (this.mode == Template.modes.LITERAL) this._addOutput(line);
2277
+ this.mode = null;
2278
+ this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
2279
+ break;
2280
+ default: if (this.mode) {
2281
+ switch (this.mode) {
2282
+ case Template.modes.EVAL:
2283
+ case Template.modes.ESCAPED:
2284
+ case Template.modes.RAW: if (line.lastIndexOf("//") > line.lastIndexOf("\n")) line += "\n";
2285
+ }
2286
+ switch (this.mode) {
2287
+ case Template.modes.EVAL:
2288
+ this.source += " ; " + line + "\n";
2289
+ break;
2290
+ case Template.modes.ESCAPED:
2291
+ this.source += " ; __append(escapeFn(" + stripSemi(line) + "))\n";
2292
+ break;
2293
+ case Template.modes.RAW:
2294
+ this.source += " ; __append(" + stripSemi(line) + ")\n";
2295
+ break;
2296
+ case Template.modes.COMMENT: break;
2297
+ case Template.modes.LITERAL:
2298
+ this._addOutput(line);
2299
+ break;
2300
+ }
2301
+ } else this._addOutput(line);
2302
+ }
2303
+ if (self.opts.compileDebug && newLineCount) {
2304
+ this.currentLine += newLineCount;
2305
+ this.source += " ; __line = " + this.currentLine + "\n";
2306
+ }
2307
+ }
2308
+ };
2309
+ /**
2310
+ * Escape characters reserved in XML.
2311
+ *
2312
+ * This is simply an export of {@link module:utils.escapeXML}.
2313
+ *
2314
+ * If `markup` is `undefined` or `null`, the empty string is returned.
2315
+ *
2316
+ * @param {String} markup Input string
2317
+ * @return {String} Escaped string
2318
+ * @public
2319
+ * @func
2320
+ * */
2321
+ exports.escapeXML = utils.escapeXML;
2322
+ /**
2323
+ * Express.js support.
2324
+ *
2325
+ * This is an alias for {@link module:ejs.renderFile}, in order to support
2326
+ * Express.js out-of-the-box.
2327
+ *
2328
+ * @func
2329
+ */
2330
+ exports.__express = exports.renderFile;
2331
+ /**
2332
+ * Version of EJS.
2333
+ *
2334
+ * @readonly
2335
+ * @type {String}
2336
+ * @public
2337
+ */
2338
+ exports.VERSION = _VERSION_STRING;
2339
+ /**
2340
+ * Name for detection of EJS.
2341
+ *
2342
+ * @readonly
2343
+ * @type {String}
2344
+ * @public
2345
+ */
2346
+ exports.name = _NAME;
2347
+ /* istanbul ignore if */
2348
+ if (typeof window != "undefined") window.ejs = exports;
2349
+ }));
2350
+
2351
+ //#endregion
2352
+ //#region src/utils/helpers/deepMerge.ts
2353
+ var import_ejs = /* @__PURE__ */ __toESM(require_ejs(), 1);
2354
+ const isObject = (val) => val !== null && typeof val === "object";
2355
+ const mergeArrayWithDedupe = (a, b$2) => Array.from(new Set([...a, ...b$2]));
2356
+ /**
2357
+ * Recursively merge the content of the new object to the existing one
2358
+ * @param {Object} target the existing object
2359
+ * @param {Object} obj the new object
2360
+ */
2361
+ function deepMerge(target, obj) {
2362
+ for (const key of Object.keys(obj)) {
2363
+ const oldVal = target[key];
2364
+ const newVal = obj[key];
2365
+ if (Array.isArray(oldVal) && Array.isArray(newVal)) target[key] = mergeArrayWithDedupe(oldVal, newVal);
2366
+ else if (isObject(oldVal) && isObject(newVal)) target[key] = deepMerge(oldVal, newVal);
2367
+ else target[key] = newVal;
2368
+ }
2369
+ return target;
2370
+ }
2371
+ var deepMerge_default = deepMerge;
2372
+
2373
+ //#endregion
2374
+ //#region src/utils/helpers/sortDependencies.ts
2375
+ function sortDependencies(packageJson) {
2376
+ const sorted = {};
2377
+ for (const depType of [
2378
+ "dependencies",
2379
+ "devDependencies",
2380
+ "peerDependencies",
2381
+ "optionalDependencies"
2382
+ ]) {
2383
+ const dependencies = packageJson[depType];
2384
+ if (dependencies && typeof dependencies === "object" && dependencies !== null) {
2385
+ sorted[depType] = {};
2386
+ Object.keys(dependencies).sort().forEach((name$1) => {
2387
+ sorted[depType][name$1] = dependencies[name$1];
2388
+ });
2389
+ }
2390
+ }
2391
+ return {
2392
+ ...packageJson,
2393
+ ...sorted
2394
+ };
2395
+ }
2396
+
2397
+ //#endregion
2398
+ //#region src/utils/fs/renderTemplate.ts
2399
+ /**
2400
+ * Renders a template folder/file to the file system,
2401
+ * by recursively copying all files under the `src` directory,
2402
+ * with the following exception:
2403
+ * - `_filename` should be renamed to `.filename`
2404
+ * - Fields in `package.json` should be recursively merged
2405
+ * @param {string} src source filename to copy
2406
+ * @param {string} dest destination filename of the copy operation
2407
+ */
2408
+ function renderTemplate(src, dest, callbacks) {
2409
+ if (fs$1.statSync(src).isDirectory()) {
2410
+ if (path$1.basename(src) === "node_modules") return;
2411
+ const dirname = path$1.basename(src);
2412
+ if (dirname.startsWith("_")) dest = path$1.resolve(path$1.dirname(dest), dirname.replace(/^_/, "."));
2413
+ fs$1.mkdirSync(dest, { recursive: true });
2414
+ for (const file of fs$1.readdirSync(src)) renderTemplate(path$1.resolve(src, file), path$1.resolve(dest, file), callbacks);
2415
+ return;
2416
+ }
2417
+ const filename = path$1.basename(src);
2418
+ if (filename === "package.json" && fs$1.existsSync(dest)) {
2419
+ const pkg = sortDependencies(deepMerge_default(JSON.parse(fs$1.readFileSync(dest, "utf8")), JSON.parse(fs$1.readFileSync(src, "utf8"))));
2420
+ fs$1.writeFileSync(dest, JSON.stringify(pkg, null, 2) + "\n");
2421
+ return;
2422
+ }
2423
+ if (filename === "extensions.json" && fs$1.existsSync(dest)) {
2424
+ const extensions = deepMerge_default(JSON.parse(fs$1.readFileSync(dest, "utf8")), JSON.parse(fs$1.readFileSync(src, "utf8")));
2425
+ fs$1.writeFileSync(dest, JSON.stringify(extensions, null, 2) + "\n");
2426
+ return;
2427
+ }
2428
+ if (filename === "settings.json" && fs$1.existsSync(dest)) {
2429
+ const settings = deepMerge_default(JSON.parse(fs$1.readFileSync(dest, "utf8")), JSON.parse(fs$1.readFileSync(src, "utf8")));
2430
+ fs$1.writeFileSync(dest, JSON.stringify(settings, null, 2) + "\n");
2431
+ return;
2432
+ }
2433
+ if (filename.startsWith("_")) dest = path$1.resolve(path$1.dirname(dest), filename.replace(/^_/, "."));
2434
+ if (filename === "_gitignore" && fs$1.existsSync(dest)) {
2435
+ const existing = fs$1.readFileSync(dest, "utf8");
2436
+ const newGitignore = fs$1.readFileSync(src, "utf8");
2437
+ fs$1.writeFileSync(dest, existing + "\n" + newGitignore);
2438
+ return;
2439
+ }
2440
+ if (filename.endsWith(".data.mjs")) {
2441
+ dest = dest.replace(/\.data\.mjs$/, "");
2442
+ callbacks.push(async (dataStore) => {
2443
+ const getData = (await import(pathToFileURL(src).toString())).default;
2444
+ dataStore[dest] = await getData({ oldData: dataStore[dest] || {} });
2445
+ });
2446
+ return;
2447
+ }
2448
+ fs$1.copyFileSync(src, dest);
2449
+ }
2450
+ var renderTemplate_default = renderTemplate;
2451
+
2452
+ //#endregion
2453
+ //#region src/core/scaffold.ts
2454
+ async function scaffoldProject({ root, projectName, packageName, shouldOverwrite, features }) {
2455
+ if (fs$1.existsSync(root) && shouldOverwrite) emptyDir(root);
2456
+ else if (!fs$1.existsSync(root)) fs$1.mkdirSync(root);
2457
+ console.log(`
2458
+ ${language.infos.scaffolding} ${root}...`);
2459
+ const pkg = {
2460
+ name: packageName,
2461
+ version: "0.0.0"
2462
+ };
2463
+ fs$1.writeFileSync(path$1.resolve(root, "package.json"), JSON.stringify(pkg, null, 2));
2464
+ const callbacks = [];
2465
+ const render = function render$1(templateName) {
2466
+ renderTemplate_default(path$1.resolve(TEMPLATE_ROOT, templateName), root, callbacks);
2467
+ };
2468
+ render("base");
2469
+ if (features.typescript) {
2470
+ render("config/typescript");
2471
+ render("tsconfig/base");
2472
+ fs$1.writeFileSync(path$1.resolve(root, "tsconfig.json"), JSON.stringify({
2473
+ files: [],
2474
+ references: [{ path: "./tsconfig.node.json" }, { path: "./tsconfig.app.json" }]
2475
+ }, null, 2) + "\n", "utf-8");
2476
+ }
2477
+ if (features.eslint) {
2478
+ render("linting/base");
2479
+ if (features.typescript) render("linting/core/ts");
2480
+ else render("linting/core/js");
2481
+ if (features.prettier) render("linting/prettier");
2482
+ }
2483
+ if (features.prettier) render("formatting/prettier");
2484
+ render(`code/${features.typescript ? "typescript-" : "default"}`);
2485
+ render("entry/default");
2486
+ const dataStore = {};
2487
+ const indexHtmlPath = path$1.resolve(root, "index.html");
2488
+ dataStore[indexHtmlPath] = {
2489
+ title: projectName,
2490
+ entryExt: features.typescript ? "tsx" : "jsx"
2491
+ };
2492
+ for (const cb of callbacks) await cb(dataStore);
2493
+ preOrderDirectoryTraverse(root, () => {}, (filepath) => {
2494
+ if (filepath.endsWith(".ejs")) {
2495
+ const template = fs$1.readFileSync(filepath, "utf-8");
2496
+ const dest = filepath.replace(/\.ejs$/, "");
2497
+ const content = import_ejs.render(template, dataStore[dest]);
2498
+ fs$1.writeFileSync(dest, content);
2499
+ fs$1.unlinkSync(filepath);
2500
+ }
2501
+ });
2502
+ if (features.typescript) {
2503
+ preOrderDirectoryTraverse(root, () => {}, (filepath) => {
2504
+ if (filepath.endsWith(".js")) {
2505
+ const tsFilePath = filepath.replace(/\.js$/, ".ts");
2506
+ if (fs$1.existsSync(tsFilePath)) fs$1.unlinkSync(filepath);
2507
+ else fs$1.renameSync(filepath, tsFilePath);
2508
+ } else if (filepath.endsWith(".jsx")) {
2509
+ const tsxFilePath = filepath.replace(/\.jsx$/, ".tsx");
2510
+ if (fs$1.existsSync(tsxFilePath)) fs$1.unlinkSync(filepath);
2511
+ else fs$1.renameSync(filepath, tsxFilePath);
2512
+ } else if (path$1.basename(filepath) === "jsconfig.json") fs$1.unlinkSync(filepath);
2513
+ });
2514
+ const indexHtmlPath$1 = path$1.resolve(root, "index.html");
2515
+ const indexHtmlContent = fs$1.readFileSync(indexHtmlPath$1, "utf8");
2516
+ fs$1.writeFileSync(indexHtmlPath$1, indexHtmlContent.replace("src/main.js", "src/main.ts"));
2517
+ } else preOrderDirectoryTraverse(root, () => {}, (filepath) => {
2518
+ if (filepath.endsWith(".ts") || filepath.endsWith(".tsx")) fs$1.unlinkSync(filepath);
2519
+ });
2520
+ }
2521
+
2522
+ //#endregion
2523
+ //#region package.json
2524
+ var name = "create-vite-react-cli";
2525
+ var version = "0.4.3";
2526
+
2527
+ //#endregion
2528
+ //#region src/index.ts
2529
+ async function createProject() {
2530
+ const cwd = process.cwd();
2531
+ const args = process.argv.slice(2);
2532
+ const flags = [
2533
+ ...FEATURE_FLAGS,
2534
+ "force",
2535
+ "help",
2536
+ "version"
2537
+ ];
2538
+ const { values: argv, positionals } = parseArgs({
2539
+ args,
2540
+ options: Object.fromEntries(flags.map((key) => [key, { type: "boolean" }])),
2541
+ strict: true,
2542
+ allowPositionals: true
2543
+ });
2544
+ if (argv.help) {
2545
+ console.log(helpMessage);
2546
+ process.exit(0);
2547
+ }
2548
+ if (argv.version) {
2549
+ console.log(`${name} v${version}`);
2550
+ process.exit(0);
2551
+ }
2552
+ const isFeatureFlagsUsed = FEATURE_FLAGS.some((flag) => typeof argv[flag] === "boolean");
2553
+ const initialTargetDir = positionals[0];
2554
+ const defaultProjectName = initialTargetDir || DEFAULT_PROJECT_NAME;
2555
+ const forceOverwrite = argv.force;
2556
+ Ie(process.stdout.isTTY && process.stdout.getColorDepth() > 8 ? gradientBanner : defaultBanner);
2557
+ const { targetDir, result } = await collectOptions(initialTargetDir, defaultProjectName, !!forceOverwrite, isFeatureFlagsUsed);
2558
+ const { features = [] } = result;
2559
+ const needsTypeScript = !!(argv.ts || argv.typescript || features.includes("typescript"));
2560
+ const needsEslint = !!(argv.eslint || argv["eslint-with-prettier"] || features.includes("eslint"));
2561
+ const needsPrettier = !!(argv.prettier || argv["eslint-with-prettier"] || features.includes("prettier"));
2562
+ const root = path$1.join(cwd, targetDir);
2563
+ await scaffoldProject({
2564
+ root,
2565
+ projectName: result.projectName,
2566
+ packageName: result.packageName,
2567
+ shouldOverwrite: !!result.shouldOverwrite,
2568
+ features: {
2569
+ typescript: needsTypeScript,
2570
+ eslint: needsEslint,
2571
+ prettier: needsPrettier
2572
+ }
2573
+ });
2574
+ const userAgent = process.env.npm_config_user_agent ?? "";
2575
+ const packageManager = /pnpm/.test(userAgent) ? "pnpm" : /yarn/.test(userAgent) ? "yarn" : /bun/.test(userAgent) ? "bun" : "npm";
2576
+ let outroMessage = `${language.infos.done}\n\n`;
2577
+ if (root !== cwd) {
2578
+ const cdProjectName = path$1.relative(cwd, root);
2579
+ outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(`cd ${cdProjectName.includes(" ") ? `"${cdProjectName}"` : cdProjectName}`))}\n`;
2580
+ }
2581
+ outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(getCommand(packageManager, "install")))}\n`;
2582
+ if (needsEslint) outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(getCommand(packageManager, "lint")))}\n`;
2583
+ if (needsPrettier) outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(getCommand(packageManager, "format")))}\n`;
2584
+ outroMessage += ` ${(0, import_picocolors.bold)((0, import_picocolors.green)(getCommand(packageManager, "dev")))}\n`;
2585
+ if (!dotGitDirectoryState.hasDotGitDirectory) outroMessage += `
2586
+ ${(0, import_picocolors.dim)("|")} ${language.infos.optionalGitCommand}
2587
+
2588
+ ${(0, import_picocolors.bold)((0, import_picocolors.green)("git init && git add -A && git commit -m \"initial commit\""))}`;
2589
+ Se(outroMessage);
2590
+ }
2591
+ createProject().catch((error) => {
2592
+ console.error(error);
2593
+ process.exit(1);
2594
+ });
2595
+
2596
+ //#endregion
2597
+ export { };