@umami/shiso 1.12.0 → 1.13.0

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 (121) hide show
  1. package/dist/chunks/App.js +76 -49
  2. package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
  3. package/dist/chunks/arc.js +130 -0
  4. package/dist/chunks/architecture-7GRP2DOG.js +4 -0
  5. package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
  6. package/dist/chunks/array.js +8 -0
  7. package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
  8. package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
  9. package/dist/chunks/channel.js +9 -0
  10. package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
  11. package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
  12. package/dist/chunks/chunk-5VM5RSS4.js +21 -0
  13. package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
  14. package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
  15. package/dist/chunks/chunk-F27PBJKO.js +95 -0
  16. package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
  17. package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
  18. package/dist/chunks/chunk-GVQU2GXP.js +58 -0
  19. package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
  20. package/dist/chunks/chunk-JWPE2WC7.js +12 -0
  21. package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
  22. package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
  23. package/dist/chunks/chunk-P2QGCYS3.js +95 -0
  24. package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
  25. package/dist/chunks/chunk-PWAF6VOD.js +467 -0
  26. package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
  27. package/dist/chunks/chunk-SVP7TREG.js +686 -0
  28. package/dist/chunks/chunk-TICWLB2K.js +3800 -0
  29. package/dist/chunks/chunk-XXDRQBXY.js +12 -0
  30. package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
  31. package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
  32. package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
  33. package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
  34. package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
  35. package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
  36. package/dist/chunks/cytoscape.esm.js +28282 -0
  37. package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
  38. package/dist/chunks/dagre.js +4235 -0
  39. package/dist/chunks/defaultLocale.js +246 -0
  40. package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
  41. package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
  42. package/dist/chunks/diagram-VSXAHHWV.js +553 -0
  43. package/dist/chunks/diagram-VX7I27RA.js +798 -0
  44. package/dist/chunks/diagram-Z3DM3KII.js +186 -0
  45. package/dist/chunks/dist.js +92 -0
  46. package/dist/chunks/docs.js +987 -91
  47. package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
  48. package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
  49. package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
  50. package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
  51. package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
  52. package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
  53. package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
  54. package/dist/chunks/graphlib.js +4194 -0
  55. package/dist/chunks/info-A6RAGUB7.js +4 -0
  56. package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
  57. package/dist/chunks/init.js +14 -0
  58. package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
  59. package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
  60. package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
  61. package/dist/chunks/katex.js +26463 -0
  62. package/dist/chunks/line.js +48 -0
  63. package/dist/chunks/linear.js +391 -0
  64. package/dist/chunks/mermaid-parser.core.js +754 -0
  65. package/dist/chunks/mermaid.core.js +4898 -0
  66. package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
  67. package/dist/chunks/ordinal.js +84 -0
  68. package/dist/chunks/packet-AYTQ26CC.js +4 -0
  69. package/dist/chunks/path.js +106 -0
  70. package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
  71. package/dist/chunks/pie-WAS4IAKB.js +4 -0
  72. package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
  73. package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
  74. package/dist/chunks/radar-RG4KPBEZ.js +4 -0
  75. package/dist/chunks/railroad-74A4TZTK.js +4 -0
  76. package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
  77. package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
  78. package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
  79. package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
  80. package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
  81. package/dist/chunks/rough.esm.js +1396 -0
  82. package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
  83. package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
  84. package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
  85. package/dist/chunks/src.js +2653 -0
  86. package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
  87. package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
  88. package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
  89. package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
  90. package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
  91. package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
  92. package/dist/chunks/treemap-WGGIJYW6.js +4 -0
  93. package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
  94. package/dist/chunks/wardley-WFR3VGLG.js +4 -0
  95. package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
  96. package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
  97. package/dist/components.js +2 -2
  98. package/dist/entry-client.js +1 -1
  99. package/dist/entry-server.js +1 -1
  100. package/docs.schema.json +1 -1
  101. package/package.json +2 -1
  102. package/scripts/expand-navigation-globs.mjs +77 -8
  103. package/src/components/CodeBlock.tsx +36 -0
  104. package/src/components/Docs.tsx +44 -21
  105. package/src/components/OpenApiOperation.tsx +28 -20
  106. package/src/components/SideNav.tsx +8 -3
  107. package/src/components/docs/Changelog.tsx +163 -0
  108. package/src/components/docs/Mermaid.tsx +164 -0
  109. package/src/components/docs/Panel.tsx +23 -0
  110. package/src/components/docs/ParamField.tsx +17 -5
  111. package/src/components/docs/PropertiesTable.tsx +2 -2
  112. package/src/components/docs/ResponseField.tsx +17 -5
  113. package/src/components/docs/Tiles.tsx +59 -0
  114. package/src/components/docs/Tree.tsx +359 -0
  115. package/src/components/docs/Update.tsx +72 -0
  116. package/src/components/docs/index.ts +7 -0
  117. package/src/components/docs/panel-context.tsx +25 -0
  118. package/src/components/docs/styles.ts +49 -0
  119. package/src/components/icons/index.ts +4 -0
  120. package/src/lib/rehype-shiki.ts +18 -1
  121. package/types/components.d.ts +79 -0
@@ -0,0 +1,2698 @@
1
+ import { n as __name } from "./chunk-Y2CYZVJY.js";
2
+ import { m as log } from "./src.js";
3
+ import { D as getThemeVariables3, H as setAccDescription, K as setDiagramTitle, U as setAccTitle, a as clear, b as getConfig, c as configureSvgSize, f as defaultConfig_default, v as getAccDescription, w as getDiagramTitle, y as getAccTitle, z as sanitizeText } from "./chunk-DU6HZSFF.js";
4
+ import { t as linear } from "./linear.js";
5
+ import { t as ordinal } from "./ordinal.js";
6
+ import { t as initRange } from "./init.js";
7
+ import { i as cleanAndMerge } from "./chunk-75Z2AOVW.js";
8
+ import { t as line_default } from "./line.js";
9
+ import "./chunk-PWAF6VOD.js";
10
+ import { t as computeDimensionOfText } from "./chunk-GMAD6QVW.js";
11
+ import { f as selectSvgElement } from "./mermaid.core.js";
12
+
13
+ //#region ../../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/range.js
14
+ function range(start, stop, step) {
15
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
16
+ var i = -1, n = Math.max(0, Math.ceil((stop - start) / step)) | 0, range = new Array(n);
17
+ while (++i < n) range[i] = start + i * step;
18
+ return range;
19
+ }
20
+
21
+ //#endregion
22
+ //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js
23
+ function band() {
24
+ var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = .5;
25
+ delete scale.unknown;
26
+ function rescale() {
27
+ var n = domain().length, reverse = r1 < r0, start = reverse ? r1 : r0, stop = reverse ? r0 : r1;
28
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
29
+ if (round) step = Math.floor(step);
30
+ start += (stop - start - step * (n - paddingInner)) * align;
31
+ bandwidth = step * (1 - paddingInner);
32
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
33
+ var values = range(n).map(function(i) {
34
+ return start + step * i;
35
+ });
36
+ return ordinalRange(reverse ? values.reverse() : values);
37
+ }
38
+ scale.domain = function(_) {
39
+ return arguments.length ? (domain(_), rescale()) : domain();
40
+ };
41
+ scale.range = function(_) {
42
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
43
+ };
44
+ scale.rangeRound = function(_) {
45
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
46
+ };
47
+ scale.bandwidth = function() {
48
+ return bandwidth;
49
+ };
50
+ scale.step = function() {
51
+ return step;
52
+ };
53
+ scale.round = function(_) {
54
+ return arguments.length ? (round = !!_, rescale()) : round;
55
+ };
56
+ scale.padding = function(_) {
57
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
58
+ };
59
+ scale.paddingInner = function(_) {
60
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
61
+ };
62
+ scale.paddingOuter = function(_) {
63
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
64
+ };
65
+ scale.align = function(_) {
66
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
67
+ };
68
+ scale.copy = function() {
69
+ return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
70
+ };
71
+ return initRange.apply(rescale(), arguments);
72
+ }
73
+
74
+ //#endregion
75
+ //#region ../../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/xychartDiagram-S5SC5T6Z.mjs
76
+ var parser = (function() {
77
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
78
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v);
79
+ return o2;
80
+ }, "o"), $V0 = [
81
+ 1,
82
+ 10,
83
+ 12,
84
+ 14,
85
+ 16,
86
+ 18,
87
+ 19,
88
+ 21,
89
+ 23
90
+ ], $V1 = [2, 6], $V2 = [1, 3], $V3 = [1, 5], $V4 = [1, 6], $V5 = [1, 7], $V6 = [
91
+ 1,
92
+ 5,
93
+ 10,
94
+ 12,
95
+ 14,
96
+ 16,
97
+ 18,
98
+ 19,
99
+ 21,
100
+ 23,
101
+ 36,
102
+ 37,
103
+ 38
104
+ ], $V7 = [1, 25], $V8 = [1, 26], $V9 = [1, 28], $Va = [1, 29], $Vb = [1, 30], $Vc = [1, 31], $Vd = [1, 32], $Ve = [1, 33], $Vf = [1, 34], $Vg = [1, 35], $Vh = [1, 36], $Vi = [1, 37], $Vj = [1, 43], $Vk = [1, 42], $Vl = [1, 47], $Vm = [1, 50], $Vn = [
105
+ 1,
106
+ 10,
107
+ 12,
108
+ 14,
109
+ 16,
110
+ 18,
111
+ 19,
112
+ 21,
113
+ 23,
114
+ 36,
115
+ 37,
116
+ 38
117
+ ], $Vo = [
118
+ 1,
119
+ 10,
120
+ 12,
121
+ 14,
122
+ 16,
123
+ 18,
124
+ 19,
125
+ 21,
126
+ 23,
127
+ 24,
128
+ 26,
129
+ 28,
130
+ 29,
131
+ 36,
132
+ 37,
133
+ 38
134
+ ], $Vp = [
135
+ 1,
136
+ 10,
137
+ 12,
138
+ 14,
139
+ 16,
140
+ 18,
141
+ 19,
142
+ 21,
143
+ 23,
144
+ 24,
145
+ 26,
146
+ 28,
147
+ 29,
148
+ 36,
149
+ 37,
150
+ 38,
151
+ 42,
152
+ 43,
153
+ 44,
154
+ 45,
155
+ 46,
156
+ 47,
157
+ 48,
158
+ 49,
159
+ 50,
160
+ 51
161
+ ], $Vq = [1, 65], $Vr = [26, 28];
162
+ var parser2 = {
163
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
164
+ yy: {},
165
+ symbols_: {
166
+ "error": 2,
167
+ "start": 3,
168
+ "eol": 4,
169
+ "XYCHART": 5,
170
+ "chartConfig": 6,
171
+ "document": 7,
172
+ "CHART_ORIENTATION": 8,
173
+ "statement": 9,
174
+ "title": 10,
175
+ "text": 11,
176
+ "X_AXIS": 12,
177
+ "parseXAxis": 13,
178
+ "Y_AXIS": 14,
179
+ "parseYAxis": 15,
180
+ "LINE": 16,
181
+ "plotData": 17,
182
+ "BAR": 18,
183
+ "acc_title": 19,
184
+ "acc_title_value": 20,
185
+ "acc_descr": 21,
186
+ "acc_descr_value": 22,
187
+ "acc_descr_multiline_value": 23,
188
+ "SQUARE_BRACES_START": 24,
189
+ "dataPoints": 25,
190
+ "SQUARE_BRACES_END": 26,
191
+ "dataPoint": 27,
192
+ "COMMA": 28,
193
+ "NUMBER_WITH_DECIMAL": 29,
194
+ "STR": 30,
195
+ "xAxisData": 31,
196
+ "bandData": 32,
197
+ "ARROW_DELIMITER": 33,
198
+ "commaSeparatedTexts": 34,
199
+ "yAxisData": 35,
200
+ "NEWLINE": 36,
201
+ "SEMI": 37,
202
+ "EOF": 38,
203
+ "alphaNum": 39,
204
+ "MD_STR": 40,
205
+ "alphaNumToken": 41,
206
+ "AMP": 42,
207
+ "NUM": 43,
208
+ "ALPHA": 44,
209
+ "PLUS": 45,
210
+ "EQUALS": 46,
211
+ "MULT": 47,
212
+ "DOT": 48,
213
+ "BRKT": 49,
214
+ "MINUS": 50,
215
+ "UNDERSCORE": 51,
216
+ "$accept": 0,
217
+ "$end": 1
218
+ },
219
+ terminals_: {
220
+ 2: "error",
221
+ 5: "XYCHART",
222
+ 8: "CHART_ORIENTATION",
223
+ 10: "title",
224
+ 12: "X_AXIS",
225
+ 14: "Y_AXIS",
226
+ 16: "LINE",
227
+ 18: "BAR",
228
+ 19: "acc_title",
229
+ 20: "acc_title_value",
230
+ 21: "acc_descr",
231
+ 22: "acc_descr_value",
232
+ 23: "acc_descr_multiline_value",
233
+ 24: "SQUARE_BRACES_START",
234
+ 26: "SQUARE_BRACES_END",
235
+ 28: "COMMA",
236
+ 29: "NUMBER_WITH_DECIMAL",
237
+ 30: "STR",
238
+ 33: "ARROW_DELIMITER",
239
+ 36: "NEWLINE",
240
+ 37: "SEMI",
241
+ 38: "EOF",
242
+ 40: "MD_STR",
243
+ 42: "AMP",
244
+ 43: "NUM",
245
+ 44: "ALPHA",
246
+ 45: "PLUS",
247
+ 46: "EQUALS",
248
+ 47: "MULT",
249
+ 48: "DOT",
250
+ 49: "BRKT",
251
+ 50: "MINUS",
252
+ 51: "UNDERSCORE"
253
+ },
254
+ productions_: [
255
+ 0,
256
+ [3, 2],
257
+ [3, 3],
258
+ [3, 2],
259
+ [3, 1],
260
+ [6, 1],
261
+ [7, 0],
262
+ [7, 2],
263
+ [9, 2],
264
+ [9, 2],
265
+ [9, 2],
266
+ [9, 2],
267
+ [9, 2],
268
+ [9, 3],
269
+ [9, 2],
270
+ [9, 3],
271
+ [9, 2],
272
+ [9, 2],
273
+ [9, 1],
274
+ [17, 3],
275
+ [25, 3],
276
+ [25, 1],
277
+ [27, 2],
278
+ [27, 1],
279
+ [13, 1],
280
+ [13, 2],
281
+ [13, 1],
282
+ [31, 1],
283
+ [31, 3],
284
+ [32, 3],
285
+ [34, 3],
286
+ [34, 1],
287
+ [15, 1],
288
+ [15, 2],
289
+ [15, 1],
290
+ [35, 3],
291
+ [4, 1],
292
+ [4, 1],
293
+ [4, 1],
294
+ [11, 1],
295
+ [11, 1],
296
+ [11, 1],
297
+ [39, 1],
298
+ [39, 2],
299
+ [41, 1],
300
+ [41, 1],
301
+ [41, 1],
302
+ [41, 1],
303
+ [41, 1],
304
+ [41, 1],
305
+ [41, 1],
306
+ [41, 1],
307
+ [41, 1],
308
+ [41, 1]
309
+ ],
310
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
311
+ var $0 = $$.length - 1;
312
+ switch (yystate) {
313
+ case 5:
314
+ yy.setOrientation($$[$0]);
315
+ break;
316
+ case 9:
317
+ yy.setDiagramTitle($$[$0].text.trim());
318
+ break;
319
+ case 12:
320
+ yy.setLineData({
321
+ text: "",
322
+ type: "text"
323
+ }, $$[$0]);
324
+ break;
325
+ case 13:
326
+ yy.setLineData($$[$0 - 1], $$[$0]);
327
+ break;
328
+ case 14:
329
+ yy.setBarData({
330
+ text: "",
331
+ type: "text"
332
+ }, $$[$0]);
333
+ break;
334
+ case 15:
335
+ yy.setBarData($$[$0 - 1], $$[$0]);
336
+ break;
337
+ case 16:
338
+ this.$ = $$[$0].trim();
339
+ yy.setAccTitle(this.$);
340
+ break;
341
+ case 17:
342
+ case 18:
343
+ this.$ = $$[$0].trim();
344
+ yy.setAccDescription(this.$);
345
+ break;
346
+ case 19:
347
+ this.$ = $$[$0 - 1];
348
+ break;
349
+ case 20:
350
+ case 30:
351
+ this.$ = [$$[$0 - 2], ...$$[$0]];
352
+ break;
353
+ case 21:
354
+ case 31:
355
+ this.$ = [$$[$0]];
356
+ break;
357
+ case 22:
358
+ this.$ = {
359
+ value: Number($$[$0 - 1]),
360
+ label: $$[$0]
361
+ };
362
+ break;
363
+ case 23:
364
+ this.$ = {
365
+ value: Number($$[$0]),
366
+ label: ""
367
+ };
368
+ break;
369
+ case 24:
370
+ yy.setXAxisTitle($$[$0]);
371
+ break;
372
+ case 25:
373
+ yy.setXAxisTitle($$[$0 - 1]);
374
+ break;
375
+ case 26:
376
+ yy.setXAxisTitle({
377
+ type: "text",
378
+ text: ""
379
+ });
380
+ break;
381
+ case 27:
382
+ yy.setXAxisBand($$[$0]);
383
+ break;
384
+ case 28:
385
+ yy.setXAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
386
+ break;
387
+ case 29:
388
+ this.$ = $$[$0 - 1];
389
+ break;
390
+ case 32:
391
+ yy.setYAxisTitle($$[$0]);
392
+ break;
393
+ case 33:
394
+ yy.setYAxisTitle($$[$0 - 1]);
395
+ break;
396
+ case 34:
397
+ yy.setYAxisTitle({
398
+ type: "text",
399
+ text: ""
400
+ });
401
+ break;
402
+ case 35:
403
+ yy.setYAxisRangeData(Number($$[$0 - 2]), Number($$[$0]));
404
+ break;
405
+ case 39:
406
+ this.$ = {
407
+ text: $$[$0],
408
+ type: "text"
409
+ };
410
+ break;
411
+ case 40:
412
+ this.$ = {
413
+ text: $$[$0],
414
+ type: "text"
415
+ };
416
+ break;
417
+ case 41:
418
+ this.$ = {
419
+ text: $$[$0],
420
+ type: "markdown"
421
+ };
422
+ break;
423
+ case 42:
424
+ this.$ = $$[$0];
425
+ break;
426
+ case 43: this.$ = $$[$0 - 1] + "" + $$[$0];
427
+ }
428
+ }, "anonymous"),
429
+ table: [
430
+ o($V0, $V1, {
431
+ 3: 1,
432
+ 4: 2,
433
+ 7: 4,
434
+ 5: $V2,
435
+ 36: $V3,
436
+ 37: $V4,
437
+ 38: $V5
438
+ }),
439
+ { 1: [3] },
440
+ o($V0, $V1, {
441
+ 4: 2,
442
+ 7: 4,
443
+ 3: 8,
444
+ 5: $V2,
445
+ 36: $V3,
446
+ 37: $V4,
447
+ 38: $V5
448
+ }),
449
+ o($V0, $V1, {
450
+ 4: 2,
451
+ 7: 4,
452
+ 6: 9,
453
+ 3: 10,
454
+ 5: $V2,
455
+ 8: [1, 11],
456
+ 36: $V3,
457
+ 37: $V4,
458
+ 38: $V5
459
+ }),
460
+ {
461
+ 1: [2, 4],
462
+ 9: 12,
463
+ 10: [1, 13],
464
+ 12: [1, 14],
465
+ 14: [1, 15],
466
+ 16: [1, 16],
467
+ 18: [1, 17],
468
+ 19: [1, 18],
469
+ 21: [1, 19],
470
+ 23: [1, 20]
471
+ },
472
+ o($V6, [2, 36]),
473
+ o($V6, [2, 37]),
474
+ o($V6, [2, 38]),
475
+ { 1: [2, 1] },
476
+ o($V0, $V1, {
477
+ 4: 2,
478
+ 7: 4,
479
+ 3: 21,
480
+ 5: $V2,
481
+ 36: $V3,
482
+ 37: $V4,
483
+ 38: $V5
484
+ }),
485
+ { 1: [2, 3] },
486
+ o($V6, [2, 5]),
487
+ o($V0, [2, 7], {
488
+ 4: 22,
489
+ 36: $V3,
490
+ 37: $V4,
491
+ 38: $V5
492
+ }),
493
+ {
494
+ 11: 23,
495
+ 30: $V7,
496
+ 39: 24,
497
+ 40: $V8,
498
+ 41: 27,
499
+ 42: $V9,
500
+ 43: $Va,
501
+ 44: $Vb,
502
+ 45: $Vc,
503
+ 46: $Vd,
504
+ 47: $Ve,
505
+ 48: $Vf,
506
+ 49: $Vg,
507
+ 50: $Vh,
508
+ 51: $Vi
509
+ },
510
+ {
511
+ 11: 39,
512
+ 13: 38,
513
+ 24: $Vj,
514
+ 29: $Vk,
515
+ 30: $V7,
516
+ 31: 40,
517
+ 32: 41,
518
+ 39: 24,
519
+ 40: $V8,
520
+ 41: 27,
521
+ 42: $V9,
522
+ 43: $Va,
523
+ 44: $Vb,
524
+ 45: $Vc,
525
+ 46: $Vd,
526
+ 47: $Ve,
527
+ 48: $Vf,
528
+ 49: $Vg,
529
+ 50: $Vh,
530
+ 51: $Vi
531
+ },
532
+ {
533
+ 11: 45,
534
+ 15: 44,
535
+ 29: $Vl,
536
+ 30: $V7,
537
+ 35: 46,
538
+ 39: 24,
539
+ 40: $V8,
540
+ 41: 27,
541
+ 42: $V9,
542
+ 43: $Va,
543
+ 44: $Vb,
544
+ 45: $Vc,
545
+ 46: $Vd,
546
+ 47: $Ve,
547
+ 48: $Vf,
548
+ 49: $Vg,
549
+ 50: $Vh,
550
+ 51: $Vi
551
+ },
552
+ {
553
+ 11: 49,
554
+ 17: 48,
555
+ 24: $Vm,
556
+ 30: $V7,
557
+ 39: 24,
558
+ 40: $V8,
559
+ 41: 27,
560
+ 42: $V9,
561
+ 43: $Va,
562
+ 44: $Vb,
563
+ 45: $Vc,
564
+ 46: $Vd,
565
+ 47: $Ve,
566
+ 48: $Vf,
567
+ 49: $Vg,
568
+ 50: $Vh,
569
+ 51: $Vi
570
+ },
571
+ {
572
+ 11: 52,
573
+ 17: 51,
574
+ 24: $Vm,
575
+ 30: $V7,
576
+ 39: 24,
577
+ 40: $V8,
578
+ 41: 27,
579
+ 42: $V9,
580
+ 43: $Va,
581
+ 44: $Vb,
582
+ 45: $Vc,
583
+ 46: $Vd,
584
+ 47: $Ve,
585
+ 48: $Vf,
586
+ 49: $Vg,
587
+ 50: $Vh,
588
+ 51: $Vi
589
+ },
590
+ { 20: [1, 53] },
591
+ { 22: [1, 54] },
592
+ o($Vn, [2, 18]),
593
+ { 1: [2, 2] },
594
+ o($Vn, [2, 8]),
595
+ o($Vn, [2, 9]),
596
+ o($Vo, [2, 39], {
597
+ 41: 55,
598
+ 42: $V9,
599
+ 43: $Va,
600
+ 44: $Vb,
601
+ 45: $Vc,
602
+ 46: $Vd,
603
+ 47: $Ve,
604
+ 48: $Vf,
605
+ 49: $Vg,
606
+ 50: $Vh,
607
+ 51: $Vi
608
+ }),
609
+ o($Vo, [2, 40]),
610
+ o($Vo, [2, 41]),
611
+ o($Vp, [2, 42]),
612
+ o($Vp, [2, 44]),
613
+ o($Vp, [2, 45]),
614
+ o($Vp, [2, 46]),
615
+ o($Vp, [2, 47]),
616
+ o($Vp, [2, 48]),
617
+ o($Vp, [2, 49]),
618
+ o($Vp, [2, 50]),
619
+ o($Vp, [2, 51]),
620
+ o($Vp, [2, 52]),
621
+ o($Vp, [2, 53]),
622
+ o($Vn, [2, 10]),
623
+ o($Vn, [2, 24], {
624
+ 32: 41,
625
+ 31: 56,
626
+ 24: $Vj,
627
+ 29: $Vk
628
+ }),
629
+ o($Vn, [2, 26]),
630
+ o($Vn, [2, 27]),
631
+ { 33: [1, 57] },
632
+ {
633
+ 11: 59,
634
+ 30: $V7,
635
+ 34: 58,
636
+ 39: 24,
637
+ 40: $V8,
638
+ 41: 27,
639
+ 42: $V9,
640
+ 43: $Va,
641
+ 44: $Vb,
642
+ 45: $Vc,
643
+ 46: $Vd,
644
+ 47: $Ve,
645
+ 48: $Vf,
646
+ 49: $Vg,
647
+ 50: $Vh,
648
+ 51: $Vi
649
+ },
650
+ o($Vn, [2, 11]),
651
+ o($Vn, [2, 32], {
652
+ 35: 60,
653
+ 29: $Vl
654
+ }),
655
+ o($Vn, [2, 34]),
656
+ { 33: [1, 61] },
657
+ o($Vn, [2, 12]),
658
+ {
659
+ 17: 62,
660
+ 24: $Vm
661
+ },
662
+ {
663
+ 25: 63,
664
+ 27: 64,
665
+ 29: $Vq
666
+ },
667
+ o($Vn, [2, 14]),
668
+ {
669
+ 17: 66,
670
+ 24: $Vm
671
+ },
672
+ o($Vn, [2, 16]),
673
+ o($Vn, [2, 17]),
674
+ o($Vp, [2, 43]),
675
+ o($Vn, [2, 25]),
676
+ { 29: [1, 67] },
677
+ { 26: [1, 68] },
678
+ {
679
+ 26: [2, 31],
680
+ 28: [1, 69]
681
+ },
682
+ o($Vn, [2, 33]),
683
+ { 29: [1, 70] },
684
+ o($Vn, [2, 13]),
685
+ { 26: [1, 71] },
686
+ {
687
+ 26: [2, 21],
688
+ 28: [1, 72]
689
+ },
690
+ o($Vr, [2, 23], { 30: [1, 73] }),
691
+ o($Vn, [2, 15]),
692
+ o($Vn, [2, 28]),
693
+ o($Vn, [2, 29]),
694
+ {
695
+ 11: 59,
696
+ 30: $V7,
697
+ 34: 74,
698
+ 39: 24,
699
+ 40: $V8,
700
+ 41: 27,
701
+ 42: $V9,
702
+ 43: $Va,
703
+ 44: $Vb,
704
+ 45: $Vc,
705
+ 46: $Vd,
706
+ 47: $Ve,
707
+ 48: $Vf,
708
+ 49: $Vg,
709
+ 50: $Vh,
710
+ 51: $Vi
711
+ },
712
+ o($Vn, [2, 35]),
713
+ o($Vn, [2, 19]),
714
+ {
715
+ 25: 75,
716
+ 27: 64,
717
+ 29: $Vq
718
+ },
719
+ o($Vr, [2, 22]),
720
+ { 26: [2, 30] },
721
+ { 26: [2, 20] }
722
+ ],
723
+ defaultActions: {
724
+ 8: [2, 1],
725
+ 10: [2, 3],
726
+ 21: [2, 2],
727
+ 74: [2, 30],
728
+ 75: [2, 20]
729
+ },
730
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
731
+ if (hash.recoverable) this.trace(str);
732
+ else {
733
+ var error = new Error(str);
734
+ error.hash = hash;
735
+ throw error;
736
+ }
737
+ }, "parseError"),
738
+ parse: /* @__PURE__ */ __name(function parse(input) {
739
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
740
+ var args = lstack.slice.call(arguments, 1);
741
+ var lexer2 = Object.create(this.lexer);
742
+ var sharedState = { yy: {} };
743
+ for (var k in this.yy) if (Object.prototype.hasOwnProperty.call(this.yy, k)) sharedState.yy[k] = this.yy[k];
744
+ lexer2.setInput(input, sharedState.yy);
745
+ sharedState.yy.lexer = lexer2;
746
+ sharedState.yy.parser = this;
747
+ if (typeof lexer2.yylloc == "undefined") lexer2.yylloc = {};
748
+ var yyloc = lexer2.yylloc;
749
+ lstack.push(yyloc);
750
+ var ranges = lexer2.options && lexer2.options.ranges;
751
+ if (typeof sharedState.yy.parseError === "function") this.parseError = sharedState.yy.parseError;
752
+ else this.parseError = Object.getPrototypeOf(this).parseError;
753
+ function popStack(n) {
754
+ stack.length = stack.length - 2 * n;
755
+ vstack.length = vstack.length - n;
756
+ lstack.length = lstack.length - n;
757
+ }
758
+ __name(popStack, "popStack");
759
+ function lex() {
760
+ var token = tstack.pop() || lexer2.lex() || EOF;
761
+ if (typeof token !== "number") {
762
+ if (token instanceof Array) {
763
+ tstack = token;
764
+ token = tstack.pop();
765
+ }
766
+ token = self.symbols_[token] || token;
767
+ }
768
+ return token;
769
+ }
770
+ __name(lex, "lex");
771
+ var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
772
+ while (true) {
773
+ state = stack[stack.length - 1];
774
+ if (this.defaultActions[state]) action = this.defaultActions[state];
775
+ else {
776
+ if (symbol === null || typeof symbol == "undefined") symbol = lex();
777
+ action = table[state] && table[state][symbol];
778
+ }
779
+ if (typeof action === "undefined" || !action.length || !action[0]) {
780
+ var errStr = "";
781
+ expected = [];
782
+ for (p in table[state]) if (this.terminals_[p] && p > TERROR) expected.push("'" + this.terminals_[p] + "'");
783
+ if (lexer2.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
784
+ else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
785
+ this.parseError(errStr, {
786
+ text: lexer2.match,
787
+ token: this.terminals_[symbol] || symbol,
788
+ line: lexer2.yylineno,
789
+ loc: yyloc,
790
+ expected
791
+ });
792
+ }
793
+ if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
794
+ switch (action[0]) {
795
+ case 1:
796
+ stack.push(symbol);
797
+ vstack.push(lexer2.yytext);
798
+ lstack.push(lexer2.yylloc);
799
+ stack.push(action[1]);
800
+ symbol = null;
801
+ if (!preErrorSymbol) {
802
+ yyleng = lexer2.yyleng;
803
+ yytext = lexer2.yytext;
804
+ yylineno = lexer2.yylineno;
805
+ yyloc = lexer2.yylloc;
806
+ if (recovering > 0) recovering--;
807
+ } else {
808
+ symbol = preErrorSymbol;
809
+ preErrorSymbol = null;
810
+ }
811
+ break;
812
+ case 2:
813
+ len = this.productions_[action[1]][1];
814
+ yyval.$ = vstack[vstack.length - len];
815
+ yyval._$ = {
816
+ first_line: lstack[lstack.length - (len || 1)].first_line,
817
+ last_line: lstack[lstack.length - 1].last_line,
818
+ first_column: lstack[lstack.length - (len || 1)].first_column,
819
+ last_column: lstack[lstack.length - 1].last_column
820
+ };
821
+ if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
822
+ r = this.performAction.apply(yyval, [
823
+ yytext,
824
+ yyleng,
825
+ yylineno,
826
+ sharedState.yy,
827
+ action[1],
828
+ vstack,
829
+ lstack
830
+ ].concat(args));
831
+ if (typeof r !== "undefined") return r;
832
+ if (len) {
833
+ stack = stack.slice(0, -1 * len * 2);
834
+ vstack = vstack.slice(0, -1 * len);
835
+ lstack = lstack.slice(0, -1 * len);
836
+ }
837
+ stack.push(this.productions_[action[1]][0]);
838
+ vstack.push(yyval.$);
839
+ lstack.push(yyval._$);
840
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
841
+ stack.push(newState);
842
+ break;
843
+ case 3: return true;
844
+ }
845
+ }
846
+ return true;
847
+ }, "parse")
848
+ };
849
+ parser2.lexer = /* @__PURE__ */ (function() {
850
+ return {
851
+ EOF: 1,
852
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
853
+ if (this.yy.parser) this.yy.parser.parseError(str, hash);
854
+ else throw new Error(str);
855
+ }, "parseError"),
856
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
857
+ this.yy = yy || this.yy || {};
858
+ this._input = input;
859
+ this._more = this._backtrack = this.done = false;
860
+ this.yylineno = this.yyleng = 0;
861
+ this.yytext = this.matched = this.match = "";
862
+ this.conditionStack = ["INITIAL"];
863
+ this.yylloc = {
864
+ first_line: 1,
865
+ first_column: 0,
866
+ last_line: 1,
867
+ last_column: 0
868
+ };
869
+ if (this.options.ranges) this.yylloc.range = [0, 0];
870
+ this.offset = 0;
871
+ return this;
872
+ }, "setInput"),
873
+ input: /* @__PURE__ */ __name(function() {
874
+ var ch = this._input[0];
875
+ this.yytext += ch;
876
+ this.yyleng++;
877
+ this.offset++;
878
+ this.match += ch;
879
+ this.matched += ch;
880
+ if (ch.match(/(?:\r\n?|\n).*/g)) {
881
+ this.yylineno++;
882
+ this.yylloc.last_line++;
883
+ } else this.yylloc.last_column++;
884
+ if (this.options.ranges) this.yylloc.range[1]++;
885
+ this._input = this._input.slice(1);
886
+ return ch;
887
+ }, "input"),
888
+ unput: /* @__PURE__ */ __name(function(ch) {
889
+ var len = ch.length;
890
+ var lines = ch.split(/(?:\r\n?|\n)/g);
891
+ this._input = ch + this._input;
892
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
893
+ this.offset -= len;
894
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
895
+ this.match = this.match.substr(0, this.match.length - 1);
896
+ this.matched = this.matched.substr(0, this.matched.length - 1);
897
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
898
+ var r = this.yylloc.range;
899
+ this.yylloc = {
900
+ first_line: this.yylloc.first_line,
901
+ last_line: this.yylineno + 1,
902
+ first_column: this.yylloc.first_column,
903
+ 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
904
+ };
905
+ if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
906
+ this.yyleng = this.yytext.length;
907
+ return this;
908
+ }, "unput"),
909
+ more: /* @__PURE__ */ __name(function() {
910
+ this._more = true;
911
+ return this;
912
+ }, "more"),
913
+ reject: /* @__PURE__ */ __name(function() {
914
+ if (this.options.backtrack_lexer) this._backtrack = true;
915
+ else 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(), {
916
+ text: "",
917
+ token: null,
918
+ line: this.yylineno
919
+ });
920
+ return this;
921
+ }, "reject"),
922
+ less: /* @__PURE__ */ __name(function(n) {
923
+ this.unput(this.match.slice(n));
924
+ }, "less"),
925
+ pastInput: /* @__PURE__ */ __name(function() {
926
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
927
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
928
+ }, "pastInput"),
929
+ upcomingInput: /* @__PURE__ */ __name(function() {
930
+ var next = this.match;
931
+ if (next.length < 20) next += this._input.substr(0, 20 - next.length);
932
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
933
+ }, "upcomingInput"),
934
+ showPosition: /* @__PURE__ */ __name(function() {
935
+ var pre = this.pastInput();
936
+ var c = new Array(pre.length + 1).join("-");
937
+ return pre + this.upcomingInput() + "\n" + c + "^";
938
+ }, "showPosition"),
939
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
940
+ var token, lines, backup;
941
+ if (this.options.backtrack_lexer) {
942
+ backup = {
943
+ yylineno: this.yylineno,
944
+ yylloc: {
945
+ first_line: this.yylloc.first_line,
946
+ last_line: this.last_line,
947
+ first_column: this.yylloc.first_column,
948
+ last_column: this.yylloc.last_column
949
+ },
950
+ yytext: this.yytext,
951
+ match: this.match,
952
+ matches: this.matches,
953
+ matched: this.matched,
954
+ yyleng: this.yyleng,
955
+ offset: this.offset,
956
+ _more: this._more,
957
+ _input: this._input,
958
+ yy: this.yy,
959
+ conditionStack: this.conditionStack.slice(0),
960
+ done: this.done
961
+ };
962
+ if (this.options.ranges) backup.yylloc.range = this.yylloc.range.slice(0);
963
+ }
964
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
965
+ if (lines) this.yylineno += lines.length;
966
+ this.yylloc = {
967
+ first_line: this.yylloc.last_line,
968
+ last_line: this.yylineno + 1,
969
+ first_column: this.yylloc.last_column,
970
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
971
+ };
972
+ this.yytext += match[0];
973
+ this.match += match[0];
974
+ this.matches = match;
975
+ this.yyleng = this.yytext.length;
976
+ if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
977
+ this._more = false;
978
+ this._backtrack = false;
979
+ this._input = this._input.slice(match[0].length);
980
+ this.matched += match[0];
981
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
982
+ if (this.done && this._input) this.done = false;
983
+ if (token) return token;
984
+ else if (this._backtrack) {
985
+ for (var k in backup) this[k] = backup[k];
986
+ return false;
987
+ }
988
+ return false;
989
+ }, "test_match"),
990
+ next: /* @__PURE__ */ __name(function() {
991
+ if (this.done) return this.EOF;
992
+ if (!this._input) this.done = true;
993
+ var token, match, tempMatch, index;
994
+ if (!this._more) {
995
+ this.yytext = "";
996
+ this.match = "";
997
+ }
998
+ var rules = this._currentRules();
999
+ for (var i = 0; i < rules.length; i++) {
1000
+ tempMatch = this._input.match(this.rules[rules[i]]);
1001
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1002
+ match = tempMatch;
1003
+ index = i;
1004
+ if (this.options.backtrack_lexer) {
1005
+ token = this.test_match(tempMatch, rules[i]);
1006
+ if (token !== false) return token;
1007
+ else if (this._backtrack) {
1008
+ match = false;
1009
+ continue;
1010
+ } else return false;
1011
+ } else if (!this.options.flex) break;
1012
+ }
1013
+ }
1014
+ if (match) {
1015
+ token = this.test_match(match, rules[index]);
1016
+ if (token !== false) return token;
1017
+ return false;
1018
+ }
1019
+ if (this._input === "") return this.EOF;
1020
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1021
+ text: "",
1022
+ token: null,
1023
+ line: this.yylineno
1024
+ });
1025
+ }, "next"),
1026
+ lex: /* @__PURE__ */ __name(function lex() {
1027
+ var r = this.next();
1028
+ if (r) return r;
1029
+ else return this.lex();
1030
+ }, "lex"),
1031
+ begin: /* @__PURE__ */ __name(function begin(condition) {
1032
+ this.conditionStack.push(condition);
1033
+ }, "begin"),
1034
+ popState: /* @__PURE__ */ __name(function popState() {
1035
+ if (this.conditionStack.length - 1 > 0) return this.conditionStack.pop();
1036
+ else return this.conditionStack[0];
1037
+ }, "popState"),
1038
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
1039
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1040
+ else return this.conditions["INITIAL"].rules;
1041
+ }, "_currentRules"),
1042
+ topState: /* @__PURE__ */ __name(function topState(n) {
1043
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1044
+ if (n >= 0) return this.conditionStack[n];
1045
+ else return "INITIAL";
1046
+ }, "topState"),
1047
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
1048
+ this.begin(condition);
1049
+ }, "pushState"),
1050
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
1051
+ return this.conditionStack.length;
1052
+ }, "stateStackSize"),
1053
+ options: { "case-insensitive": true },
1054
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1055
+ switch ($avoiding_name_collisions) {
1056
+ case 0: break;
1057
+ case 1: break;
1058
+ case 2:
1059
+ this.popState();
1060
+ return 36;
1061
+ case 3:
1062
+ this.popState();
1063
+ return 36;
1064
+ case 4: return 36;
1065
+ case 5: break;
1066
+ case 6: return 10;
1067
+ case 7:
1068
+ this.pushState("acc_title");
1069
+ return 19;
1070
+ case 8:
1071
+ this.popState();
1072
+ return "acc_title_value";
1073
+ case 9:
1074
+ this.pushState("acc_descr");
1075
+ return 21;
1076
+ case 10:
1077
+ this.popState();
1078
+ return "acc_descr_value";
1079
+ case 11:
1080
+ this.pushState("acc_descr_multiline");
1081
+ break;
1082
+ case 12:
1083
+ this.popState();
1084
+ break;
1085
+ case 13: return "acc_descr_multiline_value";
1086
+ case 14: return 5;
1087
+ case 15: return 5;
1088
+ case 16: return 8;
1089
+ case 17:
1090
+ this.pushState("axis_data");
1091
+ return "X_AXIS";
1092
+ case 18:
1093
+ this.pushState("axis_data");
1094
+ return "Y_AXIS";
1095
+ case 19:
1096
+ this.pushState("axis_band_data");
1097
+ return 24;
1098
+ case 20: return 33;
1099
+ case 21:
1100
+ this.pushState("data");
1101
+ return 16;
1102
+ case 22:
1103
+ this.pushState("data");
1104
+ return 18;
1105
+ case 23:
1106
+ this.pushState("data_inner");
1107
+ return 24;
1108
+ case 24: return 29;
1109
+ case 25:
1110
+ this.popState();
1111
+ return 26;
1112
+ case 26:
1113
+ this.popState();
1114
+ break;
1115
+ case 27:
1116
+ this.pushState("string");
1117
+ break;
1118
+ case 28:
1119
+ this.popState();
1120
+ break;
1121
+ case 29: return "STR";
1122
+ case 30: return 24;
1123
+ case 31: return 26;
1124
+ case 32: return 44;
1125
+ case 33: return "COLON";
1126
+ case 34: return 45;
1127
+ case 35: return 28;
1128
+ case 36: return 46;
1129
+ case 37: return 47;
1130
+ case 38: return 49;
1131
+ case 39: return 51;
1132
+ case 40: return 48;
1133
+ case 41: return 42;
1134
+ case 42: return 50;
1135
+ case 43: return 43;
1136
+ case 44: break;
1137
+ case 45: return 37;
1138
+ case 46: return 38;
1139
+ }
1140
+ }, "anonymous"),
1141
+ rules: [
1142
+ /^(?:%%(?!\{)[^\n]*)/i,
1143
+ /^(?:[^\}]%%[^\n]*)/i,
1144
+ /^(?:(\r?\n))/i,
1145
+ /^(?:(\r?\n))/i,
1146
+ /^(?:[\n\r]+)/i,
1147
+ /^(?:%%[^\n]*)/i,
1148
+ /^(?:title\b)/i,
1149
+ /^(?:accTitle\s*:\s*)/i,
1150
+ /^(?:(?!\n||)*[^\n]*)/i,
1151
+ /^(?:accDescr\s*:\s*)/i,
1152
+ /^(?:(?!\n||)*[^\n]*)/i,
1153
+ /^(?:accDescr\s*\{\s*)/i,
1154
+ /^(?:\})/i,
1155
+ /^(?:[^\}]*)/i,
1156
+ /^(?:xychart-beta\b)/i,
1157
+ /^(?:xychart\b)/i,
1158
+ /^(?:(?:vertical|horizontal))/i,
1159
+ /^(?:x-axis\b)/i,
1160
+ /^(?:y-axis\b)/i,
1161
+ /^(?:\[)/i,
1162
+ /^(?:-->)/i,
1163
+ /^(?:line\b)/i,
1164
+ /^(?:bar\b)/i,
1165
+ /^(?:\[)/i,
1166
+ /^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,
1167
+ /^(?:\])/i,
1168
+ /^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,
1169
+ /^(?:["])/i,
1170
+ /^(?:["])/i,
1171
+ /^(?:[^"]*)/i,
1172
+ /^(?:\[)/i,
1173
+ /^(?:\])/i,
1174
+ /^(?:[A-Za-z]+)/i,
1175
+ /^(?::)/i,
1176
+ /^(?:\+)/i,
1177
+ /^(?:,)/i,
1178
+ /^(?:=)/i,
1179
+ /^(?:\*)/i,
1180
+ /^(?:#)/i,
1181
+ /^(?:[\_])/i,
1182
+ /^(?:\.)/i,
1183
+ /^(?:&)/i,
1184
+ /^(?:-)/i,
1185
+ /^(?:[0-9]+)/i,
1186
+ /^(?:\s+)/i,
1187
+ /^(?:;)/i,
1188
+ /^(?:$)/i
1189
+ ],
1190
+ conditions: {
1191
+ "data_inner": {
1192
+ "rules": [
1193
+ 0,
1194
+ 1,
1195
+ 4,
1196
+ 5,
1197
+ 6,
1198
+ 7,
1199
+ 9,
1200
+ 11,
1201
+ 14,
1202
+ 15,
1203
+ 16,
1204
+ 17,
1205
+ 18,
1206
+ 21,
1207
+ 22,
1208
+ 24,
1209
+ 25,
1210
+ 26,
1211
+ 27,
1212
+ 30,
1213
+ 31,
1214
+ 32,
1215
+ 33,
1216
+ 34,
1217
+ 35,
1218
+ 36,
1219
+ 37,
1220
+ 38,
1221
+ 39,
1222
+ 40,
1223
+ 41,
1224
+ 42,
1225
+ 43,
1226
+ 44,
1227
+ 45,
1228
+ 46
1229
+ ],
1230
+ "inclusive": true
1231
+ },
1232
+ "data": {
1233
+ "rules": [
1234
+ 0,
1235
+ 1,
1236
+ 3,
1237
+ 4,
1238
+ 5,
1239
+ 6,
1240
+ 7,
1241
+ 9,
1242
+ 11,
1243
+ 14,
1244
+ 15,
1245
+ 16,
1246
+ 17,
1247
+ 18,
1248
+ 21,
1249
+ 22,
1250
+ 23,
1251
+ 26,
1252
+ 27,
1253
+ 30,
1254
+ 31,
1255
+ 32,
1256
+ 33,
1257
+ 34,
1258
+ 35,
1259
+ 36,
1260
+ 37,
1261
+ 38,
1262
+ 39,
1263
+ 40,
1264
+ 41,
1265
+ 42,
1266
+ 43,
1267
+ 44,
1268
+ 45,
1269
+ 46
1270
+ ],
1271
+ "inclusive": true
1272
+ },
1273
+ "axis_band_data": {
1274
+ "rules": [
1275
+ 0,
1276
+ 1,
1277
+ 4,
1278
+ 5,
1279
+ 6,
1280
+ 7,
1281
+ 9,
1282
+ 11,
1283
+ 14,
1284
+ 15,
1285
+ 16,
1286
+ 17,
1287
+ 18,
1288
+ 21,
1289
+ 22,
1290
+ 25,
1291
+ 26,
1292
+ 27,
1293
+ 30,
1294
+ 31,
1295
+ 32,
1296
+ 33,
1297
+ 34,
1298
+ 35,
1299
+ 36,
1300
+ 37,
1301
+ 38,
1302
+ 39,
1303
+ 40,
1304
+ 41,
1305
+ 42,
1306
+ 43,
1307
+ 44,
1308
+ 45,
1309
+ 46
1310
+ ],
1311
+ "inclusive": true
1312
+ },
1313
+ "axis_data": {
1314
+ "rules": [
1315
+ 0,
1316
+ 1,
1317
+ 2,
1318
+ 4,
1319
+ 5,
1320
+ 6,
1321
+ 7,
1322
+ 9,
1323
+ 11,
1324
+ 14,
1325
+ 15,
1326
+ 16,
1327
+ 17,
1328
+ 18,
1329
+ 19,
1330
+ 20,
1331
+ 21,
1332
+ 22,
1333
+ 24,
1334
+ 26,
1335
+ 27,
1336
+ 30,
1337
+ 31,
1338
+ 32,
1339
+ 33,
1340
+ 34,
1341
+ 35,
1342
+ 36,
1343
+ 37,
1344
+ 38,
1345
+ 39,
1346
+ 40,
1347
+ 41,
1348
+ 42,
1349
+ 43,
1350
+ 44,
1351
+ 45,
1352
+ 46
1353
+ ],
1354
+ "inclusive": true
1355
+ },
1356
+ "acc_descr_multiline": {
1357
+ "rules": [12, 13],
1358
+ "inclusive": false
1359
+ },
1360
+ "acc_descr": {
1361
+ "rules": [10],
1362
+ "inclusive": false
1363
+ },
1364
+ "acc_title": {
1365
+ "rules": [8],
1366
+ "inclusive": false
1367
+ },
1368
+ "title": {
1369
+ "rules": [],
1370
+ "inclusive": false
1371
+ },
1372
+ "md_string": {
1373
+ "rules": [],
1374
+ "inclusive": false
1375
+ },
1376
+ "string": {
1377
+ "rules": [28, 29],
1378
+ "inclusive": false
1379
+ },
1380
+ "INITIAL": {
1381
+ "rules": [
1382
+ 0,
1383
+ 1,
1384
+ 4,
1385
+ 5,
1386
+ 6,
1387
+ 7,
1388
+ 9,
1389
+ 11,
1390
+ 14,
1391
+ 15,
1392
+ 16,
1393
+ 17,
1394
+ 18,
1395
+ 21,
1396
+ 22,
1397
+ 26,
1398
+ 27,
1399
+ 30,
1400
+ 31,
1401
+ 32,
1402
+ 33,
1403
+ 34,
1404
+ 35,
1405
+ 36,
1406
+ 37,
1407
+ 38,
1408
+ 39,
1409
+ 40,
1410
+ 41,
1411
+ 42,
1412
+ 43,
1413
+ 44,
1414
+ 45,
1415
+ 46
1416
+ ],
1417
+ "inclusive": true
1418
+ }
1419
+ }
1420
+ };
1421
+ })();
1422
+ function Parser() {
1423
+ this.yy = {};
1424
+ }
1425
+ __name(Parser, "Parser");
1426
+ Parser.prototype = parser2;
1427
+ parser2.Parser = Parser;
1428
+ return new Parser();
1429
+ })();
1430
+ parser.parser = parser;
1431
+ var xychart_default = parser;
1432
+ function isBarPlot(data) {
1433
+ return data.type === "bar";
1434
+ }
1435
+ __name(isBarPlot, "isBarPlot");
1436
+ function isBandAxisData(data) {
1437
+ return data.type === "band";
1438
+ }
1439
+ __name(isBandAxisData, "isBandAxisData");
1440
+ function isLinearAxisData(data) {
1441
+ return data.type === "linear";
1442
+ }
1443
+ __name(isLinearAxisData, "isLinearAxisData");
1444
+ var TextDimensionCalculatorWithFont = class {
1445
+ constructor(parentGroup) {
1446
+ this.parentGroup = parentGroup;
1447
+ }
1448
+ static {
1449
+ __name(this, "TextDimensionCalculatorWithFont");
1450
+ }
1451
+ getMaxDimension(texts, fontSize) {
1452
+ if (!this.parentGroup) return {
1453
+ width: texts.reduce((acc, cur) => Math.max(cur.length, acc), 0) * fontSize,
1454
+ height: fontSize
1455
+ };
1456
+ const dimension = {
1457
+ width: 0,
1458
+ height: 0
1459
+ };
1460
+ const elem = this.parentGroup.append("g").attr("visibility", "hidden").attr("font-size", fontSize);
1461
+ for (const t of texts) {
1462
+ const bbox = computeDimensionOfText(elem, 1, t);
1463
+ const width = bbox ? bbox.width : t.length * fontSize;
1464
+ const height = bbox ? bbox.height : fontSize;
1465
+ dimension.width = Math.max(dimension.width, width);
1466
+ dimension.height = Math.max(dimension.height, height);
1467
+ }
1468
+ elem.remove();
1469
+ return dimension;
1470
+ }
1471
+ };
1472
+ var BAR_WIDTH_TO_TICK_WIDTH_RATIO = .7;
1473
+ var MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL = .2;
1474
+ var BaseAxis = class {
1475
+ constructor(axisConfig, title, textDimensionCalculator, axisThemeConfig) {
1476
+ this.axisConfig = axisConfig;
1477
+ this.title = title;
1478
+ this.textDimensionCalculator = textDimensionCalculator;
1479
+ this.axisThemeConfig = axisThemeConfig;
1480
+ this.boundingRect = {
1481
+ x: 0,
1482
+ y: 0,
1483
+ width: 0,
1484
+ height: 0
1485
+ };
1486
+ this.axisPosition = "left";
1487
+ this.showTitle = false;
1488
+ this.showLabel = false;
1489
+ this.showTick = false;
1490
+ this.showAxisLine = false;
1491
+ this.outerPadding = 0;
1492
+ this.titleTextHeight = 0;
1493
+ this.labelTextHeight = 0;
1494
+ this.normalizedLabelRotationInRad = 0;
1495
+ this.range = [0, 10];
1496
+ this.boundingRect = {
1497
+ x: 0,
1498
+ y: 0,
1499
+ width: 0,
1500
+ height: 0
1501
+ };
1502
+ this.axisPosition = "left";
1503
+ this.normalizedLabelRotationInRad = this.axisConfig.labelRotation >= -90 && this.axisConfig.labelRotation <= 90 ? this.axisConfig.labelRotation * Math.PI / 180 : 0;
1504
+ }
1505
+ static {
1506
+ __name(this, "BaseAxis");
1507
+ }
1508
+ setRange(range) {
1509
+ this.range = range;
1510
+ if (this.axisPosition === "left" || this.axisPosition === "right") this.boundingRect.height = range[1] - range[0];
1511
+ else this.boundingRect.width = range[1] - range[0];
1512
+ this.recalculateScale();
1513
+ }
1514
+ getRange() {
1515
+ return [this.range[0] + this.outerPadding, this.range[1] - this.outerPadding];
1516
+ }
1517
+ setAxisPosition(axisPosition) {
1518
+ this.axisPosition = axisPosition;
1519
+ this.setRange(this.range);
1520
+ }
1521
+ getTickDistance() {
1522
+ const range = this.getRange();
1523
+ return Math.abs(range[0] - range[1]) / this.getTickValues().length;
1524
+ }
1525
+ getAxisOuterPadding() {
1526
+ return this.outerPadding;
1527
+ }
1528
+ getLabelDimension() {
1529
+ return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((tick) => tick.toString()), this.axisConfig.labelFontSize);
1530
+ }
1531
+ recalculateOuterPaddingToDrawBar() {
1532
+ if (BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() > this.outerPadding * 2) this.outerPadding = Math.floor(BAR_WIDTH_TO_TICK_WIDTH_RATIO * this.getTickDistance() / 2);
1533
+ this.recalculateScale();
1534
+ }
1535
+ calculateSpaceIfDrawnHorizontally(availableSpace) {
1536
+ let availableHeight = availableSpace.height;
1537
+ if (this.axisConfig.showAxisLine && availableHeight > this.axisConfig.axisLineWidth) {
1538
+ availableHeight -= this.axisConfig.axisLineWidth;
1539
+ this.showAxisLine = true;
1540
+ }
1541
+ if (this.axisConfig.showLabel) {
1542
+ const spaceRequired = this.getLabelDimension();
1543
+ const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.width;
1544
+ this.outerPadding = Math.min(spaceRequired.width / 2, maxPadding);
1545
+ let heightRequired = spaceRequired.height;
1546
+ if (this.axisPosition === "bottom" && this.normalizedLabelRotationInRad !== 0) heightRequired = Math.max(heightRequired, Math.abs(Math.sin(this.normalizedLabelRotationInRad) * spaceRequired.width) + Math.abs(Math.cos(this.normalizedLabelRotationInRad) * spaceRequired.height));
1547
+ heightRequired += this.axisConfig.labelPadding * 2;
1548
+ this.labelTextHeight = spaceRequired.height;
1549
+ if (heightRequired <= availableHeight) {
1550
+ availableHeight -= heightRequired;
1551
+ this.showLabel = true;
1552
+ }
1553
+ }
1554
+ if (this.axisConfig.showTick && availableHeight >= this.axisConfig.tickLength) {
1555
+ this.showTick = true;
1556
+ availableHeight -= this.axisConfig.tickLength;
1557
+ }
1558
+ if (this.axisConfig.showTitle && this.title) {
1559
+ const spaceRequired = this.textDimensionCalculator.getMaxDimension([this.title], this.axisConfig.titleFontSize);
1560
+ const heightRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
1561
+ this.titleTextHeight = spaceRequired.height;
1562
+ if (heightRequired <= availableHeight) {
1563
+ availableHeight -= heightRequired;
1564
+ this.showTitle = true;
1565
+ }
1566
+ }
1567
+ this.boundingRect.width = availableSpace.width;
1568
+ this.boundingRect.height = availableSpace.height - availableHeight;
1569
+ }
1570
+ calculateSpaceIfDrawnVertical(availableSpace) {
1571
+ let availableWidth = availableSpace.width;
1572
+ if (this.axisConfig.showAxisLine && availableWidth > this.axisConfig.axisLineWidth) {
1573
+ availableWidth -= this.axisConfig.axisLineWidth;
1574
+ this.showAxisLine = true;
1575
+ }
1576
+ if (this.axisConfig.showLabel) {
1577
+ const spaceRequired = this.getLabelDimension();
1578
+ const maxPadding = MAX_OUTER_PADDING_PERCENT_FOR_WRT_LABEL * availableSpace.height;
1579
+ this.outerPadding = Math.min(spaceRequired.height / 2, maxPadding);
1580
+ const widthRequired = spaceRequired.width + this.axisConfig.labelPadding * 2;
1581
+ if (widthRequired <= availableWidth) {
1582
+ availableWidth -= widthRequired;
1583
+ this.showLabel = true;
1584
+ }
1585
+ }
1586
+ if (this.axisConfig.showTick && availableWidth >= this.axisConfig.tickLength) {
1587
+ this.showTick = true;
1588
+ availableWidth -= this.axisConfig.tickLength;
1589
+ }
1590
+ if (this.axisConfig.showTitle && this.title) {
1591
+ const spaceRequired = this.textDimensionCalculator.getMaxDimension([this.title], this.axisConfig.titleFontSize);
1592
+ const widthRequired = spaceRequired.height + this.axisConfig.titlePadding * 2;
1593
+ this.titleTextHeight = spaceRequired.height;
1594
+ if (widthRequired <= availableWidth) {
1595
+ availableWidth -= widthRequired;
1596
+ this.showTitle = true;
1597
+ }
1598
+ }
1599
+ this.boundingRect.width = availableSpace.width - availableWidth;
1600
+ this.boundingRect.height = availableSpace.height;
1601
+ }
1602
+ calculateSpace(availableSpace) {
1603
+ if (this.axisPosition === "left" || this.axisPosition === "right") this.calculateSpaceIfDrawnVertical(availableSpace);
1604
+ else this.calculateSpaceIfDrawnHorizontally(availableSpace);
1605
+ this.recalculateScale();
1606
+ return {
1607
+ width: this.boundingRect.width,
1608
+ height: this.boundingRect.height
1609
+ };
1610
+ }
1611
+ setBoundingBoxXY(point) {
1612
+ this.boundingRect.x = point.x;
1613
+ this.boundingRect.y = point.y;
1614
+ }
1615
+ calculateOffsetByRotation(reference) {
1616
+ const rotation = this.normalizedLabelRotationInRad;
1617
+ if (rotation === 0) return 0;
1618
+ return Math.sin(rotation) * this.getLabelDimension()[reference] / 2;
1619
+ }
1620
+ getDrawableElementsForLeftAxis() {
1621
+ const drawableElement = [];
1622
+ if (this.showAxisLine) {
1623
+ const x = this.boundingRect.x + this.boundingRect.width - this.axisConfig.axisLineWidth / 2;
1624
+ drawableElement.push({
1625
+ type: "path",
1626
+ groupTexts: ["left-axis", "axisl-line"],
1627
+ data: [{
1628
+ path: `M ${x},${this.boundingRect.y} L ${x},${this.boundingRect.y + this.boundingRect.height} `,
1629
+ strokeFill: this.axisThemeConfig.axisLineColor,
1630
+ strokeWidth: this.axisConfig.axisLineWidth
1631
+ }]
1632
+ });
1633
+ }
1634
+ if (this.showLabel) drawableElement.push({
1635
+ type: "text",
1636
+ groupTexts: ["left-axis", "label"],
1637
+ data: this.getTickValues().map((tick) => ({
1638
+ text: tick.toString(),
1639
+ 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),
1640
+ y: this.getScaleValue(tick),
1641
+ fill: this.axisThemeConfig.labelColor,
1642
+ fontSize: this.axisConfig.labelFontSize,
1643
+ rotation: 0,
1644
+ verticalPos: "middle",
1645
+ horizontalPos: "right"
1646
+ }))
1647
+ });
1648
+ if (this.showTick) {
1649
+ const x = this.boundingRect.x + this.boundingRect.width - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
1650
+ drawableElement.push({
1651
+ type: "path",
1652
+ groupTexts: ["left-axis", "ticks"],
1653
+ data: this.getTickValues().map((tick) => ({
1654
+ path: `M ${x},${this.getScaleValue(tick)} L ${x - this.axisConfig.tickLength},${this.getScaleValue(tick)}`,
1655
+ strokeFill: this.axisThemeConfig.tickColor,
1656
+ strokeWidth: this.axisConfig.tickWidth
1657
+ }))
1658
+ });
1659
+ }
1660
+ if (this.showTitle) drawableElement.push({
1661
+ type: "text",
1662
+ groupTexts: ["left-axis", "title"],
1663
+ data: [{
1664
+ text: this.title,
1665
+ x: this.boundingRect.x + this.axisConfig.titlePadding,
1666
+ y: this.boundingRect.y + this.boundingRect.height / 2,
1667
+ fill: this.axisThemeConfig.titleColor,
1668
+ fontSize: this.axisConfig.titleFontSize,
1669
+ rotation: 270,
1670
+ verticalPos: "top",
1671
+ horizontalPos: "center"
1672
+ }]
1673
+ });
1674
+ return drawableElement;
1675
+ }
1676
+ getDrawableElementsForBottomAxis() {
1677
+ const drawableElement = [];
1678
+ if (this.showAxisLine) {
1679
+ const y = this.boundingRect.y + this.axisConfig.axisLineWidth / 2;
1680
+ drawableElement.push({
1681
+ type: "path",
1682
+ groupTexts: ["bottom-axis", "axis-line"],
1683
+ data: [{
1684
+ path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1685
+ strokeFill: this.axisThemeConfig.axisLineColor,
1686
+ strokeWidth: this.axisConfig.axisLineWidth
1687
+ }]
1688
+ });
1689
+ }
1690
+ if (this.showLabel) drawableElement.push({
1691
+ type: "text",
1692
+ groupTexts: ["bottom-axis", "label"],
1693
+ data: this.getTickValues().map((tick) => ({
1694
+ text: tick.toString(),
1695
+ x: this.getScaleValue(tick) + this.calculateOffsetByRotation("height"),
1696
+ y: this.boundingRect.y + this.axisConfig.labelPadding + (this.showTick ? this.axisConfig.tickLength : 0) + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0) + Math.abs(this.calculateOffsetByRotation("width")),
1697
+ fill: this.axisThemeConfig.labelColor,
1698
+ fontSize: this.axisConfig.labelFontSize,
1699
+ rotation: this.normalizedLabelRotationInRad * 180 / Math.PI,
1700
+ verticalPos: "top",
1701
+ horizontalPos: "center"
1702
+ }))
1703
+ });
1704
+ if (this.showTick) {
1705
+ const y = this.boundingRect.y + (this.showAxisLine ? this.axisConfig.axisLineWidth : 0);
1706
+ drawableElement.push({
1707
+ type: "path",
1708
+ groupTexts: ["bottom-axis", "ticks"],
1709
+ data: this.getTickValues().map((tick) => ({
1710
+ path: `M ${this.getScaleValue(tick)},${y} L ${this.getScaleValue(tick)},${y + this.axisConfig.tickLength}`,
1711
+ strokeFill: this.axisThemeConfig.tickColor,
1712
+ strokeWidth: this.axisConfig.tickWidth
1713
+ }))
1714
+ });
1715
+ }
1716
+ if (this.showTitle) drawableElement.push({
1717
+ type: "text",
1718
+ groupTexts: ["bottom-axis", "title"],
1719
+ data: [{
1720
+ text: this.title,
1721
+ x: this.range[0] + (this.range[1] - this.range[0]) / 2,
1722
+ y: this.boundingRect.y + this.boundingRect.height - this.axisConfig.titlePadding - this.titleTextHeight,
1723
+ fill: this.axisThemeConfig.titleColor,
1724
+ fontSize: this.axisConfig.titleFontSize,
1725
+ rotation: 0,
1726
+ verticalPos: "top",
1727
+ horizontalPos: "center"
1728
+ }]
1729
+ });
1730
+ return drawableElement;
1731
+ }
1732
+ getDrawableElementsForTopAxis() {
1733
+ const drawableElement = [];
1734
+ if (this.showAxisLine) {
1735
+ const y = this.boundingRect.y + this.boundingRect.height - this.axisConfig.axisLineWidth / 2;
1736
+ drawableElement.push({
1737
+ type: "path",
1738
+ groupTexts: ["top-axis", "axis-line"],
1739
+ data: [{
1740
+ path: `M ${this.boundingRect.x},${y} L ${this.boundingRect.x + this.boundingRect.width},${y}`,
1741
+ strokeFill: this.axisThemeConfig.axisLineColor,
1742
+ strokeWidth: this.axisConfig.axisLineWidth
1743
+ }]
1744
+ });
1745
+ }
1746
+ if (this.showLabel) drawableElement.push({
1747
+ type: "text",
1748
+ groupTexts: ["top-axis", "label"],
1749
+ data: this.getTickValues().map((tick) => ({
1750
+ text: tick.toString(),
1751
+ x: this.getScaleValue(tick),
1752
+ y: this.boundingRect.y + (this.showTitle ? this.titleTextHeight + this.axisConfig.titlePadding * 2 : 0) + this.axisConfig.labelPadding,
1753
+ fill: this.axisThemeConfig.labelColor,
1754
+ fontSize: this.axisConfig.labelFontSize,
1755
+ rotation: 0,
1756
+ verticalPos: "top",
1757
+ horizontalPos: "center"
1758
+ }))
1759
+ });
1760
+ if (this.showTick) {
1761
+ const y = this.boundingRect.y;
1762
+ drawableElement.push({
1763
+ type: "path",
1764
+ groupTexts: ["top-axis", "ticks"],
1765
+ data: this.getTickValues().map((tick) => ({
1766
+ path: `M ${this.getScaleValue(tick)},${y + this.boundingRect.height - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)} L ${this.getScaleValue(tick)},${y + this.boundingRect.height - this.axisConfig.tickLength - (this.showAxisLine ? this.axisConfig.axisLineWidth : 0)}`,
1767
+ strokeFill: this.axisThemeConfig.tickColor,
1768
+ strokeWidth: this.axisConfig.tickWidth
1769
+ }))
1770
+ });
1771
+ }
1772
+ if (this.showTitle) drawableElement.push({
1773
+ type: "text",
1774
+ groupTexts: ["top-axis", "title"],
1775
+ data: [{
1776
+ text: this.title,
1777
+ x: this.boundingRect.x + this.boundingRect.width / 2,
1778
+ y: this.boundingRect.y + this.axisConfig.titlePadding,
1779
+ fill: this.axisThemeConfig.titleColor,
1780
+ fontSize: this.axisConfig.titleFontSize,
1781
+ rotation: 0,
1782
+ verticalPos: "top",
1783
+ horizontalPos: "center"
1784
+ }]
1785
+ });
1786
+ return drawableElement;
1787
+ }
1788
+ getDrawableElements() {
1789
+ if (this.axisPosition === "left") return this.getDrawableElementsForLeftAxis();
1790
+ if (this.axisPosition === "right") throw Error("Drawing of right axis is not implemented");
1791
+ if (this.axisPosition === "bottom") return this.getDrawableElementsForBottomAxis();
1792
+ if (this.axisPosition === "top") return this.getDrawableElementsForTopAxis();
1793
+ return [];
1794
+ }
1795
+ };
1796
+ var BandAxis = class extends BaseAxis {
1797
+ static {
1798
+ __name(this, "BandAxis");
1799
+ }
1800
+ constructor(axisConfig, axisThemeConfig, categories, title, textDimensionCalculator) {
1801
+ super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1802
+ this.categories = categories;
1803
+ this.scale = band().domain(this.categories).range(this.getRange());
1804
+ }
1805
+ setRange(range) {
1806
+ super.setRange(range);
1807
+ }
1808
+ recalculateScale() {
1809
+ this.scale = band().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5);
1810
+ log.trace("BandAxis axis final categories, range: ", this.categories, this.getRange());
1811
+ }
1812
+ getTickValues() {
1813
+ return this.categories;
1814
+ }
1815
+ getScaleValue(value) {
1816
+ return this.scale(value) ?? this.getRange()[0];
1817
+ }
1818
+ };
1819
+ var LinearAxis = class extends BaseAxis {
1820
+ static {
1821
+ __name(this, "LinearAxis");
1822
+ }
1823
+ constructor(axisConfig, axisThemeConfig, domain, title, textDimensionCalculator) {
1824
+ super(axisConfig, title, textDimensionCalculator, axisThemeConfig);
1825
+ this.domain = domain;
1826
+ this.scale = linear().domain(this.domain).range(this.getRange());
1827
+ }
1828
+ getTickValues() {
1829
+ return this.scale.ticks();
1830
+ }
1831
+ recalculateScale() {
1832
+ const domain = [...this.domain];
1833
+ if (this.axisPosition === "left") domain.reverse();
1834
+ this.scale = linear().domain(domain).range(this.getRange());
1835
+ }
1836
+ getScaleValue(value) {
1837
+ return this.scale(value);
1838
+ }
1839
+ };
1840
+ function getAxis(data, axisConfig, axisThemeConfig, tmpSVGGroup2) {
1841
+ const textDimensionCalculator = new TextDimensionCalculatorWithFont(tmpSVGGroup2);
1842
+ if (isBandAxisData(data)) return new BandAxis(axisConfig, axisThemeConfig, data.categories, data.title, textDimensionCalculator);
1843
+ return new LinearAxis(axisConfig, axisThemeConfig, [data.min, data.max], data.title, textDimensionCalculator);
1844
+ }
1845
+ __name(getAxis, "getAxis");
1846
+ var ChartTitle = class {
1847
+ constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) {
1848
+ this.textDimensionCalculator = textDimensionCalculator;
1849
+ this.chartConfig = chartConfig;
1850
+ this.chartData = chartData;
1851
+ this.chartThemeConfig = chartThemeConfig;
1852
+ this.boundingRect = {
1853
+ x: 0,
1854
+ y: 0,
1855
+ width: 0,
1856
+ height: 0
1857
+ };
1858
+ this.showChartTitle = false;
1859
+ }
1860
+ static {
1861
+ __name(this, "ChartTitle");
1862
+ }
1863
+ setBoundingBoxXY(point) {
1864
+ this.boundingRect.x = point.x;
1865
+ this.boundingRect.y = point.y;
1866
+ }
1867
+ calculateSpace(availableSpace) {
1868
+ const titleDimension = this.textDimensionCalculator.getMaxDimension([this.chartData.title], this.chartConfig.titleFontSize);
1869
+ const widthRequired = Math.max(titleDimension.width, availableSpace.width);
1870
+ const heightRequired = titleDimension.height + 2 * this.chartConfig.titlePadding;
1871
+ if (titleDimension.width <= widthRequired && titleDimension.height <= heightRequired && this.chartConfig.showTitle && this.chartData.title) {
1872
+ this.boundingRect.width = widthRequired;
1873
+ this.boundingRect.height = heightRequired;
1874
+ this.showChartTitle = true;
1875
+ }
1876
+ return {
1877
+ width: this.boundingRect.width,
1878
+ height: this.boundingRect.height
1879
+ };
1880
+ }
1881
+ getDrawableElements() {
1882
+ const drawableElem = [];
1883
+ if (this.showChartTitle) drawableElem.push({
1884
+ groupTexts: ["chart-title"],
1885
+ type: "text",
1886
+ data: [{
1887
+ fontSize: this.chartConfig.titleFontSize,
1888
+ text: this.chartData.title,
1889
+ verticalPos: "middle",
1890
+ horizontalPos: "center",
1891
+ x: this.boundingRect.x + this.boundingRect.width / 2,
1892
+ y: this.boundingRect.y + this.boundingRect.height / 2,
1893
+ fill: this.chartThemeConfig.titleColor,
1894
+ rotation: 0
1895
+ }]
1896
+ });
1897
+ return drawableElem;
1898
+ }
1899
+ };
1900
+ function getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
1901
+ return new ChartTitle(new TextDimensionCalculatorWithFont(tmpSVGGroup2), chartConfig, chartData, chartThemeConfig);
1902
+ }
1903
+ __name(getChartTitleComponent, "getChartTitleComponent");
1904
+ var LEGEND_MARKER_TO_FONT_RATIO = .75;
1905
+ var LEGEND_ITEM_SPACING_TO_FONT_RATIO = .5;
1906
+ var LEGEND_MARKER_SPACING_TO_FONT_RATIO = .35;
1907
+ function getLegendLayout(fontSize) {
1908
+ return {
1909
+ fontSize,
1910
+ markerSize: fontSize * LEGEND_MARKER_TO_FONT_RATIO,
1911
+ markerSpacing: fontSize * LEGEND_MARKER_SPACING_TO_FONT_RATIO,
1912
+ itemSpacing: fontSize * LEGEND_ITEM_SPACING_TO_FONT_RATIO
1913
+ };
1914
+ }
1915
+ __name(getLegendLayout, "getLegendLayout");
1916
+ var ChartLegend = class {
1917
+ constructor(textDimensionCalculator, chartConfig, chartData, chartThemeConfig) {
1918
+ this.textDimensionCalculator = textDimensionCalculator;
1919
+ this.chartConfig = chartConfig;
1920
+ this.chartData = chartData;
1921
+ this.chartThemeConfig = chartThemeConfig;
1922
+ this.boundingRect = {
1923
+ x: 0,
1924
+ y: 0,
1925
+ width: 0,
1926
+ height: 0
1927
+ };
1928
+ this.visiblePlots = [];
1929
+ }
1930
+ static {
1931
+ __name(this, "ChartLegend");
1932
+ }
1933
+ setBoundingBoxXY(point) {
1934
+ this.boundingRect.x = point.x;
1935
+ this.boundingRect.y = point.y;
1936
+ }
1937
+ calculateSpace(availableSpace) {
1938
+ this.visiblePlots = this.chartConfig.showLegend ? this.chartData.plots.filter((plot) => plot.title) : [];
1939
+ if (this.visiblePlots.length === 0) {
1940
+ this.boundingRect.width = 0;
1941
+ this.boundingRect.height = 0;
1942
+ return {
1943
+ width: 0,
1944
+ height: 0
1945
+ };
1946
+ }
1947
+ const { fontSize, markerSize, markerSpacing, itemSpacing } = getLegendLayout(this.chartConfig.legendFontSize);
1948
+ const textDimension = this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map((plot) => plot.title), fontSize);
1949
+ const widthRequired = this.chartConfig.legendPadding * 2 + markerSize + markerSpacing + textDimension.width;
1950
+ const heightRequired = this.chartConfig.legendPadding * 2 + this.visiblePlots.length * fontSize + (this.visiblePlots.length - 1) * itemSpacing;
1951
+ if (widthRequired <= availableSpace.width && heightRequired <= availableSpace.height) {
1952
+ this.boundingRect.width = widthRequired;
1953
+ this.boundingRect.height = heightRequired;
1954
+ } else {
1955
+ this.visiblePlots = [];
1956
+ this.boundingRect.width = 0;
1957
+ this.boundingRect.height = 0;
1958
+ }
1959
+ return {
1960
+ width: this.boundingRect.width,
1961
+ height: this.boundingRect.height
1962
+ };
1963
+ }
1964
+ getDrawableElements() {
1965
+ if (this.visiblePlots.length === 0) return [];
1966
+ const { fontSize, markerSize, markerSpacing, itemSpacing } = getLegendLayout(this.chartConfig.legendFontSize);
1967
+ const rowHeight = fontSize + itemSpacing;
1968
+ const startX = this.boundingRect.x + this.chartConfig.legendPadding;
1969
+ const startY = this.boundingRect.y + this.chartConfig.legendPadding;
1970
+ const barMarkers = [];
1971
+ const lineMarkers = [];
1972
+ for (const [index, plot] of this.visiblePlots.entries()) if (isBarPlot(plot)) barMarkers.push({
1973
+ x: startX,
1974
+ y: startY + index * rowHeight,
1975
+ width: markerSize,
1976
+ height: markerSize,
1977
+ fill: plot.fill,
1978
+ strokeFill: plot.fill,
1979
+ strokeWidth: 0
1980
+ });
1981
+ else {
1982
+ const markerY = startY + index * rowHeight + markerSize / 2;
1983
+ lineMarkers.push({
1984
+ path: `M ${startX},${markerY} L ${startX + markerSize},${markerY}`,
1985
+ strokeFill: plot.strokeFill,
1986
+ strokeWidth: plot.strokeWidth
1987
+ });
1988
+ }
1989
+ return [
1990
+ {
1991
+ groupTexts: ["legend", "markers"],
1992
+ type: "rect",
1993
+ data: barMarkers
1994
+ },
1995
+ {
1996
+ groupTexts: ["legend", "markers"],
1997
+ type: "path",
1998
+ data: lineMarkers
1999
+ },
2000
+ {
2001
+ groupTexts: ["legend", "label"],
2002
+ type: "text",
2003
+ data: this.visiblePlots.map((plot, index) => ({
2004
+ text: plot.title,
2005
+ x: startX + markerSize + markerSpacing,
2006
+ y: startY + index * rowHeight + markerSize / 2,
2007
+ fill: this.chartThemeConfig.legendTextColor,
2008
+ fontSize,
2009
+ rotation: 0,
2010
+ verticalPos: "middle",
2011
+ horizontalPos: "left"
2012
+ }))
2013
+ }
2014
+ ];
2015
+ }
2016
+ };
2017
+ function getChartLegendComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
2018
+ return new ChartLegend(new TextDimensionCalculatorWithFont(tmpSVGGroup2), chartConfig, chartData, chartThemeConfig);
2019
+ }
2020
+ __name(getChartLegendComponent, "getChartLegendComponent");
2021
+ var LinePlot = class {
2022
+ constructor(plotData, xAxis, yAxis, orientation, plotIndex2) {
2023
+ this.plotData = plotData;
2024
+ this.xAxis = xAxis;
2025
+ this.yAxis = yAxis;
2026
+ this.orientation = orientation;
2027
+ this.plotIndex = plotIndex2;
2028
+ }
2029
+ static {
2030
+ __name(this, "LinePlot");
2031
+ }
2032
+ getDrawableElement() {
2033
+ const finalData = this.plotData.data.map((d) => [this.xAxis.getScaleValue(d[0]), this.yAxis.getScaleValue(d[1])]);
2034
+ let path;
2035
+ if (this.orientation === "horizontal") path = line_default().y((d) => d[0]).x((d) => d[1])(finalData);
2036
+ else path = line_default().x((d) => d[0]).y((d) => d[1])(finalData);
2037
+ if (!path) return [];
2038
+ const elements = [{
2039
+ groupTexts: ["plot", `line-plot-${this.plotIndex}`],
2040
+ type: "path",
2041
+ data: [{
2042
+ path,
2043
+ strokeFill: this.plotData.strokeFill,
2044
+ strokeWidth: this.plotData.strokeWidth
2045
+ }]
2046
+ }];
2047
+ if (this.plotData.pointLabels && this.plotData.pointLabels.length > 0) {
2048
+ const labelOffset = 10;
2049
+ const fontSize = 12;
2050
+ const textData = [];
2051
+ for (const [i, [px, py]] of finalData.entries()) {
2052
+ const label = this.plotData.pointLabels[i];
2053
+ if (!label) continue;
2054
+ if (this.orientation === "horizontal") textData.push({
2055
+ x: py + labelOffset,
2056
+ y: px,
2057
+ text: label,
2058
+ fill: this.plotData.strokeFill,
2059
+ verticalPos: "middle",
2060
+ horizontalPos: "left",
2061
+ fontSize,
2062
+ rotation: 0
2063
+ });
2064
+ else textData.push({
2065
+ x: px,
2066
+ y: py - labelOffset,
2067
+ text: label,
2068
+ fill: this.plotData.strokeFill,
2069
+ verticalPos: "middle",
2070
+ horizontalPos: "center",
2071
+ fontSize,
2072
+ rotation: 0
2073
+ });
2074
+ }
2075
+ if (textData.length > 0) elements.push({
2076
+ groupTexts: [
2077
+ "plot",
2078
+ `line-plot-${this.plotIndex}`,
2079
+ "labels"
2080
+ ],
2081
+ type: "text",
2082
+ data: textData
2083
+ });
2084
+ }
2085
+ return elements;
2086
+ }
2087
+ };
2088
+ var BarPlot = class {
2089
+ constructor(barData, boundingRect, xAxis, yAxis, orientation, plotIndex2) {
2090
+ this.barData = barData;
2091
+ this.boundingRect = boundingRect;
2092
+ this.xAxis = xAxis;
2093
+ this.yAxis = yAxis;
2094
+ this.orientation = orientation;
2095
+ this.plotIndex = plotIndex2;
2096
+ }
2097
+ static {
2098
+ __name(this, "BarPlot");
2099
+ }
2100
+ getDrawableElement() {
2101
+ const finalData = this.barData.data.map((d) => [this.xAxis.getScaleValue(d[0]), this.yAxis.getScaleValue(d[1])]);
2102
+ const barWidth = Math.min(this.xAxis.getAxisOuterPadding() * 2, this.xAxis.getTickDistance()) * .95;
2103
+ const barWidthHalf = barWidth / 2;
2104
+ if (this.orientation === "horizontal") return [{
2105
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
2106
+ type: "rect",
2107
+ data: finalData.map((data) => ({
2108
+ x: this.boundingRect.x,
2109
+ y: data[0] - barWidthHalf,
2110
+ height: barWidth,
2111
+ width: data[1] - this.boundingRect.x,
2112
+ fill: this.barData.fill,
2113
+ strokeWidth: 0,
2114
+ strokeFill: this.barData.fill
2115
+ }))
2116
+ }];
2117
+ return [{
2118
+ groupTexts: ["plot", `bar-plot-${this.plotIndex}`],
2119
+ type: "rect",
2120
+ data: finalData.map((data) => ({
2121
+ x: data[0] - barWidthHalf,
2122
+ y: data[1],
2123
+ width: barWidth,
2124
+ height: this.boundingRect.y + this.boundingRect.height - data[1],
2125
+ fill: this.barData.fill,
2126
+ strokeWidth: 0,
2127
+ strokeFill: this.barData.fill
2128
+ }))
2129
+ }];
2130
+ }
2131
+ };
2132
+ var BasePlot = class {
2133
+ constructor(chartConfig, chartData, chartThemeConfig) {
2134
+ this.chartConfig = chartConfig;
2135
+ this.chartData = chartData;
2136
+ this.chartThemeConfig = chartThemeConfig;
2137
+ this.boundingRect = {
2138
+ x: 0,
2139
+ y: 0,
2140
+ width: 0,
2141
+ height: 0
2142
+ };
2143
+ }
2144
+ static {
2145
+ __name(this, "BasePlot");
2146
+ }
2147
+ setAxes(xAxis, yAxis) {
2148
+ this.xAxis = xAxis;
2149
+ this.yAxis = yAxis;
2150
+ }
2151
+ setBoundingBoxXY(point) {
2152
+ this.boundingRect.x = point.x;
2153
+ this.boundingRect.y = point.y;
2154
+ }
2155
+ calculateSpace(availableSpace) {
2156
+ this.boundingRect.width = availableSpace.width;
2157
+ this.boundingRect.height = availableSpace.height;
2158
+ return {
2159
+ width: this.boundingRect.width,
2160
+ height: this.boundingRect.height
2161
+ };
2162
+ }
2163
+ getDrawableElements() {
2164
+ if (!(this.xAxis && this.yAxis)) throw Error("Axes must be passed to render Plots");
2165
+ const drawableElem = [];
2166
+ for (const [i, plot] of this.chartData.plots.entries()) switch (plot.type) {
2167
+ case "line":
2168
+ {
2169
+ const linePlot = new LinePlot(plot, this.xAxis, this.yAxis, this.chartConfig.chartOrientation, i);
2170
+ drawableElem.push(...linePlot.getDrawableElement());
2171
+ }
2172
+ break;
2173
+ case "bar": {
2174
+ const barPlot = new BarPlot(plot, this.boundingRect, this.xAxis, this.yAxis, this.chartConfig.chartOrientation, i);
2175
+ drawableElem.push(...barPlot.getDrawableElement());
2176
+ }
2177
+ }
2178
+ return drawableElem;
2179
+ }
2180
+ };
2181
+ function getPlotComponent(chartConfig, chartData, chartThemeConfig) {
2182
+ return new BasePlot(chartConfig, chartData, chartThemeConfig);
2183
+ }
2184
+ __name(getPlotComponent, "getPlotComponent");
2185
+ var Orchestrator = class {
2186
+ constructor(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2) {
2187
+ this.chartConfig = chartConfig;
2188
+ this.chartData = chartData;
2189
+ this.componentStore = {
2190
+ title: getChartTitleComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2),
2191
+ plot: getPlotComponent(chartConfig, chartData, chartThemeConfig),
2192
+ legend: getChartLegendComponent(chartConfig, chartData, chartThemeConfig, tmpSVGGroup2),
2193
+ xAxis: getAxis(chartData.xAxis, chartConfig.xAxis, {
2194
+ titleColor: chartThemeConfig.xAxisTitleColor,
2195
+ labelColor: chartThemeConfig.xAxisLabelColor,
2196
+ tickColor: chartThemeConfig.xAxisTickColor,
2197
+ axisLineColor: chartThemeConfig.xAxisLineColor
2198
+ }, tmpSVGGroup2),
2199
+ yAxis: getAxis(chartData.yAxis, chartConfig.yAxis, {
2200
+ titleColor: chartThemeConfig.yAxisTitleColor,
2201
+ labelColor: chartThemeConfig.yAxisLabelColor,
2202
+ tickColor: chartThemeConfig.yAxisTickColor,
2203
+ axisLineColor: chartThemeConfig.yAxisLineColor
2204
+ }, tmpSVGGroup2)
2205
+ };
2206
+ }
2207
+ static {
2208
+ __name(this, "Orchestrator");
2209
+ }
2210
+ calculateVerticalSpace() {
2211
+ let availableWidth = this.chartConfig.width;
2212
+ let availableHeight = this.chartConfig.height;
2213
+ let plotX = 0;
2214
+ let plotY = 0;
2215
+ let legendSpace = {
2216
+ width: 0,
2217
+ height: 0
2218
+ };
2219
+ let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
2220
+ let chartHeight = Math.floor(availableHeight * this.chartConfig.plotReservedSpacePercent / 100);
2221
+ let spaceUsed = this.componentStore.plot.calculateSpace({
2222
+ width: chartWidth,
2223
+ height: chartHeight
2224
+ });
2225
+ availableWidth -= spaceUsed.width;
2226
+ availableHeight -= spaceUsed.height;
2227
+ spaceUsed = this.componentStore.title.calculateSpace({
2228
+ width: this.chartConfig.width,
2229
+ height: availableHeight
2230
+ });
2231
+ plotY = spaceUsed.height;
2232
+ availableHeight -= spaceUsed.height;
2233
+ this.componentStore.xAxis.setAxisPosition("bottom");
2234
+ spaceUsed = this.componentStore.xAxis.calculateSpace({
2235
+ width: availableWidth,
2236
+ height: availableHeight
2237
+ });
2238
+ availableHeight -= spaceUsed.height;
2239
+ this.componentStore.yAxis.setAxisPosition("left");
2240
+ spaceUsed = this.componentStore.yAxis.calculateSpace({
2241
+ width: availableWidth,
2242
+ height: availableHeight
2243
+ });
2244
+ plotX = spaceUsed.width;
2245
+ availableWidth -= spaceUsed.width;
2246
+ legendSpace = this.componentStore.legend.calculateSpace({
2247
+ width: availableWidth,
2248
+ height: chartHeight
2249
+ });
2250
+ availableWidth -= legendSpace.width;
2251
+ if (availableWidth > 0) {
2252
+ chartWidth += availableWidth;
2253
+ availableWidth = 0;
2254
+ }
2255
+ if (availableHeight > 0) {
2256
+ chartHeight += availableHeight;
2257
+ availableHeight = 0;
2258
+ }
2259
+ this.componentStore.plot.calculateSpace({
2260
+ width: chartWidth,
2261
+ height: chartHeight
2262
+ });
2263
+ this.componentStore.plot.setBoundingBoxXY({
2264
+ x: plotX,
2265
+ y: plotY
2266
+ });
2267
+ this.componentStore.legend.setBoundingBoxXY({
2268
+ x: plotX + chartWidth,
2269
+ y: plotY + Math.max((chartHeight - legendSpace.height) / 2, 0)
2270
+ });
2271
+ this.componentStore.xAxis.setRange([plotX, plotX + chartWidth]);
2272
+ this.componentStore.xAxis.setBoundingBoxXY({
2273
+ x: plotX,
2274
+ y: plotY + chartHeight
2275
+ });
2276
+ this.componentStore.yAxis.setRange([plotY, plotY + chartHeight]);
2277
+ this.componentStore.yAxis.setBoundingBoxXY({
2278
+ x: 0,
2279
+ y: plotY
2280
+ });
2281
+ if (this.chartData.plots.some((p) => isBarPlot(p))) this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
2282
+ }
2283
+ calculateHorizontalSpace() {
2284
+ let availableWidth = this.chartConfig.width;
2285
+ let availableHeight = this.chartConfig.height;
2286
+ let titleYEnd = 0;
2287
+ let plotX = 0;
2288
+ let plotY = 0;
2289
+ let legendSpace = {
2290
+ width: 0,
2291
+ height: 0
2292
+ };
2293
+ let chartWidth = Math.floor(availableWidth * this.chartConfig.plotReservedSpacePercent / 100);
2294
+ let chartHeight = Math.floor(availableHeight * this.chartConfig.plotReservedSpacePercent / 100);
2295
+ let spaceUsed = this.componentStore.plot.calculateSpace({
2296
+ width: chartWidth,
2297
+ height: chartHeight
2298
+ });
2299
+ availableWidth -= spaceUsed.width;
2300
+ availableHeight -= spaceUsed.height;
2301
+ spaceUsed = this.componentStore.title.calculateSpace({
2302
+ width: this.chartConfig.width,
2303
+ height: availableHeight
2304
+ });
2305
+ titleYEnd = spaceUsed.height;
2306
+ availableHeight -= spaceUsed.height;
2307
+ this.componentStore.xAxis.setAxisPosition("left");
2308
+ spaceUsed = this.componentStore.xAxis.calculateSpace({
2309
+ width: availableWidth,
2310
+ height: availableHeight
2311
+ });
2312
+ availableWidth -= spaceUsed.width;
2313
+ plotX = spaceUsed.width;
2314
+ this.componentStore.yAxis.setAxisPosition("top");
2315
+ spaceUsed = this.componentStore.yAxis.calculateSpace({
2316
+ width: availableWidth,
2317
+ height: availableHeight
2318
+ });
2319
+ availableHeight -= spaceUsed.height;
2320
+ plotY = titleYEnd + spaceUsed.height;
2321
+ legendSpace = this.componentStore.legend.calculateSpace({
2322
+ width: availableWidth,
2323
+ height: chartHeight
2324
+ });
2325
+ availableWidth -= legendSpace.width;
2326
+ if (availableWidth > 0) {
2327
+ chartWidth += availableWidth;
2328
+ availableWidth = 0;
2329
+ }
2330
+ if (availableHeight > 0) {
2331
+ chartHeight += availableHeight;
2332
+ availableHeight = 0;
2333
+ }
2334
+ this.componentStore.plot.calculateSpace({
2335
+ width: chartWidth,
2336
+ height: chartHeight
2337
+ });
2338
+ this.componentStore.plot.setBoundingBoxXY({
2339
+ x: plotX,
2340
+ y: plotY
2341
+ });
2342
+ this.componentStore.legend.setBoundingBoxXY({
2343
+ x: plotX + chartWidth,
2344
+ y: plotY + Math.max((chartHeight - legendSpace.height) / 2, 0)
2345
+ });
2346
+ this.componentStore.yAxis.setRange([plotX, plotX + chartWidth]);
2347
+ this.componentStore.yAxis.setBoundingBoxXY({
2348
+ x: plotX,
2349
+ y: titleYEnd
2350
+ });
2351
+ this.componentStore.xAxis.setRange([plotY, plotY + chartHeight]);
2352
+ this.componentStore.xAxis.setBoundingBoxXY({
2353
+ x: 0,
2354
+ y: plotY
2355
+ });
2356
+ if (this.chartData.plots.some((p) => isBarPlot(p))) this.componentStore.xAxis.recalculateOuterPaddingToDrawBar();
2357
+ }
2358
+ calculateSpace() {
2359
+ if (this.chartConfig.chartOrientation === "horizontal") this.calculateHorizontalSpace();
2360
+ else this.calculateVerticalSpace();
2361
+ }
2362
+ getDrawableElement() {
2363
+ this.calculateSpace();
2364
+ const drawableElem = [];
2365
+ this.componentStore.plot.setAxes(this.componentStore.xAxis, this.componentStore.yAxis);
2366
+ for (const component of Object.values(this.componentStore)) drawableElem.push(...component.getDrawableElements());
2367
+ return drawableElem;
2368
+ }
2369
+ };
2370
+ var XYChartBuilder = class {
2371
+ static {
2372
+ __name(this, "XYChartBuilder");
2373
+ }
2374
+ static build(config, chartData, chartThemeConfig, tmpSVGGroup2) {
2375
+ return new Orchestrator(config, chartData, chartThemeConfig, tmpSVGGroup2).getDrawableElement();
2376
+ }
2377
+ };
2378
+ var plotIndex = 0;
2379
+ var tmpSVGGroup;
2380
+ var xyChartConfig = getChartDefaultConfig();
2381
+ var xyChartThemeConfig = getChartDefaultThemeConfig();
2382
+ var xyChartData = getChartDefaultData();
2383
+ var plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
2384
+ var hasSetXAxis = false;
2385
+ var hasSetYAxis = false;
2386
+ function getChartDefaultThemeConfig() {
2387
+ const defaultThemeVariables = getThemeVariables3();
2388
+ const config = getConfig();
2389
+ return cleanAndMerge(defaultThemeVariables.xyChart, config.themeVariables.xyChart);
2390
+ }
2391
+ __name(getChartDefaultThemeConfig, "getChartDefaultThemeConfig");
2392
+ function getChartDefaultConfig() {
2393
+ const config = getConfig();
2394
+ return cleanAndMerge(defaultConfig_default.xyChart, config.xyChart);
2395
+ }
2396
+ __name(getChartDefaultConfig, "getChartDefaultConfig");
2397
+ function getChartDefaultData() {
2398
+ return {
2399
+ yAxis: {
2400
+ type: "linear",
2401
+ title: "",
2402
+ min: Infinity,
2403
+ max: -Infinity
2404
+ },
2405
+ xAxis: {
2406
+ type: "band",
2407
+ title: "",
2408
+ categories: []
2409
+ },
2410
+ title: "",
2411
+ plots: []
2412
+ };
2413
+ }
2414
+ __name(getChartDefaultData, "getChartDefaultData");
2415
+ function textSanitizer(text) {
2416
+ const config = getConfig();
2417
+ return sanitizeText(text.trim(), config);
2418
+ }
2419
+ __name(textSanitizer, "textSanitizer");
2420
+ function setTmpSVGG(SVGG) {
2421
+ tmpSVGGroup = SVGG;
2422
+ }
2423
+ __name(setTmpSVGG, "setTmpSVGG");
2424
+ function setOrientation(orientation) {
2425
+ if (orientation === "horizontal") xyChartConfig.chartOrientation = "horizontal";
2426
+ else xyChartConfig.chartOrientation = "vertical";
2427
+ }
2428
+ __name(setOrientation, "setOrientation");
2429
+ function setXAxisTitle(title) {
2430
+ xyChartData.xAxis.title = textSanitizer(title.text);
2431
+ }
2432
+ __name(setXAxisTitle, "setXAxisTitle");
2433
+ function setXAxisRangeData(min, max) {
2434
+ xyChartData.xAxis = {
2435
+ type: "linear",
2436
+ title: xyChartData.xAxis.title,
2437
+ min,
2438
+ max
2439
+ };
2440
+ hasSetXAxis = true;
2441
+ }
2442
+ __name(setXAxisRangeData, "setXAxisRangeData");
2443
+ function setXAxisBand(categories) {
2444
+ xyChartData.xAxis = {
2445
+ type: "band",
2446
+ title: xyChartData.xAxis.title,
2447
+ categories: categories.map((c) => textSanitizer(c.text))
2448
+ };
2449
+ hasSetXAxis = true;
2450
+ }
2451
+ __name(setXAxisBand, "setXAxisBand");
2452
+ function setYAxisTitle(title) {
2453
+ xyChartData.yAxis.title = textSanitizer(title.text);
2454
+ }
2455
+ __name(setYAxisTitle, "setYAxisTitle");
2456
+ function setYAxisRangeData(min, max) {
2457
+ xyChartData.yAxis = {
2458
+ type: "linear",
2459
+ title: xyChartData.yAxis.title,
2460
+ min,
2461
+ max
2462
+ };
2463
+ hasSetYAxis = true;
2464
+ }
2465
+ __name(setYAxisRangeData, "setYAxisRangeData");
2466
+ function setYAxisRangeFromPlotData(data) {
2467
+ const minValue = Math.min(...data);
2468
+ const maxValue = Math.max(...data);
2469
+ const prevMinValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.min : Infinity;
2470
+ const prevMaxValue = isLinearAxisData(xyChartData.yAxis) ? xyChartData.yAxis.max : -Infinity;
2471
+ xyChartData.yAxis = {
2472
+ type: "linear",
2473
+ title: xyChartData.yAxis.title,
2474
+ min: Math.min(prevMinValue, minValue),
2475
+ max: Math.max(prevMaxValue, maxValue)
2476
+ };
2477
+ }
2478
+ __name(setYAxisRangeFromPlotData, "setYAxisRangeFromPlotData");
2479
+ function transformDataWithoutCategory(data) {
2480
+ let retData = [];
2481
+ if (data.length === 0) return retData;
2482
+ if (!hasSetXAxis) {
2483
+ const prevMinValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.min : Infinity;
2484
+ const prevMaxValue = isLinearAxisData(xyChartData.xAxis) ? xyChartData.xAxis.max : -Infinity;
2485
+ setXAxisRangeData(Math.min(prevMinValue, 1), Math.max(prevMaxValue, data.length));
2486
+ }
2487
+ if (isBandAxisData(xyChartData.xAxis) && data.length > xyChartData.xAxis.categories.length) data = data.slice(0, xyChartData.xAxis.categories.length);
2488
+ if (!hasSetYAxis) setYAxisRangeFromPlotData(data);
2489
+ if (isBandAxisData(xyChartData.xAxis)) retData = xyChartData.xAxis.categories.map((c, i) => [c, data[i]]);
2490
+ if (isLinearAxisData(xyChartData.xAxis)) {
2491
+ const min = xyChartData.xAxis.min;
2492
+ const max = xyChartData.xAxis.max;
2493
+ if (data.length === 1) retData = [[`${min}`, data[0]]];
2494
+ else {
2495
+ const step = (max - min) / (data.length - 1);
2496
+ retData = data.map((datum, index) => [`${min + index * step}`, datum]);
2497
+ }
2498
+ }
2499
+ return retData;
2500
+ }
2501
+ __name(transformDataWithoutCategory, "transformDataWithoutCategory");
2502
+ function getPlotColorFromPalette(plotIndex2) {
2503
+ return plotColorPalette[plotIndex2 === 0 ? 0 : plotIndex2 % plotColorPalette.length];
2504
+ }
2505
+ __name(getPlotColorFromPalette, "getPlotColorFromPalette");
2506
+ function setLineData(title, data) {
2507
+ const values = data.map((d) => d.value);
2508
+ const labels = data.map((d) => d.label ? textSanitizer(d.label) : "");
2509
+ const plotData = transformDataWithoutCategory(values);
2510
+ const hasAnyLabel = labels.some((l) => l !== "");
2511
+ xyChartData.plots.push({
2512
+ type: "line",
2513
+ title: textSanitizer(title.text),
2514
+ strokeFill: getPlotColorFromPalette(plotIndex),
2515
+ strokeWidth: 2,
2516
+ data: plotData,
2517
+ ...hasAnyLabel ? { pointLabels: labels } : {}
2518
+ });
2519
+ plotIndex++;
2520
+ }
2521
+ __name(setLineData, "setLineData");
2522
+ function setBarData(title, data) {
2523
+ const plotData = transformDataWithoutCategory(data.map((d) => d.value));
2524
+ xyChartData.plots.push({
2525
+ type: "bar",
2526
+ title: textSanitizer(title.text),
2527
+ fill: getPlotColorFromPalette(plotIndex),
2528
+ data: plotData
2529
+ });
2530
+ plotIndex++;
2531
+ }
2532
+ __name(setBarData, "setBarData");
2533
+ function getDrawableElem() {
2534
+ if (xyChartData.plots.length === 0) throw Error("No Plot to render, please provide a plot with some data");
2535
+ xyChartData.title = getDiagramTitle();
2536
+ return XYChartBuilder.build(xyChartConfig, xyChartData, xyChartThemeConfig, tmpSVGGroup);
2537
+ }
2538
+ __name(getDrawableElem, "getDrawableElem");
2539
+ function getChartThemeConfig() {
2540
+ return xyChartThemeConfig;
2541
+ }
2542
+ __name(getChartThemeConfig, "getChartThemeConfig");
2543
+ function getChartConfig() {
2544
+ return xyChartConfig;
2545
+ }
2546
+ __name(getChartConfig, "getChartConfig");
2547
+ function getXYChartData() {
2548
+ return xyChartData;
2549
+ }
2550
+ __name(getXYChartData, "getXYChartData");
2551
+ var diagram = {
2552
+ parser: xychart_default,
2553
+ db: {
2554
+ getDrawableElem,
2555
+ clear: /* @__PURE__ */ __name(function() {
2556
+ clear();
2557
+ plotIndex = 0;
2558
+ xyChartConfig = getChartDefaultConfig();
2559
+ xyChartData = getChartDefaultData();
2560
+ xyChartThemeConfig = getChartDefaultThemeConfig();
2561
+ plotColorPalette = xyChartThemeConfig.plotColorPalette.split(",").map((color) => color.trim());
2562
+ hasSetXAxis = false;
2563
+ hasSetYAxis = false;
2564
+ }, "clear"),
2565
+ setAccTitle,
2566
+ getAccTitle,
2567
+ setDiagramTitle,
2568
+ getDiagramTitle,
2569
+ getAccDescription,
2570
+ setAccDescription,
2571
+ setOrientation,
2572
+ setXAxisTitle,
2573
+ setXAxisRangeData,
2574
+ setXAxisBand,
2575
+ setYAxisTitle,
2576
+ setYAxisRangeData,
2577
+ setLineData,
2578
+ setBarData,
2579
+ setTmpSVGG,
2580
+ getChartThemeConfig,
2581
+ getChartConfig,
2582
+ getXYChartData
2583
+ },
2584
+ renderer: { draw: /* @__PURE__ */ __name((txt, id, _version, diagObj) => {
2585
+ const db = diagObj.db;
2586
+ const themeConfig = db.getChartThemeConfig();
2587
+ const chartConfig = db.getChartConfig();
2588
+ const labelData = db.getXYChartData().plots[0].data.map((data) => data[1]);
2589
+ function getDominantBaseLine(horizontalPos) {
2590
+ return horizontalPos === "top" ? "text-before-edge" : "middle";
2591
+ }
2592
+ __name(getDominantBaseLine, "getDominantBaseLine");
2593
+ function getTextAnchor(verticalPos) {
2594
+ return verticalPos === "left" ? "start" : verticalPos === "right" ? "end" : "middle";
2595
+ }
2596
+ __name(getTextAnchor, "getTextAnchor");
2597
+ function getTextTransformation(data) {
2598
+ return `translate(${data.x}, ${data.y}) rotate(${data.rotation || 0})`;
2599
+ }
2600
+ __name(getTextTransformation, "getTextTransformation");
2601
+ log.debug("Rendering xychart chart\n" + txt);
2602
+ const svg = selectSvgElement(id);
2603
+ const group = svg.append("g").attr("class", "main");
2604
+ const background = group.append("rect").attr("width", chartConfig.width).attr("height", chartConfig.height).attr("class", "background");
2605
+ configureSvgSize(svg, chartConfig.height, chartConfig.width, true);
2606
+ svg.attr("viewBox", `0 0 ${chartConfig.width} ${chartConfig.height}`);
2607
+ background.attr("fill", themeConfig.backgroundColor);
2608
+ db.setTmpSVGG(svg.append("g").attr("class", "mermaid-tmp-group"));
2609
+ const shapes = db.getDrawableElem();
2610
+ const groups = {};
2611
+ function getGroup(gList) {
2612
+ let elem = group;
2613
+ let prefix = "";
2614
+ for (const [i] of gList.entries()) {
2615
+ let parent = group;
2616
+ if (i > 0 && groups[prefix]) parent = groups[prefix];
2617
+ prefix += gList[i];
2618
+ elem = groups[prefix];
2619
+ if (!elem) elem = groups[prefix] = parent.append("g").attr("class", gList[i]);
2620
+ }
2621
+ return elem;
2622
+ }
2623
+ __name(getGroup, "getGroup");
2624
+ for (const shape of shapes) {
2625
+ if (shape.data.length === 0) continue;
2626
+ const shapeGroup = getGroup(shape.groupTexts);
2627
+ switch (shape.type) {
2628
+ case "rect":
2629
+ shapeGroup.selectAll("rect").data(shape.data).enter().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).attr("stroke", (data) => data.strokeFill).attr("stroke-width", (data) => data.strokeWidth);
2630
+ if (chartConfig.showDataLabel) {
2631
+ const showDataLabelOutsideBar = chartConfig.showDataLabelOutsideBar;
2632
+ if (chartConfig.chartOrientation === "horizontal") {
2633
+ let fitsHorizontally2 = function(item, fontSize) {
2634
+ const { data, label } = item;
2635
+ return fontSize * label.length * charWidthFactor <= data.width - rightMargin;
2636
+ };
2637
+ __name(fitsHorizontally2, "fitsHorizontally");
2638
+ const charWidthFactor = .7;
2639
+ const rightMargin = 10;
2640
+ const validItems = shape.data.map((d, i) => ({
2641
+ data: d,
2642
+ label: labelData[i].toString()
2643
+ })).filter((item) => item.data.width > 0 && item.data.height > 0);
2644
+ const candidateFontSizes = validItems.map((item) => {
2645
+ const { data } = item;
2646
+ let fontSize = data.height * .7;
2647
+ while (!fitsHorizontally2(item, fontSize) && fontSize > 0) fontSize -= 1;
2648
+ return fontSize;
2649
+ });
2650
+ const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
2651
+ const determineLabelXPosition = /* @__PURE__ */ __name((item) => {
2652
+ if (showDataLabelOutsideBar) return item.data.x + item.data.width + rightMargin;
2653
+ else return item.data.x + item.data.width - rightMargin;
2654
+ }, "determineLabelXPosition");
2655
+ shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x", determineLabelXPosition).attr("y", (item) => item.data.y + item.data.height / 2).attr("text-anchor", showDataLabelOutsideBar ? "start" : "end").attr("dominant-baseline", "middle").attr("fill", themeConfig.dataLabelColor).attr("font-size", `${uniformFontSize}px`).text((item) => item.label);
2656
+ } else {
2657
+ let fitsInBar2 = function(item, fontSize, yOffset2) {
2658
+ const { data, label } = item;
2659
+ const textWidth = fontSize * label.length * .7;
2660
+ const centerX = data.x + data.width / 2;
2661
+ const leftEdge = centerX - textWidth / 2;
2662
+ const rightEdge = centerX + textWidth / 2;
2663
+ const horizontalFits = leftEdge >= data.x && rightEdge <= data.x + data.width;
2664
+ const verticalFits = data.y + yOffset2 + fontSize <= data.y + data.height;
2665
+ return horizontalFits && verticalFits;
2666
+ };
2667
+ __name(fitsInBar2, "fitsInBar");
2668
+ const yOffset = 10;
2669
+ const validItems = shape.data.map((d, i) => ({
2670
+ data: d,
2671
+ label: labelData[i].toString()
2672
+ })).filter((item) => item.data.width > 0 && item.data.height > 0);
2673
+ const candidateFontSizes = validItems.map((item) => {
2674
+ const { data, label } = item;
2675
+ let fontSize = data.width / (label.length * .7);
2676
+ while (!fitsInBar2(item, fontSize, yOffset) && fontSize > 0) fontSize -= 1;
2677
+ return fontSize;
2678
+ });
2679
+ const uniformFontSize = Math.floor(Math.min(...candidateFontSizes));
2680
+ const determineLabelYPosition = /* @__PURE__ */ __name((item) => {
2681
+ if (showDataLabelOutsideBar) return item.data.y - yOffset;
2682
+ else return item.data.y + yOffset;
2683
+ }, "determineLabelYPosition");
2684
+ shapeGroup.selectAll("text").data(validItems).enter().append("text").attr("x", (item) => item.data.x + item.data.width / 2).attr("y", determineLabelYPosition).attr("text-anchor", "middle").attr("dominant-baseline", showDataLabelOutsideBar ? "auto" : "hanging").attr("fill", themeConfig.dataLabelColor).attr("font-size", `${uniformFontSize}px`).text((item) => item.label);
2685
+ }
2686
+ }
2687
+ break;
2688
+ case "text":
2689
+ shapeGroup.selectAll("text").data(shape.data).enter().append("text").attr("x", 0).attr("y", 0).attr("fill", (data) => data.fill).attr("font-size", (data) => data.fontSize).attr("dominant-baseline", (data) => getDominantBaseLine(data.verticalPos)).attr("text-anchor", (data) => getTextAnchor(data.horizontalPos)).attr("transform", (data) => getTextTransformation(data)).text((data) => data.text);
2690
+ break;
2691
+ case "path": shapeGroup.selectAll("path").data(shape.data).enter().append("path").attr("d", (data) => data.path).attr("fill", (data) => data.fill ? data.fill : "none").attr("stroke", (data) => data.strokeFill).attr("stroke-width", (data) => data.strokeWidth);
2692
+ }
2693
+ }
2694
+ }, "draw") }
2695
+ };
2696
+
2697
+ //#endregion
2698
+ export { diagram };