@openbkn/workshop 0.2.2-rc.5 → 0.2.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 (158) hide show
  1. package/README.md +83 -13
  2. package/component.d.ts +10 -0
  3. package/dist/ActionConfirm-DJ91X3ml.js +236 -0
  4. package/dist/ActionFailure-ZgPt_3B-.js +37 -0
  5. package/dist/AgentChat-CRYai8ge.js +1062 -0
  6. package/dist/AppFormModal-D73ucaHK.js +4282 -0
  7. package/dist/AppListPage-D87piiOw.js +1364 -0
  8. package/dist/AskDrawer-BUMYsRnt.js +38 -0
  9. package/dist/ComputedView-CgYrDbx1.js +3221 -0
  10. package/dist/ConclusionApply-sjGfoEBY.js +153 -0
  11. package/dist/CypherEditor-lus6FA5L.js +485 -0
  12. package/dist/LandingList-6JI6864C.js +230 -0
  13. package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
  14. package/dist/ModelTrial-ClHFGTpQ.js +359 -0
  15. package/dist/PageRenderer-DBd_g6mN.js +85480 -0
  16. package/dist/README-DjRyTQSR.js +76 -0
  17. package/dist/ScenarioApply-DtW_hh47.js +590 -0
  18. package/dist/SimulateForm-C-i08Jjd.js +153 -0
  19. package/dist/Subgraph-CnrkH9AN.js +32586 -0
  20. package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
  21. package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
  22. package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
  23. package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
  24. package/dist/actionButton-DA5CNEzx.js +94 -0
  25. package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
  26. package/dist/agentChat-EoDznd58.js +116 -0
  27. package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
  28. package/dist/alertList-DqditwM8.js +84 -0
  29. package/dist/alertList.en-US-BAXAgltP.js +84 -0
  30. package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
  31. package/dist/asOfSlider-QPvHWUMV.js +83 -0
  32. package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
  33. package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
  34. package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
  35. package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
  36. package/dist/channel-B034hcOF.js +5 -0
  37. package/dist/china-C6m7zXIv.js +9 -0
  38. package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
  39. package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
  40. package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
  41. package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
  42. package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
  43. package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
  44. package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
  45. package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
  46. package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
  47. package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
  48. package/dist/component.d-DFoMKuUv.js +179 -0
  49. package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
  50. package/dist/customComponents-DasaZ6pq.js +4 -0
  51. package/dist/customComponents.en-US-CkabuCXg.js +79 -0
  52. package/dist/customParseFormat-C0uLEpdq.js +182 -0
  53. package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
  54. package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
  55. package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
  56. package/dist/d3-scale-DA8IHmf0.js +1841 -0
  57. package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
  58. package/dist/dateRange-BbkLMg8L.js +79 -0
  59. package/dist/dateRange.en-US-CV12Q02G.js +79 -0
  60. package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
  61. package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
  62. package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
  63. package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
  64. package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
  65. package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
  66. package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
  67. package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
  68. package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
  69. package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
  70. package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
  71. package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
  72. package/dist/eventList-CnsAwfDS.js +115 -0
  73. package/dist/eventList.en-US-Cof3rCLq.js +115 -0
  74. package/dist/eventReport-XS-HegnH.js +76 -0
  75. package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
  76. package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
  77. package/dist/ganttChart-DEeSvTJA.js +77 -0
  78. package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
  79. package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
  80. package/dist/generateCypher-Ch9_lQa6.js +399 -0
  81. package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
  82. package/dist/graph-CKJmgLki.js +1541 -0
  83. package/dist/index-BA-GzCXt.js +441 -0
  84. package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
  85. package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
  86. package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
  87. package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
  88. package/dist/katex-BsrBVQKd.js +11314 -0
  89. package/dist/manifest-BjV1PJ6u.js +41 -0
  90. package/dist/mermaid.core-yQghUlIz.js +17642 -0
  91. package/dist/metricCards-CSb-_cT2.js +104 -0
  92. package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
  93. package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
  94. package/dist/modelTrial-Bvb-RhGt.js +137 -0
  95. package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
  96. package/dist/models-DekiCOuZ.js +6 -0
  97. package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
  98. package/dist/object-metric.service-flZgBMRX.js +233 -0
  99. package/dist/objectDetail-SQUbp4Py.js +117 -0
  100. package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
  101. package/dist/objectList-D99wPtJH.js +97 -0
  102. package/dist/objectList.en-US-PBBNyVLW.js +97 -0
  103. package/dist/objectTable-0jsFFMN3.js +127 -0
  104. package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
  105. package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
  106. package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
  107. package/dist/pivotTable-CHmQw18-.js +102 -0
  108. package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
  109. package/dist/prompt-DYrjlEFr.js +373 -0
  110. package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
  111. package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
  112. package/dist/regionMap-Cme-JyV_.js +128 -0
  113. package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
  114. package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
  115. package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
  116. package/dist/scenarioBar-BV43p7n-.js +122 -0
  117. package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
  118. package/dist/scheduleGantt-CTYO-zYP.js +180 -0
  119. package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
  120. package/dist/searchBox-Ca7w0f_6.js +67 -0
  121. package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
  122. package/dist/segmentedFilter-MhjVcWo0.js +80 -0
  123. package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
  124. package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
  125. package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
  126. package/dist/stageChain-BxBafwjD.js +74 -0
  127. package/dist/stageChain.en-US-CP0G27n8.js +74 -0
  128. package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
  129. package/dist/subgraph-7n4SwliR.js +71 -0
  130. package/dist/subgraph.en-US-BNvY18IW.js +71 -0
  131. package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
  132. package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
  133. package/dist/taskInbox-DGWYeI2b.js +118 -0
  134. package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
  135. package/dist/text-BqSVQKS6.js +78 -0
  136. package/dist/text.en-US-BhAxy_LE.js +78 -0
  137. package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
  138. package/dist/trendChart-BjEeRS5_.js +135 -0
  139. package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
  140. package/dist/useLabData-Df-jEHKs.js +20470 -0
  141. package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
  142. package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
  143. package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
  144. package/dist/workshop-app-DnHNjBqy.js +86038 -0
  145. package/dist/workshop-app.css +1 -0
  146. package/dist/workshop-app.js +4 -0
  147. package/dist/world-Djau1JyJ.js +9 -0
  148. package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
  149. package/dist-cli/workshop.js +341 -218
  150. package/example/host.js +109 -0
  151. package/example/index.html +93 -0
  152. package/example/server.mjs +237 -0
  153. package/index.d.ts +48 -0
  154. package/lib/validate.js +47 -1
  155. package/package.json +17 -5
  156. package/runtime/frame-runtime.js +13 -1
  157. package/workshop-component.js +32 -12
  158. package/workshop.js +2 -0
@@ -0,0 +1,1460 @@
1
+ import { s as pi, g as mi, x as $t, v as yi, a as bi, b as wi, _ as n, l as Ut, T as Ai, d as Ci, D as Si, O as Tt, j as Ri, Q as Gt, R as _i, Y as ki, Z as Ti, $ as Ft } from "./mermaid.core-yQghUlIz.js";
2
+ import { b as Xt, l as Yt } from "./d3-scale-DA8IHmf0.js";
3
+ var St = (function() {
4
+ var e = /* @__PURE__ */ n(function(V, r, g, u) {
5
+ for (g = g || {}, u = V.length; u--; g[V[u]] = r) ;
6
+ return g;
7
+ }, "o"), t = [1, 10, 12, 14, 16, 18, 19, 21, 23], i = [2, 6], s = [1, 3], a = [1, 5], h = [1, 6], c = [1, 7], m = [1, 5, 10, 12, 14, 16, 18, 19, 21, 23, 36, 37, 38], f = [1, 25], d = [1, 26], A = [1, 28], k = [1, 29], P = [1, 30], W = [1, 31], F = [1, 32], v = [1, 33], B = [1, 34], b = [1, 35], T = [1, 36], l = [1, 37], I = [1, 43], O = [1, 42], X = [1, 47], Y = [1, 50], R = [1, 10, 12, 14, 16, 18, 19, 21, 23, 36, 37, 38], H = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 28, 29, 36, 37, 38], w = [1, 10, 12, 14, 16, 18, 19, 21, 23, 24, 26, 28, 29, 36, 37, 38, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51], C = [1, 65], M = [26, 28], _ = {
8
+ trace: /* @__PURE__ */ n(function() {
9
+ }, "trace"),
10
+ yy: {},
11
+ symbols_: { error: 2, start: 3, eol: 4, XYCHART: 5, chartConfig: 6, document: 7, CHART_ORIENTATION: 8, statement: 9, title: 10, text: 11, X_AXIS: 12, parseXAxis: 13, Y_AXIS: 14, parseYAxis: 15, LINE: 16, plotData: 17, BAR: 18, acc_title: 19, acc_title_value: 20, acc_descr: 21, acc_descr_value: 22, acc_descr_multiline_value: 23, SQUARE_BRACES_START: 24, dataPoints: 25, SQUARE_BRACES_END: 26, dataPoint: 27, COMMA: 28, NUMBER_WITH_DECIMAL: 29, STR: 30, xAxisData: 31, bandData: 32, ARROW_DELIMITER: 33, commaSeparatedTexts: 34, yAxisData: 35, NEWLINE: 36, SEMI: 37, EOF: 38, alphaNum: 39, MD_STR: 40, alphaNumToken: 41, AMP: 42, NUM: 43, ALPHA: 44, PLUS: 45, EQUALS: 46, MULT: 47, DOT: 48, BRKT: 49, MINUS: 50, UNDERSCORE: 51, $accept: 0, $end: 1 },
12
+ terminals_: { 2: "error", 5: "XYCHART", 8: "CHART_ORIENTATION", 10: "title", 12: "X_AXIS", 14: "Y_AXIS", 16: "LINE", 18: "BAR", 19: "acc_title", 20: "acc_title_value", 21: "acc_descr", 22: "acc_descr_value", 23: "acc_descr_multiline_value", 24: "SQUARE_BRACES_START", 26: "SQUARE_BRACES_END", 28: "COMMA", 29: "NUMBER_WITH_DECIMAL", 30: "STR", 33: "ARROW_DELIMITER", 36: "NEWLINE", 37: "SEMI", 38: "EOF", 40: "MD_STR", 42: "AMP", 43: "NUM", 44: "ALPHA", 45: "PLUS", 46: "EQUALS", 47: "MULT", 48: "DOT", 49: "BRKT", 50: "MINUS", 51: "UNDERSCORE" },
13
+ productions_: [0, [3, 2], [3, 3], [3, 2], [3, 1], [6, 1], [7, 0], [7, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 3], [9, 2], [9, 3], [9, 2], [9, 2], [9, 1], [17, 3], [25, 3], [25, 1], [27, 2], [27, 1], [13, 1], [13, 2], [13, 1], [31, 1], [31, 3], [32, 3], [34, 3], [34, 1], [15, 1], [15, 2], [15, 1], [35, 3], [4, 1], [4, 1], [4, 1], [11, 1], [11, 1], [11, 1], [39, 1], [39, 2], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1], [41, 1]],
14
+ performAction: /* @__PURE__ */ n(function(r, g, u, x, S, o, lt) {
15
+ var p = o.length - 1;
16
+ switch (S) {
17
+ case 5:
18
+ x.setOrientation(o[p]);
19
+ break;
20
+ case 9:
21
+ x.setDiagramTitle(o[p].text.trim());
22
+ break;
23
+ case 12:
24
+ x.setLineData({ text: "", type: "text" }, o[p]);
25
+ break;
26
+ case 13:
27
+ x.setLineData(o[p - 1], o[p]);
28
+ break;
29
+ case 14:
30
+ x.setBarData({ text: "", type: "text" }, o[p]);
31
+ break;
32
+ case 15:
33
+ x.setBarData(o[p - 1], o[p]);
34
+ break;
35
+ case 16:
36
+ this.$ = o[p].trim(), x.setAccTitle(this.$);
37
+ break;
38
+ case 17:
39
+ case 18:
40
+ this.$ = o[p].trim(), x.setAccDescription(this.$);
41
+ break;
42
+ case 19:
43
+ this.$ = o[p - 1];
44
+ break;
45
+ case 20:
46
+ case 30:
47
+ this.$ = [o[p - 2], ...o[p]];
48
+ break;
49
+ case 21:
50
+ case 31:
51
+ this.$ = [o[p]];
52
+ break;
53
+ case 22:
54
+ this.$ = { value: Number(o[p - 1]), label: o[p] };
55
+ break;
56
+ case 23:
57
+ this.$ = { value: Number(o[p]), label: "" };
58
+ break;
59
+ case 24:
60
+ x.setXAxisTitle(o[p]);
61
+ break;
62
+ case 25:
63
+ x.setXAxisTitle(o[p - 1]);
64
+ break;
65
+ case 26:
66
+ x.setXAxisTitle({ type: "text", text: "" });
67
+ break;
68
+ case 27:
69
+ x.setXAxisBand(o[p]);
70
+ break;
71
+ case 28:
72
+ x.setXAxisRangeData(Number(o[p - 2]), Number(o[p]));
73
+ break;
74
+ case 29:
75
+ this.$ = o[p - 1];
76
+ break;
77
+ case 32:
78
+ x.setYAxisTitle(o[p]);
79
+ break;
80
+ case 33:
81
+ x.setYAxisTitle(o[p - 1]);
82
+ break;
83
+ case 34:
84
+ x.setYAxisTitle({ type: "text", text: "" });
85
+ break;
86
+ case 35:
87
+ x.setYAxisRangeData(Number(o[p - 2]), Number(o[p]));
88
+ break;
89
+ case 39:
90
+ this.$ = { text: o[p], type: "text" };
91
+ break;
92
+ case 40:
93
+ this.$ = { text: o[p], type: "text" };
94
+ break;
95
+ case 41:
96
+ this.$ = { text: o[p], type: "markdown" };
97
+ break;
98
+ case 42:
99
+ this.$ = o[p];
100
+ break;
101
+ case 43:
102
+ this.$ = o[p - 1] + "" + o[p];
103
+ break;
104
+ }
105
+ }, "anonymous"),
106
+ table: [e(t, i, { 3: 1, 4: 2, 7: 4, 5: s, 36: a, 37: h, 38: c }), { 1: [3] }, e(t, i, { 4: 2, 7: 4, 3: 8, 5: s, 36: a, 37: h, 38: c }), e(t, i, { 4: 2, 7: 4, 6: 9, 3: 10, 5: s, 8: [1, 11], 36: a, 37: h, 38: c }), { 1: [2, 4], 9: 12, 10: [1, 13], 12: [1, 14], 14: [1, 15], 16: [1, 16], 18: [1, 17], 19: [1, 18], 21: [1, 19], 23: [1, 20] }, e(m, [2, 36]), e(m, [2, 37]), e(m, [2, 38]), { 1: [2, 1] }, e(t, i, { 4: 2, 7: 4, 3: 21, 5: s, 36: a, 37: h, 38: c }), { 1: [2, 3] }, e(m, [2, 5]), e(t, [2, 7], { 4: 22, 36: a, 37: h, 38: c }), { 11: 23, 30: f, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, { 11: 39, 13: 38, 24: I, 29: O, 30: f, 31: 40, 32: 41, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, { 11: 45, 15: 44, 29: X, 30: f, 35: 46, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, { 11: 49, 17: 48, 24: Y, 30: f, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, { 11: 52, 17: 51, 24: Y, 30: f, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, { 20: [1, 53] }, { 22: [1, 54] }, e(R, [2, 18]), { 1: [2, 2] }, e(R, [2, 8]), e(R, [2, 9]), e(H, [2, 39], { 41: 55, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }), e(H, [2, 40]), e(H, [2, 41]), e(w, [2, 42]), e(w, [2, 44]), e(w, [2, 45]), e(w, [2, 46]), e(w, [2, 47]), e(w, [2, 48]), e(w, [2, 49]), e(w, [2, 50]), e(w, [2, 51]), e(w, [2, 52]), e(w, [2, 53]), e(R, [2, 10]), e(R, [2, 24], { 32: 41, 31: 56, 24: I, 29: O }), e(R, [2, 26]), e(R, [2, 27]), { 33: [1, 57] }, { 11: 59, 30: f, 34: 58, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, e(R, [2, 11]), e(R, [2, 32], { 35: 60, 29: X }), e(R, [2, 34]), { 33: [1, 61] }, e(R, [2, 12]), { 17: 62, 24: Y }, { 25: 63, 27: 64, 29: C }, e(R, [2, 14]), { 17: 66, 24: Y }, e(R, [2, 16]), e(R, [2, 17]), e(w, [2, 43]), e(R, [2, 25]), { 29: [1, 67] }, { 26: [1, 68] }, { 26: [2, 31], 28: [1, 69] }, e(R, [2, 33]), { 29: [1, 70] }, e(R, [2, 13]), { 26: [1, 71] }, { 26: [2, 21], 28: [1, 72] }, e(M, [2, 23], { 30: [1, 73] }), e(R, [2, 15]), e(R, [2, 28]), e(R, [2, 29]), { 11: 59, 30: f, 34: 74, 39: 24, 40: d, 41: 27, 42: A, 43: k, 44: P, 45: W, 46: F, 47: v, 48: B, 49: b, 50: T, 51: l }, e(R, [2, 35]), e(R, [2, 19]), { 25: 75, 27: 64, 29: C }, e(M, [2, 22]), { 26: [2, 30] }, { 26: [2, 20] }],
107
+ defaultActions: { 8: [2, 1], 10: [2, 3], 21: [2, 2], 74: [2, 30], 75: [2, 20] },
108
+ parseError: /* @__PURE__ */ n(function(r, g) {
109
+ if (g.recoverable)
110
+ this.trace(r);
111
+ else {
112
+ var u = new Error(r);
113
+ throw u.hash = g, u;
114
+ }
115
+ }, "parseError"),
116
+ parse: /* @__PURE__ */ n(function(r) {
117
+ var g = this, u = [0], x = [], S = [null], o = [], lt = this.table, p = "", dt = 0, Bt = 0, ui = 2, Ot = 1, di = o.slice.call(arguments, 1), D = Object.create(this.lexer), $ = { yy: {} };
118
+ for (var bt in this.yy)
119
+ Object.prototype.hasOwnProperty.call(this.yy, bt) && ($.yy[bt] = this.yy[bt]);
120
+ D.setInput(r, $.yy), $.yy.lexer = D, $.yy.parser = this, typeof D.yylloc > "u" && (D.yylloc = {});
121
+ var wt = D.yylloc;
122
+ o.push(wt);
123
+ var xi = D.options && D.options.ranges;
124
+ typeof $.yy.parseError == "function" ? this.parseError = $.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
125
+ function fi(E) {
126
+ u.length = u.length - 2 * E, S.length = S.length - E, o.length = o.length - E;
127
+ }
128
+ n(fi, "popStack");
129
+ function Vt() {
130
+ var E;
131
+ return E = x.pop() || D.lex() || Ot, typeof E != "number" && (E instanceof Array && (x = E, E = x.pop()), E = g.symbols_[E] || E), E;
132
+ }
133
+ n(Vt, "lex");
134
+ for (var L, U, z, At, j = {}, xt, N, Wt, ft; ; ) {
135
+ if (U = u[u.length - 1], this.defaultActions[U] ? z = this.defaultActions[U] : ((L === null || typeof L > "u") && (L = Vt()), z = lt[U] && lt[U][L]), typeof z > "u" || !z.length || !z[0]) {
136
+ var Ct = "";
137
+ ft = [];
138
+ for (xt in lt[U])
139
+ this.terminals_[xt] && xt > ui && ft.push("'" + this.terminals_[xt] + "'");
140
+ D.showPosition ? Ct = "Parse error on line " + (dt + 1) + `:
141
+ ` + D.showPosition() + `
142
+ Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[L] || L) + "'" : Ct = "Parse error on line " + (dt + 1) + ": Unexpected " + (L == Ot ? "end of input" : "'" + (this.terminals_[L] || L) + "'"), this.parseError(Ct, {
143
+ text: D.match,
144
+ token: this.terminals_[L] || L,
145
+ line: D.yylineno,
146
+ loc: wt,
147
+ expected: ft
148
+ });
149
+ }
150
+ if (z[0] instanceof Array && z.length > 1)
151
+ throw new Error("Parse Error: multiple actions possible at state: " + U + ", token: " + L);
152
+ switch (z[0]) {
153
+ case 1:
154
+ u.push(L), S.push(D.yytext), o.push(D.yylloc), u.push(z[1]), L = null, Bt = D.yyleng, p = D.yytext, dt = D.yylineno, wt = D.yylloc;
155
+ break;
156
+ case 2:
157
+ if (N = this.productions_[z[1]][1], j.$ = S[S.length - N], j._$ = {
158
+ first_line: o[o.length - (N || 1)].first_line,
159
+ last_line: o[o.length - 1].last_line,
160
+ first_column: o[o.length - (N || 1)].first_column,
161
+ last_column: o[o.length - 1].last_column
162
+ }, xi && (j._$.range = [
163
+ o[o.length - (N || 1)].range[0],
164
+ o[o.length - 1].range[1]
165
+ ]), At = this.performAction.apply(j, [
166
+ p,
167
+ Bt,
168
+ dt,
169
+ $.yy,
170
+ z[1],
171
+ S,
172
+ o
173
+ ].concat(di)), typeof At < "u")
174
+ return At;
175
+ N && (u = u.slice(0, -1 * N * 2), S = S.slice(0, -1 * N), o = o.slice(0, -1 * N)), u.push(this.productions_[z[1]][0]), S.push(j.$), o.push(j._$), Wt = lt[u[u.length - 2]][u[u.length - 1]], u.push(Wt);
176
+ break;
177
+ case 3:
178
+ return !0;
179
+ }
180
+ }
181
+ return !0;
182
+ }, "parse")
183
+ }, rt = /* @__PURE__ */ (function() {
184
+ var V = {
185
+ EOF: 1,
186
+ parseError: /* @__PURE__ */ n(function(g, u) {
187
+ if (this.yy.parser)
188
+ this.yy.parser.parseError(g, u);
189
+ else
190
+ throw new Error(g);
191
+ }, "parseError"),
192
+ // resets the lexer, sets new input
193
+ setInput: /* @__PURE__ */ n(function(r, g) {
194
+ return this.yy = g || 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 = {
195
+ first_line: 1,
196
+ first_column: 0,
197
+ last_line: 1,
198
+ last_column: 0
199
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
200
+ }, "setInput"),
201
+ // consumes and returns one char from the input
202
+ input: /* @__PURE__ */ n(function() {
203
+ var r = this._input[0];
204
+ this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
205
+ var g = r.match(/(?:\r\n?|\n).*/g);
206
+ return g ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
207
+ }, "input"),
208
+ // unshifts one char (or a string) into the input
209
+ unput: /* @__PURE__ */ n(function(r) {
210
+ var g = r.length, u = r.split(/(?:\r\n?|\n)/g);
211
+ this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - g), this.offset -= g;
212
+ var x = this.match.split(/(?:\r\n?|\n)/g);
213
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), u.length - 1 && (this.yylineno -= u.length - 1);
214
+ var S = this.yylloc.range;
215
+ return this.yylloc = {
216
+ first_line: this.yylloc.first_line,
217
+ last_line: this.yylineno + 1,
218
+ first_column: this.yylloc.first_column,
219
+ last_column: u ? (u.length === x.length ? this.yylloc.first_column : 0) + x[x.length - u.length].length - u[0].length : this.yylloc.first_column - g
220
+ }, this.options.ranges && (this.yylloc.range = [S[0], S[0] + this.yyleng - g]), this.yyleng = this.yytext.length, this;
221
+ }, "unput"),
222
+ // When called from action, caches matched text and appends it on next action
223
+ more: /* @__PURE__ */ n(function() {
224
+ return this._more = !0, this;
225
+ }, "more"),
226
+ // 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.
227
+ reject: /* @__PURE__ */ n(function() {
228
+ if (this.options.backtrack_lexer)
229
+ this._backtrack = !0;
230
+ else
231
+ 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).
232
+ ` + this.showPosition(), {
233
+ text: "",
234
+ token: null,
235
+ line: this.yylineno
236
+ });
237
+ return this;
238
+ }, "reject"),
239
+ // retain first n characters of the match
240
+ less: /* @__PURE__ */ n(function(r) {
241
+ this.unput(this.match.slice(r));
242
+ }, "less"),
243
+ // displays already matched input, i.e. for error messages
244
+ pastInput: /* @__PURE__ */ n(function() {
245
+ var r = this.matched.substr(0, this.matched.length - this.match.length);
246
+ return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
247
+ }, "pastInput"),
248
+ // displays upcoming input, i.e. for error messages
249
+ upcomingInput: /* @__PURE__ */ n(function() {
250
+ var r = this.match;
251
+ return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
252
+ }, "upcomingInput"),
253
+ // displays the character position where the lexing error occurred, i.e. for error messages
254
+ showPosition: /* @__PURE__ */ n(function() {
255
+ var r = this.pastInput(), g = new Array(r.length + 1).join("-");
256
+ return r + this.upcomingInput() + `
257
+ ` + g + "^";
258
+ }, "showPosition"),
259
+ // test the lexed token: return FALSE when not a match, otherwise return token
260
+ test_match: /* @__PURE__ */ n(function(r, g) {
261
+ var u, x, S;
262
+ if (this.options.backtrack_lexer && (S = {
263
+ yylineno: this.yylineno,
264
+ yylloc: {
265
+ first_line: this.yylloc.first_line,
266
+ last_line: this.last_line,
267
+ first_column: this.yylloc.first_column,
268
+ last_column: this.yylloc.last_column
269
+ },
270
+ yytext: this.yytext,
271
+ match: this.match,
272
+ matches: this.matches,
273
+ matched: this.matched,
274
+ yyleng: this.yyleng,
275
+ offset: this.offset,
276
+ _more: this._more,
277
+ _input: this._input,
278
+ yy: this.yy,
279
+ conditionStack: this.conditionStack.slice(0),
280
+ done: this.done
281
+ }, this.options.ranges && (S.yylloc.range = this.yylloc.range.slice(0))), x = r[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = {
282
+ first_line: this.yylloc.last_line,
283
+ last_line: this.yylineno + 1,
284
+ first_column: this.yylloc.last_column,
285
+ last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
286
+ }, 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], u = this.performAction.call(this, this.yy, this, g, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), u)
287
+ return u;
288
+ if (this._backtrack) {
289
+ for (var o in S)
290
+ this[o] = S[o];
291
+ return !1;
292
+ }
293
+ return !1;
294
+ }, "test_match"),
295
+ // return next match in input
296
+ next: /* @__PURE__ */ n(function() {
297
+ if (this.done)
298
+ return this.EOF;
299
+ this._input || (this.done = !0);
300
+ var r, g, u, x;
301
+ this._more || (this.yytext = "", this.match = "");
302
+ for (var S = this._currentRules(), o = 0; o < S.length; o++)
303
+ if (u = this._input.match(this.rules[S[o]]), u && (!g || u[0].length > g[0].length)) {
304
+ if (g = u, x = o, this.options.backtrack_lexer) {
305
+ if (r = this.test_match(u, S[o]), r !== !1)
306
+ return r;
307
+ if (this._backtrack) {
308
+ g = !1;
309
+ continue;
310
+ } else
311
+ return !1;
312
+ } else if (!this.options.flex)
313
+ break;
314
+ }
315
+ return g ? (r = this.test_match(g, S[x]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
316
+ ` + this.showPosition(), {
317
+ text: "",
318
+ token: null,
319
+ line: this.yylineno
320
+ });
321
+ }, "next"),
322
+ // return next match that has a token
323
+ lex: /* @__PURE__ */ n(function() {
324
+ var g = this.next();
325
+ return g || this.lex();
326
+ }, "lex"),
327
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
328
+ begin: /* @__PURE__ */ n(function(g) {
329
+ this.conditionStack.push(g);
330
+ }, "begin"),
331
+ // pop the previously active lexer condition state off the condition stack
332
+ popState: /* @__PURE__ */ n(function() {
333
+ var g = this.conditionStack.length - 1;
334
+ return g > 0 ? this.conditionStack.pop() : this.conditionStack[0];
335
+ }, "popState"),
336
+ // produce the lexer rule set which is active for the currently active lexer condition state
337
+ _currentRules: /* @__PURE__ */ n(function() {
338
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
339
+ }, "_currentRules"),
340
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
341
+ topState: /* @__PURE__ */ n(function(g) {
342
+ return g = this.conditionStack.length - 1 - Math.abs(g || 0), g >= 0 ? this.conditionStack[g] : "INITIAL";
343
+ }, "topState"),
344
+ // alias for begin(condition)
345
+ pushState: /* @__PURE__ */ n(function(g) {
346
+ this.begin(g);
347
+ }, "pushState"),
348
+ // return the number of states currently on the stack
349
+ stateStackSize: /* @__PURE__ */ n(function() {
350
+ return this.conditionStack.length;
351
+ }, "stateStackSize"),
352
+ options: { "case-insensitive": !0 },
353
+ performAction: /* @__PURE__ */ n(function(g, u, x, S) {
354
+ switch (x) {
355
+ case 0:
356
+ break;
357
+ case 1:
358
+ break;
359
+ case 2:
360
+ return this.popState(), 36;
361
+ case 3:
362
+ return this.popState(), 36;
363
+ case 4:
364
+ return 36;
365
+ case 5:
366
+ break;
367
+ case 6:
368
+ return 10;
369
+ case 7:
370
+ return this.pushState("acc_title"), 19;
371
+ case 8:
372
+ return this.popState(), "acc_title_value";
373
+ case 9:
374
+ return this.pushState("acc_descr"), 21;
375
+ case 10:
376
+ return this.popState(), "acc_descr_value";
377
+ case 11:
378
+ this.pushState("acc_descr_multiline");
379
+ break;
380
+ case 12:
381
+ this.popState();
382
+ break;
383
+ case 13:
384
+ return "acc_descr_multiline_value";
385
+ case 14:
386
+ return 5;
387
+ case 15:
388
+ return 5;
389
+ case 16:
390
+ return 8;
391
+ case 17:
392
+ return this.pushState("axis_data"), "X_AXIS";
393
+ case 18:
394
+ return this.pushState("axis_data"), "Y_AXIS";
395
+ case 19:
396
+ return this.pushState("axis_band_data"), 24;
397
+ case 20:
398
+ return 33;
399
+ case 21:
400
+ return this.pushState("data"), 16;
401
+ case 22:
402
+ return this.pushState("data"), 18;
403
+ case 23:
404
+ return this.pushState("data_inner"), 24;
405
+ case 24:
406
+ return 29;
407
+ case 25:
408
+ return this.popState(), 26;
409
+ case 26:
410
+ this.popState();
411
+ break;
412
+ case 27:
413
+ this.pushState("string");
414
+ break;
415
+ case 28:
416
+ this.popState();
417
+ break;
418
+ case 29:
419
+ return "STR";
420
+ case 30:
421
+ return 24;
422
+ case 31:
423
+ return 26;
424
+ case 32:
425
+ return 44;
426
+ case 33:
427
+ return "COLON";
428
+ case 34:
429
+ return 45;
430
+ case 35:
431
+ return 28;
432
+ case 36:
433
+ return 46;
434
+ case 37:
435
+ return 47;
436
+ case 38:
437
+ return 49;
438
+ case 39:
439
+ return 51;
440
+ case 40:
441
+ return 48;
442
+ case 41:
443
+ return 42;
444
+ case 42:
445
+ return 50;
446
+ case 43:
447
+ return 43;
448
+ case 44:
449
+ break;
450
+ case 45:
451
+ return 37;
452
+ case 46:
453
+ return 38;
454
+ }
455
+ }, "anonymous"),
456
+ rules: [/^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:(\r?\n))/i, /^(?:(\r?\n))/i, /^(?:[\n\r]+)/i, /^(?:%%[^\n]*)/i, /^(?:title\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:\})/i, /^(?:[^\}]*)/i, /^(?:xychart-beta\b)/i, /^(?:xychart\b)/i, /^(?:(?:vertical|horizontal))/i, /^(?:x-axis\b)/i, /^(?:y-axis\b)/i, /^(?:\[)/i, /^(?:-->)/i, /^(?:line\b)/i, /^(?:bar\b)/i, /^(?:\[)/i, /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i, /^(?:\])/i, /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:\[)/i, /^(?:\])/i, /^(?:[A-Za-z]+)/i, /^(?::)/i, /^(?:\+)/i, /^(?:,)/i, /^(?:=)/i, /^(?:\*)/i, /^(?:#)/i, /^(?:[\_])/i, /^(?:\.)/i, /^(?:&)/i, /^(?:-)/i, /^(?:[0-9]+)/i, /^(?:\s+)/i, /^(?:;)/i, /^(?:$)/i],
457
+ conditions: { data_inner: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], inclusive: !0 }, data: { rules: [0, 1, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 23, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], inclusive: !0 }, axis_band_data: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], inclusive: !0 }, axis_data: { rules: [0, 1, 2, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], inclusive: !0 }, acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, title: { rules: [], inclusive: !1 }, md_string: { rules: [], inclusive: !1 }, string: { rules: [28, 29], inclusive: !1 }, INITIAL: { rules: [0, 1, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18, 21, 22, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], inclusive: !0 } }
458
+ };
459
+ return V;
460
+ })();
461
+ _.lexer = rt;
462
+ function q() {
463
+ this.yy = {};
464
+ }
465
+ return n(q, "Parser"), q.prototype = _, _.Parser = q, new q();
466
+ })();
467
+ St.parser = St;
468
+ var Di = St;
469
+ function pt(e) {
470
+ return e.type === "bar";
471
+ }
472
+ n(pt, "isBarPlot");
473
+ function mt(e) {
474
+ return e.type === "band";
475
+ }
476
+ n(mt, "isBandAxisData");
477
+ function Q(e) {
478
+ return e.type === "linear";
479
+ }
480
+ n(Q, "isLinearAxisData");
481
+ var K, Dt = (K = class {
482
+ constructor(t) {
483
+ this.parentGroup = t;
484
+ }
485
+ getMaxDimension(t, i) {
486
+ if (!this.parentGroup)
487
+ return {
488
+ width: t.reduce((d, A) => Math.max(A.length, d), 0) * i,
489
+ height: i
490
+ };
491
+ const s = {
492
+ width: 0,
493
+ height: 0
494
+ }, a = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", i), h = a.node()?.getScreenCTM?.(), c = /* @__PURE__ */ n((d) => d && d > 0 ? d : 1, "toScale"), m = c(h?.a), f = c(h?.d);
495
+ for (const d of t) {
496
+ const A = Ti(a, 1, d), k = A ? A.width / m : d.length * i, P = A ? A.height / f : i;
497
+ s.width = Math.max(s.width, k), s.height = Math.max(s.height, P);
498
+ }
499
+ return a.remove(), s;
500
+ }
501
+ }, n(K, "TextDimensionCalculatorWithFont"), K), Nt = 0.7, Ht = 0.2, Z, qt = (Z = class {
502
+ constructor(t, i, s, a) {
503
+ this.axisConfig = t, this.title = i, this.textDimensionCalculator = s, this.axisThemeConfig = a, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.showTitle = !1, this.showLabel = !1, this.showTick = !1, this.showAxisLine = !1, this.outerPadding = 0, this.titleTextHeight = 0, this.labelTextHeight = 0, this.normalizedLabelRotationInRad = 0, this.range = [0, 10], this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.axisPosition = "left", this.normalizedLabelRotationInRad = this.axisConfig.labelRotation >= -90 && this.axisConfig.labelRotation <= 90 ? this.axisConfig.labelRotation * Math.PI / 180 : 0;
504
+ }
505
+ setRange(t) {
506
+ this.range = t, this.axisPosition === "left" || this.axisPosition === "right" ? this.boundingRect.height = t[1] - t[0] : this.boundingRect.width = t[1] - t[0], this.recalculateScale();
507
+ }
508
+ getRange() {
509
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
510
+ }
511
+ setAxisPosition(t) {
512
+ this.axisPosition = t, this.setRange(this.range);
513
+ }
514
+ getTickDistance() {
515
+ const t = this.getRange();
516
+ return Math.abs(t[0] - t[1]) / this.getTickValues().length;
517
+ }
518
+ getAxisOuterPadding() {
519
+ return this.outerPadding;
520
+ }
521
+ getLabelDimension() {
522
+ return this.textDimensionCalculator.getMaxDimension(
523
+ this.getTickValues().map((t) => t.toString()),
524
+ this.axisConfig.labelFontSize
525
+ );
526
+ }
527
+ recalculateOuterPaddingToDrawBar() {
528
+ Nt * this.getTickDistance() > this.outerPadding * 2 && (this.outerPadding = Math.floor(Nt * this.getTickDistance() / 2)), this.recalculateScale();
529
+ }
530
+ calculateSpaceIfDrawnHorizontally(t) {
531
+ let i = t.height;
532
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
533
+ const s = this.getLabelDimension(), a = Ht * t.width;
534
+ this.outerPadding = Math.min(s.width / 2, a);
535
+ let h = s.height;
536
+ this.axisPosition === "bottom" && this.normalizedLabelRotationInRad !== 0 && (h = Math.max(
537
+ h,
538
+ Math.abs(Math.sin(this.normalizedLabelRotationInRad) * s.width) + Math.abs(Math.cos(this.normalizedLabelRotationInRad) * s.height)
539
+ )), h += this.axisConfig.labelPadding * 2, this.labelTextHeight = s.height, h <= i && (i -= h, this.showLabel = !0);
540
+ }
541
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
542
+ const s = this.textDimensionCalculator.getMaxDimension(
543
+ [this.title],
544
+ this.axisConfig.titleFontSize
545
+ ), a = s.height + this.axisConfig.titlePadding * 2;
546
+ this.titleTextHeight = s.height, a <= i && (i -= a, this.showTitle = !0);
547
+ }
548
+ this.boundingRect.width = t.width, this.boundingRect.height = t.height - i;
549
+ }
550
+ calculateSpaceIfDrawnVertical(t) {
551
+ let i = t.width;
552
+ if (this.axisConfig.showAxisLine && i > this.axisConfig.axisLineWidth && (i -= this.axisConfig.axisLineWidth, this.showAxisLine = !0), this.axisConfig.showLabel) {
553
+ const s = this.getLabelDimension(), a = Ht * t.height;
554
+ this.outerPadding = Math.min(s.height / 2, a);
555
+ const h = s.width + this.axisConfig.labelPadding * 2;
556
+ h <= i && (i -= h, this.showLabel = !0);
557
+ }
558
+ if (this.axisConfig.showTick && i >= this.axisConfig.tickLength && (this.showTick = !0, i -= this.axisConfig.tickLength), this.axisConfig.showTitle && this.title) {
559
+ const s = this.textDimensionCalculator.getMaxDimension(
560
+ [this.title],
561
+ this.axisConfig.titleFontSize
562
+ ), a = s.height + this.axisConfig.titlePadding * 2;
563
+ this.titleTextHeight = s.height, a <= i && (i -= a, this.showTitle = !0);
564
+ }
565
+ this.boundingRect.width = t.width - i, this.boundingRect.height = t.height;
566
+ }
567
+ calculateSpace(t) {
568
+ return this.axisPosition === "left" || this.axisPosition === "right" ? this.calculateSpaceIfDrawnVertical(t) : this.calculateSpaceIfDrawnHorizontally(t), this.recalculateScale(), {
569
+ width: this.boundingRect.width,
570
+ height: this.boundingRect.height
571
+ };
572
+ }
573
+ setBoundingBoxXY(t) {
574
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
575
+ }
576
+ calculateOffsetByRotation(t) {
577
+ const i = this.normalizedLabelRotationInRad;
578
+ return i === 0 ? 0 : Math.sin(i) * this.getLabelDimension()[t] / 2;
579
+ }
580
+ getDrawableElementsForLeftAxis() {
581
+ const t = [];
582
+ if (this.showAxisLine) {
583
+ const i = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
584
+ t.push({
585
+ type: "path",
586
+ groupTexts: ["left-axis", "axisl-line"],
587
+ data: [
588
+ {
589
+ path: `M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y + this.boundingRect.height} `,
590
+ strokeFill: this.axisThemeConfig.axisLineColor,
591
+ strokeWidth: this.axisConfig.axisLineWidth
592
+ }
593
+ ]
594
+ });
595
+ }
596
+ if (this.showLabel && t.push({
597
+ type: "text",
598
+ groupTexts: ["left-axis", "label"],
599
+ data: this.getTickValues().map((i) => ({
600
+ text: i.toString(),
601
+ x: this.boundingRect.x + this.boundingRect.width - (this.showLabel ? this.axisConfig.labelPadding : 0) - (this.showTick ? this.axisConfig.tickLength : 0) - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0),
602
+ y: this.getScaleValue(i),
603
+ fill: this.axisThemeConfig.labelColor,
604
+ fontSize: this.axisConfig.labelFontSize,
605
+ rotation: 0,
606
+ verticalPos: "middle",
607
+ horizontalPos: "right"
608
+ }))
609
+ }), this.showTick) {
610
+ const i = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
611
+ t.push({
612
+ type: "path",
613
+ groupTexts: ["left-axis", "ticks"],
614
+ data: this.getTickValues().map((s) => ({
615
+ path: `M ${i},${this.getScaleValue(s)} L ${i - this.axisConfig.tickLength},${this.getScaleValue(s)}`,
616
+ strokeFill: this.axisThemeConfig.tickColor,
617
+ strokeWidth: this.axisConfig.tickWidth
618
+ }))
619
+ });
620
+ }
621
+ return this.showTitle && t.push({
622
+ type: "text",
623
+ groupTexts: ["left-axis", "title"],
624
+ data: [
625
+ {
626
+ text: this.title,
627
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
628
+ y: this.boundingRect.y + this.boundingRect.height / 2,
629
+ fill: this.axisThemeConfig.titleColor,
630
+ fontSize: this.axisConfig.titleFontSize,
631
+ rotation: 270,
632
+ verticalPos: "top",
633
+ horizontalPos: "center"
634
+ }
635
+ ]
636
+ }), t;
637
+ }
638
+ getDrawableElementsForBottomAxis() {
639
+ const t = [];
640
+ if (this.showAxisLine) {
641
+ const i = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
642
+ t.push({
643
+ type: "path",
644
+ groupTexts: ["bottom-axis", "axis-line"],
645
+ data: [
646
+ {
647
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
648
+ strokeFill: this.axisThemeConfig.axisLineColor,
649
+ strokeWidth: this.axisConfig.axisLineWidth
650
+ }
651
+ ]
652
+ });
653
+ }
654
+ if (this.showLabel && t.push({
655
+ type: "text",
656
+ groupTexts: ["bottom-axis", "label"],
657
+ data: this.getTickValues().map((i) => ({
658
+ text: i.toString(),
659
+ x: this.getScaleValue(i) + this.calculateOffsetByRotation("height"),
660
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0) + Math.abs(this.calculateOffsetByRotation("width")),
661
+ fill: this.axisThemeConfig.labelColor,
662
+ fontSize: this.axisConfig.labelFontSize,
663
+ rotation: this.normalizedLabelRotationInRad * 180 / Math.PI,
664
+ verticalPos: "top",
665
+ horizontalPos: "center"
666
+ }))
667
+ }), this.showTick) {
668
+ const i = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
669
+ t.push({
670
+ type: "path",
671
+ groupTexts: ["bottom-axis", "ticks"],
672
+ data: this.getTickValues().map((s) => ({
673
+ path: `M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i + this.axisConfig.tickLength}`,
674
+ strokeFill: this.axisThemeConfig.tickColor,
675
+ strokeWidth: this.axisConfig.tickWidth
676
+ }))
677
+ });
678
+ }
679
+ return this.showTitle && t.push({
680
+ type: "text",
681
+ groupTexts: ["bottom-axis", "title"],
682
+ data: [
683
+ {
684
+ text: this.title,
685
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
686
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
687
+ fill: this.axisThemeConfig.titleColor,
688
+ fontSize: this.axisConfig.titleFontSize,
689
+ rotation: 0,
690
+ verticalPos: "top",
691
+ horizontalPos: "center"
692
+ }
693
+ ]
694
+ }), t;
695
+ }
696
+ getDrawableElementsForTopAxis() {
697
+ const t = [];
698
+ if (this.showAxisLine) {
699
+ const i = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
700
+ t.push({
701
+ type: "path",
702
+ groupTexts: ["top-axis", "axis-line"],
703
+ data: [
704
+ {
705
+ path: `M ${this.boundingRect.x},${i} L ${this.boundingRect.x + this.boundingRect.width},${i}`,
706
+ strokeFill: this.axisThemeConfig.axisLineColor,
707
+ strokeWidth: this.axisConfig.axisLineWidth
708
+ }
709
+ ]
710
+ });
711
+ }
712
+ if (this.showLabel && t.push({
713
+ type: "text",
714
+ groupTexts: ["top-axis", "label"],
715
+ data: this.getTickValues().map((i) => ({
716
+ text: i.toString(),
717
+ x: this.getScaleValue(i),
718
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
719
+ fill: this.axisThemeConfig.labelColor,
720
+ fontSize: this.axisConfig.labelFontSize,
721
+ rotation: 0,
722
+ verticalPos: "top",
723
+ horizontalPos: "center"
724
+ }))
725
+ }), this.showTick) {
726
+ const i = this.boundingRect.y;
727
+ t.push({
728
+ type: "path",
729
+ groupTexts: ["top-axis", "ticks"],
730
+ data: this.getTickValues().map((s) => ({
731
+ path: `M ${this.getScaleValue(s)},${i + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(s)},${i + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
732
+ strokeFill: this.axisThemeConfig.tickColor,
733
+ strokeWidth: this.axisConfig.tickWidth
734
+ }))
735
+ });
736
+ }
737
+ return this.showTitle && t.push({
738
+ type: "text",
739
+ groupTexts: ["top-axis", "title"],
740
+ data: [
741
+ {
742
+ text: this.title,
743
+ x: this.boundingRect.x + this.boundingRect.width / 2,
744
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
745
+ fill: this.axisThemeConfig.titleColor,
746
+ fontSize: this.axisConfig.titleFontSize,
747
+ rotation: 0,
748
+ verticalPos: "top",
749
+ horizontalPos: "center"
750
+ }
751
+ ]
752
+ }), t;
753
+ }
754
+ getDrawableElements() {
755
+ if (this.axisPosition === "left")
756
+ return this.getDrawableElementsForLeftAxis();
757
+ if (this.axisPosition === "right")
758
+ throw Error("Drawing of right axis is not implemented");
759
+ return this.axisPosition === "bottom" ? this.getDrawableElementsForBottomAxis() : this.axisPosition === "top" ? this.getDrawableElementsForTopAxis() : [];
760
+ }
761
+ }, n(Z, "BaseAxis"), Z), J, Pi = (J = class extends qt {
762
+ constructor(t, i, s, a, h) {
763
+ super(t, a, h, i), this.categories = s, this.scale = Xt().domain(this.categories).range(this.getRange());
764
+ }
765
+ setRange(t) {
766
+ super.setRange(t);
767
+ }
768
+ recalculateScale() {
769
+ this.scale = Xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(0.5), Ut.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
770
+ }
771
+ getTickValues() {
772
+ return this.categories;
773
+ }
774
+ getScaleValue(t) {
775
+ return this.scale(t) ?? this.getRange()[0];
776
+ }
777
+ }, n(J, "BandAxis"), J), tt, Li = (tt = class extends qt {
778
+ constructor(t, i, s, a, h) {
779
+ super(t, a, h, i), this.domain = s, this.scale = Yt().domain(this.domain).range(this.getRange());
780
+ }
781
+ getTickValues() {
782
+ return this.scale.ticks();
783
+ }
784
+ recalculateScale() {
785
+ const t = [...this.domain];
786
+ this.axisPosition === "left" && t.reverse(), this.scale = Yt().domain(t).range(this.getRange());
787
+ }
788
+ getScaleValue(t) {
789
+ return this.scale(t);
790
+ }
791
+ }, n(tt, "LinearAxis"), tt);
792
+ function Rt(e, t, i, s) {
793
+ const a = new Dt(s);
794
+ return mt(e) ? new Pi(
795
+ t,
796
+ i,
797
+ e.categories,
798
+ e.title,
799
+ a
800
+ ) : new Li(
801
+ t,
802
+ i,
803
+ [e.min, e.max],
804
+ e.title,
805
+ a
806
+ );
807
+ }
808
+ n(Rt, "getAxis");
809
+ var it, vi = (it = class {
810
+ constructor(t, i, s, a) {
811
+ this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = a, this.titleWidth = 0, this.boundingRect = {
812
+ x: 0,
813
+ y: 0,
814
+ width: 0,
815
+ height: 0
816
+ }, this.showChartTitle = !1;
817
+ }
818
+ setBoundingBoxXY(t) {
819
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
820
+ }
821
+ calculateSpace(t) {
822
+ const i = this.textDimensionCalculator.getMaxDimension(
823
+ [this.chartData.title],
824
+ this.chartConfig.titleFontSize
825
+ ), s = Math.max(i.width, t.width), a = i.height + 2 * this.chartConfig.titlePadding;
826
+ return a <= t.height && this.chartConfig.showTitle && this.chartData.title && (this.boundingRect.width = s, this.boundingRect.height = a, this.titleWidth = i.width, this.showChartTitle = !0), {
827
+ width: this.boundingRect.width,
828
+ height: this.boundingRect.height
829
+ };
830
+ }
831
+ /**
832
+ * Centre the title over [start, end], shifted as needed to keep it inside the chart.
833
+ * The title has its own row above the plot and legend, so it may use the full chart width.
834
+ */
835
+ alignTo(t, i) {
836
+ const s = Math.min(this.titleWidth, this.chartConfig.width) / 2, a = Math.min(
837
+ Math.max((t + i) / 2, s),
838
+ this.chartConfig.width - s
839
+ );
840
+ this.boundingRect.x = a - s, this.boundingRect.width = s * 2;
841
+ }
842
+ getDrawableElements() {
843
+ const t = [];
844
+ return this.showChartTitle && t.push({
845
+ groupTexts: ["chart-title"],
846
+ type: "text",
847
+ data: [
848
+ {
849
+ fontSize: this.chartConfig.titleFontSize,
850
+ text: this.chartData.title,
851
+ verticalPos: "middle",
852
+ horizontalPos: "center",
853
+ x: this.boundingRect.x + this.boundingRect.width / 2,
854
+ y: this.boundingRect.y + this.boundingRect.height / 2,
855
+ fill: this.chartThemeConfig.titleColor,
856
+ rotation: 0
857
+ }
858
+ ]
859
+ }), t;
860
+ }
861
+ }, n(it, "ChartTitle"), it);
862
+ function jt(e, t, i, s) {
863
+ const a = new Dt(s);
864
+ return new vi(a, e, t, i);
865
+ }
866
+ n(jt, "getChartTitleComponent");
867
+ var Ei = 0.75, Ii = 0.5, Mi = 0.35;
868
+ function _t(e) {
869
+ return {
870
+ fontSize: e,
871
+ markerSize: e * Ei,
872
+ markerSpacing: e * Mi,
873
+ itemSpacing: e * Ii
874
+ };
875
+ }
876
+ n(_t, "getLegendLayout");
877
+ var et, zi = (et = class {
878
+ constructor(t, i, s, a) {
879
+ this.textDimensionCalculator = t, this.chartConfig = i, this.chartData = s, this.chartThemeConfig = a, this.boundingRect = { x: 0, y: 0, width: 0, height: 0 }, this.visiblePlots = [];
880
+ }
881
+ setBoundingBoxXY(t) {
882
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
883
+ }
884
+ calculateSpace(t) {
885
+ if (this.visiblePlots = this.chartConfig.showLegend ? this.chartData.plots.filter((d) => d.title) : [], this.visiblePlots.length === 0)
886
+ return this.boundingRect.width = 0, this.boundingRect.height = 0, { width: 0, height: 0 };
887
+ const { fontSize: i, markerSize: s, markerSpacing: a, itemSpacing: h } = _t(
888
+ this.chartConfig.legendFontSize
889
+ ), c = this.textDimensionCalculator.getMaxDimension(
890
+ this.visiblePlots.map((d) => d.title),
891
+ i
892
+ ), m = this.chartConfig.legendPadding * 2 + s + a + c.width, f = this.chartConfig.legendPadding * 2 + this.visiblePlots.length * i + (this.visiblePlots.length - 1) * h;
893
+ return m <= t.width && f <= t.height ? (this.boundingRect.width = m, this.boundingRect.height = f) : (this.visiblePlots = [], this.boundingRect.width = 0, this.boundingRect.height = 0), {
894
+ width: this.boundingRect.width,
895
+ height: this.boundingRect.height
896
+ };
897
+ }
898
+ getDrawableElements() {
899
+ if (this.visiblePlots.length === 0)
900
+ return [];
901
+ const { fontSize: t, markerSize: i, markerSpacing: s, itemSpacing: a } = _t(
902
+ this.chartConfig.legendFontSize
903
+ ), h = t + a, c = this.boundingRect.x + this.chartConfig.legendPadding, m = this.boundingRect.y + this.chartConfig.legendPadding, f = [], d = [];
904
+ for (const [A, k] of this.visiblePlots.entries())
905
+ if (pt(k))
906
+ f.push({
907
+ x: c,
908
+ y: m + A * h,
909
+ width: i,
910
+ height: i,
911
+ fill: k.fill,
912
+ strokeFill: k.fill,
913
+ strokeWidth: 0
914
+ });
915
+ else {
916
+ const P = m + A * h + i / 2;
917
+ d.push({
918
+ path: `M ${c},${P} L ${c + i},${P}`,
919
+ strokeFill: k.strokeFill,
920
+ strokeWidth: k.strokeWidth
921
+ });
922
+ }
923
+ return [
924
+ {
925
+ groupTexts: ["legend", "markers"],
926
+ type: "rect",
927
+ data: f
928
+ },
929
+ {
930
+ groupTexts: ["legend", "markers"],
931
+ type: "path",
932
+ data: d
933
+ },
934
+ {
935
+ groupTexts: ["legend", "label"],
936
+ type: "text",
937
+ data: this.visiblePlots.map((A, k) => ({
938
+ text: A.title,
939
+ x: c + i + s,
940
+ y: m + k * h + i / 2,
941
+ fill: this.chartThemeConfig.legendTextColor,
942
+ fontSize: t,
943
+ rotation: 0,
944
+ verticalPos: "middle",
945
+ horizontalPos: "left"
946
+ }))
947
+ }
948
+ ];
949
+ }
950
+ }, n(et, "ChartLegend"), et);
951
+ function Qt(e, t, i, s) {
952
+ const a = new Dt(s);
953
+ return new zi(a, e, t, i);
954
+ }
955
+ n(Qt, "getChartLegendComponent");
956
+ var st, Bi = (st = class {
957
+ constructor(t, i, s, a, h) {
958
+ this.plotData = t, this.xAxis = i, this.yAxis = s, this.orientation = a, this.plotIndex = h;
959
+ }
960
+ getDrawableElement() {
961
+ const t = this.plotData.data.map((a) => [
962
+ this.xAxis.getScaleValue(a[0]),
963
+ this.yAxis.getScaleValue(a[1])
964
+ ]);
965
+ let i;
966
+ if (this.orientation === "horizontal" ? i = Ft().y((a) => a[0]).x((a) => a[1])(t) : i = Ft().x((a) => a[0]).y((a) => a[1])(t), !i)
967
+ return [];
968
+ const s = [
969
+ {
970
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
971
+ type: "path",
972
+ data: [
973
+ {
974
+ path: i,
975
+ strokeFill: this.plotData.strokeFill,
976
+ strokeWidth: this.plotData.strokeWidth
977
+ }
978
+ ]
979
+ }
980
+ ];
981
+ if (this.plotData.pointLabels && this.plotData.pointLabels.length > 0) {
982
+ const c = [];
983
+ for (const [m, [f, d]] of t.entries()) {
984
+ const A = this.plotData.pointLabels[m];
985
+ A && (this.orientation === "horizontal" ? c.push({
986
+ x: d + 10,
987
+ y: f,
988
+ text: A,
989
+ fill: this.plotData.strokeFill,
990
+ verticalPos: "middle",
991
+ horizontalPos: "left",
992
+ fontSize: 12,
993
+ rotation: 0
994
+ }) : c.push({
995
+ x: f,
996
+ y: d - 10,
997
+ text: A,
998
+ fill: this.plotData.strokeFill,
999
+ verticalPos: "middle",
1000
+ horizontalPos: "center",
1001
+ fontSize: 12,
1002
+ rotation: 0
1003
+ }));
1004
+ }
1005
+ c.length > 0 && s.push({
1006
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`, "labels"],
1007
+ type: "text",
1008
+ data: c
1009
+ });
1010
+ }
1011
+ return s;
1012
+ }
1013
+ }, n(st, "LinePlot"), st), at, Oi = (at = class {
1014
+ constructor(t, i, s, a, h, c) {
1015
+ this.barData = t, this.boundingRect = i, this.xAxis = s, this.yAxis = a, this.orientation = h, this.plotIndex = c;
1016
+ }
1017
+ getDrawableElement() {
1018
+ const t = this.barData.data.map((h) => [
1019
+ this.xAxis.getScaleValue(h[0]),
1020
+ this.yAxis.getScaleValue(h[1])
1021
+ ]), s = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * (1 - 0.05), a = s / 2;
1022
+ return this.orientation === "horizontal" ? [
1023
+ {
1024
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1025
+ type: "rect",
1026
+ data: t.map((h) => ({
1027
+ x: this.boundingRect.x,
1028
+ y: h[0] - a,
1029
+ height: s,
1030
+ width: h[1] - this.boundingRect.x,
1031
+ fill: this.barData.fill,
1032
+ strokeWidth: 0,
1033
+ strokeFill: this.barData.fill
1034
+ }))
1035
+ }
1036
+ ] : [
1037
+ {
1038
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
1039
+ type: "rect",
1040
+ data: t.map((h) => ({
1041
+ x: h[0] - a,
1042
+ y: h[1],
1043
+ width: s,
1044
+ height: this.boundingRect.y + this.boundingRect.height - h[1],
1045
+ fill: this.barData.fill,
1046
+ strokeWidth: 0,
1047
+ strokeFill: this.barData.fill
1048
+ }))
1049
+ }
1050
+ ];
1051
+ }
1052
+ }, n(at, "BarPlot"), at), nt, Vi = (nt = class {
1053
+ constructor(t, i, s) {
1054
+ this.chartConfig = t, this.chartData = i, this.chartThemeConfig = s, this.boundingRect = {
1055
+ x: 0,
1056
+ y: 0,
1057
+ width: 0,
1058
+ height: 0
1059
+ };
1060
+ }
1061
+ setAxes(t, i) {
1062
+ this.xAxis = t, this.yAxis = i;
1063
+ }
1064
+ setBoundingBoxXY(t) {
1065
+ this.boundingRect.x = t.x, this.boundingRect.y = t.y;
1066
+ }
1067
+ calculateSpace(t) {
1068
+ return this.boundingRect.width = t.width, this.boundingRect.height = t.height, {
1069
+ width: this.boundingRect.width,
1070
+ height: this.boundingRect.height
1071
+ };
1072
+ }
1073
+ getDrawableElements() {
1074
+ if (!(this.xAxis && this.yAxis))
1075
+ throw Error("Axes must be passed to render Plots");
1076
+ const t = [];
1077
+ for (const [i, s] of this.chartData.plots.entries())
1078
+ switch (s.type) {
1079
+ case "line":
1080
+ {
1081
+ const a = new Bi(
1082
+ s,
1083
+ this.xAxis,
1084
+ this.yAxis,
1085
+ this.chartConfig.chartOrientation,
1086
+ i
1087
+ );
1088
+ t.push(...a.getDrawableElement());
1089
+ }
1090
+ break;
1091
+ case "bar":
1092
+ {
1093
+ const a = new Oi(
1094
+ s,
1095
+ this.boundingRect,
1096
+ this.xAxis,
1097
+ this.yAxis,
1098
+ this.chartConfig.chartOrientation,
1099
+ i
1100
+ );
1101
+ t.push(...a.getDrawableElement());
1102
+ }
1103
+ break;
1104
+ }
1105
+ return t;
1106
+ }
1107
+ }, n(nt, "BasePlot"), nt);
1108
+ function Kt(e, t, i) {
1109
+ return new Vi(e, t, i);
1110
+ }
1111
+ n(Kt, "getPlotComponent");
1112
+ var ot, Wi = (ot = class {
1113
+ constructor(t, i, s, a) {
1114
+ this.chartConfig = t, this.chartData = i, this.componentStore = {
1115
+ title: jt(t, i, s, a),
1116
+ plot: Kt(t, i, s),
1117
+ legend: Qt(t, i, s, a),
1118
+ xAxis: Rt(
1119
+ i.xAxis,
1120
+ t.xAxis,
1121
+ {
1122
+ titleColor: s.xAxisTitleColor,
1123
+ labelColor: s.xAxisLabelColor,
1124
+ tickColor: s.xAxisTickColor,
1125
+ axisLineColor: s.xAxisLineColor
1126
+ },
1127
+ a
1128
+ ),
1129
+ yAxis: Rt(
1130
+ i.yAxis,
1131
+ t.yAxis,
1132
+ {
1133
+ titleColor: s.yAxisTitleColor,
1134
+ labelColor: s.yAxisLabelColor,
1135
+ tickColor: s.yAxisTickColor,
1136
+ axisLineColor: s.yAxisLineColor
1137
+ },
1138
+ a
1139
+ )
1140
+ };
1141
+ }
1142
+ calculateVerticalSpace() {
1143
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, a = 0, h = { width: 0, height: 0 }, c = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), m = Math.floor(
1144
+ i * this.chartConfig.plotReservedSpacePercent / 100
1145
+ ), f = this.componentStore.plot.calculateSpace({
1146
+ width: c,
1147
+ height: m
1148
+ });
1149
+ t -= f.width, i -= f.height, f = this.componentStore.title.calculateSpace({
1150
+ width: this.chartConfig.width,
1151
+ height: i
1152
+ }), a = f.height, i -= f.height, this.componentStore.xAxis.setAxisPosition("bottom"), f = this.componentStore.xAxis.calculateSpace({
1153
+ width: t,
1154
+ height: i
1155
+ }), i -= f.height, this.componentStore.yAxis.setAxisPosition("left"), f = this.componentStore.yAxis.calculateSpace({
1156
+ width: t,
1157
+ height: i
1158
+ }), s = f.width, t -= f.width, h = this.componentStore.legend.calculateSpace({
1159
+ width: t,
1160
+ height: m
1161
+ }), t -= h.width, t > 0 && (c += t, t = 0), i > 0 && (m += i, i = 0), this.componentStore.plot.calculateSpace({
1162
+ width: c,
1163
+ height: m
1164
+ }), this.componentStore.plot.setBoundingBoxXY({ x: s, y: a }), this.componentStore.title.alignTo(s, s + c), this.componentStore.legend.setBoundingBoxXY({
1165
+ x: s + c,
1166
+ y: a + Math.max((m - h.height) / 2, 0)
1167
+ }), this.componentStore.xAxis.setRange([s, s + c]), this.componentStore.xAxis.setBoundingBoxXY({ x: s, y: a + m }), this.componentStore.yAxis.setRange([a, a + m]), this.componentStore.yAxis.setBoundingBoxXY({ x: 0, y: a }), this.chartData.plots.some((d) => pt(d)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1168
+ }
1169
+ calculateHorizontalSpace() {
1170
+ let t = this.chartConfig.width, i = this.chartConfig.height, s = 0, a = 0, h = 0, c = { width: 0, height: 0 }, m = Math.floor(t * this.chartConfig.plotReservedSpacePercent / 100), f = Math.floor(
1171
+ i * this.chartConfig.plotReservedSpacePercent / 100
1172
+ ), d = this.componentStore.plot.calculateSpace({
1173
+ width: m,
1174
+ height: f
1175
+ });
1176
+ t -= d.width, i -= d.height, d = this.componentStore.title.calculateSpace({
1177
+ width: this.chartConfig.width,
1178
+ height: i
1179
+ }), s = d.height, i -= d.height, this.componentStore.xAxis.setAxisPosition("left"), d = this.componentStore.xAxis.calculateSpace({
1180
+ width: t,
1181
+ height: i
1182
+ }), t -= d.width, a = d.width, this.componentStore.yAxis.setAxisPosition("top"), d = this.componentStore.yAxis.calculateSpace({
1183
+ width: t,
1184
+ height: i
1185
+ }), i -= d.height, h = s + d.height, c = this.componentStore.legend.calculateSpace({
1186
+ width: t,
1187
+ height: f
1188
+ }), t -= c.width, t > 0 && (m += t, t = 0), i > 0 && (f += i, i = 0), this.componentStore.plot.calculateSpace({
1189
+ width: m,
1190
+ height: f
1191
+ }), this.componentStore.plot.setBoundingBoxXY({ x: a, y: h }), this.componentStore.title.alignTo(a, a + m), this.componentStore.legend.setBoundingBoxXY({
1192
+ x: a + m,
1193
+ y: h + Math.max((f - c.height) / 2, 0)
1194
+ }), this.componentStore.yAxis.setRange([a, a + m]), this.componentStore.yAxis.setBoundingBoxXY({ x: a, y: s }), this.componentStore.xAxis.setRange([h, h + f]), this.componentStore.xAxis.setBoundingBoxXY({ x: 0, y: h }), this.chartData.plots.some((A) => pt(A)) && this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
1195
+ }
1196
+ calculateSpace() {
1197
+ this.chartConfig.chartOrientation === "horizontal" ? this.calculateHorizontalSpace() : this.calculateVerticalSpace();
1198
+ }
1199
+ getDrawableElement() {
1200
+ this.calculateSpace();
1201
+ const t = [];
1202
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
1203
+ for (const i of Object.values(this.componentStore))
1204
+ t.push(...i.getDrawableElements());
1205
+ return t;
1206
+ }
1207
+ }, n(ot, "Orchestrator"), ot), ht, Fi = (ht = class {
1208
+ static build(t, i, s, a) {
1209
+ return new Wi(t, i, s, a).getDrawableElement();
1210
+ }
1211
+ }, n(ht, "XYChartBuilder"), ht), ct = 0, Zt, gt = vt(), ut = Lt(), y = Et(), kt = ut.plotColorPalette.split(",").map((e) => e.trim()), yt = !1, Pt = !1;
1212
+ function Lt() {
1213
+ const e = ki(), t = Tt();
1214
+ return Gt(e.xyChart, t.themeVariables.xyChart);
1215
+ }
1216
+ n(Lt, "getChartDefaultThemeConfig");
1217
+ function vt() {
1218
+ const e = Tt();
1219
+ return Gt(
1220
+ _i.xyChart,
1221
+ e.xyChart
1222
+ );
1223
+ }
1224
+ n(vt, "getChartDefaultConfig");
1225
+ function Et() {
1226
+ return {
1227
+ yAxis: {
1228
+ type: "linear",
1229
+ title: "",
1230
+ min: 1 / 0,
1231
+ max: -1 / 0
1232
+ },
1233
+ xAxis: {
1234
+ type: "band",
1235
+ title: "",
1236
+ categories: []
1237
+ },
1238
+ title: "",
1239
+ plots: []
1240
+ };
1241
+ }
1242
+ n(Et, "getChartDefaultData");
1243
+ function G(e) {
1244
+ const t = Tt();
1245
+ return Ri(e.trim(), t);
1246
+ }
1247
+ n(G, "textSanitizer");
1248
+ function Jt(e) {
1249
+ Zt = e;
1250
+ }
1251
+ n(Jt, "setTmpSVGG");
1252
+ function ti(e) {
1253
+ e === "horizontal" ? gt.chartOrientation = "horizontal" : gt.chartOrientation = "vertical";
1254
+ }
1255
+ n(ti, "setOrientation");
1256
+ function ii(e) {
1257
+ y.xAxis.title = G(e.text);
1258
+ }
1259
+ n(ii, "setXAxisTitle");
1260
+ function It(e, t) {
1261
+ y.xAxis = { type: "linear", title: y.xAxis.title, min: e, max: t }, yt = !0;
1262
+ }
1263
+ n(It, "setXAxisRangeData");
1264
+ function ei(e) {
1265
+ y.xAxis = {
1266
+ type: "band",
1267
+ title: y.xAxis.title,
1268
+ categories: e.map((t) => G(t.text))
1269
+ }, yt = !0;
1270
+ }
1271
+ n(ei, "setXAxisBand");
1272
+ function si(e) {
1273
+ y.yAxis.title = G(e.text);
1274
+ }
1275
+ n(si, "setYAxisTitle");
1276
+ function ai(e, t) {
1277
+ y.yAxis = { type: "linear", title: y.yAxis.title, min: e, max: t }, Pt = !0;
1278
+ }
1279
+ n(ai, "setYAxisRangeData");
1280
+ function ni(e) {
1281
+ const t = Math.min(...e), i = Math.max(...e), s = Q(y.yAxis) ? y.yAxis.min : 1 / 0, a = Q(y.yAxis) ? y.yAxis.max : -1 / 0;
1282
+ y.yAxis = {
1283
+ type: "linear",
1284
+ title: y.yAxis.title,
1285
+ min: Math.min(s, t),
1286
+ max: Math.max(a, i)
1287
+ };
1288
+ }
1289
+ n(ni, "setYAxisRangeFromPlotData");
1290
+ function Mt(e) {
1291
+ let t = [];
1292
+ if (e.length === 0)
1293
+ return t;
1294
+ if (!yt) {
1295
+ const i = Q(y.xAxis) ? y.xAxis.min : 1 / 0, s = Q(y.xAxis) ? y.xAxis.max : -1 / 0;
1296
+ It(Math.min(i, 1), Math.max(s, e.length));
1297
+ }
1298
+ if (mt(y.xAxis) && e.length > y.xAxis.categories.length && (e = e.slice(0, y.xAxis.categories.length)), Pt || ni(e), mt(y.xAxis) && (t = y.xAxis.categories.map((i, s) => [i, e[s]])), Q(y.xAxis)) {
1299
+ const i = y.xAxis.min, s = y.xAxis.max;
1300
+ if (e.length === 1)
1301
+ t = [[`${i}`, e[0]]];
1302
+ else {
1303
+ const a = (s - i) / (e.length - 1);
1304
+ t = e.map((h, c) => [`${i + c * a}`, h]);
1305
+ }
1306
+ }
1307
+ return t;
1308
+ }
1309
+ n(Mt, "transformDataWithoutCategory");
1310
+ function zt(e) {
1311
+ return kt[e === 0 ? 0 : e % kt.length];
1312
+ }
1313
+ n(zt, "getPlotColorFromPalette");
1314
+ function oi(e, t) {
1315
+ const i = t.map((c) => c.value), s = t.map((c) => c.label ? G(c.label) : ""), a = Mt(i), h = s.some((c) => c !== "");
1316
+ y.plots.push({
1317
+ type: "line",
1318
+ title: G(e.text),
1319
+ strokeFill: zt(ct),
1320
+ strokeWidth: 2,
1321
+ data: a,
1322
+ ...h ? { pointLabels: s } : {}
1323
+ }), ct++;
1324
+ }
1325
+ n(oi, "setLineData");
1326
+ function hi(e, t) {
1327
+ const i = t.map((a) => a.value), s = Mt(i);
1328
+ y.plots.push({
1329
+ type: "bar",
1330
+ title: G(e.text),
1331
+ fill: zt(ct),
1332
+ data: s
1333
+ }), ct++;
1334
+ }
1335
+ n(hi, "setBarData");
1336
+ function ri() {
1337
+ if (y.plots.length === 0)
1338
+ throw Error("No Plot to render, please provide a plot with some data");
1339
+ return y.title = $t(), Fi.build(gt, y, ut, Zt);
1340
+ }
1341
+ n(ri, "getDrawableElem");
1342
+ function li() {
1343
+ return ut;
1344
+ }
1345
+ n(li, "getChartThemeConfig");
1346
+ function ci() {
1347
+ return gt;
1348
+ }
1349
+ n(ci, "getChartConfig");
1350
+ function gi() {
1351
+ return y;
1352
+ }
1353
+ n(gi, "getXYChartData");
1354
+ var Xi = /* @__PURE__ */ n(function() {
1355
+ Si(), ct = 0, gt = vt(), y = Et(), ut = Lt(), kt = ut.plotColorPalette.split(",").map((e) => e.trim()), yt = !1, Pt = !1;
1356
+ }, "clear"), Yi = {
1357
+ getDrawableElem: ri,
1358
+ clear: Xi,
1359
+ setAccTitle: wi,
1360
+ getAccTitle: bi,
1361
+ setDiagramTitle: yi,
1362
+ getDiagramTitle: $t,
1363
+ getAccDescription: mi,
1364
+ setAccDescription: pi,
1365
+ setOrientation: ti,
1366
+ setXAxisTitle: ii,
1367
+ setXAxisRangeData: It,
1368
+ setXAxisBand: ei,
1369
+ setYAxisTitle: si,
1370
+ setYAxisRangeData: ai,
1371
+ setLineData: oi,
1372
+ setBarData: hi,
1373
+ setTmpSVGG: Jt,
1374
+ getChartThemeConfig: li,
1375
+ getChartConfig: ci,
1376
+ getXYChartData: gi
1377
+ }, Ni = /* @__PURE__ */ n((e, t, i, s) => {
1378
+ const a = s.db, h = a.getChartThemeConfig(), c = a.getChartConfig(), m = a.getXYChartData().plots[0].data.map((b) => b[1]);
1379
+ function f(b) {
1380
+ return b === "top" ? "text-before-edge" : "middle";
1381
+ }
1382
+ n(f, "getDominantBaseLine");
1383
+ function d(b) {
1384
+ return b === "left" ? "start" : b === "right" ? "end" : "middle";
1385
+ }
1386
+ n(d, "getTextAnchor");
1387
+ function A(b) {
1388
+ return `translate(${b.x}, ${b.y}) rotate(${b.rotation || 0})`;
1389
+ }
1390
+ n(A, "getTextTransformation"), Ut.debug(`Rendering xychart chart
1391
+ ` + e);
1392
+ const k = Ai(t), P = k.append("g").attr("class", "main"), W = P.append("rect").attr("width", c.width).attr("height", c.height).attr("class", "background");
1393
+ Ci(k, c.height, c.width, !0), k.attr("viewBox", `0 0 ${c.width} ${c.height}`), W.attr("fill", h.backgroundColor), a.setTmpSVGG(k.append("g").attr("class", "mermaid-tmp-group"));
1394
+ const F = a.getDrawableElem(), v = {};
1395
+ function B(b) {
1396
+ let T = P, l = "";
1397
+ for (const [I] of b.entries()) {
1398
+ let O = P;
1399
+ I > 0 && v[l] && (O = v[l]), l += b[I], T = v[l], T || (T = v[l] = O.append("g").attr("class", b[I]));
1400
+ }
1401
+ return T;
1402
+ }
1403
+ n(B, "getGroup");
1404
+ for (const b of F) {
1405
+ if (b.data.length === 0)
1406
+ continue;
1407
+ const T = B(b.groupTexts);
1408
+ switch (b.type) {
1409
+ case "rect":
1410
+ if (T.selectAll("rect").data(b.data).enter().append("rect").attr("x", (l) => l.x).attr("y", (l) => l.y).attr("width", (l) => l.width).attr("height", (l) => l.height).attr("fill", (l) => l.fill).attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth), c.showDataLabel) {
1411
+ const l = c.showDataLabelOutsideBar;
1412
+ if (c.chartOrientation === "horizontal") {
1413
+ let I = function(C, M) {
1414
+ const { data: _, label: rt } = C;
1415
+ return M * rt.length * O <= _.width - X;
1416
+ };
1417
+ n(I, "fitsHorizontally");
1418
+ const O = 0.7, X = 10, Y = b.data.map((C, M) => ({ data: C, label: m[M].toString() })).filter((C) => C.data.width > 0 && C.data.height > 0), R = Y.map((C) => {
1419
+ const { data: M } = C;
1420
+ let _ = M.height * 0.7;
1421
+ for (; !I(C, _) && _ > 0; )
1422
+ _ -= 1;
1423
+ return _;
1424
+ }), H = Math.floor(Math.min(...R)), w = /* @__PURE__ */ n((C) => l ? C.data.x + C.data.width + X : C.data.x + C.data.width - X, "determineLabelXPosition");
1425
+ T.selectAll("text").data(Y).enter().append("text").attr("x", w).attr("y", (C) => C.data.y + C.data.height / 2).attr("text-anchor", l ? "start" : "end").attr("dominant-baseline", "middle").attr("fill", h.dataLabelColor).attr("font-size", `${H}px`).text((C) => C.label);
1426
+ } else {
1427
+ let I = function(w, C, M) {
1428
+ const { data: _, label: rt } = w, V = C * rt.length * 0.7, r = _.x + _.width / 2, g = r - V / 2, u = r + V / 2, x = g >= _.x && u <= _.x + _.width, S = _.y + M + C <= _.y + _.height;
1429
+ return x && S;
1430
+ };
1431
+ n(I, "fitsInBar");
1432
+ const O = 10, X = b.data.map((w, C) => ({ data: w, label: m[C].toString() })).filter((w) => w.data.width > 0 && w.data.height > 0), Y = X.map((w) => {
1433
+ const { data: C, label: M } = w;
1434
+ let _ = C.width / (M.length * 0.7);
1435
+ for (; !I(w, _, O) && _ > 0; )
1436
+ _ -= 1;
1437
+ return _;
1438
+ }), R = Math.floor(Math.min(...Y)), H = /* @__PURE__ */ n((w) => l ? w.data.y - O : w.data.y + O, "determineLabelYPosition");
1439
+ T.selectAll("text").data(X).enter().append("text").attr("x", (w) => w.data.x + w.data.width / 2).attr("y", H).attr("text-anchor", "middle").attr("dominant-baseline", l ? "auto" : "hanging").attr("fill", h.dataLabelColor).attr("font-size", `${R}px`).text((w) => w.label);
1440
+ }
1441
+ }
1442
+ break;
1443
+ case "text":
1444
+ T.selectAll("text").data(b.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (l) => l.fill).attr("font-size", (l) => l.fontSize).attr("dominant-baseline", (l) => f(l.verticalPos)).attr("text-anchor", (l) => d(l.horizontalPos)).attr("transform", (l) => A(l)).text((l) => l.text);
1445
+ break;
1446
+ case "path":
1447
+ T.selectAll("path").data(b.data).enter().append("path").attr("d", (l) => l.path).attr("fill", (l) => l.fill ? l.fill : "none").attr("stroke", (l) => l.strokeFill).attr("stroke-width", (l) => l.strokeWidth);
1448
+ break;
1449
+ }
1450
+ }
1451
+ }, "draw"), Hi = {
1452
+ draw: Ni
1453
+ }, Gi = {
1454
+ parser: Di,
1455
+ db: Yi,
1456
+ renderer: Hi
1457
+ };
1458
+ export {
1459
+ Gi as diagram
1460
+ };