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