UNPKG

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,316 lines (1,315 loc) 188 kB
import ae from "node:fs/promises"; import ar, { format as _s } from "util"; import lr from "os"; import fr from "yargs"; import { resolve as wn, normalize as hr } from "path"; import { readFileSync as $s, writeFile as Dr, statSync as pr } from "fs"; import "assert"; import { fileURLToPath as gr } from "url"; import Z from "node:path"; import { parse as dr } from "@vue/compiler-sfc"; import It from "node:fs"; import { fileURLToPath as mr } from "node:url"; function br(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var Ht, jn; function yn() { if (jn) return Ht; jn = 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, Ht = n, Ht; } var ke = { exports: {} }, Vt, Ln; function Cr() { return Ln || (Ln = 1, Vt = ({ 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"); }), Vt; } var Gt, Tn; function Er() { if (Tn) return Gt; Tn = 1; const t = Cr(); return Gt = (e) => typeof e == "string" ? e.replace(t(), "") : e, Gt; } var We = { exports: {} }, Mn; function xr() { if (Mn) return We.exports; Mn = 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 We.exports = t, We.exports.default = t, We.exports; } var Ut, kn; function Fr() { return kn || (kn = 1, Ut = 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; }), Ut; } var Wn; function wr() { if (Wn) return ke.exports; Wn = 1; const t = Er(), e = xr(), n = Fr(), 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 ke.exports = s, ke.exports.default = s, ke.exports; } var Zt, In; function vs() { if (In) return Zt; In = 1; const t = wr(); function e(d) { return d ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g; } function n(d) { let E = e(); return ("" + d).replace(E, "").split(` `).reduce(function(B, v) { return t(v) > B ? t(v) : B; }, 0); } function s(d, E) { return Array(E + 1).join(d); } function r(d, E, w, $) { let B = n(d); if (E + 1 >= B) { let v = E - B; switch ($) { case "right": { d = s(w, v) + d; break; } case "center": { let W = Math.ceil(v / 2), z = v - W; d = s(w, z) + d + s(w, W); break; } default: { d = d + s(w, v); break; } } } return d; } let o = {}; function i(d, E, w) { E = "\x1B[" + E + "m", w = "\x1B[" + w + "m", o[E] = { set: d, to: !0 }, o[w] = { set: d, to: !1 }, o[d] = { on: E, 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, E) { let w = E[1] ? parseInt(E[1].split(";")[0]) : 0; if (w >= 30 && w <= 39 || w >= 90 && w <= 97) { d.lastForegroundAdded = E[0]; return; } if (w >= 40 && w <= 49 || w >= 100 && w <= 107) { d.lastBackgroundAdded = E[0]; return; } if (w === 0) { for (let B in d) Object.prototype.hasOwnProperty.call(d, B) && delete d[B]; return; } let $ = o[E[0]]; $ && (d[$.set] = $.to); } function c(d) { let E = e(!0), w = E.exec(d), $ = {}; for (; w !== null; ) u($, w), w = E.exec(d); return $; } function D(d, E) { let w = d.lastBackgroundAdded, $ = d.lastForegroundAdded; return delete d.lastBackgroundAdded, delete d.lastForegroundAdded, Object.keys(d).forEach(function(B) { d[B] && (E += o[B].off); }), w && w != "\x1B[49m" && (E += "\x1B[49m"), $ && $ != "\x1B[39m" && (E += "\x1B[39m"), E; } function h(d, E) { let w = d.lastBackgroundAdded, $ = d.lastForegroundAdded; return delete d.lastBackgroundAdded, delete d.lastForegroundAdded, Object.keys(d).forEach(function(B) { d[B] && (E = o[B].on + E); }), w && w != "\x1B[49m" && (E = w + E), $ && $ != "\x1B[39m" && (E = $ + E), E; } function C(d, E) { if (d.length === n(d)) return d.substr(0, E); for (; n(d) > E; ) d = d.slice(0, -1); return d; } function a(d, E) { let w = e(!0), $ = d.split(e()), B = 0, v = 0, W = "", z, Q = {}; for (; v < E; ) { z = w.exec(d); let te = $[B]; if (B++, v + n(te) > E && (te = C(te, E - v)), W += te, v += n(te), v < E) { if (!z) break; W += z[0], u(Q, z); } } return D(Q, W); } function p(d, E, w) { if (w = w || "…", n(d) <= E) return d; E -= n(w); let B = a(d, E); B += w; const v = "\x1B]8;;\x07"; return d.includes(v) && !B.includes(v) && (B += v), B; } function x() { 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 b(d, E) { d = d || {}, E = E || x(); let w = Object.assign({}, E, d); return w.chars = Object.assign({}, E.chars, d.chars), w.style = Object.assign({}, E.style, d.style), w; } function l(d, E) { let w = [], $ = E.split(/(\s+)/g), B = [], v = 0, W; for (let z = 0; z < $.length; z += 2) { let Q = $[z], te = v + n(Q); v > 0 && W && (te += W.length), te > d ? (v !== 0 && w.push(B.join("")), B = [Q], v = n(Q)) : (B.push(W || "", Q), v = te), W = $[z + 1]; } return v && w.push(B.join("")), w; } function R(d, E) { let w = [], $ = ""; function B(W, z) { for ($.length && z && ($ += z), $ += W; $.length > d; ) w.push($.slice(0, d)), $ = $.slice(d); } let v = E.split(/(\s+)/g); for (let W = 0; W < v.length; W += 2) B(v[W], W && v[W - 1]); return $.length && w.push($), w; } function j(d, E, w = !0) { let $ = []; E = E.split(` `); const B = w ? l : R; for (let v = 0; v < E.length; v++) $.push.apply($, B(d, E[v])); return $; } function _(d) { let E = {}, w = []; for (let $ = 0; $ < d.length; $++) { let B = h(E, d[$]); E = c(B); let v = Object.assign({}, E); w.push(D(v, B)); } return w; } function y(d, E) { const w = "\x1B]", $ = "\x07", B = ";"; return [w, "8", B, B, d || E, $, E, w, "8", B, B, $].join(""); } return Zt = { strlen: n, repeat: s, pad: r, truncate: p, mergeOptions: b, wordWrap: j, colorizeLines: _, hyperlink: y }, Zt; } var Kt = { exports: {} }, ye = { exports: {} }, Yt = { exports: {} }, Jt = { exports: {} }, Qt = { exports: {} }, Pn; function yr() { return Pn || (Pn = 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"; }); }(Qt)), Qt.exports; } var Xt, zn; function _r() { return zn || (zn = 1, Xt = 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); }), Xt; } var en, qn; function $r() { if (qn) return en; qn = 1; var t = lr, e = _r(), 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 c = s ? 1 : 0; if (process.platform === "win32") { var D = t.release().split("."); return Number(process.versions.node.split(".")[0]) >= 8 && Number(D[0]) >= 10 && Number(D[2]) >= 10586 ? Number(D[2]) >= 14931 ? 3 : 2 : 1; } if ("CI" in n) return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(C) { return C in n; }) || n.CI_NAME === "codeship" ? 1 : c; 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 h = parseInt((n.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (n.TERM_PROGRAM) { case "iTerm.app": return h >= 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", c); } function i(u) { var c = o(u); return r(c); } return en = { supportsColor: i, stdout: i(process.stdout), stderr: i(process.stderr) }, en; } var tn = { exports: {} }, Hn; function vr() { return Hn || (Hn = 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] || [" "], c = Math.floor(Math.random() * u.length); typeof o[i] < "u" ? r += o[i][c] : r += i; }), r; }; }(tn)), tn.exports; } var nn = { exports: {} }, Vn; function Ar() { return Vn || (Vn = 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(D) { var h = Math.floor(Math.random() * D); return h; } function u(D) { var h = !1; return o.filter(function(C) { h = C === D; }), h; } function c(D, h) { var C = "", a, p; h = h || {}, h.up = typeof h.up < "u" ? h.up : !0, h.mid = typeof h.mid < "u" ? h.mid : !0, h.down = typeof h.down < "u" ? h.down : !0, h.size = typeof h.size < "u" ? h.size : "maxi", D = D.split(""); for (p in D) if (!u(p)) { switch (C = C + D[p], a = { up: 0, down: 0, mid: 0 }, h.size) { case "mini": a.up = i(8), a.mid = i(2), a.down = i(8); break; case "maxi": a.up = i(16) + 3, a.mid = i(4) + 1, a.down = i(64) + 3; break; default: a.up = i(8) + 1, a.mid = i(6) / 2, a.down = i(8) + 1; break; } var x = ["up", "mid", "down"]; for (var b in x) for (var l = x[b], R = 0; R <= a[l]; R++) h[l] && (C = C + r[l][i(r[l].length)]); } return C; } return c(n, s); }; }(nn)), nn.exports; } var sn = { exports: {} }, Gn; function Sr() { return Gn || (Gn = 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); } }; }; }(sn)), sn.exports; } var rn = { exports: {} }, Un; function Rr() { return Un || (Un = 1, function(t) { t.exports = function(e) { return function(n, s, r) { return s % 2 === 0 ? n : e.inverse(n); }; }; }(rn)), rn.exports; } var on = { exports: {} }, Zn; function Br() { return Zn || (Zn = 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); }; }; }(on)), on.exports; } var un = { exports: {} }, Kn; function Or() { return Kn || (Kn = 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); }; }; }(un)), un.exports; } var Yn; function Nr() { return Yn || (Yn = 1, function(t) { var e = {}; t.exports = e, e.themes = {}; var n = ar, s = e.styles = yr(), r = Object.defineProperties, o = new RegExp(/[\r\n]+/g); e.supportsColor = $r().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(b) { return ("" + b).replace(/\x1B\[\d+m/g, ""); }, e.stylize = function(l, R) { if (!e.enabled) return l + ""; var j = s[R]; return !j && R in e ? e[R](l) : j.open + l + j.close; }; var i = /[|\\{}()[\]^$+*?.]/g, u = function(b) { if (typeof b != "string") throw new TypeError("Expected a string"); return b.replace(i, "\\$&"); }; function c(b) { var l = function R() { return C.apply(R, arguments); }; return l._styles = b, l.__proto__ = h, l; } var D = function() { var b = {}; return s.grey = s.gray, Object.keys(s).forEach(function(l) { s[l].closeRe = new RegExp(u(s[l].close), "g"), b[l] = { get: function() { return c(this._styles.concat(l)); } }; }), b; }(), h = r(function() { }, D); function C() { var b = Array.prototype.slice.call(arguments), l = b.map(function(d) { return d != null && d.constructor === String ? d : n.inspect(d); }).join(" "); if (!e.enabled || !l) return l; for (var R = l.indexOf(` `) != -1, j = this._styles, _ = j.length; _--; ) { var y = s[j[_]]; l = y.open + l.replace(y.closeRe, y.open) + y.close, R && (l = l.replace(o, function(d) { return y.close + d + y.open; })); } return l; } e.setTheme = function(b) { if (typeof b == "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 l in b) (function(R) { e[R] = function(j) { if (typeof b[R] == "object") { var _ = j; for (var y in b[R]) _ = e[b[R][y]](_); return _; } return e[b[R]](j); }; })(l); }; function a() { var b = {}; return Object.keys(D).forEach(function(l) { b[l] = { get: function() { return c([l]); } }; }), b; } var p = function(l, R) { var j = R.split(""); return j = j.map(l), j.join(""); }; e.trap = vr(), e.zalgo = Ar(), e.maps = {}, e.maps.america = Sr()(e), e.maps.zebra = Rr()(e), e.maps.rainbow = Br()(e), e.maps.random = Or()(e); for (var x in e.maps) (function(b) { e[b] = function(l) { return p(e.maps[b], l); }; })(x); r(e, a()); }(Jt)), Jt.exports; } var Jn; function jr() { return Jn || (Jn = 1, function(t) { var e = Nr(); t.exports = e; }(Yt)), Yt.exports; } var Qn; function Lr() { if (Qn) return ye.exports; Qn = 1; const { info: t, debug: e } = yn(), n = vs(); 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(a) { this.setOptions(a), this.x = null, this.y = null; } setOptions(a) { ["boolean", "number", "bigint", "string"].indexOf(typeof a) !== -1 && (a = { content: "" + a }), a = a || {}, this.options = a; let p = a.content; if (["boolean", "number", "bigint", "string"].indexOf(typeof p) !== -1) this.content = String(p); else if (!p) this.content = this.options.href || ""; else throw new Error("Content needs to be a primitive, got: " + typeof p); this.colSpan = a.colSpan || 1, this.rowSpan = a.rowSpan || 1, this.options.href && Object.defineProperty(this, "href", { get() { return this.options.href; } }); } mergeTableOptions(a, p) { this.cells = p; let x = this.options.chars || {}, b = a.chars, l = this.chars = {}; h.forEach(function(_) { u(x, b, _, l); }), this.truncate = this.options.truncate || a.truncate; let R = this.options.style = this.options.style || {}, j = a.style; u(R, j, "padding-left", this), u(R, j, "padding-right", this), this.head = R.head || j.head, this.border = R.border || j.border, this.fixedWidth = a.colWidths[this.x], this.lines = this.computeLines(a), this.desiredWidth = n.strlen(this.content) + this.paddingLeft + this.paddingRight, this.desiredHeight = this.lines.length; } computeLines(a) { const p = a.wordWrap || a.textWrap, { wordWrap: x = p } = this.options; if (this.fixedWidth && x) { if (this.fixedWidth -= this.paddingLeft + this.paddingRight, this.colSpan) { let R = 1; for (; R < this.colSpan; ) this.fixedWidth += a.colWidths[this.x + R], R++; } const { wrapOnWordBoundary: b = !0 } = a, { wrapOnWordBoundary: l = b } = this.options; return this.wrapLines(n.wordWrap(this.fixedWidth, this.content, l)); } return this.wrapLines(this.content.split(` `)); } wrapLines(a) { const p = n.colorizeLines(a); return this.href ? p.map((x) => n.hyperlink(this.href, x)) : p; } /** * 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(a) { let p = this.x, x = this.y; this.widths = a.colWidths.slice(p, p + this.colSpan), this.heights = a.rowHeights.slice(x, x + this.rowSpan), this.width = this.widths.reduce(D, -1), this.height = this.heights.reduce(D, -1), this.hAlign = this.options.hAlign || a.colAligns[p], this.vAlign = this.options.vAlign || a.rowAligns[x], this.drawRight = p + this.colSpan == a.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(a, p) { if (a == "top") return this.drawTop(this.drawRight); if (a == "bottom") return this.drawBottom(this.drawRight); let x = n.truncate(this.content, 10, this.truncate); a || t(`${this.y}-${this.x}: ${this.rowSpan - a}x${this.colSpan} Cell ${x}`); let b = Math.max(this.height - this.lines.length, 0), l; switch (this.vAlign) { case "center": l = Math.ceil(b / 2); break; case "bottom": l = b; break; default: l = 0; } if (a < l || a >= l + this.lines.length) return this.drawEmpty(this.drawRight, p); let R = this.lines.length > this.height && a + 1 >= this.height; return this.drawLine(a - l, this.drawRight, R, p); } /** * Renders the top line of the cell. * @param drawRight - true if this method should render the right edge of the cell. * @returns {String} */ drawTop(a) { let p = []; return this.cells ? this.widths.forEach(function(x, b) { p.push(this._topLeftChar(b)), p.push(n.repeat(this.chars[this.y == 0 ? "top" : "mid"], x)); }, this) : (p.push(this._topLeftChar(0)), p.push(n.repeat(this.chars[this.y == 0 ? "top" : "mid"], this.width))), a && p.push(this.chars[this.y == 0 ? "topRight" : "rightMid"]), this.wrapWithStyleColors("border", p.join("")); } _topLeftChar(a) { let p = this.x + a, x; if (this.y == 0) x = p == 0 ? "topLeft" : a == 0 ? "topMid" : "top"; else if (p == 0) x = "leftMid"; else if (x = a == 0 ? "midMid" : "bottomMid", this.cells && (this.cells[this.y - 1][p] instanceof s.ColSpanCell && (x = a == 0 ? "topMid" : "mid"), a == 0)) { let l = 1; for (; this.cells[this.y][p - l] instanceof s.ColSpanCell; ) l++; this.cells[this.y][p - l] instanceof s.RowSpanCell && (x = "leftMid"); } return this.chars[x]; } wrapWithStyleColors(a, p) { if (this[a] && this[a].length) try { let x = jr(); for (let b = this[a].length - 1; b >= 0; b--) x = x[this[a][b]]; return x(p); } catch { return p; } else return p; } /** * 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(a, p, x, b) { let l = this.chars[this.x == 0 ? "left" : "middle"]; if (this.x && b && this.cells) { let w = this.cells[this.y + b][this.x - 1]; for (; w instanceof r; ) w = this.cells[w.y][w.x - 1]; w instanceof o || (l = this.chars.rightMid); } let R = n.repeat(" ", this.paddingLeft), j = p ? this.chars.right : "", _ = n.repeat(" ", this.paddingRight), y = this.lines[a], d = this.width - (this.paddingLeft + this.paddingRight); x && (y += this.truncate || "…"); let E = n.truncate(y, d, this.truncate); return E = n.pad(E, d, " ", this.hAlign), E = R + E + _, this.stylizeLine(l, E, j); } stylizeLine(a, p, x) { return a = this.wrapWithStyleColors("border", a), x = this.wrapWithStyleColors("border", x), this.y === 0 && (p = this.wrapWithStyleColors("head", p)), a + p + x; } /** * Renders the bottom line of the cell. * @param drawRight - true if this method should render the right edge of the cell. * @returns {String} */ drawBottom(a) { let p = this.chars[this.x == 0 ? "bottomLeft" : "bottomMid"], x = n.repeat(this.chars.bottom, this.width), b = a ? this.chars.bottomRight : ""; return this.wrapWithStyleColors("border", p + x + b); } /** * 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(a, p) { let x = this.chars[this.x == 0 ? "left" : "middle"]; if (this.x && p && this.cells) { let R = this.cells[this.y + p][this.x - 1]; for (; R instanceof r; ) R = this.cells[R.y][R.x - 1]; R instanceof o || (x = this.chars.rightMid); } let b = a ? this.chars.right : "", l = n.repeat(" ", this.width); return this.stylizeLine(x, l, b); } } class r { /** * A Cell that doesn't do anything. It just draws empty lines. * Used as a placeholder in column spanning. * @constructor */ constructor() { } draw(a) { return typeof a == "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(a) { this.originalCell = a; } init(a) { let p = this.y, x = this.originalCell.y; this.cellOffset = p - x, this.offset = c(a.rowHeights, x, this.cellOffset); } draw(a) { return a == "top" ? this.originalCell.draw(this.offset, this.cellOffset) : a == "bottom" ? this.originalCell.draw("bottom") : (e(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`), this.originalCell.draw(this.offset + 1 + a)); } mergeTableOptions() { } } function i(...C) { return C.filter((a) => a != null).shift(); } function u(C, a, p, x) { let b = p.split("-"); b.length > 1 ? (b[1] = b[1].charAt(0).toUpperCase() + b[1].substr(1), b = b.join(""), x[b] = i(C[b], C[p], a[b], a[p])) : x[p] = i(C[p], a[p]); } function c(C, a, p) { let x = C[a]; for (let b = 1; b < p; b++) x += 1 + C[a + b]; return x; } function D(C, a) { return C + a + 1; } let h = [ "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 ye.exports = s, ye.exports.ColSpanCell = r, ye.exports.RowSpanCell = o, ye.exports; } var Xn; function Tr() { if (Xn) return Kt.exports; Xn = 1; const { warn: t, debug: e } = yn(), n = Lr(), { ColSpanCell: s, RowSpanCell: r } = n; (function() { function i(_, y) { return _[y] > 0 ? i(_, y + 1) : y; } function u(_) { let y = {}; _.forEach(function(d, E) { let w = 0; d.forEach(function($) { $.y = E, $.x = E ? i(y, w) : w; const B = $.rowSpan || 1, v = $.colSpan || 1; if (B > 1) for (let W = 0; W < v; W++) y[$.x + W] = B; w = $.x + v; }), Object.keys(y).forEach(($) => { y[$]--, y[$] < 1 && delete y[$]; }); }); } function c(_) { let y = 0; return _.forEach(function(d) { d.forEach(function(E) { y = Math.max(y, E.x + (E.colSpan || 1)); }); }), y; } function D(_) { return _.length; } function h(_, y) { let d = _.y, E = _.y - 1 + (_.rowSpan || 1), w = y.y, $ = y.y - 1 + (y.rowSpan || 1), B = !(d > $ || w > E), v = _.x, W = _.x - 1 + (_.colSpan || 1), z = y.x, Q = y.x - 1 + (y.colSpan || 1), te = !(v > Q || z > W); return B && te; } function C(_, y, d) { let E = Math.min(_.length - 1, d), w = { x: y, y: d }; for (let $ = 0; $ <= E; $++) { let B = _[$]; for (let v = 0; v < B.length; v++) if (h(w, B[v])) return !0; } return !1; } function a(_, y, d, E) { for (let w = d; w < E; w++) if (C(_, w, y)) return !1; return !0; } function p(_) { _.forEach(function(y, d) { y.forEach(function(E) { for (let w = 1; w < E.rowSpan; w++) { let $ = new r(E); $.x = E.x, $.y = E.y + w, $.colSpan = E.colSpan, b($, _[d + w]); } }); }); } function x(_) { for (let y = _.length - 1; y >= 0; y--) { let d = _[y]; for (let E = 0; E < d.length; E++) { let w = d[E]; for (let $ = 1; $ < w.colSpan; $++) { let B = new s(); B.x = w.x + $, B.y = w.y, d.splice(E + 1, 0, B); } } } } function b(_, y) { let d = 0; for (; d < y.length && y[d].x < _.x; ) d++; y.splice(d, 0, _); } function l(_) { let y = D(_), d = c(_); e(`Max rows: ${y}; Max cols: ${d}`); for (let E = 0; E < y; E++) for (let w = 0; w < d; w++) if (!C(_, w, E)) { let $ = { x: w, y: E, colSpan: 1, rowSpan: 1 }; for (w++; w < d && !C(_, w, E); ) $.colSpan++, w++; let B = E + 1; for (; B < y && a(_, B, $.x, $.x + $.colSpan); ) $.rowSpan++, B++; let v = new n($); v.x = $.x, v.y = $.y, t(`Missing cell at ${v.y}-${v.x}.`), b(v, _[E]); } } function R(_) { return _.map(function(y) { if (!Array.isArray(y)) { let d = Object.keys(y)[0]; y = y[d], Array.isArray(y) ? (y = y.slice(), y.unshift(d)) : y = [d, y]; } return y.map(function(d) { return new n(d); }); }); } function j(_) { let y = R(_); return u(y), l(y), p(y), x(y), y; } Kt.exports = { makeTableLayout: j, layoutTable: u, addRowSpanCells: p, maxWidth: c, fillInTable: l, computeWidths: o("colSpan", "desiredWidth", "x", 1), computeHeights: o("rowSpan", "desiredHeight", "y", 1) }; })(); function o(i, u, c, D) { return function(h, C) { let a = [], p = [], x = {}; C.forEach(function(b) { b.forEach(function(l) { (l[i] || 1) > 1 ? p.push(l) : a[l[c]] = Math.max(a[l[c]] || 0, l[u] || 0, D); }); }), h.forEach(function(b, l) { typeof b == "number" && (a[l] = b); }); for (let b = p.length - 1; b >= 0; b--) { let l = p[b], R = l[i], j = l[c], _ = a[j], y = typeof h[j] == "number" ? 0 : 1; if (typeof _ == "number") for (let d = 1; d < R; d++) _ += 1 + a[j + d], typeof h[j + d] != "number" && y++; else _ = u === "desiredWidth" ? l.desiredWidth - 1 : 1, (!x[j] || x[j] < _) && (x[j] = _); if (l[u] > _) { let d = 0; for (; y > 0 && l[u] > _; ) { if (typeof h[j + d] != "number") { let E = Math.round((l[u] - _) / y); _ += E, a[j + d] += E, y--; } d++; } } } Object.assign(h, a, x); for (let b = 0; b < h.length; b++) h[b] = Math.max(D, h[b] || 0); }; } return Kt.exports; } var cn, es; function Mr() { if (es) return cn; es = 1; const t = yn(), e = vs(), n = Tr(); 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 c = n.makeTableLayout(i); c.forEach(function(h) { h.forEach(function(C) { C.mergeTableOptions(this.options, c); }, this); }, this), n.computeWidths(this.options.colWidths, c), n.computeHeights(this.options.rowHeights, c), c.forEach(function(h) { h.forEach(function(C) { C.init(this.options); }, this); }, this); let D = []; for (let h = 0; h < c.length; h++) { let C = c[h], a = this.options.rowHeights[h]; (h === 0 || !this.options.style.compact || h == 1 && u) && r(C, "top", D); for (let p = 0; p < a; p++) r(C, p, D); h + 1 == c.length && r(C, "bottom", D); } return D.join(` `); } get width() { return this.toString().split(` `)[0].length; } } s.reset = () => t.reset(); function r(o, i, u) { let c = []; o.forEach(function(h) { c.push(h.draw(i)); }); let D = c.join(""); D.length && u.push(D); } return cn = s, cn; } var an, ts; function kr() {