@kong-ui-public/documentation 1.4.17-pr.2665.525593492.0 → 1.4.17

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 (84) hide show
  1. package/dist/_basePickBy-BCsiP0lE-DJBdvZNn.js +151 -0
  2. package/dist/{_baseUniq-SAfYgIkf-buEvGj9H.js → _baseUniq-CsvgMmt0-CCBG5z_B.js} +165 -165
  3. package/dist/arc-DYb5Ak6k-js8YHzj6.js +83 -0
  4. package/dist/architecture-U656AL7Q-LZu-yAfZ-CQD6AyxA.js +5 -0
  5. package/dist/architectureDiagram-KFL7JDKH-BK_an8l5-D20M_MXF.js +4665 -0
  6. package/dist/blockDiagram-ZYB65J3Q-C0KtqCEe-pwEm3-ie.js +2265 -0
  7. package/dist/{c4Diagram-6F5ED5ID-D5yqWyf0-DzlUmurv.js → c4Diagram-AAMF2YG6-DYHWlrmc-C6NWDsTV.js} +4 -4
  8. package/dist/{channel-bVcNKbrJ-NqcPkfCx.js → channel-3QVQMCTA-BwyrTaJi.js} +1 -1
  9. package/dist/{chunk-TMUBEWPD-BRIzn5gH-alZ9Sg3f.js → chunk-ANTBXLJU-BhR1MDfy-Bec7kb00.js} +1 -1
  10. package/dist/{chunk-KFBOBJHC-nixdujtH-CrTZo7r-.js → chunk-FHKO5MBM-z_nuC8Da-Dge2Nbr5.js} +1 -1
  11. package/dist/chunk-GLLZNHP4-DgwBbAOT-BUrsAxH8.js +19 -0
  12. package/dist/chunk-JBRWN2VN-CHua2TSC-BYWS19Oz.js +1374 -0
  13. package/dist/chunk-LXBSTHXV-CoED0jHL-Cc8w4JL1.js +1382 -0
  14. package/dist/chunk-NRVI72HA-DxsqT4Dt-Bo_vu9qn.js +20 -0
  15. package/dist/{chunk-ASOPGD6M-B5bA_saK-BiT875Ve.js → chunk-OMD6QJNC-_VI6zVGr-Bb4P7zNG.js} +1 -1
  16. package/dist/chunk-WVR4S24B-C4HIWky3-CkJ0DHSJ.js +8 -0
  17. package/dist/classDiagram-3BZAVTQC-DrmNjTt_-CS9fxl_R.js +16 -0
  18. package/dist/classDiagram-v2-QTMF73CY-DrmNjTt_-CS9fxl_R.js +16 -0
  19. package/dist/{clone-_5SW34SG-DOuhA6mG.js → clone-C0dvnYv6-BozdSvey.js} +1 -1
  20. package/dist/cytoscape.esm-CjI2IsL8-DYIumutE.js +18721 -0
  21. package/dist/{dagre-4EVJKHTY-CcAruc30-B3UMlKNl.js → dagre-2BBEFEWP-Bh_bYuL8-Cej31YXN.js} +53 -53
  22. package/dist/defaultLocale-D7EN2tov-CK6dgF7Y.js +171 -0
  23. package/dist/diagram-4IRLE6MV-34TaesxP-XfF-gcP2.js +533 -0
  24. package/dist/diagram-GUPCWM2R-Cr4-5_uX-B8mxM1Uc.js +143 -0
  25. package/dist/diagram-RP2FKANI-COpvHjzI-C-_mZxuk.js +221 -0
  26. package/dist/documentation.es.js +1 -1
  27. package/dist/documentation.umd.js +860 -399
  28. package/dist/erDiagram-HZWUO2LU-Cu2MerRS-KziSgDQg.js +840 -0
  29. package/dist/flowDiagram-THRYKUMA-CfrQTB8C-BYn8LF24.js +1627 -0
  30. package/dist/ganttDiagram-WV7ZQ7D5-gkieebY_-C7YOriZ4.js +2504 -0
  31. package/dist/gitGraph-F6HP7TQM-suE5ufvy-CQDQV2yP.js +5 -0
  32. package/dist/{gitGraphDiagram-NRZ2UAAF-B-t90-9e-BkGPAEnk.js → gitGraphDiagram-OJR772UL-CYA7EIoU-Bqc1qZk4.js} +103 -103
  33. package/dist/{graph-BYZMvqpu-BXRs5843.js → graph-B_1gOUDz-Dm6REFzZ.js} +2 -2
  34. package/dist/{index-CMZig9xg.js → index-BDD0CD9m.js} +9834 -9540
  35. package/dist/info-NVLQJR56-CdsHk-Jf-tf8zb8tD.js +5 -0
  36. package/dist/infoDiagram-6WOFNB3A-ajp3t5Lm-D80dGo5F.js +24 -0
  37. package/dist/{journeyDiagram-G5WM74LC-BE7U42Ad-y6YegUqL.js → journeyDiagram-FFXJYRFH-kgCEEPLo-CakI8CyJ.js} +357 -333
  38. package/dist/{kanban-definition-QRCXZQQD-C-5-UNRm-BOYYKTAB.js → kanban-definition-KOZQBZVT-CmM4CHe6-rjuufCiO.js} +75 -73
  39. package/dist/{katex-Qk2jHgyB-_qyJ_37x.js → katex-C0Lgw_Sx-CbX2I1cQ.js} +1864 -1814
  40. package/dist/{layout-BHI4imdk-CESYC-il.js → layout-9vIfpCf3-FfABA43y.js} +81 -81
  41. package/dist/linear-C-k9vokG-Md9dfBfB.js +259 -0
  42. package/dist/{mermaid-parser.core-Ce96PX3Q-CV9ue_xr.js → mermaid-parser.core-DHL9WXVx-DeKF3RZx.js} +4080 -3590
  43. package/dist/{mindmap-definition-GWI6TPTV-C98Syvj2-DUWC1UH5.js → mindmap-definition-LNHGMQRG-BsypuFYj-DSVrvuog.js} +1112 -1100
  44. package/dist/packet-BFZMPI3H-BcK9kJ-B-BxxCPBGn.js +5 -0
  45. package/dist/pie-7BOR55EZ-Vt5px0F3-BM7egbMh.js +5 -0
  46. package/dist/pieDiagram-DBDJKBY4-Bam6gKTi-BOqYeC6c.js +161 -0
  47. package/dist/{quadrantDiagram-OS5C2QUG-M57vVPSx-BRx-dMGe.js → quadrantDiagram-YPSRARAO-CJwMw09m-CN2OO-Le.js} +2 -2
  48. package/dist/radar-NHE76QYJ-Br11XWE4-4RP4MPFA.js +5 -0
  49. package/dist/requirementDiagram-EGVEC5DT-DkRytT0X-C2zigskn.js +850 -0
  50. package/dist/{sankeyDiagram-Y46BX6SQ-D6EdYPdp-D2Qzxmhx.js → sankeyDiagram-HRAUVNP4-08s1UHMk-2j8idkNs.js} +198 -193
  51. package/dist/{sequenceDiagram-G6AWOVSC-B171TAb1-KCpoI-Ck.js → sequenceDiagram-WFGC7UMF-6_s7-CN7-D-oTpLFJ.js} +1001 -992
  52. package/dist/stateDiagram-UUKSUZ4H-eWajY90l-BlM614AN.js +263 -0
  53. package/dist/stateDiagram-v2-EYPG3UTE-Dh7Ngu1O-YVMiocHE.js +16 -0
  54. package/dist/style.css +1 -1
  55. package/dist/timeline-definition-3HZDQTIS-4TPEOhE8-fDDLVlO8.js +799 -0
  56. package/dist/treemap-KMMF4GRG-nu7WEuPi-C1YG24W8.js +5 -0
  57. package/dist/{xychartDiagram-6QU3TZC5-CqbTSF5W-CUbJ50KT.js → xychartDiagram-FDP5SA34-BbtKlU7T-D1BI5nWs.js} +459 -423
  58. package/package.json +4 -4
  59. package/dist/_basePickBy-zlkqRmFy-D6w9JBLu.js +0 -151
  60. package/dist/arc-CK9P6CkJ-DVgfRhzX.js +0 -83
  61. package/dist/architecture-I3QFYML2-DJzmbE4M-C3v7Cpg0.js +0 -5
  62. package/dist/architectureDiagram-UYN6MBPD-DkZdgpXi-BTThTJ0F.js +0 -4592
  63. package/dist/blockDiagram-ZHA2E4KO-DnCMGCMN-DBXa-baO.js +0 -2247
  64. package/dist/chunk-5HRBRIJM-BjQ8go1b-CJmT3AYe.js +0 -24
  65. package/dist/chunk-7U56Z5CX-awhAxjZ0-Cs_UWlwk.js +0 -1213
  66. package/dist/chunk-T2TOU4HS-DqOVhIzl-O3PUl7Qp.js +0 -1301
  67. package/dist/classDiagram-LNE6IOMH-fQzyXfo--DYLd8UQH.js +0 -14
  68. package/dist/classDiagram-v2-MQ7JQ4JX-fQzyXfo--DYLd8UQH.js +0 -14
  69. package/dist/cytoscape.esm-DAyNQ0qu-i5PnoWfE.js +0 -16110
  70. package/dist/diagram-QW4FP2JN-DZT_0aFO-SYzM51ke.js +0 -126
  71. package/dist/erDiagram-6RL3IURR-BfgUC5jv-BrebVho-.js +0 -937
  72. package/dist/flowDiagram-7ASYPVHJ-Bo9CnsE7-Ds2vln_y.js +0 -1484
  73. package/dist/ganttDiagram-NTVNEXSI-8E9hjd6N-fR_cmeDc.js +0 -2491
  74. package/dist/gitGraph-YCYPL57B-BnErPIwo-DXUTceC1.js +0 -5
  75. package/dist/info-46DW6VJ7-DPpbx_vA-omPXKuBd.js +0 -5
  76. package/dist/infoDiagram-A4XQUW5V-Bo9uoOcA-CnlgI27B.js +0 -22
  77. package/dist/linear-C2PheBya-BHVXLcru.js +0 -423
  78. package/dist/packet-W2GHVCYJ-BLiQbm7T-BD1xX8XM.js +0 -5
  79. package/dist/pie-BEWT4RHE-D3Mbo3mT-B4n38n6N.js +0 -5
  80. package/dist/pieDiagram-YF2LJOPJ-BJV27s9B-DA7hy5wG.js +0 -161
  81. package/dist/requirementDiagram-MIRIMTAZ-D0KDg7rf-CRMUyo68.js +0 -768
  82. package/dist/stateDiagram-MAYHULR4-D7FUnT9_-aCApnrI4.js +0 -268
  83. package/dist/stateDiagram-v2-4JROLMXI-Cyc74STT-D-7hwTRo.js +0 -14
  84. package/dist/timeline-definition-U7ZMHBDA-Bw-dp1yf-C01CsNUU.js +0 -804
@@ -1,2247 +0,0 @@
1
- import { _ as g, aD as at, a9 as O, aa as ce, l as L, aq as he, av as ge, br as ue, ay as ye, az as pe, g as B, bs as G, bq as Xt, e as be, ao as tt, ag as xe, bt as fe, bu as bt, bv as me, ad as Tt } from "./index-CMZig9xg.js";
2
- import { a as we } from "./clone-_5SW34SG-DOuhA6mG.js";
3
- import { L as Le } from "./graph-BYZMvqpu-BXRs5843.js";
4
- import { t as Se } from "./channel-bVcNKbrJ-NqcPkfCx.js";
5
- var xt = function() {
6
- var e = /* @__PURE__ */ g(function(D, c, p, f) {
7
- for (p = p || {}, f = D.length; f--; p[D[f]] = c) ;
8
- return p;
9
- }, "o"), t = [1, 7], a = [1, 13], n = [1, 14], i = [1, 15], r = [1, 19], s = [1, 16], l = [1, 17], o = [1, 18], y = [8, 30], u = [8, 21, 28, 29, 30, 31, 32, 40, 44, 47], b = [1, 23], x = [1, 24], S = [8, 15, 16, 21, 28, 29, 30, 31, 32, 40, 44, 47], w = [8, 15, 16, 21, 27, 28, 29, 30, 31, 32, 40, 44, 47], v = [1, 49], k = {
10
- trace: /* @__PURE__ */ g(function() {
11
- }, "trace"),
12
- yy: {},
13
- symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, block: 31, NODE_ID: 32, nodeShapeNLabel: 33, dirList: 34, DIR: 35, NODE_DSTART: 36, NODE_DEND: 37, BLOCK_ARROW_START: 38, BLOCK_ARROW_END: 39, classDef: 40, CLASSDEF_ID: 41, CLASSDEF_STYLEOPTS: 42, DEFAULT: 43, class: 44, CLASSENTITY_IDS: 45, STYLECLASS: 46, style: 47, STYLE_ENTITY_IDS: 48, STYLE_DEFINITION_DATA: 49, $accept: 0, $end: 1 },
14
- terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "block", 32: "NODE_ID", 35: "DIR", 36: "NODE_DSTART", 37: "NODE_DEND", 38: "BLOCK_ARROW_START", 39: "BLOCK_ARROW_END", 40: "classDef", 41: "CLASSDEF_ID", 42: "CLASSDEF_STYLEOPTS", 43: "DEFAULT", 44: "class", 45: "CLASSENTITY_IDS", 46: "STYLECLASS", 47: "style", 48: "STYLE_ENTITY_IDS", 49: "STYLE_DEFINITION_DATA" },
15
- productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [34, 1], [34, 2], [33, 3], [33, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
16
- performAction: /* @__PURE__ */ g(function(D, c, p, f, E, d, m) {
17
- var h = d.length - 1;
18
- switch (E) {
19
- case 4:
20
- f.getLogger().debug("Rule: separator (NL) ");
21
- break;
22
- case 5:
23
- f.getLogger().debug("Rule: separator (Space) ");
24
- break;
25
- case 6:
26
- f.getLogger().debug("Rule: separator (EOF) ");
27
- break;
28
- case 7:
29
- f.getLogger().debug("Rule: hierarchy: ", d[h - 1]), f.setHierarchy(d[h - 1]);
30
- break;
31
- case 8:
32
- f.getLogger().debug("Stop NL ");
33
- break;
34
- case 9:
35
- f.getLogger().debug("Stop EOF ");
36
- break;
37
- case 10:
38
- f.getLogger().debug("Stop NL2 ");
39
- break;
40
- case 11:
41
- f.getLogger().debug("Stop EOF2 ");
42
- break;
43
- case 12:
44
- f.getLogger().debug("Rule: statement: ", d[h]), typeof d[h].length == "number" ? this.$ = d[h] : this.$ = [d[h]];
45
- break;
46
- case 13:
47
- f.getLogger().debug("Rule: statement #2: ", d[h - 1]), this.$ = [d[h - 1]].concat(d[h]);
48
- break;
49
- case 14:
50
- f.getLogger().debug("Rule: link: ", d[h], D), this.$ = { edgeTypeStr: d[h], label: "" };
51
- break;
52
- case 15:
53
- f.getLogger().debug("Rule: LABEL link: ", d[h - 3], d[h - 1], d[h]), this.$ = { edgeTypeStr: d[h], label: d[h - 1] };
54
- break;
55
- case 18:
56
- const I = parseInt(d[h]), M = f.generateId();
57
- this.$ = { id: M, type: "space", label: "", width: I, children: [] };
58
- break;
59
- case 23:
60
- f.getLogger().debug("Rule: (nodeStatement link node) ", d[h - 2], d[h - 1], d[h], " typestr: ", d[h - 1].edgeTypeStr);
61
- const z = f.edgeStrToEdgeData(d[h - 1].edgeTypeStr);
62
- this.$ = [
63
- { id: d[h - 2].id, label: d[h - 2].label, type: d[h - 2].type, directions: d[h - 2].directions },
64
- { id: d[h - 2].id + "-" + d[h].id, start: d[h - 2].id, end: d[h].id, label: d[h - 1].label, type: "edge", directions: d[h].directions, arrowTypeEnd: z, arrowTypeStart: "arrow_open" },
65
- { id: d[h].id, label: d[h].label, type: f.typeStr2Type(d[h].typeStr), directions: d[h].directions }
66
- ];
67
- break;
68
- case 24:
69
- f.getLogger().debug("Rule: nodeStatement (abc88 node size) ", d[h - 1], d[h]), this.$ = { id: d[h - 1].id, label: d[h - 1].label, type: f.typeStr2Type(d[h - 1].typeStr), directions: d[h - 1].directions, widthInColumns: parseInt(d[h], 10) };
70
- break;
71
- case 25:
72
- f.getLogger().debug("Rule: nodeStatement (node) ", d[h]), this.$ = { id: d[h].id, label: d[h].label, type: f.typeStr2Type(d[h].typeStr), directions: d[h].directions, widthInColumns: 1 };
73
- break;
74
- case 26:
75
- f.getLogger().debug("APA123", this ? this : "na"), f.getLogger().debug("COLUMNS: ", d[h]), this.$ = { type: "column-setting", columns: d[h] === "auto" ? -1 : parseInt(d[h]) };
76
- break;
77
- case 27:
78
- f.getLogger().debug("Rule: id-block statement : ", d[h - 2], d[h - 1]), f.generateId(), this.$ = { ...d[h - 2], type: "composite", children: d[h - 1] };
79
- break;
80
- case 28:
81
- f.getLogger().debug("Rule: blockStatement : ", d[h - 2], d[h - 1], d[h]);
82
- const X = f.generateId();
83
- this.$ = { id: X, type: "composite", label: "", children: d[h - 1] };
84
- break;
85
- case 29:
86
- f.getLogger().debug("Rule: node (NODE_ID separator): ", d[h]), this.$ = { id: d[h] };
87
- break;
88
- case 30:
89
- f.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", d[h - 1], d[h]), this.$ = { id: d[h - 1], label: d[h].label, typeStr: d[h].typeStr, directions: d[h].directions };
90
- break;
91
- case 31:
92
- f.getLogger().debug("Rule: dirList: ", d[h]), this.$ = [d[h]];
93
- break;
94
- case 32:
95
- f.getLogger().debug("Rule: dirList: ", d[h - 1], d[h]), this.$ = [d[h - 1]].concat(d[h]);
96
- break;
97
- case 33:
98
- f.getLogger().debug("Rule: nodeShapeNLabel: ", d[h - 2], d[h - 1], d[h]), this.$ = { typeStr: d[h - 2] + d[h], label: d[h - 1] };
99
- break;
100
- case 34:
101
- f.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", d[h - 3], d[h - 2], " #3:", d[h - 1], d[h]), this.$ = { typeStr: d[h - 3] + d[h], label: d[h - 2], directions: d[h - 1] };
102
- break;
103
- case 35:
104
- case 36:
105
- this.$ = { type: "classDef", id: d[h - 1].trim(), css: d[h].trim() };
106
- break;
107
- case 37:
108
- this.$ = { type: "applyClass", id: d[h - 1].trim(), styleClass: d[h].trim() };
109
- break;
110
- case 38:
111
- this.$ = { type: "applyStyles", id: d[h - 1].trim(), stylesStr: d[h].trim() };
112
- break;
113
- }
114
- }, "anonymous"),
115
- table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 11: 3, 13: 4, 19: 5, 20: 6, 21: t, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: a, 29: n, 31: i, 32: r, 40: s, 44: l, 47: o }, { 8: [1, 20] }, e(y, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 21: t, 28: a, 29: n, 31: i, 32: r, 40: s, 44: l, 47: o }), e(u, [2, 16], { 14: 22, 15: b, 16: x }), e(u, [2, 17]), e(u, [2, 18]), e(u, [2, 19]), e(u, [2, 20]), e(u, [2, 21]), e(u, [2, 22]), e(S, [2, 25], { 27: [1, 25] }), e(u, [2, 26]), { 19: 26, 26: 12, 32: r }, { 11: 27, 13: 4, 19: 5, 20: 6, 21: t, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: a, 29: n, 31: i, 32: r, 40: s, 44: l, 47: o }, { 41: [1, 28], 43: [1, 29] }, { 45: [1, 30] }, { 48: [1, 31] }, e(w, [2, 29], { 33: 32, 36: [1, 33], 38: [1, 34] }), { 1: [2, 7] }, e(y, [2, 13]), { 26: 35, 32: r }, { 32: [2, 14] }, { 17: [1, 36] }, e(S, [2, 24]), { 11: 37, 13: 4, 14: 22, 15: b, 16: x, 19: 5, 20: 6, 21: t, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: a, 29: n, 31: i, 32: r, 40: s, 44: l, 47: o }, { 30: [1, 38] }, { 42: [1, 39] }, { 42: [1, 40] }, { 46: [1, 41] }, { 49: [1, 42] }, e(w, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(S, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(u, [2, 28]), e(u, [2, 35]), e(u, [2, 36]), e(u, [2, 37]), e(u, [2, 38]), { 37: [1, 47] }, { 34: 48, 35: v }, { 15: [1, 50] }, e(u, [2, 27]), e(w, [2, 33]), { 39: [1, 51] }, { 34: 52, 35: v, 39: [2, 31] }, { 32: [2, 15] }, e(w, [2, 34]), { 39: [2, 32] }],
116
- defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
117
- parseError: /* @__PURE__ */ g(function(D, c) {
118
- if (c.recoverable)
119
- this.trace(D);
120
- else {
121
- var p = new Error(D);
122
- throw p.hash = c, p;
123
- }
124
- }, "parseError"),
125
- parse: /* @__PURE__ */ g(function(D) {
126
- var c = this, p = [0], f = [], E = [null], d = [], m = this.table, h = "", I = 0, M = 0, z = 2, X = 1, F = d.slice.call(arguments, 1), A = Object.create(this.lexer), V = { yy: {} };
127
- for (var gt in this.yy)
128
- Object.prototype.hasOwnProperty.call(this.yy, gt) && (V.yy[gt] = this.yy[gt]);
129
- A.setInput(D, V.yy), V.yy.lexer = A, V.yy.parser = this, typeof A.yylloc > "u" && (A.yylloc = {});
130
- var ut = A.yylloc;
131
- d.push(ut);
132
- var oe = A.options && A.options.ranges;
133
- typeof V.yy.parseError == "function" ? this.parseError = V.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
134
- function de(Y) {
135
- p.length = p.length - 2 * Y, E.length = E.length - Y, d.length = d.length - Y;
136
- }
137
- g(de, "popStack");
138
- function Dt() {
139
- var Y;
140
- return Y = f.pop() || A.lex() || X, typeof Y != "number" && (Y instanceof Array && (f = Y, Y = f.pop()), Y = c.symbols_[Y] || Y), Y;
141
- }
142
- g(Dt, "lex");
143
- for (var W, q, H, yt, Q = {}, st, J, Nt, it; ; ) {
144
- if (q = p[p.length - 1], this.defaultActions[q] ? H = this.defaultActions[q] : ((W === null || typeof W > "u") && (W = Dt()), H = m[q] && m[q][W]), typeof H > "u" || !H.length || !H[0]) {
145
- var pt = "";
146
- it = [];
147
- for (st in m[q])
148
- this.terminals_[st] && st > z && it.push("'" + this.terminals_[st] + "'");
149
- A.showPosition ? pt = "Parse error on line " + (I + 1) + `:
150
- ` + A.showPosition() + `
151
- Expecting ` + it.join(", ") + ", got '" + (this.terminals_[W] || W) + "'" : pt = "Parse error on line " + (I + 1) + ": Unexpected " + (W == X ? "end of input" : "'" + (this.terminals_[W] || W) + "'"), this.parseError(pt, {
152
- text: A.match,
153
- token: this.terminals_[W] || W,
154
- line: A.yylineno,
155
- loc: ut,
156
- expected: it
157
- });
158
- }
159
- if (H[0] instanceof Array && H.length > 1)
160
- throw new Error("Parse Error: multiple actions possible at state: " + q + ", token: " + W);
161
- switch (H[0]) {
162
- case 1:
163
- p.push(W), E.push(A.yytext), d.push(A.yylloc), p.push(H[1]), W = null, M = A.yyleng, h = A.yytext, I = A.yylineno, ut = A.yylloc;
164
- break;
165
- case 2:
166
- if (J = this.productions_[H[1]][1], Q.$ = E[E.length - J], Q._$ = {
167
- first_line: d[d.length - (J || 1)].first_line,
168
- last_line: d[d.length - 1].last_line,
169
- first_column: d[d.length - (J || 1)].first_column,
170
- last_column: d[d.length - 1].last_column
171
- }, oe && (Q._$.range = [
172
- d[d.length - (J || 1)].range[0],
173
- d[d.length - 1].range[1]
174
- ]), yt = this.performAction.apply(Q, [
175
- h,
176
- M,
177
- I,
178
- V.yy,
179
- H[1],
180
- E,
181
- d
182
- ].concat(F)), typeof yt < "u")
183
- return yt;
184
- J && (p = p.slice(0, -1 * J * 2), E = E.slice(0, -1 * J), d = d.slice(0, -1 * J)), p.push(this.productions_[H[1]][0]), E.push(Q.$), d.push(Q._$), Nt = m[p[p.length - 2]][p[p.length - 1]], p.push(Nt);
185
- break;
186
- case 3:
187
- return !0;
188
- }
189
- }
190
- return !0;
191
- }, "parse")
192
- }, N = /* @__PURE__ */ function() {
193
- var D = {
194
- EOF: 1,
195
- parseError: /* @__PURE__ */ g(function(c, p) {
196
- if (this.yy.parser)
197
- this.yy.parser.parseError(c, p);
198
- else
199
- throw new Error(c);
200
- }, "parseError"),
201
- // resets the lexer, sets new input
202
- setInput: /* @__PURE__ */ g(function(c, p) {
203
- return this.yy = p || this.yy || {}, this._input = c, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
204
- first_line: 1,
205
- first_column: 0,
206
- last_line: 1,
207
- last_column: 0
208
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
209
- }, "setInput"),
210
- // consumes and returns one char from the input
211
- input: /* @__PURE__ */ g(function() {
212
- var c = this._input[0];
213
- this.yytext += c, this.yyleng++, this.offset++, this.match += c, this.matched += c;
214
- var p = c.match(/(?:\r\n?|\n).*/g);
215
- return p ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), c;
216
- }, "input"),
217
- // unshifts one char (or a string) into the input
218
- unput: /* @__PURE__ */ g(function(c) {
219
- var p = c.length, f = c.split(/(?:\r\n?|\n)/g);
220
- this._input = c + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - p), this.offset -= p;
221
- var E = this.match.split(/(?:\r\n?|\n)/g);
222
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), f.length - 1 && (this.yylineno -= f.length - 1);
223
- var d = this.yylloc.range;
224
- return this.yylloc = {
225
- first_line: this.yylloc.first_line,
226
- last_line: this.yylineno + 1,
227
- first_column: this.yylloc.first_column,
228
- last_column: f ? (f.length === E.length ? this.yylloc.first_column : 0) + E[E.length - f.length].length - f[0].length : this.yylloc.first_column - p
229
- }, this.options.ranges && (this.yylloc.range = [d[0], d[0] + this.yyleng - p]), this.yyleng = this.yytext.length, this;
230
- }, "unput"),
231
- // When called from action, caches matched text and appends it on next action
232
- more: /* @__PURE__ */ g(function() {
233
- return this._more = !0, this;
234
- }, "more"),
235
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
236
- reject: /* @__PURE__ */ g(function() {
237
- if (this.options.backtrack_lexer)
238
- this._backtrack = !0;
239
- else
240
- 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).
241
- ` + this.showPosition(), {
242
- text: "",
243
- token: null,
244
- line: this.yylineno
245
- });
246
- return this;
247
- }, "reject"),
248
- // retain first n characters of the match
249
- less: /* @__PURE__ */ g(function(c) {
250
- this.unput(this.match.slice(c));
251
- }, "less"),
252
- // displays already matched input, i.e. for error messages
253
- pastInput: /* @__PURE__ */ g(function() {
254
- var c = this.matched.substr(0, this.matched.length - this.match.length);
255
- return (c.length > 20 ? "..." : "") + c.substr(-20).replace(/\n/g, "");
256
- }, "pastInput"),
257
- // displays upcoming input, i.e. for error messages
258
- upcomingInput: /* @__PURE__ */ g(function() {
259
- var c = this.match;
260
- return c.length < 20 && (c += this._input.substr(0, 20 - c.length)), (c.substr(0, 20) + (c.length > 20 ? "..." : "")).replace(/\n/g, "");
261
- }, "upcomingInput"),
262
- // displays the character position where the lexing error occurred, i.e. for error messages
263
- showPosition: /* @__PURE__ */ g(function() {
264
- var c = this.pastInput(), p = new Array(c.length + 1).join("-");
265
- return c + this.upcomingInput() + `
266
- ` + p + "^";
267
- }, "showPosition"),
268
- // test the lexed token: return FALSE when not a match, otherwise return token
269
- test_match: /* @__PURE__ */ g(function(c, p) {
270
- var f, E, d;
271
- if (this.options.backtrack_lexer && (d = {
272
- yylineno: this.yylineno,
273
- yylloc: {
274
- first_line: this.yylloc.first_line,
275
- last_line: this.last_line,
276
- first_column: this.yylloc.first_column,
277
- last_column: this.yylloc.last_column
278
- },
279
- yytext: this.yytext,
280
- match: this.match,
281
- matches: this.matches,
282
- matched: this.matched,
283
- yyleng: this.yyleng,
284
- offset: this.offset,
285
- _more: this._more,
286
- _input: this._input,
287
- yy: this.yy,
288
- conditionStack: this.conditionStack.slice(0),
289
- done: this.done
290
- }, this.options.ranges && (d.yylloc.range = this.yylloc.range.slice(0))), E = c[0].match(/(?:\r\n?|\n).*/g), E && (this.yylineno += E.length), this.yylloc = {
291
- first_line: this.yylloc.last_line,
292
- last_line: this.yylineno + 1,
293
- first_column: this.yylloc.last_column,
294
- last_column: E ? E[E.length - 1].length - E[E.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + c[0].length
295
- }, this.yytext += c[0], this.match += c[0], this.matches = c, 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(c[0].length), this.matched += c[0], f = this.performAction.call(this, this.yy, this, p, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), f)
296
- return f;
297
- if (this._backtrack) {
298
- for (var m in d)
299
- this[m] = d[m];
300
- return !1;
301
- }
302
- return !1;
303
- }, "test_match"),
304
- // return next match in input
305
- next: /* @__PURE__ */ g(function() {
306
- if (this.done)
307
- return this.EOF;
308
- this._input || (this.done = !0);
309
- var c, p, f, E;
310
- this._more || (this.yytext = "", this.match = "");
311
- for (var d = this._currentRules(), m = 0; m < d.length; m++)
312
- if (f = this._input.match(this.rules[d[m]]), f && (!p || f[0].length > p[0].length)) {
313
- if (p = f, E = m, this.options.backtrack_lexer) {
314
- if (c = this.test_match(f, d[m]), c !== !1)
315
- return c;
316
- if (this._backtrack) {
317
- p = !1;
318
- continue;
319
- } else
320
- return !1;
321
- } else if (!this.options.flex)
322
- break;
323
- }
324
- return p ? (c = this.test_match(p, d[E]), c !== !1 ? c : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
325
- ` + this.showPosition(), {
326
- text: "",
327
- token: null,
328
- line: this.yylineno
329
- });
330
- }, "next"),
331
- // return next match that has a token
332
- lex: /* @__PURE__ */ g(function() {
333
- var c = this.next();
334
- return c || this.lex();
335
- }, "lex"),
336
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
337
- begin: /* @__PURE__ */ g(function(c) {
338
- this.conditionStack.push(c);
339
- }, "begin"),
340
- // pop the previously active lexer condition state off the condition stack
341
- popState: /* @__PURE__ */ g(function() {
342
- var c = this.conditionStack.length - 1;
343
- return c > 0 ? this.conditionStack.pop() : this.conditionStack[0];
344
- }, "popState"),
345
- // produce the lexer rule set which is active for the currently active lexer condition state
346
- _currentRules: /* @__PURE__ */ g(function() {
347
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
348
- }, "_currentRules"),
349
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
350
- topState: /* @__PURE__ */ g(function(c) {
351
- return c = this.conditionStack.length - 1 - Math.abs(c || 0), c >= 0 ? this.conditionStack[c] : "INITIAL";
352
- }, "topState"),
353
- // alias for begin(condition)
354
- pushState: /* @__PURE__ */ g(function(c) {
355
- this.begin(c);
356
- }, "pushState"),
357
- // return the number of states currently on the stack
358
- stateStackSize: /* @__PURE__ */ g(function() {
359
- return this.conditionStack.length;
360
- }, "stateStackSize"),
361
- options: {},
362
- performAction: /* @__PURE__ */ g(function(c, p, f, E) {
363
- switch (f) {
364
- case 0:
365
- return 10;
366
- case 1:
367
- return c.getLogger().debug("Found space-block"), 31;
368
- case 2:
369
- return c.getLogger().debug("Found nl-block"), 31;
370
- case 3:
371
- return c.getLogger().debug("Found space-block"), 29;
372
- case 4:
373
- c.getLogger().debug(".", p.yytext);
374
- break;
375
- case 5:
376
- c.getLogger().debug("_", p.yytext);
377
- break;
378
- case 6:
379
- return 5;
380
- case 7:
381
- return p.yytext = -1, 28;
382
- case 8:
383
- return p.yytext = p.yytext.replace(/columns\s+/, ""), c.getLogger().debug("COLUMNS (LEX)", p.yytext), 28;
384
- case 9:
385
- this.pushState("md_string");
386
- break;
387
- case 10:
388
- return "MD_STR";
389
- case 11:
390
- this.popState();
391
- break;
392
- case 12:
393
- this.pushState("string");
394
- break;
395
- case 13:
396
- c.getLogger().debug("LEX: POPPING STR:", p.yytext), this.popState();
397
- break;
398
- case 14:
399
- return c.getLogger().debug("LEX: STR end:", p.yytext), "STR";
400
- case 15:
401
- return p.yytext = p.yytext.replace(/space\:/, ""), c.getLogger().debug("SPACE NUM (LEX)", p.yytext), 21;
402
- case 16:
403
- return p.yytext = "1", c.getLogger().debug("COLUMNS (LEX)", p.yytext), 21;
404
- case 17:
405
- return 43;
406
- case 18:
407
- return "LINKSTYLE";
408
- case 19:
409
- return "INTERPOLATE";
410
- case 20:
411
- return this.pushState("CLASSDEF"), 40;
412
- case 21:
413
- return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
414
- case 22:
415
- return this.popState(), this.pushState("CLASSDEFID"), 41;
416
- case 23:
417
- return this.popState(), 42;
418
- case 24:
419
- return this.pushState("CLASS"), 44;
420
- case 25:
421
- return this.popState(), this.pushState("CLASS_STYLE"), 45;
422
- case 26:
423
- return this.popState(), 46;
424
- case 27:
425
- return this.pushState("STYLE_STMNT"), 47;
426
- case 28:
427
- return this.popState(), this.pushState("STYLE_DEFINITION"), 48;
428
- case 29:
429
- return this.popState(), 49;
430
- case 30:
431
- return this.pushState("acc_title"), "acc_title";
432
- case 31:
433
- return this.popState(), "acc_title_value";
434
- case 32:
435
- return this.pushState("acc_descr"), "acc_descr";
436
- case 33:
437
- return this.popState(), "acc_descr_value";
438
- case 34:
439
- this.pushState("acc_descr_multiline");
440
- break;
441
- case 35:
442
- this.popState();
443
- break;
444
- case 36:
445
- return "acc_descr_multiline_value";
446
- case 37:
447
- return 30;
448
- case 38:
449
- return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
450
- case 39:
451
- return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
452
- case 40:
453
- return this.popState(), c.getLogger().debug("Lex: ))"), "NODE_DEND";
454
- case 41:
455
- return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
456
- case 42:
457
- return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
458
- case 43:
459
- return this.popState(), c.getLogger().debug("Lex: (-"), "NODE_DEND";
460
- case 44:
461
- return this.popState(), c.getLogger().debug("Lex: -)"), "NODE_DEND";
462
- case 45:
463
- return this.popState(), c.getLogger().debug("Lex: (("), "NODE_DEND";
464
- case 46:
465
- return this.popState(), c.getLogger().debug("Lex: ]]"), "NODE_DEND";
466
- case 47:
467
- return this.popState(), c.getLogger().debug("Lex: ("), "NODE_DEND";
468
- case 48:
469
- return this.popState(), c.getLogger().debug("Lex: ])"), "NODE_DEND";
470
- case 49:
471
- return this.popState(), c.getLogger().debug("Lex: /]"), "NODE_DEND";
472
- case 50:
473
- return this.popState(), c.getLogger().debug("Lex: /]"), "NODE_DEND";
474
- case 51:
475
- return this.popState(), c.getLogger().debug("Lex: )]"), "NODE_DEND";
476
- case 52:
477
- return this.popState(), c.getLogger().debug("Lex: )"), "NODE_DEND";
478
- case 53:
479
- return this.popState(), c.getLogger().debug("Lex: ]>"), "NODE_DEND";
480
- case 54:
481
- return this.popState(), c.getLogger().debug("Lex: ]"), "NODE_DEND";
482
- case 55:
483
- return c.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 36;
484
- case 56:
485
- return c.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 36;
486
- case 57:
487
- return c.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 36;
488
- case 58:
489
- return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
490
- case 59:
491
- return c.getLogger().debug("Lex: ((("), this.pushState("NODE"), 36;
492
- case 60:
493
- return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
494
- case 61:
495
- return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
496
- case 62:
497
- return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
498
- case 63:
499
- return c.getLogger().debug("Lexc: >"), this.pushState("NODE"), 36;
500
- case 64:
501
- return c.getLogger().debug("Lexa: (["), this.pushState("NODE"), 36;
502
- case 65:
503
- return c.getLogger().debug("Lexa: )"), this.pushState("NODE"), 36;
504
- case 66:
505
- return this.pushState("NODE"), 36;
506
- case 67:
507
- return this.pushState("NODE"), 36;
508
- case 68:
509
- return this.pushState("NODE"), 36;
510
- case 69:
511
- return this.pushState("NODE"), 36;
512
- case 70:
513
- return this.pushState("NODE"), 36;
514
- case 71:
515
- return this.pushState("NODE"), 36;
516
- case 72:
517
- return this.pushState("NODE"), 36;
518
- case 73:
519
- return c.getLogger().debug("Lexa: ["), this.pushState("NODE"), 36;
520
- case 74:
521
- return this.pushState("BLOCK_ARROW"), c.getLogger().debug("LEX ARR START"), 38;
522
- case 75:
523
- return c.getLogger().debug("Lex: NODE_ID", p.yytext), 32;
524
- case 76:
525
- return c.getLogger().debug("Lex: EOF", p.yytext), 8;
526
- case 77:
527
- this.pushState("md_string");
528
- break;
529
- case 78:
530
- this.pushState("md_string");
531
- break;
532
- case 79:
533
- return "NODE_DESCR";
534
- case 80:
535
- this.popState();
536
- break;
537
- case 81:
538
- c.getLogger().debug("Lex: Starting string"), this.pushState("string");
539
- break;
540
- case 82:
541
- c.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
542
- break;
543
- case 83:
544
- return c.getLogger().debug("LEX: NODE_DESCR:", p.yytext), "NODE_DESCR";
545
- case 84:
546
- c.getLogger().debug("LEX POPPING"), this.popState();
547
- break;
548
- case 85:
549
- c.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
550
- break;
551
- case 86:
552
- return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (right): dir:", p.yytext), "DIR";
553
- case 87:
554
- return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (left):", p.yytext), "DIR";
555
- case 88:
556
- return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (x):", p.yytext), "DIR";
557
- case 89:
558
- return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (y):", p.yytext), "DIR";
559
- case 90:
560
- return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (up):", p.yytext), "DIR";
561
- case 91:
562
- return p.yytext = p.yytext.replace(/^,\s*/, ""), c.getLogger().debug("Lex (down):", p.yytext), "DIR";
563
- case 92:
564
- return p.yytext = "]>", c.getLogger().debug("Lex (ARROW_DIR end):", p.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
565
- case 93:
566
- return c.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
567
- case 94:
568
- return c.getLogger().debug("Lex: LINK", p.yytext), 15;
569
- case 95:
570
- return c.getLogger().debug("Lex: LINK", p.yytext), 15;
571
- case 96:
572
- return c.getLogger().debug("Lex: LINK", p.yytext), 15;
573
- case 97:
574
- return c.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
575
- case 98:
576
- return c.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
577
- case 99:
578
- return c.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
579
- case 100:
580
- this.pushState("md_string");
581
- break;
582
- case 101:
583
- return c.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
584
- case 102:
585
- return this.popState(), c.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
586
- case 103:
587
- return this.popState(), c.getLogger().debug("Lex: LINK", p.yytext), 15;
588
- case 104:
589
- return this.popState(), c.getLogger().debug("Lex: LINK", p.yytext), 15;
590
- case 105:
591
- return c.getLogger().debug("Lex: COLON", p.yytext), p.yytext = p.yytext.slice(1), 27;
592
- }
593
- }, "anonymous"),
594
- rules: [/^(?:block-beta\b)/, /^(?:block\s+)/, /^(?:block\n+)/, /^(?:block:)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
595
- conditions: { STYLE_DEFINITION: { rules: [29], inclusive: !1 }, STYLE_STMNT: { rules: [28], inclusive: !1 }, CLASSDEFID: { rules: [23], inclusive: !1 }, CLASSDEF: { rules: [21, 22], inclusive: !1 }, CLASS_STYLE: { rules: [26], inclusive: !1 }, CLASS: { rules: [25], inclusive: !1 }, LLABEL: { rules: [100, 101, 102, 103, 104], inclusive: !1 }, ARROW_DIR: { rules: [86, 87, 88, 89, 90, 91, 92], inclusive: !1 }, BLOCK_ARROW: { rules: [77, 82, 85], inclusive: !1 }, NODE: { rules: [38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 78, 81], inclusive: !1 }, md_string: { rules: [10, 11, 79, 80], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [13, 14, 83, 84], inclusive: !1 }, acc_descr_multiline: { rules: [35, 36], inclusive: !1 }, acc_descr: { rules: [33], inclusive: !1 }, acc_title: { rules: [31], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 16, 17, 18, 19, 20, 24, 27, 30, 32, 34, 37, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 93, 94, 95, 96, 97, 98, 99, 105], inclusive: !0 } }
596
- };
597
- return D;
598
- }();
599
- k.lexer = N;
600
- function _() {
601
- this.yy = {};
602
- }
603
- return g(_, "Parser"), _.prototype = k, k.Parser = _, new _();
604
- }();
605
- xt.parser = xt;
606
- var ke = xt, U = /* @__PURE__ */ new Map(), St = [], ft = /* @__PURE__ */ new Map(), $t = "color", Ct = "fill", _e = "bgFill", Ft = ",", ve = B(), ot = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ g((e) => xe.sanitizeText(e, ve), "sanitizeText"), De = /* @__PURE__ */ g(function(e, t = "") {
607
- let a = ot.get(e);
608
- a || (a = { id: e, styles: [], textStyles: [] }, ot.set(e, a)), t != null && t.split(Ft).forEach((n) => {
609
- const i = n.replace(/([^;]*);/, "$1").trim();
610
- if (RegExp($t).exec(n)) {
611
- const r = i.replace(Ct, _e).replace($t, Ct);
612
- a.textStyles.push(r);
613
- }
614
- a.styles.push(i);
615
- });
616
- }, "addStyleClass"), Ne = /* @__PURE__ */ g(function(e, t = "") {
617
- const a = U.get(e);
618
- t != null && (a.styles = t.split(Ft));
619
- }, "addStyle2Node"), Te = /* @__PURE__ */ g(function(e, t) {
620
- e.split(",").forEach(function(a) {
621
- let n = U.get(a);
622
- if (n === void 0) {
623
- const i = a.trim();
624
- n = { id: i, type: "na", children: [] }, U.set(i, n);
625
- }
626
- n.classes || (n.classes = []), n.classes.push(t);
627
- });
628
- }, "setCssClass"), Yt = /* @__PURE__ */ g((e, t) => {
629
- const a = e.flat(), n = [];
630
- for (const i of a) {
631
- if (i.label && (i.label = Ee(i.label)), i.type === "classDef") {
632
- De(i.id, i.css);
633
- continue;
634
- }
635
- if (i.type === "applyClass") {
636
- Te(i.id, (i == null ? void 0 : i.styleClass) ?? "");
637
- continue;
638
- }
639
- if (i.type === "applyStyles") {
640
- i != null && i.stylesStr && Ne(i.id, i == null ? void 0 : i.stylesStr);
641
- continue;
642
- }
643
- if (i.type === "column-setting")
644
- t.columns = i.columns ?? -1;
645
- else if (i.type === "edge") {
646
- const r = (ft.get(i.id) ?? 0) + 1;
647
- ft.set(i.id, r), i.id = r + "-" + i.id, St.push(i);
648
- } else {
649
- i.label || (i.type === "composite" ? i.label = "" : i.label = i.id);
650
- const r = U.get(i.id);
651
- if (r === void 0 ? U.set(i.id, i) : (i.type !== "na" && (r.type = i.type), i.label !== i.id && (r.label = i.label)), i.children && Yt(i.children, i), i.type === "space") {
652
- const s = i.width ?? 1;
653
- for (let l = 0; l < s; l++) {
654
- const o = we(i);
655
- o.id = o.id + "-" + l, U.set(o.id, o), n.push(o);
656
- }
657
- } else r === void 0 && n.push(i);
658
- }
659
- }
660
- t.children = n;
661
- }, "populateBlockDatabase"), kt = [], rt = { id: "root", type: "composite", children: [], columns: -1 }, $e = /* @__PURE__ */ g(() => {
662
- L.debug("Clear called"), he(), rt = { id: "root", type: "composite", children: [], columns: -1 }, U = /* @__PURE__ */ new Map([["root", rt]]), kt = [], ot = /* @__PURE__ */ new Map(), St = [], ft = /* @__PURE__ */ new Map();
663
- }, "clear");
664
- function Kt(e) {
665
- switch (L.debug("typeStr2Type", e), e) {
666
- case "[]":
667
- return "square";
668
- case "()":
669
- return L.debug("we have a round"), "round";
670
- case "(())":
671
- return "circle";
672
- case ">]":
673
- return "rect_left_inv_arrow";
674
- case "{}":
675
- return "diamond";
676
- case "{{}}":
677
- return "hexagon";
678
- case "([])":
679
- return "stadium";
680
- case "[[]]":
681
- return "subroutine";
682
- case "[()]":
683
- return "cylinder";
684
- case "((()))":
685
- return "doublecircle";
686
- case "[//]":
687
- return "lean_right";
688
- case "[\\\\]":
689
- return "lean_left";
690
- case "[/\\]":
691
- return "trapezoid";
692
- case "[\\/]":
693
- return "inv_trapezoid";
694
- case "<[]>":
695
- return "block_arrow";
696
- default:
697
- return "na";
698
- }
699
- }
700
- g(Kt, "typeStr2Type");
701
- function Ht(e) {
702
- switch (L.debug("typeStr2Type", e), e) {
703
- case "==":
704
- return "thick";
705
- default:
706
- return "normal";
707
- }
708
- }
709
- g(Ht, "edgeTypeStr2Type");
710
- function jt(e) {
711
- switch (e.trim()) {
712
- case "--x":
713
- return "arrow_cross";
714
- case "--o":
715
- return "arrow_circle";
716
- default:
717
- return "arrow_point";
718
- }
719
- }
720
- g(jt, "edgeStrToEdgeData");
721
- var It = 0, Ce = /* @__PURE__ */ g(() => (It++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + It), "generateId"), Ie = /* @__PURE__ */ g((e) => {
722
- rt.children = e, Yt(e, rt), kt = rt.children;
723
- }, "setHierarchy"), Oe = /* @__PURE__ */ g((e) => {
724
- const t = U.get(e);
725
- return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
726
- }, "getColumns"), Be = /* @__PURE__ */ g(() => [...U.values()], "getBlocksFlat"), ze = /* @__PURE__ */ g(() => kt || [], "getBlocks"), Ae = /* @__PURE__ */ g(() => St, "getEdges"), Re = /* @__PURE__ */ g((e) => U.get(e), "getBlock"), Me = /* @__PURE__ */ g((e) => {
727
- U.set(e.id, e);
728
- }, "setBlock"), Pe = /* @__PURE__ */ g(() => console, "getLogger"), We = /* @__PURE__ */ g(function() {
729
- return ot;
730
- }, "getClasses"), Xe = {
731
- getConfig: /* @__PURE__ */ g(() => at().block, "getConfig"),
732
- typeStr2Type: Kt,
733
- edgeTypeStr2Type: Ht,
734
- edgeStrToEdgeData: jt,
735
- getLogger: Pe,
736
- getBlocksFlat: Be,
737
- getBlocks: ze,
738
- getEdges: Ae,
739
- setHierarchy: Ie,
740
- getBlock: Re,
741
- setBlock: Me,
742
- getColumns: Oe,
743
- getClasses: We,
744
- clear: $e,
745
- generateId: Ce
746
- }, Fe = Xe, nt = /* @__PURE__ */ g((e, t) => {
747
- const a = Se, n = a(e, "r"), i = a(e, "g"), r = a(e, "b");
748
- return ge(n, i, r, t);
749
- }, "fade"), Ye = /* @__PURE__ */ g((e) => `.label {
750
- font-family: ${e.fontFamily};
751
- color: ${e.nodeTextColor || e.textColor};
752
- }
753
- .cluster-label text {
754
- fill: ${e.titleColor};
755
- }
756
- .cluster-label span,p {
757
- color: ${e.titleColor};
758
- }
759
-
760
-
761
-
762
- .label text,span,p {
763
- fill: ${e.nodeTextColor || e.textColor};
764
- color: ${e.nodeTextColor || e.textColor};
765
- }
766
-
767
- .node rect,
768
- .node circle,
769
- .node ellipse,
770
- .node polygon,
771
- .node path {
772
- fill: ${e.mainBkg};
773
- stroke: ${e.nodeBorder};
774
- stroke-width: 1px;
775
- }
776
- .flowchart-label text {
777
- text-anchor: middle;
778
- }
779
- // .flowchart-label .text-outer-tspan {
780
- // text-anchor: middle;
781
- // }
782
- // .flowchart-label .text-inner-tspan {
783
- // text-anchor: start;
784
- // }
785
-
786
- .node .label {
787
- text-align: center;
788
- }
789
- .node.clickable {
790
- cursor: pointer;
791
- }
792
-
793
- .arrowheadPath {
794
- fill: ${e.arrowheadColor};
795
- }
796
-
797
- .edgePath .path {
798
- stroke: ${e.lineColor};
799
- stroke-width: 2.0px;
800
- }
801
-
802
- .flowchart-link {
803
- stroke: ${e.lineColor};
804
- fill: none;
805
- }
806
-
807
- .edgeLabel {
808
- background-color: ${e.edgeLabelBackground};
809
- rect {
810
- opacity: 0.5;
811
- background-color: ${e.edgeLabelBackground};
812
- fill: ${e.edgeLabelBackground};
813
- }
814
- text-align: center;
815
- }
816
-
817
- /* For html labels only */
818
- .labelBkg {
819
- background-color: ${nt(e.edgeLabelBackground, 0.5)};
820
- // background-color:
821
- }
822
-
823
- .node .cluster {
824
- // fill: ${nt(e.mainBkg, 0.5)};
825
- fill: ${nt(e.clusterBkg, 0.5)};
826
- stroke: ${nt(e.clusterBorder, 0.2)};
827
- box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
828
- stroke-width: 1px;
829
- }
830
-
831
- .cluster text {
832
- fill: ${e.titleColor};
833
- }
834
-
835
- .cluster span,p {
836
- color: ${e.titleColor};
837
- }
838
- /* .cluster div {
839
- color: ${e.titleColor};
840
- } */
841
-
842
- div.mermaidTooltip {
843
- position: absolute;
844
- text-align: center;
845
- max-width: 200px;
846
- padding: 2px;
847
- font-family: ${e.fontFamily};
848
- font-size: 12px;
849
- background: ${e.tertiaryColor};
850
- border: 1px solid ${e.border2};
851
- border-radius: 2px;
852
- pointer-events: none;
853
- z-index: 100;
854
- }
855
-
856
- .flowchartTitleText {
857
- text-anchor: middle;
858
- font-size: 18px;
859
- fill: ${e.textColor};
860
- }
861
- `, "getStyles"), Ke = Ye, He = /* @__PURE__ */ g((e, t, a, n) => {
862
- t.forEach((i) => {
863
- er[i](e, a, n);
864
- });
865
- }, "insertMarkers"), je = /* @__PURE__ */ g((e, t, a) => {
866
- L.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");
867
- }, "extension"), Ue = /* @__PURE__ */ g((e, t, a) => {
868
- 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");
869
- }, "composition"), Ze = /* @__PURE__ */ g((e, t, a) => {
870
- 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");
871
- }, "aggregation"), Ge = /* @__PURE__ */ g((e, t, a) => {
872
- 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");
873
- }, "dependency"), Je = /* @__PURE__ */ g((e, t, a) => {
874
- 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);
875
- }, "lollipop"), Ve = /* @__PURE__ */ g((e, t, a) => {
876
- 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");
877
- }, "point"), qe = /* @__PURE__ */ g((e, t, a) => {
878
- 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");
879
- }, "circle"), Qe = /* @__PURE__ */ g((e, t, a) => {
880
- 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");
881
- }, "cross"), tr = /* @__PURE__ */ g((e, t, a) => {
882
- 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");
883
- }, "barb"), er = {
884
- extension: je,
885
- composition: Ue,
886
- aggregation: Ze,
887
- dependency: Ge,
888
- lollipop: Je,
889
- point: Ve,
890
- circle: qe,
891
- cross: Qe,
892
- barb: tr
893
- }, rr = He, Ot, Bt, C = ((Bt = (Ot = B()) == null ? void 0 : Ot.block) == null ? void 0 : Bt.padding) ?? 8;
894
- function Ut(e, t) {
895
- if (e === 0 || !Number.isInteger(e))
896
- throw new Error("Columns must be an integer !== 0.");
897
- if (t < 0 || !Number.isInteger(t))
898
- throw new Error("Position must be a non-negative integer." + t);
899
- if (e < 0)
900
- return { px: t, py: 0 };
901
- if (e === 1)
902
- return { px: 0, py: t };
903
- const a = t % e, n = Math.floor(t / e);
904
- return { px: a, py: n };
905
- }
906
- g(Ut, "calculateBlockPosition");
907
- var ar = /* @__PURE__ */ g((e) => {
908
- let t = 0, a = 0;
909
- for (const n of e.children) {
910
- const { width: i, height: r, x: s, y: l } = n.size ?? { width: 0, height: 0, x: 0, y: 0 };
911
- L.debug(
912
- "getMaxChildSize abc95 child:",
913
- n.id,
914
- "width:",
915
- i,
916
- "height:",
917
- r,
918
- "x:",
919
- s,
920
- "y:",
921
- l,
922
- n.type
923
- ), n.type !== "space" && (i > t && (t = i / (e.widthInColumns ?? 1)), r > a && (a = r));
924
- }
925
- return { width: t, height: a };
926
- }, "getMaxChildSize");
927
- function dt(e, t, a = 0, n = 0) {
928
- var i, r, s, l, o, y, u, b, x, S, w;
929
- L.debug(
930
- "setBlockSizes abc95 (start)",
931
- e.id,
932
- (i = e == null ? void 0 : e.size) == null ? void 0 : i.x,
933
- "block width =",
934
- e == null ? void 0 : e.size,
935
- "sieblingWidth",
936
- a
937
- ), (r = e == null ? void 0 : e.size) != null && r.width || (e.size = {
938
- width: a,
939
- height: n,
940
- x: 0,
941
- y: 0
942
- });
943
- let v = 0, k = 0;
944
- if (((s = e.children) == null ? void 0 : s.length) > 0) {
945
- for (const d of e.children)
946
- dt(d, t);
947
- const N = ar(e);
948
- v = N.width, k = N.height, L.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", v, k);
949
- for (const d of e.children)
950
- d.size && (L.debug(
951
- `abc95 Setting size of children of ${e.id} id=${d.id} ${v} ${k} ${JSON.stringify(d.size)}`
952
- ), d.size.width = v * (d.widthInColumns ?? 1) + C * ((d.widthInColumns ?? 1) - 1), d.size.height = k, d.size.x = 0, d.size.y = 0, L.debug(
953
- `abc95 updating size of ${e.id} children child:${d.id} maxWidth:${v} maxHeight:${k}`
954
- ));
955
- for (const d of e.children)
956
- dt(d, t, v, k);
957
- const _ = e.columns ?? -1;
958
- let D = 0;
959
- for (const d of e.children)
960
- D += d.widthInColumns ?? 1;
961
- let c = e.children.length;
962
- _ > 0 && _ < D && (c = _);
963
- const p = Math.ceil(D / c);
964
- let f = c * (v + C) + C, E = p * (k + C) + C;
965
- if (f < a) {
966
- L.debug(
967
- `Detected to small siebling: abc95 ${e.id} sieblingWidth ${a} sieblingHeight ${n} width ${f}`
968
- ), f = a, E = n;
969
- const d = (a - c * C - C) / c, m = (n - p * C - C) / p;
970
- L.debug("Size indata abc88", e.id, "childWidth", d, "maxWidth", v), L.debug("Size indata abc88", e.id, "childHeight", m, "maxHeight", k), L.debug("Size indata abc88 xSize", c, "padding", C);
971
- for (const h of e.children)
972
- h.size && (h.size.width = d, h.size.height = m, h.size.x = 0, h.size.y = 0);
973
- }
974
- if (L.debug(
975
- `abc95 (finale calc) ${e.id} xSize ${c} ySize ${p} columns ${_}${e.children.length} width=${Math.max(f, ((l = e.size) == null ? void 0 : l.width) || 0)}`
976
- ), f < (((o = e == null ? void 0 : e.size) == null ? void 0 : o.width) || 0)) {
977
- f = ((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) || 0;
978
- const d = _ > 0 ? Math.min(e.children.length, _) : e.children.length;
979
- if (d > 0) {
980
- const m = (f - d * C - C) / d;
981
- L.debug("abc95 (growing to fit) width", e.id, f, (u = e.size) == null ? void 0 : u.width, m);
982
- for (const h of e.children)
983
- h.size && (h.size.width = m);
984
- }
985
- }
986
- e.size = {
987
- width: f,
988
- height: E,
989
- x: 0,
990
- y: 0
991
- };
992
- }
993
- L.debug(
994
- "setBlockSizes abc94 (done)",
995
- e.id,
996
- (b = e == null ? void 0 : e.size) == null ? void 0 : b.x,
997
- (x = e == null ? void 0 : e.size) == null ? void 0 : x.width,
998
- (S = e == null ? void 0 : e.size) == null ? void 0 : S.y,
999
- (w = e == null ? void 0 : e.size) == null ? void 0 : w.height
1000
- );
1001
- }
1002
- g(dt, "setBlockSizes");
1003
- function _t(e, t) {
1004
- var a, n, i, r, s, l, o, y, u, b, x, S, w, v, k, N, _;
1005
- L.debug(
1006
- `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(a = e == null ? void 0 : e.size) == null ? void 0 : a.x} y: ${(n = e == null ? void 0 : e.size) == null ? void 0 : n.y} width: ${(i = e == null ? void 0 : e.size) == null ? void 0 : i.width}`
1007
- );
1008
- const D = e.columns ?? -1;
1009
- if (L.debug("layoutBlocks columns abc95", e.id, "=>", D, e), e.children && // find max width of children
1010
- e.children.length > 0) {
1011
- const c = ((s = (r = e == null ? void 0 : e.children[0]) == null ? void 0 : r.size) == null ? void 0 : s.width) ?? 0, p = e.children.length * c + (e.children.length - 1) * C;
1012
- L.debug("widthOfChildren 88", p, "posX");
1013
- let f = 0;
1014
- L.debug("abc91 block?.size?.x", e.id, (l = e == null ? void 0 : e.size) == null ? void 0 : l.x);
1015
- let E = (o = e == null ? void 0 : e.size) != null && o.x ? ((y = e == null ? void 0 : e.size) == null ? void 0 : y.x) + (-((u = e == null ? void 0 : e.size) == null ? void 0 : u.width) / 2 || 0) : -C, d = 0;
1016
- for (const m of e.children) {
1017
- const h = e;
1018
- if (!m.size)
1019
- continue;
1020
- const { width: I, height: M } = m.size, { px: z, py: X } = Ut(D, f);
1021
- if (X != d && (d = X, E = (b = e == null ? void 0 : e.size) != null && b.x ? ((x = e == null ? void 0 : e.size) == null ? void 0 : x.x) + (-((S = e == null ? void 0 : e.size) == null ? void 0 : S.width) / 2 || 0) : -C, L.debug("New row in layout for block", e.id, " and child ", m.id, d)), L.debug(
1022
- `abc89 layout blocks (child) id: ${m.id} Pos: ${f} (px, py) ${z},${X} (${(w = h == null ? void 0 : h.size) == null ? void 0 : w.x},${(v = h == null ? void 0 : h.size) == null ? void 0 : v.y}) parent: ${h.id} width: ${I}${C}`
1023
- ), h.size) {
1024
- const F = I / 2;
1025
- m.size.x = E + C + F, L.debug(
1026
- `abc91 layout blocks (calc) px, pyid:${m.id} startingPos=X${E} new startingPosX${m.size.x} ${F} padding=${C} width=${I} halfWidth=${F} => x:${m.size.x} y:${m.size.y} ${m.widthInColumns} (width * (child?.w || 1)) / 2 ${I * ((m == null ? void 0 : m.widthInColumns) ?? 1) / 2}`
1027
- ), E = m.size.x + F, m.size.y = h.size.y - h.size.height / 2 + X * (M + C) + M / 2 + C, L.debug(
1028
- `abc88 layout blocks (calc) px, pyid:${m.id}startingPosX${E}${C}${F}=>x:${m.size.x}y:${m.size.y}${m.widthInColumns}(width * (child?.w || 1)) / 2${I * ((m == null ? void 0 : m.widthInColumns) ?? 1) / 2}`
1029
- );
1030
- }
1031
- m.children && _t(m), f += (m == null ? void 0 : m.widthInColumns) ?? 1, L.debug("abc88 columnsPos", m, f);
1032
- }
1033
- }
1034
- L.debug(
1035
- `layout blocks (<==layoutBlocks) ${e.id} x: ${(k = e == null ? void 0 : e.size) == null ? void 0 : k.x} y: ${(N = e == null ? void 0 : e.size) == null ? void 0 : N.y} width: ${(_ = e == null ? void 0 : e.size) == null ? void 0 : _.width}`
1036
- );
1037
- }
1038
- g(_t, "layoutBlocks");
1039
- function vt(e, { minX: t, minY: a, maxX: n, maxY: i } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1040
- if (e.size && e.id !== "root") {
1041
- const { x: r, y: s, width: l, height: o } = e.size;
1042
- 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);
1043
- }
1044
- if (e.children)
1045
- for (const r of e.children)
1046
- ({ minX: t, minY: a, maxX: n, maxY: i } = vt(r, { minX: t, minY: a, maxX: n, maxY: i }));
1047
- return { minX: t, minY: a, maxX: n, maxY: i };
1048
- }
1049
- g(vt, "findBounds");
1050
- function Zt(e) {
1051
- const t = e.getBlock("root");
1052
- if (!t)
1053
- return;
1054
- dt(t, e, 0, 0), _t(t), L.debug("getBlocks", JSON.stringify(t, null, 2));
1055
- const { minX: a, minY: n, maxX: i, maxY: r } = vt(t), s = r - n, l = i - a;
1056
- return { x: a, y: n, width: l, height: s };
1057
- }
1058
- g(Zt, "layout");
1059
- function mt(e, t) {
1060
- t && e.attr("style", t);
1061
- }
1062
- g(mt, "applyStyle");
1063
- function Gt(e) {
1064
- const t = O(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), a = t.append("xhtml:div"), n = e.label, i = e.isNode ? "nodeLabel" : "edgeLabel", r = a.append("span");
1065
- return r.html(n), mt(r, e.labelStyle), r.attr("class", i), mt(a, e.labelStyle), a.style("display", "inline-block"), a.style("white-space", "nowrap"), a.attr("xmlns", "http://www.w3.org/1999/xhtml"), t.node();
1066
- }
1067
- g(Gt, "addHtmlLabel");
1068
- var sr = /* @__PURE__ */ g((e, t, a, n) => {
1069
- let i = e || "";
1070
- if (typeof i == "object" && (i = i[0]), G(B().flowchart.htmlLabels)) {
1071
- i = i.replace(/\\n|\n/g, "<br />"), L.debug("vertexText" + i);
1072
- const r = {
1073
- isNode: n,
1074
- label: fe(bt(i)),
1075
- labelStyle: t.replace("fill:", "color:")
1076
- };
1077
- return Gt(r);
1078
- } else {
1079
- const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
1080
- r.setAttribute("style", t.replace("color:", "fill:"));
1081
- let s = [];
1082
- typeof i == "string" ? s = i.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(i) ? s = i : s = [];
1083
- for (const l of s) {
1084
- const o = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1085
- o.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), o.setAttribute("dy", "1em"), o.setAttribute("x", "0"), a ? o.setAttribute("class", "title-row") : o.setAttribute("class", "row"), o.textContent = l.trim(), r.appendChild(o);
1086
- }
1087
- return r;
1088
- }
1089
- }, "createLabel"), j = sr, ir = /* @__PURE__ */ g((e, t, a, n, i) => {
1090
- t.arrowTypeStart && zt(e, "start", t.arrowTypeStart, a, n, i), t.arrowTypeEnd && zt(e, "end", t.arrowTypeEnd, a, n, i);
1091
- }, "addEdgeMarkers"), nr = {
1092
- arrow_cross: "cross",
1093
- arrow_point: "point",
1094
- arrow_barb: "barb",
1095
- arrow_circle: "circle",
1096
- aggregation: "aggregation",
1097
- extension: "extension",
1098
- composition: "composition",
1099
- dependency: "dependency",
1100
- lollipop: "lollipop"
1101
- }, zt = /* @__PURE__ */ g((e, t, a, n, i, r) => {
1102
- const s = nr[a];
1103
- if (!s) {
1104
- L.warn(`Unknown arrow type: ${a}`);
1105
- return;
1106
- }
1107
- const l = t === "start" ? "Start" : "End";
1108
- e.attr(`marker-${t}`, `url(${n}#${i}_${r}-${s}${l})`);
1109
- }, "addEdgeMarker"), wt = {}, P = {}, lr = /* @__PURE__ */ g((e, t) => {
1110
- const a = B(), n = G(a.flowchart.htmlLabels), i = t.labelType === "markdown" ? Xt(
1111
- e,
1112
- t.label,
1113
- {
1114
- style: t.labelStyle,
1115
- useHtmlLabels: n,
1116
- addSvgBackground: !0
1117
- },
1118
- a
1119
- ) : j(t.label, t.labelStyle), r = e.insert("g").attr("class", "edgeLabel"), s = r.insert("g").attr("class", "label");
1120
- s.node().appendChild(i);
1121
- let l = i.getBBox();
1122
- if (n) {
1123
- const y = i.children[0], u = O(i);
1124
- l = y.getBoundingClientRect(), u.attr("width", l.width), u.attr("height", l.height);
1125
- }
1126
- s.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")"), wt[t.id] = r, t.width = l.width, t.height = l.height;
1127
- let o;
1128
- if (t.startLabelLeft) {
1129
- const y = j(t.startLabelLeft, t.labelStyle), u = e.insert("g").attr("class", "edgeTerminals"), b = u.insert("g").attr("class", "inner");
1130
- o = b.node().appendChild(y);
1131
- const x = y.getBBox();
1132
- b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), P[t.id] || (P[t.id] = {}), P[t.id].startLeft = u, et(o, t.startLabelLeft);
1133
- }
1134
- if (t.startLabelRight) {
1135
- const y = j(t.startLabelRight, t.labelStyle), u = e.insert("g").attr("class", "edgeTerminals"), b = u.insert("g").attr("class", "inner");
1136
- o = u.node().appendChild(y), b.node().appendChild(y);
1137
- const x = y.getBBox();
1138
- b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), P[t.id] || (P[t.id] = {}), P[t.id].startRight = u, et(o, t.startLabelRight);
1139
- }
1140
- if (t.endLabelLeft) {
1141
- const y = j(t.endLabelLeft, t.labelStyle), u = e.insert("g").attr("class", "edgeTerminals"), b = u.insert("g").attr("class", "inner");
1142
- o = b.node().appendChild(y);
1143
- const x = y.getBBox();
1144
- b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), u.node().appendChild(y), P[t.id] || (P[t.id] = {}), P[t.id].endLeft = u, et(o, t.endLabelLeft);
1145
- }
1146
- if (t.endLabelRight) {
1147
- const y = j(t.endLabelRight, t.labelStyle), u = e.insert("g").attr("class", "edgeTerminals"), b = u.insert("g").attr("class", "inner");
1148
- o = b.node().appendChild(y);
1149
- const x = y.getBBox();
1150
- b.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), u.node().appendChild(y), P[t.id] || (P[t.id] = {}), P[t.id].endRight = u, et(o, t.endLabelRight);
1151
- }
1152
- return i;
1153
- }, "insertEdgeLabel");
1154
- function et(e, t) {
1155
- B().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1156
- }
1157
- g(et, "setTerminalWidth");
1158
- var or = /* @__PURE__ */ g((e, t) => {
1159
- L.debug("Moving label abc88 ", e.id, e.label, wt[e.id], t);
1160
- let a = t.updatedPath ? t.updatedPath : t.originalPath;
1161
- const n = B(), { subGraphTitleTotalMargin: i } = be(n);
1162
- if (e.label) {
1163
- const r = wt[e.id];
1164
- let s = e.x, l = e.y;
1165
- if (a) {
1166
- const o = tt.calcLabelPosition(a);
1167
- L.debug(
1168
- "Moving label " + e.label + " from (",
1169
- s,
1170
- ",",
1171
- l,
1172
- ") to (",
1173
- o.x,
1174
- ",",
1175
- o.y,
1176
- ") abc88"
1177
- ), t.updatedPath && (s = o.x, l = o.y);
1178
- }
1179
- r.attr("transform", `translate(${s}, ${l + i / 2})`);
1180
- }
1181
- if (e.startLabelLeft) {
1182
- const r = P[e.id].startLeft;
1183
- let s = e.x, l = e.y;
1184
- if (a) {
1185
- const o = tt.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1186
- s = o.x, l = o.y;
1187
- }
1188
- r.attr("transform", `translate(${s}, ${l})`);
1189
- }
1190
- if (e.startLabelRight) {
1191
- const r = P[e.id].startRight;
1192
- let s = e.x, l = e.y;
1193
- if (a) {
1194
- const o = tt.calcTerminalLabelPosition(
1195
- e.arrowTypeStart ? 10 : 0,
1196
- "start_right",
1197
- a
1198
- );
1199
- s = o.x, l = o.y;
1200
- }
1201
- r.attr("transform", `translate(${s}, ${l})`);
1202
- }
1203
- if (e.endLabelLeft) {
1204
- const r = P[e.id].endLeft;
1205
- let s = e.x, l = e.y;
1206
- if (a) {
1207
- const o = tt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1208
- s = o.x, l = o.y;
1209
- }
1210
- r.attr("transform", `translate(${s}, ${l})`);
1211
- }
1212
- if (e.endLabelRight) {
1213
- const r = P[e.id].endRight;
1214
- let s = e.x, l = e.y;
1215
- if (a) {
1216
- const o = tt.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1217
- s = o.x, l = o.y;
1218
- }
1219
- r.attr("transform", `translate(${s}, ${l})`);
1220
- }
1221
- }, "positionEdgeLabel"), dr = /* @__PURE__ */ g((e, t) => {
1222
- const 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;
1223
- return i >= s || r >= l;
1224
- }, "outsideNode"), cr = /* @__PURE__ */ g((e, t, a) => {
1225
- L.debug(`intersection calc abc89:
1226
- outsidePoint: ${JSON.stringify(t)}
1227
- insidePoint : ${JSON.stringify(a)}
1228
- node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1229
- const n = e.x, i = e.y, r = Math.abs(n - a.x), s = e.width / 2;
1230
- let l = a.x < t.x ? s - r : s + r;
1231
- const o = e.height / 2, y = Math.abs(t.y - a.y), u = Math.abs(t.x - a.x);
1232
- if (Math.abs(i - t.y) * s > Math.abs(n - t.x) * o) {
1233
- let b = a.y < t.y ? t.y - o - i : i - o - t.y;
1234
- l = u * b / y;
1235
- const x = {
1236
- x: a.x < t.x ? a.x + l : a.x - u + l,
1237
- y: a.y < t.y ? a.y + y - b : a.y - y + b
1238
- };
1239
- return l === 0 && (x.x = t.x, x.y = t.y), u === 0 && (x.x = t.x), y === 0 && (x.y = t.y), L.debug(`abc89 topp/bott calc, Q ${y}, q ${b}, R ${u}, r ${l}`, x), x;
1240
- } else {
1241
- a.x < t.x ? l = t.x - s - n : l = n - s - t.x;
1242
- let b = y * l / u, x = a.x < t.x ? a.x + u - l : a.x - u + l, S = a.y < t.y ? a.y + b : a.y - b;
1243
- return L.debug(`sides calc abc89, Q ${y}, q ${b}, R ${u}, r ${l}`, { _x: x, _y: S }), l === 0 && (x = t.x, S = t.y), u === 0 && (x = t.x), y === 0 && (S = t.y), { x, y: S };
1244
- }
1245
- }, "intersection"), At = /* @__PURE__ */ g((e, t) => {
1246
- L.debug("abc88 cutPathAtIntersect", e, t);
1247
- let a = [], n = e[0], i = !1;
1248
- return e.forEach((r) => {
1249
- if (!dr(t, r) && !i) {
1250
- const s = cr(t, n, r);
1251
- let l = !1;
1252
- a.forEach((o) => {
1253
- l = l || o.x === s.x && o.y === s.y;
1254
- }), a.some((o) => o.x === s.x && o.y === s.y) || a.push(s), i = !0;
1255
- } else
1256
- n = r, i || a.push(r);
1257
- }), a;
1258
- }, "cutPathAtIntersect"), hr = /* @__PURE__ */ g(function(e, t, a, n, i, r, s) {
1259
- let l = a.points;
1260
- L.debug("abc88 InsertEdge: edge=", a, "e=", t);
1261
- let o = !1;
1262
- const y = r.node(t.v);
1263
- var u = r.node(t.w);
1264
- u != null && u.intersect && y != null && y.intersect && (l = l.slice(1, a.points.length - 1), l.unshift(y.intersect(l[0])), l.push(u.intersect(l[l.length - 1]))), a.toCluster && (L.debug("to cluster abc88", n[a.toCluster]), l = At(a.points, n[a.toCluster].node), o = !0), a.fromCluster && (L.debug("from cluster abc88", n[a.fromCluster]), l = At(l.reverse(), n[a.fromCluster].node).reverse(), o = !0);
1265
- const b = l.filter((c) => !Number.isNaN(c.y));
1266
- let x = pe;
1267
- a.curve && (i === "graph" || i === "flowchart") && (x = a.curve);
1268
- const { x: S, y: w } = ue(a), v = ye().x(S).y(w).curve(x);
1269
- let k;
1270
- switch (a.thickness) {
1271
- case "normal":
1272
- k = "edge-thickness-normal";
1273
- break;
1274
- case "thick":
1275
- k = "edge-thickness-thick";
1276
- break;
1277
- case "invisible":
1278
- k = "edge-thickness-thick";
1279
- break;
1280
- default:
1281
- k = "";
1282
- }
1283
- switch (a.pattern) {
1284
- case "solid":
1285
- k += " edge-pattern-solid";
1286
- break;
1287
- case "dotted":
1288
- k += " edge-pattern-dotted";
1289
- break;
1290
- case "dashed":
1291
- k += " edge-pattern-dashed";
1292
- break;
1293
- }
1294
- const N = e.append("path").attr("d", v(b)).attr("id", a.id).attr("class", " " + k + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1295
- let _ = "";
1296
- (B().flowchart.arrowMarkerAbsolute || B().state.arrowMarkerAbsolute) && (_ = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, _ = _.replace(/\(/g, "\\("), _ = _.replace(/\)/g, "\\)")), ir(N, a, _, s, i);
1297
- let D = {};
1298
- return o && (D.updatedPath = l), D.originalPath = a.points, D;
1299
- }, "insertEdge"), gr = /* @__PURE__ */ g((e) => {
1300
- const t = /* @__PURE__ */ new Set();
1301
- for (const a of e)
1302
- switch (a) {
1303
- case "x":
1304
- t.add("right"), t.add("left");
1305
- break;
1306
- case "y":
1307
- t.add("up"), t.add("down");
1308
- break;
1309
- default:
1310
- t.add(a);
1311
- break;
1312
- }
1313
- return t;
1314
- }, "expandAndDeduplicateDirections"), ur = /* @__PURE__ */ g((e, t, a) => {
1315
- const n = gr(e), i = 2, r = t.height + 2 * a.padding, s = r / i, l = t.width + 2 * s + a.padding, o = a.padding / 2;
1316
- return n.has("right") && n.has("left") && n.has("up") && n.has("down") ? [
1317
- // Bottom
1318
- { x: 0, y: 0 },
1319
- { x: s, y: 0 },
1320
- { x: l / 2, y: 2 * o },
1321
- { x: l - s, y: 0 },
1322
- { x: l, y: 0 },
1323
- // Right
1324
- { x: l, y: -r / 3 },
1325
- { x: l + 2 * o, y: -r / 2 },
1326
- { x: l, y: -2 * r / 3 },
1327
- { x: l, y: -r },
1328
- // Top
1329
- { x: l - s, y: -r },
1330
- { x: l / 2, y: -r - 2 * o },
1331
- { x: s, y: -r },
1332
- // Left
1333
- { x: 0, y: -r },
1334
- { x: 0, y: -2 * r / 3 },
1335
- { x: -2 * o, y: -r / 2 },
1336
- { x: 0, y: -r / 3 }
1337
- ] : n.has("right") && n.has("left") && n.has("up") ? [
1338
- { x: s, y: 0 },
1339
- { x: l - s, y: 0 },
1340
- { x: l, y: -r / 2 },
1341
- { x: l - s, y: -r },
1342
- { x: s, y: -r },
1343
- { x: 0, y: -r / 2 }
1344
- ] : n.has("right") && n.has("left") && n.has("down") ? [
1345
- { x: 0, y: 0 },
1346
- { x: s, y: -r },
1347
- { x: l - s, y: -r },
1348
- { x: l, y: 0 }
1349
- ] : n.has("right") && n.has("up") && n.has("down") ? [
1350
- { x: 0, y: 0 },
1351
- { x: l, y: -s },
1352
- { x: l, y: -r + s },
1353
- { x: 0, y: -r }
1354
- ] : n.has("left") && n.has("up") && n.has("down") ? [
1355
- { x: l, y: 0 },
1356
- { x: 0, y: -s },
1357
- { x: 0, y: -r + s },
1358
- { x: l, y: -r }
1359
- ] : n.has("right") && n.has("left") ? [
1360
- { x: s, y: 0 },
1361
- { x: s, y: -o },
1362
- { x: l - s, y: -o },
1363
- { x: l - s, y: 0 },
1364
- { x: l, y: -r / 2 },
1365
- { x: l - s, y: -r },
1366
- { x: l - s, y: -r + o },
1367
- { x: s, y: -r + o },
1368
- { x: s, y: -r },
1369
- { x: 0, y: -r / 2 }
1370
- ] : n.has("up") && n.has("down") ? [
1371
- // Bottom center
1372
- { x: l / 2, y: 0 },
1373
- // Left pont of bottom arrow
1374
- { x: 0, y: -o },
1375
- { x: s, y: -o },
1376
- // Left top over vertical section
1377
- { x: s, y: -r + o },
1378
- { x: 0, y: -r + o },
1379
- // Top of arrow
1380
- { x: l / 2, y: -r },
1381
- { x: l, y: -r + o },
1382
- // Top of right vertical bar
1383
- { x: l - s, y: -r + o },
1384
- { x: l - s, y: -o },
1385
- { x: l, y: -o }
1386
- ] : n.has("right") && n.has("up") ? [
1387
- { x: 0, y: 0 },
1388
- { x: l, y: -s },
1389
- { x: 0, y: -r }
1390
- ] : n.has("right") && n.has("down") ? [
1391
- { x: 0, y: 0 },
1392
- { x: l, y: 0 },
1393
- { x: 0, y: -r }
1394
- ] : n.has("left") && n.has("up") ? [
1395
- { x: l, y: 0 },
1396
- { x: 0, y: -s },
1397
- { x: l, y: -r }
1398
- ] : n.has("left") && n.has("down") ? [
1399
- { x: l, y: 0 },
1400
- { x: 0, y: 0 },
1401
- { x: l, y: -r }
1402
- ] : n.has("right") ? [
1403
- { x: s, y: -o },
1404
- { x: s, y: -o },
1405
- { x: l - s, y: -o },
1406
- { x: l - s, y: 0 },
1407
- { x: l, y: -r / 2 },
1408
- { x: l - s, y: -r },
1409
- { x: l - s, y: -r + o },
1410
- // top left corner of arrow
1411
- { x: s, y: -r + o },
1412
- { x: s, y: -r + o }
1413
- ] : n.has("left") ? [
1414
- { x: s, y: 0 },
1415
- { x: s, y: -o },
1416
- // Two points, the right corners
1417
- { x: l - s, y: -o },
1418
- { x: l - s, y: -r + o },
1419
- { x: s, y: -r + o },
1420
- { x: s, y: -r },
1421
- { x: 0, y: -r / 2 }
1422
- ] : n.has("up") ? [
1423
- // Bottom center
1424
- { x: s, y: -o },
1425
- // Left top over vertical section
1426
- { x: s, y: -r + o },
1427
- { x: 0, y: -r + o },
1428
- // Top of arrow
1429
- { x: l / 2, y: -r },
1430
- { x: l, y: -r + o },
1431
- // Top of right vertical bar
1432
- { x: l - s, y: -r + o },
1433
- { x: l - s, y: -o }
1434
- ] : n.has("down") ? [
1435
- // Bottom center
1436
- { x: l / 2, y: 0 },
1437
- // Left pont of bottom arrow
1438
- { x: 0, y: -o },
1439
- { x: s, y: -o },
1440
- // Left top over vertical section
1441
- { x: s, y: -r + o },
1442
- { x: l - s, y: -r + o },
1443
- { x: l - s, y: -o },
1444
- { x: l, y: -o }
1445
- ] : [{ x: 0, y: 0 }];
1446
- }, "getArrowPoints");
1447
- function Jt(e, t) {
1448
- return e.intersect(t);
1449
- }
1450
- g(Jt, "intersectNode");
1451
- var yr = Jt;
1452
- function Vt(e, t, a, n) {
1453
- 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), y = Math.abs(t * a * s / o);
1454
- n.x < i && (y = -y);
1455
- var u = Math.abs(t * a * l / o);
1456
- return n.y < r && (u = -u), { x: i + y, y: r + u };
1457
- }
1458
- g(Vt, "intersectEllipse");
1459
- var qt = Vt;
1460
- function Qt(e, t, a) {
1461
- return qt(e, t, t, a);
1462
- }
1463
- g(Qt, "intersectCircle");
1464
- var pr = Qt;
1465
- function te(e, t, a, n) {
1466
- var i, r, s, l, o, y, u, b, x, S, w, v, k, N, _;
1467
- if (i = t.y - e.y, s = e.x - t.x, o = t.x * e.y - e.x * t.y, x = i * a.x + s * a.y + o, S = i * n.x + s * n.y + o, !(x !== 0 && S !== 0 && Lt(x, S)) && (r = n.y - a.y, l = a.x - n.x, y = n.x * a.y - a.x * n.y, u = r * e.x + l * e.y + y, b = r * t.x + l * t.y + y, !(u !== 0 && b !== 0 && Lt(u, b)) && (w = i * l - r * s, w !== 0)))
1468
- return v = Math.abs(w / 2), k = s * y - l * o, N = k < 0 ? (k - v) / w : (k + v) / w, k = r * o - i * y, _ = k < 0 ? (k - v) / w : (k + v) / w, { x: N, y: _ };
1469
- }
1470
- g(te, "intersectLine");
1471
- function Lt(e, t) {
1472
- return e * t > 0;
1473
- }
1474
- g(Lt, "sameSign");
1475
- var br = te, xr = ee;
1476
- function ee(e, t, a) {
1477
- var n = e.x, i = e.y, r = [], s = Number.POSITIVE_INFINITY, l = Number.POSITIVE_INFINITY;
1478
- typeof t.forEach == "function" ? t.forEach(function(w) {
1479
- s = Math.min(s, w.x), l = Math.min(l, w.y);
1480
- }) : (s = Math.min(s, t.x), l = Math.min(l, t.y));
1481
- for (var o = n - e.width / 2 - s, y = i - e.height / 2 - l, u = 0; u < t.length; u++) {
1482
- var b = t[u], x = t[u < t.length - 1 ? u + 1 : 0], S = br(
1483
- e,
1484
- a,
1485
- { x: o + b.x, y: y + b.y },
1486
- { x: o + x.x, y: y + x.y }
1487
- );
1488
- S && r.push(S);
1489
- }
1490
- return r.length ? (r.length > 1 && r.sort(function(w, v) {
1491
- var k = w.x - a.x, N = w.y - a.y, _ = Math.sqrt(k * k + N * N), D = v.x - a.x, c = v.y - a.y, p = Math.sqrt(D * D + c * c);
1492
- return _ < p ? -1 : _ === p ? 0 : 1;
1493
- }), r[0]) : e;
1494
- }
1495
- g(ee, "intersectPolygon");
1496
- var fr = /* @__PURE__ */ g((e, t) => {
1497
- var a = e.x, n = e.y, i = t.x - a, r = t.y - n, s = e.width / 2, l = e.height / 2, o, y;
1498
- return Math.abs(r) * s > Math.abs(i) * l ? (r < 0 && (l = -l), o = r === 0 ? 0 : l * i / r, y = l) : (i < 0 && (s = -s), o = s, y = i === 0 ? 0 : s * r / i), { x: a + o, y: n + y };
1499
- }, "intersectRect"), mr = fr, T = {
1500
- node: yr,
1501
- circle: pr,
1502
- ellipse: qt,
1503
- polygon: xr,
1504
- rect: mr
1505
- }, R = /* @__PURE__ */ g(async (e, t, a, n) => {
1506
- const i = B();
1507
- let r;
1508
- const s = t.useHtmlLabels || G(i.flowchart.htmlLabels);
1509
- a ? r = a : r = "node default";
1510
- const l = e.insert("g").attr("class", r).attr("id", t.domId || t.id), o = l.insert("g").attr("class", "label").attr("style", t.labelStyle);
1511
- let y;
1512
- t.labelText === void 0 ? y = "" : y = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1513
- const u = o.node();
1514
- let b;
1515
- t.labelType === "markdown" ? b = Xt(
1516
- o,
1517
- Tt(bt(y), i),
1518
- {
1519
- useHtmlLabels: s,
1520
- width: t.width || i.flowchart.wrappingWidth,
1521
- classes: "markdown-node-label"
1522
- },
1523
- i
1524
- ) : b = u.appendChild(
1525
- j(Tt(bt(y), i), t.labelStyle, !1, n)
1526
- );
1527
- let x = b.getBBox();
1528
- const S = t.padding / 2;
1529
- if (G(i.flowchart.htmlLabels)) {
1530
- const w = b.children[0], v = O(b), k = w.getElementsByTagName("img");
1531
- if (k) {
1532
- const N = y.replace(/<img[^>]*>/g, "").trim() === "";
1533
- await Promise.all(
1534
- [...k].map(
1535
- (_) => new Promise((D) => {
1536
- function c() {
1537
- if (_.style.display = "flex", _.style.flexDirection = "column", N) {
1538
- const p = i.fontSize ? i.fontSize : window.getComputedStyle(document.body).fontSize, f = parseInt(p, 10) * 5 + "px";
1539
- _.style.minWidth = f, _.style.maxWidth = f;
1540
- } else
1541
- _.style.width = "100%";
1542
- D(_);
1543
- }
1544
- g(c, "setupImage"), setTimeout(() => {
1545
- _.complete && c();
1546
- }), _.addEventListener("error", c), _.addEventListener("load", c);
1547
- })
1548
- )
1549
- );
1550
- }
1551
- x = w.getBoundingClientRect(), v.attr("width", x.width), v.attr("height", x.height);
1552
- }
1553
- return s ? o.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")") : o.attr("transform", "translate(0, " + -x.height / 2 + ")"), t.centerLabel && o.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), o.insert("rect", ":first-child"), { shapeSvg: l, bbox: x, halfPadding: S, label: o };
1554
- }, "labelHelper"), $ = /* @__PURE__ */ g((e, t) => {
1555
- const a = t.node().getBBox();
1556
- e.width = a.width, e.height = a.height;
1557
- }, "updateNodeBounds");
1558
- function Z(e, t, a, n) {
1559
- return e.insert("polygon", ":first-child").attr(
1560
- "points",
1561
- n.map(function(i) {
1562
- return i.x + "," + i.y;
1563
- }).join(" ")
1564
- ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
1565
- }
1566
- g(Z, "insertPolygonShape");
1567
- var wr = /* @__PURE__ */ g(async (e, t) => {
1568
- t.useHtmlLabels || B().flowchart.htmlLabels || (t.centerLabel = !0);
1569
- const { shapeSvg: a, bbox: n, halfPadding: i } = await R(
1570
- e,
1571
- t,
1572
- "node " + t.classes,
1573
- !0
1574
- );
1575
- L.info("Classes = ", t.classes);
1576
- const r = a.insert("rect", ":first-child");
1577
- 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), $(t, r), t.intersect = function(s) {
1578
- return T.rect(t, s);
1579
- }, a;
1580
- }, "note"), Lr = wr, Rt = /* @__PURE__ */ g((e) => e ? " " + e : "", "formatClass"), K = /* @__PURE__ */ g((e, t) => `${t || "node default"}${Rt(e.classes)} ${Rt(
1581
- e.class
1582
- )}`, "getClassesFromNode"), Mt = /* @__PURE__ */ g(async (e, t) => {
1583
- const { shapeSvg: a, bbox: n } = await R(
1584
- e,
1585
- t,
1586
- K(t, void 0),
1587
- !0
1588
- ), i = n.width + t.padding, r = n.height + t.padding, s = i + r, l = [
1589
- { x: s / 2, y: 0 },
1590
- { x: s, y: -s / 2 },
1591
- { x: s / 2, y: -s },
1592
- { x: 0, y: -s / 2 }
1593
- ];
1594
- L.info("Question main (Circle)");
1595
- const o = Z(a, s, s, l);
1596
- return o.attr("style", t.style), $(t, o), t.intersect = function(y) {
1597
- return L.warn("Intersect called"), T.polygon(t, l, y);
1598
- }, a;
1599
- }, "question"), Sr = /* @__PURE__ */ g((e, t) => {
1600
- const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = 28, i = [
1601
- { x: 0, y: n / 2 },
1602
- { x: n / 2, y: 0 },
1603
- { x: 0, y: -28 / 2 },
1604
- { x: -28 / 2, y: 0 }
1605
- ];
1606
- return a.insert("polygon", ":first-child").attr(
1607
- "points",
1608
- i.map(function(r) {
1609
- return r.x + "," + r.y;
1610
- }).join(" ")
1611
- ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
1612
- return T.circle(t, 14, r);
1613
- }, a;
1614
- }, "choice"), kr = /* @__PURE__ */ g(async (e, t) => {
1615
- const { shapeSvg: a, bbox: n } = await R(
1616
- e,
1617
- t,
1618
- K(t, void 0),
1619
- !0
1620
- ), i = 4, r = n.height + t.padding, s = r / i, l = n.width + 2 * s + t.padding, o = [
1621
- { x: s, y: 0 },
1622
- { x: l - s, y: 0 },
1623
- { x: l, y: -r / 2 },
1624
- { x: l - s, y: -r },
1625
- { x: s, y: -r },
1626
- { x: 0, y: -r / 2 }
1627
- ], y = Z(a, l, r, o);
1628
- return y.attr("style", t.style), $(t, y), t.intersect = function(u) {
1629
- return T.polygon(t, o, u);
1630
- }, a;
1631
- }, "hexagon"), _r = /* @__PURE__ */ g(async (e, t) => {
1632
- const { shapeSvg: a, bbox: n } = await R(e, t, void 0, !0), i = 2, r = n.height + 2 * t.padding, s = r / i, l = n.width + 2 * s + t.padding, o = ur(t.directions, n, t), y = Z(a, l, r, o);
1633
- return y.attr("style", t.style), $(t, y), t.intersect = function(u) {
1634
- return T.polygon(t, o, u);
1635
- }, a;
1636
- }, "block_arrow"), vr = /* @__PURE__ */ g(async (e, t) => {
1637
- const { shapeSvg: a, bbox: n } = await R(
1638
- e,
1639
- t,
1640
- K(t, void 0),
1641
- !0
1642
- ), i = n.width + t.padding, r = n.height + t.padding, s = [
1643
- { x: -r / 2, y: 0 },
1644
- { x: i, y: 0 },
1645
- { x: i, y: -r },
1646
- { x: -r / 2, y: -r },
1647
- { x: 0, y: -r / 2 }
1648
- ];
1649
- return Z(a, i, r, s).attr("style", t.style), t.width = i + r, t.height = r, t.intersect = function(l) {
1650
- return T.polygon(t, s, l);
1651
- }, a;
1652
- }, "rect_left_inv_arrow"), Er = /* @__PURE__ */ g(async (e, t) => {
1653
- const { shapeSvg: a, bbox: n } = await R(e, t, K(t), !0), i = n.width + t.padding, r = n.height + t.padding, s = [
1654
- { x: -2 * r / 6, y: 0 },
1655
- { x: i - r / 6, y: 0 },
1656
- { x: i + 2 * r / 6, y: -r },
1657
- { x: r / 6, y: -r }
1658
- ], l = Z(a, i, r, s);
1659
- return l.attr("style", t.style), $(t, l), t.intersect = function(o) {
1660
- return T.polygon(t, s, o);
1661
- }, a;
1662
- }, "lean_right"), Dr = /* @__PURE__ */ g(async (e, t) => {
1663
- const { shapeSvg: a, bbox: n } = await R(
1664
- e,
1665
- t,
1666
- K(t, void 0),
1667
- !0
1668
- ), i = n.width + t.padding, r = n.height + t.padding, s = [
1669
- { x: 2 * r / 6, y: 0 },
1670
- { x: i + r / 6, y: 0 },
1671
- { x: i - 2 * r / 6, y: -r },
1672
- { x: -r / 6, y: -r }
1673
- ], l = Z(a, i, r, s);
1674
- return l.attr("style", t.style), $(t, l), t.intersect = function(o) {
1675
- return T.polygon(t, s, o);
1676
- }, a;
1677
- }, "lean_left"), Nr = /* @__PURE__ */ g(async (e, t) => {
1678
- const { shapeSvg: a, bbox: n } = await R(
1679
- e,
1680
- t,
1681
- K(t, void 0),
1682
- !0
1683
- ), i = n.width + t.padding, r = n.height + t.padding, s = [
1684
- { x: -2 * r / 6, y: 0 },
1685
- { x: i + 2 * r / 6, y: 0 },
1686
- { x: i - r / 6, y: -r },
1687
- { x: r / 6, y: -r }
1688
- ], l = Z(a, i, r, s);
1689
- return l.attr("style", t.style), $(t, l), t.intersect = function(o) {
1690
- return T.polygon(t, s, o);
1691
- }, a;
1692
- }, "trapezoid"), Tr = /* @__PURE__ */ g(async (e, t) => {
1693
- const { shapeSvg: a, bbox: n } = await R(
1694
- e,
1695
- t,
1696
- K(t, void 0),
1697
- !0
1698
- ), i = n.width + t.padding, r = n.height + t.padding, s = [
1699
- { x: r / 6, y: 0 },
1700
- { x: i - r / 6, y: 0 },
1701
- { x: i + 2 * r / 6, y: -r },
1702
- { x: -2 * r / 6, y: -r }
1703
- ], l = Z(a, i, r, s);
1704
- return l.attr("style", t.style), $(t, l), t.intersect = function(o) {
1705
- return T.polygon(t, s, o);
1706
- }, a;
1707
- }, "inv_trapezoid"), $r = /* @__PURE__ */ g(async (e, t) => {
1708
- const { shapeSvg: a, bbox: n } = await R(
1709
- e,
1710
- t,
1711
- K(t, void 0),
1712
- !0
1713
- ), i = n.width + t.padding, r = n.height + t.padding, s = [
1714
- { x: 0, y: 0 },
1715
- { x: i + r / 2, y: 0 },
1716
- { x: i, y: -r / 2 },
1717
- { x: i + r / 2, y: -r },
1718
- { x: 0, y: -r }
1719
- ], l = Z(a, i, r, s);
1720
- return l.attr("style", t.style), $(t, l), t.intersect = function(o) {
1721
- return T.polygon(t, s, o);
1722
- }, a;
1723
- }, "rect_right_inv_arrow"), Cr = /* @__PURE__ */ g(async (e, t) => {
1724
- const { shapeSvg: a, bbox: n } = await R(
1725
- e,
1726
- t,
1727
- K(t, void 0),
1728
- !0
1729
- ), 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, y = 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) + ")");
1730
- return $(t, y), t.intersect = function(u) {
1731
- const b = T.rect(t, u), x = b.x - t.x;
1732
- if (r != 0 && (Math.abs(x) < t.width / 2 || Math.abs(x) == t.width / 2 && Math.abs(b.y - t.y) > t.height / 2 - s)) {
1733
- let S = s * s * (1 - x * x / (r * r));
1734
- S != 0 && (S = Math.sqrt(S)), S = s - S, u.y - t.y > 0 && (S = -S), b.y += S;
1735
- }
1736
- return b;
1737
- }, a;
1738
- }, "cylinder"), Ir = /* @__PURE__ */ g(async (e, t) => {
1739
- const { shapeSvg: a, bbox: n, halfPadding: i } = await R(
1740
- e,
1741
- t,
1742
- "node " + t.classes + " " + t.class,
1743
- !0
1744
- ), 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, y = t.positioned ? -l / 2 : -n.height / 2 - i;
1745
- if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", y).attr("width", s).attr("height", l), t.props) {
1746
- const u = new Set(Object.keys(t.props));
1747
- t.props.borders && (ct(r, t.props.borders, s, l), u.delete("borders")), u.forEach((b) => {
1748
- L.warn(`Unknown node property ${b}`);
1749
- });
1750
- }
1751
- return $(t, r), t.intersect = function(u) {
1752
- return T.rect(t, u);
1753
- }, a;
1754
- }, "rect"), Or = /* @__PURE__ */ g(async (e, t) => {
1755
- const { shapeSvg: a, bbox: n, halfPadding: i } = await R(
1756
- e,
1757
- t,
1758
- "node " + t.classes,
1759
- !0
1760
- ), 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, y = t.positioned ? -l / 2 : -n.height / 2 - i;
1761
- 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", y).attr("width", s).attr("height", l), t.props) {
1762
- const u = new Set(Object.keys(t.props));
1763
- t.props.borders && (ct(r, t.props.borders, s, l), u.delete("borders")), u.forEach((b) => {
1764
- L.warn(`Unknown node property ${b}`);
1765
- });
1766
- }
1767
- return $(t, r), t.intersect = function(u) {
1768
- return T.rect(t, u);
1769
- }, a;
1770
- }, "composite"), Br = /* @__PURE__ */ g(async (e, t) => {
1771
- const { shapeSvg: a } = await R(e, t, "label", !0);
1772
- L.trace("Classes = ", t.class);
1773
- const n = a.insert("rect", ":first-child"), i = 0, r = 0;
1774
- if (n.attr("width", i).attr("height", r), a.attr("class", "label edgeLabel"), t.props) {
1775
- const s = new Set(Object.keys(t.props));
1776
- t.props.borders && (ct(n, t.props.borders, i, r), s.delete("borders")), s.forEach((l) => {
1777
- L.warn(`Unknown node property ${l}`);
1778
- });
1779
- }
1780
- return $(t, n), t.intersect = function(s) {
1781
- return T.rect(t, s);
1782
- }, a;
1783
- }, "labelRect");
1784
- function ct(e, t, a, n) {
1785
- const i = [], r = /* @__PURE__ */ g((l) => {
1786
- i.push(l, 0);
1787
- }, "addBorder"), s = /* @__PURE__ */ g((l) => {
1788
- i.push(0, l);
1789
- }, "skipBorder");
1790
- t.includes("t") ? (L.debug("add top border"), r(a)) : s(a), t.includes("r") ? (L.debug("add right border"), r(n)) : s(n), t.includes("b") ? (L.debug("add bottom border"), r(a)) : s(a), t.includes("l") ? (L.debug("add left border"), r(n)) : s(n), e.attr("stroke-dasharray", i.join(" "));
1791
- }
1792
- g(ct, "applyNodePropertyBorders");
1793
- var zr = /* @__PURE__ */ g((e, t) => {
1794
- let a;
1795
- t.classes ? a = "node " + t.classes : a = "node default";
1796
- const 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;
1797
- let o = "";
1798
- typeof l == "object" ? o = l[0] : o = l, L.info("Label text abc79", o, l, typeof l == "object");
1799
- const y = s.node().appendChild(j(o, t.labelStyle, !0, !0));
1800
- let u = { width: 0, height: 0 };
1801
- if (G(B().flowchart.htmlLabels)) {
1802
- const v = y.children[0], k = O(y);
1803
- u = v.getBoundingClientRect(), k.attr("width", u.width), k.attr("height", u.height);
1804
- }
1805
- L.info("Text 2", l);
1806
- const b = l.slice(1, l.length);
1807
- let x = y.getBBox();
1808
- const S = s.node().appendChild(
1809
- j(b.join ? b.join("<br/>") : b, t.labelStyle, !0, !0)
1810
- );
1811
- if (G(B().flowchart.htmlLabels)) {
1812
- const v = S.children[0], k = O(S);
1813
- u = v.getBoundingClientRect(), k.attr("width", u.width), k.attr("height", u.height);
1814
- }
1815
- const w = t.padding / 2;
1816
- return O(S).attr(
1817
- "transform",
1818
- "translate( " + // (titleBox.width - bbox.width) / 2 +
1819
- (u.width > x.width ? 0 : (x.width - u.width) / 2) + ", " + (x.height + w + 5) + ")"
1820
- ), O(y).attr(
1821
- "transform",
1822
- "translate( " + // (titleBox.width - bbox.width) / 2 +
1823
- (u.width < x.width ? 0 : -(x.width - u.width) / 2) + ", 0)"
1824
- ), u = s.node().getBBox(), s.attr(
1825
- "transform",
1826
- "translate(" + -u.width / 2 + ", " + (-u.height / 2 - w + 3) + ")"
1827
- ), i.attr("class", "outer title-state").attr("x", -u.width / 2 - w).attr("y", -u.height / 2 - w).attr("width", u.width + t.padding).attr("height", u.height + t.padding), r.attr("class", "divider").attr("x1", -u.width / 2 - w).attr("x2", u.width / 2 + w).attr("y1", -u.height / 2 - w + x.height + w).attr("y2", -u.height / 2 - w + x.height + w), $(t, i), t.intersect = function(v) {
1828
- return T.rect(t, v);
1829
- }, n;
1830
- }, "rectWithTitle"), Ar = /* @__PURE__ */ g(async (e, t) => {
1831
- const { shapeSvg: a, bbox: n } = await R(
1832
- e,
1833
- t,
1834
- K(t, void 0),
1835
- !0
1836
- ), i = n.height + t.padding, r = n.width + i / 4 + t.padding, s = 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);
1837
- return $(t, s), t.intersect = function(l) {
1838
- return T.rect(t, l);
1839
- }, a;
1840
- }, "stadium"), Rr = /* @__PURE__ */ g(async (e, t) => {
1841
- const { shapeSvg: a, bbox: n, halfPadding: i } = await R(
1842
- e,
1843
- t,
1844
- K(t, void 0),
1845
- !0
1846
- ), r = a.insert("circle", ":first-child");
1847
- 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), L.info("Circle main"), $(t, r), t.intersect = function(s) {
1848
- return L.info("Circle intersect", t, n.width / 2 + i, s), T.circle(t, n.width / 2 + i, s);
1849
- }, a;
1850
- }, "circle"), Mr = /* @__PURE__ */ g(async (e, t) => {
1851
- const { shapeSvg: a, bbox: n, halfPadding: i } = await R(
1852
- e,
1853
- t,
1854
- K(t, void 0),
1855
- !0
1856
- ), r = 5, s = a.insert("g", ":first-child"), l = s.insert("circle"), o = s.insert("circle");
1857
- return s.attr("class", t.class), l.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", n.width / 2 + i + r).attr("width", n.width + t.padding + r * 2).attr("height", n.height + t.padding + r * 2), o.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), L.info("DoubleCircle main"), $(t, l), t.intersect = function(y) {
1858
- return L.info("DoubleCircle intersect", t, n.width / 2 + i + r, y), T.circle(t, n.width / 2 + i + r, y);
1859
- }, a;
1860
- }, "doublecircle"), Pr = /* @__PURE__ */ g(async (e, t) => {
1861
- const { shapeSvg: a, bbox: n } = await R(
1862
- e,
1863
- t,
1864
- K(t, void 0),
1865
- !0
1866
- ), i = n.width + t.padding, r = n.height + t.padding, s = [
1867
- { x: 0, y: 0 },
1868
- { x: i, y: 0 },
1869
- { x: i, y: -r },
1870
- { x: 0, y: -r },
1871
- { x: 0, y: 0 },
1872
- { x: -8, y: 0 },
1873
- { x: i + 8, y: 0 },
1874
- { x: i + 8, y: -r },
1875
- { x: -8, y: -r },
1876
- { x: -8, y: 0 }
1877
- ], l = Z(a, i, r, s);
1878
- return l.attr("style", t.style), $(t, l), t.intersect = function(o) {
1879
- return T.polygon(t, s, o);
1880
- }, a;
1881
- }, "subroutine"), Wr = /* @__PURE__ */ g((e, t) => {
1882
- const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), n = a.insert("circle", ":first-child");
1883
- return n.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), $(t, n), t.intersect = function(i) {
1884
- return T.circle(t, 7, i);
1885
- }, a;
1886
- }, "start"), Pt = /* @__PURE__ */ g((e, t, a) => {
1887
- const n = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
1888
- let i = 70, r = 10;
1889
- a === "LR" && (i = 10, r = 70);
1890
- const s = n.append("rect").attr("x", -1 * i / 2).attr("y", -1 * r / 2).attr("width", i).attr("height", r).attr("class", "fork-join");
1891
- return $(t, s), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(l) {
1892
- return T.rect(t, l);
1893
- }, n;
1894
- }, "forkJoin"), Xr = /* @__PURE__ */ g((e, t) => {
1895
- const 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");
1896
- 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), $(t, i), t.intersect = function(r) {
1897
- return T.circle(t, 7, r);
1898
- }, a;
1899
- }, "end"), Fr = /* @__PURE__ */ g((e, t) => {
1900
- var a;
1901
- const n = t.padding / 2, i = 4, r = 8;
1902
- let s;
1903
- t.classes ? s = "node " + t.classes : s = "node default";
1904
- const l = e.insert("g").attr("class", s).attr("id", t.domId || t.id), o = l.insert("rect", ":first-child"), y = l.insert("line"), u = l.insert("line");
1905
- let b = 0, x = i;
1906
- const S = l.insert("g").attr("class", "label");
1907
- let w = 0;
1908
- const v = (a = t.classData.annotations) == null ? void 0 : a[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", N = S.node().appendChild(j(k, t.labelStyle, !0, !0));
1909
- let _ = N.getBBox();
1910
- if (G(B().flowchart.htmlLabels)) {
1911
- const m = N.children[0], h = O(N);
1912
- _ = m.getBoundingClientRect(), h.attr("width", _.width), h.attr("height", _.height);
1913
- }
1914
- t.classData.annotations[0] && (x += _.height + i, b += _.width);
1915
- let D = t.classData.label;
1916
- t.classData.type !== void 0 && t.classData.type !== "" && (B().flowchart.htmlLabels ? D += "&lt;" + t.classData.type + "&gt;" : D += "<" + t.classData.type + ">");
1917
- const c = S.node().appendChild(j(D, t.labelStyle, !0, !0));
1918
- O(c).attr("class", "classTitle");
1919
- let p = c.getBBox();
1920
- if (G(B().flowchart.htmlLabels)) {
1921
- const m = c.children[0], h = O(c);
1922
- p = m.getBoundingClientRect(), h.attr("width", p.width), h.attr("height", p.height);
1923
- }
1924
- x += p.height + i, p.width > b && (b = p.width);
1925
- const f = [];
1926
- t.classData.members.forEach((m) => {
1927
- const h = m.getDisplayDetails();
1928
- let I = h.displayText;
1929
- B().flowchart.htmlLabels && (I = I.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1930
- const M = S.node().appendChild(
1931
- j(
1932
- I,
1933
- h.cssStyle ? h.cssStyle : t.labelStyle,
1934
- !0,
1935
- !0
1936
- )
1937
- );
1938
- let z = M.getBBox();
1939
- if (G(B().flowchart.htmlLabels)) {
1940
- const X = M.children[0], F = O(M);
1941
- z = X.getBoundingClientRect(), F.attr("width", z.width), F.attr("height", z.height);
1942
- }
1943
- z.width > b && (b = z.width), x += z.height + i, f.push(M);
1944
- }), x += r;
1945
- const E = [];
1946
- if (t.classData.methods.forEach((m) => {
1947
- const h = m.getDisplayDetails();
1948
- let I = h.displayText;
1949
- B().flowchart.htmlLabels && (I = I.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1950
- const M = S.node().appendChild(
1951
- j(
1952
- I,
1953
- h.cssStyle ? h.cssStyle : t.labelStyle,
1954
- !0,
1955
- !0
1956
- )
1957
- );
1958
- let z = M.getBBox();
1959
- if (G(B().flowchart.htmlLabels)) {
1960
- const X = M.children[0], F = O(M);
1961
- z = X.getBoundingClientRect(), F.attr("width", z.width), F.attr("height", z.height);
1962
- }
1963
- z.width > b && (b = z.width), x += z.height + i, E.push(M);
1964
- }), x += r, v) {
1965
- let m = (b - _.width) / 2;
1966
- O(N).attr(
1967
- "transform",
1968
- "translate( " + (-1 * b / 2 + m) + ", " + -1 * x / 2 + ")"
1969
- ), w = _.height + i;
1970
- }
1971
- let d = (b - p.width) / 2;
1972
- return O(c).attr(
1973
- "transform",
1974
- "translate( " + (-1 * b / 2 + d) + ", " + (-1 * x / 2 + w) + ")"
1975
- ), w += p.height + i, y.attr("class", "divider").attr("x1", -b / 2 - n).attr("x2", b / 2 + n).attr("y1", -x / 2 - n + r + w).attr("y2", -x / 2 - n + r + w), w += r, f.forEach((m) => {
1976
- O(m).attr(
1977
- "transform",
1978
- "translate( " + -b / 2 + ", " + (-1 * x / 2 + w + r / 2) + ")"
1979
- );
1980
- const h = m == null ? void 0 : m.getBBox();
1981
- w += ((h == null ? void 0 : h.height) ?? 0) + i;
1982
- }), w += r, u.attr("class", "divider").attr("x1", -b / 2 - n).attr("x2", b / 2 + n).attr("y1", -x / 2 - n + r + w).attr("y2", -x / 2 - n + r + w), w += r, E.forEach((m) => {
1983
- O(m).attr(
1984
- "transform",
1985
- "translate( " + -b / 2 + ", " + (-1 * x / 2 + w) + ")"
1986
- );
1987
- const h = m == null ? void 0 : m.getBBox();
1988
- w += ((h == null ? void 0 : h.height) ?? 0) + i;
1989
- }), o.attr("style", t.style).attr("class", "outer title-state").attr("x", -b / 2 - n).attr("y", -(x / 2) - n).attr("width", b + t.padding).attr("height", x + t.padding), $(t, o), t.intersect = function(m) {
1990
- return T.rect(t, m);
1991
- }, l;
1992
- }, "class_box"), Wt = {
1993
- rhombus: Mt,
1994
- composite: Or,
1995
- question: Mt,
1996
- rect: Ir,
1997
- labelRect: Br,
1998
- rectWithTitle: zr,
1999
- choice: Sr,
2000
- circle: Rr,
2001
- doublecircle: Mr,
2002
- stadium: Ar,
2003
- hexagon: kr,
2004
- block_arrow: _r,
2005
- rect_left_inv_arrow: vr,
2006
- lean_right: Er,
2007
- lean_left: Dr,
2008
- trapezoid: Nr,
2009
- inv_trapezoid: Tr,
2010
- rect_right_inv_arrow: $r,
2011
- cylinder: Cr,
2012
- start: Wr,
2013
- end: Xr,
2014
- note: Lr,
2015
- subroutine: Pr,
2016
- fork: Pt,
2017
- join: Pt,
2018
- class_box: Fr
2019
- }, lt = {}, re = /* @__PURE__ */ g(async (e, t, a) => {
2020
- let n, i;
2021
- if (t.link) {
2022
- let r;
2023
- B().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 Wt[t.shape](n, t, a);
2024
- } else
2025
- i = await Wt[t.shape](e, t, a), n = i;
2026
- return t.tooltip && i.attr("title", t.tooltip), t.class && i.attr("class", "node default " + t.class), lt[t.id] = n, t.haveCallback && lt[t.id].attr("class", lt[t.id].attr("class") + " clickable"), n;
2027
- }, "insertNode"), Yr = /* @__PURE__ */ g((e) => {
2028
- const t = lt[e.id];
2029
- L.trace(
2030
- "Transforming node",
2031
- e.diff,
2032
- e,
2033
- "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2034
- );
2035
- const a = 8, n = e.diff || 0;
2036
- return e.clusterNode ? t.attr(
2037
- "transform",
2038
- "translate(" + (e.x + n - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
2039
- ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), n;
2040
- }, "positionNode");
2041
- function Et(e, t, a = !1) {
2042
- var n, i, r;
2043
- const s = e;
2044
- let l = "default";
2045
- (((n = s == null ? void 0 : s.classes) == null ? void 0 : n.length) || 0) > 0 && (l = ((s == null ? void 0 : s.classes) ?? []).join(" ")), l = l + " flowchart-label";
2046
- let o = 0, y = "", u;
2047
- switch (s.type) {
2048
- case "round":
2049
- o = 5, y = "rect";
2050
- break;
2051
- case "composite":
2052
- o = 0, y = "composite", u = 0;
2053
- break;
2054
- case "square":
2055
- y = "rect";
2056
- break;
2057
- case "diamond":
2058
- y = "question";
2059
- break;
2060
- case "hexagon":
2061
- y = "hexagon";
2062
- break;
2063
- case "block_arrow":
2064
- y = "block_arrow";
2065
- break;
2066
- case "odd":
2067
- y = "rect_left_inv_arrow";
2068
- break;
2069
- case "lean_right":
2070
- y = "lean_right";
2071
- break;
2072
- case "lean_left":
2073
- y = "lean_left";
2074
- break;
2075
- case "trapezoid":
2076
- y = "trapezoid";
2077
- break;
2078
- case "inv_trapezoid":
2079
- y = "inv_trapezoid";
2080
- break;
2081
- case "rect_left_inv_arrow":
2082
- y = "rect_left_inv_arrow";
2083
- break;
2084
- case "circle":
2085
- y = "circle";
2086
- break;
2087
- case "ellipse":
2088
- y = "ellipse";
2089
- break;
2090
- case "stadium":
2091
- y = "stadium";
2092
- break;
2093
- case "subroutine":
2094
- y = "subroutine";
2095
- break;
2096
- case "cylinder":
2097
- y = "cylinder";
2098
- break;
2099
- case "group":
2100
- y = "rect";
2101
- break;
2102
- case "doublecircle":
2103
- y = "doublecircle";
2104
- break;
2105
- default:
2106
- y = "rect";
2107
- }
2108
- const b = me((s == null ? void 0 : s.styles) ?? []), x = s.label, S = s.size ?? { width: 0, height: 0, x: 0, y: 0 };
2109
- return {
2110
- labelStyle: b.labelStyle,
2111
- shape: y,
2112
- labelText: x,
2113
- rx: o,
2114
- ry: o,
2115
- class: l,
2116
- style: b.style,
2117
- id: s.id,
2118
- directions: s.directions,
2119
- width: S.width,
2120
- height: S.height,
2121
- x: S.x,
2122
- y: S.y,
2123
- positioned: a,
2124
- intersect: void 0,
2125
- type: s.type,
2126
- padding: u ?? ((r = (i = at()) == null ? void 0 : i.block) == null ? void 0 : r.padding) ?? 0
2127
- };
2128
- }
2129
- g(Et, "getNodeFromBlock");
2130
- async function ae(e, t, a) {
2131
- const n = Et(t, a, !1);
2132
- if (n.type === "group")
2133
- return;
2134
- const i = at(), r = await re(e, n, { config: i }), s = r.node().getBBox(), l = a.getBlock(n.id);
2135
- l.size = { width: s.width, height: s.height, x: 0, y: 0, node: r }, a.setBlock(l), r.remove();
2136
- }
2137
- g(ae, "calculateBlockSize");
2138
- async function se(e, t, a) {
2139
- const n = Et(t, a, !0);
2140
- if (a.getBlock(n.id).type !== "space") {
2141
- const i = at();
2142
- await re(e, n, { config: i }), t.intersect = n == null ? void 0 : n.intersect, Yr(n);
2143
- }
2144
- }
2145
- g(se, "insertBlockPositioned");
2146
- async function ht(e, t, a, n) {
2147
- for (const i of t)
2148
- await n(e, i, a), i.children && await ht(e, i.children, a, n);
2149
- }
2150
- g(ht, "performOperations");
2151
- async function ie(e, t, a) {
2152
- await ht(e, t, a, ae);
2153
- }
2154
- g(ie, "calculateBlockSizes");
2155
- async function ne(e, t, a) {
2156
- await ht(e, t, a, se);
2157
- }
2158
- g(ne, "insertBlocks");
2159
- async function le(e, t, a, n, i) {
2160
- const r = new Le({
2161
- multigraph: !0,
2162
- compound: !0
2163
- });
2164
- r.setGraph({
2165
- rankdir: "TB",
2166
- nodesep: 10,
2167
- ranksep: 10,
2168
- marginx: 8,
2169
- marginy: 8
2170
- });
2171
- for (const s of a)
2172
- s.size && r.setNode(s.id, {
2173
- width: s.size.width,
2174
- height: s.size.height,
2175
- intersect: s.intersect
2176
- });
2177
- for (const s of t)
2178
- if (s.start && s.end) {
2179
- const l = n.getBlock(s.start), o = n.getBlock(s.end);
2180
- if (l != null && l.size && o != null && o.size) {
2181
- const y = l.size, u = o.size, b = [
2182
- { x: y.x, y: y.y },
2183
- { x: y.x + (u.x - y.x) / 2, y: y.y + (u.y - y.y) / 2 },
2184
- { x: u.x, y: u.y }
2185
- ];
2186
- hr(
2187
- e,
2188
- { v: s.start, w: s.end, name: s.id },
2189
- {
2190
- ...s,
2191
- arrowTypeEnd: s.arrowTypeEnd,
2192
- arrowTypeStart: s.arrowTypeStart,
2193
- points: b,
2194
- classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2195
- },
2196
- void 0,
2197
- "block",
2198
- r,
2199
- i
2200
- ), s.label && (await lr(e, {
2201
- ...s,
2202
- label: s.label,
2203
- labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2204
- arrowTypeEnd: s.arrowTypeEnd,
2205
- arrowTypeStart: s.arrowTypeStart,
2206
- points: b,
2207
- classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2208
- }), or(
2209
- { ...s, x: b[1].x, y: b[1].y },
2210
- {
2211
- originalPath: b
2212
- }
2213
- ));
2214
- }
2215
- }
2216
- }
2217
- g(le, "insertEdges");
2218
- var Kr = /* @__PURE__ */ g(function(e, t) {
2219
- return t.db.getClasses();
2220
- }, "getClasses"), Hr = /* @__PURE__ */ g(async function(e, t, a, n) {
2221
- const { securityLevel: i, block: r } = at(), s = n.db;
2222
- let l;
2223
- i === "sandbox" && (l = O("#i" + t));
2224
- const o = i === "sandbox" ? O(l.nodes()[0].contentDocument.body) : O("body"), y = i === "sandbox" ? o.select(`[id="${t}"]`) : O(`[id="${t}"]`);
2225
- rr(y, ["point", "circle", "cross"], n.type, t);
2226
- const u = s.getBlocks(), b = s.getBlocksFlat(), x = s.getEdges(), S = y.insert("g").attr("class", "block");
2227
- await ie(S, u, s);
2228
- const w = Zt(s);
2229
- if (await ne(S, u, s), await le(S, x, b, s, t), w) {
2230
- const v = w, k = Math.max(1, Math.round(0.125 * (v.width / v.height))), N = v.height + k + 10, _ = v.width + 10, { useMaxWidth: D } = r;
2231
- ce(y, N, _, !!D), L.debug("Here Bounds", w, v), y.attr(
2232
- "viewBox",
2233
- `${v.x - 5} ${v.y - 5} ${v.width + 10} ${v.height + 10}`
2234
- );
2235
- }
2236
- }, "draw"), jr = {
2237
- draw: Hr,
2238
- getClasses: Kr
2239
- }, Vr = {
2240
- parser: ke,
2241
- db: Fe,
2242
- renderer: jr,
2243
- styles: Ke
2244
- };
2245
- export {
2246
- Vr as diagram
2247
- };