@schmitech/chatbot-widget 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tableau10-D7jGxypv-BNlEL2G_.js +9 -0
- package/dist/arc-D-ZI5fuh-CvDHBzlN.js +84 -0
- package/dist/blockDiagram-c4efeb88-DUnNxfIR-Bhh-x1q6.js +1221 -0
- package/dist/c4Diagram-c83219d4-cC4OxfBG-DRTO_jy5.js +1580 -0
- package/dist/channel-hcYozyrT-BSOc2Hp-.js +6 -0
- package/dist/chatbot-widget.bundle.js +3881 -1586
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +12 -63652
- package/dist/chatbot-widget.umd.js +3880 -1585
- package/dist/classDiagram-beda092f-BLYhf5Mr-vk4Ko58U.js +218 -0
- package/dist/classDiagram-v2-2358418a-VBkbF8mr-Ca0l1fEs.js +201 -0
- package/dist/clone-BZIkCMuw-B9owNq6E.js +9 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/createText-1719965b-UejsQ47k-B1DYw0WW.js +2955 -0
- package/dist/edges-96097737-1M5QvjOd-BpQVVoQN.js +1088 -0
- package/dist/erDiagram-0228fc6a-CjBNxHoC-DXDVlH55.js +929 -0
- package/dist/flowDb-c6c81e3f-Q2aoOxdz-DfrfI3H1.js +1127 -0
- package/dist/flowDiagram-50d868cf-zizL6ppE-BAH-_juu.js +788 -0
- package/dist/flowDiagram-v2-4f6560a1-DVx_vlO5-bkcRE0UW.js +18 -0
- package/dist/flowchart-elk-definition-6af322e1-Eyez36go-B_lk3oHt.js +48132 -0
- package/dist/ganttDiagram-a2739b55-C82Jv-TO-DoS-s1Yu.js +1743 -0
- package/dist/gitGraphDiagram-82fe8481-D9o_9-U8-DJF-ZeR8.js +1265 -0
- package/dist/graph-BjmGDpTe-DgbYS1Ie.js +848 -0
- package/dist/index-5325376f-CJL5w-Sw-BXp44Ej5.js +374 -0
- package/dist/index-s6Yb6o1D.js +116386 -0
- package/dist/infoDiagram-8eee0895-FpS-TLK_-BnvO_wUe.js +320 -0
- package/dist/journeyDiagram-c64418c1-CMj1efQ9-CshcRDhm.js +802 -0
- package/dist/layout-D_6hdlf3-B7guhEBN.js +1470 -0
- package/dist/mindmap-definition-8da855dc-D4SxHjUd-jFZFomnk.js +21924 -0
- package/dist/pieDiagram-a8764435-BF5ZqOjB-Mqzg2J4Q.js +498 -0
- package/dist/quadrantDiagram-1e28029f-GtQb80VU-DCy1QjzW.js +903 -0
- package/dist/requirementDiagram-08caed73-CHtPj3FO-AHEP0cIt.js +767 -0
- package/dist/sankeyDiagram-a04cb91d-CBlXzOgd-CWJTc5AX.js +802 -0
- package/dist/sequenceDiagram-c5b8d532-Cs1iyw97-oayOJE8v.js +2235 -0
- package/dist/shared/styles.d.ts +1 -1
- package/dist/stateDiagram-1ecb1508-CpRKICMQ-C5OFJeRZ.js +266 -0
- package/dist/stateDiagram-v2-c2b004d7-BtkhFyQ5-DxzE8Je5.js +185 -0
- package/dist/styles-b4e223ce-D0oeHeKH-BmNvk4NR.js +1090 -0
- package/dist/styles-ca3715f6-BouNgl-L-_qXsPDP3.js +961 -0
- package/dist/styles-d45a18b0-Cvhb8Ltu-43I3Cd_I.js +437 -0
- package/dist/svgDrawCommon-b86b1483-mg-1NjZY-DrmnILcc.js +65 -0
- package/dist/timeline-definition-faaaa080-3olbep_P-BqKpgsPZ.js +793 -0
- package/dist/ui/Message.d.ts +1 -5
- package/dist/ui/MessagesList.d.ts +1 -5
- package/dist/xychartDiagram-f5964ef8-BN6HXpmW-C-g_F1w2.js +1238 -0
- package/package.json +3 -3
- package/dist/ui/TypingEffect.d.ts +0 -18
|
@@ -0,0 +1,1088 @@
|
|
|
1
|
+
import { O as f, c as lt, k as ot, g as w, f as O, P as _, i as N, q as z, bq as G } from "./index-s6Yb6o1D.js";
|
|
2
|
+
import { $ as nt } from "./createText-1719965b-UejsQ47k-B1DYw0WW.js";
|
|
3
|
+
typeof window < "u" && (window.global = window);
|
|
4
|
+
const dt = (a, t, e, s) => {
|
|
5
|
+
t.forEach((l) => {
|
|
6
|
+
bt[l](a, e, s);
|
|
7
|
+
});
|
|
8
|
+
}, ht = (a, t, e) => {
|
|
9
|
+
f.trace("Making markers for ", e), a.append("defs").append("marker").attr("id", e + "_" + 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"), a.append("defs").append("marker").attr("id", e + "_" + 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");
|
|
10
|
+
}, ct = (a, t, e) => {
|
|
11
|
+
a.append("defs").append("marker").attr("id", e + "_" + 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"), a.append("defs").append("marker").attr("id", e + "_" + 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");
|
|
12
|
+
}, yt = (a, t, e) => {
|
|
13
|
+
a.append("defs").append("marker").attr("id", e + "_" + 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"), a.append("defs").append("marker").attr("id", e + "_" + 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");
|
|
14
|
+
}, pt = (a, t, e) => {
|
|
15
|
+
a.append("defs").append("marker").attr("id", e + "_" + 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"), a.append("defs").append("marker").attr("id", e + "_" + 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");
|
|
16
|
+
}, gt = (a, t, e) => {
|
|
17
|
+
a.append("defs").append("marker").attr("id", e + "_" + 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), a.append("defs").append("marker").attr("id", e + "_" + 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);
|
|
18
|
+
}, xt = (a, t, e) => {
|
|
19
|
+
a.append("marker").attr("id", e + "_" + 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"), a.append("marker").attr("id", e + "_" + 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");
|
|
20
|
+
}, ft = (a, t, e) => {
|
|
21
|
+
a.append("marker").attr("id", e + "_" + 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"), a.append("marker").attr("id", e + "_" + 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");
|
|
22
|
+
}, ut = (a, t, e) => {
|
|
23
|
+
a.append("marker").attr("id", e + "_" + 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"), a.append("marker").attr("id", e + "_" + 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");
|
|
24
|
+
}, wt = (a, t, e) => {
|
|
25
|
+
a.append("defs").append("marker").attr("id", e + "_" + 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");
|
|
26
|
+
}, bt = {
|
|
27
|
+
extension: ht,
|
|
28
|
+
composition: ct,
|
|
29
|
+
aggregation: yt,
|
|
30
|
+
dependency: pt,
|
|
31
|
+
lollipop: gt,
|
|
32
|
+
point: xt,
|
|
33
|
+
circle: ft,
|
|
34
|
+
cross: ut,
|
|
35
|
+
barb: wt
|
|
36
|
+
}, or = dt;
|
|
37
|
+
function mt(a, t) {
|
|
38
|
+
t && a.attr("style", t);
|
|
39
|
+
}
|
|
40
|
+
function kt(a, t) {
|
|
41
|
+
const e = _(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), s = e.append("xhtml:div"), l = a.label, r = a.isNode ? "nodeLabel" : "edgeLabel";
|
|
42
|
+
return s.html(
|
|
43
|
+
z(
|
|
44
|
+
'<span class="' + r + '" ' + (a.labelStyle ? 'style="' + a.labelStyle + '"' : "") + ">" + l + "</span>",
|
|
45
|
+
t
|
|
46
|
+
)
|
|
47
|
+
), mt(s, a.labelStyle), s.style("display", "inline-block"), s.style("white-space", "nowrap"), s.attr("xmlns", "http://www.w3.org/1999/xhtml"), e.node();
|
|
48
|
+
}
|
|
49
|
+
const Lt = (a, t, e, s) => {
|
|
50
|
+
let l = a || "";
|
|
51
|
+
typeof l == "object" && (l = l[0]);
|
|
52
|
+
const r = w();
|
|
53
|
+
if (O(r.flowchart.htmlLabels)) {
|
|
54
|
+
l = l.replace(/\\n|\n/g, "<br />"), f.debug("vertexText" + l);
|
|
55
|
+
const n = {
|
|
56
|
+
isNode: s,
|
|
57
|
+
label: G(l).replace(
|
|
58
|
+
/fa[blrs]?:fa-[\w-]+/g,
|
|
59
|
+
// cspell: disable-line
|
|
60
|
+
(i) => `<i class='${i.replace(":", " ")}'></i>`
|
|
61
|
+
),
|
|
62
|
+
labelStyle: t.replace("fill:", "color:")
|
|
63
|
+
};
|
|
64
|
+
return kt(n, r);
|
|
65
|
+
} else {
|
|
66
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
67
|
+
n.setAttribute("style", t.replace("color:", "fill:"));
|
|
68
|
+
let i = [];
|
|
69
|
+
typeof l == "string" ? i = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? i = l : i = [];
|
|
70
|
+
for (const o of i) {
|
|
71
|
+
const h = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
72
|
+
h.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), h.setAttribute("dy", "1em"), h.setAttribute("x", "0"), e ? h.setAttribute("class", "title-row") : h.setAttribute("class", "row"), h.textContent = o.trim(), n.appendChild(h);
|
|
73
|
+
}
|
|
74
|
+
return n;
|
|
75
|
+
}
|
|
76
|
+
}, P = Lt, M = async (a, t, e, s) => {
|
|
77
|
+
let l;
|
|
78
|
+
const r = t.useHtmlLabels || O(w().flowchart.htmlLabels);
|
|
79
|
+
e ? l = e : l = "node default";
|
|
80
|
+
const n = a.insert("g").attr("class", l).attr("id", t.domId || t.id), i = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
|
|
81
|
+
let o;
|
|
82
|
+
t.labelText === void 0 ? o = "" : o = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
|
|
83
|
+
const h = i.node();
|
|
84
|
+
let d;
|
|
85
|
+
t.labelType === "markdown" ? d = nt(i, z(G(o), w()), {
|
|
86
|
+
useHtmlLabels: r,
|
|
87
|
+
width: t.width || w().flowchart.wrappingWidth,
|
|
88
|
+
classes: "markdown-node-label"
|
|
89
|
+
}) : d = h.appendChild(
|
|
90
|
+
P(
|
|
91
|
+
z(G(o), w()),
|
|
92
|
+
t.labelStyle,
|
|
93
|
+
!1,
|
|
94
|
+
s
|
|
95
|
+
)
|
|
96
|
+
);
|
|
97
|
+
let c = d.getBBox();
|
|
98
|
+
const p = t.padding / 2;
|
|
99
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
100
|
+
const y = d.children[0], x = _(d), k = y.getElementsByTagName("img");
|
|
101
|
+
if (k) {
|
|
102
|
+
const g = o.replace(/<img[^>]*>/g, "").trim() === "";
|
|
103
|
+
await Promise.all(
|
|
104
|
+
[...k].map(
|
|
105
|
+
(u) => new Promise((v) => {
|
|
106
|
+
function B() {
|
|
107
|
+
if (u.style.display = "flex", u.style.flexDirection = "column", g) {
|
|
108
|
+
const C = w().fontSize ? w().fontSize : window.getComputedStyle(document.body).fontSize, X = parseInt(C, 10) * 5 + "px";
|
|
109
|
+
u.style.minWidth = X, u.style.maxWidth = X;
|
|
110
|
+
} else
|
|
111
|
+
u.style.width = "100%";
|
|
112
|
+
v(u);
|
|
113
|
+
}
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
u.complete && B();
|
|
116
|
+
}), u.addEventListener("error", B), u.addEventListener("load", B);
|
|
117
|
+
})
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
c = y.getBoundingClientRect(), x.attr("width", c.width), x.attr("height", c.height);
|
|
122
|
+
}
|
|
123
|
+
return r ? i.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")") : i.attr("transform", "translate(0, " + -c.height / 2 + ")"), t.centerLabel && i.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), i.insert("rect", ":first-child"), { shapeSvg: n, bbox: c, halfPadding: p, label: i };
|
|
124
|
+
}, m = (a, t) => {
|
|
125
|
+
const e = t.node().getBBox();
|
|
126
|
+
a.width = e.width, a.height = e.height;
|
|
127
|
+
};
|
|
128
|
+
function R(a, t, e, s) {
|
|
129
|
+
return a.insert("polygon", ":first-child").attr(
|
|
130
|
+
"points",
|
|
131
|
+
s.map(function(l) {
|
|
132
|
+
return l.x + "," + l.y;
|
|
133
|
+
}).join(" ")
|
|
134
|
+
).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + e / 2 + ")");
|
|
135
|
+
}
|
|
136
|
+
function St(a, t) {
|
|
137
|
+
return a.intersect(t);
|
|
138
|
+
}
|
|
139
|
+
function st(a, t, e, s) {
|
|
140
|
+
var l = a.x, r = a.y, n = l - s.x, i = r - s.y, o = Math.sqrt(t * t * i * i + e * e * n * n), h = Math.abs(t * e * n / o);
|
|
141
|
+
s.x < l && (h = -h);
|
|
142
|
+
var d = Math.abs(t * e * i / o);
|
|
143
|
+
return s.y < r && (d = -d), { x: l + h, y: r + d };
|
|
144
|
+
}
|
|
145
|
+
function vt(a, t, e) {
|
|
146
|
+
return st(a, t, t, e);
|
|
147
|
+
}
|
|
148
|
+
function Mt(a, t, e, s) {
|
|
149
|
+
var l, r, n, i, o, h, d, c, p, y, x, k, g, u, v;
|
|
150
|
+
if (l = t.y - a.y, n = a.x - t.x, o = t.x * a.y - a.x * t.y, p = l * e.x + n * e.y + o, y = l * s.x + n * s.y + o, !(p !== 0 && y !== 0 && J(p, y)) && (r = s.y - e.y, i = e.x - s.x, h = s.x * e.y - e.x * s.y, d = r * a.x + i * a.y + h, c = r * t.x + i * t.y + h, !(d !== 0 && c !== 0 && J(d, c)) && (x = l * i - r * n, x !== 0)))
|
|
151
|
+
return k = Math.abs(x / 2), g = n * h - i * o, u = g < 0 ? (g - k) / x : (g + k) / x, g = r * o - l * h, v = g < 0 ? (g - k) / x : (g + k) / x, { x: u, y: v };
|
|
152
|
+
}
|
|
153
|
+
function J(a, t) {
|
|
154
|
+
return a * t > 0;
|
|
155
|
+
}
|
|
156
|
+
function Tt(a, t, e) {
|
|
157
|
+
var s = a.x, l = a.y, r = [], n = Number.POSITIVE_INFINITY, i = Number.POSITIVE_INFINITY;
|
|
158
|
+
typeof t.forEach == "function" ? t.forEach(function(x) {
|
|
159
|
+
n = Math.min(n, x.x), i = Math.min(i, x.y);
|
|
160
|
+
}) : (n = Math.min(n, t.x), i = Math.min(i, t.y));
|
|
161
|
+
for (var o = s - a.width / 2 - n, h = l - a.height / 2 - i, d = 0; d < t.length; d++) {
|
|
162
|
+
var c = t[d], p = t[d < t.length - 1 ? d + 1 : 0], y = Mt(
|
|
163
|
+
a,
|
|
164
|
+
e,
|
|
165
|
+
{ x: o + c.x, y: h + c.y },
|
|
166
|
+
{ x: o + p.x, y: h + p.y }
|
|
167
|
+
);
|
|
168
|
+
y && r.push(y);
|
|
169
|
+
}
|
|
170
|
+
return r.length ? (r.length > 1 && r.sort(function(x, k) {
|
|
171
|
+
var g = x.x - e.x, u = x.y - e.y, v = Math.sqrt(g * g + u * u), B = k.x - e.x, C = k.y - e.y, X = Math.sqrt(B * B + C * C);
|
|
172
|
+
return v < X ? -1 : v === X ? 0 : 1;
|
|
173
|
+
}), r[0]) : a;
|
|
174
|
+
}
|
|
175
|
+
const Bt = (a, t) => {
|
|
176
|
+
var e = a.x, s = a.y, l = t.x - e, r = t.y - s, n = a.width / 2, i = a.height / 2, o, h;
|
|
177
|
+
return Math.abs(r) * n > Math.abs(l) * i ? (r < 0 && (i = -i), o = r === 0 ? 0 : i * l / r, h = i) : (l < 0 && (n = -n), o = n, h = l === 0 ? 0 : n * r / l), { x: e + o, y: s + h };
|
|
178
|
+
}, _t = Bt, b = {
|
|
179
|
+
node: St,
|
|
180
|
+
circle: vt,
|
|
181
|
+
ellipse: st,
|
|
182
|
+
polygon: Tt,
|
|
183
|
+
rect: _t
|
|
184
|
+
}, Ct = async (a, t) => {
|
|
185
|
+
t.useHtmlLabels || w().flowchart.htmlLabels || (t.centerLabel = !0);
|
|
186
|
+
const { shapeSvg: e, bbox: s, halfPadding: l } = await M(
|
|
187
|
+
a,
|
|
188
|
+
t,
|
|
189
|
+
"node " + t.classes,
|
|
190
|
+
!0
|
|
191
|
+
);
|
|
192
|
+
f.info("Classes = ", t.classes);
|
|
193
|
+
const r = e.insert("rect", ":first-child");
|
|
194
|
+
return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -s.width / 2 - l).attr("y", -s.height / 2 - l).attr("width", s.width + t.padding).attr("height", s.height + t.padding), m(t, r), t.intersect = function(n) {
|
|
195
|
+
return b.rect(t, n);
|
|
196
|
+
}, e;
|
|
197
|
+
}, $t = Ct, Et = (a) => {
|
|
198
|
+
const t = /* @__PURE__ */ new Set();
|
|
199
|
+
for (const e of a)
|
|
200
|
+
switch (e) {
|
|
201
|
+
case "x":
|
|
202
|
+
t.add("right"), t.add("left");
|
|
203
|
+
break;
|
|
204
|
+
case "y":
|
|
205
|
+
t.add("up"), t.add("down");
|
|
206
|
+
break;
|
|
207
|
+
default:
|
|
208
|
+
t.add(e);
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
return t;
|
|
212
|
+
}, Pt = (a, t, e) => {
|
|
213
|
+
const s = Et(a), l = 2, r = t.height + 2 * e.padding, n = r / l, i = t.width + 2 * n + e.padding, o = e.padding / 2;
|
|
214
|
+
return s.has("right") && s.has("left") && s.has("up") && s.has("down") ? [
|
|
215
|
+
// Bottom
|
|
216
|
+
{ x: 0, y: 0 },
|
|
217
|
+
{ x: n, y: 0 },
|
|
218
|
+
{ x: i / 2, y: 2 * o },
|
|
219
|
+
{ x: i - n, y: 0 },
|
|
220
|
+
{ x: i, y: 0 },
|
|
221
|
+
// Right
|
|
222
|
+
{ x: i, y: -r / 3 },
|
|
223
|
+
{ x: i + 2 * o, y: -r / 2 },
|
|
224
|
+
{ x: i, y: -2 * r / 3 },
|
|
225
|
+
{ x: i, y: -r },
|
|
226
|
+
// Top
|
|
227
|
+
{ x: i - n, y: -r },
|
|
228
|
+
{ x: i / 2, y: -r - 2 * o },
|
|
229
|
+
{ x: n, y: -r },
|
|
230
|
+
// Left
|
|
231
|
+
{ x: 0, y: -r },
|
|
232
|
+
{ x: 0, y: -2 * r / 3 },
|
|
233
|
+
{ x: -2 * o, y: -r / 2 },
|
|
234
|
+
{ x: 0, y: -r / 3 }
|
|
235
|
+
] : s.has("right") && s.has("left") && s.has("up") ? [
|
|
236
|
+
{ x: n, y: 0 },
|
|
237
|
+
{ x: i - n, y: 0 },
|
|
238
|
+
{ x: i, y: -r / 2 },
|
|
239
|
+
{ x: i - n, y: -r },
|
|
240
|
+
{ x: n, y: -r },
|
|
241
|
+
{ x: 0, y: -r / 2 }
|
|
242
|
+
] : s.has("right") && s.has("left") && s.has("down") ? [
|
|
243
|
+
{ x: 0, y: 0 },
|
|
244
|
+
{ x: n, y: -r },
|
|
245
|
+
{ x: i - n, y: -r },
|
|
246
|
+
{ x: i, y: 0 }
|
|
247
|
+
] : s.has("right") && s.has("up") && s.has("down") ? [
|
|
248
|
+
{ x: 0, y: 0 },
|
|
249
|
+
{ x: i, y: -n },
|
|
250
|
+
{ x: i, y: -r + n },
|
|
251
|
+
{ x: 0, y: -r }
|
|
252
|
+
] : s.has("left") && s.has("up") && s.has("down") ? [
|
|
253
|
+
{ x: i, y: 0 },
|
|
254
|
+
{ x: 0, y: -n },
|
|
255
|
+
{ x: 0, y: -r + n },
|
|
256
|
+
{ x: i, y: -r }
|
|
257
|
+
] : s.has("right") && s.has("left") ? [
|
|
258
|
+
{ x: n, y: 0 },
|
|
259
|
+
{ x: n, y: -o },
|
|
260
|
+
{ x: i - n, y: -o },
|
|
261
|
+
{ x: i - n, y: 0 },
|
|
262
|
+
{ x: i, y: -r / 2 },
|
|
263
|
+
{ x: i - n, y: -r },
|
|
264
|
+
{ x: i - n, y: -r + o },
|
|
265
|
+
{ x: n, y: -r + o },
|
|
266
|
+
{ x: n, y: -r },
|
|
267
|
+
{ x: 0, y: -r / 2 }
|
|
268
|
+
] : s.has("up") && s.has("down") ? [
|
|
269
|
+
// Bottom center
|
|
270
|
+
{ x: i / 2, y: 0 },
|
|
271
|
+
// Left pont of bottom arrow
|
|
272
|
+
{ x: 0, y: -o },
|
|
273
|
+
{ x: n, y: -o },
|
|
274
|
+
// Left top over vertical section
|
|
275
|
+
{ x: n, y: -r + o },
|
|
276
|
+
{ x: 0, y: -r + o },
|
|
277
|
+
// Top of arrow
|
|
278
|
+
{ x: i / 2, y: -r },
|
|
279
|
+
{ x: i, y: -r + o },
|
|
280
|
+
// Top of right vertical bar
|
|
281
|
+
{ x: i - n, y: -r + o },
|
|
282
|
+
{ x: i - n, y: -o },
|
|
283
|
+
{ x: i, y: -o }
|
|
284
|
+
] : s.has("right") && s.has("up") ? [
|
|
285
|
+
{ x: 0, y: 0 },
|
|
286
|
+
{ x: i, y: -n },
|
|
287
|
+
{ x: 0, y: -r }
|
|
288
|
+
] : s.has("right") && s.has("down") ? [
|
|
289
|
+
{ x: 0, y: 0 },
|
|
290
|
+
{ x: i, y: 0 },
|
|
291
|
+
{ x: 0, y: -r }
|
|
292
|
+
] : s.has("left") && s.has("up") ? [
|
|
293
|
+
{ x: i, y: 0 },
|
|
294
|
+
{ x: 0, y: -n },
|
|
295
|
+
{ x: i, y: -r }
|
|
296
|
+
] : s.has("left") && s.has("down") ? [
|
|
297
|
+
{ x: i, y: 0 },
|
|
298
|
+
{ x: 0, y: 0 },
|
|
299
|
+
{ x: i, y: -r }
|
|
300
|
+
] : s.has("right") ? [
|
|
301
|
+
{ x: n, y: -o },
|
|
302
|
+
{ x: n, y: -o },
|
|
303
|
+
{ x: i - n, y: -o },
|
|
304
|
+
{ x: i - n, y: 0 },
|
|
305
|
+
{ x: i, y: -r / 2 },
|
|
306
|
+
{ x: i - n, y: -r },
|
|
307
|
+
{ x: i - n, y: -r + o },
|
|
308
|
+
// top left corner of arrow
|
|
309
|
+
{ x: n, y: -r + o },
|
|
310
|
+
{ x: n, y: -r + o }
|
|
311
|
+
] : s.has("left") ? [
|
|
312
|
+
{ x: n, y: 0 },
|
|
313
|
+
{ x: n, y: -o },
|
|
314
|
+
// Two points, the right corners
|
|
315
|
+
{ x: i - n, y: -o },
|
|
316
|
+
{ x: i - n, y: -r + o },
|
|
317
|
+
{ x: n, y: -r + o },
|
|
318
|
+
{ x: n, y: -r },
|
|
319
|
+
{ x: 0, y: -r / 2 }
|
|
320
|
+
] : s.has("up") ? [
|
|
321
|
+
// Bottom center
|
|
322
|
+
{ x: n, y: -o },
|
|
323
|
+
// Left top over vertical section
|
|
324
|
+
{ x: n, y: -r + o },
|
|
325
|
+
{ x: 0, y: -r + o },
|
|
326
|
+
// Top of arrow
|
|
327
|
+
{ x: i / 2, y: -r },
|
|
328
|
+
{ x: i, y: -r + o },
|
|
329
|
+
// Top of right vertical bar
|
|
330
|
+
{ x: i - n, y: -r + o },
|
|
331
|
+
{ x: i - n, y: -o }
|
|
332
|
+
] : s.has("down") ? [
|
|
333
|
+
// Bottom center
|
|
334
|
+
{ x: i / 2, y: 0 },
|
|
335
|
+
// Left pont of bottom arrow
|
|
336
|
+
{ x: 0, y: -o },
|
|
337
|
+
{ x: n, y: -o },
|
|
338
|
+
// Left top over vertical section
|
|
339
|
+
{ x: n, y: -r + o },
|
|
340
|
+
{ x: i - n, y: -r + o },
|
|
341
|
+
{ x: i - n, y: -o },
|
|
342
|
+
{ x: i, y: -o }
|
|
343
|
+
] : [{ x: 0, y: 0 }];
|
|
344
|
+
}, Q = (a) => a ? " " + a : "", E = (a, t) => `node default${Q(a.classes)} ${Q(
|
|
345
|
+
a.class
|
|
346
|
+
)}`, K = async (a, t) => {
|
|
347
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
348
|
+
a,
|
|
349
|
+
t,
|
|
350
|
+
E(t),
|
|
351
|
+
!0
|
|
352
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = l + r, i = [
|
|
353
|
+
{ x: n / 2, y: 0 },
|
|
354
|
+
{ x: n, y: -n / 2 },
|
|
355
|
+
{ x: n / 2, y: -n },
|
|
356
|
+
{ x: 0, y: -n / 2 }
|
|
357
|
+
];
|
|
358
|
+
f.info("Question main (Circle)");
|
|
359
|
+
const o = R(e, n, n, i);
|
|
360
|
+
return o.attr("style", t.style), m(t, o), t.intersect = function(h) {
|
|
361
|
+
return f.warn("Intersect called"), b.polygon(t, i, h);
|
|
362
|
+
}, e;
|
|
363
|
+
}, Ot = (a, t) => {
|
|
364
|
+
const e = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = 28, l = [
|
|
365
|
+
{ x: 0, y: s / 2 },
|
|
366
|
+
{ x: s / 2, y: 0 },
|
|
367
|
+
{ x: 0, y: -s / 2 },
|
|
368
|
+
{ x: -s / 2, y: 0 }
|
|
369
|
+
];
|
|
370
|
+
return e.insert("polygon", ":first-child").attr(
|
|
371
|
+
"points",
|
|
372
|
+
l.map(function(r) {
|
|
373
|
+
return r.x + "," + r.y;
|
|
374
|
+
}).join(" ")
|
|
375
|
+
).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
|
|
376
|
+
return b.circle(t, 14, r);
|
|
377
|
+
}, e;
|
|
378
|
+
}, Rt = async (a, t) => {
|
|
379
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
380
|
+
a,
|
|
381
|
+
t,
|
|
382
|
+
E(t),
|
|
383
|
+
!0
|
|
384
|
+
), l = 4, r = s.height + t.padding, n = r / l, i = s.width + 2 * n + t.padding, o = [
|
|
385
|
+
{ x: n, y: 0 },
|
|
386
|
+
{ x: i - n, y: 0 },
|
|
387
|
+
{ x: i, y: -r / 2 },
|
|
388
|
+
{ x: i - n, y: -r },
|
|
389
|
+
{ x: n, y: -r },
|
|
390
|
+
{ x: 0, y: -r / 2 }
|
|
391
|
+
], h = R(e, i, r, o);
|
|
392
|
+
return h.attr("style", t.style), m(t, h), t.intersect = function(d) {
|
|
393
|
+
return b.polygon(t, o, d);
|
|
394
|
+
}, e;
|
|
395
|
+
}, Wt = async (a, t) => {
|
|
396
|
+
const { shapeSvg: e, bbox: s } = await M(a, t, void 0, !0), l = 2, r = s.height + 2 * t.padding, n = r / l, i = s.width + 2 * n + t.padding, o = Pt(t.directions, s, t), h = R(e, i, r, o);
|
|
397
|
+
return h.attr("style", t.style), m(t, h), t.intersect = function(d) {
|
|
398
|
+
return b.polygon(t, o, d);
|
|
399
|
+
}, e;
|
|
400
|
+
}, Xt = async (a, t) => {
|
|
401
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
402
|
+
a,
|
|
403
|
+
t,
|
|
404
|
+
E(t),
|
|
405
|
+
!0
|
|
406
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
407
|
+
{ x: -r / 2, y: 0 },
|
|
408
|
+
{ x: l, y: 0 },
|
|
409
|
+
{ x: l, y: -r },
|
|
410
|
+
{ x: -r / 2, y: -r },
|
|
411
|
+
{ x: 0, y: -r / 2 }
|
|
412
|
+
];
|
|
413
|
+
return R(e, l, r, n).attr("style", t.style), t.width = l + r, t.height = r, t.intersect = function(i) {
|
|
414
|
+
return b.polygon(t, n, i);
|
|
415
|
+
}, e;
|
|
416
|
+
}, Yt = async (a, t) => {
|
|
417
|
+
const { shapeSvg: e, bbox: s } = await M(a, t, E(t), !0), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
418
|
+
{ x: -2 * r / 6, y: 0 },
|
|
419
|
+
{ x: l - r / 6, y: 0 },
|
|
420
|
+
{ x: l + 2 * r / 6, y: -r },
|
|
421
|
+
{ x: r / 6, y: -r }
|
|
422
|
+
], i = R(e, l, r, n);
|
|
423
|
+
return i.attr("style", t.style), m(t, i), t.intersect = function(o) {
|
|
424
|
+
return b.polygon(t, n, o);
|
|
425
|
+
}, e;
|
|
426
|
+
}, Ht = async (a, t) => {
|
|
427
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
428
|
+
a,
|
|
429
|
+
t,
|
|
430
|
+
E(t),
|
|
431
|
+
!0
|
|
432
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
433
|
+
{ x: 2 * r / 6, y: 0 },
|
|
434
|
+
{ x: l + r / 6, y: 0 },
|
|
435
|
+
{ x: l - 2 * r / 6, y: -r },
|
|
436
|
+
{ x: -r / 6, y: -r }
|
|
437
|
+
], i = R(e, l, r, n);
|
|
438
|
+
return i.attr("style", t.style), m(t, i), t.intersect = function(o) {
|
|
439
|
+
return b.polygon(t, n, o);
|
|
440
|
+
}, e;
|
|
441
|
+
}, It = async (a, t) => {
|
|
442
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
443
|
+
a,
|
|
444
|
+
t,
|
|
445
|
+
E(t),
|
|
446
|
+
!0
|
|
447
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
448
|
+
{ x: -2 * r / 6, y: 0 },
|
|
449
|
+
{ x: l + 2 * r / 6, y: 0 },
|
|
450
|
+
{ x: l - r / 6, y: -r },
|
|
451
|
+
{ x: r / 6, y: -r }
|
|
452
|
+
], i = R(e, l, r, n);
|
|
453
|
+
return i.attr("style", t.style), m(t, i), t.intersect = function(o) {
|
|
454
|
+
return b.polygon(t, n, o);
|
|
455
|
+
}, e;
|
|
456
|
+
}, Dt = async (a, t) => {
|
|
457
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
458
|
+
a,
|
|
459
|
+
t,
|
|
460
|
+
E(t),
|
|
461
|
+
!0
|
|
462
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
463
|
+
{ x: r / 6, y: 0 },
|
|
464
|
+
{ x: l - r / 6, y: 0 },
|
|
465
|
+
{ x: l + 2 * r / 6, y: -r },
|
|
466
|
+
{ x: -2 * r / 6, y: -r }
|
|
467
|
+
], i = R(e, l, r, n);
|
|
468
|
+
return i.attr("style", t.style), m(t, i), t.intersect = function(o) {
|
|
469
|
+
return b.polygon(t, n, o);
|
|
470
|
+
}, e;
|
|
471
|
+
}, Nt = async (a, t) => {
|
|
472
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
473
|
+
a,
|
|
474
|
+
t,
|
|
475
|
+
E(t),
|
|
476
|
+
!0
|
|
477
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
478
|
+
{ x: 0, y: 0 },
|
|
479
|
+
{ x: l + r / 2, y: 0 },
|
|
480
|
+
{ x: l, y: -r / 2 },
|
|
481
|
+
{ x: l + r / 2, y: -r },
|
|
482
|
+
{ x: 0, y: -r }
|
|
483
|
+
], i = R(e, l, r, n);
|
|
484
|
+
return i.attr("style", t.style), m(t, i), t.intersect = function(o) {
|
|
485
|
+
return b.polygon(t, n, o);
|
|
486
|
+
}, e;
|
|
487
|
+
}, jt = async (a, t) => {
|
|
488
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
489
|
+
a,
|
|
490
|
+
t,
|
|
491
|
+
E(t),
|
|
492
|
+
!0
|
|
493
|
+
), l = s.width + t.padding, r = l / 2, n = r / (2.5 + l / 50), i = s.height + n + t.padding, o = "M 0," + n + " a " + r + "," + n + " 0,0,0 " + l + " 0 a " + r + "," + n + " 0,0,0 " + -l + " 0 l 0," + i + " a " + r + "," + n + " 0,0,0 " + l + " 0 l 0," + -i, h = e.attr("label-offset-y", n).insert("path", ":first-child").attr("style", t.style).attr("d", o).attr("transform", "translate(" + -l / 2 + "," + -(i / 2 + n) + ")");
|
|
494
|
+
return m(t, h), t.intersect = function(d) {
|
|
495
|
+
const c = b.rect(t, d), p = c.x - t.x;
|
|
496
|
+
if (r != 0 && (Math.abs(p) < t.width / 2 || Math.abs(p) == t.width / 2 && Math.abs(c.y - t.y) > t.height / 2 - n)) {
|
|
497
|
+
let y = n * n * (1 - p * p / (r * r));
|
|
498
|
+
y != 0 && (y = Math.sqrt(y)), y = n - y, d.y - t.y > 0 && (y = -y), c.y += y;
|
|
499
|
+
}
|
|
500
|
+
return c;
|
|
501
|
+
}, e;
|
|
502
|
+
}, Ut = async (a, t) => {
|
|
503
|
+
const { shapeSvg: e, bbox: s, halfPadding: l } = await M(
|
|
504
|
+
a,
|
|
505
|
+
t,
|
|
506
|
+
"node " + t.classes + " " + t.class,
|
|
507
|
+
!0
|
|
508
|
+
), r = e.insert("rect", ":first-child"), n = t.positioned ? t.width : s.width + t.padding, i = t.positioned ? t.height : s.height + t.padding, o = t.positioned ? -n / 2 : -s.width / 2 - l, h = t.positioned ? -i / 2 : -s.height / 2 - l;
|
|
509
|
+
if (r.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", h).attr("width", n).attr("height", i), t.props) {
|
|
510
|
+
const d = new Set(Object.keys(t.props));
|
|
511
|
+
t.props.borders && (F(r, t.props.borders, n, i), d.delete("borders")), d.forEach((c) => {
|
|
512
|
+
f.warn(`Unknown node property ${c}`);
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
return m(t, r), t.intersect = function(d) {
|
|
516
|
+
return b.rect(t, d);
|
|
517
|
+
}, e;
|
|
518
|
+
}, At = async (a, t) => {
|
|
519
|
+
const { shapeSvg: e, bbox: s, halfPadding: l } = await M(
|
|
520
|
+
a,
|
|
521
|
+
t,
|
|
522
|
+
"node " + t.classes,
|
|
523
|
+
!0
|
|
524
|
+
), r = e.insert("rect", ":first-child"), n = t.positioned ? t.width : s.width + t.padding, i = t.positioned ? t.height : s.height + t.padding, o = t.positioned ? -n / 2 : -s.width / 2 - l, h = t.positioned ? -i / 2 : -s.height / 2 - l;
|
|
525
|
+
if (r.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", h).attr("width", n).attr("height", i), t.props) {
|
|
526
|
+
const d = new Set(Object.keys(t.props));
|
|
527
|
+
t.props.borders && (F(r, t.props.borders, n, i), d.delete("borders")), d.forEach((c) => {
|
|
528
|
+
f.warn(`Unknown node property ${c}`);
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
return m(t, r), t.intersect = function(d) {
|
|
532
|
+
return b.rect(t, d);
|
|
533
|
+
}, e;
|
|
534
|
+
}, qt = async (a, t) => {
|
|
535
|
+
const { shapeSvg: e } = await M(a, t, "label", !0);
|
|
536
|
+
f.trace("Classes = ", t.class);
|
|
537
|
+
const s = e.insert("rect", ":first-child"), l = 0, r = 0;
|
|
538
|
+
if (s.attr("width", l).attr("height", r), e.attr("class", "label edgeLabel"), t.props) {
|
|
539
|
+
const n = new Set(Object.keys(t.props));
|
|
540
|
+
t.props.borders && (F(s, t.props.borders, l, r), n.delete("borders")), n.forEach((i) => {
|
|
541
|
+
f.warn(`Unknown node property ${i}`);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
return m(t, s), t.intersect = function(n) {
|
|
545
|
+
return b.rect(t, n);
|
|
546
|
+
}, e;
|
|
547
|
+
};
|
|
548
|
+
function F(a, t, e, s) {
|
|
549
|
+
const l = [], r = (i) => {
|
|
550
|
+
l.push(i, 0);
|
|
551
|
+
}, n = (i) => {
|
|
552
|
+
l.push(0, i);
|
|
553
|
+
};
|
|
554
|
+
t.includes("t") ? (f.debug("add top border"), r(e)) : n(e), t.includes("r") ? (f.debug("add right border"), r(s)) : n(s), t.includes("b") ? (f.debug("add bottom border"), r(e)) : n(e), t.includes("l") ? (f.debug("add left border"), r(s)) : n(s), a.attr("stroke-dasharray", l.join(" "));
|
|
555
|
+
}
|
|
556
|
+
const Zt = (a, t) => {
|
|
557
|
+
let e;
|
|
558
|
+
t.classes ? e = "node " + t.classes : e = "node default";
|
|
559
|
+
const s = a.insert("g").attr("class", e).attr("id", t.domId || t.id), l = s.insert("rect", ":first-child"), r = s.insert("line"), n = s.insert("g").attr("class", "label"), i = t.labelText.flat ? t.labelText.flat() : t.labelText;
|
|
560
|
+
let o = "";
|
|
561
|
+
typeof i == "object" ? o = i[0] : o = i, f.info("Label text abc79", o, i, typeof i == "object");
|
|
562
|
+
const h = n.node().appendChild(P(o, t.labelStyle, !0, !0));
|
|
563
|
+
let d = { width: 0, height: 0 };
|
|
564
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
565
|
+
const k = h.children[0], g = _(h);
|
|
566
|
+
d = k.getBoundingClientRect(), g.attr("width", d.width), g.attr("height", d.height);
|
|
567
|
+
}
|
|
568
|
+
f.info("Text 2", i);
|
|
569
|
+
const c = i.slice(1, i.length);
|
|
570
|
+
let p = h.getBBox();
|
|
571
|
+
const y = n.node().appendChild(
|
|
572
|
+
P(c.join ? c.join("<br/>") : c, t.labelStyle, !0, !0)
|
|
573
|
+
);
|
|
574
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
575
|
+
const k = y.children[0], g = _(y);
|
|
576
|
+
d = k.getBoundingClientRect(), g.attr("width", d.width), g.attr("height", d.height);
|
|
577
|
+
}
|
|
578
|
+
const x = t.padding / 2;
|
|
579
|
+
return _(y).attr(
|
|
580
|
+
"transform",
|
|
581
|
+
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
582
|
+
(d.width > p.width ? 0 : (p.width - d.width) / 2) + ", " + (p.height + x + 5) + ")"
|
|
583
|
+
), _(h).attr(
|
|
584
|
+
"transform",
|
|
585
|
+
"translate( " + // (titleBox.width - bbox.width) / 2 +
|
|
586
|
+
(d.width < p.width ? 0 : -(p.width - d.width) / 2) + ", 0)"
|
|
587
|
+
), d = n.node().getBBox(), n.attr(
|
|
588
|
+
"transform",
|
|
589
|
+
"translate(" + -d.width / 2 + ", " + (-d.height / 2 - x + 3) + ")"
|
|
590
|
+
), l.attr("class", "outer title-state").attr("x", -d.width / 2 - x).attr("y", -d.height / 2 - x).attr("width", d.width + t.padding).attr("height", d.height + t.padding), r.attr("class", "divider").attr("x1", -d.width / 2 - x).attr("x2", d.width / 2 + x).attr("y1", -d.height / 2 - x + p.height + x).attr("y2", -d.height / 2 - x + p.height + x), m(t, l), t.intersect = function(k) {
|
|
591
|
+
return b.rect(t, k);
|
|
592
|
+
}, s;
|
|
593
|
+
}, zt = async (a, t) => {
|
|
594
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
595
|
+
a,
|
|
596
|
+
t,
|
|
597
|
+
E(t),
|
|
598
|
+
!0
|
|
599
|
+
), l = s.height + t.padding, r = s.width + l / 4 + t.padding, n = e.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -r / 2).attr("y", -l / 2).attr("width", r).attr("height", l);
|
|
600
|
+
return m(t, n), t.intersect = function(i) {
|
|
601
|
+
return b.rect(t, i);
|
|
602
|
+
}, e;
|
|
603
|
+
}, Gt = async (a, t) => {
|
|
604
|
+
const { shapeSvg: e, bbox: s, halfPadding: l } = await M(
|
|
605
|
+
a,
|
|
606
|
+
t,
|
|
607
|
+
E(t),
|
|
608
|
+
!0
|
|
609
|
+
), r = e.insert("circle", ":first-child");
|
|
610
|
+
return r.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + l).attr("width", s.width + t.padding).attr("height", s.height + t.padding), f.info("Circle main"), m(t, r), t.intersect = function(n) {
|
|
611
|
+
return f.info("Circle intersect", t, s.width / 2 + l, n), b.circle(t, s.width / 2 + l, n);
|
|
612
|
+
}, e;
|
|
613
|
+
}, Ft = async (a, t) => {
|
|
614
|
+
const { shapeSvg: e, bbox: s, halfPadding: l } = await M(
|
|
615
|
+
a,
|
|
616
|
+
t,
|
|
617
|
+
E(t),
|
|
618
|
+
!0
|
|
619
|
+
), r = 5, n = e.insert("g", ":first-child"), i = n.insert("circle"), o = n.insert("circle");
|
|
620
|
+
return n.attr("class", t.class), i.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + l + r).attr("width", s.width + t.padding + r * 2).attr("height", s.height + t.padding + r * 2), o.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", s.width / 2 + l).attr("width", s.width + t.padding).attr("height", s.height + t.padding), f.info("DoubleCircle main"), m(t, i), t.intersect = function(h) {
|
|
621
|
+
return f.info("DoubleCircle intersect", t, s.width / 2 + l + r, h), b.circle(t, s.width / 2 + l + r, h);
|
|
622
|
+
}, e;
|
|
623
|
+
}, Vt = async (a, t) => {
|
|
624
|
+
const { shapeSvg: e, bbox: s } = await M(
|
|
625
|
+
a,
|
|
626
|
+
t,
|
|
627
|
+
E(t),
|
|
628
|
+
!0
|
|
629
|
+
), l = s.width + t.padding, r = s.height + t.padding, n = [
|
|
630
|
+
{ x: 0, y: 0 },
|
|
631
|
+
{ x: l, y: 0 },
|
|
632
|
+
{ x: l, y: -r },
|
|
633
|
+
{ x: 0, y: -r },
|
|
634
|
+
{ x: 0, y: 0 },
|
|
635
|
+
{ x: -8, y: 0 },
|
|
636
|
+
{ x: l + 8, y: 0 },
|
|
637
|
+
{ x: l + 8, y: -r },
|
|
638
|
+
{ x: -8, y: -r },
|
|
639
|
+
{ x: -8, y: 0 }
|
|
640
|
+
], i = R(e, l, r, n);
|
|
641
|
+
return i.attr("style", t.style), m(t, i), t.intersect = function(o) {
|
|
642
|
+
return b.polygon(t, n, o);
|
|
643
|
+
}, e;
|
|
644
|
+
}, Jt = (a, t) => {
|
|
645
|
+
const e = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = e.insert("circle", ":first-child");
|
|
646
|
+
return s.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), m(t, s), t.intersect = function(l) {
|
|
647
|
+
return b.circle(t, 7, l);
|
|
648
|
+
}, e;
|
|
649
|
+
}, tt = (a, t, e) => {
|
|
650
|
+
const s = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
|
|
651
|
+
let l = 70, r = 10;
|
|
652
|
+
e === "LR" && (l = 10, r = 70);
|
|
653
|
+
const n = s.append("rect").attr("x", -1 * l / 2).attr("y", -1 * r / 2).attr("width", l).attr("height", r).attr("class", "fork-join");
|
|
654
|
+
return m(t, n), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(i) {
|
|
655
|
+
return b.rect(t, i);
|
|
656
|
+
}, s;
|
|
657
|
+
}, Qt = (a, t) => {
|
|
658
|
+
const e = a.insert("g").attr("class", "node default").attr("id", t.domId || t.id), s = e.insert("circle", ":first-child"), l = e.insert("circle", ":first-child");
|
|
659
|
+
return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), s.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), m(t, l), t.intersect = function(r) {
|
|
660
|
+
return b.circle(t, 7, r);
|
|
661
|
+
}, e;
|
|
662
|
+
}, Kt = (a, t) => {
|
|
663
|
+
const e = t.padding / 2, s = 4, l = 8;
|
|
664
|
+
let r;
|
|
665
|
+
t.classes ? r = "node " + t.classes : r = "node default";
|
|
666
|
+
const n = a.insert("g").attr("class", r).attr("id", t.domId || t.id), i = n.insert("rect", ":first-child"), o = n.insert("line"), h = n.insert("line");
|
|
667
|
+
let d = 0, c = s;
|
|
668
|
+
const p = n.insert("g").attr("class", "label");
|
|
669
|
+
let y = 0;
|
|
670
|
+
const x = t.classData.annotations && t.classData.annotations[0], k = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", g = p.node().appendChild(P(k, t.labelStyle, !0, !0));
|
|
671
|
+
let u = g.getBBox();
|
|
672
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
673
|
+
const L = g.children[0], S = _(g);
|
|
674
|
+
u = L.getBoundingClientRect(), S.attr("width", u.width), S.attr("height", u.height);
|
|
675
|
+
}
|
|
676
|
+
t.classData.annotations[0] && (c += u.height + s, d += u.width);
|
|
677
|
+
let v = t.classData.label;
|
|
678
|
+
t.classData.type !== void 0 && t.classData.type !== "" && (w().flowchart.htmlLabels ? v += "<" + t.classData.type + ">" : v += "<" + t.classData.type + ">");
|
|
679
|
+
const B = p.node().appendChild(P(v, t.labelStyle, !0, !0));
|
|
680
|
+
_(B).attr("class", "classTitle");
|
|
681
|
+
let C = B.getBBox();
|
|
682
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
683
|
+
const L = B.children[0], S = _(B);
|
|
684
|
+
C = L.getBoundingClientRect(), S.attr("width", C.width), S.attr("height", C.height);
|
|
685
|
+
}
|
|
686
|
+
c += C.height + s, C.width > d && (d = C.width);
|
|
687
|
+
const X = [];
|
|
688
|
+
t.classData.members.forEach((L) => {
|
|
689
|
+
const S = L.getDisplayDetails();
|
|
690
|
+
let H = S.displayText;
|
|
691
|
+
w().flowchart.htmlLabels && (H = H.replace(/</g, "<").replace(/>/g, ">"));
|
|
692
|
+
const W = p.node().appendChild(
|
|
693
|
+
P(
|
|
694
|
+
H,
|
|
695
|
+
S.cssStyle ? S.cssStyle : t.labelStyle,
|
|
696
|
+
!0,
|
|
697
|
+
!0
|
|
698
|
+
)
|
|
699
|
+
);
|
|
700
|
+
let $ = W.getBBox();
|
|
701
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
702
|
+
const Z = W.children[0], D = _(W);
|
|
703
|
+
$ = Z.getBoundingClientRect(), D.attr("width", $.width), D.attr("height", $.height);
|
|
704
|
+
}
|
|
705
|
+
$.width > d && (d = $.width), c += $.height + s, X.push(W);
|
|
706
|
+
}), c += l;
|
|
707
|
+
const V = [];
|
|
708
|
+
if (t.classData.methods.forEach((L) => {
|
|
709
|
+
const S = L.getDisplayDetails();
|
|
710
|
+
let H = S.displayText;
|
|
711
|
+
w().flowchart.htmlLabels && (H = H.replace(/</g, "<").replace(/>/g, ">"));
|
|
712
|
+
const W = p.node().appendChild(
|
|
713
|
+
P(
|
|
714
|
+
H,
|
|
715
|
+
S.cssStyle ? S.cssStyle : t.labelStyle,
|
|
716
|
+
!0,
|
|
717
|
+
!0
|
|
718
|
+
)
|
|
719
|
+
);
|
|
720
|
+
let $ = W.getBBox();
|
|
721
|
+
if (O(w().flowchart.htmlLabels)) {
|
|
722
|
+
const Z = W.children[0], D = _(W);
|
|
723
|
+
$ = Z.getBoundingClientRect(), D.attr("width", $.width), D.attr("height", $.height);
|
|
724
|
+
}
|
|
725
|
+
$.width > d && (d = $.width), c += $.height + s, V.push(W);
|
|
726
|
+
}), c += l, x) {
|
|
727
|
+
let L = (d - u.width) / 2;
|
|
728
|
+
_(g).attr(
|
|
729
|
+
"transform",
|
|
730
|
+
"translate( " + (-1 * d / 2 + L) + ", " + -1 * c / 2 + ")"
|
|
731
|
+
), y = u.height + s;
|
|
732
|
+
}
|
|
733
|
+
let it = (d - C.width) / 2;
|
|
734
|
+
return _(B).attr(
|
|
735
|
+
"transform",
|
|
736
|
+
"translate( " + (-1 * d / 2 + it) + ", " + (-1 * c / 2 + y) + ")"
|
|
737
|
+
), y += C.height + s, o.attr("class", "divider").attr("x1", -d / 2 - e).attr("x2", d / 2 + e).attr("y1", -c / 2 - e + l + y).attr("y2", -c / 2 - e + l + y), y += l, X.forEach((L) => {
|
|
738
|
+
_(L).attr(
|
|
739
|
+
"transform",
|
|
740
|
+
"translate( " + -d / 2 + ", " + (-1 * c / 2 + y + l / 2) + ")"
|
|
741
|
+
);
|
|
742
|
+
const S = L == null ? void 0 : L.getBBox();
|
|
743
|
+
y += ((S == null ? void 0 : S.height) ?? 0) + s;
|
|
744
|
+
}), y += l, h.attr("class", "divider").attr("x1", -d / 2 - e).attr("x2", d / 2 + e).attr("y1", -c / 2 - e + l + y).attr("y2", -c / 2 - e + l + y), y += l, V.forEach((L) => {
|
|
745
|
+
_(L).attr(
|
|
746
|
+
"transform",
|
|
747
|
+
"translate( " + -d / 2 + ", " + (-1 * c / 2 + y) + ")"
|
|
748
|
+
);
|
|
749
|
+
const S = L == null ? void 0 : L.getBBox();
|
|
750
|
+
y += ((S == null ? void 0 : S.height) ?? 0) + s;
|
|
751
|
+
}), i.attr("style", t.style).attr("class", "outer title-state").attr("x", -d / 2 - e).attr("y", -(c / 2) - e).attr("width", d + t.padding).attr("height", c + t.padding), m(t, i), t.intersect = function(L) {
|
|
752
|
+
return b.rect(t, L);
|
|
753
|
+
}, n;
|
|
754
|
+
}, rt = {
|
|
755
|
+
rhombus: K,
|
|
756
|
+
composite: At,
|
|
757
|
+
question: K,
|
|
758
|
+
rect: Ut,
|
|
759
|
+
labelRect: qt,
|
|
760
|
+
rectWithTitle: Zt,
|
|
761
|
+
choice: Ot,
|
|
762
|
+
circle: Gt,
|
|
763
|
+
doublecircle: Ft,
|
|
764
|
+
stadium: zt,
|
|
765
|
+
hexagon: Rt,
|
|
766
|
+
block_arrow: Wt,
|
|
767
|
+
rect_left_inv_arrow: Xt,
|
|
768
|
+
lean_right: Yt,
|
|
769
|
+
lean_left: Ht,
|
|
770
|
+
trapezoid: It,
|
|
771
|
+
inv_trapezoid: Dt,
|
|
772
|
+
rect_right_inv_arrow: Nt,
|
|
773
|
+
cylinder: jt,
|
|
774
|
+
start: Jt,
|
|
775
|
+
end: Qt,
|
|
776
|
+
note: $t,
|
|
777
|
+
subroutine: Vt,
|
|
778
|
+
fork: tt,
|
|
779
|
+
join: tt,
|
|
780
|
+
class_box: Kt
|
|
781
|
+
};
|
|
782
|
+
let I = {};
|
|
783
|
+
const dr = async (a, t, e) => {
|
|
784
|
+
let s, l;
|
|
785
|
+
if (t.link) {
|
|
786
|
+
let r;
|
|
787
|
+
w().securityLevel === "sandbox" ? r = "_top" : t.linkTarget && (r = t.linkTarget || "_blank"), s = a.insert("svg:a").attr("xlink:href", t.link).attr("target", r), l = await rt[t.shape](s, t, e);
|
|
788
|
+
} else
|
|
789
|
+
l = await rt[t.shape](a, t, e), s = l;
|
|
790
|
+
return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), s.attr("data-node", "true"), s.attr("data-id", t.id), I[t.id] = s, t.haveCallback && I[t.id].attr("class", I[t.id].attr("class") + " clickable"), s;
|
|
791
|
+
}, hr = (a, t) => {
|
|
792
|
+
I[t.id] = a;
|
|
793
|
+
}, cr = () => {
|
|
794
|
+
I = {};
|
|
795
|
+
}, yr = (a) => {
|
|
796
|
+
const t = I[a.id];
|
|
797
|
+
f.trace(
|
|
798
|
+
"Transforming node",
|
|
799
|
+
a.diff,
|
|
800
|
+
a,
|
|
801
|
+
"translate(" + (a.x - a.width / 2 - 5) + ", " + a.width / 2 + ")"
|
|
802
|
+
);
|
|
803
|
+
const e = 8, s = a.diff || 0;
|
|
804
|
+
return a.clusterNode ? t.attr(
|
|
805
|
+
"transform",
|
|
806
|
+
"translate(" + (a.x + s - a.width / 2) + ", " + (a.y - a.height / 2 - e) + ")"
|
|
807
|
+
) : t.attr("transform", "translate(" + a.x + ", " + a.y + ")"), s;
|
|
808
|
+
}, tr = ({
|
|
809
|
+
flowchart: a
|
|
810
|
+
}) => {
|
|
811
|
+
var t, e;
|
|
812
|
+
const s = ((t = a == null ? void 0 : a.subGraphTitleMargin) == null ? void 0 : t.top) ?? 0, l = ((e = a == null ? void 0 : a.subGraphTitleMargin) == null ? void 0 : e.bottom) ?? 0, r = s + l;
|
|
813
|
+
return {
|
|
814
|
+
subGraphTitleTopMargin: s,
|
|
815
|
+
subGraphTitleBottomMargin: l,
|
|
816
|
+
subGraphTitleTotalMargin: r
|
|
817
|
+
};
|
|
818
|
+
}, Y = {
|
|
819
|
+
aggregation: 18,
|
|
820
|
+
extension: 18,
|
|
821
|
+
composition: 18,
|
|
822
|
+
dependency: 6,
|
|
823
|
+
lollipop: 13.5,
|
|
824
|
+
arrow_point: 5.3
|
|
825
|
+
};
|
|
826
|
+
function j(a, t) {
|
|
827
|
+
if (a === void 0 || t === void 0)
|
|
828
|
+
return { angle: 0, deltaX: 0, deltaY: 0 };
|
|
829
|
+
a = A(a), t = A(t);
|
|
830
|
+
const [e, s] = [a.x, a.y], [l, r] = [t.x, t.y], n = l - e, i = r - s;
|
|
831
|
+
return { angle: Math.atan(i / n), deltaX: n, deltaY: i };
|
|
832
|
+
}
|
|
833
|
+
const A = (a) => Array.isArray(a) ? { x: a[0], y: a[1] } : a, rr = (a) => ({
|
|
834
|
+
x: function(t, e, s) {
|
|
835
|
+
let l = 0;
|
|
836
|
+
if (e === 0 && Object.hasOwn(Y, a.arrowTypeStart)) {
|
|
837
|
+
const { angle: r, deltaX: n } = j(s[0], s[1]);
|
|
838
|
+
l = Y[a.arrowTypeStart] * Math.cos(r) * (n >= 0 ? 1 : -1);
|
|
839
|
+
} else if (e === s.length - 1 && Object.hasOwn(Y, a.arrowTypeEnd)) {
|
|
840
|
+
const { angle: r, deltaX: n } = j(
|
|
841
|
+
s[s.length - 1],
|
|
842
|
+
s[s.length - 2]
|
|
843
|
+
);
|
|
844
|
+
l = Y[a.arrowTypeEnd] * Math.cos(r) * (n >= 0 ? 1 : -1);
|
|
845
|
+
}
|
|
846
|
+
return A(t).x + l;
|
|
847
|
+
},
|
|
848
|
+
y: function(t, e, s) {
|
|
849
|
+
let l = 0;
|
|
850
|
+
if (e === 0 && Object.hasOwn(Y, a.arrowTypeStart)) {
|
|
851
|
+
const { angle: r, deltaY: n } = j(s[0], s[1]);
|
|
852
|
+
l = Y[a.arrowTypeStart] * Math.abs(Math.sin(r)) * (n >= 0 ? 1 : -1);
|
|
853
|
+
} else if (e === s.length - 1 && Object.hasOwn(Y, a.arrowTypeEnd)) {
|
|
854
|
+
const { angle: r, deltaY: n } = j(
|
|
855
|
+
s[s.length - 1],
|
|
856
|
+
s[s.length - 2]
|
|
857
|
+
);
|
|
858
|
+
l = Y[a.arrowTypeEnd] * Math.abs(Math.sin(r)) * (n >= 0 ? 1 : -1);
|
|
859
|
+
}
|
|
860
|
+
return A(t).y + l;
|
|
861
|
+
}
|
|
862
|
+
}), er = (a, t, e, s, l) => {
|
|
863
|
+
t.arrowTypeStart && et(a, "start", t.arrowTypeStart, e, s, l), t.arrowTypeEnd && et(a, "end", t.arrowTypeEnd, e, s, l);
|
|
864
|
+
}, ar = {
|
|
865
|
+
arrow_cross: "cross",
|
|
866
|
+
arrow_point: "point",
|
|
867
|
+
arrow_barb: "barb",
|
|
868
|
+
arrow_circle: "circle",
|
|
869
|
+
aggregation: "aggregation",
|
|
870
|
+
extension: "extension",
|
|
871
|
+
composition: "composition",
|
|
872
|
+
dependency: "dependency",
|
|
873
|
+
lollipop: "lollipop"
|
|
874
|
+
}, et = (a, t, e, s, l, r) => {
|
|
875
|
+
const n = ar[e];
|
|
876
|
+
if (!n) {
|
|
877
|
+
f.warn(`Unknown arrow type: ${e}`);
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
const i = t === "start" ? "Start" : "End";
|
|
881
|
+
a.attr(`marker-${t}`, `url(${s}#${l}_${r}-${n}${i})`);
|
|
882
|
+
};
|
|
883
|
+
let q = {}, T = {};
|
|
884
|
+
const pr = () => {
|
|
885
|
+
q = {}, T = {};
|
|
886
|
+
}, gr = (a, t) => {
|
|
887
|
+
const e = O(w().flowchart.htmlLabels), s = t.labelType === "markdown" ? nt(a, t.label, {
|
|
888
|
+
style: t.labelStyle,
|
|
889
|
+
useHtmlLabels: e,
|
|
890
|
+
addSvgBackground: !0
|
|
891
|
+
}) : P(t.label, t.labelStyle), l = a.insert("g").attr("class", "edgeLabel"), r = l.insert("g").attr("class", "label");
|
|
892
|
+
r.node().appendChild(s);
|
|
893
|
+
let n = s.getBBox();
|
|
894
|
+
if (e) {
|
|
895
|
+
const o = s.children[0], h = _(s);
|
|
896
|
+
n = o.getBoundingClientRect(), h.attr("width", n.width), h.attr("height", n.height);
|
|
897
|
+
}
|
|
898
|
+
r.attr("transform", "translate(" + -n.width / 2 + ", " + -n.height / 2 + ")"), q[t.id] = l, t.width = n.width, t.height = n.height;
|
|
899
|
+
let i;
|
|
900
|
+
if (t.startLabelLeft) {
|
|
901
|
+
const o = P(t.startLabelLeft, t.labelStyle), h = a.insert("g").attr("class", "edgeTerminals"), d = h.insert("g").attr("class", "inner");
|
|
902
|
+
i = d.node().appendChild(o);
|
|
903
|
+
const c = o.getBBox();
|
|
904
|
+
d.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startLeft = h, U(i, t.startLabelLeft);
|
|
905
|
+
}
|
|
906
|
+
if (t.startLabelRight) {
|
|
907
|
+
const o = P(t.startLabelRight, t.labelStyle), h = a.insert("g").attr("class", "edgeTerminals"), d = h.insert("g").attr("class", "inner");
|
|
908
|
+
i = h.node().appendChild(o), d.node().appendChild(o);
|
|
909
|
+
const c = o.getBBox();
|
|
910
|
+
d.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), T[t.id] || (T[t.id] = {}), T[t.id].startRight = h, U(i, t.startLabelRight);
|
|
911
|
+
}
|
|
912
|
+
if (t.endLabelLeft) {
|
|
913
|
+
const o = P(t.endLabelLeft, t.labelStyle), h = a.insert("g").attr("class", "edgeTerminals"), d = h.insert("g").attr("class", "inner");
|
|
914
|
+
i = d.node().appendChild(o);
|
|
915
|
+
const c = o.getBBox();
|
|
916
|
+
d.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), h.node().appendChild(o), T[t.id] || (T[t.id] = {}), T[t.id].endLeft = h, U(i, t.endLabelLeft);
|
|
917
|
+
}
|
|
918
|
+
if (t.endLabelRight) {
|
|
919
|
+
const o = P(t.endLabelRight, t.labelStyle), h = a.insert("g").attr("class", "edgeTerminals"), d = h.insert("g").attr("class", "inner");
|
|
920
|
+
i = d.node().appendChild(o);
|
|
921
|
+
const c = o.getBBox();
|
|
922
|
+
d.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), h.node().appendChild(o), T[t.id] || (T[t.id] = {}), T[t.id].endRight = h, U(i, t.endLabelRight);
|
|
923
|
+
}
|
|
924
|
+
return s;
|
|
925
|
+
};
|
|
926
|
+
function U(a, t) {
|
|
927
|
+
w().flowchart.htmlLabels && a && (a.style.width = t.length * 9 + "px", a.style.height = "12px");
|
|
928
|
+
}
|
|
929
|
+
const xr = (a, t) => {
|
|
930
|
+
f.debug("Moving label abc88 ", a.id, a.label, q[a.id], t);
|
|
931
|
+
let e = t.updatedPath ? t.updatedPath : t.originalPath;
|
|
932
|
+
const s = w(), { subGraphTitleTotalMargin: l } = tr(s);
|
|
933
|
+
if (a.label) {
|
|
934
|
+
const r = q[a.id];
|
|
935
|
+
let n = a.x, i = a.y;
|
|
936
|
+
if (e) {
|
|
937
|
+
const o = N.calcLabelPosition(e);
|
|
938
|
+
f.debug(
|
|
939
|
+
"Moving label " + a.label + " from (",
|
|
940
|
+
n,
|
|
941
|
+
",",
|
|
942
|
+
i,
|
|
943
|
+
") to (",
|
|
944
|
+
o.x,
|
|
945
|
+
",",
|
|
946
|
+
o.y,
|
|
947
|
+
") abc88"
|
|
948
|
+
), t.updatedPath && (n = o.x, i = o.y);
|
|
949
|
+
}
|
|
950
|
+
r.attr("transform", `translate(${n}, ${i + l / 2})`);
|
|
951
|
+
}
|
|
952
|
+
if (a.startLabelLeft) {
|
|
953
|
+
const r = T[a.id].startLeft;
|
|
954
|
+
let n = a.x, i = a.y;
|
|
955
|
+
if (e) {
|
|
956
|
+
const o = N.calcTerminalLabelPosition(a.arrowTypeStart ? 10 : 0, "start_left", e);
|
|
957
|
+
n = o.x, i = o.y;
|
|
958
|
+
}
|
|
959
|
+
r.attr("transform", `translate(${n}, ${i})`);
|
|
960
|
+
}
|
|
961
|
+
if (a.startLabelRight) {
|
|
962
|
+
const r = T[a.id].startRight;
|
|
963
|
+
let n = a.x, i = a.y;
|
|
964
|
+
if (e) {
|
|
965
|
+
const o = N.calcTerminalLabelPosition(
|
|
966
|
+
a.arrowTypeStart ? 10 : 0,
|
|
967
|
+
"start_right",
|
|
968
|
+
e
|
|
969
|
+
);
|
|
970
|
+
n = o.x, i = o.y;
|
|
971
|
+
}
|
|
972
|
+
r.attr("transform", `translate(${n}, ${i})`);
|
|
973
|
+
}
|
|
974
|
+
if (a.endLabelLeft) {
|
|
975
|
+
const r = T[a.id].endLeft;
|
|
976
|
+
let n = a.x, i = a.y;
|
|
977
|
+
if (e) {
|
|
978
|
+
const o = N.calcTerminalLabelPosition(a.arrowTypeEnd ? 10 : 0, "end_left", e);
|
|
979
|
+
n = o.x, i = o.y;
|
|
980
|
+
}
|
|
981
|
+
r.attr("transform", `translate(${n}, ${i})`);
|
|
982
|
+
}
|
|
983
|
+
if (a.endLabelRight) {
|
|
984
|
+
const r = T[a.id].endRight;
|
|
985
|
+
let n = a.x, i = a.y;
|
|
986
|
+
if (e) {
|
|
987
|
+
const o = N.calcTerminalLabelPosition(a.arrowTypeEnd ? 10 : 0, "end_right", e);
|
|
988
|
+
n = o.x, i = o.y;
|
|
989
|
+
}
|
|
990
|
+
r.attr("transform", `translate(${n}, ${i})`);
|
|
991
|
+
}
|
|
992
|
+
}, nr = (a, t) => {
|
|
993
|
+
const e = a.x, s = a.y, l = Math.abs(t.x - e), r = Math.abs(t.y - s), n = a.width / 2, i = a.height / 2;
|
|
994
|
+
return l >= n || r >= i;
|
|
995
|
+
}, sr = (a, t, e) => {
|
|
996
|
+
f.debug(`intersection calc abc89:
|
|
997
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
998
|
+
insidePoint : ${JSON.stringify(e)}
|
|
999
|
+
node : x:${a.x} y:${a.y} w:${a.width} h:${a.height}`);
|
|
1000
|
+
const s = a.x, l = a.y, r = Math.abs(s - e.x), n = a.width / 2;
|
|
1001
|
+
let i = e.x < t.x ? n - r : n + r;
|
|
1002
|
+
const o = a.height / 2, h = Math.abs(t.y - e.y), d = Math.abs(t.x - e.x);
|
|
1003
|
+
if (Math.abs(l - t.y) * n > Math.abs(s - t.x) * o) {
|
|
1004
|
+
let c = e.y < t.y ? t.y - o - l : l - o - t.y;
|
|
1005
|
+
i = d * c / h;
|
|
1006
|
+
const p = {
|
|
1007
|
+
x: e.x < t.x ? e.x + i : e.x - d + i,
|
|
1008
|
+
y: e.y < t.y ? e.y + h - c : e.y - h + c
|
|
1009
|
+
};
|
|
1010
|
+
return i === 0 && (p.x = t.x, p.y = t.y), d === 0 && (p.x = t.x), h === 0 && (p.y = t.y), f.debug(`abc89 topp/bott calc, Q ${h}, q ${c}, R ${d}, r ${i}`, p), p;
|
|
1011
|
+
} else {
|
|
1012
|
+
e.x < t.x ? i = t.x - n - s : i = s - n - t.x;
|
|
1013
|
+
let c = h * i / d, p = e.x < t.x ? e.x + d - i : e.x - d + i, y = e.y < t.y ? e.y + c : e.y - c;
|
|
1014
|
+
return f.debug(`sides calc abc89, Q ${h}, q ${c}, R ${d}, r ${i}`, { _x: p, _y: y }), i === 0 && (p = t.x, y = t.y), d === 0 && (p = t.x), h === 0 && (y = t.y), { x: p, y };
|
|
1015
|
+
}
|
|
1016
|
+
}, at = (a, t) => {
|
|
1017
|
+
f.debug("abc88 cutPathAtIntersect", a, t);
|
|
1018
|
+
let e = [], s = a[0], l = !1;
|
|
1019
|
+
return a.forEach((r) => {
|
|
1020
|
+
if (!nr(t, r) && !l) {
|
|
1021
|
+
const n = sr(t, s, r);
|
|
1022
|
+
let i = !1;
|
|
1023
|
+
e.forEach((o) => {
|
|
1024
|
+
i = i || o.x === n.x && o.y === n.y;
|
|
1025
|
+
}), e.some((o) => o.x === n.x && o.y === n.y) || e.push(n), l = !0;
|
|
1026
|
+
} else
|
|
1027
|
+
s = r, l || e.push(r);
|
|
1028
|
+
}), e;
|
|
1029
|
+
}, fr = function(a, t, e, s, l, r, n) {
|
|
1030
|
+
let i = e.points;
|
|
1031
|
+
f.debug("abc88 InsertEdge: edge=", e, "e=", t);
|
|
1032
|
+
let o = !1;
|
|
1033
|
+
const h = r.node(t.v);
|
|
1034
|
+
var d = r.node(t.w);
|
|
1035
|
+
d != null && d.intersect && h != null && h.intersect && (i = i.slice(1, e.points.length - 1), i.unshift(h.intersect(i[0])), i.push(d.intersect(i[i.length - 1]))), e.toCluster && (f.debug("to cluster abc88", s[e.toCluster]), i = at(e.points, s[e.toCluster].node), o = !0), e.fromCluster && (f.debug("from cluster abc88", s[e.fromCluster]), i = at(i.reverse(), s[e.fromCluster].node).reverse(), o = !0);
|
|
1036
|
+
const c = i.filter((C) => !Number.isNaN(C.y));
|
|
1037
|
+
let p = ot;
|
|
1038
|
+
e.curve && (l === "graph" || l === "flowchart") && (p = e.curve);
|
|
1039
|
+
const { x: y, y: x } = rr(e), k = lt().x(y).y(x).curve(p);
|
|
1040
|
+
let g;
|
|
1041
|
+
switch (e.thickness) {
|
|
1042
|
+
case "normal":
|
|
1043
|
+
g = "edge-thickness-normal";
|
|
1044
|
+
break;
|
|
1045
|
+
case "thick":
|
|
1046
|
+
g = "edge-thickness-thick";
|
|
1047
|
+
break;
|
|
1048
|
+
case "invisible":
|
|
1049
|
+
g = "edge-thickness-thick";
|
|
1050
|
+
break;
|
|
1051
|
+
default:
|
|
1052
|
+
g = "";
|
|
1053
|
+
}
|
|
1054
|
+
switch (e.pattern) {
|
|
1055
|
+
case "solid":
|
|
1056
|
+
g += " edge-pattern-solid";
|
|
1057
|
+
break;
|
|
1058
|
+
case "dotted":
|
|
1059
|
+
g += " edge-pattern-dotted";
|
|
1060
|
+
break;
|
|
1061
|
+
case "dashed":
|
|
1062
|
+
g += " edge-pattern-dashed";
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
const u = a.append("path").attr("d", k(c)).attr("id", e.id).attr("class", " " + g + (e.classes ? " " + e.classes : "")).attr("style", e.style);
|
|
1066
|
+
let v = "";
|
|
1067
|
+
(w().flowchart.arrowMarkerAbsolute || w().state.arrowMarkerAbsolute) && (v = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search, v = v.replace(/\(/g, "\\("), v = v.replace(/\)/g, "\\)")), er(u, e, v, n, l);
|
|
1068
|
+
let B = {};
|
|
1069
|
+
return o && (B.updatedPath = i), B.originalPath = e.points, B;
|
|
1070
|
+
};
|
|
1071
|
+
export {
|
|
1072
|
+
_t as E,
|
|
1073
|
+
M,
|
|
1074
|
+
P as R,
|
|
1075
|
+
er as a,
|
|
1076
|
+
or as c,
|
|
1077
|
+
xr as d,
|
|
1078
|
+
pr as f,
|
|
1079
|
+
fr as g,
|
|
1080
|
+
dr as h,
|
|
1081
|
+
m,
|
|
1082
|
+
hr as o,
|
|
1083
|
+
yr as p,
|
|
1084
|
+
rr as r,
|
|
1085
|
+
tr as t,
|
|
1086
|
+
gr as x,
|
|
1087
|
+
cr as y
|
|
1088
|
+
};
|