@infinilabs/ai-chat 0.0.0 → 0.0.2

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 (119) hide show
  1. package/README.md +310 -56
  2. package/dist/_baseUniq-BFn6cCm9.js +152 -0
  3. package/dist/_baseUniq-nfJyj2zU.cjs +151 -0
  4. package/dist/arc-BWSMkwk2.cjs +130 -0
  5. package/dist/arc-DODeX7B9.js +131 -0
  6. package/dist/architecture-U656AL7Q-B4C0nw6C.js +5 -0
  7. package/dist/architecture-U656AL7Q-CVURQXwt.cjs +5 -0
  8. package/dist/architectureDiagram-VXUJARFQ-2UbdzpNz.cjs +8681 -0
  9. package/dist/architectureDiagram-VXUJARFQ-NCVmzKuE.js +8681 -0
  10. package/dist/blockDiagram-VD42YOAC-B3yCPK1N.cjs +3606 -0
  11. package/dist/blockDiagram-VD42YOAC-C4FsmQfk.js +3606 -0
  12. package/dist/c4Diagram-YG6GDRKO-ATyoKzFV.js +2481 -0
  13. package/dist/c4Diagram-YG6GDRKO-COwVcHWj.cjs +2481 -0
  14. package/dist/channel-2Y73gsu9.cjs +6 -0
  15. package/dist/channel-oB8MffQV.js +7 -0
  16. package/dist/chunk-4BX2VUAB-C3diNHZw.cjs +15 -0
  17. package/dist/chunk-4BX2VUAB-sd2zFBFz.js +16 -0
  18. package/dist/chunk-55IACEB6-6ohTnYE3.js +13 -0
  19. package/dist/chunk-55IACEB6-T-CzlJke.cjs +12 -0
  20. package/dist/chunk-B4BG7PRW-B1zqG62l.cjs +1825 -0
  21. package/dist/chunk-B4BG7PRW-E1dti26Y.js +1826 -0
  22. package/dist/chunk-DI55MBZ5-Dk0kfYBV.cjs +1914 -0
  23. package/dist/chunk-DI55MBZ5-DpHw-vMw.js +1915 -0
  24. package/dist/chunk-FMBD7UC4-B1vXpasq.js +19 -0
  25. package/dist/chunk-FMBD7UC4-CShN9-qf.cjs +18 -0
  26. package/dist/chunk-QN33PNHL-Cw7FG91D.js +24 -0
  27. package/dist/chunk-QN33PNHL-DJi1fhak.cjs +23 -0
  28. package/dist/chunk-QZHKN3VN-BweiBR9P.js +17 -0
  29. package/dist/chunk-QZHKN3VN-DfUW_gDw.cjs +16 -0
  30. package/dist/chunk-TZMSLE5B-DY2Kbag4.cjs +107 -0
  31. package/dist/chunk-TZMSLE5B-ZQ2Esoix.js +108 -0
  32. package/dist/classDiagram-2ON5EDUG-D2tIbkjc.js +19 -0
  33. package/dist/classDiagram-2ON5EDUG-DRhRmkUb.cjs +19 -0
  34. package/dist/classDiagram-v2-WZHVMYZB-D2tIbkjc.js +19 -0
  35. package/dist/classDiagram-v2-WZHVMYZB-DRhRmkUb.cjs +19 -0
  36. package/dist/clone-BMkj3yun.cjs +7 -0
  37. package/dist/clone-ChHXIoR6.js +8 -0
  38. package/dist/cose-bilkent-S5V4N54A-BXnWH5Od.cjs +4942 -0
  39. package/dist/cose-bilkent-S5V4N54A-D15BmpCb.js +4942 -0
  40. package/dist/cytoscape.esm-BfvZ3QT_.js +30239 -0
  41. package/dist/cytoscape.esm-D8IBYQeQ.cjs +30238 -0
  42. package/dist/dagre-6UL2VRFP-DGQ6TW_g.cjs +693 -0
  43. package/dist/dagre-6UL2VRFP-WmhUYWg8.js +693 -0
  44. package/dist/defaultLocale-DVr69WTU.js +206 -0
  45. package/dist/defaultLocale-DwYGIg9G.cjs +203 -0
  46. package/dist/diagram-PSM6KHXK-DSfHBoUT.js +845 -0
  47. package/dist/diagram-PSM6KHXK-J4qyGeN7.cjs +845 -0
  48. package/dist/diagram-QEK2KX5R-D96wT5cH.cjs +300 -0
  49. package/dist/diagram-QEK2KX5R-I_nyexpY.js +300 -0
  50. package/dist/diagram-S2PKOQOG-BC_WyKEe.cjs +210 -0
  51. package/dist/diagram-S2PKOQOG-aooXSMNo.js +210 -0
  52. package/dist/erDiagram-Q2GNP2WA-DQ8Lquay.cjs +1158 -0
  53. package/dist/erDiagram-Q2GNP2WA-DWF8e6EL.js +1158 -0
  54. package/dist/flowDiagram-NV44I4VS-CM9c4F1o.js +2331 -0
  55. package/dist/flowDiagram-NV44I4VS-DpYNkyM2.cjs +2331 -0
  56. package/dist/ganttDiagram-JELNMOA3-CAsoD6rZ.js +3679 -0
  57. package/dist/ganttDiagram-JELNMOA3-DfKahpj4.cjs +3679 -0
  58. package/dist/gitGraph-F6HP7TQM-BX2fz4_i.js +5 -0
  59. package/dist/gitGraph-F6HP7TQM-DRkGg4T1.cjs +5 -0
  60. package/dist/gitGraphDiagram-NY62KEGX-PXpI94u6.js +1203 -0
  61. package/dist/gitGraphDiagram-NY62KEGX-YhnKpooH.cjs +1203 -0
  62. package/dist/graph-BvxpI7Xc.js +596 -0
  63. package/dist/graph-CI_TWBSn.cjs +595 -0
  64. package/dist/index-BctLGjTK.cjs +120500 -0
  65. package/dist/index-CjSgoo1P.js +120485 -0
  66. package/dist/index.cjs +19 -0
  67. package/dist/index.js +12 -19961
  68. package/dist/info-NVLQJR56-BGbTE7dw.cjs +5 -0
  69. package/dist/info-NVLQJR56-DRxIh-N8.js +5 -0
  70. package/dist/infoDiagram-WHAUD3N6-BB2Bnbnh.cjs +31 -0
  71. package/dist/infoDiagram-WHAUD3N6-D_RrgwxS.js +31 -0
  72. package/dist/init-DevvdK2U.cjs +15 -0
  73. package/dist/init-ZxktEp_H.js +16 -0
  74. package/dist/journeyDiagram-XKPGCS4Q-BJjXlMIj.js +1254 -0
  75. package/dist/journeyDiagram-XKPGCS4Q-BcBLsfI9.cjs +1254 -0
  76. package/dist/kanban-definition-3W4ZIXB7-0wwNBZ93.js +1047 -0
  77. package/dist/kanban-definition-3W4ZIXB7-CaY0q4j9.cjs +1047 -0
  78. package/dist/katex-BhpYeT3b.cjs +14523 -0
  79. package/dist/katex-ei8sH3Uy.js +14524 -0
  80. package/dist/layout-CcghncRv.js +2183 -0
  81. package/dist/layout-CvwzED_C.cjs +2182 -0
  82. package/dist/linear-CYow-mAK.cjs +339 -0
  83. package/dist/linear-D_gKQzVp.js +340 -0
  84. package/dist/mermaid-parser.core-CzmkR-3i.cjs +18703 -0
  85. package/dist/mermaid-parser.core-DCMDT-Cp.js +18704 -0
  86. package/dist/min-BBp7Smma.js +41 -0
  87. package/dist/min-Gu1I_bJ9.cjs +40 -0
  88. package/dist/mindmap-definition-VGOIOE7T-D16Pp1u5.cjs +1126 -0
  89. package/dist/mindmap-definition-VGOIOE7T-PjSLRtz4.js +1126 -0
  90. package/dist/ordinal-CxptdPJm.js +76 -0
  91. package/dist/ordinal-D7sQNqXZ.cjs +75 -0
  92. package/dist/packet-BFZMPI3H-BvdogPiS.js +5 -0
  93. package/dist/packet-BFZMPI3H-C7pOHUWY.cjs +5 -0
  94. package/dist/pie-7BOR55EZ-D-DxSHbP.cjs +5 -0
  95. package/dist/pie-7BOR55EZ-DEWJe4Xn.js +5 -0
  96. package/dist/pieDiagram-ADFJNKIX-CoDddKZl.js +237 -0
  97. package/dist/pieDiagram-ADFJNKIX-DjN4DU9l.cjs +237 -0
  98. package/dist/quadrantDiagram-AYHSOK5B-BZOg0JMm.js +1335 -0
  99. package/dist/quadrantDiagram-AYHSOK5B-DXjTSOL4.cjs +1335 -0
  100. package/dist/radar-NHE76QYJ-BrnDXy9q.cjs +5 -0
  101. package/dist/radar-NHE76QYJ-C2WmPmJ4.js +5 -0
  102. package/dist/requirementDiagram-UZGBJVZJ-CCW1O1xH.js +1161 -0
  103. package/dist/requirementDiagram-UZGBJVZJ-e5F3-dDI.cjs +1161 -0
  104. package/dist/sankeyDiagram-TZEHDZUN-BaGzCxTp.js +1193 -0
  105. package/dist/sankeyDiagram-TZEHDZUN-DtIvOvVI.cjs +1193 -0
  106. package/dist/sequenceDiagram-WL72ISMW-0vFhYnxn.cjs +3874 -0
  107. package/dist/sequenceDiagram-WL72ISMW-DL3B7U56.js +3874 -0
  108. package/dist/stateDiagram-FKZM4ZOC-CXW608BR.cjs +447 -0
  109. package/dist/stateDiagram-FKZM4ZOC-Ddw6HxPD.js +447 -0
  110. package/dist/stateDiagram-v2-4FDKWEC3-DZCkQKmp.js +19 -0
  111. package/dist/stateDiagram-v2-4FDKWEC3-DefWUbvq.cjs +19 -0
  112. package/dist/timeline-definition-IT6M3QCI-C3TfA9lE.cjs +1222 -0
  113. package/dist/timeline-definition-IT6M3QCI-DiS88lUo.js +1222 -0
  114. package/dist/treemap-KMMF4GRG-Bl-H6j2c.cjs +5 -0
  115. package/dist/treemap-KMMF4GRG-DGGr_R9A.js +5 -0
  116. package/dist/xychartDiagram-PRI3JC2R-BrOwRjfF.js +1886 -0
  117. package/dist/xychartDiagram-PRI3JC2R-CM06DttH.cjs +1886 -0
  118. package/package.json +22 -11
  119. package/dist/index.css +0 -1582
@@ -0,0 +1,1335 @@
1
+ "use strict";
2
+ var _a, _b;
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const index = require("./index-BctLGjTK.cjs");
5
+ const linear = require("./linear-CYow-mAK.cjs");
6
+ var parser = (function() {
7
+ var o = /* @__PURE__ */ index.__name(function(k, v, o2, l) {
8
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
9
+ return o2;
10
+ }, "o"), $V0 = [1, 3], $V1 = [1, 4], $V2 = [1, 5], $V3 = [1, 6], $V4 = [1, 7], $V5 = [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], $V6 = [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], $V7 = [55, 56, 57], $V8 = [2, 36], $V9 = [1, 37], $Va = [1, 36], $Vb = [1, 38], $Vc = [1, 35], $Vd = [1, 43], $Ve = [1, 41], $Vf = [1, 14], $Vg = [1, 23], $Vh = [1, 18], $Vi = [1, 19], $Vj = [1, 20], $Vk = [1, 21], $Vl = [1, 22], $Vm = [1, 24], $Vn = [1, 25], $Vo = [1, 26], $Vp = [1, 27], $Vq = [1, 28], $Vr = [1, 29], $Vs = [1, 32], $Vt = [1, 33], $Vu = [1, 34], $Vv = [1, 39], $Vw = [1, 40], $Vx = [1, 42], $Vy = [1, 44], $Vz = [1, 62], $VA = [1, 61], $VB = [4, 5, 8, 10, 12, 13, 14, 18, 44, 47, 49, 55, 56, 57, 63, 64, 65, 66, 67], $VC = [1, 65], $VD = [1, 66], $VE = [1, 67], $VF = [1, 68], $VG = [1, 69], $VH = [1, 70], $VI = [1, 71], $VJ = [1, 72], $VK = [1, 73], $VL = [1, 74], $VM = [1, 75], $VN = [1, 76], $VO = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18], $VP = [1, 90], $VQ = [1, 91], $VR = [1, 92], $VS = [1, 99], $VT = [1, 93], $VU = [1, 96], $VV = [1, 94], $VW = [1, 95], $VX = [1, 97], $VY = [1, 98], $VZ = [1, 102], $V_ = [10, 55, 56, 57], $V$ = [4, 5, 6, 8, 10, 11, 13, 17, 18, 19, 20, 55, 56, 57];
11
+ var parser2 = {
12
+ trace: /* @__PURE__ */ index.__name(function trace() {
13
+ }, "trace"),
14
+ yy: {},
15
+ 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 },
16
+ 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" },
17
+ 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]],
18
+ performAction: /* @__PURE__ */ index.__name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
19
+ var $0 = $$.length - 1;
20
+ switch (yystate) {
21
+ case 23:
22
+ this.$ = $$[$0];
23
+ break;
24
+ case 24:
25
+ this.$ = $$[$0 - 1] + "" + $$[$0];
26
+ break;
27
+ case 26:
28
+ this.$ = $$[$0 - 1] + $$[$0];
29
+ break;
30
+ case 27:
31
+ this.$ = [$$[$0].trim()];
32
+ break;
33
+ case 28:
34
+ $$[$0 - 2].push($$[$0].trim());
35
+ this.$ = $$[$0 - 2];
36
+ break;
37
+ case 29:
38
+ this.$ = $$[$0 - 4];
39
+ yy.addClass($$[$0 - 2], $$[$0]);
40
+ break;
41
+ case 37:
42
+ this.$ = [];
43
+ break;
44
+ case 42:
45
+ this.$ = $$[$0].trim();
46
+ yy.setDiagramTitle(this.$);
47
+ break;
48
+ case 43:
49
+ this.$ = $$[$0].trim();
50
+ yy.setAccTitle(this.$);
51
+ break;
52
+ case 44:
53
+ case 45:
54
+ this.$ = $$[$0].trim();
55
+ yy.setAccDescription(this.$);
56
+ break;
57
+ case 46:
58
+ yy.addSection($$[$0].substr(8));
59
+ this.$ = $$[$0].substr(8);
60
+ break;
61
+ case 47:
62
+ yy.addPoint($$[$0 - 3], "", $$[$0 - 1], $$[$0], []);
63
+ break;
64
+ case 48:
65
+ yy.addPoint($$[$0 - 4], $$[$0 - 3], $$[$0 - 1], $$[$0], []);
66
+ break;
67
+ case 49:
68
+ yy.addPoint($$[$0 - 4], "", $$[$0 - 2], $$[$0 - 1], $$[$0]);
69
+ break;
70
+ case 50:
71
+ yy.addPoint($$[$0 - 5], $$[$0 - 4], $$[$0 - 2], $$[$0 - 1], $$[$0]);
72
+ break;
73
+ case 51:
74
+ yy.setXAxisLeftText($$[$0 - 2]);
75
+ yy.setXAxisRightText($$[$0]);
76
+ break;
77
+ case 52:
78
+ $$[$0 - 1].text += " ⟶ ";
79
+ yy.setXAxisLeftText($$[$0 - 1]);
80
+ break;
81
+ case 53:
82
+ yy.setXAxisLeftText($$[$0]);
83
+ break;
84
+ case 54:
85
+ yy.setYAxisBottomText($$[$0 - 2]);
86
+ yy.setYAxisTopText($$[$0]);
87
+ break;
88
+ case 55:
89
+ $$[$0 - 1].text += " ⟶ ";
90
+ yy.setYAxisBottomText($$[$0 - 1]);
91
+ break;
92
+ case 56:
93
+ yy.setYAxisBottomText($$[$0]);
94
+ break;
95
+ case 57:
96
+ yy.setQuadrant1Text($$[$0]);
97
+ break;
98
+ case 58:
99
+ yy.setQuadrant2Text($$[$0]);
100
+ break;
101
+ case 59:
102
+ yy.setQuadrant3Text($$[$0]);
103
+ break;
104
+ case 60:
105
+ yy.setQuadrant4Text($$[$0]);
106
+ break;
107
+ case 64:
108
+ this.$ = { text: $$[$0], type: "text" };
109
+ break;
110
+ case 65:
111
+ this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
112
+ break;
113
+ case 66:
114
+ this.$ = { text: $$[$0], type: "text" };
115
+ break;
116
+ case 67:
117
+ this.$ = { text: $$[$0], type: "markdown" };
118
+ break;
119
+ case 68:
120
+ this.$ = $$[$0];
121
+ break;
122
+ case 69:
123
+ this.$ = $$[$0 - 1] + "" + $$[$0];
124
+ break;
125
+ }
126
+ }, "anonymous"),
127
+ table: [{ 18: $V0, 26: 1, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, { 1: [3] }, { 18: $V0, 26: 8, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, { 18: $V0, 26: 9, 27: 2, 28: $V1, 55: $V2, 56: $V3, 57: $V4 }, o($V5, [2, 33], { 29: 10 }), o($V6, [2, 61]), o($V6, [2, 62]), o($V6, [2, 63]), { 1: [2, 30] }, { 1: [2, 31] }, o($V7, $V8, { 30: 11, 31: 12, 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 1: [2, 32], 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $Vf, 25: $Vg, 35: $Vh, 37: $Vi, 39: $Vj, 41: $Vk, 42: $Vl, 48: $Vm, 50: $Vn, 51: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V5, [2, 34]), { 27: 45, 55: $V2, 56: $V3, 57: $V4 }, o($V7, [2, 37]), o($V7, $V8, { 24: 13, 32: 15, 33: 16, 34: 17, 43: 30, 58: 31, 31: 46, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $Vf, 25: $Vg, 35: $Vh, 37: $Vi, 39: $Vj, 41: $Vk, 42: $Vl, 48: $Vm, 50: $Vn, 51: $Vo, 52: $Vp, 53: $Vq, 54: $Vr, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 39]), o($V7, [2, 40]), o($V7, [2, 41]), { 36: [1, 47] }, { 38: [1, 48] }, { 40: [1, 49] }, o($V7, [2, 45]), o($V7, [2, 46]), { 18: [1, 50] }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 51, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 52, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 53, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 54, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 55, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 43: 56, 58: 31, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, { 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 44: [1, 57], 47: [1, 58], 58: 60, 59: 59, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }, o($VB, [2, 64]), o($VB, [2, 66]), o($VB, [2, 67]), o($VB, [2, 70]), o($VB, [2, 71]), o($VB, [2, 72]), o($VB, [2, 73]), o($VB, [2, 74]), o($VB, [2, 75]), o($VB, [2, 76]), o($VB, [2, 77]), o($VB, [2, 78]), o($VB, [2, 79]), o($VB, [2, 80]), o($V5, [2, 35]), o($V7, [2, 38]), o($V7, [2, 42]), o($V7, [2, 43]), o($V7, [2, 44]), { 3: 64, 4: $VC, 5: $VD, 6: $VE, 7: $VF, 8: $VG, 9: $VH, 10: $VI, 11: $VJ, 12: $VK, 13: $VL, 14: $VM, 15: $VN, 21: 63 }, o($V7, [2, 53], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 49: [1, 77], 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 56], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 49: [1, 78], 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 57], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 58], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 59], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 60], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), { 45: [1, 79] }, { 44: [1, 80] }, o($VB, [2, 65]), o($VB, [2, 81]), o($VB, [2, 82]), o($VB, [2, 83]), { 3: 82, 4: $VC, 5: $VD, 6: $VE, 7: $VF, 8: $VG, 9: $VH, 10: $VI, 11: $VJ, 12: $VK, 13: $VL, 14: $VM, 15: $VN, 18: [1, 81] }, o($VO, [2, 23]), o($VO, [2, 1]), o($VO, [2, 2]), o($VO, [2, 3]), o($VO, [2, 4]), o($VO, [2, 5]), o($VO, [2, 6]), o($VO, [2, 7]), o($VO, [2, 8]), o($VO, [2, 9]), o($VO, [2, 10]), o($VO, [2, 11]), o($VO, [2, 12]), o($V7, [2, 52], { 58: 31, 43: 83, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 55], { 58: 31, 43: 84, 4: $V9, 5: $Va, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 60: $Vs, 61: $Vt, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), { 46: [1, 85] }, { 45: [1, 86] }, { 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 16: 89, 17: $VV, 18: $VW, 19: $VX, 20: $VY, 22: 88, 23: 87 }, o($VO, [2, 24]), o($V7, [2, 51], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 54], { 59: 59, 58: 60, 4: $V9, 5: $Va, 8: $Vz, 10: $Vb, 12: $Vc, 13: $Vd, 14: $Ve, 18: $VA, 63: $Vu, 64: $Vv, 65: $Vw, 66: $Vx, 67: $Vy }), o($V7, [2, 47], { 22: 88, 16: 89, 23: 100, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY }), { 46: [1, 101] }, o($V7, [2, 29], { 10: $VZ }), o($V_, [2, 27], { 16: 103, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY }), o($V$, [2, 25]), o($V$, [2, 13]), o($V$, [2, 14]), o($V$, [2, 15]), o($V$, [2, 16]), o($V$, [2, 17]), o($V$, [2, 18]), o($V$, [2, 19]), o($V$, [2, 20]), o($V$, [2, 21]), o($V$, [2, 22]), o($V7, [2, 49], { 10: $VZ }), o($V7, [2, 48], { 22: 88, 16: 89, 23: 104, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY }), { 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 16: 89, 17: $VV, 18: $VW, 19: $VX, 20: $VY, 22: 105 }, o($V$, [2, 26]), o($V7, [2, 50], { 10: $VZ }), o($V_, [2, 28], { 16: 103, 4: $VP, 5: $VQ, 6: $VR, 8: $VS, 11: $VT, 13: $VU, 17: $VV, 18: $VW, 19: $VX, 20: $VY })],
128
+ defaultActions: { 8: [2, 30], 9: [2, 31] },
129
+ parseError: /* @__PURE__ */ index.__name(function parseError(str, hash) {
130
+ if (hash.recoverable) {
131
+ this.trace(str);
132
+ } else {
133
+ var error = new Error(str);
134
+ error.hash = hash;
135
+ throw error;
136
+ }
137
+ }, "parseError"),
138
+ parse: /* @__PURE__ */ index.__name(function parse(input) {
139
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
140
+ var args = lstack.slice.call(arguments, 1);
141
+ var lexer2 = Object.create(this.lexer);
142
+ var sharedState = { yy: {} };
143
+ for (var k in this.yy) {
144
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
145
+ sharedState.yy[k] = this.yy[k];
146
+ }
147
+ }
148
+ lexer2.setInput(input, sharedState.yy);
149
+ sharedState.yy.lexer = lexer2;
150
+ sharedState.yy.parser = this;
151
+ if (typeof lexer2.yylloc == "undefined") {
152
+ lexer2.yylloc = {};
153
+ }
154
+ var yyloc = lexer2.yylloc;
155
+ lstack.push(yyloc);
156
+ var ranges = lexer2.options && lexer2.options.ranges;
157
+ if (typeof sharedState.yy.parseError === "function") {
158
+ this.parseError = sharedState.yy.parseError;
159
+ } else {
160
+ this.parseError = Object.getPrototypeOf(this).parseError;
161
+ }
162
+ function popStack(n) {
163
+ stack.length = stack.length - 2 * n;
164
+ vstack.length = vstack.length - n;
165
+ lstack.length = lstack.length - n;
166
+ }
167
+ index.__name(popStack, "popStack");
168
+ function lex() {
169
+ var token;
170
+ token = tstack.pop() || lexer2.lex() || EOF;
171
+ if (typeof token !== "number") {
172
+ if (token instanceof Array) {
173
+ tstack = token;
174
+ token = tstack.pop();
175
+ }
176
+ token = self.symbols_[token] || token;
177
+ }
178
+ return token;
179
+ }
180
+ index.__name(lex, "lex");
181
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
182
+ while (true) {
183
+ state = stack[stack.length - 1];
184
+ if (this.defaultActions[state]) {
185
+ action = this.defaultActions[state];
186
+ } else {
187
+ if (symbol === null || typeof symbol == "undefined") {
188
+ symbol = lex();
189
+ }
190
+ action = table[state] && table[state][symbol];
191
+ }
192
+ if (typeof action === "undefined" || !action.length || !action[0]) {
193
+ var errStr = "";
194
+ expected = [];
195
+ for (p in table[state]) {
196
+ if (this.terminals_[p] && p > TERROR) {
197
+ expected.push("'" + this.terminals_[p] + "'");
198
+ }
199
+ }
200
+ if (lexer2.showPosition) {
201
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
202
+ } else {
203
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
204
+ }
205
+ this.parseError(errStr, {
206
+ text: lexer2.match,
207
+ token: this.terminals_[symbol] || symbol,
208
+ line: lexer2.yylineno,
209
+ loc: yyloc,
210
+ expected
211
+ });
212
+ }
213
+ if (action[0] instanceof Array && action.length > 1) {
214
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
215
+ }
216
+ switch (action[0]) {
217
+ case 1:
218
+ stack.push(symbol);
219
+ vstack.push(lexer2.yytext);
220
+ lstack.push(lexer2.yylloc);
221
+ stack.push(action[1]);
222
+ symbol = null;
223
+ {
224
+ yyleng = lexer2.yyleng;
225
+ yytext = lexer2.yytext;
226
+ yylineno = lexer2.yylineno;
227
+ yyloc = lexer2.yylloc;
228
+ }
229
+ break;
230
+ case 2:
231
+ len = this.productions_[action[1]][1];
232
+ yyval.$ = vstack[vstack.length - len];
233
+ yyval._$ = {
234
+ first_line: lstack[lstack.length - (len || 1)].first_line,
235
+ last_line: lstack[lstack.length - 1].last_line,
236
+ first_column: lstack[lstack.length - (len || 1)].first_column,
237
+ last_column: lstack[lstack.length - 1].last_column
238
+ };
239
+ if (ranges) {
240
+ yyval._$.range = [
241
+ lstack[lstack.length - (len || 1)].range[0],
242
+ lstack[lstack.length - 1].range[1]
243
+ ];
244
+ }
245
+ r = this.performAction.apply(yyval, [
246
+ yytext,
247
+ yyleng,
248
+ yylineno,
249
+ sharedState.yy,
250
+ action[1],
251
+ vstack,
252
+ lstack
253
+ ].concat(args));
254
+ if (typeof r !== "undefined") {
255
+ return r;
256
+ }
257
+ if (len) {
258
+ stack = stack.slice(0, -1 * len * 2);
259
+ vstack = vstack.slice(0, -1 * len);
260
+ lstack = lstack.slice(0, -1 * len);
261
+ }
262
+ stack.push(this.productions_[action[1]][0]);
263
+ vstack.push(yyval.$);
264
+ lstack.push(yyval._$);
265
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
266
+ stack.push(newState);
267
+ break;
268
+ case 3:
269
+ return true;
270
+ }
271
+ }
272
+ return true;
273
+ }, "parse")
274
+ };
275
+ var lexer = /* @__PURE__ */ (function() {
276
+ var lexer2 = {
277
+ EOF: 1,
278
+ parseError: /* @__PURE__ */ index.__name(function parseError(str, hash) {
279
+ if (this.yy.parser) {
280
+ this.yy.parser.parseError(str, hash);
281
+ } else {
282
+ throw new Error(str);
283
+ }
284
+ }, "parseError"),
285
+ // resets the lexer, sets new input
286
+ setInput: /* @__PURE__ */ index.__name(function(input, yy) {
287
+ this.yy = yy || this.yy || {};
288
+ this._input = input;
289
+ this._more = this._backtrack = this.done = false;
290
+ this.yylineno = this.yyleng = 0;
291
+ this.yytext = this.matched = this.match = "";
292
+ this.conditionStack = ["INITIAL"];
293
+ this.yylloc = {
294
+ first_line: 1,
295
+ first_column: 0,
296
+ last_line: 1,
297
+ last_column: 0
298
+ };
299
+ if (this.options.ranges) {
300
+ this.yylloc.range = [0, 0];
301
+ }
302
+ this.offset = 0;
303
+ return this;
304
+ }, "setInput"),
305
+ // consumes and returns one char from the input
306
+ input: /* @__PURE__ */ index.__name(function() {
307
+ var ch = this._input[0];
308
+ this.yytext += ch;
309
+ this.yyleng++;
310
+ this.offset++;
311
+ this.match += ch;
312
+ this.matched += ch;
313
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
314
+ if (lines) {
315
+ this.yylineno++;
316
+ this.yylloc.last_line++;
317
+ } else {
318
+ this.yylloc.last_column++;
319
+ }
320
+ if (this.options.ranges) {
321
+ this.yylloc.range[1]++;
322
+ }
323
+ this._input = this._input.slice(1);
324
+ return ch;
325
+ }, "input"),
326
+ // unshifts one char (or a string) into the input
327
+ unput: /* @__PURE__ */ index.__name(function(ch) {
328
+ var len = ch.length;
329
+ var lines = ch.split(/(?:\r\n?|\n)/g);
330
+ this._input = ch + this._input;
331
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
332
+ this.offset -= len;
333
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
334
+ this.match = this.match.substr(0, this.match.length - 1);
335
+ this.matched = this.matched.substr(0, this.matched.length - 1);
336
+ if (lines.length - 1) {
337
+ this.yylineno -= lines.length - 1;
338
+ }
339
+ var r = this.yylloc.range;
340
+ this.yylloc = {
341
+ first_line: this.yylloc.first_line,
342
+ last_line: this.yylineno + 1,
343
+ first_column: this.yylloc.first_column,
344
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
345
+ };
346
+ if (this.options.ranges) {
347
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
348
+ }
349
+ this.yyleng = this.yytext.length;
350
+ return this;
351
+ }, "unput"),
352
+ // When called from action, caches matched text and appends it on next action
353
+ more: /* @__PURE__ */ index.__name(function() {
354
+ this._more = true;
355
+ return this;
356
+ }, "more"),
357
+ // 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.
358
+ reject: /* @__PURE__ */ index.__name(function() {
359
+ if (this.options.backtrack_lexer) {
360
+ this._backtrack = true;
361
+ } else {
362
+ 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).\n" + this.showPosition(), {
363
+ text: "",
364
+ token: null,
365
+ line: this.yylineno
366
+ });
367
+ }
368
+ return this;
369
+ }, "reject"),
370
+ // retain first n characters of the match
371
+ less: /* @__PURE__ */ index.__name(function(n) {
372
+ this.unput(this.match.slice(n));
373
+ }, "less"),
374
+ // displays already matched input, i.e. for error messages
375
+ pastInput: /* @__PURE__ */ index.__name(function() {
376
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
377
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
378
+ }, "pastInput"),
379
+ // displays upcoming input, i.e. for error messages
380
+ upcomingInput: /* @__PURE__ */ index.__name(function() {
381
+ var next = this.match;
382
+ if (next.length < 20) {
383
+ next += this._input.substr(0, 20 - next.length);
384
+ }
385
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
386
+ }, "upcomingInput"),
387
+ // displays the character position where the lexing error occurred, i.e. for error messages
388
+ showPosition: /* @__PURE__ */ index.__name(function() {
389
+ var pre = this.pastInput();
390
+ var c = new Array(pre.length + 1).join("-");
391
+ return pre + this.upcomingInput() + "\n" + c + "^";
392
+ }, "showPosition"),
393
+ // test the lexed token: return FALSE when not a match, otherwise return token
394
+ test_match: /* @__PURE__ */ index.__name(function(match, indexed_rule) {
395
+ var token, lines, backup;
396
+ if (this.options.backtrack_lexer) {
397
+ backup = {
398
+ yylineno: this.yylineno,
399
+ yylloc: {
400
+ first_line: this.yylloc.first_line,
401
+ last_line: this.last_line,
402
+ first_column: this.yylloc.first_column,
403
+ last_column: this.yylloc.last_column
404
+ },
405
+ yytext: this.yytext,
406
+ match: this.match,
407
+ matches: this.matches,
408
+ matched: this.matched,
409
+ yyleng: this.yyleng,
410
+ offset: this.offset,
411
+ _more: this._more,
412
+ _input: this._input,
413
+ yy: this.yy,
414
+ conditionStack: this.conditionStack.slice(0),
415
+ done: this.done
416
+ };
417
+ if (this.options.ranges) {
418
+ backup.yylloc.range = this.yylloc.range.slice(0);
419
+ }
420
+ }
421
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
422
+ if (lines) {
423
+ this.yylineno += lines.length;
424
+ }
425
+ this.yylloc = {
426
+ first_line: this.yylloc.last_line,
427
+ last_line: this.yylineno + 1,
428
+ first_column: this.yylloc.last_column,
429
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
430
+ };
431
+ this.yytext += match[0];
432
+ this.match += match[0];
433
+ this.matches = match;
434
+ this.yyleng = this.yytext.length;
435
+ if (this.options.ranges) {
436
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
437
+ }
438
+ this._more = false;
439
+ this._backtrack = false;
440
+ this._input = this._input.slice(match[0].length);
441
+ this.matched += match[0];
442
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
443
+ if (this.done && this._input) {
444
+ this.done = false;
445
+ }
446
+ if (token) {
447
+ return token;
448
+ } else if (this._backtrack) {
449
+ for (var k in backup) {
450
+ this[k] = backup[k];
451
+ }
452
+ return false;
453
+ }
454
+ return false;
455
+ }, "test_match"),
456
+ // return next match in input
457
+ next: /* @__PURE__ */ index.__name(function() {
458
+ if (this.done) {
459
+ return this.EOF;
460
+ }
461
+ if (!this._input) {
462
+ this.done = true;
463
+ }
464
+ var token, match, tempMatch, index2;
465
+ if (!this._more) {
466
+ this.yytext = "";
467
+ this.match = "";
468
+ }
469
+ var rules = this._currentRules();
470
+ for (var i = 0; i < rules.length; i++) {
471
+ tempMatch = this._input.match(this.rules[rules[i]]);
472
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
473
+ match = tempMatch;
474
+ index2 = i;
475
+ if (this.options.backtrack_lexer) {
476
+ token = this.test_match(tempMatch, rules[i]);
477
+ if (token !== false) {
478
+ return token;
479
+ } else if (this._backtrack) {
480
+ match = false;
481
+ continue;
482
+ } else {
483
+ return false;
484
+ }
485
+ } else if (!this.options.flex) {
486
+ break;
487
+ }
488
+ }
489
+ }
490
+ if (match) {
491
+ token = this.test_match(match, rules[index2]);
492
+ if (token !== false) {
493
+ return token;
494
+ }
495
+ return false;
496
+ }
497
+ if (this._input === "") {
498
+ return this.EOF;
499
+ } else {
500
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
501
+ text: "",
502
+ token: null,
503
+ line: this.yylineno
504
+ });
505
+ }
506
+ }, "next"),
507
+ // return next match that has a token
508
+ lex: /* @__PURE__ */ index.__name(function lex() {
509
+ var r = this.next();
510
+ if (r) {
511
+ return r;
512
+ } else {
513
+ return this.lex();
514
+ }
515
+ }, "lex"),
516
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
517
+ begin: /* @__PURE__ */ index.__name(function begin(condition) {
518
+ this.conditionStack.push(condition);
519
+ }, "begin"),
520
+ // pop the previously active lexer condition state off the condition stack
521
+ popState: /* @__PURE__ */ index.__name(function popState() {
522
+ var n = this.conditionStack.length - 1;
523
+ if (n > 0) {
524
+ return this.conditionStack.pop();
525
+ } else {
526
+ return this.conditionStack[0];
527
+ }
528
+ }, "popState"),
529
+ // produce the lexer rule set which is active for the currently active lexer condition state
530
+ _currentRules: /* @__PURE__ */ index.__name(function _currentRules() {
531
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
532
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
533
+ } else {
534
+ return this.conditions["INITIAL"].rules;
535
+ }
536
+ }, "_currentRules"),
537
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
538
+ topState: /* @__PURE__ */ index.__name(function topState(n) {
539
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
540
+ if (n >= 0) {
541
+ return this.conditionStack[n];
542
+ } else {
543
+ return "INITIAL";
544
+ }
545
+ }, "topState"),
546
+ // alias for begin(condition)
547
+ pushState: /* @__PURE__ */ index.__name(function pushState(condition) {
548
+ this.begin(condition);
549
+ }, "pushState"),
550
+ // return the number of states currently on the stack
551
+ stateStackSize: /* @__PURE__ */ index.__name(function stateStackSize() {
552
+ return this.conditionStack.length;
553
+ }, "stateStackSize"),
554
+ options: { "case-insensitive": true },
555
+ performAction: /* @__PURE__ */ index.__name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
556
+ switch ($avoiding_name_collisions) {
557
+ case 0:
558
+ break;
559
+ case 1:
560
+ break;
561
+ case 2:
562
+ return 55;
563
+ case 3:
564
+ break;
565
+ case 4:
566
+ this.begin("title");
567
+ return 35;
568
+ case 5:
569
+ this.popState();
570
+ return "title_value";
571
+ case 6:
572
+ this.begin("acc_title");
573
+ return 37;
574
+ case 7:
575
+ this.popState();
576
+ return "acc_title_value";
577
+ case 8:
578
+ this.begin("acc_descr");
579
+ return 39;
580
+ case 9:
581
+ this.popState();
582
+ return "acc_descr_value";
583
+ case 10:
584
+ this.begin("acc_descr_multiline");
585
+ break;
586
+ case 11:
587
+ this.popState();
588
+ break;
589
+ case 12:
590
+ return "acc_descr_multiline_value";
591
+ case 13:
592
+ return 48;
593
+ case 14:
594
+ return 50;
595
+ case 15:
596
+ return 49;
597
+ case 16:
598
+ return 51;
599
+ case 17:
600
+ return 52;
601
+ case 18:
602
+ return 53;
603
+ case 19:
604
+ return 54;
605
+ case 20:
606
+ return 25;
607
+ case 21:
608
+ this.begin("md_string");
609
+ break;
610
+ case 22:
611
+ return "MD_STR";
612
+ case 23:
613
+ this.popState();
614
+ break;
615
+ case 24:
616
+ this.begin("string");
617
+ break;
618
+ case 25:
619
+ this.popState();
620
+ break;
621
+ case 26:
622
+ return "STR";
623
+ case 27:
624
+ this.begin("class_name");
625
+ break;
626
+ case 28:
627
+ this.popState();
628
+ return 47;
629
+ case 29:
630
+ this.begin("point_start");
631
+ return 44;
632
+ case 30:
633
+ this.begin("point_x");
634
+ return 45;
635
+ case 31:
636
+ this.popState();
637
+ break;
638
+ case 32:
639
+ this.popState();
640
+ this.begin("point_y");
641
+ break;
642
+ case 33:
643
+ this.popState();
644
+ return 46;
645
+ case 34:
646
+ return 28;
647
+ case 35:
648
+ return 4;
649
+ case 36:
650
+ return 11;
651
+ case 37:
652
+ return 64;
653
+ case 38:
654
+ return 10;
655
+ case 39:
656
+ return 65;
657
+ case 40:
658
+ return 65;
659
+ case 41:
660
+ return 14;
661
+ case 42:
662
+ return 13;
663
+ case 43:
664
+ return 67;
665
+ case 44:
666
+ return 66;
667
+ case 45:
668
+ return 12;
669
+ case 46:
670
+ return 8;
671
+ case 47:
672
+ return 5;
673
+ case 48:
674
+ return 18;
675
+ case 49:
676
+ return 56;
677
+ case 50:
678
+ return 63;
679
+ case 51:
680
+ return 57;
681
+ }
682
+ }, "anonymous"),
683
+ 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],
684
+ conditions: { "class_name": { "rules": [28], "inclusive": false }, "point_y": { "rules": [33], "inclusive": false }, "point_x": { "rules": [32], "inclusive": false }, "point_start": { "rules": [30, 31], "inclusive": false }, "acc_descr_multiline": { "rules": [11, 12], "inclusive": false }, "acc_descr": { "rules": [9], "inclusive": false }, "acc_title": { "rules": [7], "inclusive": false }, "title": { "rules": [5], "inclusive": false }, "md_string": { "rules": [22, 23], "inclusive": false }, "string": { "rules": [25, 26], "inclusive": false }, "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": true } }
685
+ };
686
+ return lexer2;
687
+ })();
688
+ parser2.lexer = lexer;
689
+ function Parser() {
690
+ this.yy = {};
691
+ }
692
+ index.__name(Parser, "Parser");
693
+ Parser.prototype = parser2;
694
+ parser2.Parser = Parser;
695
+ return new Parser();
696
+ })();
697
+ parser.parser = parser;
698
+ var quadrant_default = parser;
699
+ var defaultThemeVariables = index.getThemeVariables3();
700
+ var QuadrantBuilder = (_a = class {
701
+ constructor() {
702
+ this.classes = /* @__PURE__ */ new Map();
703
+ this.config = this.getDefaultConfig();
704
+ this.themeConfig = this.getDefaultThemeConfig();
705
+ this.data = this.getDefaultData();
706
+ }
707
+ getDefaultData() {
708
+ return {
709
+ titleText: "",
710
+ quadrant1Text: "",
711
+ quadrant2Text: "",
712
+ quadrant3Text: "",
713
+ quadrant4Text: "",
714
+ xAxisLeftText: "",
715
+ xAxisRightText: "",
716
+ yAxisBottomText: "",
717
+ yAxisTopText: "",
718
+ points: []
719
+ };
720
+ }
721
+ getDefaultConfig() {
722
+ return {
723
+ showXAxis: true,
724
+ showYAxis: true,
725
+ showTitle: true,
726
+ chartHeight: index.defaultConfig_default.quadrantChart?.chartWidth || 500,
727
+ chartWidth: index.defaultConfig_default.quadrantChart?.chartHeight || 500,
728
+ titlePadding: index.defaultConfig_default.quadrantChart?.titlePadding || 10,
729
+ titleFontSize: index.defaultConfig_default.quadrantChart?.titleFontSize || 20,
730
+ quadrantPadding: index.defaultConfig_default.quadrantChart?.quadrantPadding || 5,
731
+ xAxisLabelPadding: index.defaultConfig_default.quadrantChart?.xAxisLabelPadding || 5,
732
+ yAxisLabelPadding: index.defaultConfig_default.quadrantChart?.yAxisLabelPadding || 5,
733
+ xAxisLabelFontSize: index.defaultConfig_default.quadrantChart?.xAxisLabelFontSize || 16,
734
+ yAxisLabelFontSize: index.defaultConfig_default.quadrantChart?.yAxisLabelFontSize || 16,
735
+ quadrantLabelFontSize: index.defaultConfig_default.quadrantChart?.quadrantLabelFontSize || 16,
736
+ quadrantTextTopPadding: index.defaultConfig_default.quadrantChart?.quadrantTextTopPadding || 5,
737
+ pointTextPadding: index.defaultConfig_default.quadrantChart?.pointTextPadding || 5,
738
+ pointLabelFontSize: index.defaultConfig_default.quadrantChart?.pointLabelFontSize || 12,
739
+ pointRadius: index.defaultConfig_default.quadrantChart?.pointRadius || 5,
740
+ xAxisPosition: index.defaultConfig_default.quadrantChart?.xAxisPosition || "top",
741
+ yAxisPosition: index.defaultConfig_default.quadrantChart?.yAxisPosition || "left",
742
+ quadrantInternalBorderStrokeWidth: index.defaultConfig_default.quadrantChart?.quadrantInternalBorderStrokeWidth || 1,
743
+ quadrantExternalBorderStrokeWidth: index.defaultConfig_default.quadrantChart?.quadrantExternalBorderStrokeWidth || 2
744
+ };
745
+ }
746
+ getDefaultThemeConfig() {
747
+ return {
748
+ quadrant1Fill: defaultThemeVariables.quadrant1Fill,
749
+ quadrant2Fill: defaultThemeVariables.quadrant2Fill,
750
+ quadrant3Fill: defaultThemeVariables.quadrant3Fill,
751
+ quadrant4Fill: defaultThemeVariables.quadrant4Fill,
752
+ quadrant1TextFill: defaultThemeVariables.quadrant1TextFill,
753
+ quadrant2TextFill: defaultThemeVariables.quadrant2TextFill,
754
+ quadrant3TextFill: defaultThemeVariables.quadrant3TextFill,
755
+ quadrant4TextFill: defaultThemeVariables.quadrant4TextFill,
756
+ quadrantPointFill: defaultThemeVariables.quadrantPointFill,
757
+ quadrantPointTextFill: defaultThemeVariables.quadrantPointTextFill,
758
+ quadrantXAxisTextFill: defaultThemeVariables.quadrantXAxisTextFill,
759
+ quadrantYAxisTextFill: defaultThemeVariables.quadrantYAxisTextFill,
760
+ quadrantTitleFill: defaultThemeVariables.quadrantTitleFill,
761
+ quadrantInternalBorderStrokeFill: defaultThemeVariables.quadrantInternalBorderStrokeFill,
762
+ quadrantExternalBorderStrokeFill: defaultThemeVariables.quadrantExternalBorderStrokeFill
763
+ };
764
+ }
765
+ clear() {
766
+ this.config = this.getDefaultConfig();
767
+ this.themeConfig = this.getDefaultThemeConfig();
768
+ this.data = this.getDefaultData();
769
+ this.classes = /* @__PURE__ */ new Map();
770
+ index.log.info("clear called");
771
+ }
772
+ setData(data) {
773
+ this.data = { ...this.data, ...data };
774
+ }
775
+ addPoints(points) {
776
+ this.data.points = [...points, ...this.data.points];
777
+ }
778
+ addClass(className, styles) {
779
+ this.classes.set(className, styles);
780
+ }
781
+ setConfig(config2) {
782
+ index.log.trace("setConfig called with: ", config2);
783
+ this.config = { ...this.config, ...config2 };
784
+ }
785
+ setThemeConfig(themeConfig) {
786
+ index.log.trace("setThemeConfig called with: ", themeConfig);
787
+ this.themeConfig = { ...this.themeConfig, ...themeConfig };
788
+ }
789
+ calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle) {
790
+ const xAxisSpaceCalculation = this.config.xAxisLabelPadding * 2 + this.config.xAxisLabelFontSize;
791
+ const xAxisSpace = {
792
+ top: xAxisPosition === "top" && showXAxis ? xAxisSpaceCalculation : 0,
793
+ bottom: xAxisPosition === "bottom" && showXAxis ? xAxisSpaceCalculation : 0
794
+ };
795
+ const yAxisSpaceCalculation = this.config.yAxisLabelPadding * 2 + this.config.yAxisLabelFontSize;
796
+ const yAxisSpace = {
797
+ left: this.config.yAxisPosition === "left" && showYAxis ? yAxisSpaceCalculation : 0,
798
+ right: this.config.yAxisPosition === "right" && showYAxis ? yAxisSpaceCalculation : 0
799
+ };
800
+ const titleSpaceCalculation = this.config.titleFontSize + this.config.titlePadding * 2;
801
+ const titleSpace = {
802
+ top: showTitle ? titleSpaceCalculation : 0
803
+ };
804
+ const quadrantLeft = this.config.quadrantPadding + yAxisSpace.left;
805
+ const quadrantTop = this.config.quadrantPadding + xAxisSpace.top + titleSpace.top;
806
+ const quadrantWidth = this.config.chartWidth - this.config.quadrantPadding * 2 - yAxisSpace.left - yAxisSpace.right;
807
+ const quadrantHeight = this.config.chartHeight - this.config.quadrantPadding * 2 - xAxisSpace.top - xAxisSpace.bottom - titleSpace.top;
808
+ const quadrantHalfWidth = quadrantWidth / 2;
809
+ const quadrantHalfHeight = quadrantHeight / 2;
810
+ const quadrantSpace = {
811
+ quadrantLeft,
812
+ quadrantTop,
813
+ quadrantWidth,
814
+ quadrantHalfWidth,
815
+ quadrantHeight,
816
+ quadrantHalfHeight
817
+ };
818
+ return {
819
+ xAxisSpace,
820
+ yAxisSpace,
821
+ titleSpace,
822
+ quadrantSpace
823
+ };
824
+ }
825
+ getAxisLabels(xAxisPosition, showXAxis, showYAxis, spaceData) {
826
+ const { quadrantSpace, titleSpace } = spaceData;
827
+ const {
828
+ quadrantHalfHeight,
829
+ quadrantHeight,
830
+ quadrantLeft,
831
+ quadrantHalfWidth,
832
+ quadrantTop,
833
+ quadrantWidth
834
+ } = quadrantSpace;
835
+ const drawXAxisLabelsInMiddle = Boolean(this.data.xAxisRightText);
836
+ const drawYAxisLabelsInMiddle = Boolean(this.data.yAxisTopText);
837
+ const axisLabels = [];
838
+ if (this.data.xAxisLeftText && showXAxis) {
839
+ axisLabels.push({
840
+ text: this.data.xAxisLeftText,
841
+ fill: this.themeConfig.quadrantXAxisTextFill,
842
+ x: quadrantLeft + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0),
843
+ y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding,
844
+ fontSize: this.config.xAxisLabelFontSize,
845
+ verticalPos: drawXAxisLabelsInMiddle ? "center" : "left",
846
+ horizontalPos: "top",
847
+ rotation: 0
848
+ });
849
+ }
850
+ if (this.data.xAxisRightText && showXAxis) {
851
+ axisLabels.push({
852
+ text: this.data.xAxisRightText,
853
+ fill: this.themeConfig.quadrantXAxisTextFill,
854
+ x: quadrantLeft + quadrantHalfWidth + (drawXAxisLabelsInMiddle ? quadrantHalfWidth / 2 : 0),
855
+ y: xAxisPosition === "top" ? this.config.xAxisLabelPadding + titleSpace.top : this.config.xAxisLabelPadding + quadrantTop + quadrantHeight + this.config.quadrantPadding,
856
+ fontSize: this.config.xAxisLabelFontSize,
857
+ verticalPos: drawXAxisLabelsInMiddle ? "center" : "left",
858
+ horizontalPos: "top",
859
+ rotation: 0
860
+ });
861
+ }
862
+ if (this.data.yAxisBottomText && showYAxis) {
863
+ axisLabels.push({
864
+ text: this.data.yAxisBottomText,
865
+ fill: this.themeConfig.quadrantYAxisTextFill,
866
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding,
867
+ y: quadrantTop + quadrantHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0),
868
+ fontSize: this.config.yAxisLabelFontSize,
869
+ verticalPos: drawYAxisLabelsInMiddle ? "center" : "left",
870
+ horizontalPos: "top",
871
+ rotation: -90
872
+ });
873
+ }
874
+ if (this.data.yAxisTopText && showYAxis) {
875
+ axisLabels.push({
876
+ text: this.data.yAxisTopText,
877
+ fill: this.themeConfig.quadrantYAxisTextFill,
878
+ x: this.config.yAxisPosition === "left" ? this.config.yAxisLabelPadding : this.config.yAxisLabelPadding + quadrantLeft + quadrantWidth + this.config.quadrantPadding,
879
+ y: quadrantTop + quadrantHalfHeight - (drawYAxisLabelsInMiddle ? quadrantHalfHeight / 2 : 0),
880
+ fontSize: this.config.yAxisLabelFontSize,
881
+ verticalPos: drawYAxisLabelsInMiddle ? "center" : "left",
882
+ horizontalPos: "top",
883
+ rotation: -90
884
+ });
885
+ }
886
+ return axisLabels;
887
+ }
888
+ getQuadrants(spaceData) {
889
+ const { quadrantSpace } = spaceData;
890
+ const { quadrantHalfHeight, quadrantLeft, quadrantHalfWidth, quadrantTop } = quadrantSpace;
891
+ const quadrants = [
892
+ {
893
+ text: {
894
+ text: this.data.quadrant1Text,
895
+ fill: this.themeConfig.quadrant1TextFill,
896
+ x: 0,
897
+ y: 0,
898
+ fontSize: this.config.quadrantLabelFontSize,
899
+ verticalPos: "center",
900
+ horizontalPos: "middle",
901
+ rotation: 0
902
+ },
903
+ x: quadrantLeft + quadrantHalfWidth,
904
+ y: quadrantTop,
905
+ width: quadrantHalfWidth,
906
+ height: quadrantHalfHeight,
907
+ fill: this.themeConfig.quadrant1Fill
908
+ },
909
+ {
910
+ text: {
911
+ text: this.data.quadrant2Text,
912
+ fill: this.themeConfig.quadrant2TextFill,
913
+ x: 0,
914
+ y: 0,
915
+ fontSize: this.config.quadrantLabelFontSize,
916
+ verticalPos: "center",
917
+ horizontalPos: "middle",
918
+ rotation: 0
919
+ },
920
+ x: quadrantLeft,
921
+ y: quadrantTop,
922
+ width: quadrantHalfWidth,
923
+ height: quadrantHalfHeight,
924
+ fill: this.themeConfig.quadrant2Fill
925
+ },
926
+ {
927
+ text: {
928
+ text: this.data.quadrant3Text,
929
+ fill: this.themeConfig.quadrant3TextFill,
930
+ x: 0,
931
+ y: 0,
932
+ fontSize: this.config.quadrantLabelFontSize,
933
+ verticalPos: "center",
934
+ horizontalPos: "middle",
935
+ rotation: 0
936
+ },
937
+ x: quadrantLeft,
938
+ y: quadrantTop + quadrantHalfHeight,
939
+ width: quadrantHalfWidth,
940
+ height: quadrantHalfHeight,
941
+ fill: this.themeConfig.quadrant3Fill
942
+ },
943
+ {
944
+ text: {
945
+ text: this.data.quadrant4Text,
946
+ fill: this.themeConfig.quadrant4TextFill,
947
+ x: 0,
948
+ y: 0,
949
+ fontSize: this.config.quadrantLabelFontSize,
950
+ verticalPos: "center",
951
+ horizontalPos: "middle",
952
+ rotation: 0
953
+ },
954
+ x: quadrantLeft + quadrantHalfWidth,
955
+ y: quadrantTop + quadrantHalfHeight,
956
+ width: quadrantHalfWidth,
957
+ height: quadrantHalfHeight,
958
+ fill: this.themeConfig.quadrant4Fill
959
+ }
960
+ ];
961
+ for (const quadrant of quadrants) {
962
+ quadrant.text.x = quadrant.x + quadrant.width / 2;
963
+ if (this.data.points.length === 0) {
964
+ quadrant.text.y = quadrant.y + quadrant.height / 2;
965
+ quadrant.text.horizontalPos = "middle";
966
+ } else {
967
+ quadrant.text.y = quadrant.y + this.config.quadrantTextTopPadding;
968
+ quadrant.text.horizontalPos = "top";
969
+ }
970
+ }
971
+ return quadrants;
972
+ }
973
+ getQuadrantPoints(spaceData) {
974
+ const { quadrantSpace } = spaceData;
975
+ const { quadrantHeight, quadrantLeft, quadrantTop, quadrantWidth } = quadrantSpace;
976
+ const xAxis = linear.linear().domain([0, 1]).range([quadrantLeft, quadrantWidth + quadrantLeft]);
977
+ const yAxis = linear.linear().domain([0, 1]).range([quadrantHeight + quadrantTop, quadrantTop]);
978
+ const points = this.data.points.map((point) => {
979
+ const classStyles = this.classes.get(point.className);
980
+ if (classStyles) {
981
+ point = { ...classStyles, ...point };
982
+ }
983
+ const props = {
984
+ x: xAxis(point.x),
985
+ y: yAxis(point.y),
986
+ fill: point.color ?? this.themeConfig.quadrantPointFill,
987
+ radius: point.radius ?? this.config.pointRadius,
988
+ text: {
989
+ text: point.text,
990
+ fill: this.themeConfig.quadrantPointTextFill,
991
+ x: xAxis(point.x),
992
+ y: yAxis(point.y) + this.config.pointTextPadding,
993
+ verticalPos: "center",
994
+ horizontalPos: "top",
995
+ fontSize: this.config.pointLabelFontSize,
996
+ rotation: 0
997
+ },
998
+ strokeColor: point.strokeColor ?? this.themeConfig.quadrantPointFill,
999
+ strokeWidth: point.strokeWidth ?? "0px"
1000
+ };
1001
+ return props;
1002
+ });
1003
+ return points;
1004
+ }
1005
+ getBorders(spaceData) {
1006
+ const halfExternalBorderWidth = this.config.quadrantExternalBorderStrokeWidth / 2;
1007
+ const { quadrantSpace } = spaceData;
1008
+ const {
1009
+ quadrantHalfHeight,
1010
+ quadrantHeight,
1011
+ quadrantLeft,
1012
+ quadrantHalfWidth,
1013
+ quadrantTop,
1014
+ quadrantWidth
1015
+ } = quadrantSpace;
1016
+ const borderLines = [
1017
+ // top border
1018
+ {
1019
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1020
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1021
+ x1: quadrantLeft - halfExternalBorderWidth,
1022
+ y1: quadrantTop,
1023
+ x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth,
1024
+ y2: quadrantTop
1025
+ },
1026
+ // right border
1027
+ {
1028
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1029
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1030
+ x1: quadrantLeft + quadrantWidth,
1031
+ y1: quadrantTop + halfExternalBorderWidth,
1032
+ x2: quadrantLeft + quadrantWidth,
1033
+ y2: quadrantTop + quadrantHeight - halfExternalBorderWidth
1034
+ },
1035
+ // bottom border
1036
+ {
1037
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1038
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1039
+ x1: quadrantLeft - halfExternalBorderWidth,
1040
+ y1: quadrantTop + quadrantHeight,
1041
+ x2: quadrantLeft + quadrantWidth + halfExternalBorderWidth,
1042
+ y2: quadrantTop + quadrantHeight
1043
+ },
1044
+ // left border
1045
+ {
1046
+ strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
1047
+ strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
1048
+ x1: quadrantLeft,
1049
+ y1: quadrantTop + halfExternalBorderWidth,
1050
+ x2: quadrantLeft,
1051
+ y2: quadrantTop + quadrantHeight - halfExternalBorderWidth
1052
+ },
1053
+ // vertical inner border
1054
+ {
1055
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
1056
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
1057
+ x1: quadrantLeft + quadrantHalfWidth,
1058
+ y1: quadrantTop + halfExternalBorderWidth,
1059
+ x2: quadrantLeft + quadrantHalfWidth,
1060
+ y2: quadrantTop + quadrantHeight - halfExternalBorderWidth
1061
+ },
1062
+ // horizontal inner border
1063
+ {
1064
+ strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
1065
+ strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
1066
+ x1: quadrantLeft + halfExternalBorderWidth,
1067
+ y1: quadrantTop + quadrantHalfHeight,
1068
+ x2: quadrantLeft + quadrantWidth - halfExternalBorderWidth,
1069
+ y2: quadrantTop + quadrantHalfHeight
1070
+ }
1071
+ ];
1072
+ return borderLines;
1073
+ }
1074
+ getTitle(showTitle) {
1075
+ if (showTitle) {
1076
+ return {
1077
+ text: this.data.titleText,
1078
+ fill: this.themeConfig.quadrantTitleFill,
1079
+ fontSize: this.config.titleFontSize,
1080
+ horizontalPos: "top",
1081
+ verticalPos: "center",
1082
+ rotation: 0,
1083
+ y: this.config.titlePadding,
1084
+ x: this.config.chartWidth / 2
1085
+ };
1086
+ }
1087
+ return;
1088
+ }
1089
+ build() {
1090
+ const showXAxis = this.config.showXAxis && !!(this.data.xAxisLeftText || this.data.xAxisRightText);
1091
+ const showYAxis = this.config.showYAxis && !!(this.data.yAxisTopText || this.data.yAxisBottomText);
1092
+ const showTitle = this.config.showTitle && !!this.data.titleText;
1093
+ const xAxisPosition = this.data.points.length > 0 ? "bottom" : this.config.xAxisPosition;
1094
+ const calculatedSpace = this.calculateSpace(xAxisPosition, showXAxis, showYAxis, showTitle);
1095
+ return {
1096
+ points: this.getQuadrantPoints(calculatedSpace),
1097
+ quadrants: this.getQuadrants(calculatedSpace),
1098
+ axisLabels: this.getAxisLabels(xAxisPosition, showXAxis, showYAxis, calculatedSpace),
1099
+ borderLines: this.getBorders(calculatedSpace),
1100
+ title: this.getTitle(showTitle)
1101
+ };
1102
+ }
1103
+ }, index.__name(_a, "QuadrantBuilder"), _a);
1104
+ var InvalidStyleError = (_b = class extends Error {
1105
+ constructor(style, value, type) {
1106
+ super(`value for ${style} ${value} is invalid, please use a valid ${type}`);
1107
+ this.name = "InvalidStyleError";
1108
+ }
1109
+ }, index.__name(_b, "InvalidStyleError"), _b);
1110
+ function validateHexCode(value) {
1111
+ return !/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(value);
1112
+ }
1113
+ index.__name(validateHexCode, "validateHexCode");
1114
+ function validateNumber(value) {
1115
+ return !/^\d+$/.test(value);
1116
+ }
1117
+ index.__name(validateNumber, "validateNumber");
1118
+ function validateSizeInPixels(value) {
1119
+ return !/^\d+px$/.test(value);
1120
+ }
1121
+ index.__name(validateSizeInPixels, "validateSizeInPixels");
1122
+ var config = index.getConfig2();
1123
+ function textSanitizer(text) {
1124
+ return index.sanitizeText(text.trim(), config);
1125
+ }
1126
+ index.__name(textSanitizer, "textSanitizer");
1127
+ var quadrantBuilder = new QuadrantBuilder();
1128
+ function setQuadrant1Text(textObj) {
1129
+ quadrantBuilder.setData({ quadrant1Text: textSanitizer(textObj.text) });
1130
+ }
1131
+ index.__name(setQuadrant1Text, "setQuadrant1Text");
1132
+ function setQuadrant2Text(textObj) {
1133
+ quadrantBuilder.setData({ quadrant2Text: textSanitizer(textObj.text) });
1134
+ }
1135
+ index.__name(setQuadrant2Text, "setQuadrant2Text");
1136
+ function setQuadrant3Text(textObj) {
1137
+ quadrantBuilder.setData({ quadrant3Text: textSanitizer(textObj.text) });
1138
+ }
1139
+ index.__name(setQuadrant3Text, "setQuadrant3Text");
1140
+ function setQuadrant4Text(textObj) {
1141
+ quadrantBuilder.setData({ quadrant4Text: textSanitizer(textObj.text) });
1142
+ }
1143
+ index.__name(setQuadrant4Text, "setQuadrant4Text");
1144
+ function setXAxisLeftText(textObj) {
1145
+ quadrantBuilder.setData({ xAxisLeftText: textSanitizer(textObj.text) });
1146
+ }
1147
+ index.__name(setXAxisLeftText, "setXAxisLeftText");
1148
+ function setXAxisRightText(textObj) {
1149
+ quadrantBuilder.setData({ xAxisRightText: textSanitizer(textObj.text) });
1150
+ }
1151
+ index.__name(setXAxisRightText, "setXAxisRightText");
1152
+ function setYAxisTopText(textObj) {
1153
+ quadrantBuilder.setData({ yAxisTopText: textSanitizer(textObj.text) });
1154
+ }
1155
+ index.__name(setYAxisTopText, "setYAxisTopText");
1156
+ function setYAxisBottomText(textObj) {
1157
+ quadrantBuilder.setData({ yAxisBottomText: textSanitizer(textObj.text) });
1158
+ }
1159
+ index.__name(setYAxisBottomText, "setYAxisBottomText");
1160
+ function parseStyles(styles) {
1161
+ const stylesObject = {};
1162
+ for (const style of styles) {
1163
+ const [key, value] = style.trim().split(/\s*:\s*/);
1164
+ if (key === "radius") {
1165
+ if (validateNumber(value)) {
1166
+ throw new InvalidStyleError(key, value, "number");
1167
+ }
1168
+ stylesObject.radius = parseInt(value);
1169
+ } else if (key === "color") {
1170
+ if (validateHexCode(value)) {
1171
+ throw new InvalidStyleError(key, value, "hex code");
1172
+ }
1173
+ stylesObject.color = value;
1174
+ } else if (key === "stroke-color") {
1175
+ if (validateHexCode(value)) {
1176
+ throw new InvalidStyleError(key, value, "hex code");
1177
+ }
1178
+ stylesObject.strokeColor = value;
1179
+ } else if (key === "stroke-width") {
1180
+ if (validateSizeInPixels(value)) {
1181
+ throw new InvalidStyleError(key, value, "number of pixels (eg. 10px)");
1182
+ }
1183
+ stylesObject.strokeWidth = value;
1184
+ } else {
1185
+ throw new Error(`style named ${key} is not supported.`);
1186
+ }
1187
+ }
1188
+ return stylesObject;
1189
+ }
1190
+ index.__name(parseStyles, "parseStyles");
1191
+ function addPoint(textObj, className, x, y, styles) {
1192
+ const stylesObject = parseStyles(styles);
1193
+ quadrantBuilder.addPoints([
1194
+ {
1195
+ x,
1196
+ y,
1197
+ text: textSanitizer(textObj.text),
1198
+ className,
1199
+ ...stylesObject
1200
+ }
1201
+ ]);
1202
+ }
1203
+ index.__name(addPoint, "addPoint");
1204
+ function addClass(className, styles) {
1205
+ quadrantBuilder.addClass(className, parseStyles(styles));
1206
+ }
1207
+ index.__name(addClass, "addClass");
1208
+ function setWidth(width) {
1209
+ quadrantBuilder.setConfig({ chartWidth: width });
1210
+ }
1211
+ index.__name(setWidth, "setWidth");
1212
+ function setHeight(height) {
1213
+ quadrantBuilder.setConfig({ chartHeight: height });
1214
+ }
1215
+ index.__name(setHeight, "setHeight");
1216
+ function getQuadrantData() {
1217
+ const config2 = index.getConfig2();
1218
+ const { themeVariables, quadrantChart: quadrantChartConfig } = config2;
1219
+ if (quadrantChartConfig) {
1220
+ quadrantBuilder.setConfig(quadrantChartConfig);
1221
+ }
1222
+ quadrantBuilder.setThemeConfig({
1223
+ quadrant1Fill: themeVariables.quadrant1Fill,
1224
+ quadrant2Fill: themeVariables.quadrant2Fill,
1225
+ quadrant3Fill: themeVariables.quadrant3Fill,
1226
+ quadrant4Fill: themeVariables.quadrant4Fill,
1227
+ quadrant1TextFill: themeVariables.quadrant1TextFill,
1228
+ quadrant2TextFill: themeVariables.quadrant2TextFill,
1229
+ quadrant3TextFill: themeVariables.quadrant3TextFill,
1230
+ quadrant4TextFill: themeVariables.quadrant4TextFill,
1231
+ quadrantPointFill: themeVariables.quadrantPointFill,
1232
+ quadrantPointTextFill: themeVariables.quadrantPointTextFill,
1233
+ quadrantXAxisTextFill: themeVariables.quadrantXAxisTextFill,
1234
+ quadrantYAxisTextFill: themeVariables.quadrantYAxisTextFill,
1235
+ quadrantExternalBorderStrokeFill: themeVariables.quadrantExternalBorderStrokeFill,
1236
+ quadrantInternalBorderStrokeFill: themeVariables.quadrantInternalBorderStrokeFill,
1237
+ quadrantTitleFill: themeVariables.quadrantTitleFill
1238
+ });
1239
+ quadrantBuilder.setData({ titleText: index.getDiagramTitle() });
1240
+ return quadrantBuilder.build();
1241
+ }
1242
+ index.__name(getQuadrantData, "getQuadrantData");
1243
+ var clear2 = /* @__PURE__ */ index.__name(function() {
1244
+ quadrantBuilder.clear();
1245
+ index.clear();
1246
+ }, "clear");
1247
+ var quadrantDb_default = {
1248
+ setWidth,
1249
+ setHeight,
1250
+ setQuadrant1Text,
1251
+ setQuadrant2Text,
1252
+ setQuadrant3Text,
1253
+ setQuadrant4Text,
1254
+ setXAxisLeftText,
1255
+ setXAxisRightText,
1256
+ setYAxisTopText,
1257
+ setYAxisBottomText,
1258
+ parseStyles,
1259
+ addPoint,
1260
+ addClass,
1261
+ getQuadrantData,
1262
+ clear: clear2,
1263
+ setAccTitle: index.setAccTitle,
1264
+ getAccTitle: index.getAccTitle,
1265
+ setDiagramTitle: index.setDiagramTitle,
1266
+ getDiagramTitle: index.getDiagramTitle,
1267
+ getAccDescription: index.getAccDescription,
1268
+ setAccDescription: index.setAccDescription
1269
+ };
1270
+ var draw = /* @__PURE__ */ index.__name((txt, id, _version, diagObj) => {
1271
+ function getDominantBaseLine(horizontalPos) {
1272
+ return horizontalPos === "top" ? "hanging" : "middle";
1273
+ }
1274
+ index.__name(getDominantBaseLine, "getDominantBaseLine");
1275
+ function getTextAnchor(verticalPos) {
1276
+ return verticalPos === "left" ? "start" : "middle";
1277
+ }
1278
+ index.__name(getTextAnchor, "getTextAnchor");
1279
+ function getTransformation(data) {
1280
+ return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
1281
+ }
1282
+ index.__name(getTransformation, "getTransformation");
1283
+ const conf = index.getConfig2();
1284
+ index.log.debug("Rendering quadrant chart\n" + txt);
1285
+ const securityLevel = conf.securityLevel;
1286
+ let sandboxElement;
1287
+ if (securityLevel === "sandbox") {
1288
+ sandboxElement = index.select("#i" + id);
1289
+ }
1290
+ const root = securityLevel === "sandbox" ? index.select(sandboxElement.nodes()[0].contentDocument.body) : index.select("body");
1291
+ const svg = root.select(`[id="${id}"]`);
1292
+ const group = svg.append("g").attr("class", "main");
1293
+ const width = conf.quadrantChart?.chartWidth ?? 500;
1294
+ const height = conf.quadrantChart?.chartHeight ?? 500;
1295
+ index.configureSvgSize(svg, height, width, conf.quadrantChart?.useMaxWidth ?? true);
1296
+ svg.attr("viewBox", "0 0 " + width + " " + height);
1297
+ diagObj.db.setHeight(height);
1298
+ diagObj.db.setWidth(width);
1299
+ const quadrantData = diagObj.db.getQuadrantData();
1300
+ const quadrantsGroup = group.append("g").attr("class", "quadrants");
1301
+ const borderGroup = group.append("g").attr("class", "border");
1302
+ const dataPointGroup = group.append("g").attr("class", "data-points");
1303
+ const labelGroup = group.append("g").attr("class", "labels");
1304
+ const titleGroup = group.append("g").attr("class", "title");
1305
+ if (quadrantData.title) {
1306
+ titleGroup.append("text").attr("x", 0).attr("y", 0).attr("fill", quadrantData.title.fill).attr("font-size", quadrantData.title.fontSize).attr("dominant-baseline", getDominantBaseLine(quadrantData.title.horizontalPos)).attr("text-anchor", getTextAnchor(quadrantData.title.verticalPos)).attr("transform", getTransformation(quadrantData.title)).text(quadrantData.title.text);
1307
+ }
1308
+ if (quadrantData.borderLines) {
1309
+ borderGroup.selectAll("line").data(quadrantData.borderLines).enter().append("line").attr("x1", (data) => data.x1).attr("y1", (data) => data.y1).attr("x2", (data) => data.x2).attr("y2", (data) => data.y2).style("stroke", (data) => data.strokeFill).style("stroke-width", (data) => data.strokeWidth);
1310
+ }
1311
+ const quadrants = quadrantsGroup.selectAll("g.quadrant").data(quadrantData.quadrants).enter().append("g").attr("class", "quadrant");
1312
+ quadrants.append("rect").attr("x", (data) => data.x).attr("y", (data) => data.y).attr("width", (data) => data.width).attr("height", (data) => data.height).attr("fill", (data) => data.fill);
1313
+ quadrants.append("text").attr("x", 0).attr("y", 0).attr("fill", (data) => data.text.fill).attr("font-size", (data) => data.text.fontSize).attr(
1314
+ "dominant-baseline",
1315
+ (data) => getDominantBaseLine(data.text.horizontalPos)
1316
+ ).attr("text-anchor", (data) => getTextAnchor(data.text.verticalPos)).attr("transform", (data) => getTransformation(data.text)).text((data) => data.text.text);
1317
+ const labels = labelGroup.selectAll("g.label").data(quadrantData.axisLabels).enter().append("g").attr("class", "label");
1318
+ labels.append("text").attr("x", 0).attr("y", 0).text((data) => data.text).attr("fill", (data) => data.fill).attr("font-size", (data) => data.fontSize).attr("dominant-baseline", (data) => getDominantBaseLine(data.horizontalPos)).attr("text-anchor", (data) => getTextAnchor(data.verticalPos)).attr("transform", (data) => getTransformation(data));
1319
+ const dataPoints = dataPointGroup.selectAll("g.data-point").data(quadrantData.points).enter().append("g").attr("class", "data-point");
1320
+ dataPoints.append("circle").attr("cx", (data) => data.x).attr("cy", (data) => data.y).attr("r", (data) => data.radius).attr("fill", (data) => data.fill).attr("stroke", (data) => data.strokeColor).attr("stroke-width", (data) => data.strokeWidth);
1321
+ dataPoints.append("text").attr("x", 0).attr("y", 0).text((data) => data.text.text).attr("fill", (data) => data.text.fill).attr("font-size", (data) => data.text.fontSize).attr(
1322
+ "dominant-baseline",
1323
+ (data) => getDominantBaseLine(data.text.horizontalPos)
1324
+ ).attr("text-anchor", (data) => getTextAnchor(data.text.verticalPos)).attr("transform", (data) => getTransformation(data.text));
1325
+ }, "draw");
1326
+ var quadrantRenderer_default = {
1327
+ draw
1328
+ };
1329
+ var diagram = {
1330
+ parser: quadrant_default,
1331
+ db: quadrantDb_default,
1332
+ renderer: quadrantRenderer_default,
1333
+ styles: /* @__PURE__ */ index.__name(() => "", "styles")
1334
+ };
1335
+ exports.diagram = diagram;