@mherod/get-cookie 2.0.0-rc.26 → 2.0.0-rc.27
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/cli.js +10095 -546
- package/dist/index.js +10037 -17143
- package/dist/index.js.map +1 -1
- package/dist/module.js +165 -222
- package/dist/module.js.map +1 -1
- package/dist/prompt.2dcd57a4.js +736 -0
- package/dist/prompt.ad369937.js +736 -0
- package/dist/prompt.ebd83909.js +736 -0
- package/dist/prompt.fb2c7dad.js +1002 -0
- package/dist/prompt.fb2c7dad.js.map +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/browsers/CompositeCookieQueryStrategy.ts +6 -3
- package/src/cli.ts +6 -3
- package/src/comboQueryCookieSpec.ts +1 -1
- package/src/cookieSpecsFromUrl.ts +5 -1
- package/src/fetchWithCookies.ts +19 -4
- package/src/getMergedRenderedCookies.ts +6 -1
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
function $parcel$interopDefault(D) {
|
|
2
|
+
return D && D.__esModule ? D.default : D;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
var D = require("node:process"), u = require("node:readline"), e = require("node:tty"), t = require("tty");
|
|
6
|
+
|
|
7
|
+
require("node:util"), require("node:path");
|
|
8
|
+
|
|
9
|
+
var r = ("undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : {}).parcelRequire5c26;
|
|
10
|
+
|
|
11
|
+
r.register("ktfWu", (function(s, i) {
|
|
12
|
+
function $3637fed4480c7ff6$var$$(D) {
|
|
13
|
+
if ("string" != typeof D) throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);
|
|
14
|
+
return D.replace(function $3637fed4480c7ff6$var$z({onlyFirst: D = !1} = {}) {
|
|
15
|
+
const u = [ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" ].join("|");
|
|
16
|
+
return new RegExp(u, D ? void 0 : "g");
|
|
17
|
+
}(), "");
|
|
18
|
+
}
|
|
19
|
+
function $3637fed4480c7ff6$var$c(D, u = {}) {
|
|
20
|
+
if ("string" != typeof D || 0 === D.length || (u = {
|
|
21
|
+
ambiguousIsNarrow: !0,
|
|
22
|
+
...u
|
|
23
|
+
}, 0 === (D = $3637fed4480c7ff6$var$$(D)).length)) return 0;
|
|
24
|
+
D = D.replace(/\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\u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DBD])|\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\uDF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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, " ");
|
|
25
|
+
const e = u.ambiguousIsNarrow ? 1 : 2;
|
|
26
|
+
let t = 0;
|
|
27
|
+
for (const u of D) {
|
|
28
|
+
const D = u.codePointAt(0);
|
|
29
|
+
if (!(D <= 31 || D >= 127 && D <= 159 || D >= 768 && D <= 879)) switch ($.eastAsianWidth(u)) {
|
|
30
|
+
case "F":
|
|
31
|
+
case "W":
|
|
32
|
+
t += 2;
|
|
33
|
+
break;
|
|
34
|
+
|
|
35
|
+
case "A":
|
|
36
|
+
t += e;
|
|
37
|
+
break;
|
|
38
|
+
|
|
39
|
+
default:
|
|
40
|
+
t += 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
}
|
|
45
|
+
function $3637fed4480c7ff6$var$P(D, u, e) {
|
|
46
|
+
return String(D).normalize().replace(/\r\n/g, "\n").split("\n").map((D => ((D, u, e = {}) => {
|
|
47
|
+
if (!1 !== e.trim && "" === D.trim()) return "";
|
|
48
|
+
let t, r, s = "";
|
|
49
|
+
const i = (D => D.split(" ").map((D => $3637fed4480c7ff6$var$c(D))))(D);
|
|
50
|
+
let C = [ "" ];
|
|
51
|
+
for (const [t, r] of D.split(" ").entries()) {
|
|
52
|
+
!1 !== e.trim && (C[C.length - 1] = C[C.length - 1].trimStart());
|
|
53
|
+
let D = $3637fed4480c7ff6$var$c(C[C.length - 1]);
|
|
54
|
+
if (0 !== t && (D >= u && (!1 === e.wordWrap || !1 === e.trim) && (C.push(""), D = 0),
|
|
55
|
+
(D > 0 || !1 === e.trim) && (C[C.length - 1] += " ", D++)), e.hard && i[t] > u) {
|
|
56
|
+
const e = u - D, s = 1 + Math.floor((i[t] - e - 1) / u);
|
|
57
|
+
Math.floor((i[t] - 1) / u) < s && C.push(""), $3637fed4480c7ff6$var$_(C, r, u);
|
|
58
|
+
} else {
|
|
59
|
+
if (D + i[t] > u && D > 0 && i[t] > 0) {
|
|
60
|
+
if (!1 === e.wordWrap && D < u) {
|
|
61
|
+
$3637fed4480c7ff6$var$_(C, r, u);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
C.push("");
|
|
65
|
+
}
|
|
66
|
+
D + i[t] > u && !1 === e.wordWrap ? $3637fed4480c7ff6$var$_(C, r, u) : C[C.length - 1] += r;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
!1 !== e.trim && (C = C.map((D => (D => {
|
|
70
|
+
const u = D.split(" ");
|
|
71
|
+
let e = u.length;
|
|
72
|
+
for (;e > 0 && !($3637fed4480c7ff6$var$c(u[e - 1]) > 0); ) e--;
|
|
73
|
+
return e === u.length ? D : u.slice(0, e).join(" ") + u.slice(e).join("");
|
|
74
|
+
})(D))));
|
|
75
|
+
const n = [ ...C.join("\n") ];
|
|
76
|
+
for (const [D, u] of n.entries()) {
|
|
77
|
+
if (s += u, p.has(u)) {
|
|
78
|
+
const {groups: u} = new RegExp(`(?:\\[(?<code>\\d+)m|\\${A}(?<uri>.*))`).exec(n.slice(D).join("")) || {
|
|
79
|
+
groups: {}
|
|
80
|
+
};
|
|
81
|
+
if (void 0 !== u.code) {
|
|
82
|
+
const D = Number.parseFloat(u.code);
|
|
83
|
+
t = 39 === D ? void 0 : D;
|
|
84
|
+
} else void 0 !== u.uri && (r = 0 === u.uri.length ? void 0 : u.uri);
|
|
85
|
+
}
|
|
86
|
+
const e = f.codes.get(Number(t));
|
|
87
|
+
"\n" === n[D + 1] ? (r && (s += $3637fed4480c7ff6$var$j("")), t && e && (s += $3637fed4480c7ff6$var$N(e))) : "\n" === u && (t && e && (s += $3637fed4480c7ff6$var$N(t)),
|
|
88
|
+
r && (s += $3637fed4480c7ff6$var$j(r)));
|
|
89
|
+
}
|
|
90
|
+
return s;
|
|
91
|
+
})(D, u, e))).join("\n");
|
|
92
|
+
}
|
|
93
|
+
function $3637fed4480c7ff6$var$g(D, u) {
|
|
94
|
+
D.isTTY && D.setRawMode(u);
|
|
95
|
+
}
|
|
96
|
+
async function $3637fed4480c7ff6$export$195ba6d62321b933(D, u = {}) {
|
|
97
|
+
if (!u.type || "text" === u.type) return await $3637fed4480c7ff6$var$text({
|
|
98
|
+
message: D,
|
|
99
|
+
defaultValue: u.default,
|
|
100
|
+
placeholder: u.placeholder,
|
|
101
|
+
initialValue: u.initial
|
|
102
|
+
});
|
|
103
|
+
if ("confirm" === u.type) return await $3637fed4480c7ff6$var$confirm({
|
|
104
|
+
message: D,
|
|
105
|
+
initialValue: u.initial
|
|
106
|
+
});
|
|
107
|
+
if ("select" === u.type) return await $3637fed4480c7ff6$var$select({
|
|
108
|
+
message: D,
|
|
109
|
+
options: u.options.map((D => "string" == typeof D ? {
|
|
110
|
+
value: D,
|
|
111
|
+
label: D
|
|
112
|
+
} : D))
|
|
113
|
+
});
|
|
114
|
+
if ("multiselect" === u.type) return await $3637fed4480c7ff6$var$multiselect({
|
|
115
|
+
message: D,
|
|
116
|
+
options: u.options.map((D => "string" == typeof D ? {
|
|
117
|
+
value: D,
|
|
118
|
+
label: D
|
|
119
|
+
} : D)),
|
|
120
|
+
required: u.required
|
|
121
|
+
});
|
|
122
|
+
throw new Error(`Unknown prompt type: ${u.type}`);
|
|
123
|
+
}
|
|
124
|
+
!function $parcel$export(D, u, e, t) {
|
|
125
|
+
Object.defineProperty(D, u, {
|
|
126
|
+
get: e,
|
|
127
|
+
set: t,
|
|
128
|
+
enumerable: !0,
|
|
129
|
+
configurable: !0
|
|
130
|
+
});
|
|
131
|
+
}(s.exports, "prompt", (() => $3637fed4480c7ff6$export$195ba6d62321b933));
|
|
132
|
+
var C = r("52uPe");
|
|
133
|
+
r("1Q6tZ"), r("4zhKd");
|
|
134
|
+
const n = {
|
|
135
|
+
to: (D, u) => u ? `[${u + 1};${D + 1}H` : `[${D + 1}G`,
|
|
136
|
+
move(D, u) {
|
|
137
|
+
let e = "";
|
|
138
|
+
return D < 0 ? e += `[${-D}D` : D > 0 && (e += `[${D}C`), u < 0 ? e += `[${-u}A` : u > 0 && (e += `[${u}B`),
|
|
139
|
+
e;
|
|
140
|
+
},
|
|
141
|
+
up: (D = 1) => `[${D}A`,
|
|
142
|
+
down: (D = 1) => `[${D}B`,
|
|
143
|
+
forward: (D = 1) => `[${D}C`,
|
|
144
|
+
backward: (D = 1) => `[${D}D`,
|
|
145
|
+
nextLine: (D = 1) => "[E".repeat(D),
|
|
146
|
+
prevLine: (D = 1) => "[F".repeat(D),
|
|
147
|
+
left: "[G",
|
|
148
|
+
hide: "[?25l",
|
|
149
|
+
show: "[?25h",
|
|
150
|
+
save: "7",
|
|
151
|
+
restore: "8"
|
|
152
|
+
}, E = {
|
|
153
|
+
screen: "[2J",
|
|
154
|
+
up: (D = 1) => "[1J".repeat(D),
|
|
155
|
+
down: (D = 1) => "[J".repeat(D),
|
|
156
|
+
line: "[2K",
|
|
157
|
+
lineEnd: "[K",
|
|
158
|
+
lineStart: "[1K",
|
|
159
|
+
lines(D) {
|
|
160
|
+
let u = "";
|
|
161
|
+
for (let e = 0; e < D; e++) u += this.line + (e < D - 1 ? n.up() : "");
|
|
162
|
+
return D && (u += n.left), u;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
var o = {
|
|
166
|
+
cursor: n,
|
|
167
|
+
scroll: {
|
|
168
|
+
up: (D = 1) => "[S".repeat(D),
|
|
169
|
+
down: (D = 1) => "[T".repeat(D)
|
|
170
|
+
},
|
|
171
|
+
erase: E,
|
|
172
|
+
beep: ""
|
|
173
|
+
}, a = {}, c = {
|
|
174
|
+
get exports() {
|
|
175
|
+
return a;
|
|
176
|
+
},
|
|
177
|
+
set exports(D) {
|
|
178
|
+
a = D;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
let l = $parcel$interopDefault(t), h = !process.argv.includes("--no-color") && (process.argv.includes("--color") || "win32" === process.platform || l.isatty(1) && "dumb" !== process.env.TERM || !1), $3637fed4480c7ff6$var$formatter = (D, u, e = D) => t => {
|
|
182
|
+
let r = "" + t, s = r.indexOf(u, D.length);
|
|
183
|
+
return ~s ? D + $3637fed4480c7ff6$var$replaceClose(r, u, e, s) + u : D + r + u;
|
|
184
|
+
}, $3637fed4480c7ff6$var$replaceClose = (D, u, e, t) => {
|
|
185
|
+
let r = D.substring(0, t) + e, s = D.substring(t + u.length), i = s.indexOf(u);
|
|
186
|
+
return ~i ? r + $3637fed4480c7ff6$var$replaceClose(s, u, e, i) : r + s;
|
|
187
|
+
}, $3637fed4480c7ff6$var$createColors = (D = h) => ({
|
|
188
|
+
isColorSupported: D,
|
|
189
|
+
reset: D ? D => `[0m${D}[0m` : String,
|
|
190
|
+
bold: D ? $3637fed4480c7ff6$var$formatter("[1m", "[22m", "[22m[1m") : String,
|
|
191
|
+
dim: D ? $3637fed4480c7ff6$var$formatter("[2m", "[22m", "[22m[2m") : String,
|
|
192
|
+
italic: D ? $3637fed4480c7ff6$var$formatter("[3m", "[23m") : String,
|
|
193
|
+
underline: D ? $3637fed4480c7ff6$var$formatter("[4m", "[24m") : String,
|
|
194
|
+
inverse: D ? $3637fed4480c7ff6$var$formatter("[7m", "[27m") : String,
|
|
195
|
+
hidden: D ? $3637fed4480c7ff6$var$formatter("[8m", "[28m") : String,
|
|
196
|
+
strikethrough: D ? $3637fed4480c7ff6$var$formatter("[9m", "[29m") : String,
|
|
197
|
+
black: D ? $3637fed4480c7ff6$var$formatter("[30m", "[39m") : String,
|
|
198
|
+
red: D ? $3637fed4480c7ff6$var$formatter("[31m", "[39m") : String,
|
|
199
|
+
green: D ? $3637fed4480c7ff6$var$formatter("[32m", "[39m") : String,
|
|
200
|
+
yellow: D ? $3637fed4480c7ff6$var$formatter("[33m", "[39m") : String,
|
|
201
|
+
blue: D ? $3637fed4480c7ff6$var$formatter("[34m", "[39m") : String,
|
|
202
|
+
magenta: D ? $3637fed4480c7ff6$var$formatter("[35m", "[39m") : String,
|
|
203
|
+
cyan: D ? $3637fed4480c7ff6$var$formatter("[36m", "[39m") : String,
|
|
204
|
+
white: D ? $3637fed4480c7ff6$var$formatter("[37m", "[39m") : String,
|
|
205
|
+
gray: D ? $3637fed4480c7ff6$var$formatter("[90m", "[39m") : String,
|
|
206
|
+
bgBlack: D ? $3637fed4480c7ff6$var$formatter("[40m", "[49m") : String,
|
|
207
|
+
bgRed: D ? $3637fed4480c7ff6$var$formatter("[41m", "[49m") : String,
|
|
208
|
+
bgGreen: D ? $3637fed4480c7ff6$var$formatter("[42m", "[49m") : String,
|
|
209
|
+
bgYellow: D ? $3637fed4480c7ff6$var$formatter("[43m", "[49m") : String,
|
|
210
|
+
bgBlue: D ? $3637fed4480c7ff6$var$formatter("[44m", "[49m") : String,
|
|
211
|
+
bgMagenta: D ? $3637fed4480c7ff6$var$formatter("[45m", "[49m") : String,
|
|
212
|
+
bgCyan: D ? $3637fed4480c7ff6$var$formatter("[46m", "[49m") : String,
|
|
213
|
+
bgWhite: D ? $3637fed4480c7ff6$var$formatter("[47m", "[49m") : String
|
|
214
|
+
});
|
|
215
|
+
c.exports = $3637fed4480c7ff6$var$createColors(), a.createColors = $3637fed4480c7ff6$var$createColors;
|
|
216
|
+
var B = {};
|
|
217
|
+
!function(D) {
|
|
218
|
+
function F(D) {
|
|
219
|
+
return D.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
220
|
+
}
|
|
221
|
+
var u = {};
|
|
222
|
+
D.exports = u, u.eastAsianWidth = function(D) {
|
|
223
|
+
var u = D.charCodeAt(0), e = 2 == D.length ? D.charCodeAt(1) : 0, t = u;
|
|
224
|
+
return 55296 <= u && u <= 56319 && 56320 <= e && e <= 57343 && (t = (u &= 1023) << 10 | (e &= 1023),
|
|
225
|
+
t += 65536), 12288 == t || 65281 <= t && t <= 65376 || 65504 <= t && t <= 65510 ? "F" : 8361 == t || 65377 <= t && t <= 65470 || 65474 <= t && t <= 65479 || 65482 <= t && t <= 65487 || 65490 <= t && t <= 65495 || 65498 <= t && t <= 65500 || 65512 <= t && t <= 65518 ? "H" : 4352 <= t && t <= 4447 || 4515 <= t && t <= 4519 || 4602 <= t && t <= 4607 || 9001 <= t && t <= 9002 || 11904 <= t && t <= 11929 || 11931 <= t && t <= 12019 || 12032 <= t && t <= 12245 || 12272 <= t && t <= 12283 || 12289 <= t && t <= 12350 || 12353 <= t && t <= 12438 || 12441 <= t && t <= 12543 || 12549 <= t && t <= 12589 || 12593 <= t && t <= 12686 || 12688 <= t && t <= 12730 || 12736 <= t && t <= 12771 || 12784 <= t && t <= 12830 || 12832 <= t && t <= 12871 || 12880 <= t && t <= 13054 || 13056 <= t && t <= 19903 || 19968 <= t && t <= 42124 || 42128 <= t && t <= 42182 || 43360 <= t && t <= 43388 || 44032 <= t && t <= 55203 || 55216 <= t && t <= 55238 || 55243 <= t && t <= 55291 || 63744 <= t && t <= 64255 || 65040 <= t && t <= 65049 || 65072 <= t && t <= 65106 || 65108 <= t && t <= 65126 || 65128 <= t && t <= 65131 || 110592 <= t && t <= 110593 || 127488 <= t && t <= 127490 || 127504 <= t && t <= 127546 || 127552 <= t && t <= 127560 || 127568 <= t && t <= 127569 || 131072 <= t && t <= 194367 || 177984 <= t && t <= 196605 || 196608 <= t && t <= 262141 ? "W" : 32 <= t && t <= 126 || 162 <= t && t <= 163 || 165 <= t && t <= 166 || 172 == t || 175 == t || 10214 <= t && t <= 10221 || 10629 <= t && t <= 10630 ? "Na" : 161 == t || 164 == t || 167 <= t && t <= 168 || 170 == t || 173 <= t && t <= 174 || 176 <= t && t <= 180 || 182 <= t && t <= 186 || 188 <= t && t <= 191 || 198 == t || 208 == t || 215 <= t && t <= 216 || 222 <= t && t <= 225 || 230 == t || 232 <= t && t <= 234 || 236 <= t && t <= 237 || 240 == t || 242 <= t && t <= 243 || 247 <= t && t <= 250 || 252 == t || 254 == t || 257 == t || 273 == t || 275 == t || 283 == t || 294 <= t && t <= 295 || 299 == t || 305 <= t && t <= 307 || 312 == t || 319 <= t && t <= 322 || 324 == t || 328 <= t && t <= 331 || 333 == t || 338 <= t && t <= 339 || 358 <= t && t <= 359 || 363 == t || 462 == t || 464 == t || 466 == t || 468 == t || 470 == t || 472 == t || 474 == t || 476 == t || 593 == t || 609 == t || 708 == t || 711 == t || 713 <= t && t <= 715 || 717 == t || 720 == t || 728 <= t && t <= 731 || 733 == t || 735 == t || 768 <= t && t <= 879 || 913 <= t && t <= 929 || 931 <= t && t <= 937 || 945 <= t && t <= 961 || 963 <= t && t <= 969 || 1025 == t || 1040 <= t && t <= 1103 || 1105 == t || 8208 == t || 8211 <= t && t <= 8214 || 8216 <= t && t <= 8217 || 8220 <= t && t <= 8221 || 8224 <= t && t <= 8226 || 8228 <= t && t <= 8231 || 8240 == t || 8242 <= t && t <= 8243 || 8245 == t || 8251 == t || 8254 == t || 8308 == t || 8319 == t || 8321 <= t && t <= 8324 || 8364 == t || 8451 == t || 8453 == t || 8457 == t || 8467 == t || 8470 == t || 8481 <= t && t <= 8482 || 8486 == t || 8491 == t || 8531 <= t && t <= 8532 || 8539 <= t && t <= 8542 || 8544 <= t && t <= 8555 || 8560 <= t && t <= 8569 || 8585 == t || 8592 <= t && t <= 8601 || 8632 <= t && t <= 8633 || 8658 == t || 8660 == t || 8679 == t || 8704 == t || 8706 <= t && t <= 8707 || 8711 <= t && t <= 8712 || 8715 == t || 8719 == t || 8721 == t || 8725 == t || 8730 == t || 8733 <= t && t <= 8736 || 8739 == t || 8741 == t || 8743 <= t && t <= 8748 || 8750 == t || 8756 <= t && t <= 8759 || 8764 <= t && t <= 8765 || 8776 == t || 8780 == t || 8786 == t || 8800 <= t && t <= 8801 || 8804 <= t && t <= 8807 || 8810 <= t && t <= 8811 || 8814 <= t && t <= 8815 || 8834 <= t && t <= 8835 || 8838 <= t && t <= 8839 || 8853 == t || 8857 == t || 8869 == t || 8895 == t || 8978 == t || 9312 <= t && t <= 9449 || 9451 <= t && t <= 9547 || 9552 <= t && t <= 9587 || 9600 <= t && t <= 9615 || 9618 <= t && t <= 9621 || 9632 <= t && t <= 9633 || 9635 <= t && t <= 9641 || 9650 <= t && t <= 9651 || 9654 <= t && t <= 9655 || 9660 <= t && t <= 9661 || 9664 <= t && t <= 9665 || 9670 <= t && t <= 9672 || 9675 == t || 9678 <= t && t <= 9681 || 9698 <= t && t <= 9701 || 9711 == t || 9733 <= t && t <= 9734 || 9737 == t || 9742 <= t && t <= 9743 || 9748 <= t && t <= 9749 || 9756 == t || 9758 == t || 9792 == t || 9794 == t || 9824 <= t && t <= 9825 || 9827 <= t && t <= 9829 || 9831 <= t && t <= 9834 || 9836 <= t && t <= 9837 || 9839 == t || 9886 <= t && t <= 9887 || 9918 <= t && t <= 9919 || 9924 <= t && t <= 9933 || 9935 <= t && t <= 9953 || 9955 == t || 9960 <= t && t <= 9983 || 10045 == t || 10071 == t || 10102 <= t && t <= 10111 || 11093 <= t && t <= 11097 || 12872 <= t && t <= 12879 || 57344 <= t && t <= 63743 || 65024 <= t && t <= 65039 || 65533 == t || 127232 <= t && t <= 127242 || 127248 <= t && t <= 127277 || 127280 <= t && t <= 127337 || 127344 <= t && t <= 127386 || 917760 <= t && t <= 917999 || 983040 <= t && t <= 1048573 || 1048576 <= t && t <= 1114109 ? "A" : "N";
|
|
226
|
+
}, u.characterLength = function(D) {
|
|
227
|
+
var u = this.eastAsianWidth(D);
|
|
228
|
+
return "F" == u || "W" == u || "A" == u ? 2 : 1;
|
|
229
|
+
}, u.length = function(D) {
|
|
230
|
+
for (var u = F(D), e = 0, t = 0; t < u.length; t++) e += this.characterLength(u[t]);
|
|
231
|
+
return e;
|
|
232
|
+
}, u.slice = function(D, e, t) {
|
|
233
|
+
textLen = u.length(D), t = t || 1, (e = e || 0) < 0 && (e = textLen + e), t < 0 && (t = textLen + t);
|
|
234
|
+
for (var r = "", s = 0, i = F(D), C = 0; C < i.length; C++) {
|
|
235
|
+
var n = i[C], E = u.length(n);
|
|
236
|
+
if (s >= e - (2 == E ? 1 : 0)) {
|
|
237
|
+
if (!(s + E <= t)) break;
|
|
238
|
+
r += n;
|
|
239
|
+
}
|
|
240
|
+
s += E;
|
|
241
|
+
}
|
|
242
|
+
return r;
|
|
243
|
+
};
|
|
244
|
+
}({
|
|
245
|
+
get exports() {
|
|
246
|
+
return B;
|
|
247
|
+
},
|
|
248
|
+
set exports(D) {
|
|
249
|
+
B = D;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
const $ = B, $3637fed4480c7ff6$var$L = (D = 0) => u => `[${u + D}m`, $3637fed4480c7ff6$var$M = (D = 0) => u => `[${38 + D};5;${u}m`, $3637fed4480c7ff6$var$T = (D = 0) => (u, e, t) => `[${38 + D};2;${u};${e};${t}m`, d = {
|
|
253
|
+
modifier: {
|
|
254
|
+
reset: [ 0, 0 ],
|
|
255
|
+
bold: [ 1, 22 ],
|
|
256
|
+
dim: [ 2, 22 ],
|
|
257
|
+
italic: [ 3, 23 ],
|
|
258
|
+
underline: [ 4, 24 ],
|
|
259
|
+
overline: [ 53, 55 ],
|
|
260
|
+
inverse: [ 7, 27 ],
|
|
261
|
+
hidden: [ 8, 28 ],
|
|
262
|
+
strikethrough: [ 9, 29 ]
|
|
263
|
+
},
|
|
264
|
+
color: {
|
|
265
|
+
black: [ 30, 39 ],
|
|
266
|
+
red: [ 31, 39 ],
|
|
267
|
+
green: [ 32, 39 ],
|
|
268
|
+
yellow: [ 33, 39 ],
|
|
269
|
+
blue: [ 34, 39 ],
|
|
270
|
+
magenta: [ 35, 39 ],
|
|
271
|
+
cyan: [ 36, 39 ],
|
|
272
|
+
white: [ 37, 39 ],
|
|
273
|
+
blackBright: [ 90, 39 ],
|
|
274
|
+
gray: [ 90, 39 ],
|
|
275
|
+
grey: [ 90, 39 ],
|
|
276
|
+
redBright: [ 91, 39 ],
|
|
277
|
+
greenBright: [ 92, 39 ],
|
|
278
|
+
yellowBright: [ 93, 39 ],
|
|
279
|
+
blueBright: [ 94, 39 ],
|
|
280
|
+
magentaBright: [ 95, 39 ],
|
|
281
|
+
cyanBright: [ 96, 39 ],
|
|
282
|
+
whiteBright: [ 97, 39 ]
|
|
283
|
+
},
|
|
284
|
+
bgColor: {
|
|
285
|
+
bgBlack: [ 40, 49 ],
|
|
286
|
+
bgRed: [ 41, 49 ],
|
|
287
|
+
bgGreen: [ 42, 49 ],
|
|
288
|
+
bgYellow: [ 43, 49 ],
|
|
289
|
+
bgBlue: [ 44, 49 ],
|
|
290
|
+
bgMagenta: [ 45, 49 ],
|
|
291
|
+
bgCyan: [ 46, 49 ],
|
|
292
|
+
bgWhite: [ 47, 49 ],
|
|
293
|
+
bgBlackBright: [ 100, 49 ],
|
|
294
|
+
bgGray: [ 100, 49 ],
|
|
295
|
+
bgGrey: [ 100, 49 ],
|
|
296
|
+
bgRedBright: [ 101, 49 ],
|
|
297
|
+
bgGreenBright: [ 102, 49 ],
|
|
298
|
+
bgYellowBright: [ 103, 49 ],
|
|
299
|
+
bgBlueBright: [ 104, 49 ],
|
|
300
|
+
bgMagentaBright: [ 105, 49 ],
|
|
301
|
+
bgCyanBright: [ 106, 49 ],
|
|
302
|
+
bgWhiteBright: [ 107, 49 ]
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
Object.keys(d.modifier), Object.keys(d.color), Object.keys(d.bgColor);
|
|
306
|
+
const f = function $3637fed4480c7ff6$var$U() {
|
|
307
|
+
const D = new Map;
|
|
308
|
+
for (const [u, e] of Object.entries(d)) {
|
|
309
|
+
for (const [u, t] of Object.entries(e)) d[u] = {
|
|
310
|
+
open: `[${t[0]}m`,
|
|
311
|
+
close: `[${t[1]}m`
|
|
312
|
+
}, e[u] = d[u], D.set(t[0], t[1]);
|
|
313
|
+
Object.defineProperty(d, u, {
|
|
314
|
+
value: e,
|
|
315
|
+
enumerable: !1
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
return Object.defineProperty(d, "codes", {
|
|
319
|
+
value: D,
|
|
320
|
+
enumerable: !1
|
|
321
|
+
}), d.color.close = "[39m", d.bgColor.close = "[49m", d.color.ansi = $3637fed4480c7ff6$var$L(),
|
|
322
|
+
d.color.ansi256 = $3637fed4480c7ff6$var$M(), d.color.ansi16m = $3637fed4480c7ff6$var$T(),
|
|
323
|
+
d.bgColor.ansi = $3637fed4480c7ff6$var$L(10), d.bgColor.ansi256 = $3637fed4480c7ff6$var$M(10),
|
|
324
|
+
d.bgColor.ansi16m = $3637fed4480c7ff6$var$T(10), Object.defineProperties(d, {
|
|
325
|
+
rgbToAnsi256: {
|
|
326
|
+
value: (D, u, e) => D === u && u === e ? D < 8 ? 16 : D > 248 ? 231 : Math.round((D - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(D / 255 * 5) + 6 * Math.round(u / 255 * 5) + Math.round(e / 255 * 5),
|
|
327
|
+
enumerable: !1
|
|
328
|
+
},
|
|
329
|
+
hexToRgb: {
|
|
330
|
+
value: D => {
|
|
331
|
+
const u = /[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));
|
|
332
|
+
if (!u) return [ 0, 0, 0 ];
|
|
333
|
+
let [e] = u;
|
|
334
|
+
3 === e.length && (e = [ ...e ].map((D => D + D)).join(""));
|
|
335
|
+
const t = Number.parseInt(e, 16);
|
|
336
|
+
return [ t >> 16 & 255, t >> 8 & 255, 255 & t ];
|
|
337
|
+
},
|
|
338
|
+
enumerable: !1
|
|
339
|
+
},
|
|
340
|
+
hexToAnsi256: {
|
|
341
|
+
value: D => d.rgbToAnsi256(...d.hexToRgb(D)),
|
|
342
|
+
enumerable: !1
|
|
343
|
+
},
|
|
344
|
+
ansi256ToAnsi: {
|
|
345
|
+
value: D => {
|
|
346
|
+
if (D < 8) return 30 + D;
|
|
347
|
+
if (D < 16) return D - 8 + 90;
|
|
348
|
+
let u, e, t;
|
|
349
|
+
if (D >= 232) u = (10 * (D - 232) + 8) / 255, e = u, t = u; else {
|
|
350
|
+
const r = (D -= 16) % 36;
|
|
351
|
+
u = Math.floor(D / 36) / 5, e = Math.floor(r / 6) / 5, t = r % 6 / 5;
|
|
352
|
+
}
|
|
353
|
+
const r = 2 * Math.max(u, e, t);
|
|
354
|
+
if (0 === r) return 30;
|
|
355
|
+
let s = 30 + (Math.round(t) << 2 | Math.round(e) << 1 | Math.round(u));
|
|
356
|
+
return 2 === r && (s += 60), s;
|
|
357
|
+
},
|
|
358
|
+
enumerable: !1
|
|
359
|
+
},
|
|
360
|
+
rgbToAnsi: {
|
|
361
|
+
value: (D, u, e) => d.ansi256ToAnsi(d.rgbToAnsi256(D, u, e)),
|
|
362
|
+
enumerable: !1
|
|
363
|
+
},
|
|
364
|
+
hexToAnsi: {
|
|
365
|
+
value: D => d.ansi256ToAnsi(d.hexToAnsi256(D)),
|
|
366
|
+
enumerable: !1
|
|
367
|
+
}
|
|
368
|
+
}), d;
|
|
369
|
+
}(), p = new Set([ "", "" ]), A = "]8;;", $3637fed4480c7ff6$var$N = D => `${p.values().next().value}[${D}m`, $3637fed4480c7ff6$var$j = D => `${p.values().next().value}]8;;${D}`, $3637fed4480c7ff6$var$_ = (D, u, e) => {
|
|
370
|
+
const t = [ ...u ];
|
|
371
|
+
let r = !1, s = !1, i = $3637fed4480c7ff6$var$c($3637fed4480c7ff6$var$$(D[D.length - 1]));
|
|
372
|
+
for (const [u, C] of t.entries()) {
|
|
373
|
+
const n = $3637fed4480c7ff6$var$c(C);
|
|
374
|
+
i + n <= e ? D[D.length - 1] += C : (D.push(C), i = 0), p.has(C) && (r = !0, s = t.slice(u + 1).join("").startsWith(A)),
|
|
375
|
+
r ? s ? "" === C && (r = !1, s = !1) : "m" === C && (r = !1) : (i += n, i === e && u < t.length - 1 && (D.push(""),
|
|
376
|
+
i = 0));
|
|
377
|
+
}
|
|
378
|
+
!i && D[D.length - 1].length > 0 && D.length > 1 && (D[D.length - 2] += D.pop());
|
|
379
|
+
}, g = Symbol("clack:cancel"), m = new Map([ [ "k", "up" ], [ "j", "down" ], [ "h", "left" ], [ "l", "right" ] ]), v = new Set([ "up", "down", "left", "right", "space", "enter" ]);
|
|
380
|
+
class $3637fed4480c7ff6$var$h {
|
|
381
|
+
constructor({render: u, input: e = D.stdin, output: t = D.stdout, ...r}, s = !0) {
|
|
382
|
+
this._track = !1, this._cursor = 0, this.state = "initial", this.error = "", this.subscribers = new Map,
|
|
383
|
+
this._prevFrame = "", this.opts = r, this.onKeypress = this.onKeypress.bind(this),
|
|
384
|
+
this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this),
|
|
385
|
+
this._track = s, this.input = e, this.output = t;
|
|
386
|
+
}
|
|
387
|
+
prompt() {
|
|
388
|
+
const D = new (0, e.WriteStream)(0);
|
|
389
|
+
return D._write = (D, u, e) => {
|
|
390
|
+
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor,
|
|
391
|
+
this.emit("value", this.value)), e();
|
|
392
|
+
}, this.input.pipe(D), this.rl = $parcel$interopDefault(u).createInterface({
|
|
393
|
+
input: this.input,
|
|
394
|
+
output: D,
|
|
395
|
+
tabSize: 2,
|
|
396
|
+
prompt: "",
|
|
397
|
+
escapeCodeTimeout: 50
|
|
398
|
+
}), $parcel$interopDefault(u).emitKeypressEvents(this.input, this.rl), this.rl.prompt(),
|
|
399
|
+
void 0 !== this.opts.initialValue && this._track && this.rl.write(this.opts.initialValue),
|
|
400
|
+
this.input.on("keypress", this.onKeypress), $3637fed4480c7ff6$var$g(this.input, !0),
|
|
401
|
+
this.output.on("resize", this.render), this.render(), new Promise(((D, u) => {
|
|
402
|
+
this.once("submit", (() => {
|
|
403
|
+
this.output.write(o.cursor.show), this.output.off("resize", this.render), $3637fed4480c7ff6$var$g(this.input, !1),
|
|
404
|
+
D(this.value);
|
|
405
|
+
})), this.once("cancel", (() => {
|
|
406
|
+
this.output.write(o.cursor.show), this.output.off("resize", this.render), $3637fed4480c7ff6$var$g(this.input, !1),
|
|
407
|
+
D(g);
|
|
408
|
+
}));
|
|
409
|
+
}));
|
|
410
|
+
}
|
|
411
|
+
on(D, u) {
|
|
412
|
+
const e = this.subscribers.get(D) ?? [];
|
|
413
|
+
e.push({
|
|
414
|
+
cb: u
|
|
415
|
+
}), this.subscribers.set(D, e);
|
|
416
|
+
}
|
|
417
|
+
once(D, u) {
|
|
418
|
+
const e = this.subscribers.get(D) ?? [];
|
|
419
|
+
e.push({
|
|
420
|
+
cb: u,
|
|
421
|
+
once: !0
|
|
422
|
+
}), this.subscribers.set(D, e);
|
|
423
|
+
}
|
|
424
|
+
emit(D, ...u) {
|
|
425
|
+
const e = this.subscribers.get(D) ?? [], t = [];
|
|
426
|
+
for (const D of e) D.cb(...u), D.once && t.push((() => e.splice(e.indexOf(D), 1)));
|
|
427
|
+
for (const D of t) D();
|
|
428
|
+
}
|
|
429
|
+
unsubscribe() {
|
|
430
|
+
this.subscribers.clear();
|
|
431
|
+
}
|
|
432
|
+
onKeypress(D, u) {
|
|
433
|
+
if ("error" === this.state && (this.state = "active"), u?.name && !this._track && m.has(u.name) && this.emit("cursor", m.get(u.name)),
|
|
434
|
+
u?.name && v.has(u.name) && this.emit("cursor", u.name), D && ("y" === D.toLowerCase() || "n" === D.toLowerCase()) && this.emit("confirm", "y" === D.toLowerCase()),
|
|
435
|
+
D && this.emit("key", D.toLowerCase()), "return" === u?.name) {
|
|
436
|
+
if (this.opts.validate) {
|
|
437
|
+
const D = this.opts.validate(this.value);
|
|
438
|
+
D && (this.error = D, this.state = "error", this.rl.write(this.value));
|
|
439
|
+
}
|
|
440
|
+
"error" !== this.state && (this.state = "submit");
|
|
441
|
+
}
|
|
442
|
+
"" === D && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"),
|
|
443
|
+
this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
|
|
444
|
+
}
|
|
445
|
+
close() {
|
|
446
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write("\n"),
|
|
447
|
+
$3637fed4480c7ff6$var$g(this.input, !1), this.rl.close(), this.emit(`${this.state}`, this.value),
|
|
448
|
+
this.unsubscribe();
|
|
449
|
+
}
|
|
450
|
+
restoreCursor() {
|
|
451
|
+
const D = $3637fed4480c7ff6$var$P(this._prevFrame, process.stdout.columns, {
|
|
452
|
+
hard: !0
|
|
453
|
+
}).split("\n").length - 1;
|
|
454
|
+
this.output.write(o.cursor.move(-999, -1 * D));
|
|
455
|
+
}
|
|
456
|
+
render() {
|
|
457
|
+
const D = $3637fed4480c7ff6$var$P(this._render(this) ?? "", process.stdout.columns, {
|
|
458
|
+
hard: !0
|
|
459
|
+
});
|
|
460
|
+
if (D !== this._prevFrame) {
|
|
461
|
+
if ("initial" === this.state) this.output.write(o.cursor.hide); else {
|
|
462
|
+
const u = function $3637fed4480c7ff6$var$FD(D, u) {
|
|
463
|
+
if (D === u) return;
|
|
464
|
+
const e = D.split("\n"), t = u.split("\n"), r = [];
|
|
465
|
+
for (let D = 0; D < Math.max(e.length, t.length); D++) e[D] !== t[D] && r.push(D);
|
|
466
|
+
return r;
|
|
467
|
+
}(this._prevFrame, D);
|
|
468
|
+
if (this.restoreCursor(), u && 1 === u?.length) {
|
|
469
|
+
const e = u[0];
|
|
470
|
+
this.output.write(o.cursor.move(0, e)), this.output.write(o.erase.lines(1));
|
|
471
|
+
const t = D.split("\n");
|
|
472
|
+
return this.output.write(t[e]), this._prevFrame = D, void this.output.write(o.cursor.move(0, t.length - e - 1));
|
|
473
|
+
}
|
|
474
|
+
if (u && u?.length > 1) {
|
|
475
|
+
const e = u[0];
|
|
476
|
+
this.output.write(o.cursor.move(0, e)), this.output.write(o.erase.down());
|
|
477
|
+
const t = D.split("\n").slice(e);
|
|
478
|
+
return this.output.write(t.join("\n")), void (this._prevFrame = D);
|
|
479
|
+
}
|
|
480
|
+
this.output.write(o.erase.down());
|
|
481
|
+
}
|
|
482
|
+
this.output.write(D), "initial" === this.state && (this.state = "active"), this._prevFrame = D;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
class $3637fed4480c7ff6$var$sD extends $3637fed4480c7ff6$var$h {
|
|
487
|
+
get cursor() {
|
|
488
|
+
return this.value ? 0 : 1;
|
|
489
|
+
}
|
|
490
|
+
get _value() {
|
|
491
|
+
return 0 === this.cursor;
|
|
492
|
+
}
|
|
493
|
+
constructor(D) {
|
|
494
|
+
super(D, !1), this.value = !!D.initialValue, this.on("value", (() => {
|
|
495
|
+
this.value = this._value;
|
|
496
|
+
})), this.on("confirm", (D => {
|
|
497
|
+
this.output.write(o.cursor.move(0, -1)), this.value = D, this.state = "submit",
|
|
498
|
+
this.close();
|
|
499
|
+
})), this.on("cursor", (() => {
|
|
500
|
+
this.value = !this.value;
|
|
501
|
+
}));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
class $3637fed4480c7ff6$var$iD extends $3637fed4480c7ff6$var$h {
|
|
505
|
+
constructor(D) {
|
|
506
|
+
super(D, !1), this.cursor = 0, this.options = D.options, this.value = [ ...D.initialValues ?? [] ],
|
|
507
|
+
this.cursor = Math.max(this.options.findIndex((({value: u}) => u === D.cursorAt)), 0),
|
|
508
|
+
this.on("key", (D => {
|
|
509
|
+
"a" === D && this.toggleAll();
|
|
510
|
+
})), this.on("cursor", (D => {
|
|
511
|
+
switch (D) {
|
|
512
|
+
case "left":
|
|
513
|
+
case "up":
|
|
514
|
+
this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
|
|
515
|
+
break;
|
|
516
|
+
|
|
517
|
+
case "down":
|
|
518
|
+
case "right":
|
|
519
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
520
|
+
break;
|
|
521
|
+
|
|
522
|
+
case "space":
|
|
523
|
+
this.toggleValue();
|
|
524
|
+
}
|
|
525
|
+
}));
|
|
526
|
+
}
|
|
527
|
+
get _value() {
|
|
528
|
+
return this.options[this.cursor].value;
|
|
529
|
+
}
|
|
530
|
+
toggleAll() {
|
|
531
|
+
const D = this.value.length === this.options.length;
|
|
532
|
+
this.value = D ? [] : this.options.map((D => D.value));
|
|
533
|
+
}
|
|
534
|
+
toggleValue() {
|
|
535
|
+
const D = this.value.includes(this._value);
|
|
536
|
+
this.value = D ? this.value.filter((D => D !== this._value)) : [ ...this.value, this._value ];
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
class $3637fed4480c7ff6$var$ED extends $3637fed4480c7ff6$var$h {
|
|
540
|
+
constructor(D) {
|
|
541
|
+
super(D, !1), this.cursor = 0, this.options = D.options, this.cursor = this.options.findIndex((({value: u}) => u === D.initialValue)),
|
|
542
|
+
-1 === this.cursor && (this.cursor = 0), this.changeValue(), this.on("cursor", (D => {
|
|
543
|
+
switch (D) {
|
|
544
|
+
case "left":
|
|
545
|
+
case "up":
|
|
546
|
+
this.cursor = 0 === this.cursor ? this.options.length - 1 : this.cursor - 1;
|
|
547
|
+
break;
|
|
548
|
+
|
|
549
|
+
case "down":
|
|
550
|
+
case "right":
|
|
551
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
552
|
+
}
|
|
553
|
+
this.changeValue();
|
|
554
|
+
}));
|
|
555
|
+
}
|
|
556
|
+
get _value() {
|
|
557
|
+
return this.options[this.cursor];
|
|
558
|
+
}
|
|
559
|
+
changeValue() {
|
|
560
|
+
this.value = this._value.value;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
class $3637fed4480c7ff6$var$oD extends $3637fed4480c7ff6$var$h {
|
|
564
|
+
constructor(D) {
|
|
565
|
+
super(D), this.valueWithCursor = "", this.on("finalize", (() => {
|
|
566
|
+
this.value || (this.value = D.defaultValue), this.valueWithCursor = this.value;
|
|
567
|
+
})), this.on("value", (() => {
|
|
568
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${a.inverse(a.hidden("_"))}`; else {
|
|
569
|
+
const D = this.value.slice(0, this.cursor), u = this.value.slice(this.cursor);
|
|
570
|
+
this.valueWithCursor = `${D}${a.inverse(u[0])}${u.slice(1)}`;
|
|
571
|
+
}
|
|
572
|
+
}));
|
|
573
|
+
}
|
|
574
|
+
get cursor() {
|
|
575
|
+
return this._cursor;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
const b = (0, C.i)(), $3637fed4480c7ff6$var$s = (D, u) => b ? D : u, w = $3637fed4480c7ff6$var$s("❯", ">"), y = $3637fed4480c7ff6$var$s("■", "x"), x = $3637fed4480c7ff6$var$s("▲", "x"), S = $3637fed4480c7ff6$var$s("✔", "√"), _ = "", k = "", j = $3637fed4480c7ff6$var$s("●", ">"), V = $3637fed4480c7ff6$var$s("○", " "), M = $3637fed4480c7ff6$var$s("◻", "[•]"), T = $3637fed4480c7ff6$var$s("◼", "[+]"), W = $3637fed4480c7ff6$var$s("◻", "[ ]"), $3637fed4480c7ff6$var$symbol = D => {
|
|
579
|
+
switch (D) {
|
|
580
|
+
case "initial":
|
|
581
|
+
case "active":
|
|
582
|
+
return (0, C.c)(w);
|
|
583
|
+
|
|
584
|
+
case "cancel":
|
|
585
|
+
return (0, C.f)(y);
|
|
586
|
+
|
|
587
|
+
case "error":
|
|
588
|
+
return (0, C.y)(x);
|
|
589
|
+
|
|
590
|
+
case "submit":
|
|
591
|
+
return (0, C.b)(S);
|
|
592
|
+
}
|
|
593
|
+
}, $3637fed4480c7ff6$var$text = D => new $3637fed4480c7ff6$var$oD({
|
|
594
|
+
validate: D.validate,
|
|
595
|
+
placeholder: D.placeholder,
|
|
596
|
+
defaultValue: D.defaultValue,
|
|
597
|
+
initialValue: D.initialValue,
|
|
598
|
+
render() {
|
|
599
|
+
const u = `${(0, C.g)(_)}\n${$3637fed4480c7ff6$var$symbol(this.state)} ${D.message}\n`, e = D.placeholder ? (0,
|
|
600
|
+
C.a)(D.placeholder[0]) + (0, C.d)(D.placeholder.slice(1)) : (0, C.a)((0, C.h)("_")), t = this.value ? this.valueWithCursor : e;
|
|
601
|
+
switch (this.state) {
|
|
602
|
+
case "error":
|
|
603
|
+
return `${u.trim()}\n${(0, C.y)(_)} ${t}\n${(0, C.y)(k)} ${(0, C.y)(this.error)}\n`;
|
|
604
|
+
|
|
605
|
+
case "submit":
|
|
606
|
+
return `${u}${(0, C.g)(_)} ${(0, C.d)(this.value || D.placeholder)}`;
|
|
607
|
+
|
|
608
|
+
case "cancel":
|
|
609
|
+
return `${u}${(0, C.g)(_)} ${(0, C.s)((0, C.d)(this.value ?? ""))}${this.value?.trim() ? "\n" + (0,
|
|
610
|
+
C.g)(_) : ""}`;
|
|
611
|
+
|
|
612
|
+
default:
|
|
613
|
+
return `${u}${(0, C.c)(_)} ${t}\n${(0, C.c)(k)}\n`;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}).prompt(), $3637fed4480c7ff6$var$confirm = D => {
|
|
617
|
+
const u = D.active ?? "Yes", e = D.inactive ?? "No";
|
|
618
|
+
return new $3637fed4480c7ff6$var$sD({
|
|
619
|
+
active: u,
|
|
620
|
+
inactive: e,
|
|
621
|
+
initialValue: D.initialValue ?? !0,
|
|
622
|
+
render() {
|
|
623
|
+
const t = `${(0, C.g)(_)}\n${$3637fed4480c7ff6$var$symbol(this.state)} ${D.message}\n`, r = this.value ? u : e;
|
|
624
|
+
switch (this.state) {
|
|
625
|
+
case "submit":
|
|
626
|
+
return `${t}${(0, C.g)(_)} ${(0, C.d)(r)}`;
|
|
627
|
+
|
|
628
|
+
case "cancel":
|
|
629
|
+
return `${t}${(0, C.g)(_)} ${(0, C.s)((0, C.d)(r))}\n${(0, C.g)(_)}`;
|
|
630
|
+
|
|
631
|
+
default:
|
|
632
|
+
return `${t}${(0, C.c)(_)} ${this.value ? `${(0, C.b)(j)} ${u}` : `${(0, C.d)(V)} ${(0,
|
|
633
|
+
C.d)(u)}`} ${(0, C.d)("/")} ${this.value ? `${(0, C.d)(V)} ${(0, C.d)(e)}` : `${(0,
|
|
634
|
+
C.b)(j)} ${e}`}\n${(0, C.c)(k)}\n`;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}).prompt();
|
|
638
|
+
}, $3637fed4480c7ff6$var$select = D => {
|
|
639
|
+
const opt = (D, u) => {
|
|
640
|
+
const e = D.label ?? String(D.value);
|
|
641
|
+
switch (u) {
|
|
642
|
+
case "active":
|
|
643
|
+
return `${(0, C.b)(j)} ${e} ${D.hint ? (0, C.d)(`(${D.hint})`) : ""}`;
|
|
644
|
+
|
|
645
|
+
case "selected":
|
|
646
|
+
return `${(0, C.d)(e)}`;
|
|
647
|
+
|
|
648
|
+
case "cancelled":
|
|
649
|
+
return `${(0, C.s)((0, C.d)(e))}`;
|
|
650
|
+
}
|
|
651
|
+
return `${(0, C.d)(V)} ${(0, C.d)(e)}`;
|
|
652
|
+
};
|
|
653
|
+
return new $3637fed4480c7ff6$var$ED({
|
|
654
|
+
options: D.options,
|
|
655
|
+
initialValue: D.initialValue,
|
|
656
|
+
render() {
|
|
657
|
+
const u = `${(0, C.g)(_)}\n${$3637fed4480c7ff6$var$symbol(this.state)} ${D.message}\n`;
|
|
658
|
+
switch (this.state) {
|
|
659
|
+
case "submit":
|
|
660
|
+
return `${u}${(0, C.g)(_)} ${opt(this.options[this.cursor], "selected")}`;
|
|
661
|
+
|
|
662
|
+
case "cancel":
|
|
663
|
+
return `${u}${(0, C.g)(_)} ${opt(this.options[this.cursor], "cancelled")}\n${(0,
|
|
664
|
+
C.g)(_)}`;
|
|
665
|
+
|
|
666
|
+
default:
|
|
667
|
+
return `${u}${(0, C.c)(_)} ${this.options.map(((D, u) => opt(D, u === this.cursor ? "active" : "inactive"))).join(`\n${(0,
|
|
668
|
+
C.c)(_)} `)}\n${(0, C.c)(k)}\n`;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}).prompt();
|
|
672
|
+
}, $3637fed4480c7ff6$var$multiselect = D => {
|
|
673
|
+
const opt = (D, u) => {
|
|
674
|
+
const e = D.label ?? String(D.value);
|
|
675
|
+
switch (u) {
|
|
676
|
+
case "active":
|
|
677
|
+
return `${(0, C.c)(M)} ${e} ${D.hint ? (0, C.d)(`(${D.hint})`) : ""}`;
|
|
678
|
+
|
|
679
|
+
case "selected":
|
|
680
|
+
return `${(0, C.b)(T)} ${(0, C.d)(e)}`;
|
|
681
|
+
|
|
682
|
+
case "cancelled":
|
|
683
|
+
return `${(0, C.s)((0, C.d)(e))}`;
|
|
684
|
+
|
|
685
|
+
case "active-selected":
|
|
686
|
+
return `${(0, C.b)(T)} ${e} ${D.hint ? (0, C.d)(`(${D.hint})`) : ""}`;
|
|
687
|
+
|
|
688
|
+
case "submitted":
|
|
689
|
+
return `${(0, C.d)(e)}`;
|
|
690
|
+
}
|
|
691
|
+
return `${(0, C.d)(W)} ${(0, C.d)(e)}`;
|
|
692
|
+
};
|
|
693
|
+
return new $3637fed4480c7ff6$var$iD({
|
|
694
|
+
options: D.options,
|
|
695
|
+
initialValues: D.initialValues,
|
|
696
|
+
required: D.required ?? !0,
|
|
697
|
+
cursorAt: D.cursorAt,
|
|
698
|
+
validate(D) {
|
|
699
|
+
if (this.required && 0 === D.length) return `Please select at least one option.\n${(0,
|
|
700
|
+
C.r)((0, C.d)(`Press ${(0, C.g)((0, C.e)((0, C.a)(" space ")))} to select, ${(0,
|
|
701
|
+
C.g)((0, C.e)((0, C.a)(" enter ")))} to submit`))}`;
|
|
702
|
+
},
|
|
703
|
+
render() {
|
|
704
|
+
const u = `${(0, C.g)(_)}\n${$3637fed4480c7ff6$var$symbol(this.state)} ${D.message}\n`;
|
|
705
|
+
switch (this.state) {
|
|
706
|
+
case "submit":
|
|
707
|
+
return `${u}${(0, C.g)(_)} ${this.options.filter((({value: D}) => this.value.includes(D))).map((D => opt(D, "submitted"))).join((0,
|
|
708
|
+
C.d)(", ")) || (0, C.d)("none")}`;
|
|
709
|
+
|
|
710
|
+
case "cancel":
|
|
711
|
+
{
|
|
712
|
+
const D = this.options.filter((({value: D}) => this.value.includes(D))).map((D => opt(D, "cancelled"))).join((0,
|
|
713
|
+
C.d)(", "));
|
|
714
|
+
return `${u}${(0, C.g)(_)} ${D.trim() ? `${D}\n${(0, C.g)(_)}` : ""}`;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
case "error":
|
|
718
|
+
{
|
|
719
|
+
const D = this.error.split("\n").map(((D, u) => 0 === u ? `${(0, C.y)(k)} ${(0,
|
|
720
|
+
C.y)(D)}` : ` ${D}`)).join("\n");
|
|
721
|
+
return u + (0, C.y)(_) + " " + this.options.map(((D, u) => {
|
|
722
|
+
const e = this.value.includes(D.value), t = u === this.cursor;
|
|
723
|
+
return opt(D, t && e ? "active-selected" : e ? "selected" : t ? "active" : "inactive");
|
|
724
|
+
})).join(`\n${(0, C.y)(_)} `) + "\n" + D + "\n";
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
default:
|
|
728
|
+
return `${u}${(0, C.c)(_)} ${this.options.map(((D, u) => {
|
|
729
|
+
const e = this.value.includes(D.value), t = u === this.cursor;
|
|
730
|
+
return opt(D, t && e ? "active-selected" : e ? "selected" : t ? "active" : "inactive");
|
|
731
|
+
})).join(`\n${(0, C.c)(_)} `)}\n${(0, C.c)(k)}\n`;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}).prompt();
|
|
735
|
+
};
|
|
736
|
+
}));
|