create-rstack 1.7.20 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +36 -6
- package/dist/index.js +825 -771
- package/dist/rslib-runtime.js +39 -0
- package/package.json +12 -12
- package/template-biome/package.json +1 -1
- package/template-eslint/react-js/package.json +4 -4
- package/template-eslint/react-ts/package.json +5 -5
- package/template-eslint/svelte-js/package.json +4 -4
- package/template-eslint/svelte-ts/package.json +5 -5
- package/template-eslint/vanilla-js/package.json +3 -3
- package/template-eslint/vanilla-ts/package.json +4 -4
- package/template-eslint/vue-js/package.json +4 -4
- package/template-eslint/vue-ts/package.json +4 -4
- package/template-prettier/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import * as __rspack_external_child_process from "child_process";
|
|
4
3
|
import * as __rspack_external_fs from "fs";
|
|
5
4
|
import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
|
|
6
5
|
import * as __rspack_external_node_fs_promises_153e37e0 from "node:fs/promises";
|
|
7
6
|
import * as __rspack_external_path from "path";
|
|
7
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
8
8
|
import node_path, { dirname } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import { stripVTControlCharacters } from "node:util";
|
|
11
10
|
import node_process, { stdin, stdout } from "node:process";
|
|
12
11
|
import node_readline from "node:readline";
|
|
13
|
-
import { Writable } from "node:stream";
|
|
14
|
-
import node_os from "node:os";
|
|
15
12
|
import node_tty from "node:tty";
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { styleText } from "node:util";
|
|
14
|
+
import node_os from "node:os";
|
|
15
|
+
__webpack_require__.add({
|
|
16
|
+
"./node_modules/.pnpm/@vercel+detect-agent@1.1.0/node_modules/@vercel/detect-agent/dist/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
18
17
|
var __defProp = Object.defineProperty;
|
|
19
18
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
19
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -53,6 +52,8 @@ var __webpack_modules__ = {
|
|
|
53
52
|
const REPLIT = "replit";
|
|
54
53
|
const GEMINI = "gemini";
|
|
55
54
|
const CODEX = "codex";
|
|
55
|
+
const AUGMENT_CLI = "augment-cli";
|
|
56
|
+
const OPENCODE = "opencode";
|
|
56
57
|
const KNOWN_AGENTS = {
|
|
57
58
|
CURSOR,
|
|
58
59
|
CURSOR_CLI,
|
|
@@ -60,7 +61,9 @@ var __webpack_modules__ = {
|
|
|
60
61
|
DEVIN,
|
|
61
62
|
REPLIT,
|
|
62
63
|
GEMINI,
|
|
63
|
-
CODEX
|
|
64
|
+
CODEX,
|
|
65
|
+
AUGMENT_CLI,
|
|
66
|
+
OPENCODE
|
|
64
67
|
};
|
|
65
68
|
async function determineAgent() {
|
|
66
69
|
if (process.env.AI_AGENT) {
|
|
@@ -96,6 +99,18 @@ var __webpack_modules__ = {
|
|
|
96
99
|
name: CODEX
|
|
97
100
|
}
|
|
98
101
|
};
|
|
102
|
+
if (process.env.AUGMENT_AGENT) return {
|
|
103
|
+
isAgent: true,
|
|
104
|
+
agent: {
|
|
105
|
+
name: AUGMENT_CLI
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
if (process.env.OPENCODE_CLIENT) return {
|
|
109
|
+
isAgent: true,
|
|
110
|
+
agent: {
|
|
111
|
+
name: OPENCODE
|
|
112
|
+
}
|
|
113
|
+
};
|
|
99
114
|
if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) return {
|
|
100
115
|
isAgent: true,
|
|
101
116
|
agent: {
|
|
@@ -123,7 +138,7 @@ var __webpack_modules__ = {
|
|
|
123
138
|
};
|
|
124
139
|
}
|
|
125
140
|
},
|
|
126
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"
|
|
141
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
127
142
|
const cp = __webpack_require__("child_process");
|
|
128
143
|
const parse = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js");
|
|
129
144
|
const enoent = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");
|
|
@@ -145,7 +160,7 @@ var __webpack_modules__ = {
|
|
|
145
160
|
module.exports._parse = parse;
|
|
146
161
|
module.exports._enoent = enoent;
|
|
147
162
|
},
|
|
148
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"
|
|
163
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js" (module) {
|
|
149
164
|
const isWin = 'win32' === process.platform;
|
|
150
165
|
function notFoundError(original, syscall) {
|
|
151
166
|
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
@@ -182,7 +197,7 @@ var __webpack_modules__ = {
|
|
|
182
197
|
notFoundError
|
|
183
198
|
};
|
|
184
199
|
},
|
|
185
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"
|
|
200
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
186
201
|
const path = __webpack_require__("path");
|
|
187
202
|
const resolveCommand = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js");
|
|
188
203
|
const escape = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js");
|
|
@@ -244,7 +259,7 @@ var __webpack_modules__ = {
|
|
|
244
259
|
}
|
|
245
260
|
module.exports = parse;
|
|
246
261
|
},
|
|
247
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"
|
|
262
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js" (module) {
|
|
248
263
|
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
249
264
|
function escapeCommand(arg) {
|
|
250
265
|
arg = arg.replace(metaCharsRegExp, '^$1');
|
|
@@ -262,7 +277,7 @@ var __webpack_modules__ = {
|
|
|
262
277
|
module.exports.command = escapeCommand;
|
|
263
278
|
module.exports.argument = escapeArgument;
|
|
264
279
|
},
|
|
265
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"
|
|
280
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
266
281
|
const fs = __webpack_require__("fs");
|
|
267
282
|
const shebangCommand = __webpack_require__("./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");
|
|
268
283
|
function readShebang(command) {
|
|
@@ -278,7 +293,7 @@ var __webpack_modules__ = {
|
|
|
278
293
|
}
|
|
279
294
|
module.exports = readShebang;
|
|
280
295
|
},
|
|
281
|
-
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"
|
|
296
|
+
"./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
282
297
|
const path = __webpack_require__("path");
|
|
283
298
|
const which = __webpack_require__("./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js");
|
|
284
299
|
const getPathKey = __webpack_require__("./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");
|
|
@@ -309,7 +324,7 @@ var __webpack_modules__ = {
|
|
|
309
324
|
}
|
|
310
325
|
module.exports = resolveCommand;
|
|
311
326
|
},
|
|
312
|
-
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js"
|
|
327
|
+
"./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
|
|
313
328
|
var isMergeableObject = function(value) {
|
|
314
329
|
return isNonNullObject(value) && !isSpecial(value);
|
|
315
330
|
};
|
|
@@ -392,7 +407,7 @@ var __webpack_modules__ = {
|
|
|
392
407
|
var deepmerge_1 = deepmerge;
|
|
393
408
|
module.exports = deepmerge_1;
|
|
394
409
|
},
|
|
395
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"
|
|
410
|
+
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
396
411
|
__webpack_require__("fs");
|
|
397
412
|
var core;
|
|
398
413
|
core = 'win32' === process.platform || global.TESTING_WINDOWS ? __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js") : __webpack_require__("./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js");
|
|
@@ -431,7 +446,7 @@ var __webpack_modules__ = {
|
|
|
431
446
|
}
|
|
432
447
|
}
|
|
433
448
|
},
|
|
434
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"
|
|
449
|
+
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
435
450
|
module.exports = isexe;
|
|
436
451
|
isexe.sync = sync;
|
|
437
452
|
var fs = __webpack_require__("fs");
|
|
@@ -460,7 +475,7 @@ var __webpack_modules__ = {
|
|
|
460
475
|
return ret;
|
|
461
476
|
}
|
|
462
477
|
},
|
|
463
|
-
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"
|
|
478
|
+
"./node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
464
479
|
module.exports = isexe;
|
|
465
480
|
isexe.sync = sync;
|
|
466
481
|
var fs = __webpack_require__("fs");
|
|
@@ -488,7 +503,7 @@ var __webpack_modules__ = {
|
|
|
488
503
|
return checkStat(fs.statSync(path), path, options);
|
|
489
504
|
}
|
|
490
505
|
},
|
|
491
|
-
"./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"
|
|
506
|
+
"./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js" (module) {
|
|
492
507
|
function hasKey(obj, keys) {
|
|
493
508
|
var o = obj;
|
|
494
509
|
keys.slice(0, -1).forEach(function(key) {
|
|
@@ -667,7 +682,7 @@ var __webpack_modules__ = {
|
|
|
667
682
|
return argv;
|
|
668
683
|
};
|
|
669
684
|
},
|
|
670
|
-
"./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"
|
|
685
|
+
"./node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js" (module) {
|
|
671
686
|
const pathKey = (options = {})=>{
|
|
672
687
|
const environment = options.env || process.env;
|
|
673
688
|
const platform = options.platform || process.platform;
|
|
@@ -677,7 +692,7 @@ var __webpack_modules__ = {
|
|
|
677
692
|
module.exports = pathKey;
|
|
678
693
|
module.exports["default"] = pathKey;
|
|
679
694
|
},
|
|
680
|
-
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"
|
|
695
|
+
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
681
696
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
682
697
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
683
698
|
let formatter = (open, close, replace = open)=>(input)=>{
|
|
@@ -743,7 +758,7 @@ var __webpack_modules__ = {
|
|
|
743
758
|
module.exports = createColors();
|
|
744
759
|
module.exports.createColors = createColors;
|
|
745
760
|
},
|
|
746
|
-
"./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"
|
|
761
|
+
"./node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
747
762
|
const shebangRegex = __webpack_require__("./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");
|
|
748
763
|
module.exports = (string = '')=>{
|
|
749
764
|
const match = string.match(shebangRegex);
|
|
@@ -754,10 +769,10 @@ var __webpack_modules__ = {
|
|
|
754
769
|
return argument ? `${binary} ${argument}` : binary;
|
|
755
770
|
};
|
|
756
771
|
},
|
|
757
|
-
"./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"
|
|
772
|
+
"./node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js" (module) {
|
|
758
773
|
module.exports = /^#!(.*)/;
|
|
759
774
|
},
|
|
760
|
-
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"
|
|
775
|
+
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js" (module) {
|
|
761
776
|
const ESC = '\x1B';
|
|
762
777
|
const CSI = `${ESC}[`;
|
|
763
778
|
const beep = '\u0007';
|
|
@@ -811,7 +826,7 @@ var __webpack_modules__ = {
|
|
|
811
826
|
beep
|
|
812
827
|
};
|
|
813
828
|
},
|
|
814
|
-
"./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"
|
|
829
|
+
"./node_modules/.pnpm/which@2.0.2/node_modules/which/which.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
815
830
|
const isWindows = 'win32' === process.platform || 'cygwin' === process.env.OSTYPE || 'msys' === process.env.OSTYPE;
|
|
816
831
|
const path = __webpack_require__("path");
|
|
817
832
|
const COLON = isWindows ? ';' : ':';
|
|
@@ -898,473 +913,178 @@ var __webpack_modules__ = {
|
|
|
898
913
|
module.exports = which;
|
|
899
914
|
which.sync = whichSync;
|
|
900
915
|
},
|
|
901
|
-
child_process
|
|
916
|
+
child_process (module) {
|
|
902
917
|
module.exports = __rspack_external_child_process;
|
|
903
918
|
},
|
|
904
|
-
fs
|
|
919
|
+
fs (module) {
|
|
905
920
|
module.exports = __rspack_external_fs;
|
|
906
921
|
},
|
|
907
|
-
"node:fs"
|
|
922
|
+
"node:fs" (module) {
|
|
908
923
|
module.exports = __rspack_external_node_fs_5ea92f0c;
|
|
909
924
|
},
|
|
910
|
-
"node:fs/promises"
|
|
925
|
+
"node:fs/promises" (module) {
|
|
911
926
|
module.exports = __rspack_external_node_fs_promises_153e37e0;
|
|
912
927
|
},
|
|
913
|
-
path
|
|
928
|
+
path (module) {
|
|
914
929
|
module.exports = __rspack_external_path;
|
|
915
930
|
}
|
|
916
|
-
};
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
920
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
921
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
922
|
-
exports: {}
|
|
923
|
-
};
|
|
924
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
925
|
-
return module.exports;
|
|
926
|
-
}
|
|
927
|
-
(()=>{
|
|
928
|
-
__webpack_require__.n = (module)=>{
|
|
929
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
930
|
-
__webpack_require__.d(getter, {
|
|
931
|
-
a: getter
|
|
932
|
-
});
|
|
933
|
-
return getter;
|
|
934
|
-
};
|
|
935
|
-
})();
|
|
936
|
-
(()=>{
|
|
937
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
938
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
939
|
-
enumerable: true,
|
|
940
|
-
get: definition[key]
|
|
941
|
-
});
|
|
942
|
-
};
|
|
943
|
-
})();
|
|
944
|
-
(()=>{
|
|
945
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
946
|
-
})();
|
|
947
|
-
var external_node_fs_ = __webpack_require__("node:fs");
|
|
948
|
-
var src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
949
|
-
var picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
931
|
+
});
|
|
932
|
+
const src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
933
|
+
const picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
950
934
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
}
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
function t(F) {
|
|
976
|
-
return F.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
977
|
-
}
|
|
978
|
-
u.length = function(F) {
|
|
979
|
-
for(var s = t(F), i = 0, D = 0; D < s.length; D++)i += this.characterLength(s[D]);
|
|
980
|
-
return i;
|
|
981
|
-
}, u.slice = function(F, s, i) {
|
|
982
|
-
textLen = u.length(F), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
|
|
983
|
-
for(var D = "", C = 0, n = t(F), E = 0; E < n.length; E++){
|
|
984
|
-
var a = n[E], o = u.length(a);
|
|
985
|
-
if (C >= s - (2 == o ? 1 : 0)) if (C + o <= i) D += a;
|
|
986
|
-
else break;
|
|
987
|
-
C += o;
|
|
988
|
-
}
|
|
989
|
-
return D;
|
|
990
|
-
};
|
|
991
|
-
})(W);
|
|
992
|
-
var tD = W.exports;
|
|
993
|
-
const eD = L(tD);
|
|
994
|
-
var FD = function() {
|
|
995
|
-
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;
|
|
996
|
-
};
|
|
997
|
-
const sD = L(FD);
|
|
998
|
-
function dist_p(e, u = {}) {
|
|
999
|
-
if ("string" != typeof e || 0 === e.length || (u = {
|
|
1000
|
-
ambiguousIsNarrow: !0,
|
|
1001
|
-
...u
|
|
1002
|
-
}, e = P(e), 0 === e.length)) return 0;
|
|
1003
|
-
e = e.replace(sD(), " ");
|
|
1004
|
-
const t = u.ambiguousIsNarrow ? 1 : 2;
|
|
1005
|
-
let F = 0;
|
|
1006
|
-
for (const s of e){
|
|
1007
|
-
const i = s.codePointAt(0);
|
|
1008
|
-
if (!(i <= 31) && (!(i >= 127) || !(i <= 159)) && (!(i >= 768) || !(i <= 879))) switch(eD.eastAsianWidth(s)){
|
|
1009
|
-
case "F":
|
|
1010
|
-
case "W":
|
|
1011
|
-
F += 2;
|
|
935
|
+
const dist_at = (t)=>161 === t || 164 === t || 167 === t || 168 === t || 170 === t || 173 === t || 174 === t || t >= 176 && t <= 180 || t >= 182 && t <= 186 || t >= 188 && t <= 191 || 198 === t || 208 === t || 215 === t || 216 === t || t >= 222 && t <= 225 || 230 === t || t >= 232 && t <= 234 || 236 === t || 237 === t || 240 === t || 242 === t || 243 === t || t >= 247 && t <= 250 || 252 === t || 254 === t || 257 === t || 273 === t || 275 === t || 283 === t || 294 === t || 295 === t || 299 === t || t >= 305 && t <= 307 || 312 === t || t >= 319 && t <= 322 || 324 === t || t >= 328 && t <= 331 || 333 === t || 338 === t || 339 === t || 358 === t || 359 === t || 363 === t || 462 === t || 464 === t || 466 === t || 468 === t || 470 === t || 472 === t || 474 === t || 476 === t || 593 === t || 609 === t || 708 === t || 711 === t || t >= 713 && t <= 715 || 717 === t || 720 === t || t >= 728 && t <= 731 || 733 === t || 735 === t || t >= 768 && t <= 879 || t >= 913 && t <= 929 || t >= 931 && t <= 937 || t >= 945 && t <= 961 || t >= 963 && t <= 969 || 1025 === t || t >= 1040 && t <= 1103 || 1105 === t || 8208 === t || t >= 8211 && t <= 8214 || 8216 === t || 8217 === t || 8220 === t || 8221 === t || t >= 8224 && t <= 8226 || t >= 8228 && t <= 8231 || 8240 === t || 8242 === t || 8243 === t || 8245 === t || 8251 === t || 8254 === t || 8308 === t || 8319 === t || t >= 8321 && t <= 8324 || 8364 === t || 8451 === t || 8453 === t || 8457 === t || 8467 === t || 8470 === t || 8481 === t || 8482 === t || 8486 === t || 8491 === t || 8531 === t || 8532 === t || t >= 8539 && t <= 8542 || t >= 8544 && t <= 8555 || t >= 8560 && t <= 8569 || 8585 === t || t >= 8592 && t <= 8601 || 8632 === t || 8633 === t || 8658 === t || 8660 === t || 8679 === t || 8704 === t || 8706 === t || 8707 === t || 8711 === t || 8712 === t || 8715 === t || 8719 === t || 8721 === t || 8725 === t || 8730 === t || t >= 8733 && t <= 8736 || 8739 === t || 8741 === t || t >= 8743 && t <= 8748 || 8750 === t || t >= 8756 && t <= 8759 || 8764 === t || 8765 === t || 8776 === t || 8780 === t || 8786 === t || 8800 === t || 8801 === t || t >= 8804 && t <= 8807 || 8810 === t || 8811 === t || 8814 === t || 8815 === t || 8834 === t || 8835 === t || 8838 === t || 8839 === t || 8853 === t || 8857 === t || 8869 === t || 8895 === t || 8978 === t || t >= 9312 && t <= 9449 || t >= 9451 && t <= 9547 || t >= 9552 && t <= 9587 || t >= 9600 && t <= 9615 || t >= 9618 && t <= 9621 || 9632 === t || 9633 === t || t >= 9635 && t <= 9641 || 9650 === t || 9651 === t || 9654 === t || 9655 === t || 9660 === t || 9661 === t || 9664 === t || 9665 === t || t >= 9670 && t <= 9672 || 9675 === t || t >= 9678 && t <= 9681 || t >= 9698 && t <= 9701 || 9711 === t || 9733 === t || 9734 === t || 9737 === t || 9742 === t || 9743 === t || 9756 === t || 9758 === t || 9792 === t || 9794 === t || 9824 === t || 9825 === t || t >= 9827 && t <= 9829 || t >= 9831 && t <= 9834 || 9836 === t || 9837 === t || 9839 === t || 9886 === t || 9887 === t || 9919 === t || t >= 9926 && t <= 9933 || t >= 9935 && t <= 9939 || t >= 9941 && t <= 9953 || 9955 === t || 9960 === t || 9961 === t || t >= 9963 && t <= 9969 || 9972 === t || t >= 9974 && t <= 9977 || 9979 === t || 9980 === t || 9982 === t || 9983 === t || 10045 === t || t >= 10102 && t <= 10111 || t >= 11094 && t <= 11097 || t >= 12872 && t <= 12879 || t >= 57344 && t <= 63743 || t >= 65024 && t <= 65039 || 65533 === t || t >= 127232 && t <= 127242 || t >= 127248 && t <= 127277 || t >= 127280 && t <= 127337 || t >= 127344 && t <= 127373 || 127375 === t || 127376 === t || t >= 127387 && t <= 127404 || t >= 917760 && t <= 917999 || t >= 983040 && t <= 1048573 || t >= 1048576 && t <= 1114109, dist_lt = (t)=>12288 === t || t >= 65281 && t <= 65376 || t >= 65504 && t <= 65510, ht = (t)=>t >= 4352 && t <= 4447 || 8986 === t || 8987 === t || 9001 === t || 9002 === t || t >= 9193 && t <= 9196 || 9200 === t || 9203 === t || 9725 === t || 9726 === t || 9748 === t || 9749 === t || t >= 9800 && t <= 9811 || 9855 === t || 9875 === t || 9889 === t || 9898 === t || 9899 === t || 9917 === t || 9918 === t || 9924 === t || 9925 === t || 9934 === t || 9940 === t || 9962 === t || 9970 === t || 9971 === t || 9973 === t || 9978 === t || 9981 === t || 9989 === t || 9994 === t || 9995 === t || 10024 === t || 10060 === t || 10062 === t || t >= 10067 && t <= 10069 || 10071 === t || t >= 10133 && t <= 10135 || 10160 === t || 10175 === t || 11035 === t || 11036 === t || 11088 === t || 11093 === t || t >= 11904 && t <= 11929 || t >= 11931 && t <= 12019 || t >= 12032 && t <= 12245 || t >= 12272 && t <= 12287 || t >= 12289 && t <= 12350 || t >= 12353 && t <= 12438 || t >= 12441 && t <= 12543 || t >= 12549 && t <= 12591 || t >= 12593 && t <= 12686 || t >= 12688 && t <= 12771 || t >= 12783 && t <= 12830 || t >= 12832 && t <= 12871 || t >= 12880 && t <= 19903 || t >= 19968 && t <= 42124 || t >= 42128 && t <= 42182 || t >= 43360 && t <= 43388 || t >= 44032 && t <= 55203 || t >= 63744 && t <= 64255 || t >= 65040 && t <= 65049 || t >= 65072 && t <= 65106 || t >= 65108 && t <= 65126 || t >= 65128 && t <= 65131 || t >= 94176 && t <= 94180 || 94192 === t || 94193 === t || t >= 94208 && t <= 100343 || t >= 100352 && t <= 101589 || t >= 101632 && t <= 101640 || t >= 110576 && t <= 110579 || t >= 110581 && t <= 110587 || 110589 === t || 110590 === t || t >= 110592 && t <= 110882 || 110898 === t || t >= 110928 && t <= 110930 || 110933 === t || t >= 110948 && t <= 110951 || t >= 110960 && t <= 111355 || 126980 === t || 127183 === t || 127374 === t || t >= 127377 && t <= 127386 || t >= 127488 && t <= 127490 || t >= 127504 && t <= 127547 || t >= 127552 && t <= 127560 || 127568 === t || 127569 === t || t >= 127584 && t <= 127589 || t >= 127744 && t <= 127776 || t >= 127789 && t <= 127797 || t >= 127799 && t <= 127868 || t >= 127870 && t <= 127891 || t >= 127904 && t <= 127946 || t >= 127951 && t <= 127955 || t >= 127968 && t <= 127984 || 127988 === t || t >= 127992 && t <= 128062 || 128064 === t || t >= 128066 && t <= 128252 || t >= 128255 && t <= 128317 || t >= 128331 && t <= 128334 || t >= 128336 && t <= 128359 || 128378 === t || 128405 === t || 128406 === t || 128420 === t || t >= 128507 && t <= 128591 || t >= 128640 && t <= 128709 || 128716 === t || t >= 128720 && t <= 128722 || t >= 128725 && t <= 128727 || t >= 128732 && t <= 128735 || 128747 === t || 128748 === t || t >= 128756 && t <= 128764 || t >= 128992 && t <= 129003 || 129008 === t || t >= 129292 && t <= 129338 || t >= 129340 && t <= 129349 || t >= 129351 && t <= 129535 || t >= 129648 && t <= 129660 || t >= 129664 && t <= 129672 || t >= 129680 && t <= 129725 || t >= 129727 && t <= 129733 || t >= 129742 && t <= 129755 || t >= 129760 && t <= 129768 || t >= 129776 && t <= 129784 || t >= 131072 && t <= 196605 || t >= 196608 && t <= 262141, dist_O = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, dist_y = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, M = /\t{1,1000}/y, P = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu, dist_L = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, dist_ct = /\p{M}+/gu, pt = {
|
|
936
|
+
limit: 1 / 0,
|
|
937
|
+
ellipsis: ""
|
|
938
|
+
}, dist_X = (t, e = {}, s = {})=>{
|
|
939
|
+
const i = e.limit ?? 1 / 0, r = e.ellipsis ?? "", n = e?.ellipsisWidth ?? (r ? dist_X(r, pt, s).width : 0), u = s.ansiWidth ?? 0, a = s.controlWidth ?? 0, l = s.tabWidth ?? 8, E = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, m = s.fullWidthWidth ?? 2, A = s.regularWidth ?? 1, V = s.wideWidth ?? 2;
|
|
940
|
+
let h = 0, o = 0, f = t.length, v = 0, F = !1, d = f, b = Math.max(0, i - n), C = 0, B = 0, c = 0, p = 0;
|
|
941
|
+
t: for(;;){
|
|
942
|
+
if (B > C || o >= f && o > h) {
|
|
943
|
+
const ut = t.slice(C, B) || t.slice(h, o);
|
|
944
|
+
v = 0;
|
|
945
|
+
for (const Y of ut.replaceAll(dist_ct, "")){
|
|
946
|
+
const $ = Y.codePointAt(0) || 0;
|
|
947
|
+
if (dist_lt($) ? p = m : ht($) ? p = V : E !== A && dist_at($) ? p = E : p = A, c + p > b && (d = Math.min(d, Math.max(C, h) + v)), c + p > i) {
|
|
948
|
+
F = !0;
|
|
949
|
+
break t;
|
|
950
|
+
}
|
|
951
|
+
v += Y.length, c += p;
|
|
952
|
+
}
|
|
953
|
+
C = B = 0;
|
|
954
|
+
}
|
|
955
|
+
if (o >= f) break;
|
|
956
|
+
if (dist_L.lastIndex = o, dist_L.test(t)) {
|
|
957
|
+
if (v = dist_L.lastIndex - o, p = v * A, c + p > b && (d = Math.min(d, o + Math.floor((b - c) / A))), c + p > i) {
|
|
958
|
+
F = !0;
|
|
1012
959
|
break;
|
|
1013
|
-
|
|
1014
|
-
|
|
960
|
+
}
|
|
961
|
+
c += p, C = h, B = o, o = h = dist_L.lastIndex;
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
if (dist_O.lastIndex = o, dist_O.test(t)) {
|
|
965
|
+
if (c + u > b && (d = Math.min(d, o)), c + u > i) {
|
|
966
|
+
F = !0;
|
|
1015
967
|
break;
|
|
1016
|
-
|
|
1017
|
-
|
|
968
|
+
}
|
|
969
|
+
c += u, C = h, B = o, o = h = dist_O.lastIndex;
|
|
970
|
+
continue;
|
|
1018
971
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
0
|
|
1027
|
-
],
|
|
1028
|
-
bold: [
|
|
1029
|
-
1,
|
|
1030
|
-
22
|
|
1031
|
-
],
|
|
1032
|
-
dim: [
|
|
1033
|
-
2,
|
|
1034
|
-
22
|
|
1035
|
-
],
|
|
1036
|
-
italic: [
|
|
1037
|
-
3,
|
|
1038
|
-
23
|
|
1039
|
-
],
|
|
1040
|
-
underline: [
|
|
1041
|
-
4,
|
|
1042
|
-
24
|
|
1043
|
-
],
|
|
1044
|
-
overline: [
|
|
1045
|
-
53,
|
|
1046
|
-
55
|
|
1047
|
-
],
|
|
1048
|
-
inverse: [
|
|
1049
|
-
7,
|
|
1050
|
-
27
|
|
1051
|
-
],
|
|
1052
|
-
hidden: [
|
|
1053
|
-
8,
|
|
1054
|
-
28
|
|
1055
|
-
],
|
|
1056
|
-
strikethrough: [
|
|
1057
|
-
9,
|
|
1058
|
-
29
|
|
1059
|
-
]
|
|
1060
|
-
},
|
|
1061
|
-
color: {
|
|
1062
|
-
black: [
|
|
1063
|
-
30,
|
|
1064
|
-
39
|
|
1065
|
-
],
|
|
1066
|
-
red: [
|
|
1067
|
-
31,
|
|
1068
|
-
39
|
|
1069
|
-
],
|
|
1070
|
-
green: [
|
|
1071
|
-
32,
|
|
1072
|
-
39
|
|
1073
|
-
],
|
|
1074
|
-
yellow: [
|
|
1075
|
-
33,
|
|
1076
|
-
39
|
|
1077
|
-
],
|
|
1078
|
-
blue: [
|
|
1079
|
-
34,
|
|
1080
|
-
39
|
|
1081
|
-
],
|
|
1082
|
-
magenta: [
|
|
1083
|
-
35,
|
|
1084
|
-
39
|
|
1085
|
-
],
|
|
1086
|
-
cyan: [
|
|
1087
|
-
36,
|
|
1088
|
-
39
|
|
1089
|
-
],
|
|
1090
|
-
white: [
|
|
1091
|
-
37,
|
|
1092
|
-
39
|
|
1093
|
-
],
|
|
1094
|
-
blackBright: [
|
|
1095
|
-
90,
|
|
1096
|
-
39
|
|
1097
|
-
],
|
|
1098
|
-
gray: [
|
|
1099
|
-
90,
|
|
1100
|
-
39
|
|
1101
|
-
],
|
|
1102
|
-
grey: [
|
|
1103
|
-
90,
|
|
1104
|
-
39
|
|
1105
|
-
],
|
|
1106
|
-
redBright: [
|
|
1107
|
-
91,
|
|
1108
|
-
39
|
|
1109
|
-
],
|
|
1110
|
-
greenBright: [
|
|
1111
|
-
92,
|
|
1112
|
-
39
|
|
1113
|
-
],
|
|
1114
|
-
yellowBright: [
|
|
1115
|
-
93,
|
|
1116
|
-
39
|
|
1117
|
-
],
|
|
1118
|
-
blueBright: [
|
|
1119
|
-
94,
|
|
1120
|
-
39
|
|
1121
|
-
],
|
|
1122
|
-
magentaBright: [
|
|
1123
|
-
95,
|
|
1124
|
-
39
|
|
1125
|
-
],
|
|
1126
|
-
cyanBright: [
|
|
1127
|
-
96,
|
|
1128
|
-
39
|
|
1129
|
-
],
|
|
1130
|
-
whiteBright: [
|
|
1131
|
-
97,
|
|
1132
|
-
39
|
|
1133
|
-
]
|
|
1134
|
-
},
|
|
1135
|
-
bgColor: {
|
|
1136
|
-
bgBlack: [
|
|
1137
|
-
40,
|
|
1138
|
-
49
|
|
1139
|
-
],
|
|
1140
|
-
bgRed: [
|
|
1141
|
-
41,
|
|
1142
|
-
49
|
|
1143
|
-
],
|
|
1144
|
-
bgGreen: [
|
|
1145
|
-
42,
|
|
1146
|
-
49
|
|
1147
|
-
],
|
|
1148
|
-
bgYellow: [
|
|
1149
|
-
43,
|
|
1150
|
-
49
|
|
1151
|
-
],
|
|
1152
|
-
bgBlue: [
|
|
1153
|
-
44,
|
|
1154
|
-
49
|
|
1155
|
-
],
|
|
1156
|
-
bgMagenta: [
|
|
1157
|
-
45,
|
|
1158
|
-
49
|
|
1159
|
-
],
|
|
1160
|
-
bgCyan: [
|
|
1161
|
-
46,
|
|
1162
|
-
49
|
|
1163
|
-
],
|
|
1164
|
-
bgWhite: [
|
|
1165
|
-
47,
|
|
1166
|
-
49
|
|
1167
|
-
],
|
|
1168
|
-
bgBlackBright: [
|
|
1169
|
-
100,
|
|
1170
|
-
49
|
|
1171
|
-
],
|
|
1172
|
-
bgGray: [
|
|
1173
|
-
100,
|
|
1174
|
-
49
|
|
1175
|
-
],
|
|
1176
|
-
bgGrey: [
|
|
1177
|
-
100,
|
|
1178
|
-
49
|
|
1179
|
-
],
|
|
1180
|
-
bgRedBright: [
|
|
1181
|
-
101,
|
|
1182
|
-
49
|
|
1183
|
-
],
|
|
1184
|
-
bgGreenBright: [
|
|
1185
|
-
102,
|
|
1186
|
-
49
|
|
1187
|
-
],
|
|
1188
|
-
bgYellowBright: [
|
|
1189
|
-
103,
|
|
1190
|
-
49
|
|
1191
|
-
],
|
|
1192
|
-
bgBlueBright: [
|
|
1193
|
-
104,
|
|
1194
|
-
49
|
|
1195
|
-
],
|
|
1196
|
-
bgMagentaBright: [
|
|
1197
|
-
105,
|
|
1198
|
-
49
|
|
1199
|
-
],
|
|
1200
|
-
bgCyanBright: [
|
|
1201
|
-
106,
|
|
1202
|
-
49
|
|
1203
|
-
],
|
|
1204
|
-
bgWhiteBright: [
|
|
1205
|
-
107,
|
|
1206
|
-
49
|
|
1207
|
-
]
|
|
1208
|
-
}
|
|
1209
|
-
};
|
|
1210
|
-
Object.keys(dist_r.modifier);
|
|
1211
|
-
const iD = Object.keys(dist_r.color), CD = Object.keys(dist_r.bgColor);
|
|
1212
|
-
[
|
|
1213
|
-
...iD,
|
|
1214
|
-
...CD
|
|
1215
|
-
];
|
|
1216
|
-
function rD() {
|
|
1217
|
-
const e = new Map;
|
|
1218
|
-
for (const [u, t] of Object.entries(dist_r)){
|
|
1219
|
-
for (const [F, s] of Object.entries(t))dist_r[F] = {
|
|
1220
|
-
open: `\x1B[${s[0]}m`,
|
|
1221
|
-
close: `\x1B[${s[1]}m`
|
|
1222
|
-
}, t[F] = dist_r[F], e.set(s[0], s[1]);
|
|
1223
|
-
Object.defineProperty(dist_r, u, {
|
|
1224
|
-
value: t,
|
|
1225
|
-
enumerable: !1
|
|
1226
|
-
});
|
|
1227
|
-
}
|
|
1228
|
-
return Object.defineProperty(dist_r, "codes", {
|
|
1229
|
-
value: e,
|
|
1230
|
-
enumerable: !1
|
|
1231
|
-
}), dist_r.color.close = "\x1B[39m", dist_r.bgColor.close = "\x1B[49m", dist_r.color.ansi = dist_N(), dist_r.color.ansi256 = dist_I(), dist_r.color.ansi16m = dist_R(), dist_r.bgColor.ansi = dist_N(dist_w), dist_r.bgColor.ansi256 = dist_I(dist_w), dist_r.bgColor.ansi16m = dist_R(dist_w), Object.defineProperties(dist_r, {
|
|
1232
|
-
rgbToAnsi256: {
|
|
1233
|
-
value: (u, t, F)=>u === t && t === F ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F / 255 * 5),
|
|
1234
|
-
enumerable: !1
|
|
1235
|
-
},
|
|
1236
|
-
hexToRgb: {
|
|
1237
|
-
value: (u)=>{
|
|
1238
|
-
const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
|
|
1239
|
-
if (!t) return [
|
|
1240
|
-
0,
|
|
1241
|
-
0,
|
|
1242
|
-
0
|
|
1243
|
-
];
|
|
1244
|
-
let [F] = t;
|
|
1245
|
-
3 === F.length && (F = [
|
|
1246
|
-
...F
|
|
1247
|
-
].map((i)=>i + i).join(""));
|
|
1248
|
-
const s = Number.parseInt(F, 16);
|
|
1249
|
-
return [
|
|
1250
|
-
s >> 16 & 255,
|
|
1251
|
-
s >> 8 & 255,
|
|
1252
|
-
255 & s
|
|
1253
|
-
];
|
|
1254
|
-
},
|
|
1255
|
-
enumerable: !1
|
|
1256
|
-
},
|
|
1257
|
-
hexToAnsi256: {
|
|
1258
|
-
value: (u)=>dist_r.rgbToAnsi256(...dist_r.hexToRgb(u)),
|
|
1259
|
-
enumerable: !1
|
|
1260
|
-
},
|
|
1261
|
-
ansi256ToAnsi: {
|
|
1262
|
-
value: (u)=>{
|
|
1263
|
-
if (u < 8) return 30 + u;
|
|
1264
|
-
if (u < 16) return 90 + (u - 8);
|
|
1265
|
-
let t, F, s;
|
|
1266
|
-
if (u >= 232) t = ((u - 232) * 10 + 8) / 255, F = t, s = t;
|
|
1267
|
-
else {
|
|
1268
|
-
u -= 16;
|
|
1269
|
-
const C = u % 36;
|
|
1270
|
-
t = Math.floor(u / 36) / 5, F = Math.floor(C / 6) / 5, s = C % 6 / 5;
|
|
1271
|
-
}
|
|
1272
|
-
const i = 2 * Math.max(t, F, s);
|
|
1273
|
-
if (0 === i) return 30;
|
|
1274
|
-
let D = 30 + (Math.round(s) << 2 | Math.round(F) << 1 | Math.round(t));
|
|
1275
|
-
return 2 === i && (D += 60), D;
|
|
1276
|
-
},
|
|
1277
|
-
enumerable: !1
|
|
1278
|
-
},
|
|
1279
|
-
rgbToAnsi: {
|
|
1280
|
-
value: (u, t, F)=>dist_r.ansi256ToAnsi(dist_r.rgbToAnsi256(u, t, F)),
|
|
1281
|
-
enumerable: !1
|
|
1282
|
-
},
|
|
1283
|
-
hexToAnsi: {
|
|
1284
|
-
value: (u)=>dist_r.ansi256ToAnsi(dist_r.hexToAnsi256(u)),
|
|
1285
|
-
enumerable: !1
|
|
972
|
+
if (dist_y.lastIndex = o, dist_y.test(t)) {
|
|
973
|
+
if (v = dist_y.lastIndex - o, p = v * a, c + p > b && (d = Math.min(d, o + Math.floor((b - c) / a))), c + p > i) {
|
|
974
|
+
F = !0;
|
|
975
|
+
break;
|
|
976
|
+
}
|
|
977
|
+
c += p, C = h, B = o, o = h = dist_y.lastIndex;
|
|
978
|
+
continue;
|
|
1286
979
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
980
|
+
if (M.lastIndex = o, M.test(t)) {
|
|
981
|
+
if (v = M.lastIndex - o, p = v * l, c + p > b && (d = Math.min(d, o + Math.floor((b - c) / l))), c + p > i) {
|
|
982
|
+
F = !0;
|
|
983
|
+
break;
|
|
984
|
+
}
|
|
985
|
+
c += p, C = h, B = o, o = h = M.lastIndex;
|
|
986
|
+
continue;
|
|
987
|
+
}
|
|
988
|
+
if (P.lastIndex = o, P.test(t)) {
|
|
989
|
+
if (c + g > b && (d = Math.min(d, o)), c + g > i) {
|
|
990
|
+
F = !0;
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
c += g, C = h, B = o, o = h = P.lastIndex;
|
|
1301
994
|
continue;
|
|
1302
995
|
}
|
|
1303
|
-
|
|
996
|
+
o += 1;
|
|
1304
997
|
}
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
},
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
998
|
+
return {
|
|
999
|
+
width: F ? b : c,
|
|
1000
|
+
index: F ? d : f,
|
|
1001
|
+
truncated: F,
|
|
1002
|
+
ellipsed: F && i >= n
|
|
1003
|
+
};
|
|
1004
|
+
}, ft = {
|
|
1005
|
+
limit: 1 / 0,
|
|
1006
|
+
ellipsis: "",
|
|
1007
|
+
ellipsisWidth: 0
|
|
1008
|
+
}, dist_S = (t, e = {})=>dist_X(t, ft, e).width, dist_W = "\x1B", dist_Z = "\x9B", Ft = 39, dist_j = "\x07", Q = "[", dist_dt = "]", dist_tt = "m", dist_U = `${dist_dt}8;;`, et = new RegExp(`(?:\\${Q}(?<code>\\d+)m|\\${dist_U}(?<uri>.*)${dist_j})`, "y"), mt = (t)=>{
|
|
1009
|
+
if (t >= 30 && t <= 37 || t >= 90 && t <= 97) return 39;
|
|
1010
|
+
if (t >= 40 && t <= 47 || t >= 100 && t <= 107) return 49;
|
|
1011
|
+
if (1 === t || 2 === t) return 22;
|
|
1012
|
+
if (3 === t) return 23;
|
|
1013
|
+
if (4 === t) return 24;
|
|
1014
|
+
if (7 === t) return 27;
|
|
1015
|
+
if (8 === t) return 28;
|
|
1016
|
+
if (9 === t) return 29;
|
|
1017
|
+
if (0 === t) return 0;
|
|
1018
|
+
}, dist_st = (t)=>`${dist_W}${Q}${t}${dist_tt}`, it = (t)=>`${dist_W}${dist_U}${t}${dist_j}`, gt = (t)=>t.map((e)=>dist_S(e)), G = (t, e, s)=>{
|
|
1019
|
+
const i = e[Symbol.iterator]();
|
|
1020
|
+
let r = !1, n = !1, u = t.at(-1), a = void 0 === u ? 0 : dist_S(u), l = i.next(), E = i.next(), g = 0;
|
|
1021
|
+
for(; !l.done;){
|
|
1022
|
+
const m = l.value, A = dist_S(m);
|
|
1023
|
+
a + A <= s ? t[t.length - 1] += m : (t.push(m), a = 0), (m === dist_W || m === dist_Z) && (r = !0, n = e.startsWith(dist_U, g + 1)), r ? n ? m === dist_j && (r = !1, n = !1) : m === dist_tt && (r = !1) : (a += A, a !== s || E.done || (t.push(""), a = 0)), l = E, E = i.next(), g += m.length;
|
|
1024
|
+
}
|
|
1025
|
+
u = t.at(-1), !a && void 0 !== u && u.length > 0 && t.length > 1 && (t[t.length - 2] += t.pop());
|
|
1026
|
+
}, vt = (t)=>{
|
|
1027
|
+
const e = t.split(" ");
|
|
1028
|
+
let s = e.length;
|
|
1029
|
+
for(; s > 0 && !(dist_S(e[s - 1]) > 0);)s--;
|
|
1030
|
+
return s === e.length ? t : e.slice(0, s).join(" ") + e.slice(s).join("");
|
|
1031
|
+
}, Et = (t, e, s = {})=>{
|
|
1032
|
+
if (!1 !== s.trim && "" === t.trim()) return "";
|
|
1033
|
+
let i = "", r, n;
|
|
1034
|
+
const u = t.split(" "), a = gt(u);
|
|
1035
|
+
let l = [
|
|
1316
1036
|
""
|
|
1317
1037
|
];
|
|
1318
|
-
for (const [
|
|
1319
|
-
!1 !==
|
|
1320
|
-
let
|
|
1321
|
-
if (0 !==
|
|
1322
|
-
const
|
|
1323
|
-
Math.floor((
|
|
1038
|
+
for (const [h, o] of u.entries()){
|
|
1039
|
+
!1 !== s.trim && (l[l.length - 1] = (l.at(-1) ?? "").trimStart());
|
|
1040
|
+
let f = dist_S(l.at(-1) ?? "");
|
|
1041
|
+
if (0 !== h && (f >= e && (!1 === s.wordWrap || !1 === s.trim) && (l.push(""), f = 0), (f > 0 || !1 === s.trim) && (l[l.length - 1] += " ", f++)), s.hard && a[h] > e) {
|
|
1042
|
+
const v = e - f, F = 1 + Math.floor((a[h] - v - 1) / e);
|
|
1043
|
+
Math.floor((a[h] - 1) / e) < F && l.push(""), G(l, o, e);
|
|
1324
1044
|
continue;
|
|
1325
1045
|
}
|
|
1326
|
-
if (
|
|
1327
|
-
if (!1 ===
|
|
1328
|
-
|
|
1046
|
+
if (f + a[h] > e && f > 0 && a[h] > 0) {
|
|
1047
|
+
if (!1 === s.wordWrap && f < e) {
|
|
1048
|
+
G(l, o, e);
|
|
1329
1049
|
continue;
|
|
1330
1050
|
}
|
|
1331
|
-
|
|
1051
|
+
l.push("");
|
|
1332
1052
|
}
|
|
1333
|
-
if (
|
|
1334
|
-
|
|
1053
|
+
if (f + a[h] > e && !1 === s.wordWrap) {
|
|
1054
|
+
G(l, o, e);
|
|
1335
1055
|
continue;
|
|
1336
1056
|
}
|
|
1337
|
-
|
|
1057
|
+
l[l.length - 1] += o;
|
|
1338
1058
|
}
|
|
1339
|
-
!1 !==
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
if (
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
`
|
|
1357
|
-
` && (s && o && (F += dist_z(s)), i && (F += K(i)));
|
|
1059
|
+
!1 !== s.trim && (l = l.map((h)=>vt(h)));
|
|
1060
|
+
const E = l.join(`
|
|
1061
|
+
`), g = E[Symbol.iterator]();
|
|
1062
|
+
let m = g.next(), A = g.next(), V = 0;
|
|
1063
|
+
for(; !m.done;){
|
|
1064
|
+
const h = m.value, o = A.value;
|
|
1065
|
+
if (i += h, h === dist_W || h === dist_Z) {
|
|
1066
|
+
et.lastIndex = V + 1;
|
|
1067
|
+
const F = et.exec(E)?.groups;
|
|
1068
|
+
if (F?.code !== void 0) {
|
|
1069
|
+
const d = Number.parseFloat(F.code);
|
|
1070
|
+
r = d === Ft ? void 0 : d;
|
|
1071
|
+
} else F?.uri !== void 0 && (n = 0 === F.uri.length ? void 0 : F.uri);
|
|
1072
|
+
}
|
|
1073
|
+
const f = r ? mt(r) : void 0;
|
|
1074
|
+
o === `
|
|
1075
|
+
` ? (n && (i += it("")), r && f && (i += dist_st(f))) : h === `
|
|
1076
|
+
` && (r && f && (i += dist_st(r)), n && (i += it(n))), V += h.length, m = A, A = g.next();
|
|
1358
1077
|
}
|
|
1359
|
-
return
|
|
1078
|
+
return i;
|
|
1360
1079
|
};
|
|
1361
|
-
function
|
|
1362
|
-
return String(
|
|
1080
|
+
function K(t, e, s) {
|
|
1081
|
+
return String(t).normalize().replaceAll(`\r
|
|
1082
|
+
`, `
|
|
1363
1083
|
`).split(`
|
|
1364
|
-
`).map((
|
|
1084
|
+
`).map((i)=>Et(i, e, s)).join(`
|
|
1365
1085
|
`);
|
|
1366
1086
|
}
|
|
1367
|
-
const
|
|
1087
|
+
const At = [
|
|
1368
1088
|
"up",
|
|
1369
1089
|
"down",
|
|
1370
1090
|
"left",
|
|
@@ -1372,8 +1092,8 @@ const xD = [
|
|
|
1372
1092
|
"space",
|
|
1373
1093
|
"enter",
|
|
1374
1094
|
"cancel"
|
|
1375
|
-
],
|
|
1376
|
-
actions: new Set(
|
|
1095
|
+
], dist_ = {
|
|
1096
|
+
actions: new Set(At),
|
|
1377
1097
|
aliases: new Map([
|
|
1378
1098
|
[
|
|
1379
1099
|
"k",
|
|
@@ -1399,170 +1119,249 @@ const xD = [
|
|
|
1399
1119
|
"escape",
|
|
1400
1120
|
"cancel"
|
|
1401
1121
|
]
|
|
1402
|
-
])
|
|
1122
|
+
]),
|
|
1123
|
+
messages: {
|
|
1124
|
+
cancel: "Canceled",
|
|
1125
|
+
error: "Something went wrong"
|
|
1126
|
+
},
|
|
1127
|
+
withGuide: !0
|
|
1403
1128
|
};
|
|
1404
|
-
function
|
|
1405
|
-
if ("string" == typeof
|
|
1406
|
-
for (const
|
|
1129
|
+
function H(t, e) {
|
|
1130
|
+
if ("string" == typeof t) return dist_.aliases.get(t) === e;
|
|
1131
|
+
for (const s of t)if (void 0 !== s && H(s, e)) return !0;
|
|
1407
1132
|
return !1;
|
|
1408
1133
|
}
|
|
1409
|
-
function
|
|
1410
|
-
if (
|
|
1411
|
-
const
|
|
1412
|
-
`),
|
|
1413
|
-
`), s = [];
|
|
1414
|
-
for(let
|
|
1415
|
-
return
|
|
1134
|
+
function _t(t, e) {
|
|
1135
|
+
if (t === e) return;
|
|
1136
|
+
const s = t.split(`
|
|
1137
|
+
`), i = e.split(`
|
|
1138
|
+
`), r = Math.max(s.length, i.length), n = [];
|
|
1139
|
+
for(let u = 0; u < r; u++)s[u] !== i[u] && n.push(u);
|
|
1140
|
+
return {
|
|
1141
|
+
lines: n,
|
|
1142
|
+
numLinesBefore: s.length,
|
|
1143
|
+
numLinesAfter: i.length,
|
|
1144
|
+
numLines: r
|
|
1145
|
+
};
|
|
1416
1146
|
}
|
|
1417
1147
|
globalThis.process.platform.startsWith("win");
|
|
1418
|
-
const
|
|
1419
|
-
function
|
|
1420
|
-
return
|
|
1148
|
+
const z = Symbol("clack:cancel");
|
|
1149
|
+
function Ct(t) {
|
|
1150
|
+
return t === z;
|
|
1421
1151
|
}
|
|
1422
|
-
function
|
|
1423
|
-
const
|
|
1424
|
-
|
|
1152
|
+
function dist_T(t, e) {
|
|
1153
|
+
const s = t;
|
|
1154
|
+
s.isTTY && s.setRawMode(e);
|
|
1155
|
+
}
|
|
1156
|
+
const dist_rt = (t)=>"columns" in t && "number" == typeof t.columns ? t.columns : 80, dist_nt = (t)=>"rows" in t && "number" == typeof t.rows ? t.rows : 20;
|
|
1157
|
+
function Bt(t, e, s, i = s) {
|
|
1158
|
+
const r = dist_rt(t ?? stdout);
|
|
1159
|
+
return K(e, r - s.length, {
|
|
1160
|
+
hard: !0,
|
|
1161
|
+
trim: !1
|
|
1162
|
+
}).split(`
|
|
1163
|
+
`).map((n, u)=>`${0 === u ? i : s}${n}`).join(`
|
|
1164
|
+
`);
|
|
1425
1165
|
}
|
|
1426
|
-
var gD = Object.defineProperty, vD = (e, u, t)=>u in e ? gD(e, u, {
|
|
1427
|
-
enumerable: !0,
|
|
1428
|
-
configurable: !0,
|
|
1429
|
-
writable: !0,
|
|
1430
|
-
value: t
|
|
1431
|
-
}) : e[u] = t, dist_h = (e, u, t)=>(vD(e, "symbol" != typeof u ? u + "" : u, t), t);
|
|
1432
1166
|
class x {
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1167
|
+
input;
|
|
1168
|
+
output;
|
|
1169
|
+
_abortSignal;
|
|
1170
|
+
rl;
|
|
1171
|
+
opts;
|
|
1172
|
+
_render;
|
|
1173
|
+
_track = !1;
|
|
1174
|
+
_prevFrame = "";
|
|
1175
|
+
_subscribers = new Map;
|
|
1176
|
+
_cursor = 0;
|
|
1177
|
+
state = "initial";
|
|
1178
|
+
error = "";
|
|
1179
|
+
value;
|
|
1180
|
+
userInput = "";
|
|
1181
|
+
constructor(e, s = !0){
|
|
1182
|
+
const { input: i = stdin, output: r = stdout, render: n, signal: u, ...a } = e;
|
|
1183
|
+
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = s, this._abortSignal = u, this.input = i, this.output = r;
|
|
1437
1184
|
}
|
|
1438
1185
|
unsubscribe() {
|
|
1439
1186
|
this._subscribers.clear();
|
|
1440
1187
|
}
|
|
1441
|
-
setSubscriber(
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1188
|
+
setSubscriber(e, s) {
|
|
1189
|
+
const i = this._subscribers.get(e) ?? [];
|
|
1190
|
+
i.push(s), this._subscribers.set(e, i);
|
|
1444
1191
|
}
|
|
1445
|
-
on(
|
|
1446
|
-
this.setSubscriber(
|
|
1447
|
-
cb:
|
|
1192
|
+
on(e, s) {
|
|
1193
|
+
this.setSubscriber(e, {
|
|
1194
|
+
cb: s
|
|
1448
1195
|
});
|
|
1449
1196
|
}
|
|
1450
|
-
once(
|
|
1451
|
-
this.setSubscriber(
|
|
1452
|
-
cb:
|
|
1197
|
+
once(e, s) {
|
|
1198
|
+
this.setSubscriber(e, {
|
|
1199
|
+
cb: s,
|
|
1453
1200
|
once: !0
|
|
1454
1201
|
});
|
|
1455
1202
|
}
|
|
1456
|
-
emit(
|
|
1457
|
-
const
|
|
1458
|
-
for (const
|
|
1459
|
-
for (const
|
|
1203
|
+
emit(e, ...s) {
|
|
1204
|
+
const i = this._subscribers.get(e) ?? [], r = [];
|
|
1205
|
+
for (const n of i)n.cb(...s), n.once && r.push(()=>i.splice(i.indexOf(n), 1));
|
|
1206
|
+
for (const n of r)n();
|
|
1460
1207
|
}
|
|
1461
1208
|
prompt() {
|
|
1462
|
-
return new Promise((
|
|
1209
|
+
return new Promise((e)=>{
|
|
1463
1210
|
if (this._abortSignal) {
|
|
1464
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(),
|
|
1211
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), e(z);
|
|
1465
1212
|
this._abortSignal.addEventListener("abort", ()=>{
|
|
1466
1213
|
this.state = "cancel", this.close();
|
|
1467
1214
|
}, {
|
|
1468
1215
|
once: !0
|
|
1469
1216
|
});
|
|
1470
1217
|
}
|
|
1471
|
-
|
|
1472
|
-
F._write = (s, i, D)=>{
|
|
1473
|
-
this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D();
|
|
1474
|
-
}, this.input.pipe(F), this.rl = node_readline.createInterface({
|
|
1218
|
+
this.rl = node_readline.createInterface({
|
|
1475
1219
|
input: this.input,
|
|
1476
|
-
output: F,
|
|
1477
1220
|
tabSize: 2,
|
|
1478
1221
|
prompt: "",
|
|
1479
1222
|
escapeCodeTimeout: 50,
|
|
1480
1223
|
terminal: !0
|
|
1481
|
-
}),
|
|
1482
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render),
|
|
1224
|
+
}), this.rl.prompt(), void 0 !== this.opts.initialUserInput && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), dist_T(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", ()=>{
|
|
1225
|
+
this.output.write(src.cursor.show), this.output.off("resize", this.render), dist_T(this.input, !1), e(this.value);
|
|
1483
1226
|
}), this.once("cancel", ()=>{
|
|
1484
|
-
this.output.write(src.cursor.show), this.output.off("resize", this.render),
|
|
1227
|
+
this.output.write(src.cursor.show), this.output.off("resize", this.render), dist_T(this.input, !1), e(z);
|
|
1485
1228
|
});
|
|
1486
1229
|
});
|
|
1487
1230
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1231
|
+
_isActionKey(e, s) {
|
|
1232
|
+
return " " === e;
|
|
1233
|
+
}
|
|
1234
|
+
_setValue(e) {
|
|
1235
|
+
this.value = e, this.emit("value", this.value);
|
|
1236
|
+
}
|
|
1237
|
+
_setUserInput(e, s) {
|
|
1238
|
+
this.userInput = e ?? "", this.emit("userInput", this.userInput), s && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
1239
|
+
}
|
|
1240
|
+
_clearUserInput() {
|
|
1241
|
+
this.rl?.write(null, {
|
|
1242
|
+
ctrl: !0,
|
|
1243
|
+
name: "u"
|
|
1244
|
+
}), this._setUserInput("");
|
|
1245
|
+
}
|
|
1246
|
+
onKeypress(e, s) {
|
|
1247
|
+
if (this._track && "return" !== s.name && (s.name && this._isActionKey(e, s) && this.rl?.write(null, {
|
|
1248
|
+
ctrl: !0,
|
|
1249
|
+
name: "h"
|
|
1250
|
+
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), "error" === this.state && (this.state = "active"), s?.name && (!this._track && dist_.aliases.has(s.name) && this.emit("cursor", dist_.aliases.get(s.name)), dist_.actions.has(s.name) && this.emit("cursor", s.name)), e && ("y" === e.toLowerCase() || "n" === e.toLowerCase()) && this.emit("confirm", "y" === e.toLowerCase()), this.emit("key", e?.toLowerCase(), s), s?.name === "return") {
|
|
1490
1251
|
if (this.opts.validate) {
|
|
1491
|
-
const
|
|
1492
|
-
|
|
1252
|
+
const i = this.opts.validate(this.value);
|
|
1253
|
+
i && (this.error = i instanceof Error ? i.message : i, this.state = "error", this.rl?.write(this.userInput));
|
|
1493
1254
|
}
|
|
1494
1255
|
"error" !== this.state && (this.state = "submit");
|
|
1495
1256
|
}
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1257
|
+
H([
|
|
1258
|
+
e,
|
|
1259
|
+
s?.name,
|
|
1260
|
+
s?.sequence
|
|
1500
1261
|
], "cancel") && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"), this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
|
|
1501
1262
|
}
|
|
1502
1263
|
close() {
|
|
1503
1264
|
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
1504
|
-
`),
|
|
1265
|
+
`), dist_T(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
1505
1266
|
}
|
|
1506
1267
|
restoreCursor() {
|
|
1507
|
-
const
|
|
1508
|
-
hard: !0
|
|
1268
|
+
const e = K(this._prevFrame, process.stdout.columns, {
|
|
1269
|
+
hard: !0,
|
|
1270
|
+
trim: !1
|
|
1509
1271
|
}).split(`
|
|
1510
1272
|
`).length - 1;
|
|
1511
|
-
this.output.write(src.cursor.move(-999, -1 *
|
|
1273
|
+
this.output.write(src.cursor.move(-999, -1 * e));
|
|
1512
1274
|
}
|
|
1513
1275
|
render() {
|
|
1514
|
-
const
|
|
1515
|
-
hard: !0
|
|
1276
|
+
const e = K(this._render(this) ?? "", process.stdout.columns, {
|
|
1277
|
+
hard: !0,
|
|
1278
|
+
trim: !1
|
|
1516
1279
|
});
|
|
1517
|
-
if (
|
|
1280
|
+
if (e !== this._prevFrame) {
|
|
1518
1281
|
if ("initial" === this.state) this.output.write(src.cursor.hide);
|
|
1519
1282
|
else {
|
|
1520
|
-
const
|
|
1521
|
-
if (this.restoreCursor(),
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1524
|
-
|
|
1283
|
+
const s = _t(this._prevFrame, e), i = dist_nt(this.output);
|
|
1284
|
+
if (this.restoreCursor(), s) {
|
|
1285
|
+
const r = Math.max(0, s.numLinesAfter - i), n = Math.max(0, s.numLinesBefore - i);
|
|
1286
|
+
let u = s.lines.find((a)=>a >= r);
|
|
1287
|
+
if (void 0 === u) {
|
|
1288
|
+
this._prevFrame = e;
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
if (1 === s.lines.length) {
|
|
1292
|
+
this.output.write(src.cursor.move(0, u - n)), this.output.write(src.erase.lines(1));
|
|
1293
|
+
const a = e.split(`
|
|
1525
1294
|
`);
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1295
|
+
this.output.write(a[u]), this._prevFrame = e, this.output.write(src.cursor.move(0, a.length - u - 1));
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
if (s.lines.length > 1) {
|
|
1299
|
+
if (r < n) u = r;
|
|
1300
|
+
else {
|
|
1301
|
+
const l = u - n;
|
|
1302
|
+
l > 0 && this.output.write(src.cursor.move(0, l));
|
|
1303
|
+
}
|
|
1304
|
+
this.output.write(src.erase.down());
|
|
1305
|
+
const a = e.split(`
|
|
1306
|
+
`).slice(u);
|
|
1307
|
+
this.output.write(a.join(`
|
|
1308
|
+
`)), this._prevFrame = e;
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1537
1311
|
}
|
|
1538
1312
|
this.output.write(src.erase.down());
|
|
1539
1313
|
}
|
|
1540
|
-
this.output.write(
|
|
1314
|
+
this.output.write(e), "initial" === this.state && (this.state = "active"), this._prevFrame = e;
|
|
1541
1315
|
}
|
|
1542
1316
|
}
|
|
1543
1317
|
}
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1318
|
+
function dist_D(t, e, s) {
|
|
1319
|
+
const i = t + e, r = Math.max(s.length - 1, 0), n = i < 0 ? r : i > r ? 0 : i;
|
|
1320
|
+
return s[n].disabled ? dist_D(n, e < 0 ? -1 : 1, s) : n;
|
|
1321
|
+
}
|
|
1322
|
+
class Mt extends x {
|
|
1323
|
+
options;
|
|
1324
|
+
cursor = 0;
|
|
1325
|
+
get _value() {
|
|
1326
|
+
return this.options[this.cursor].value;
|
|
1327
|
+
}
|
|
1328
|
+
get _enabledOptions() {
|
|
1329
|
+
return this.options.filter((e)=>!0 !== e.disabled);
|
|
1330
|
+
}
|
|
1331
|
+
toggleAll() {
|
|
1332
|
+
const e = this._enabledOptions, s = void 0 !== this.value && this.value.length === e.length;
|
|
1333
|
+
this.value = s ? [] : e.map((i)=>i.value);
|
|
1334
|
+
}
|
|
1335
|
+
toggleInvert() {
|
|
1336
|
+
const e = this.value;
|
|
1337
|
+
if (!e) return;
|
|
1338
|
+
const s = this._enabledOptions.filter((i)=>!e.includes(i.value));
|
|
1339
|
+
this.value = s.map((i)=>i.value);
|
|
1340
|
+
}
|
|
1341
|
+
toggleValue() {
|
|
1342
|
+
void 0 === this.value && (this.value = []);
|
|
1343
|
+
const e = this.value.includes(this._value);
|
|
1344
|
+
this.value = e ? this.value.filter((s)=>s !== this._value) : [
|
|
1345
|
+
...this.value,
|
|
1346
|
+
this._value
|
|
1347
|
+
];
|
|
1348
|
+
}
|
|
1349
|
+
constructor(e){
|
|
1350
|
+
super(e, !1), this.options = e.options, this.value = [
|
|
1351
|
+
...e.initialValues ?? []
|
|
1352
|
+
];
|
|
1353
|
+
const s = Math.max(this.options.findIndex(({ value: i })=>i === e.cursorAt), 0);
|
|
1354
|
+
this.cursor = this.options[s].disabled ? dist_D(s, 1, this.options) : s, this.on("key", (i)=>{
|
|
1355
|
+
"a" === i && this.toggleAll(), "i" === i && this.toggleInvert();
|
|
1356
|
+
}), this.on("cursor", (i)=>{
|
|
1357
|
+
switch(i){
|
|
1559
1358
|
case "left":
|
|
1560
1359
|
case "up":
|
|
1561
|
-
this.cursor =
|
|
1360
|
+
this.cursor = dist_D(this.cursor, -1, this.options);
|
|
1562
1361
|
break;
|
|
1563
1362
|
case "down":
|
|
1564
1363
|
case "right":
|
|
1565
|
-
this.cursor = this.cursor
|
|
1364
|
+
this.cursor = dist_D(this.cursor, 1, this.options);
|
|
1566
1365
|
break;
|
|
1567
1366
|
case "space":
|
|
1568
1367
|
this.toggleValue();
|
|
@@ -1570,253 +1369,506 @@ let SD = class extends x {
|
|
|
1570
1369
|
}
|
|
1571
1370
|
});
|
|
1572
1371
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
this.
|
|
1372
|
+
}
|
|
1373
|
+
class Wt extends x {
|
|
1374
|
+
options;
|
|
1375
|
+
cursor = 0;
|
|
1376
|
+
get _selectedValue() {
|
|
1377
|
+
return this.options[this.cursor];
|
|
1579
1378
|
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
this.value = u ? this.value.filter((t)=>t !== this._value) : [
|
|
1583
|
-
...this.value,
|
|
1584
|
-
this._value
|
|
1585
|
-
];
|
|
1379
|
+
changeValue() {
|
|
1380
|
+
this.value = this._selectedValue.value;
|
|
1586
1381
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
value: t
|
|
1593
|
-
}) : e[u] = t, J = (e, u, t)=>(PD(e, "symbol" != typeof u ? u + "" : u, t), t);
|
|
1594
|
-
class LD extends x {
|
|
1595
|
-
constructor(u){
|
|
1596
|
-
super(u, !1), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t })=>t === u.initialValue), -1 === this.cursor && (this.cursor = 0), this.changeValue(), this.on("cursor", (t)=>{
|
|
1597
|
-
switch(t){
|
|
1382
|
+
constructor(e){
|
|
1383
|
+
super(e, !1), this.options = e.options;
|
|
1384
|
+
const s = this.options.findIndex(({ value: r })=>r === e.initialValue), i = -1 === s ? 0 : s;
|
|
1385
|
+
this.cursor = this.options[i].disabled ? dist_D(i, 1, this.options) : i, this.changeValue(), this.on("cursor", (r)=>{
|
|
1386
|
+
switch(r){
|
|
1598
1387
|
case "left":
|
|
1599
1388
|
case "up":
|
|
1600
|
-
this.cursor =
|
|
1389
|
+
this.cursor = dist_D(this.cursor, -1, this.options);
|
|
1601
1390
|
break;
|
|
1602
1391
|
case "down":
|
|
1603
1392
|
case "right":
|
|
1604
|
-
this.cursor = this.cursor
|
|
1393
|
+
this.cursor = dist_D(this.cursor, 1, this.options);
|
|
1605
1394
|
break;
|
|
1606
1395
|
}
|
|
1607
1396
|
this.changeValue();
|
|
1608
1397
|
});
|
|
1609
1398
|
}
|
|
1610
|
-
get _value() {
|
|
1611
|
-
return this.options[this.cursor];
|
|
1612
|
-
}
|
|
1613
|
-
changeValue() {
|
|
1614
|
-
this.value = this._value.value;
|
|
1615
|
-
}
|
|
1616
1399
|
}
|
|
1617
|
-
class
|
|
1618
|
-
get
|
|
1619
|
-
if ("submit" === this.state) return this.
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1400
|
+
class dist_$t extends x {
|
|
1401
|
+
get userInputWithCursor() {
|
|
1402
|
+
if ("submit" === this.state) return this.userInput;
|
|
1403
|
+
const e = this.userInput;
|
|
1404
|
+
if (this.cursor >= e.length) return `${this.userInput}\u2588`;
|
|
1405
|
+
const s = e.slice(0, this.cursor), [i, ...r] = e.slice(this.cursor);
|
|
1406
|
+
return `${s}${picocolors.inverse(i)}${r.join("")}`;
|
|
1623
1407
|
}
|
|
1624
1408
|
get cursor() {
|
|
1625
1409
|
return this._cursor;
|
|
1626
1410
|
}
|
|
1627
|
-
constructor(
|
|
1628
|
-
super(
|
|
1629
|
-
|
|
1411
|
+
constructor(e){
|
|
1412
|
+
super({
|
|
1413
|
+
...e,
|
|
1414
|
+
initialUserInput: e.initialUserInput ?? e.initialValue
|
|
1415
|
+
}), this.on("userInput", (s)=>{
|
|
1416
|
+
this._setValue(s);
|
|
1417
|
+
}), this.on("finalize", ()=>{
|
|
1418
|
+
this.value || (this.value = e.defaultValue), void 0 === this.value && (this.value = "");
|
|
1630
1419
|
});
|
|
1631
1420
|
}
|
|
1632
1421
|
}
|
|
1633
|
-
|
|
1422
|
+
const external_node_fs_ = __webpack_require__("node:fs");
|
|
1423
|
+
function dist_ht() {
|
|
1634
1424
|
return "win32" !== node_process.platform ? "linux" !== node_process.env.TERM : !!node_process.env.CI || !!node_process.env.WT_SESSION || !!node_process.env.TERMINUS_SUBLIME || "{cmd::Cmder}" === node_process.env.ConEmuTask || "Terminus-Sublime" === node_process.env.TERM_PROGRAM || "vscode" === node_process.env.TERM_PROGRAM || "xterm-256color" === node_process.env.TERM || "alacritty" === node_process.env.TERM || "JetBrains-JediTerm" === node_process.env.TERMINAL_EMULATOR;
|
|
1635
1425
|
}
|
|
1636
|
-
const
|
|
1637
|
-
switch(
|
|
1426
|
+
const ee = dist_ht(), dist_w = (e, r)=>ee ? e : r, Me = dist_w("\u25C6", "*"), ce = dist_w("\u25A0", "x"), de = dist_w("\u25B2", "x"), dist_k = dist_w("\u25C7", "o"), dist_h = (dist_w("\u250C", "T"), dist_w("\u2502", "|")), dist_x = dist_w("\u2514", "\u2014"), dist_Y = (dist_w("\u2510", "T"), dist_w("\u2518", "\u2014"), dist_w("\u25CF", ">")), dist_K = dist_w("\u25CB", " "), te = dist_w("\u25FB", "[\u2022]"), dist_G = dist_w("\u25FC", "[+]"), dist_z = dist_w("\u25FB", "[ ]"), se = (dist_w("\u25AA", "\u2022"), dist_w("\u2500", "-")), he = dist_w("\u256E", "+"), Ne = dist_w("\u251C", "+"), me = dist_w("\u256F", "+"), pe = dist_w("\u2570", "+"), N = (dist_w("\u256D", "+"), dist_w("\u25CF", "\u2022"), dist_w("\u25C6", "*"), dist_w("\u25B2", "!"), dist_w("\u25A0", "x"), (e)=>{
|
|
1427
|
+
switch(e){
|
|
1638
1428
|
case "initial":
|
|
1639
1429
|
case "active":
|
|
1640
|
-
return
|
|
1430
|
+
return picocolors_default().cyan(Me);
|
|
1641
1431
|
case "cancel":
|
|
1642
|
-
return picocolors.red(
|
|
1432
|
+
return picocolors.red(ce);
|
|
1643
1433
|
case "error":
|
|
1644
|
-
return picocolors.yellow(
|
|
1434
|
+
return picocolors.yellow(de);
|
|
1645
1435
|
case "submit":
|
|
1646
|
-
return picocolors.green(
|
|
1436
|
+
return picocolors.green(dist_k);
|
|
1647
1437
|
}
|
|
1648
|
-
}),
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1438
|
+
}), Ee = (e)=>{
|
|
1439
|
+
switch(e){
|
|
1440
|
+
case "initial":
|
|
1441
|
+
case "active":
|
|
1442
|
+
return picocolors_default().cyan(dist_h);
|
|
1443
|
+
case "cancel":
|
|
1444
|
+
return picocolors.red(dist_h);
|
|
1445
|
+
case "error":
|
|
1446
|
+
return picocolors.yellow(dist_h);
|
|
1447
|
+
case "submit":
|
|
1448
|
+
return picocolors.green(dist_h);
|
|
1449
|
+
}
|
|
1450
|
+
}, dist_mt = (e)=>161 === e || 164 === e || 167 === e || 168 === e || 170 === e || 173 === e || 174 === e || e >= 176 && e <= 180 || e >= 182 && e <= 186 || e >= 188 && e <= 191 || 198 === e || 208 === e || 215 === e || 216 === e || e >= 222 && e <= 225 || 230 === e || e >= 232 && e <= 234 || 236 === e || 237 === e || 240 === e || 242 === e || 243 === e || e >= 247 && e <= 250 || 252 === e || 254 === e || 257 === e || 273 === e || 275 === e || 283 === e || 294 === e || 295 === e || 299 === e || e >= 305 && e <= 307 || 312 === e || e >= 319 && e <= 322 || 324 === e || e >= 328 && e <= 331 || 333 === e || 338 === e || 339 === e || 358 === e || 359 === e || 363 === e || 462 === e || 464 === e || 466 === e || 468 === e || 470 === e || 472 === e || 474 === e || 476 === e || 593 === e || 609 === e || 708 === e || 711 === e || e >= 713 && e <= 715 || 717 === e || 720 === e || e >= 728 && e <= 731 || 733 === e || 735 === e || e >= 768 && e <= 879 || e >= 913 && e <= 929 || e >= 931 && e <= 937 || e >= 945 && e <= 961 || e >= 963 && e <= 969 || 1025 === e || e >= 1040 && e <= 1103 || 1105 === e || 8208 === e || e >= 8211 && e <= 8214 || 8216 === e || 8217 === e || 8220 === e || 8221 === e || e >= 8224 && e <= 8226 || e >= 8228 && e <= 8231 || 8240 === e || 8242 === e || 8243 === e || 8245 === e || 8251 === e || 8254 === e || 8308 === e || 8319 === e || e >= 8321 && e <= 8324 || 8364 === e || 8451 === e || 8453 === e || 8457 === e || 8467 === e || 8470 === e || 8481 === e || 8482 === e || 8486 === e || 8491 === e || 8531 === e || 8532 === e || e >= 8539 && e <= 8542 || e >= 8544 && e <= 8555 || e >= 8560 && e <= 8569 || 8585 === e || e >= 8592 && e <= 8601 || 8632 === e || 8633 === e || 8658 === e || 8660 === e || 8679 === e || 8704 === e || 8706 === e || 8707 === e || 8711 === e || 8712 === e || 8715 === e || 8719 === e || 8721 === e || 8725 === e || 8730 === e || e >= 8733 && e <= 8736 || 8739 === e || 8741 === e || e >= 8743 && e <= 8748 || 8750 === e || e >= 8756 && e <= 8759 || 8764 === e || 8765 === e || 8776 === e || 8780 === e || 8786 === e || 8800 === e || 8801 === e || e >= 8804 && e <= 8807 || 8810 === e || 8811 === e || 8814 === e || 8815 === e || 8834 === e || 8835 === e || 8838 === e || 8839 === e || 8853 === e || 8857 === e || 8869 === e || 8895 === e || 8978 === e || e >= 9312 && e <= 9449 || e >= 9451 && e <= 9547 || e >= 9552 && e <= 9587 || e >= 9600 && e <= 9615 || e >= 9618 && e <= 9621 || 9632 === e || 9633 === e || e >= 9635 && e <= 9641 || 9650 === e || 9651 === e || 9654 === e || 9655 === e || 9660 === e || 9661 === e || 9664 === e || 9665 === e || e >= 9670 && e <= 9672 || 9675 === e || e >= 9678 && e <= 9681 || e >= 9698 && e <= 9701 || 9711 === e || 9733 === e || 9734 === e || 9737 === e || 9742 === e || 9743 === e || 9756 === e || 9758 === e || 9792 === e || 9794 === e || 9824 === e || 9825 === e || e >= 9827 && e <= 9829 || e >= 9831 && e <= 9834 || 9836 === e || 9837 === e || 9839 === e || 9886 === e || 9887 === e || 9919 === e || e >= 9926 && e <= 9933 || e >= 9935 && e <= 9939 || e >= 9941 && e <= 9953 || 9955 === e || 9960 === e || 9961 === e || e >= 9963 && e <= 9969 || 9972 === e || e >= 9974 && e <= 9977 || 9979 === e || 9980 === e || 9982 === e || 9983 === e || 10045 === e || e >= 10102 && e <= 10111 || e >= 11094 && e <= 11097 || e >= 12872 && e <= 12879 || e >= 57344 && e <= 63743 || e >= 65024 && e <= 65039 || 65533 === e || e >= 127232 && e <= 127242 || e >= 127248 && e <= 127277 || e >= 127280 && e <= 127337 || e >= 127344 && e <= 127373 || 127375 === e || 127376 === e || e >= 127387 && e <= 127404 || e >= 917760 && e <= 917999 || e >= 983040 && e <= 1048573 || e >= 1048576 && e <= 1114109, dist_pt = (e)=>12288 === e || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510, dist_gt = (e)=>e >= 4352 && e <= 4447 || 8986 === e || 8987 === e || 9001 === e || 9002 === e || e >= 9193 && e <= 9196 || 9200 === e || 9203 === e || 9725 === e || 9726 === e || 9748 === e || 9749 === e || e >= 9800 && e <= 9811 || 9855 === e || 9875 === e || 9889 === e || 9898 === e || 9899 === e || 9917 === e || 9918 === e || 9924 === e || 9925 === e || 9934 === e || 9940 === e || 9962 === e || 9970 === e || 9971 === e || 9973 === e || 9978 === e || 9981 === e || 9989 === e || 9994 === e || 9995 === e || 10024 === e || 10060 === e || 10062 === e || e >= 10067 && e <= 10069 || 10071 === e || e >= 10133 && e <= 10135 || 10160 === e || 10175 === e || 11035 === e || 11036 === e || 11088 === e || 11093 === e || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12771 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 19903 || e >= 19968 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || 94192 === e || 94193 === e || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101632 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || 110589 === e || 110590 === e || e >= 110592 && e <= 110882 || 110898 === e || e >= 110928 && e <= 110930 || 110933 === e || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || 126980 === e || 127183 === e || 127374 === e || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || 127568 === e || 127569 === e || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || 127988 === e || e >= 127992 && e <= 128062 || 128064 === e || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || 128378 === e || 128405 === e || 128406 === e || 128420 === e || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || 128716 === e || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || 128747 === e || 128748 === e || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || 129008 === e || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129672 || e >= 129680 && e <= 129725 || e >= 129727 && e <= 129733 || e >= 129742 && e <= 129755 || e >= 129760 && e <= 129768 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141, ve = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y, re = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y, ie = /\t{1,1000}/y, Ae = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu, ne = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y, dist_ft = /\p{M}+/gu, dist_Ft = {
|
|
1451
|
+
limit: 1 / 0,
|
|
1452
|
+
ellipsis: ""
|
|
1453
|
+
}, Le = (e, r = {}, s = {})=>{
|
|
1454
|
+
const i = r.limit ?? 1 / 0, n = r.ellipsis ?? "", o = r?.ellipsisWidth ?? (n ? Le(n, dist_Ft, s).width : 0), u = s.ansiWidth ?? 0, l = s.controlWidth ?? 0, a = s.tabWidth ?? 8, d = s.ambiguousWidth ?? 1, g = s.emojiWidth ?? 2, E = s.fullWidthWidth ?? 2, p = s.regularWidth ?? 1, y = s.wideWidth ?? 2;
|
|
1455
|
+
let $ = 0, c = 0, m = e.length, f = 0, F = !1, v = m, S = Math.max(0, i - o), B = 0, b = 0, A = 0, C = 0;
|
|
1456
|
+
e: for(;;){
|
|
1457
|
+
if (b > B || c >= m && c > $) {
|
|
1458
|
+
const _ = e.slice(B, b) || e.slice($, c);
|
|
1459
|
+
f = 0;
|
|
1460
|
+
for (const D of _.replaceAll(dist_ft, "")){
|
|
1461
|
+
const T = D.codePointAt(0) || 0;
|
|
1462
|
+
if (dist_pt(T) ? C = E : dist_gt(T) ? C = y : d !== p && dist_mt(T) ? C = d : C = p, A + C > S && (v = Math.min(v, Math.max(B, $) + f)), A + C > i) {
|
|
1463
|
+
F = !0;
|
|
1464
|
+
break e;
|
|
1465
|
+
}
|
|
1466
|
+
f += D.length, A += C;
|
|
1467
|
+
}
|
|
1468
|
+
B = b = 0;
|
|
1469
|
+
}
|
|
1470
|
+
if (c >= m) break;
|
|
1471
|
+
if (ne.lastIndex = c, ne.test(e)) {
|
|
1472
|
+
if (f = ne.lastIndex - c, C = f * p, A + C > S && (v = Math.min(v, c + Math.floor((S - A) / p))), A + C > i) {
|
|
1473
|
+
F = !0;
|
|
1474
|
+
break;
|
|
1475
|
+
}
|
|
1476
|
+
A += C, B = $, b = c, c = $ = ne.lastIndex;
|
|
1477
|
+
continue;
|
|
1478
|
+
}
|
|
1479
|
+
if (ve.lastIndex = c, ve.test(e)) {
|
|
1480
|
+
if (A + u > S && (v = Math.min(v, c)), A + u > i) {
|
|
1481
|
+
F = !0;
|
|
1482
|
+
break;
|
|
1483
|
+
}
|
|
1484
|
+
A += u, B = $, b = c, c = $ = ve.lastIndex;
|
|
1485
|
+
continue;
|
|
1486
|
+
}
|
|
1487
|
+
if (re.lastIndex = c, re.test(e)) {
|
|
1488
|
+
if (f = re.lastIndex - c, C = f * l, A + C > S && (v = Math.min(v, c + Math.floor((S - A) / l))), A + C > i) {
|
|
1489
|
+
F = !0;
|
|
1490
|
+
break;
|
|
1491
|
+
}
|
|
1492
|
+
A += C, B = $, b = c, c = $ = re.lastIndex;
|
|
1493
|
+
continue;
|
|
1494
|
+
}
|
|
1495
|
+
if (ie.lastIndex = c, ie.test(e)) {
|
|
1496
|
+
if (f = ie.lastIndex - c, C = f * a, A + C > S && (v = Math.min(v, c + Math.floor((S - A) / a))), A + C > i) {
|
|
1497
|
+
F = !0;
|
|
1498
|
+
break;
|
|
1499
|
+
}
|
|
1500
|
+
A += C, B = $, b = c, c = $ = ie.lastIndex;
|
|
1501
|
+
continue;
|
|
1502
|
+
}
|
|
1503
|
+
if (Ae.lastIndex = c, Ae.test(e)) {
|
|
1504
|
+
if (A + g > S && (v = Math.min(v, c)), A + g > i) {
|
|
1505
|
+
F = !0;
|
|
1506
|
+
break;
|
|
1507
|
+
}
|
|
1508
|
+
A += g, B = $, b = c, c = $ = Ae.lastIndex;
|
|
1509
|
+
continue;
|
|
1510
|
+
}
|
|
1511
|
+
c += 1;
|
|
1512
|
+
}
|
|
1513
|
+
return {
|
|
1514
|
+
width: F ? S : A,
|
|
1515
|
+
index: F ? v : m,
|
|
1516
|
+
truncated: F,
|
|
1517
|
+
ellipsed: F && i >= o
|
|
1518
|
+
};
|
|
1519
|
+
}, dist_yt = {
|
|
1520
|
+
limit: 1 / 0,
|
|
1521
|
+
ellipsis: "",
|
|
1522
|
+
ellipsisWidth: 0
|
|
1523
|
+
}, dist_M = (e, r = {})=>Le(e, dist_yt, r).width, ae = "\x1B", je = "\x9B", dist_Et = 39, Ce = "\x07", Ve = "[", dist_vt = "]", ke = "m", we = `${dist_vt}8;;`, Ge = new RegExp(`(?:\\${Ve}(?<code>\\d+)m|\\${we}(?<uri>.*)${Ce})`, "y"), dist_At = (e)=>{
|
|
1524
|
+
if (e >= 30 && e <= 37 || e >= 90 && e <= 97) return 39;
|
|
1525
|
+
if (e >= 40 && e <= 47 || e >= 100 && e <= 107) return 49;
|
|
1526
|
+
if (1 === e || 2 === e) return 22;
|
|
1527
|
+
if (3 === e) return 23;
|
|
1528
|
+
if (4 === e) return 24;
|
|
1529
|
+
if (7 === e) return 27;
|
|
1530
|
+
if (8 === e) return 28;
|
|
1531
|
+
if (9 === e) return 29;
|
|
1532
|
+
if (0 === e) return 0;
|
|
1533
|
+
}, He = (e)=>`${ae}${Ve}${e}${ke}`, Ue = (e)=>`${ae}${we}${e}${Ce}`, dist_Ct = (e)=>e.map((r)=>dist_M(r)), Se = (e, r, s)=>{
|
|
1534
|
+
const i = r[Symbol.iterator]();
|
|
1535
|
+
let n = !1, o = !1, u = e.at(-1), l = void 0 === u ? 0 : dist_M(u), a = i.next(), d = i.next(), g = 0;
|
|
1536
|
+
for(; !a.done;){
|
|
1537
|
+
const E = a.value, p = dist_M(E);
|
|
1538
|
+
l + p <= s ? e[e.length - 1] += E : (e.push(E), l = 0), (E === ae || E === je) && (n = !0, o = r.startsWith(we, g + 1)), n ? o ? E === Ce && (n = !1, o = !1) : E === ke && (n = !1) : (l += p, l !== s || d.done || (e.push(""), l = 0)), a = d, d = i.next(), g += E.length;
|
|
1539
|
+
}
|
|
1540
|
+
u = e.at(-1), !l && void 0 !== u && u.length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
|
|
1541
|
+
}, dist_wt = (e)=>{
|
|
1542
|
+
const r = e.split(" ");
|
|
1543
|
+
let s = r.length;
|
|
1544
|
+
for(; s > 0 && !(dist_M(r[s - 1]) > 0);)s--;
|
|
1545
|
+
return s === r.length ? e : r.slice(0, s).join(" ") + r.slice(s).join("");
|
|
1546
|
+
}, dist_St = (e, r, s = {})=>{
|
|
1547
|
+
if (!1 !== s.trim && "" === e.trim()) return "";
|
|
1548
|
+
let i = "", n, o;
|
|
1549
|
+
const u = e.split(" "), l = dist_Ct(u);
|
|
1550
|
+
let a = [
|
|
1551
|
+
""
|
|
1552
|
+
];
|
|
1553
|
+
for (const [$, c] of u.entries()){
|
|
1554
|
+
!1 !== s.trim && (a[a.length - 1] = (a.at(-1) ?? "").trimStart());
|
|
1555
|
+
let m = dist_M(a.at(-1) ?? "");
|
|
1556
|
+
if (0 !== $ && (m >= r && (!1 === s.wordWrap || !1 === s.trim) && (a.push(""), m = 0), (m > 0 || !1 === s.trim) && (a[a.length - 1] += " ", m++)), s.hard && l[$] > r) {
|
|
1557
|
+
const f = r - m, F = 1 + Math.floor((l[$] - f - 1) / r);
|
|
1558
|
+
Math.floor((l[$] - 1) / r) < F && a.push(""), Se(a, c, r);
|
|
1559
|
+
continue;
|
|
1560
|
+
}
|
|
1561
|
+
if (m + l[$] > r && m > 0 && l[$] > 0) {
|
|
1562
|
+
if (!1 === s.wordWrap && m < r) {
|
|
1563
|
+
Se(a, c, r);
|
|
1564
|
+
continue;
|
|
1565
|
+
}
|
|
1566
|
+
a.push("");
|
|
1567
|
+
}
|
|
1568
|
+
if (m + l[$] > r && !1 === s.wordWrap) {
|
|
1569
|
+
Se(a, c, r);
|
|
1570
|
+
continue;
|
|
1571
|
+
}
|
|
1572
|
+
a[a.length - 1] += c;
|
|
1573
|
+
}
|
|
1574
|
+
!1 !== s.trim && (a = a.map(($)=>dist_wt($)));
|
|
1575
|
+
const d = a.join(`
|
|
1576
|
+
`), g = d[Symbol.iterator]();
|
|
1577
|
+
let E = g.next(), p = g.next(), y = 0;
|
|
1578
|
+
for(; !E.done;){
|
|
1579
|
+
const $ = E.value, c = p.value;
|
|
1580
|
+
if (i += $, $ === ae || $ === je) {
|
|
1581
|
+
Ge.lastIndex = y + 1;
|
|
1582
|
+
const F = Ge.exec(d)?.groups;
|
|
1583
|
+
if (F?.code !== void 0) {
|
|
1584
|
+
const v = Number.parseFloat(F.code);
|
|
1585
|
+
n = v === dist_Et ? void 0 : v;
|
|
1586
|
+
} else F?.uri !== void 0 && (o = 0 === F.uri.length ? void 0 : F.uri);
|
|
1587
|
+
}
|
|
1588
|
+
const m = n ? dist_At(n) : void 0;
|
|
1589
|
+
c === `
|
|
1590
|
+
` ? (o && (i += Ue("")), n && m && (i += He(m))) : $ === `
|
|
1591
|
+
` && (n && m && (i += He(n)), o && (i += Ue(o))), y += $.length, E = p, p = g.next();
|
|
1592
|
+
}
|
|
1593
|
+
return i;
|
|
1594
|
+
};
|
|
1595
|
+
function dist_q(e, r, s) {
|
|
1596
|
+
return String(e).normalize().replaceAll(`\r
|
|
1597
|
+
`, `
|
|
1598
|
+
`).split(`
|
|
1599
|
+
`).map((i)=>dist_St(i, r, s)).join(`
|
|
1600
|
+
`);
|
|
1601
|
+
}
|
|
1602
|
+
const dist_It = (e, r, s, i, n)=>{
|
|
1603
|
+
let o = r, u = 0;
|
|
1604
|
+
for(let l = s; l < i; l++){
|
|
1605
|
+
const a = e[l];
|
|
1606
|
+
if (o -= a.length, u++, o <= n) break;
|
|
1607
|
+
}
|
|
1608
|
+
return {
|
|
1609
|
+
lineCount: o,
|
|
1610
|
+
removals: u
|
|
1611
|
+
};
|
|
1612
|
+
}, dist_J = (e)=>{
|
|
1613
|
+
const { cursor: r, options: s, style: i } = e, n = e.output ?? process.stdout, o = dist_rt(n), u = e.columnPadding ?? 0, l = e.rowPadding ?? 4, a = o - u, d = dist_nt(n), g = picocolors_default().dim("..."), E = e.maxItems ?? 1 / 0, p = Math.max(d - l, 0), y = Math.max(Math.min(E, p), 5);
|
|
1614
|
+
let $ = 0;
|
|
1615
|
+
r >= y - 3 && ($ = Math.max(Math.min(r - y + 3, s.length - y), 0));
|
|
1616
|
+
let c = y < s.length && $ > 0, m = y < s.length && $ + y < s.length;
|
|
1617
|
+
const f = Math.min($ + y, s.length), F = [];
|
|
1618
|
+
let v = 0;
|
|
1619
|
+
c && v++, m && v++;
|
|
1620
|
+
const S = $ + (c ? 1 : 0), B = f - (m ? 1 : 0);
|
|
1621
|
+
for(let A = S; A < B; A++){
|
|
1622
|
+
const C = dist_q(i(s[A], A === r), a, {
|
|
1623
|
+
hard: !0,
|
|
1624
|
+
trim: !1
|
|
1625
|
+
}).split(`
|
|
1626
|
+
`);
|
|
1627
|
+
F.push(C), v += C.length;
|
|
1628
|
+
}
|
|
1629
|
+
if (v > p) {
|
|
1630
|
+
let A = 0, C = 0, _ = v;
|
|
1631
|
+
const D = r - S, T = (W, I)=>dist_It(F, _, W, I, p);
|
|
1632
|
+
c ? ({ lineCount: _, removals: A } = T(0, D), _ > p && ({ lineCount: _, removals: C } = T(D + 1, F.length))) : ({ lineCount: _, removals: C } = T(D + 1, F.length), _ > p && ({ lineCount: _, removals: A } = T(0, D))), A > 0 && (c = !0, F.splice(0, A)), C > 0 && (m = !0, F.splice(F.length - C, C));
|
|
1633
|
+
}
|
|
1634
|
+
const b = [];
|
|
1635
|
+
c && b.push(g);
|
|
1636
|
+
for (const A of F)for (const C of A)b.push(C);
|
|
1637
|
+
return m && b.push(g), b;
|
|
1638
|
+
};
|
|
1639
|
+
const Pt = (e = "", r)=>{
|
|
1640
|
+
(r?.output ?? process.stdout).write(`${picocolors.gray(dist_x)} ${picocolors.red(e)}
|
|
1641
|
+
|
|
1642
|
+
`);
|
|
1643
|
+
}, dist_Wt = (e = "", r)=>{
|
|
1644
|
+
(r?.output ?? process.stdout).write(`${picocolors.gray(dist_h)}
|
|
1645
|
+
${picocolors.gray(dist_x)} ${e}
|
|
1646
|
+
|
|
1647
|
+
`);
|
|
1648
|
+
}, dist_Q = (e, r)=>e.split(`
|
|
1649
|
+
`).map((s)=>r(s)).join(`
|
|
1650
|
+
`), dist_Lt = (e)=>{
|
|
1651
|
+
const r = (i, n)=>{
|
|
1652
|
+
const o = i.label ?? String(i.value);
|
|
1653
|
+
return "disabled" === n ? `${picocolors.gray(dist_z)} ${dist_Q(o, (u)=>picocolors.strikethrough(picocolors.gray(u)))}${i.hint ? ` ${picocolors_default().dim(`(${i.hint ?? "disabled"})`)}` : ""}` : "active" === n ? `${picocolors_default().cyan(te)} ${o}${i.hint ? ` ${picocolors_default().dim(`(${i.hint})`)}` : ""}` : "selected" === n ? `${picocolors.green(dist_G)} ${dist_Q(o, picocolors.dim)}${i.hint ? ` ${picocolors_default().dim(`(${i.hint})`)}` : ""}` : "cancelled" === n ? `${dist_Q(o, (u)=>picocolors.strikethrough(picocolors_default().dim(u)))}` : "active-selected" === n ? `${picocolors.green(dist_G)} ${o}${i.hint ? ` ${picocolors_default().dim(`(${i.hint})`)}` : ""}` : "submitted" === n ? `${dist_Q(o, picocolors.dim)}` : `${picocolors_default().dim(dist_z)} ${dist_Q(o, picocolors.dim)}`;
|
|
1654
|
+
}, s = e.required ?? !0;
|
|
1655
|
+
return new Mt({
|
|
1656
|
+
options: e.options,
|
|
1657
|
+
signal: e.signal,
|
|
1658
|
+
input: e.input,
|
|
1659
|
+
output: e.output,
|
|
1660
|
+
initialValues: e.initialValues,
|
|
1661
|
+
required: s,
|
|
1662
|
+
cursorAt: e.cursorAt,
|
|
1663
|
+
validate (i) {
|
|
1664
|
+
if (s && (void 0 === i || 0 === i.length)) return `Please select at least one option.
|
|
1665
|
+
${picocolors_default().reset(picocolors_default().dim(`Press ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" space ")))} to select, ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" enter ")))} to submit`))}`;
|
|
1666
|
+
},
|
|
1662
1667
|
render () {
|
|
1663
|
-
const n = `${picocolors.gray(
|
|
1664
|
-
${
|
|
1665
|
-
`,
|
|
1668
|
+
const i = Bt(e.output, e.message, `${Ee(this.state)} `, `${N(this.state)} `), n = `${picocolors.gray(dist_h)}
|
|
1669
|
+
${i}
|
|
1670
|
+
`, o = this.value ?? [], u = (l, a)=>{
|
|
1671
|
+
if (l.disabled) return r(l, "disabled");
|
|
1672
|
+
const d = o.includes(l.value);
|
|
1673
|
+
return a && d ? r(l, "active-selected") : d ? r(l, "selected") : r(l, a ? "active" : "inactive");
|
|
1674
|
+
};
|
|
1666
1675
|
switch(this.state){
|
|
1667
|
-
case "error":
|
|
1668
|
-
return `${n.trim()}
|
|
1669
|
-
${picocolors.yellow(dist_o)} ${i}
|
|
1670
|
-
${picocolors.yellow(dist_d)} ${picocolors.yellow(this.error)}
|
|
1671
|
-
`;
|
|
1672
1676
|
case "submit":
|
|
1673
|
-
|
|
1677
|
+
{
|
|
1678
|
+
const l = this.options.filter(({ value: d })=>o.includes(d)).map((d)=>r(d, "submitted")).join(picocolors_default().dim(", ")) || picocolors_default().dim("none"), a = Bt(e.output, l, `${picocolors.gray(dist_h)} `);
|
|
1679
|
+
return `${n}${a}`;
|
|
1680
|
+
}
|
|
1674
1681
|
case "cancel":
|
|
1675
|
-
|
|
1676
|
-
|
|
1682
|
+
{
|
|
1683
|
+
const l = this.options.filter(({ value: d })=>o.includes(d)).map((d)=>r(d, "cancelled")).join(picocolors_default().dim(", "));
|
|
1684
|
+
if ("" === l.trim()) return `${n}${picocolors.gray(dist_h)}`;
|
|
1685
|
+
const a = Bt(e.output, l, `${picocolors.gray(dist_h)} `);
|
|
1686
|
+
return `${n}${a}
|
|
1687
|
+
${picocolors.gray(dist_h)}`;
|
|
1688
|
+
}
|
|
1689
|
+
case "error":
|
|
1690
|
+
{
|
|
1691
|
+
const l = `${picocolors.yellow(dist_h)} `, a = this.error.split(`
|
|
1692
|
+
`).map((E, p)=>0 === p ? `${picocolors.yellow(dist_x)} ${picocolors.yellow(E)}` : ` ${E}`).join(`
|
|
1693
|
+
`), d = n.split(`
|
|
1694
|
+
`).length, g = a.split(`
|
|
1695
|
+
`).length + 1;
|
|
1696
|
+
return `${n}${l}${dist_J({
|
|
1697
|
+
output: e.output,
|
|
1698
|
+
options: this.options,
|
|
1699
|
+
cursor: this.cursor,
|
|
1700
|
+
maxItems: e.maxItems,
|
|
1701
|
+
columnPadding: l.length,
|
|
1702
|
+
rowPadding: d + g,
|
|
1703
|
+
style: u
|
|
1704
|
+
}).join(`
|
|
1705
|
+
${l}`)}
|
|
1706
|
+
${a}
|
|
1707
|
+
`;
|
|
1708
|
+
}
|
|
1677
1709
|
default:
|
|
1678
|
-
|
|
1679
|
-
|
|
1710
|
+
{
|
|
1711
|
+
const l = `${picocolors_default().cyan(dist_h)} `, a = n.split(`
|
|
1712
|
+
`).length;
|
|
1713
|
+
return `${n}${l}${dist_J({
|
|
1714
|
+
output: e.output,
|
|
1715
|
+
options: this.options,
|
|
1716
|
+
cursor: this.cursor,
|
|
1717
|
+
maxItems: e.maxItems,
|
|
1718
|
+
columnPadding: l.length,
|
|
1719
|
+
rowPadding: a + 2,
|
|
1720
|
+
style: u
|
|
1721
|
+
}).join(`
|
|
1722
|
+
${l}`)}
|
|
1723
|
+
${picocolors_default().cyan(dist_x)}
|
|
1680
1724
|
`;
|
|
1725
|
+
}
|
|
1681
1726
|
}
|
|
1682
1727
|
}
|
|
1683
|
-
}).prompt()
|
|
1684
|
-
|
|
1685
|
-
|
|
1728
|
+
}).prompt();
|
|
1729
|
+
}, jt = (e)=>picocolors_default().dim(e), dist_Vt = (e, r, s)=>{
|
|
1730
|
+
const i = {
|
|
1731
|
+
hard: !0,
|
|
1732
|
+
trim: !1
|
|
1733
|
+
}, n = dist_q(e, r, i).split(`
|
|
1734
|
+
`), o = n.reduce((a, d)=>Math.max(dist_M(d), a), 0), u = n.map(s).reduce((a, d)=>Math.max(dist_M(d), a), 0), l = r - (u - o);
|
|
1735
|
+
return dist_q(e, l, i);
|
|
1736
|
+
}, dist_kt = (e = "", r = "", s)=>{
|
|
1737
|
+
const i = s?.output ?? node_process.stdout, n = (s?.withGuide ?? dist_.withGuide) !== !1, o = s?.format ?? jt, u = [
|
|
1738
|
+
"",
|
|
1739
|
+
...dist_Vt(e, dist_rt(i) - 6, o).split(`
|
|
1740
|
+
`).map(o),
|
|
1741
|
+
""
|
|
1742
|
+
], l = dist_M(r), a = Math.max(u.reduce((p, y)=>{
|
|
1743
|
+
const $ = dist_M(y);
|
|
1744
|
+
return $ > p ? $ : p;
|
|
1745
|
+
}, 0), l) + 2, d = u.map((p)=>`${picocolors.gray(dist_h)} ${p}${" ".repeat(a - dist_M(p))}${picocolors.gray(dist_h)}`).join(`
|
|
1746
|
+
`), g = n ? `${picocolors.gray(dist_h)}
|
|
1747
|
+
` : "", E = n ? Ne : pe;
|
|
1748
|
+
i.write(`${g}${picocolors.green(dist_k)} ${picocolors_default().reset(r)} ${picocolors.gray(se.repeat(Math.max(a - l - 1, 1)) + he)}
|
|
1749
|
+
${d}
|
|
1750
|
+
${picocolors.gray(E + se.repeat(a + 2) + me)}
|
|
1751
|
+
`);
|
|
1752
|
+
};
|
|
1753
|
+
picocolors.magenta, dist_w("\u2500", "-"), dist_w("\u2501", "="), dist_w("\u2588", "#");
|
|
1754
|
+
const oe = (e, r)=>e.includes(`
|
|
1755
|
+
`) ? e.split(`
|
|
1756
|
+
`).map((s)=>r(s)).join(`
|
|
1757
|
+
`) : r(e), qt = (e)=>{
|
|
1758
|
+
const r = (s, i)=>{
|
|
1759
|
+
const n = s.label ?? String(s.value);
|
|
1686
1760
|
switch(i){
|
|
1761
|
+
case "disabled":
|
|
1762
|
+
return `${picocolors.gray(dist_K)} ${oe(n, picocolors.gray)}${s.hint ? ` ${picocolors_default().dim(`(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
1687
1763
|
case "selected":
|
|
1688
|
-
return `${picocolors.dim
|
|
1764
|
+
return `${oe(n, picocolors.dim)}`;
|
|
1689
1765
|
case "active":
|
|
1690
|
-
return `${picocolors.green(
|
|
1766
|
+
return `${picocolors.green(dist_Y)} ${n}${s.hint ? ` ${picocolors_default().dim(`(${s.hint})`)}` : ""}`;
|
|
1691
1767
|
case "cancelled":
|
|
1692
|
-
return `${picocolors.strikethrough(
|
|
1768
|
+
return `${oe(n, (o)=>picocolors.strikethrough(picocolors_default().dim(o)))}`;
|
|
1693
1769
|
default:
|
|
1694
|
-
return `${
|
|
1770
|
+
return `${picocolors_default().dim(dist_K)} ${oe(n, picocolors.dim)}`;
|
|
1695
1771
|
}
|
|
1696
1772
|
};
|
|
1697
|
-
return new
|
|
1698
|
-
options:
|
|
1699
|
-
|
|
1773
|
+
return new Wt({
|
|
1774
|
+
options: e.options,
|
|
1775
|
+
signal: e.signal,
|
|
1776
|
+
input: e.input,
|
|
1777
|
+
output: e.output,
|
|
1778
|
+
initialValue: e.initialValue,
|
|
1700
1779
|
render () {
|
|
1701
|
-
const
|
|
1702
|
-
${
|
|
1780
|
+
const s = `${N(this.state)} `, i = `${Ee(this.state)} `, n = Bt(e.output, e.message, i, s), o = `${picocolors.gray(dist_h)}
|
|
1781
|
+
${n}
|
|
1703
1782
|
`;
|
|
1704
1783
|
switch(this.state){
|
|
1705
1784
|
case "submit":
|
|
1706
|
-
|
|
1785
|
+
{
|
|
1786
|
+
const u = `${picocolors.gray(dist_h)} `, l = Bt(e.output, r(this.options[this.cursor], "selected"), u);
|
|
1787
|
+
return `${o}${l}`;
|
|
1788
|
+
}
|
|
1707
1789
|
case "cancel":
|
|
1708
|
-
|
|
1709
|
-
|
|
1790
|
+
{
|
|
1791
|
+
const u = `${picocolors.gray(dist_h)} `, l = Bt(e.output, r(this.options[this.cursor], "cancelled"), u);
|
|
1792
|
+
return `${o}${l}
|
|
1793
|
+
${picocolors.gray(dist_h)}`;
|
|
1794
|
+
}
|
|
1710
1795
|
default:
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1796
|
+
{
|
|
1797
|
+
const u = `${picocolors_default().cyan(dist_h)} `, l = o.split(`
|
|
1798
|
+
`).length;
|
|
1799
|
+
return `${o}${u}${dist_J({
|
|
1800
|
+
output: e.output,
|
|
1801
|
+
cursor: this.cursor,
|
|
1802
|
+
options: this.options,
|
|
1803
|
+
maxItems: e.maxItems,
|
|
1804
|
+
columnPadding: u.length,
|
|
1805
|
+
rowPadding: l + 2,
|
|
1806
|
+
style: (a, d)=>r(a, a.disabled ? "disabled" : d ? "active" : "inactive")
|
|
1807
|
+
}).join(`
|
|
1808
|
+
${u}`)}
|
|
1809
|
+
${picocolors_default().cyan(dist_x)}
|
|
1719
1810
|
`;
|
|
1811
|
+
}
|
|
1720
1812
|
}
|
|
1721
1813
|
}
|
|
1722
1814
|
}).prompt();
|
|
1723
|
-
},
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
required: t.required ?? !0,
|
|
1732
|
-
cursorAt: t.cursorAt,
|
|
1733
|
-
validate (r) {
|
|
1734
|
-
if (this.required && 0 === r.length) return `Please select at least one option.
|
|
1735
|
-
${picocolors.reset(picocolors.dim(`Press ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" space ")))} to select, ${picocolors.gray(picocolors.bgWhite(picocolors.inverse(" enter ")))} to submit`))}`;
|
|
1736
|
-
},
|
|
1815
|
+
}, Qt = (picocolors.gray(dist_h), (e)=>new dist_$t({
|
|
1816
|
+
validate: e.validate,
|
|
1817
|
+
placeholder: e.placeholder,
|
|
1818
|
+
defaultValue: e.defaultValue,
|
|
1819
|
+
initialValue: e.initialValue,
|
|
1820
|
+
output: e.output,
|
|
1821
|
+
signal: e.signal,
|
|
1822
|
+
input: e.input,
|
|
1737
1823
|
render () {
|
|
1738
|
-
const r = `${picocolors.gray(
|
|
1739
|
-
${
|
|
1740
|
-
`, i = (
|
|
1741
|
-
const a = this.value.includes(s.value);
|
|
1742
|
-
return c && a ? n(s, "active-selected") : a ? n(s, "selected") : n(s, c ? "active" : "inactive");
|
|
1743
|
-
};
|
|
1824
|
+
const r = (e?.withGuide ?? dist_.withGuide) !== !1, s = `${r ? `${picocolors.gray(dist_h)}
|
|
1825
|
+
` : ""}${N(this.state)} ${e.message}
|
|
1826
|
+
`, i = e.placeholder ? picocolors.inverse(e.placeholder[0]) + picocolors_default().dim(e.placeholder.slice(1)) : picocolors.inverse(picocolors.hidden("_")), n = this.userInput ? this.userInputWithCursor : i, o = this.value ?? "";
|
|
1744
1827
|
switch(this.state){
|
|
1828
|
+
case "error":
|
|
1829
|
+
{
|
|
1830
|
+
const u = this.error ? ` ${picocolors.yellow(this.error)}` : "", l = r ? `${picocolors.yellow(dist_h)} ` : "", a = r ? picocolors.yellow(dist_x) : "";
|
|
1831
|
+
return `${s.trim()}
|
|
1832
|
+
${l}${n}
|
|
1833
|
+
${a}${u}
|
|
1834
|
+
`;
|
|
1835
|
+
}
|
|
1745
1836
|
case "submit":
|
|
1746
|
-
return `${r}${picocolors.gray(dist_o)} ${this.options.filter(({ value: s })=>this.value.includes(s)).map((s)=>n(s, "submitted")).join(picocolors.dim(", ")) || picocolors.dim("none")}`;
|
|
1747
|
-
case "cancel":
|
|
1748
1837
|
{
|
|
1749
|
-
const
|
|
1750
|
-
return `${
|
|
1751
|
-
${picocolors.gray(dist_o)}` : ""}`;
|
|
1838
|
+
const u = o ? ` ${picocolors_default().dim(o)}` : "", l = r ? picocolors.gray(dist_h) : "";
|
|
1839
|
+
return `${s}${l}${u}`;
|
|
1752
1840
|
}
|
|
1753
|
-
case "
|
|
1841
|
+
case "cancel":
|
|
1754
1842
|
{
|
|
1755
|
-
const
|
|
1756
|
-
|
|
1757
|
-
`
|
|
1758
|
-
return `${r + picocolors.yellow(dist_o)} ${dist_G({
|
|
1759
|
-
options: this.options,
|
|
1760
|
-
cursor: this.cursor,
|
|
1761
|
-
maxItems: t.maxItems,
|
|
1762
|
-
style: i
|
|
1763
|
-
}).join(`
|
|
1764
|
-
${picocolors.yellow(dist_o)} `)}
|
|
1765
|
-
${s}
|
|
1766
|
-
`;
|
|
1843
|
+
const u = o ? ` ${picocolors.strikethrough(picocolors_default().dim(o))}` : "", l = r ? picocolors.gray(dist_h) : "";
|
|
1844
|
+
return `${s}${l}${u}${o.trim() ? `
|
|
1845
|
+
${l}` : ""}`;
|
|
1767
1846
|
}
|
|
1768
1847
|
default:
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
style: i
|
|
1774
|
-
}).join(`
|
|
1775
|
-
${picocolors.cyan(dist_o)} `)}
|
|
1776
|
-
${picocolors.cyan(dist_d)}
|
|
1848
|
+
{
|
|
1849
|
+
const u = r ? `${picocolors_default().cyan(dist_h)} ` : "", l = r ? picocolors_default().cyan(dist_x) : "";
|
|
1850
|
+
return `${s}${u}${n}
|
|
1851
|
+
${l}
|
|
1777
1852
|
`;
|
|
1853
|
+
}
|
|
1778
1854
|
}
|
|
1779
1855
|
}
|
|
1780
|
-
}).prompt();
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
`);
|
|
1790
|
-
process.stdout.write(`${picocolors.gray(dist_o)}
|
|
1791
|
-
${picocolors.green(dist_C)} ${picocolors.reset(n)} ${picocolors.gray(dist_.repeat(Math.max(s - i - 1, 1)) + me)}
|
|
1792
|
-
${c}
|
|
1793
|
-
${picocolors.gray(de + dist_.repeat(s + 2) + pe)}
|
|
1794
|
-
`);
|
|
1795
|
-
}, xe = (t = "")=>{
|
|
1796
|
-
process.stdout.write(`${picocolors.gray(dist_d)} ${picocolors.red(t)}
|
|
1797
|
-
|
|
1798
|
-
`);
|
|
1799
|
-
}, Se = (t = "")=>{
|
|
1800
|
-
process.stdout.write(`${picocolors.gray(dist_o)}
|
|
1801
|
-
${picocolors.gray(dist_d)} ${t}
|
|
1802
|
-
|
|
1803
|
-
`);
|
|
1804
|
-
};
|
|
1805
|
-
picocolors.gray(dist_o);
|
|
1806
|
-
var dist = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.0.0/node_modules/@vercel/detect-agent/dist/index.js");
|
|
1807
|
-
var cross_spawn = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js");
|
|
1808
|
-
var cross_spawn_default = /*#__PURE__*/ __webpack_require__.n(cross_spawn);
|
|
1809
|
-
var cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
1810
|
-
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
1811
|
-
var minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
1812
|
-
var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
|
|
1856
|
+
}).prompt());
|
|
1857
|
+
const createStyler = (style)=>(text)=>styleText(style, String(text));
|
|
1858
|
+
const bold = createStyler('bold');
|
|
1859
|
+
const red = createStyler('red');
|
|
1860
|
+
const green = createStyler('green');
|
|
1861
|
+
const yellow = createStyler('yellow');
|
|
1862
|
+
const magenta = createStyler('magenta');
|
|
1863
|
+
const cyan = createStyler('cyan');
|
|
1864
|
+
const gray = createStyler('gray');
|
|
1813
1865
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
|
|
1814
1866
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
1815
1867
|
const position = argv.indexOf(prefix + flag);
|
|
1816
1868
|
const terminatorPosition = argv.indexOf('--');
|
|
1817
1869
|
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
1818
1870
|
}
|
|
1819
|
-
const { env } = node_process;
|
|
1871
|
+
const { env: env } = node_process;
|
|
1820
1872
|
let flagForceColor;
|
|
1821
1873
|
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
1822
1874
|
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
@@ -1916,24 +1968,6 @@ let errorStackRegExp = /at [^\r\n]{0,200}:\d+:\d+[\s\)]*$/;
|
|
|
1916
1968
|
let anonymousErrorStackRegExp = /at [^\r\n]{0,200}\(<anonymous>\)$/;
|
|
1917
1969
|
let indexErrorStackRegExp = /at [^\r\n]{0,200}\(index\s\d+\)$/;
|
|
1918
1970
|
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message) || indexErrorStackRegExp.test(message);
|
|
1919
|
-
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
1920
|
-
let string = '' + input;
|
|
1921
|
-
let index = string.indexOf(close, open.length);
|
|
1922
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
1923
|
-
} : String;
|
|
1924
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
1925
|
-
let start = string.substring(0, index) + replace;
|
|
1926
|
-
let end = string.substring(index + close.length);
|
|
1927
|
-
let nextIndex = end.indexOf(close);
|
|
1928
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
1929
|
-
};
|
|
1930
|
-
const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
|
|
1931
|
-
const red = formatter('\x1b[31m', '\x1b[39m');
|
|
1932
|
-
const green = formatter('\x1b[32m', '\x1b[39m');
|
|
1933
|
-
const yellow = formatter('\x1b[33m', '\x1b[39m');
|
|
1934
|
-
const magenta = formatter('\x1b[35m', '\x1b[39m');
|
|
1935
|
-
const cyan = formatter('\x1b[36m', '\x1b[39m');
|
|
1936
|
-
const gray = formatter('\x1b[90m', '\x1b[39m');
|
|
1937
1971
|
let startColor = [
|
|
1938
1972
|
189,
|
|
1939
1973
|
255,
|
|
@@ -2069,14 +2103,21 @@ let createLogger = (options = {})=>{
|
|
|
2069
2103
|
return logger;
|
|
2070
2104
|
};
|
|
2071
2105
|
let src_logger = createLogger();
|
|
2106
|
+
const dist = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.1.0/node_modules/@vercel/detect-agent/dist/index.js");
|
|
2107
|
+
const cross_spawn = __webpack_require__("./node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js");
|
|
2108
|
+
var cross_spawn_default = /*#__PURE__*/ __webpack_require__.n(cross_spawn);
|
|
2109
|
+
const cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
2110
|
+
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
2111
|
+
const minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
2112
|
+
var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
|
|
2072
2113
|
const src_filename = fileURLToPath(import.meta.url);
|
|
2073
2114
|
const src_dirname = dirname(src_filename);
|
|
2074
2115
|
function cancelAndExit() {
|
|
2075
|
-
|
|
2116
|
+
Pt('Operation cancelled.');
|
|
2076
2117
|
process.exit(0);
|
|
2077
2118
|
}
|
|
2078
2119
|
function checkCancel(value) {
|
|
2079
|
-
if (
|
|
2120
|
+
if (Ct(value)) cancelAndExit();
|
|
2080
2121
|
return value;
|
|
2081
2122
|
}
|
|
2082
2123
|
function formatProjectName(input) {
|
|
@@ -2138,10 +2179,14 @@ function logHelpMessage(name, templates, extraTools) {
|
|
|
2138
2179
|
${toolsList.join(', ')}
|
|
2139
2180
|
`);
|
|
2140
2181
|
}
|
|
2141
|
-
async function getTools({ tools, dir, template }, extraTools) {
|
|
2182
|
+
async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
2142
2183
|
const parsedTools = parseToolsOption(tools);
|
|
2184
|
+
const filteredExtraTools = extraTools?.filter((tool)=>{
|
|
2185
|
+
const when = tool.when ?? (()=>true);
|
|
2186
|
+
return templateName ? when(templateName) : true;
|
|
2187
|
+
});
|
|
2143
2188
|
if (null !== parsedTools) {
|
|
2144
|
-
const toolsArr = parsedTools.filter((tool)=>BUILTIN_TOOLS.includes(tool) ||
|
|
2189
|
+
const toolsArr = parsedTools.filter((tool)=>BUILTIN_TOOLS.includes(tool) || filteredExtraTools?.some((extraTool)=>extraTool.value === tool));
|
|
2145
2190
|
return toolsArr;
|
|
2146
2191
|
}
|
|
2147
2192
|
if (dir && template) return [];
|
|
@@ -2159,16 +2204,16 @@ async function getTools({ tools, dir, template }, extraTools) {
|
|
|
2159
2204
|
label: 'Prettier - formatting'
|
|
2160
2205
|
}
|
|
2161
2206
|
];
|
|
2162
|
-
if (
|
|
2207
|
+
if (filteredExtraTools) {
|
|
2163
2208
|
const normalize = (tool)=>({
|
|
2164
2209
|
value: tool.value,
|
|
2165
2210
|
label: tool.label,
|
|
2166
2211
|
hint: tool.command
|
|
2167
2212
|
});
|
|
2168
|
-
options.unshift(...
|
|
2169
|
-
options.push(...
|
|
2213
|
+
options.unshift(...filteredExtraTools.filter((tool)=>'pre' === tool.order).map(normalize));
|
|
2214
|
+
options.push(...filteredExtraTools.filter((tool)=>'pre' !== tool.order).map(normalize));
|
|
2170
2215
|
}
|
|
2171
|
-
return checkCancel(await
|
|
2216
|
+
return checkCancel(await dist_Lt({
|
|
2172
2217
|
message: 'Select additional tools (Use <space> to select, <enter> to continue)',
|
|
2173
2218
|
options,
|
|
2174
2219
|
required: false
|
|
@@ -2225,12 +2270,12 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2225
2270
|
packageManager
|
|
2226
2271
|
};
|
|
2227
2272
|
if (!version) version = (await readPackageJson(root)).version;
|
|
2228
|
-
const projectName = argv.dir ?? checkCancel(await
|
|
2273
|
+
const projectName = argv.dir ?? checkCancel(await Qt({
|
|
2229
2274
|
message: 'Project name or path',
|
|
2230
2275
|
placeholder: `${name.toLowerCase()}-project`,
|
|
2231
2276
|
defaultValue: `${name.toLowerCase()}-project`,
|
|
2232
2277
|
validate (value) {
|
|
2233
|
-
if (
|
|
2278
|
+
if (value?.length === 0) return 'Project name is required';
|
|
2234
2279
|
}
|
|
2235
2280
|
}));
|
|
2236
2281
|
const formatted = formatProjectName(projectName);
|
|
@@ -2238,7 +2283,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2238
2283
|
const packageName = argv.packageName || formatted.packageName;
|
|
2239
2284
|
const distFolder = node_path.isAbsolute(targetDir) ? targetDir : node_path.join(cwd, targetDir);
|
|
2240
2285
|
if (!argv.override && external_node_fs_["default"].existsSync(distFolder) && !isEmptyDir(distFolder)) {
|
|
2241
|
-
const option = checkCancel(await
|
|
2286
|
+
const option = checkCancel(await qt({
|
|
2242
2287
|
message: `"${targetDir}" is not empty, please choose:`,
|
|
2243
2288
|
options: [
|
|
2244
2289
|
{
|
|
@@ -2254,7 +2299,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2254
2299
|
if ('no' === option) cancelAndExit();
|
|
2255
2300
|
}
|
|
2256
2301
|
const templateName = await getTemplateName(argv);
|
|
2257
|
-
const tools = await getTools(argv, extraTools);
|
|
2302
|
+
const tools = await getTools(argv, extraTools, templateName);
|
|
2258
2303
|
const srcFolder = node_path.join(root, `template-${templateName}`);
|
|
2259
2304
|
const commonFolder = node_path.join(root, 'template-common');
|
|
2260
2305
|
if (!external_node_fs_["default"].existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
|
|
@@ -2333,8 +2378,8 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
2333
2378
|
`3. ${picocolors_default().cyan(`${packageManager} install`)}`,
|
|
2334
2379
|
`4. ${picocolors_default().cyan(`${packageManager} run dev`)}`
|
|
2335
2380
|
];
|
|
2336
|
-
if (nextSteps.length)
|
|
2337
|
-
|
|
2381
|
+
if (nextSteps.length) dist_kt(nextSteps.map((step)=>picocolors_default().reset(step)).join('\n'), 'Next steps');
|
|
2382
|
+
dist_Wt('All set, happy coding!');
|
|
2338
2383
|
}
|
|
2339
2384
|
function sortObjectKeys(obj) {
|
|
2340
2385
|
const sortedKeys = Object.keys(obj).sort();
|
|
@@ -2473,8 +2518,17 @@ function mergeAgentsFiles(agentsFiles) {
|
|
|
2473
2518
|
for (const [, section] of Object.entries(allSections)){
|
|
2474
2519
|
result.push(`${'#'.repeat(section.level)} ${section.title}`);
|
|
2475
2520
|
result.push('');
|
|
2476
|
-
for
|
|
2521
|
+
for(let i = 0; i < section.contents.length; i++){
|
|
2522
|
+
const content = section.contents[i];
|
|
2523
|
+
const nextContent = section.contents[i + 1];
|
|
2477
2524
|
result.push(content);
|
|
2525
|
+
if (nextContent) {
|
|
2526
|
+
const lastNewLineIndex = content.lastIndexOf('\n');
|
|
2527
|
+
const lastLine = -1 === lastNewLineIndex ? content : content.substring(lastNewLineIndex + 1);
|
|
2528
|
+
const firstNewLineIndex = nextContent.indexOf('\n');
|
|
2529
|
+
const nextFirstLine = -1 === firstNewLineIndex ? nextContent : nextContent.substring(0, firstNewLineIndex);
|
|
2530
|
+
if (lastLine.startsWith('- ') && nextFirstLine.startsWith('- ')) continue;
|
|
2531
|
+
}
|
|
2478
2532
|
result.push('');
|
|
2479
2533
|
}
|
|
2480
2534
|
}
|
|
@@ -2488,4 +2542,4 @@ function collectAgentsFiles(agentsMdSearchDirs) {
|
|
|
2488
2542
|
}
|
|
2489
2543
|
return agentsFiles;
|
|
2490
2544
|
}
|
|
2491
|
-
export { BUILTIN_TOOLS, checkCancel, collectAgentsFiles, copyFolder, create,
|
|
2545
|
+
export { BUILTIN_TOOLS, Qt as text, checkCancel, collectAgentsFiles, copyFolder, create, dist_Lt as multiselect, mergeAgentsFiles, mergePackageJson, qt as select };
|