bg-editor 0.0.1

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.
Files changed (67) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +51 -0
  3. package/README.zh-CN.md +51 -0
  4. package/dist/_basePickBy-4kmg42pS.js +158 -0
  5. package/dist/_baseUniq-WOvvCHTI.js +621 -0
  6. package/dist/arc-wItjmL5I.js +90 -0
  7. package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
  8. package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
  9. package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
  10. package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
  11. package/dist/channel-Dah4F59k.js +12 -0
  12. package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
  13. package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
  14. package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
  15. package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
  16. package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
  17. package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
  18. package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
  19. package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
  20. package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
  21. package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
  22. package/dist/clone-C74UiRbr.js +15 -0
  23. package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
  24. package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
  25. package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
  26. package/dist/defaultLocale-DgmhL6Re.js +178 -0
  27. package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
  28. package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
  29. package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
  30. package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
  31. package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
  32. package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
  33. package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
  34. package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
  35. package/dist/graph-CnOTx4E0.js +254 -0
  36. package/dist/index-D6-Wf75-.js +122127 -0
  37. package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
  38. package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
  39. package/dist/init-d639unba.js +23 -0
  40. package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
  41. package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
  42. package/dist/layout-OXk4OSoz.js +1342 -0
  43. package/dist/linear-CO_vz87n.js +266 -0
  44. package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
  45. package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
  46. package/dist/ordinal-CofNqUw2.js +68 -0
  47. package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
  48. package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
  49. package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
  50. package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
  51. package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
  52. package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
  53. package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
  54. package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
  55. package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
  57. package/dist/style.css +1 -0
  58. package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
  59. package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
  60. package/dist/umo-editor.js +16 -0
  61. package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
  62. package/package.json +200 -0
  63. package/types/index.d.ts +277 -0
  64. package/types/src/components/index.d.ts +9 -0
  65. package/types/src/components/menus/button.vue.d.ts +583 -0
  66. package/types/src/components/modal.vue.d.ts +2 -0
  67. package/types/src/components/tooltip.vue.d.ts +27 -0
@@ -0,0 +1,1029 @@
1
+ import "./style.css";
2
+ import { _ as o, s as _e, g as Ae, q as ie, p as ke, a as Fe, b as Pe, c as zt, l as bt, d as Lt, e as ve, y as Ce, F as D, K as Le, i as Ee } from "./index-D6-Wf75-.js";
3
+ import { l as ee } from "./linear-CO_vz87n.js";
4
+ /**
5
+ * @umoteam/editor 9.0.1
6
+ * @license MIT
7
+ * @author umodoc https://www.umodoc.com
8
+ * @see https://www.umodoc.com
9
+ **/
10
+ var Et = function() {
11
+ var t = /* @__PURE__ */ o(function(M, r, l, x) {
12
+ for (l = l || {}, x = M.length; x--; l[M[x]] = r) ;
13
+ return l;
14
+ }, "o"), n = [1, 3], f = [1, 4], d = [1, 5], h = [1, 6], p = [1, 7], y = [1, 4, 5, 10, 12, 13, 14, 18, 25, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], _ = [1, 4, 5, 10, 12, 13, 14, 18, 25, 28, 35, 37, 39, 41, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 60, 61, 63, 64, 65, 66, 67], a = [55, 56, 57], A = [2, 36], u = [1, 37], T = [1, 36], q = [1, 38], m = [1, 35], b = [1, 43], g = [1, 41], G = [1, 14], ht = [1, 23], xt = [1, 18], ft = [1, 19], gt = [1, 20], ct = [1, 21], _t = [1, 22], dt = [1, 24], i = [1, 25], Vt = [1, 26], It = [1, 27], wt = [1, 28], Bt = [1, 29], W = [1, 32], U = [1, 33], k = [1, 34], F = [1, 39], P = [1, 40], v = [1, 42], C = [1, 44], O = [1, 62], H = [1, 61], L = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], Rt = [1, 65], Nt = [1, 66], Wt = [1, 67], Ut = [1, 68], Qt = [1, 69], Ot = [1, 70], Ht = [1, 71], Xt = [1, 72], Mt = [1, 73], Yt = [1, 74], jt = [1, 75], Gt = [1, 76], I = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], K = [1, 90], Z = [1, 91], J = [1, 92], $ = [1, 99], tt = [1, 93], et = [1, 96], it = [1, 94], at = [1, 95], nt = [1, 97], st = [1, 98], At = [1, 102], Kt = [10, 55, 56, 57], R = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57], kt = {
15
+ trace: /* @__PURE__ */ o(function() {
16
+ }, "trace"),
17
+ yy: {},
18
+ symbols_: { error: 2, idStringToken: 3, ALPHA: 4, NUM: 5, NODE_STRING: 6, DOWN: 7, MINUS: 8, DEFAULT: 9, COMMA: 10, COLON: 11, AMP: 12, BRKT: 13, MULT: 14, UNICODE_TEXT: 15, styleComponent: 16, UNIT: 17, SPACE: 18, STYLE: 19, PCT: 20, idString: 21, style: 22, stylesOpt: 23, classDefStatement: 24, CLASSDEF: 25, start: 26, eol: 27, QUADRANT: 28, document: 29, line: 30, statement: 31, axisDetails: 32, quadrantDetails: 33, points: 34, title: 35, title_value: 36, acc_title: 37, acc_title_value: 38, acc_descr: 39, acc_descr_value: 40, acc_descr_multiline_value: 41, section: 42, text: 43, point_start: 44, point_x: 45, point_y: 46, class_name: 47, "X-AXIS": 48, "AXIS-TEXT-DELIMITER": 49, "Y-AXIS": 50, QUADRANT_1: 51, QUADRANT_2: 52, QUADRANT_3: 53, QUADRANT_4: 54, NEWLINE: 55, SEMI: 56, EOF: 57, alphaNumToken: 58, textNoTagsToken: 59, STR: 60, MD_STR: 61, alphaNum: 62, PUNCTUATION: 63, PLUS: 64, EQUALS: 65, DOT: 66, UNDERSCORE: 67, $accept: 0, $end: 1 },
19
+ terminals_: { 2: "error", 4: "ALPHA", 5: "NUM", 6: "NODE_STRING", 7: "DOWN", 8: "MINUS", 9: "DEFAULT", 10: "COMMA", 11: "COLON", 12: "AMP", 13: "BRKT", 14: "MULT", 15: "UNICODE_TEXT", 17: "UNIT", 18: "SPACE", 19: "STYLE", 20: "PCT", 25: "CLASSDEF", 28: "QUADRANT", 35: "title", 36: "title_value", 37: "acc_title", 38: "acc_title_value", 39: "acc_descr", 40: "acc_descr_value", 41: "acc_descr_multiline_value", 42: "section", 44: "point_start", 45: "point_x", 46: "point_y", 47: "class_name", 48: "X-AXIS", 49: "AXIS-TEXT-DELIMITER", 50: "Y-AXIS", 51: "QUADRANT_1", 52: "QUADRANT_2", 53: "QUADRANT_3", 54: "QUADRANT_4", 55: "NEWLINE", 56: "SEMI", 57: "EOF", 60: "STR", 61: "MD_STR", 63: "PUNCTUATION", 64: "PLUS", 65: "EQUALS", 66: "DOT", 67: "UNDERSCORE" },
20
+ productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [21, 1], [21, 2], [22, 1], [22, 2], [23, 1], [23, 3], [24, 5], [26, 2], [26, 2], [26, 2], [29, 0], [29, 2], [30, 2], [31, 0], [31, 1], [31, 2], [31, 1], [31, 1], [31, 1], [31, 2], [31, 2], [31, 2], [31, 1], [31, 1], [34, 4], [34, 5], [34, 5], [34, 6], [32, 4], [32, 3], [32, 2], [32, 4], [32, 3], [32, 2], [33, 2], [33, 2], [33, 2], [33, 2], [27, 1], [27, 1], [27, 1], [43, 1], [43, 2], [43, 1], [43, 1], [62, 1], [62, 2], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [58, 1], [59, 1], [59, 1], [59, 1]],
21
+ performAction: /* @__PURE__ */ o(function(r, l, x, c, S, e, ut) {
22
+ var s = e.length - 1;
23
+ switch (S) {
24
+ case 23:
25
+ this.$ = e[s];
26
+ break;
27
+ case 24:
28
+ this.$ = e[s - 1] + "" + e[s];
29
+ break;
30
+ case 26:
31
+ this.$ = e[s - 1] + e[s];
32
+ break;
33
+ case 27:
34
+ this.$ = [e[s].trim()];
35
+ break;
36
+ case 28:
37
+ e[s - 2].push(e[s].trim()), this.$ = e[s - 2];
38
+ break;
39
+ case 29:
40
+ this.$ = e[s - 4], c.addClass(e[s - 2], e[s]);
41
+ break;
42
+ case 37:
43
+ this.$ = [];
44
+ break;
45
+ case 42:
46
+ this.$ = e[s].trim(), c.setDiagramTitle(this.$);
47
+ break;
48
+ case 43:
49
+ this.$ = e[s].trim(), c.setAccTitle(this.$);
50
+ break;
51
+ case 44:
52
+ case 45:
53
+ this.$ = e[s].trim(), c.setAccDescription(this.$);
54
+ break;
55
+ case 46:
56
+ c.addSection(e[s].substr(8)), this.$ = e[s].substr(8);
57
+ break;
58
+ case 47:
59
+ c.addPoint(e[s - 3], "", e[s - 1], e[s], []);
60
+ break;
61
+ case 48:
62
+ c.addPoint(e[s - 4], e[s - 3], e[s - 1], e[s], []);
63
+ break;
64
+ case 49:
65
+ c.addPoint(e[s - 4], "", e[s - 2], e[s - 1], e[s]);
66
+ break;
67
+ case 50:
68
+ c.addPoint(e[s - 5], e[s - 4], e[s - 2], e[s - 1], e[s]);
69
+ break;
70
+ case 51:
71
+ c.setXAxisLeftText(e[s - 2]), c.setXAxisRightText(e[s]);
72
+ break;
73
+ case 52:
74
+ e[s - 1].text += " ⟶ ", c.setXAxisLeftText(e[s - 1]);
75
+ break;
76
+ case 53:
77
+ c.setXAxisLeftText(e[s]);
78
+ break;
79
+ case 54:
80
+ c.setYAxisBottomText(e[s - 2]), c.setYAxisTopText(e[s]);
81
+ break;
82
+ case 55:
83
+ e[s - 1].text += " ⟶ ", c.setYAxisBottomText(e[s - 1]);
84
+ break;
85
+ case 56:
86
+ c.setYAxisBottomText(e[s]);
87
+ break;
88
+ case 57:
89
+ c.setQuadrant1Text(e[s]);
90
+ break;
91
+ case 58:
92
+ c.setQuadrant2Text(e[s]);
93
+ break;
94
+ case 59:
95
+ c.setQuadrant3Text(e[s]);
96
+ break;
97
+ case 60:
98
+ c.setQuadrant4Text(e[s]);
99
+ break;
100
+ case 64:
101
+ this.$ = { text: e[s], type: "text" };
102
+ break;
103
+ case 65:
104
+ this.$ = { text: e[s - 1].text + "" + e[s], type: e[s - 1].type };
105
+ break;
106
+ case 66:
107
+ this.$ = { text: e[s], type: "text" };
108
+ break;
109
+ case 67:
110
+ this.$ = { text: e[s], type: "markdown" };
111
+ break;
112
+ case 68:
113
+ this.$ = e[s];
114
+ break;
115
+ case 69:
116
+ this.$ = e[s - 1] + "" + e[s];
117
+ break;
118
+ }
119
+ }, "anonymous"),
120
+ table: [{ 18: n, 26: 1, 27: 2, 28: f, 55: d, 56: h, 57: p }, { 1: [3] }, { 18: n, 26: 8, 27: 2, 28: f, 55: d, 56: h, 57: p }, { 18: n, 26: 9, 27: 2, 28: f, 55: d, 56: h, 57: p }, t(y, [2, 33], { 29: 10 }), t(_, [2, 61]), t(_, [2, 62]), t(_, [2, 63]), { 1: [2, 30] }, { 1: [2, 31] }, t(a, A, { 30: 11, 31: 12, 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 1: [2, 32], 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 18: G, 25: ht, 35: xt, 37: ft, 39: gt, 41: ct, 42: _t, 48: dt, 50: i, 51: Vt, 52: It, 53: wt, 54: Bt, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(y, [2, 34]), { 27: 45, 55: d, 56: h, 57: p }, t(a, [2, 37]), t(a, A, { 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 31: 46, 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 18: G, 25: ht, 35: xt, 37: ft, 39: gt, 41: ct, 42: _t, 48: dt, 50: i, 51: Vt, 52: It, 53: wt, 54: Bt, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 39]), t(a, [2, 40]), t(a, [2, 41]), { 36: [1, 47] }, { 38: [1, 48] }, { 40: [1, 49] }, t(a, [2, 45]), t(a, [2, 46]), { 18: [1, 50] }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 51, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 52, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 53, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 54, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 55, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 43: 56, 58: 31, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }, { 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 44: [1, 57], 47: [1, 58], 58: 60, 59: 59, 63: k, 64: F, 65: P, 66: v, 67: C }, t(L, [2, 64]), t(L, [2, 66]), t(L, [2, 67]), t(L, [2, 70]), t(L, [2, 71]), t(L, [2, 72]), t(L, [2, 73]), t(L, [2, 74]), t(L, [2, 75]), t(L, [2, 76]), t(L, [2, 77]), t(L, [2, 78]), t(L, [2, 79]), t(L, [2, 80]), t(y, [2, 35]), t(a, [2, 38]), t(a, [2, 42]), t(a, [2, 43]), t(a, [2, 44]), { 3: 64, 4: Rt, 5: Nt, 6: Wt, 7: Ut, 8: Qt, 9: Ot, 10: Ht, 11: Xt, 12: Mt, 13: Yt, 14: jt, 15: Gt, 21: 63 }, t(a, [2, 53], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 49: [1, 77], 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 56], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 49: [1, 78], 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 57], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 58], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 59], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 60], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), { 45: [1, 79] }, { 44: [1, 80] }, t(L, [2, 65]), t(L, [2, 81]), t(L, [2, 82]), t(L, [2, 83]), { 3: 82, 4: Rt, 5: Nt, 6: Wt, 7: Ut, 8: Qt, 9: Ot, 10: Ht, 11: Xt, 12: Mt, 13: Yt, 14: jt, 15: Gt, 18: [1, 81] }, t(I, [2, 23]), t(I, [2, 1]), t(I, [2, 2]), t(I, [2, 3]), t(I, [2, 4]), t(I, [2, 5]), t(I, [2, 6]), t(I, [2, 7]), t(I, [2, 8]), t(I, [2, 9]), t(I, [2, 10]), t(I, [2, 11]), t(I, [2, 12]), t(a, [2, 52], { 58: 31, 43: 83, 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 55], { 58: 31, 43: 84, 4: u, 5: T, 10: q, 12: m, 13: b, 14: g, 60: W, 61: U, 63: k, 64: F, 65: P, 66: v, 67: C }), { 46: [1, 85] }, { 45: [1, 86] }, { 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 16: 89, 17: it, 18: at, 19: nt, 20: st, 22: 88, 23: 87 }, t(I, [2, 24]), t(a, [2, 51], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 54], { 59: 59, 58: 60, 4: u, 5: T, 8: O, 10: q, 12: m, 13: b, 14: g, 18: H, 63: k, 64: F, 65: P, 66: v, 67: C }), t(a, [2, 47], { 22: 88, 16: 89, 23: 100, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st }), { 46: [1, 101] }, t(a, [2, 29], { 10: At }), t(Kt, [2, 27], { 16: 103, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st }), t(R, [2, 25]), t(R, [2, 13]), t(R, [2, 14]), t(R, [2, 15]), t(R, [2, 16]), t(R, [2, 17]), t(R, [2, 18]), t(R, [2, 19]), t(R, [2, 20]), t(R, [2, 21]), t(R, [2, 22]), t(a, [2, 49], { 10: At }), t(a, [2, 48], { 22: 88, 16: 89, 23: 104, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st }), { 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 16: 89, 17: it, 18: at, 19: nt, 20: st, 22: 105 }, t(R, [2, 26]), t(a, [2, 50], { 10: At }), t(Kt, [2, 28], { 16: 103, 4: K, 5: Z, 6: J, 8: $, 11: tt, 13: et, 17: it, 18: at, 19: nt, 20: st })],
121
+ defaultActions: { 8: [2, 30], 9: [2, 31] },
122
+ parseError: /* @__PURE__ */ o(function(r, l) {
123
+ if (l.recoverable)
124
+ this.trace(r);
125
+ else {
126
+ var x = new Error(r);
127
+ throw x.hash = l, x;
128
+ }
129
+ }, "parseError"),
130
+ parse: /* @__PURE__ */ o(function(r) {
131
+ var l = this, x = [0], c = [], S = [null], e = [], ut = this.table, s = "", yt = 0, Zt = 0, qe = 2, Jt = 1, me = e.slice.call(arguments, 1), E = Object.create(this.lexer), Y = { yy: {} };
132
+ for (var Ft in this.yy)
133
+ Object.prototype.hasOwnProperty.call(this.yy, Ft) && (Y.yy[Ft] = this.yy[Ft]);
134
+ E.setInput(r, Y.yy), Y.yy.lexer = E, Y.yy.parser = this, typeof E.yylloc > "u" && (E.yylloc = {});
135
+ var Pt = E.yylloc;
136
+ e.push(Pt);
137
+ var be = E.options && E.options.ranges;
138
+ typeof Y.yy.parseError == "function" ? this.parseError = Y.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
139
+ function Se(B) {
140
+ x.length = x.length - 2 * B, S.length = S.length - B, e.length = e.length - B;
141
+ }
142
+ o(Se, "popStack");
143
+ function $t() {
144
+ var B;
145
+ return B = c.pop() || E.lex() || Jt, typeof B != "number" && (B instanceof Array && (c = B, B = c.pop()), B = l.symbols_[B] || B), B;
146
+ }
147
+ o($t, "lex");
148
+ for (var w, j, N, vt, rt = {}, Tt, X, te, qt; ; ) {
149
+ if (j = x[x.length - 1], this.defaultActions[j] ? N = this.defaultActions[j] : ((w === null || typeof w > "u") && (w = $t()), N = ut[j] && ut[j][w]), typeof N > "u" || !N.length || !N[0]) {
150
+ var Ct = "";
151
+ qt = [];
152
+ for (Tt in ut[j])
153
+ this.terminals_[Tt] && Tt > qe && qt.push("'" + this.terminals_[Tt] + "'");
154
+ E.showPosition ? Ct = "Parse error on line " + (yt + 1) + `:
155
+ ` + E.showPosition() + `
156
+ Expecting ` + qt.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : Ct = "Parse error on line " + (yt + 1) + ": Unexpected " + (w == Jt ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(Ct, {
157
+ text: E.match,
158
+ token: this.terminals_[w] || w,
159
+ line: E.yylineno,
160
+ loc: Pt,
161
+ expected: qt
162
+ });
163
+ }
164
+ if (N[0] instanceof Array && N.length > 1)
165
+ throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + w);
166
+ switch (N[0]) {
167
+ case 1:
168
+ x.push(w), S.push(E.yytext), e.push(E.yylloc), x.push(N[1]), w = null, Zt = E.yyleng, s = E.yytext, yt = E.yylineno, Pt = E.yylloc;
169
+ break;
170
+ case 2:
171
+ if (X = this.productions_[N[1]][1], rt.$ = S[S.length - X], rt._$ = {
172
+ first_line: e[e.length - (X || 1)].first_line,
173
+ last_line: e[e.length - 1].last_line,
174
+ first_column: e[e.length - (X || 1)].first_column,
175
+ last_column: e[e.length - 1].last_column
176
+ }, be && (rt._$.range = [
177
+ e[e.length - (X || 1)].range[0],
178
+ e[e.length - 1].range[1]
179
+ ]), vt = this.performAction.apply(rt, [
180
+ s,
181
+ Zt,
182
+ yt,
183
+ Y.yy,
184
+ N[1],
185
+ S,
186
+ e
187
+ ].concat(me)), typeof vt < "u")
188
+ return vt;
189
+ X && (x = x.slice(0, -1 * X * 2), S = S.slice(0, -1 * X), e = e.slice(0, -1 * X)), x.push(this.productions_[N[1]][0]), S.push(rt.$), e.push(rt._$), te = ut[x[x.length - 2]][x[x.length - 1]], x.push(te);
190
+ break;
191
+ case 3:
192
+ return !0;
193
+ }
194
+ }
195
+ return !0;
196
+ }, "parse")
197
+ }, Te = /* @__PURE__ */ function() {
198
+ var M = {
199
+ EOF: 1,
200
+ parseError: /* @__PURE__ */ o(function(l, x) {
201
+ if (this.yy.parser)
202
+ this.yy.parser.parseError(l, x);
203
+ else
204
+ throw new Error(l);
205
+ }, "parseError"),
206
+ // resets the lexer, sets new input
207
+ setInput: /* @__PURE__ */ o(function(r, l) {
208
+ return this.yy = l || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
209
+ first_line: 1,
210
+ first_column: 0,
211
+ last_line: 1,
212
+ last_column: 0
213
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
214
+ }, "setInput"),
215
+ // consumes and returns one char from the input
216
+ input: /* @__PURE__ */ o(function() {
217
+ var r = this._input[0];
218
+ this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
219
+ var l = r.match(/(?:\r\n?|\n).*/g);
220
+ return l ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
221
+ }, "input"),
222
+ // unshifts one char (or a string) into the input
223
+ unput: /* @__PURE__ */ o(function(r) {
224
+ var l = r.length, x = r.split(/(?:\r\n?|\n)/g);
225
+ this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - l), this.offset -= l;
226
+ var c = this.match.split(/(?:\r\n?|\n)/g);
227
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), x.length - 1 && (this.yylineno -= x.length - 1);
228
+ var S = this.yylloc.range;
229
+ return this.yylloc = {
230
+ first_line: this.yylloc.first_line,
231
+ last_line: this.yylineno + 1,
232
+ first_column: this.yylloc.first_column,
233
+ last_column: x ? (x.length === c.length ? this.yylloc.first_column : 0) + c[c.length - x.length].length - x[0].length : this.yylloc.first_column - l
234
+ }, this.options.ranges && (this.yylloc.range = [S[0], S[0] + this.yyleng - l]), this.yyleng = this.yytext.length, this;
235
+ }, "unput"),
236
+ // When called from action, caches matched text and appends it on next action
237
+ more: /* @__PURE__ */ o(function() {
238
+ return this._more = !0, this;
239
+ }, "more"),
240
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
241
+ reject: /* @__PURE__ */ o(function() {
242
+ if (this.options.backtrack_lexer)
243
+ this._backtrack = !0;
244
+ else
245
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
246
+ ` + this.showPosition(), {
247
+ text: "",
248
+ token: null,
249
+ line: this.yylineno
250
+ });
251
+ return this;
252
+ }, "reject"),
253
+ // retain first n characters of the match
254
+ less: /* @__PURE__ */ o(function(r) {
255
+ this.unput(this.match.slice(r));
256
+ }, "less"),
257
+ // displays already matched input, i.e. for error messages
258
+ pastInput: /* @__PURE__ */ o(function() {
259
+ var r = this.matched.substr(0, this.matched.length - this.match.length);
260
+ return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
261
+ }, "pastInput"),
262
+ // displays upcoming input, i.e. for error messages
263
+ upcomingInput: /* @__PURE__ */ o(function() {
264
+ var r = this.match;
265
+ return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
266
+ }, "upcomingInput"),
267
+ // displays the character position where the lexing error occurred, i.e. for error messages
268
+ showPosition: /* @__PURE__ */ o(function() {
269
+ var r = this.pastInput(), l = new Array(r.length + 1).join("-");
270
+ return r + this.upcomingInput() + `
271
+ ` + l + "^";
272
+ }, "showPosition"),
273
+ // test the lexed token: return FALSE when not a match, otherwise return token
274
+ test_match: /* @__PURE__ */ o(function(r, l) {
275
+ var x, c, S;
276
+ if (this.options.backtrack_lexer && (S = {
277
+ yylineno: this.yylineno,
278
+ yylloc: {
279
+ first_line: this.yylloc.first_line,
280
+ last_line: this.last_line,
281
+ first_column: this.yylloc.first_column,
282
+ last_column: this.yylloc.last_column
283
+ },
284
+ yytext: this.yytext,
285
+ match: this.match,
286
+ matches: this.matches,
287
+ matched: this.matched,
288
+ yyleng: this.yyleng,
289
+ offset: this.offset,
290
+ _more: this._more,
291
+ _input: this._input,
292
+ yy: this.yy,
293
+ conditionStack: this.conditionStack.slice(0),
294
+ done: this.done
295
+ }, this.options.ranges && (S.yylloc.range = this.yylloc.range.slice(0))), c = r[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
296
+ first_line: this.yylloc.last_line,
297
+ last_line: this.yylineno + 1,
298
+ first_column: this.yylloc.last_column,
299
+ last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
300
+ }, this.yytext += r[0], this.match += r[0], this.matches = r, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(r[0].length), this.matched += r[0], x = this.performAction.call(this, this.yy, this, l, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), x)
301
+ return x;
302
+ if (this._backtrack) {
303
+ for (var e in S)
304
+ this[e] = S[e];
305
+ return !1;
306
+ }
307
+ return !1;
308
+ }, "test_match"),
309
+ // return next match in input
310
+ next: /* @__PURE__ */ o(function() {
311
+ if (this.done)
312
+ return this.EOF;
313
+ this._input || (this.done = !0);
314
+ var r, l, x, c;
315
+ this._more || (this.yytext = "", this.match = "");
316
+ for (var S = this._currentRules(), e = 0; e < S.length; e++)
317
+ if (x = this._input.match(this.rules[S[e]]), x && (!l || x[0].length > l[0].length)) {
318
+ if (l = x, c = e, this.options.backtrack_lexer) {
319
+ if (r = this.test_match(x, S[e]), r !== !1)
320
+ return r;
321
+ if (this._backtrack) {
322
+ l = !1;
323
+ continue;
324
+ } else
325
+ return !1;
326
+ } else if (!this.options.flex)
327
+ break;
328
+ }
329
+ return l ? (r = this.test_match(l, S[c]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
330
+ ` + this.showPosition(), {
331
+ text: "",
332
+ token: null,
333
+ line: this.yylineno
334
+ });
335
+ }, "next"),
336
+ // return next match that has a token
337
+ lex: /* @__PURE__ */ o(function() {
338
+ var l = this.next();
339
+ return l || this.lex();
340
+ }, "lex"),
341
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
342
+ begin: /* @__PURE__ */ o(function(l) {
343
+ this.conditionStack.push(l);
344
+ }, "begin"),
345
+ // pop the previously active lexer condition state off the condition stack
346
+ popState: /* @__PURE__ */ o(function() {
347
+ var l = this.conditionStack.length - 1;
348
+ return l > 0 ? this.conditionStack.pop() : this.conditionStack[0];
349
+ }, "popState"),
350
+ // produce the lexer rule set which is active for the currently active lexer condition state
351
+ _currentRules: /* @__PURE__ */ o(function() {
352
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
353
+ }, "_currentRules"),
354
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
355
+ topState: /* @__PURE__ */ o(function(l) {
356
+ return l = this.conditionStack.length - 1 - Math.abs(l || 0), l >= 0 ? this.conditionStack[l] : "INITIAL";
357
+ }, "topState"),
358
+ // alias for begin(condition)
359
+ pushState: /* @__PURE__ */ o(function(l) {
360
+ this.begin(l);
361
+ }, "pushState"),
362
+ // return the number of states currently on the stack
363
+ stateStackSize: /* @__PURE__ */ o(function() {
364
+ return this.conditionStack.length;
365
+ }, "stateStackSize"),
366
+ options: { "case-insensitive": !0 },
367
+ performAction: /* @__PURE__ */ o(function(l, x, c, S) {
368
+ switch (c) {
369
+ case 0:
370
+ break;
371
+ case 1:
372
+ break;
373
+ case 2:
374
+ return 55;
375
+ case 3:
376
+ break;
377
+ case 4:
378
+ return this.begin("title"), 35;
379
+ case 5:
380
+ return this.popState(), "title_value";
381
+ case 6:
382
+ return this.begin("acc_title"), 37;
383
+ case 7:
384
+ return this.popState(), "acc_title_value";
385
+ case 8:
386
+ return this.begin("acc_descr"), 39;
387
+ case 9:
388
+ return this.popState(), "acc_descr_value";
389
+ case 10:
390
+ this.begin("acc_descr_multiline");
391
+ break;
392
+ case 11:
393
+ this.popState();
394
+ break;
395
+ case 12:
396
+ return "acc_descr_multiline_value";
397
+ case 13:
398
+ return 48;
399
+ case 14:
400
+ return 50;
401
+ case 15:
402
+ return 49;
403
+ case 16:
404
+ return 51;
405
+ case 17:
406
+ return 52;
407
+ case 18:
408
+ return 53;
409
+ case 19:
410
+ return 54;
411
+ case 20:
412
+ return 25;
413
+ case 21:
414
+ this.begin("md_string");
415
+ break;
416
+ case 22:
417
+ return "MD_STR";
418
+ case 23:
419
+ this.popState();
420
+ break;
421
+ case 24:
422
+ this.begin("string");
423
+ break;
424
+ case 25:
425
+ this.popState();
426
+ break;
427
+ case 26:
428
+ return "STR";
429
+ case 27:
430
+ this.begin("class_name");
431
+ break;
432
+ case 28:
433
+ return this.popState(), 47;
434
+ case 29:
435
+ return this.begin("point_start"), 44;
436
+ case 30:
437
+ return this.begin("point_x"), 45;
438
+ case 31:
439
+ this.popState();
440
+ break;
441
+ case 32:
442
+ this.popState(), this.begin("point_y");
443
+ break;
444
+ case 33:
445
+ return this.popState(), 46;
446
+ case 34:
447
+ return 28;
448
+ case 35:
449
+ return 4;
450
+ case 36:
451
+ return 11;
452
+ case 37:
453
+ return 64;
454
+ case 38:
455
+ return 10;
456
+ case 39:
457
+ return 65;
458
+ case 40:
459
+ return 65;
460
+ case 41:
461
+ return 14;
462
+ case 42:
463
+ return 13;
464
+ case 43:
465
+ return 67;
466
+ case 44:
467
+ return 66;
468
+ case 45:
469
+ return 12;
470
+ case 46:
471
+ return 8;
472
+ case 47:
473
+ return 5;
474
+ case 48:
475
+ return 18;
476
+ case 49:
477
+ return 56;
478
+ case 50:
479
+ return 63;
480
+ case 51:
481
+ return 57;
482
+ }
483
+ }, "anonymous"),
484
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?: *x-axis *)/i, /^(?: *y-axis *)/i, /^(?: *--+> *)/i, /^(?: *quadrant-1 *)/i, /^(?: *quadrant-2 *)/i, /^(?: *quadrant-3 *)/i, /^(?: *quadrant-4 *)/i, /^(?:classDef\b)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?::::)/i, /^(?:^\w+)/i, /^(?:\s*:\s*\[\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?:\s*\] *)/i, /^(?:\s*,\s*)/i, /^(?:(1)|(0(.\d+)?))/i, /^(?: *quadrantChart *)/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s)/i, /^(?:;)/i, /^(?:[!"#$%&'*+,-.`?\\_/])/i, /^(?:$)/i],
485
+ conditions: { class_name: { rules: [28], inclusive: !1 }, point_y: { rules: [33], inclusive: !1 }, point_x: { rules: [32], inclusive: !1 }, point_start: { rules: [30, 31], inclusive: !1 }, acc_descr_multiline: { rules: [11, 12], inclusive: !1 }, acc_descr: { rules: [9], inclusive: !1 }, acc_title: { rules: [7], inclusive: !1 }, title: { rules: [5], inclusive: !1 }, md_string: { rules: [22, 23], inclusive: !1 }, string: { rules: [25, 26], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 29, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], inclusive: !0 } }
486
+ };
487
+ return M;
488
+ }();
489
+ kt.lexer = Te;
490
+ function pt() {
491
+ this.yy = {};
492
+ }
493
+ return o(pt, "Parser"), pt.prototype = kt, kt.Parser = pt, new pt();
494
+ }();
495
+ Et.parser = Et;
496
+ var De = Et, V = Le(), ot, ze = (ot = class {
497
+ constructor() {
498
+ this.classes = /* @__PURE__ */ new Map(), this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData();
499
+ }
500
+ getDefaultData() {
501
+ return {
502
+ titleText: "",
503
+ quadrant1Text: "",
504
+ quadrant2Text: "",
505
+ quadrant3Text: "",
506
+ quadrant4Text: "",
507
+ xAxisLeftText: "",
508
+ xAxisRightText: "",
509
+ yAxisBottomText: "",
510
+ yAxisTopText: "",
511
+ points: []
512
+ };
513
+ }
514
+ getDefaultConfig() {
515
+ return {
516
+ showXAxis: !0,
517
+ showYAxis: !0,
518
+ showTitle: !0,
519
+ chartHeight: D.quadrantChart?.chartWidth || 500,
520
+ chartWidth: D.quadrantChart?.chartHeight || 500,
521
+ titlePadding: D.quadrantChart?.titlePadding || 10,
522
+ titleFontSize: D.quadrantChart?.titleFontSize || 20,
523
+ quadrantPadding: D.quadrantChart?.quadrantPadding || 5,
524
+ xAxisLabelPadding: D.quadrantChart?.xAxisLabelPadding || 5,
525
+ yAxisLabelPadding: D.quadrantChart?.yAxisLabelPadding || 5,
526
+ xAxisLabelFontSize: D.quadrantChart?.xAxisLabelFontSize || 16,
527
+ yAxisLabelFontSize: D.quadrantChart?.yAxisLabelFontSize || 16,
528
+ quadrantLabelFontSize: D.quadrantChart?.quadrantLabelFontSize || 16,
529
+ quadrantTextTopPadding: D.quadrantChart?.quadrantTextTopPadding || 5,
530
+ pointTextPadding: D.quadrantChart?.pointTextPadding || 5,
531
+ pointLabelFontSize: D.quadrantChart?.pointLabelFontSize || 12,
532
+ pointRadius: D.quadrantChart?.pointRadius || 5,
533
+ xAxisPosition: D.quadrantChart?.xAxisPosition || "top",
534
+ yAxisPosition: D.quadrantChart?.yAxisPosition || "left",
535
+ quadrantInternalBorderStrokeWidth: D.quadrantChart?.quadrantInternalBorderStrokeWidth || 1,
536
+ quadrantExternalBorderStrokeWidth: D.quadrantChart?.quadrantExternalBorderStrokeWidth || 2
537
+ };
538
+ }
539
+ getDefaultThemeConfig() {
540
+ return {
541
+ quadrant1Fill: V.quadrant1Fill,
542
+ quadrant2Fill: V.quadrant2Fill,
543
+ quadrant3Fill: V.quadrant3Fill,
544
+ quadrant4Fill: V.quadrant4Fill,
545
+ quadrant1TextFill: V.quadrant1TextFill,
546
+ quadrant2TextFill: V.quadrant2TextFill,
547
+ quadrant3TextFill: V.quadrant3TextFill,
548
+ quadrant4TextFill: V.quadrant4TextFill,
549
+ quadrantPointFill: V.quadrantPointFill,
550
+ quadrantPointTextFill: V.quadrantPointTextFill,
551
+ quadrantXAxisTextFill: V.quadrantXAxisTextFill,
552
+ quadrantYAxisTextFill: V.quadrantYAxisTextFill,
553
+ quadrantTitleFill: V.quadrantTitleFill,
554
+ quadrantInternalBorderStrokeFill: V.quadrantInternalBorderStrokeFill,
555
+ quadrantExternalBorderStrokeFill: V.quadrantExternalBorderStrokeFill
556
+ };
557
+ }
558
+ clear() {
559
+ this.config = this.getDefaultConfig(), this.themeConfig = this.getDefaultThemeConfig(), this.data = this.getDefaultData(), this.classes = /* @__PURE__ */ new Map(), bt.info("clear called");
560
+ }
561
+ setData(n) {
562
+ this.data = { ...this.data, ...n };
563
+ }
564
+ addPoints(n) {
565
+ this.data.points = [...n, ...this.data.points];
566
+ }
567
+ addClass(n, f) {
568
+ this.classes.set(n, f);
569
+ }
570
+ setConfig(n) {
571
+ bt.trace("setConfig called with: ", n), this.config = { ...this.config, ...n };
572
+ }
573
+ setThemeConfig(n) {
574
+ bt.trace("setThemeConfig called with: ", n), this.themeConfig = { ...this.themeConfig, ...n };
575
+ }
576
+ calculateSpace(n, f, d, h) {
577
+ const p = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize, y = {
578
+ top: n === "top" && f ? p : 0,
579
+ bottom: n === "bottom" && f ? p : 0
580
+ }, _ = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize, a = {
581
+ left: this.config.yAxisPosition === "left" && d ? _ : 0,
582
+ right: this.config.yAxisPosition === "right" && d ? _ : 0
583
+ }, A = this.config.titleFontSize + this.config.titlePadding * 2, u = {
584
+ top: h ? A : 0
585
+ }, T = this.config.quadrantPadding + a.left, q = this.config.quadrantPadding + y.top + u.top, m = this.config.chartWidth - this.config.quadrantPadding * 2 - a.left - a.right, b = this.config.chartHeight - this.config.quadrantPadding * 2 - y.top - y.bottom - u.top, g = m / 2, G = b / 2;
586
+ return {
587
+ xAxisSpace: y,
588
+ yAxisSpace: a,
589
+ titleSpace: u,
590
+ quadrantSpace: {
591
+ quadrantLeft: T,
592
+ quadrantTop: q,
593
+ quadrantWidth: m,
594
+ quadrantHalfWidth: g,
595
+ quadrantHeight: b,
596
+ quadrantHalfHeight: G
597
+ }
598
+ };
599
+ }
600
+ getAxisLabels(n, f, d, h) {
601
+ const { quadrantSpace: p, titleSpace: y } = h, {
602
+ quadrantHalfHeight: _,
603
+ quadrantHeight: a,
604
+ quadrantLeft: A,
605
+ quadrantHalfWidth: u,
606
+ quadrantTop: T,
607
+ quadrantWidth: q
608
+ } = p, m = !!this.data.xAxisRightText, b = !!this.data.yAxisTopText, g = [];
609
+ return this.data.xAxisLeftText && f && g.push({
610
+ text: this.data.xAxisLeftText,
611
+ fill: this.themeConfig.quadrantXAxisTextFill,
612
+ x: A + (m ? u / 2 : 0),
613
+ y: n === "top" ? this.config.xAxisLabelPadding + y.top : this.config.xAxisLabelPadding + T + a + this.config.quadrantPadding,
614
+ fontSize: this.config.xAxisLabelFontSize,
615
+ verticalPos: m ? "center" : "left",
616
+ horizontalPos: "top",
617
+ rotation: 0
618
+ }), this.data.xAxisRightText && f && g.push({
619
+ text: this.data.xAxisRightText,
620
+ fill: this.themeConfig.quadrantXAxisTextFill,
621
+ x: A + u + (m ? u / 2 : 0),
622
+ y: n === "top" ? this.config.xAxisLabelPadding + y.top : this.config.xAxisLabelPadding + T + a + this.config.quadrantPadding,
623
+ fontSize: this.config.xAxisLabelFontSize,
624
+ verticalPos: m ? "center" : "left",
625
+ horizontalPos: "top",
626
+ rotation: 0
627
+ }), this.data.yAxisBottomText && d && g.push({
628
+ text: this.data.yAxisBottomText,
629
+ fill: this.themeConfig.quadrantYAxisTextFill,
630
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + A + q + this.config.quadrantPadding,
631
+ y: T + a - (b ? _ / 2 : 0),
632
+ fontSize: this.config.yAxisLabelFontSize,
633
+ verticalPos: b ? "center" : "left",
634
+ horizontalPos: "top",
635
+ rotation: -90
636
+ }), this.data.yAxisTopText && d && g.push({
637
+ text: this.data.yAxisTopText,
638
+ fill: this.themeConfig.quadrantYAxisTextFill,
639
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + A + q + this.config.quadrantPadding,
640
+ y: T + _ - (b ? _ / 2 : 0),
641
+ fontSize: this.config.yAxisLabelFontSize,
642
+ verticalPos: b ? "center" : "left",
643
+ horizontalPos: "top",
644
+ rotation: -90
645
+ }), g;
646
+ }
647
+ getQuadrants(n) {
648
+ const { quadrantSpace: f } = n, { quadrantHalfHeight: d, quadrantLeft: h, quadrantHalfWidth: p, quadrantTop: y } = f, _ = [
649
+ {
650
+ text: {
651
+ text: this.data.quadrant1Text,
652
+ fill: this.themeConfig.quadrant1TextFill,
653
+ x: 0,
654
+ y: 0,
655
+ fontSize: this.config.quadrantLabelFontSize,
656
+ verticalPos: "center",
657
+ horizontalPos: "middle",
658
+ rotation: 0
659
+ },
660
+ x: h + p,
661
+ y,
662
+ width: p,
663
+ height: d,
664
+ fill: this.themeConfig.quadrant1Fill
665
+ },
666
+ {
667
+ text: {
668
+ text: this.data.quadrant2Text,
669
+ fill: this.themeConfig.quadrant2TextFill,
670
+ x: 0,
671
+ y: 0,
672
+ fontSize: this.config.quadrantLabelFontSize,
673
+ verticalPos: "center",
674
+ horizontalPos: "middle",
675
+ rotation: 0
676
+ },
677
+ x: h,
678
+ y,
679
+ width: p,
680
+ height: d,
681
+ fill: this.themeConfig.quadrant2Fill
682
+ },
683
+ {
684
+ text: {
685
+ text: this.data.quadrant3Text,
686
+ fill: this.themeConfig.quadrant3TextFill,
687
+ x: 0,
688
+ y: 0,
689
+ fontSize: this.config.quadrantLabelFontSize,
690
+ verticalPos: "center",
691
+ horizontalPos: "middle",
692
+ rotation: 0
693
+ },
694
+ x: h,
695
+ y: y + d,
696
+ width: p,
697
+ height: d,
698
+ fill: this.themeConfig.quadrant3Fill
699
+ },
700
+ {
701
+ text: {
702
+ text: this.data.quadrant4Text,
703
+ fill: this.themeConfig.quadrant4TextFill,
704
+ x: 0,
705
+ y: 0,
706
+ fontSize: this.config.quadrantLabelFontSize,
707
+ verticalPos: "center",
708
+ horizontalPos: "middle",
709
+ rotation: 0
710
+ },
711
+ x: h + p,
712
+ y: y + d,
713
+ width: p,
714
+ height: d,
715
+ fill: this.themeConfig.quadrant4Fill
716
+ }
717
+ ];
718
+ for (const a of _)
719
+ a.text.x = a.x + a.width / 2, this.data.points.length === 0 ? (a.text.y = a.y + a.height / 2, a.text.horizontalPos = "middle") : (a.text.y = a.y + this.config.quadrantTextTopPadding, a.text.horizontalPos = "top");
720
+ return _;
721
+ }
722
+ getQuadrantPoints(n) {
723
+ const { quadrantSpace: f } = n, { quadrantHeight: d, quadrantLeft: h, quadrantTop: p, quadrantWidth: y } = f, _ = ee().domain([0, 1]).range([h, y + h]), a = ee().domain([0, 1]).range([d + p, p]);
724
+ return this.data.points.map((u) => {
725
+ const T = this.classes.get(u.className);
726
+ return T && (u = { ...T, ...u }), {
727
+ x: _(u.x),
728
+ y: a(u.y),
729
+ fill: u.color ?? this.themeConfig.quadrantPointFill,
730
+ radius: u.radius ?? this.config.pointRadius,
731
+ text: {
732
+ text: u.text,
733
+ fill: this.themeConfig.quadrantPointTextFill,
734
+ x: _(u.x),
735
+ y: a(u.y) + this.config.pointTextPadding,
736
+ verticalPos: "center",
737
+ horizontalPos: "top",
738
+ fontSize: this.config.pointLabelFontSize,
739
+ rotation: 0
740
+ },
741
+ strokeColor: u.strokeColor ?? this.themeConfig.quadrantPointFill,
742
+ strokeWidth: u.strokeWidth ?? "0px"
743
+ };
744
+ });
745
+ }
746
+ getBorders(n) {
747
+ const f = this.config.quadrantExternalBorderStrokeWidth / 2, { quadrantSpace: d } = n, {
748
+ quadrantHalfHeight: h,
749
+ quadrantHeight: p,
750
+ quadrantLeft: y,
751
+ quadrantHalfWidth: _,
752
+ quadrantTop: a,
753
+ quadrantWidth: A
754
+ } = d;
755
+ return [
756
+ // top border
757
+ {
758
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
759
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
760
+ x1: y - f,
761
+ y1: a,
762
+ x2: y + A + f,
763
+ y2: a
764
+ },
765
+ // right border
766
+ {
767
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
768
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
769
+ x1: y + A,
770
+ y1: a + f,
771
+ x2: y + A,
772
+ y2: a + p - f
773
+ },
774
+ // bottom border
775
+ {
776
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
777
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
778
+ x1: y - f,
779
+ y1: a + p,
780
+ x2: y + A + f,
781
+ y2: a + p
782
+ },
783
+ // left border
784
+ {
785
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
786
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
787
+ x1: y,
788
+ y1: a + f,
789
+ x2: y,
790
+ y2: a + p - f
791
+ },
792
+ // vertical inner border
793
+ {
794
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
795
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
796
+ x1: y + _,
797
+ y1: a + f,
798
+ x2: y + _,
799
+ y2: a + p - f
800
+ },
801
+ // horizontal inner border
802
+ {
803
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
804
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
805
+ x1: y + f,
806
+ y1: a + h,
807
+ x2: y + A - f,
808
+ y2: a + h
809
+ }
810
+ ];
811
+ }
812
+ getTitle(n) {
813
+ if (n)
814
+ return {
815
+ text: this.data.titleText,
816
+ fill: this.themeConfig.quadrantTitleFill,
817
+ fontSize: this.config.titleFontSize,
818
+ horizontalPos: "top",
819
+ verticalPos: "center",
820
+ rotation: 0,
821
+ y: this.config.titlePadding,
822
+ x: this.config.chartWidth / 2
823
+ };
824
+ }
825
+ build() {
826
+ const n = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText), f = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText), d = this.config.showTitle && !!this.data.titleText, h = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition, p = this.calculateSpace(h, n, f, d);
827
+ return {
828
+ points: this.getQuadrantPoints(p),
829
+ quadrants: this.getQuadrants(p),
830
+ axisLabels: this.getAxisLabels(h, n, f, p),
831
+ borderLines: this.getBorders(p),
832
+ title: this.getTitle(d)
833
+ };
834
+ }
835
+ }, o(ot, "QuadrantBuilder"), ot), lt, mt = (lt = class extends Error {
836
+ constructor(n, f, d) {
837
+ super(`value for ${n} ${f} is invalid, please use a valid ${d}`), this.name = "InvalidStyleError";
838
+ }
839
+ }, o(lt, "InvalidStyleError"), lt);
840
+ function Dt(t) {
841
+ return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t);
842
+ }
843
+ o(Dt, "validateHexCode");
844
+ function ae(t) {
845
+ return !/^\d+$/.test(t);
846
+ }
847
+ o(ae, "validateNumber");
848
+ function ne(t) {
849
+ return !/^\d+px$/.test(t);
850
+ }
851
+ o(ne, "validateSizeInPixels");
852
+ var Ve = zt();
853
+ function Q(t) {
854
+ return Ee(t.trim(), Ve);
855
+ }
856
+ o(Q, "textSanitizer");
857
+ var z = new ze();
858
+ function se(t) {
859
+ z.setData({ quadrant1Text: Q(t.text) });
860
+ }
861
+ o(se, "setQuadrant1Text");
862
+ function re(t) {
863
+ z.setData({ quadrant2Text: Q(t.text) });
864
+ }
865
+ o(re, "setQuadrant2Text");
866
+ function oe(t) {
867
+ z.setData({ quadrant3Text: Q(t.text) });
868
+ }
869
+ o(oe, "setQuadrant3Text");
870
+ function le(t) {
871
+ z.setData({ quadrant4Text: Q(t.text) });
872
+ }
873
+ o(le, "setQuadrant4Text");
874
+ function he(t) {
875
+ z.setData({ xAxisLeftText: Q(t.text) });
876
+ }
877
+ o(he, "setXAxisLeftText");
878
+ function ce(t) {
879
+ z.setData({ xAxisRightText: Q(t.text) });
880
+ }
881
+ o(ce, "setXAxisRightText");
882
+ function de(t) {
883
+ z.setData({ yAxisTopText: Q(t.text) });
884
+ }
885
+ o(de, "setYAxisTopText");
886
+ function ue(t) {
887
+ z.setData({ yAxisBottomText: Q(t.text) });
888
+ }
889
+ o(ue, "setYAxisBottomText");
890
+ function St(t) {
891
+ const n = {};
892
+ for (const f of t) {
893
+ const [d, h] = f.trim().split(/\s*:\s*/);
894
+ if (d === "radius") {
895
+ if (ae(h))
896
+ throw new mt(d, h, "number");
897
+ n.radius = parseInt(h);
898
+ } else if (d === "color") {
899
+ if (Dt(h))
900
+ throw new mt(d, h, "hex code");
901
+ n.color = h;
902
+ } else if (d === "stroke-color") {
903
+ if (Dt(h))
904
+ throw new mt(d, h, "hex code");
905
+ n.strokeColor = h;
906
+ } else if (d === "stroke-width") {
907
+ if (ne(h))
908
+ throw new mt(d, h, "number of pixels (eg. 10px)");
909
+ n.strokeWidth = h;
910
+ } else
911
+ throw new Error(`style named ${d} is not supported.`);
912
+ }
913
+ return n;
914
+ }
915
+ o(St, "parseStyles");
916
+ function xe(t, n, f, d, h) {
917
+ const p = St(h);
918
+ z.addPoints([
919
+ {
920
+ x: f,
921
+ y: d,
922
+ text: Q(t.text),
923
+ className: n,
924
+ ...p
925
+ }
926
+ ]);
927
+ }
928
+ o(xe, "addPoint");
929
+ function fe(t, n) {
930
+ z.addClass(t, St(n));
931
+ }
932
+ o(fe, "addClass");
933
+ function ge(t) {
934
+ z.setConfig({ chartWidth: t });
935
+ }
936
+ o(ge, "setWidth");
937
+ function pe(t) {
938
+ z.setConfig({ chartHeight: t });
939
+ }
940
+ o(pe, "setHeight");
941
+ function ye() {
942
+ const t = zt(), { themeVariables: n, quadrantChart: f } = t;
943
+ return f && z.setConfig(f), z.setThemeConfig({
944
+ quadrant1Fill: n.quadrant1Fill,
945
+ quadrant2Fill: n.quadrant2Fill,
946
+ quadrant3Fill: n.quadrant3Fill,
947
+ quadrant4Fill: n.quadrant4Fill,
948
+ quadrant1TextFill: n.quadrant1TextFill,
949
+ quadrant2TextFill: n.quadrant2TextFill,
950
+ quadrant3TextFill: n.quadrant3TextFill,
951
+ quadrant4TextFill: n.quadrant4TextFill,
952
+ quadrantPointFill: n.quadrantPointFill,
953
+ quadrantPointTextFill: n.quadrantPointTextFill,
954
+ quadrantXAxisTextFill: n.quadrantXAxisTextFill,
955
+ quadrantYAxisTextFill: n.quadrantYAxisTextFill,
956
+ quadrantExternalBorderStrokeFill: n.quadrantExternalBorderStrokeFill,
957
+ quadrantInternalBorderStrokeFill: n.quadrantInternalBorderStrokeFill,
958
+ quadrantTitleFill: n.quadrantTitleFill
959
+ }), z.setData({ titleText: ie() }), z.build();
960
+ }
961
+ o(ye, "getQuadrantData");
962
+ var Ie = /* @__PURE__ */ o(function() {
963
+ z.clear(), Ce();
964
+ }, "clear"), we = {
965
+ setWidth: ge,
966
+ setHeight: pe,
967
+ setQuadrant1Text: se,
968
+ setQuadrant2Text: re,
969
+ setQuadrant3Text: oe,
970
+ setQuadrant4Text: le,
971
+ setXAxisLeftText: he,
972
+ setXAxisRightText: ce,
973
+ setYAxisTopText: de,
974
+ setYAxisBottomText: ue,
975
+ parseStyles: St,
976
+ addPoint: xe,
977
+ addClass: fe,
978
+ getQuadrantData: ye,
979
+ clear: Ie,
980
+ setAccTitle: Pe,
981
+ getAccTitle: Fe,
982
+ setDiagramTitle: ke,
983
+ getDiagramTitle: ie,
984
+ getAccDescription: Ae,
985
+ setAccDescription: _e
986
+ }, Be = /* @__PURE__ */ o((t, n, f, d) => {
987
+ function h(i) {
988
+ return i === "top" ? "hanging" : "middle";
989
+ }
990
+ o(h, "getDominantBaseLine");
991
+ function p(i) {
992
+ return i === "left" ? "start" : "middle";
993
+ }
994
+ o(p, "getTextAnchor");
995
+ function y(i) {
996
+ return `translate(${i.x}, ${i.y}) rotate(${i.rotation || 0})`;
997
+ }
998
+ o(y, "getTransformation");
999
+ const _ = zt();
1000
+ bt.debug(`Rendering quadrant chart
1001
+ ` + t);
1002
+ const a = _.securityLevel;
1003
+ let A;
1004
+ a === "sandbox" && (A = Lt("#i" + n));
1005
+ const T = (a === "sandbox" ? Lt(A.nodes()[0].contentDocument.body) : Lt("body")).select(`[id="${n}"]`), q = T.append("g").attr("class", "main"), m = _.quadrantChart?.chartWidth ?? 500, b = _.quadrantChart?.chartHeight ?? 500;
1006
+ ve(T, b, m, _.quadrantChart?.useMaxWidth ?? !0), T.attr("viewBox", "0 0 " + m + " " + b), d.db.setHeight(b), d.db.setWidth(m);
1007
+ const g = d.db.getQuadrantData(), G = q.append("g").attr("class", "quadrants"), ht = q.append("g").attr("class", "border"), xt = q.append("g").attr("class", "data-points"), ft = q.append("g").attr("class", "labels"), gt = q.append("g").attr("class", "title");
1008
+ g.title && gt.append("text").attr("x", 0).attr("y", 0).attr("fill", g.title.fill).attr("font-size", g.title.fontSize).attr("dominant-baseline", h(g.title.horizontalPos)).attr("text-anchor", p(g.title.verticalPos)).attr("transform", y(g.title)).text(g.title.text), g.borderLines && ht.selectAll("line").data(g.borderLines).enter().append("line").attr("x1", (i) => i.x1).attr("y1", (i) => i.y1).attr("x2", (i) => i.x2).attr("y2", (i) => i.y2).style("stroke", (i) => i.strokeFill).style("stroke-width", (i) => i.strokeWidth);
1009
+ const ct = G.selectAll("g.quadrant").data(g.quadrants).enter().append("g").attr("class", "quadrant");
1010
+ ct.append("rect").attr("x", (i) => i.x).attr("y", (i) => i.y).attr("width", (i) => i.width).attr("height", (i) => i.height).attr("fill", (i) => i.fill), ct.append("text").attr("x", 0).attr("y", 0).attr("fill", (i) => i.text.fill).attr("font-size", (i) => i.text.fontSize).attr(
1011
+ "dominant-baseline",
1012
+ (i) => h(i.text.horizontalPos)
1013
+ ).attr("text-anchor", (i) => p(i.text.verticalPos)).attr("transform", (i) => y(i.text)).text((i) => i.text.text), ft.selectAll("g.label").data(g.axisLabels).enter().append("g").attr("class", "label").append("text").attr("x", 0).attr("y", 0).text((i) => i.text).attr("fill", (i) => i.fill).attr("font-size", (i) => i.fontSize).attr("dominant-baseline", (i) => h(i.horizontalPos)).attr("text-anchor", (i) => p(i.verticalPos)).attr("transform", (i) => y(i));
1014
+ const dt = xt.selectAll("g.data-point").data(g.points).enter().append("g").attr("class", "data-point");
1015
+ dt.append("circle").attr("cx", (i) => i.x).attr("cy", (i) => i.y).attr("r", (i) => i.radius).attr("fill", (i) => i.fill).attr("stroke", (i) => i.strokeColor).attr("stroke-width", (i) => i.strokeWidth), dt.append("text").attr("x", 0).attr("y", 0).text((i) => i.text.text).attr("fill", (i) => i.text.fill).attr("font-size", (i) => i.text.fontSize).attr(
1016
+ "dominant-baseline",
1017
+ (i) => h(i.text.horizontalPos)
1018
+ ).attr("text-anchor", (i) => p(i.text.verticalPos)).attr("transform", (i) => y(i.text));
1019
+ }, "draw"), Re = {
1020
+ draw: Be
1021
+ }, Qe = {
1022
+ parser: De,
1023
+ db: we,
1024
+ renderer: Re,
1025
+ styles: /* @__PURE__ */ o(() => "", "styles")
1026
+ };
1027
+ export {
1028
+ Qe as diagram
1029
+ };