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