@kong-ui-public/documentation 1.5.78 → 1.6.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 (63) hide show
  1. package/dist/{arc-DZdQjcG8-C_2Dx6GQ.js → arc-DZdQjcG8-CduayE88.js} +2 -2
  2. package/dist/{architectureDiagram-3BPJPVTR-By_DXDyu-DTj86bUZ.js → architectureDiagram-3BPJPVTR-By_DXDyu-U3MSLbOU.js} +1506 -1513
  3. package/dist/blockDiagram-GPEHLZMM-9Cp9Hbl7-CKP-SiVG.js +3268 -0
  4. package/dist/{c4Diagram-AAUBKEIU-ftdwlfdB-CYiERTWJ.js → c4Diagram-AAUBKEIU-ftdwlfdB-D3A61SdV.js} +11 -12
  5. package/dist/{channel-DM9j7IFL-CjNPz4Hd.js → channel-DM9j7IFL-DxqBUxfY.js} +1 -1
  6. package/dist/{chunk-2J33WTMH-CBbjVzWb-BAAd-TK5.js → chunk-2J33WTMH-CBbjVzWb-0og4LHQ-.js} +7 -8
  7. package/dist/chunk-4BX2VUAB-C_NnimAy--QQ0Db2V.js +8 -0
  8. package/dist/{chunk-55IACEB6-DZn1aNO0-_bs5ibIB.js → chunk-55IACEB6-DZn1aNO0-A3zOZ7dT.js} +1 -1
  9. package/dist/{chunk-727SXJPM-B2_6_WLv-CzbzsbtK.js → chunk-727SXJPM-B2_6_WLv-Bs3CxHaX.js} +548 -549
  10. package/dist/{chunk-AQP2D5EJ-DEAEiJjW-BPr5JvkB.js → chunk-AQP2D5EJ-DEAEiJjW-DTbwZT8N.js} +446 -458
  11. package/dist/{chunk-FMBD7UC4-D_tZ4Dxg-BUygZnCT.js → chunk-FMBD7UC4-D_tZ4Dxg-DwjoPGUH.js} +1 -1
  12. package/dist/{chunk-ND2GUHAM-Duw3k8MU-Dr8SD23L.js → chunk-ND2GUHAM-Duw3k8MU-HmrdHLJ9.js} +1 -1
  13. package/dist/{chunk-QZHKN3VN-DN6nBdn0-DxWE5zsM.js → chunk-QZHKN3VN-DN6nBdn0-BvQOETVz.js} +1 -1
  14. package/dist/classDiagram-4FO5ZUOK-Du5qFrfN-BqXc0etQ.js +17 -0
  15. package/dist/classDiagram-v2-Q7XG4LA2-DM6zutfc-BqXc0etQ.js +17 -0
  16. package/dist/{cose-bilkent-S5V4N54A-0ZumbVgj-BKcFQWbE.js → cose-bilkent-S5V4N54A-0ZumbVgj-0z7CQbIH.js} +465 -465
  17. package/dist/{cytoscape.esm-BDIiOYYO-BbddfVIJ.js → cytoscape.esm-BDIiOYYO-C1jMBhD8.js} +356 -371
  18. package/dist/dagre-BM42HDAG-qMWMsyLb-DGMrq3i3.js +288 -0
  19. package/dist/{dagre-DJxg_nfI-BzVw7cNP.js → dagre-DJxg_nfI-hVOVexz-.js} +9 -9
  20. package/dist/{diagram-2AECGRRQ-B2gF_dHe-DCRSlKG-.js → diagram-2AECGRRQ-B2gF_dHe-Bv_EpxRz.js} +10 -14
  21. package/dist/{diagram-5GNKFQAL-DJ9WwRrD-DtSWJY6-.js → diagram-5GNKFQAL-DJ9WwRrD-WVvm0Icu.js} +4 -4
  22. package/dist/{diagram-KO2AKTUF-RfkqD-VW-ZR9mxccc.js → diagram-KO2AKTUF-RfkqD-VW-yyAds1Qq.js} +153 -156
  23. package/dist/{diagram-LMA3HP47-Ct7s9hIt-DXtPBRn4.js → diagram-LMA3HP47-Ct7s9hIt-Dy6f9BAO.js} +21 -22
  24. package/dist/{diagram-OG6HWLK6-BSYJ2CoI-DX1BfXw6.js → diagram-OG6HWLK6-BSYJ2CoI-ckmfat-L.js} +79 -81
  25. package/dist/documentation.es.js +1 -1
  26. package/dist/documentation.umd.js +374 -374
  27. package/dist/{erDiagram-TEJ5UH35-BudwiSYX-BPA5-1u6.js → erDiagram-TEJ5UH35-BudwiSYX-bVzp1Kjr.js} +134 -135
  28. package/dist/{flowDiagram-I6XJVG4X-B23Smlxp-Cb24VZnb.js → flowDiagram-I6XJVG4X-B23Smlxp-ClHvdCdJ.js} +842 -849
  29. package/dist/{ganttDiagram-6RSMTGT7-C-i89z_P-DEdTFlTH.js → ganttDiagram-6RSMTGT7-C-i89z_P-t5UAyRM5.js} +46 -46
  30. package/dist/gitGraphDiagram-PVQCEYII-DpVfXnUD-Cg3smOdz.js +734 -0
  31. package/dist/{graphlib-D2YdGpuK-CM8PX5pf.js → graphlib-D2YdGpuK-CnQPmzkS.js} +17 -17
  32. package/dist/{index-Dpyqhws4.js → index-DfVKdDwj.js} +16258 -16515
  33. package/dist/{infoDiagram-5YYISTIA-CDUwzFql-BsbTK2Me.js → infoDiagram-5YYISTIA-CDUwzFql-Bmthmcp4.js} +2 -2
  34. package/dist/{ishikawaDiagram-YF4QCWOH-MfYdx0rK-DsWP0O6d.js → ishikawaDiagram-YF4QCWOH-MfYdx0rK-cbltssua.js} +137 -138
  35. package/dist/{journeyDiagram-JHISSGLW-C_udOPtJ-BkIf9B4Q.js → journeyDiagram-JHISSGLW-C_udOPtJ-BjAvgSAR.js} +13 -13
  36. package/dist/{kanban-definition-UN3LZRKU-C1Su-UOY-6sw-wDwK.js → kanban-definition-UN3LZRKU-C1Su-UOY-DZ93dsWZ.js} +334 -336
  37. package/dist/{katex-D7tFlpqA-B7yKriH4.js → katex-D7tFlpqA-BOSQxXe1.js} +254 -256
  38. package/dist/{linear-1MXhYum8-CfR5ywK4.js → linear-1MXhYum8-9C1jno9G.js} +5 -5
  39. package/dist/{mindmap-definition-RKZ34NQL-MuSV765K-Cv2rDIFS.js → mindmap-definition-RKZ34NQL-MuSV765K-Kub1iXFv.js} +94 -97
  40. package/dist/{ordinal-D9ksOc8y-CrGveXkB.js → ordinal-D9ksOc8y-2hZwLyEk.js} +1 -1
  41. package/dist/{pieDiagram-4H26LBE5-TgFp7J6_-C8m2xJbj.js → pieDiagram-4H26LBE5-TgFp7J6_-i6NxP3Xz.js} +43 -44
  42. package/dist/{quadrantDiagram-W4KKPZXB-DKPne3o_-D0Tfl8NQ.js → quadrantDiagram-W4KKPZXB-DKPne3o_-DXLHqRuR.js} +351 -353
  43. package/dist/{requirementDiagram-4Y6WPE33-vh8uUAp_-C5zLx-_o.js → requirementDiagram-4Y6WPE33-vh8uUAp_-CHtsISxP.js} +384 -386
  44. package/dist/{sankeyDiagram-5OEKKPKP-Cgs6W_El-DBrv4QL_.js → sankeyDiagram-5OEKKPKP-Cgs6W_El-D7GZyd8n.js} +178 -178
  45. package/dist/{sequenceDiagram-3UESZ5HK-C5F57Dkt-D6DqZiJP.js → sequenceDiagram-3UESZ5HK-C5F57Dkt-BW1Hb7UW.js} +643 -653
  46. package/dist/{stateDiagram-AJRCARHV-09dUKG6Y-9QhAIhCk.js → stateDiagram-AJRCARHV-09dUKG6Y-Dm2a1vNu.js} +5 -5
  47. package/dist/stateDiagram-v2-BHNVJYJU-CWqmRt12-DbWzZ-j-.js +16 -0
  48. package/dist/style.css +1 -1
  49. package/dist/timeline-definition-PNZ67QCA-CCndyx0V-B5CT96H-.js +1095 -0
  50. package/dist/{vennDiagram-CIIHVFJN-DQfKxM3L-086u82L3.js → vennDiagram-CIIHVFJN-DQfKxM3L-qUaKEl7l.js} +596 -603
  51. package/dist/{wardley-L42UT6IY-BjAkE_cs-li1xYed9.js → wardley-L42UT6IY-BjAkE_cs-C-giFqos.js} +5760 -5809
  52. package/dist/wardleyDiagram-YWT4CUSO-Bf9L2NsL-DXPF2Ee9.js +639 -0
  53. package/dist/{xychartDiagram-2RQKCTM6-ChNH3q1U--vbcTXH5.js → xychartDiagram-2RQKCTM6-ChNH3q1U-a59DsJDA.js} +10 -10
  54. package/package.json +4 -4
  55. package/dist/blockDiagram-GPEHLZMM-9Cp9Hbl7-CSQRWfog.js +0 -3278
  56. package/dist/chunk-4BX2VUAB-C_NnimAy-B-8x_g6K.js +0 -9
  57. package/dist/classDiagram-4FO5ZUOK-Du5qFrfN-DLmqgbj1.js +0 -17
  58. package/dist/classDiagram-v2-Q7XG4LA2-DM6zutfc-DLmqgbj1.js +0 -17
  59. package/dist/dagre-BM42HDAG-qMWMsyLb-BzK2-5zM.js +0 -291
  60. package/dist/gitGraphDiagram-PVQCEYII-DpVfXnUD-BtfdBLxW.js +0 -747
  61. package/dist/stateDiagram-v2-BHNVJYJU-CWqmRt12-Br5eF-5b.js +0 -16
  62. package/dist/timeline-definition-PNZ67QCA-CCndyx0V-CkhwKYjQ.js +0 -1106
  63. package/dist/wardleyDiagram-YWT4CUSO-Bf9L2NsL-CCMCDU5F.js +0 -647
@@ -0,0 +1,3268 @@
1
+ import { p as g, o as tt, q as v, A as ye, g as S, H as pe, k as xe, aB as be, aj as fe, ap as me, Z as O, am as we, aC as z, aD as Et, aE as G, aF as Se, N as J, a as ke, aG as Le, aH as jt, aI as _e, aJ as Ee, aK as $e, aL as De, aM as ve, aN as Ne, aO as Te, aP as Ie, aQ as Oe, aR as Be, aS as Ce, aT as Re, aU as ze, aV as Ae, aW as Me, aX as Pe, aY as Ye, aZ as We, a_ as Xe, a$ as Fe, b0 as je, b1 as He, b2 as Ke, b3 as Ue, c as Bt, b4 as Ct, b5 as qe } from "./index-DfVKdDwj.js";
2
+ import { n as Ze } from "./channel-DM9j7IFL-DxqBUxfY.js";
3
+ import { t as Ge } from "./chunk-FMBD7UC4-D_tZ4Dxg-DwjoPGUH.js";
4
+ import { y as Je } from "./graphlib-D2YdGpuK-CnQPmzkS.js";
5
+ function Ve(e) {
6
+ return Array.isArray(e);
7
+ }
8
+ function Qe(e) {
9
+ if (Le(e)) return e;
10
+ let t = jt(e);
11
+ if (!tr(e)) return {};
12
+ if (Ve(e)) {
13
+ let n = Array.from(e);
14
+ return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (n.index = e.index, n.input = e.input), n;
15
+ }
16
+ if (_e(e)) {
17
+ let n = e, i = n.constructor;
18
+ return new i(n.buffer, n.byteOffset, n.length);
19
+ }
20
+ if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
21
+ if (t === "[object DataView]") {
22
+ let n = e, i = n.buffer, r = n.byteOffset, s = n.byteLength, l = new ArrayBuffer(s), o = new Uint8Array(i, r, s);
23
+ return new Uint8Array(l).set(o), new DataView(l);
24
+ }
25
+ if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") {
26
+ let n = e.constructor, i = new n(e.valueOf());
27
+ return t === "[object String]" ? rr(i, e) : xt(i, e), i;
28
+ }
29
+ if (t === "[object Date]") return new Date(Number(e));
30
+ if (t === "[object RegExp]") {
31
+ let n = e, i = new RegExp(n.source, n.flags);
32
+ return i.lastIndex = n.lastIndex, i;
33
+ }
34
+ if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
35
+ if (t === "[object Map]") {
36
+ let n = e, i = /* @__PURE__ */ new Map();
37
+ return n.forEach((r, s) => {
38
+ i.set(s, r);
39
+ }), i;
40
+ }
41
+ if (t === "[object Set]") {
42
+ let n = e, i = /* @__PURE__ */ new Set();
43
+ return n.forEach((r) => {
44
+ i.add(r);
45
+ }), i;
46
+ }
47
+ if (t === "[object Arguments]") {
48
+ let n = e, i = {};
49
+ return xt(i, n), i.length = n.length, i[Symbol.iterator] = n[Symbol.iterator], i;
50
+ }
51
+ let a = {};
52
+ return ar(a, e), xt(a, e), er(a, e), a;
53
+ }
54
+ function tr(e) {
55
+ switch (jt(e)) {
56
+ case Ke:
57
+ case He:
58
+ case je:
59
+ case Fe:
60
+ case Xe:
61
+ case We:
62
+ case Ye:
63
+ case Pe:
64
+ case Me:
65
+ case Ae:
66
+ case ze:
67
+ case Re:
68
+ case Ce:
69
+ case Be:
70
+ case Oe:
71
+ case Ie:
72
+ case Te:
73
+ case Ne:
74
+ case ve:
75
+ case De:
76
+ case $e:
77
+ case Ee:
78
+ return !0;
79
+ default:
80
+ return !1;
81
+ }
82
+ }
83
+ function xt(e, t) {
84
+ for (let a in t) Object.hasOwn(t, a) && (e[a] = t[a]);
85
+ }
86
+ function er(e, t) {
87
+ let a = Object.getOwnPropertySymbols(t);
88
+ for (let n = 0; n < a.length; n++) {
89
+ let i = a[n];
90
+ Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
91
+ }
92
+ }
93
+ function rr(e, t) {
94
+ let a = t.valueOf().length;
95
+ for (let n in t) Object.hasOwn(t, n) && (Number.isNaN(Number(n)) || Number(n) >= a) && (e[n] = t[n]);
96
+ }
97
+ function ar(e, t) {
98
+ let a = Object.getPrototypeOf(t);
99
+ a !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, a);
100
+ }
101
+ var ft = (function() {
102
+ var e = /* @__PURE__ */ g(function(d, x, _, f) {
103
+ for (_ ||= {}, f = d.length; f--; _[d[f]] = x) ;
104
+ return _;
105
+ }, "o"), t = [1, 15], a = [1, 7], n = [1, 13], i = [1, 14], r = [1, 19], s = [1, 16], l = [1, 17], o = [1, 18], p = [8, 30], c = [
106
+ 8,
107
+ 10,
108
+ 21,
109
+ 28,
110
+ 29,
111
+ 30,
112
+ 31,
113
+ 39,
114
+ 43,
115
+ 46
116
+ ], u = [1, 23], m = [1, 24], b = [
117
+ 8,
118
+ 10,
119
+ 15,
120
+ 16,
121
+ 21,
122
+ 28,
123
+ 29,
124
+ 30,
125
+ 31,
126
+ 39,
127
+ 43,
128
+ 46
129
+ ], w = [
130
+ 8,
131
+ 10,
132
+ 15,
133
+ 16,
134
+ 21,
135
+ 27,
136
+ 28,
137
+ 29,
138
+ 30,
139
+ 31,
140
+ 39,
141
+ 43,
142
+ 46
143
+ ], k = [1, 49], L = {
144
+ trace: /* @__PURE__ */ g(function() {
145
+ }, "trace"),
146
+ yy: {},
147
+ symbols_: {
148
+ error: 2,
149
+ spaceLines: 3,
150
+ SPACELINE: 4,
151
+ NL: 5,
152
+ separator: 6,
153
+ SPACE: 7,
154
+ EOF: 8,
155
+ start: 9,
156
+ BLOCK_DIAGRAM_KEY: 10,
157
+ document: 11,
158
+ stop: 12,
159
+ statement: 13,
160
+ link: 14,
161
+ LINK: 15,
162
+ START_LINK: 16,
163
+ LINK_LABEL: 17,
164
+ STR: 18,
165
+ nodeStatement: 19,
166
+ columnsStatement: 20,
167
+ SPACE_BLOCK: 21,
168
+ blockStatement: 22,
169
+ classDefStatement: 23,
170
+ cssClassStatement: 24,
171
+ styleStatement: 25,
172
+ node: 26,
173
+ SIZE: 27,
174
+ COLUMNS: 28,
175
+ "id-block": 29,
176
+ end: 30,
177
+ NODE_ID: 31,
178
+ nodeShapeNLabel: 32,
179
+ dirList: 33,
180
+ DIR: 34,
181
+ NODE_DSTART: 35,
182
+ NODE_DEND: 36,
183
+ BLOCK_ARROW_START: 37,
184
+ BLOCK_ARROW_END: 38,
185
+ classDef: 39,
186
+ CLASSDEF_ID: 40,
187
+ CLASSDEF_STYLEOPTS: 41,
188
+ DEFAULT: 42,
189
+ class: 43,
190
+ CLASSENTITY_IDS: 44,
191
+ STYLECLASS: 45,
192
+ style: 46,
193
+ STYLE_ENTITY_IDS: 47,
194
+ STYLE_DEFINITION_DATA: 48,
195
+ $accept: 0,
196
+ $end: 1
197
+ },
198
+ terminals_: {
199
+ 2: "error",
200
+ 4: "SPACELINE",
201
+ 5: "NL",
202
+ 7: "SPACE",
203
+ 8: "EOF",
204
+ 10: "BLOCK_DIAGRAM_KEY",
205
+ 15: "LINK",
206
+ 16: "START_LINK",
207
+ 17: "LINK_LABEL",
208
+ 18: "STR",
209
+ 21: "SPACE_BLOCK",
210
+ 27: "SIZE",
211
+ 28: "COLUMNS",
212
+ 29: "id-block",
213
+ 30: "end",
214
+ 31: "NODE_ID",
215
+ 34: "DIR",
216
+ 35: "NODE_DSTART",
217
+ 36: "NODE_DEND",
218
+ 37: "BLOCK_ARROW_START",
219
+ 38: "BLOCK_ARROW_END",
220
+ 39: "classDef",
221
+ 40: "CLASSDEF_ID",
222
+ 41: "CLASSDEF_STYLEOPTS",
223
+ 42: "DEFAULT",
224
+ 43: "class",
225
+ 44: "CLASSENTITY_IDS",
226
+ 45: "STYLECLASS",
227
+ 46: "style",
228
+ 47: "STYLE_ENTITY_IDS",
229
+ 48: "STYLE_DEFINITION_DATA"
230
+ },
231
+ productions_: [
232
+ 0,
233
+ [3, 1],
234
+ [3, 2],
235
+ [3, 2],
236
+ [6, 1],
237
+ [6, 1],
238
+ [6, 1],
239
+ [9, 3],
240
+ [12, 1],
241
+ [12, 1],
242
+ [12, 2],
243
+ [12, 2],
244
+ [11, 1],
245
+ [11, 2],
246
+ [14, 1],
247
+ [14, 4],
248
+ [13, 1],
249
+ [13, 1],
250
+ [13, 1],
251
+ [13, 1],
252
+ [13, 1],
253
+ [13, 1],
254
+ [13, 1],
255
+ [19, 3],
256
+ [19, 2],
257
+ [19, 1],
258
+ [20, 1],
259
+ [22, 4],
260
+ [22, 3],
261
+ [26, 1],
262
+ [26, 2],
263
+ [33, 1],
264
+ [33, 2],
265
+ [32, 3],
266
+ [32, 4],
267
+ [23, 3],
268
+ [23, 3],
269
+ [24, 3],
270
+ [25, 3]
271
+ ],
272
+ performAction: /* @__PURE__ */ g(function(d, x, _, f, E, h, R) {
273
+ var y = h.length - 1;
274
+ switch (E) {
275
+ case 4:
276
+ f.getLogger().debug("Rule: separator (NL) ");
277
+ break;
278
+ case 5:
279
+ f.getLogger().debug("Rule: separator (Space) ");
280
+ break;
281
+ case 6:
282
+ f.getLogger().debug("Rule: separator (EOF) ");
283
+ break;
284
+ case 7:
285
+ f.getLogger().debug("Rule: hierarchy: ", h[y - 1]), f.setHierarchy(h[y - 1]);
286
+ break;
287
+ case 8:
288
+ f.getLogger().debug("Stop NL ");
289
+ break;
290
+ case 9:
291
+ f.getLogger().debug("Stop EOF ");
292
+ break;
293
+ case 10:
294
+ f.getLogger().debug("Stop NL2 ");
295
+ break;
296
+ case 11:
297
+ f.getLogger().debug("Stop EOF2 ");
298
+ break;
299
+ case 12:
300
+ f.getLogger().debug("Rule: statement: ", h[y]), typeof h[y].length == "number" ? this.$ = h[y] : this.$ = [h[y]];
301
+ break;
302
+ case 13:
303
+ f.getLogger().debug("Rule: statement #2: ", h[y - 1]), this.$ = [h[y - 1]].concat(h[y]);
304
+ break;
305
+ case 14:
306
+ f.getLogger().debug("Rule: link: ", h[y], d), this.$ = {
307
+ edgeTypeStr: h[y],
308
+ label: ""
309
+ };
310
+ break;
311
+ case 15:
312
+ f.getLogger().debug("Rule: LABEL link: ", h[y - 3], h[y - 1], h[y]), this.$ = {
313
+ edgeTypeStr: h[y],
314
+ label: h[y - 1]
315
+ };
316
+ break;
317
+ case 18:
318
+ let j = parseInt(h[y]), H = f.generateId();
319
+ this.$ = {
320
+ id: H,
321
+ type: "space",
322
+ label: "",
323
+ width: j,
324
+ children: []
325
+ };
326
+ break;
327
+ case 23:
328
+ f.getLogger().debug("Rule: (nodeStatement link node) ", h[y - 2], h[y - 1], h[y], " typestr: ", h[y - 1].edgeTypeStr);
329
+ let ct = f.edgeStrToEdgeData(h[y - 1].edgeTypeStr), dt = f.edgeStrToEdgeStartData(h[y - 1].edgeTypeStr), et = f.edgeStrToThickness(h[y - 1].edgeTypeStr), ht = f.edgeStrToPattern(h[y - 1].edgeTypeStr);
330
+ this.$ = [
331
+ {
332
+ id: h[y - 2].id,
333
+ label: h[y - 2].label,
334
+ type: h[y - 2].type,
335
+ directions: h[y - 2].directions
336
+ },
337
+ {
338
+ id: h[y - 2].id + "-" + h[y].id,
339
+ start: h[y - 2].id,
340
+ end: h[y].id,
341
+ label: h[y - 1].label,
342
+ type: "edge",
343
+ thickness: et,
344
+ pattern: ht,
345
+ directions: h[y].directions,
346
+ arrowTypeEnd: ct,
347
+ arrowTypeStart: dt
348
+ },
349
+ {
350
+ id: h[y].id,
351
+ label: h[y].label,
352
+ type: f.typeStr2Type(h[y].typeStr),
353
+ directions: h[y].directions
354
+ }
355
+ ];
356
+ break;
357
+ case 24:
358
+ f.getLogger().debug("Rule: nodeStatement (abc88 node size) ", h[y - 1], h[y]), this.$ = {
359
+ id: h[y - 1].id,
360
+ label: h[y - 1].label,
361
+ type: f.typeStr2Type(h[y - 1].typeStr),
362
+ directions: h[y - 1].directions,
363
+ widthInColumns: parseInt(h[y], 10)
364
+ };
365
+ break;
366
+ case 25:
367
+ f.getLogger().debug("Rule: nodeStatement (node) ", h[y]), this.$ = {
368
+ id: h[y].id,
369
+ label: h[y].label,
370
+ type: f.typeStr2Type(h[y].typeStr),
371
+ directions: h[y].directions,
372
+ widthInColumns: 1
373
+ };
374
+ break;
375
+ case 26:
376
+ f.getLogger().debug("APA123", this ? this : "na"), f.getLogger().debug("COLUMNS: ", h[y]), this.$ = {
377
+ type: "column-setting",
378
+ columns: h[y] === "auto" ? -1 : parseInt(h[y])
379
+ };
380
+ break;
381
+ case 27:
382
+ f.getLogger().debug("Rule: id-block statement : ", h[y - 2], h[y - 1]), f.generateId(), this.$ = {
383
+ ...h[y - 2],
384
+ type: "composite",
385
+ children: h[y - 1]
386
+ };
387
+ break;
388
+ case 28:
389
+ f.getLogger().debug("Rule: blockStatement : ", h[y - 2], h[y - 1], h[y]);
390
+ let I = f.generateId();
391
+ this.$ = {
392
+ id: I,
393
+ type: "composite",
394
+ label: "",
395
+ children: h[y - 1]
396
+ };
397
+ break;
398
+ case 29:
399
+ f.getLogger().debug("Rule: node (NODE_ID separator): ", h[y]), this.$ = { id: h[y] };
400
+ break;
401
+ case 30:
402
+ f.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", h[y - 1], h[y]), this.$ = {
403
+ id: h[y - 1],
404
+ label: h[y].label,
405
+ typeStr: h[y].typeStr,
406
+ directions: h[y].directions
407
+ };
408
+ break;
409
+ case 31:
410
+ f.getLogger().debug("Rule: dirList: ", h[y]), this.$ = [h[y]];
411
+ break;
412
+ case 32:
413
+ f.getLogger().debug("Rule: dirList: ", h[y - 1], h[y]), this.$ = [h[y - 1]].concat(h[y]);
414
+ break;
415
+ case 33:
416
+ f.getLogger().debug("Rule: nodeShapeNLabel: ", h[y - 2], h[y - 1], h[y]), this.$ = {
417
+ typeStr: h[y - 2] + h[y],
418
+ label: h[y - 1]
419
+ };
420
+ break;
421
+ case 34:
422
+ f.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", h[y - 3], h[y - 2], " #3:", h[y - 1], h[y]), this.$ = {
423
+ typeStr: h[y - 3] + h[y],
424
+ label: h[y - 2],
425
+ directions: h[y - 1]
426
+ };
427
+ break;
428
+ case 35:
429
+ case 36:
430
+ this.$ = {
431
+ type: "classDef",
432
+ id: h[y - 1].trim(),
433
+ css: h[y].trim()
434
+ };
435
+ break;
436
+ case 37:
437
+ this.$ = {
438
+ type: "applyClass",
439
+ id: h[y - 1].trim(),
440
+ styleClass: h[y].trim()
441
+ };
442
+ break;
443
+ case 38:
444
+ this.$ = {
445
+ type: "applyStyles",
446
+ id: h[y - 1].trim(),
447
+ stylesStr: h[y].trim()
448
+ };
449
+ break;
450
+ }
451
+ }, "anonymous"),
452
+ table: [
453
+ {
454
+ 9: 1,
455
+ 10: [1, 2]
456
+ },
457
+ { 1: [3] },
458
+ {
459
+ 10: t,
460
+ 11: 3,
461
+ 13: 4,
462
+ 19: 5,
463
+ 20: 6,
464
+ 21: a,
465
+ 22: 8,
466
+ 23: 9,
467
+ 24: 10,
468
+ 25: 11,
469
+ 26: 12,
470
+ 28: n,
471
+ 29: i,
472
+ 31: r,
473
+ 39: s,
474
+ 43: l,
475
+ 46: o
476
+ },
477
+ { 8: [1, 20] },
478
+ e(p, [2, 12], {
479
+ 13: 4,
480
+ 19: 5,
481
+ 20: 6,
482
+ 22: 8,
483
+ 23: 9,
484
+ 24: 10,
485
+ 25: 11,
486
+ 26: 12,
487
+ 11: 21,
488
+ 10: t,
489
+ 21: a,
490
+ 28: n,
491
+ 29: i,
492
+ 31: r,
493
+ 39: s,
494
+ 43: l,
495
+ 46: o
496
+ }),
497
+ e(c, [2, 16], {
498
+ 14: 22,
499
+ 15: u,
500
+ 16: m
501
+ }),
502
+ e(c, [2, 17]),
503
+ e(c, [2, 18]),
504
+ e(c, [2, 19]),
505
+ e(c, [2, 20]),
506
+ e(c, [2, 21]),
507
+ e(c, [2, 22]),
508
+ e(b, [2, 25], { 27: [1, 25] }),
509
+ e(c, [2, 26]),
510
+ {
511
+ 19: 26,
512
+ 26: 12,
513
+ 31: r
514
+ },
515
+ {
516
+ 10: t,
517
+ 11: 27,
518
+ 13: 4,
519
+ 19: 5,
520
+ 20: 6,
521
+ 21: a,
522
+ 22: 8,
523
+ 23: 9,
524
+ 24: 10,
525
+ 25: 11,
526
+ 26: 12,
527
+ 28: n,
528
+ 29: i,
529
+ 31: r,
530
+ 39: s,
531
+ 43: l,
532
+ 46: o
533
+ },
534
+ {
535
+ 40: [1, 28],
536
+ 42: [1, 29]
537
+ },
538
+ { 44: [1, 30] },
539
+ { 47: [1, 31] },
540
+ e(w, [2, 29], {
541
+ 32: 32,
542
+ 35: [1, 33],
543
+ 37: [1, 34]
544
+ }),
545
+ { 1: [2, 7] },
546
+ e(p, [2, 13]),
547
+ {
548
+ 26: 35,
549
+ 31: r
550
+ },
551
+ { 31: [2, 14] },
552
+ { 17: [1, 36] },
553
+ e(b, [2, 24]),
554
+ {
555
+ 10: t,
556
+ 11: 37,
557
+ 13: 4,
558
+ 14: 22,
559
+ 15: u,
560
+ 16: m,
561
+ 19: 5,
562
+ 20: 6,
563
+ 21: a,
564
+ 22: 8,
565
+ 23: 9,
566
+ 24: 10,
567
+ 25: 11,
568
+ 26: 12,
569
+ 28: n,
570
+ 29: i,
571
+ 31: r,
572
+ 39: s,
573
+ 43: l,
574
+ 46: o
575
+ },
576
+ { 30: [1, 38] },
577
+ { 41: [1, 39] },
578
+ { 41: [1, 40] },
579
+ { 45: [1, 41] },
580
+ { 48: [1, 42] },
581
+ e(w, [2, 30]),
582
+ { 18: [1, 43] },
583
+ { 18: [1, 44] },
584
+ e(b, [2, 23]),
585
+ { 18: [1, 45] },
586
+ { 30: [1, 46] },
587
+ e(c, [2, 28]),
588
+ e(c, [2, 35]),
589
+ e(c, [2, 36]),
590
+ e(c, [2, 37]),
591
+ e(c, [2, 38]),
592
+ { 36: [1, 47] },
593
+ {
594
+ 33: 48,
595
+ 34: k
596
+ },
597
+ { 15: [1, 50] },
598
+ e(c, [2, 27]),
599
+ e(w, [2, 33]),
600
+ { 38: [1, 51] },
601
+ {
602
+ 33: 52,
603
+ 34: k,
604
+ 38: [2, 31]
605
+ },
606
+ { 31: [2, 15] },
607
+ e(w, [2, 34]),
608
+ { 38: [2, 32] }
609
+ ],
610
+ defaultActions: {
611
+ 20: [2, 7],
612
+ 23: [2, 14],
613
+ 50: [2, 15],
614
+ 52: [2, 32]
615
+ },
616
+ parseError: /* @__PURE__ */ g(function(d, x) {
617
+ if (x.recoverable) this.trace(d);
618
+ else {
619
+ var _ = Error(d);
620
+ throw _.hash = x, _;
621
+ }
622
+ }, "parseError"),
623
+ parse: /* @__PURE__ */ g(function(d) {
624
+ var x = this, _ = [0], f = [], E = [null], h = [], R = this.table, y = "", j = 0, H = 0, ct = 0, dt = 2, et = 1, ht = h.slice.call(arguments, 1), I = Object.create(this.lexer), U = { yy: {} };
625
+ for (var gt in this.yy) Object.prototype.hasOwnProperty.call(this.yy, gt) && (U.yy[gt] = this.yy[gt]);
626
+ I.setInput(d, U.yy), U.yy.lexer = I, U.yy.parser = this, I.yylloc === void 0 && (I.yylloc = {});
627
+ var ut = I.yylloc;
628
+ h.push(ut);
629
+ var ge = I.options && I.options.ranges;
630
+ typeof U.yy.parseError == "function" ? this.parseError = U.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
631
+ function ue(Y) {
632
+ _.length -= 2 * Y, E.length -= Y, h.length -= Y;
633
+ }
634
+ g(ue, "popStack");
635
+ function Tt() {
636
+ var Y = f.pop() || I.lex() || et;
637
+ return typeof Y != "number" && (Y instanceof Array && (f = Y, Y = f.pop()), Y = x.symbols_[Y] || Y), Y;
638
+ }
639
+ g(Tt, "lex");
640
+ for (var A, yt, q, P, pt, Z = {}, rt, K, It, at; ; ) {
641
+ if (q = _[_.length - 1], this.defaultActions[q] ? P = this.defaultActions[q] : (A ??= Tt(), P = R[q] && R[q][A]), P === void 0 || !P.length || !P[0]) {
642
+ var Ot = "";
643
+ for (rt in at = [], R[q]) this.terminals_[rt] && rt > dt && at.push("'" + this.terminals_[rt] + "'");
644
+ Ot = I.showPosition ? "Parse error on line " + (j + 1) + `:
645
+ ` + I.showPosition() + `
646
+ Expecting ` + at.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : "Parse error on line " + (j + 1) + ": Unexpected " + (A == et ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(Ot, {
647
+ text: I.match,
648
+ token: this.terminals_[A] || A,
649
+ line: I.yylineno,
650
+ loc: ut,
651
+ expected: at
652
+ });
653
+ }
654
+ if (P[0] instanceof Array && P.length > 1) throw Error("Parse Error: multiple actions possible at state: " + q + ", token: " + A);
655
+ switch (P[0]) {
656
+ case 1:
657
+ _.push(A), E.push(I.yytext), h.push(I.yylloc), _.push(P[1]), A = null, yt ? (A = yt, yt = null) : (H = I.yyleng, y = I.yytext, j = I.yylineno, ut = I.yylloc, ct > 0);
658
+ break;
659
+ case 2:
660
+ if (K = this.productions_[P[1]][1], Z.$ = E[E.length - K], Z._$ = {
661
+ first_line: h[h.length - (K || 1)].first_line,
662
+ last_line: h[h.length - 1].last_line,
663
+ first_column: h[h.length - (K || 1)].first_column,
664
+ last_column: h[h.length - 1].last_column
665
+ }, ge && (Z._$.range = [h[h.length - (K || 1)].range[0], h[h.length - 1].range[1]]), pt = this.performAction.apply(Z, [
666
+ y,
667
+ H,
668
+ j,
669
+ U.yy,
670
+ P[1],
671
+ E,
672
+ h
673
+ ].concat(ht)), pt !== void 0) return pt;
674
+ K && (_ = _.slice(0, -1 * K * 2), E = E.slice(0, -1 * K), h = h.slice(0, -1 * K)), _.push(this.productions_[P[1]][0]), E.push(Z.$), h.push(Z._$), It = R[_[_.length - 2]][_[_.length - 1]], _.push(It);
675
+ break;
676
+ case 3:
677
+ return !0;
678
+ }
679
+ }
680
+ return !0;
681
+ }, "parse")
682
+ };
683
+ L.lexer = /* @__PURE__ */ (function() {
684
+ return {
685
+ EOF: 1,
686
+ parseError: /* @__PURE__ */ g(function(d, x) {
687
+ if (this.yy.parser) this.yy.parser.parseError(d, x);
688
+ else throw Error(d);
689
+ }, "parseError"),
690
+ setInput: /* @__PURE__ */ g(function(d, x) {
691
+ return this.yy = x || this.yy || {}, this._input = d, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
692
+ first_line: 1,
693
+ first_column: 0,
694
+ last_line: 1,
695
+ last_column: 0
696
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
697
+ }, "setInput"),
698
+ input: /* @__PURE__ */ g(function() {
699
+ var d = this._input[0];
700
+ return this.yytext += d, this.yyleng++, this.offset++, this.match += d, this.matched += d, d.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), d;
701
+ }, "input"),
702
+ unput: /* @__PURE__ */ g(function(d) {
703
+ var x = d.length, _ = d.split(/(?:\r\n?|\n)/g);
704
+ this._input = d + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - x), this.offset -= x;
705
+ var f = this.match.split(/(?:\r\n?|\n)/g);
706
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), _.length - 1 && (this.yylineno -= _.length - 1);
707
+ var E = this.yylloc.range;
708
+ return this.yylloc = {
709
+ first_line: this.yylloc.first_line,
710
+ last_line: this.yylineno + 1,
711
+ first_column: this.yylloc.first_column,
712
+ last_column: _ ? (_.length === f.length ? this.yylloc.first_column : 0) + f[f.length - _.length].length - _[0].length : this.yylloc.first_column - x
713
+ }, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - x]), this.yyleng = this.yytext.length, this;
714
+ }, "unput"),
715
+ more: /* @__PURE__ */ g(function() {
716
+ return this._more = !0, this;
717
+ }, "more"),
718
+ reject: /* @__PURE__ */ g(function() {
719
+ if (this.options.backtrack_lexer) this._backtrack = !0;
720
+ 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).
721
+ ` + this.showPosition(), {
722
+ text: "",
723
+ token: null,
724
+ line: this.yylineno
725
+ });
726
+ return this;
727
+ }, "reject"),
728
+ less: /* @__PURE__ */ g(function(d) {
729
+ this.unput(this.match.slice(d));
730
+ }, "less"),
731
+ pastInput: /* @__PURE__ */ g(function() {
732
+ var d = this.matched.substr(0, this.matched.length - this.match.length);
733
+ return (d.length > 20 ? "..." : "") + d.substr(-20).replace(/\n/g, "");
734
+ }, "pastInput"),
735
+ upcomingInput: /* @__PURE__ */ g(function() {
736
+ var d = this.match;
737
+ return d.length < 20 && (d += this._input.substr(0, 20 - d.length)), (d.substr(0, 20) + (d.length > 20 ? "..." : "")).replace(/\n/g, "");
738
+ }, "upcomingInput"),
739
+ showPosition: /* @__PURE__ */ g(function() {
740
+ var d = this.pastInput(), x = Array(d.length + 1).join("-");
741
+ return d + this.upcomingInput() + `
742
+ ` + x + "^";
743
+ }, "showPosition"),
744
+ test_match: /* @__PURE__ */ g(function(d, x) {
745
+ var _, f, E;
746
+ if (this.options.backtrack_lexer && (E = {
747
+ yylineno: this.yylineno,
748
+ yylloc: {
749
+ first_line: this.yylloc.first_line,
750
+ last_line: this.last_line,
751
+ first_column: this.yylloc.first_column,
752
+ last_column: this.yylloc.last_column
753
+ },
754
+ yytext: this.yytext,
755
+ match: this.match,
756
+ matches: this.matches,
757
+ matched: this.matched,
758
+ yyleng: this.yyleng,
759
+ offset: this.offset,
760
+ _more: this._more,
761
+ _input: this._input,
762
+ yy: this.yy,
763
+ conditionStack: this.conditionStack.slice(0),
764
+ done: this.done
765
+ }, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), f = d[0].match(/(?:\r\n?|\n).*/g), f && (this.yylineno += f.length), this.yylloc = {
766
+ first_line: this.yylloc.last_line,
767
+ last_line: this.yylineno + 1,
768
+ first_column: this.yylloc.last_column,
769
+ last_column: f ? f[f.length - 1].length - f[f.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + d[0].length
770
+ }, this.yytext += d[0], this.match += d[0], this.matches = d, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(d[0].length), this.matched += d[0], _ = this.performAction.call(this, this.yy, this, x, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), _) return _;
771
+ if (this._backtrack) {
772
+ for (var h in E) this[h] = E[h];
773
+ return !1;
774
+ }
775
+ return !1;
776
+ }, "test_match"),
777
+ next: /* @__PURE__ */ g(function() {
778
+ if (this.done) return this.EOF;
779
+ this._input || (this.done = !0);
780
+ var d, x, _, f;
781
+ this._more || (this.yytext = "", this.match = "");
782
+ for (var E = this._currentRules(), h = 0; h < E.length; h++) if (_ = this._input.match(this.rules[E[h]]), _ && (!x || _[0].length > x[0].length)) {
783
+ if (x = _, f = h, this.options.backtrack_lexer) {
784
+ if (d = this.test_match(_, E[h]), d !== !1) return d;
785
+ if (this._backtrack) {
786
+ x = !1;
787
+ continue;
788
+ } else return !1;
789
+ } else if (!this.options.flex) break;
790
+ }
791
+ return x ? (d = this.test_match(x, E[f]), d === !1 ? !1 : d) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
792
+ ` + this.showPosition(), {
793
+ text: "",
794
+ token: null,
795
+ line: this.yylineno
796
+ });
797
+ }, "next"),
798
+ lex: /* @__PURE__ */ g(function() {
799
+ return this.next() || this.lex();
800
+ }, "lex"),
801
+ begin: /* @__PURE__ */ g(function(d) {
802
+ this.conditionStack.push(d);
803
+ }, "begin"),
804
+ popState: /* @__PURE__ */ g(function() {
805
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
806
+ }, "popState"),
807
+ _currentRules: /* @__PURE__ */ g(function() {
808
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
809
+ }, "_currentRules"),
810
+ topState: /* @__PURE__ */ g(function(d) {
811
+ return d = this.conditionStack.length - 1 - Math.abs(d || 0), d >= 0 ? this.conditionStack[d] : "INITIAL";
812
+ }, "topState"),
813
+ pushState: /* @__PURE__ */ g(function(d) {
814
+ this.begin(d);
815
+ }, "pushState"),
816
+ stateStackSize: /* @__PURE__ */ g(function() {
817
+ return this.conditionStack.length;
818
+ }, "stateStackSize"),
819
+ options: {},
820
+ performAction: /* @__PURE__ */ g(function(d, x, _, f) {
821
+ switch (_) {
822
+ case 0:
823
+ return d.getLogger().debug("Found block-beta"), 10;
824
+ case 1:
825
+ return d.getLogger().debug("Found id-block"), 29;
826
+ case 2:
827
+ return d.getLogger().debug("Found block"), 10;
828
+ case 3:
829
+ d.getLogger().debug(".", x.yytext);
830
+ break;
831
+ case 4:
832
+ d.getLogger().debug("_", x.yytext);
833
+ break;
834
+ case 5:
835
+ return 5;
836
+ case 6:
837
+ return x.yytext = -1, 28;
838
+ case 7:
839
+ return x.yytext = x.yytext.replace(/columns\s+/, ""), d.getLogger().debug("COLUMNS (LEX)", x.yytext), 28;
840
+ case 8:
841
+ this.pushState("md_string");
842
+ break;
843
+ case 9:
844
+ return "MD_STR";
845
+ case 10:
846
+ this.popState();
847
+ break;
848
+ case 11:
849
+ this.pushState("string");
850
+ break;
851
+ case 12:
852
+ d.getLogger().debug("LEX: POPPING STR:", x.yytext), this.popState();
853
+ break;
854
+ case 13:
855
+ return d.getLogger().debug("LEX: STR end:", x.yytext), "STR";
856
+ case 14:
857
+ return x.yytext = x.yytext.replace(/space\:/, ""), d.getLogger().debug("SPACE NUM (LEX)", x.yytext), 21;
858
+ case 15:
859
+ return x.yytext = "1", d.getLogger().debug("COLUMNS (LEX)", x.yytext), 21;
860
+ case 16:
861
+ return 42;
862
+ case 17:
863
+ return "LINKSTYLE";
864
+ case 18:
865
+ return "INTERPOLATE";
866
+ case 19:
867
+ return this.pushState("CLASSDEF"), 39;
868
+ case 20:
869
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
870
+ case 21:
871
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
872
+ case 22:
873
+ return this.popState(), 41;
874
+ case 23:
875
+ return this.pushState("CLASS"), 43;
876
+ case 24:
877
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
878
+ case 25:
879
+ return this.popState(), 45;
880
+ case 26:
881
+ return this.pushState("STYLE_STMNT"), 46;
882
+ case 27:
883
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
884
+ case 28:
885
+ return this.popState(), 48;
886
+ case 29:
887
+ return this.pushState("acc_title"), "acc_title";
888
+ case 30:
889
+ return this.popState(), "acc_title_value";
890
+ case 31:
891
+ return this.pushState("acc_descr"), "acc_descr";
892
+ case 32:
893
+ return this.popState(), "acc_descr_value";
894
+ case 33:
895
+ this.pushState("acc_descr_multiline");
896
+ break;
897
+ case 34:
898
+ this.popState();
899
+ break;
900
+ case 35:
901
+ return "acc_descr_multiline_value";
902
+ case 36:
903
+ return 30;
904
+ case 37:
905
+ return this.popState(), d.getLogger().debug("Lex: (("), "NODE_DEND";
906
+ case 38:
907
+ return this.popState(), d.getLogger().debug("Lex: (("), "NODE_DEND";
908
+ case 39:
909
+ return this.popState(), d.getLogger().debug("Lex: ))"), "NODE_DEND";
910
+ case 40:
911
+ return this.popState(), d.getLogger().debug("Lex: (("), "NODE_DEND";
912
+ case 41:
913
+ return this.popState(), d.getLogger().debug("Lex: (("), "NODE_DEND";
914
+ case 42:
915
+ return this.popState(), d.getLogger().debug("Lex: (-"), "NODE_DEND";
916
+ case 43:
917
+ return this.popState(), d.getLogger().debug("Lex: -)"), "NODE_DEND";
918
+ case 44:
919
+ return this.popState(), d.getLogger().debug("Lex: (("), "NODE_DEND";
920
+ case 45:
921
+ return this.popState(), d.getLogger().debug("Lex: ]]"), "NODE_DEND";
922
+ case 46:
923
+ return this.popState(), d.getLogger().debug("Lex: ("), "NODE_DEND";
924
+ case 47:
925
+ return this.popState(), d.getLogger().debug("Lex: ])"), "NODE_DEND";
926
+ case 48:
927
+ return this.popState(), d.getLogger().debug("Lex: /]"), "NODE_DEND";
928
+ case 49:
929
+ return this.popState(), d.getLogger().debug("Lex: /]"), "NODE_DEND";
930
+ case 50:
931
+ return this.popState(), d.getLogger().debug("Lex: )]"), "NODE_DEND";
932
+ case 51:
933
+ return this.popState(), d.getLogger().debug("Lex: )"), "NODE_DEND";
934
+ case 52:
935
+ return this.popState(), d.getLogger().debug("Lex: ]>"), "NODE_DEND";
936
+ case 53:
937
+ return this.popState(), d.getLogger().debug("Lex: ]"), "NODE_DEND";
938
+ case 54:
939
+ return d.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
940
+ case 55:
941
+ return d.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
942
+ case 56:
943
+ return d.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
944
+ case 57:
945
+ return d.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
946
+ case 58:
947
+ return d.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
948
+ case 59:
949
+ return d.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
950
+ case 60:
951
+ return d.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
952
+ case 61:
953
+ return d.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
954
+ case 62:
955
+ return d.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
956
+ case 63:
957
+ return d.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
958
+ case 64:
959
+ return d.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
960
+ case 65:
961
+ return this.pushState("NODE"), 35;
962
+ case 66:
963
+ return this.pushState("NODE"), 35;
964
+ case 67:
965
+ return this.pushState("NODE"), 35;
966
+ case 68:
967
+ return this.pushState("NODE"), 35;
968
+ case 69:
969
+ return this.pushState("NODE"), 35;
970
+ case 70:
971
+ return this.pushState("NODE"), 35;
972
+ case 71:
973
+ return this.pushState("NODE"), 35;
974
+ case 72:
975
+ return d.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
976
+ case 73:
977
+ return this.pushState("BLOCK_ARROW"), d.getLogger().debug("LEX ARR START"), 37;
978
+ case 74:
979
+ return d.getLogger().debug("Lex: NODE_ID", x.yytext), 31;
980
+ case 75:
981
+ return d.getLogger().debug("Lex: EOF", x.yytext), 8;
982
+ case 76:
983
+ this.pushState("md_string");
984
+ break;
985
+ case 77:
986
+ this.pushState("md_string");
987
+ break;
988
+ case 78:
989
+ return "NODE_DESCR";
990
+ case 79:
991
+ this.popState();
992
+ break;
993
+ case 80:
994
+ d.getLogger().debug("Lex: Starting string"), this.pushState("string");
995
+ break;
996
+ case 81:
997
+ d.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
998
+ break;
999
+ case 82:
1000
+ return d.getLogger().debug("LEX: NODE_DESCR:", x.yytext), "NODE_DESCR";
1001
+ case 83:
1002
+ d.getLogger().debug("LEX POPPING"), this.popState();
1003
+ break;
1004
+ case 84:
1005
+ d.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
1006
+ break;
1007
+ case 85:
1008
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), d.getLogger().debug("Lex (right): dir:", x.yytext), "DIR";
1009
+ case 86:
1010
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), d.getLogger().debug("Lex (left):", x.yytext), "DIR";
1011
+ case 87:
1012
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), d.getLogger().debug("Lex (x):", x.yytext), "DIR";
1013
+ case 88:
1014
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), d.getLogger().debug("Lex (y):", x.yytext), "DIR";
1015
+ case 89:
1016
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), d.getLogger().debug("Lex (up):", x.yytext), "DIR";
1017
+ case 90:
1018
+ return x.yytext = x.yytext.replace(/^,\s*/, ""), d.getLogger().debug("Lex (down):", x.yytext), "DIR";
1019
+ case 91:
1020
+ return x.yytext = "]>", d.getLogger().debug("Lex (ARROW_DIR end):", x.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
1021
+ case 92:
1022
+ return d.getLogger().debug("Lex: LINK", "#" + x.yytext + "#"), 15;
1023
+ case 93:
1024
+ return d.getLogger().debug("Lex: LINK", x.yytext), 15;
1025
+ case 94:
1026
+ return d.getLogger().debug("Lex: LINK", x.yytext), 15;
1027
+ case 95:
1028
+ return d.getLogger().debug("Lex: LINK", x.yytext), 15;
1029
+ case 96:
1030
+ return d.getLogger().debug("Lex: START_LINK", x.yytext), this.pushState("LLABEL"), 16;
1031
+ case 97:
1032
+ return d.getLogger().debug("Lex: START_LINK", x.yytext), this.pushState("LLABEL"), 16;
1033
+ case 98:
1034
+ return d.getLogger().debug("Lex: START_LINK", x.yytext), this.pushState("LLABEL"), 16;
1035
+ case 99:
1036
+ this.pushState("md_string");
1037
+ break;
1038
+ case 100:
1039
+ return d.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
1040
+ case 101:
1041
+ return this.popState(), d.getLogger().debug("Lex: LINK", "#" + x.yytext + "#"), 15;
1042
+ case 102:
1043
+ return this.popState(), d.getLogger().debug("Lex: LINK", x.yytext), 15;
1044
+ case 103:
1045
+ return this.popState(), d.getLogger().debug("Lex: LINK", x.yytext), 15;
1046
+ case 104:
1047
+ return d.getLogger().debug("Lex: COLON", x.yytext), x.yytext = x.yytext.slice(1), 27;
1048
+ }
1049
+ }, "anonymous"),
1050
+ rules: [
1051
+ /^(?:block-beta\b)/,
1052
+ /^(?:block:)/,
1053
+ /^(?:block\b)/,
1054
+ /^(?:[\s]+)/,
1055
+ /^(?:[\n]+)/,
1056
+ /^(?:((\u000D\u000A)|(\u000A)))/,
1057
+ /^(?:columns\s+auto\b)/,
1058
+ /^(?:columns\s+[\d]+)/,
1059
+ /^(?:["][`])/,
1060
+ /^(?:[^`"]+)/,
1061
+ /^(?:[`]["])/,
1062
+ /^(?:["])/,
1063
+ /^(?:["])/,
1064
+ /^(?:[^"]*)/,
1065
+ /^(?:space[:]\d+)/,
1066
+ /^(?:space\b)/,
1067
+ /^(?:default\b)/,
1068
+ /^(?:linkStyle\b)/,
1069
+ /^(?:interpolate\b)/,
1070
+ /^(?:classDef\s+)/,
1071
+ /^(?:DEFAULT\s+)/,
1072
+ /^(?:\w+\s+)/,
1073
+ /^(?:[^\n]*)/,
1074
+ /^(?:class\s+)/,
1075
+ /^(?:(\w+)+((,\s*\w+)*))/,
1076
+ /^(?:[^\n]*)/,
1077
+ /^(?:style\s+)/,
1078
+ /^(?:(\w+)+((,\s*\w+)*))/,
1079
+ /^(?:[^\n]*)/,
1080
+ /^(?:accTitle\s*:\s*)/,
1081
+ /^(?:(?!\n||)*[^\n]*)/,
1082
+ /^(?:accDescr\s*:\s*)/,
1083
+ /^(?:(?!\n||)*[^\n]*)/,
1084
+ /^(?:accDescr\s*\{\s*)/,
1085
+ /^(?:[\}])/,
1086
+ /^(?:[^\}]*)/,
1087
+ /^(?:end\b\s*)/,
1088
+ /^(?:\(\(\()/,
1089
+ /^(?:\)\)\))/,
1090
+ /^(?:[\)]\))/,
1091
+ /^(?:\}\})/,
1092
+ /^(?:\})/,
1093
+ /^(?:\(-)/,
1094
+ /^(?:-\))/,
1095
+ /^(?:\(\()/,
1096
+ /^(?:\]\])/,
1097
+ /^(?:\()/,
1098
+ /^(?:\]\))/,
1099
+ /^(?:\\\])/,
1100
+ /^(?:\/\])/,
1101
+ /^(?:\)\])/,
1102
+ /^(?:[\)])/,
1103
+ /^(?:\]>)/,
1104
+ /^(?:[\]])/,
1105
+ /^(?:-\))/,
1106
+ /^(?:\(-)/,
1107
+ /^(?:\)\))/,
1108
+ /^(?:\))/,
1109
+ /^(?:\(\(\()/,
1110
+ /^(?:\(\()/,
1111
+ /^(?:\{\{)/,
1112
+ /^(?:\{)/,
1113
+ /^(?:>)/,
1114
+ /^(?:\(\[)/,
1115
+ /^(?:\()/,
1116
+ /^(?:\[\[)/,
1117
+ /^(?:\[\|)/,
1118
+ /^(?:\[\()/,
1119
+ /^(?:\)\)\))/,
1120
+ /^(?:\[\\)/,
1121
+ /^(?:\[\/)/,
1122
+ /^(?:\[\\)/,
1123
+ /^(?:\[)/,
1124
+ /^(?:<\[)/,
1125
+ /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,
1126
+ /^(?:$)/,
1127
+ /^(?:["][`])/,
1128
+ /^(?:["][`])/,
1129
+ /^(?:[^`"]+)/,
1130
+ /^(?:[`]["])/,
1131
+ /^(?:["])/,
1132
+ /^(?:["])/,
1133
+ /^(?:[^"]+)/,
1134
+ /^(?:["])/,
1135
+ /^(?:\]>\s*\()/,
1136
+ /^(?:,?\s*right\s*)/,
1137
+ /^(?:,?\s*left\s*)/,
1138
+ /^(?:,?\s*x\s*)/,
1139
+ /^(?:,?\s*y\s*)/,
1140
+ /^(?:,?\s*up\s*)/,
1141
+ /^(?:,?\s*down\s*)/,
1142
+ /^(?:\)\s*)/,
1143
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1144
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1145
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1146
+ /^(?:\s*~~[\~]+\s*)/,
1147
+ /^(?:\s*[xo<]?--\s*)/,
1148
+ /^(?:\s*[xo<]?==\s*)/,
1149
+ /^(?:\s*[xo<]?-\.\s*)/,
1150
+ /^(?:["][`])/,
1151
+ /^(?:["])/,
1152
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1153
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1154
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1155
+ /^(?::\d+)/
1156
+ ],
1157
+ conditions: {
1158
+ STYLE_DEFINITION: {
1159
+ rules: [28],
1160
+ inclusive: !1
1161
+ },
1162
+ STYLE_STMNT: {
1163
+ rules: [27],
1164
+ inclusive: !1
1165
+ },
1166
+ CLASSDEFID: {
1167
+ rules: [22],
1168
+ inclusive: !1
1169
+ },
1170
+ CLASSDEF: {
1171
+ rules: [20, 21],
1172
+ inclusive: !1
1173
+ },
1174
+ CLASS_STYLE: {
1175
+ rules: [25],
1176
+ inclusive: !1
1177
+ },
1178
+ CLASS: {
1179
+ rules: [24],
1180
+ inclusive: !1
1181
+ },
1182
+ LLABEL: {
1183
+ rules: [
1184
+ 99,
1185
+ 100,
1186
+ 101,
1187
+ 102,
1188
+ 103
1189
+ ],
1190
+ inclusive: !1
1191
+ },
1192
+ ARROW_DIR: {
1193
+ rules: [
1194
+ 85,
1195
+ 86,
1196
+ 87,
1197
+ 88,
1198
+ 89,
1199
+ 90,
1200
+ 91
1201
+ ],
1202
+ inclusive: !1
1203
+ },
1204
+ BLOCK_ARROW: {
1205
+ rules: [
1206
+ 76,
1207
+ 81,
1208
+ 84
1209
+ ],
1210
+ inclusive: !1
1211
+ },
1212
+ NODE: {
1213
+ rules: [
1214
+ 37,
1215
+ 38,
1216
+ 39,
1217
+ 40,
1218
+ 41,
1219
+ 42,
1220
+ 43,
1221
+ 44,
1222
+ 45,
1223
+ 46,
1224
+ 47,
1225
+ 48,
1226
+ 49,
1227
+ 50,
1228
+ 51,
1229
+ 52,
1230
+ 53,
1231
+ 77,
1232
+ 80
1233
+ ],
1234
+ inclusive: !1
1235
+ },
1236
+ md_string: {
1237
+ rules: [
1238
+ 9,
1239
+ 10,
1240
+ 78,
1241
+ 79
1242
+ ],
1243
+ inclusive: !1
1244
+ },
1245
+ space: {
1246
+ rules: [],
1247
+ inclusive: !1
1248
+ },
1249
+ string: {
1250
+ rules: [
1251
+ 12,
1252
+ 13,
1253
+ 82,
1254
+ 83
1255
+ ],
1256
+ inclusive: !1
1257
+ },
1258
+ acc_descr_multiline: {
1259
+ rules: [34, 35],
1260
+ inclusive: !1
1261
+ },
1262
+ acc_descr: {
1263
+ rules: [32],
1264
+ inclusive: !1
1265
+ },
1266
+ acc_title: {
1267
+ rules: [30],
1268
+ inclusive: !1
1269
+ },
1270
+ INITIAL: {
1271
+ rules: [
1272
+ 0,
1273
+ 1,
1274
+ 2,
1275
+ 3,
1276
+ 4,
1277
+ 5,
1278
+ 6,
1279
+ 7,
1280
+ 8,
1281
+ 11,
1282
+ 14,
1283
+ 15,
1284
+ 16,
1285
+ 17,
1286
+ 18,
1287
+ 19,
1288
+ 23,
1289
+ 26,
1290
+ 29,
1291
+ 31,
1292
+ 33,
1293
+ 36,
1294
+ 54,
1295
+ 55,
1296
+ 56,
1297
+ 57,
1298
+ 58,
1299
+ 59,
1300
+ 60,
1301
+ 61,
1302
+ 62,
1303
+ 63,
1304
+ 64,
1305
+ 65,
1306
+ 66,
1307
+ 67,
1308
+ 68,
1309
+ 69,
1310
+ 70,
1311
+ 71,
1312
+ 72,
1313
+ 73,
1314
+ 74,
1315
+ 75,
1316
+ 92,
1317
+ 93,
1318
+ 94,
1319
+ 95,
1320
+ 96,
1321
+ 97,
1322
+ 98,
1323
+ 104
1324
+ ],
1325
+ inclusive: !0
1326
+ }
1327
+ }
1328
+ };
1329
+ })();
1330
+ function $() {
1331
+ this.yy = {};
1332
+ }
1333
+ return g($, "Parser"), $.prototype = L, L.Parser = $, new $();
1334
+ })();
1335
+ ft.parser = ft;
1336
+ var ir = ft, W = /* @__PURE__ */ new Map(), $t = [], mt = /* @__PURE__ */ new Map(), Rt = "color", zt = "fill", sr = "bgFill", Ht = ",", nr = O(), st = /* @__PURE__ */ new Map(), wt = "", lr = /* @__PURE__ */ g((e) => ke.sanitizeText(e, nr), "sanitizeText"), or = /* @__PURE__ */ g(function(e, t = "") {
1337
+ let a = st.get(e);
1338
+ a || (a = {
1339
+ id: e,
1340
+ styles: [],
1341
+ textStyles: []
1342
+ }, st.set(e, a)), t?.split(Ht).forEach((n) => {
1343
+ let i = n.replace(/([^;]*);/, "$1").trim();
1344
+ if (RegExp(Rt).exec(n)) {
1345
+ let r = i.replace(zt, sr).replace(Rt, zt);
1346
+ a.textStyles.push(r);
1347
+ }
1348
+ a.styles.push(i);
1349
+ });
1350
+ }, "addStyleClass"), cr = /* @__PURE__ */ g(function(e, t = "") {
1351
+ let a = W.get(e);
1352
+ t != null && (a.styles = t.split(Ht));
1353
+ }, "addStyle2Node"), dr = /* @__PURE__ */ g(function(e, t) {
1354
+ e.split(",").forEach(function(a) {
1355
+ let n = W.get(a);
1356
+ if (n === void 0) {
1357
+ let i = a.trim();
1358
+ n = {
1359
+ id: i,
1360
+ type: "na",
1361
+ children: []
1362
+ }, W.set(i, n);
1363
+ }
1364
+ n.classes ||= [], n.classes.push(t);
1365
+ });
1366
+ }, "setCssClass"), Kt = /* @__PURE__ */ g((e, t) => {
1367
+ let a = e.flat(), n = [], i = a.find((r) => r?.type === "column-setting")?.columns ?? -1;
1368
+ for (let r of a) {
1369
+ if (typeof i == "number" && i > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > i && S.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${i}`), r.label &&= lr(r.label), r.type === "classDef") {
1370
+ or(r.id, r.css);
1371
+ continue;
1372
+ }
1373
+ if (r.type === "applyClass") {
1374
+ dr(r.id, r?.styleClass ?? "");
1375
+ continue;
1376
+ }
1377
+ if (r.type === "applyStyles") {
1378
+ r?.stylesStr && cr(r.id, r?.stylesStr);
1379
+ continue;
1380
+ }
1381
+ if (r.type === "column-setting") t.columns = r.columns ?? -1;
1382
+ else if (r.type === "edge") {
1383
+ let s = (mt.get(r.id) ?? 0) + 1;
1384
+ mt.set(r.id, s), r.id = s + "-" + r.id, $t.push(r);
1385
+ } else {
1386
+ r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
1387
+ let s = W.get(r.id);
1388
+ if (s === void 0 ? W.set(r.id, r) : (r.type !== "na" && (s.type = r.type), r.label !== r.id && (s.label = r.label)), r.children && Kt(r.children, r), r.type === "space") {
1389
+ let l = r.width ?? 1;
1390
+ for (let o = 0; o < l; o++) {
1391
+ let p = Qe(r);
1392
+ p.id = p.id + "-" + o, W.set(p.id, p), n.push(p);
1393
+ }
1394
+ } else s === void 0 && n.push(r);
1395
+ }
1396
+ }
1397
+ t.children = n;
1398
+ }, "populateBlockDatabase"), St = [], Q = {
1399
+ id: "root",
1400
+ type: "composite",
1401
+ children: [],
1402
+ columns: -1
1403
+ }, hr = /* @__PURE__ */ g(() => {
1404
+ S.debug("Clear called"), pe(), Q = {
1405
+ id: "root",
1406
+ type: "composite",
1407
+ children: [],
1408
+ columns: -1
1409
+ }, W = /* @__PURE__ */ new Map([["root", Q]]), St = [], st = /* @__PURE__ */ new Map(), $t = [], mt = /* @__PURE__ */ new Map(), wt = "";
1410
+ }, "clear");
1411
+ function Ut(e) {
1412
+ switch (S.debug("typeStr2Type", e), e) {
1413
+ case "[]":
1414
+ return "square";
1415
+ case "()":
1416
+ return S.debug("we have a round"), "round";
1417
+ case "(())":
1418
+ return "circle";
1419
+ case ">]":
1420
+ return "rect_left_inv_arrow";
1421
+ case "{}":
1422
+ return "diamond";
1423
+ case "{{}}":
1424
+ return "hexagon";
1425
+ case "([])":
1426
+ return "stadium";
1427
+ case "[[]]":
1428
+ return "subroutine";
1429
+ case "[()]":
1430
+ return "cylinder";
1431
+ case "((()))":
1432
+ return "doublecircle";
1433
+ case "[//]":
1434
+ return "lean_right";
1435
+ case "[\\\\]":
1436
+ return "lean_left";
1437
+ case "[/\\]":
1438
+ return "trapezoid";
1439
+ case "[\\/]":
1440
+ return "inv_trapezoid";
1441
+ case "<[]>":
1442
+ return "block_arrow";
1443
+ default:
1444
+ return "na";
1445
+ }
1446
+ }
1447
+ g(Ut, "typeStr2Type");
1448
+ function qt(e) {
1449
+ return (S.debug("typeStr2Type", e), e) === "==" ? "thick" : "normal";
1450
+ }
1451
+ g(qt, "edgeTypeStr2Type");
1452
+ function Zt(e) {
1453
+ switch (e.trim().slice(-1)) {
1454
+ case "x":
1455
+ return "arrow_cross";
1456
+ case "o":
1457
+ return "arrow_circle";
1458
+ case ">":
1459
+ return "arrow_point";
1460
+ default:
1461
+ return "";
1462
+ }
1463
+ }
1464
+ g(Zt, "edgeStrToEdgeData");
1465
+ function Gt(e) {
1466
+ switch (e.trim().charAt(0)) {
1467
+ case "x":
1468
+ return "arrow_cross";
1469
+ case "o":
1470
+ return "arrow_circle";
1471
+ case "<":
1472
+ return "arrow_point";
1473
+ default:
1474
+ return "arrow_open";
1475
+ }
1476
+ }
1477
+ g(Gt, "edgeStrToEdgeStartData");
1478
+ function Jt(e) {
1479
+ return e.includes("==") ? "thick" : "normal";
1480
+ }
1481
+ g(Jt, "edgeStrToThickness");
1482
+ function Vt(e) {
1483
+ return e.includes(".-") ? "dotted" : "solid";
1484
+ }
1485
+ g(Vt, "edgeStrToPattern");
1486
+ var At = 0, gr = {
1487
+ getConfig: /* @__PURE__ */ g(() => tt().block, "getConfig"),
1488
+ typeStr2Type: Ut,
1489
+ edgeTypeStr2Type: qt,
1490
+ edgeStrToEdgeData: Zt,
1491
+ edgeStrToEdgeStartData: Gt,
1492
+ edgeStrToThickness: Jt,
1493
+ edgeStrToPattern: Vt,
1494
+ getLogger: /* @__PURE__ */ g(() => S, "getLogger"),
1495
+ getBlocksFlat: /* @__PURE__ */ g(() => [...W.values()], "getBlocksFlat"),
1496
+ getBlocks: /* @__PURE__ */ g(() => St || [], "getBlocks"),
1497
+ getEdges: /* @__PURE__ */ g(() => $t, "getEdges"),
1498
+ setHierarchy: /* @__PURE__ */ g((e) => {
1499
+ Q.children = e, Kt(e, Q), St = Q.children;
1500
+ }, "setHierarchy"),
1501
+ getBlock: /* @__PURE__ */ g((e) => W.get(e), "getBlock"),
1502
+ setBlock: /* @__PURE__ */ g((e) => {
1503
+ W.set(e.id, e);
1504
+ }, "setBlock"),
1505
+ getColumns: /* @__PURE__ */ g((e) => {
1506
+ let t = W.get(e);
1507
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
1508
+ }, "getColumns"),
1509
+ getClasses: /* @__PURE__ */ g(function() {
1510
+ return st;
1511
+ }, "getClasses"),
1512
+ clear: hr,
1513
+ generateId: /* @__PURE__ */ g(() => (At++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + At), "generateId"),
1514
+ setDiagramId: /* @__PURE__ */ g((e) => {
1515
+ wt = e;
1516
+ }, "setDiagramId"),
1517
+ getDiagramId: /* @__PURE__ */ g(() => wt, "getDiagramId")
1518
+ }, bt = /* @__PURE__ */ g((e, t) => {
1519
+ let a = Ze;
1520
+ return xe(a(e, "r"), a(e, "g"), a(e, "b"), t);
1521
+ }, "fade"), ur = /* @__PURE__ */ g((e) => `.label {
1522
+ font-family: ${e.fontFamily};
1523
+ color: ${e.nodeTextColor || e.textColor};
1524
+ }
1525
+ .cluster-label text {
1526
+ fill: ${e.titleColor};
1527
+ }
1528
+ .cluster-label span,p {
1529
+ color: ${e.titleColor};
1530
+ }
1531
+
1532
+
1533
+
1534
+ .label text,span,p {
1535
+ fill: ${e.nodeTextColor || e.textColor};
1536
+ color: ${e.nodeTextColor || e.textColor};
1537
+ }
1538
+
1539
+ .node rect,
1540
+ .node circle,
1541
+ .node ellipse,
1542
+ .node polygon,
1543
+ .node path {
1544
+ fill: ${e.mainBkg};
1545
+ stroke: ${e.nodeBorder};
1546
+ stroke-width: 1px;
1547
+ }
1548
+ .flowchart-label text {
1549
+ text-anchor: middle;
1550
+ }
1551
+ // .flowchart-label .text-outer-tspan {
1552
+ // text-anchor: middle;
1553
+ // }
1554
+ // .flowchart-label .text-inner-tspan {
1555
+ // text-anchor: start;
1556
+ // }
1557
+
1558
+ .node .label {
1559
+ text-align: center;
1560
+ }
1561
+ .node.clickable {
1562
+ cursor: pointer;
1563
+ }
1564
+
1565
+ .arrowheadPath {
1566
+ fill: ${e.arrowheadColor};
1567
+ }
1568
+
1569
+ .edgePath .path {
1570
+ stroke: ${e.lineColor};
1571
+ stroke-width: 2.0px;
1572
+ }
1573
+
1574
+ .flowchart-link {
1575
+ stroke: ${e.lineColor};
1576
+ fill: none;
1577
+ }
1578
+
1579
+ .edgeLabel {
1580
+ background-color: ${e.edgeLabelBackground};
1581
+ /*
1582
+ * This is for backward compatibility with existing code that didn't
1583
+ * add a \`<p>\` around edge labels.
1584
+ *
1585
+ * TODO: We should probably remove this in a future release.
1586
+ */
1587
+ p {
1588
+ margin: 0;
1589
+ padding: 0;
1590
+ display: inline;
1591
+ }
1592
+ rect {
1593
+ opacity: 0.5;
1594
+ background-color: ${e.edgeLabelBackground};
1595
+ fill: ${e.edgeLabelBackground};
1596
+ }
1597
+ text-align: center;
1598
+ }
1599
+
1600
+ /* For html labels only */
1601
+ .labelBkg {
1602
+ background-color: ${e.edgeLabelBackground};
1603
+ }
1604
+
1605
+ .node .cluster {
1606
+ // fill: ${bt(e.mainBkg, 0.5)};
1607
+ fill: ${bt(e.clusterBkg, 0.5)};
1608
+ stroke: ${bt(e.clusterBorder, 0.2)};
1609
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
1610
+ stroke-width: 1px;
1611
+ }
1612
+
1613
+ .cluster text {
1614
+ fill: ${e.titleColor};
1615
+ }
1616
+
1617
+ .cluster span,p {
1618
+ color: ${e.titleColor};
1619
+ }
1620
+ /* .cluster div {
1621
+ color: ${e.titleColor};
1622
+ } */
1623
+
1624
+ div.mermaidTooltip {
1625
+ position: absolute;
1626
+ text-align: center;
1627
+ max-width: 200px;
1628
+ padding: 2px;
1629
+ font-family: ${e.fontFamily};
1630
+ font-size: 12px;
1631
+ background: ${e.tertiaryColor};
1632
+ border: 1px solid ${e.border2};
1633
+ border-radius: 2px;
1634
+ pointer-events: none;
1635
+ z-index: 100;
1636
+ }
1637
+
1638
+ .flowchartTitleText {
1639
+ text-anchor: middle;
1640
+ font-size: 18px;
1641
+ fill: ${e.textColor};
1642
+ }
1643
+ ${Ge()}
1644
+ `, "getStyles"), yr = /* @__PURE__ */ g((e, t, a, n) => {
1645
+ t.forEach((i) => {
1646
+ pr[i](e, a, n);
1647
+ });
1648
+ }, "insertMarkers"), pr = {
1649
+ extension: /* @__PURE__ */ g((e, t, a) => {
1650
+ S.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
1651
+ }, "extension"),
1652
+ composition: /* @__PURE__ */ g((e, t, a) => {
1653
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1654
+ }, "composition"),
1655
+ aggregation: /* @__PURE__ */ g((e, t, a) => {
1656
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
1657
+ }, "aggregation"),
1658
+ dependency: /* @__PURE__ */ g((e, t, a) => {
1659
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
1660
+ }, "dependency"),
1661
+ lollipop: /* @__PURE__ */ g((e, t, a) => {
1662
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
1663
+ }, "lollipop"),
1664
+ point: /* @__PURE__ */ g((e, t, a) => {
1665
+ e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1666
+ }, "point"),
1667
+ circle: /* @__PURE__ */ g((e, t, a) => {
1668
+ e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
1669
+ }, "circle"),
1670
+ cross: /* @__PURE__ */ g((e, t, a) => {
1671
+ e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
1672
+ }, "cross"),
1673
+ barb: /* @__PURE__ */ g((e, t, a) => {
1674
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
1675
+ }, "barb")
1676
+ }, xr = yr, T = O()?.block?.padding ?? 8;
1677
+ function kt(e, t) {
1678
+ if (e === 0 || !Number.isInteger(e)) throw Error("Columns must be an integer !== 0.");
1679
+ if (t < 0 || !Number.isInteger(t)) throw Error("Position must be a non-negative integer." + t);
1680
+ return e < 0 ? {
1681
+ px: t,
1682
+ py: 0
1683
+ } : e === 1 ? {
1684
+ px: 0,
1685
+ py: t
1686
+ } : {
1687
+ px: t % e,
1688
+ py: Math.floor(t / e)
1689
+ };
1690
+ }
1691
+ g(kt, "calculateBlockPosition");
1692
+ var br = /* @__PURE__ */ g((e) => {
1693
+ let t = 0, a = 0;
1694
+ for (let n of e.children) {
1695
+ let { width: i, height: r, x: s, y: l } = n.size ?? {
1696
+ width: 0,
1697
+ height: 0,
1698
+ x: 0,
1699
+ y: 0
1700
+ };
1701
+ if (S.debug("getMaxChildSize abc95 child:", n.id, "width:", i, "height:", r, "x:", s, "y:", l, n.type), n.type === "space") continue;
1702
+ let o = i / (n.widthInColumns ?? 1);
1703
+ o > t && (t = o), r > a && (a = r);
1704
+ }
1705
+ return {
1706
+ width: t,
1707
+ height: a
1708
+ };
1709
+ }, "getMaxChildSize");
1710
+ function nt(e, t, a = 0, n = 0) {
1711
+ S.debug("setBlockSizes abc95 (start)", e.id, e?.size?.x, "block width =", e?.size, "siblingWidth", a), e?.size?.width || (e.size = {
1712
+ width: a,
1713
+ height: n,
1714
+ x: 0,
1715
+ y: 0
1716
+ });
1717
+ let i = 0, r = 0;
1718
+ if (e.children?.length > 0) {
1719
+ for (let b of e.children) nt(b, t);
1720
+ let s = br(e);
1721
+ i = s.width, r = s.height, S.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", i, r);
1722
+ for (let b of e.children) b.size && (S.debug(`abc95 Setting size of children of ${e.id} id=${b.id} ${i} ${r} ${JSON.stringify(b.size)}`), b.size.width = i * (b.widthInColumns ?? 1) + T * ((b.widthInColumns ?? 1) - 1), b.size.height = r, b.size.x = 0, b.size.y = 0, S.debug(`abc95 updating size of ${e.id} children child:${b.id} maxWidth:${i} maxHeight:${r}`));
1723
+ for (let b of e.children) nt(b, t, i, r);
1724
+ let l = e.columns ?? -1, o = 0;
1725
+ for (let b of e.children) o += b.widthInColumns ?? 1;
1726
+ let p = e.children.length;
1727
+ l > 0 && l < o && (p = l);
1728
+ let c = Math.ceil(o / p), u = p * (i + T) + T, m = c * (r + T) + T;
1729
+ if (u < a) {
1730
+ S.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${n} width ${u}`), u = a, m = n;
1731
+ let b = (a - p * T - T) / p, w = (n - c * T - T) / c;
1732
+ S.debug("Size indata abc88", e.id, "childWidth", b, "maxWidth", i), S.debug("Size indata abc88", e.id, "childHeight", w, "maxHeight", r), S.debug("Size indata abc88 xSize", p, "padding", T);
1733
+ for (let k of e.children) k.size && (k.size.width = b, k.size.height = w, k.size.x = 0, k.size.y = 0);
1734
+ }
1735
+ if (S.debug(`abc95 (finale calc) ${e.id} xSize ${p} ySize ${c} columns ${l}${e.children.length} width=${Math.max(u, e.size?.width || 0)}`), u < (e?.size?.width || 0)) {
1736
+ u = e?.size?.width || 0;
1737
+ let b = l > 0 ? Math.min(e.children.length, l) : e.children.length;
1738
+ if (b > 0) {
1739
+ let w = (u - b * T - T) / b;
1740
+ S.debug("abc95 (growing to fit) width", e.id, u, e.size?.width, w);
1741
+ for (let k of e.children) k.size && (k.size.width = w);
1742
+ }
1743
+ }
1744
+ e.size = {
1745
+ width: u,
1746
+ height: m,
1747
+ x: 0,
1748
+ y: 0
1749
+ };
1750
+ }
1751
+ S.debug("setBlockSizes abc94 (done)", e.id, e?.size?.x, e?.size?.width, e?.size?.y, e?.size?.height);
1752
+ }
1753
+ g(nt, "setBlockSizes");
1754
+ function Dt(e, t) {
1755
+ S.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1756
+ let a = e.columns ?? -1;
1757
+ if (S.debug("layoutBlocks columns abc95", e.id, "=>", a, e), e.children && e.children.length > 0) {
1758
+ let n = e?.children[0]?.size?.width ?? 0, i = e.children.length * n + (e.children.length - 1) * T;
1759
+ S.debug("widthOfChildren 88", i, "posX");
1760
+ let r = /* @__PURE__ */ new Map();
1761
+ {
1762
+ let c = 0;
1763
+ for (let u of e.children) {
1764
+ if (!u.size) continue;
1765
+ let { py: m } = kt(a, c), b = r.get(m) ?? 0;
1766
+ u.size.height > b && r.set(m, u.size.height);
1767
+ let w = u?.widthInColumns ?? 1;
1768
+ a > 0 && (w = Math.min(w, a - c % a)), c += w;
1769
+ }
1770
+ }
1771
+ let s = /* @__PURE__ */ new Map();
1772
+ {
1773
+ let c = 0, u = [...r.keys()].sort((m, b) => m - b);
1774
+ for (let m of u) s.set(m, c), c += (r.get(m) ?? 0) + T;
1775
+ }
1776
+ let l = 0;
1777
+ S.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1778
+ let o = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -T, p = 0;
1779
+ for (let c of e.children) {
1780
+ let u = e;
1781
+ if (!c.size) continue;
1782
+ let { width: m, height: b } = c.size, { px: w, py: k } = kt(a, l);
1783
+ if (k != p && (p = k, o = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -T, S.debug("New row in layout for block", e.id, " and child ", c.id, p)), S.debug(`abc89 layout blocks (child) id: ${c.id} Pos: ${l} (px, py) ${w},${k} (${u?.size?.x},${u?.size?.y}) parent: ${u.id} width: ${m}${T}`), u.size) {
1784
+ let $ = m / 2;
1785
+ c.size.x = o + T + $, S.debug(`abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${o} new startingPosX${c.size.x} ${$} padding=${T} width=${m} halfWidth=${$} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${m * (c?.widthInColumns ?? 1) / 2}`), o = c.size.x + $;
1786
+ let d = s.get(k) ?? 0, x = r.get(k) ?? b;
1787
+ c.size.y = u.size.y - u.size.height / 2 + d + x / 2 + T, S.debug(`abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${o}${T}${$}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${m * (c?.widthInColumns ?? 1) / 2}`);
1788
+ }
1789
+ c.children && Dt(c);
1790
+ let L = c?.widthInColumns ?? 1;
1791
+ a > 0 && (L = Math.min(L, a - l % a)), l += L, S.debug("abc88 columnsPos", c, l);
1792
+ }
1793
+ }
1794
+ S.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
1795
+ }
1796
+ g(Dt, "layoutBlocks");
1797
+ function vt(e, { minX: t, minY: a, maxX: n, maxY: i } = {
1798
+ minX: 0,
1799
+ minY: 0,
1800
+ maxX: 0,
1801
+ maxY: 0
1802
+ }) {
1803
+ if (e.size && e.id !== "root") {
1804
+ let { x: r, y: s, width: l, height: o } = e.size;
1805
+ r - l / 2 < t && (t = r - l / 2), s - o / 2 < a && (a = s - o / 2), r + l / 2 > n && (n = r + l / 2), s + o / 2 > i && (i = s + o / 2);
1806
+ }
1807
+ if (e.children) for (let r of e.children) ({ minX: t, minY: a, maxX: n, maxY: i } = vt(r, {
1808
+ minX: t,
1809
+ minY: a,
1810
+ maxX: n,
1811
+ maxY: i
1812
+ }));
1813
+ return {
1814
+ minX: t,
1815
+ minY: a,
1816
+ maxX: n,
1817
+ maxY: i
1818
+ };
1819
+ }
1820
+ g(vt, "findBounds");
1821
+ function Qt(e) {
1822
+ let t = e.getBlock("root");
1823
+ if (!t) return;
1824
+ nt(t, e, 0, 0), Dt(t), S.debug("getBlocks", JSON.stringify(t, null, 2));
1825
+ let { minX: a, minY: n, maxX: i, maxY: r } = vt(t), s = r - n;
1826
+ return {
1827
+ x: a,
1828
+ y: n,
1829
+ width: i - a,
1830
+ height: s
1831
+ };
1832
+ }
1833
+ g(Qt, "layout");
1834
+ var X = /* @__PURE__ */ g(async (e, t, a, n = !1, i = !1) => {
1835
+ let r = t || "";
1836
+ typeof r == "object" && (r = r[0]);
1837
+ let s = O(), l = z(s);
1838
+ return await Et(e, r, {
1839
+ style: a,
1840
+ isTitle: n,
1841
+ useHtmlLabels: l,
1842
+ markdown: !1,
1843
+ isNode: i,
1844
+ width: 1 / 0
1845
+ }, s);
1846
+ }, "createLabel"), fr = /* @__PURE__ */ g((e, t, a, n, i) => {
1847
+ t.arrowTypeStart && Mt(e, "start", t.arrowTypeStart, a, n, i), t.arrowTypeEnd && Mt(e, "end", t.arrowTypeEnd, a, n, i);
1848
+ }, "addEdgeMarkers"), mr = {
1849
+ arrow_cross: "cross",
1850
+ arrow_point: "point",
1851
+ arrow_barb: "barb",
1852
+ arrow_circle: "circle",
1853
+ aggregation: "aggregation",
1854
+ extension: "extension",
1855
+ composition: "composition",
1856
+ dependency: "dependency",
1857
+ lollipop: "lollipop"
1858
+ }, Mt = /* @__PURE__ */ g((e, t, a, n, i, r) => {
1859
+ let s = mr[a];
1860
+ if (!s) {
1861
+ S.warn(`Unknown arrow type: ${a}`);
1862
+ return;
1863
+ }
1864
+ let l = t === "start" ? "Start" : "End";
1865
+ e.attr(`marker-${t}`, `url(${n}#${i}_${r}-${s}${l})`);
1866
+ }, "addEdgeMarker"), Lt = {}, C = {}, wr = /* @__PURE__ */ g(async (e, t) => {
1867
+ let a = O(), n = z(a), i = e.insert("g").attr("class", "edgeLabel"), r = i.insert("g").attr("class", "label"), s = t.labelType === "markdown", l = await Et(e, t.label, {
1868
+ style: t.labelStyle,
1869
+ useHtmlLabels: n,
1870
+ addSvgBackground: s,
1871
+ isNode: !1,
1872
+ markdown: s,
1873
+ width: s ? void 0 : 1 / 0
1874
+ }, a);
1875
+ r.node().appendChild(l);
1876
+ let o = l.getBBox(), p = o;
1877
+ if (n) {
1878
+ let u = l.children[0], m = v(l);
1879
+ o = u.getBoundingClientRect(), p = o, m.attr("width", o.width), m.attr("height", o.height);
1880
+ } else {
1881
+ let u = v(l).select("text").node();
1882
+ u && typeof u.getBBox == "function" && (p = u.getBBox());
1883
+ }
1884
+ r.attr("transform", G(p, n)), Lt[t.id] = i, t.width = o.width, t.height = o.height;
1885
+ let c;
1886
+ if (t.startLabelLeft) {
1887
+ let u = e.insert("g").attr("class", "edgeTerminals"), m = u.insert("g").attr("class", "inner"), b = await X(m, t.startLabelLeft, t.labelStyle);
1888
+ c = b;
1889
+ let w = b.getBBox();
1890
+ if (n) {
1891
+ let k = b.children[0], L = v(b);
1892
+ w = k.getBoundingClientRect(), L.attr("width", w.width), L.attr("height", w.height);
1893
+ }
1894
+ m.attr("transform", G(w, n)), C[t.id] || (C[t.id] = {}), C[t.id].startLeft = u, V(c, t.startLabelLeft);
1895
+ }
1896
+ if (t.startLabelRight) {
1897
+ let u = e.insert("g").attr("class", "edgeTerminals"), m = u.insert("g").attr("class", "inner"), b = await X(m, t.startLabelRight, t.labelStyle);
1898
+ c = b;
1899
+ let w = b.getBBox();
1900
+ if (n) {
1901
+ let k = b.children[0], L = v(b);
1902
+ w = k.getBoundingClientRect(), L.attr("width", w.width), L.attr("height", w.height);
1903
+ }
1904
+ m.attr("transform", G(w, n)), C[t.id] || (C[t.id] = {}), C[t.id].startRight = u, V(c, t.startLabelRight);
1905
+ }
1906
+ if (t.endLabelLeft) {
1907
+ let u = e.insert("g").attr("class", "edgeTerminals"), m = u.insert("g").attr("class", "inner"), b = await X(u, t.endLabelLeft, t.labelStyle);
1908
+ c = b;
1909
+ let w = b.getBBox();
1910
+ if (n) {
1911
+ let k = b.children[0], L = v(b);
1912
+ w = k.getBoundingClientRect(), L.attr("width", w.width), L.attr("height", w.height);
1913
+ }
1914
+ m.attr("transform", G(w, n)), C[t.id] || (C[t.id] = {}), C[t.id].endLeft = u, V(c, t.endLabelLeft);
1915
+ }
1916
+ if (t.endLabelRight) {
1917
+ let u = e.insert("g").attr("class", "edgeTerminals"), m = u.insert("g").attr("class", "inner"), b = await X(u, t.endLabelRight, t.labelStyle);
1918
+ c = b;
1919
+ let w = b.getBBox();
1920
+ if (n) {
1921
+ let k = b.children[0], L = v(b);
1922
+ w = k.getBoundingClientRect(), L.attr("width", w.width), L.attr("height", w.height);
1923
+ }
1924
+ m.attr("transform", G(w, n)), C[t.id] || (C[t.id] = {}), C[t.id].endRight = u, V(c, t.endLabelRight);
1925
+ }
1926
+ return l;
1927
+ }, "insertEdgeLabel");
1928
+ function V(e, t) {
1929
+ z(O()) && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1930
+ }
1931
+ g(V, "setTerminalWidth");
1932
+ var Sr = /* @__PURE__ */ g((e, t) => {
1933
+ S.debug("Moving label abc88 ", e.id, e.label, Lt[e.id], t);
1934
+ let a = t.updatedPath ? t.updatedPath : t.originalPath, { subGraphTitleTotalMargin: n } = Se(O());
1935
+ if (e.label) {
1936
+ let i = Lt[e.id], r = e.x, s = e.y;
1937
+ if (a) {
1938
+ let l = J.calcLabelPosition(a);
1939
+ S.debug("Moving label " + e.label + " from (", r, ",", s, ") to (", l.x, ",", l.y, ") abc88"), t.updatedPath && (r = l.x, s = l.y);
1940
+ }
1941
+ i.attr("transform", `translate(${r}, ${s + n / 2})`);
1942
+ }
1943
+ if (e.startLabelLeft) {
1944
+ let i = C[e.id].startLeft, r = e.x, s = e.y;
1945
+ if (a) {
1946
+ let l = J.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1947
+ r = l.x, s = l.y;
1948
+ }
1949
+ i.attr("transform", `translate(${r}, ${s})`);
1950
+ }
1951
+ if (e.startLabelRight) {
1952
+ let i = C[e.id].startRight, r = e.x, s = e.y;
1953
+ if (a) {
1954
+ let l = J.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_right", a);
1955
+ r = l.x, s = l.y;
1956
+ }
1957
+ i.attr("transform", `translate(${r}, ${s})`);
1958
+ }
1959
+ if (e.endLabelLeft) {
1960
+ let i = C[e.id].endLeft, r = e.x, s = e.y;
1961
+ if (a) {
1962
+ let l = J.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1963
+ r = l.x, s = l.y;
1964
+ }
1965
+ i.attr("transform", `translate(${r}, ${s})`);
1966
+ }
1967
+ if (e.endLabelRight) {
1968
+ let i = C[e.id].endRight, r = e.x, s = e.y;
1969
+ if (a) {
1970
+ let l = J.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1971
+ r = l.x, s = l.y;
1972
+ }
1973
+ i.attr("transform", `translate(${r}, ${s})`);
1974
+ }
1975
+ }, "positionEdgeLabel"), kr = /* @__PURE__ */ g((e, t) => {
1976
+ let a = e.x, n = e.y, i = Math.abs(t.x - a), r = Math.abs(t.y - n), s = e.width / 2, l = e.height / 2;
1977
+ return i >= s || r >= l;
1978
+ }, "outsideNode"), Lr = /* @__PURE__ */ g((e, t, a) => {
1979
+ S.debug(`intersection calc abc89:
1980
+ outsidePoint: ${JSON.stringify(t)}
1981
+ insidePoint : ${JSON.stringify(a)}
1982
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1983
+ let n = e.x, i = e.y, r = Math.abs(n - a.x), s = e.width / 2, l = a.x < t.x ? s - r : s + r, o = e.height / 2, p = Math.abs(t.y - a.y), c = Math.abs(t.x - a.x);
1984
+ if (Math.abs(i - t.y) * s > Math.abs(n - t.x) * o) {
1985
+ let u = a.y < t.y ? t.y - o - i : i - o - t.y;
1986
+ l = c * u / p;
1987
+ let m = {
1988
+ x: a.x < t.x ? a.x + l : a.x - c + l,
1989
+ y: a.y < t.y ? a.y + p - u : a.y - p + u
1990
+ };
1991
+ return l === 0 && (m.x = t.x, m.y = t.y), c === 0 && (m.x = t.x), p === 0 && (m.y = t.y), S.debug(`abc89 topp/bott calc, Q ${p}, q ${u}, R ${c}, r ${l}`, m), m;
1992
+ } else {
1993
+ l = a.x < t.x ? t.x - s - n : n - s - t.x;
1994
+ let u = p * l / c, m = a.x < t.x ? a.x + c - l : a.x - c + l, b = a.y < t.y ? a.y + u : a.y - u;
1995
+ return S.debug(`sides calc abc89, Q ${p}, q ${u}, R ${c}, r ${l}`, {
1996
+ _x: m,
1997
+ _y: b
1998
+ }), l === 0 && (m = t.x, b = t.y), c === 0 && (m = t.x), p === 0 && (b = t.y), {
1999
+ x: m,
2000
+ y: b
2001
+ };
2002
+ }
2003
+ }, "intersection"), Pt = /* @__PURE__ */ g((e, t) => {
2004
+ S.debug("abc88 cutPathAtIntersect", e, t);
2005
+ let a = [], n = e[0], i = !1;
2006
+ return e.forEach((r) => {
2007
+ if (!kr(t, r) && !i) {
2008
+ let s = Lr(t, n, r), l = !1;
2009
+ a.forEach((o) => {
2010
+ l ||= o.x === s.x && o.y === s.y;
2011
+ }), a.some((o) => o.x === s.x && o.y === s.y) || a.push(s), i = !0;
2012
+ } else n = r, i || a.push(r);
2013
+ }), a;
2014
+ }, "cutPathAtIntersect"), _r = /* @__PURE__ */ g(function(e, t, a, n, i, r, s) {
2015
+ let l = a.points;
2016
+ S.debug("abc88 InsertEdge: edge=", a, "e=", t);
2017
+ let o = !1, p = r.node(t.v);
2018
+ var c = r.node(t.w);
2019
+ c?.intersect && p?.intersect && (l = l.slice(1, a.points.length - 1), l.unshift(p.intersect(l[0])), l.push(c.intersect(l[l.length - 1]))), a.toCluster && (S.debug("to cluster abc88", n[a.toCluster]), l = Pt(a.points, n[a.toCluster].node), o = !0), a.fromCluster && (S.debug("from cluster abc88", n[a.fromCluster]), l = Pt(l.reverse(), n[a.fromCluster].node).reverse(), o = !0);
2020
+ let u = l.filter((_) => !Number.isNaN(_.y)), m = me;
2021
+ a.curve && (i === "graph" || i === "flowchart") && (m = a.curve);
2022
+ let { x: b, y: w } = be(a), k = fe().x(b).y(w).curve(m), L;
2023
+ switch (a.thickness) {
2024
+ case "normal":
2025
+ L = "edge-thickness-normal";
2026
+ break;
2027
+ case "thick":
2028
+ L = "edge-thickness-thick";
2029
+ break;
2030
+ case "invisible":
2031
+ L = "edge-thickness-thick";
2032
+ break;
2033
+ default:
2034
+ L = "";
2035
+ }
2036
+ switch (a.pattern) {
2037
+ case "solid":
2038
+ L += " edge-pattern-solid";
2039
+ break;
2040
+ case "dotted":
2041
+ L += " edge-pattern-dotted";
2042
+ break;
2043
+ case "dashed":
2044
+ L += " edge-pattern-dashed";
2045
+ break;
2046
+ }
2047
+ let $ = e.append("path").attr("d", k(u)).attr("id", a.id).attr("class", " " + L + (a.classes ? " " + a.classes : "")).attr("style", a.style), d = "";
2048
+ (O().flowchart.arrowMarkerAbsolute || O().state.arrowMarkerAbsolute) && (d = we(!0)), fr($, a, d, s, i);
2049
+ let x = {};
2050
+ return o && (x.updatedPath = l), x.originalPath = a.points, x;
2051
+ }, "insertEdge"), Er = /* @__PURE__ */ g((e) => {
2052
+ let t = /* @__PURE__ */ new Set();
2053
+ for (let a of e) switch (a) {
2054
+ case "x":
2055
+ t.add("right"), t.add("left");
2056
+ break;
2057
+ case "y":
2058
+ t.add("up"), t.add("down");
2059
+ break;
2060
+ default:
2061
+ t.add(a);
2062
+ break;
2063
+ }
2064
+ return t;
2065
+ }, "expandAndDeduplicateDirections"), $r = /* @__PURE__ */ g((e, t, a, n) => {
2066
+ let i = Er(e), r = t.height + 2 * a.padding, s = r / 2, l = n ?? t.width + 2 * s + a.padding, o = a.padding / 2;
2067
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
2068
+ {
2069
+ x: 0,
2070
+ y: 0
2071
+ },
2072
+ {
2073
+ x: s,
2074
+ y: 0
2075
+ },
2076
+ {
2077
+ x: l / 2,
2078
+ y: 2 * o
2079
+ },
2080
+ {
2081
+ x: l - s,
2082
+ y: 0
2083
+ },
2084
+ {
2085
+ x: l,
2086
+ y: 0
2087
+ },
2088
+ {
2089
+ x: l,
2090
+ y: -r / 3
2091
+ },
2092
+ {
2093
+ x: l + 2 * o,
2094
+ y: -r / 2
2095
+ },
2096
+ {
2097
+ x: l,
2098
+ y: -2 * r / 3
2099
+ },
2100
+ {
2101
+ x: l,
2102
+ y: -r
2103
+ },
2104
+ {
2105
+ x: l - s,
2106
+ y: -r
2107
+ },
2108
+ {
2109
+ x: l / 2,
2110
+ y: -r - 2 * o
2111
+ },
2112
+ {
2113
+ x: s,
2114
+ y: -r
2115
+ },
2116
+ {
2117
+ x: 0,
2118
+ y: -r
2119
+ },
2120
+ {
2121
+ x: 0,
2122
+ y: -2 * r / 3
2123
+ },
2124
+ {
2125
+ x: -2 * o,
2126
+ y: -r / 2
2127
+ },
2128
+ {
2129
+ x: 0,
2130
+ y: -r / 3
2131
+ }
2132
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
2133
+ {
2134
+ x: s,
2135
+ y: 0
2136
+ },
2137
+ {
2138
+ x: l - s,
2139
+ y: 0
2140
+ },
2141
+ {
2142
+ x: l,
2143
+ y: -r / 2
2144
+ },
2145
+ {
2146
+ x: l - s,
2147
+ y: -r
2148
+ },
2149
+ {
2150
+ x: s,
2151
+ y: -r
2152
+ },
2153
+ {
2154
+ x: 0,
2155
+ y: -r / 2
2156
+ }
2157
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
2158
+ {
2159
+ x: 0,
2160
+ y: 0
2161
+ },
2162
+ {
2163
+ x: s,
2164
+ y: -r
2165
+ },
2166
+ {
2167
+ x: l - s,
2168
+ y: -r
2169
+ },
2170
+ {
2171
+ x: l,
2172
+ y: 0
2173
+ }
2174
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
2175
+ {
2176
+ x: 0,
2177
+ y: 0
2178
+ },
2179
+ {
2180
+ x: l,
2181
+ y: -s
2182
+ },
2183
+ {
2184
+ x: l,
2185
+ y: -r + s
2186
+ },
2187
+ {
2188
+ x: 0,
2189
+ y: -r
2190
+ }
2191
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
2192
+ {
2193
+ x: l,
2194
+ y: 0
2195
+ },
2196
+ {
2197
+ x: 0,
2198
+ y: -s
2199
+ },
2200
+ {
2201
+ x: 0,
2202
+ y: -r + s
2203
+ },
2204
+ {
2205
+ x: l,
2206
+ y: -r
2207
+ }
2208
+ ] : i.has("right") && i.has("left") ? [
2209
+ {
2210
+ x: s,
2211
+ y: 0
2212
+ },
2213
+ {
2214
+ x: s,
2215
+ y: -o
2216
+ },
2217
+ {
2218
+ x: l - s,
2219
+ y: -o
2220
+ },
2221
+ {
2222
+ x: l - s,
2223
+ y: 0
2224
+ },
2225
+ {
2226
+ x: l,
2227
+ y: -r / 2
2228
+ },
2229
+ {
2230
+ x: l - s,
2231
+ y: -r
2232
+ },
2233
+ {
2234
+ x: l - s,
2235
+ y: -r + o
2236
+ },
2237
+ {
2238
+ x: s,
2239
+ y: -r + o
2240
+ },
2241
+ {
2242
+ x: s,
2243
+ y: -r
2244
+ },
2245
+ {
2246
+ x: 0,
2247
+ y: -r / 2
2248
+ }
2249
+ ] : i.has("up") && i.has("down") ? [
2250
+ {
2251
+ x: l / 2,
2252
+ y: 0
2253
+ },
2254
+ {
2255
+ x: 0,
2256
+ y: -o
2257
+ },
2258
+ {
2259
+ x: s,
2260
+ y: -o
2261
+ },
2262
+ {
2263
+ x: s,
2264
+ y: -r + o
2265
+ },
2266
+ {
2267
+ x: 0,
2268
+ y: -r + o
2269
+ },
2270
+ {
2271
+ x: l / 2,
2272
+ y: -r
2273
+ },
2274
+ {
2275
+ x: l,
2276
+ y: -r + o
2277
+ },
2278
+ {
2279
+ x: l - s,
2280
+ y: -r + o
2281
+ },
2282
+ {
2283
+ x: l - s,
2284
+ y: -o
2285
+ },
2286
+ {
2287
+ x: l,
2288
+ y: -o
2289
+ }
2290
+ ] : i.has("right") && i.has("up") ? [
2291
+ {
2292
+ x: 0,
2293
+ y: 0
2294
+ },
2295
+ {
2296
+ x: l,
2297
+ y: -s
2298
+ },
2299
+ {
2300
+ x: 0,
2301
+ y: -r
2302
+ }
2303
+ ] : i.has("right") && i.has("down") ? [
2304
+ {
2305
+ x: 0,
2306
+ y: 0
2307
+ },
2308
+ {
2309
+ x: l,
2310
+ y: 0
2311
+ },
2312
+ {
2313
+ x: 0,
2314
+ y: -r
2315
+ }
2316
+ ] : i.has("left") && i.has("up") ? [
2317
+ {
2318
+ x: l,
2319
+ y: 0
2320
+ },
2321
+ {
2322
+ x: 0,
2323
+ y: -s
2324
+ },
2325
+ {
2326
+ x: l,
2327
+ y: -r
2328
+ }
2329
+ ] : i.has("left") && i.has("down") ? [
2330
+ {
2331
+ x: l,
2332
+ y: 0
2333
+ },
2334
+ {
2335
+ x: 0,
2336
+ y: 0
2337
+ },
2338
+ {
2339
+ x: l,
2340
+ y: -r
2341
+ }
2342
+ ] : i.has("right") ? [
2343
+ {
2344
+ x: s,
2345
+ y: -o
2346
+ },
2347
+ {
2348
+ x: s,
2349
+ y: -o
2350
+ },
2351
+ {
2352
+ x: l - s,
2353
+ y: -o
2354
+ },
2355
+ {
2356
+ x: l - s,
2357
+ y: 0
2358
+ },
2359
+ {
2360
+ x: l,
2361
+ y: -r / 2
2362
+ },
2363
+ {
2364
+ x: l - s,
2365
+ y: -r
2366
+ },
2367
+ {
2368
+ x: l - s,
2369
+ y: -r + o
2370
+ },
2371
+ {
2372
+ x: s,
2373
+ y: -r + o
2374
+ },
2375
+ {
2376
+ x: s,
2377
+ y: -r + o
2378
+ }
2379
+ ] : i.has("left") ? [
2380
+ {
2381
+ x: s,
2382
+ y: 0
2383
+ },
2384
+ {
2385
+ x: s,
2386
+ y: -o
2387
+ },
2388
+ {
2389
+ x: l - s,
2390
+ y: -o
2391
+ },
2392
+ {
2393
+ x: l - s,
2394
+ y: -r + o
2395
+ },
2396
+ {
2397
+ x: s,
2398
+ y: -r + o
2399
+ },
2400
+ {
2401
+ x: s,
2402
+ y: -r
2403
+ },
2404
+ {
2405
+ x: 0,
2406
+ y: -r / 2
2407
+ }
2408
+ ] : i.has("up") ? [
2409
+ {
2410
+ x: s,
2411
+ y: -o
2412
+ },
2413
+ {
2414
+ x: s,
2415
+ y: -r + o
2416
+ },
2417
+ {
2418
+ x: 0,
2419
+ y: -r + o
2420
+ },
2421
+ {
2422
+ x: l / 2,
2423
+ y: -r
2424
+ },
2425
+ {
2426
+ x: l,
2427
+ y: -r + o
2428
+ },
2429
+ {
2430
+ x: l - s,
2431
+ y: -r + o
2432
+ },
2433
+ {
2434
+ x: l - s,
2435
+ y: -o
2436
+ }
2437
+ ] : i.has("down") ? [
2438
+ {
2439
+ x: l / 2,
2440
+ y: 0
2441
+ },
2442
+ {
2443
+ x: 0,
2444
+ y: -o
2445
+ },
2446
+ {
2447
+ x: s,
2448
+ y: -o
2449
+ },
2450
+ {
2451
+ x: s,
2452
+ y: -r + o
2453
+ },
2454
+ {
2455
+ x: l - s,
2456
+ y: -r + o
2457
+ },
2458
+ {
2459
+ x: l - s,
2460
+ y: -o
2461
+ },
2462
+ {
2463
+ x: l,
2464
+ y: -o
2465
+ }
2466
+ ] : [{
2467
+ x: 0,
2468
+ y: 0
2469
+ }];
2470
+ }, "getArrowPoints");
2471
+ function te(e, t) {
2472
+ return e.intersect(t);
2473
+ }
2474
+ g(te, "intersectNode");
2475
+ var Dr = te;
2476
+ function ee(e, t, a, n) {
2477
+ var i = e.x, r = e.y, s = i - n.x, l = r - n.y, o = Math.sqrt(t * t * l * l + a * a * s * s), p = Math.abs(t * a * s / o);
2478
+ n.x < i && (p = -p);
2479
+ var c = Math.abs(t * a * l / o);
2480
+ return n.y < r && (c = -c), {
2481
+ x: i + p,
2482
+ y: r + c
2483
+ };
2484
+ }
2485
+ g(ee, "intersectEllipse");
2486
+ var re = ee;
2487
+ function ae(e, t, a) {
2488
+ return re(e, t, t, a);
2489
+ }
2490
+ g(ae, "intersectCircle");
2491
+ var vr = ae;
2492
+ function ie(e, t, a, n) {
2493
+ var i = t.y - e.y, r, s = e.x - t.x, l, o = t.x * e.y - e.x * t.y, p, c, u, m = i * a.x + s * a.y + o, b = i * n.x + s * n.y + o, w, k, L, $, d;
2494
+ if (!(m !== 0 && b !== 0 && _t(m, b)) && (r = n.y - a.y, l = a.x - n.x, p = n.x * a.y - a.x * n.y, c = r * e.x + l * e.y + p, u = r * t.x + l * t.y + p, !(c !== 0 && u !== 0 && _t(c, u)) && (w = i * l - r * s, w !== 0))) return k = Math.abs(w / 2), L = s * p - l * o, $ = L < 0 ? (L - k) / w : (L + k) / w, L = r * o - i * p, d = L < 0 ? (L - k) / w : (L + k) / w, {
2495
+ x: $,
2496
+ y: d
2497
+ };
2498
+ }
2499
+ g(ie, "intersectLine");
2500
+ function _t(e, t) {
2501
+ return e * t > 0;
2502
+ }
2503
+ g(_t, "sameSign");
2504
+ var Nr = ie, Tr = se;
2505
+ function se(e, t, a) {
2506
+ var n = e.x, i = e.y, r = [], s = 1 / 0, l = 1 / 0;
2507
+ typeof t.forEach == "function" ? t.forEach(function(w) {
2508
+ s = Math.min(s, w.x), l = Math.min(l, w.y);
2509
+ }) : (s = Math.min(s, t.x), l = Math.min(l, t.y));
2510
+ for (var o = n - e.width / 2 - s, p = i - e.height / 2 - l, c = 0; c < t.length; c++) {
2511
+ var u = t[c], m = t[c < t.length - 1 ? c + 1 : 0], b = Nr(e, a, {
2512
+ x: o + u.x,
2513
+ y: p + u.y
2514
+ }, {
2515
+ x: o + m.x,
2516
+ y: p + m.y
2517
+ });
2518
+ b && r.push(b);
2519
+ }
2520
+ return r.length ? (r.length > 1 && r.sort(function(w, k) {
2521
+ var L = w.x - a.x, $ = w.y - a.y, d = Math.sqrt(L * L + $ * $), x = k.x - a.x, _ = k.y - a.y, f = Math.sqrt(x * x + _ * _);
2522
+ return d < f ? -1 : d === f ? 0 : 1;
2523
+ }), r[0]) : e;
2524
+ }
2525
+ g(se, "intersectPolygon");
2526
+ var D = {
2527
+ node: Dr,
2528
+ circle: vr,
2529
+ ellipse: re,
2530
+ polygon: Tr,
2531
+ rect: /* @__PURE__ */ g((e, t) => {
2532
+ var a = e.x, n = e.y, i = t.x - a, r = t.y - n, s = e.width / 2, l = e.height / 2, o, p;
2533
+ return Math.abs(r) * s > Math.abs(i) * l ? (r < 0 && (l = -l), o = r === 0 ? 0 : l * i / r, p = l) : (i < 0 && (s = -s), o = s, p = i === 0 ? 0 : s * r / i), {
2534
+ x: a + o,
2535
+ y: n + p
2536
+ };
2537
+ }, "intersectRect")
2538
+ }, B = /* @__PURE__ */ g(async (e, t, a, n) => {
2539
+ let i = O(), r, s = t.useHtmlLabels || z(i);
2540
+ r = a || "node default";
2541
+ let l = e.insert("g").attr("class", r).attr("id", t.domId || t.id), o = l.insert("g").attr("class", "label").attr("style", t.labelStyle), p;
2542
+ p = t.labelText === void 0 ? "" : typeof t.labelText == "string" ? t.labelText : t.labelText[0];
2543
+ let c;
2544
+ c = t.labelType === "markdown" ? Et(o, Bt(Ct(p), i), {
2545
+ useHtmlLabels: s,
2546
+ width: t.width || i.flowchart.wrappingWidth,
2547
+ classes: "markdown-node-label"
2548
+ }, i) : await X(o, Bt(Ct(p), i), t.labelStyle, !1, n);
2549
+ let u = c.getBBox(), m = t.padding / 2;
2550
+ if (z(i)) {
2551
+ let b = c.children[0], w = v(c);
2552
+ await qe(b, p), u = b.getBoundingClientRect(), w.attr("width", u.width), w.attr("height", u.height);
2553
+ }
2554
+ return s ? o.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")") : o.attr("transform", "translate(0, " + -u.height / 2 + ")"), t.centerLabel && o.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")"), o.insert("rect", ":first-child"), {
2555
+ shapeSvg: l,
2556
+ bbox: u,
2557
+ halfPadding: m,
2558
+ label: o
2559
+ };
2560
+ }, "labelHelper"), N = /* @__PURE__ */ g((e, t) => {
2561
+ let a = t.node().getBBox();
2562
+ e.width = a.width, e.height = a.height;
2563
+ }, "updateNodeBounds");
2564
+ function F(e, t, a, n) {
2565
+ return e.insert("polygon", ":first-child").attr("points", n.map(function(i) {
2566
+ return i.x + "," + i.y;
2567
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
2568
+ }
2569
+ g(F, "insertPolygonShape");
2570
+ var Ir = /* @__PURE__ */ g(async (e, t) => {
2571
+ t.useHtmlLabels || z(O()) || (t.centerLabel = !0);
2572
+ let { shapeSvg: a, bbox: n, halfPadding: i } = await B(e, t, "node " + t.classes, !0);
2573
+ S.info("Classes = ", t.classes);
2574
+ let r = a.insert("rect", ":first-child");
2575
+ return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -n.width / 2 - i).attr("y", -n.height / 2 - i).attr("width", n.width + t.padding).attr("height", n.height + t.padding), N(t, r), t.intersect = function(s) {
2576
+ return D.rect(t, s);
2577
+ }, a;
2578
+ }, "note"), Yt = /* @__PURE__ */ g((e) => e ? " " + e : "", "formatClass"), M = /* @__PURE__ */ g((e, t) => `${t || "node default"}${Yt(e.classes)} ${Yt(e.class)}`, "getClassesFromNode"), Wt = /* @__PURE__ */ g(async (e, t) => {
2579
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding + (n.height + t.padding), r = [
2580
+ {
2581
+ x: i / 2,
2582
+ y: 0
2583
+ },
2584
+ {
2585
+ x: i,
2586
+ y: -i / 2
2587
+ },
2588
+ {
2589
+ x: i / 2,
2590
+ y: -i
2591
+ },
2592
+ {
2593
+ x: 0,
2594
+ y: -i / 2
2595
+ }
2596
+ ];
2597
+ S.info("Question main (Circle)");
2598
+ let s = F(a, i, i, r);
2599
+ return s.attr("style", t.style), N(t, s), t.intersect = function(l) {
2600
+ return S.warn("Intersect called"), D.polygon(t, r, l);
2601
+ }, a;
2602
+ }, "question"), Or = /* @__PURE__ */ g((e, t) => {
2603
+ let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
2604
+ return a.insert("polygon", ":first-child").attr("points", [
2605
+ {
2606
+ x: 0,
2607
+ y: 28 / 2
2608
+ },
2609
+ {
2610
+ x: 28 / 2,
2611
+ y: 0
2612
+ },
2613
+ {
2614
+ x: 0,
2615
+ y: -28 / 2
2616
+ },
2617
+ {
2618
+ x: -28 / 2,
2619
+ y: 0
2620
+ }
2621
+ ].map(function(n) {
2622
+ return n.x + "," + n.y;
2623
+ }).join(" ")).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(n) {
2624
+ return D.circle(t, 14, n);
2625
+ }, a;
2626
+ }, "choice"), Br = /* @__PURE__ */ g(async (e, t) => {
2627
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = t.positioned ? t.height : n.height + t.padding, r = i / 4, s = t.positioned ? t.width : n.width + 2 * r + t.padding, l = [
2628
+ {
2629
+ x: r,
2630
+ y: 0
2631
+ },
2632
+ {
2633
+ x: s - r,
2634
+ y: 0
2635
+ },
2636
+ {
2637
+ x: s,
2638
+ y: -i / 2
2639
+ },
2640
+ {
2641
+ x: s - r,
2642
+ y: -i
2643
+ },
2644
+ {
2645
+ x: r,
2646
+ y: -i
2647
+ },
2648
+ {
2649
+ x: 0,
2650
+ y: -i / 2
2651
+ }
2652
+ ], o = F(a, s, i, l);
2653
+ return o.attr("style", t.style), N(t, o), t.intersect = function(p) {
2654
+ return D.polygon(t, l, p);
2655
+ }, a;
2656
+ }, "hexagon"), Cr = /* @__PURE__ */ g(async (e, t) => {
2657
+ let { shapeSvg: a, bbox: n } = await B(e, t, void 0, !0), i = n.height + 2 * t.padding, r = i / 2, s = n.width + 2 * r + t.padding, l = t.positioned && (t.widthInColumns ?? 1) > 1 && t.width > s ? t.width : s, o = $r(t.directions, n, t, l), p = F(a, l, i, o);
2658
+ return p.attr("style", t.style), N(t, p), t.intersect = function(c) {
2659
+ return D.polygon(t, o, c);
2660
+ }, a;
2661
+ }, "block_arrow"), Rr = /* @__PURE__ */ g(async (e, t) => {
2662
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2663
+ {
2664
+ x: -r / 2,
2665
+ y: 0
2666
+ },
2667
+ {
2668
+ x: i,
2669
+ y: 0
2670
+ },
2671
+ {
2672
+ x: i,
2673
+ y: -r
2674
+ },
2675
+ {
2676
+ x: -r / 2,
2677
+ y: -r
2678
+ },
2679
+ {
2680
+ x: 0,
2681
+ y: -r / 2
2682
+ }
2683
+ ];
2684
+ return F(a, i, r, s).attr("style", t.style), t.width = i + r, t.height = r, t.intersect = function(l) {
2685
+ return D.polygon(t, s, l);
2686
+ }, a;
2687
+ }, "rect_left_inv_arrow"), zr = /* @__PURE__ */ g(async (e, t) => {
2688
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2689
+ {
2690
+ x: -2 * r / 6,
2691
+ y: 0
2692
+ },
2693
+ {
2694
+ x: i - r / 6,
2695
+ y: 0
2696
+ },
2697
+ {
2698
+ x: i + 2 * r / 6,
2699
+ y: -r
2700
+ },
2701
+ {
2702
+ x: r / 6,
2703
+ y: -r
2704
+ }
2705
+ ], l = F(a, i, r, s);
2706
+ return l.attr("style", t.style), N(t, l), t.intersect = function(o) {
2707
+ return D.polygon(t, s, o);
2708
+ }, a;
2709
+ }, "lean_right"), Ar = /* @__PURE__ */ g(async (e, t) => {
2710
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2711
+ {
2712
+ x: 2 * r / 6,
2713
+ y: 0
2714
+ },
2715
+ {
2716
+ x: i + r / 6,
2717
+ y: 0
2718
+ },
2719
+ {
2720
+ x: i - 2 * r / 6,
2721
+ y: -r
2722
+ },
2723
+ {
2724
+ x: -r / 6,
2725
+ y: -r
2726
+ }
2727
+ ], l = F(a, i, r, s);
2728
+ return l.attr("style", t.style), N(t, l), t.intersect = function(o) {
2729
+ return D.polygon(t, s, o);
2730
+ }, a;
2731
+ }, "lean_left"), Mr = /* @__PURE__ */ g(async (e, t) => {
2732
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2733
+ {
2734
+ x: -2 * r / 6,
2735
+ y: 0
2736
+ },
2737
+ {
2738
+ x: i + 2 * r / 6,
2739
+ y: 0
2740
+ },
2741
+ {
2742
+ x: i - r / 6,
2743
+ y: -r
2744
+ },
2745
+ {
2746
+ x: r / 6,
2747
+ y: -r
2748
+ }
2749
+ ], l = F(a, i, r, s);
2750
+ return l.attr("style", t.style), N(t, l), t.intersect = function(o) {
2751
+ return D.polygon(t, s, o);
2752
+ }, a;
2753
+ }, "trapezoid"), Pr = /* @__PURE__ */ g(async (e, t) => {
2754
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2755
+ {
2756
+ x: r / 6,
2757
+ y: 0
2758
+ },
2759
+ {
2760
+ x: i - r / 6,
2761
+ y: 0
2762
+ },
2763
+ {
2764
+ x: i + 2 * r / 6,
2765
+ y: -r
2766
+ },
2767
+ {
2768
+ x: -2 * r / 6,
2769
+ y: -r
2770
+ }
2771
+ ], l = F(a, i, r, s);
2772
+ return l.attr("style", t.style), N(t, l), t.intersect = function(o) {
2773
+ return D.polygon(t, s, o);
2774
+ }, a;
2775
+ }, "inv_trapezoid"), Yr = /* @__PURE__ */ g(async (e, t) => {
2776
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2777
+ {
2778
+ x: 0,
2779
+ y: 0
2780
+ },
2781
+ {
2782
+ x: i + r / 2,
2783
+ y: 0
2784
+ },
2785
+ {
2786
+ x: i,
2787
+ y: -r / 2
2788
+ },
2789
+ {
2790
+ x: i + r / 2,
2791
+ y: -r
2792
+ },
2793
+ {
2794
+ x: 0,
2795
+ y: -r
2796
+ }
2797
+ ], l = F(a, i, r, s);
2798
+ return l.attr("style", t.style), N(t, l), t.intersect = function(o) {
2799
+ return D.polygon(t, s, o);
2800
+ }, a;
2801
+ }, "rect_right_inv_arrow"), Wr = /* @__PURE__ */ g(async (e, t) => {
2802
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = i / 2, s = r / (2.5 + i / 50), l = n.height + s + t.padding, o = "M 0," + s + " a " + r + "," + s + " 0,0,0 " + i + " 0 a " + r + "," + s + " 0,0,0 " + -i + " 0 l 0," + l + " a " + r + "," + s + " 0,0,0 " + i + " 0 l 0," + -l;
2803
+ return N(t, a.attr("label-offset-y", s).insert("path", ":first-child").attr("style", t.style).attr("d", o).attr("transform", "translate(" + -i / 2 + "," + -(l / 2 + s) + ")")), t.intersect = function(p) {
2804
+ let c = D.rect(t, p), u = c.x - t.x;
2805
+ if (r != 0 && (Math.abs(u) < t.width / 2 || Math.abs(u) == t.width / 2 && Math.abs(c.y - t.y) > t.height / 2 - s)) {
2806
+ let m = s * s * (1 - u * u / (r * r));
2807
+ m != 0 && (m = Math.sqrt(m)), m = s - m, p.y - t.y > 0 && (m = -m), c.y += m;
2808
+ }
2809
+ return c;
2810
+ }, a;
2811
+ }, "cylinder"), Xr = /* @__PURE__ */ g(async (e, t) => {
2812
+ let { shapeSvg: a, bbox: n, halfPadding: i } = await B(e, t, "node " + t.classes + " " + t.class, !0), r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : n.width + t.padding, l = t.positioned ? t.height : n.height + t.padding, o = t.positioned ? -s / 2 : -n.width / 2 - i, p = t.positioned ? -l / 2 : -n.height / 2 - i;
2813
+ if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", p).attr("width", s).attr("height", l), t.props) {
2814
+ let c = new Set(Object.keys(t.props));
2815
+ t.props.borders && (lt(r, t.props.borders, s, l), c.delete("borders")), c.forEach((u) => {
2816
+ S.warn(`Unknown node property ${u}`);
2817
+ });
2818
+ }
2819
+ return N(t, r), t.intersect = function(c) {
2820
+ return D.rect(t, c);
2821
+ }, a;
2822
+ }, "rect"), Fr = /* @__PURE__ */ g(async (e, t) => {
2823
+ let { shapeSvg: a, bbox: n, halfPadding: i } = await B(e, t, "node " + t.classes, !0), r = a.insert("rect", ":first-child"), s = t.positioned ? t.width : n.width + t.padding, l = t.positioned ? t.height : n.height + t.padding, o = t.positioned ? -s / 2 : -n.width / 2 - i, p = t.positioned ? -l / 2 : -n.height / 2 - i;
2824
+ if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", p).attr("width", s).attr("height", l), t.props) {
2825
+ let c = new Set(Object.keys(t.props));
2826
+ t.props.borders && (lt(r, t.props.borders, s, l), c.delete("borders")), c.forEach((u) => {
2827
+ S.warn(`Unknown node property ${u}`);
2828
+ });
2829
+ }
2830
+ return N(t, r), t.intersect = function(c) {
2831
+ return D.rect(t, c);
2832
+ }, a;
2833
+ }, "composite"), jr = /* @__PURE__ */ g(async (e, t) => {
2834
+ let { shapeSvg: a } = await B(e, t, "label", !0);
2835
+ S.trace("Classes = ", t.class);
2836
+ let n = a.insert("rect", ":first-child");
2837
+ if (n.attr("width", 0).attr("height", 0), a.attr("class", "label edgeLabel"), t.props) {
2838
+ let i = new Set(Object.keys(t.props));
2839
+ t.props.borders && (lt(n, t.props.borders, 0, 0), i.delete("borders")), i.forEach((r) => {
2840
+ S.warn(`Unknown node property ${r}`);
2841
+ });
2842
+ }
2843
+ return N(t, n), t.intersect = function(i) {
2844
+ return D.rect(t, i);
2845
+ }, a;
2846
+ }, "labelRect");
2847
+ function lt(e, t, a, n) {
2848
+ let i = [], r = /* @__PURE__ */ g((l) => {
2849
+ i.push(l, 0);
2850
+ }, "addBorder"), s = /* @__PURE__ */ g((l) => {
2851
+ i.push(0, l);
2852
+ }, "skipBorder");
2853
+ t.includes("t") ? (S.debug("add top border"), r(a)) : s(a), t.includes("r") ? (S.debug("add right border"), r(n)) : s(n), t.includes("b") ? (S.debug("add bottom border"), r(a)) : s(a), t.includes("l") ? (S.debug("add left border"), r(n)) : s(n), e.attr("stroke-dasharray", i.join(" "));
2854
+ }
2855
+ g(lt, "applyNodePropertyBorders");
2856
+ var Hr = /* @__PURE__ */ g(async (e, t) => {
2857
+ let a;
2858
+ a = t.classes ? "node " + t.classes : "node default";
2859
+ let n = e.insert("g").attr("class", a).attr("id", t.domId || t.id), i = n.insert("rect", ":first-child"), r = n.insert("line"), s = n.insert("g").attr("class", "label"), l = t.labelText.flat ? t.labelText.flat() : t.labelText, o = "";
2860
+ o = typeof l == "object" ? l[0] : l, S.info("Label text abc79", o, l, typeof l == "object");
2861
+ let p = await X(s, o, t.labelStyle, !0, !0), c = {
2862
+ width: 0,
2863
+ height: 0
2864
+ };
2865
+ if (z(O())) {
2866
+ let k = p.children[0], L = v(p);
2867
+ c = k.getBoundingClientRect(), L.attr("width", c.width), L.attr("height", c.height);
2868
+ }
2869
+ S.info("Text 2", l);
2870
+ let u = l.slice(1, l.length), m = p.getBBox(), b = await X(s, u.join ? u.join("<br/>") : u, t.labelStyle, !0, !0);
2871
+ if (z(O())) {
2872
+ let k = b.children[0], L = v(b);
2873
+ c = k.getBoundingClientRect(), L.attr("width", c.width), L.attr("height", c.height);
2874
+ }
2875
+ let w = t.padding / 2;
2876
+ return v(b).attr("transform", "translate( " + (c.width > m.width ? 0 : (m.width - c.width) / 2) + ", " + (m.height + w + 5) + ")"), v(p).attr("transform", "translate( " + (c.width < m.width ? 0 : -(m.width - c.width) / 2) + ", 0)"), c = s.node().getBBox(), s.attr("transform", "translate(" + -c.width / 2 + ", " + (-c.height / 2 - w + 3) + ")"), i.attr("class", "outer title-state").attr("x", -c.width / 2 - w).attr("y", -c.height / 2 - w).attr("width", c.width + t.padding).attr("height", c.height + t.padding), r.attr("class", "divider").attr("x1", -c.width / 2 - w).attr("x2", c.width / 2 + w).attr("y1", -c.height / 2 - w + m.height + w).attr("y2", -c.height / 2 - w + m.height + w), N(t, i), t.intersect = function(k) {
2877
+ return D.rect(t, k);
2878
+ }, n;
2879
+ }, "rectWithTitle"), Kr = /* @__PURE__ */ g(async (e, t) => {
2880
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.height + t.padding, r = n.width + i / 4 + t.padding;
2881
+ return N(t, a.insert("rect", ":first-child").attr("style", t.style).attr("rx", i / 2).attr("ry", i / 2).attr("x", -r / 2).attr("y", -i / 2).attr("width", r).attr("height", i)), t.intersect = function(s) {
2882
+ return D.rect(t, s);
2883
+ }, a;
2884
+ }, "stadium"), Ur = /* @__PURE__ */ g(async (e, t) => {
2885
+ let { shapeSvg: a, bbox: n, halfPadding: i } = await B(e, t, M(t, void 0), !0), r = a.insert("circle", ":first-child");
2886
+ return r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i).attr("width", n.width + t.padding).attr("height", n.height + t.padding), S.info("Circle main"), N(t, r), t.intersect = function(s) {
2887
+ return S.info("Circle intersect", t, n.width / 2 + i, s), D.circle(t, n.width / 2 + i, s);
2888
+ }, a;
2889
+ }, "circle"), qr = /* @__PURE__ */ g(async (e, t) => {
2890
+ let { shapeSvg: a, bbox: n, halfPadding: i } = await B(e, t, M(t, void 0), !0), r = a.insert("g", ":first-child"), s = r.insert("circle"), l = r.insert("circle");
2891
+ return r.attr("class", t.class), s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i + 5).attr("width", n.width + t.padding + 10).attr("height", n.height + t.padding + 10), l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i).attr("width", n.width + t.padding).attr("height", n.height + t.padding), S.info("DoubleCircle main"), N(t, s), t.intersect = function(o) {
2892
+ return S.info("DoubleCircle intersect", t, n.width / 2 + i + 5, o), D.circle(t, n.width / 2 + i + 5, o);
2893
+ }, a;
2894
+ }, "doublecircle"), Zr = /* @__PURE__ */ g(async (e, t) => {
2895
+ let { shapeSvg: a, bbox: n } = await B(e, t, M(t, void 0), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
2896
+ {
2897
+ x: 0,
2898
+ y: 0
2899
+ },
2900
+ {
2901
+ x: i,
2902
+ y: 0
2903
+ },
2904
+ {
2905
+ x: i,
2906
+ y: -r
2907
+ },
2908
+ {
2909
+ x: 0,
2910
+ y: -r
2911
+ },
2912
+ {
2913
+ x: 0,
2914
+ y: 0
2915
+ },
2916
+ {
2917
+ x: -8,
2918
+ y: 0
2919
+ },
2920
+ {
2921
+ x: i + 8,
2922
+ y: 0
2923
+ },
2924
+ {
2925
+ x: i + 8,
2926
+ y: -r
2927
+ },
2928
+ {
2929
+ x: -8,
2930
+ y: -r
2931
+ },
2932
+ {
2933
+ x: -8,
2934
+ y: 0
2935
+ }
2936
+ ], l = F(a, i, r, s);
2937
+ return l.attr("style", t.style), N(t, l), t.intersect = function(o) {
2938
+ return D.polygon(t, s, o);
2939
+ }, a;
2940
+ }, "subroutine"), Gr = /* @__PURE__ */ g((e, t) => {
2941
+ let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = a.insert("circle", ":first-child");
2942
+ return n.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), N(t, n), t.intersect = function(i) {
2943
+ return D.circle(t, 7, i);
2944
+ }, a;
2945
+ }, "start"), Xt = /* @__PURE__ */ g((e, t, a) => {
2946
+ let n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 70, r = 10;
2947
+ return a === "LR" && (i = 10, r = 70), N(t, n.append("rect").attr("x", -1 * i / 2).attr("y", -1 * r / 2).attr("width", i).attr("height", r).attr("class", "fork-join")), t.height += t.padding / 2, t.width += t.padding / 2, t.intersect = function(s) {
2948
+ return D.rect(t, s);
2949
+ }, n;
2950
+ }, "forkJoin"), Ft = {
2951
+ rhombus: Wt,
2952
+ composite: Fr,
2953
+ question: Wt,
2954
+ rect: Xr,
2955
+ labelRect: jr,
2956
+ rectWithTitle: Hr,
2957
+ choice: Or,
2958
+ circle: Ur,
2959
+ doublecircle: qr,
2960
+ stadium: Kr,
2961
+ hexagon: Br,
2962
+ block_arrow: Cr,
2963
+ rect_left_inv_arrow: Rr,
2964
+ lean_right: zr,
2965
+ lean_left: Ar,
2966
+ trapezoid: Mr,
2967
+ inv_trapezoid: Pr,
2968
+ rect_right_inv_arrow: Yr,
2969
+ cylinder: Wr,
2970
+ start: Gr,
2971
+ end: /* @__PURE__ */ g((e, t) => {
2972
+ let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = a.insert("circle", ":first-child"), i = a.insert("circle", ":first-child");
2973
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), n.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), N(t, i), t.intersect = function(r) {
2974
+ return D.circle(t, 7, r);
2975
+ }, a;
2976
+ }, "end"),
2977
+ note: Ir,
2978
+ subroutine: Zr,
2979
+ fork: Xt,
2980
+ join: Xt,
2981
+ class_box: /* @__PURE__ */ g(async (e, t) => {
2982
+ let a = t.padding / 2, n;
2983
+ n = t.classes ? "node " + t.classes : "node default";
2984
+ let i = e.insert("g").attr("class", n).attr("id", t.domId || t.id), r = i.insert("rect", ":first-child"), s = i.insert("line"), l = i.insert("line"), o = 0, p = 4, c = i.insert("g").attr("class", "label"), u = 0, m = t.classData.annotations?.[0], b = await X(c, t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", t.labelStyle, !0, !0), w = b.getBBox();
2985
+ if (z(O())) {
2986
+ let f = b.children[0], E = v(b);
2987
+ w = f.getBoundingClientRect(), E.attr("width", w.width), E.attr("height", w.height);
2988
+ }
2989
+ t.classData.annotations[0] && (p += w.height + 4, o += w.width);
2990
+ let k = t.classData.label;
2991
+ t.classData.type !== void 0 && t.classData.type !== "" && (z(O()) ? k += "&lt;" + t.classData.type + "&gt;" : k += "<" + t.classData.type + ">");
2992
+ let L = await X(c, k, t.labelStyle, !0, !0);
2993
+ v(L).attr("class", "classTitle");
2994
+ let $ = L.getBBox();
2995
+ if (z(O())) {
2996
+ let f = L.children[0], E = v(L);
2997
+ $ = f.getBoundingClientRect(), E.attr("width", $.width), E.attr("height", $.height);
2998
+ }
2999
+ p += $.height + 4, $.width > o && (o = $.width);
3000
+ let d = [];
3001
+ t.classData.members.forEach(async (f) => {
3002
+ let E = f.getDisplayDetails(), h = E.displayText;
3003
+ z(O()) && (h = h.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
3004
+ let R = await X(c, h, E.cssStyle ? E.cssStyle : t.labelStyle, !0, !0), y = R.getBBox();
3005
+ if (z(O())) {
3006
+ let j = R.children[0], H = v(R);
3007
+ y = j.getBoundingClientRect(), H.attr("width", y.width), H.attr("height", y.height);
3008
+ }
3009
+ y.width > o && (o = y.width), p += y.height + 4, d.push(R);
3010
+ }), p += 8;
3011
+ let x = [];
3012
+ if (t.classData.methods.forEach(async (f) => {
3013
+ let E = f.getDisplayDetails(), h = E.displayText;
3014
+ z(O()) && (h = h.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
3015
+ let R = await X(c, h, E.cssStyle ? E.cssStyle : t.labelStyle, !0, !0), y = R.getBBox();
3016
+ if (z(O())) {
3017
+ let j = R.children[0], H = v(R);
3018
+ y = j.getBoundingClientRect(), H.attr("width", y.width), H.attr("height", y.height);
3019
+ }
3020
+ y.width > o && (o = y.width), p += y.height + 4, x.push(R);
3021
+ }), p += 8, m) {
3022
+ let f = (o - w.width) / 2;
3023
+ v(b).attr("transform", "translate( " + (-1 * o / 2 + f) + ", " + -1 * p / 2 + ")"), u = w.height + 4;
3024
+ }
3025
+ let _ = (o - $.width) / 2;
3026
+ return v(L).attr("transform", "translate( " + (-1 * o / 2 + _) + ", " + (-1 * p / 2 + u) + ")"), u += $.height + 4, s.attr("class", "divider").attr("x1", -o / 2 - a).attr("x2", o / 2 + a).attr("y1", -p / 2 - a + 8 + u).attr("y2", -p / 2 - a + 8 + u), u += 8, d.forEach((f) => {
3027
+ v(f).attr("transform", "translate( " + -o / 2 + ", " + (-1 * p / 2 + u + 8 / 2) + ")");
3028
+ let E = f?.getBBox();
3029
+ u += (E?.height ?? 0) + 4;
3030
+ }), u += 8, l.attr("class", "divider").attr("x1", -o / 2 - a).attr("x2", o / 2 + a).attr("y1", -p / 2 - a + 8 + u).attr("y2", -p / 2 - a + 8 + u), u += 8, x.forEach((f) => {
3031
+ v(f).attr("transform", "translate( " + -o / 2 + ", " + (-1 * p / 2 + u) + ")");
3032
+ let E = f?.getBBox();
3033
+ u += (E?.height ?? 0) + 4;
3034
+ }), r.attr("style", t.style).attr("class", "outer title-state").attr("x", -o / 2 - a).attr("y", -(p / 2) - a).attr("width", o + t.padding).attr("height", p + t.padding), N(t, r), t.intersect = function(f) {
3035
+ return D.rect(t, f);
3036
+ }, i;
3037
+ }, "class_box")
3038
+ }, it = {}, ne = /* @__PURE__ */ g(async (e, t, a) => {
3039
+ let n, i;
3040
+ if (t.link) {
3041
+ let r;
3042
+ O().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), n = e.insert("svg:a").attr("xlink:href", t.link).attr("target", r), i = await Ft[t.shape](n, t, a);
3043
+ } else i = await Ft[t.shape](e, t, a), n = i;
3044
+ return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), it[t.id] = n, t.haveCallback && it[t.id].attr("class", it[t.id].attr("class") + " clickable"), n;
3045
+ }, "insertNode"), Jr = /* @__PURE__ */ g((e) => {
3046
+ let t = it[e.id];
3047
+ S.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
3048
+ let a = e.diff || 0;
3049
+ return e.clusterNode ? t.attr("transform", "translate(" + (e.x + a - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), a;
3050
+ }, "positionNode");
3051
+ function Nt(e, t, a = !1) {
3052
+ let n = e, i = "default";
3053
+ (n?.classes?.length || 0) > 0 && (i = (n?.classes ?? []).join(" ")), i += " flowchart-label";
3054
+ let r = 0, s = "", l;
3055
+ switch (n.type) {
3056
+ case "round":
3057
+ r = 5, s = "rect";
3058
+ break;
3059
+ case "composite":
3060
+ r = 0, s = "composite", l = 0;
3061
+ break;
3062
+ case "square":
3063
+ s = "rect";
3064
+ break;
3065
+ case "diamond":
3066
+ s = "question";
3067
+ break;
3068
+ case "hexagon":
3069
+ s = "hexagon";
3070
+ break;
3071
+ case "block_arrow":
3072
+ s = "block_arrow";
3073
+ break;
3074
+ case "odd":
3075
+ s = "rect_left_inv_arrow";
3076
+ break;
3077
+ case "lean_right":
3078
+ s = "lean_right";
3079
+ break;
3080
+ case "lean_left":
3081
+ s = "lean_left";
3082
+ break;
3083
+ case "trapezoid":
3084
+ s = "trapezoid";
3085
+ break;
3086
+ case "inv_trapezoid":
3087
+ s = "inv_trapezoid";
3088
+ break;
3089
+ case "rect_left_inv_arrow":
3090
+ s = "rect_left_inv_arrow";
3091
+ break;
3092
+ case "circle":
3093
+ s = "circle";
3094
+ break;
3095
+ case "ellipse":
3096
+ s = "ellipse";
3097
+ break;
3098
+ case "stadium":
3099
+ s = "stadium";
3100
+ break;
3101
+ case "subroutine":
3102
+ s = "subroutine";
3103
+ break;
3104
+ case "cylinder":
3105
+ s = "cylinder";
3106
+ break;
3107
+ case "group":
3108
+ s = "rect";
3109
+ break;
3110
+ case "doublecircle":
3111
+ s = "doublecircle";
3112
+ break;
3113
+ default:
3114
+ s = "rect";
3115
+ }
3116
+ let o = Ue(n?.styles ?? []), p = n.label, c = n.size ?? {
3117
+ width: 0,
3118
+ height: 0,
3119
+ x: 0,
3120
+ y: 0
3121
+ }, u = t.getDiagramId();
3122
+ return {
3123
+ labelStyle: o.labelStyle,
3124
+ shape: s,
3125
+ labelText: p,
3126
+ rx: r,
3127
+ ry: r,
3128
+ class: i,
3129
+ style: o.style,
3130
+ id: n.id,
3131
+ domId: u ? `${u}-${n.id}` : n.id,
3132
+ directions: n.directions,
3133
+ width: c.width,
3134
+ height: c.height,
3135
+ x: c.x,
3136
+ y: c.y,
3137
+ positioned: a,
3138
+ intersect: void 0,
3139
+ type: n.type,
3140
+ padding: l ?? tt()?.block?.padding ?? 0,
3141
+ widthInColumns: n.widthInColumns ?? 1
3142
+ };
3143
+ }
3144
+ g(Nt, "getNodeFromBlock");
3145
+ async function le(e, t, a) {
3146
+ let n = Nt(t, a, !1);
3147
+ if (n.type === "group") return;
3148
+ let i = await ne(e, n, { config: tt() }), r = i.node().getBBox(), s = a.getBlock(n.id);
3149
+ s.size = {
3150
+ width: r.width,
3151
+ height: r.height,
3152
+ x: 0,
3153
+ y: 0,
3154
+ node: i
3155
+ }, a.setBlock(s), i.remove();
3156
+ }
3157
+ g(le, "calculateBlockSize");
3158
+ async function oe(e, t, a) {
3159
+ let n = Nt(t, a, !0);
3160
+ a.getBlock(n.id).type !== "space" && (await ne(e, n, { config: tt() }), t.intersect = n?.intersect, Jr(n));
3161
+ }
3162
+ g(oe, "insertBlockPositioned");
3163
+ async function ot(e, t, a, n) {
3164
+ for (let i of t) await n(e, i, a), i.children && await ot(e, i.children, a, n);
3165
+ }
3166
+ g(ot, "performOperations");
3167
+ async function ce(e, t, a) {
3168
+ await ot(e, t, a, le);
3169
+ }
3170
+ g(ce, "calculateBlockSizes");
3171
+ async function de(e, t, a) {
3172
+ await ot(e, t, a, oe);
3173
+ }
3174
+ g(de, "insertBlocks");
3175
+ async function he(e, t, a, n, i) {
3176
+ let r = new Je({
3177
+ multigraph: !0,
3178
+ compound: !0
3179
+ });
3180
+ r.setGraph({
3181
+ rankdir: "TB",
3182
+ nodesep: 10,
3183
+ ranksep: 10,
3184
+ marginx: 8,
3185
+ marginy: 8
3186
+ });
3187
+ for (let s of a) s.size && r.setNode(s.id, {
3188
+ width: s.size.width,
3189
+ height: s.size.height,
3190
+ intersect: s.intersect
3191
+ });
3192
+ for (let s of t) if (s.start && s.end) {
3193
+ let l = n.getBlock(s.start), o = n.getBlock(s.end);
3194
+ if (l?.size && o?.size) {
3195
+ let p = l.size, c = o.size, u = [
3196
+ {
3197
+ x: p.x,
3198
+ y: p.y
3199
+ },
3200
+ {
3201
+ x: p.x + (c.x - p.x) / 2,
3202
+ y: p.y + (c.y - p.y) / 2
3203
+ },
3204
+ {
3205
+ x: c.x,
3206
+ y: c.y
3207
+ }
3208
+ ], m = i ? `${i}-${s.id}` : s.id, b = `${s.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal"} ${s.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;
3209
+ _r(e, {
3210
+ v: s.start,
3211
+ w: s.end,
3212
+ name: m
3213
+ }, {
3214
+ ...s,
3215
+ id: m,
3216
+ arrowTypeEnd: s.arrowTypeEnd,
3217
+ arrowTypeStart: s.arrowTypeStart,
3218
+ points: u,
3219
+ classes: b
3220
+ }, void 0, "block", r, i), s.label && (await wr(e, {
3221
+ ...s,
3222
+ label: s.label,
3223
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
3224
+ arrowTypeEnd: s.arrowTypeEnd,
3225
+ arrowTypeStart: s.arrowTypeStart,
3226
+ points: u,
3227
+ classes: b
3228
+ }), Sr({
3229
+ ...s,
3230
+ x: u[1].x,
3231
+ y: u[1].y
3232
+ }, { originalPath: u }));
3233
+ }
3234
+ }
3235
+ }
3236
+ g(he, "insertEdges");
3237
+ var ra = {
3238
+ parser: ir,
3239
+ db: gr,
3240
+ renderer: {
3241
+ draw: /* @__PURE__ */ g(async function(e, t, a, n) {
3242
+ let { securityLevel: i, block: r } = tt(), s = n.db;
3243
+ s.setDiagramId(t);
3244
+ let l;
3245
+ i === "sandbox" && (l = v("#i" + t));
3246
+ let o = v(i === "sandbox" ? l.nodes()[0].contentDocument.body : "body"), p = i === "sandbox" ? o.select(`[id="${t}"]`) : v(`[id="${t}"]`);
3247
+ xr(p, [
3248
+ "point",
3249
+ "circle",
3250
+ "cross"
3251
+ ], n.type, t);
3252
+ let c = s.getBlocks(), u = s.getBlocksFlat(), m = s.getEdges(), b = p.insert("g").attr("class", "block");
3253
+ await ce(b, c, s);
3254
+ let w = Qt(s);
3255
+ if (await de(b, c, s), await he(b, m, u, s, t), w) {
3256
+ let k = w, L = Math.max(1, Math.round(0.125 * (k.width / k.height))), $ = k.height + L + 10, d = k.width + 10, { useMaxWidth: x } = r;
3257
+ ye(p, $, d, !!x), S.debug("Here Bounds", w, k), p.attr("viewBox", `${k.x - 5} ${k.y - 5} ${k.width + 10} ${k.height + 10}`);
3258
+ }
3259
+ }, "draw"),
3260
+ getClasses: /* @__PURE__ */ g(function(e, t) {
3261
+ return t.db.getClasses();
3262
+ }, "getClasses")
3263
+ },
3264
+ styles: ur
3265
+ };
3266
+ export {
3267
+ ra as diagram
3268
+ };