opencommit 3.2.10 → 3.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/out/cli.cjs +2210 -774
- package/package.json +1 -1
package/out/cli.cjs
CHANGED
|
@@ -161,6 +161,843 @@ var require_picocolors = __commonJS({
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
// node_modules/@clack/core/dist/index.mjs
|
|
165
|
+
function q3({ onlyFirst: t2 = false } = {}) {
|
|
166
|
+
const u3 = ["[\\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("|");
|
|
167
|
+
return new RegExp(u3, t2 ? void 0 : "g");
|
|
168
|
+
}
|
|
169
|
+
function S3(t2) {
|
|
170
|
+
if (typeof t2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``);
|
|
171
|
+
return t2.replace(q3(), "");
|
|
172
|
+
}
|
|
173
|
+
function j2(t2) {
|
|
174
|
+
return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
|
|
175
|
+
}
|
|
176
|
+
function A2(t2, u3 = {}) {
|
|
177
|
+
if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = S3(t2), t2.length === 0)) return 0;
|
|
178
|
+
t2 = t2.replace(DD2(), " ");
|
|
179
|
+
const F5 = u3.ambiguousIsNarrow ? 1 : 2;
|
|
180
|
+
let e3 = 0;
|
|
181
|
+
for (const s2 of t2) {
|
|
182
|
+
const C5 = s2.codePointAt(0);
|
|
183
|
+
if (C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879) continue;
|
|
184
|
+
switch (Q2.eastAsianWidth(s2)) {
|
|
185
|
+
case "F":
|
|
186
|
+
case "W":
|
|
187
|
+
e3 += 2;
|
|
188
|
+
break;
|
|
189
|
+
case "A":
|
|
190
|
+
e3 += F5;
|
|
191
|
+
break;
|
|
192
|
+
default:
|
|
193
|
+
e3 += 1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return e3;
|
|
197
|
+
}
|
|
198
|
+
function tD2() {
|
|
199
|
+
const t2 = /* @__PURE__ */ new Map();
|
|
200
|
+
for (const [u3, F5] of Object.entries(r)) {
|
|
201
|
+
for (const [e3, s2] of Object.entries(F5)) r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]);
|
|
202
|
+
Object.defineProperty(r, u3, { value: F5, enumerable: false });
|
|
203
|
+
}
|
|
204
|
+
return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
|
|
205
|
+
const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
|
|
206
|
+
if (!F5) return [0, 0, 0];
|
|
207
|
+
let [e3] = F5;
|
|
208
|
+
e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join(""));
|
|
209
|
+
const s2 = Number.parseInt(e3, 16);
|
|
210
|
+
return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
|
|
211
|
+
}, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
|
|
212
|
+
if (u3 < 8) return 30 + u3;
|
|
213
|
+
if (u3 < 16) return 90 + (u3 - 8);
|
|
214
|
+
let F5, e3, s2;
|
|
215
|
+
if (u3 >= 232) F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5;
|
|
216
|
+
else {
|
|
217
|
+
u3 -= 16;
|
|
218
|
+
const i3 = u3 % 36;
|
|
219
|
+
F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5;
|
|
220
|
+
}
|
|
221
|
+
const C5 = Math.max(F5, e3, s2) * 2;
|
|
222
|
+
if (C5 === 0) return 30;
|
|
223
|
+
let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5));
|
|
224
|
+
return C5 === 2 && (D5 += 60), D5;
|
|
225
|
+
}, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
|
|
226
|
+
}
|
|
227
|
+
function R4(t2, u3, F5) {
|
|
228
|
+
return String(t2).normalize().replace(/\r\n/g, `
|
|
229
|
+
`).split(`
|
|
230
|
+
`).map((e3) => ED2(e3, u3, F5)).join(`
|
|
231
|
+
`);
|
|
232
|
+
}
|
|
233
|
+
function aD2(t2, u3) {
|
|
234
|
+
if (t2 === u3) return;
|
|
235
|
+
const F5 = t2.split(`
|
|
236
|
+
`), e3 = u3.split(`
|
|
237
|
+
`), s2 = [];
|
|
238
|
+
for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) F5[C5] !== e3[C5] && s2.push(C5);
|
|
239
|
+
return s2;
|
|
240
|
+
}
|
|
241
|
+
function hD2(t2) {
|
|
242
|
+
return t2 === V4;
|
|
243
|
+
}
|
|
244
|
+
function v3(t2, u3) {
|
|
245
|
+
t2.isTTY && t2.setRawMode(u3);
|
|
246
|
+
}
|
|
247
|
+
function WD({ input: t2 = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) {
|
|
248
|
+
const s2 = f.createInterface({ input: t2, output: u3, prompt: "", tabSize: 1 });
|
|
249
|
+
f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true);
|
|
250
|
+
const C5 = (D5, { name: i3 }) => {
|
|
251
|
+
if (String(D5) === "" && process.exit(0), !F5) return;
|
|
252
|
+
let n2 = i3 === "return" ? 0 : -1, E4 = i3 === "return" ? -1 : 0;
|
|
253
|
+
f.moveCursor(u3, n2, E4, () => {
|
|
254
|
+
f.clearLine(u3, 1, () => {
|
|
255
|
+
t2.once("keypress", C5);
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
};
|
|
259
|
+
return e3 && process.stdout.write(import_sisteransi.cursor.hide), t2.once("keypress", C5), () => {
|
|
260
|
+
t2.off("keypress", C5), e3 && process.stdout.write(import_sisteransi.cursor.show), t2.isTTY && !PD && t2.setRawMode(false), s2.terminal = false, s2.close();
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
var import_sisteransi, import_node_process, f, import_node_readline, import_node_tty, import_picocolors, M3, J3, Q2, X2, DD2, m3, T4, P2, W3, r, uD2, FD2, eD2, g2, sD2, b4, O3, CD2, I3, w4, N3, L4, iD2, y3, rD2, ED2, oD2, nD2, a, V4, z3, lD2, x3, xD2, BD2, cD2, G4, AD2, pD2, fD2, K3, gD2, vD, dD2, Y2, mD2, bD2, wD2, Z3, yD, $D, kD, H3, _D, SD, jD, MD, TD, PD;
|
|
264
|
+
var init_dist = __esm({
|
|
265
|
+
"node_modules/@clack/core/dist/index.mjs"() {
|
|
266
|
+
import_sisteransi = __toESM(require_src(), 1);
|
|
267
|
+
import_node_process = require("node:process");
|
|
268
|
+
f = __toESM(require("node:readline"), 1);
|
|
269
|
+
import_node_readline = __toESM(require("node:readline"), 1);
|
|
270
|
+
import_node_tty = require("node:tty");
|
|
271
|
+
import_picocolors = __toESM(require_picocolors(), 1);
|
|
272
|
+
M3 = { exports: {} };
|
|
273
|
+
(function(t2) {
|
|
274
|
+
var u3 = {};
|
|
275
|
+
t2.exports = u3, u3.eastAsianWidth = function(e3) {
|
|
276
|
+
var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2;
|
|
277
|
+
return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N";
|
|
278
|
+
}, u3.characterLength = function(e3) {
|
|
279
|
+
var s2 = this.eastAsianWidth(e3);
|
|
280
|
+
return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
|
|
281
|
+
};
|
|
282
|
+
function F5(e3) {
|
|
283
|
+
return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
284
|
+
}
|
|
285
|
+
u3.length = function(e3) {
|
|
286
|
+
for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) C5 = C5 + this.characterLength(s2[D5]);
|
|
287
|
+
return C5;
|
|
288
|
+
}, u3.slice = function(e3, s2, C5) {
|
|
289
|
+
textLen = u3.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5);
|
|
290
|
+
for (var D5 = "", i3 = 0, n2 = F5(e3), E4 = 0; E4 < n2.length; E4++) {
|
|
291
|
+
var h4 = n2[E4], o3 = u3.length(h4);
|
|
292
|
+
if (i3 >= s2 - (o3 == 2 ? 1 : 0)) if (i3 + o3 <= C5) D5 += h4;
|
|
293
|
+
else break;
|
|
294
|
+
i3 += o3;
|
|
295
|
+
}
|
|
296
|
+
return D5;
|
|
297
|
+
};
|
|
298
|
+
})(M3);
|
|
299
|
+
J3 = M3.exports;
|
|
300
|
+
Q2 = j2(J3);
|
|
301
|
+
X2 = function() {
|
|
302
|
+
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;
|
|
303
|
+
};
|
|
304
|
+
DD2 = j2(X2);
|
|
305
|
+
m3 = 10;
|
|
306
|
+
T4 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`;
|
|
307
|
+
P2 = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`;
|
|
308
|
+
W3 = (t2 = 0) => (u3, F5, e3) => `\x1B[${38 + t2};2;${u3};${F5};${e3}m`;
|
|
309
|
+
r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
310
|
+
Object.keys(r.modifier);
|
|
311
|
+
uD2 = Object.keys(r.color);
|
|
312
|
+
FD2 = Object.keys(r.bgColor);
|
|
313
|
+
[...uD2, ...FD2];
|
|
314
|
+
eD2 = tD2();
|
|
315
|
+
g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
316
|
+
sD2 = 39;
|
|
317
|
+
b4 = "\x07";
|
|
318
|
+
O3 = "[";
|
|
319
|
+
CD2 = "]";
|
|
320
|
+
I3 = "m";
|
|
321
|
+
w4 = `${CD2}8;;`;
|
|
322
|
+
N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`;
|
|
323
|
+
L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`;
|
|
324
|
+
iD2 = (t2) => t2.split(" ").map((u3) => A2(u3));
|
|
325
|
+
y3 = (t2, u3, F5) => {
|
|
326
|
+
const e3 = [...u3];
|
|
327
|
+
let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1]));
|
|
328
|
+
for (const [i3, n2] of e3.entries()) {
|
|
329
|
+
const E4 = A2(n2);
|
|
330
|
+
if (D5 + E4 <= F5 ? t2[t2.length - 1] += n2 : (t2.push(n2), D5 = 0), g2.has(n2) && (s2 = true, C5 = e3.slice(i3 + 1).join("").startsWith(w4)), s2) {
|
|
331
|
+
C5 ? n2 === b4 && (s2 = false, C5 = false) : n2 === I3 && (s2 = false);
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
D5 += E4, D5 === F5 && i3 < e3.length - 1 && (t2.push(""), D5 = 0);
|
|
335
|
+
}
|
|
336
|
+
!D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
|
|
337
|
+
};
|
|
338
|
+
rD2 = (t2) => {
|
|
339
|
+
const u3 = t2.split(" ");
|
|
340
|
+
let F5 = u3.length;
|
|
341
|
+
for (; F5 > 0 && !(A2(u3[F5 - 1]) > 0); ) F5--;
|
|
342
|
+
return F5 === u3.length ? t2 : u3.slice(0, F5).join(" ") + u3.slice(F5).join("");
|
|
343
|
+
};
|
|
344
|
+
ED2 = (t2, u3, F5 = {}) => {
|
|
345
|
+
if (F5.trim !== false && t2.trim() === "") return "";
|
|
346
|
+
let e3 = "", s2, C5;
|
|
347
|
+
const D5 = iD2(t2);
|
|
348
|
+
let i3 = [""];
|
|
349
|
+
for (const [E4, h4] of t2.split(" ").entries()) {
|
|
350
|
+
F5.trim !== false && (i3[i3.length - 1] = i3[i3.length - 1].trimStart());
|
|
351
|
+
let o3 = A2(i3[i3.length - 1]);
|
|
352
|
+
if (E4 !== 0 && (o3 >= u3 && (F5.wordWrap === false || F5.trim === false) && (i3.push(""), o3 = 0), (o3 > 0 || F5.trim === false) && (i3[i3.length - 1] += " ", o3++)), F5.hard && D5[E4] > u3) {
|
|
353
|
+
const B3 = u3 - o3, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u3);
|
|
354
|
+
Math.floor((D5[E4] - 1) / u3) < p4 && i3.push(""), y3(i3, h4, u3);
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
if (o3 + D5[E4] > u3 && o3 > 0 && D5[E4] > 0) {
|
|
358
|
+
if (F5.wordWrap === false && o3 < u3) {
|
|
359
|
+
y3(i3, h4, u3);
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
i3.push("");
|
|
363
|
+
}
|
|
364
|
+
if (o3 + D5[E4] > u3 && F5.wordWrap === false) {
|
|
365
|
+
y3(i3, h4, u3);
|
|
366
|
+
continue;
|
|
367
|
+
}
|
|
368
|
+
i3[i3.length - 1] += h4;
|
|
369
|
+
}
|
|
370
|
+
F5.trim !== false && (i3 = i3.map((E4) => rD2(E4)));
|
|
371
|
+
const n2 = [...i3.join(`
|
|
372
|
+
`)];
|
|
373
|
+
for (const [E4, h4] of n2.entries()) {
|
|
374
|
+
if (e3 += h4, g2.has(h4)) {
|
|
375
|
+
const { groups: B3 } = new RegExp(`(?:\\${O3}(?<code>\\d+)m|\\${w4}(?<uri>.*)${b4})`).exec(n2.slice(E4).join("")) || { groups: {} };
|
|
376
|
+
if (B3.code !== void 0) {
|
|
377
|
+
const p4 = Number.parseFloat(B3.code);
|
|
378
|
+
s2 = p4 === sD2 ? void 0 : p4;
|
|
379
|
+
} else B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri);
|
|
380
|
+
}
|
|
381
|
+
const o3 = eD2.codes.get(Number(s2));
|
|
382
|
+
n2[E4 + 1] === `
|
|
383
|
+
` ? (C5 && (e3 += L4("")), s2 && o3 && (e3 += N3(o3))) : h4 === `
|
|
384
|
+
` && (s2 && o3 && (e3 += N3(s2)), C5 && (e3 += L4(C5)));
|
|
385
|
+
}
|
|
386
|
+
return e3;
|
|
387
|
+
};
|
|
388
|
+
oD2 = Object.defineProperty;
|
|
389
|
+
nD2 = (t2, u3, F5) => u3 in t2 ? oD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
390
|
+
a = (t2, u3, F5) => (nD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
391
|
+
V4 = Symbol("clack:cancel");
|
|
392
|
+
z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
393
|
+
lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
394
|
+
x3 = class {
|
|
395
|
+
constructor({ render: u3, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) {
|
|
396
|
+
a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u3.bind(this), this._track = C5, this.input = F5, this.output = e3;
|
|
397
|
+
}
|
|
398
|
+
prompt() {
|
|
399
|
+
const u3 = new import_node_tty.WriteStream(0);
|
|
400
|
+
return u3._write = (F5, e3, s2) => {
|
|
401
|
+
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
|
|
402
|
+
}, this.input.pipe(u3), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u3, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => {
|
|
403
|
+
this.once("submit", () => {
|
|
404
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value);
|
|
405
|
+
}), this.once("cancel", () => {
|
|
406
|
+
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(V4);
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
on(u3, F5) {
|
|
411
|
+
const e3 = this.subscribers.get(u3) ?? [];
|
|
412
|
+
e3.push({ cb: F5 }), this.subscribers.set(u3, e3);
|
|
413
|
+
}
|
|
414
|
+
once(u3, F5) {
|
|
415
|
+
const e3 = this.subscribers.get(u3) ?? [];
|
|
416
|
+
e3.push({ cb: F5, once: true }), this.subscribers.set(u3, e3);
|
|
417
|
+
}
|
|
418
|
+
emit(u3, ...F5) {
|
|
419
|
+
const e3 = this.subscribers.get(u3) ?? [], s2 = [];
|
|
420
|
+
for (const C5 of e3) C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1));
|
|
421
|
+
for (const C5 of s2) C5();
|
|
422
|
+
}
|
|
423
|
+
unsubscribe() {
|
|
424
|
+
this.subscribers.clear();
|
|
425
|
+
}
|
|
426
|
+
onKeypress(u3, F5) {
|
|
427
|
+
if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F5?.name === "return") {
|
|
428
|
+
if (this.opts.validate) {
|
|
429
|
+
const e3 = this.opts.validate(this.value);
|
|
430
|
+
e3 && (this.error = e3, this.state = "error", this.rl.write(this.value));
|
|
431
|
+
}
|
|
432
|
+
this.state !== "error" && (this.state = "submit");
|
|
433
|
+
}
|
|
434
|
+
u3 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
435
|
+
}
|
|
436
|
+
close() {
|
|
437
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
438
|
+
`), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
439
|
+
}
|
|
440
|
+
restoreCursor() {
|
|
441
|
+
const u3 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
442
|
+
`).length - 1;
|
|
443
|
+
this.output.write(import_sisteransi.cursor.move(-999, u3 * -1));
|
|
444
|
+
}
|
|
445
|
+
render() {
|
|
446
|
+
const u3 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
447
|
+
if (u3 !== this._prevFrame) {
|
|
448
|
+
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
449
|
+
else {
|
|
450
|
+
const F5 = aD2(this._prevFrame, u3);
|
|
451
|
+
if (this.restoreCursor(), F5 && F5?.length === 1) {
|
|
452
|
+
const e3 = F5[0];
|
|
453
|
+
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1));
|
|
454
|
+
const s2 = u3.split(`
|
|
455
|
+
`);
|
|
456
|
+
this.output.write(s2[e3]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1));
|
|
457
|
+
return;
|
|
458
|
+
} else if (F5 && F5?.length > 1) {
|
|
459
|
+
const e3 = F5[0];
|
|
460
|
+
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down());
|
|
461
|
+
const s2 = u3.split(`
|
|
462
|
+
`).slice(e3);
|
|
463
|
+
this.output.write(s2.join(`
|
|
464
|
+
`)), this._prevFrame = u3;
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
this.output.write(import_sisteransi.erase.down());
|
|
468
|
+
}
|
|
469
|
+
this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
xD2 = class extends x3 {
|
|
474
|
+
get cursor() {
|
|
475
|
+
return this.value ? 0 : 1;
|
|
476
|
+
}
|
|
477
|
+
get _value() {
|
|
478
|
+
return this.cursor === 0;
|
|
479
|
+
}
|
|
480
|
+
constructor(u3) {
|
|
481
|
+
super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
|
|
482
|
+
this.value = this._value;
|
|
483
|
+
}), this.on("confirm", (F5) => {
|
|
484
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close();
|
|
485
|
+
}), this.on("cursor", () => {
|
|
486
|
+
this.value = !this.value;
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
BD2 = Object.defineProperty;
|
|
491
|
+
cD2 = (t2, u3, F5) => u3 in t2 ? BD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
492
|
+
G4 = (t2, u3, F5) => (cD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
493
|
+
AD2 = class extends x3 {
|
|
494
|
+
constructor(u3) {
|
|
495
|
+
super(u3, false), G4(this, "options"), G4(this, "cursor", 0);
|
|
496
|
+
const { options: F5 } = u3;
|
|
497
|
+
this.options = Object.entries(F5).flatMap(([e3, s2]) => [{ value: e3, group: true, label: e3 }, ...s2.map((C5) => ({ ...C5, group: e3 }))]), this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: e3 }) => e3 === u3.cursorAt), 0), this.on("cursor", (e3) => {
|
|
498
|
+
switch (e3) {
|
|
499
|
+
case "left":
|
|
500
|
+
case "up":
|
|
501
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
502
|
+
break;
|
|
503
|
+
case "down":
|
|
504
|
+
case "right":
|
|
505
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
506
|
+
break;
|
|
507
|
+
case "space":
|
|
508
|
+
this.toggleValue();
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
getGroupItems(u3) {
|
|
514
|
+
return this.options.filter((F5) => F5.group === u3);
|
|
515
|
+
}
|
|
516
|
+
isGroupSelected(u3) {
|
|
517
|
+
return this.getGroupItems(u3).every((F5) => this.value.includes(F5.value));
|
|
518
|
+
}
|
|
519
|
+
toggleValue() {
|
|
520
|
+
const u3 = this.options[this.cursor];
|
|
521
|
+
if (u3.group === true) {
|
|
522
|
+
const F5 = u3.value, e3 = this.getGroupItems(F5);
|
|
523
|
+
this.isGroupSelected(F5) ? this.value = this.value.filter((s2) => e3.findIndex((C5) => C5.value === s2) === -1) : this.value = [...this.value, ...e3.map((s2) => s2.value)], this.value = Array.from(new Set(this.value));
|
|
524
|
+
} else {
|
|
525
|
+
const F5 = this.value.includes(u3.value);
|
|
526
|
+
this.value = F5 ? this.value.filter((e3) => e3 !== u3.value) : [...this.value, u3.value];
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
pD2 = Object.defineProperty;
|
|
531
|
+
fD2 = (t2, u3, F5) => u3 in t2 ? pD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
532
|
+
K3 = (t2, u3, F5) => (fD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
533
|
+
gD2 = class extends x3 {
|
|
534
|
+
constructor(u3) {
|
|
535
|
+
super(u3, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u3.cursorAt), 0), this.on("key", (F5) => {
|
|
536
|
+
F5 === "a" && this.toggleAll();
|
|
537
|
+
}), this.on("cursor", (F5) => {
|
|
538
|
+
switch (F5) {
|
|
539
|
+
case "left":
|
|
540
|
+
case "up":
|
|
541
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
542
|
+
break;
|
|
543
|
+
case "down":
|
|
544
|
+
case "right":
|
|
545
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
546
|
+
break;
|
|
547
|
+
case "space":
|
|
548
|
+
this.toggleValue();
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
get _value() {
|
|
554
|
+
return this.options[this.cursor].value;
|
|
555
|
+
}
|
|
556
|
+
toggleAll() {
|
|
557
|
+
const u3 = this.value.length === this.options.length;
|
|
558
|
+
this.value = u3 ? [] : this.options.map((F5) => F5.value);
|
|
559
|
+
}
|
|
560
|
+
toggleValue() {
|
|
561
|
+
const u3 = this.value.includes(this._value);
|
|
562
|
+
this.value = u3 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value];
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
vD = Object.defineProperty;
|
|
566
|
+
dD2 = (t2, u3, F5) => u3 in t2 ? vD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
567
|
+
Y2 = (t2, u3, F5) => (dD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
568
|
+
mD2 = class extends x3 {
|
|
569
|
+
constructor({ mask: u3, ...F5 }) {
|
|
570
|
+
super(F5), Y2(this, "valueWithCursor", ""), Y2(this, "_mask", "\u2022"), this._mask = u3 ?? "\u2022", this.on("finalize", () => {
|
|
571
|
+
this.valueWithCursor = this.masked;
|
|
572
|
+
}), this.on("value", () => {
|
|
573
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.masked}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
574
|
+
else {
|
|
575
|
+
const e3 = this.masked.slice(0, this.cursor), s2 = this.masked.slice(this.cursor);
|
|
576
|
+
this.valueWithCursor = `${e3}${import_picocolors.default.inverse(s2[0])}${s2.slice(1)}`;
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
get cursor() {
|
|
581
|
+
return this._cursor;
|
|
582
|
+
}
|
|
583
|
+
get masked() {
|
|
584
|
+
return this.value.replaceAll(/./g, this._mask);
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
bD2 = Object.defineProperty;
|
|
588
|
+
wD2 = (t2, u3, F5) => u3 in t2 ? bD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
589
|
+
Z3 = (t2, u3, F5) => (wD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
590
|
+
yD = class extends x3 {
|
|
591
|
+
constructor(u3) {
|
|
592
|
+
super(u3, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => {
|
|
593
|
+
switch (F5) {
|
|
594
|
+
case "left":
|
|
595
|
+
case "up":
|
|
596
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
597
|
+
break;
|
|
598
|
+
case "down":
|
|
599
|
+
case "right":
|
|
600
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
601
|
+
break;
|
|
602
|
+
}
|
|
603
|
+
this.changeValue();
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
get _value() {
|
|
607
|
+
return this.options[this.cursor];
|
|
608
|
+
}
|
|
609
|
+
changeValue() {
|
|
610
|
+
this.value = this._value.value;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
$D = Object.defineProperty;
|
|
614
|
+
kD = (t2, u3, F5) => u3 in t2 ? $D(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
615
|
+
H3 = (t2, u3, F5) => (kD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
616
|
+
_D = class extends x3 {
|
|
617
|
+
constructor(u3) {
|
|
618
|
+
super(u3, false), H3(this, "options"), H3(this, "cursor", 0), this.options = u3.options;
|
|
619
|
+
const F5 = this.options.map(({ value: [e3] }) => e3?.toLowerCase());
|
|
620
|
+
this.cursor = Math.max(F5.indexOf(u3.initialValue), 0), this.on("key", (e3) => {
|
|
621
|
+
if (!F5.includes(e3)) return;
|
|
622
|
+
const s2 = this.options.find(({ value: [C5] }) => C5?.toLowerCase() === e3);
|
|
623
|
+
s2 && (this.value = s2.value, this.state = "submit", this.emit("submit"));
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
SD = Object.defineProperty;
|
|
628
|
+
jD = (t2, u3, F5) => u3 in t2 ? SD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
629
|
+
MD = (t2, u3, F5) => (jD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
630
|
+
TD = class extends x3 {
|
|
631
|
+
constructor(u3) {
|
|
632
|
+
super(u3), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
|
|
633
|
+
this.value || (this.value = u3.defaultValue), this.valueWithCursor = this.value;
|
|
634
|
+
}), this.on("value", () => {
|
|
635
|
+
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
636
|
+
else {
|
|
637
|
+
const F5 = this.value.slice(0, this.cursor), e3 = this.value.slice(this.cursor);
|
|
638
|
+
this.valueWithCursor = `${F5}${import_picocolors.default.inverse(e3[0])}${e3.slice(1)}`;
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
get cursor() {
|
|
643
|
+
return this._cursor;
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
PD = globalThis.process.platform.startsWith("win");
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
// node_modules/@clack/prompts/dist/index.mjs
|
|
651
|
+
var dist_exports = {};
|
|
652
|
+
__export(dist_exports, {
|
|
653
|
+
cancel: () => ne,
|
|
654
|
+
confirm: () => Q3,
|
|
655
|
+
group: () => $e,
|
|
656
|
+
groupMultiselect: () => se,
|
|
657
|
+
intro: () => ae,
|
|
658
|
+
isCancel: () => hD2,
|
|
659
|
+
log: () => g3,
|
|
660
|
+
multiselect: () => re,
|
|
661
|
+
note: () => ie,
|
|
662
|
+
outro: () => ce,
|
|
663
|
+
password: () => Y3,
|
|
664
|
+
select: () => ee,
|
|
665
|
+
selectKey: () => te,
|
|
666
|
+
spinner: () => le,
|
|
667
|
+
text: () => J4
|
|
668
|
+
});
|
|
669
|
+
function N4() {
|
|
670
|
+
return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
671
|
+
}
|
|
672
|
+
function ue() {
|
|
673
|
+
const r3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
674
|
+
return new RegExp(r3, "g");
|
|
675
|
+
}
|
|
676
|
+
var import_node_process2, import_picocolors2, import_sisteransi2, p2, u, W4, D3, F3, f2, L5, a2, o, w5, S4, _5, y4, A3, q4, R5, G5, H4, K4, U5, Z4, z4, X3, h2, J4, Y3, Q3, ee, te, re, se, b5, ie, ne, ae, ce, g3, C3, le, $e;
|
|
677
|
+
var init_dist2 = __esm({
|
|
678
|
+
"node_modules/@clack/prompts/dist/index.mjs"() {
|
|
679
|
+
init_dist();
|
|
680
|
+
init_dist();
|
|
681
|
+
import_node_process2 = __toESM(require("node:process"), 1);
|
|
682
|
+
import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
683
|
+
import_sisteransi2 = __toESM(require_src(), 1);
|
|
684
|
+
p2 = N4();
|
|
685
|
+
u = (r3, n2) => p2 ? r3 : n2;
|
|
686
|
+
W4 = u("\u25C6", "*");
|
|
687
|
+
D3 = u("\u25A0", "x");
|
|
688
|
+
F3 = u("\u25B2", "x");
|
|
689
|
+
f2 = u("\u25C7", "o");
|
|
690
|
+
L5 = u("\u250C", "T");
|
|
691
|
+
a2 = u("\u2502", "|");
|
|
692
|
+
o = u("\u2514", "\u2014");
|
|
693
|
+
w5 = u("\u25CF", ">");
|
|
694
|
+
S4 = u("\u25CB", " ");
|
|
695
|
+
_5 = u("\u25FB", "[\u2022]");
|
|
696
|
+
y4 = u("\u25FC", "[+]");
|
|
697
|
+
A3 = u("\u25FB", "[ ]");
|
|
698
|
+
q4 = u("\u25AA", "\u2022");
|
|
699
|
+
R5 = u("\u2500", "-");
|
|
700
|
+
G5 = u("\u256E", "+");
|
|
701
|
+
H4 = u("\u251C", "+");
|
|
702
|
+
K4 = u("\u256F", "+");
|
|
703
|
+
U5 = u("\u25CF", "\u2022");
|
|
704
|
+
Z4 = u("\u25C6", "*");
|
|
705
|
+
z4 = u("\u25B2", "!");
|
|
706
|
+
X3 = u("\u25A0", "x");
|
|
707
|
+
h2 = (r3) => {
|
|
708
|
+
switch (r3) {
|
|
709
|
+
case "initial":
|
|
710
|
+
case "active":
|
|
711
|
+
return import_picocolors2.default.cyan(W4);
|
|
712
|
+
case "cancel":
|
|
713
|
+
return import_picocolors2.default.red(D3);
|
|
714
|
+
case "error":
|
|
715
|
+
return import_picocolors2.default.yellow(F3);
|
|
716
|
+
case "submit":
|
|
717
|
+
return import_picocolors2.default.green(f2);
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
J4 = (r3) => new TD({ validate: r3.validate, placeholder: r3.placeholder, defaultValue: r3.defaultValue, initialValue: r3.initialValue, render() {
|
|
721
|
+
const n2 = `${import_picocolors2.default.gray(a2)}
|
|
722
|
+
${h2(this.state)} ${r3.message}
|
|
723
|
+
`, s2 = r3.placeholder ? import_picocolors2.default.inverse(r3.placeholder[0]) + import_picocolors2.default.dim(r3.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t2 = this.value ? this.valueWithCursor : s2;
|
|
724
|
+
switch (this.state) {
|
|
725
|
+
case "error":
|
|
726
|
+
return `${n2.trim()}
|
|
727
|
+
${import_picocolors2.default.yellow(a2)} ${t2}
|
|
728
|
+
${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(this.error)}
|
|
729
|
+
`;
|
|
730
|
+
case "submit":
|
|
731
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r3.placeholder)}`;
|
|
732
|
+
case "cancel":
|
|
733
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
734
|
+
` + import_picocolors2.default.gray(a2) : ""}`;
|
|
735
|
+
default:
|
|
736
|
+
return `${n2}${import_picocolors2.default.cyan(a2)} ${t2}
|
|
737
|
+
${import_picocolors2.default.cyan(o)}
|
|
738
|
+
`;
|
|
739
|
+
}
|
|
740
|
+
} }).prompt();
|
|
741
|
+
Y3 = (r3) => new mD2({ validate: r3.validate, mask: r3.mask ?? q4, render() {
|
|
742
|
+
const n2 = `${import_picocolors2.default.gray(a2)}
|
|
743
|
+
${h2(this.state)} ${r3.message}
|
|
744
|
+
`, s2 = this.valueWithCursor, t2 = this.masked;
|
|
745
|
+
switch (this.state) {
|
|
746
|
+
case "error":
|
|
747
|
+
return `${n2.trim()}
|
|
748
|
+
${import_picocolors2.default.yellow(a2)} ${t2}
|
|
749
|
+
${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(this.error)}
|
|
750
|
+
`;
|
|
751
|
+
case "submit":
|
|
752
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(t2)}`;
|
|
753
|
+
case "cancel":
|
|
754
|
+
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(t2 ?? ""))}${t2 ? `
|
|
755
|
+
` + import_picocolors2.default.gray(a2) : ""}`;
|
|
756
|
+
default:
|
|
757
|
+
return `${n2}${import_picocolors2.default.cyan(a2)} ${s2}
|
|
758
|
+
${import_picocolors2.default.cyan(o)}
|
|
759
|
+
`;
|
|
760
|
+
}
|
|
761
|
+
} }).prompt();
|
|
762
|
+
Q3 = (r3) => {
|
|
763
|
+
const n2 = r3.active ?? "Yes", s2 = r3.inactive ?? "No";
|
|
764
|
+
return new xD2({ active: n2, inactive: s2, initialValue: r3.initialValue ?? true, render() {
|
|
765
|
+
const t2 = `${import_picocolors2.default.gray(a2)}
|
|
766
|
+
${h2(this.state)} ${r3.message}
|
|
767
|
+
`, i3 = this.value ? n2 : s2;
|
|
768
|
+
switch (this.state) {
|
|
769
|
+
case "submit":
|
|
770
|
+
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(i3)}`;
|
|
771
|
+
case "cancel":
|
|
772
|
+
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}
|
|
773
|
+
${import_picocolors2.default.gray(a2)}`;
|
|
774
|
+
default:
|
|
775
|
+
return `${t2}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(w5)} ${n2}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(n2)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(s2)}` : `${import_picocolors2.default.green(w5)} ${s2}`}
|
|
776
|
+
${import_picocolors2.default.cyan(o)}
|
|
777
|
+
`;
|
|
778
|
+
}
|
|
779
|
+
} }).prompt();
|
|
780
|
+
};
|
|
781
|
+
ee = (r3) => {
|
|
782
|
+
const n2 = (s2, t2) => {
|
|
783
|
+
const i3 = s2.label ?? String(s2.value);
|
|
784
|
+
return t2 === "active" ? `${import_picocolors2.default.green(w5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(i3)}`;
|
|
785
|
+
};
|
|
786
|
+
return new yD({ options: r3.options, initialValue: r3.initialValue, render() {
|
|
787
|
+
const s2 = `${import_picocolors2.default.gray(a2)}
|
|
788
|
+
${h2(this.state)} ${r3.message}
|
|
789
|
+
`;
|
|
790
|
+
switch (this.state) {
|
|
791
|
+
case "submit":
|
|
792
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "selected")}`;
|
|
793
|
+
case "cancel":
|
|
794
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "cancelled")}
|
|
795
|
+
${import_picocolors2.default.gray(a2)}`;
|
|
796
|
+
default:
|
|
797
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(`
|
|
798
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
799
|
+
${import_picocolors2.default.cyan(o)}
|
|
800
|
+
`;
|
|
801
|
+
}
|
|
802
|
+
} }).prompt();
|
|
803
|
+
};
|
|
804
|
+
te = (r3) => {
|
|
805
|
+
const n2 = (s2, t2 = "inactive") => {
|
|
806
|
+
const i3 = s2.label ?? String(s2.value);
|
|
807
|
+
return t2 === "selected" ? `${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : t2 === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${s2.value} `))} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${s2.value} `)))} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}`;
|
|
808
|
+
};
|
|
809
|
+
return new _D({ options: r3.options, initialValue: r3.initialValue, render() {
|
|
810
|
+
const s2 = `${import_picocolors2.default.gray(a2)}
|
|
811
|
+
${h2(this.state)} ${r3.message}
|
|
812
|
+
`;
|
|
813
|
+
switch (this.state) {
|
|
814
|
+
case "submit":
|
|
815
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options.find((t2) => t2.value === this.value), "selected")}`;
|
|
816
|
+
case "cancel":
|
|
817
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[0], "cancelled")}
|
|
818
|
+
${import_picocolors2.default.gray(a2)}`;
|
|
819
|
+
default:
|
|
820
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(`
|
|
821
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
822
|
+
${import_picocolors2.default.cyan(o)}
|
|
823
|
+
`;
|
|
824
|
+
}
|
|
825
|
+
} }).prompt();
|
|
826
|
+
};
|
|
827
|
+
re = (r3) => {
|
|
828
|
+
const n2 = (s2, t2) => {
|
|
829
|
+
const i3 = s2.label ?? String(s2.value);
|
|
830
|
+
return t2 === "active" ? `${import_picocolors2.default.cyan(_5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : t2 === "active-selected" ? `${import_picocolors2.default.green(y4)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors2.default.dim(i3)}` : `${import_picocolors2.default.dim(A3)} ${import_picocolors2.default.dim(i3)}`;
|
|
831
|
+
};
|
|
832
|
+
return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) {
|
|
833
|
+
if (this.required && s2.length === 0) return `Please select at least one option.
|
|
834
|
+
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
835
|
+
}, render() {
|
|
836
|
+
let s2 = `${import_picocolors2.default.gray(a2)}
|
|
837
|
+
${h2(this.state)} ${r3.message}
|
|
838
|
+
`;
|
|
839
|
+
switch (this.state) {
|
|
840
|
+
case "submit":
|
|
841
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
842
|
+
case "cancel": {
|
|
843
|
+
const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
844
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${t2.trim() ? `${t2}
|
|
845
|
+
${import_picocolors2.default.gray(a2)}` : ""}`;
|
|
846
|
+
}
|
|
847
|
+
case "error": {
|
|
848
|
+
const t2 = this.error.split(`
|
|
849
|
+
`).map((i3, c4) => c4 === 0 ? `${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(i3)}` : ` ${i3}`).join(`
|
|
850
|
+
`);
|
|
851
|
+
return s2 + import_picocolors2.default.yellow(a2) + " " + this.options.map((i3, c4) => {
|
|
852
|
+
const l3 = this.value.includes(i3.value), $6 = c4 === this.cursor;
|
|
853
|
+
return $6 && l3 ? n2(i3, "active-selected") : l3 ? n2(i3, "selected") : n2(i3, $6 ? "active" : "inactive");
|
|
854
|
+
}).join(`
|
|
855
|
+
${import_picocolors2.default.yellow(a2)} `) + `
|
|
856
|
+
` + t2 + `
|
|
857
|
+
`;
|
|
858
|
+
}
|
|
859
|
+
default:
|
|
860
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => {
|
|
861
|
+
const c4 = this.value.includes(t2.value), l3 = i3 === this.cursor;
|
|
862
|
+
return l3 && c4 ? n2(t2, "active-selected") : c4 ? n2(t2, "selected") : n2(t2, l3 ? "active" : "inactive");
|
|
863
|
+
}).join(`
|
|
864
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
865
|
+
${import_picocolors2.default.cyan(o)}
|
|
866
|
+
`;
|
|
867
|
+
}
|
|
868
|
+
} }).prompt();
|
|
869
|
+
};
|
|
870
|
+
se = (r3) => {
|
|
871
|
+
const n2 = (s2, t2, i3 = []) => {
|
|
872
|
+
const c4 = s2.label ?? String(s2.value), l3 = typeof s2.group == "string", $6 = l3 && (i3[i3.indexOf(s2) + 1] ?? { group: true }), v5 = l3 && $6.group === true, m5 = l3 ? `${v5 ? o : a2} ` : "";
|
|
873
|
+
return t2 === "active" ? `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.cyan(_5)} ${c4} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "group-active" ? `${m5}${import_picocolors2.default.cyan(_5)} ${import_picocolors2.default.dim(c4)}` : t2 === "group-active-selected" ? `${m5}${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(c4)}` : t2 === "selected" ? `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(c4)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(c4))}` : t2 === "active-selected" ? `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.green(y4)} ${c4} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors2.default.dim(c4)}` : `${import_picocolors2.default.dim(m5)}${import_picocolors2.default.dim(A3)} ${import_picocolors2.default.dim(c4)}`;
|
|
874
|
+
};
|
|
875
|
+
return new AD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) {
|
|
876
|
+
if (this.required && s2.length === 0) return `Please select at least one option.
|
|
877
|
+
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
878
|
+
}, render() {
|
|
879
|
+
let s2 = `${import_picocolors2.default.gray(a2)}
|
|
880
|
+
${h2(this.state)} ${r3.message}
|
|
881
|
+
`;
|
|
882
|
+
switch (this.state) {
|
|
883
|
+
case "submit":
|
|
884
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors2.default.dim(", "))}`;
|
|
885
|
+
case "cancel": {
|
|
886
|
+
const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
887
|
+
return `${s2}${import_picocolors2.default.gray(a2)} ${t2.trim() ? `${t2}
|
|
888
|
+
${import_picocolors2.default.gray(a2)}` : ""}`;
|
|
889
|
+
}
|
|
890
|
+
case "error": {
|
|
891
|
+
const t2 = this.error.split(`
|
|
892
|
+
`).map((i3, c4) => c4 === 0 ? `${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(i3)}` : ` ${i3}`).join(`
|
|
893
|
+
`);
|
|
894
|
+
return `${s2}${import_picocolors2.default.yellow(a2)} ${this.options.map((i3, c4, l3) => {
|
|
895
|
+
const $6 = this.value.includes(i3.value) || i3.group === true && this.isGroupSelected(`${i3.value}`), v5 = c4 === this.cursor;
|
|
896
|
+
return !v5 && typeof i3.group == "string" && this.options[this.cursor].value === i3.group ? n2(i3, $6 ? "group-active-selected" : "group-active", l3) : v5 && $6 ? n2(i3, "active-selected", l3) : $6 ? n2(i3, "selected", l3) : n2(i3, v5 ? "active" : "inactive", l3);
|
|
897
|
+
}).join(`
|
|
898
|
+
${import_picocolors2.default.yellow(a2)} `)}
|
|
899
|
+
${t2}
|
|
900
|
+
`;
|
|
901
|
+
}
|
|
902
|
+
default:
|
|
903
|
+
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3, c4) => {
|
|
904
|
+
const l3 = this.value.includes(t2.value) || t2.group === true && this.isGroupSelected(`${t2.value}`), $6 = i3 === this.cursor;
|
|
905
|
+
return !$6 && typeof t2.group == "string" && this.options[this.cursor].value === t2.group ? n2(t2, l3 ? "group-active-selected" : "group-active", c4) : $6 && l3 ? n2(t2, "active-selected", c4) : l3 ? n2(t2, "selected", c4) : n2(t2, $6 ? "active" : "inactive", c4);
|
|
906
|
+
}).join(`
|
|
907
|
+
${import_picocolors2.default.cyan(a2)} `)}
|
|
908
|
+
${import_picocolors2.default.cyan(o)}
|
|
909
|
+
`;
|
|
910
|
+
}
|
|
911
|
+
} }).prompt();
|
|
912
|
+
};
|
|
913
|
+
b5 = (r3) => r3.replace(ue(), "");
|
|
914
|
+
ie = (r3 = "", n2 = "") => {
|
|
915
|
+
const s2 = `
|
|
916
|
+
${r3}
|
|
917
|
+
`.split(`
|
|
918
|
+
`), t2 = Math.max(s2.reduce((c4, l3) => (l3 = b5(l3), l3.length > c4 ? l3.length : c4), 0), b5(n2).length) + 2, i3 = s2.map((c4) => `${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(c4)}${" ".repeat(t2 - b5(c4).length)}${import_picocolors2.default.gray(a2)}`).join(`
|
|
919
|
+
`);
|
|
920
|
+
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
921
|
+
${import_picocolors2.default.green(f2)} ${import_picocolors2.default.reset(n2)} ${import_picocolors2.default.gray(R5.repeat(Math.max(t2 - n2.length - 1, 1)) + G5)}
|
|
922
|
+
${i3}
|
|
923
|
+
${import_picocolors2.default.gray(H4 + R5.repeat(t2 + 2) + K4)}
|
|
924
|
+
`);
|
|
925
|
+
};
|
|
926
|
+
ne = (r3 = "") => {
|
|
927
|
+
process.stdout.write(`${import_picocolors2.default.gray(o)} ${import_picocolors2.default.red(r3)}
|
|
928
|
+
|
|
929
|
+
`);
|
|
930
|
+
};
|
|
931
|
+
ae = (r3 = "") => {
|
|
932
|
+
process.stdout.write(`${import_picocolors2.default.gray(L5)} ${r3}
|
|
933
|
+
`);
|
|
934
|
+
};
|
|
935
|
+
ce = (r3 = "") => {
|
|
936
|
+
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
937
|
+
${import_picocolors2.default.gray(o)} ${r3}
|
|
938
|
+
|
|
939
|
+
`);
|
|
940
|
+
};
|
|
941
|
+
g3 = { message: (r3 = "", { symbol: n2 = import_picocolors2.default.gray(a2) } = {}) => {
|
|
942
|
+
const s2 = [`${import_picocolors2.default.gray(a2)}`];
|
|
943
|
+
if (r3) {
|
|
944
|
+
const [t2, ...i3] = r3.split(`
|
|
945
|
+
`);
|
|
946
|
+
s2.push(`${n2} ${t2}`, ...i3.map((c4) => `${import_picocolors2.default.gray(a2)} ${c4}`));
|
|
947
|
+
}
|
|
948
|
+
process.stdout.write(`${s2.join(`
|
|
949
|
+
`)}
|
|
950
|
+
`);
|
|
951
|
+
}, info: (r3) => {
|
|
952
|
+
g3.message(r3, { symbol: import_picocolors2.default.blue(U5) });
|
|
953
|
+
}, success: (r3) => {
|
|
954
|
+
g3.message(r3, { symbol: import_picocolors2.default.green(Z4) });
|
|
955
|
+
}, step: (r3) => {
|
|
956
|
+
g3.message(r3, { symbol: import_picocolors2.default.green(f2) });
|
|
957
|
+
}, warn: (r3) => {
|
|
958
|
+
g3.message(r3, { symbol: import_picocolors2.default.yellow(z4) });
|
|
959
|
+
}, warning: (r3) => {
|
|
960
|
+
g3.warn(r3);
|
|
961
|
+
}, error: (r3) => {
|
|
962
|
+
g3.message(r3, { symbol: import_picocolors2.default.red(X3) });
|
|
963
|
+
} };
|
|
964
|
+
C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"];
|
|
965
|
+
le = () => {
|
|
966
|
+
let r3, n2;
|
|
967
|
+
const s2 = p2 ? 80 : 120;
|
|
968
|
+
return { start(t2 = "") {
|
|
969
|
+
t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
970
|
+
${import_picocolors2.default.magenta("\u25CB")} ${t2}
|
|
971
|
+
`);
|
|
972
|
+
let i3 = 0, c4 = 0;
|
|
973
|
+
n2 = setInterval(() => {
|
|
974
|
+
let l3 = C3[i3];
|
|
975
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors2.default.magenta(l3)} ${t2}${Math.floor(c4) >= 1 ? ".".repeat(Math.floor(c4)).slice(0, 3) : ""}
|
|
976
|
+
`), i3 = i3 === C3.length - 1 ? 0 : i3 + 1, c4 = c4 === C3.length ? 0 : c4 + 0.125;
|
|
977
|
+
}, s2);
|
|
978
|
+
}, stop(t2 = "") {
|
|
979
|
+
process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n2), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
980
|
+
${import_picocolors2.default.green(f2)} ${t2}
|
|
981
|
+
`), r3();
|
|
982
|
+
} };
|
|
983
|
+
};
|
|
984
|
+
$e = async (r3, n2) => {
|
|
985
|
+
const s2 = {}, t2 = Object.keys(r3);
|
|
986
|
+
for (const i3 of t2) {
|
|
987
|
+
const c4 = r3[i3], l3 = await c4({ results: s2 })?.catch(($6) => {
|
|
988
|
+
throw $6;
|
|
989
|
+
});
|
|
990
|
+
if (typeof n2?.onCancel == "function" && hD2(l3)) {
|
|
991
|
+
s2[i3] = "canceled", n2.onCancel({ results: s2 });
|
|
992
|
+
continue;
|
|
993
|
+
}
|
|
994
|
+
s2[i3] = l3;
|
|
995
|
+
}
|
|
996
|
+
return s2;
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
});
|
|
1000
|
+
|
|
164
1001
|
// node_modules/isexe/windows.js
|
|
165
1002
|
var require_windows = __commonJS({
|
|
166
1003
|
"node_modules/isexe/windows.js"(exports2, module2) {
|
|
@@ -225,10 +1062,10 @@ var require_mode = __commonJS({
|
|
|
225
1062
|
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
226
1063
|
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
227
1064
|
var u3 = parseInt("100", 8);
|
|
228
|
-
var
|
|
1065
|
+
var g5 = parseInt("010", 8);
|
|
229
1066
|
var o3 = parseInt("001", 8);
|
|
230
|
-
var ug = u3 |
|
|
231
|
-
var ret = mod & o3 || mod &
|
|
1067
|
+
var ug = u3 | g5;
|
|
1068
|
+
var ret = mod & o3 || mod & g5 && gid === myGid || mod & u3 && uid === myUid || mod & ug && myUid === 0;
|
|
232
1069
|
return ret;
|
|
233
1070
|
}
|
|
234
1071
|
}
|
|
@@ -6390,13 +7227,13 @@ function p3(e3, t2, r3) {
|
|
|
6390
7227
|
function m4(e3) {
|
|
6391
7228
|
f3(e3, void 0, o2);
|
|
6392
7229
|
}
|
|
6393
|
-
function
|
|
7230
|
+
function g4(e3, t2, r3) {
|
|
6394
7231
|
if ("function" != typeof e3) throw new TypeError("Argument is not a function");
|
|
6395
7232
|
return Function.prototype.apply.call(e3, t2, r3);
|
|
6396
7233
|
}
|
|
6397
7234
|
function w6(e3, t2, r3) {
|
|
6398
7235
|
try {
|
|
6399
|
-
return c3(
|
|
7236
|
+
return c3(g4(e3, t2, r3));
|
|
6400
7237
|
} catch (e4) {
|
|
6401
7238
|
return d6(e4);
|
|
6402
7239
|
}
|
|
@@ -6450,7 +7287,7 @@ function $5(e3, t2, r3) {
|
|
|
6450
7287
|
function M4(e3, t2, r3) {
|
|
6451
7288
|
if (void 0 === e3) throw new TypeError(`${t2} is required in '${r3}'.`);
|
|
6452
7289
|
}
|
|
6453
|
-
function
|
|
7290
|
+
function Y4(e3) {
|
|
6454
7291
|
return Number(e3);
|
|
6455
7292
|
}
|
|
6456
7293
|
function Q4(e3) {
|
|
@@ -6465,7 +7302,7 @@ function N5(e3, t2) {
|
|
|
6465
7302
|
}(o3), o3 < 0 || o3 > r3) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r3}, inclusive`);
|
|
6466
7303
|
return z5(o3) && 0 !== o3 ? o3 : 0;
|
|
6467
7304
|
}
|
|
6468
|
-
function
|
|
7305
|
+
function H5(e3) {
|
|
6469
7306
|
if (!r2(e3)) return false;
|
|
6470
7307
|
if ("function" != typeof e3.getReader) return false;
|
|
6471
7308
|
try {
|
|
@@ -6489,7 +7326,7 @@ function V5(e3, t2) {
|
|
|
6489
7326
|
function U6(e3, t2) {
|
|
6490
7327
|
e3._reader._readRequests.push(t2);
|
|
6491
7328
|
}
|
|
6492
|
-
function
|
|
7329
|
+
function G6(e3, t2, r3) {
|
|
6493
7330
|
const o3 = e3._reader._readRequests.shift();
|
|
6494
7331
|
r3 ? o3._closeSteps() : o3._chunkSteps(t2);
|
|
6495
7332
|
}
|
|
@@ -6516,12 +7353,12 @@ function oe(e3) {
|
|
|
6516
7353
|
if (!r2(e3)) return false;
|
|
6517
7354
|
if (!Object.prototype.hasOwnProperty.call(e3, "_asyncIteratorImpl")) return false;
|
|
6518
7355
|
try {
|
|
6519
|
-
return e3._asyncIteratorImpl instanceof
|
|
7356
|
+
return e3._asyncIteratorImpl instanceof te2;
|
|
6520
7357
|
} catch (e4) {
|
|
6521
7358
|
return false;
|
|
6522
7359
|
}
|
|
6523
7360
|
}
|
|
6524
|
-
function
|
|
7361
|
+
function ne2(e3) {
|
|
6525
7362
|
return new TypeError(`ReadableStreamAsyncIterator.${e3} can only be used on a ReadableSteamAsyncIterator`);
|
|
6526
7363
|
}
|
|
6527
7364
|
function ie2(e3, t2, r3, o3, n2) {
|
|
@@ -6535,7 +7372,7 @@ function le2(e3) {
|
|
|
6535
7372
|
}(e3.buffer, e3.byteOffset, e3.byteOffset + e3.byteLength);
|
|
6536
7373
|
return new Uint8Array(t2);
|
|
6537
7374
|
}
|
|
6538
|
-
function
|
|
7375
|
+
function se2(e3) {
|
|
6539
7376
|
const t2 = e3._queue.shift();
|
|
6540
7377
|
return e3._queueTotalSize -= t2.size, e3._queueTotalSize < 0 && (e3._queueTotalSize = 0), t2.value;
|
|
6541
7378
|
}
|
|
@@ -6576,7 +7413,7 @@ function _e(e3, t2) {
|
|
|
6576
7413
|
let r3 = false;
|
|
6577
7414
|
"closed" === e3._state && (r3 = true);
|
|
6578
7415
|
const o3 = pe(t2);
|
|
6579
|
-
"default" === t2.readerType ?
|
|
7416
|
+
"default" === t2.readerType ? G6(e3, o3, r3) : function(e4, t3, r4) {
|
|
6580
7417
|
const o4 = e4._reader._readIntoRequests.shift();
|
|
6581
7418
|
r4 ? o4._closeSteps(t3) : o4._chunkSteps(t3);
|
|
6582
7419
|
}(e3, o3, r3);
|
|
@@ -6705,7 +7542,7 @@ function Ie(e3, t2) {
|
|
|
6705
7542
|
function De(e3) {
|
|
6706
7543
|
return new TypeError(`ReadableStreamBYOBReader.prototype.${e3} can only be used on a ReadableStreamBYOBReader`);
|
|
6707
7544
|
}
|
|
6708
|
-
function $
|
|
7545
|
+
function $e2(e3, t2) {
|
|
6709
7546
|
const { highWaterMark: r3 } = e3;
|
|
6710
7547
|
if (void 0 === r3) return t2;
|
|
6711
7548
|
if (ae2(r3) || r3 < 0) throw new RangeError("Invalid highWaterMark");
|
|
@@ -6718,10 +7555,10 @@ function Me(e3) {
|
|
|
6718
7555
|
function Ye(e3, t2) {
|
|
6719
7556
|
F4(e3, t2);
|
|
6720
7557
|
const r3 = null == e3 ? void 0 : e3.highWaterMark, o3 = null == e3 ? void 0 : e3.size;
|
|
6721
|
-
return { highWaterMark: void 0 === r3 ? void 0 :
|
|
7558
|
+
return { highWaterMark: void 0 === r3 ? void 0 : Y4(r3), size: void 0 === o3 ? void 0 : Qe(o3, `${t2} has member 'size' that`) };
|
|
6722
7559
|
}
|
|
6723
7560
|
function Qe(e3, t2) {
|
|
6724
|
-
return I4(e3, t2), (t3) =>
|
|
7561
|
+
return I4(e3, t2), (t3) => Y4(e3(t3));
|
|
6725
7562
|
}
|
|
6726
7563
|
function Ne(e3, t2, r3) {
|
|
6727
7564
|
return I4(e3, r3), (r4) => w6(e3, t2, [r4]);
|
|
@@ -6730,7 +7567,7 @@ function He(e3, t2, r3) {
|
|
|
6730
7567
|
return I4(e3, r3), () => w6(e3, t2, []);
|
|
6731
7568
|
}
|
|
6732
7569
|
function xe(e3, t2, r3) {
|
|
6733
|
-
return I4(e3, r3), (r4) =>
|
|
7570
|
+
return I4(e3, r3), (r4) => g4(e3, t2, [r4]);
|
|
6734
7571
|
}
|
|
6735
7572
|
function Ve(e3, t2, r3) {
|
|
6736
7573
|
return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]);
|
|
@@ -6829,7 +7666,7 @@ function dt(e3) {
|
|
|
6829
7666
|
const t3 = e4._controlledWritableStream;
|
|
6830
7667
|
(function(e5) {
|
|
6831
7668
|
e5._inFlightCloseRequest = e5._closeRequest, e5._closeRequest = void 0;
|
|
6832
|
-
})(t3),
|
|
7669
|
+
})(t3), se2(e4);
|
|
6833
7670
|
const r4 = e4._closeAlgorithm();
|
|
6834
7671
|
ut(e4), b6(r4, () => (function(e5) {
|
|
6835
7672
|
e5._inFlightCloseRequest._resolve(void 0), e5._inFlightCloseRequest = void 0, "erroring" === e5._state && (e5._storedError = void 0, void 0 !== e5._pendingAbortRequest && (e5._pendingAbortRequest._resolve(), e5._pendingAbortRequest = void 0)), e5._state = "closed";
|
|
@@ -6848,7 +7685,7 @@ function dt(e3) {
|
|
|
6848
7685
|
e5._inFlightWriteRequest._resolve(void 0), e5._inFlightWriteRequest = void 0;
|
|
6849
7686
|
}(r4);
|
|
6850
7687
|
const t4 = r4._state;
|
|
6851
|
-
if (
|
|
7688
|
+
if (se2(e4), !rt(r4) && "writable" === t4) {
|
|
6852
7689
|
const t5 = bt(e4);
|
|
6853
7690
|
nt(r4, t5);
|
|
6854
7691
|
}
|
|
@@ -6914,9 +7751,9 @@ function Et(e3) {
|
|
|
6914
7751
|
function kt(e3, t2, r3, o3, n2, a4) {
|
|
6915
7752
|
const i3 = e3.getReader(), l3 = t2.getWriter();
|
|
6916
7753
|
Vt(e3) && (e3._disturbed = true);
|
|
6917
|
-
let s2, _7,
|
|
7754
|
+
let s2, _7, g5, w7 = false, S6 = false, v5 = "readable", R7 = "writable", T6 = false, q6 = false;
|
|
6918
7755
|
const C5 = u2((e4) => {
|
|
6919
|
-
|
|
7756
|
+
g5 = e4;
|
|
6920
7757
|
});
|
|
6921
7758
|
let E4 = Promise.resolve(void 0);
|
|
6922
7759
|
return u2((P4, W6) => {
|
|
@@ -6945,7 +7782,7 @@ function kt(e3, t2, r3, o3, n2, a4) {
|
|
|
6945
7782
|
if (void 0 !== a4 && (k7 = () => {
|
|
6946
7783
|
const e4 = void 0 !== a4.reason ? a4.reason : new Wt("Aborted", "AbortError"), t3 = [];
|
|
6947
7784
|
o3 || t3.push(() => "writable" === R7 ? l3.abort(e4) : c3(void 0)), n2 || t3.push(() => "readable" === v5 ? i3.cancel(e4) : c3(void 0)), z6(() => Promise.all(t3.map((e5) => e5())), true, e4);
|
|
6948
|
-
}, a4.aborted ? k7() : a4.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true,
|
|
7785
|
+
}, a4.aborted ? k7() : a4.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true, g5()), "errored" === v5) A5(s2);
|
|
6949
7786
|
else if ("erroring" === R7 || "errored" === R7) j4(_7);
|
|
6950
7787
|
else if ("closed" === v5) B3();
|
|
6951
7788
|
else if (T6 || "closed" === R7) {
|
|
@@ -6975,7 +7812,7 @@ function kt(e3, t2, r3, o3, n2, a4) {
|
|
|
6975
7812
|
w7 || (b6(i3.closed, B3, A5), b6(l3.closed, function() {
|
|
6976
7813
|
return S6 || (R7 = "closed"), null;
|
|
6977
7814
|
}, j4)), q6 ? O5() : y5(() => {
|
|
6978
|
-
q6 = true,
|
|
7815
|
+
q6 = true, g5(), O5();
|
|
6979
7816
|
});
|
|
6980
7817
|
});
|
|
6981
7818
|
}
|
|
@@ -6994,7 +7831,7 @@ function Ot(e3, t2) {
|
|
|
6994
7831
|
function y6(e5) {
|
|
6995
7832
|
_6(e5.closed, (t4) => (e5 !== i3 || (o3.error(t4), n2.error(t4), h4 && p4 || a4(void 0)), null));
|
|
6996
7833
|
}
|
|
6997
|
-
function
|
|
7834
|
+
function g5() {
|
|
6998
7835
|
l3 && (i3.releaseLock(), i3 = e4.getReader(), y6(i3), l3 = false), b6(i3.read(), (e5) => {
|
|
6999
7836
|
var t4, r4;
|
|
7000
7837
|
if (d7 = false, f4 = false, e5.done) return h4 || o3.close(), p4 || n2.close(), null === (t4 = o3.byobRequest) || void 0 === t4 || t4.respond(0), null === (r4 = n2.byobRequest) || void 0 === r4 || r4.respond(0), h4 && p4 || a4(void 0), null;
|
|
@@ -7038,13 +7875,13 @@ function Ot(e3, t2) {
|
|
|
7038
7875
|
if (s2) return d7 = true, c3(void 0);
|
|
7039
7876
|
s2 = true;
|
|
7040
7877
|
const e5 = o3.byobRequest;
|
|
7041
|
-
return null === e5 ?
|
|
7878
|
+
return null === e5 ? g5() : w7(e5.view, false), c3(void 0);
|
|
7042
7879
|
}
|
|
7043
7880
|
function v5() {
|
|
7044
7881
|
if (s2) return f4 = true, c3(void 0);
|
|
7045
7882
|
s2 = true;
|
|
7046
7883
|
const e5 = n2.byobRequest;
|
|
7047
|
-
return null === e5 ?
|
|
7884
|
+
return null === e5 ? g5() : w7(e5.view, true), c3(void 0);
|
|
7048
7885
|
}
|
|
7049
7886
|
function R7(e5) {
|
|
7050
7887
|
if (h4 = true, t3 = e5, p4) {
|
|
@@ -7086,7 +7923,7 @@ function Ot(e3, t2) {
|
|
|
7086
7923
|
}
|
|
7087
7924
|
return p4;
|
|
7088
7925
|
}
|
|
7089
|
-
function
|
|
7926
|
+
function g5(e5) {
|
|
7090
7927
|
if (h4 = true, n2 = e5, f4) {
|
|
7091
7928
|
const e6 = [o3, n2], t4 = r3.cancel(e6);
|
|
7092
7929
|
l3(t4);
|
|
@@ -7097,7 +7934,7 @@ function Ot(e3, t2) {
|
|
|
7097
7934
|
a4 = e5;
|
|
7098
7935
|
}, pull: m5, cancel: y6 }), S6 = new ReadableStream3({ start(e5) {
|
|
7099
7936
|
i3 = e5;
|
|
7100
|
-
}, pull: m5, cancel:
|
|
7937
|
+
}, pull: m5, cancel: g5 });
|
|
7101
7938
|
return _6(r3.closed, (e5) => (a4.error(e5), i3.error(e5), f4 && h4 || l3(void 0), null)), [w7, S6];
|
|
7102
7939
|
}(e3);
|
|
7103
7940
|
}
|
|
@@ -7150,7 +7987,7 @@ function Mt(e3, t2, r3) {
|
|
|
7150
7987
|
return I4(e3, r3), (r4) => w6(e3, t2, [r4]);
|
|
7151
7988
|
}
|
|
7152
7989
|
function Yt(e3, t2, r3) {
|
|
7153
|
-
return I4(e3, r3), (r4) =>
|
|
7990
|
+
return I4(e3, r3), (r4) => g4(e3, t2, [r4]);
|
|
7154
7991
|
}
|
|
7155
7992
|
function Qt(e3, t2) {
|
|
7156
7993
|
if ("bytes" !== (e3 = `${e3}`)) throw new TypeError(`${t2} '${e3}' is not a valid enumeration value for ReadableStreamType`);
|
|
@@ -7178,7 +8015,7 @@ function xt(e3, t2) {
|
|
|
7178
8015
|
F4(e3, t2);
|
|
7179
8016
|
const r3 = null == e3 ? void 0 : e3.readable;
|
|
7180
8017
|
M4(r3, "readable", "ReadableWritablePair"), function(e4, t3) {
|
|
7181
|
-
if (!
|
|
8018
|
+
if (!H5(e4)) throw new TypeError(`${t3} is not a ReadableStream.`);
|
|
7182
8019
|
}(r3, `${t2} has member 'readable' that`);
|
|
7183
8020
|
const o3 = null == e3 ? void 0 : e3.writable;
|
|
7184
8021
|
return M4(o3, "writable", "ReadableWritablePair"), function(e4, t3) {
|
|
@@ -7225,7 +8062,7 @@ function Kt(e3) {
|
|
|
7225
8062
|
function Zt(e3, t2) {
|
|
7226
8063
|
F4(e3, t2);
|
|
7227
8064
|
const r3 = null == e3 ? void 0 : e3.highWaterMark;
|
|
7228
|
-
return M4(r3, "highWaterMark", "QueuingStrategyInit"), { highWaterMark:
|
|
8065
|
+
return M4(r3, "highWaterMark", "QueuingStrategyInit"), { highWaterMark: Y4(r3) };
|
|
7229
8066
|
}
|
|
7230
8067
|
function tr(e3) {
|
|
7231
8068
|
return new TypeError(`ByteLengthQueuingStrategy.prototype.${e3} can only be used on a ByteLengthQueuingStrategy`);
|
|
@@ -7243,7 +8080,7 @@ function ir(e3, t2, r3) {
|
|
|
7243
8080
|
return I4(e3, r3), (r4) => w6(e3, t2, [r4]);
|
|
7244
8081
|
}
|
|
7245
8082
|
function lr(e3, t2, r3) {
|
|
7246
|
-
return I4(e3, r3), (r4) =>
|
|
8083
|
+
return I4(e3, r3), (r4) => g4(e3, t2, [r4]);
|
|
7247
8084
|
}
|
|
7248
8085
|
function sr(e3, t2, r3) {
|
|
7249
8086
|
return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]);
|
|
@@ -7333,7 +8170,7 @@ function qr(e3) {
|
|
|
7333
8170
|
function Cr(e3) {
|
|
7334
8171
|
"erroring" === e3._writableState && qr(e3);
|
|
7335
8172
|
}
|
|
7336
|
-
var e2, o2, a3, i2, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader,
|
|
8173
|
+
var e2, o2, a3, i2, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader, te2, re2, ae2, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy, TransformStream2, TransformStreamDefaultController;
|
|
7337
8174
|
var init_ponyfill = __esm({
|
|
7338
8175
|
"node_modules/formdata-node/node_modules/web-streams-polyfill/dist/ponyfill.mjs"() {
|
|
7339
8176
|
e2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e3) => `Symbol(${e3})`;
|
|
@@ -7423,7 +8260,7 @@ var init_ponyfill = __esm({
|
|
|
7423
8260
|
}
|
|
7424
8261
|
};
|
|
7425
8262
|
Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n(ReadableStreamDefaultReader.prototype.read, "read"), n(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e2.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true });
|
|
7426
|
-
|
|
8263
|
+
te2 = class {
|
|
7427
8264
|
constructor(e3, t2) {
|
|
7428
8265
|
this._ongoingPromise = void 0, this._isFinished = false, this._reader = e3, this._preventCancel = t2;
|
|
7429
8266
|
}
|
|
@@ -7459,9 +8296,9 @@ var init_ponyfill = __esm({
|
|
|
7459
8296
|
}
|
|
7460
8297
|
};
|
|
7461
8298
|
re2 = { next() {
|
|
7462
|
-
return oe(this) ? this._asyncIteratorImpl.next() : d6(
|
|
8299
|
+
return oe(this) ? this._asyncIteratorImpl.next() : d6(ne2("next"));
|
|
7463
8300
|
}, return(e3) {
|
|
7464
|
-
return oe(this) ? this._asyncIteratorImpl.return(e3) : d6(
|
|
8301
|
+
return oe(this) ? this._asyncIteratorImpl.return(e3) : d6(ne2("return"));
|
|
7465
8302
|
} };
|
|
7466
8303
|
"symbol" == typeof e2.asyncIterator && Object.defineProperty(re2, e2.asyncIterator, { value() {
|
|
7467
8304
|
return this;
|
|
@@ -7572,7 +8409,7 @@ var init_ponyfill = __esm({
|
|
|
7572
8409
|
}(e4), 0 === X4(r3)) me(e4, i3, n2, a4);
|
|
7573
8410
|
else {
|
|
7574
8411
|
e4._pendingPullIntos.length > 0 && Ce(e4);
|
|
7575
|
-
|
|
8412
|
+
G6(r3, new Uint8Array(i3, n2, a4), false);
|
|
7576
8413
|
}
|
|
7577
8414
|
else Le(r3) ? (me(e4, i3, n2, a4), Te(e4)) : me(e4, i3, n2, a4);
|
|
7578
8415
|
be(e4);
|
|
@@ -7700,7 +8537,7 @@ var init_ponyfill = __esm({
|
|
|
7700
8537
|
const u3 = r5();
|
|
7701
8538
|
b6(c3(u3), () => (t4._started = true, dt(t4), null), (r6) => (t4._started = true, Ze(e5, r6), null));
|
|
7702
8539
|
}(e4, n3, a5, i3, l3, s2, r4, o4);
|
|
7703
|
-
}(this, o3, $
|
|
8540
|
+
}(this, o3, $e2(r3, 1), a4);
|
|
7704
8541
|
}
|
|
7705
8542
|
get locked() {
|
|
7706
8543
|
if (!Ge(this)) throw _t("locked");
|
|
@@ -7871,7 +8708,7 @@ var init_ponyfill = __esm({
|
|
|
7871
8708
|
return function(e4, t2) {
|
|
7872
8709
|
if (!Ft(e4)) return;
|
|
7873
8710
|
const r3 = e4._controlledReadableStream;
|
|
7874
|
-
if (Ut(r3) && X4(r3) > 0)
|
|
8711
|
+
if (Ut(r3) && X4(r3) > 0) G6(r3, t2, false);
|
|
7875
8712
|
else {
|
|
7876
8713
|
let r4;
|
|
7877
8714
|
try {
|
|
@@ -7900,7 +8737,7 @@ var init_ponyfill = __esm({
|
|
|
7900
8737
|
[q5](e3) {
|
|
7901
8738
|
const t2 = this._controlledReadableStream;
|
|
7902
8739
|
if (this._queue.length > 0) {
|
|
7903
|
-
const r3 =
|
|
8740
|
+
const r3 = se2(this);
|
|
7904
8741
|
this._closeRequested && 0 === this._queue.length ? (jt(this), Xt(t2)) : At(this), e3._chunkSteps(r3);
|
|
7905
8742
|
} else U6(t2, e3), At(this);
|
|
7906
8743
|
}
|
|
@@ -7919,10 +8756,10 @@ var init_ponyfill = __esm({
|
|
|
7919
8756
|
var n2;
|
|
7920
8757
|
if ((n2 = this)._state = "readable", n2._reader = void 0, n2._storedError = void 0, n2._disturbed = false, "bytes" === o3.type) {
|
|
7921
8758
|
if (void 0 !== r3.size) throw new RangeError("The strategy for a byte stream cannot have a size function");
|
|
7922
|
-
Oe(this, o3, $
|
|
8759
|
+
Oe(this, o3, $e2(r3, 0));
|
|
7923
8760
|
} else {
|
|
7924
8761
|
const e4 = Me(r3);
|
|
7925
|
-
It(this, o3, $
|
|
8762
|
+
It(this, o3, $e2(r3, 1), e4);
|
|
7926
8763
|
}
|
|
7927
8764
|
}
|
|
7928
8765
|
get locked() {
|
|
@@ -7943,7 +8780,7 @@ var init_ponyfill = __esm({
|
|
|
7943
8780
|
}(this);
|
|
7944
8781
|
}
|
|
7945
8782
|
pipeThrough(e3, t2 = {}) {
|
|
7946
|
-
if (!
|
|
8783
|
+
if (!H5(this)) throw Kt("pipeThrough");
|
|
7947
8784
|
$5(e3, 1, "pipeThrough");
|
|
7948
8785
|
const r3 = xt(e3, "First parameter"), o3 = Ht(t2, "Second parameter");
|
|
7949
8786
|
if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
|
|
@@ -7951,7 +8788,7 @@ var init_ponyfill = __esm({
|
|
|
7951
8788
|
return m4(kt(this, r3.writable, o3.preventClose, o3.preventAbort, o3.preventCancel, o3.signal)), r3.readable;
|
|
7952
8789
|
}
|
|
7953
8790
|
pipeTo(e3, t2 = {}) {
|
|
7954
|
-
if (!
|
|
8791
|
+
if (!H5(this)) return d6(Kt("pipeTo"));
|
|
7955
8792
|
if (void 0 === e3) return d6("Parameter 1 is required in 'pipeTo'.");
|
|
7956
8793
|
if (!x4(e3)) return d6(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
|
|
7957
8794
|
let r3;
|
|
@@ -7963,14 +8800,14 @@ var init_ponyfill = __esm({
|
|
|
7963
8800
|
return this.locked ? d6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : e3.locked ? d6(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : kt(this, e3, r3.preventClose, r3.preventAbort, r3.preventCancel, r3.signal);
|
|
7964
8801
|
}
|
|
7965
8802
|
tee() {
|
|
7966
|
-
if (!
|
|
8803
|
+
if (!H5(this)) throw Kt("tee");
|
|
7967
8804
|
if (this.locked) throw new TypeError("Cannot tee a stream that already has a reader");
|
|
7968
8805
|
return Ot(this);
|
|
7969
8806
|
}
|
|
7970
8807
|
values(e3) {
|
|
7971
|
-
if (!
|
|
8808
|
+
if (!H5(this)) throw Kt("values");
|
|
7972
8809
|
return function(e4, t2) {
|
|
7973
|
-
const r3 = e4.getReader(), o3 = new
|
|
8810
|
+
const r3 = e4.getReader(), o3 = new te2(r3, t2), n2 = Object.create(re2);
|
|
7974
8811
|
return n2._asyncIteratorImpl = o3, n2;
|
|
7975
8812
|
}(this, function(e4, t2) {
|
|
7976
8813
|
F4(e4, t2);
|
|
@@ -8022,7 +8859,7 @@ var init_ponyfill = __esm({
|
|
|
8022
8859
|
}(e3, "First parameter");
|
|
8023
8860
|
if (void 0 !== a4.readableType) throw new RangeError("Invalid readableType specified");
|
|
8024
8861
|
if (void 0 !== a4.writableType) throw new RangeError("Invalid writableType specified");
|
|
8025
|
-
const i3 = $
|
|
8862
|
+
const i3 = $e2(n2, 0), l3 = Me(n2), s2 = $e2(o3, 1), f4 = Me(o3);
|
|
8026
8863
|
let b7;
|
|
8027
8864
|
!function(e4, t3, r4, o4, n3, a5) {
|
|
8028
8865
|
function i4() {
|
|
@@ -47084,8 +47921,8 @@ var $ = (t2, { onFlag: n2, onArgument: r3 }) => {
|
|
|
47084
47921
|
const a4 = N(i3);
|
|
47085
47922
|
if (a4) {
|
|
47086
47923
|
if (o3(), !n2) continue;
|
|
47087
|
-
const [l3, f4,
|
|
47088
|
-
if (
|
|
47924
|
+
const [l3, f4, g5] = a4;
|
|
47925
|
+
if (g5) for (let c4 = 0; c4 < l3.length; c4 += 1) {
|
|
47089
47926
|
o3();
|
|
47090
47927
|
const u3 = c4 === l3.length - 1;
|
|
47091
47928
|
e3 = n2(l3[c4], u3 ? f4 : void 0, [s2, c4 + 1, u3]);
|
|
@@ -47111,9 +47948,9 @@ var E = (t2, n2) => {
|
|
|
47111
47948
|
var U = (t2, n2 = process.argv.slice(2), { ignore: r3 } = {}) => {
|
|
47112
47949
|
const e3 = [], o3 = K(t2), s2 = {}, i3 = [];
|
|
47113
47950
|
return i3[F] = [], $(n2, { onFlag(a4, l3, f4) {
|
|
47114
|
-
const
|
|
47115
|
-
if (!r3?.(
|
|
47116
|
-
if (
|
|
47951
|
+
const g5 = w(o3, a4);
|
|
47952
|
+
if (!r3?.(g5 ? V : k, a4, l3)) {
|
|
47953
|
+
if (g5) {
|
|
47117
47954
|
const [c4, u3] = o3[a4], y6 = d(u3, l3), p4 = (P4, A5) => {
|
|
47118
47955
|
e3.push(f4), A5 && e3.push(A5), c4.push(m(u3, P4 || ""));
|
|
47119
47956
|
};
|
|
@@ -47628,9 +48465,9 @@ function x2(t2, e3, r3, n2) {
|
|
|
47628
48465
|
if (o3 && l3.flags.help === true) return u3(), process.exit(0);
|
|
47629
48466
|
if (e3.parameters) {
|
|
47630
48467
|
let { parameters: c4 } = e3, m5 = l3._;
|
|
47631
|
-
const
|
|
47632
|
-
if (
|
|
47633
|
-
c4 = c4.slice(0,
|
|
48468
|
+
const g5 = c4.indexOf("--"), v5 = c4.slice(g5 + 1), h4 = /* @__PURE__ */ Object.create(null);
|
|
48469
|
+
if (g5 > -1 && v5.length > 0) {
|
|
48470
|
+
c4 = c4.slice(0, g5);
|
|
47634
48471
|
const E4 = l3._["--"];
|
|
47635
48472
|
m5 = m5.slice(0, -E4.length || void 0), b3(h4, w3(c4), m5, u3), b3(h4, w3(v5), E4, u3);
|
|
47636
48473
|
} else b3(h4, w3(c4), m5, u3);
|
|
@@ -47672,7 +48509,7 @@ function G3(t2, e3) {
|
|
|
47672
48509
|
// package.json
|
|
47673
48510
|
var package_default = {
|
|
47674
48511
|
name: "opencommit",
|
|
47675
|
-
version: "3.2.
|
|
48512
|
+
version: "3.2.12",
|
|
47676
48513
|
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
|
47677
48514
|
keywords: [
|
|
47678
48515
|
"git",
|
|
@@ -47783,607 +48620,8 @@ var package_default = {
|
|
|
47783
48620
|
}
|
|
47784
48621
|
};
|
|
47785
48622
|
|
|
47786
|
-
//
|
|
47787
|
-
|
|
47788
|
-
var import_node_process = require("node:process");
|
|
47789
|
-
var f = __toESM(require("node:readline"), 1);
|
|
47790
|
-
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
47791
|
-
var import_node_tty = require("node:tty");
|
|
47792
|
-
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
47793
|
-
function q3({ onlyFirst: t2 = false } = {}) {
|
|
47794
|
-
const u3 = ["[\\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("|");
|
|
47795
|
-
return new RegExp(u3, t2 ? void 0 : "g");
|
|
47796
|
-
}
|
|
47797
|
-
function S3(t2) {
|
|
47798
|
-
if (typeof t2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``);
|
|
47799
|
-
return t2.replace(q3(), "");
|
|
47800
|
-
}
|
|
47801
|
-
function j2(t2) {
|
|
47802
|
-
return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
|
|
47803
|
-
}
|
|
47804
|
-
var M3 = { exports: {} };
|
|
47805
|
-
(function(t2) {
|
|
47806
|
-
var u3 = {};
|
|
47807
|
-
t2.exports = u3, u3.eastAsianWidth = function(e3) {
|
|
47808
|
-
var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2;
|
|
47809
|
-
return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N";
|
|
47810
|
-
}, u3.characterLength = function(e3) {
|
|
47811
|
-
var s2 = this.eastAsianWidth(e3);
|
|
47812
|
-
return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1;
|
|
47813
|
-
};
|
|
47814
|
-
function F5(e3) {
|
|
47815
|
-
return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
|
|
47816
|
-
}
|
|
47817
|
-
u3.length = function(e3) {
|
|
47818
|
-
for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) C5 = C5 + this.characterLength(s2[D5]);
|
|
47819
|
-
return C5;
|
|
47820
|
-
}, u3.slice = function(e3, s2, C5) {
|
|
47821
|
-
textLen = u3.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5);
|
|
47822
|
-
for (var D5 = "", i3 = 0, n2 = F5(e3), E4 = 0; E4 < n2.length; E4++) {
|
|
47823
|
-
var h4 = n2[E4], o3 = u3.length(h4);
|
|
47824
|
-
if (i3 >= s2 - (o3 == 2 ? 1 : 0)) if (i3 + o3 <= C5) D5 += h4;
|
|
47825
|
-
else break;
|
|
47826
|
-
i3 += o3;
|
|
47827
|
-
}
|
|
47828
|
-
return D5;
|
|
47829
|
-
};
|
|
47830
|
-
})(M3);
|
|
47831
|
-
var J3 = M3.exports;
|
|
47832
|
-
var Q2 = j2(J3);
|
|
47833
|
-
var X2 = function() {
|
|
47834
|
-
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;
|
|
47835
|
-
};
|
|
47836
|
-
var DD2 = j2(X2);
|
|
47837
|
-
function A2(t2, u3 = {}) {
|
|
47838
|
-
if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = S3(t2), t2.length === 0)) return 0;
|
|
47839
|
-
t2 = t2.replace(DD2(), " ");
|
|
47840
|
-
const F5 = u3.ambiguousIsNarrow ? 1 : 2;
|
|
47841
|
-
let e3 = 0;
|
|
47842
|
-
for (const s2 of t2) {
|
|
47843
|
-
const C5 = s2.codePointAt(0);
|
|
47844
|
-
if (C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879) continue;
|
|
47845
|
-
switch (Q2.eastAsianWidth(s2)) {
|
|
47846
|
-
case "F":
|
|
47847
|
-
case "W":
|
|
47848
|
-
e3 += 2;
|
|
47849
|
-
break;
|
|
47850
|
-
case "A":
|
|
47851
|
-
e3 += F5;
|
|
47852
|
-
break;
|
|
47853
|
-
default:
|
|
47854
|
-
e3 += 1;
|
|
47855
|
-
}
|
|
47856
|
-
}
|
|
47857
|
-
return e3;
|
|
47858
|
-
}
|
|
47859
|
-
var m3 = 10;
|
|
47860
|
-
var T4 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`;
|
|
47861
|
-
var P2 = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`;
|
|
47862
|
-
var W3 = (t2 = 0) => (u3, F5, e3) => `\x1B[${38 + t2};2;${u3};${F5};${e3}m`;
|
|
47863
|
-
var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
|
|
47864
|
-
Object.keys(r.modifier);
|
|
47865
|
-
var uD2 = Object.keys(r.color);
|
|
47866
|
-
var FD2 = Object.keys(r.bgColor);
|
|
47867
|
-
[...uD2, ...FD2];
|
|
47868
|
-
function tD2() {
|
|
47869
|
-
const t2 = /* @__PURE__ */ new Map();
|
|
47870
|
-
for (const [u3, F5] of Object.entries(r)) {
|
|
47871
|
-
for (const [e3, s2] of Object.entries(F5)) r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]);
|
|
47872
|
-
Object.defineProperty(r, u3, { value: F5, enumerable: false });
|
|
47873
|
-
}
|
|
47874
|
-
return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => {
|
|
47875
|
-
const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16));
|
|
47876
|
-
if (!F5) return [0, 0, 0];
|
|
47877
|
-
let [e3] = F5;
|
|
47878
|
-
e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join(""));
|
|
47879
|
-
const s2 = Number.parseInt(e3, 16);
|
|
47880
|
-
return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
|
|
47881
|
-
}, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => {
|
|
47882
|
-
if (u3 < 8) return 30 + u3;
|
|
47883
|
-
if (u3 < 16) return 90 + (u3 - 8);
|
|
47884
|
-
let F5, e3, s2;
|
|
47885
|
-
if (u3 >= 232) F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5;
|
|
47886
|
-
else {
|
|
47887
|
-
u3 -= 16;
|
|
47888
|
-
const i3 = u3 % 36;
|
|
47889
|
-
F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5;
|
|
47890
|
-
}
|
|
47891
|
-
const C5 = Math.max(F5, e3, s2) * 2;
|
|
47892
|
-
if (C5 === 0) return 30;
|
|
47893
|
-
let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5));
|
|
47894
|
-
return C5 === 2 && (D5 += 60), D5;
|
|
47895
|
-
}, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r;
|
|
47896
|
-
}
|
|
47897
|
-
var eD2 = tD2();
|
|
47898
|
-
var g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
|
|
47899
|
-
var sD2 = 39;
|
|
47900
|
-
var b4 = "\x07";
|
|
47901
|
-
var O3 = "[";
|
|
47902
|
-
var CD2 = "]";
|
|
47903
|
-
var I3 = "m";
|
|
47904
|
-
var w4 = `${CD2}8;;`;
|
|
47905
|
-
var N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`;
|
|
47906
|
-
var L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`;
|
|
47907
|
-
var iD2 = (t2) => t2.split(" ").map((u3) => A2(u3));
|
|
47908
|
-
var y3 = (t2, u3, F5) => {
|
|
47909
|
-
const e3 = [...u3];
|
|
47910
|
-
let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1]));
|
|
47911
|
-
for (const [i3, n2] of e3.entries()) {
|
|
47912
|
-
const E4 = A2(n2);
|
|
47913
|
-
if (D5 + E4 <= F5 ? t2[t2.length - 1] += n2 : (t2.push(n2), D5 = 0), g2.has(n2) && (s2 = true, C5 = e3.slice(i3 + 1).join("").startsWith(w4)), s2) {
|
|
47914
|
-
C5 ? n2 === b4 && (s2 = false, C5 = false) : n2 === I3 && (s2 = false);
|
|
47915
|
-
continue;
|
|
47916
|
-
}
|
|
47917
|
-
D5 += E4, D5 === F5 && i3 < e3.length - 1 && (t2.push(""), D5 = 0);
|
|
47918
|
-
}
|
|
47919
|
-
!D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop());
|
|
47920
|
-
};
|
|
47921
|
-
var rD2 = (t2) => {
|
|
47922
|
-
const u3 = t2.split(" ");
|
|
47923
|
-
let F5 = u3.length;
|
|
47924
|
-
for (; F5 > 0 && !(A2(u3[F5 - 1]) > 0); ) F5--;
|
|
47925
|
-
return F5 === u3.length ? t2 : u3.slice(0, F5).join(" ") + u3.slice(F5).join("");
|
|
47926
|
-
};
|
|
47927
|
-
var ED2 = (t2, u3, F5 = {}) => {
|
|
47928
|
-
if (F5.trim !== false && t2.trim() === "") return "";
|
|
47929
|
-
let e3 = "", s2, C5;
|
|
47930
|
-
const D5 = iD2(t2);
|
|
47931
|
-
let i3 = [""];
|
|
47932
|
-
for (const [E4, h4] of t2.split(" ").entries()) {
|
|
47933
|
-
F5.trim !== false && (i3[i3.length - 1] = i3[i3.length - 1].trimStart());
|
|
47934
|
-
let o3 = A2(i3[i3.length - 1]);
|
|
47935
|
-
if (E4 !== 0 && (o3 >= u3 && (F5.wordWrap === false || F5.trim === false) && (i3.push(""), o3 = 0), (o3 > 0 || F5.trim === false) && (i3[i3.length - 1] += " ", o3++)), F5.hard && D5[E4] > u3) {
|
|
47936
|
-
const B3 = u3 - o3, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u3);
|
|
47937
|
-
Math.floor((D5[E4] - 1) / u3) < p4 && i3.push(""), y3(i3, h4, u3);
|
|
47938
|
-
continue;
|
|
47939
|
-
}
|
|
47940
|
-
if (o3 + D5[E4] > u3 && o3 > 0 && D5[E4] > 0) {
|
|
47941
|
-
if (F5.wordWrap === false && o3 < u3) {
|
|
47942
|
-
y3(i3, h4, u3);
|
|
47943
|
-
continue;
|
|
47944
|
-
}
|
|
47945
|
-
i3.push("");
|
|
47946
|
-
}
|
|
47947
|
-
if (o3 + D5[E4] > u3 && F5.wordWrap === false) {
|
|
47948
|
-
y3(i3, h4, u3);
|
|
47949
|
-
continue;
|
|
47950
|
-
}
|
|
47951
|
-
i3[i3.length - 1] += h4;
|
|
47952
|
-
}
|
|
47953
|
-
F5.trim !== false && (i3 = i3.map((E4) => rD2(E4)));
|
|
47954
|
-
const n2 = [...i3.join(`
|
|
47955
|
-
`)];
|
|
47956
|
-
for (const [E4, h4] of n2.entries()) {
|
|
47957
|
-
if (e3 += h4, g2.has(h4)) {
|
|
47958
|
-
const { groups: B3 } = new RegExp(`(?:\\${O3}(?<code>\\d+)m|\\${w4}(?<uri>.*)${b4})`).exec(n2.slice(E4).join("")) || { groups: {} };
|
|
47959
|
-
if (B3.code !== void 0) {
|
|
47960
|
-
const p4 = Number.parseFloat(B3.code);
|
|
47961
|
-
s2 = p4 === sD2 ? void 0 : p4;
|
|
47962
|
-
} else B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri);
|
|
47963
|
-
}
|
|
47964
|
-
const o3 = eD2.codes.get(Number(s2));
|
|
47965
|
-
n2[E4 + 1] === `
|
|
47966
|
-
` ? (C5 && (e3 += L4("")), s2 && o3 && (e3 += N3(o3))) : h4 === `
|
|
47967
|
-
` && (s2 && o3 && (e3 += N3(s2)), C5 && (e3 += L4(C5)));
|
|
47968
|
-
}
|
|
47969
|
-
return e3;
|
|
47970
|
-
};
|
|
47971
|
-
function R4(t2, u3, F5) {
|
|
47972
|
-
return String(t2).normalize().replace(/\r\n/g, `
|
|
47973
|
-
`).split(`
|
|
47974
|
-
`).map((e3) => ED2(e3, u3, F5)).join(`
|
|
47975
|
-
`);
|
|
47976
|
-
}
|
|
47977
|
-
var oD2 = Object.defineProperty;
|
|
47978
|
-
var nD2 = (t2, u3, F5) => u3 in t2 ? oD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
47979
|
-
var a = (t2, u3, F5) => (nD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
47980
|
-
function aD2(t2, u3) {
|
|
47981
|
-
if (t2 === u3) return;
|
|
47982
|
-
const F5 = t2.split(`
|
|
47983
|
-
`), e3 = u3.split(`
|
|
47984
|
-
`), s2 = [];
|
|
47985
|
-
for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) F5[C5] !== e3[C5] && s2.push(C5);
|
|
47986
|
-
return s2;
|
|
47987
|
-
}
|
|
47988
|
-
var V4 = Symbol("clack:cancel");
|
|
47989
|
-
function hD2(t2) {
|
|
47990
|
-
return t2 === V4;
|
|
47991
|
-
}
|
|
47992
|
-
function v3(t2, u3) {
|
|
47993
|
-
t2.isTTY && t2.setRawMode(u3);
|
|
47994
|
-
}
|
|
47995
|
-
var z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]);
|
|
47996
|
-
var lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]);
|
|
47997
|
-
var x3 = class {
|
|
47998
|
-
constructor({ render: u3, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) {
|
|
47999
|
-
a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u3.bind(this), this._track = C5, this.input = F5, this.output = e3;
|
|
48000
|
-
}
|
|
48001
|
-
prompt() {
|
|
48002
|
-
const u3 = new import_node_tty.WriteStream(0);
|
|
48003
|
-
return u3._write = (F5, e3, s2) => {
|
|
48004
|
-
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2();
|
|
48005
|
-
}, this.input.pipe(u3), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u3, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => {
|
|
48006
|
-
this.once("submit", () => {
|
|
48007
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value);
|
|
48008
|
-
}), this.once("cancel", () => {
|
|
48009
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(V4);
|
|
48010
|
-
});
|
|
48011
|
-
});
|
|
48012
|
-
}
|
|
48013
|
-
on(u3, F5) {
|
|
48014
|
-
const e3 = this.subscribers.get(u3) ?? [];
|
|
48015
|
-
e3.push({ cb: F5 }), this.subscribers.set(u3, e3);
|
|
48016
|
-
}
|
|
48017
|
-
once(u3, F5) {
|
|
48018
|
-
const e3 = this.subscribers.get(u3) ?? [];
|
|
48019
|
-
e3.push({ cb: F5, once: true }), this.subscribers.set(u3, e3);
|
|
48020
|
-
}
|
|
48021
|
-
emit(u3, ...F5) {
|
|
48022
|
-
const e3 = this.subscribers.get(u3) ?? [], s2 = [];
|
|
48023
|
-
for (const C5 of e3) C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1));
|
|
48024
|
-
for (const C5 of s2) C5();
|
|
48025
|
-
}
|
|
48026
|
-
unsubscribe() {
|
|
48027
|
-
this.subscribers.clear();
|
|
48028
|
-
}
|
|
48029
|
-
onKeypress(u3, F5) {
|
|
48030
|
-
if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F5?.name === "return") {
|
|
48031
|
-
if (this.opts.validate) {
|
|
48032
|
-
const e3 = this.opts.validate(this.value);
|
|
48033
|
-
e3 && (this.error = e3, this.state = "error", this.rl.write(this.value));
|
|
48034
|
-
}
|
|
48035
|
-
this.state !== "error" && (this.state = "submit");
|
|
48036
|
-
}
|
|
48037
|
-
u3 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
48038
|
-
}
|
|
48039
|
-
close() {
|
|
48040
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
48041
|
-
`), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
48042
|
-
}
|
|
48043
|
-
restoreCursor() {
|
|
48044
|
-
const u3 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(`
|
|
48045
|
-
`).length - 1;
|
|
48046
|
-
this.output.write(import_sisteransi.cursor.move(-999, u3 * -1));
|
|
48047
|
-
}
|
|
48048
|
-
render() {
|
|
48049
|
-
const u3 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true });
|
|
48050
|
-
if (u3 !== this._prevFrame) {
|
|
48051
|
-
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
48052
|
-
else {
|
|
48053
|
-
const F5 = aD2(this._prevFrame, u3);
|
|
48054
|
-
if (this.restoreCursor(), F5 && F5?.length === 1) {
|
|
48055
|
-
const e3 = F5[0];
|
|
48056
|
-
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1));
|
|
48057
|
-
const s2 = u3.split(`
|
|
48058
|
-
`);
|
|
48059
|
-
this.output.write(s2[e3]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1));
|
|
48060
|
-
return;
|
|
48061
|
-
} else if (F5 && F5?.length > 1) {
|
|
48062
|
-
const e3 = F5[0];
|
|
48063
|
-
this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down());
|
|
48064
|
-
const s2 = u3.split(`
|
|
48065
|
-
`).slice(e3);
|
|
48066
|
-
this.output.write(s2.join(`
|
|
48067
|
-
`)), this._prevFrame = u3;
|
|
48068
|
-
return;
|
|
48069
|
-
}
|
|
48070
|
-
this.output.write(import_sisteransi.erase.down());
|
|
48071
|
-
}
|
|
48072
|
-
this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3;
|
|
48073
|
-
}
|
|
48074
|
-
}
|
|
48075
|
-
};
|
|
48076
|
-
var xD2 = class extends x3 {
|
|
48077
|
-
get cursor() {
|
|
48078
|
-
return this.value ? 0 : 1;
|
|
48079
|
-
}
|
|
48080
|
-
get _value() {
|
|
48081
|
-
return this.cursor === 0;
|
|
48082
|
-
}
|
|
48083
|
-
constructor(u3) {
|
|
48084
|
-
super(u3, false), this.value = !!u3.initialValue, this.on("value", () => {
|
|
48085
|
-
this.value = this._value;
|
|
48086
|
-
}), this.on("confirm", (F5) => {
|
|
48087
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close();
|
|
48088
|
-
}), this.on("cursor", () => {
|
|
48089
|
-
this.value = !this.value;
|
|
48090
|
-
});
|
|
48091
|
-
}
|
|
48092
|
-
};
|
|
48093
|
-
var pD2 = Object.defineProperty;
|
|
48094
|
-
var fD2 = (t2, u3, F5) => u3 in t2 ? pD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
48095
|
-
var K3 = (t2, u3, F5) => (fD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
48096
|
-
var gD2 = class extends x3 {
|
|
48097
|
-
constructor(u3) {
|
|
48098
|
-
super(u3, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u3.cursorAt), 0), this.on("key", (F5) => {
|
|
48099
|
-
F5 === "a" && this.toggleAll();
|
|
48100
|
-
}), this.on("cursor", (F5) => {
|
|
48101
|
-
switch (F5) {
|
|
48102
|
-
case "left":
|
|
48103
|
-
case "up":
|
|
48104
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
48105
|
-
break;
|
|
48106
|
-
case "down":
|
|
48107
|
-
case "right":
|
|
48108
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
48109
|
-
break;
|
|
48110
|
-
case "space":
|
|
48111
|
-
this.toggleValue();
|
|
48112
|
-
break;
|
|
48113
|
-
}
|
|
48114
|
-
});
|
|
48115
|
-
}
|
|
48116
|
-
get _value() {
|
|
48117
|
-
return this.options[this.cursor].value;
|
|
48118
|
-
}
|
|
48119
|
-
toggleAll() {
|
|
48120
|
-
const u3 = this.value.length === this.options.length;
|
|
48121
|
-
this.value = u3 ? [] : this.options.map((F5) => F5.value);
|
|
48122
|
-
}
|
|
48123
|
-
toggleValue() {
|
|
48124
|
-
const u3 = this.value.includes(this._value);
|
|
48125
|
-
this.value = u3 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value];
|
|
48126
|
-
}
|
|
48127
|
-
};
|
|
48128
|
-
var bD2 = Object.defineProperty;
|
|
48129
|
-
var wD2 = (t2, u3, F5) => u3 in t2 ? bD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
48130
|
-
var Z3 = (t2, u3, F5) => (wD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
48131
|
-
var yD = class extends x3 {
|
|
48132
|
-
constructor(u3) {
|
|
48133
|
-
super(u3, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => {
|
|
48134
|
-
switch (F5) {
|
|
48135
|
-
case "left":
|
|
48136
|
-
case "up":
|
|
48137
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
48138
|
-
break;
|
|
48139
|
-
case "down":
|
|
48140
|
-
case "right":
|
|
48141
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
48142
|
-
break;
|
|
48143
|
-
}
|
|
48144
|
-
this.changeValue();
|
|
48145
|
-
});
|
|
48146
|
-
}
|
|
48147
|
-
get _value() {
|
|
48148
|
-
return this.options[this.cursor];
|
|
48149
|
-
}
|
|
48150
|
-
changeValue() {
|
|
48151
|
-
this.value = this._value.value;
|
|
48152
|
-
}
|
|
48153
|
-
};
|
|
48154
|
-
var SD = Object.defineProperty;
|
|
48155
|
-
var jD = (t2, u3, F5) => u3 in t2 ? SD(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5;
|
|
48156
|
-
var MD = (t2, u3, F5) => (jD(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5);
|
|
48157
|
-
var TD = class extends x3 {
|
|
48158
|
-
constructor(u3) {
|
|
48159
|
-
super(u3), MD(this, "valueWithCursor", ""), this.on("finalize", () => {
|
|
48160
|
-
this.value || (this.value = u3.defaultValue), this.valueWithCursor = this.value;
|
|
48161
|
-
}), this.on("value", () => {
|
|
48162
|
-
if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${import_picocolors.default.inverse(import_picocolors.default.hidden("_"))}`;
|
|
48163
|
-
else {
|
|
48164
|
-
const F5 = this.value.slice(0, this.cursor), e3 = this.value.slice(this.cursor);
|
|
48165
|
-
this.valueWithCursor = `${F5}${import_picocolors.default.inverse(e3[0])}${e3.slice(1)}`;
|
|
48166
|
-
}
|
|
48167
|
-
});
|
|
48168
|
-
}
|
|
48169
|
-
get cursor() {
|
|
48170
|
-
return this._cursor;
|
|
48171
|
-
}
|
|
48172
|
-
};
|
|
48173
|
-
var PD = globalThis.process.platform.startsWith("win");
|
|
48174
|
-
function WD({ input: t2 = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) {
|
|
48175
|
-
const s2 = f.createInterface({ input: t2, output: u3, prompt: "", tabSize: 1 });
|
|
48176
|
-
f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true);
|
|
48177
|
-
const C5 = (D5, { name: i3 }) => {
|
|
48178
|
-
if (String(D5) === "" && process.exit(0), !F5) return;
|
|
48179
|
-
let n2 = i3 === "return" ? 0 : -1, E4 = i3 === "return" ? -1 : 0;
|
|
48180
|
-
f.moveCursor(u3, n2, E4, () => {
|
|
48181
|
-
f.clearLine(u3, 1, () => {
|
|
48182
|
-
t2.once("keypress", C5);
|
|
48183
|
-
});
|
|
48184
|
-
});
|
|
48185
|
-
};
|
|
48186
|
-
return e3 && process.stdout.write(import_sisteransi.cursor.hide), t2.once("keypress", C5), () => {
|
|
48187
|
-
t2.off("keypress", C5), e3 && process.stdout.write(import_sisteransi.cursor.show), t2.isTTY && !PD && t2.setRawMode(false), s2.terminal = false, s2.close();
|
|
48188
|
-
};
|
|
48189
|
-
}
|
|
48190
|
-
|
|
48191
|
-
// node_modules/@clack/prompts/dist/index.mjs
|
|
48192
|
-
var import_node_process2 = __toESM(require("node:process"), 1);
|
|
48193
|
-
var import_picocolors2 = __toESM(require_picocolors(), 1);
|
|
48194
|
-
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
48195
|
-
function N4() {
|
|
48196
|
-
return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
48197
|
-
}
|
|
48198
|
-
var p2 = N4();
|
|
48199
|
-
var u = (r3, n2) => p2 ? r3 : n2;
|
|
48200
|
-
var W4 = u("\u25C6", "*");
|
|
48201
|
-
var D3 = u("\u25A0", "x");
|
|
48202
|
-
var F3 = u("\u25B2", "x");
|
|
48203
|
-
var f2 = u("\u25C7", "o");
|
|
48204
|
-
var L5 = u("\u250C", "T");
|
|
48205
|
-
var a2 = u("\u2502", "|");
|
|
48206
|
-
var o = u("\u2514", "\u2014");
|
|
48207
|
-
var w5 = u("\u25CF", ">");
|
|
48208
|
-
var S4 = u("\u25CB", " ");
|
|
48209
|
-
var _5 = u("\u25FB", "[\u2022]");
|
|
48210
|
-
var y4 = u("\u25FC", "[+]");
|
|
48211
|
-
var A3 = u("\u25FB", "[ ]");
|
|
48212
|
-
var q4 = u("\u25AA", "\u2022");
|
|
48213
|
-
var R5 = u("\u2500", "-");
|
|
48214
|
-
var G4 = u("\u256E", "+");
|
|
48215
|
-
var H3 = u("\u251C", "+");
|
|
48216
|
-
var K4 = u("\u256F", "+");
|
|
48217
|
-
var U5 = u("\u25CF", "\u2022");
|
|
48218
|
-
var Z4 = u("\u25C6", "*");
|
|
48219
|
-
var z4 = u("\u25B2", "!");
|
|
48220
|
-
var X3 = u("\u25A0", "x");
|
|
48221
|
-
var h2 = (r3) => {
|
|
48222
|
-
switch (r3) {
|
|
48223
|
-
case "initial":
|
|
48224
|
-
case "active":
|
|
48225
|
-
return import_picocolors2.default.cyan(W4);
|
|
48226
|
-
case "cancel":
|
|
48227
|
-
return import_picocolors2.default.red(D3);
|
|
48228
|
-
case "error":
|
|
48229
|
-
return import_picocolors2.default.yellow(F3);
|
|
48230
|
-
case "submit":
|
|
48231
|
-
return import_picocolors2.default.green(f2);
|
|
48232
|
-
}
|
|
48233
|
-
};
|
|
48234
|
-
var J4 = (r3) => new TD({ validate: r3.validate, placeholder: r3.placeholder, defaultValue: r3.defaultValue, initialValue: r3.initialValue, render() {
|
|
48235
|
-
const n2 = `${import_picocolors2.default.gray(a2)}
|
|
48236
|
-
${h2(this.state)} ${r3.message}
|
|
48237
|
-
`, s2 = r3.placeholder ? import_picocolors2.default.inverse(r3.placeholder[0]) + import_picocolors2.default.dim(r3.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), t2 = this.value ? this.valueWithCursor : s2;
|
|
48238
|
-
switch (this.state) {
|
|
48239
|
-
case "error":
|
|
48240
|
-
return `${n2.trim()}
|
|
48241
|
-
${import_picocolors2.default.yellow(a2)} ${t2}
|
|
48242
|
-
${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(this.error)}
|
|
48243
|
-
`;
|
|
48244
|
-
case "submit":
|
|
48245
|
-
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(this.value || r3.placeholder)}`;
|
|
48246
|
-
case "cancel":
|
|
48247
|
-
return `${n2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
48248
|
-
` + import_picocolors2.default.gray(a2) : ""}`;
|
|
48249
|
-
default:
|
|
48250
|
-
return `${n2}${import_picocolors2.default.cyan(a2)} ${t2}
|
|
48251
|
-
${import_picocolors2.default.cyan(o)}
|
|
48252
|
-
`;
|
|
48253
|
-
}
|
|
48254
|
-
} }).prompt();
|
|
48255
|
-
var Q3 = (r3) => {
|
|
48256
|
-
const n2 = r3.active ?? "Yes", s2 = r3.inactive ?? "No";
|
|
48257
|
-
return new xD2({ active: n2, inactive: s2, initialValue: r3.initialValue ?? true, render() {
|
|
48258
|
-
const t2 = `${import_picocolors2.default.gray(a2)}
|
|
48259
|
-
${h2(this.state)} ${r3.message}
|
|
48260
|
-
`, i3 = this.value ? n2 : s2;
|
|
48261
|
-
switch (this.state) {
|
|
48262
|
-
case "submit":
|
|
48263
|
-
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(i3)}`;
|
|
48264
|
-
case "cancel":
|
|
48265
|
-
return `${t2}${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}
|
|
48266
|
-
${import_picocolors2.default.gray(a2)}`;
|
|
48267
|
-
default:
|
|
48268
|
-
return `${t2}${import_picocolors2.default.cyan(a2)} ${this.value ? `${import_picocolors2.default.green(w5)} ${n2}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(n2)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(s2)}` : `${import_picocolors2.default.green(w5)} ${s2}`}
|
|
48269
|
-
${import_picocolors2.default.cyan(o)}
|
|
48270
|
-
`;
|
|
48271
|
-
}
|
|
48272
|
-
} }).prompt();
|
|
48273
|
-
};
|
|
48274
|
-
var ee = (r3) => {
|
|
48275
|
-
const n2 = (s2, t2) => {
|
|
48276
|
-
const i3 = s2.label ?? String(s2.value);
|
|
48277
|
-
return t2 === "active" ? `${import_picocolors2.default.green(w5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : `${import_picocolors2.default.dim(S4)} ${import_picocolors2.default.dim(i3)}`;
|
|
48278
|
-
};
|
|
48279
|
-
return new yD({ options: r3.options, initialValue: r3.initialValue, render() {
|
|
48280
|
-
const s2 = `${import_picocolors2.default.gray(a2)}
|
|
48281
|
-
${h2(this.state)} ${r3.message}
|
|
48282
|
-
`;
|
|
48283
|
-
switch (this.state) {
|
|
48284
|
-
case "submit":
|
|
48285
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "selected")}`;
|
|
48286
|
-
case "cancel":
|
|
48287
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${n2(this.options[this.cursor], "cancelled")}
|
|
48288
|
-
${import_picocolors2.default.gray(a2)}`;
|
|
48289
|
-
default:
|
|
48290
|
-
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(`
|
|
48291
|
-
${import_picocolors2.default.cyan(a2)} `)}
|
|
48292
|
-
${import_picocolors2.default.cyan(o)}
|
|
48293
|
-
`;
|
|
48294
|
-
}
|
|
48295
|
-
} }).prompt();
|
|
48296
|
-
};
|
|
48297
|
-
var re = (r3) => {
|
|
48298
|
-
const n2 = (s2, t2) => {
|
|
48299
|
-
const i3 = s2.label ?? String(s2.value);
|
|
48300
|
-
return t2 === "active" ? `${import_picocolors2.default.cyan(_5)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors2.default.green(y4)} ${import_picocolors2.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(i3))}` : t2 === "active-selected" ? `${import_picocolors2.default.green(y4)} ${i3} ${s2.hint ? import_picocolors2.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors2.default.dim(i3)}` : `${import_picocolors2.default.dim(A3)} ${import_picocolors2.default.dim(i3)}`;
|
|
48301
|
-
};
|
|
48302
|
-
return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) {
|
|
48303
|
-
if (this.required && s2.length === 0) return `Please select at least one option.
|
|
48304
|
-
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
48305
|
-
}, render() {
|
|
48306
|
-
let s2 = `${import_picocolors2.default.gray(a2)}
|
|
48307
|
-
${h2(this.state)} ${r3.message}
|
|
48308
|
-
`;
|
|
48309
|
-
switch (this.state) {
|
|
48310
|
-
case "submit":
|
|
48311
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors2.default.dim(", ")) || import_picocolors2.default.dim("none")}`;
|
|
48312
|
-
case "cancel": {
|
|
48313
|
-
const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
48314
|
-
return `${s2}${import_picocolors2.default.gray(a2)} ${t2.trim() ? `${t2}
|
|
48315
|
-
${import_picocolors2.default.gray(a2)}` : ""}`;
|
|
48316
|
-
}
|
|
48317
|
-
case "error": {
|
|
48318
|
-
const t2 = this.error.split(`
|
|
48319
|
-
`).map((i3, c4) => c4 === 0 ? `${import_picocolors2.default.yellow(o)} ${import_picocolors2.default.yellow(i3)}` : ` ${i3}`).join(`
|
|
48320
|
-
`);
|
|
48321
|
-
return s2 + import_picocolors2.default.yellow(a2) + " " + this.options.map((i3, c4) => {
|
|
48322
|
-
const l3 = this.value.includes(i3.value), $6 = c4 === this.cursor;
|
|
48323
|
-
return $6 && l3 ? n2(i3, "active-selected") : l3 ? n2(i3, "selected") : n2(i3, $6 ? "active" : "inactive");
|
|
48324
|
-
}).join(`
|
|
48325
|
-
${import_picocolors2.default.yellow(a2)} `) + `
|
|
48326
|
-
` + t2 + `
|
|
48327
|
-
`;
|
|
48328
|
-
}
|
|
48329
|
-
default:
|
|
48330
|
-
return `${s2}${import_picocolors2.default.cyan(a2)} ${this.options.map((t2, i3) => {
|
|
48331
|
-
const c4 = this.value.includes(t2.value), l3 = i3 === this.cursor;
|
|
48332
|
-
return l3 && c4 ? n2(t2, "active-selected") : c4 ? n2(t2, "selected") : n2(t2, l3 ? "active" : "inactive");
|
|
48333
|
-
}).join(`
|
|
48334
|
-
${import_picocolors2.default.cyan(a2)} `)}
|
|
48335
|
-
${import_picocolors2.default.cyan(o)}
|
|
48336
|
-
`;
|
|
48337
|
-
}
|
|
48338
|
-
} }).prompt();
|
|
48339
|
-
};
|
|
48340
|
-
var b5 = (r3) => r3.replace(ue(), "");
|
|
48341
|
-
var ie = (r3 = "", n2 = "") => {
|
|
48342
|
-
const s2 = `
|
|
48343
|
-
${r3}
|
|
48344
|
-
`.split(`
|
|
48345
|
-
`), t2 = Math.max(s2.reduce((c4, l3) => (l3 = b5(l3), l3.length > c4 ? l3.length : c4), 0), b5(n2).length) + 2, i3 = s2.map((c4) => `${import_picocolors2.default.gray(a2)} ${import_picocolors2.default.dim(c4)}${" ".repeat(t2 - b5(c4).length)}${import_picocolors2.default.gray(a2)}`).join(`
|
|
48346
|
-
`);
|
|
48347
|
-
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48348
|
-
${import_picocolors2.default.green(f2)} ${import_picocolors2.default.reset(n2)} ${import_picocolors2.default.gray(R5.repeat(Math.max(t2 - n2.length - 1, 1)) + G4)}
|
|
48349
|
-
${i3}
|
|
48350
|
-
${import_picocolors2.default.gray(H3 + R5.repeat(t2 + 2) + K4)}
|
|
48351
|
-
`);
|
|
48352
|
-
};
|
|
48353
|
-
var ae = (r3 = "") => {
|
|
48354
|
-
process.stdout.write(`${import_picocolors2.default.gray(L5)} ${r3}
|
|
48355
|
-
`);
|
|
48356
|
-
};
|
|
48357
|
-
var ce = (r3 = "") => {
|
|
48358
|
-
process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48359
|
-
${import_picocolors2.default.gray(o)} ${r3}
|
|
48360
|
-
|
|
48361
|
-
`);
|
|
48362
|
-
};
|
|
48363
|
-
var C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"];
|
|
48364
|
-
var le = () => {
|
|
48365
|
-
let r3, n2;
|
|
48366
|
-
const s2 = p2 ? 80 : 120;
|
|
48367
|
-
return { start(t2 = "") {
|
|
48368
|
-
t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48369
|
-
${import_picocolors2.default.magenta("\u25CB")} ${t2}
|
|
48370
|
-
`);
|
|
48371
|
-
let i3 = 0, c4 = 0;
|
|
48372
|
-
n2 = setInterval(() => {
|
|
48373
|
-
let l3 = C3[i3];
|
|
48374
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors2.default.magenta(l3)} ${t2}${Math.floor(c4) >= 1 ? ".".repeat(Math.floor(c4)).slice(0, 3) : ""}
|
|
48375
|
-
`), i3 = i3 === C3.length - 1 ? 0 : i3 + 1, c4 = c4 === C3.length ? 0 : c4 + 0.125;
|
|
48376
|
-
}, s2);
|
|
48377
|
-
}, stop(t2 = "") {
|
|
48378
|
-
process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n2), process.stdout.write(`${import_picocolors2.default.gray(a2)}
|
|
48379
|
-
${import_picocolors2.default.green(f2)} ${t2}
|
|
48380
|
-
`), r3();
|
|
48381
|
-
} };
|
|
48382
|
-
};
|
|
48383
|
-
function ue() {
|
|
48384
|
-
const r3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
48385
|
-
return new RegExp(r3, "g");
|
|
48386
|
-
}
|
|
48623
|
+
// src/commands/commit.ts
|
|
48624
|
+
init_dist2();
|
|
48387
48625
|
|
|
48388
48626
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
48389
48627
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -50016,7 +50254,11 @@ function create$(options) {
|
|
|
50016
50254
|
}
|
|
50017
50255
|
var $4 = create$();
|
|
50018
50256
|
|
|
50257
|
+
// src/generateCommitMessageFromGitDiff.ts
|
|
50258
|
+
init_dist2();
|
|
50259
|
+
|
|
50019
50260
|
// src/commands/config.ts
|
|
50261
|
+
init_dist2();
|
|
50020
50262
|
var dotenv = __toESM(require_main(), 1);
|
|
50021
50263
|
var import_fs = require("fs");
|
|
50022
50264
|
var import_ini = __toESM(require_ini(), 1);
|
|
@@ -50294,26 +50536,26 @@ function getI18nLocal(value) {
|
|
|
50294
50536
|
}
|
|
50295
50537
|
|
|
50296
50538
|
// src/commands/config.ts
|
|
50297
|
-
var CONFIG_KEYS = /* @__PURE__ */ ((
|
|
50298
|
-
|
|
50299
|
-
|
|
50300
|
-
|
|
50301
|
-
|
|
50302
|
-
|
|
50303
|
-
|
|
50304
|
-
|
|
50305
|
-
|
|
50306
|
-
|
|
50307
|
-
|
|
50308
|
-
|
|
50309
|
-
|
|
50310
|
-
|
|
50311
|
-
|
|
50312
|
-
|
|
50313
|
-
|
|
50314
|
-
|
|
50315
|
-
|
|
50316
|
-
return
|
|
50539
|
+
var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS3) => {
|
|
50540
|
+
CONFIG_KEYS3["OCO_API_KEY"] = "OCO_API_KEY";
|
|
50541
|
+
CONFIG_KEYS3["OCO_TOKENS_MAX_INPUT"] = "OCO_TOKENS_MAX_INPUT";
|
|
50542
|
+
CONFIG_KEYS3["OCO_TOKENS_MAX_OUTPUT"] = "OCO_TOKENS_MAX_OUTPUT";
|
|
50543
|
+
CONFIG_KEYS3["OCO_DESCRIPTION"] = "OCO_DESCRIPTION";
|
|
50544
|
+
CONFIG_KEYS3["OCO_EMOJI"] = "OCO_EMOJI";
|
|
50545
|
+
CONFIG_KEYS3["OCO_MODEL"] = "OCO_MODEL";
|
|
50546
|
+
CONFIG_KEYS3["OCO_LANGUAGE"] = "OCO_LANGUAGE";
|
|
50547
|
+
CONFIG_KEYS3["OCO_WHY"] = "OCO_WHY";
|
|
50548
|
+
CONFIG_KEYS3["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER";
|
|
50549
|
+
CONFIG_KEYS3["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE";
|
|
50550
|
+
CONFIG_KEYS3["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER";
|
|
50551
|
+
CONFIG_KEYS3["OCO_ONE_LINE_COMMIT"] = "OCO_ONE_LINE_COMMIT";
|
|
50552
|
+
CONFIG_KEYS3["OCO_TEST_MOCK_TYPE"] = "OCO_TEST_MOCK_TYPE";
|
|
50553
|
+
CONFIG_KEYS3["OCO_API_URL"] = "OCO_API_URL";
|
|
50554
|
+
CONFIG_KEYS3["OCO_API_CUSTOM_HEADERS"] = "OCO_API_CUSTOM_HEADERS";
|
|
50555
|
+
CONFIG_KEYS3["OCO_OMIT_SCOPE"] = "OCO_OMIT_SCOPE";
|
|
50556
|
+
CONFIG_KEYS3["OCO_GITPUSH"] = "OCO_GITPUSH";
|
|
50557
|
+
CONFIG_KEYS3["OCO_HOOK_AUTO_UNCOMMENT"] = "OCO_HOOK_AUTO_UNCOMMENT";
|
|
50558
|
+
return CONFIG_KEYS3;
|
|
50317
50559
|
})(CONFIG_KEYS || {});
|
|
50318
50560
|
var MODEL_LIST = {
|
|
50319
50561
|
openai: [
|
|
@@ -50345,10 +50587,11 @@ var MODEL_LIST = {
|
|
|
50345
50587
|
"gpt-4o-mini-2024-07-18"
|
|
50346
50588
|
],
|
|
50347
50589
|
anthropic: [
|
|
50348
|
-
"claude-
|
|
50349
|
-
"claude-
|
|
50350
|
-
"claude-3-sonnet-
|
|
50351
|
-
"claude-3-
|
|
50590
|
+
"claude-sonnet-4-20250514",
|
|
50591
|
+
"claude-opus-4-20250514",
|
|
50592
|
+
"claude-3-7-sonnet-20250219",
|
|
50593
|
+
"claude-3-5-sonnet-20241022",
|
|
50594
|
+
"claude-3-5-haiku-20241022"
|
|
50352
50595
|
],
|
|
50353
50596
|
gemini: [
|
|
50354
50597
|
"gemini-1.5-flash",
|
|
@@ -51082,6 +51325,31 @@ var OCO_AI_PROVIDER_ENUM = /* @__PURE__ */ ((OCO_AI_PROVIDER_ENUM2) => {
|
|
|
51082
51325
|
OCO_AI_PROVIDER_ENUM2["OPENROUTER"] = "openrouter";
|
|
51083
51326
|
return OCO_AI_PROVIDER_ENUM2;
|
|
51084
51327
|
})(OCO_AI_PROVIDER_ENUM || {});
|
|
51328
|
+
var PROVIDER_API_KEY_URLS = {
|
|
51329
|
+
["openai" /* OPENAI */]: "https://platform.openai.com/api-keys",
|
|
51330
|
+
["anthropic" /* ANTHROPIC */]: "https://console.anthropic.com/settings/keys",
|
|
51331
|
+
["gemini" /* GEMINI */]: "https://aistudio.google.com/app/apikey",
|
|
51332
|
+
["groq" /* GROQ */]: "https://console.groq.com/keys",
|
|
51333
|
+
["mistral" /* MISTRAL */]: "https://console.mistral.ai/api-keys/",
|
|
51334
|
+
["deepseek" /* DEEPSEEK */]: "https://platform.deepseek.com/api_keys",
|
|
51335
|
+
["openrouter" /* OPENROUTER */]: "https://openrouter.ai/keys",
|
|
51336
|
+
["aimlapi" /* AIMLAPI */]: "https://aimlapi.com/app/keys",
|
|
51337
|
+
["azure" /* AZURE */]: "https://portal.azure.com/",
|
|
51338
|
+
["ollama" /* OLLAMA */]: null,
|
|
51339
|
+
["mlx" /* MLX */]: null,
|
|
51340
|
+
["flowise" /* FLOWISE */]: null,
|
|
51341
|
+
["test" /* TEST */]: null
|
|
51342
|
+
};
|
|
51343
|
+
var RECOMMENDED_MODELS = {
|
|
51344
|
+
["openai" /* OPENAI */]: "gpt-4o-mini",
|
|
51345
|
+
["anthropic" /* ANTHROPIC */]: "claude-sonnet-4-20250514",
|
|
51346
|
+
["gemini" /* GEMINI */]: "gemini-1.5-flash",
|
|
51347
|
+
["groq" /* GROQ */]: "llama3-70b-8192",
|
|
51348
|
+
["mistral" /* MISTRAL */]: "mistral-small-latest",
|
|
51349
|
+
["deepseek" /* DEEPSEEK */]: "deepseek-chat",
|
|
51350
|
+
["openrouter" /* OPENROUTER */]: "openai/gpt-4o-mini",
|
|
51351
|
+
["aimlapi" /* AIMLAPI */]: "gpt-4o-mini"
|
|
51352
|
+
};
|
|
51085
51353
|
var defaultConfigPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit");
|
|
51086
51354
|
var defaultEnvPath = (0, import_path.resolve)(process.cwd(), ".env");
|
|
51087
51355
|
var OCO_PROMPT_MODULE_ENUM = /* @__PURE__ */ ((OCO_PROMPT_MODULE_ENUM2) => {
|
|
@@ -51433,6 +51701,12 @@ var configCommand = G3(
|
|
|
51433
51701
|
}
|
|
51434
51702
|
);
|
|
51435
51703
|
|
|
51704
|
+
// src/prompts.ts
|
|
51705
|
+
init_dist2();
|
|
51706
|
+
|
|
51707
|
+
// src/modules/commitlint/config.ts
|
|
51708
|
+
init_dist2();
|
|
51709
|
+
|
|
51436
51710
|
// node_modules/@anthropic-ai/sdk/version.mjs
|
|
51437
51711
|
var VERSION = "0.19.2";
|
|
51438
51712
|
|
|
@@ -56946,6 +57220,389 @@ var {
|
|
|
56946
57220
|
mergeConfig: mergeConfig2
|
|
56947
57221
|
} = axios_default;
|
|
56948
57222
|
|
|
57223
|
+
// src/utils/errors.ts
|
|
57224
|
+
var PROVIDER_BILLING_URLS = {
|
|
57225
|
+
["anthropic" /* ANTHROPIC */]: "https://console.anthropic.com/settings/billing",
|
|
57226
|
+
["openai" /* OPENAI */]: "https://platform.openai.com/settings/organization/billing",
|
|
57227
|
+
["gemini" /* GEMINI */]: "https://aistudio.google.com/app/plan",
|
|
57228
|
+
["groq" /* GROQ */]: "https://console.groq.com/settings/billing",
|
|
57229
|
+
["mistral" /* MISTRAL */]: "https://console.mistral.ai/billing/",
|
|
57230
|
+
["deepseek" /* DEEPSEEK */]: "https://platform.deepseek.com/usage",
|
|
57231
|
+
["openrouter" /* OPENROUTER */]: "https://openrouter.ai/credits",
|
|
57232
|
+
["aimlapi" /* AIMLAPI */]: "https://aimlapi.com/app/billing",
|
|
57233
|
+
["azure" /* AZURE */]: "https://portal.azure.com/#view/Microsoft_Azure_CostManagement",
|
|
57234
|
+
["ollama" /* OLLAMA */]: null,
|
|
57235
|
+
["mlx" /* MLX */]: null,
|
|
57236
|
+
["flowise" /* FLOWISE */]: null,
|
|
57237
|
+
["test" /* TEST */]: null
|
|
57238
|
+
};
|
|
57239
|
+
var InsufficientCreditsError = class extends Error {
|
|
57240
|
+
constructor(provider, message) {
|
|
57241
|
+
super(message || `Insufficient credits or quota for provider '${provider}'`);
|
|
57242
|
+
this.name = "InsufficientCreditsError";
|
|
57243
|
+
this.provider = provider;
|
|
57244
|
+
}
|
|
57245
|
+
};
|
|
57246
|
+
var RateLimitError3 = class extends Error {
|
|
57247
|
+
constructor(provider, retryAfter, message) {
|
|
57248
|
+
super(message || `Rate limit exceeded for provider '${provider}'`);
|
|
57249
|
+
this.name = "RateLimitError";
|
|
57250
|
+
this.provider = provider;
|
|
57251
|
+
this.retryAfter = retryAfter;
|
|
57252
|
+
}
|
|
57253
|
+
};
|
|
57254
|
+
var ServiceUnavailableError = class extends Error {
|
|
57255
|
+
constructor(provider, statusCode = 503, message) {
|
|
57256
|
+
super(message || `Service unavailable for provider '${provider}'`);
|
|
57257
|
+
this.name = "ServiceUnavailableError";
|
|
57258
|
+
this.provider = provider;
|
|
57259
|
+
this.statusCode = statusCode;
|
|
57260
|
+
}
|
|
57261
|
+
};
|
|
57262
|
+
var AuthenticationError3 = class extends Error {
|
|
57263
|
+
constructor(provider, message) {
|
|
57264
|
+
super(message || `Authentication failed for provider '${provider}'`);
|
|
57265
|
+
this.name = "AuthenticationError";
|
|
57266
|
+
this.provider = provider;
|
|
57267
|
+
}
|
|
57268
|
+
};
|
|
57269
|
+
var ModelNotFoundError = class extends Error {
|
|
57270
|
+
constructor(modelName, provider, statusCode = 404) {
|
|
57271
|
+
super(`Model '${modelName}' not found for provider '${provider}'`);
|
|
57272
|
+
this.name = "ModelNotFoundError";
|
|
57273
|
+
this.modelName = modelName;
|
|
57274
|
+
this.provider = provider;
|
|
57275
|
+
this.statusCode = statusCode;
|
|
57276
|
+
}
|
|
57277
|
+
};
|
|
57278
|
+
var ApiKeyMissingError = class extends Error {
|
|
57279
|
+
constructor(provider) {
|
|
57280
|
+
super(`API key is missing for provider '${provider}'`);
|
|
57281
|
+
this.name = "ApiKeyMissingError";
|
|
57282
|
+
this.provider = provider;
|
|
57283
|
+
}
|
|
57284
|
+
};
|
|
57285
|
+
function isModelNotFoundError(error) {
|
|
57286
|
+
if (error instanceof ModelNotFoundError) {
|
|
57287
|
+
return true;
|
|
57288
|
+
}
|
|
57289
|
+
if (error instanceof Error) {
|
|
57290
|
+
const message = error.message.toLowerCase();
|
|
57291
|
+
if (message.includes("model") && (message.includes("not found") || message.includes("does not exist") || message.includes("invalid model"))) {
|
|
57292
|
+
return true;
|
|
57293
|
+
}
|
|
57294
|
+
if (message.includes("model") && (message.includes("not found") || message.includes("invalid"))) {
|
|
57295
|
+
return true;
|
|
57296
|
+
}
|
|
57297
|
+
if ("status" in error && error.status === 404 && message.includes("model")) {
|
|
57298
|
+
return true;
|
|
57299
|
+
}
|
|
57300
|
+
if ("response" in error) {
|
|
57301
|
+
const response = error.response;
|
|
57302
|
+
if (response?.status === 404) {
|
|
57303
|
+
return true;
|
|
57304
|
+
}
|
|
57305
|
+
}
|
|
57306
|
+
}
|
|
57307
|
+
return false;
|
|
57308
|
+
}
|
|
57309
|
+
function isApiKeyError(error) {
|
|
57310
|
+
if (error instanceof ApiKeyMissingError) {
|
|
57311
|
+
return true;
|
|
57312
|
+
}
|
|
57313
|
+
if (error instanceof Error) {
|
|
57314
|
+
const message = error.message.toLowerCase();
|
|
57315
|
+
if (message.includes("api key") || message.includes("apikey") || message.includes("authentication") || message.includes("unauthorized") || message.includes("invalid_api_key") || message.includes("incorrect api key")) {
|
|
57316
|
+
return true;
|
|
57317
|
+
}
|
|
57318
|
+
if ("response" in error) {
|
|
57319
|
+
const response = error.response;
|
|
57320
|
+
if (response?.status === 401) {
|
|
57321
|
+
return true;
|
|
57322
|
+
}
|
|
57323
|
+
}
|
|
57324
|
+
}
|
|
57325
|
+
return false;
|
|
57326
|
+
}
|
|
57327
|
+
function getSuggestedModels(provider, failedModel) {
|
|
57328
|
+
const providerKey = provider.toLowerCase();
|
|
57329
|
+
const models = MODEL_LIST[providerKey];
|
|
57330
|
+
if (!models || !Array.isArray(models)) {
|
|
57331
|
+
return [];
|
|
57332
|
+
}
|
|
57333
|
+
return models.filter((m5) => m5 !== failedModel).slice(0, 5);
|
|
57334
|
+
}
|
|
57335
|
+
function isInsufficientCreditsError(error) {
|
|
57336
|
+
if (error instanceof InsufficientCreditsError) {
|
|
57337
|
+
return true;
|
|
57338
|
+
}
|
|
57339
|
+
if (error instanceof Error) {
|
|
57340
|
+
const message = error.message.toLowerCase();
|
|
57341
|
+
if (message.includes("insufficient") || message.includes("credit") || message.includes("quota") || message.includes("balance") || message.includes("billing") || message.includes("payment") || message.includes("exceeded") || message.includes("limit reached") || message.includes("no remaining")) {
|
|
57342
|
+
return true;
|
|
57343
|
+
}
|
|
57344
|
+
if ("status" in error && error.status === 402) {
|
|
57345
|
+
return true;
|
|
57346
|
+
}
|
|
57347
|
+
if ("response" in error) {
|
|
57348
|
+
const response = error.response;
|
|
57349
|
+
if (response?.status === 402) {
|
|
57350
|
+
return true;
|
|
57351
|
+
}
|
|
57352
|
+
}
|
|
57353
|
+
}
|
|
57354
|
+
return false;
|
|
57355
|
+
}
|
|
57356
|
+
function isRateLimitError(error) {
|
|
57357
|
+
if (error instanceof RateLimitError3) {
|
|
57358
|
+
return true;
|
|
57359
|
+
}
|
|
57360
|
+
if (error instanceof Error) {
|
|
57361
|
+
const message = error.message.toLowerCase();
|
|
57362
|
+
if (message.includes("rate limit") || message.includes("rate_limit") || message.includes("too many requests") || message.includes("throttle")) {
|
|
57363
|
+
return true;
|
|
57364
|
+
}
|
|
57365
|
+
if ("status" in error && error.status === 429) {
|
|
57366
|
+
return true;
|
|
57367
|
+
}
|
|
57368
|
+
if ("response" in error) {
|
|
57369
|
+
const response = error.response;
|
|
57370
|
+
if (response?.status === 429) {
|
|
57371
|
+
return true;
|
|
57372
|
+
}
|
|
57373
|
+
}
|
|
57374
|
+
}
|
|
57375
|
+
return false;
|
|
57376
|
+
}
|
|
57377
|
+
function isServiceUnavailableError(error) {
|
|
57378
|
+
if (error instanceof ServiceUnavailableError) {
|
|
57379
|
+
return true;
|
|
57380
|
+
}
|
|
57381
|
+
if (error instanceof Error) {
|
|
57382
|
+
const message = error.message.toLowerCase();
|
|
57383
|
+
if (message.includes("service unavailable") || message.includes("server error") || message.includes("internal error") || message.includes("temporarily unavailable") || message.includes("overloaded")) {
|
|
57384
|
+
return true;
|
|
57385
|
+
}
|
|
57386
|
+
const status = error.status || error.response?.status;
|
|
57387
|
+
if (status && status >= 500 && status < 600) {
|
|
57388
|
+
return true;
|
|
57389
|
+
}
|
|
57390
|
+
}
|
|
57391
|
+
return false;
|
|
57392
|
+
}
|
|
57393
|
+
function formatUserFriendlyError(error, provider) {
|
|
57394
|
+
const billingUrl = PROVIDER_BILLING_URLS[provider] || null;
|
|
57395
|
+
if (error instanceof InsufficientCreditsError) {
|
|
57396
|
+
return {
|
|
57397
|
+
title: "Insufficient Credits",
|
|
57398
|
+
message: `Your ${provider} account has insufficient credits or quota.`,
|
|
57399
|
+
helpUrl: billingUrl,
|
|
57400
|
+
suggestion: "Add credits to your account to continue using the service."
|
|
57401
|
+
};
|
|
57402
|
+
}
|
|
57403
|
+
if (error instanceof RateLimitError3) {
|
|
57404
|
+
const retryMsg = error.retryAfter ? `Please wait ${error.retryAfter} seconds before retrying.` : "Please wait a moment before retrying.";
|
|
57405
|
+
return {
|
|
57406
|
+
title: "Rate Limit Exceeded",
|
|
57407
|
+
message: `You've made too many requests to ${provider}.`,
|
|
57408
|
+
helpUrl: billingUrl,
|
|
57409
|
+
suggestion: retryMsg
|
|
57410
|
+
};
|
|
57411
|
+
}
|
|
57412
|
+
if (error instanceof ServiceUnavailableError) {
|
|
57413
|
+
return {
|
|
57414
|
+
title: "Service Unavailable",
|
|
57415
|
+
message: `The ${provider} service is temporarily unavailable.`,
|
|
57416
|
+
helpUrl: null,
|
|
57417
|
+
suggestion: "Please try again in a few moments."
|
|
57418
|
+
};
|
|
57419
|
+
}
|
|
57420
|
+
if (error instanceof AuthenticationError3) {
|
|
57421
|
+
return {
|
|
57422
|
+
title: "Authentication Failed",
|
|
57423
|
+
message: `Your ${provider} API key is invalid or expired.`,
|
|
57424
|
+
helpUrl: billingUrl,
|
|
57425
|
+
suggestion: "Run `oco setup` to configure a valid API key."
|
|
57426
|
+
};
|
|
57427
|
+
}
|
|
57428
|
+
if (error instanceof ModelNotFoundError) {
|
|
57429
|
+
return {
|
|
57430
|
+
title: "Model Not Found",
|
|
57431
|
+
message: `The model '${error.modelName}' is not available for ${provider}.`,
|
|
57432
|
+
helpUrl: null,
|
|
57433
|
+
suggestion: "Run `oco setup` to select a valid model."
|
|
57434
|
+
};
|
|
57435
|
+
}
|
|
57436
|
+
if (isInsufficientCreditsError(error)) {
|
|
57437
|
+
return {
|
|
57438
|
+
title: "Insufficient Credits",
|
|
57439
|
+
message: `Your ${provider} account has insufficient credits or quota.`,
|
|
57440
|
+
helpUrl: billingUrl,
|
|
57441
|
+
suggestion: "Add credits to your account to continue using the service."
|
|
57442
|
+
};
|
|
57443
|
+
}
|
|
57444
|
+
if (isRateLimitError(error)) {
|
|
57445
|
+
return {
|
|
57446
|
+
title: "Rate Limit Exceeded",
|
|
57447
|
+
message: `You've made too many requests to ${provider}.`,
|
|
57448
|
+
helpUrl: billingUrl,
|
|
57449
|
+
suggestion: "Please wait a moment before retrying."
|
|
57450
|
+
};
|
|
57451
|
+
}
|
|
57452
|
+
if (isServiceUnavailableError(error)) {
|
|
57453
|
+
return {
|
|
57454
|
+
title: "Service Unavailable",
|
|
57455
|
+
message: `The ${provider} service is temporarily unavailable.`,
|
|
57456
|
+
helpUrl: null,
|
|
57457
|
+
suggestion: "Please try again in a few moments."
|
|
57458
|
+
};
|
|
57459
|
+
}
|
|
57460
|
+
if (isApiKeyError(error)) {
|
|
57461
|
+
return {
|
|
57462
|
+
title: "Authentication Failed",
|
|
57463
|
+
message: `Your ${provider} API key is invalid or expired.`,
|
|
57464
|
+
helpUrl: billingUrl,
|
|
57465
|
+
suggestion: "Run `oco setup` to configure a valid API key."
|
|
57466
|
+
};
|
|
57467
|
+
}
|
|
57468
|
+
if (isModelNotFoundError(error)) {
|
|
57469
|
+
const model = error.modelName || error.model || "unknown";
|
|
57470
|
+
return {
|
|
57471
|
+
title: "Model Not Found",
|
|
57472
|
+
message: `The model '${model}' is not available for ${provider}.`,
|
|
57473
|
+
helpUrl: null,
|
|
57474
|
+
suggestion: "Run `oco setup` to select a valid model."
|
|
57475
|
+
};
|
|
57476
|
+
}
|
|
57477
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
57478
|
+
return {
|
|
57479
|
+
title: "Error",
|
|
57480
|
+
message: errorMessage,
|
|
57481
|
+
helpUrl: null,
|
|
57482
|
+
suggestion: "Run `oco setup` to reconfigure or check your settings."
|
|
57483
|
+
};
|
|
57484
|
+
}
|
|
57485
|
+
function printFormattedError(formatted) {
|
|
57486
|
+
let output = `
|
|
57487
|
+
${source_default.red("\u2716")} ${source_default.bold.red(formatted.title)}
|
|
57488
|
+
`;
|
|
57489
|
+
output += ` ${formatted.message}
|
|
57490
|
+
`;
|
|
57491
|
+
if (formatted.helpUrl) {
|
|
57492
|
+
output += `
|
|
57493
|
+
${source_default.cyan("Help:")} ${source_default.underline(formatted.helpUrl)}
|
|
57494
|
+
`;
|
|
57495
|
+
}
|
|
57496
|
+
if (formatted.suggestion) {
|
|
57497
|
+
output += `
|
|
57498
|
+
${source_default.yellow("Suggestion:")} ${formatted.suggestion}
|
|
57499
|
+
`;
|
|
57500
|
+
}
|
|
57501
|
+
return output;
|
|
57502
|
+
}
|
|
57503
|
+
|
|
57504
|
+
// src/utils/engineErrorHandler.ts
|
|
57505
|
+
function getStatusCode(error) {
|
|
57506
|
+
if (typeof error?.status === "number") {
|
|
57507
|
+
return error.status;
|
|
57508
|
+
}
|
|
57509
|
+
if (axios_default.isAxiosError(error)) {
|
|
57510
|
+
return error.response?.status ?? null;
|
|
57511
|
+
}
|
|
57512
|
+
if (typeof error?.response?.status === "number") {
|
|
57513
|
+
return error.response.status;
|
|
57514
|
+
}
|
|
57515
|
+
return null;
|
|
57516
|
+
}
|
|
57517
|
+
function getRetryAfter(error) {
|
|
57518
|
+
const headers = error?.response?.headers;
|
|
57519
|
+
if (headers) {
|
|
57520
|
+
const retryAfter = headers["retry-after"] || headers["Retry-After"];
|
|
57521
|
+
if (retryAfter) {
|
|
57522
|
+
const seconds = parseInt(retryAfter, 10);
|
|
57523
|
+
if (!isNaN(seconds)) {
|
|
57524
|
+
return seconds;
|
|
57525
|
+
}
|
|
57526
|
+
}
|
|
57527
|
+
}
|
|
57528
|
+
return void 0;
|
|
57529
|
+
}
|
|
57530
|
+
function extractErrorMessage(error) {
|
|
57531
|
+
if (error instanceof Error) {
|
|
57532
|
+
return error.message;
|
|
57533
|
+
}
|
|
57534
|
+
const apiError = error?.response?.data?.error;
|
|
57535
|
+
if (apiError) {
|
|
57536
|
+
if (typeof apiError === "string") {
|
|
57537
|
+
return apiError;
|
|
57538
|
+
}
|
|
57539
|
+
if (apiError.message) {
|
|
57540
|
+
return apiError.message;
|
|
57541
|
+
}
|
|
57542
|
+
}
|
|
57543
|
+
const errorData = error?.error;
|
|
57544
|
+
if (errorData) {
|
|
57545
|
+
if (typeof errorData === "string") {
|
|
57546
|
+
return errorData;
|
|
57547
|
+
}
|
|
57548
|
+
if (errorData.message) {
|
|
57549
|
+
return errorData.message;
|
|
57550
|
+
}
|
|
57551
|
+
}
|
|
57552
|
+
if (typeof error === "string") {
|
|
57553
|
+
return error;
|
|
57554
|
+
}
|
|
57555
|
+
return "An unknown error occurred";
|
|
57556
|
+
}
|
|
57557
|
+
function isModelNotFoundMessage(message) {
|
|
57558
|
+
const lowerMessage = message.toLowerCase();
|
|
57559
|
+
return lowerMessage.includes("model") && (lowerMessage.includes("not found") || lowerMessage.includes("does not exist") || lowerMessage.includes("invalid") || lowerMessage.includes("pull")) || lowerMessage.includes("does_not_exist");
|
|
57560
|
+
}
|
|
57561
|
+
function isInsufficientCreditsMessage(message) {
|
|
57562
|
+
const lowerMessage = message.toLowerCase();
|
|
57563
|
+
return lowerMessage.includes("insufficient") || lowerMessage.includes("credit") || lowerMessage.includes("quota") || lowerMessage.includes("balance too low") || lowerMessage.includes("billing") || lowerMessage.includes("payment required") || lowerMessage.includes("exceeded");
|
|
57564
|
+
}
|
|
57565
|
+
function normalizeEngineError(error, provider, model) {
|
|
57566
|
+
if (error instanceof ModelNotFoundError || error instanceof AuthenticationError3 || error instanceof InsufficientCreditsError || error instanceof RateLimitError3 || error instanceof ServiceUnavailableError) {
|
|
57567
|
+
return error;
|
|
57568
|
+
}
|
|
57569
|
+
const statusCode = getStatusCode(error);
|
|
57570
|
+
const message = extractErrorMessage(error);
|
|
57571
|
+
switch (statusCode) {
|
|
57572
|
+
case 401:
|
|
57573
|
+
return new AuthenticationError3(provider, message);
|
|
57574
|
+
case 402:
|
|
57575
|
+
return new InsufficientCreditsError(provider, message);
|
|
57576
|
+
case 404:
|
|
57577
|
+
if (isModelNotFoundMessage(message)) {
|
|
57578
|
+
return new ModelNotFoundError(model, provider, 404);
|
|
57579
|
+
}
|
|
57580
|
+
return error instanceof Error ? error : new Error(message);
|
|
57581
|
+
case 429:
|
|
57582
|
+
const retryAfter = getRetryAfter(error);
|
|
57583
|
+
return new RateLimitError3(provider, retryAfter, message);
|
|
57584
|
+
case 500:
|
|
57585
|
+
case 502:
|
|
57586
|
+
case 503:
|
|
57587
|
+
case 504:
|
|
57588
|
+
return new ServiceUnavailableError(provider, statusCode, message);
|
|
57589
|
+
}
|
|
57590
|
+
if (isModelNotFoundMessage(message)) {
|
|
57591
|
+
return new ModelNotFoundError(model, provider, 404);
|
|
57592
|
+
}
|
|
57593
|
+
if (isInsufficientCreditsMessage(message)) {
|
|
57594
|
+
return new InsufficientCreditsError(provider, message);
|
|
57595
|
+
}
|
|
57596
|
+
const lowerMessage = message.toLowerCase();
|
|
57597
|
+
if (lowerMessage.includes("rate limit") || lowerMessage.includes("rate_limit") || lowerMessage.includes("too many requests")) {
|
|
57598
|
+
return new RateLimitError3(provider, void 0, message);
|
|
57599
|
+
}
|
|
57600
|
+
if (lowerMessage.includes("unauthorized") || lowerMessage.includes("api key") || lowerMessage.includes("apikey") || lowerMessage.includes("authentication") || lowerMessage.includes("invalid_api_key")) {
|
|
57601
|
+
return new AuthenticationError3(provider, message);
|
|
57602
|
+
}
|
|
57603
|
+
return error instanceof Error ? error : new Error(message);
|
|
57604
|
+
}
|
|
57605
|
+
|
|
56949
57606
|
// src/utils/removeContentTags.ts
|
|
56950
57607
|
function removeContentTags(content, tag) {
|
|
56951
57608
|
if (!content || typeof content !== "string") {
|
|
@@ -57022,16 +57679,7 @@ var AnthropicEngine = class {
|
|
|
57022
57679
|
let content = message;
|
|
57023
57680
|
return removeContentTags(content, "think");
|
|
57024
57681
|
} catch (error) {
|
|
57025
|
-
|
|
57026
|
-
ce(`${source_default.red("\u2716")} ${err?.message || err}`);
|
|
57027
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
57028
|
-
const anthropicAiError = error.response.data.error;
|
|
57029
|
-
if (anthropicAiError?.message) ce(anthropicAiError.message);
|
|
57030
|
-
ce(
|
|
57031
|
-
"For help look into README https://github.com/di-sukharev/opencommit#setup"
|
|
57032
|
-
);
|
|
57033
|
-
}
|
|
57034
|
-
throw err;
|
|
57682
|
+
throw normalizeEngineError(error, "anthropic", this.config.model);
|
|
57035
57683
|
}
|
|
57036
57684
|
};
|
|
57037
57685
|
this.config = config7;
|
|
@@ -57180,12 +57828,12 @@ function __await(v5) {
|
|
|
57180
57828
|
}
|
|
57181
57829
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
57182
57830
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
57183
|
-
var
|
|
57831
|
+
var g5 = generator.apply(thisArg, _arguments || []), i3, q6 = [];
|
|
57184
57832
|
return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
|
|
57185
57833
|
return this;
|
|
57186
57834
|
}, i3;
|
|
57187
57835
|
function verb(n2) {
|
|
57188
|
-
if (
|
|
57836
|
+
if (g5[n2]) i3[n2] = function(v5) {
|
|
57189
57837
|
return new Promise(function(a4, b7) {
|
|
57190
57838
|
q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5);
|
|
57191
57839
|
});
|
|
@@ -57193,7 +57841,7 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
57193
57841
|
}
|
|
57194
57842
|
function resume(n2, v5) {
|
|
57195
57843
|
try {
|
|
57196
|
-
step(
|
|
57844
|
+
step(g5[n2](v5));
|
|
57197
57845
|
} catch (e3) {
|
|
57198
57846
|
settle2(q6[0][3], e3);
|
|
57199
57847
|
}
|
|
@@ -60866,17 +61514,7 @@ var AzureEngine = class {
|
|
|
60866
61514
|
let content = message?.content;
|
|
60867
61515
|
return removeContentTags(content, "think");
|
|
60868
61516
|
} catch (error) {
|
|
60869
|
-
|
|
60870
|
-
const err = error;
|
|
60871
|
-
ce(`${source_default.red("\u2716")} ${JSON.stringify(error)}`);
|
|
60872
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
60873
|
-
const openAiError = error.response.data.error;
|
|
60874
|
-
if (openAiError?.message) ce(openAiError.message);
|
|
60875
|
-
ce(
|
|
60876
|
-
"For help look into README https://github.com/di-sukharev/opencommit#setup"
|
|
60877
|
-
);
|
|
60878
|
-
}
|
|
60879
|
-
throw err;
|
|
61517
|
+
throw normalizeEngineError(error, "azure", this.config.model);
|
|
60880
61518
|
}
|
|
60881
61519
|
};
|
|
60882
61520
|
this.config = config7;
|
|
@@ -60910,9 +61548,8 @@ var FlowiseEngine = class {
|
|
|
60910
61548
|
const message = response.data;
|
|
60911
61549
|
let content = message?.text;
|
|
60912
61550
|
return removeContentTags(content, "think");
|
|
60913
|
-
} catch (
|
|
60914
|
-
|
|
60915
|
-
throw new Error("local model issues. details: " + message);
|
|
61551
|
+
} catch (error) {
|
|
61552
|
+
throw normalizeEngineError(error, "flowise", this.config.model);
|
|
60916
61553
|
}
|
|
60917
61554
|
}
|
|
60918
61555
|
};
|
|
@@ -61227,12 +61864,12 @@ function __await2(v5) {
|
|
|
61227
61864
|
}
|
|
61228
61865
|
function __asyncGenerator2(thisArg, _arguments, generator) {
|
|
61229
61866
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
61230
|
-
var
|
|
61867
|
+
var g5 = generator.apply(thisArg, _arguments || []), i3, q6 = [];
|
|
61231
61868
|
return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() {
|
|
61232
61869
|
return this;
|
|
61233
61870
|
}, i3;
|
|
61234
61871
|
function verb(n2) {
|
|
61235
|
-
if (
|
|
61872
|
+
if (g5[n2]) i3[n2] = function(v5) {
|
|
61236
61873
|
return new Promise(function(a4, b7) {
|
|
61237
61874
|
q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5);
|
|
61238
61875
|
});
|
|
@@ -61240,7 +61877,7 @@ function __asyncGenerator2(thisArg, _arguments, generator) {
|
|
|
61240
61877
|
}
|
|
61241
61878
|
function resume(n2, v5) {
|
|
61242
61879
|
try {
|
|
61243
|
-
step(
|
|
61880
|
+
step(g5[n2](v5));
|
|
61244
61881
|
} catch (e3) {
|
|
61245
61882
|
settle2(q6[0][3], e3);
|
|
61246
61883
|
}
|
|
@@ -61772,12 +62409,7 @@ var GeminiEngine = class {
|
|
|
61772
62409
|
const content = result.response.text();
|
|
61773
62410
|
return removeContentTags(content, "think");
|
|
61774
62411
|
} catch (error) {
|
|
61775
|
-
|
|
61776
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
61777
|
-
const geminiError = error.response.data.error;
|
|
61778
|
-
if (geminiError) throw new Error(geminiError?.message);
|
|
61779
|
-
}
|
|
61780
|
-
throw err;
|
|
62412
|
+
throw normalizeEngineError(error, "gemini", this.config.model);
|
|
61781
62413
|
}
|
|
61782
62414
|
}
|
|
61783
62415
|
};
|
|
@@ -61810,9 +62442,8 @@ var OllamaEngine = class {
|
|
|
61810
62442
|
const { message } = response.data;
|
|
61811
62443
|
let content = message?.content;
|
|
61812
62444
|
return removeContentTags(content, "think");
|
|
61813
|
-
} catch (
|
|
61814
|
-
|
|
61815
|
-
throw new Error(`Ollama provider error: ${message}`);
|
|
62445
|
+
} catch (error) {
|
|
62446
|
+
throw normalizeEngineError(error, "ollama", this.config.model);
|
|
61816
62447
|
}
|
|
61817
62448
|
}
|
|
61818
62449
|
};
|
|
@@ -61824,7 +62455,7 @@ __export(error_exports2, {
|
|
|
61824
62455
|
APIConnectionTimeoutError: () => APIConnectionTimeoutError3,
|
|
61825
62456
|
APIError: () => APIError3,
|
|
61826
62457
|
APIUserAbortError: () => APIUserAbortError3,
|
|
61827
|
-
AuthenticationError: () =>
|
|
62458
|
+
AuthenticationError: () => AuthenticationError4,
|
|
61828
62459
|
BadRequestError: () => BadRequestError3,
|
|
61829
62460
|
ConflictError: () => ConflictError3,
|
|
61830
62461
|
ContentFilterFinishReasonError: () => ContentFilterFinishReasonError,
|
|
@@ -61833,7 +62464,7 @@ __export(error_exports2, {
|
|
|
61833
62464
|
NotFoundError: () => NotFoundError3,
|
|
61834
62465
|
OpenAIError: () => OpenAIError,
|
|
61835
62466
|
PermissionDeniedError: () => PermissionDeniedError3,
|
|
61836
|
-
RateLimitError: () =>
|
|
62467
|
+
RateLimitError: () => RateLimitError4,
|
|
61837
62468
|
UnprocessableEntityError: () => UnprocessableEntityError3
|
|
61838
62469
|
});
|
|
61839
62470
|
|
|
@@ -63105,7 +63736,7 @@ var APIError3 = class _APIError extends OpenAIError {
|
|
|
63105
63736
|
return new BadRequestError3(status, error, message, headers);
|
|
63106
63737
|
}
|
|
63107
63738
|
if (status === 401) {
|
|
63108
|
-
return new
|
|
63739
|
+
return new AuthenticationError4(status, error, message, headers);
|
|
63109
63740
|
}
|
|
63110
63741
|
if (status === 403) {
|
|
63111
63742
|
return new PermissionDeniedError3(status, error, message, headers);
|
|
@@ -63120,7 +63751,7 @@ var APIError3 = class _APIError extends OpenAIError {
|
|
|
63120
63751
|
return new UnprocessableEntityError3(status, error, message, headers);
|
|
63121
63752
|
}
|
|
63122
63753
|
if (status === 429) {
|
|
63123
|
-
return new
|
|
63754
|
+
return new RateLimitError4(status, error, message, headers);
|
|
63124
63755
|
}
|
|
63125
63756
|
if (status >= 500) {
|
|
63126
63757
|
return new InternalServerError3(status, error, message, headers);
|
|
@@ -63153,7 +63784,7 @@ var BadRequestError3 = class extends APIError3 {
|
|
|
63153
63784
|
this.status = 400;
|
|
63154
63785
|
}
|
|
63155
63786
|
};
|
|
63156
|
-
var
|
|
63787
|
+
var AuthenticationError4 = class extends APIError3 {
|
|
63157
63788
|
constructor() {
|
|
63158
63789
|
super(...arguments);
|
|
63159
63790
|
this.status = 401;
|
|
@@ -63183,7 +63814,7 @@ var UnprocessableEntityError3 = class extends APIError3 {
|
|
|
63183
63814
|
this.status = 422;
|
|
63184
63815
|
}
|
|
63185
63816
|
};
|
|
63186
|
-
var
|
|
63817
|
+
var RateLimitError4 = class extends APIError3 {
|
|
63187
63818
|
constructor() {
|
|
63188
63819
|
super(...arguments);
|
|
63189
63820
|
this.status = 429;
|
|
@@ -66492,15 +67123,15 @@ OpenAI.APIConnectionTimeoutError = APIConnectionTimeoutError3;
|
|
|
66492
67123
|
OpenAI.APIUserAbortError = APIUserAbortError3;
|
|
66493
67124
|
OpenAI.NotFoundError = NotFoundError3;
|
|
66494
67125
|
OpenAI.ConflictError = ConflictError3;
|
|
66495
|
-
OpenAI.RateLimitError =
|
|
67126
|
+
OpenAI.RateLimitError = RateLimitError4;
|
|
66496
67127
|
OpenAI.BadRequestError = BadRequestError3;
|
|
66497
|
-
OpenAI.AuthenticationError =
|
|
67128
|
+
OpenAI.AuthenticationError = AuthenticationError4;
|
|
66498
67129
|
OpenAI.InternalServerError = InternalServerError3;
|
|
66499
67130
|
OpenAI.PermissionDeniedError = PermissionDeniedError3;
|
|
66500
67131
|
OpenAI.UnprocessableEntityError = UnprocessableEntityError3;
|
|
66501
67132
|
OpenAI.toFile = toFile2;
|
|
66502
67133
|
OpenAI.fileFromPath = fileFromPath4;
|
|
66503
|
-
var { OpenAIError: OpenAIError2, APIError: APIError4, APIConnectionError: APIConnectionError4, APIConnectionTimeoutError: APIConnectionTimeoutError4, APIUserAbortError: APIUserAbortError4, NotFoundError: NotFoundError4, ConflictError: ConflictError4, RateLimitError:
|
|
67134
|
+
var { OpenAIError: OpenAIError2, APIError: APIError4, APIConnectionError: APIConnectionError4, APIConnectionTimeoutError: APIConnectionTimeoutError4, APIUserAbortError: APIUserAbortError4, NotFoundError: NotFoundError4, ConflictError: ConflictError4, RateLimitError: RateLimitError5, BadRequestError: BadRequestError4, AuthenticationError: AuthenticationError5, InternalServerError: InternalServerError4, PermissionDeniedError: PermissionDeniedError4, UnprocessableEntityError: UnprocessableEntityError4 } = error_exports2;
|
|
66504
67135
|
(function(OpenAI2) {
|
|
66505
67136
|
OpenAI2.Page = Page;
|
|
66506
67137
|
OpenAI2.CursorPage = CursorPage;
|
|
@@ -66541,12 +67172,7 @@ var OpenAiEngine = class {
|
|
|
66541
67172
|
let content = message?.content;
|
|
66542
67173
|
return removeContentTags(content, "think");
|
|
66543
67174
|
} catch (error) {
|
|
66544
|
-
|
|
66545
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
66546
|
-
const openAiError = error.response.data.error;
|
|
66547
|
-
if (openAiError) throw new Error(openAiError.message);
|
|
66548
|
-
}
|
|
66549
|
-
throw err;
|
|
67175
|
+
throw normalizeEngineError(error, "openai", this.config.model);
|
|
66550
67176
|
}
|
|
66551
67177
|
};
|
|
66552
67178
|
this.config = config7;
|
|
@@ -66590,12 +67216,7 @@ var MistralAiEngine = class {
|
|
|
66590
67216
|
let content = message.content;
|
|
66591
67217
|
return removeContentTags(content, "think");
|
|
66592
67218
|
} catch (error) {
|
|
66593
|
-
|
|
66594
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
66595
|
-
const mistralError = error.response.data.error;
|
|
66596
|
-
if (mistralError) throw new Error(mistralError.message);
|
|
66597
|
-
}
|
|
66598
|
-
throw err;
|
|
67219
|
+
throw normalizeEngineError(error, "mistral", this.config.model);
|
|
66599
67220
|
}
|
|
66600
67221
|
};
|
|
66601
67222
|
this.config = config7;
|
|
@@ -66644,9 +67265,8 @@ var MLXEngine = class {
|
|
|
66644
67265
|
const message = choices[0].message;
|
|
66645
67266
|
let content = message?.content;
|
|
66646
67267
|
return removeContentTags(content, "think");
|
|
66647
|
-
} catch (
|
|
66648
|
-
|
|
66649
|
-
throw new Error(`MLX provider error: ${message}`);
|
|
67268
|
+
} catch (error) {
|
|
67269
|
+
throw normalizeEngineError(error, "mlx", this.config.model);
|
|
66650
67270
|
}
|
|
66651
67271
|
}
|
|
66652
67272
|
};
|
|
@@ -66676,12 +67296,7 @@ var DeepseekEngine = class extends OpenAiEngine {
|
|
|
66676
67296
|
let content = message?.content;
|
|
66677
67297
|
return removeContentTags(content, "think");
|
|
66678
67298
|
} catch (error) {
|
|
66679
|
-
|
|
66680
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
66681
|
-
const openAiError = error.response.data.error;
|
|
66682
|
-
if (openAiError) throw new Error(openAiError.message);
|
|
66683
|
-
}
|
|
66684
|
-
throw err;
|
|
67299
|
+
throw normalizeEngineError(error, "deepseek", this.config.model);
|
|
66685
67300
|
}
|
|
66686
67301
|
};
|
|
66687
67302
|
}
|
|
@@ -66700,12 +67315,7 @@ var AimlApiEngine = class {
|
|
|
66700
67315
|
const message = response.data.choices?.[0]?.message;
|
|
66701
67316
|
return message?.content ?? null;
|
|
66702
67317
|
} catch (error) {
|
|
66703
|
-
|
|
66704
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
66705
|
-
const apiError = error.response.data.error;
|
|
66706
|
-
if (apiError) throw new Error(apiError.message);
|
|
66707
|
-
}
|
|
66708
|
-
throw err;
|
|
67318
|
+
throw normalizeEngineError(error, "aimlapi", this.config.model);
|
|
66709
67319
|
}
|
|
66710
67320
|
};
|
|
66711
67321
|
this.client = axios_default.create({
|
|
@@ -66735,12 +67345,7 @@ var OpenRouterEngine = class {
|
|
|
66735
67345
|
let content = message?.content;
|
|
66736
67346
|
return removeContentTags(content, "think");
|
|
66737
67347
|
} catch (error) {
|
|
66738
|
-
|
|
66739
|
-
if (axios_default.isAxiosError(error) && error.response?.status === 401) {
|
|
66740
|
-
const openRouterError = error.response.data.error;
|
|
66741
|
-
if (openRouterError) throw new Error(openRouterError.message);
|
|
66742
|
-
}
|
|
66743
|
-
throw err;
|
|
67348
|
+
throw normalizeEngineError(error, "openrouter", this.config.model);
|
|
66744
67349
|
}
|
|
66745
67350
|
};
|
|
66746
67351
|
this.client = axios_default.create({
|
|
@@ -66833,6 +67438,7 @@ var computeHash = async (content, algorithm = "sha256") => {
|
|
|
66833
67438
|
};
|
|
66834
67439
|
|
|
66835
67440
|
// src/modules/commitlint/prompts.ts
|
|
67441
|
+
init_dist2();
|
|
66836
67442
|
var import_types = __toESM(require_lib5(), 1);
|
|
66837
67443
|
var config2 = getConfig();
|
|
66838
67444
|
var translation = i18n[config2.OCO_LANGUAGE || "en"];
|
|
@@ -67340,8 +67946,77 @@ var GenerateCommitMessageErrorEnum = ((GenerateCommitMessageErrorEnum2) => {
|
|
|
67340
67946
|
GenerateCommitMessageErrorEnum2["outputTokensTooHigh"] = `Token limit exceeded, OCO_TOKENS_MAX_OUTPUT must not be much higher than the default ${500 /* DEFAULT_MAX_TOKENS_OUTPUT */} tokens.`;
|
|
67341
67947
|
return GenerateCommitMessageErrorEnum2;
|
|
67342
67948
|
})(GenerateCommitMessageErrorEnum || {});
|
|
67949
|
+
async function handleModelNotFoundError(error, provider, currentModel) {
|
|
67950
|
+
console.log(
|
|
67951
|
+
source_default.red(`
|
|
67952
|
+
\u2716 Model '${currentModel}' not found
|
|
67953
|
+
`)
|
|
67954
|
+
);
|
|
67955
|
+
const suggestedModels = getSuggestedModels(provider, currentModel);
|
|
67956
|
+
const recommended = RECOMMENDED_MODELS[provider];
|
|
67957
|
+
if (suggestedModels.length === 0) {
|
|
67958
|
+
console.log(
|
|
67959
|
+
source_default.yellow(
|
|
67960
|
+
`No alternative models available. Run 'oco setup' to configure a different model.`
|
|
67961
|
+
)
|
|
67962
|
+
);
|
|
67963
|
+
return null;
|
|
67964
|
+
}
|
|
67965
|
+
const options = [];
|
|
67966
|
+
if (recommended && suggestedModels.includes(recommended)) {
|
|
67967
|
+
options.push({
|
|
67968
|
+
value: recommended,
|
|
67969
|
+
label: `${recommended} (Recommended)`
|
|
67970
|
+
});
|
|
67971
|
+
}
|
|
67972
|
+
suggestedModels.filter((m5) => m5 !== recommended).forEach((model) => {
|
|
67973
|
+
options.push({ value: model, label: model });
|
|
67974
|
+
});
|
|
67975
|
+
options.push({ value: "__custom__", label: "Enter custom model..." });
|
|
67976
|
+
const selection = await ee({
|
|
67977
|
+
message: "Select an alternative model:",
|
|
67978
|
+
options
|
|
67979
|
+
});
|
|
67980
|
+
if (hD2(selection)) {
|
|
67981
|
+
return null;
|
|
67982
|
+
}
|
|
67983
|
+
let newModel;
|
|
67984
|
+
if (selection === "__custom__") {
|
|
67985
|
+
const { text } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
|
|
67986
|
+
const customModel = await text({
|
|
67987
|
+
message: "Enter model name:",
|
|
67988
|
+
validate: (value) => {
|
|
67989
|
+
if (!value || value.trim().length === 0) {
|
|
67990
|
+
return "Model name is required";
|
|
67991
|
+
}
|
|
67992
|
+
return void 0;
|
|
67993
|
+
}
|
|
67994
|
+
});
|
|
67995
|
+
if (hD2(customModel)) {
|
|
67996
|
+
return null;
|
|
67997
|
+
}
|
|
67998
|
+
newModel = customModel;
|
|
67999
|
+
} else {
|
|
68000
|
+
newModel = selection;
|
|
68001
|
+
}
|
|
68002
|
+
const saveAsDefault = await Q3({
|
|
68003
|
+
message: "Save as default model?"
|
|
68004
|
+
});
|
|
68005
|
+
if (!hD2(saveAsDefault) && saveAsDefault) {
|
|
68006
|
+
const existingConfig = getGlobalConfig();
|
|
68007
|
+
setGlobalConfig({
|
|
68008
|
+
...existingConfig,
|
|
68009
|
+
OCO_MODEL: newModel
|
|
68010
|
+
});
|
|
68011
|
+
console.log(source_default.green("\u2714") + " Model saved as default\n");
|
|
68012
|
+
}
|
|
68013
|
+
return newModel;
|
|
68014
|
+
}
|
|
67343
68015
|
var ADJUSTMENT_FACTOR = 20;
|
|
67344
|
-
var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false, context = "") => {
|
|
68016
|
+
var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false, context = "", retryWithModel) => {
|
|
68017
|
+
const currentConfig = getConfig();
|
|
68018
|
+
const provider = currentConfig.OCO_AI_PROVIDER || "openai";
|
|
68019
|
+
const currentModel = retryWithModel || currentConfig.OCO_MODEL;
|
|
67345
68020
|
try {
|
|
67346
68021
|
const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(
|
|
67347
68022
|
fullGitMojiSpec,
|
|
@@ -67375,6 +68050,28 @@ var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false, context
|
|
|
67375
68050
|
throw new Error("EMPTY_MESSAGE" /* emptyMessage */);
|
|
67376
68051
|
return commitMessage;
|
|
67377
68052
|
} catch (error) {
|
|
68053
|
+
if (isModelNotFoundError(error)) {
|
|
68054
|
+
const newModel = await handleModelNotFoundError(
|
|
68055
|
+
error,
|
|
68056
|
+
provider,
|
|
68057
|
+
currentModel
|
|
68058
|
+
);
|
|
68059
|
+
if (newModel) {
|
|
68060
|
+
console.log(source_default.cyan(`Retrying with ${newModel}...
|
|
68061
|
+
`));
|
|
68062
|
+
const existingConfig = getGlobalConfig();
|
|
68063
|
+
setGlobalConfig({
|
|
68064
|
+
...existingConfig,
|
|
68065
|
+
OCO_MODEL: newModel
|
|
68066
|
+
});
|
|
68067
|
+
return generateCommitMessageByDiff(
|
|
68068
|
+
diff,
|
|
68069
|
+
fullGitMojiSpec,
|
|
68070
|
+
context,
|
|
68071
|
+
newModel
|
|
68072
|
+
);
|
|
68073
|
+
}
|
|
68074
|
+
}
|
|
67378
68075
|
throw error;
|
|
67379
68076
|
}
|
|
67380
68077
|
};
|
|
@@ -67465,6 +68162,7 @@ function delay3(ms) {
|
|
|
67465
68162
|
var import_fs3 = require("fs");
|
|
67466
68163
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
67467
68164
|
var import_path4 = require("path");
|
|
68165
|
+
init_dist2();
|
|
67468
68166
|
var assertGitRepo = async () => {
|
|
67469
68167
|
try {
|
|
67470
68168
|
await execa("git", ["rev-parse"]);
|
|
@@ -67709,9 +68407,10 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
|
|
|
67709
68407
|
commitGenerationSpinner.stop(
|
|
67710
68408
|
`${source_default.red("\u2716")} Failed to generate the commit message`
|
|
67711
68409
|
);
|
|
67712
|
-
|
|
67713
|
-
const
|
|
67714
|
-
|
|
68410
|
+
const errorConfig = getConfig();
|
|
68411
|
+
const provider = errorConfig.OCO_AI_PROVIDER || "openai";
|
|
68412
|
+
const formatted = formatUserFriendlyError(error, provider);
|
|
68413
|
+
ce(printFormattedError(formatted));
|
|
67715
68414
|
process.exit(1);
|
|
67716
68415
|
}
|
|
67717
68416
|
};
|
|
@@ -67782,6 +68481,7 @@ ${stagedFiles.map((file) => ` ${file}`).join("\n")}`
|
|
|
67782
68481
|
}
|
|
67783
68482
|
|
|
67784
68483
|
// src/commands/commitlint.ts
|
|
68484
|
+
init_dist2();
|
|
67785
68485
|
var commitlintConfigCommand = G3(
|
|
67786
68486
|
{
|
|
67787
68487
|
name: "commitlint" /* commitlint */,
|
|
@@ -67811,6 +68511,7 @@ var commitlintConfigCommand = G3(
|
|
|
67811
68511
|
);
|
|
67812
68512
|
|
|
67813
68513
|
// src/commands/githook.ts
|
|
68514
|
+
init_dist2();
|
|
67814
68515
|
var import_fs4 = require("fs");
|
|
67815
68516
|
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
67816
68517
|
var import_path5 = __toESM(require("path"), 1);
|
|
@@ -67894,6 +68595,7 @@ var hookCommand = G3(
|
|
|
67894
68595
|
|
|
67895
68596
|
// src/commands/prepare-commit-msg-hook.ts
|
|
67896
68597
|
var import_promises4 = __toESM(require("fs/promises"), 1);
|
|
68598
|
+
init_dist2();
|
|
67897
68599
|
var [messageFilePath, commitSource] = process.argv.slice(2);
|
|
67898
68600
|
var prepareCommitMessageHook = async (isStageAllFlag = false) => {
|
|
67899
68601
|
try {
|
|
@@ -67946,7 +68648,730 @@ ${fileContent.toString()}`;
|
|
|
67946
68648
|
}
|
|
67947
68649
|
};
|
|
67948
68650
|
|
|
68651
|
+
// src/commands/setup.ts
|
|
68652
|
+
init_dist2();
|
|
68653
|
+
|
|
68654
|
+
// src/utils/modelCache.ts
|
|
68655
|
+
var import_fs5 = require("fs");
|
|
68656
|
+
var import_os2 = require("os");
|
|
68657
|
+
var import_path6 = require("path");
|
|
68658
|
+
var MODEL_CACHE_PATH = (0, import_path6.join)((0, import_os2.homedir)(), ".opencommit-models.json");
|
|
68659
|
+
var CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
68660
|
+
function readCache() {
|
|
68661
|
+
try {
|
|
68662
|
+
if (!(0, import_fs5.existsSync)(MODEL_CACHE_PATH)) {
|
|
68663
|
+
return null;
|
|
68664
|
+
}
|
|
68665
|
+
const data = (0, import_fs5.readFileSync)(MODEL_CACHE_PATH, "utf8");
|
|
68666
|
+
return JSON.parse(data);
|
|
68667
|
+
} catch {
|
|
68668
|
+
return null;
|
|
68669
|
+
}
|
|
68670
|
+
}
|
|
68671
|
+
function writeCache(models) {
|
|
68672
|
+
try {
|
|
68673
|
+
const cache = {
|
|
68674
|
+
timestamp: Date.now(),
|
|
68675
|
+
models
|
|
68676
|
+
};
|
|
68677
|
+
(0, import_fs5.writeFileSync)(MODEL_CACHE_PATH, JSON.stringify(cache, null, 2), "utf8");
|
|
68678
|
+
} catch {
|
|
68679
|
+
}
|
|
68680
|
+
}
|
|
68681
|
+
function isCacheValid(cache) {
|
|
68682
|
+
if (!cache) return false;
|
|
68683
|
+
return Date.now() - cache.timestamp < CACHE_TTL_MS;
|
|
68684
|
+
}
|
|
68685
|
+
async function fetchOpenAIModels(apiKey) {
|
|
68686
|
+
try {
|
|
68687
|
+
const response = await fetch("https://api.openai.com/v1/models", {
|
|
68688
|
+
headers: {
|
|
68689
|
+
Authorization: `Bearer ${apiKey}`
|
|
68690
|
+
}
|
|
68691
|
+
});
|
|
68692
|
+
if (!response.ok) {
|
|
68693
|
+
return MODEL_LIST.openai;
|
|
68694
|
+
}
|
|
68695
|
+
const data = await response.json();
|
|
68696
|
+
const models = data.data.map((m5) => m5.id).filter(
|
|
68697
|
+
(id) => id.startsWith("gpt-") || id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4")
|
|
68698
|
+
).sort();
|
|
68699
|
+
return models.length > 0 ? models : MODEL_LIST.openai;
|
|
68700
|
+
} catch {
|
|
68701
|
+
return MODEL_LIST.openai;
|
|
68702
|
+
}
|
|
68703
|
+
}
|
|
68704
|
+
async function fetchOllamaModels(baseUrl = "http://localhost:11434") {
|
|
68705
|
+
try {
|
|
68706
|
+
const response = await fetch(`${baseUrl}/api/tags`);
|
|
68707
|
+
if (!response.ok) {
|
|
68708
|
+
return [];
|
|
68709
|
+
}
|
|
68710
|
+
const data = await response.json();
|
|
68711
|
+
return data.models?.map((m5) => m5.name) || [];
|
|
68712
|
+
} catch {
|
|
68713
|
+
return [];
|
|
68714
|
+
}
|
|
68715
|
+
}
|
|
68716
|
+
async function fetchAnthropicModels(apiKey) {
|
|
68717
|
+
try {
|
|
68718
|
+
const response = await fetch("https://api.anthropic.com/v1/models", {
|
|
68719
|
+
headers: {
|
|
68720
|
+
"x-api-key": apiKey,
|
|
68721
|
+
"anthropic-version": "2023-06-01"
|
|
68722
|
+
}
|
|
68723
|
+
});
|
|
68724
|
+
if (!response.ok) {
|
|
68725
|
+
return MODEL_LIST.anthropic;
|
|
68726
|
+
}
|
|
68727
|
+
const data = await response.json();
|
|
68728
|
+
const models = data.data?.map((m5) => m5.id).filter((id) => id.startsWith("claude-")).sort();
|
|
68729
|
+
return models && models.length > 0 ? models : MODEL_LIST.anthropic;
|
|
68730
|
+
} catch {
|
|
68731
|
+
return MODEL_LIST.anthropic;
|
|
68732
|
+
}
|
|
68733
|
+
}
|
|
68734
|
+
async function fetchMistralModels(apiKey) {
|
|
68735
|
+
try {
|
|
68736
|
+
const response = await fetch("https://api.mistral.ai/v1/models", {
|
|
68737
|
+
headers: {
|
|
68738
|
+
Authorization: `Bearer ${apiKey}`
|
|
68739
|
+
}
|
|
68740
|
+
});
|
|
68741
|
+
if (!response.ok) {
|
|
68742
|
+
return MODEL_LIST.mistral;
|
|
68743
|
+
}
|
|
68744
|
+
const data = await response.json();
|
|
68745
|
+
const models = data.data?.map((m5) => m5.id).sort();
|
|
68746
|
+
return models && models.length > 0 ? models : MODEL_LIST.mistral;
|
|
68747
|
+
} catch {
|
|
68748
|
+
return MODEL_LIST.mistral;
|
|
68749
|
+
}
|
|
68750
|
+
}
|
|
68751
|
+
async function fetchGroqModels(apiKey) {
|
|
68752
|
+
try {
|
|
68753
|
+
const response = await fetch("https://api.groq.com/openai/v1/models", {
|
|
68754
|
+
headers: {
|
|
68755
|
+
Authorization: `Bearer ${apiKey}`
|
|
68756
|
+
}
|
|
68757
|
+
});
|
|
68758
|
+
if (!response.ok) {
|
|
68759
|
+
return MODEL_LIST.groq;
|
|
68760
|
+
}
|
|
68761
|
+
const data = await response.json();
|
|
68762
|
+
const models = data.data?.map((m5) => m5.id).sort();
|
|
68763
|
+
return models && models.length > 0 ? models : MODEL_LIST.groq;
|
|
68764
|
+
} catch {
|
|
68765
|
+
return MODEL_LIST.groq;
|
|
68766
|
+
}
|
|
68767
|
+
}
|
|
68768
|
+
async function fetchOpenRouterModels(apiKey) {
|
|
68769
|
+
try {
|
|
68770
|
+
const response = await fetch("https://openrouter.ai/api/v1/models", {
|
|
68771
|
+
headers: {
|
|
68772
|
+
Authorization: `Bearer ${apiKey}`
|
|
68773
|
+
}
|
|
68774
|
+
});
|
|
68775
|
+
if (!response.ok) {
|
|
68776
|
+
return MODEL_LIST.openrouter;
|
|
68777
|
+
}
|
|
68778
|
+
const data = await response.json();
|
|
68779
|
+
const models = data.data?.filter(
|
|
68780
|
+
(m5) => m5.context_length && m5.context_length > 0
|
|
68781
|
+
).map((m5) => m5.id).sort();
|
|
68782
|
+
return models && models.length > 0 ? models : MODEL_LIST.openrouter;
|
|
68783
|
+
} catch {
|
|
68784
|
+
return MODEL_LIST.openrouter;
|
|
68785
|
+
}
|
|
68786
|
+
}
|
|
68787
|
+
async function fetchDeepSeekModels(apiKey) {
|
|
68788
|
+
try {
|
|
68789
|
+
const response = await fetch("https://api.deepseek.com/v1/models", {
|
|
68790
|
+
headers: {
|
|
68791
|
+
Authorization: `Bearer ${apiKey}`
|
|
68792
|
+
}
|
|
68793
|
+
});
|
|
68794
|
+
if (!response.ok) {
|
|
68795
|
+
return MODEL_LIST.deepseek;
|
|
68796
|
+
}
|
|
68797
|
+
const data = await response.json();
|
|
68798
|
+
const models = data.data?.map((m5) => m5.id).sort();
|
|
68799
|
+
return models && models.length > 0 ? models : MODEL_LIST.deepseek;
|
|
68800
|
+
} catch {
|
|
68801
|
+
return MODEL_LIST.deepseek;
|
|
68802
|
+
}
|
|
68803
|
+
}
|
|
68804
|
+
async function fetchModelsForProvider(provider, apiKey, baseUrl, forceRefresh = false) {
|
|
68805
|
+
const cache = readCache();
|
|
68806
|
+
if (!forceRefresh && isCacheValid(cache) && cache.models[provider]) {
|
|
68807
|
+
return cache.models[provider];
|
|
68808
|
+
}
|
|
68809
|
+
let models = [];
|
|
68810
|
+
switch (provider.toLowerCase()) {
|
|
68811
|
+
case "openai" /* OPENAI */:
|
|
68812
|
+
if (apiKey) {
|
|
68813
|
+
models = await fetchOpenAIModels(apiKey);
|
|
68814
|
+
} else {
|
|
68815
|
+
models = MODEL_LIST.openai;
|
|
68816
|
+
}
|
|
68817
|
+
break;
|
|
68818
|
+
case "ollama" /* OLLAMA */:
|
|
68819
|
+
models = await fetchOllamaModels(baseUrl);
|
|
68820
|
+
break;
|
|
68821
|
+
case "anthropic" /* ANTHROPIC */:
|
|
68822
|
+
if (apiKey) {
|
|
68823
|
+
models = await fetchAnthropicModels(apiKey);
|
|
68824
|
+
} else {
|
|
68825
|
+
models = MODEL_LIST.anthropic;
|
|
68826
|
+
}
|
|
68827
|
+
break;
|
|
68828
|
+
case "gemini" /* GEMINI */:
|
|
68829
|
+
models = MODEL_LIST.gemini;
|
|
68830
|
+
break;
|
|
68831
|
+
case "groq" /* GROQ */:
|
|
68832
|
+
if (apiKey) {
|
|
68833
|
+
models = await fetchGroqModels(apiKey);
|
|
68834
|
+
} else {
|
|
68835
|
+
models = MODEL_LIST.groq;
|
|
68836
|
+
}
|
|
68837
|
+
break;
|
|
68838
|
+
case "mistral" /* MISTRAL */:
|
|
68839
|
+
if (apiKey) {
|
|
68840
|
+
models = await fetchMistralModels(apiKey);
|
|
68841
|
+
} else {
|
|
68842
|
+
models = MODEL_LIST.mistral;
|
|
68843
|
+
}
|
|
68844
|
+
break;
|
|
68845
|
+
case "deepseek" /* DEEPSEEK */:
|
|
68846
|
+
if (apiKey) {
|
|
68847
|
+
models = await fetchDeepSeekModels(apiKey);
|
|
68848
|
+
} else {
|
|
68849
|
+
models = MODEL_LIST.deepseek;
|
|
68850
|
+
}
|
|
68851
|
+
break;
|
|
68852
|
+
case "aimlapi" /* AIMLAPI */:
|
|
68853
|
+
models = MODEL_LIST.aimlapi;
|
|
68854
|
+
break;
|
|
68855
|
+
case "openrouter" /* OPENROUTER */:
|
|
68856
|
+
if (apiKey) {
|
|
68857
|
+
models = await fetchOpenRouterModels(apiKey);
|
|
68858
|
+
} else {
|
|
68859
|
+
models = MODEL_LIST.openrouter;
|
|
68860
|
+
}
|
|
68861
|
+
break;
|
|
68862
|
+
default:
|
|
68863
|
+
models = MODEL_LIST.openai;
|
|
68864
|
+
}
|
|
68865
|
+
const existingCache = cache?.models || {};
|
|
68866
|
+
existingCache[provider] = models;
|
|
68867
|
+
writeCache(existingCache);
|
|
68868
|
+
return models;
|
|
68869
|
+
}
|
|
68870
|
+
function clearModelCache() {
|
|
68871
|
+
try {
|
|
68872
|
+
if ((0, import_fs5.existsSync)(MODEL_CACHE_PATH)) {
|
|
68873
|
+
(0, import_fs5.writeFileSync)(MODEL_CACHE_PATH, "{}", "utf8");
|
|
68874
|
+
}
|
|
68875
|
+
} catch {
|
|
68876
|
+
}
|
|
68877
|
+
}
|
|
68878
|
+
function getCacheInfo() {
|
|
68879
|
+
const cache = readCache();
|
|
68880
|
+
if (!cache) {
|
|
68881
|
+
return { timestamp: null, providers: [] };
|
|
68882
|
+
}
|
|
68883
|
+
return {
|
|
68884
|
+
timestamp: cache.timestamp,
|
|
68885
|
+
providers: Object.keys(cache.models || {})
|
|
68886
|
+
};
|
|
68887
|
+
}
|
|
68888
|
+
function getCachedModels(provider) {
|
|
68889
|
+
const cache = readCache();
|
|
68890
|
+
if (!cache || !cache.models[provider]) {
|
|
68891
|
+
return null;
|
|
68892
|
+
}
|
|
68893
|
+
return cache.models[provider];
|
|
68894
|
+
}
|
|
68895
|
+
|
|
68896
|
+
// src/commands/setup.ts
|
|
68897
|
+
var PROVIDER_DISPLAY_NAMES = {
|
|
68898
|
+
["openai" /* OPENAI */]: "OpenAI (GPT-4o, GPT-4)",
|
|
68899
|
+
["anthropic" /* ANTHROPIC */]: "Anthropic (Claude Sonnet, Opus)",
|
|
68900
|
+
["ollama" /* OLLAMA */]: "Ollama (Free, runs locally)",
|
|
68901
|
+
["gemini" /* GEMINI */]: "Google Gemini",
|
|
68902
|
+
["groq" /* GROQ */]: "Groq (Fast inference, free tier)",
|
|
68903
|
+
["mistral" /* MISTRAL */]: "Mistral AI",
|
|
68904
|
+
["deepseek" /* DEEPSEEK */]: "DeepSeek",
|
|
68905
|
+
["openrouter" /* OPENROUTER */]: "OpenRouter (Multiple providers)",
|
|
68906
|
+
["aimlapi" /* AIMLAPI */]: "AI/ML API",
|
|
68907
|
+
["azure" /* AZURE */]: "Azure OpenAI",
|
|
68908
|
+
["mlx" /* MLX */]: "MLX (Apple Silicon, local)"
|
|
68909
|
+
};
|
|
68910
|
+
var PRIMARY_PROVIDERS = [
|
|
68911
|
+
"openai" /* OPENAI */,
|
|
68912
|
+
"anthropic" /* ANTHROPIC */,
|
|
68913
|
+
"ollama" /* OLLAMA */
|
|
68914
|
+
];
|
|
68915
|
+
var OTHER_PROVIDERS = [
|
|
68916
|
+
"gemini" /* GEMINI */,
|
|
68917
|
+
"groq" /* GROQ */,
|
|
68918
|
+
"mistral" /* MISTRAL */,
|
|
68919
|
+
"deepseek" /* DEEPSEEK */,
|
|
68920
|
+
"openrouter" /* OPENROUTER */,
|
|
68921
|
+
"aimlapi" /* AIMLAPI */,
|
|
68922
|
+
"azure" /* AZURE */,
|
|
68923
|
+
"mlx" /* MLX */
|
|
68924
|
+
];
|
|
68925
|
+
var NO_API_KEY_PROVIDERS = [
|
|
68926
|
+
"ollama" /* OLLAMA */,
|
|
68927
|
+
"mlx" /* MLX */
|
|
68928
|
+
];
|
|
68929
|
+
async function selectProvider() {
|
|
68930
|
+
const primaryOptions = PRIMARY_PROVIDERS.map((provider) => ({
|
|
68931
|
+
value: provider,
|
|
68932
|
+
label: PROVIDER_DISPLAY_NAMES[provider] || provider
|
|
68933
|
+
}));
|
|
68934
|
+
primaryOptions.push({
|
|
68935
|
+
value: "other",
|
|
68936
|
+
label: "Other providers..."
|
|
68937
|
+
});
|
|
68938
|
+
const selection = await ee({
|
|
68939
|
+
message: "Select your AI provider:",
|
|
68940
|
+
options: primaryOptions
|
|
68941
|
+
});
|
|
68942
|
+
if (hD2(selection)) return selection;
|
|
68943
|
+
if (selection === "other") {
|
|
68944
|
+
const otherOptions = OTHER_PROVIDERS.map((provider) => ({
|
|
68945
|
+
value: provider,
|
|
68946
|
+
label: PROVIDER_DISPLAY_NAMES[provider] || provider
|
|
68947
|
+
}));
|
|
68948
|
+
return await ee({
|
|
68949
|
+
message: "Select provider:",
|
|
68950
|
+
options: otherOptions
|
|
68951
|
+
});
|
|
68952
|
+
}
|
|
68953
|
+
return selection;
|
|
68954
|
+
}
|
|
68955
|
+
async function getApiKey(provider) {
|
|
68956
|
+
const url2 = PROVIDER_API_KEY_URLS[provider];
|
|
68957
|
+
let message = `Enter your ${provider} API key:`;
|
|
68958
|
+
if (url2) {
|
|
68959
|
+
message = `Enter your API key:
|
|
68960
|
+
${source_default.dim(` Get your key at: ${url2}`)}`;
|
|
68961
|
+
}
|
|
68962
|
+
return await J4({
|
|
68963
|
+
message,
|
|
68964
|
+
placeholder: "sk-...",
|
|
68965
|
+
validate: (value) => {
|
|
68966
|
+
if (!value || value.trim().length === 0) {
|
|
68967
|
+
return "API key is required";
|
|
68968
|
+
}
|
|
68969
|
+
return void 0;
|
|
68970
|
+
}
|
|
68971
|
+
});
|
|
68972
|
+
}
|
|
68973
|
+
function formatCacheAge(timestamp) {
|
|
68974
|
+
if (!timestamp) return "";
|
|
68975
|
+
const ageMs = Date.now() - timestamp;
|
|
68976
|
+
const days = Math.floor(ageMs / (1e3 * 60 * 60 * 24));
|
|
68977
|
+
const hours = Math.floor(ageMs / (1e3 * 60 * 60));
|
|
68978
|
+
if (days > 0) {
|
|
68979
|
+
return `${days} day${days === 1 ? "" : "s"} ago`;
|
|
68980
|
+
} else if (hours > 0) {
|
|
68981
|
+
return `${hours} hour${hours === 1 ? "" : "s"} ago`;
|
|
68982
|
+
}
|
|
68983
|
+
return "just now";
|
|
68984
|
+
}
|
|
68985
|
+
async function selectModel(provider, apiKey) {
|
|
68986
|
+
const providerDisplayName = PROVIDER_DISPLAY_NAMES[provider]?.split(" (")[0] || provider;
|
|
68987
|
+
const loadingSpinner = le();
|
|
68988
|
+
loadingSpinner.start(`Fetching models from ${providerDisplayName}...`);
|
|
68989
|
+
let models = [];
|
|
68990
|
+
let usedFallback = false;
|
|
68991
|
+
try {
|
|
68992
|
+
models = await fetchModelsForProvider(provider, apiKey);
|
|
68993
|
+
} catch {
|
|
68994
|
+
usedFallback = true;
|
|
68995
|
+
const providerKey = provider.toLowerCase();
|
|
68996
|
+
models = MODEL_LIST[providerKey] || [];
|
|
68997
|
+
}
|
|
68998
|
+
const cacheInfo = getCacheInfo();
|
|
68999
|
+
const cacheAge = formatCacheAge(cacheInfo.timestamp);
|
|
69000
|
+
if (usedFallback) {
|
|
69001
|
+
loadingSpinner.stop(
|
|
69002
|
+
source_default.yellow("Could not fetch models from API. Using default list.")
|
|
69003
|
+
);
|
|
69004
|
+
} else if (cacheAge) {
|
|
69005
|
+
loadingSpinner.stop(`Models loaded ${source_default.dim(`(cached ${cacheAge})`)}`);
|
|
69006
|
+
} else {
|
|
69007
|
+
loadingSpinner.stop("Models loaded");
|
|
69008
|
+
}
|
|
69009
|
+
if (models.length === 0) {
|
|
69010
|
+
if (NO_API_KEY_PROVIDERS.includes(provider)) {
|
|
69011
|
+
return await J4({
|
|
69012
|
+
message: "Enter model name (e.g., llama3:8b, mistral):",
|
|
69013
|
+
placeholder: "llama3:8b",
|
|
69014
|
+
validate: (value) => {
|
|
69015
|
+
if (!value || value.trim().length === 0) {
|
|
69016
|
+
return "Model name is required";
|
|
69017
|
+
}
|
|
69018
|
+
return void 0;
|
|
69019
|
+
}
|
|
69020
|
+
});
|
|
69021
|
+
}
|
|
69022
|
+
const providerKey = provider.toLowerCase();
|
|
69023
|
+
return MODEL_LIST[providerKey]?.[0] || "gpt-4o-mini";
|
|
69024
|
+
}
|
|
69025
|
+
const recommended = RECOMMENDED_MODELS[provider];
|
|
69026
|
+
const options = [];
|
|
69027
|
+
if (recommended && models.includes(recommended)) {
|
|
69028
|
+
options.push({
|
|
69029
|
+
value: recommended,
|
|
69030
|
+
label: `${recommended} (Recommended)`
|
|
69031
|
+
});
|
|
69032
|
+
}
|
|
69033
|
+
const otherModels = models.filter((m5) => m5 !== recommended).slice(0, 10);
|
|
69034
|
+
otherModels.forEach((model) => {
|
|
69035
|
+
options.push({ value: model, label: model });
|
|
69036
|
+
});
|
|
69037
|
+
if (models.length > 11) {
|
|
69038
|
+
options.push({ value: "__show_all__", label: "Show all models..." });
|
|
69039
|
+
}
|
|
69040
|
+
options.push({ value: "__custom__", label: "Enter custom model..." });
|
|
69041
|
+
const selection = await ee({
|
|
69042
|
+
message: "Select a model:",
|
|
69043
|
+
options
|
|
69044
|
+
});
|
|
69045
|
+
if (hD2(selection)) return selection;
|
|
69046
|
+
if (selection === "__show_all__") {
|
|
69047
|
+
const allOptions = models.map((model) => ({
|
|
69048
|
+
value: model,
|
|
69049
|
+
label: model === recommended ? `${model} (Recommended)` : model
|
|
69050
|
+
}));
|
|
69051
|
+
return await ee({
|
|
69052
|
+
message: "Select a model:",
|
|
69053
|
+
options: allOptions
|
|
69054
|
+
});
|
|
69055
|
+
}
|
|
69056
|
+
if (selection === "__custom__") {
|
|
69057
|
+
return await J4({
|
|
69058
|
+
message: "Enter model name:",
|
|
69059
|
+
validate: (value) => {
|
|
69060
|
+
if (!value || value.trim().length === 0) {
|
|
69061
|
+
return "Model name is required";
|
|
69062
|
+
}
|
|
69063
|
+
return void 0;
|
|
69064
|
+
}
|
|
69065
|
+
});
|
|
69066
|
+
}
|
|
69067
|
+
return selection;
|
|
69068
|
+
}
|
|
69069
|
+
async function setupOllama() {
|
|
69070
|
+
console.log(source_default.cyan("\n Ollama - Free Local AI\n"));
|
|
69071
|
+
console.log(source_default.dim(" Setup steps:"));
|
|
69072
|
+
console.log(source_default.dim(" 1. Install: https://ollama.ai/download"));
|
|
69073
|
+
console.log(source_default.dim(" 2. Pull a model: ollama pull llama3:8b"));
|
|
69074
|
+
console.log(source_default.dim(" 3. Start server: ollama serve\n"));
|
|
69075
|
+
const loadingSpinner = le();
|
|
69076
|
+
loadingSpinner.start("Checking for local Ollama installation...");
|
|
69077
|
+
const defaultUrl = "http://localhost:11434";
|
|
69078
|
+
let ollamaModels = [];
|
|
69079
|
+
try {
|
|
69080
|
+
ollamaModels = await fetchOllamaModels(defaultUrl);
|
|
69081
|
+
if (ollamaModels.length > 0) {
|
|
69082
|
+
loadingSpinner.stop(
|
|
69083
|
+
`${source_default.green("\u2714")} Found ${ollamaModels.length} local model(s)`
|
|
69084
|
+
);
|
|
69085
|
+
} else {
|
|
69086
|
+
loadingSpinner.stop(
|
|
69087
|
+
source_default.yellow(
|
|
69088
|
+
"Ollama is running but no models found. Pull a model first: ollama pull llama3:8b"
|
|
69089
|
+
)
|
|
69090
|
+
);
|
|
69091
|
+
}
|
|
69092
|
+
} catch {
|
|
69093
|
+
loadingSpinner.stop(
|
|
69094
|
+
source_default.yellow(
|
|
69095
|
+
"Could not connect to Ollama. Make sure it is running: ollama serve"
|
|
69096
|
+
)
|
|
69097
|
+
);
|
|
69098
|
+
}
|
|
69099
|
+
let model;
|
|
69100
|
+
if (ollamaModels.length > 0) {
|
|
69101
|
+
model = await ee({
|
|
69102
|
+
message: "Select a model:",
|
|
69103
|
+
options: [
|
|
69104
|
+
...ollamaModels.map((m5) => ({ value: m5, label: m5 })),
|
|
69105
|
+
{ value: "__custom__", label: "Enter custom model name..." }
|
|
69106
|
+
]
|
|
69107
|
+
});
|
|
69108
|
+
if (hD2(model)) return null;
|
|
69109
|
+
if (model === "__custom__") {
|
|
69110
|
+
model = await J4({
|
|
69111
|
+
message: "Enter model name (e.g., llama3:8b, mistral):",
|
|
69112
|
+
placeholder: "llama3:8b"
|
|
69113
|
+
});
|
|
69114
|
+
}
|
|
69115
|
+
} else {
|
|
69116
|
+
model = await J4({
|
|
69117
|
+
message: "Enter model name (e.g., llama3:8b, mistral):",
|
|
69118
|
+
placeholder: "llama3:8b",
|
|
69119
|
+
validate: (value) => {
|
|
69120
|
+
if (!value || value.trim().length === 0) {
|
|
69121
|
+
return "Model name is required";
|
|
69122
|
+
}
|
|
69123
|
+
return void 0;
|
|
69124
|
+
}
|
|
69125
|
+
});
|
|
69126
|
+
}
|
|
69127
|
+
if (hD2(model)) return null;
|
|
69128
|
+
const apiUrl = await J4({
|
|
69129
|
+
message: "Ollama URL (press Enter for default):",
|
|
69130
|
+
placeholder: defaultUrl,
|
|
69131
|
+
defaultValue: defaultUrl
|
|
69132
|
+
});
|
|
69133
|
+
if (hD2(apiUrl)) return null;
|
|
69134
|
+
return {
|
|
69135
|
+
provider: "ollama" /* OLLAMA */,
|
|
69136
|
+
model,
|
|
69137
|
+
apiUrl: apiUrl || defaultUrl
|
|
69138
|
+
};
|
|
69139
|
+
}
|
|
69140
|
+
async function runSetup() {
|
|
69141
|
+
ae(source_default.bgCyan(" Welcome to OpenCommit! "));
|
|
69142
|
+
const provider = await selectProvider();
|
|
69143
|
+
if (hD2(provider)) {
|
|
69144
|
+
ce("Setup cancelled");
|
|
69145
|
+
return false;
|
|
69146
|
+
}
|
|
69147
|
+
let config7 = {};
|
|
69148
|
+
if (provider === "ollama" /* OLLAMA */) {
|
|
69149
|
+
const ollamaConfig = await setupOllama();
|
|
69150
|
+
if (!ollamaConfig) {
|
|
69151
|
+
ce("Setup cancelled");
|
|
69152
|
+
return false;
|
|
69153
|
+
}
|
|
69154
|
+
config7 = {
|
|
69155
|
+
OCO_AI_PROVIDER: ollamaConfig.provider,
|
|
69156
|
+
OCO_MODEL: ollamaConfig.model,
|
|
69157
|
+
OCO_API_URL: ollamaConfig.apiUrl,
|
|
69158
|
+
OCO_API_KEY: "ollama"
|
|
69159
|
+
// Placeholder
|
|
69160
|
+
};
|
|
69161
|
+
} else if (provider === "mlx" /* MLX */) {
|
|
69162
|
+
console.log(source_default.cyan("\n MLX - Apple Silicon Local AI\n"));
|
|
69163
|
+
console.log(source_default.dim(" MLX runs locally on Apple Silicon Macs."));
|
|
69164
|
+
console.log(source_default.dim(" No API key required.\n"));
|
|
69165
|
+
const model = await J4({
|
|
69166
|
+
message: "Enter model name:",
|
|
69167
|
+
placeholder: "mlx-community/Llama-3-8B-Instruct-4bit"
|
|
69168
|
+
});
|
|
69169
|
+
if (hD2(model)) {
|
|
69170
|
+
ce("Setup cancelled");
|
|
69171
|
+
return false;
|
|
69172
|
+
}
|
|
69173
|
+
config7 = {
|
|
69174
|
+
OCO_AI_PROVIDER: "mlx" /* MLX */,
|
|
69175
|
+
OCO_MODEL: model,
|
|
69176
|
+
OCO_API_KEY: "mlx"
|
|
69177
|
+
// Placeholder
|
|
69178
|
+
};
|
|
69179
|
+
} else {
|
|
69180
|
+
const apiKey = await getApiKey(provider);
|
|
69181
|
+
if (hD2(apiKey)) {
|
|
69182
|
+
ce("Setup cancelled");
|
|
69183
|
+
return false;
|
|
69184
|
+
}
|
|
69185
|
+
const model = await selectModel(provider, apiKey);
|
|
69186
|
+
if (hD2(model)) {
|
|
69187
|
+
ce("Setup cancelled");
|
|
69188
|
+
return false;
|
|
69189
|
+
}
|
|
69190
|
+
config7 = {
|
|
69191
|
+
OCO_AI_PROVIDER: provider,
|
|
69192
|
+
OCO_API_KEY: apiKey,
|
|
69193
|
+
OCO_MODEL: model
|
|
69194
|
+
};
|
|
69195
|
+
}
|
|
69196
|
+
const existingConfig = getIsGlobalConfigFileExist() ? getGlobalConfig() : DEFAULT_CONFIG;
|
|
69197
|
+
const newConfig = {
|
|
69198
|
+
...existingConfig,
|
|
69199
|
+
...config7
|
|
69200
|
+
};
|
|
69201
|
+
setGlobalConfig(newConfig);
|
|
69202
|
+
ce(
|
|
69203
|
+
`${source_default.green("\u2714")} Configuration saved to ~/.opencommit
|
|
69204
|
+
|
|
69205
|
+
Run ${source_default.cyan("oco")} to generate commit messages!`
|
|
69206
|
+
);
|
|
69207
|
+
return true;
|
|
69208
|
+
}
|
|
69209
|
+
function isFirstRun() {
|
|
69210
|
+
if (!getIsGlobalConfigFileExist()) {
|
|
69211
|
+
return true;
|
|
69212
|
+
}
|
|
69213
|
+
const config7 = getConfig();
|
|
69214
|
+
const provider = config7.OCO_AI_PROVIDER || "openai" /* OPENAI */;
|
|
69215
|
+
if (NO_API_KEY_PROVIDERS.includes(provider)) {
|
|
69216
|
+
return !config7.OCO_MODEL;
|
|
69217
|
+
}
|
|
69218
|
+
return !config7.OCO_API_KEY;
|
|
69219
|
+
}
|
|
69220
|
+
async function promptForMissingApiKey() {
|
|
69221
|
+
const config7 = getConfig();
|
|
69222
|
+
const provider = config7.OCO_AI_PROVIDER || "openai" /* OPENAI */;
|
|
69223
|
+
if (NO_API_KEY_PROVIDERS.includes(provider)) {
|
|
69224
|
+
return true;
|
|
69225
|
+
}
|
|
69226
|
+
if (config7.OCO_API_KEY) {
|
|
69227
|
+
return true;
|
|
69228
|
+
}
|
|
69229
|
+
console.log(
|
|
69230
|
+
source_default.yellow(
|
|
69231
|
+
`
|
|
69232
|
+
API key missing for ${provider}. Let's set it up.
|
|
69233
|
+
`
|
|
69234
|
+
)
|
|
69235
|
+
);
|
|
69236
|
+
const apiKey = await getApiKey(provider);
|
|
69237
|
+
if (hD2(apiKey)) {
|
|
69238
|
+
return false;
|
|
69239
|
+
}
|
|
69240
|
+
const existingConfig = getGlobalConfig();
|
|
69241
|
+
setGlobalConfig({
|
|
69242
|
+
...existingConfig,
|
|
69243
|
+
OCO_API_KEY: apiKey
|
|
69244
|
+
});
|
|
69245
|
+
console.log(source_default.green("\u2714") + " API key saved\n");
|
|
69246
|
+
return true;
|
|
69247
|
+
}
|
|
69248
|
+
var setupCommand = G3(
|
|
69249
|
+
{
|
|
69250
|
+
name: "setup" /* setup */,
|
|
69251
|
+
help: {
|
|
69252
|
+
description: "Interactive setup wizard for OpenCommit"
|
|
69253
|
+
}
|
|
69254
|
+
},
|
|
69255
|
+
async () => {
|
|
69256
|
+
await runSetup();
|
|
69257
|
+
}
|
|
69258
|
+
);
|
|
69259
|
+
|
|
69260
|
+
// src/commands/models.ts
|
|
69261
|
+
init_dist2();
|
|
69262
|
+
function formatCacheAge2(timestamp) {
|
|
69263
|
+
if (!timestamp) return "never";
|
|
69264
|
+
const ageMs = Date.now() - timestamp;
|
|
69265
|
+
const days = Math.floor(ageMs / (1e3 * 60 * 60 * 24));
|
|
69266
|
+
const hours = Math.floor(ageMs / (1e3 * 60 * 60));
|
|
69267
|
+
const minutes = Math.floor(ageMs / (1e3 * 60));
|
|
69268
|
+
if (days > 0) {
|
|
69269
|
+
return `${days} day${days === 1 ? "" : "s"} ago`;
|
|
69270
|
+
} else if (hours > 0) {
|
|
69271
|
+
return `${hours} hour${hours === 1 ? "" : "s"} ago`;
|
|
69272
|
+
} else if (minutes > 0) {
|
|
69273
|
+
return `${minutes} minute${minutes === 1 ? "" : "s"} ago`;
|
|
69274
|
+
}
|
|
69275
|
+
return "just now";
|
|
69276
|
+
}
|
|
69277
|
+
async function listModels(provider, useCache = true) {
|
|
69278
|
+
const config7 = getConfig();
|
|
69279
|
+
const apiKey = config7.OCO_API_KEY;
|
|
69280
|
+
const currentModel = config7.OCO_MODEL;
|
|
69281
|
+
let models = [];
|
|
69282
|
+
if (useCache) {
|
|
69283
|
+
const cached = getCachedModels(provider);
|
|
69284
|
+
if (cached) {
|
|
69285
|
+
models = cached;
|
|
69286
|
+
}
|
|
69287
|
+
}
|
|
69288
|
+
if (models.length === 0) {
|
|
69289
|
+
const providerKey = provider.toLowerCase();
|
|
69290
|
+
models = MODEL_LIST[providerKey] || [];
|
|
69291
|
+
}
|
|
69292
|
+
console.log(`
|
|
69293
|
+
${source_default.bold("Available models for")} ${source_default.cyan(provider)}:
|
|
69294
|
+
`);
|
|
69295
|
+
if (models.length === 0) {
|
|
69296
|
+
console.log(source_default.dim(" No models found"));
|
|
69297
|
+
} else {
|
|
69298
|
+
models.forEach((model) => {
|
|
69299
|
+
const isCurrent = model === currentModel;
|
|
69300
|
+
const prefix = isCurrent ? source_default.green("* ") : " ";
|
|
69301
|
+
const label = isCurrent ? source_default.green(model) : model;
|
|
69302
|
+
console.log(`${prefix}${label}`);
|
|
69303
|
+
});
|
|
69304
|
+
}
|
|
69305
|
+
console.log("");
|
|
69306
|
+
}
|
|
69307
|
+
async function refreshModels(provider) {
|
|
69308
|
+
const config7 = getConfig();
|
|
69309
|
+
const apiKey = config7.OCO_API_KEY;
|
|
69310
|
+
const loadingSpinner = le();
|
|
69311
|
+
loadingSpinner.start(`Fetching models from ${provider}...`);
|
|
69312
|
+
clearModelCache();
|
|
69313
|
+
try {
|
|
69314
|
+
const models = await fetchModelsForProvider(provider, apiKey, void 0, true);
|
|
69315
|
+
loadingSpinner.stop(`${source_default.green("+")} Fetched ${models.length} models`);
|
|
69316
|
+
await listModels(provider, true);
|
|
69317
|
+
} catch (error) {
|
|
69318
|
+
loadingSpinner.stop(source_default.red("Failed to fetch models"));
|
|
69319
|
+
console.error(source_default.red(`Error: ${error instanceof Error ? error.message : "Unknown error"}`));
|
|
69320
|
+
}
|
|
69321
|
+
}
|
|
69322
|
+
var modelsCommand = G3(
|
|
69323
|
+
{
|
|
69324
|
+
name: "models" /* models */,
|
|
69325
|
+
help: {
|
|
69326
|
+
description: "List and manage cached models for your AI provider"
|
|
69327
|
+
},
|
|
69328
|
+
flags: {
|
|
69329
|
+
refresh: {
|
|
69330
|
+
type: Boolean,
|
|
69331
|
+
alias: "r",
|
|
69332
|
+
description: "Clear cache and re-fetch models from the provider",
|
|
69333
|
+
default: false
|
|
69334
|
+
},
|
|
69335
|
+
provider: {
|
|
69336
|
+
type: String,
|
|
69337
|
+
alias: "p",
|
|
69338
|
+
description: "Specify provider (defaults to current OCO_AI_PROVIDER)"
|
|
69339
|
+
}
|
|
69340
|
+
}
|
|
69341
|
+
},
|
|
69342
|
+
async ({ flags }) => {
|
|
69343
|
+
const config7 = getConfig();
|
|
69344
|
+
const provider = flags.provider || config7.OCO_AI_PROVIDER || "openai" /* OPENAI */;
|
|
69345
|
+
ae(source_default.bgCyan(" OpenCommit Models "));
|
|
69346
|
+
const cacheInfo = getCacheInfo();
|
|
69347
|
+
if (cacheInfo.timestamp) {
|
|
69348
|
+
console.log(
|
|
69349
|
+
source_default.dim(` Cache last updated: ${formatCacheAge2(cacheInfo.timestamp)}`)
|
|
69350
|
+
);
|
|
69351
|
+
if (cacheInfo.providers.length > 0) {
|
|
69352
|
+
console.log(
|
|
69353
|
+
source_default.dim(` Cached providers: ${cacheInfo.providers.join(", ")}`)
|
|
69354
|
+
);
|
|
69355
|
+
}
|
|
69356
|
+
} else {
|
|
69357
|
+
console.log(source_default.dim(" No cached models"));
|
|
69358
|
+
}
|
|
69359
|
+
if (flags.refresh) {
|
|
69360
|
+
await refreshModels(provider);
|
|
69361
|
+
} else {
|
|
69362
|
+
await listModels(provider);
|
|
69363
|
+
}
|
|
69364
|
+
ce(
|
|
69365
|
+
`Run ${source_default.cyan("oco models --refresh")} to update the model list`
|
|
69366
|
+
);
|
|
69367
|
+
}
|
|
69368
|
+
);
|
|
69369
|
+
|
|
69370
|
+
// src/utils/checkIsLatestVersion.ts
|
|
69371
|
+
init_dist2();
|
|
69372
|
+
|
|
67949
69373
|
// src/version.ts
|
|
69374
|
+
init_dist2();
|
|
67950
69375
|
var getOpenCommitLatestVersion = async () => {
|
|
67951
69376
|
try {
|
|
67952
69377
|
const { stdout } = await execa("npm", ["view", "opencommit", "version"]);
|
|
@@ -67977,9 +69402,9 @@ Current version: ${currentVersion}. Latest version: ${latestVersion}.
|
|
|
67977
69402
|
};
|
|
67978
69403
|
|
|
67979
69404
|
// src/migrations/_run.ts
|
|
67980
|
-
var
|
|
67981
|
-
var
|
|
67982
|
-
var
|
|
69405
|
+
var import_fs6 = __toESM(require("fs"), 1);
|
|
69406
|
+
var import_os3 = require("os");
|
|
69407
|
+
var import_path7 = require("path");
|
|
67983
69408
|
|
|
67984
69409
|
// src/migrations/00_use_single_api_key_and_url.ts
|
|
67985
69410
|
function use_single_api_key_and_url_default() {
|
|
@@ -68070,18 +69495,19 @@ var migrations = [
|
|
|
68070
69495
|
];
|
|
68071
69496
|
|
|
68072
69497
|
// src/migrations/_run.ts
|
|
68073
|
-
|
|
69498
|
+
init_dist2();
|
|
69499
|
+
var migrationsFile = (0, import_path7.join)((0, import_os3.homedir)(), ".opencommit_migrations");
|
|
68074
69500
|
var getCompletedMigrations = () => {
|
|
68075
|
-
if (!
|
|
69501
|
+
if (!import_fs6.default.existsSync(migrationsFile)) {
|
|
68076
69502
|
return [];
|
|
68077
69503
|
}
|
|
68078
|
-
const data =
|
|
69504
|
+
const data = import_fs6.default.readFileSync(migrationsFile, "utf-8");
|
|
68079
69505
|
return data ? JSON.parse(data) : [];
|
|
68080
69506
|
};
|
|
68081
69507
|
var saveCompletedMigration = (migrationName) => {
|
|
68082
69508
|
const completedMigrations = getCompletedMigrations();
|
|
68083
69509
|
completedMigrations.push(migrationName);
|
|
68084
|
-
|
|
69510
|
+
import_fs6.default.writeFileSync(
|
|
68085
69511
|
migrationsFile,
|
|
68086
69512
|
JSON.stringify(completedMigrations, null, 2)
|
|
68087
69513
|
);
|
|
@@ -68133,7 +69559,7 @@ Z2(
|
|
|
68133
69559
|
{
|
|
68134
69560
|
version: package_default.version,
|
|
68135
69561
|
name: "opencommit",
|
|
68136
|
-
commands: [configCommand, hookCommand, commitlintConfigCommand],
|
|
69562
|
+
commands: [configCommand, hookCommand, commitlintConfigCommand, setupCommand, modelsCommand],
|
|
68137
69563
|
flags: {
|
|
68138
69564
|
fgm: {
|
|
68139
69565
|
type: Boolean,
|
|
@@ -68162,6 +69588,16 @@ Z2(
|
|
|
68162
69588
|
if (await isHookCalled()) {
|
|
68163
69589
|
prepareCommitMessageHook();
|
|
68164
69590
|
} else {
|
|
69591
|
+
if (isFirstRun()) {
|
|
69592
|
+
const setupComplete = await runSetup();
|
|
69593
|
+
if (!setupComplete) {
|
|
69594
|
+
process.exit(1);
|
|
69595
|
+
}
|
|
69596
|
+
}
|
|
69597
|
+
const hasApiKey = await promptForMissingApiKey();
|
|
69598
|
+
if (!hasApiKey) {
|
|
69599
|
+
process.exit(1);
|
|
69600
|
+
}
|
|
68165
69601
|
commit(extraArgs, flags.context, false, flags.fgm, flags.yes);
|
|
68166
69602
|
}
|
|
68167
69603
|
},
|