@kong-ui-public/documentation 1.5.10 → 1.5.11

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