vue-mess-detector
Version:
A static code analysis tool for detecting code smells and best practice violations in Vue.js and Nuxt.js projects
1,307 lines • 194 kB
JavaScript
import be from "node:fs/promises";
import mr, { format as js, inspect as br } from "util";
import Er from "os";
import Cr from "yargs";
import { normalize as xr, resolve as ye, dirname as _n, basename as wr, extname as Fr, relative as yr } from "path";
import { readFileSync as Nn, statSync as Ts, readdirSync as _r, writeFile as vr } from "fs";
import { notStrictEqual as $r, strictEqual as Ar } from "assert";
import { fileURLToPath as Sr } from "url";
import Y from "node:path";
import { parse as Rr } from "@vue/compiler-sfc";
import Zt from "node:fs";
import { fileURLToPath as Br } from "node:url";
function Ws(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var Qt, Pn;
function Ln() {
if (Pn) return Qt;
Pn = 1;
let t = [], e = 0;
const n = (s, r) => {
e >= r && t.push(s);
};
return n.WARN = 1, n.INFO = 2, n.DEBUG = 3, n.reset = () => {
t = [];
}, n.setDebugLevel = (s) => {
e = s;
}, n.warn = (s) => n(s, n.WARN), n.info = (s) => n(s, n.INFO), n.debug = (s) => n(s, n.DEBUG), n.debugMessages = () => t, Qt = n, Qt;
}
var Ve = { exports: {} }, Xt, zn;
function Or() {
return zn || (zn = 1, Xt = ({ onlyFirst: t = !1 } = {}) => {
const e = [
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
].join("|");
return new RegExp(e, t ? void 0 : "g");
}), Xt;
}
var en, qn;
function Nr() {
if (qn) return en;
qn = 1;
const t = Or();
return en = (e) => typeof e == "string" ? e.replace(t(), "") : e, en;
}
var Ge = { exports: {} }, Hn;
function Lr() {
if (Hn) return Ge.exports;
Hn = 1;
const t = (e) => Number.isNaN(e) ? !1 : e >= 4352 && (e <= 4447 || // Hangul Jamo
e === 9001 || // LEFT-POINTING ANGLE BRACKET
e === 9002 || // RIGHT-POINTING ANGLE BRACKET
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
11904 <= e && e <= 12871 && e !== 12351 || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
12880 <= e && e <= 19903 || // CJK Unified Ideographs .. Yi Radicals
19968 <= e && e <= 42182 || // Hangul Jamo Extended-A
43360 <= e && e <= 43388 || // Hangul Syllables
44032 <= e && e <= 55203 || // CJK Compatibility Ideographs
63744 <= e && e <= 64255 || // Vertical Forms
65040 <= e && e <= 65049 || // CJK Compatibility Forms .. Small Form Variants
65072 <= e && e <= 65131 || // Halfwidth and Fullwidth Forms
65281 <= e && e <= 65376 || 65504 <= e && e <= 65510 || // Kana Supplement
110592 <= e && e <= 110593 || // Enclosed Ideographic Supplement
127488 <= e && e <= 127569 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
131072 <= e && e <= 262141);
return Ge.exports = t, Ge.exports.default = t, Ge.exports;
}
var tn, Vn;
function jr() {
return Vn || (Vn = 1, tn = function() {
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
}), tn;
}
var Gn;
function Tr() {
if (Gn) return Ve.exports;
Gn = 1;
const t = Nr(), e = Lr(), n = jr(), s = (r) => {
if (typeof r != "string" || r.length === 0 || (r = t(r), r.length === 0))
return 0;
r = r.replace(n(), " ");
let o = 0;
for (let i = 0; i < r.length; i++) {
const u = r.codePointAt(i);
u <= 31 || u >= 127 && u <= 159 || u >= 768 && u <= 879 || (u > 65535 && i++, o += e(u) ? 2 : 1);
}
return o;
};
return Ve.exports = s, Ve.exports.default = s, Ve.exports;
}
var nn, Un;
function Ms() {
if (Un) return nn;
Un = 1;
const t = Tr();
function e(D) {
return D ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
}
function n(D) {
let C = e();
return ("" + D).replace(C, "").split(`
`).reduce(function(B, $) {
return t($) > B ? t($) : B;
}, 0);
}
function s(D, C) {
return Array(C + 1).join(D);
}
function r(D, C, w, v) {
let B = n(D);
if (C + 1 >= B) {
let $ = C - B;
switch (v) {
case "right": {
D = s(w, $) + D;
break;
}
case "center": {
let I = Math.ceil($ / 2), M = $ - I;
D = s(w, M) + D + s(w, I);
break;
}
default: {
D = D + s(w, $);
break;
}
}
}
return D;
}
let o = {};
function i(D, C, w) {
C = "\x1B[" + C + "m", w = "\x1B[" + w + "m", o[C] = { set: D, to: !0 }, o[w] = { set: D, to: !1 }, o[D] = { on: C, off: w };
}
i("bold", 1, 22), i("italics", 3, 23), i("underline", 4, 24), i("inverse", 7, 27), i("strikethrough", 9, 29);
function u(D, C) {
let w = C[1] ? parseInt(C[1].split(";")[0]) : 0;
if (w >= 30 && w <= 39 || w >= 90 && w <= 97) {
D.lastForegroundAdded = C[0];
return;
}
if (w >= 40 && w <= 49 || w >= 100 && w <= 107) {
D.lastBackgroundAdded = C[0];
return;
}
if (w === 0) {
for (let B in D)
Object.prototype.hasOwnProperty.call(D, B) && delete D[B];
return;
}
let v = o[C[0]];
v && (D[v.set] = v.to);
}
function a(D) {
let C = e(!0), w = C.exec(D), v = {};
for (; w !== null; )
u(v, w), w = C.exec(D);
return v;
}
function f(D, C) {
let w = D.lastBackgroundAdded, v = D.lastForegroundAdded;
return delete D.lastBackgroundAdded, delete D.lastForegroundAdded, Object.keys(D).forEach(function(B) {
D[B] && (C += o[B].off);
}), w && w != "\x1B[49m" && (C += "\x1B[49m"), v && v != "\x1B[39m" && (C += "\x1B[39m"), C;
}
function p(D, C) {
let w = D.lastBackgroundAdded, v = D.lastForegroundAdded;
return delete D.lastBackgroundAdded, delete D.lastForegroundAdded, Object.keys(D).forEach(function(B) {
D[B] && (C = o[B].on + C);
}), w && w != "\x1B[49m" && (C = w + C), v && v != "\x1B[39m" && (C = v + C), C;
}
function E(D, C) {
if (D.length === n(D))
return D.substr(0, C);
for (; n(D) > C; )
D = D.slice(0, -1);
return D;
}
function h(D, C) {
let w = e(!0), v = D.split(e()), B = 0, $ = 0, I = "", M, H = {};
for (; $ < C; ) {
M = w.exec(D);
let U = v[B];
if (B++, $ + n(U) > C && (U = E(U, C - $)), I += U, $ += n(U), $ < C) {
if (!M)
break;
I += M[0], u(H, M);
}
}
return f(H, I);
}
function d(D, C, w) {
if (w = w || "…", n(D) <= C)
return D;
C -= n(w);
let B = h(D, C);
B += w;
const $ = "\x1B]8;;\x07";
return D.includes($) && !B.includes($) && (B += $), B;
}
function F() {
return {
chars: {
top: "─",
"top-mid": "┬",
"top-left": "┌",
"top-right": "┐",
bottom: "─",
"bottom-mid": "┴",
"bottom-left": "└",
"bottom-right": "┘",
left: "│",
"left-mid": "├",
mid: "─",
"mid-mid": "┼",
right: "│",
"right-mid": "┤",
middle: "│"
},
truncate: "…",
colWidths: [],
rowHeights: [],
colAligns: [],
rowAligns: [],
style: {
"padding-left": 1,
"padding-right": 1,
head: ["red"],
border: ["grey"],
compact: !1
},
head: []
};
}
function m(D, C) {
D = D || {}, C = C || F();
let w = Object.assign({}, C, D);
return w.chars = Object.assign({}, C.chars, D.chars), w.style = Object.assign({}, C.style, D.style), w;
}
function c(D, C) {
let w = [], v = C.split(/(\s+)/g), B = [], $ = 0, I;
for (let M = 0; M < v.length; M += 2) {
let H = v[M], U = $ + n(H);
$ > 0 && I && (U += I.length), U > D ? ($ !== 0 && w.push(B.join("")), B = [H], $ = n(H)) : (B.push(I || "", H), $ = U), I = v[M + 1];
}
return $ && w.push(B.join("")), w;
}
function S(D, C) {
let w = [], v = "";
function B(I, M) {
for (v.length && M && (v += M), v += I; v.length > D; )
w.push(v.slice(0, D)), v = v.slice(D);
}
let $ = C.split(/(\s+)/g);
for (let I = 0; I < $.length; I += 2)
B($[I], I && $[I - 1]);
return v.length && w.push(v), w;
}
function L(D, C, w = !0) {
let v = [];
C = C.split(`
`);
const B = w ? c : S;
for (let $ = 0; $ < C.length; $++)
v.push.apply(v, B(D, C[$]));
return v;
}
function y(D) {
let C = {}, w = [];
for (let v = 0; v < D.length; v++) {
let B = p(C, D[v]);
C = a(B);
let $ = Object.assign({}, C);
w.push(f($, B));
}
return w;
}
function _(D, C) {
const w = "\x1B]", v = "\x07", B = ";";
return [w, "8", B, B, D || C, v, C, w, "8", B, B, v].join("");
}
return nn = {
strlen: n,
repeat: s,
pad: r,
truncate: d,
mergeOptions: m,
wordWrap: L,
colorizeLines: y,
hyperlink: _
}, nn;
}
var sn = { exports: {} }, Ae = { exports: {} }, rn = { exports: {} }, on = { exports: {} }, un = { exports: {} }, Zn;
function Wr() {
return Zn || (Zn = 1, function(t) {
var e = {};
t.exports = e;
var n = {
reset: [0, 0],
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29],
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
gray: [90, 39],
grey: [90, 39],
brightRed: [91, 39],
brightGreen: [92, 39],
brightYellow: [93, 39],
brightBlue: [94, 39],
brightMagenta: [95, 39],
brightCyan: [96, 39],
brightWhite: [97, 39],
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
bgGray: [100, 49],
bgGrey: [100, 49],
bgBrightRed: [101, 49],
bgBrightGreen: [102, 49],
bgBrightYellow: [103, 49],
bgBrightBlue: [104, 49],
bgBrightMagenta: [105, 49],
bgBrightCyan: [106, 49],
bgBrightWhite: [107, 49],
// legacy styles for colors pre v1.0.0
blackBG: [40, 49],
redBG: [41, 49],
greenBG: [42, 49],
yellowBG: [43, 49],
blueBG: [44, 49],
magentaBG: [45, 49],
cyanBG: [46, 49],
whiteBG: [47, 49]
};
Object.keys(n).forEach(function(s) {
var r = n[s], o = e[s] = [];
o.open = "\x1B[" + r[0] + "m", o.close = "\x1B[" + r[1] + "m";
});
}(un)), un.exports;
}
var an, Kn;
function Mr() {
return Kn || (Kn = 1, an = function(t, e) {
e = e || process.argv;
var n = e.indexOf("--"), s = /^-{1,2}/.test(t) ? "" : "--", r = e.indexOf(s + t);
return r !== -1 && (n === -1 ? !0 : r < n);
}), an;
}
var cn, Yn;
function kr() {
if (Yn) return cn;
Yn = 1;
var t = Er, e = Mr(), n = process.env, s = void 0;
e("no-color") || e("no-colors") || e("color=false") ? s = !1 : (e("color") || e("colors") || e("color=true") || e("color=always")) && (s = !0), "FORCE_COLOR" in n && (s = n.FORCE_COLOR.length === 0 || parseInt(n.FORCE_COLOR, 10) !== 0);
function r(u) {
return u === 0 ? !1 : {
level: u,
hasBasic: !0,
has256: u >= 2,
has16m: u >= 3
};
}
function o(u) {
if (s === !1)
return 0;
if (e("color=16m") || e("color=full") || e("color=truecolor"))
return 3;
if (e("color=256"))
return 2;
if (u && !u.isTTY && s !== !0)
return 0;
var a = s ? 1 : 0;
if (process.platform === "win32") {
var f = t.release().split(".");
return Number(process.versions.node.split(".")[0]) >= 8 && Number(f[0]) >= 10 && Number(f[2]) >= 10586 ? Number(f[2]) >= 14931 ? 3 : 2 : 1;
}
if ("CI" in n)
return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(E) {
return E in n;
}) || n.CI_NAME === "codeship" ? 1 : a;
if ("TEAMCITY_VERSION" in n)
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION) ? 1 : 0;
if ("TERM_PROGRAM" in n) {
var p = parseInt((n.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
switch (n.TERM_PROGRAM) {
case "iTerm.app":
return p >= 3 ? 3 : 2;
case "Hyper":
return 3;
case "Apple_Terminal":
return 2;
}
}
return /-256(color)?$/i.test(n.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM) || "COLORTERM" in n ? 1 : (n.TERM === "dumb", a);
}
function i(u) {
var a = o(u);
return r(a);
}
return cn = {
supportsColor: i,
stdout: i(process.stdout),
stderr: i(process.stderr)
}, cn;
}
var ln = { exports: {} }, Jn;
function Ir() {
return Jn || (Jn = 1, function(t) {
t.exports = function(n, s) {
var r = "";
n = n || "Run the trap, drop the bass", n = n.split("");
var o = {
a: ["@", "Ą", "Ⱥ", "Ʌ", "Δ", "Λ", "Д"],
b: ["ß", "Ɓ", "Ƀ", "ɮ", "β", "฿"],
c: ["©", "Ȼ", "Ͼ"],
d: ["Ð", "Ɗ", "Ԁ", "ԁ", "Ԃ", "ԃ"],
e: [
"Ë",
"ĕ",
"Ǝ",
"ɘ",
"Σ",
"ξ",
"Ҽ",
"੬"
],
f: ["Ӻ"],
g: ["ɢ"],
h: ["Ħ", "ƕ", "Ң", "Һ", "Ӈ", "Ԋ"],
i: ["༏"],
j: ["Ĵ"],
k: ["ĸ", "Ҡ", "Ӄ", "Ԟ"],
l: ["Ĺ"],
m: ["ʍ", "Ӎ", "ӎ", "Ԡ", "ԡ", "൩"],
n: ["Ñ", "ŋ", "Ɲ", "Ͷ", "Π", "Ҋ"],
o: [
"Ø",
"õ",
"ø",
"Ǿ",
"ʘ",
"Ѻ",
"ם",
"",
"๏"
],
p: ["Ƿ", "Ҏ"],
q: ["্"],
r: ["®", "Ʀ", "Ȑ", "Ɍ", "ʀ", "Я"],
s: ["§", "Ϟ", "ϟ", "Ϩ"],
t: ["Ł", "Ŧ", "ͳ"],
u: ["Ʊ", "Ս"],
v: ["ט"],
w: ["Ш", "Ѡ", "Ѽ", "൰"],
x: ["Ҳ", "Ӿ", "Ӽ", "ӽ"],
y: ["¥", "Ұ", "Ӌ"],
z: ["Ƶ", "ɀ"]
};
return n.forEach(function(i) {
i = i.toLowerCase();
var u = o[i] || [" "], a = Math.floor(Math.random() * u.length);
typeof o[i] < "u" ? r += o[i][a] : r += i;
}), r;
};
}(ln)), ln.exports;
}
var hn = { exports: {} }, Qn;
function Pr() {
return Qn || (Qn = 1, function(t) {
t.exports = function(n, s) {
n = n || " he is here ";
var r = {
up: [
"̍",
"̎",
"̄",
"̅",
"̿",
"̑",
"̆",
"̐",
"͒",
"͗",
"͑",
"̇",
"̈",
"̊",
"͂",
"̓",
"̈",
"͊",
"͋",
"͌",
"̃",
"̂",
"̌",
"͐",
"̀",
"́",
"̋",
"̏",
"̒",
"̓",
"̔",
"̽",
"̉",
"ͣ",
"ͤ",
"ͥ",
"ͦ",
"ͧ",
"ͨ",
"ͩ",
"ͪ",
"ͫ",
"ͬ",
"ͭ",
"ͮ",
"ͯ",
"̾",
"͛",
"͆",
"̚"
],
down: [
"̖",
"̗",
"̘",
"̙",
"̜",
"̝",
"̞",
"̟",
"̠",
"̤",
"̥",
"̦",
"̩",
"̪",
"̫",
"̬",
"̭",
"̮",
"̯",
"̰",
"̱",
"̲",
"̳",
"̹",
"̺",
"̻",
"̼",
"ͅ",
"͇",
"͈",
"͉",
"͍",
"͎",
"͓",
"͔",
"͕",
"͖",
"͙",
"͚",
"̣"
],
mid: [
"̕",
"̛",
"̀",
"́",
"͘",
"̡",
"̢",
"̧",
"̨",
"̴",
"̵",
"̶",
"͜",
"͝",
"͞",
"͟",
"͠",
"͢",
"̸",
"̷",
"͡",
" ҉"
]
}, o = [].concat(r.up, r.down, r.mid);
function i(f) {
var p = Math.floor(Math.random() * f);
return p;
}
function u(f) {
var p = !1;
return o.filter(function(E) {
p = E === f;
}), p;
}
function a(f, p) {
var E = "", h, d;
p = p || {}, p.up = typeof p.up < "u" ? p.up : !0, p.mid = typeof p.mid < "u" ? p.mid : !0, p.down = typeof p.down < "u" ? p.down : !0, p.size = typeof p.size < "u" ? p.size : "maxi", f = f.split("");
for (d in f)
if (!u(d)) {
switch (E = E + f[d], h = { up: 0, down: 0, mid: 0 }, p.size) {
case "mini":
h.up = i(8), h.mid = i(2), h.down = i(8);
break;
case "maxi":
h.up = i(16) + 3, h.mid = i(4) + 1, h.down = i(64) + 3;
break;
default:
h.up = i(8) + 1, h.mid = i(6) / 2, h.down = i(8) + 1;
break;
}
var F = ["up", "mid", "down"];
for (var m in F)
for (var c = F[m], S = 0; S <= h[c]; S++)
p[c] && (E = E + r[c][i(r[c].length)]);
}
return E;
}
return a(n, s);
};
}(hn)), hn.exports;
}
var fn = { exports: {} }, Xn;
function zr() {
return Xn || (Xn = 1, function(t) {
t.exports = function(e) {
return function(n, s, r) {
if (n === " ") return n;
switch (s % 3) {
case 0:
return e.red(n);
case 1:
return e.white(n);
case 2:
return e.blue(n);
}
};
};
}(fn)), fn.exports;
}
var pn = { exports: {} }, es;
function qr() {
return es || (es = 1, function(t) {
t.exports = function(e) {
return function(n, s, r) {
return s % 2 === 0 ? n : e.inverse(n);
};
};
}(pn)), pn.exports;
}
var Dn = { exports: {} }, ts;
function Hr() {
return ts || (ts = 1, function(t) {
t.exports = function(e) {
var n = ["red", "yellow", "green", "blue", "magenta"];
return function(s, r, o) {
return s === " " ? s : e[n[r++ % n.length]](s);
};
};
}(Dn)), Dn.exports;
}
var dn = { exports: {} }, ns;
function Vr() {
return ns || (ns = 1, function(t) {
t.exports = function(e) {
var n = [
"underline",
"inverse",
"grey",
"yellow",
"red",
"green",
"blue",
"white",
"cyan",
"magenta",
"brightYellow",
"brightRed",
"brightGreen",
"brightBlue",
"brightWhite",
"brightCyan",
"brightMagenta"
];
return function(s, r, o) {
return s === " " ? s : e[n[Math.round(Math.random() * (n.length - 2))]](s);
};
};
}(dn)), dn.exports;
}
var ss;
function Gr() {
return ss || (ss = 1, function(t) {
var e = {};
t.exports = e, e.themes = {};
var n = mr, s = e.styles = Wr(), r = Object.defineProperties, o = new RegExp(/[\r\n]+/g);
e.supportsColor = kr().supportsColor, typeof e.enabled > "u" && (e.enabled = e.supportsColor() !== !1), e.enable = function() {
e.enabled = !0;
}, e.disable = function() {
e.enabled = !1;
}, e.stripColors = e.strip = function(m) {
return ("" + m).replace(/\x1B\[\d+m/g, "");
}, e.stylize = function(c, S) {
if (!e.enabled)
return c + "";
var L = s[S];
return !L && S in e ? e[S](c) : L.open + c + L.close;
};
var i = /[|\\{}()[\]^$+*?.]/g, u = function(m) {
if (typeof m != "string")
throw new TypeError("Expected a string");
return m.replace(i, "\\$&");
};
function a(m) {
var c = function S() {
return E.apply(S, arguments);
};
return c._styles = m, c.__proto__ = p, c;
}
var f = function() {
var m = {};
return s.grey = s.gray, Object.keys(s).forEach(function(c) {
s[c].closeRe = new RegExp(u(s[c].close), "g"), m[c] = {
get: function() {
return a(this._styles.concat(c));
}
};
}), m;
}(), p = r(function() {
}, f);
function E() {
var m = Array.prototype.slice.call(arguments), c = m.map(function(D) {
return D != null && D.constructor === String ? D : n.inspect(D);
}).join(" ");
if (!e.enabled || !c)
return c;
for (var S = c.indexOf(`
`) != -1, L = this._styles, y = L.length; y--; ) {
var _ = s[L[y]];
c = _.open + c.replace(_.closeRe, _.open) + _.close, S && (c = c.replace(o, function(D) {
return _.close + D + _.open;
}));
}
return c;
}
e.setTheme = function(m) {
if (typeof m == "string") {
console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");
return;
}
for (var c in m)
(function(S) {
e[S] = function(L) {
if (typeof m[S] == "object") {
var y = L;
for (var _ in m[S])
y = e[m[S][_]](y);
return y;
}
return e[m[S]](L);
};
})(c);
};
function h() {
var m = {};
return Object.keys(f).forEach(function(c) {
m[c] = {
get: function() {
return a([c]);
}
};
}), m;
}
var d = function(c, S) {
var L = S.split("");
return L = L.map(c), L.join("");
};
e.trap = Ir(), e.zalgo = Pr(), e.maps = {}, e.maps.america = zr()(e), e.maps.zebra = qr()(e), e.maps.rainbow = Hr()(e), e.maps.random = Vr()(e);
for (var F in e.maps)
(function(m) {
e[m] = function(c) {
return d(e.maps[m], c);
};
})(F);
r(e, h());
}(on)), on.exports;
}
var rs;
function Ur() {
return rs || (rs = 1, function(t) {
var e = Gr();
t.exports = e;
}(rn)), rn.exports;
}
var os;
function Zr() {
if (os) return Ae.exports;
os = 1;
const { info: t, debug: e } = Ln(), n = Ms();
class s {
/**
* A representation of a cell within the table.
* Implementations must have `init` and `draw` methods,
* as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties.
* @param options
* @constructor
*/
constructor(h) {
this.setOptions(h), this.x = null, this.y = null;
}
setOptions(h) {
["boolean", "number", "bigint", "string"].indexOf(typeof h) !== -1 && (h = { content: "" + h }), h = h || {}, this.options = h;
let d = h.content;
if (["boolean", "number", "bigint", "string"].indexOf(typeof d) !== -1)
this.content = String(d);
else if (!d)
this.content = this.options.href || "";
else
throw new Error("Content needs to be a primitive, got: " + typeof d);
this.colSpan = h.colSpan || 1, this.rowSpan = h.rowSpan || 1, this.options.href && Object.defineProperty(this, "href", {
get() {
return this.options.href;
}
});
}
mergeTableOptions(h, d) {
this.cells = d;
let F = this.options.chars || {}, m = h.chars, c = this.chars = {};
p.forEach(function(y) {
u(F, m, y, c);
}), this.truncate = this.options.truncate || h.truncate;
let S = this.options.style = this.options.style || {}, L = h.style;
u(S, L, "padding-left", this), u(S, L, "padding-right", this), this.head = S.head || L.head, this.border = S.border || L.border, this.fixedWidth = h.colWidths[this.x], this.lines = this.computeLines(h), this.desiredWidth = n.strlen(this.content) + this.paddingLeft + this.paddingRight, this.desiredHeight = this.lines.length;
}
computeLines(h) {
const d = h.wordWrap || h.textWrap, { wordWrap: F = d } = this.options;
if (this.fixedWidth && F) {
if (this.fixedWidth -= this.paddingLeft + this.paddingRight, this.colSpan) {
let S = 1;
for (; S < this.colSpan; )
this.fixedWidth += h.colWidths[this.x + S], S++;
}
const { wrapOnWordBoundary: m = !0 } = h, { wrapOnWordBoundary: c = m } = this.options;
return this.wrapLines(n.wordWrap(this.fixedWidth, this.content, c));
}
return this.wrapLines(this.content.split(`
`));
}
wrapLines(h) {
const d = n.colorizeLines(h);
return this.href ? d.map((F) => n.hyperlink(this.href, F)) : d;
}
/**
* Initializes the Cells data structure.
*
* @param tableOptions - A fully populated set of tableOptions.
* In addition to the standard default values, tableOptions must have fully populated the
* `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number
* of columns or rows (respectively) in this table, and each array item must be a Number.
*
*/
init(h) {
let d = this.x, F = this.y;
this.widths = h.colWidths.slice(d, d + this.colSpan), this.heights = h.rowHeights.slice(F, F + this.rowSpan), this.width = this.widths.reduce(f, -1), this.height = this.heights.reduce(f, -1), this.hAlign = this.options.hAlign || h.colAligns[d], this.vAlign = this.options.vAlign || h.rowAligns[F], this.drawRight = d + this.colSpan == h.colWidths.length;
}
/**
* Draws the given line of the cell.
* This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`.
* @param lineNum - can be `top`, `bottom` or a numerical line number.
* @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how
* many rows below it's being called from. Otherwise it's undefined.
* @returns {String} The representation of this line.
*/
draw(h, d) {
if (h == "top") return this.drawTop(this.drawRight);
if (h == "bottom") return this.drawBottom(this.drawRight);
let F = n.truncate(this.content, 10, this.truncate);
h || t(`${this.y}-${this.x}: ${this.rowSpan - h}x${this.colSpan} Cell ${F}`);
let m = Math.max(this.height - this.lines.length, 0), c;
switch (this.vAlign) {
case "center":
c = Math.ceil(m / 2);
break;
case "bottom":
c = m;
break;
default:
c = 0;
}
if (h < c || h >= c + this.lines.length)
return this.drawEmpty(this.drawRight, d);
let S = this.lines.length > this.height && h + 1 >= this.height;
return this.drawLine(h - c, this.drawRight, S, d);
}
/**
* Renders the top line of the cell.
* @param drawRight - true if this method should render the right edge of the cell.
* @returns {String}
*/
drawTop(h) {
let d = [];
return this.cells ? this.widths.forEach(function(F, m) {
d.push(this._topLeftChar(m)), d.push(n.repeat(this.chars[this.y == 0 ? "top" : "mid"], F));
}, this) : (d.push(this._topLeftChar(0)), d.push(n.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width))), h && d.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]), this.wrapWithStyleColors("border", d.join(""));
}
_topLeftChar(h) {
let d = this.x + h, F;
if (this.y == 0)
F = d == 0 ? "topLeft" : h == 0 ? "topMid" : "top";
else if (d == 0)
F = "leftMid";
else if (F = h == 0 ? "midMid" : "bottomMid", this.cells && (this.cells[this.y - 1][d] instanceof s.ColSpanCell && (F = h == 0 ? "topMid" : "mid"), h == 0)) {
let c = 1;
for (; this.cells[this.y][d - c] instanceof s.ColSpanCell; )
c++;
this.cells[this.y][d - c] instanceof s.RowSpanCell && (F = "leftMid");
}
return this.chars[F];
}
wrapWithStyleColors(h, d) {
if (this[h] && this[h].length)
try {
let F = Ur();
for (let m = this[h].length - 1; m >= 0; m--)
F = F[this[h][m]];
return F(d);
} catch {
return d;
}
else
return d;
}
/**
* Renders a line of text.
* @param lineNum - Which line of text to render. This is not necessarily the line within the cell.
* There may be top-padding above the first line of text.
* @param drawRight - true if this method should render the right edge of the cell.
* @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even
* if the text fits. This is used when the cell is vertically truncated. If `false` the text should
* only include the truncation symbol if the text will not fit horizontally within the cell width.
* @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
* @returns {String}
*/
drawLine(h, d, F, m) {
let c = this.chars[this.x == 0 ? "left" : "middle"];
if (this.x && m && this.cells) {
let w = this.cells[this.y + m][this.x - 1];
for (; w instanceof r; )
w = this.cells[w.y][w.x - 1];
w instanceof o || (c = this.chars.rightMid);
}
let S = n.repeat(" ", this.paddingLeft), L = d ? this.chars.right : "", y = n.repeat(" ", this.paddingRight), _ = this.lines[h], D = this.width - (this.paddingLeft + this.paddingRight);
F && (_ += this.truncate || "…");
let C = n.truncate(_, D, this.truncate);
return C = n.pad(C, D, " ", this.hAlign), C = S + C + y, this.stylizeLine(c, C, L);
}
stylizeLine(h, d, F) {
return h = this.wrapWithStyleColors("border", h), F = this.wrapWithStyleColors("border", F), this.y === 0 && (d = this.wrapWithStyleColors("head", d)), h + d + F;
}
/**
* Renders the bottom line of the cell.
* @param drawRight - true if this method should render the right edge of the cell.
* @returns {String}
*/
drawBottom(h) {
let d = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"], F = n.repeat(this.chars.bottom, this.width), m = h ? this.chars.bottomRight : "";
return this.wrapWithStyleColors("border", d + F + m);
}
/**
* Renders a blank line of text within the cell. Used for top and/or bottom padding.
* @param drawRight - true if this method should render the right edge of the cell.
* @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
* @returns {String}
*/
drawEmpty(h, d) {
let F = this.chars[this.x == 0 ? "left" : "middle"];
if (this.x && d && this.cells) {
let S = this.cells[this.y + d][this.x - 1];
for (; S instanceof r; )
S = this.cells[S.y][S.x - 1];
S instanceof o || (F = this.chars.rightMid);
}
let m = h ? this.chars.right : "", c = n.repeat(" ", this.width);
return this.stylizeLine(F, c, m);
}
}
class r {
/**
* A Cell that doesn't do anything. It just draws empty lines.
* Used as a placeholder in column spanning.
* @constructor
*/
constructor() {
}
draw(h) {
return typeof h == "number" && e(`${this.y}-${this.x}: 1x1 ColSpanCell`), "";
}
init() {
}
mergeTableOptions() {
}
}
class o {
/**
* A placeholder Cell for a Cell that spans multiple rows.
* It delegates rendering to the original cell, but adds the appropriate offset.
* @param originalCell
* @constructor
*/
constructor(h) {
this.originalCell = h;
}
init(h) {
let d = this.y, F = this.originalCell.y;
this.cellOffset = d - F, this.offset = a(h.rowHeights, F, this.cellOffset);
}
draw(h) {
return h == "top" ? this.originalCell.draw(this.offset, this.cellOffset) : h == "bottom" ? this.originalCell.draw("bottom") : (e(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`), this.originalCell.draw(this.offset + 1 + h));
}
mergeTableOptions() {
}
}
function i(...E) {
return E.filter((h) => h != null).shift();
}
function u(E, h, d, F) {
let m = d.split("-");
m.length > 1 ? (m[1] = m[1].charAt(0).toUpperCase() + m[1].substr(1), m = m.join(""), F[m] = i(E[m], E[d], h[m], h[d])) : F[d] = i(E[d], h[d]);
}
function a(E, h, d) {
let F = E[h];
for (let m = 1; m < d; m++)
F += 1 + E[h + m];
return F;
}
function f(E, h) {
return E + h + 1;
}
let p = [
"top",
"top-mid",
"top-left",
"top-right",
"bottom",
"bottom-mid",
"bottom-left",
"bottom-right",
"left",
"left-mid",
"mid",
"mid-mid",
"right",
"right-mid",
"middle"
];
return Ae.exports = s, Ae.exports.ColSpanCell = r, Ae.exports.RowSpanCell = o, Ae.exports;
}
var is;
function Kr() {
if (is) return sn.exports;
is = 1;
const { warn: t, debug: e } = Ln(), n = Zr(), { ColSpanCell: s, RowSpanCell: r } = n;
(function() {
function i(y, _) {
return y[_] > 0 ? i(y, _ + 1) : _;
}
function u(y) {
let _ = {};
y.forEach(function(D, C) {
let w = 0;
D.forEach(function(v) {
v.y = C, v.x = C ? i(_, w) : w;
const B = v.rowSpan || 1, $ = v.colSpan || 1;
if (B > 1)
for (let I = 0; I < $; I++)
_[v.x + I] = B;
w = v.x + $;
}), Object.keys(_).forEach((v) => {
_[v]--, _[v] < 1 && delete _[v];
});
});
}
function a(y) {
let _ = 0;
return y.forEach(function(D) {
D.forEach(function(C) {
_ = Math.max(_, C.x + (C.colSpan || 1));
});
}), _;
}
function f(y) {
return y.length;
}
function p(y, _) {
let D = y.y, C = y.y - 1 + (y.rowSpan || 1), w = _.y, v = _.y - 1 + (_.rowSpan || 1), B = !(D > v || w > C), $ = y.x, I = y.x - 1 + (y.colSpan || 1), M = _.x, H = _.x - 1 + (_.colSpan || 1), U = !($ > H || M > I);
return B && U;
}
function E(y, _, D) {
let C = Math.min(y.length - 1, D), w = { x: _, y: D };
for (let v = 0; v <= C; v++) {
let B = y[v];
for (let $ = 0; $ < B.length; $++)
if (p(w, B[$]))
return !0;
}
return !1;
}
function h(y, _, D, C) {
for (let w = D; w < C; w++)
if (E(y, w, _))
return !1;
return !0;
}
function d(y) {
y.forEach(function(_, D) {
_.forEach(function(C) {
for (let w = 1; w < C.rowSpan; w++) {
let v = new r(C);
v.x = C.x, v.y = C.y + w, v.colSpan = C.colSpan, m(v, y[D + w]);
}
});
});
}
function F(y) {
for (let _ = y.length - 1; _ >= 0; _--) {
let D = y[_];
for (let C = 0; C < D.length; C++) {
let w = D[C];
for (let v = 1; v < w.colSpan; v++) {
let B = new s();
B.x = w.x + v, B.y = w.y, D.splice(C + 1, 0, B);
}
}
}
}
function m(y, _) {
let D = 0;
for (; D < _.length && _[D].x < y.x; )
D++;
_.splice(D, 0, y);
}
function c(y) {
let _ = f(y), D = a(y);
e(`Max rows: ${_}; Max cols: ${D}`);
for (let C = 0; C < _; C++)
for (let w = 0; w < D; w++)
if (!E(y, w, C)) {
let v = { x: w, y: C, colSpan: 1, rowSpan: 1 };
for (w++; w < D && !E(y, w, C); )
v.colSpan++, w++;
let B = C + 1;
for (; B < _ && h(y, B, v.x, v.x + v.colSpan); )
v.rowSpan++, B++;
let $ = new n(v);
$.x = v.x, $.y = v.y, t(`Missing cell at ${$.y}-${$.x}.`), m($, y[C]);
}
}
function S(y) {
return y.map(function(_) {
if (!Array.isArray(_)) {
let D = Object.keys(_)[0];
_ = _[D], Array.isArray(_) ? (_ = _.slice(), _.unshift(D)) : _ = [D, _];
}
return _.map(function(D) {
return new n(D);
});
});
}
function L(y) {
let _ = S(y);
return u(_), c(_), d(_), F(_), _;
}
sn.exports = {
makeTableLayout: L,
layoutTable: u,
addRowSpanCells: d,
maxWidth: a,
fillInTable: c,
computeWidths: o("colSpan", "desiredWidth", "x", 1),
computeHeights: o("rowSpan", "desiredHeight", "y", 1)
};
})();
function o(i, u, a, f) {
return function(p, E) {
let h = [], d = [], F = {};
E.forEach(function(m) {
m.forEach(function(c) {
(c[i] || 1) > 1 ? d.push(c) : h[c[a]] = Math.max(h[c[a]] || 0, c[u] || 0, f);
});
}), p.forEach(function(m, c) {
typeof m == "number" && (h[c] = m);
});
for (let m = d.length - 1; m >= 0; m--) {
let c = d[m], S = c[i], L = c[a], y = h[L], _ = typeof p[L] == "number" ? 0 : 1;
if (typeof y == "number")
for (let D = 1; D < S; D++)
y += 1 + h[L + D], typeof p[L + D] != "number" && _++;
else
y = u === "desiredWidth" ? c.desiredWidth - 1 : 1, (!F[L] || F[L] < y) && (F[L] = y);
if (c[u] > y) {
let D = 0;
for (; _ > 0 && c[u] > y; ) {
if (typeof p[L + D] != "number") {
let C = Math.round((c[u] - y) / _);
y += C, h[L + D] += C, _--;
}
D++;
}
}
}
Object.assign(p, h, F);
for (let m = 0; m < p.length; m++)
p[m] = Math.max(f, p[m] || 0);
};
}
return sn.exports;
}
var gn, us;
function Yr() {
if (us) return gn;
us = 1;
const t = Ln(), e = Ms(), n = Kr();
class s extends Array {
constructor(i) {
super();
const u = e.mergeOptions(i);
if (Object.defineProperty(this, "options", {
value: u,
enumerable: u.debug
}), u.debug) {
switch (typeof u.debug) {
case "boolean":
t.setDebugLevel(t.WARN);
break;
case "number":
t.setDebugLevel(u.debug);
break;
case "string":
t.setDebugLevel(parseInt(u.debug, 10));
break;
default:
t.setDebugLevel(t.WARN), t.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof u.debug}`);
}
Object.defineProperty(this, "messages", {
get() {
return t.debugMessages();
}
});
}
}
toString() {
let i = this, u = this.options.head && this.options.head.length;
u ? (i = [this.options.head], this.length && i.push.apply(i, this)) : this.options.style.head = [];
let a = n.makeTableLayout(i);
a.forEach(function(p) {
p.forEach(function(E) {
E.mergeTableOptions(this.options, a);
}, this);
}, this), n.computeWidths(this.options.colWidths, a), n.computeHeights(this.options.rowHeights, a), a.forEach(function(p) {
p.forEach(function(E) {
E.init(this.options);
}, this);
}, this);
let f = [];
for (let p = 0; p < a.length; p++) {
let E = a[p], h = this.options.rowHeights[p];
(p === 0 || !this.options.style.compact || p == 1 && u) && r(E, "top", f);
for (let d = 0; d < h; d++)
r(E, d, f);
p + 1 == a.length && r(E, "bottom", f);
}
return f.join(`
`);
}
get width() {
return this.toString().split(`
`)[0].length;
}
}
s.reset = () => t.reset();
function r(o, i, u) {
let a = [];
o.forEach(function(p) {
a.