@gql.tada/cli-utils 1.7.3 → 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.
@@ -0,0 +1,2822 @@
1
+ var e = require("node:process");
2
+
3
+ var D = require("node:readline");
4
+
5
+ var r = require("node:tty");
6
+
7
+ var t = require("node:fs/promises");
8
+
9
+ var n = require("node:path");
10
+
11
+ var i = require("node:buffer");
12
+
13
+ var a = require("node:child_process");
14
+
15
+ var s = require("fs");
16
+
17
+ var c = require("path");
18
+
19
+ var l = require("child_process");
20
+
21
+ var d = require("node:url");
22
+
23
+ var p = require("node:os");
24
+
25
+ var E = require("node:fs");
26
+
27
+ var f = require("node:timers/promises");
28
+
29
+ var h = require("stream");
30
+
31
+ var m = require("node:util");
32
+
33
+ var g = require("./index-chunk.js");
34
+
35
+ var B = require("@gql.tada/internal");
36
+
37
+ function _interopNamespaceDefault(e) {
38
+ var D = Object.create(null);
39
+ if (e) {
40
+ Object.keys(e).forEach((function(r) {
41
+ if ("default" !== r) {
42
+ var t = Object.getOwnPropertyDescriptor(e, r);
43
+ Object.defineProperty(D, r, t.get ? t : {
44
+ enumerable: !0,
45
+ get: function() {
46
+ return e[r];
47
+ }
48
+ });
49
+ }
50
+ }));
51
+ }
52
+ D.default = e;
53
+ return D;
54
+ }
55
+
56
+ var b = _interopNamespaceDefault(D);
57
+
58
+ function getDefaultExportFromCjs(e) {
59
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
60
+ }
61
+
62
+ var w = "[";
63
+
64
+ var S = {
65
+ to(e, D) {
66
+ if (!D) {
67
+ return `${w}${e + 1}G`;
68
+ }
69
+ return `${w}${D + 1};${e + 1}H`;
70
+ },
71
+ move(e, D) {
72
+ var r = "";
73
+ if (e < 0) {
74
+ r += `${w}${-e}D`;
75
+ } else if (e > 0) {
76
+ r += `${w}${e}C`;
77
+ }
78
+ if (D < 0) {
79
+ r += `${w}${-D}A`;
80
+ } else if (D > 0) {
81
+ r += `${w}${D}B`;
82
+ }
83
+ return r;
84
+ },
85
+ up: (e = 1) => `${w}${e}A`,
86
+ down: (e = 1) => `${w}${e}B`,
87
+ forward: (e = 1) => `${w}${e}C`,
88
+ backward: (e = 1) => `${w}${e}D`,
89
+ nextLine: (e = 1) => `${w}E`.repeat(e),
90
+ prevLine: (e = 1) => `${w}F`.repeat(e),
91
+ left: `${w}G`,
92
+ hide: `${w}?25l`,
93
+ show: `${w}?25h`,
94
+ save: "7",
95
+ restore: "8"
96
+ };
97
+
98
+ var I = {
99
+ up: (e = 1) => `${w}S`.repeat(e),
100
+ down: (e = 1) => `${w}T`.repeat(e)
101
+ };
102
+
103
+ var O = {
104
+ screen: `${w}2J`,
105
+ up: (e = 1) => `${w}1J`.repeat(e),
106
+ down: (e = 1) => `${w}J`.repeat(e),
107
+ line: `${w}2K`,
108
+ lineEnd: `${w}K`,
109
+ lineStart: `${w}1K`,
110
+ lines(e) {
111
+ var D = "";
112
+ for (var r = 0; r < e; r++) {
113
+ D += this.line + (r < e - 1 ? S.up() : "");
114
+ }
115
+ if (e) {
116
+ D += S.left;
117
+ }
118
+ return D;
119
+ }
120
+ };
121
+
122
+ var k = {
123
+ cursor: S,
124
+ scroll: I,
125
+ erase: O,
126
+ beep: ""
127
+ };
128
+
129
+ var G = {
130
+ exports: {}
131
+ };
132
+
133
+ var M = String;
134
+
135
+ var create = function() {
136
+ return {
137
+ isColorSupported: !1,
138
+ reset: M,
139
+ bold: M,
140
+ dim: M,
141
+ italic: M,
142
+ underline: M,
143
+ inverse: M,
144
+ hidden: M,
145
+ strikethrough: M,
146
+ black: M,
147
+ red: M,
148
+ green: M,
149
+ yellow: M,
150
+ blue: M,
151
+ magenta: M,
152
+ cyan: M,
153
+ white: M,
154
+ gray: M,
155
+ bgBlack: M,
156
+ bgRed: M,
157
+ bgGreen: M,
158
+ bgYellow: M,
159
+ bgBlue: M,
160
+ bgMagenta: M,
161
+ bgCyan: M,
162
+ bgWhite: M
163
+ };
164
+ };
165
+
166
+ G.exports = create();
167
+
168
+ G.exports.createColors = create;
169
+
170
+ var _ = getDefaultExportFromCjs(G.exports);
171
+
172
+ function S$1(e) {
173
+ if ("string" != typeof e) {
174
+ throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
175
+ }
176
+ return e.replace(function q$1({onlyFirst: e = !1} = {}) {
177
+ var D = [ "[\\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("|");
178
+ return new RegExp(D, e ? void 0 : "g");
179
+ }(), "");
180
+ }
181
+
182
+ function j(e) {
183
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
184
+ }
185
+
186
+ var U = {
187
+ exports: {}
188
+ };
189
+
190
+ !function() {
191
+ var e = {};
192
+ U.exports = e, e.eastAsianWidth = function(e) {
193
+ var D = e.charCodeAt(0), r = 2 == e.length ? e.charCodeAt(1) : 0, t = D;
194
+ return 55296 <= D && D <= 56319 && 56320 <= r && r <= 57343 && (t = (D &= 1023) << 10 | (r &= 1023),
195
+ 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";
196
+ }, e.characterLength = function(e) {
197
+ var D = this.eastAsianWidth(e);
198
+ return "F" == D || "W" == D || "A" == D ? 2 : 1;
199
+ };
200
+ function F(e) {
201
+ return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
202
+ }
203
+ e.length = function(e) {
204
+ for (var D = F(e), r = 0, t = 0; t < D.length; t++) {
205
+ r += this.characterLength(D[t]);
206
+ }
207
+ return r;
208
+ }, e.slice = function(D, r, t) {
209
+ textLen = e.length(D), t = t || 1, (r = r || 0) < 0 && (r = textLen + r), t < 0 && (t = textLen + t);
210
+ for (var n = "", i = 0, a = F(D), s = 0; s < a.length; s++) {
211
+ var c = a[s], l = e.length(c);
212
+ if (i >= r - (2 == l ? 1 : 0)) {
213
+ if (i + l <= t) {
214
+ n += c;
215
+ } else {
216
+ break;
217
+ }
218
+ }
219
+ i += l;
220
+ }
221
+ return n;
222
+ };
223
+ }();
224
+
225
+ var z = j(U.exports);
226
+
227
+ var V = j((function() {
228
+ 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;
229
+ }));
230
+
231
+ function A(e, D = {}) {
232
+ if ("string" != typeof e || 0 === e.length || (D = {
233
+ ambiguousIsNarrow: !0,
234
+ ...D
235
+ }, 0 === (e = S$1(e)).length)) {
236
+ return 0;
237
+ }
238
+ e = e.replace(V(), " ");
239
+ var r = D.ambiguousIsNarrow ? 1 : 2;
240
+ var t = 0;
241
+ for (var n of e) {
242
+ var i = n.codePointAt(0);
243
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) {
244
+ continue;
245
+ }
246
+ switch (z.eastAsianWidth(n)) {
247
+ case "F":
248
+ case "W":
249
+ t += 2;
250
+ break;
251
+
252
+ case "A":
253
+ t += r;
254
+ break;
255
+
256
+ default:
257
+ t += 1;
258
+ }
259
+ }
260
+ return t;
261
+ }
262
+
263
+ var T = (e = 0) => D => `[${D + e}m`, P = (e = 0) => D => `[${38 + e};5;${D}m`, W = (e = 0) => (D, r, t) => `[${38 + e};2;${D};${r};${t}m`, K = {
264
+ modifier: {
265
+ reset: [ 0, 0 ],
266
+ bold: [ 1, 22 ],
267
+ dim: [ 2, 22 ],
268
+ italic: [ 3, 23 ],
269
+ underline: [ 4, 24 ],
270
+ overline: [ 53, 55 ],
271
+ inverse: [ 7, 27 ],
272
+ hidden: [ 8, 28 ],
273
+ strikethrough: [ 9, 29 ]
274
+ },
275
+ color: {
276
+ black: [ 30, 39 ],
277
+ red: [ 31, 39 ],
278
+ green: [ 32, 39 ],
279
+ yellow: [ 33, 39 ],
280
+ blue: [ 34, 39 ],
281
+ magenta: [ 35, 39 ],
282
+ cyan: [ 36, 39 ],
283
+ white: [ 37, 39 ],
284
+ blackBright: [ 90, 39 ],
285
+ gray: [ 90, 39 ],
286
+ grey: [ 90, 39 ],
287
+ redBright: [ 91, 39 ],
288
+ greenBright: [ 92, 39 ],
289
+ yellowBright: [ 93, 39 ],
290
+ blueBright: [ 94, 39 ],
291
+ magentaBright: [ 95, 39 ],
292
+ cyanBright: [ 96, 39 ],
293
+ whiteBright: [ 97, 39 ]
294
+ },
295
+ bgColor: {
296
+ bgBlack: [ 40, 49 ],
297
+ bgRed: [ 41, 49 ],
298
+ bgGreen: [ 42, 49 ],
299
+ bgYellow: [ 43, 49 ],
300
+ bgBlue: [ 44, 49 ],
301
+ bgMagenta: [ 45, 49 ],
302
+ bgCyan: [ 46, 49 ],
303
+ bgWhite: [ 47, 49 ],
304
+ bgBlackBright: [ 100, 49 ],
305
+ bgGray: [ 100, 49 ],
306
+ bgGrey: [ 100, 49 ],
307
+ bgRedBright: [ 101, 49 ],
308
+ bgGreenBright: [ 102, 49 ],
309
+ bgYellowBright: [ 103, 49 ],
310
+ bgBlueBright: [ 104, 49 ],
311
+ bgMagentaBright: [ 105, 49 ],
312
+ bgCyanBright: [ 106, 49 ],
313
+ bgWhiteBright: [ 107, 49 ]
314
+ }
315
+ };
316
+
317
+ Object.keys(K.modifier);
318
+
319
+ Object.keys(K.color), Object.keys(K.bgColor);
320
+
321
+ var H = function tD() {
322
+ var e = new Map;
323
+ for (var [D, r] of Object.entries(K)) {
324
+ for (var [t, n] of Object.entries(r)) {
325
+ K[t] = {
326
+ open: `[${n[0]}m`,
327
+ close: `[${n[1]}m`
328
+ }, r[t] = K[t], e.set(n[0], n[1]);
329
+ }
330
+ Object.defineProperty(K, D, {
331
+ value: r,
332
+ enumerable: !1
333
+ });
334
+ }
335
+ return Object.defineProperty(K, "codes", {
336
+ value: e,
337
+ enumerable: !1
338
+ }), K.color.close = "", K.bgColor.close = "", K.color.ansi = T(), K.color.ansi256 = P(),
339
+ K.color.ansi16m = W(), K.bgColor.ansi = T(10), K.bgColor.ansi256 = P(10), K.bgColor.ansi16m = W(10),
340
+ Object.defineProperties(K, {
341
+ rgbToAnsi256: {
342
+ value: (e, D, r) => e === D && D === r ? e < 8 ? 16 : e > 248 ? 231 : Math.round((e - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(e / 255 * 5) + 6 * Math.round(D / 255 * 5) + Math.round(r / 255 * 5),
343
+ enumerable: !1
344
+ },
345
+ hexToRgb: {
346
+ value: e => {
347
+ var D = /[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));
348
+ if (!D) {
349
+ return [ 0, 0, 0 ];
350
+ }
351
+ var [r] = D;
352
+ 3 === r.length && (r = [ ...r ].map((e => e + e)).join(""));
353
+ var t = Number.parseInt(r, 16);
354
+ return [ t >> 16 & 255, t >> 8 & 255, 255 & t ];
355
+ },
356
+ enumerable: !1
357
+ },
358
+ hexToAnsi256: {
359
+ value: e => K.rgbToAnsi256(...K.hexToRgb(e)),
360
+ enumerable: !1
361
+ },
362
+ ansi256ToAnsi: {
363
+ value: e => {
364
+ if (e < 8) {
365
+ return 30 + e;
366
+ }
367
+ if (e < 16) {
368
+ return e - 8 + 90;
369
+ }
370
+ var D, r, t;
371
+ if (e >= 232) {
372
+ r = D = (10 * (e - 232) + 8) / 255, t = D;
373
+ } else {
374
+ var n = (e -= 16) % 36;
375
+ D = Math.floor(e / 36) / 5, r = Math.floor(n / 6) / 5, t = n % 6 / 5;
376
+ }
377
+ var i = 2 * Math.max(D, r, t);
378
+ if (0 === i) {
379
+ return 30;
380
+ }
381
+ var a = 30 + (Math.round(t) << 2 | Math.round(r) << 1 | Math.round(D));
382
+ return 2 === i && (a += 60), a;
383
+ },
384
+ enumerable: !1
385
+ },
386
+ rgbToAnsi: {
387
+ value: (e, D, r) => K.ansi256ToAnsi(K.rgbToAnsi256(e, D, r)),
388
+ enumerable: !1
389
+ },
390
+ hexToAnsi: {
391
+ value: e => K.ansi256ToAnsi(K.hexToAnsi256(e)),
392
+ enumerable: !1
393
+ }
394
+ }), K;
395
+ }(), Y = new Set([ "", "›" ]), J = "]8;;", N = e => `${Y.values().next().value}[${e}m`, L = e => `${Y.values().next().value}${J}${e}`, y$1 = (e, D, r) => {
396
+ var t = [ ...D ];
397
+ var n = !1, i = !1, a = A(S$1(e[e.length - 1]));
398
+ for (var [s, c] of t.entries()) {
399
+ var l = A(c);
400
+ if (a + l <= r ? e[e.length - 1] += c : (e.push(c), a = 0), Y.has(c) && (n = !0,
401
+ i = t.slice(s + 1).join("").startsWith(J)), n) {
402
+ i ? "" === c && (n = !1, i = !1) : "m" === c && (n = !1);
403
+ continue;
404
+ }
405
+ (a += l) === r && s < t.length - 1 && (e.push(""), a = 0);
406
+ }
407
+ !a && e[e.length - 1].length > 0 && e.length > 1 && (e[e.length - 2] += e.pop());
408
+ }, ED = (e, D, r = {}) => {
409
+ if (!1 !== r.trim && "" === e.trim()) {
410
+ return "";
411
+ }
412
+ var t, n, i = "";
413
+ var a = (e => e.split(" ").map((e => A(e))))(e);
414
+ var s = [ "" ];
415
+ for (var [c, l] of e.split(" ").entries()) {
416
+ !1 !== r.trim && (s[s.length - 1] = s[s.length - 1].trimStart());
417
+ var d = A(s[s.length - 1]);
418
+ if (0 !== c && (d >= D && (!1 === r.wordWrap || !1 === r.trim) && (s.push(""), d = 0),
419
+ (d > 0 || !1 === r.trim) && (s[s.length - 1] += " ", d++)), r.hard && a[c] > D) {
420
+ var p = 1 + Math.floor((a[c] - (D - d) - 1) / D);
421
+ Math.floor((a[c] - 1) / D) < p && s.push(""), y$1(s, l, D);
422
+ continue;
423
+ }
424
+ if (d + a[c] > D && d > 0 && a[c] > 0) {
425
+ if (!1 === r.wordWrap && d < D) {
426
+ y$1(s, l, D);
427
+ continue;
428
+ }
429
+ s.push("");
430
+ }
431
+ if (d + a[c] > D && !1 === r.wordWrap) {
432
+ y$1(s, l, D);
433
+ continue;
434
+ }
435
+ s[s.length - 1] += l;
436
+ }
437
+ !1 !== r.trim && (s = s.map((e => (e => {
438
+ var D = e.split(" ");
439
+ var r = D.length;
440
+ for (;r > 0 && !(A(D[r - 1]) > 0); ) {
441
+ r--;
442
+ }
443
+ return r === D.length ? e : D.slice(0, r).join(" ") + D.slice(r).join("");
444
+ })(e))));
445
+ var E = [ ...s.join("\n") ];
446
+ for (var [f, h] of E.entries()) {
447
+ if (i += h, Y.has(h)) {
448
+ var {groups: m} = new RegExp(`(?:\\[(?<code>\\d+)m|\\${J}(?<uri>.*))`).exec(E.slice(f).join("")) || {
449
+ groups: {}
450
+ };
451
+ if (void 0 !== m.code) {
452
+ var g = Number.parseFloat(m.code);
453
+ t = 39 === g ? void 0 : g;
454
+ } else {
455
+ void 0 !== m.uri && (n = 0 === m.uri.length ? void 0 : m.uri);
456
+ }
457
+ }
458
+ var B = H.codes.get(Number(t));
459
+ "\n" === E[f + 1] ? (n && (i += L("")), t && B && (i += N(B))) : "\n" === h && (t && B && (i += N(t)),
460
+ n && (i += L(n)));
461
+ }
462
+ return i;
463
+ };
464
+
465
+ function R(e, D, r) {
466
+ return String(e).normalize().replace(/\r\n/g, "\n").split("\n").map((e => ED(e, D, r))).join("\n");
467
+ }
468
+
469
+ var X = Object.defineProperty, a$1 = (e, D, r) => (((e, D, r) => {
470
+ D in e ? X(e, D, {
471
+ enumerable: !0,
472
+ configurable: !0,
473
+ writable: !0,
474
+ value: r
475
+ }) : e[D] = r;
476
+ })(e, "symbol" != typeof D ? D + "" : D, r), r);
477
+
478
+ var Z = Symbol("clack:cancel");
479
+
480
+ function hD(e) {
481
+ return e === Z;
482
+ }
483
+
484
+ function v(e, D) {
485
+ e.isTTY && e.setRawMode(D);
486
+ }
487
+
488
+ var Q = new Map([ [ "k", "up" ], [ "j", "down" ], [ "h", "left" ], [ "l", "right" ] ]), uu = new Set([ "up", "down", "left", "right", "space", "enter" ]);
489
+
490
+ let eu = class x {
491
+ constructor({render: D, input: r = e.stdin, output: t = e.stdout, ...n}, i = !0) {
492
+ a$1(this, "input"), a$1(this, "output"), a$1(this, "rl"), a$1(this, "opts"), a$1(this, "_track", !1),
493
+ a$1(this, "_render"), a$1(this, "_cursor", 0), a$1(this, "state", "initial"), a$1(this, "value"),
494
+ a$1(this, "error", ""), a$1(this, "subscribers", new Map), a$1(this, "_prevFrame", ""),
495
+ this.opts = n, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this),
496
+ this.render = this.render.bind(this), this._render = D.bind(this), this._track = i,
497
+ this.input = r, this.output = t;
498
+ }
499
+ prompt() {
500
+ var e = new r.WriteStream(0);
501
+ return e._write = (e, D, r) => {
502
+ this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor,
503
+ this.emit("value", this.value)), r();
504
+ }, this.input.pipe(e), this.rl = D.createInterface({
505
+ input: this.input,
506
+ output: e,
507
+ tabSize: 2,
508
+ prompt: "",
509
+ escapeCodeTimeout: 50
510
+ }), D.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), void 0 !== this.opts.initialValue && this._track && this.rl.write(this.opts.initialValue),
511
+ this.input.on("keypress", this.onKeypress), v(this.input, !0), this.output.on("resize", this.render),
512
+ this.render(), new Promise(((e, D) => {
513
+ this.once("submit", (() => {
514
+ this.output.write(k.cursor.show), this.output.off("resize", this.render), v(this.input, !1),
515
+ e(this.value);
516
+ })), this.once("cancel", (() => {
517
+ this.output.write(k.cursor.show), this.output.off("resize", this.render), v(this.input, !1),
518
+ e(Z);
519
+ }));
520
+ }));
521
+ }
522
+ on(e, D) {
523
+ var r = this.subscribers.get(e) ?? [];
524
+ r.push({
525
+ cb: D
526
+ }), this.subscribers.set(e, r);
527
+ }
528
+ once(e, D) {
529
+ var r = this.subscribers.get(e) ?? [];
530
+ r.push({
531
+ cb: D,
532
+ once: !0
533
+ }), this.subscribers.set(e, r);
534
+ }
535
+ emit(e, ...D) {
536
+ var r = this.subscribers.get(e) ?? [], t = [];
537
+ var _loop = function(e) {
538
+ e.cb(...D), e.once && t.push((() => r.splice(r.indexOf(e), 1)));
539
+ };
540
+ for (var n of r) {
541
+ _loop(n);
542
+ }
543
+ for (var i of t) {
544
+ i();
545
+ }
546
+ }
547
+ unsubscribe() {
548
+ this.subscribers.clear();
549
+ }
550
+ onKeypress(e, D) {
551
+ if ("error" === this.state && (this.state = "active"), D?.name && !this._track && Q.has(D.name) && this.emit("cursor", Q.get(D.name)),
552
+ D?.name && uu.has(D.name) && this.emit("cursor", D.name), e && ("y" === e.toLowerCase() || "n" === e.toLowerCase()) && this.emit("confirm", "y" === e.toLowerCase()),
553
+ "\t" === e && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder),
554
+ this.emit("value", this.opts.placeholder))), e && this.emit("key", e.toLowerCase()),
555
+ "return" === D?.name) {
556
+ if (this.opts.validate) {
557
+ var r = this.opts.validate(this.value);
558
+ r && (this.error = r, this.state = "error", this.rl.write(this.value));
559
+ }
560
+ "error" !== this.state && (this.state = "submit");
561
+ }
562
+ "" === e && (this.state = "cancel"), ("submit" === this.state || "cancel" === this.state) && this.emit("finalize"),
563
+ this.render(), ("submit" === this.state || "cancel" === this.state) && this.close();
564
+ }
565
+ close() {
566
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write("\n"),
567
+ v(this.input, !1), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
568
+ }
569
+ restoreCursor() {
570
+ var e = R(this._prevFrame, process.stdout.columns, {
571
+ hard: !0
572
+ }).split("\n").length - 1;
573
+ this.output.write(k.cursor.move(-999, -1 * e));
574
+ }
575
+ render() {
576
+ var e = R(this._render(this) ?? "", process.stdout.columns, {
577
+ hard: !0
578
+ });
579
+ if (e !== this._prevFrame) {
580
+ if ("initial" === this.state) {
581
+ this.output.write(k.cursor.hide);
582
+ } else {
583
+ var D = function aD(e, D) {
584
+ if (e === D) {
585
+ return;
586
+ }
587
+ var r = e.split("\n"), t = D.split("\n"), n = [];
588
+ for (var i = 0; i < Math.max(r.length, t.length); i++) {
589
+ r[i] !== t[i] && n.push(i);
590
+ }
591
+ return n;
592
+ }(this._prevFrame, e);
593
+ if (this.restoreCursor(), D && 1 === D?.length) {
594
+ var r = D[0];
595
+ this.output.write(k.cursor.move(0, r)), this.output.write(k.erase.lines(1));
596
+ var t = e.split("\n");
597
+ this.output.write(t[r]), this._prevFrame = e, this.output.write(k.cursor.move(0, t.length - r - 1));
598
+ return;
599
+ } else if (D && D?.length > 1) {
600
+ var n = D[0];
601
+ this.output.write(k.cursor.move(0, n)), this.output.write(k.erase.down());
602
+ var i = e.split("\n").slice(n);
603
+ this.output.write(i.join("\n")), this._prevFrame = e;
604
+ return;
605
+ }
606
+ this.output.write(k.erase.down());
607
+ }
608
+ this.output.write(e), "initial" === this.state && (this.state = "active"), this._prevFrame = e;
609
+ }
610
+ }
611
+ };
612
+
613
+ class xD extends eu {
614
+ get cursor() {
615
+ return this.value ? 0 : 1;
616
+ }
617
+ get _value() {
618
+ return 0 === this.cursor;
619
+ }
620
+ constructor(e) {
621
+ super(e, !1), this.value = !!e.initialValue, this.on("value", (() => {
622
+ this.value = this._value;
623
+ })), this.on("confirm", (e => {
624
+ this.output.write(k.cursor.move(0, -1)), this.value = e, this.state = "submit",
625
+ this.close();
626
+ })), this.on("cursor", (() => {
627
+ this.value = !this.value;
628
+ }));
629
+ }
630
+ }
631
+
632
+ var Du = Object.defineProperty, MD = (e, D, r) => (((e, D, r) => {
633
+ D in e ? Du(e, D, {
634
+ enumerable: !0,
635
+ configurable: !0,
636
+ writable: !0,
637
+ value: r
638
+ }) : e[D] = r;
639
+ })(e, D + "", r), r);
640
+
641
+ class TD extends eu {
642
+ constructor(e) {
643
+ super(e), MD(this, "valueWithCursor", ""), this.on("finalize", (() => {
644
+ this.value || (this.value = e.defaultValue), this.valueWithCursor = this.value;
645
+ })), this.on("value", (() => {
646
+ if (this.cursor >= this.value.length) {
647
+ this.valueWithCursor = `${this.value}${_.inverse(_.hidden("_"))}`;
648
+ } else {
649
+ var e = this.value.slice(0, this.cursor), D = this.value.slice(this.cursor);
650
+ this.valueWithCursor = `${e}${_.inverse(D[0])}${D.slice(1)}`;
651
+ }
652
+ }));
653
+ }
654
+ get cursor() {
655
+ return this._cursor;
656
+ }
657
+ }
658
+
659
+ var ru = globalThis.process.platform.startsWith("win");
660
+
661
+ var tu = function q() {
662
+ return "win32" !== e.platform ? "linux" !== e.env.TERM : Boolean(e.env.CI) || Boolean(e.env.WT_SESSION) || Boolean(e.env.TERMINUS_SUBLIME) || "{cmd::Cmder}" === e.env.ConEmuTask || "Terminus-Sublime" === e.env.TERM_PROGRAM || "vscode" === e.env.TERM_PROGRAM || "xterm-256color" === e.env.TERM || "alacritty" === e.env.TERM || "JetBrains-JediTerm" === e.env.TERMINAL_EMULATOR;
663
+ }(), o = (e, D) => tu ? e : D, nu = o("◆", "*"), iu = o("■", "x"), au = o("▲", "x"), su = o("◇", "o"), ou = o("┌", "T"), cu = o("│", "|"), Fu = o("└", "—"), lu = o("●", ">"), du = o("○", " "), y = e => {
664
+ switch (e) {
665
+ case "initial":
666
+ case "active":
667
+ return _.cyan(nu);
668
+
669
+ case "cancel":
670
+ return _.red(iu);
671
+
672
+ case "error":
673
+ return _.yellow(au);
674
+
675
+ case "submit":
676
+ return _.green(su);
677
+ }
678
+ }, te = e => new TD({
679
+ validate: e.validate,
680
+ placeholder: e.placeholder,
681
+ defaultValue: e.defaultValue,
682
+ initialValue: e.initialValue,
683
+ render() {
684
+ var D = `${_.gray(cu)}\n${y(this.state)} ${e.message}\n`, r = e.placeholder ? _.inverse(e.placeholder[0]) + _.dim(e.placeholder.slice(1)) : _.inverse(_.hidden("_")), t = this.value ? this.valueWithCursor : r;
685
+ switch (this.state) {
686
+ case "error":
687
+ return `${D.trim()}\n${_.yellow(cu)} ${t}\n${_.yellow(Fu)} ${_.yellow(this.error)}\n`;
688
+
689
+ case "submit":
690
+ return `${D}${_.gray(cu)} ${_.dim(this.value || e.placeholder)}`;
691
+
692
+ case "cancel":
693
+ return `${D}${_.gray(cu)} ${_.strikethrough(_.dim(this.value ?? ""))}${this.value?.trim() ? "\n" + _.gray(cu) : ""}`;
694
+
695
+ default:
696
+ return `${D}${_.cyan(cu)} ${t}\n${_.cyan(Fu)}\n`;
697
+ }
698
+ }
699
+ }).prompt(), se = e => {
700
+ var D = e.active ?? "Yes", r = e.inactive ?? "No";
701
+ return new xD({
702
+ active: D,
703
+ inactive: r,
704
+ initialValue: e.initialValue ?? !0,
705
+ render() {
706
+ var t = `${_.gray(cu)}\n${y(this.state)} ${e.message}\n`, n = this.value ? D : r;
707
+ switch (this.state) {
708
+ case "submit":
709
+ return `${t}${_.gray(cu)} ${_.dim(n)}`;
710
+
711
+ case "cancel":
712
+ return `${t}${_.gray(cu)} ${_.strikethrough(_.dim(n))}\n${_.gray(cu)}`;
713
+
714
+ default:
715
+ return `${t}${_.cyan(cu)} ${this.value ? `${_.green(lu)} ${D}` : `${_.dim(du)} ${_.dim(D)}`} ${_.dim("/")} ${this.value ? `${_.dim(du)} ${_.dim(r)}` : `${_.green(lu)} ${r}`}\n${_.cyan(Fu)}\n`;
716
+ }
717
+ }
718
+ }).prompt();
719
+ }, ue = (e = "") => {
720
+ process.stdout.write(`${_.gray(Fu)} ${_.red(e)}\n\n`);
721
+ }, de = () => {
722
+ var D = tu ? [ "◒", "◐", "◓", "◑" ] : [ "•", "o", "O", "0" ], r = tu ? 80 : 120;
723
+ var t, n, i = !1, a = "";
724
+ var u = (e = "", D = 0) => {
725
+ a = e ?? a, i = !1, clearInterval(n);
726
+ var r = 0 === D ? _.green(su) : 1 === D ? _.red(iu) : _.red(au);
727
+ process.stdout.write(k.cursor.move(-999, 0)), process.stdout.write(k.erase.down(1)),
728
+ process.stdout.write(`${r} ${a}\n`), t();
729
+ }, $ = e => {
730
+ i && u(e > 1 ? "Something went wrong" : "Canceled", e);
731
+ };
732
+ return process.on("uncaughtExceptionMonitor", (() => $(2))), process.on("unhandledRejection", (() => $(2))),
733
+ process.on("SIGINT", (() => $(1))), process.on("SIGTERM", (() => $(1))), process.on("exit", $),
734
+ {
735
+ start: (s = "") => {
736
+ i = !0, t = function WD({input: D = e.stdin, output: r = e.stdout, overwrite: t = !0, hideCursor: n = !0} = {}) {
737
+ var i = b.createInterface({
738
+ input: D,
739
+ output: r,
740
+ prompt: "",
741
+ tabSize: 1
742
+ });
743
+ b.emitKeypressEvents(D, i), D.isTTY && D.setRawMode(!0);
744
+ var C = (e, {name: n}) => {
745
+ if ("" === String(e) && process.exit(0), !t) {
746
+ return;
747
+ }
748
+ b.moveCursor(r, "return" === n ? 0 : -1, "return" === n ? -1 : 0, (() => {
749
+ b.clearLine(r, 1, (() => {
750
+ D.once("keypress", C);
751
+ }));
752
+ }));
753
+ };
754
+ return n && process.stdout.write(k.cursor.hide), D.once("keypress", C), () => {
755
+ D.off("keypress", C), n && process.stdout.write(k.cursor.show), D.isTTY && !ru && D.setRawMode(!1),
756
+ i.terminal = !1, i.close();
757
+ };
758
+ }(), a = s.replace(/\.+$/, ""), process.stdout.write(`${_.gray(cu)}\n`);
759
+ var c = 0, l = 0;
760
+ n = setInterval((() => {
761
+ var e = _.magenta(D[c]), r = ".".repeat(Math.floor(l)).slice(0, 3);
762
+ process.stdout.write(k.cursor.move(-999, 0)), process.stdout.write(k.erase.down(1)),
763
+ process.stdout.write(`${e} ${a}${r}`), c = c + 1 < D.length ? c + 1 : 0, l = l < D.length ? l + .125 : 0;
764
+ }), r);
765
+ },
766
+ stop: u,
767
+ message: (e = "") => {
768
+ a = e ?? a;
769
+ }
770
+ };
771
+ };
772
+
773
+ var Cu = {
774
+ exports: {}
775
+ };
776
+
777
+ var pu;
778
+
779
+ var Eu;
780
+
781
+ var fu;
782
+
783
+ var vu;
784
+
785
+ var hu;
786
+
787
+ if ("win32" === process.platform || global.TESTING_WINDOWS) {
788
+ hu = function requireWindows() {
789
+ if (Eu) {
790
+ return pu;
791
+ }
792
+ Eu = 1;
793
+ pu = isexe;
794
+ isexe.sync = function sync(D, r) {
795
+ return checkStat(e.statSync(D), D, r);
796
+ };
797
+ var e = s;
798
+ function checkStat(e, D, r) {
799
+ if (!e.isSymbolicLink() && !e.isFile()) {
800
+ return !1;
801
+ }
802
+ return function checkPathExt(e, D) {
803
+ var r = void 0 !== D.pathExt ? D.pathExt : process.env.PATHEXT;
804
+ if (!r) {
805
+ return !0;
806
+ }
807
+ if (-1 !== (r = r.split(";")).indexOf("")) {
808
+ return !0;
809
+ }
810
+ for (var t = 0; t < r.length; t++) {
811
+ var n = r[t].toLowerCase();
812
+ if (n && e.substr(-n.length).toLowerCase() === n) {
813
+ return !0;
814
+ }
815
+ }
816
+ return !1;
817
+ }(D, r);
818
+ }
819
+ function isexe(D, r, t) {
820
+ e.stat(D, (function(e, n) {
821
+ t(e, e ? !1 : checkStat(n, D, r));
822
+ }));
823
+ }
824
+ return pu;
825
+ }();
826
+ } else {
827
+ hu = function requireMode() {
828
+ if (vu) {
829
+ return fu;
830
+ }
831
+ vu = 1;
832
+ fu = isexe;
833
+ isexe.sync = function sync(D, r) {
834
+ return checkStat(e.statSync(D), r);
835
+ };
836
+ var e = s;
837
+ function isexe(D, r, t) {
838
+ e.stat(D, (function(e, D) {
839
+ t(e, e ? !1 : checkStat(D, r));
840
+ }));
841
+ }
842
+ function checkStat(e, D) {
843
+ return e.isFile() && function checkMode(e, D) {
844
+ var r = e.mode;
845
+ var t = e.uid;
846
+ var n = e.gid;
847
+ var i = void 0 !== D.uid ? D.uid : process.getuid && process.getuid();
848
+ var a = void 0 !== D.gid ? D.gid : process.getgid && process.getgid();
849
+ var s = parseInt("100", 8);
850
+ var c = parseInt("010", 8);
851
+ return r & parseInt("001", 8) || r & c && n === a || r & s && t === i || r & (s | c) && 0 === i;
852
+ }(e, D);
853
+ }
854
+ return fu;
855
+ }();
856
+ }
857
+
858
+ var mu = isexe$1;
859
+
860
+ isexe$1.sync = function sync(e, D) {
861
+ try {
862
+ return hu.sync(e, D || {});
863
+ } catch (e) {
864
+ if (D && D.ignoreErrors || "EACCES" === e.code) {
865
+ return !1;
866
+ } else {
867
+ throw e;
868
+ }
869
+ }
870
+ };
871
+
872
+ function isexe$1(e, D, r) {
873
+ if ("function" == typeof D) {
874
+ r = D;
875
+ D = {};
876
+ }
877
+ if (!r) {
878
+ if ("function" != typeof Promise) {
879
+ throw new TypeError("callback not provided");
880
+ }
881
+ return new Promise((function(r, t) {
882
+ isexe$1(e, D || {}, (function(e, D) {
883
+ if (e) {
884
+ t(e);
885
+ } else {
886
+ r(D);
887
+ }
888
+ }));
889
+ }));
890
+ }
891
+ hu(e, D || {}, (function(e, t) {
892
+ if (e) {
893
+ if ("EACCES" === e.code || D && D.ignoreErrors) {
894
+ e = null;
895
+ t = !1;
896
+ }
897
+ }
898
+ r(e, t);
899
+ }));
900
+ }
901
+
902
+ var gu = "win32" === process.platform || "cygwin" === process.env.OSTYPE || "msys" === process.env.OSTYPE;
903
+
904
+ var Bu = c;
905
+
906
+ var bu = gu ? ";" : ":";
907
+
908
+ var yu = mu;
909
+
910
+ var getNotFoundError = e => Object.assign(new Error(`not found: ${e}`), {
911
+ code: "ENOENT"
912
+ });
913
+
914
+ var getPathInfo = (e, D) => {
915
+ var r = D.colon || bu;
916
+ var t = e.match(/\//) || gu && e.match(/\\/) ? [ "" ] : [ ...gu ? [ process.cwd() ] : [], ...(D.path || process.env.PATH || "").split(r) ];
917
+ var n = gu ? D.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
918
+ var i = gu ? n.split(r) : [ "" ];
919
+ if (gu) {
920
+ if (-1 !== e.indexOf(".") && "" !== i[0]) {
921
+ i.unshift("");
922
+ }
923
+ }
924
+ return {
925
+ pathEnv: t,
926
+ pathExt: i,
927
+ pathExtExe: n
928
+ };
929
+ };
930
+
931
+ var which$1 = (e, D, r) => {
932
+ if ("function" == typeof D) {
933
+ r = D;
934
+ D = {};
935
+ }
936
+ if (!D) {
937
+ D = {};
938
+ }
939
+ var {pathEnv: t, pathExt: n, pathExtExe: i} = getPathInfo(e, D);
940
+ var a = [];
941
+ var step = r => new Promise(((n, i) => {
942
+ if (r === t.length) {
943
+ return D.all && a.length ? n(a) : i(getNotFoundError(e));
944
+ }
945
+ var s = t[r];
946
+ var c = /^".*"$/.test(s) ? s.slice(1, -1) : s;
947
+ var l = Bu.join(c, e);
948
+ var d = !c && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + l : l;
949
+ n(subStep(d, r, 0));
950
+ }));
951
+ var subStep = (e, r, t) => new Promise(((s, c) => {
952
+ if (t === n.length) {
953
+ return s(step(r + 1));
954
+ }
955
+ var l = n[t];
956
+ yu(e + l, {
957
+ pathExt: i
958
+ }, ((n, i) => {
959
+ if (!n && i) {
960
+ if (D.all) {
961
+ a.push(e + l);
962
+ } else {
963
+ return s(e + l);
964
+ }
965
+ }
966
+ return s(subStep(e, r, t + 1));
967
+ }));
968
+ }));
969
+ return r ? step(0).then((e => r(null, e)), r) : step(0);
970
+ };
971
+
972
+ var Au = which$1;
973
+
974
+ which$1.sync = (e, D) => {
975
+ D = D || {};
976
+ var {pathEnv: r, pathExt: t, pathExtExe: n} = getPathInfo(e, D);
977
+ var i = [];
978
+ for (var a = 0; a < r.length; a++) {
979
+ var s = r[a];
980
+ var c = /^".*"$/.test(s) ? s.slice(1, -1) : s;
981
+ var l = Bu.join(c, e);
982
+ var d = !c && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + l : l;
983
+ for (var p = 0; p < t.length; p++) {
984
+ var E = d + t[p];
985
+ try {
986
+ if (yu.sync(E, {
987
+ pathExt: n
988
+ })) {
989
+ if (D.all) {
990
+ i.push(E);
991
+ } else {
992
+ return E;
993
+ }
994
+ }
995
+ } catch (e) {}
996
+ }
997
+ }
998
+ if (D.all && i.length) {
999
+ return i;
1000
+ }
1001
+ if (D.nothrow) {
1002
+ return null;
1003
+ }
1004
+ throw getNotFoundError(e);
1005
+ };
1006
+
1007
+ var wu = {
1008
+ exports: {}
1009
+ };
1010
+
1011
+ var pathKey$1 = (e = {}) => {
1012
+ var D = e.env || process.env;
1013
+ if ("win32" !== (e.platform || process.platform)) {
1014
+ return "PATH";
1015
+ }
1016
+ return Object.keys(D).reverse().find((e => "PATH" === e.toUpperCase())) || "Path";
1017
+ };
1018
+
1019
+ wu.exports = pathKey$1;
1020
+
1021
+ wu.exports.default = pathKey$1;
1022
+
1023
+ var xu = c;
1024
+
1025
+ var Su = Au;
1026
+
1027
+ var $u = wu.exports;
1028
+
1029
+ function resolveCommandAttempt(e, D) {
1030
+ var r = e.options.env || process.env;
1031
+ var t = process.cwd();
1032
+ var n = null != e.options.cwd;
1033
+ var i = n && void 0 !== process.chdir && !process.chdir.disabled;
1034
+ if (i) {
1035
+ try {
1036
+ process.chdir(e.options.cwd);
1037
+ } catch (e) {}
1038
+ }
1039
+ var a;
1040
+ try {
1041
+ a = Su.sync(e.command, {
1042
+ path: r[$u({
1043
+ env: r
1044
+ })],
1045
+ pathExt: D ? xu.delimiter : void 0
1046
+ });
1047
+ } catch (e) {} finally {
1048
+ if (i) {
1049
+ process.chdir(t);
1050
+ }
1051
+ }
1052
+ if (a) {
1053
+ a = xu.resolve(n ? e.options.cwd : "", a);
1054
+ }
1055
+ return a;
1056
+ }
1057
+
1058
+ var Tu = function resolveCommand$1(e) {
1059
+ return resolveCommandAttempt(e) || resolveCommandAttempt(e, !0);
1060
+ };
1061
+
1062
+ var Iu = {};
1063
+
1064
+ var Ou = /([()\][%!^"`<>&|;, *?])/g;
1065
+
1066
+ Iu.command = function escapeCommand(e) {
1067
+ return e = e.replace(Ou, "^$1");
1068
+ };
1069
+
1070
+ Iu.argument = function escapeArgument(e, D) {
1071
+ e = (e = `"${e = (e = (e = `${e}`).replace(/(\\*)"/g, '$1$1\\"')).replace(/(\\*)$/, "$1$1")}"`).replace(Ou, "^$1");
1072
+ if (D) {
1073
+ e = e.replace(Ou, "^$1");
1074
+ }
1075
+ return e;
1076
+ };
1077
+
1078
+ var ku = /^#!(.*)/;
1079
+
1080
+ var ju = s;
1081
+
1082
+ var shebangCommand = (e = "") => {
1083
+ var D = e.match(ku);
1084
+ if (!D) {
1085
+ return null;
1086
+ }
1087
+ var [r, t] = D[0].replace(/#! ?/, "").split(" ");
1088
+ var n = r.split("/").pop();
1089
+ if ("env" === n) {
1090
+ return t;
1091
+ }
1092
+ return t ? `${n} ${t}` : n;
1093
+ };
1094
+
1095
+ var Pu = c;
1096
+
1097
+ var Gu = Tu;
1098
+
1099
+ var Ru = Iu;
1100
+
1101
+ var Lu = function readShebang$1(e) {
1102
+ var D = Buffer.alloc(150);
1103
+ var r;
1104
+ try {
1105
+ r = ju.openSync(e, "r");
1106
+ ju.readSync(r, D, 0, 150, 0);
1107
+ ju.closeSync(r);
1108
+ } catch (e) {}
1109
+ return shebangCommand(D.toString());
1110
+ };
1111
+
1112
+ var Mu = "win32" === process.platform;
1113
+
1114
+ var _u = /\.(?:com|exe)$/i;
1115
+
1116
+ var Nu = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
1117
+
1118
+ function parseNonShell(e) {
1119
+ if (!Mu) {
1120
+ return e;
1121
+ }
1122
+ var D = function detectShebang(e) {
1123
+ e.file = Gu(e);
1124
+ var D = e.file && Lu(e.file);
1125
+ if (D) {
1126
+ e.args.unshift(e.file);
1127
+ e.command = D;
1128
+ return Gu(e);
1129
+ }
1130
+ return e.file;
1131
+ }(e);
1132
+ var r = !_u.test(D);
1133
+ if (e.options.forceShell || r) {
1134
+ var t = Nu.test(D);
1135
+ e.command = Pu.normalize(e.command);
1136
+ e.command = Ru.command(e.command);
1137
+ e.args = e.args.map((e => Ru.argument(e, t)));
1138
+ var n = [ e.command ].concat(e.args).join(" ");
1139
+ e.args = [ "/d", "/s", "/c", `"${n}"` ];
1140
+ e.command = process.env.comspec || "cmd.exe";
1141
+ e.options.windowsVerbatimArguments = !0;
1142
+ }
1143
+ return e;
1144
+ }
1145
+
1146
+ var Wu = "win32" === process.platform;
1147
+
1148
+ function notFoundError(e, D) {
1149
+ return Object.assign(new Error(`${D} ${e.command} ENOENT`), {
1150
+ code: "ENOENT",
1151
+ errno: "ENOENT",
1152
+ syscall: `${D} ${e.command}`,
1153
+ path: e.command,
1154
+ spawnargs: e.args
1155
+ });
1156
+ }
1157
+
1158
+ function verifyENOENT(e, D) {
1159
+ if (Wu && 1 === e && !D.file) {
1160
+ return notFoundError(D.original, "spawn");
1161
+ }
1162
+ return null;
1163
+ }
1164
+
1165
+ var Uu = {
1166
+ hookChildProcess: function hookChildProcess(e, D) {
1167
+ if (!Wu) {
1168
+ return;
1169
+ }
1170
+ var r = e.emit;
1171
+ e.emit = function(t, n) {
1172
+ if ("exit" === t) {
1173
+ var i = verifyENOENT(n, D);
1174
+ if (i) {
1175
+ return r.call(e, "error", i);
1176
+ }
1177
+ }
1178
+ return r.apply(e, arguments);
1179
+ };
1180
+ },
1181
+ verifyENOENT,
1182
+ verifyENOENTSync: function verifyENOENTSync(e, D) {
1183
+ if (Wu && 1 === e && !D.file) {
1184
+ return notFoundError(D.original, "spawnSync");
1185
+ }
1186
+ return null;
1187
+ },
1188
+ notFoundError
1189
+ };
1190
+
1191
+ var qu = l;
1192
+
1193
+ var zu = function parse$1(e, D, r) {
1194
+ if (D && !Array.isArray(D)) {
1195
+ r = D;
1196
+ D = null;
1197
+ }
1198
+ var t = {
1199
+ command: e,
1200
+ args: D = D ? D.slice(0) : [],
1201
+ options: r = Object.assign({}, r),
1202
+ file: void 0,
1203
+ original: {
1204
+ command: e,
1205
+ args: D
1206
+ }
1207
+ };
1208
+ return r.shell ? t : parseNonShell(t);
1209
+ };
1210
+
1211
+ var Vu = Uu;
1212
+
1213
+ function spawn(e, D, r) {
1214
+ var t = zu(e, D, r);
1215
+ var n = qu.spawn(t.command, t.args, t.options);
1216
+ Vu.hookChildProcess(n, t);
1217
+ return n;
1218
+ }
1219
+
1220
+ Cu.exports = spawn;
1221
+
1222
+ Cu.exports.spawn = spawn;
1223
+
1224
+ Cu.exports.sync = function spawnSync(e, D, r) {
1225
+ var t = zu(e, D, r);
1226
+ var n = qu.spawnSync(t.command, t.args, t.options);
1227
+ n.error = n.error || Vu.verifyENOENTSync(n.status, t);
1228
+ return n;
1229
+ };
1230
+
1231
+ Cu.exports._parse = zu;
1232
+
1233
+ Cu.exports._enoent = Vu;
1234
+
1235
+ var Ku = getDefaultExportFromCjs(Cu.exports);
1236
+
1237
+ function pathKey(e = {}) {
1238
+ var {env: D = process.env, platform: r = process.platform} = e;
1239
+ if ("win32" !== r) {
1240
+ return "PATH";
1241
+ }
1242
+ return Object.keys(D).reverse().find((e => "PATH" === e.toUpperCase())) || "Path";
1243
+ }
1244
+
1245
+ var applyPreferLocal = (e, D) => {
1246
+ var r;
1247
+ while (r !== D) {
1248
+ e.push(n.join(D, "node_modules/.bin"));
1249
+ r = D;
1250
+ D = n.resolve(D, "..");
1251
+ }
1252
+ };
1253
+
1254
+ var applyExecPath = (e, D, r) => {
1255
+ var t = D instanceof URL ? d.fileURLToPath(D) : D;
1256
+ e.push(n.resolve(r, t, ".."));
1257
+ };
1258
+
1259
+ var npmRunPathEnv = ({env: D = e.env, ...r} = {}) => {
1260
+ var t = pathKey({
1261
+ env: D = {
1262
+ ...D
1263
+ }
1264
+ });
1265
+ r.path = D[t];
1266
+ D[t] = (({cwd: D = e.cwd(), path: r = e.env[pathKey()], preferLocal: t = !0, execPath: i = e.execPath, addExecPath: a = !0} = {}) => {
1267
+ var s = D instanceof URL ? d.fileURLToPath(D) : D;
1268
+ var c = n.resolve(s);
1269
+ var l = [];
1270
+ if (t) {
1271
+ applyPreferLocal(l, c);
1272
+ }
1273
+ if (a) {
1274
+ applyExecPath(l, i, c);
1275
+ }
1276
+ return [ ...l, r ].join(n.delimiter);
1277
+ })(r);
1278
+ return D;
1279
+ };
1280
+
1281
+ var copyProperty = (e, D, r, t) => {
1282
+ if ("length" === r || "prototype" === r) {
1283
+ return;
1284
+ }
1285
+ if ("arguments" === r || "caller" === r) {
1286
+ return;
1287
+ }
1288
+ var n = Object.getOwnPropertyDescriptor(e, r);
1289
+ var i = Object.getOwnPropertyDescriptor(D, r);
1290
+ if (!canCopyProperty(n, i) && t) {
1291
+ return;
1292
+ }
1293
+ Object.defineProperty(e, r, i);
1294
+ };
1295
+
1296
+ var canCopyProperty = function(e, D) {
1297
+ return void 0 === e || e.configurable || e.writable === D.writable && e.enumerable === D.enumerable && e.configurable === D.configurable && (e.writable || e.value === D.value);
1298
+ };
1299
+
1300
+ var wrappedToString = (e, D) => `/* Wrapped ${e}*/\n${D}`;
1301
+
1302
+ var Hu = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
1303
+
1304
+ var Yu = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
1305
+
1306
+ function mimicFunction(e, D, {ignoreNonConfigurable: r = !1} = {}) {
1307
+ var {name: t} = e;
1308
+ for (var n of Reflect.ownKeys(D)) {
1309
+ copyProperty(e, D, n, r);
1310
+ }
1311
+ ((e, D) => {
1312
+ var r = Object.getPrototypeOf(D);
1313
+ if (r === Object.getPrototypeOf(e)) {
1314
+ return;
1315
+ }
1316
+ Object.setPrototypeOf(e, r);
1317
+ })(e, D);
1318
+ ((e, D, r) => {
1319
+ var t = "" === r ? "" : `with ${r.trim()}() `;
1320
+ var n = wrappedToString.bind(null, t, D.toString());
1321
+ Object.defineProperty(n, "name", Yu);
1322
+ Object.defineProperty(e, "toString", {
1323
+ ...Hu,
1324
+ value: n
1325
+ });
1326
+ })(e, D, t);
1327
+ return e;
1328
+ }
1329
+
1330
+ var Ju = new WeakMap;
1331
+
1332
+ var onetime = (e, D = {}) => {
1333
+ if ("function" != typeof e) {
1334
+ throw new TypeError("Expected a function");
1335
+ }
1336
+ var r;
1337
+ var t = 0;
1338
+ var n = e.displayName || e.name || "<anonymous>";
1339
+ var onetime = function(...i) {
1340
+ Ju.set(onetime, ++t);
1341
+ if (1 === t) {
1342
+ r = e.apply(this, i);
1343
+ e = null;
1344
+ } else if (!0 === D.throw) {
1345
+ throw new Error(`Function \`${n}\` can only be called once`);
1346
+ }
1347
+ return r;
1348
+ };
1349
+ mimicFunction(onetime, e);
1350
+ Ju.set(onetime, t);
1351
+ return onetime;
1352
+ };
1353
+
1354
+ onetime.callCount = e => {
1355
+ if (!Ju.has(e)) {
1356
+ throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);
1357
+ }
1358
+ return Ju.get(e);
1359
+ };
1360
+
1361
+ var getRealtimeSignal = (e, D) => ({
1362
+ name: `SIGRT${D + 1}`,
1363
+ number: Xu + D,
1364
+ action: "terminate",
1365
+ description: "Application-specific signal (realtime)",
1366
+ standard: "posix"
1367
+ });
1368
+
1369
+ var Xu = 34;
1370
+
1371
+ var Zu = 64;
1372
+
1373
+ var Qu = [ {
1374
+ name: "SIGHUP",
1375
+ number: 1,
1376
+ action: "terminate",
1377
+ description: "Terminal closed",
1378
+ standard: "posix"
1379
+ }, {
1380
+ name: "SIGINT",
1381
+ number: 2,
1382
+ action: "terminate",
1383
+ description: "User interruption with CTRL-C",
1384
+ standard: "ansi"
1385
+ }, {
1386
+ name: "SIGQUIT",
1387
+ number: 3,
1388
+ action: "core",
1389
+ description: "User interruption with CTRL-\\",
1390
+ standard: "posix"
1391
+ }, {
1392
+ name: "SIGILL",
1393
+ number: 4,
1394
+ action: "core",
1395
+ description: "Invalid machine instruction",
1396
+ standard: "ansi"
1397
+ }, {
1398
+ name: "SIGTRAP",
1399
+ number: 5,
1400
+ action: "core",
1401
+ description: "Debugger breakpoint",
1402
+ standard: "posix"
1403
+ }, {
1404
+ name: "SIGABRT",
1405
+ number: 6,
1406
+ action: "core",
1407
+ description: "Aborted",
1408
+ standard: "ansi"
1409
+ }, {
1410
+ name: "SIGIOT",
1411
+ number: 6,
1412
+ action: "core",
1413
+ description: "Aborted",
1414
+ standard: "bsd"
1415
+ }, {
1416
+ name: "SIGBUS",
1417
+ number: 7,
1418
+ action: "core",
1419
+ description: "Bus error due to misaligned, non-existing address or paging error",
1420
+ standard: "bsd"
1421
+ }, {
1422
+ name: "SIGEMT",
1423
+ number: 7,
1424
+ action: "terminate",
1425
+ description: "Command should be emulated but is not implemented",
1426
+ standard: "other"
1427
+ }, {
1428
+ name: "SIGFPE",
1429
+ number: 8,
1430
+ action: "core",
1431
+ description: "Floating point arithmetic error",
1432
+ standard: "ansi"
1433
+ }, {
1434
+ name: "SIGKILL",
1435
+ number: 9,
1436
+ action: "terminate",
1437
+ description: "Forced termination",
1438
+ standard: "posix",
1439
+ forced: !0
1440
+ }, {
1441
+ name: "SIGUSR1",
1442
+ number: 10,
1443
+ action: "terminate",
1444
+ description: "Application-specific signal",
1445
+ standard: "posix"
1446
+ }, {
1447
+ name: "SIGSEGV",
1448
+ number: 11,
1449
+ action: "core",
1450
+ description: "Segmentation fault",
1451
+ standard: "ansi"
1452
+ }, {
1453
+ name: "SIGUSR2",
1454
+ number: 12,
1455
+ action: "terminate",
1456
+ description: "Application-specific signal",
1457
+ standard: "posix"
1458
+ }, {
1459
+ name: "SIGPIPE",
1460
+ number: 13,
1461
+ action: "terminate",
1462
+ description: "Broken pipe or socket",
1463
+ standard: "posix"
1464
+ }, {
1465
+ name: "SIGALRM",
1466
+ number: 14,
1467
+ action: "terminate",
1468
+ description: "Timeout or timer",
1469
+ standard: "posix"
1470
+ }, {
1471
+ name: "SIGTERM",
1472
+ number: 15,
1473
+ action: "terminate",
1474
+ description: "Termination",
1475
+ standard: "ansi"
1476
+ }, {
1477
+ name: "SIGSTKFLT",
1478
+ number: 16,
1479
+ action: "terminate",
1480
+ description: "Stack is empty or overflowed",
1481
+ standard: "other"
1482
+ }, {
1483
+ name: "SIGCHLD",
1484
+ number: 17,
1485
+ action: "ignore",
1486
+ description: "Child process terminated, paused or unpaused",
1487
+ standard: "posix"
1488
+ }, {
1489
+ name: "SIGCLD",
1490
+ number: 17,
1491
+ action: "ignore",
1492
+ description: "Child process terminated, paused or unpaused",
1493
+ standard: "other"
1494
+ }, {
1495
+ name: "SIGCONT",
1496
+ number: 18,
1497
+ action: "unpause",
1498
+ description: "Unpaused",
1499
+ standard: "posix",
1500
+ forced: !0
1501
+ }, {
1502
+ name: "SIGSTOP",
1503
+ number: 19,
1504
+ action: "pause",
1505
+ description: "Paused",
1506
+ standard: "posix",
1507
+ forced: !0
1508
+ }, {
1509
+ name: "SIGTSTP",
1510
+ number: 20,
1511
+ action: "pause",
1512
+ description: 'Paused using CTRL-Z or "suspend"',
1513
+ standard: "posix"
1514
+ }, {
1515
+ name: "SIGTTIN",
1516
+ number: 21,
1517
+ action: "pause",
1518
+ description: "Background process cannot read terminal input",
1519
+ standard: "posix"
1520
+ }, {
1521
+ name: "SIGBREAK",
1522
+ number: 21,
1523
+ action: "terminate",
1524
+ description: "User interruption with CTRL-BREAK",
1525
+ standard: "other"
1526
+ }, {
1527
+ name: "SIGTTOU",
1528
+ number: 22,
1529
+ action: "pause",
1530
+ description: "Background process cannot write to terminal output",
1531
+ standard: "posix"
1532
+ }, {
1533
+ name: "SIGURG",
1534
+ number: 23,
1535
+ action: "ignore",
1536
+ description: "Socket received out-of-band data",
1537
+ standard: "bsd"
1538
+ }, {
1539
+ name: "SIGXCPU",
1540
+ number: 24,
1541
+ action: "core",
1542
+ description: "Process timed out",
1543
+ standard: "bsd"
1544
+ }, {
1545
+ name: "SIGXFSZ",
1546
+ number: 25,
1547
+ action: "core",
1548
+ description: "File too big",
1549
+ standard: "bsd"
1550
+ }, {
1551
+ name: "SIGVTALRM",
1552
+ number: 26,
1553
+ action: "terminate",
1554
+ description: "Timeout or timer",
1555
+ standard: "bsd"
1556
+ }, {
1557
+ name: "SIGPROF",
1558
+ number: 27,
1559
+ action: "terminate",
1560
+ description: "Timeout or timer",
1561
+ standard: "bsd"
1562
+ }, {
1563
+ name: "SIGWINCH",
1564
+ number: 28,
1565
+ action: "ignore",
1566
+ description: "Terminal window size changed",
1567
+ standard: "bsd"
1568
+ }, {
1569
+ name: "SIGIO",
1570
+ number: 29,
1571
+ action: "terminate",
1572
+ description: "I/O is available",
1573
+ standard: "other"
1574
+ }, {
1575
+ name: "SIGPOLL",
1576
+ number: 29,
1577
+ action: "terminate",
1578
+ description: "Watched event",
1579
+ standard: "other"
1580
+ }, {
1581
+ name: "SIGINFO",
1582
+ number: 29,
1583
+ action: "ignore",
1584
+ description: "Request for process information",
1585
+ standard: "other"
1586
+ }, {
1587
+ name: "SIGPWR",
1588
+ number: 30,
1589
+ action: "terminate",
1590
+ description: "Device running out of power",
1591
+ standard: "systemv"
1592
+ }, {
1593
+ name: "SIGSYS",
1594
+ number: 31,
1595
+ action: "core",
1596
+ description: "Invalid system call",
1597
+ standard: "other"
1598
+ }, {
1599
+ name: "SIGUNUSED",
1600
+ number: 31,
1601
+ action: "terminate",
1602
+ description: "Invalid system call",
1603
+ standard: "other"
1604
+ } ];
1605
+
1606
+ var getSignals = () => {
1607
+ var e = Array.from({
1608
+ length: Zu - Xu + 1
1609
+ }, getRealtimeSignal);
1610
+ return [ ...Qu, ...e ].map(normalizeSignal);
1611
+ };
1612
+
1613
+ var normalizeSignal = ({name: e, number: D, description: r, action: t, forced: n = !1, standard: i}) => {
1614
+ var {signals: {[e]: a}} = p.constants;
1615
+ var s = void 0 !== a;
1616
+ return {
1617
+ name: e,
1618
+ number: s ? a : D,
1619
+ description: r,
1620
+ supported: s,
1621
+ action: t,
1622
+ forced: n,
1623
+ standard: i
1624
+ };
1625
+ };
1626
+
1627
+ var getSignalByName = ({name: e, number: D, description: r, supported: t, action: n, forced: i, standard: a}) => [ e, {
1628
+ name: e,
1629
+ number: D,
1630
+ description: r,
1631
+ supported: t,
1632
+ action: n,
1633
+ forced: i,
1634
+ standard: a
1635
+ } ];
1636
+
1637
+ var ee = (() => {
1638
+ var e = getSignals();
1639
+ return Object.fromEntries(e.map(getSignalByName));
1640
+ })();
1641
+
1642
+ var getSignalByNumber = (e, D) => {
1643
+ var r = findSignalByNumber(e, D);
1644
+ if (void 0 === r) {
1645
+ return {};
1646
+ }
1647
+ var {name: t, description: n, supported: i, action: a, forced: s, standard: c} = r;
1648
+ return {
1649
+ [e]: {
1650
+ name: t,
1651
+ number: e,
1652
+ description: n,
1653
+ supported: i,
1654
+ action: a,
1655
+ forced: s,
1656
+ standard: c
1657
+ }
1658
+ };
1659
+ };
1660
+
1661
+ var findSignalByNumber = (e, D) => {
1662
+ var r = D.find((({name: D}) => p.constants.signals[D] === e));
1663
+ if (void 0 !== r) {
1664
+ return r;
1665
+ }
1666
+ return D.find((D => D.number === e));
1667
+ };
1668
+
1669
+ (() => {
1670
+ var e = getSignals();
1671
+ var D = Array.from({
1672
+ length: Zu + 1
1673
+ }, ((D, r) => getSignalByNumber(r, e)));
1674
+ Object.assign({}, ...D);
1675
+ })();
1676
+
1677
+ var makeError = ({stdout: D, stderr: r, all: t, error: n, signal: i, exitCode: a, command: s, escapedCommand: c, timedOut: l, isCanceled: d, killed: p, parsed: {options: {timeout: E, cwd: f = e.cwd()}}}) => {
1678
+ var h = void 0 === (i = null === i ? void 0 : i) ? void 0 : ee[i].description;
1679
+ var m = (({timedOut: e, timeout: D, errorCode: r, signal: t, signalDescription: n, exitCode: i, isCanceled: a}) => {
1680
+ if (e) {
1681
+ return `timed out after ${D} milliseconds`;
1682
+ }
1683
+ if (a) {
1684
+ return "was canceled";
1685
+ }
1686
+ if (void 0 !== r) {
1687
+ return `failed with ${r}`;
1688
+ }
1689
+ if (void 0 !== t) {
1690
+ return `was killed with ${t} (${n})`;
1691
+ }
1692
+ if (void 0 !== i) {
1693
+ return `failed with exit code ${i}`;
1694
+ }
1695
+ return "failed";
1696
+ })({
1697
+ timedOut: l,
1698
+ timeout: E,
1699
+ errorCode: n && n.code,
1700
+ signal: i,
1701
+ signalDescription: h,
1702
+ exitCode: a = null === a ? void 0 : a,
1703
+ isCanceled: d
1704
+ });
1705
+ var g = `Command ${m}: ${s}`;
1706
+ var B = "[object Error]" === Object.prototype.toString.call(n);
1707
+ var b = B ? `${g}\n${n.message}` : g;
1708
+ var w = [ b, r, D ].filter(Boolean).join("\n");
1709
+ if (B) {
1710
+ n.originalMessage = n.message;
1711
+ n.message = w;
1712
+ } else {
1713
+ n = new Error(w);
1714
+ }
1715
+ n.shortMessage = b;
1716
+ n.command = s;
1717
+ n.escapedCommand = c;
1718
+ n.exitCode = a;
1719
+ n.signal = i;
1720
+ n.signalDescription = h;
1721
+ n.stdout = D;
1722
+ n.stderr = r;
1723
+ n.cwd = f;
1724
+ if (void 0 !== t) {
1725
+ n.all = t;
1726
+ }
1727
+ if ("bufferedData" in n) {
1728
+ delete n.bufferedData;
1729
+ }
1730
+ n.failed = !0;
1731
+ n.timedOut = Boolean(l);
1732
+ n.isCanceled = d;
1733
+ n.killed = p && !l;
1734
+ return n;
1735
+ };
1736
+
1737
+ var De = [ "stdin", "stdout", "stderr" ];
1738
+
1739
+ var normalizeStdio = e => {
1740
+ if (!e) {
1741
+ return;
1742
+ }
1743
+ var {stdio: D} = e;
1744
+ if (void 0 === D) {
1745
+ return De.map((D => e[D]));
1746
+ }
1747
+ if ((e => De.some((D => void 0 !== e[D])))(e)) {
1748
+ throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${De.map((e => `\`${e}\``)).join(", ")}`);
1749
+ }
1750
+ if ("string" == typeof D) {
1751
+ return D;
1752
+ }
1753
+ if (!Array.isArray(D)) {
1754
+ throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof D}\``);
1755
+ }
1756
+ var r = Math.max(D.length, De.length);
1757
+ return Array.from({
1758
+ length: r
1759
+ }, ((e, r) => D[r]));
1760
+ };
1761
+
1762
+ var re = [];
1763
+
1764
+ re.push("SIGHUP", "SIGINT", "SIGTERM");
1765
+
1766
+ if ("win32" !== process.platform) {
1767
+ re.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
1768
+ }
1769
+
1770
+ if ("linux" === process.platform) {
1771
+ re.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
1772
+ }
1773
+
1774
+ var processOk = e => !!e && "object" == typeof e && "function" == typeof e.removeListener && "function" == typeof e.emit && "function" == typeof e.reallyExit && "function" == typeof e.listeners && "function" == typeof e.kill && "number" == typeof e.pid && "function" == typeof e.on;
1775
+
1776
+ var ne = Symbol.for("signal-exit emitter");
1777
+
1778
+ var ie = globalThis;
1779
+
1780
+ var ae = Object.defineProperty.bind(Object);
1781
+
1782
+ class Emitter {
1783
+ emitted={
1784
+ afterExit: !1,
1785
+ exit: !1
1786
+ };
1787
+ listeners={
1788
+ afterExit: [],
1789
+ exit: []
1790
+ };
1791
+ count=0;
1792
+ id=Math.random();
1793
+ constructor() {
1794
+ if (ie[ne]) {
1795
+ return ie[ne];
1796
+ }
1797
+ ae(ie, ne, {
1798
+ value: this,
1799
+ writable: !1,
1800
+ enumerable: !1,
1801
+ configurable: !1
1802
+ });
1803
+ }
1804
+ on(e, D) {
1805
+ this.listeners[e].push(D);
1806
+ }
1807
+ removeListener(e, D) {
1808
+ var r = this.listeners[e];
1809
+ var t = r.indexOf(D);
1810
+ if (-1 === t) {
1811
+ return;
1812
+ }
1813
+ if (0 === t && 1 === r.length) {
1814
+ r.length = 0;
1815
+ } else {
1816
+ r.splice(t, 1);
1817
+ }
1818
+ }
1819
+ emit(e, D, r) {
1820
+ if (this.emitted[e]) {
1821
+ return !1;
1822
+ }
1823
+ this.emitted[e] = !0;
1824
+ var t = !1;
1825
+ for (var n of this.listeners[e]) {
1826
+ t = !0 === n(D, r) || t;
1827
+ }
1828
+ if ("exit" === e) {
1829
+ t = this.emit("afterExit", D, r) || t;
1830
+ }
1831
+ return t;
1832
+ }
1833
+ }
1834
+
1835
+ class SignalExitBase {}
1836
+
1837
+ var oe = globalThis.process;
1838
+
1839
+ var {onExit: ce} = (Fe = processOk(oe) ? new class SignalExit extends SignalExitBase {
1840
+ #u="win32" === oe.platform ? "SIGINT" : "SIGHUP";
1841
+ #e=new Emitter;
1842
+ #D;
1843
+ #r;
1844
+ #t;
1845
+ #n={};
1846
+ #i=!1;
1847
+ constructor(e) {
1848
+ var D;
1849
+ super();
1850
+ D = this;
1851
+ this.#D = e;
1852
+ this.#n = {};
1853
+ var _loop = function(r) {
1854
+ D.#n[r] = () => {
1855
+ var t = D.#D.listeners(r);
1856
+ var {count: n} = D.#e;
1857
+ if ("object" == typeof e.__signal_exit_emitter__ && "number" == typeof e.__signal_exit_emitter__.count) {
1858
+ n += e.__signal_exit_emitter__.count;
1859
+ }
1860
+ if (t.length === n) {
1861
+ D.unload();
1862
+ var i = D.#e.emit("exit", null, r);
1863
+ var a = "SIGHUP" === r ? D.#u : r;
1864
+ if (!i) {
1865
+ e.kill(e.pid, a);
1866
+ }
1867
+ }
1868
+ };
1869
+ };
1870
+ for (var r of re) {
1871
+ _loop(r);
1872
+ }
1873
+ this.#t = e.reallyExit;
1874
+ this.#r = e.emit;
1875
+ }
1876
+ onExit(e, D) {
1877
+ if (!processOk(this.#D)) {
1878
+ return () => {};
1879
+ }
1880
+ if (!1 === this.#i) {
1881
+ this.load();
1882
+ }
1883
+ var r = D?.alwaysLast ? "afterExit" : "exit";
1884
+ this.#e.on(r, e);
1885
+ return () => {
1886
+ this.#e.removeListener(r, e);
1887
+ if (0 === this.#e.listeners.exit.length && 0 === this.#e.listeners.afterExit.length) {
1888
+ this.unload();
1889
+ }
1890
+ };
1891
+ }
1892
+ load() {
1893
+ if (this.#i) {
1894
+ return;
1895
+ }
1896
+ this.#i = !0;
1897
+ this.#e.count += 1;
1898
+ for (var e of re) {
1899
+ try {
1900
+ var D = this.#n[e];
1901
+ if (D) {
1902
+ this.#D.on(e, D);
1903
+ }
1904
+ } catch (e) {}
1905
+ }
1906
+ this.#D.emit = (e, ...D) => this.#a(e, ...D);
1907
+ this.#D.reallyExit = e => this.#s(e);
1908
+ }
1909
+ unload() {
1910
+ if (!this.#i) {
1911
+ return;
1912
+ }
1913
+ this.#i = !1;
1914
+ re.forEach((e => {
1915
+ var D = this.#n[e];
1916
+ if (!D) {
1917
+ throw new Error("Listener not defined for signal: " + e);
1918
+ }
1919
+ try {
1920
+ this.#D.removeListener(e, D);
1921
+ } catch (e) {}
1922
+ }));
1923
+ this.#D.emit = this.#r;
1924
+ this.#D.reallyExit = this.#t;
1925
+ this.#e.count -= 1;
1926
+ }
1927
+ #s(e) {
1928
+ if (!processOk(this.#D)) {
1929
+ return 0;
1930
+ }
1931
+ this.#D.exitCode = e || 0;
1932
+ this.#e.emit("exit", this.#D.exitCode, null);
1933
+ return this.#t.call(this.#D, this.#D.exitCode);
1934
+ }
1935
+ #a(e, ...D) {
1936
+ var r = this.#r;
1937
+ if ("exit" === e && processOk(this.#D)) {
1938
+ if ("number" == typeof D[0]) {
1939
+ this.#D.exitCode = D[0];
1940
+ }
1941
+ var t = r.call(this.#D, e, ...D);
1942
+ this.#e.emit("exit", this.#D.exitCode, null);
1943
+ return t;
1944
+ } else {
1945
+ return r.call(this.#D, e, ...D);
1946
+ }
1947
+ }
1948
+ }(oe) : new class SignalExitFallback extends SignalExitBase {
1949
+ onExit() {
1950
+ return () => {};
1951
+ }
1952
+ load() {}
1953
+ unload() {}
1954
+ }, {
1955
+ onExit: (e, D) => Fe.onExit(e, D),
1956
+ load: () => Fe.load(),
1957
+ unload: () => Fe.unload()
1958
+ });
1959
+
1960
+ var Fe;
1961
+
1962
+ var spawnedKill = (e, D = "SIGTERM", r = {}) => {
1963
+ var t = e(D);
1964
+ setKillTimeout(e, D, r, t);
1965
+ return t;
1966
+ };
1967
+
1968
+ var setKillTimeout = (e, D, r, t) => {
1969
+ if (!shouldForceKill(D, r, t)) {
1970
+ return;
1971
+ }
1972
+ var n = getForceKillAfterTimeout(r);
1973
+ var i = setTimeout((() => {
1974
+ e("SIGKILL");
1975
+ }), n);
1976
+ if (i.unref) {
1977
+ i.unref();
1978
+ }
1979
+ };
1980
+
1981
+ var shouldForceKill = (e, {forceKillAfterTimeout: D}, r) => isSigterm(e) && !1 !== D && r;
1982
+
1983
+ var isSigterm = e => e === p.constants.signals.SIGTERM || "string" == typeof e && "SIGTERM" === e.toUpperCase();
1984
+
1985
+ var getForceKillAfterTimeout = ({forceKillAfterTimeout: e = !0}) => {
1986
+ if (!0 === e) {
1987
+ return 5e3;
1988
+ }
1989
+ if (!Number.isFinite(e) || e < 0) {
1990
+ throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
1991
+ }
1992
+ return e;
1993
+ };
1994
+
1995
+ var spawnedCancel = (e, D) => {
1996
+ if (e.kill()) {
1997
+ D.isCanceled = !0;
1998
+ }
1999
+ };
2000
+
2001
+ var setupTimeout = (e, {timeout: D, killSignal: r = "SIGTERM"}, t) => {
2002
+ if (0 === D || void 0 === D) {
2003
+ return t;
2004
+ }
2005
+ var n;
2006
+ var i = new Promise(((t, i) => {
2007
+ n = setTimeout((() => {
2008
+ ((e, D, r) => {
2009
+ e.kill(D);
2010
+ r(Object.assign(new Error("Timed out"), {
2011
+ timedOut: !0,
2012
+ signal: D
2013
+ }));
2014
+ })(e, r, i);
2015
+ }), D);
2016
+ }));
2017
+ var a = t.finally((() => {
2018
+ clearTimeout(n);
2019
+ }));
2020
+ return Promise.race([ i, a ]);
2021
+ };
2022
+
2023
+ var validateTimeout = ({timeout: e}) => {
2024
+ if (void 0 !== e && (!Number.isFinite(e) || e < 0)) {
2025
+ throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);
2026
+ }
2027
+ };
2028
+
2029
+ var setExitHandler = async (e, {cleanup: D, detached: r}, t) => {
2030
+ if (!D || r) {
2031
+ return t;
2032
+ }
2033
+ var n = ce((() => {
2034
+ e.kill();
2035
+ }));
2036
+ return t.finally((() => {
2037
+ n();
2038
+ }));
2039
+ };
2040
+
2041
+ function isStream(e) {
2042
+ return null !== e && "object" == typeof e && "function" == typeof e.pipe;
2043
+ }
2044
+
2045
+ function isWritableStream(e) {
2046
+ return isStream(e) && !1 !== e.writable && "function" == typeof e._write && "object" == typeof e._writableState;
2047
+ }
2048
+
2049
+ var pipeToTarget = (e, D, r) => {
2050
+ if ("string" == typeof r) {
2051
+ e[D].pipe(E.createWriteStream(r));
2052
+ return e;
2053
+ }
2054
+ if (isWritableStream(r)) {
2055
+ e[D].pipe(r);
2056
+ return e;
2057
+ }
2058
+ if (!(e => e instanceof a.ChildProcess && "function" == typeof e.then)(r)) {
2059
+ throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
2060
+ }
2061
+ if (!isWritableStream(r.stdin)) {
2062
+ throw new TypeError("The target child process's stdin must be available.");
2063
+ }
2064
+ e[D].pipe(r.stdin);
2065
+ return r;
2066
+ };
2067
+
2068
+ var addPipeMethods = e => {
2069
+ if (null !== e.stdout) {
2070
+ e.pipeStdout = pipeToTarget.bind(void 0, e, "stdout");
2071
+ }
2072
+ if (null !== e.stderr) {
2073
+ e.pipeStderr = pipeToTarget.bind(void 0, e, "stderr");
2074
+ }
2075
+ if (void 0 !== e.all) {
2076
+ e.pipeAll = pipeToTarget.bind(void 0, e, "all");
2077
+ }
2078
+ };
2079
+
2080
+ var getStreamContents = async (e, {init: D, convertChunk: r, getSize: t, truncateChunk: n, addChunk: i, getFinalChunk: a, finalize: s}, {maxBuffer: c = Number.POSITIVE_INFINITY} = {}) => {
2081
+ if (!isAsyncIterable(e)) {
2082
+ throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
2083
+ }
2084
+ var l = D();
2085
+ l.length = 0;
2086
+ try {
2087
+ for await (var d of e) {
2088
+ var p = r[getChunkType(d)](d, l);
2089
+ appendChunk({
2090
+ convertedChunk: p,
2091
+ state: l,
2092
+ getSize: t,
2093
+ truncateChunk: n,
2094
+ addChunk: i,
2095
+ maxBuffer: c
2096
+ });
2097
+ }
2098
+ appendFinalChunk({
2099
+ state: l,
2100
+ convertChunk: r,
2101
+ getSize: t,
2102
+ truncateChunk: n,
2103
+ addChunk: i,
2104
+ getFinalChunk: a,
2105
+ maxBuffer: c
2106
+ });
2107
+ return s(l);
2108
+ } catch (e) {
2109
+ e.bufferedData = s(l);
2110
+ throw e;
2111
+ }
2112
+ };
2113
+
2114
+ var appendFinalChunk = ({state: e, getSize: D, truncateChunk: r, addChunk: t, getFinalChunk: n, maxBuffer: i}) => {
2115
+ var a = n(e);
2116
+ if (void 0 !== a) {
2117
+ appendChunk({
2118
+ convertedChunk: a,
2119
+ state: e,
2120
+ getSize: D,
2121
+ truncateChunk: r,
2122
+ addChunk: t,
2123
+ maxBuffer: i
2124
+ });
2125
+ }
2126
+ };
2127
+
2128
+ var appendChunk = ({convertedChunk: e, state: D, getSize: r, truncateChunk: t, addChunk: n, maxBuffer: i}) => {
2129
+ var a = r(e);
2130
+ var s = D.length + a;
2131
+ if (s <= i) {
2132
+ addNewChunk(e, D, n, s);
2133
+ return;
2134
+ }
2135
+ var c = t(e, i - D.length);
2136
+ if (void 0 !== c) {
2137
+ addNewChunk(c, D, n, i);
2138
+ }
2139
+ throw new MaxBufferError;
2140
+ };
2141
+
2142
+ var addNewChunk = (e, D, r, t) => {
2143
+ D.contents = r(e, D, t);
2144
+ D.length = t;
2145
+ };
2146
+
2147
+ var isAsyncIterable = e => "object" == typeof e && null !== e && "function" == typeof e[Symbol.asyncIterator];
2148
+
2149
+ var getChunkType = e => {
2150
+ var D = typeof e;
2151
+ if ("string" === D) {
2152
+ return "string";
2153
+ }
2154
+ if ("object" !== D || null === e) {
2155
+ return "others";
2156
+ }
2157
+ if (globalThis.Buffer?.isBuffer(e)) {
2158
+ return "buffer";
2159
+ }
2160
+ var r = le.call(e);
2161
+ if ("[object ArrayBuffer]" === r) {
2162
+ return "arrayBuffer";
2163
+ }
2164
+ if ("[object DataView]" === r) {
2165
+ return "dataView";
2166
+ }
2167
+ if (Number.isInteger(e.byteLength) && Number.isInteger(e.byteOffset) && "[object ArrayBuffer]" === le.call(e.buffer)) {
2168
+ return "typedArray";
2169
+ }
2170
+ return "others";
2171
+ };
2172
+
2173
+ var {toString: le} = Object.prototype;
2174
+
2175
+ class MaxBufferError extends Error {
2176
+ name="MaxBufferError";
2177
+ constructor() {
2178
+ super("maxBuffer exceeded");
2179
+ }
2180
+ }
2181
+
2182
+ var throwObjectStream = e => {
2183
+ throw new Error(`Streams in object mode are not supported: ${String(e)}`);
2184
+ };
2185
+
2186
+ var getLengthProp = e => e.length;
2187
+
2188
+ var Ce = new TextEncoder;
2189
+
2190
+ var useUint8Array = e => new Uint8Array(e);
2191
+
2192
+ var useUint8ArrayWithOffset = e => new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
2193
+
2194
+ var resizeArrayBufferSlow = (e, D) => {
2195
+ if (D <= e.byteLength) {
2196
+ return e;
2197
+ }
2198
+ var r = new ArrayBuffer(getNewContentsLength(D));
2199
+ new Uint8Array(r).set(new Uint8Array(e), 0);
2200
+ return r;
2201
+ };
2202
+
2203
+ var resizeArrayBuffer = (e, D) => {
2204
+ if (D <= e.maxByteLength) {
2205
+ e.resize(D);
2206
+ return e;
2207
+ }
2208
+ var r = new ArrayBuffer(D, {
2209
+ maxByteLength: getNewContentsLength(D)
2210
+ });
2211
+ new Uint8Array(r).set(new Uint8Array(e), 0);
2212
+ return r;
2213
+ };
2214
+
2215
+ var getNewContentsLength = e => pe ** Math.ceil(Math.log(e) / Math.log(pe));
2216
+
2217
+ var pe = 2;
2218
+
2219
+ var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
2220
+
2221
+ var Ee = {
2222
+ init: () => ({
2223
+ contents: new ArrayBuffer(0)
2224
+ }),
2225
+ convertChunk: {
2226
+ string: e => Ce.encode(e),
2227
+ buffer: useUint8Array,
2228
+ arrayBuffer: useUint8Array,
2229
+ dataView: useUint8ArrayWithOffset,
2230
+ typedArray: useUint8ArrayWithOffset,
2231
+ others: throwObjectStream
2232
+ },
2233
+ getSize: getLengthProp,
2234
+ truncateChunk: (e, D) => e.slice(0, D),
2235
+ addChunk: (e, {contents: D, length: r}, t) => {
2236
+ var n = hasArrayBufferResize() ? resizeArrayBuffer(D, t) : resizeArrayBufferSlow(D, t);
2237
+ new Uint8Array(n).set(e, r);
2238
+ return n;
2239
+ },
2240
+ getFinalChunk: () => {},
2241
+ finalize: ({contents: e, length: D}) => hasArrayBufferResize() ? e : e.slice(0, D)
2242
+ };
2243
+
2244
+ async function getStreamAsBuffer(e, D) {
2245
+ if (!("Buffer" in globalThis)) {
2246
+ throw new Error("getStreamAsBuffer() is only supported in Node.js");
2247
+ }
2248
+ try {
2249
+ return arrayBufferToNodeBuffer(await async function getStreamAsArrayBuffer(e, D) {
2250
+ return getStreamContents(e, Ee, D);
2251
+ }(e, D));
2252
+ } catch (e) {
2253
+ if (void 0 !== e.bufferedData) {
2254
+ e.bufferedData = arrayBufferToNodeBuffer(e.bufferedData);
2255
+ }
2256
+ throw e;
2257
+ }
2258
+ }
2259
+
2260
+ var arrayBufferToNodeBuffer = e => globalThis.Buffer.from(e);
2261
+
2262
+ var useTextDecoder = (e, {textDecoder: D}) => D.decode(e, {
2263
+ stream: !0
2264
+ });
2265
+
2266
+ var fe = {
2267
+ init: () => ({
2268
+ contents: "",
2269
+ textDecoder: new TextDecoder
2270
+ }),
2271
+ convertChunk: {
2272
+ string: e => e,
2273
+ buffer: useTextDecoder,
2274
+ arrayBuffer: useTextDecoder,
2275
+ dataView: useTextDecoder,
2276
+ typedArray: useTextDecoder,
2277
+ others: throwObjectStream
2278
+ },
2279
+ getSize: getLengthProp,
2280
+ truncateChunk: (e, D) => e.slice(0, D),
2281
+ addChunk: (e, {contents: D}) => D + e,
2282
+ getFinalChunk: ({textDecoder: e}) => {
2283
+ var D = e.decode();
2284
+ return "" === D ? void 0 : D;
2285
+ },
2286
+ finalize: ({contents: e}) => e
2287
+ };
2288
+
2289
+ var {PassThrough: ve} = h;
2290
+
2291
+ var he = getDefaultExportFromCjs((function() {
2292
+ var e = [];
2293
+ var D = new ve({
2294
+ objectMode: !0
2295
+ });
2296
+ D.setMaxListeners(0);
2297
+ D.add = add;
2298
+ D.isEmpty = function isEmpty() {
2299
+ return 0 == e.length;
2300
+ };
2301
+ D.on("unpipe", remove);
2302
+ Array.prototype.slice.call(arguments).forEach(add);
2303
+ return D;
2304
+ function add(r) {
2305
+ if (Array.isArray(r)) {
2306
+ r.forEach(add);
2307
+ return this;
2308
+ }
2309
+ e.push(r);
2310
+ r.once("end", remove.bind(null, r));
2311
+ r.once("error", D.emit.bind(D, "error"));
2312
+ r.pipe(D, {
2313
+ end: !1
2314
+ });
2315
+ return this;
2316
+ }
2317
+ function remove(r) {
2318
+ if (!(e = e.filter((function(e) {
2319
+ return e !== r;
2320
+ }))).length && D.readable) {
2321
+ D.end();
2322
+ }
2323
+ }
2324
+ }));
2325
+
2326
+ var getInput = ({input: e, inputFile: D}) => {
2327
+ if ("string" != typeof D) {
2328
+ return e;
2329
+ }
2330
+ (e => {
2331
+ if (void 0 !== e) {
2332
+ throw new TypeError("The `input` and `inputFile` options cannot be both set.");
2333
+ }
2334
+ })(e);
2335
+ return E.createReadStream(D);
2336
+ };
2337
+
2338
+ var handleInput = (e, D) => {
2339
+ var r = getInput(D);
2340
+ if (void 0 === r) {
2341
+ return;
2342
+ }
2343
+ if (isStream(r)) {
2344
+ r.pipe(e.stdin);
2345
+ } else {
2346
+ e.stdin.end(r);
2347
+ }
2348
+ };
2349
+
2350
+ var makeAllStream = (e, {all: D}) => {
2351
+ if (!D || !e.stdout && !e.stderr) {
2352
+ return;
2353
+ }
2354
+ var r = he();
2355
+ if (e.stdout) {
2356
+ r.add(e.stdout);
2357
+ }
2358
+ if (e.stderr) {
2359
+ r.add(e.stderr);
2360
+ }
2361
+ return r;
2362
+ };
2363
+
2364
+ var getBufferedData = async (e, D) => {
2365
+ if (!e || void 0 === D) {
2366
+ return;
2367
+ }
2368
+ await f.setTimeout(0);
2369
+ e.destroy();
2370
+ try {
2371
+ return await D;
2372
+ } catch (e) {
2373
+ return e.bufferedData;
2374
+ }
2375
+ };
2376
+
2377
+ var getStreamPromise = (e, {encoding: D, buffer: r, maxBuffer: t}) => {
2378
+ if (!e || !r) {
2379
+ return;
2380
+ }
2381
+ if ("utf8" === D || "utf-8" === D) {
2382
+ return async function getStreamAsString(e, D) {
2383
+ return getStreamContents(e, fe, D);
2384
+ }(e, {
2385
+ maxBuffer: t
2386
+ });
2387
+ }
2388
+ if (null === D || "buffer" === D) {
2389
+ return getStreamAsBuffer(e, {
2390
+ maxBuffer: t
2391
+ });
2392
+ }
2393
+ return applyEncoding(e, t, D);
2394
+ };
2395
+
2396
+ var applyEncoding = async (e, D, r) => (await getStreamAsBuffer(e, {
2397
+ maxBuffer: D
2398
+ })).toString(r);
2399
+
2400
+ var getSpawnedResult = async ({stdout: e, stderr: D, all: r}, {encoding: t, buffer: n, maxBuffer: i}, a) => {
2401
+ var s = getStreamPromise(e, {
2402
+ encoding: t,
2403
+ buffer: n,
2404
+ maxBuffer: i
2405
+ });
2406
+ var c = getStreamPromise(D, {
2407
+ encoding: t,
2408
+ buffer: n,
2409
+ maxBuffer: i
2410
+ });
2411
+ var l = getStreamPromise(r, {
2412
+ encoding: t,
2413
+ buffer: n,
2414
+ maxBuffer: 2 * i
2415
+ });
2416
+ try {
2417
+ return await Promise.all([ a, s, c, l ]);
2418
+ } catch (t) {
2419
+ return Promise.all([ {
2420
+ error: t,
2421
+ signal: t.signal,
2422
+ timedOut: t.timedOut
2423
+ }, getBufferedData(e, s), getBufferedData(D, c), getBufferedData(r, l) ]);
2424
+ }
2425
+ };
2426
+
2427
+ var me = (async () => {})().constructor.prototype;
2428
+
2429
+ var ge = [ "then", "catch", "finally" ].map((e => [ e, Reflect.getOwnPropertyDescriptor(me, e) ]));
2430
+
2431
+ var mergePromise = (e, D) => {
2432
+ var _loop = function(t) {
2433
+ var n = "function" == typeof D ? (...e) => Reflect.apply(t.value, D(), e) : t.value.bind(D);
2434
+ Reflect.defineProperty(e, r, {
2435
+ ...t,
2436
+ value: n
2437
+ });
2438
+ };
2439
+ for (var [r, t] of ge) {
2440
+ _loop(t);
2441
+ }
2442
+ };
2443
+
2444
+ var getSpawnedPromise = e => new Promise(((D, r) => {
2445
+ e.on("exit", ((e, r) => {
2446
+ D({
2447
+ exitCode: e,
2448
+ signal: r
2449
+ });
2450
+ }));
2451
+ e.on("error", (e => {
2452
+ r(e);
2453
+ }));
2454
+ if (e.stdin) {
2455
+ e.stdin.on("error", (e => {
2456
+ r(e);
2457
+ }));
2458
+ }
2459
+ }));
2460
+
2461
+ var normalizeArgs = (e, D = []) => {
2462
+ if (!Array.isArray(D)) {
2463
+ return [ e ];
2464
+ }
2465
+ return [ e, ...D ];
2466
+ };
2467
+
2468
+ var Be = /^[\w.-]+$/;
2469
+
2470
+ var joinCommand = (e, D) => normalizeArgs(e, D).join(" ");
2471
+
2472
+ var getEscapedCommand = (e, D) => normalizeArgs(e, D).map((e => (e => {
2473
+ if ("string" != typeof e || Be.test(e)) {
2474
+ return e;
2475
+ }
2476
+ return `"${e.replaceAll('"', '\\"')}"`;
2477
+ })(e))).join(" ");
2478
+
2479
+ var be = m.debuglog("execa").enabled;
2480
+
2481
+ var padField = (e, D) => String(e).padStart(D, "0");
2482
+
2483
+ var logCommand = (D, {verbose: r}) => {
2484
+ if (!r) {
2485
+ return;
2486
+ }
2487
+ e.stderr.write(`[${t = new Date, `${padField(t.getHours(), 2)}:${padField(t.getMinutes(), 2)}:${padField(t.getSeconds(), 2)}.${padField(t.getMilliseconds(), 3)}`}] ${D}\n`);
2488
+ var t;
2489
+ };
2490
+
2491
+ var handleArguments = (D, r, t = {}) => {
2492
+ var i = Ku._parse(D, r, t);
2493
+ D = i.command;
2494
+ r = i.args;
2495
+ (t = {
2496
+ maxBuffer: 1e8,
2497
+ buffer: !0,
2498
+ stripFinalNewline: !0,
2499
+ extendEnv: !0,
2500
+ preferLocal: !1,
2501
+ localDir: (t = i.options).cwd || e.cwd(),
2502
+ execPath: e.execPath,
2503
+ encoding: "utf8",
2504
+ reject: !0,
2505
+ cleanup: !0,
2506
+ all: !1,
2507
+ windowsHide: !0,
2508
+ verbose: be,
2509
+ ...t
2510
+ }).env = (({env: D, extendEnv: r, preferLocal: t, localDir: n, execPath: i}) => {
2511
+ var a = r ? {
2512
+ ...e.env,
2513
+ ...D
2514
+ } : D;
2515
+ if (t) {
2516
+ return npmRunPathEnv({
2517
+ env: a,
2518
+ cwd: n,
2519
+ execPath: i
2520
+ });
2521
+ }
2522
+ return a;
2523
+ })(t);
2524
+ t.stdio = normalizeStdio(t);
2525
+ if ("win32" === e.platform && "cmd" === n.basename(D, ".exe")) {
2526
+ r.unshift("/q");
2527
+ }
2528
+ return {
2529
+ file: D,
2530
+ args: r,
2531
+ options: t,
2532
+ parsed: i
2533
+ };
2534
+ };
2535
+
2536
+ var handleOutput = (e, D, r) => {
2537
+ if ("string" != typeof D && !i.Buffer.isBuffer(D)) {
2538
+ return void 0 === r ? void 0 : "";
2539
+ }
2540
+ if (e.stripFinalNewline) {
2541
+ return function stripFinalNewline(e) {
2542
+ var D = "string" == typeof e ? "\n" : "\n".charCodeAt();
2543
+ var r = "string" == typeof e ? "\r" : "\r".charCodeAt();
2544
+ if (e[e.length - 1] === D) {
2545
+ e = e.slice(0, -1);
2546
+ }
2547
+ if (e[e.length - 1] === r) {
2548
+ e = e.slice(0, -1);
2549
+ }
2550
+ return e;
2551
+ }(D);
2552
+ }
2553
+ return D;
2554
+ };
2555
+
2556
+ function execa(e, D, r) {
2557
+ var t = handleArguments(e, D, r);
2558
+ var n = joinCommand(e, D);
2559
+ var i = getEscapedCommand(e, D);
2560
+ logCommand(i, t.options);
2561
+ validateTimeout(t.options);
2562
+ var s;
2563
+ try {
2564
+ s = a.spawn(t.file, t.args, t.options);
2565
+ } catch (e) {
2566
+ var c = new a.ChildProcess;
2567
+ var l = Promise.reject(makeError({
2568
+ error: e,
2569
+ stdout: "",
2570
+ stderr: "",
2571
+ all: "",
2572
+ command: n,
2573
+ escapedCommand: i,
2574
+ parsed: t,
2575
+ timedOut: !1,
2576
+ isCanceled: !1,
2577
+ killed: !1
2578
+ }));
2579
+ mergePromise(c, l);
2580
+ return c;
2581
+ }
2582
+ var d = getSpawnedPromise(s);
2583
+ var p = setupTimeout(s, t.options, d);
2584
+ var E = setExitHandler(s, t.options, p);
2585
+ s.kill = spawnedKill.bind(null, s.kill.bind(s));
2586
+ s.cancel = spawnedCancel.bind(null, s, {
2587
+ isCanceled: !1
2588
+ });
2589
+ var f = onetime((async () => {
2590
+ var [{error: e, exitCode: D, signal: r, timedOut: a}, c, l, d] = await getSpawnedResult(s, t.options, E);
2591
+ var p = handleOutput(t.options, c);
2592
+ var f = handleOutput(t.options, l);
2593
+ var h = handleOutput(t.options, d);
2594
+ if (e || 0 !== D || null !== r) {
2595
+ var m = makeError({
2596
+ error: e,
2597
+ exitCode: D,
2598
+ signal: r,
2599
+ stdout: p,
2600
+ stderr: f,
2601
+ all: h,
2602
+ command: n,
2603
+ escapedCommand: i,
2604
+ parsed: t,
2605
+ timedOut: a,
2606
+ isCanceled: t.options.signal ? t.options.signal.aborted : !1,
2607
+ killed: s.killed
2608
+ });
2609
+ if (!t.options.reject) {
2610
+ return m;
2611
+ }
2612
+ throw m;
2613
+ }
2614
+ return {
2615
+ command: n,
2616
+ escapedCommand: i,
2617
+ exitCode: 0,
2618
+ stdout: p,
2619
+ stderr: f,
2620
+ all: h,
2621
+ failed: !1,
2622
+ timedOut: !1,
2623
+ isCanceled: !1,
2624
+ killed: !1
2625
+ };
2626
+ }));
2627
+ handleInput(s, t.options);
2628
+ s.all = makeAllStream(s, t.options);
2629
+ addPipeMethods(s);
2630
+ mergePromise(s, f);
2631
+ return s;
2632
+ }
2633
+
2634
+ var question = async (e, D, r) => {
2635
+ var t = "";
2636
+ var n = !1;
2637
+ while (!n) {
2638
+ if (hD(t = await te({
2639
+ message: e
2640
+ }))) {
2641
+ n = !0;
2642
+ ue("Operation cancelled.");
2643
+ process.exit(0);
2644
+ } else if (await D(t)) {
2645
+ n = !0;
2646
+ }
2647
+ }
2648
+ return t;
2649
+ };
2650
+
2651
+ exports.run = async function run(e) {
2652
+ var D = de();
2653
+ ((e = "") => {
2654
+ process.stdout.write(`${_.gray(ou)} ${e}\n`);
2655
+ })("GQL.Tada");
2656
+ var r = await question("Where can we get your schema? Point us at an introspection JSON-file, a GraphQL schema file or an endpoint", (async r => {
2657
+ try {
2658
+ var i = new URL(r);
2659
+ D.start("Validating the URL.");
2660
+ try {
2661
+ var a = await fetch(i.toString());
2662
+ if (!a.ok) {
2663
+ D.stop("Validated the URL.");
2664
+ return !!await se({
2665
+ message: `Got ${a.status} from ${i.toString()}, continue anyway? You can add headers later.`
2666
+ });
2667
+ }
2668
+ } catch (e) {
2669
+ D.stop("Validated the URL.");
2670
+ return !!await se({
2671
+ message: `Got ${e.message} from ${i.toString()}, continue anyway? You can add headers later.`
2672
+ });
2673
+ }
2674
+ D.stop("Validated the URL.");
2675
+ return !0;
2676
+ } catch (e) {}
2677
+ if (!(r.endsWith(".json") || r.endsWith(".graphql"))) {
2678
+ return !1;
2679
+ }
2680
+ var s = n.resolve(e, r);
2681
+ var c = !!await t.readFile(s);
2682
+ if (!c) {
2683
+ console.log(`\nCould not find "${s}"`);
2684
+ }
2685
+ return c;
2686
+ }));
2687
+ var i = await question("What directory do you want us to write the tadaOutputFile to?", (async D => {
2688
+ var r = n.resolve(e, D);
2689
+ var i = !!await t.stat(r);
2690
+ if (!i) {
2691
+ console.log(`\nCould not find "${r}"`);
2692
+ }
2693
+ return i;
2694
+ }));
2695
+ if (hD(i)) {
2696
+ ue("Operation cancelled.");
2697
+ process.exit(0);
2698
+ }
2699
+ i = n.resolve(i, "graphql-env.d.ts");
2700
+ var a = await se({
2701
+ message: "Do you want us to install the dependencies?"
2702
+ });
2703
+ if (hD(a)) {
2704
+ ue("Operation cancelled.");
2705
+ process.exit(0);
2706
+ }
2707
+ var s = !1;
2708
+ var c;
2709
+ try {
2710
+ var l = n.resolve(e, "package.json");
2711
+ var d = await t.readFile(l, "utf-8");
2712
+ c = JSON.parse(d);
2713
+ var p = Object.entries({
2714
+ ...c.dependencies,
2715
+ ...c.devDependencies
2716
+ }).find((e => "typescript" === e[0]));
2717
+ if (p && "string" == typeof p[1]) {
2718
+ s = g.semverComply(p[1], g.MINIMUM_VERSIONS.typescript_embed_lsp);
2719
+ }
2720
+ } catch (e) {}
2721
+ if (a) {
2722
+ D.start("Installing packages.");
2723
+ await async function installPackages(e, D, r) {
2724
+ if (r) {
2725
+ await execa(e, [ "yarn" === e ? "add" : "install", "-D", "@0no-co/graphqlsp" ], {
2726
+ stdio: "ignore",
2727
+ cwd: D
2728
+ });
2729
+ }
2730
+ await execa(e, [ "yarn" === e ? "add" : "install", "gql.tada" ], {
2731
+ stdio: "ignore",
2732
+ cwd: D
2733
+ });
2734
+ }(function getPkgManager() {
2735
+ var e = process.env.npm_config_user_agent || "";
2736
+ if (e.startsWith("yarn")) {
2737
+ return "yarn";
2738
+ }
2739
+ if (e.startsWith("pnpm")) {
2740
+ return "pnpm";
2741
+ }
2742
+ return "npm";
2743
+ }(), e, !s);
2744
+ D.stop("Installed packages.");
2745
+ } else {
2746
+ D.start("Writing to package.json.");
2747
+ try {
2748
+ var E = n.resolve(e, "package.json");
2749
+ var f = await t.readFile(E, "utf-8");
2750
+ if (!(c = JSON.parse(f)).dependencies) {
2751
+ c.dependencies = {};
2752
+ }
2753
+ if (!c.dependencies["gql.tada"]) {
2754
+ c.dependencies["gql.tada"] = "^1.4.3";
2755
+ }
2756
+ if (!s) {
2757
+ if (!c.devDependencies) {
2758
+ c.devDependencies = {};
2759
+ }
2760
+ if (!c.devDependencies["@0no-co/graphqlsp"]) {
2761
+ c.devDependencies["@0no-co/graphqlsp"] = "^1.8.0";
2762
+ }
2763
+ }
2764
+ await t.writeFile(E, JSON.stringify(c, null, 2));
2765
+ D.stop("Written to package.json.");
2766
+ } catch (e) {
2767
+ D.stop('Failed to write to package.json, you can try adding "gql.tada" and "@0no-co/graphqlsp" yourself.');
2768
+ }
2769
+ }
2770
+ D.start("Writing to tsconfig.json.");
2771
+ var h = "tsconfig.json";
2772
+ try {
2773
+ var m = n.resolve(e, "tsconfig.json");
2774
+ var b = await B.readTSConfigFile(m);
2775
+ if (Array.isArray(b.references) && Array.isArray(b.files) && !b.files.length && !b.include) {
2776
+ var w;
2777
+ var S;
2778
+ for (var I of b.references) {
2779
+ if (!I || "string" != typeof I.path) {
2780
+ continue;
2781
+ }
2782
+ var O = n.resolve(e, I.path);
2783
+ if (".json" !== n.extname(O)) {
2784
+ O = n.join(O, "tsconfig.json");
2785
+ }
2786
+ try {
2787
+ await t.access(O);
2788
+ } catch (e) {
2789
+ continue;
2790
+ }
2791
+ if ("tsconfig.app.json" === n.basename(O)) {
2792
+ S = O;
2793
+ break;
2794
+ } else if (!w) {
2795
+ w = O;
2796
+ }
2797
+ }
2798
+ var k = S || w;
2799
+ if (k) {
2800
+ m = k;
2801
+ b = await B.readTSConfigFile(m);
2802
+ h = n.relative(e, m);
2803
+ }
2804
+ }
2805
+ var G = r.endsWith(".json") || r.endsWith(".graphql");
2806
+ var M = n.dirname(m);
2807
+ b.compilerOptions = {
2808
+ ...b.compilerOptions,
2809
+ plugins: [ {
2810
+ name: s ? "gql.tada/ts-plugin" : "@0no-co/graphqlsp",
2811
+ schema: G ? n.relative(M, n.resolve(e, r)) : r,
2812
+ tadaOutputLocation: n.relative(M, i)
2813
+ } ]
2814
+ };
2815
+ await t.writeFile(m, JSON.stringify(b, null, 2));
2816
+ } catch (e) {}
2817
+ D.stop(`Written to ${h}.`);
2818
+ ((e = "") => {
2819
+ process.stdout.write(`${_.gray(cu)}\n${_.gray(Fu)} ${e}\n\n`);
2820
+ })("Off to the races!");
2821
+ };
2822
+ //# sourceMappingURL=runner-chunk.js.map