create-pds 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2717 @@
1
+ #!/usr/bin/env node
2
+ import { formatWithOptions, stripVTControlCharacters } from "node:util";
3
+ import { dirname, join, sep } from "node:path";
4
+ import y, { stdin, stdout } from "node:process";
5
+ import * as tty from "node:tty";
6
+ import * as g from "node:readline";
7
+ import O from "node:readline";
8
+ import { Writable } from "node:stream";
9
+ import { spawn } from "node:child_process";
10
+ import { cp, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
11
+ import { existsSync } from "node:fs";
12
+ import { fileURLToPath } from "node:url";
13
+
14
+ //#region rolldown:runtime
15
+ var __create = Object.create;
16
+ var __defProp = Object.defineProperty;
17
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
18
+ var __getOwnPropNames = Object.getOwnPropertyNames;
19
+ var __getProtoOf = Object.getPrototypeOf;
20
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
21
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
22
+ var __copyProps = (to, from, except, desc) => {
23
+ if (from && typeof from === "object" || typeof from === "function") {
24
+ for (var keys = __getOwnPropNames(from), i$1 = 0, n$1 = keys.length, key; i$1 < n$1; i$1++) {
25
+ key = keys[i$1];
26
+ if (!__hasOwnProp.call(to, key) && key !== except) {
27
+ __defProp(to, key, {
28
+ get: ((k$2) => from[k$2]).bind(null, key),
29
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
30
+ });
31
+ }
32
+ }
33
+ }
34
+ return to;
35
+ };
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
37
+ value: mod,
38
+ enumerable: true
39
+ }) : target, mod));
40
+
41
+ //#endregion
42
+ //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
43
+ const LogLevels = {
44
+ silent: Number.NEGATIVE_INFINITY,
45
+ fatal: 0,
46
+ error: 0,
47
+ warn: 1,
48
+ log: 2,
49
+ info: 3,
50
+ success: 3,
51
+ fail: 3,
52
+ ready: 3,
53
+ start: 3,
54
+ box: 3,
55
+ debug: 4,
56
+ trace: 5,
57
+ verbose: Number.POSITIVE_INFINITY
58
+ };
59
+ const LogTypes = {
60
+ silent: { level: -1 },
61
+ fatal: { level: LogLevels.fatal },
62
+ error: { level: LogLevels.error },
63
+ warn: { level: LogLevels.warn },
64
+ log: { level: LogLevels.log },
65
+ info: { level: LogLevels.info },
66
+ success: { level: LogLevels.success },
67
+ fail: { level: LogLevels.fail },
68
+ ready: { level: LogLevels.info },
69
+ start: { level: LogLevels.info },
70
+ box: { level: LogLevels.info },
71
+ debug: { level: LogLevels.debug },
72
+ trace: { level: LogLevels.trace },
73
+ verbose: { level: LogLevels.verbose }
74
+ };
75
+ function isPlainObject$1(value) {
76
+ if (value === null || typeof value !== "object") return false;
77
+ const prototype = Object.getPrototypeOf(value);
78
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
79
+ if (Symbol.iterator in value) return false;
80
+ if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
81
+ return true;
82
+ }
83
+ function _defu(baseObject, defaults, namespace = ".", merger) {
84
+ if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
85
+ const object = Object.assign({}, defaults);
86
+ for (const key in baseObject) {
87
+ if (key === "__proto__" || key === "constructor") continue;
88
+ const value = baseObject[key];
89
+ if (value === null || value === void 0) continue;
90
+ if (merger && merger(object, key, value, namespace)) continue;
91
+ if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
92
+ else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
93
+ else object[key] = value;
94
+ }
95
+ return object;
96
+ }
97
+ function createDefu(merger) {
98
+ return (...arguments_) => arguments_.reduce((p$1, c$1) => _defu(p$1, c$1, "", merger), {});
99
+ }
100
+ const defu = createDefu();
101
+ function isPlainObject(obj) {
102
+ return Object.prototype.toString.call(obj) === "[object Object]";
103
+ }
104
+ function isLogObj(arg) {
105
+ if (!isPlainObject(arg)) return false;
106
+ if (!arg.message && !arg.args) return false;
107
+ if (arg.stack) return false;
108
+ return true;
109
+ }
110
+ let paused = false;
111
+ const queue = [];
112
+ var Consola = class Consola {
113
+ options;
114
+ _lastLog;
115
+ _mockFn;
116
+ /**
117
+ * Creates an instance of Consola with specified options or defaults.
118
+ *
119
+ * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
120
+ */
121
+ constructor(options = {}) {
122
+ const types = options.types || LogTypes;
123
+ this.options = defu({
124
+ ...options,
125
+ defaults: { ...options.defaults },
126
+ level: _normalizeLogLevel(options.level, types),
127
+ reporters: [...options.reporters || []]
128
+ }, {
129
+ types: LogTypes,
130
+ throttle: 1e3,
131
+ throttleMin: 5,
132
+ formatOptions: {
133
+ date: true,
134
+ colors: false,
135
+ compact: true
136
+ }
137
+ });
138
+ for (const type in types) {
139
+ const defaults = {
140
+ type,
141
+ ...this.options.defaults,
142
+ ...types[type]
143
+ };
144
+ this[type] = this._wrapLogFn(defaults);
145
+ this[type].raw = this._wrapLogFn(defaults, true);
146
+ }
147
+ if (this.options.mockFn) this.mockTypes();
148
+ this._lastLog = {};
149
+ }
150
+ /**
151
+ * Gets the current log level of the Consola instance.
152
+ *
153
+ * @returns {number} The current log level.
154
+ */
155
+ get level() {
156
+ return this.options.level;
157
+ }
158
+ /**
159
+ * Sets the minimum log level that will be output by the instance.
160
+ *
161
+ * @param {number} level - The new log level to set.
162
+ */
163
+ set level(level) {
164
+ this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
165
+ }
166
+ /**
167
+ * Displays a prompt to the user and returns the response.
168
+ * Throw an error if `prompt` is not supported by the current configuration.
169
+ *
170
+ * @template T
171
+ * @param {string} message - The message to display in the prompt.
172
+ * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
173
+ * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
174
+ */
175
+ prompt(message, opts) {
176
+ if (!this.options.prompt) throw new Error("prompt is not supported!");
177
+ return this.options.prompt(message, opts);
178
+ }
179
+ /**
180
+ * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
181
+ *
182
+ * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
183
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
184
+ */
185
+ create(options) {
186
+ const instance = new Consola({
187
+ ...this.options,
188
+ ...options
189
+ });
190
+ if (this._mockFn) instance.mockTypes(this._mockFn);
191
+ return instance;
192
+ }
193
+ /**
194
+ * Creates a new Consola instance with the specified default log object properties.
195
+ *
196
+ * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
197
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
198
+ */
199
+ withDefaults(defaults) {
200
+ return this.create({
201
+ ...this.options,
202
+ defaults: {
203
+ ...this.options.defaults,
204
+ ...defaults
205
+ }
206
+ });
207
+ }
208
+ /**
209
+ * Creates a new Consola instance with a specified tag, which will be included in every log.
210
+ *
211
+ * @param {string} tag - The tag to include in each log of the new instance.
212
+ * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
213
+ */
214
+ withTag(tag) {
215
+ return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
216
+ }
217
+ /**
218
+ * Adds a custom reporter to the Consola instance.
219
+ * Reporters will be called for each log message, depending on their implementation and log level.
220
+ *
221
+ * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
222
+ * @returns {Consola} The current Consola instance.
223
+ */
224
+ addReporter(reporter) {
225
+ this.options.reporters.push(reporter);
226
+ return this;
227
+ }
228
+ /**
229
+ * Removes a custom reporter from the Consola instance.
230
+ * If no reporter is specified, all reporters will be removed.
231
+ *
232
+ * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
233
+ * @returns {Consola} The current Consola instance.
234
+ */
235
+ removeReporter(reporter) {
236
+ if (reporter) {
237
+ const i$1 = this.options.reporters.indexOf(reporter);
238
+ if (i$1 !== -1) return this.options.reporters.splice(i$1, 1);
239
+ } else this.options.reporters.splice(0);
240
+ return this;
241
+ }
242
+ /**
243
+ * Replaces all reporters of the Consola instance with the specified array of reporters.
244
+ *
245
+ * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
246
+ * @returns {Consola} The current Consola instance.
247
+ */
248
+ setReporters(reporters) {
249
+ this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
250
+ return this;
251
+ }
252
+ wrapAll() {
253
+ this.wrapConsole();
254
+ this.wrapStd();
255
+ }
256
+ restoreAll() {
257
+ this.restoreConsole();
258
+ this.restoreStd();
259
+ }
260
+ /**
261
+ * Overrides console methods with Consola logging methods for consistent logging.
262
+ */
263
+ wrapConsole() {
264
+ for (const type in this.options.types) {
265
+ if (!console["__" + type]) console["__" + type] = console[type];
266
+ console[type] = this[type].raw;
267
+ }
268
+ }
269
+ /**
270
+ * Restores the original console methods, removing Consola overrides.
271
+ */
272
+ restoreConsole() {
273
+ for (const type in this.options.types) if (console["__" + type]) {
274
+ console[type] = console["__" + type];
275
+ delete console["__" + type];
276
+ }
277
+ }
278
+ /**
279
+ * Overrides standard output and error streams to redirect them through Consola.
280
+ */
281
+ wrapStd() {
282
+ this._wrapStream(this.options.stdout, "log");
283
+ this._wrapStream(this.options.stderr, "log");
284
+ }
285
+ _wrapStream(stream, type) {
286
+ if (!stream) return;
287
+ if (!stream.__write) stream.__write = stream.write;
288
+ stream.write = (data) => {
289
+ this[type].raw(String(data).trim());
290
+ };
291
+ }
292
+ /**
293
+ * Restores the original standard output and error streams, removing the Consola redirection.
294
+ */
295
+ restoreStd() {
296
+ this._restoreStream(this.options.stdout);
297
+ this._restoreStream(this.options.stderr);
298
+ }
299
+ _restoreStream(stream) {
300
+ if (!stream) return;
301
+ if (stream.__write) {
302
+ stream.write = stream.__write;
303
+ delete stream.__write;
304
+ }
305
+ }
306
+ /**
307
+ * Pauses logging, queues incoming logs until resumed.
308
+ */
309
+ pauseLogs() {
310
+ paused = true;
311
+ }
312
+ /**
313
+ * Resumes logging, processing any queued logs.
314
+ */
315
+ resumeLogs() {
316
+ paused = false;
317
+ const _queue = queue.splice(0);
318
+ for (const item of _queue) item[0]._logFn(item[1], item[2]);
319
+ }
320
+ /**
321
+ * Replaces logging methods with mocks if a mock function is provided.
322
+ *
323
+ * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
324
+ */
325
+ mockTypes(mockFn) {
326
+ const _mockFn = mockFn || this.options.mockFn;
327
+ this._mockFn = _mockFn;
328
+ if (typeof _mockFn !== "function") return;
329
+ for (const type in this.options.types) {
330
+ this[type] = _mockFn(type, this.options.types[type]) || this[type];
331
+ this[type].raw = this[type];
332
+ }
333
+ }
334
+ _wrapLogFn(defaults, isRaw) {
335
+ return (...args) => {
336
+ if (paused) {
337
+ queue.push([
338
+ this,
339
+ defaults,
340
+ args,
341
+ isRaw
342
+ ]);
343
+ return;
344
+ }
345
+ return this._logFn(defaults, args, isRaw);
346
+ };
347
+ }
348
+ _logFn(defaults, args, isRaw) {
349
+ if ((defaults.level || 0) > this.level) return false;
350
+ const logObj = {
351
+ date: /* @__PURE__ */ new Date(),
352
+ args: [],
353
+ ...defaults,
354
+ level: _normalizeLogLevel(defaults.level, this.options.types)
355
+ };
356
+ if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
357
+ else logObj.args = [...args];
358
+ if (logObj.message) {
359
+ logObj.args.unshift(logObj.message);
360
+ delete logObj.message;
361
+ }
362
+ if (logObj.additional) {
363
+ if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
364
+ logObj.args.push("\n" + logObj.additional.join("\n"));
365
+ delete logObj.additional;
366
+ }
367
+ logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
368
+ logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
369
+ const resolveLog = (newLog = false) => {
370
+ const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
371
+ if (this._lastLog.object && repeated > 0) {
372
+ const args2 = [...this._lastLog.object.args];
373
+ if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
374
+ this._log({
375
+ ...this._lastLog.object,
376
+ args: args2
377
+ });
378
+ this._lastLog.count = 1;
379
+ }
380
+ if (newLog) {
381
+ this._lastLog.object = logObj;
382
+ this._log(logObj);
383
+ }
384
+ };
385
+ clearTimeout(this._lastLog.timeout);
386
+ const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
387
+ this._lastLog.time = logObj.date;
388
+ if (diffTime < this.options.throttle) try {
389
+ const serializedLog = JSON.stringify([
390
+ logObj.type,
391
+ logObj.tag,
392
+ logObj.args
393
+ ]);
394
+ const isSameLog = this._lastLog.serialized === serializedLog;
395
+ this._lastLog.serialized = serializedLog;
396
+ if (isSameLog) {
397
+ this._lastLog.count = (this._lastLog.count || 0) + 1;
398
+ if (this._lastLog.count > this.options.throttleMin) {
399
+ this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
400
+ return;
401
+ }
402
+ }
403
+ } catch {}
404
+ resolveLog(true);
405
+ }
406
+ _log(logObj) {
407
+ for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
408
+ }
409
+ };
410
+ function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
411
+ if (input === void 0) return defaultLevel;
412
+ if (typeof input === "number") return input;
413
+ if (types[input] && types[input].level !== void 0) return types[input].level;
414
+ return defaultLevel;
415
+ }
416
+ Consola.prototype.add = Consola.prototype.addReporter;
417
+ Consola.prototype.remove = Consola.prototype.removeReporter;
418
+ Consola.prototype.clear = Consola.prototype.removeReporter;
419
+ Consola.prototype.withScope = Consola.prototype.withTag;
420
+ Consola.prototype.mock = Consola.prototype.mockTypes;
421
+ Consola.prototype.pause = Consola.prototype.pauseLogs;
422
+ Consola.prototype.resume = Consola.prototype.resumeLogs;
423
+ function createConsola$1(options = {}) {
424
+ return new Consola(options);
425
+ }
426
+
427
+ //#endregion
428
+ //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
429
+ function parseStack(stack, message) {
430
+ const cwd = process.cwd() + sep;
431
+ return stack.split("\n").splice(message.split("\n").length).map((l$2) => l$2.trim().replace("file://", "").replace(cwd, ""));
432
+ }
433
+ function writeStream(data, stream) {
434
+ return (stream.__write || stream.write).call(stream, data);
435
+ }
436
+ const bracket = (x$2) => x$2 ? `[${x$2}]` : "";
437
+ var BasicReporter = class {
438
+ formatStack(stack, message, opts) {
439
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
440
+ return indent + parseStack(stack, message).join(`
441
+ ${indent}`);
442
+ }
443
+ formatError(err, opts) {
444
+ const message = err.message ?? formatWithOptions(opts, err);
445
+ const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
446
+ const level = opts?.errorLevel || 0;
447
+ const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
448
+ const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
449
+ ...opts,
450
+ errorLevel: level + 1
451
+ }) : "";
452
+ return causedPrefix + message + "\n" + stack + causedError;
453
+ }
454
+ formatArgs(args, opts) {
455
+ return formatWithOptions(opts, ...args.map((arg) => {
456
+ if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
457
+ return arg;
458
+ }));
459
+ }
460
+ formatDate(date, opts) {
461
+ return opts.date ? date.toLocaleTimeString() : "";
462
+ }
463
+ filterAndJoin(arr) {
464
+ return arr.filter(Boolean).join(" ");
465
+ }
466
+ formatLogObj(logObj, opts) {
467
+ const message = this.formatArgs(logObj.args, opts);
468
+ if (logObj.type === "box") return "\n" + [
469
+ bracket(logObj.tag),
470
+ logObj.title && logObj.title,
471
+ ...message.split("\n")
472
+ ].filter(Boolean).map((l$2) => " > " + l$2).join("\n") + "\n";
473
+ return this.filterAndJoin([
474
+ bracket(logObj.type),
475
+ bracket(logObj.tag),
476
+ message
477
+ ]);
478
+ }
479
+ log(logObj, ctx) {
480
+ return writeStream(this.formatLogObj(logObj, {
481
+ columns: ctx.options.stdout.columns || 0,
482
+ ...ctx.options.formatOptions
483
+ }) + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
484
+ }
485
+ };
486
+
487
+ //#endregion
488
+ //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
489
+ const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
490
+ const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
491
+ const isForced = "FORCE_COLOR" in env || argv.includes("--color");
492
+ const isWindows = platform === "win32";
493
+ const isDumbTerminal = env.TERM === "dumb";
494
+ const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
495
+ const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
496
+ const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
497
+ function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
498
+ return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
499
+ }
500
+ function clearBleed(index, string, open, close, replace) {
501
+ return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
502
+ }
503
+ function filterEmpty(open, close, replace = open, at = open.length + 1) {
504
+ return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
505
+ }
506
+ function init(open, close, replace) {
507
+ return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
508
+ }
509
+ const colorDefs = {
510
+ reset: init(0, 0),
511
+ bold: init(1, 22, "\x1B[22m\x1B[1m"),
512
+ dim: init(2, 22, "\x1B[22m\x1B[2m"),
513
+ italic: init(3, 23),
514
+ underline: init(4, 24),
515
+ inverse: init(7, 27),
516
+ hidden: init(8, 28),
517
+ strikethrough: init(9, 29),
518
+ black: init(30, 39),
519
+ red: init(31, 39),
520
+ green: init(32, 39),
521
+ yellow: init(33, 39),
522
+ blue: init(34, 39),
523
+ magenta: init(35, 39),
524
+ cyan: init(36, 39),
525
+ white: init(37, 39),
526
+ gray: init(90, 39),
527
+ bgBlack: init(40, 49),
528
+ bgRed: init(41, 49),
529
+ bgGreen: init(42, 49),
530
+ bgYellow: init(43, 49),
531
+ bgBlue: init(44, 49),
532
+ bgMagenta: init(45, 49),
533
+ bgCyan: init(46, 49),
534
+ bgWhite: init(47, 49),
535
+ blackBright: init(90, 39),
536
+ redBright: init(91, 39),
537
+ greenBright: init(92, 39),
538
+ yellowBright: init(93, 39),
539
+ blueBright: init(94, 39),
540
+ magentaBright: init(95, 39),
541
+ cyanBright: init(96, 39),
542
+ whiteBright: init(97, 39),
543
+ bgBlackBright: init(100, 49),
544
+ bgRedBright: init(101, 49),
545
+ bgGreenBright: init(102, 49),
546
+ bgYellowBright: init(103, 49),
547
+ bgBlueBright: init(104, 49),
548
+ bgMagentaBright: init(105, 49),
549
+ bgCyanBright: init(106, 49),
550
+ bgWhiteBright: init(107, 49)
551
+ };
552
+ function createColors(useColor = isColorSupported) {
553
+ return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
554
+ }
555
+ const colors = createColors();
556
+ function getColor$1(color, fallback = "reset") {
557
+ return colors[color] || colors[fallback];
558
+ }
559
+ const ansiRegex$1 = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
560
+ function stripAnsi$1(text) {
561
+ return text.replace(new RegExp(ansiRegex$1, "g"), "");
562
+ }
563
+ const boxStylePresets = {
564
+ solid: {
565
+ tl: "┌",
566
+ tr: "┐",
567
+ bl: "└",
568
+ br: "┘",
569
+ h: "─",
570
+ v: "│"
571
+ },
572
+ double: {
573
+ tl: "╔",
574
+ tr: "╗",
575
+ bl: "╚",
576
+ br: "╝",
577
+ h: "═",
578
+ v: "║"
579
+ },
580
+ doubleSingle: {
581
+ tl: "╓",
582
+ tr: "╖",
583
+ bl: "╙",
584
+ br: "╜",
585
+ h: "─",
586
+ v: "║"
587
+ },
588
+ doubleSingleRounded: {
589
+ tl: "╭",
590
+ tr: "╮",
591
+ bl: "╰",
592
+ br: "╯",
593
+ h: "─",
594
+ v: "║"
595
+ },
596
+ singleThick: {
597
+ tl: "┏",
598
+ tr: "┓",
599
+ bl: "┗",
600
+ br: "┛",
601
+ h: "━",
602
+ v: "┃"
603
+ },
604
+ singleDouble: {
605
+ tl: "╒",
606
+ tr: "╕",
607
+ bl: "╘",
608
+ br: "╛",
609
+ h: "═",
610
+ v: "│"
611
+ },
612
+ singleDoubleRounded: {
613
+ tl: "╭",
614
+ tr: "╮",
615
+ bl: "╰",
616
+ br: "╯",
617
+ h: "═",
618
+ v: "│"
619
+ },
620
+ rounded: {
621
+ tl: "╭",
622
+ tr: "╮",
623
+ bl: "╰",
624
+ br: "╯",
625
+ h: "─",
626
+ v: "│"
627
+ }
628
+ };
629
+ const defaultStyle = {
630
+ borderColor: "white",
631
+ borderStyle: "rounded",
632
+ valign: "center",
633
+ padding: 2,
634
+ marginLeft: 1,
635
+ marginTop: 1,
636
+ marginBottom: 1
637
+ };
638
+ function box(text, _opts = {}) {
639
+ const opts = {
640
+ ..._opts,
641
+ style: {
642
+ ...defaultStyle,
643
+ ..._opts.style
644
+ }
645
+ };
646
+ const textLines = text.split("\n");
647
+ const boxLines = [];
648
+ const _color = getColor$1(opts.style.borderColor);
649
+ const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
650
+ if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
651
+ const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
652
+ const height = textLines.length + paddingOffset;
653
+ const width = Math.max(...textLines.map((line) => stripAnsi$1(line).length), opts.title ? stripAnsi$1(opts.title).length : 0) + paddingOffset;
654
+ const widthOffset = width + paddingOffset;
655
+ const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
656
+ if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
657
+ if (opts.title) {
658
+ const title = _color ? _color(opts.title) : opts.title;
659
+ const left = borderStyle.h.repeat(Math.floor((width - stripAnsi$1(opts.title).length) / 2));
660
+ const right = borderStyle.h.repeat(width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset);
661
+ boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
662
+ } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
663
+ const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
664
+ for (let i$1 = 0; i$1 < height; i$1++) if (i$1 < valignOffset || i$1 >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
665
+ else {
666
+ const line = textLines[i$1 - valignOffset];
667
+ const left = " ".repeat(paddingOffset);
668
+ const right = " ".repeat(width - stripAnsi$1(line).length);
669
+ boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
670
+ }
671
+ boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
672
+ if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
673
+ return boxLines.join("\n");
674
+ }
675
+
676
+ //#endregion
677
+ //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
678
+ const r$1 = Object.create(null), i = (e$1) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e$1 ? r$1 : globalThis), o$1 = new Proxy(r$1, {
679
+ get(e$1, s$1) {
680
+ return i()[s$1] ?? r$1[s$1];
681
+ },
682
+ has(e$1, s$1) {
683
+ return s$1 in i() || s$1 in r$1;
684
+ },
685
+ set(e$1, s$1, E) {
686
+ const B$1 = i(true);
687
+ return B$1[s$1] = E, true;
688
+ },
689
+ deleteProperty(e$1, s$1) {
690
+ if (!s$1) return false;
691
+ const E = i(true);
692
+ return delete E[s$1], true;
693
+ },
694
+ ownKeys() {
695
+ const e$1 = i(true);
696
+ return Object.keys(e$1);
697
+ }
698
+ }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
699
+ ["APPVEYOR"],
700
+ [
701
+ "AWS_AMPLIFY",
702
+ "AWS_APP_ID",
703
+ { ci: true }
704
+ ],
705
+ ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
706
+ ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
707
+ ["APPCIRCLE", "AC_APPCIRCLE"],
708
+ ["BAMBOO", "bamboo_planKey"],
709
+ ["BITBUCKET", "BITBUCKET_COMMIT"],
710
+ ["BITRISE", "BITRISE_IO"],
711
+ ["BUDDY", "BUDDY_WORKSPACE_ID"],
712
+ ["BUILDKITE"],
713
+ ["CIRCLE", "CIRCLECI"],
714
+ ["CIRRUS", "CIRRUS_CI"],
715
+ [
716
+ "CLOUDFLARE_PAGES",
717
+ "CF_PAGES",
718
+ { ci: true }
719
+ ],
720
+ ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
721
+ ["CODEFRESH", "CF_BUILD_ID"],
722
+ ["DRONE"],
723
+ ["DRONE", "DRONE_BUILD_EVENT"],
724
+ ["DSARI"],
725
+ ["GITHUB_ACTIONS"],
726
+ ["GITLAB", "GITLAB_CI"],
727
+ ["GITLAB", "CI_MERGE_REQUEST_ID"],
728
+ ["GOCD", "GO_PIPELINE_LABEL"],
729
+ ["LAYERCI"],
730
+ ["HUDSON", "HUDSON_URL"],
731
+ ["JENKINS", "JENKINS_URL"],
732
+ ["MAGNUM"],
733
+ ["NETLIFY"],
734
+ [
735
+ "NETLIFY",
736
+ "NETLIFY_LOCAL",
737
+ { ci: false }
738
+ ],
739
+ ["NEVERCODE"],
740
+ ["RENDER"],
741
+ ["SAIL", "SAILCI"],
742
+ ["SEMAPHORE"],
743
+ ["SCREWDRIVER"],
744
+ ["SHIPPABLE"],
745
+ ["SOLANO", "TDDIUM"],
746
+ ["STRIDER"],
747
+ ["TEAMCITY", "TEAMCITY_VERSION"],
748
+ ["TRAVIS"],
749
+ ["VERCEL", "NOW_BUILDER"],
750
+ [
751
+ "VERCEL",
752
+ "VERCEL",
753
+ { ci: false }
754
+ ],
755
+ [
756
+ "VERCEL",
757
+ "VERCEL_ENV",
758
+ { ci: false }
759
+ ],
760
+ ["APPCENTER", "APPCENTER_BUILD_ID"],
761
+ [
762
+ "CODESANDBOX",
763
+ "CODESANDBOX_SSE",
764
+ { ci: false }
765
+ ],
766
+ [
767
+ "CODESANDBOX",
768
+ "CODESANDBOX_HOST",
769
+ { ci: false }
770
+ ],
771
+ ["STACKBLITZ"],
772
+ ["STORMKIT"],
773
+ ["CLEAVR"],
774
+ ["ZEABUR"],
775
+ [
776
+ "CODESPHERE",
777
+ "CODESPHERE_APP_ID",
778
+ { ci: true }
779
+ ],
780
+ ["RAILWAY", "RAILWAY_PROJECT_ID"],
781
+ ["RAILWAY", "RAILWAY_SERVICE_ID"],
782
+ ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
783
+ [
784
+ "FIREBASE_APP_HOSTING",
785
+ "FIREBASE_APP_HOSTING",
786
+ { ci: true }
787
+ ]
788
+ ];
789
+ function b$2() {
790
+ if (globalThis.process?.env) for (const e$1 of f) {
791
+ const s$1 = e$1[1] || e$1[0];
792
+ if (globalThis.process?.env[s$1]) return {
793
+ name: e$1[0].toLowerCase(),
794
+ ...e$1[2]
795
+ };
796
+ }
797
+ return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
798
+ name: "stackblitz",
799
+ ci: false
800
+ } : {
801
+ name: "",
802
+ ci: false
803
+ };
804
+ }
805
+ const l$1 = b$2();
806
+ l$1.name;
807
+ function n(e$1) {
808
+ return e$1 ? e$1 !== "false" : false;
809
+ }
810
+ const I$1 = globalThis.process?.platform || "", T$2 = n(o$1.CI) || l$1.ci !== false, a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), g$1 = n(o$1.DEBUG), R$1 = t === "test" || n(o$1.TEST);
811
+ n(o$1.MINIMAL);
812
+ const A$2 = /^win/i.test(I$1);
813
+ !n(o$1.NO_COLOR) && (n(o$1.FORCE_COLOR) || (a || A$2) && o$1.TERM);
814
+ const C$1 = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
815
+ Number(C$1?.split(".")[0]);
816
+ const y$2 = globalThis.process || Object.create(null), _$2 = { versions: {} };
817
+ new Proxy(y$2, { get(e$1, s$1) {
818
+ if (s$1 === "env") return o$1;
819
+ if (s$1 in e$1) return e$1[s$1];
820
+ if (s$1 in _$2) return _$2[s$1];
821
+ } });
822
+ const c = globalThis.process?.release?.name === "node", O$1 = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D$1 = !!globalThis.Deno, L$2 = !!globalThis.fastly, S$1 = !!globalThis.Netlify, u$1 = !!globalThis.EdgeRuntime, N$1 = globalThis.navigator?.userAgent === "Cloudflare-Workers", F$1 = [
823
+ [S$1, "netlify"],
824
+ [u$1, "edge-light"],
825
+ [N$1, "workerd"],
826
+ [L$2, "fastly"],
827
+ [D$1, "deno"],
828
+ [O$1, "bun"],
829
+ [c, "node"]
830
+ ];
831
+ function G$2() {
832
+ const e$1 = F$1.find((s$1) => s$1[0]);
833
+ if (e$1) return { name: e$1[1] };
834
+ }
835
+ G$2()?.name;
836
+ function ansiRegex({ onlyFirst = false } = {}) {
837
+ const pattern = [`[\\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("|");
838
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
839
+ }
840
+ const regex = ansiRegex();
841
+ function stripAnsi(string) {
842
+ if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
843
+ return string.replace(regex, "");
844
+ }
845
+ function isAmbiguous(x$2) {
846
+ return x$2 === 161 || x$2 === 164 || x$2 === 167 || x$2 === 168 || x$2 === 170 || x$2 === 173 || x$2 === 174 || x$2 >= 176 && x$2 <= 180 || x$2 >= 182 && x$2 <= 186 || x$2 >= 188 && x$2 <= 191 || x$2 === 198 || x$2 === 208 || x$2 === 215 || x$2 === 216 || x$2 >= 222 && x$2 <= 225 || x$2 === 230 || x$2 >= 232 && x$2 <= 234 || x$2 === 236 || x$2 === 237 || x$2 === 240 || x$2 === 242 || x$2 === 243 || x$2 >= 247 && x$2 <= 250 || x$2 === 252 || x$2 === 254 || x$2 === 257 || x$2 === 273 || x$2 === 275 || x$2 === 283 || x$2 === 294 || x$2 === 295 || x$2 === 299 || x$2 >= 305 && x$2 <= 307 || x$2 === 312 || x$2 >= 319 && x$2 <= 322 || x$2 === 324 || x$2 >= 328 && x$2 <= 331 || x$2 === 333 || x$2 === 338 || x$2 === 339 || x$2 === 358 || x$2 === 359 || x$2 === 363 || x$2 === 462 || x$2 === 464 || x$2 === 466 || x$2 === 468 || x$2 === 470 || x$2 === 472 || x$2 === 474 || x$2 === 476 || x$2 === 593 || x$2 === 609 || x$2 === 708 || x$2 === 711 || x$2 >= 713 && x$2 <= 715 || x$2 === 717 || x$2 === 720 || x$2 >= 728 && x$2 <= 731 || x$2 === 733 || x$2 === 735 || x$2 >= 768 && x$2 <= 879 || x$2 >= 913 && x$2 <= 929 || x$2 >= 931 && x$2 <= 937 || x$2 >= 945 && x$2 <= 961 || x$2 >= 963 && x$2 <= 969 || x$2 === 1025 || x$2 >= 1040 && x$2 <= 1103 || x$2 === 1105 || x$2 === 8208 || x$2 >= 8211 && x$2 <= 8214 || x$2 === 8216 || x$2 === 8217 || x$2 === 8220 || x$2 === 8221 || x$2 >= 8224 && x$2 <= 8226 || x$2 >= 8228 && x$2 <= 8231 || x$2 === 8240 || x$2 === 8242 || x$2 === 8243 || x$2 === 8245 || x$2 === 8251 || x$2 === 8254 || x$2 === 8308 || x$2 === 8319 || x$2 >= 8321 && x$2 <= 8324 || x$2 === 8364 || x$2 === 8451 || x$2 === 8453 || x$2 === 8457 || x$2 === 8467 || x$2 === 8470 || x$2 === 8481 || x$2 === 8482 || x$2 === 8486 || x$2 === 8491 || x$2 === 8531 || x$2 === 8532 || x$2 >= 8539 && x$2 <= 8542 || x$2 >= 8544 && x$2 <= 8555 || x$2 >= 8560 && x$2 <= 8569 || x$2 === 8585 || x$2 >= 8592 && x$2 <= 8601 || x$2 === 8632 || x$2 === 8633 || x$2 === 8658 || x$2 === 8660 || x$2 === 8679 || x$2 === 8704 || x$2 === 8706 || x$2 === 8707 || x$2 === 8711 || x$2 === 8712 || x$2 === 8715 || x$2 === 8719 || x$2 === 8721 || x$2 === 8725 || x$2 === 8730 || x$2 >= 8733 && x$2 <= 8736 || x$2 === 8739 || x$2 === 8741 || x$2 >= 8743 && x$2 <= 8748 || x$2 === 8750 || x$2 >= 8756 && x$2 <= 8759 || x$2 === 8764 || x$2 === 8765 || x$2 === 8776 || x$2 === 8780 || x$2 === 8786 || x$2 === 8800 || x$2 === 8801 || x$2 >= 8804 && x$2 <= 8807 || x$2 === 8810 || x$2 === 8811 || x$2 === 8814 || x$2 === 8815 || x$2 === 8834 || x$2 === 8835 || x$2 === 8838 || x$2 === 8839 || x$2 === 8853 || x$2 === 8857 || x$2 === 8869 || x$2 === 8895 || x$2 === 8978 || x$2 >= 9312 && x$2 <= 9449 || x$2 >= 9451 && x$2 <= 9547 || x$2 >= 9552 && x$2 <= 9587 || x$2 >= 9600 && x$2 <= 9615 || x$2 >= 9618 && x$2 <= 9621 || x$2 === 9632 || x$2 === 9633 || x$2 >= 9635 && x$2 <= 9641 || x$2 === 9650 || x$2 === 9651 || x$2 === 9654 || x$2 === 9655 || x$2 === 9660 || x$2 === 9661 || x$2 === 9664 || x$2 === 9665 || x$2 >= 9670 && x$2 <= 9672 || x$2 === 9675 || x$2 >= 9678 && x$2 <= 9681 || x$2 >= 9698 && x$2 <= 9701 || x$2 === 9711 || x$2 === 9733 || x$2 === 9734 || x$2 === 9737 || x$2 === 9742 || x$2 === 9743 || x$2 === 9756 || x$2 === 9758 || x$2 === 9792 || x$2 === 9794 || x$2 === 9824 || x$2 === 9825 || x$2 >= 9827 && x$2 <= 9829 || x$2 >= 9831 && x$2 <= 9834 || x$2 === 9836 || x$2 === 9837 || x$2 === 9839 || x$2 === 9886 || x$2 === 9887 || x$2 === 9919 || x$2 >= 9926 && x$2 <= 9933 || x$2 >= 9935 && x$2 <= 9939 || x$2 >= 9941 && x$2 <= 9953 || x$2 === 9955 || x$2 === 9960 || x$2 === 9961 || x$2 >= 9963 && x$2 <= 9969 || x$2 === 9972 || x$2 >= 9974 && x$2 <= 9977 || x$2 === 9979 || x$2 === 9980 || x$2 === 9982 || x$2 === 9983 || x$2 === 10045 || x$2 >= 10102 && x$2 <= 10111 || x$2 >= 11094 && x$2 <= 11097 || x$2 >= 12872 && x$2 <= 12879 || x$2 >= 57344 && x$2 <= 63743 || x$2 >= 65024 && x$2 <= 65039 || x$2 === 65533 || x$2 >= 127232 && x$2 <= 127242 || x$2 >= 127248 && x$2 <= 127277 || x$2 >= 127280 && x$2 <= 127337 || x$2 >= 127344 && x$2 <= 127373 || x$2 === 127375 || x$2 === 127376 || x$2 >= 127387 && x$2 <= 127404 || x$2 >= 917760 && x$2 <= 917999 || x$2 >= 983040 && x$2 <= 1048573 || x$2 >= 1048576 && x$2 <= 1114109;
847
+ }
848
+ function isFullWidth(x$2) {
849
+ return x$2 === 12288 || x$2 >= 65281 && x$2 <= 65376 || x$2 >= 65504 && x$2 <= 65510;
850
+ }
851
+ function isWide(x$2) {
852
+ return x$2 >= 4352 && x$2 <= 4447 || x$2 === 8986 || x$2 === 8987 || x$2 === 9001 || x$2 === 9002 || x$2 >= 9193 && x$2 <= 9196 || x$2 === 9200 || x$2 === 9203 || x$2 === 9725 || x$2 === 9726 || x$2 === 9748 || x$2 === 9749 || x$2 >= 9776 && x$2 <= 9783 || x$2 >= 9800 && x$2 <= 9811 || x$2 === 9855 || x$2 >= 9866 && x$2 <= 9871 || x$2 === 9875 || x$2 === 9889 || x$2 === 9898 || x$2 === 9899 || x$2 === 9917 || x$2 === 9918 || x$2 === 9924 || x$2 === 9925 || x$2 === 9934 || x$2 === 9940 || x$2 === 9962 || x$2 === 9970 || x$2 === 9971 || x$2 === 9973 || x$2 === 9978 || x$2 === 9981 || x$2 === 9989 || x$2 === 9994 || x$2 === 9995 || x$2 === 10024 || x$2 === 10060 || x$2 === 10062 || x$2 >= 10067 && x$2 <= 10069 || x$2 === 10071 || x$2 >= 10133 && x$2 <= 10135 || x$2 === 10160 || x$2 === 10175 || x$2 === 11035 || x$2 === 11036 || x$2 === 11088 || x$2 === 11093 || x$2 >= 11904 && x$2 <= 11929 || x$2 >= 11931 && x$2 <= 12019 || x$2 >= 12032 && x$2 <= 12245 || x$2 >= 12272 && x$2 <= 12287 || x$2 >= 12289 && x$2 <= 12350 || x$2 >= 12353 && x$2 <= 12438 || x$2 >= 12441 && x$2 <= 12543 || x$2 >= 12549 && x$2 <= 12591 || x$2 >= 12593 && x$2 <= 12686 || x$2 >= 12688 && x$2 <= 12773 || x$2 >= 12783 && x$2 <= 12830 || x$2 >= 12832 && x$2 <= 12871 || x$2 >= 12880 && x$2 <= 42124 || x$2 >= 42128 && x$2 <= 42182 || x$2 >= 43360 && x$2 <= 43388 || x$2 >= 44032 && x$2 <= 55203 || x$2 >= 63744 && x$2 <= 64255 || x$2 >= 65040 && x$2 <= 65049 || x$2 >= 65072 && x$2 <= 65106 || x$2 >= 65108 && x$2 <= 65126 || x$2 >= 65128 && x$2 <= 65131 || x$2 >= 94176 && x$2 <= 94180 || x$2 === 94192 || x$2 === 94193 || x$2 >= 94208 && x$2 <= 100343 || x$2 >= 100352 && x$2 <= 101589 || x$2 >= 101631 && x$2 <= 101640 || x$2 >= 110576 && x$2 <= 110579 || x$2 >= 110581 && x$2 <= 110587 || x$2 === 110589 || x$2 === 110590 || x$2 >= 110592 && x$2 <= 110882 || x$2 === 110898 || x$2 >= 110928 && x$2 <= 110930 || x$2 === 110933 || x$2 >= 110948 && x$2 <= 110951 || x$2 >= 110960 && x$2 <= 111355 || x$2 >= 119552 && x$2 <= 119638 || x$2 >= 119648 && x$2 <= 119670 || x$2 === 126980 || x$2 === 127183 || x$2 === 127374 || x$2 >= 127377 && x$2 <= 127386 || x$2 >= 127488 && x$2 <= 127490 || x$2 >= 127504 && x$2 <= 127547 || x$2 >= 127552 && x$2 <= 127560 || x$2 === 127568 || x$2 === 127569 || x$2 >= 127584 && x$2 <= 127589 || x$2 >= 127744 && x$2 <= 127776 || x$2 >= 127789 && x$2 <= 127797 || x$2 >= 127799 && x$2 <= 127868 || x$2 >= 127870 && x$2 <= 127891 || x$2 >= 127904 && x$2 <= 127946 || x$2 >= 127951 && x$2 <= 127955 || x$2 >= 127968 && x$2 <= 127984 || x$2 === 127988 || x$2 >= 127992 && x$2 <= 128062 || x$2 === 128064 || x$2 >= 128066 && x$2 <= 128252 || x$2 >= 128255 && x$2 <= 128317 || x$2 >= 128331 && x$2 <= 128334 || x$2 >= 128336 && x$2 <= 128359 || x$2 === 128378 || x$2 === 128405 || x$2 === 128406 || x$2 === 128420 || x$2 >= 128507 && x$2 <= 128591 || x$2 >= 128640 && x$2 <= 128709 || x$2 === 128716 || x$2 >= 128720 && x$2 <= 128722 || x$2 >= 128725 && x$2 <= 128727 || x$2 >= 128732 && x$2 <= 128735 || x$2 === 128747 || x$2 === 128748 || x$2 >= 128756 && x$2 <= 128764 || x$2 >= 128992 && x$2 <= 129003 || x$2 === 129008 || x$2 >= 129292 && x$2 <= 129338 || x$2 >= 129340 && x$2 <= 129349 || x$2 >= 129351 && x$2 <= 129535 || x$2 >= 129648 && x$2 <= 129660 || x$2 >= 129664 && x$2 <= 129673 || x$2 >= 129679 && x$2 <= 129734 || x$2 >= 129742 && x$2 <= 129756 || x$2 >= 129759 && x$2 <= 129769 || x$2 >= 129776 && x$2 <= 129784 || x$2 >= 131072 && x$2 <= 196605 || x$2 >= 196608 && x$2 <= 262141;
853
+ }
854
+ function validate(codePoint) {
855
+ if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
856
+ }
857
+ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
858
+ validate(codePoint);
859
+ if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
860
+ return 1;
861
+ }
862
+ const emojiRegex = () => {
863
+ return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
864
+ };
865
+ const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
866
+ const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
867
+ function stringWidth$1(string, options = {}) {
868
+ if (typeof string !== "string" || string.length === 0) return 0;
869
+ const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
870
+ if (!countAnsiEscapeCodes) string = stripAnsi(string);
871
+ if (string.length === 0) return 0;
872
+ let width = 0;
873
+ const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
874
+ for (const { segment: character } of segmenter.segment(string)) {
875
+ const codePoint = character.codePointAt(0);
876
+ if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
877
+ if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
878
+ if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
879
+ if (codePoint >= 55296 && codePoint <= 57343) continue;
880
+ if (codePoint >= 65024 && codePoint <= 65039) continue;
881
+ if (defaultIgnorableCodePointRegex.test(character)) continue;
882
+ if (emojiRegex().test(character)) {
883
+ width += 2;
884
+ continue;
885
+ }
886
+ width += eastAsianWidth(codePoint, eastAsianWidthOptions);
887
+ }
888
+ return width;
889
+ }
890
+ function isUnicodeSupported() {
891
+ const { env: env$1 } = y;
892
+ const { TERM, TERM_PROGRAM } = env$1;
893
+ if (y.platform !== "win32") return TERM !== "linux";
894
+ return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
895
+ }
896
+ const TYPE_COLOR_MAP = {
897
+ info: "cyan",
898
+ fail: "red",
899
+ success: "green",
900
+ ready: "green",
901
+ start: "magenta"
902
+ };
903
+ const LEVEL_COLOR_MAP = {
904
+ 0: "red",
905
+ 1: "yellow"
906
+ };
907
+ const unicode = isUnicodeSupported();
908
+ const s = (c$1, fallback) => unicode ? c$1 : fallback;
909
+ const TYPE_ICONS = {
910
+ error: s("✖", "×"),
911
+ fatal: s("✖", "×"),
912
+ ready: s("✔", "√"),
913
+ warn: s("⚠", "‼"),
914
+ info: s("ℹ", "i"),
915
+ success: s("✔", "√"),
916
+ debug: s("⚙", "D"),
917
+ trace: s("→", "→"),
918
+ fail: s("✖", "×"),
919
+ start: s("◐", "o"),
920
+ log: ""
921
+ };
922
+ function stringWidth(str) {
923
+ if (!(typeof Intl === "object") || !Intl.Segmenter) return stripAnsi$1(str).length;
924
+ return stringWidth$1(str);
925
+ }
926
+ var FancyReporter = class extends BasicReporter {
927
+ formatStack(stack, message, opts) {
928
+ const indent = " ".repeat((opts?.errorLevel || 0) + 1);
929
+ return `
930
+ ${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m$1) => colors.gray(m$1)).replace(/\((.+)\)/, (_$3, m$1) => `(${colors.cyan(m$1)})`)).join(`
931
+ ${indent}`);
932
+ }
933
+ formatType(logObj, isBadge, opts) {
934
+ const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
935
+ if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
936
+ const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
937
+ return _type ? getColor(typeColor)(_type) : "";
938
+ }
939
+ formatLogObj(logObj, opts) {
940
+ const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
941
+ if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
942
+ title: logObj.title ? characterFormat(logObj.title) : void 0,
943
+ style: logObj.style
944
+ });
945
+ const date = this.formatDate(logObj.date, opts);
946
+ const coloredDate = date && colors.gray(date);
947
+ const isBadge = logObj.badge ?? logObj.level < 2;
948
+ const type = this.formatType(logObj, isBadge, opts);
949
+ const tag = logObj.tag ? colors.gray(logObj.tag) : "";
950
+ let line;
951
+ const left = this.filterAndJoin([type, characterFormat(message)]);
952
+ const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
953
+ const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
954
+ line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
955
+ line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
956
+ if (logObj.type === "trace") {
957
+ const _err = /* @__PURE__ */ new Error("Trace: " + logObj.message);
958
+ line += this.formatStack(_err.stack || "", _err.message);
959
+ }
960
+ return isBadge ? "\n" + line + "\n" : line;
961
+ }
962
+ };
963
+ function characterFormat(str) {
964
+ return str.replace(/`([^`]+)`/gm, (_$3, m$1) => colors.cyan(m$1)).replace(/\s+_([^_]+)_\s+/gm, (_$3, m$1) => ` ${colors.underline(m$1)} `);
965
+ }
966
+ function getColor(color = "white") {
967
+ return colors[color] || colors.white;
968
+ }
969
+ function getBgColor(color = "bgWhite") {
970
+ return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
971
+ }
972
+ function createConsola(options = {}) {
973
+ let level = _getDefaultLogLevel();
974
+ if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
975
+ return createConsola$1({
976
+ level,
977
+ defaults: { level },
978
+ stdout: process.stdout,
979
+ stderr: process.stderr,
980
+ prompt: (...args) => import("./prompt-CJttWhPO.js").then((m$1) => m$1.prompt(...args)),
981
+ reporters: options.reporters || [options.fancy ?? !(T$2 || R$1) ? new FancyReporter() : new BasicReporter()],
982
+ ...options
983
+ });
984
+ }
985
+ function _getDefaultLogLevel() {
986
+ if (g$1) return LogLevels.debug;
987
+ if (R$1) return LogLevels.warn;
988
+ return LogLevels.info;
989
+ }
990
+ const consola = createConsola();
991
+
992
+ //#endregion
993
+ //#region ../../node_modules/.pnpm/citty@0.1.6/node_modules/citty/dist/index.mjs
994
+ function toArray(val) {
995
+ if (Array.isArray(val)) return val;
996
+ return val === void 0 ? [] : [val];
997
+ }
998
+ function formatLineColumns(lines, linePrefix = "") {
999
+ const maxLengh = [];
1000
+ for (const line of lines) for (const [i$1, element] of line.entries()) maxLengh[i$1] = Math.max(maxLengh[i$1] || 0, element.length);
1001
+ return lines.map((l$2) => l$2.map((c$1, i$1) => linePrefix + c$1[i$1 === 0 ? "padStart" : "padEnd"](maxLengh[i$1])).join(" ")).join("\n");
1002
+ }
1003
+ function resolveValue(input) {
1004
+ return typeof input === "function" ? input() : input;
1005
+ }
1006
+ var CLIError = class extends Error {
1007
+ constructor(message, code) {
1008
+ super(message);
1009
+ this.code = code;
1010
+ this.name = "CLIError";
1011
+ }
1012
+ };
1013
+ const NUMBER_CHAR_RE = /\d/;
1014
+ const STR_SPLITTERS = [
1015
+ "-",
1016
+ "_",
1017
+ "/",
1018
+ "."
1019
+ ];
1020
+ function isUppercase(char = "") {
1021
+ if (NUMBER_CHAR_RE.test(char)) return;
1022
+ return char !== char.toLowerCase();
1023
+ }
1024
+ function splitByCase(str, separators) {
1025
+ const splitters = separators ?? STR_SPLITTERS;
1026
+ const parts = [];
1027
+ if (!str || typeof str !== "string") return parts;
1028
+ let buff = "";
1029
+ let previousUpper;
1030
+ let previousSplitter;
1031
+ for (const char of str) {
1032
+ const isSplitter = splitters.includes(char);
1033
+ if (isSplitter === true) {
1034
+ parts.push(buff);
1035
+ buff = "";
1036
+ previousUpper = void 0;
1037
+ continue;
1038
+ }
1039
+ const isUpper = isUppercase(char);
1040
+ if (previousSplitter === false) {
1041
+ if (previousUpper === false && isUpper === true) {
1042
+ parts.push(buff);
1043
+ buff = char;
1044
+ previousUpper = isUpper;
1045
+ continue;
1046
+ }
1047
+ if (previousUpper === true && isUpper === false && buff.length > 1) {
1048
+ const lastChar = buff.at(-1);
1049
+ parts.push(buff.slice(0, Math.max(0, buff.length - 1)));
1050
+ buff = lastChar + char;
1051
+ previousUpper = isUpper;
1052
+ continue;
1053
+ }
1054
+ }
1055
+ buff += char;
1056
+ previousUpper = isUpper;
1057
+ previousSplitter = isSplitter;
1058
+ }
1059
+ parts.push(buff);
1060
+ return parts;
1061
+ }
1062
+ function upperFirst(str) {
1063
+ return str ? str[0].toUpperCase() + str.slice(1) : "";
1064
+ }
1065
+ function lowerFirst(str) {
1066
+ return str ? str[0].toLowerCase() + str.slice(1) : "";
1067
+ }
1068
+ function pascalCase(str, opts) {
1069
+ return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p$1) => upperFirst(opts?.normalize ? p$1.toLowerCase() : p$1)).join("") : "";
1070
+ }
1071
+ function camelCase(str, opts) {
1072
+ return lowerFirst(pascalCase(str || "", opts));
1073
+ }
1074
+ function kebabCase(str, joiner) {
1075
+ return str ? (Array.isArray(str) ? str : splitByCase(str)).map((p$1) => p$1.toLowerCase()).join(joiner ?? "-") : "";
1076
+ }
1077
+ function toArr(any) {
1078
+ return any == void 0 ? [] : Array.isArray(any) ? any : [any];
1079
+ }
1080
+ function toVal(out, key, val, opts) {
1081
+ let x$2;
1082
+ const old = out[key];
1083
+ const nxt = ~opts.string.indexOf(key) ? val == void 0 || val === true ? "" : String(val) : typeof val === "boolean" ? val : ~opts.boolean.indexOf(key) ? val === "false" ? false : val === "true" || (out._.push((x$2 = +val, x$2 * 0 === 0) ? x$2 : val), !!val) : (x$2 = +val, x$2 * 0 === 0) ? x$2 : val;
1084
+ out[key] = old == void 0 ? nxt : Array.isArray(old) ? old.concat(nxt) : [old, nxt];
1085
+ }
1086
+ function parseRawArgs(args = [], opts = {}) {
1087
+ let k$2;
1088
+ let arr;
1089
+ let arg;
1090
+ let name;
1091
+ let val;
1092
+ const out = { _: [] };
1093
+ let i$1 = 0;
1094
+ let j = 0;
1095
+ let idx = 0;
1096
+ const len = args.length;
1097
+ const alibi = opts.alias !== void 0;
1098
+ const strict = opts.unknown !== void 0;
1099
+ const defaults = opts.default !== void 0;
1100
+ opts.alias = opts.alias || {};
1101
+ opts.string = toArr(opts.string);
1102
+ opts.boolean = toArr(opts.boolean);
1103
+ if (alibi) for (k$2 in opts.alias) {
1104
+ arr = opts.alias[k$2] = toArr(opts.alias[k$2]);
1105
+ for (i$1 = 0; i$1 < arr.length; i$1++) (opts.alias[arr[i$1]] = arr.concat(k$2)).splice(i$1, 1);
1106
+ }
1107
+ for (i$1 = opts.boolean.length; i$1-- > 0;) {
1108
+ arr = opts.alias[opts.boolean[i$1]] || [];
1109
+ for (j = arr.length; j-- > 0;) opts.boolean.push(arr[j]);
1110
+ }
1111
+ for (i$1 = opts.string.length; i$1-- > 0;) {
1112
+ arr = opts.alias[opts.string[i$1]] || [];
1113
+ for (j = arr.length; j-- > 0;) opts.string.push(arr[j]);
1114
+ }
1115
+ if (defaults) for (k$2 in opts.default) {
1116
+ name = typeof opts.default[k$2];
1117
+ arr = opts.alias[k$2] = opts.alias[k$2] || [];
1118
+ if (opts[name] !== void 0) {
1119
+ opts[name].push(k$2);
1120
+ for (i$1 = 0; i$1 < arr.length; i$1++) opts[name].push(arr[i$1]);
1121
+ }
1122
+ }
1123
+ const keys = strict ? Object.keys(opts.alias) : [];
1124
+ for (i$1 = 0; i$1 < len; i$1++) {
1125
+ arg = args[i$1];
1126
+ if (arg === "--") {
1127
+ out._ = out._.concat(args.slice(++i$1));
1128
+ break;
1129
+ }
1130
+ for (j = 0; j < arg.length; j++) if (arg.charCodeAt(j) !== 45) break;
1131
+ if (j === 0) out._.push(arg);
1132
+ else if (arg.substring(j, j + 3) === "no-") {
1133
+ name = arg.slice(Math.max(0, j + 3));
1134
+ if (strict && !~keys.indexOf(name)) return opts.unknown(arg);
1135
+ out[name] = false;
1136
+ } else {
1137
+ for (idx = j + 1; idx < arg.length; idx++) if (arg.charCodeAt(idx) === 61) break;
1138
+ name = arg.substring(j, idx);
1139
+ val = arg.slice(Math.max(0, ++idx)) || i$1 + 1 === len || ("" + args[i$1 + 1]).charCodeAt(0) === 45 || args[++i$1];
1140
+ arr = j === 2 ? [name] : name;
1141
+ for (idx = 0; idx < arr.length; idx++) {
1142
+ name = arr[idx];
1143
+ if (strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
1144
+ toVal(out, name, idx + 1 < arr.length || val, opts);
1145
+ }
1146
+ }
1147
+ }
1148
+ if (defaults) {
1149
+ for (k$2 in opts.default) if (out[k$2] === void 0) out[k$2] = opts.default[k$2];
1150
+ }
1151
+ if (alibi) for (k$2 in out) {
1152
+ arr = opts.alias[k$2] || [];
1153
+ while (arr.length > 0) out[arr.shift()] = out[k$2];
1154
+ }
1155
+ return out;
1156
+ }
1157
+ function parseArgs(rawArgs, argsDef) {
1158
+ const parseOptions = {
1159
+ boolean: [],
1160
+ string: [],
1161
+ mixed: [],
1162
+ alias: {},
1163
+ default: {}
1164
+ };
1165
+ const args = resolveArgs(argsDef);
1166
+ for (const arg of args) {
1167
+ if (arg.type === "positional") continue;
1168
+ if (arg.type === "string") parseOptions.string.push(arg.name);
1169
+ else if (arg.type === "boolean") parseOptions.boolean.push(arg.name);
1170
+ if (arg.default !== void 0) parseOptions.default[arg.name] = arg.default;
1171
+ if (arg.alias) parseOptions.alias[arg.name] = arg.alias;
1172
+ }
1173
+ const parsed = parseRawArgs(rawArgs, parseOptions);
1174
+ const [ ...positionalArguments] = parsed._;
1175
+ const parsedArgsProxy = new Proxy(parsed, { get(target, prop) {
1176
+ return target[prop] ?? target[camelCase(prop)] ?? target[kebabCase(prop)];
1177
+ } });
1178
+ for (const [, arg] of args.entries()) if (arg.type === "positional") {
1179
+ const nextPositionalArgument = positionalArguments.shift();
1180
+ if (nextPositionalArgument !== void 0) parsedArgsProxy[arg.name] = nextPositionalArgument;
1181
+ else if (arg.default === void 0 && arg.required !== false) throw new CLIError(`Missing required positional argument: ${arg.name.toUpperCase()}`, "EARG");
1182
+ else parsedArgsProxy[arg.name] = arg.default;
1183
+ } else if (arg.required && parsedArgsProxy[arg.name] === void 0) throw new CLIError(`Missing required argument: --${arg.name}`, "EARG");
1184
+ return parsedArgsProxy;
1185
+ }
1186
+ function resolveArgs(argsDef) {
1187
+ const args = [];
1188
+ for (const [name, argDef] of Object.entries(argsDef || {})) args.push({
1189
+ ...argDef,
1190
+ name,
1191
+ alias: toArray(argDef.alias)
1192
+ });
1193
+ return args;
1194
+ }
1195
+ function defineCommand(def) {
1196
+ return def;
1197
+ }
1198
+ async function runCommand$1(cmd, opts) {
1199
+ const cmdArgs = await resolveValue(cmd.args || {});
1200
+ const parsedArgs = parseArgs(opts.rawArgs, cmdArgs);
1201
+ const context = {
1202
+ rawArgs: opts.rawArgs,
1203
+ args: parsedArgs,
1204
+ data: opts.data,
1205
+ cmd
1206
+ };
1207
+ if (typeof cmd.setup === "function") await cmd.setup(context);
1208
+ let result;
1209
+ try {
1210
+ const subCommands = await resolveValue(cmd.subCommands);
1211
+ if (subCommands && Object.keys(subCommands).length > 0) {
1212
+ const subCommandArgIndex = opts.rawArgs.findIndex((arg) => !arg.startsWith("-"));
1213
+ const subCommandName = opts.rawArgs[subCommandArgIndex];
1214
+ if (subCommandName) {
1215
+ if (!subCommands[subCommandName]) throw new CLIError(`Unknown command \`${subCommandName}\``, "E_UNKNOWN_COMMAND");
1216
+ const subCommand = await resolveValue(subCommands[subCommandName]);
1217
+ if (subCommand) await runCommand$1(subCommand, { rawArgs: opts.rawArgs.slice(subCommandArgIndex + 1) });
1218
+ } else if (!cmd.run) throw new CLIError(`No command specified.`, "E_NO_COMMAND");
1219
+ }
1220
+ if (typeof cmd.run === "function") result = await cmd.run(context);
1221
+ } finally {
1222
+ if (typeof cmd.cleanup === "function") await cmd.cleanup(context);
1223
+ }
1224
+ return { result };
1225
+ }
1226
+ async function resolveSubCommand(cmd, rawArgs, parent) {
1227
+ const subCommands = await resolveValue(cmd.subCommands);
1228
+ if (subCommands && Object.keys(subCommands).length > 0) {
1229
+ const subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith("-"));
1230
+ const subCommandName = rawArgs[subCommandArgIndex];
1231
+ const subCommand = await resolveValue(subCommands[subCommandName]);
1232
+ if (subCommand) return resolveSubCommand(subCommand, rawArgs.slice(subCommandArgIndex + 1), cmd);
1233
+ }
1234
+ return [cmd, parent];
1235
+ }
1236
+ async function showUsage(cmd, parent) {
1237
+ try {
1238
+ consola.log(await renderUsage(cmd, parent) + "\n");
1239
+ } catch (error) {
1240
+ consola.error(error);
1241
+ }
1242
+ }
1243
+ async function renderUsage(cmd, parent) {
1244
+ const cmdMeta = await resolveValue(cmd.meta || {});
1245
+ const cmdArgs = resolveArgs(await resolveValue(cmd.args || {}));
1246
+ const parentMeta = await resolveValue(parent?.meta || {});
1247
+ const commandName = `${parentMeta.name ? `${parentMeta.name} ` : ""}` + (cmdMeta.name || process.argv[1]);
1248
+ const argLines = [];
1249
+ const posLines = [];
1250
+ const commandsLines = [];
1251
+ const usageLine = [];
1252
+ for (const arg of cmdArgs) if (arg.type === "positional") {
1253
+ const name = arg.name.toUpperCase();
1254
+ const isRequired = arg.required !== false && arg.default === void 0;
1255
+ const defaultHint = arg.default ? `="${arg.default}"` : "";
1256
+ posLines.push([
1257
+ "`" + name + defaultHint + "`",
1258
+ arg.description || "",
1259
+ arg.valueHint ? `<${arg.valueHint}>` : ""
1260
+ ]);
1261
+ usageLine.push(isRequired ? `<${name}>` : `[${name}]`);
1262
+ } else {
1263
+ const isRequired = arg.required === true && arg.default === void 0;
1264
+ const argStr = (arg.type === "boolean" && arg.default === true ? [...(arg.alias || []).map((a$1) => `--no-${a$1}`), `--no-${arg.name}`].join(", ") : [...(arg.alias || []).map((a$1) => `-${a$1}`), `--${arg.name}`].join(", ")) + (arg.type === "string" && (arg.valueHint || arg.default) ? `=${arg.valueHint ? `<${arg.valueHint}>` : `"${arg.default || ""}"`}` : "");
1265
+ argLines.push(["`" + argStr + (isRequired ? " (required)" : "") + "`", arg.description || ""]);
1266
+ if (isRequired) usageLine.push(argStr);
1267
+ }
1268
+ if (cmd.subCommands) {
1269
+ const commandNames = [];
1270
+ const subCommands = await resolveValue(cmd.subCommands);
1271
+ for (const [name, sub] of Object.entries(subCommands)) {
1272
+ const meta = await resolveValue((await resolveValue(sub))?.meta);
1273
+ commandsLines.push([`\`${name}\``, meta?.description || ""]);
1274
+ commandNames.push(name);
1275
+ }
1276
+ usageLine.push(commandNames.join("|"));
1277
+ }
1278
+ const usageLines = [];
1279
+ const version = cmdMeta.version || parentMeta.version;
1280
+ usageLines.push(colors.gray(`${cmdMeta.description} (${commandName + (version ? ` v${version}` : "")})`), "");
1281
+ const hasOptions = argLines.length > 0 || posLines.length > 0;
1282
+ usageLines.push(`${colors.underline(colors.bold("USAGE"))} \`${commandName}${hasOptions ? " [OPTIONS]" : ""} ${usageLine.join(" ")}\``, "");
1283
+ if (posLines.length > 0) {
1284
+ usageLines.push(colors.underline(colors.bold("ARGUMENTS")), "");
1285
+ usageLines.push(formatLineColumns(posLines, " "));
1286
+ usageLines.push("");
1287
+ }
1288
+ if (argLines.length > 0) {
1289
+ usageLines.push(colors.underline(colors.bold("OPTIONS")), "");
1290
+ usageLines.push(formatLineColumns(argLines, " "));
1291
+ usageLines.push("");
1292
+ }
1293
+ if (commandsLines.length > 0) {
1294
+ usageLines.push(colors.underline(colors.bold("COMMANDS")), "");
1295
+ usageLines.push(formatLineColumns(commandsLines, " "));
1296
+ usageLines.push("", `Use \`${commandName} <command> --help\` for more information about a command.`);
1297
+ }
1298
+ return usageLines.filter((l$2) => typeof l$2 === "string").join("\n");
1299
+ }
1300
+ async function runMain(cmd, opts = {}) {
1301
+ const rawArgs = opts.rawArgs || process.argv.slice(2);
1302
+ const showUsage$1 = opts.showUsage || showUsage;
1303
+ try {
1304
+ if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
1305
+ await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
1306
+ process.exit(0);
1307
+ } else if (rawArgs.length === 1 && rawArgs[0] === "--version") {
1308
+ const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
1309
+ if (!meta?.version) throw new CLIError("No version specified", "E_NO_VERSION");
1310
+ consola.log(meta.version);
1311
+ } else await runCommand$1(cmd, { rawArgs });
1312
+ } catch (error) {
1313
+ const isCLIError = error instanceof CLIError;
1314
+ if (!isCLIError) consola.error(error, "\n");
1315
+ if (isCLIError) await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
1316
+ consola.error(error.message);
1317
+ process.exit(1);
1318
+ }
1319
+ }
1320
+
1321
+ //#endregion
1322
+ //#region ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
1323
+ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1324
+ const ESC = "\x1B";
1325
+ const CSI = `${ESC}[`;
1326
+ const beep = "\x07";
1327
+ const cursor = {
1328
+ to(x$2, y$3) {
1329
+ if (!y$3) return `${CSI}${x$2 + 1}G`;
1330
+ return `${CSI}${y$3 + 1};${x$2 + 1}H`;
1331
+ },
1332
+ move(x$2, y$3) {
1333
+ let ret = "";
1334
+ if (x$2 < 0) ret += `${CSI}${-x$2}D`;
1335
+ else if (x$2 > 0) ret += `${CSI}${x$2}C`;
1336
+ if (y$3 < 0) ret += `${CSI}${-y$3}A`;
1337
+ else if (y$3 > 0) ret += `${CSI}${y$3}B`;
1338
+ return ret;
1339
+ },
1340
+ up: (count = 1) => `${CSI}${count}A`,
1341
+ down: (count = 1) => `${CSI}${count}B`,
1342
+ forward: (count = 1) => `${CSI}${count}C`,
1343
+ backward: (count = 1) => `${CSI}${count}D`,
1344
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
1345
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
1346
+ left: `${CSI}G`,
1347
+ hide: `${CSI}?25l`,
1348
+ show: `${CSI}?25h`,
1349
+ save: `${ESC}7`,
1350
+ restore: `${ESC}8`
1351
+ };
1352
+ const scroll = {
1353
+ up: (count = 1) => `${CSI}S`.repeat(count),
1354
+ down: (count = 1) => `${CSI}T`.repeat(count)
1355
+ };
1356
+ const erase = {
1357
+ screen: `${CSI}2J`,
1358
+ up: (count = 1) => `${CSI}1J`.repeat(count),
1359
+ down: (count = 1) => `${CSI}J`.repeat(count),
1360
+ line: `${CSI}2K`,
1361
+ lineEnd: `${CSI}K`,
1362
+ lineStart: `${CSI}1K`,
1363
+ lines(count) {
1364
+ let clear = "";
1365
+ for (let i$1 = 0; i$1 < count; i$1++) clear += this.line + (i$1 < count - 1 ? cursor.up() : "");
1366
+ if (count) clear += cursor.left;
1367
+ return clear;
1368
+ }
1369
+ };
1370
+ module.exports = {
1371
+ cursor,
1372
+ scroll,
1373
+ erase,
1374
+ beep
1375
+ };
1376
+ }));
1377
+
1378
+ //#endregion
1379
+ //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
1380
+ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1381
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
1382
+ 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);
1383
+ let formatter = (open, close, replace = open) => (input) => {
1384
+ let string = "" + input, index = string.indexOf(close, open.length);
1385
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
1386
+ };
1387
+ let replaceClose = (string, close, replace, index) => {
1388
+ let result = "", cursor = 0;
1389
+ do {
1390
+ result += string.substring(cursor, index) + replace;
1391
+ cursor = index + close.length;
1392
+ index = string.indexOf(close, cursor);
1393
+ } while (~index);
1394
+ return result + string.substring(cursor);
1395
+ };
1396
+ let createColors = (enabled = isColorSupported) => {
1397
+ let f$1 = enabled ? formatter : () => String;
1398
+ return {
1399
+ isColorSupported: enabled,
1400
+ reset: f$1("\x1B[0m", "\x1B[0m"),
1401
+ bold: f$1("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
1402
+ dim: f$1("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
1403
+ italic: f$1("\x1B[3m", "\x1B[23m"),
1404
+ underline: f$1("\x1B[4m", "\x1B[24m"),
1405
+ inverse: f$1("\x1B[7m", "\x1B[27m"),
1406
+ hidden: f$1("\x1B[8m", "\x1B[28m"),
1407
+ strikethrough: f$1("\x1B[9m", "\x1B[29m"),
1408
+ black: f$1("\x1B[30m", "\x1B[39m"),
1409
+ red: f$1("\x1B[31m", "\x1B[39m"),
1410
+ green: f$1("\x1B[32m", "\x1B[39m"),
1411
+ yellow: f$1("\x1B[33m", "\x1B[39m"),
1412
+ blue: f$1("\x1B[34m", "\x1B[39m"),
1413
+ magenta: f$1("\x1B[35m", "\x1B[39m"),
1414
+ cyan: f$1("\x1B[36m", "\x1B[39m"),
1415
+ white: f$1("\x1B[37m", "\x1B[39m"),
1416
+ gray: f$1("\x1B[90m", "\x1B[39m"),
1417
+ bgBlack: f$1("\x1B[40m", "\x1B[49m"),
1418
+ bgRed: f$1("\x1B[41m", "\x1B[49m"),
1419
+ bgGreen: f$1("\x1B[42m", "\x1B[49m"),
1420
+ bgYellow: f$1("\x1B[43m", "\x1B[49m"),
1421
+ bgBlue: f$1("\x1B[44m", "\x1B[49m"),
1422
+ bgMagenta: f$1("\x1B[45m", "\x1B[49m"),
1423
+ bgCyan: f$1("\x1B[46m", "\x1B[49m"),
1424
+ bgWhite: f$1("\x1B[47m", "\x1B[49m"),
1425
+ blackBright: f$1("\x1B[90m", "\x1B[39m"),
1426
+ redBright: f$1("\x1B[91m", "\x1B[39m"),
1427
+ greenBright: f$1("\x1B[92m", "\x1B[39m"),
1428
+ yellowBright: f$1("\x1B[93m", "\x1B[39m"),
1429
+ blueBright: f$1("\x1B[94m", "\x1B[39m"),
1430
+ magentaBright: f$1("\x1B[95m", "\x1B[39m"),
1431
+ cyanBright: f$1("\x1B[96m", "\x1B[39m"),
1432
+ whiteBright: f$1("\x1B[97m", "\x1B[39m"),
1433
+ bgBlackBright: f$1("\x1B[100m", "\x1B[49m"),
1434
+ bgRedBright: f$1("\x1B[101m", "\x1B[49m"),
1435
+ bgGreenBright: f$1("\x1B[102m", "\x1B[49m"),
1436
+ bgYellowBright: f$1("\x1B[103m", "\x1B[49m"),
1437
+ bgBlueBright: f$1("\x1B[104m", "\x1B[49m"),
1438
+ bgMagentaBright: f$1("\x1B[105m", "\x1B[49m"),
1439
+ bgCyanBright: f$1("\x1B[106m", "\x1B[49m"),
1440
+ bgWhiteBright: f$1("\x1B[107m", "\x1B[49m")
1441
+ };
1442
+ };
1443
+ module.exports = createColors();
1444
+ module.exports.createColors = createColors;
1445
+ }));
1446
+
1447
+ //#endregion
1448
+ //#region ../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
1449
+ var import_src = require_src();
1450
+ var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
1451
+ function DD({ onlyFirst: e$1 = !1 } = {}) {
1452
+ const t$1 = ["[\\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("|");
1453
+ return new RegExp(t$1, e$1 ? void 0 : "g");
1454
+ }
1455
+ const uD = DD();
1456
+ function P$1(e$1) {
1457
+ if (typeof e$1 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e$1}\``);
1458
+ return e$1.replace(uD, "");
1459
+ }
1460
+ function L$1(e$1) {
1461
+ return e$1 && e$1.__esModule && Object.prototype.hasOwnProperty.call(e$1, "default") ? e$1.default : e$1;
1462
+ }
1463
+ var W$1 = { exports: {} };
1464
+ (function(e$1) {
1465
+ var u$2 = {};
1466
+ e$1.exports = u$2, u$2.eastAsianWidth = function(F$2) {
1467
+ var s$1 = F$2.charCodeAt(0), i$1 = F$2.length == 2 ? F$2.charCodeAt(1) : 0, D$2 = s$1;
1468
+ return 55296 <= s$1 && s$1 <= 56319 && 56320 <= i$1 && i$1 <= 57343 && (s$1 &= 1023, i$1 &= 1023, D$2 = s$1 << 10 | i$1, D$2 += 65536), D$2 == 12288 || 65281 <= D$2 && D$2 <= 65376 || 65504 <= D$2 && D$2 <= 65510 ? "F" : D$2 == 8361 || 65377 <= D$2 && D$2 <= 65470 || 65474 <= D$2 && D$2 <= 65479 || 65482 <= D$2 && D$2 <= 65487 || 65490 <= D$2 && D$2 <= 65495 || 65498 <= D$2 && D$2 <= 65500 || 65512 <= D$2 && D$2 <= 65518 ? "H" : 4352 <= D$2 && D$2 <= 4447 || 4515 <= D$2 && D$2 <= 4519 || 4602 <= D$2 && D$2 <= 4607 || 9001 <= D$2 && D$2 <= 9002 || 11904 <= D$2 && D$2 <= 11929 || 11931 <= D$2 && D$2 <= 12019 || 12032 <= D$2 && D$2 <= 12245 || 12272 <= D$2 && D$2 <= 12283 || 12289 <= D$2 && D$2 <= 12350 || 12353 <= D$2 && D$2 <= 12438 || 12441 <= D$2 && D$2 <= 12543 || 12549 <= D$2 && D$2 <= 12589 || 12593 <= D$2 && D$2 <= 12686 || 12688 <= D$2 && D$2 <= 12730 || 12736 <= D$2 && D$2 <= 12771 || 12784 <= D$2 && D$2 <= 12830 || 12832 <= D$2 && D$2 <= 12871 || 12880 <= D$2 && D$2 <= 13054 || 13056 <= D$2 && D$2 <= 19903 || 19968 <= D$2 && D$2 <= 42124 || 42128 <= D$2 && D$2 <= 42182 || 43360 <= D$2 && D$2 <= 43388 || 44032 <= D$2 && D$2 <= 55203 || 55216 <= D$2 && D$2 <= 55238 || 55243 <= D$2 && D$2 <= 55291 || 63744 <= D$2 && D$2 <= 64255 || 65040 <= D$2 && D$2 <= 65049 || 65072 <= D$2 && D$2 <= 65106 || 65108 <= D$2 && D$2 <= 65126 || 65128 <= D$2 && D$2 <= 65131 || 110592 <= D$2 && D$2 <= 110593 || 127488 <= D$2 && D$2 <= 127490 || 127504 <= D$2 && D$2 <= 127546 || 127552 <= D$2 && D$2 <= 127560 || 127568 <= D$2 && D$2 <= 127569 || 131072 <= D$2 && D$2 <= 194367 || 177984 <= D$2 && D$2 <= 196605 || 196608 <= D$2 && D$2 <= 262141 ? "W" : 32 <= D$2 && D$2 <= 126 || 162 <= D$2 && D$2 <= 163 || 165 <= D$2 && D$2 <= 166 || D$2 == 172 || D$2 == 175 || 10214 <= D$2 && D$2 <= 10221 || 10629 <= D$2 && D$2 <= 10630 ? "Na" : D$2 == 161 || D$2 == 164 || 167 <= D$2 && D$2 <= 168 || D$2 == 170 || 173 <= D$2 && D$2 <= 174 || 176 <= D$2 && D$2 <= 180 || 182 <= D$2 && D$2 <= 186 || 188 <= D$2 && D$2 <= 191 || D$2 == 198 || D$2 == 208 || 215 <= D$2 && D$2 <= 216 || 222 <= D$2 && D$2 <= 225 || D$2 == 230 || 232 <= D$2 && D$2 <= 234 || 236 <= D$2 && D$2 <= 237 || D$2 == 240 || 242 <= D$2 && D$2 <= 243 || 247 <= D$2 && D$2 <= 250 || D$2 == 252 || D$2 == 254 || D$2 == 257 || D$2 == 273 || D$2 == 275 || D$2 == 283 || 294 <= D$2 && D$2 <= 295 || D$2 == 299 || 305 <= D$2 && D$2 <= 307 || D$2 == 312 || 319 <= D$2 && D$2 <= 322 || D$2 == 324 || 328 <= D$2 && D$2 <= 331 || D$2 == 333 || 338 <= D$2 && D$2 <= 339 || 358 <= D$2 && D$2 <= 359 || D$2 == 363 || D$2 == 462 || D$2 == 464 || D$2 == 466 || D$2 == 468 || D$2 == 470 || D$2 == 472 || D$2 == 474 || D$2 == 476 || D$2 == 593 || D$2 == 609 || D$2 == 708 || D$2 == 711 || 713 <= D$2 && D$2 <= 715 || D$2 == 717 || D$2 == 720 || 728 <= D$2 && D$2 <= 731 || D$2 == 733 || D$2 == 735 || 768 <= D$2 && D$2 <= 879 || 913 <= D$2 && D$2 <= 929 || 931 <= D$2 && D$2 <= 937 || 945 <= D$2 && D$2 <= 961 || 963 <= D$2 && D$2 <= 969 || D$2 == 1025 || 1040 <= D$2 && D$2 <= 1103 || D$2 == 1105 || D$2 == 8208 || 8211 <= D$2 && D$2 <= 8214 || 8216 <= D$2 && D$2 <= 8217 || 8220 <= D$2 && D$2 <= 8221 || 8224 <= D$2 && D$2 <= 8226 || 8228 <= D$2 && D$2 <= 8231 || D$2 == 8240 || 8242 <= D$2 && D$2 <= 8243 || D$2 == 8245 || D$2 == 8251 || D$2 == 8254 || D$2 == 8308 || D$2 == 8319 || 8321 <= D$2 && D$2 <= 8324 || D$2 == 8364 || D$2 == 8451 || D$2 == 8453 || D$2 == 8457 || D$2 == 8467 || D$2 == 8470 || 8481 <= D$2 && D$2 <= 8482 || D$2 == 8486 || D$2 == 8491 || 8531 <= D$2 && D$2 <= 8532 || 8539 <= D$2 && D$2 <= 8542 || 8544 <= D$2 && D$2 <= 8555 || 8560 <= D$2 && D$2 <= 8569 || D$2 == 8585 || 8592 <= D$2 && D$2 <= 8601 || 8632 <= D$2 && D$2 <= 8633 || D$2 == 8658 || D$2 == 8660 || D$2 == 8679 || D$2 == 8704 || 8706 <= D$2 && D$2 <= 8707 || 8711 <= D$2 && D$2 <= 8712 || D$2 == 8715 || D$2 == 8719 || D$2 == 8721 || D$2 == 8725 || D$2 == 8730 || 8733 <= D$2 && D$2 <= 8736 || D$2 == 8739 || D$2 == 8741 || 8743 <= D$2 && D$2 <= 8748 || D$2 == 8750 || 8756 <= D$2 && D$2 <= 8759 || 8764 <= D$2 && D$2 <= 8765 || D$2 == 8776 || D$2 == 8780 || D$2 == 8786 || 8800 <= D$2 && D$2 <= 8801 || 8804 <= D$2 && D$2 <= 8807 || 8810 <= D$2 && D$2 <= 8811 || 8814 <= D$2 && D$2 <= 8815 || 8834 <= D$2 && D$2 <= 8835 || 8838 <= D$2 && D$2 <= 8839 || D$2 == 8853 || D$2 == 8857 || D$2 == 8869 || D$2 == 8895 || D$2 == 8978 || 9312 <= D$2 && D$2 <= 9449 || 9451 <= D$2 && D$2 <= 9547 || 9552 <= D$2 && D$2 <= 9587 || 9600 <= D$2 && D$2 <= 9615 || 9618 <= D$2 && D$2 <= 9621 || 9632 <= D$2 && D$2 <= 9633 || 9635 <= D$2 && D$2 <= 9641 || 9650 <= D$2 && D$2 <= 9651 || 9654 <= D$2 && D$2 <= 9655 || 9660 <= D$2 && D$2 <= 9661 || 9664 <= D$2 && D$2 <= 9665 || 9670 <= D$2 && D$2 <= 9672 || D$2 == 9675 || 9678 <= D$2 && D$2 <= 9681 || 9698 <= D$2 && D$2 <= 9701 || D$2 == 9711 || 9733 <= D$2 && D$2 <= 9734 || D$2 == 9737 || 9742 <= D$2 && D$2 <= 9743 || 9748 <= D$2 && D$2 <= 9749 || D$2 == 9756 || D$2 == 9758 || D$2 == 9792 || D$2 == 9794 || 9824 <= D$2 && D$2 <= 9825 || 9827 <= D$2 && D$2 <= 9829 || 9831 <= D$2 && D$2 <= 9834 || 9836 <= D$2 && D$2 <= 9837 || D$2 == 9839 || 9886 <= D$2 && D$2 <= 9887 || 9918 <= D$2 && D$2 <= 9919 || 9924 <= D$2 && D$2 <= 9933 || 9935 <= D$2 && D$2 <= 9953 || D$2 == 9955 || 9960 <= D$2 && D$2 <= 9983 || D$2 == 10045 || D$2 == 10071 || 10102 <= D$2 && D$2 <= 10111 || 11093 <= D$2 && D$2 <= 11097 || 12872 <= D$2 && D$2 <= 12879 || 57344 <= D$2 && D$2 <= 63743 || 65024 <= D$2 && D$2 <= 65039 || D$2 == 65533 || 127232 <= D$2 && D$2 <= 127242 || 127248 <= D$2 && D$2 <= 127277 || 127280 <= D$2 && D$2 <= 127337 || 127344 <= D$2 && D$2 <= 127386 || 917760 <= D$2 && D$2 <= 917999 || 983040 <= D$2 && D$2 <= 1048573 || 1048576 <= D$2 && D$2 <= 1114109 ? "A" : "N";
1469
+ }, u$2.characterLength = function(F$2) {
1470
+ var s$1 = this.eastAsianWidth(F$2);
1471
+ return s$1 == "F" || s$1 == "W" || s$1 == "A" ? 2 : 1;
1472
+ };
1473
+ function t$1(F$2) {
1474
+ return F$2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
1475
+ }
1476
+ u$2.length = function(F$2) {
1477
+ for (var s$1 = t$1(F$2), i$1 = 0, D$2 = 0; D$2 < s$1.length; D$2++) i$1 = i$1 + this.characterLength(s$1[D$2]);
1478
+ return i$1;
1479
+ }, u$2.slice = function(F$2, s$1, i$1) {
1480
+ textLen = u$2.length(F$2), s$1 = s$1 || 0, i$1 = i$1 || 1, s$1 < 0 && (s$1 = textLen + s$1), i$1 < 0 && (i$1 = textLen + i$1);
1481
+ for (var D$2 = "", C$2 = 0, n$1 = t$1(F$2), E = 0; E < n$1.length; E++) {
1482
+ var a$1 = n$1[E], o$2 = u$2.length(a$1);
1483
+ if (C$2 >= s$1 - (o$2 == 2 ? 1 : 0)) if (C$2 + o$2 <= i$1) D$2 += a$1;
1484
+ else break;
1485
+ C$2 += o$2;
1486
+ }
1487
+ return D$2;
1488
+ };
1489
+ })(W$1);
1490
+ var tD = W$1.exports;
1491
+ const eD = L$1(tD);
1492
+ var FD = function() {
1493
+ 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;
1494
+ };
1495
+ const sD = L$1(FD);
1496
+ function p(e$1, u$2 = {}) {
1497
+ if (typeof e$1 != "string" || e$1.length === 0 || (u$2 = {
1498
+ ambiguousIsNarrow: !0,
1499
+ ...u$2
1500
+ }, e$1 = P$1(e$1), e$1.length === 0)) return 0;
1501
+ e$1 = e$1.replace(sD(), " ");
1502
+ const t$1 = u$2.ambiguousIsNarrow ? 1 : 2;
1503
+ let F$2 = 0;
1504
+ for (const s$1 of e$1) {
1505
+ const i$1 = s$1.codePointAt(0);
1506
+ if (i$1 <= 31 || i$1 >= 127 && i$1 <= 159 || i$1 >= 768 && i$1 <= 879) continue;
1507
+ switch (eD.eastAsianWidth(s$1)) {
1508
+ case "F":
1509
+ case "W":
1510
+ F$2 += 2;
1511
+ break;
1512
+ case "A":
1513
+ F$2 += t$1;
1514
+ break;
1515
+ default: F$2 += 1;
1516
+ }
1517
+ }
1518
+ return F$2;
1519
+ }
1520
+ const w = 10, N = (e$1 = 0) => (u$2) => `\x1B[${u$2 + e$1}m`, I = (e$1 = 0) => (u$2) => `\x1B[${38 + e$1};5;${u$2}m`, R = (e$1 = 0) => (u$2, t$1, F$2) => `\x1B[${38 + e$1};2;${u$2};${t$1};${F$2}m`, r = {
1521
+ modifier: {
1522
+ reset: [0, 0],
1523
+ bold: [1, 22],
1524
+ dim: [2, 22],
1525
+ italic: [3, 23],
1526
+ underline: [4, 24],
1527
+ overline: [53, 55],
1528
+ inverse: [7, 27],
1529
+ hidden: [8, 28],
1530
+ strikethrough: [9, 29]
1531
+ },
1532
+ color: {
1533
+ black: [30, 39],
1534
+ red: [31, 39],
1535
+ green: [32, 39],
1536
+ yellow: [33, 39],
1537
+ blue: [34, 39],
1538
+ magenta: [35, 39],
1539
+ cyan: [36, 39],
1540
+ white: [37, 39],
1541
+ blackBright: [90, 39],
1542
+ gray: [90, 39],
1543
+ grey: [90, 39],
1544
+ redBright: [91, 39],
1545
+ greenBright: [92, 39],
1546
+ yellowBright: [93, 39],
1547
+ blueBright: [94, 39],
1548
+ magentaBright: [95, 39],
1549
+ cyanBright: [96, 39],
1550
+ whiteBright: [97, 39]
1551
+ },
1552
+ bgColor: {
1553
+ bgBlack: [40, 49],
1554
+ bgRed: [41, 49],
1555
+ bgGreen: [42, 49],
1556
+ bgYellow: [43, 49],
1557
+ bgBlue: [44, 49],
1558
+ bgMagenta: [45, 49],
1559
+ bgCyan: [46, 49],
1560
+ bgWhite: [47, 49],
1561
+ bgBlackBright: [100, 49],
1562
+ bgGray: [100, 49],
1563
+ bgGrey: [100, 49],
1564
+ bgRedBright: [101, 49],
1565
+ bgGreenBright: [102, 49],
1566
+ bgYellowBright: [103, 49],
1567
+ bgBlueBright: [104, 49],
1568
+ bgMagentaBright: [105, 49],
1569
+ bgCyanBright: [106, 49],
1570
+ bgWhiteBright: [107, 49]
1571
+ }
1572
+ };
1573
+ Object.keys(r.modifier);
1574
+ const iD = Object.keys(r.color), CD = Object.keys(r.bgColor);
1575
+ [...iD, ...CD];
1576
+ function rD() {
1577
+ const e$1 = /* @__PURE__ */ new Map();
1578
+ for (const [u$2, t$1] of Object.entries(r)) {
1579
+ for (const [F$2, s$1] of Object.entries(t$1)) r[F$2] = {
1580
+ open: `\x1B[${s$1[0]}m`,
1581
+ close: `\x1B[${s$1[1]}m`
1582
+ }, t$1[F$2] = r[F$2], e$1.set(s$1[0], s$1[1]);
1583
+ Object.defineProperty(r, u$2, {
1584
+ value: t$1,
1585
+ enumerable: !1
1586
+ });
1587
+ }
1588
+ return Object.defineProperty(r, "codes", {
1589
+ value: e$1,
1590
+ enumerable: !1
1591
+ }), 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, {
1592
+ rgbToAnsi256: {
1593
+ value: (u$2, t$1, F$2) => u$2 === t$1 && t$1 === F$2 ? u$2 < 8 ? 16 : u$2 > 248 ? 231 : Math.round((u$2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u$2 / 255 * 5) + 6 * Math.round(t$1 / 255 * 5) + Math.round(F$2 / 255 * 5),
1594
+ enumerable: !1
1595
+ },
1596
+ hexToRgb: {
1597
+ value: (u$2) => {
1598
+ const t$1 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u$2.toString(16));
1599
+ if (!t$1) return [
1600
+ 0,
1601
+ 0,
1602
+ 0
1603
+ ];
1604
+ let [F$2] = t$1;
1605
+ F$2.length === 3 && (F$2 = [...F$2].map((i$1) => i$1 + i$1).join(""));
1606
+ const s$1 = Number.parseInt(F$2, 16);
1607
+ return [
1608
+ s$1 >> 16 & 255,
1609
+ s$1 >> 8 & 255,
1610
+ s$1 & 255
1611
+ ];
1612
+ },
1613
+ enumerable: !1
1614
+ },
1615
+ hexToAnsi256: {
1616
+ value: (u$2) => r.rgbToAnsi256(...r.hexToRgb(u$2)),
1617
+ enumerable: !1
1618
+ },
1619
+ ansi256ToAnsi: {
1620
+ value: (u$2) => {
1621
+ if (u$2 < 8) return 30 + u$2;
1622
+ if (u$2 < 16) return 90 + (u$2 - 8);
1623
+ let t$1, F$2, s$1;
1624
+ if (u$2 >= 232) t$1 = ((u$2 - 232) * 10 + 8) / 255, F$2 = t$1, s$1 = t$1;
1625
+ else {
1626
+ u$2 -= 16;
1627
+ const C$2 = u$2 % 36;
1628
+ t$1 = Math.floor(u$2 / 36) / 5, F$2 = Math.floor(C$2 / 6) / 5, s$1 = C$2 % 6 / 5;
1629
+ }
1630
+ const i$1 = Math.max(t$1, F$2, s$1) * 2;
1631
+ if (i$1 === 0) return 30;
1632
+ let D$2 = 30 + (Math.round(s$1) << 2 | Math.round(F$2) << 1 | Math.round(t$1));
1633
+ return i$1 === 2 && (D$2 += 60), D$2;
1634
+ },
1635
+ enumerable: !1
1636
+ },
1637
+ rgbToAnsi: {
1638
+ value: (u$2, t$1, F$2) => r.ansi256ToAnsi(r.rgbToAnsi256(u$2, t$1, F$2)),
1639
+ enumerable: !1
1640
+ },
1641
+ hexToAnsi: {
1642
+ value: (u$2) => r.ansi256ToAnsi(r.hexToAnsi256(u$2)),
1643
+ enumerable: !1
1644
+ }
1645
+ }), r;
1646
+ }
1647
+ 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$2) => p(u$2)), k$1 = (e$1, u$2, t$1) => {
1648
+ const F$2 = [...u$2];
1649
+ let s$1 = !1, i$1 = !1, D$2 = p(P$1(e$1[e$1.length - 1]));
1650
+ for (const [C$2, n$1] of F$2.entries()) {
1651
+ const E = p(n$1);
1652
+ if (D$2 + E <= t$1 ? e$1[e$1.length - 1] += n$1 : (e$1.push(n$1), D$2 = 0), d$1.has(n$1) && (s$1 = !0, i$1 = F$2.slice(C$2 + 1).join("").startsWith(_$1)), s$1) {
1653
+ i$1 ? n$1 === y$1 && (s$1 = !1, i$1 = !1) : n$1 === G$1 && (s$1 = !1);
1654
+ continue;
1655
+ }
1656
+ D$2 += E, D$2 === t$1 && C$2 < F$2.length - 1 && (e$1.push(""), D$2 = 0);
1657
+ }
1658
+ !D$2 && e$1[e$1.length - 1].length > 0 && e$1.length > 1 && (e$1[e$1.length - 2] += e$1.pop());
1659
+ }, hD = (e$1) => {
1660
+ const u$2 = e$1.split(" ");
1661
+ let t$1 = u$2.length;
1662
+ for (; t$1 > 0 && !(p(u$2[t$1 - 1]) > 0);) t$1--;
1663
+ return t$1 === u$2.length ? e$1 : u$2.slice(0, t$1).join(" ") + u$2.slice(t$1).join("");
1664
+ }, lD = (e$1, u$2, t$1 = {}) => {
1665
+ if (t$1.trim !== !1 && e$1.trim() === "") return "";
1666
+ let F$2 = "", s$1, i$1;
1667
+ const D$2 = aD(e$1);
1668
+ let C$2 = [""];
1669
+ for (const [E, a$1] of e$1.split(" ").entries()) {
1670
+ t$1.trim !== !1 && (C$2[C$2.length - 1] = C$2[C$2.length - 1].trimStart());
1671
+ let o$2 = p(C$2[C$2.length - 1]);
1672
+ if (E !== 0 && (o$2 >= u$2 && (t$1.wordWrap === !1 || t$1.trim === !1) && (C$2.push(""), o$2 = 0), (o$2 > 0 || t$1.trim === !1) && (C$2[C$2.length - 1] += " ", o$2++)), t$1.hard && D$2[E] > u$2) {
1673
+ const c$1 = u$2 - o$2, f$1 = 1 + Math.floor((D$2[E] - c$1 - 1) / u$2);
1674
+ Math.floor((D$2[E] - 1) / u$2) < f$1 && C$2.push(""), k$1(C$2, a$1, u$2);
1675
+ continue;
1676
+ }
1677
+ if (o$2 + D$2[E] > u$2 && o$2 > 0 && D$2[E] > 0) {
1678
+ if (t$1.wordWrap === !1 && o$2 < u$2) {
1679
+ k$1(C$2, a$1, u$2);
1680
+ continue;
1681
+ }
1682
+ C$2.push("");
1683
+ }
1684
+ if (o$2 + D$2[E] > u$2 && t$1.wordWrap === !1) {
1685
+ k$1(C$2, a$1, u$2);
1686
+ continue;
1687
+ }
1688
+ C$2[C$2.length - 1] += a$1;
1689
+ }
1690
+ t$1.trim !== !1 && (C$2 = C$2.map((E) => hD(E)));
1691
+ const n$1 = [...C$2.join(`
1692
+ `)];
1693
+ for (const [E, a$1] of n$1.entries()) {
1694
+ if (F$2 += a$1, d$1.has(a$1)) {
1695
+ const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
1696
+ if (c$1.code !== void 0) {
1697
+ const f$1 = Number.parseFloat(c$1.code);
1698
+ s$1 = f$1 === oD ? void 0 : f$1;
1699
+ } else c$1.uri !== void 0 && (i$1 = c$1.uri.length === 0 ? void 0 : c$1.uri);
1700
+ }
1701
+ const o$2 = ED.codes.get(Number(s$1));
1702
+ n$1[E + 1] === `
1703
+ ` ? (i$1 && (F$2 += K$1("")), s$1 && o$2 && (F$2 += z(o$2))) : a$1 === `
1704
+ ` && (s$1 && o$2 && (F$2 += z(s$1)), i$1 && (F$2 += K$1(i$1)));
1705
+ }
1706
+ return F$2;
1707
+ };
1708
+ function Y$1(e$1, u$2, t$1) {
1709
+ return String(e$1).normalize().replace(/\r\n/g, `
1710
+ `).split(`
1711
+ `).map((F$2) => lD(F$2, u$2, t$1)).join(`
1712
+ `);
1713
+ }
1714
+ const B = {
1715
+ actions: new Set([
1716
+ "up",
1717
+ "down",
1718
+ "left",
1719
+ "right",
1720
+ "space",
1721
+ "enter",
1722
+ "cancel"
1723
+ ]),
1724
+ aliases: new Map([
1725
+ ["k", "up"],
1726
+ ["j", "down"],
1727
+ ["h", "left"],
1728
+ ["l", "right"],
1729
+ ["", "cancel"],
1730
+ ["escape", "cancel"]
1731
+ ])
1732
+ };
1733
+ function $(e$1, u$2) {
1734
+ if (typeof e$1 == "string") return B.aliases.get(e$1) === u$2;
1735
+ for (const t$1 of e$1) if (t$1 !== void 0 && $(t$1, u$2)) return !0;
1736
+ return !1;
1737
+ }
1738
+ function BD(e$1, u$2) {
1739
+ if (e$1 === u$2) return;
1740
+ const t$1 = e$1.split(`
1741
+ `), F$2 = u$2.split(`
1742
+ `), s$1 = [];
1743
+ for (let i$1 = 0; i$1 < Math.max(t$1.length, F$2.length); i$1++) t$1[i$1] !== F$2[i$1] && s$1.push(i$1);
1744
+ return s$1;
1745
+ }
1746
+ const AD = globalThis.process.platform.startsWith("win"), S = Symbol("clack:cancel");
1747
+ function pD(e$1) {
1748
+ return e$1 === S;
1749
+ }
1750
+ function m(e$1, u$2) {
1751
+ const t$1 = e$1;
1752
+ t$1.isTTY && t$1.setRawMode(u$2);
1753
+ }
1754
+ function fD({ input: e$1 = stdin, output: u$2 = stdout, overwrite: t$1 = !0, hideCursor: F$2 = !0 } = {}) {
1755
+ const s$1 = g.createInterface({
1756
+ input: e$1,
1757
+ output: u$2,
1758
+ prompt: "",
1759
+ tabSize: 1
1760
+ });
1761
+ g.emitKeypressEvents(e$1, s$1), e$1.isTTY && e$1.setRawMode(!0);
1762
+ const i$1 = (D$2, { name: C$2, sequence: n$1 }) => {
1763
+ if ($([
1764
+ String(D$2),
1765
+ C$2,
1766
+ n$1
1767
+ ], "cancel")) {
1768
+ F$2 && u$2.write(import_src.cursor.show), process.exit(0);
1769
+ return;
1770
+ }
1771
+ if (!t$1) return;
1772
+ const a$1 = C$2 === "return" ? 0 : -1, o$2 = C$2 === "return" ? -1 : 0;
1773
+ g.moveCursor(u$2, a$1, o$2, () => {
1774
+ g.clearLine(u$2, 1, () => {
1775
+ e$1.once("keypress", i$1);
1776
+ });
1777
+ });
1778
+ };
1779
+ return F$2 && u$2.write(import_src.cursor.hide), e$1.once("keypress", i$1), () => {
1780
+ e$1.off("keypress", i$1), F$2 && u$2.write(import_src.cursor.show), e$1.isTTY && !AD && e$1.setRawMode(!1), s$1.terminal = !1, s$1.close();
1781
+ };
1782
+ }
1783
+ var gD = Object.defineProperty, vD = (e$1, u$2, t$1) => u$2 in e$1 ? gD(e$1, u$2, {
1784
+ enumerable: !0,
1785
+ configurable: !0,
1786
+ writable: !0,
1787
+ value: t$1
1788
+ }) : e$1[u$2] = t$1, h = (e$1, u$2, t$1) => (vD(e$1, typeof u$2 != "symbol" ? u$2 + "" : u$2, t$1), t$1);
1789
+ var x$1 = class {
1790
+ constructor(u$2, t$1 = !0) {
1791
+ 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");
1792
+ const { input: F$2 = stdin, output: s$1 = stdout, render: i$1, signal: D$2, ...C$2 } = u$2;
1793
+ this.opts = C$2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i$1.bind(this), this._track = t$1, this._abortSignal = D$2, this.input = F$2, this.output = s$1;
1794
+ }
1795
+ unsubscribe() {
1796
+ this._subscribers.clear();
1797
+ }
1798
+ setSubscriber(u$2, t$1) {
1799
+ const F$2 = this._subscribers.get(u$2) ?? [];
1800
+ F$2.push(t$1), this._subscribers.set(u$2, F$2);
1801
+ }
1802
+ on(u$2, t$1) {
1803
+ this.setSubscriber(u$2, { cb: t$1 });
1804
+ }
1805
+ once(u$2, t$1) {
1806
+ this.setSubscriber(u$2, {
1807
+ cb: t$1,
1808
+ once: !0
1809
+ });
1810
+ }
1811
+ emit(u$2, ...t$1) {
1812
+ const F$2 = this._subscribers.get(u$2) ?? [], s$1 = [];
1813
+ for (const i$1 of F$2) i$1.cb(...t$1), i$1.once && s$1.push(() => F$2.splice(F$2.indexOf(i$1), 1));
1814
+ for (const i$1 of s$1) i$1();
1815
+ }
1816
+ prompt() {
1817
+ return new Promise((u$2, t$1) => {
1818
+ if (this._abortSignal) {
1819
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u$2(S);
1820
+ this._abortSignal.addEventListener("abort", () => {
1821
+ this.state = "cancel", this.close();
1822
+ }, { once: !0 });
1823
+ }
1824
+ const F$2 = new Writable();
1825
+ F$2._write = (s$1, i$1, D$2) => {
1826
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D$2();
1827
+ }, this.input.pipe(F$2), this.rl = O.createInterface({
1828
+ input: this.input,
1829
+ output: F$2,
1830
+ tabSize: 2,
1831
+ prompt: "",
1832
+ escapeCodeTimeout: 50,
1833
+ terminal: !0
1834
+ }), 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", () => {
1835
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$2(this.value);
1836
+ }), this.once("cancel", () => {
1837
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), m(this.input, !1), u$2(S);
1838
+ });
1839
+ });
1840
+ }
1841
+ onKeypress(u$2, t$1) {
1842
+ if (this.state === "error" && (this.state = "active"), t$1?.name && (!this._track && B.aliases.has(t$1.name) && this.emit("cursor", B.aliases.get(t$1.name)), B.actions.has(t$1.name) && this.emit("cursor", t$1.name)), u$2 && (u$2.toLowerCase() === "y" || u$2.toLowerCase() === "n") && this.emit("confirm", u$2.toLowerCase() === "y"), u$2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u$2 && this.emit("key", u$2.toLowerCase()), t$1?.name === "return") {
1843
+ if (this.opts.validate) {
1844
+ const F$2 = this.opts.validate(this.value);
1845
+ F$2 && (this.error = F$2 instanceof Error ? F$2.message : F$2, this.state = "error", this.rl?.write(this.value));
1846
+ }
1847
+ this.state !== "error" && (this.state = "submit");
1848
+ }
1849
+ $([
1850
+ u$2,
1851
+ t$1?.name,
1852
+ t$1?.sequence
1853
+ ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
1854
+ }
1855
+ close() {
1856
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
1857
+ `), m(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
1858
+ }
1859
+ restoreCursor() {
1860
+ const u$2 = Y$1(this._prevFrame, process.stdout.columns, { hard: !0 }).split(`
1861
+ `).length - 1;
1862
+ this.output.write(import_src.cursor.move(-999, u$2 * -1));
1863
+ }
1864
+ render() {
1865
+ const u$2 = Y$1(this._render(this) ?? "", process.stdout.columns, { hard: !0 });
1866
+ if (u$2 !== this._prevFrame) {
1867
+ if (this.state === "initial") this.output.write(import_src.cursor.hide);
1868
+ else {
1869
+ const t$1 = BD(this._prevFrame, u$2);
1870
+ if (this.restoreCursor(), t$1 && t$1?.length === 1) {
1871
+ const F$2 = t$1[0];
1872
+ this.output.write(import_src.cursor.move(0, F$2)), this.output.write(import_src.erase.lines(1));
1873
+ const s$1 = u$2.split(`
1874
+ `);
1875
+ this.output.write(s$1[F$2]), this._prevFrame = u$2, this.output.write(import_src.cursor.move(0, s$1.length - F$2 - 1));
1876
+ return;
1877
+ }
1878
+ if (t$1 && t$1?.length > 1) {
1879
+ const F$2 = t$1[0];
1880
+ this.output.write(import_src.cursor.move(0, F$2)), this.output.write(import_src.erase.down());
1881
+ const s$1 = u$2.split(`
1882
+ `).slice(F$2);
1883
+ this.output.write(s$1.join(`
1884
+ `)), this._prevFrame = u$2;
1885
+ return;
1886
+ }
1887
+ this.output.write(import_src.erase.down());
1888
+ }
1889
+ this.output.write(u$2), this.state === "initial" && (this.state = "active"), this._prevFrame = u$2;
1890
+ }
1891
+ }
1892
+ };
1893
+ var dD = class extends x$1 {
1894
+ get cursor() {
1895
+ return this.value ? 0 : 1;
1896
+ }
1897
+ get _value() {
1898
+ return this.cursor === 0;
1899
+ }
1900
+ constructor(u$2) {
1901
+ super(u$2, !1), this.value = !!u$2.initialValue, this.on("value", () => {
1902
+ this.value = this._value;
1903
+ }), this.on("confirm", (t$1) => {
1904
+ this.output.write(import_src.cursor.move(0, -1)), this.value = t$1, this.state = "submit", this.close();
1905
+ }), this.on("cursor", () => {
1906
+ this.value = !this.value;
1907
+ });
1908
+ }
1909
+ };
1910
+ var mD = Object.defineProperty, bD = (e$1, u$2, t$1) => u$2 in e$1 ? mD(e$1, u$2, {
1911
+ enumerable: !0,
1912
+ configurable: !0,
1913
+ writable: !0,
1914
+ value: t$1
1915
+ }) : e$1[u$2] = t$1, Z = (e$1, u$2, t$1) => (bD(e$1, typeof u$2 != "symbol" ? u$2 + "" : u$2, t$1), t$1), q$1 = (e$1, u$2, t$1) => {
1916
+ if (!u$2.has(e$1)) throw TypeError("Cannot " + t$1);
1917
+ }, T$1 = (e$1, u$2, t$1) => (q$1(e$1, u$2, "read from private field"), t$1 ? t$1.call(e$1) : u$2.get(e$1)), wD = (e$1, u$2, t$1) => {
1918
+ if (u$2.has(e$1)) throw TypeError("Cannot add the same private member more than once");
1919
+ u$2 instanceof WeakSet ? u$2.add(e$1) : u$2.set(e$1, t$1);
1920
+ }, yD = (e$1, u$2, t$1, F$2) => (q$1(e$1, u$2, "write to private field"), F$2 ? F$2.call(e$1, t$1) : u$2.set(e$1, t$1), t$1), A$1;
1921
+ let _D = class extends x$1 {
1922
+ constructor(u$2) {
1923
+ super(u$2, !1), Z(this, "options"), Z(this, "cursor", 0), wD(this, A$1, void 0);
1924
+ const { options: t$1 } = u$2;
1925
+ yD(this, A$1, u$2.selectableGroups !== !1), this.options = Object.entries(t$1).flatMap(([F$2, s$1]) => [{
1926
+ value: F$2,
1927
+ group: !0,
1928
+ label: F$2
1929
+ }, ...s$1.map((i$1) => ({
1930
+ ...i$1,
1931
+ group: F$2
1932
+ }))]), this.value = [...u$2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F$2 }) => F$2 === u$2.cursorAt), T$1(this, A$1) ? 0 : 1), this.on("cursor", (F$2) => {
1933
+ switch (F$2) {
1934
+ case "left":
1935
+ case "up": {
1936
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1937
+ const s$1 = this.options[this.cursor]?.group === !0;
1938
+ !T$1(this, A$1) && s$1 && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
1939
+ break;
1940
+ }
1941
+ case "down":
1942
+ case "right": {
1943
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1944
+ const s$1 = this.options[this.cursor]?.group === !0;
1945
+ !T$1(this, A$1) && s$1 && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
1946
+ break;
1947
+ }
1948
+ case "space":
1949
+ this.toggleValue();
1950
+ break;
1951
+ }
1952
+ });
1953
+ }
1954
+ getGroupItems(u$2) {
1955
+ return this.options.filter((t$1) => t$1.group === u$2);
1956
+ }
1957
+ isGroupSelected(u$2) {
1958
+ return this.getGroupItems(u$2).every((t$1) => this.value.includes(t$1.value));
1959
+ }
1960
+ toggleValue() {
1961
+ const u$2 = this.options[this.cursor];
1962
+ if (u$2.group === !0) {
1963
+ const t$1 = u$2.value, F$2 = this.getGroupItems(t$1);
1964
+ this.isGroupSelected(t$1) ? this.value = this.value.filter((s$1) => F$2.findIndex((i$1) => i$1.value === s$1) === -1) : this.value = [...this.value, ...F$2.map((s$1) => s$1.value)], this.value = Array.from(new Set(this.value));
1965
+ } else this.value = this.value.includes(u$2.value) ? this.value.filter((F$2) => F$2 !== u$2.value) : [...this.value, u$2.value];
1966
+ }
1967
+ };
1968
+ A$1 = /* @__PURE__ */ new WeakMap();
1969
+ var kD = Object.defineProperty, $D = (e$1, u$2, t$1) => u$2 in e$1 ? kD(e$1, u$2, {
1970
+ enumerable: !0,
1971
+ configurable: !0,
1972
+ writable: !0,
1973
+ value: t$1
1974
+ }) : e$1[u$2] = t$1, H = (e$1, u$2, t$1) => ($D(e$1, typeof u$2 != "symbol" ? u$2 + "" : u$2, t$1), t$1);
1975
+ let SD = class extends x$1 {
1976
+ constructor(u$2) {
1977
+ super(u$2, !1), H(this, "options"), H(this, "cursor", 0), this.options = u$2.options, this.value = [...u$2.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: t$1 }) => t$1 === u$2.cursorAt), 0), this.on("key", (t$1) => {
1978
+ t$1 === "a" && this.toggleAll();
1979
+ }), this.on("cursor", (t$1) => {
1980
+ switch (t$1) {
1981
+ case "left":
1982
+ case "up":
1983
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1984
+ break;
1985
+ case "down":
1986
+ case "right":
1987
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1988
+ break;
1989
+ case "space":
1990
+ this.toggleValue();
1991
+ break;
1992
+ }
1993
+ });
1994
+ }
1995
+ get _value() {
1996
+ return this.options[this.cursor].value;
1997
+ }
1998
+ toggleAll() {
1999
+ this.value = this.value.length === this.options.length ? [] : this.options.map((t$1) => t$1.value);
2000
+ }
2001
+ toggleValue() {
2002
+ this.value = this.value.includes(this._value) ? this.value.filter((t$1) => t$1 !== this._value) : [...this.value, this._value];
2003
+ }
2004
+ };
2005
+ var TD = Object.defineProperty, jD = (e$1, u$2, t$1) => u$2 in e$1 ? TD(e$1, u$2, {
2006
+ enumerable: !0,
2007
+ configurable: !0,
2008
+ writable: !0,
2009
+ value: t$1
2010
+ }) : e$1[u$2] = t$1, U$1 = (e$1, u$2, t$1) => (jD(e$1, typeof u$2 != "symbol" ? u$2 + "" : u$2, t$1), t$1);
2011
+ var MD = class extends x$1 {
2012
+ constructor({ mask: u$2, ...t$1 }) {
2013
+ super(t$1), U$1(this, "valueWithCursor", ""), U$1(this, "_mask", "•"), this._mask = u$2 ?? "•", this.on("finalize", () => {
2014
+ this.valueWithCursor = this.masked;
2015
+ }), this.on("value", () => {
2016
+ if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
2017
+ else {
2018
+ const F$2 = this.masked.slice(0, this.cursor), s$1 = this.masked.slice(this.cursor);
2019
+ this.valueWithCursor = `${F$2}${import_picocolors.default.inverse(s$1[0])}${s$1.slice(1)}`;
2020
+ }
2021
+ });
2022
+ }
2023
+ get cursor() {
2024
+ return this._cursor;
2025
+ }
2026
+ get masked() {
2027
+ return this.value.replaceAll(/./g, this._mask);
2028
+ }
2029
+ };
2030
+ var OD = Object.defineProperty, PD = (e$1, u$2, t$1) => u$2 in e$1 ? OD(e$1, u$2, {
2031
+ enumerable: !0,
2032
+ configurable: !0,
2033
+ writable: !0,
2034
+ value: t$1
2035
+ }) : e$1[u$2] = t$1, J$1 = (e$1, u$2, t$1) => (PD(e$1, typeof u$2 != "symbol" ? u$2 + "" : u$2, t$1), t$1);
2036
+ var LD = class extends x$1 {
2037
+ constructor(u$2) {
2038
+ super(u$2, !1), J$1(this, "options"), J$1(this, "cursor", 0), this.options = u$2.options, this.cursor = this.options.findIndex(({ value: t$1 }) => t$1 === u$2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t$1) => {
2039
+ switch (t$1) {
2040
+ case "left":
2041
+ case "up":
2042
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
2043
+ break;
2044
+ case "down":
2045
+ case "right":
2046
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
2047
+ break;
2048
+ }
2049
+ this.changeValue();
2050
+ });
2051
+ }
2052
+ get _value() {
2053
+ return this.options[this.cursor];
2054
+ }
2055
+ changeValue() {
2056
+ this.value = this._value.value;
2057
+ }
2058
+ };
2059
+ var WD = Object.defineProperty, ND = (e$1, u$2, t$1) => u$2 in e$1 ? WD(e$1, u$2, {
2060
+ enumerable: !0,
2061
+ configurable: !0,
2062
+ writable: !0,
2063
+ value: t$1
2064
+ }) : e$1[u$2] = t$1, Q = (e$1, u$2, t$1) => (ND(e$1, typeof u$2 != "symbol" ? u$2 + "" : u$2, t$1), t$1);
2065
+ var ID = class extends x$1 {
2066
+ constructor(u$2) {
2067
+ super(u$2, !1), Q(this, "options"), Q(this, "cursor", 0), this.options = u$2.options;
2068
+ const t$1 = this.options.map(({ value: [F$2] }) => F$2?.toLowerCase());
2069
+ this.cursor = Math.max(t$1.indexOf(u$2.initialValue), 0), this.on("key", (F$2) => {
2070
+ if (!t$1.includes(F$2)) return;
2071
+ const s$1 = this.options.find(({ value: [i$1] }) => i$1?.toLowerCase() === F$2);
2072
+ s$1 && (this.value = s$1.value, this.state = "submit", this.emit("submit"));
2073
+ });
2074
+ }
2075
+ };
2076
+ var RD = class extends x$1 {
2077
+ get valueWithCursor() {
2078
+ if (this.state === "submit") return this.value;
2079
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
2080
+ const u$2 = this.value.slice(0, this.cursor), [t$1, ...F$2] = this.value.slice(this.cursor);
2081
+ return `${u$2}${import_picocolors.default.inverse(t$1)}${F$2.join("")}`;
2082
+ }
2083
+ get cursor() {
2084
+ return this._cursor;
2085
+ }
2086
+ constructor(u$2) {
2087
+ super(u$2), this.on("finalize", () => {
2088
+ this.value || (this.value = u$2.defaultValue);
2089
+ });
2090
+ }
2091
+ };
2092
+
2093
+ //#endregion
2094
+ //#region ../../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
2095
+ function ce() {
2096
+ 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";
2097
+ }
2098
+ const V = ce(), u = (t$1, n$1) => V ? t$1 : n$1, 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$1) => {
2099
+ switch (t$1) {
2100
+ case "initial":
2101
+ case "active": return import_picocolors.default.cyan(le);
2102
+ case "cancel": return import_picocolors.default.red(L);
2103
+ case "error": return import_picocolors.default.yellow(W);
2104
+ case "submit": return import_picocolors.default.green(C);
2105
+ }
2106
+ }, G = (t$1) => {
2107
+ const { cursor: n$1, options: r$2, style: i$1 } = t$1, s$1 = t$1.maxItems ?? Number.POSITIVE_INFINITY, c$1 = Math.max(process.stdout.rows - 4, 0), a$1 = Math.min(c$1, Math.max(s$1, 5));
2108
+ let l$2 = 0;
2109
+ n$1 >= l$2 + a$1 - 3 ? l$2 = Math.max(Math.min(n$1 - a$1 + 3, r$2.length - a$1), 0) : n$1 < l$2 + 2 && (l$2 = Math.max(n$1 - 2, 0));
2110
+ const $$1 = a$1 < r$2.length && l$2 > 0, g$2 = a$1 < r$2.length && l$2 + a$1 < r$2.length;
2111
+ return r$2.slice(l$2, l$2 + a$1).map((p$1, v$1, f$1) => {
2112
+ const j = v$1 === 0 && $$1, E = v$1 === f$1.length - 1 && g$2;
2113
+ return j || E ? import_picocolors.default.dim("...") : i$1(p$1, v$1 + l$2 === n$1);
2114
+ });
2115
+ }, he = (t$1) => new RD({
2116
+ validate: t$1.validate,
2117
+ placeholder: t$1.placeholder,
2118
+ defaultValue: t$1.defaultValue,
2119
+ initialValue: t$1.initialValue,
2120
+ render() {
2121
+ const n$1 = `${import_picocolors.default.gray(o)}
2122
+ ${b(this.state)} ${t$1.message}
2123
+ `, r$2 = t$1.placeholder ? import_picocolors.default.inverse(t$1.placeholder[0]) + import_picocolors.default.dim(t$1.placeholder.slice(1)) : import_picocolors.default.inverse(import_picocolors.default.hidden("_")), i$1 = this.value ? this.valueWithCursor : r$2;
2124
+ switch (this.state) {
2125
+ case "error": return `${n$1.trim()}
2126
+ ${import_picocolors.default.yellow(o)} ${i$1}
2127
+ ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
2128
+ `;
2129
+ case "submit": return `${n$1}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(this.value || t$1.placeholder)}`;
2130
+ case "cancel": return `${n$1}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(this.value ?? ""))}${this.value?.trim() ? `
2131
+ ${import_picocolors.default.gray(o)}` : ""}`;
2132
+ default: return `${n$1}${import_picocolors.default.cyan(o)} ${i$1}
2133
+ ${import_picocolors.default.cyan(d)}
2134
+ `;
2135
+ }
2136
+ }
2137
+ }).prompt(), ge = (t$1) => new MD({
2138
+ validate: t$1.validate,
2139
+ mask: t$1.mask ?? $e,
2140
+ render() {
2141
+ const n$1 = `${import_picocolors.default.gray(o)}
2142
+ ${b(this.state)} ${t$1.message}
2143
+ `, r$2 = this.valueWithCursor, i$1 = this.masked;
2144
+ switch (this.state) {
2145
+ case "error": return `${n$1.trim()}
2146
+ ${import_picocolors.default.yellow(o)} ${i$1}
2147
+ ${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(this.error)}
2148
+ `;
2149
+ case "submit": return `${n$1}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(i$1)}`;
2150
+ case "cancel": return `${n$1}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i$1 ?? ""))}${i$1 ? `
2151
+ ${import_picocolors.default.gray(o)}` : ""}`;
2152
+ default: return `${n$1}${import_picocolors.default.cyan(o)} ${r$2}
2153
+ ${import_picocolors.default.cyan(d)}
2154
+ `;
2155
+ }
2156
+ }
2157
+ }).prompt(), ye = (t$1) => {
2158
+ const n$1 = t$1.active ?? "Yes", r$2 = t$1.inactive ?? "No";
2159
+ return new dD({
2160
+ active: n$1,
2161
+ inactive: r$2,
2162
+ initialValue: t$1.initialValue ?? !0,
2163
+ render() {
2164
+ const i$1 = `${import_picocolors.default.gray(o)}
2165
+ ${b(this.state)} ${t$1.message}
2166
+ `, s$1 = this.value ? n$1 : r$2;
2167
+ switch (this.state) {
2168
+ case "submit": return `${i$1}${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(s$1)}`;
2169
+ case "cancel": return `${i$1}${import_picocolors.default.gray(o)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(s$1))}
2170
+ ${import_picocolors.default.gray(o)}`;
2171
+ default: return `${i$1}${import_picocolors.default.cyan(o)} ${this.value ? `${import_picocolors.default.green(k)} ${n$1}` : `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(n$1)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(r$2)}` : `${import_picocolors.default.green(k)} ${r$2}`}
2172
+ ${import_picocolors.default.cyan(d)}
2173
+ `;
2174
+ }
2175
+ }
2176
+ }).prompt();
2177
+ }, ve = (t$1) => {
2178
+ const n$1 = (r$2, i$1) => {
2179
+ const s$1 = r$2.label ?? String(r$2.value);
2180
+ switch (i$1) {
2181
+ case "selected": return `${import_picocolors.default.dim(s$1)}`;
2182
+ case "active": return `${import_picocolors.default.green(k)} ${s$1} ${r$2.hint ? import_picocolors.default.dim(`(${r$2.hint})`) : ""}`;
2183
+ case "cancelled": return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s$1))}`;
2184
+ default: return `${import_picocolors.default.dim(P)} ${import_picocolors.default.dim(s$1)}`;
2185
+ }
2186
+ };
2187
+ return new LD({
2188
+ options: t$1.options,
2189
+ initialValue: t$1.initialValue,
2190
+ render() {
2191
+ const r$2 = `${import_picocolors.default.gray(o)}
2192
+ ${b(this.state)} ${t$1.message}
2193
+ `;
2194
+ switch (this.state) {
2195
+ case "submit": return `${r$2}${import_picocolors.default.gray(o)} ${n$1(this.options[this.cursor], "selected")}`;
2196
+ case "cancel": return `${r$2}${import_picocolors.default.gray(o)} ${n$1(this.options[this.cursor], "cancelled")}
2197
+ ${import_picocolors.default.gray(o)}`;
2198
+ default: return `${r$2}${import_picocolors.default.cyan(o)} ${G({
2199
+ cursor: this.cursor,
2200
+ options: this.options,
2201
+ maxItems: t$1.maxItems,
2202
+ style: (i$1, s$1) => n$1(i$1, s$1 ? "active" : "inactive")
2203
+ }).join(`
2204
+ ${import_picocolors.default.cyan(o)} `)}
2205
+ ${import_picocolors.default.cyan(d)}
2206
+ `;
2207
+ }
2208
+ }
2209
+ }).prompt();
2210
+ }, we = (t$1) => {
2211
+ const n$1 = (r$2, i$1 = "inactive") => {
2212
+ const s$1 = r$2.label ?? String(r$2.value);
2213
+ return i$1 === "selected" ? `${import_picocolors.default.dim(s$1)}` : i$1 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s$1))}` : i$1 === "active" ? `${import_picocolors.default.bgCyan(import_picocolors.default.gray(` ${r$2.value} `))} ${s$1} ${r$2.hint ? import_picocolors.default.dim(`(${r$2.hint})`) : ""}` : `${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(` ${r$2.value} `)))} ${s$1} ${r$2.hint ? import_picocolors.default.dim(`(${r$2.hint})`) : ""}`;
2214
+ };
2215
+ return new ID({
2216
+ options: t$1.options,
2217
+ initialValue: t$1.initialValue,
2218
+ render() {
2219
+ const r$2 = `${import_picocolors.default.gray(o)}
2220
+ ${b(this.state)} ${t$1.message}
2221
+ `;
2222
+ switch (this.state) {
2223
+ case "submit": return `${r$2}${import_picocolors.default.gray(o)} ${n$1(this.options.find((i$1) => i$1.value === this.value) ?? t$1.options[0], "selected")}`;
2224
+ case "cancel": return `${r$2}${import_picocolors.default.gray(o)} ${n$1(this.options[0], "cancelled")}
2225
+ ${import_picocolors.default.gray(o)}`;
2226
+ default: return `${r$2}${import_picocolors.default.cyan(o)} ${this.options.map((i$1, s$1) => n$1(i$1, s$1 === this.cursor ? "active" : "inactive")).join(`
2227
+ ${import_picocolors.default.cyan(o)} `)}
2228
+ ${import_picocolors.default.cyan(d)}
2229
+ `;
2230
+ }
2231
+ }
2232
+ }).prompt();
2233
+ }, fe = (t$1) => {
2234
+ const n$1 = (r$2, i$1) => {
2235
+ const s$1 = r$2.label ?? String(r$2.value);
2236
+ return i$1 === "active" ? `${import_picocolors.default.cyan(A)} ${s$1} ${r$2.hint ? import_picocolors.default.dim(`(${r$2.hint})`) : ""}` : i$1 === "selected" ? `${import_picocolors.default.green(T)} ${import_picocolors.default.dim(s$1)} ${r$2.hint ? import_picocolors.default.dim(`(${r$2.hint})`) : ""}` : i$1 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(s$1))}` : i$1 === "active-selected" ? `${import_picocolors.default.green(T)} ${s$1} ${r$2.hint ? import_picocolors.default.dim(`(${r$2.hint})`) : ""}` : i$1 === "submitted" ? `${import_picocolors.default.dim(s$1)}` : `${import_picocolors.default.dim(F)} ${import_picocolors.default.dim(s$1)}`;
2237
+ };
2238
+ return new SD({
2239
+ options: t$1.options,
2240
+ initialValues: t$1.initialValues,
2241
+ required: t$1.required ?? !0,
2242
+ cursorAt: t$1.cursorAt,
2243
+ validate(r$2) {
2244
+ if (this.required && r$2.length === 0) return `Please select at least one option.
2245
+ ${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`))}`;
2246
+ },
2247
+ render() {
2248
+ const r$2 = `${import_picocolors.default.gray(o)}
2249
+ ${b(this.state)} ${t$1.message}
2250
+ `, i$1 = (s$1, c$1) => {
2251
+ const a$1 = this.value.includes(s$1.value);
2252
+ return c$1 && a$1 ? n$1(s$1, "active-selected") : a$1 ? n$1(s$1, "selected") : n$1(s$1, c$1 ? "active" : "inactive");
2253
+ };
2254
+ switch (this.state) {
2255
+ case "submit": return `${r$2}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s$1 }) => this.value.includes(s$1)).map((s$1) => n$1(s$1, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`;
2256
+ case "cancel": {
2257
+ const s$1 = this.options.filter(({ value: c$1 }) => this.value.includes(c$1)).map((c$1) => n$1(c$1, "cancelled")).join(import_picocolors.default.dim(", "));
2258
+ return `${r$2}${import_picocolors.default.gray(o)} ${s$1.trim() ? `${s$1}
2259
+ ${import_picocolors.default.gray(o)}` : ""}`;
2260
+ }
2261
+ case "error": {
2262
+ const s$1 = this.error.split(`
2263
+ `).map((c$1, a$1) => a$1 === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c$1)}` : ` ${c$1}`).join(`
2264
+ `);
2265
+ return `${r$2 + import_picocolors.default.yellow(o)} ${G({
2266
+ options: this.options,
2267
+ cursor: this.cursor,
2268
+ maxItems: t$1.maxItems,
2269
+ style: i$1
2270
+ }).join(`
2271
+ ${import_picocolors.default.yellow(o)} `)}
2272
+ ${s$1}
2273
+ `;
2274
+ }
2275
+ default: return `${r$2}${import_picocolors.default.cyan(o)} ${G({
2276
+ options: this.options,
2277
+ cursor: this.cursor,
2278
+ maxItems: t$1.maxItems,
2279
+ style: i$1
2280
+ }).join(`
2281
+ ${import_picocolors.default.cyan(o)} `)}
2282
+ ${import_picocolors.default.cyan(d)}
2283
+ `;
2284
+ }
2285
+ }
2286
+ }).prompt();
2287
+ }, be = (t$1) => {
2288
+ const { selectableGroups: n$1 = !0 } = t$1, r$2 = (i$1, s$1, c$1 = []) => {
2289
+ const a$1 = i$1.label ?? String(i$1.value), l$2 = typeof i$1.group == "string", $$1 = l$2 && (c$1[c$1.indexOf(i$1) + 1] ?? { group: !0 }), g$2 = l$2 && $$1.group === !0, p$1 = l$2 ? n$1 ? `${g$2 ? d : o} ` : " " : "";
2290
+ if (s$1 === "active") return `${import_picocolors.default.dim(p$1)}${import_picocolors.default.cyan(A)} ${a$1} ${i$1.hint ? import_picocolors.default.dim(`(${i$1.hint})`) : ""}`;
2291
+ if (s$1 === "group-active") return `${p$1}${import_picocolors.default.cyan(A)} ${import_picocolors.default.dim(a$1)}`;
2292
+ if (s$1 === "group-active-selected") return `${p$1}${import_picocolors.default.green(T)} ${import_picocolors.default.dim(a$1)}`;
2293
+ if (s$1 === "selected") {
2294
+ const f$1 = l$2 || n$1 ? import_picocolors.default.green(T) : "";
2295
+ return `${import_picocolors.default.dim(p$1)}${f$1} ${import_picocolors.default.dim(a$1)} ${i$1.hint ? import_picocolors.default.dim(`(${i$1.hint})`) : ""}`;
2296
+ }
2297
+ if (s$1 === "cancelled") return `${import_picocolors.default.strikethrough(import_picocolors.default.dim(a$1))}`;
2298
+ if (s$1 === "active-selected") return `${import_picocolors.default.dim(p$1)}${import_picocolors.default.green(T)} ${a$1} ${i$1.hint ? import_picocolors.default.dim(`(${i$1.hint})`) : ""}`;
2299
+ if (s$1 === "submitted") return `${import_picocolors.default.dim(a$1)}`;
2300
+ const v$1 = l$2 || n$1 ? import_picocolors.default.dim(F) : "";
2301
+ return `${import_picocolors.default.dim(p$1)}${v$1} ${import_picocolors.default.dim(a$1)}`;
2302
+ };
2303
+ return new _D({
2304
+ options: t$1.options,
2305
+ initialValues: t$1.initialValues,
2306
+ required: t$1.required ?? !0,
2307
+ cursorAt: t$1.cursorAt,
2308
+ selectableGroups: n$1,
2309
+ validate(i$1) {
2310
+ if (this.required && i$1.length === 0) return `Please select at least one option.
2311
+ ${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`))}`;
2312
+ },
2313
+ render() {
2314
+ const i$1 = `${import_picocolors.default.gray(o)}
2315
+ ${b(this.state)} ${t$1.message}
2316
+ `;
2317
+ switch (this.state) {
2318
+ case "submit": return `${i$1}${import_picocolors.default.gray(o)} ${this.options.filter(({ value: s$1 }) => this.value.includes(s$1)).map((s$1) => r$2(s$1, "submitted")).join(import_picocolors.default.dim(", "))}`;
2319
+ case "cancel": {
2320
+ const s$1 = this.options.filter(({ value: c$1 }) => this.value.includes(c$1)).map((c$1) => r$2(c$1, "cancelled")).join(import_picocolors.default.dim(", "));
2321
+ return `${i$1}${import_picocolors.default.gray(o)} ${s$1.trim() ? `${s$1}
2322
+ ${import_picocolors.default.gray(o)}` : ""}`;
2323
+ }
2324
+ case "error": {
2325
+ const s$1 = this.error.split(`
2326
+ `).map((c$1, a$1) => a$1 === 0 ? `${import_picocolors.default.yellow(d)} ${import_picocolors.default.yellow(c$1)}` : ` ${c$1}`).join(`
2327
+ `);
2328
+ return `${i$1}${import_picocolors.default.yellow(o)} ${this.options.map((c$1, a$1, l$2) => {
2329
+ const $$1 = this.value.includes(c$1.value) || c$1.group === !0 && this.isGroupSelected(`${c$1.value}`), g$2 = a$1 === this.cursor;
2330
+ return !g$2 && typeof c$1.group == "string" && this.options[this.cursor].value === c$1.group ? r$2(c$1, $$1 ? "group-active-selected" : "group-active", l$2) : g$2 && $$1 ? r$2(c$1, "active-selected", l$2) : $$1 ? r$2(c$1, "selected", l$2) : r$2(c$1, g$2 ? "active" : "inactive", l$2);
2331
+ }).join(`
2332
+ ${import_picocolors.default.yellow(o)} `)}
2333
+ ${s$1}
2334
+ `;
2335
+ }
2336
+ default: return `${i$1}${import_picocolors.default.cyan(o)} ${this.options.map((s$1, c$1, a$1) => {
2337
+ const l$2 = this.value.includes(s$1.value) || s$1.group === !0 && this.isGroupSelected(`${s$1.value}`), $$1 = c$1 === this.cursor;
2338
+ return !$$1 && typeof s$1.group == "string" && this.options[this.cursor].value === s$1.group ? r$2(s$1, l$2 ? "group-active-selected" : "group-active", a$1) : $$1 && l$2 ? r$2(s$1, "active-selected", a$1) : l$2 ? r$2(s$1, "selected", a$1) : r$2(s$1, $$1 ? "active" : "inactive", a$1);
2339
+ }).join(`
2340
+ ${import_picocolors.default.cyan(o)} `)}
2341
+ ${import_picocolors.default.cyan(d)}
2342
+ `;
2343
+ }
2344
+ }
2345
+ }).prompt();
2346
+ }, Me = (t$1 = "", n$1 = "") => {
2347
+ const r$2 = `
2348
+ ${t$1}
2349
+ `.split(`
2350
+ `), i$1 = stripVTControlCharacters(n$1).length, s$1 = Math.max(r$2.reduce((a$1, l$2) => {
2351
+ const $$1 = stripVTControlCharacters(l$2);
2352
+ return $$1.length > a$1 ? $$1.length : a$1;
2353
+ }, 0), i$1) + 2, c$1 = r$2.map((a$1) => `${import_picocolors.default.gray(o)} ${import_picocolors.default.dim(a$1)}${" ".repeat(s$1 - stripVTControlCharacters(a$1).length)}${import_picocolors.default.gray(o)}`).join(`
2354
+ `);
2355
+ process.stdout.write(`${import_picocolors.default.gray(o)}
2356
+ ${import_picocolors.default.green(C)} ${import_picocolors.default.reset(n$1)} ${import_picocolors.default.gray(_.repeat(Math.max(s$1 - i$1 - 1, 1)) + me)}
2357
+ ${c$1}
2358
+ ${import_picocolors.default.gray(de + _.repeat(s$1 + 2) + pe)}
2359
+ `);
2360
+ }, xe = (t$1 = "") => {
2361
+ process.stdout.write(`${import_picocolors.default.gray(d)} ${import_picocolors.default.red(t$1)}
2362
+
2363
+ `);
2364
+ }, Ie = (t$1 = "") => {
2365
+ process.stdout.write(`${import_picocolors.default.gray(ue)} ${t$1}
2366
+ `);
2367
+ }, Se = (t$1 = "") => {
2368
+ process.stdout.write(`${import_picocolors.default.gray(o)}
2369
+ ${import_picocolors.default.gray(d)} ${t$1}
2370
+
2371
+ `);
2372
+ }, M = {
2373
+ message: (t$1 = "", { symbol: n$1 = import_picocolors.default.gray(o) } = {}) => {
2374
+ const r$2 = [`${import_picocolors.default.gray(o)}`];
2375
+ if (t$1) {
2376
+ const [i$1, ...s$1] = t$1.split(`
2377
+ `);
2378
+ r$2.push(`${n$1} ${i$1}`, ...s$1.map((c$1) => `${import_picocolors.default.gray(o)} ${c$1}`));
2379
+ }
2380
+ process.stdout.write(`${r$2.join(`
2381
+ `)}
2382
+ `);
2383
+ },
2384
+ info: (t$1) => {
2385
+ M.message(t$1, { symbol: import_picocolors.default.blue(q) });
2386
+ },
2387
+ success: (t$1) => {
2388
+ M.message(t$1, { symbol: import_picocolors.default.green(D) });
2389
+ },
2390
+ step: (t$1) => {
2391
+ M.message(t$1, { symbol: import_picocolors.default.green(C) });
2392
+ },
2393
+ warn: (t$1) => {
2394
+ M.message(t$1, { symbol: import_picocolors.default.yellow(U) });
2395
+ },
2396
+ warning: (t$1) => {
2397
+ M.warn(t$1);
2398
+ },
2399
+ error: (t$1) => {
2400
+ M.message(t$1, { symbol: import_picocolors.default.red(K) });
2401
+ }
2402
+ }, J = `${import_picocolors.default.gray(o)} `, x = {
2403
+ message: async (t$1, { symbol: n$1 = import_picocolors.default.gray(o) } = {}) => {
2404
+ process.stdout.write(`${import_picocolors.default.gray(o)}
2405
+ ${n$1} `);
2406
+ let r$2 = 3;
2407
+ for await (let i$1 of t$1) {
2408
+ i$1 = i$1.replace(/\n/g, `
2409
+ ${J}`), i$1.includes(`
2410
+ `) && (r$2 = 3 + stripVTControlCharacters(i$1.slice(i$1.lastIndexOf(`
2411
+ `))).length);
2412
+ const s$1 = stripVTControlCharacters(i$1).length;
2413
+ r$2 + s$1 < process.stdout.columns ? (r$2 += s$1, process.stdout.write(i$1)) : (process.stdout.write(`
2414
+ ${J}${i$1.trimStart()}`), r$2 = 3 + stripVTControlCharacters(i$1.trimStart()).length);
2415
+ }
2416
+ process.stdout.write(`
2417
+ `);
2418
+ },
2419
+ info: (t$1) => x.message(t$1, { symbol: import_picocolors.default.blue(q) }),
2420
+ success: (t$1) => x.message(t$1, { symbol: import_picocolors.default.green(D) }),
2421
+ step: (t$1) => x.message(t$1, { symbol: import_picocolors.default.green(C) }),
2422
+ warn: (t$1) => x.message(t$1, { symbol: import_picocolors.default.yellow(U) }),
2423
+ warning: (t$1) => x.warn(t$1),
2424
+ error: (t$1) => x.message(t$1, { symbol: import_picocolors.default.red(K) })
2425
+ }, Y = ({ indicator: t$1 = "dots" } = {}) => {
2426
+ const n$1 = V ? [
2427
+ "◒",
2428
+ "◐",
2429
+ "◓",
2430
+ "◑"
2431
+ ] : [
2432
+ "•",
2433
+ "o",
2434
+ "O",
2435
+ "0"
2436
+ ], r$2 = V ? 80 : 120, i$1 = process.env.CI === "true";
2437
+ let s$1, c$1, a$1 = !1, l$2 = "", $$1, g$2 = performance.now();
2438
+ const p$1 = (m$1) => {
2439
+ a$1 && N$2(m$1 > 1 ? "Something went wrong" : "Canceled", m$1);
2440
+ }, v$1 = () => p$1(2), f$1 = () => p$1(1), j = () => {
2441
+ process.on("uncaughtExceptionMonitor", v$1), process.on("unhandledRejection", v$1), process.on("SIGINT", f$1), process.on("SIGTERM", f$1), process.on("exit", p$1);
2442
+ }, E = () => {
2443
+ process.removeListener("uncaughtExceptionMonitor", v$1), process.removeListener("unhandledRejection", v$1), process.removeListener("SIGINT", f$1), process.removeListener("SIGTERM", f$1), process.removeListener("exit", p$1);
2444
+ }, B$1 = () => {
2445
+ if ($$1 === void 0) return;
2446
+ i$1 && process.stdout.write(`
2447
+ `);
2448
+ const m$1 = $$1.split(`
2449
+ `);
2450
+ process.stdout.write(import_src.cursor.move(-999, m$1.length - 1)), process.stdout.write(import_src.erase.down(m$1.length));
2451
+ }, R$2 = (m$1) => m$1.replace(/\.+$/, ""), O$2 = (m$1) => {
2452
+ const h$1 = (performance.now() - m$1) / 1e3, w$1 = Math.floor(h$1 / 60), I$2 = Math.floor(h$1 % 60);
2453
+ return w$1 > 0 ? `[${w$1}m ${I$2}s]` : `[${I$2}s]`;
2454
+ }, H$1 = (m$1 = "") => {
2455
+ a$1 = !0, s$1 = fD(), l$2 = R$2(m$1), g$2 = performance.now(), process.stdout.write(`${import_picocolors.default.gray(o)}
2456
+ `);
2457
+ let h$1 = 0, w$1 = 0;
2458
+ j(), c$1 = setInterval(() => {
2459
+ if (i$1 && l$2 === $$1) return;
2460
+ B$1(), $$1 = l$2;
2461
+ const I$2 = import_picocolors.default.magenta(n$1[h$1]);
2462
+ if (i$1) process.stdout.write(`${I$2} ${l$2}...`);
2463
+ else if (t$1 === "timer") process.stdout.write(`${I$2} ${l$2} ${O$2(g$2)}`);
2464
+ else {
2465
+ const z$1 = ".".repeat(Math.floor(w$1)).slice(0, 3);
2466
+ process.stdout.write(`${I$2} ${l$2}${z$1}`);
2467
+ }
2468
+ h$1 = h$1 + 1 < n$1.length ? h$1 + 1 : 0, w$1 = w$1 < n$1.length ? w$1 + .125 : 0;
2469
+ }, r$2);
2470
+ }, N$2 = (m$1 = "", h$1 = 0) => {
2471
+ a$1 = !1, clearInterval(c$1), B$1();
2472
+ const w$1 = h$1 === 0 ? import_picocolors.default.green(C) : h$1 === 1 ? import_picocolors.default.red(L) : import_picocolors.default.red(W);
2473
+ l$2 = R$2(m$1 ?? l$2), t$1 === "timer" ? process.stdout.write(`${w$1} ${l$2} ${O$2(g$2)}
2474
+ `) : process.stdout.write(`${w$1} ${l$2}
2475
+ `), E(), s$1();
2476
+ };
2477
+ return {
2478
+ start: H$1,
2479
+ stop: N$2,
2480
+ message: (m$1 = "") => {
2481
+ l$2 = R$2(m$1 ?? l$2);
2482
+ }
2483
+ };
2484
+ }, Ce = async (t$1, n$1) => {
2485
+ const r$2 = {}, i$1 = Object.keys(t$1);
2486
+ for (const s$1 of i$1) {
2487
+ const c$1 = t$1[s$1], a$1 = await c$1({ results: r$2 })?.catch((l$2) => {
2488
+ throw l$2;
2489
+ });
2490
+ if (typeof n$1?.onCancel == "function" && pD(a$1)) {
2491
+ r$2[s$1] = "canceled", n$1.onCancel({ results: r$2 });
2492
+ continue;
2493
+ }
2494
+ r$2[s$1] = a$1;
2495
+ }
2496
+ return r$2;
2497
+ }, Te = async (t$1) => {
2498
+ for (const n$1 of t$1) {
2499
+ if (n$1.enabled === !1) continue;
2500
+ const r$2 = Y();
2501
+ r$2.start(n$1.title);
2502
+ const i$1 = await n$1.task(r$2.message);
2503
+ r$2.stop(i$1 || n$1.title);
2504
+ }
2505
+ };
2506
+
2507
+ //#endregion
2508
+ //#region src/index.ts
2509
+ /**
2510
+ * create-pds - Create a new AT Protocol PDS on Cloudflare Workers
2511
+ */
2512
+ const __dirname = dirname(fileURLToPath(import.meta.url));
2513
+ function detectPackageManager() {
2514
+ const userAgent = process.env.npm_config_user_agent || "";
2515
+ if (userAgent.startsWith("yarn")) return "yarn";
2516
+ if (userAgent.startsWith("pnpm")) return "pnpm";
2517
+ if (userAgent.startsWith("bun")) return "bun";
2518
+ return "npm";
2519
+ }
2520
+ function runCommand(command, args, cwd) {
2521
+ return new Promise((resolve, reject) => {
2522
+ const child = spawn(command, args, {
2523
+ cwd,
2524
+ stdio: "inherit",
2525
+ shell: process.platform === "win32"
2526
+ });
2527
+ child.on("close", (code) => {
2528
+ if (code === 0) resolve();
2529
+ else reject(/* @__PURE__ */ new Error(`${command} ${args.join(" ")} failed with code ${code}`));
2530
+ });
2531
+ child.on("error", reject);
2532
+ });
2533
+ }
2534
+ async function copyTemplateDir(src, dest) {
2535
+ await mkdir(dest, { recursive: true });
2536
+ const entries = await readdir(src, { withFileTypes: true });
2537
+ for (const entry of entries) {
2538
+ const srcPath = join(src, entry.name);
2539
+ let destName = entry.name;
2540
+ if (destName === "gitignore") destName = ".gitignore";
2541
+ else if (destName === "env.example") destName = ".env.example";
2542
+ else if (destName.endsWith(".tmpl")) destName = destName.slice(0, -5);
2543
+ const destPath = join(dest, destName);
2544
+ if (entry.isDirectory()) await copyTemplateDir(srcPath, destPath);
2545
+ else await cp(srcPath, destPath);
2546
+ }
2547
+ }
2548
+ async function replaceInFile(filePath, replacements) {
2549
+ let content = await readFile(filePath, "utf-8");
2550
+ for (const [key, value] of Object.entries(replacements)) content = content.replaceAll(`{{${key}}}`, value);
2551
+ await writeFile(filePath, content);
2552
+ }
2553
+ runMain(defineCommand({
2554
+ meta: {
2555
+ name: "create-pds",
2556
+ version: "0.0.0",
2557
+ description: "Create a new AT Protocol PDS on Cloudflare Workers"
2558
+ },
2559
+ args: {
2560
+ name: {
2561
+ type: "positional",
2562
+ description: "Project name",
2563
+ required: false
2564
+ },
2565
+ "package-manager": {
2566
+ type: "string",
2567
+ alias: "pm",
2568
+ description: "Package manager to use (npm, yarn, pnpm, bun)"
2569
+ },
2570
+ "skip-install": {
2571
+ type: "boolean",
2572
+ description: "Skip installing dependencies",
2573
+ default: false
2574
+ },
2575
+ "skip-git": {
2576
+ type: "boolean",
2577
+ description: "Skip git initialization",
2578
+ default: false
2579
+ },
2580
+ "skip-init": {
2581
+ type: "boolean",
2582
+ description: "Skip running pds init",
2583
+ default: false
2584
+ },
2585
+ yes: {
2586
+ type: "boolean",
2587
+ alias: "y",
2588
+ description: "Accept all defaults (non-interactive mode)",
2589
+ default: false
2590
+ }
2591
+ },
2592
+ async run({ args }) {
2593
+ const nonInteractive = args.yes || !process.stdout.isTTY;
2594
+ Ie("Create PDS");
2595
+ M.warn("This is experimental software. Do not migrate your main Bluesky account yet.");
2596
+ if (!nonInteractive) Me("Use --yes to run non-interactively", "Tip");
2597
+ let projectName = args.name;
2598
+ if (!projectName) if (nonInteractive) projectName = "pds-worker";
2599
+ else {
2600
+ const result = await he({
2601
+ message: "Project name:",
2602
+ placeholder: "pds-worker",
2603
+ defaultValue: "pds-worker"
2604
+ });
2605
+ if (pD(result)) {
2606
+ xe("Cancelled");
2607
+ process.exit(0);
2608
+ }
2609
+ projectName = result || "pds-worker";
2610
+ }
2611
+ const targetDir = join(process.cwd(), projectName);
2612
+ if (existsSync(targetDir)) {
2613
+ if (nonInteractive) {
2614
+ M.error(`Directory ${projectName} already exists`);
2615
+ process.exit(1);
2616
+ }
2617
+ const overwrite = await ye({
2618
+ message: `Directory ${projectName} already exists. Overwrite?`,
2619
+ initialValue: false
2620
+ });
2621
+ if (pD(overwrite) || !overwrite) {
2622
+ xe("Cancelled");
2623
+ process.exit(0);
2624
+ }
2625
+ }
2626
+ const detectedPm = detectPackageManager();
2627
+ let pm = args["package-manager"] || detectedPm;
2628
+ if (!args["package-manager"] && !nonInteractive) {
2629
+ const pmResult = await ve({
2630
+ message: "Package manager:",
2631
+ initialValue: detectedPm,
2632
+ options: [
2633
+ {
2634
+ value: "pnpm",
2635
+ label: "pnpm"
2636
+ },
2637
+ {
2638
+ value: "npm",
2639
+ label: "npm"
2640
+ },
2641
+ {
2642
+ value: "yarn",
2643
+ label: "yarn"
2644
+ },
2645
+ {
2646
+ value: "bun",
2647
+ label: "bun"
2648
+ }
2649
+ ]
2650
+ });
2651
+ if (pD(pmResult)) {
2652
+ xe("Cancelled");
2653
+ process.exit(0);
2654
+ }
2655
+ pm = pmResult;
2656
+ }
2657
+ let initGit = !args["skip-git"];
2658
+ if (!args["skip-git"] && !nonInteractive) {
2659
+ const gitResult = await ye({
2660
+ message: "Initialize git repository?",
2661
+ initialValue: true
2662
+ });
2663
+ if (pD(gitResult)) {
2664
+ xe("Cancelled");
2665
+ process.exit(0);
2666
+ }
2667
+ initGit = gitResult;
2668
+ }
2669
+ const spinner = Y();
2670
+ spinner.start("Copying template...");
2671
+ await copyTemplateDir(join(__dirname, "..", "templates", "pds-worker"), targetDir);
2672
+ await replaceInFile(join(targetDir, "package.json"), { name: projectName });
2673
+ spinner.stop("Template copied");
2674
+ if (initGit) {
2675
+ spinner.start("Initializing git...");
2676
+ try {
2677
+ await runCommand("git", ["init"], targetDir);
2678
+ spinner.stop("Git initialized");
2679
+ } catch {
2680
+ spinner.stop("Failed to initialize git");
2681
+ }
2682
+ }
2683
+ if (!args["skip-install"]) {
2684
+ spinner.start(`Installing dependencies with ${pm}...`);
2685
+ try {
2686
+ await runCommand(pm, ["install"], targetDir);
2687
+ spinner.stop("Dependencies installed");
2688
+ } catch {
2689
+ spinner.stop("Failed to install dependencies");
2690
+ M.warning("You can install dependencies manually later");
2691
+ }
2692
+ }
2693
+ if (!args["skip-init"] && !args["skip-install"]) {
2694
+ M.info("Now let's configure your PDS for local development");
2695
+ try {
2696
+ await runCommand(pm, [
2697
+ "run",
2698
+ "pds",
2699
+ "init"
2700
+ ], targetDir);
2701
+ } catch {
2702
+ M.warning("Failed to run pds init. You can run it manually later:");
2703
+ M.info(` cd ${projectName} && ${pm}${pm === "npm" ? "run" : ""} pds init`);
2704
+ }
2705
+ }
2706
+ Me([
2707
+ `cd ${projectName}`,
2708
+ `${pm} dev`,
2709
+ "",
2710
+ "Your PDS will be running at http://localhost:5173"
2711
+ ].join("\n"), "Next steps");
2712
+ Se("Happy building!");
2713
+ }
2714
+ }));
2715
+
2716
+ //#endregion
2717
+ export { };