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