@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.
Files changed (47) hide show
  1. package/dist/Tableau10-D7jGxypv-BNlEL2G_.js +9 -0
  2. package/dist/arc-D-ZI5fuh-CvDHBzlN.js +84 -0
  3. package/dist/blockDiagram-c4efeb88-DUnNxfIR-Bhh-x1q6.js +1221 -0
  4. package/dist/c4Diagram-c83219d4-cC4OxfBG-DRTO_jy5.js +1580 -0
  5. package/dist/channel-hcYozyrT-BSOc2Hp-.js +6 -0
  6. package/dist/chatbot-widget.bundle.js +3881 -1586
  7. package/dist/chatbot-widget.css +1 -1
  8. package/dist/chatbot-widget.es.js +12 -63652
  9. package/dist/chatbot-widget.umd.js +3880 -1585
  10. package/dist/classDiagram-beda092f-BLYhf5Mr-vk4Ko58U.js +218 -0
  11. package/dist/classDiagram-v2-2358418a-VBkbF8mr-Ca0l1fEs.js +201 -0
  12. package/dist/clone-BZIkCMuw-B9owNq6E.js +9 -0
  13. package/dist/config/index.d.ts +2 -2
  14. package/dist/createText-1719965b-UejsQ47k-B1DYw0WW.js +2955 -0
  15. package/dist/edges-96097737-1M5QvjOd-BpQVVoQN.js +1088 -0
  16. package/dist/erDiagram-0228fc6a-CjBNxHoC-DXDVlH55.js +929 -0
  17. package/dist/flowDb-c6c81e3f-Q2aoOxdz-DfrfI3H1.js +1127 -0
  18. package/dist/flowDiagram-50d868cf-zizL6ppE-BAH-_juu.js +788 -0
  19. package/dist/flowDiagram-v2-4f6560a1-DVx_vlO5-bkcRE0UW.js +18 -0
  20. package/dist/flowchart-elk-definition-6af322e1-Eyez36go-B_lk3oHt.js +48132 -0
  21. package/dist/ganttDiagram-a2739b55-C82Jv-TO-DoS-s1Yu.js +1743 -0
  22. package/dist/gitGraphDiagram-82fe8481-D9o_9-U8-DJF-ZeR8.js +1265 -0
  23. package/dist/graph-BjmGDpTe-DgbYS1Ie.js +848 -0
  24. package/dist/index-5325376f-CJL5w-Sw-BXp44Ej5.js +374 -0
  25. package/dist/index-s6Yb6o1D.js +116386 -0
  26. package/dist/infoDiagram-8eee0895-FpS-TLK_-BnvO_wUe.js +320 -0
  27. package/dist/journeyDiagram-c64418c1-CMj1efQ9-CshcRDhm.js +802 -0
  28. package/dist/layout-D_6hdlf3-B7guhEBN.js +1470 -0
  29. package/dist/mindmap-definition-8da855dc-D4SxHjUd-jFZFomnk.js +21924 -0
  30. package/dist/pieDiagram-a8764435-BF5ZqOjB-Mqzg2J4Q.js +498 -0
  31. package/dist/quadrantDiagram-1e28029f-GtQb80VU-DCy1QjzW.js +903 -0
  32. package/dist/requirementDiagram-08caed73-CHtPj3FO-AHEP0cIt.js +767 -0
  33. package/dist/sankeyDiagram-a04cb91d-CBlXzOgd-CWJTc5AX.js +802 -0
  34. package/dist/sequenceDiagram-c5b8d532-Cs1iyw97-oayOJE8v.js +2235 -0
  35. package/dist/shared/styles.d.ts +1 -1
  36. package/dist/stateDiagram-1ecb1508-CpRKICMQ-C5OFJeRZ.js +266 -0
  37. package/dist/stateDiagram-v2-c2b004d7-BtkhFyQ5-DxzE8Je5.js +185 -0
  38. package/dist/styles-b4e223ce-D0oeHeKH-BmNvk4NR.js +1090 -0
  39. package/dist/styles-ca3715f6-BouNgl-L-_qXsPDP3.js +961 -0
  40. package/dist/styles-d45a18b0-Cvhb8Ltu-43I3Cd_I.js +437 -0
  41. package/dist/svgDrawCommon-b86b1483-mg-1NjZY-DrmnILcc.js +65 -0
  42. package/dist/timeline-definition-faaaa080-3olbep_P-BqKpgsPZ.js +793 -0
  43. package/dist/ui/Message.d.ts +1 -5
  44. package/dist/ui/MessagesList.d.ts +1 -5
  45. package/dist/xychartDiagram-f5964ef8-BN6HXpmW-C-g_F1w2.js +1238 -0
  46. package/package.json +3 -3
  47. package/dist/ui/TypingEffect.d.ts +0 -18
@@ -0,0 +1,788 @@
1
+ import { j as D, X as vt } from "./flowDb-c6c81e3f-Q2aoOxdz-DfrfI3H1.js";
2
+ import { O as j, g as $, P as x, d as mt, R as U, _ as R, Y as C, f as Q, r as J, l as Z, c as kt } from "./index-s6Yb6o1D.js";
3
+ import { K as St } from "./graph-BjmGDpTe-DgbYS1Ie.js";
4
+ import { A as _t, j as Ot, e as Lt, k as B, a as At } from "./layout-D_6hdlf3-B7guhEBN.js";
5
+ import { h as It, w as Tt, Z as Mt, e as A, t as tt, p as et, f as rt, u as O, b as at } from "./styles-d45a18b0-Cvhb8Ltu-43I3Cd_I.js";
6
+ typeof window < "u" && (window.global = window);
7
+ function Pt(r) {
8
+ if (!r.ok) throw new Error(r.status + " " + r.statusText);
9
+ return r.text();
10
+ }
11
+ function Nt(r, e) {
12
+ return fetch(r, e).then(Pt);
13
+ }
14
+ function Bt(r) {
15
+ return (e, t) => Nt(e, t).then((a) => new DOMParser().parseFromString(a, r));
16
+ }
17
+ var Et = Bt("image/svg+xml"), W = {
18
+ normal: $t,
19
+ vee: Ct,
20
+ undirected: Dt
21
+ };
22
+ function jt(r) {
23
+ W = r;
24
+ }
25
+ function $t(r, e, t, a) {
26
+ var n = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), i = n.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
27
+ A(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
28
+ }
29
+ function Ct(r, e, t, a) {
30
+ var n = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), i = n.append("path").attr("d", "M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
31
+ A(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
32
+ }
33
+ function Dt(r, e, t, a) {
34
+ var n = r.append("marker").attr("id", e).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto"), i = n.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
35
+ A(i, t[a + "Style"]), t[a + "Class"] && i.attr("class", t[a + "Class"]);
36
+ }
37
+ function Rt(r, e) {
38
+ var t = r;
39
+ return t.node().appendChild(e.label), A(t, e.labelStyle), t;
40
+ }
41
+ function Ut(r, e) {
42
+ for (var t = r.append("text"), a = Wt(e.label).split(`
43
+ `), n = 0; n < a.length; n++)
44
+ t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(a[n]);
45
+ return A(t, e.labelStyle), t;
46
+ }
47
+ function Wt(r) {
48
+ for (var e = "", t = !1, a, n = 0; n < r.length; ++n)
49
+ if (a = r[n], t) {
50
+ switch (a) {
51
+ case "n":
52
+ e += `
53
+ `;
54
+ break;
55
+ default:
56
+ e += a;
57
+ }
58
+ t = !1;
59
+ } else a === "\\" ? t = !0 : e += a;
60
+ return e;
61
+ }
62
+ function H(r, e, t) {
63
+ var a = e.label, n = r.append("g");
64
+ e.labelType === "svg" ? Rt(n, e) : typeof a != "string" || e.labelType === "html" ? tt(n, e) : Ut(n, e);
65
+ var i = n.node().getBBox(), o;
66
+ switch (t) {
67
+ case "top":
68
+ o = -e.height / 2;
69
+ break;
70
+ case "bottom":
71
+ o = e.height / 2 - i.height;
72
+ break;
73
+ default:
74
+ o = -i.height / 2;
75
+ }
76
+ return n.attr("transform", "translate(" + -i.width / 2 + "," + o + ")"), n;
77
+ }
78
+ var z = function(r, e) {
79
+ var t = e.nodes().filter(function(i) {
80
+ return et(e, i);
81
+ }), a = r.selectAll("g.cluster").data(t, function(i) {
82
+ return i;
83
+ });
84
+ O(a.exit(), e).style("opacity", 0).remove();
85
+ var n = a.enter().append("g").attr("class", "cluster").attr("id", function(i) {
86
+ var o = e.node(i);
87
+ return o.id;
88
+ }).style("opacity", 0).each(function(i) {
89
+ var o = e.node(i), s = x(this);
90
+ x(this).append("rect");
91
+ var d = s.append("g").attr("class", "label");
92
+ H(d, o, o.clusterLabelPos);
93
+ });
94
+ return a = a.merge(n), a = O(a, e).style("opacity", 1), a.selectAll("rect").each(function(i) {
95
+ var o = e.node(i), s = x(this);
96
+ A(s, o.style);
97
+ }), a;
98
+ };
99
+ function zt(r) {
100
+ z = r;
101
+ }
102
+ let Y = function(r, e) {
103
+ var t = r.selectAll("g.edgeLabel").data(e.edges(), function(n) {
104
+ return at(n);
105
+ }).classed("update", !0);
106
+ t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(n) {
107
+ var i = x(this);
108
+ i.select(".label").remove();
109
+ var o = e.edge(n), s = H(i, e.edge(n), 0).classed("label", !0), d = s.node().getBBox();
110
+ o.labelId && s.attr("id", o.labelId), Object.prototype.hasOwnProperty.call(o, "width") || (o.width = d.width), Object.prototype.hasOwnProperty.call(o, "height") || (o.height = d.height);
111
+ });
112
+ var a;
113
+ return t.exit ? a = t.exit() : a = t.selectAll(null), O(a, e).style("opacity", 0).remove(), t;
114
+ };
115
+ function Yt(r) {
116
+ Y = r;
117
+ }
118
+ function G(r, e) {
119
+ return r.intersect(e);
120
+ }
121
+ var q = function(r, e, t) {
122
+ var a = r.selectAll("g.edgePath").data(e.edges(), function(o) {
123
+ return at(o);
124
+ }).classed("update", !0), n = Ft(a, e);
125
+ Gt(a, e);
126
+ var i = a.merge !== void 0 ? a.merge(n) : a;
127
+ return O(i, e).style("opacity", 1), i.each(function(o) {
128
+ var s = x(this), d = e.edge(o);
129
+ d.elem = this, d.id && s.attr("id", d.id), rt(
130
+ s,
131
+ d.class,
132
+ (s.classed("update") ? "update " : "") + "edgePath"
133
+ );
134
+ }), i.selectAll("path.path").each(function(o) {
135
+ var s = e.edge(o);
136
+ s.arrowheadId = Lt("arrowhead");
137
+ var d = x(this).attr("marker-end", function() {
138
+ return "url(" + Xt(location.href, s.arrowheadId) + ")";
139
+ }).style("fill", "none");
140
+ O(d, e).attr("d", function(u) {
141
+ return Vt(e, u);
142
+ }), A(d, s.style);
143
+ }), i.selectAll("defs *").remove(), i.selectAll("defs").each(function(o) {
144
+ var s = e.edge(o), d = t[s.arrowhead];
145
+ d(x(this), s.arrowheadId, s, "arrowhead");
146
+ }), i;
147
+ };
148
+ function qt(r) {
149
+ q = r;
150
+ }
151
+ function Xt(r, e) {
152
+ var t = r.split("#")[0];
153
+ return t + "#" + e;
154
+ }
155
+ function Vt(r, e) {
156
+ var t = r.edge(e), a = r.node(e.v), n = r.node(e.w), i = t.points.slice(1, t.points.length - 1);
157
+ return i.unshift(G(a, i[0])), i.push(G(n, i[i.length - 1])), nt(t, i);
158
+ }
159
+ function nt(r, e) {
160
+ var t = (kt || Et.line)().x(function(a) {
161
+ return a.x;
162
+ }).y(function(a) {
163
+ return a.y;
164
+ });
165
+ return (t.curve || t.interpolate)(r.curve), t(e);
166
+ }
167
+ function Ht(r) {
168
+ var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
169
+ return { x: t.e, y: t.f };
170
+ }
171
+ function Ft(r, e) {
172
+ var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
173
+ return t.append("path").attr("class", "path").attr("d", function(a) {
174
+ var n = e.edge(a), i = e.node(a.v).elem, o = At(n.points.length).map(function() {
175
+ return Ht(i);
176
+ });
177
+ return nt(n, o);
178
+ }), t.append("defs"), t;
179
+ }
180
+ function Gt(r, e) {
181
+ var t = r.exit();
182
+ O(t, e).style("opacity", 0).remove();
183
+ }
184
+ var X = function(r, e, t) {
185
+ var a = e.nodes().filter(function(o) {
186
+ return !et(e, o);
187
+ }), n = r.selectAll("g.node").data(a, function(o) {
188
+ return o;
189
+ }).classed("update", !0);
190
+ n.exit().remove(), n.enter().append("g").attr("class", "node").style("opacity", 0), n = r.selectAll("g.node"), n.each(function(o) {
191
+ var s = e.node(o), d = x(this);
192
+ rt(
193
+ d,
194
+ s.class,
195
+ (d.classed("update") ? "update " : "") + "node"
196
+ ), d.select("g.label").remove();
197
+ var u = d.append("g").attr("class", "label"), l = H(u, s), g = t[s.shape], c = Ot(l.node().getBBox(), "width", "height");
198
+ s.elem = this, s.id && d.attr("id", s.id), s.labelId && u.attr("id", s.labelId), Object.prototype.hasOwnProperty.call(s, "width") && (c.width = s.width), Object.prototype.hasOwnProperty.call(s, "height") && (c.height = s.height), c.width += s.paddingLeft + s.paddingRight, c.height += s.paddingTop + s.paddingBottom, u.attr(
199
+ "transform",
200
+ "translate(" + (s.paddingLeft - s.paddingRight) / 2 + "," + (s.paddingTop - s.paddingBottom) / 2 + ")"
201
+ );
202
+ var h = x(this);
203
+ h.select(".label-container").remove();
204
+ var f = g(h, c, s).classed("label-container", !0);
205
+ A(f, s.style);
206
+ var b = f.node().getBBox();
207
+ s.width = b.width, s.height = b.height;
208
+ });
209
+ var i;
210
+ return n.exit ? i = n.exit() : i = n.selectAll(null), O(i, e).style("opacity", 0).remove(), n;
211
+ };
212
+ function Kt(r) {
213
+ X = r;
214
+ }
215
+ function Qt(r, e) {
216
+ var t = r.filter(function() {
217
+ return !x(this).classed("update");
218
+ });
219
+ function a(n) {
220
+ var i = e.node(n);
221
+ return "translate(" + i.x + "," + i.y + ")";
222
+ }
223
+ t.attr("transform", a), O(r, e).style("opacity", 1).attr("transform", a), O(t.selectAll("rect"), e).attr("width", function(n) {
224
+ return e.node(n).width;
225
+ }).attr("height", function(n) {
226
+ return e.node(n).height;
227
+ }).attr("x", function(n) {
228
+ var i = e.node(n);
229
+ return -i.width / 2;
230
+ }).attr("y", function(n) {
231
+ var i = e.node(n);
232
+ return -i.height / 2;
233
+ });
234
+ }
235
+ function Jt(r, e) {
236
+ var t = r.filter(function() {
237
+ return !x(this).classed("update");
238
+ });
239
+ function a(n) {
240
+ var i = e.edge(n);
241
+ return Object.prototype.hasOwnProperty.call(i, "x") ? "translate(" + i.x + "," + i.y + ")" : "";
242
+ }
243
+ t.attr("transform", a), O(r, e).style("opacity", 1).attr("transform", a);
244
+ }
245
+ function Zt(r, e) {
246
+ var t = r.filter(function() {
247
+ return !x(this).classed("update");
248
+ });
249
+ function a(n) {
250
+ var i = e.node(n);
251
+ return "translate(" + i.x + "," + i.y + ")";
252
+ }
253
+ t.attr("transform", a), O(r, e).style("opacity", 1).attr("transform", a);
254
+ }
255
+ function it(r, e, t, a) {
256
+ var n = r.x, i = r.y, o = n - a.x, s = i - a.y, d = Math.sqrt(e * e * s * s + t * t * o * o), u = Math.abs(e * t * o / d);
257
+ a.x < n && (u = -u);
258
+ var l = Math.abs(e * t * s / d);
259
+ return a.y < i && (l = -l), { x: n + u, y: i + l };
260
+ }
261
+ function te(r, e, t) {
262
+ return it(r, e, e, t);
263
+ }
264
+ function ee(r, e, t, a) {
265
+ var n, i, o, s, d, u, l, g, c, h, f, b, p, w, k;
266
+ if (n = e.y - r.y, o = r.x - e.x, d = e.x * r.y - r.x * e.y, c = n * t.x + o * t.y + d, h = n * a.x + o * a.y + d, !(c !== 0 && h !== 0 && K(c, h)) && (i = a.y - t.y, s = t.x - a.x, u = a.x * t.y - t.x * a.y, l = i * r.x + s * r.y + u, g = i * e.x + s * e.y + u, !(l !== 0 && g !== 0 && K(l, g)) && (f = n * s - i * o, f !== 0)))
267
+ return b = Math.abs(f / 2), p = o * u - s * d, w = p < 0 ? (p - b) / f : (p + b) / f, p = i * d - n * u, k = p < 0 ? (p - b) / f : (p + b) / f, { x: w, y: k };
268
+ }
269
+ function K(r, e) {
270
+ return r * e > 0;
271
+ }
272
+ function L(r, e, t) {
273
+ var a = r.x, n = r.y, i = [], o = Number.POSITIVE_INFINITY, s = Number.POSITIVE_INFINITY;
274
+ e.forEach(function(f) {
275
+ o = Math.min(o, f.x), s = Math.min(s, f.y);
276
+ });
277
+ for (var d = a - r.width / 2 - o, u = n - r.height / 2 - s, l = 0; l < e.length; l++) {
278
+ var g = e[l], c = e[l < e.length - 1 ? l + 1 : 0], h = ee(
279
+ r,
280
+ t,
281
+ { x: d + g.x, y: u + g.y },
282
+ { x: d + c.x, y: u + c.y }
283
+ );
284
+ h && i.push(h);
285
+ }
286
+ return i.length ? (i.length > 1 && i.sort(function(f, b) {
287
+ var p = f.x - t.x, w = f.y - t.y, k = Math.sqrt(p * p + w * w), T = b.x - t.x, S = b.y - t.y, y = Math.sqrt(T * T + S * S);
288
+ return k < y ? -1 : k === y ? 0 : 1;
289
+ }), i[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
290
+ }
291
+ function F(r, e) {
292
+ var t = r.x, a = r.y, n = e.x - t, i = e.y - a, o = r.width / 2, s = r.height / 2, d, u;
293
+ return Math.abs(i) * o > Math.abs(n) * s ? (i < 0 && (s = -s), d = i === 0 ? 0 : s * n / i, u = s) : (n < 0 && (o = -o), d = o, u = n === 0 ? 0 : o * i / n), { x: t + d, y: a + u };
294
+ }
295
+ var V = {
296
+ rect: ae,
297
+ ellipse: ne,
298
+ circle: ie,
299
+ diamond: oe
300
+ };
301
+ function re(r) {
302
+ V = r;
303
+ }
304
+ function ae(r, e, t) {
305
+ var a = r.insert("rect", ":first-child").attr("rx", t.rx).attr("ry", t.ry).attr("x", -e.width / 2).attr("y", -e.height / 2).attr("width", e.width).attr("height", e.height);
306
+ return t.intersect = function(n) {
307
+ return F(t, n);
308
+ }, a;
309
+ }
310
+ function ne(r, e, t) {
311
+ var a = e.width / 2, n = e.height / 2, i = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", a).attr("ry", n);
312
+ return t.intersect = function(o) {
313
+ return it(t, a, n, o);
314
+ }, i;
315
+ }
316
+ function ie(r, e, t) {
317
+ var a = Math.max(e.width, e.height) / 2, n = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", a);
318
+ return t.intersect = function(i) {
319
+ return te(t, a, i);
320
+ }, n;
321
+ }
322
+ function oe(r, e, t) {
323
+ var a = e.width * Math.SQRT2 / 2, n = e.height * Math.SQRT2 / 2, i = [
324
+ { x: 0, y: -n },
325
+ { x: -a, y: 0 },
326
+ { x: 0, y: n },
327
+ { x: a, y: 0 }
328
+ ], o = r.insert("polygon", ":first-child").attr(
329
+ "points",
330
+ i.map(function(s) {
331
+ return s.x + "," + s.y;
332
+ }).join(" ")
333
+ );
334
+ return t.intersect = function(s) {
335
+ return L(t, i, s);
336
+ }, o;
337
+ }
338
+ function se() {
339
+ var r = function(e, t) {
340
+ ce(t);
341
+ var a = E(e, "output"), n = E(a, "clusters"), i = E(a, "edgePaths"), o = Y(E(a, "edgeLabels"), t), s = X(E(a, "nodes"), t, V);
342
+ _t(t), Zt(s, t), Jt(o, t), q(i, t, W);
343
+ var d = z(n, t);
344
+ Qt(d, t), he(t);
345
+ };
346
+ return r.createNodes = function(e) {
347
+ return arguments.length ? (Kt(e), r) : X;
348
+ }, r.createClusters = function(e) {
349
+ return arguments.length ? (zt(e), r) : z;
350
+ }, r.createEdgeLabels = function(e) {
351
+ return arguments.length ? (Yt(e), r) : Y;
352
+ }, r.createEdgePaths = function(e) {
353
+ return arguments.length ? (qt(e), r) : q;
354
+ }, r.shapes = function(e) {
355
+ return arguments.length ? (re(e), r) : V;
356
+ }, r.arrows = function(e) {
357
+ return arguments.length ? (jt(e), r) : W;
358
+ }, r;
359
+ }
360
+ var le = {
361
+ paddingLeft: 10,
362
+ paddingRight: 10,
363
+ paddingTop: 10,
364
+ paddingBottom: 10,
365
+ rx: 0,
366
+ ry: 0,
367
+ shape: "rect"
368
+ }, de = {
369
+ arrowhead: "normal",
370
+ curve: C
371
+ };
372
+ function ce(r) {
373
+ r.nodes().forEach((e) => {
374
+ const t = r.node(e);
375
+ !Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && B(t, {
376
+ paddingLeft: t.paddingX,
377
+ paddingRight: t.paddingX
378
+ }), Object.prototype.hasOwnProperty.call(t, "paddingY") && B(t, {
379
+ paddingTop: t.paddingY,
380
+ paddingBottom: t.paddingY
381
+ }), Object.prototype.hasOwnProperty.call(t, "padding") && B(t, {
382
+ paddingLeft: t.padding,
383
+ paddingRight: t.padding,
384
+ paddingTop: t.padding,
385
+ paddingBottom: t.padding
386
+ }), B(t, le), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((a) => {
387
+ t[a] = Number(t[a]);
388
+ }), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
389
+ }), r.edges().forEach(function(e) {
390
+ var t = r.edge(e);
391
+ Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), B(t, de);
392
+ });
393
+ }
394
+ function he(r) {
395
+ r.nodes().forEach((e) => {
396
+ var t = r.node(e);
397
+ Object.prototype.hasOwnProperty.call(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, Object.prototype.hasOwnProperty.call(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
398
+ });
399
+ }
400
+ function E(r, e) {
401
+ var t = r.select("g." + e);
402
+ return t.empty() && (t = r.append("g").attr("class", e)), t;
403
+ }
404
+ function ot(r, e, t) {
405
+ const a = e.width, n = e.height, i = (a + n) * 0.9, o = [
406
+ { x: i / 2, y: 0 },
407
+ { x: i, y: -i / 2 },
408
+ { x: i / 2, y: -i },
409
+ { x: 0, y: -i / 2 }
410
+ ], s = I(r, i, i, o);
411
+ return t.intersect = function(d) {
412
+ return L(t, o, d);
413
+ }, s;
414
+ }
415
+ function st(r, e, t) {
416
+ const a = e.height, n = a / 4, i = e.width + 2 * n, o = [
417
+ { x: n, y: 0 },
418
+ { x: i - n, y: 0 },
419
+ { x: i, y: -a / 2 },
420
+ { x: i - n, y: -a },
421
+ { x: n, y: -a },
422
+ { x: 0, y: -a / 2 }
423
+ ], s = I(r, i, a, o);
424
+ return t.intersect = function(d) {
425
+ return L(t, o, d);
426
+ }, s;
427
+ }
428
+ function lt(r, e, t) {
429
+ const a = e.width, n = e.height, i = [
430
+ { x: -n / 2, y: 0 },
431
+ { x: a, y: 0 },
432
+ { x: a, y: -n },
433
+ { x: -n / 2, y: -n },
434
+ { x: 0, y: -n / 2 }
435
+ ], o = I(r, a, n, i);
436
+ return t.intersect = function(s) {
437
+ return L(t, i, s);
438
+ }, o;
439
+ }
440
+ function dt(r, e, t) {
441
+ const a = e.width, n = e.height, i = [
442
+ { x: -2 * n / 6, y: 0 },
443
+ { x: a - n / 6, y: 0 },
444
+ { x: a + 2 * n / 6, y: -n },
445
+ { x: n / 6, y: -n }
446
+ ], o = I(r, a, n, i);
447
+ return t.intersect = function(s) {
448
+ return L(t, i, s);
449
+ }, o;
450
+ }
451
+ function ct(r, e, t) {
452
+ const a = e.width, n = e.height, i = [
453
+ { x: 2 * n / 6, y: 0 },
454
+ { x: a + n / 6, y: 0 },
455
+ { x: a - 2 * n / 6, y: -n },
456
+ { x: -n / 6, y: -n }
457
+ ], o = I(r, a, n, i);
458
+ return t.intersect = function(s) {
459
+ return L(t, i, s);
460
+ }, o;
461
+ }
462
+ function ht(r, e, t) {
463
+ const a = e.width, n = e.height, i = [
464
+ { x: -2 * n / 6, y: 0 },
465
+ { x: a + 2 * n / 6, y: 0 },
466
+ { x: a - n / 6, y: -n },
467
+ { x: n / 6, y: -n }
468
+ ], o = I(r, a, n, i);
469
+ return t.intersect = function(s) {
470
+ return L(t, i, s);
471
+ }, o;
472
+ }
473
+ function ut(r, e, t) {
474
+ const a = e.width, n = e.height, i = [
475
+ { x: n / 6, y: 0 },
476
+ { x: a - n / 6, y: 0 },
477
+ { x: a + 2 * n / 6, y: -n },
478
+ { x: -2 * n / 6, y: -n }
479
+ ], o = I(r, a, n, i);
480
+ return t.intersect = function(s) {
481
+ return L(t, i, s);
482
+ }, o;
483
+ }
484
+ function pt(r, e, t) {
485
+ const a = e.width, n = e.height, i = [
486
+ { x: 0, y: 0 },
487
+ { x: a + n / 2, y: 0 },
488
+ { x: a, y: -n / 2 },
489
+ { x: a + n / 2, y: -n },
490
+ { x: 0, y: -n }
491
+ ], o = I(r, a, n, i);
492
+ return t.intersect = function(s) {
493
+ return L(t, i, s);
494
+ }, o;
495
+ }
496
+ function ft(r, e, t) {
497
+ const a = e.height, n = e.width + a / 4, i = r.insert("rect", ":first-child").attr("rx", a / 2).attr("ry", a / 2).attr("x", -n / 2).attr("y", -a / 2).attr("width", n).attr("height", a);
498
+ return t.intersect = function(o) {
499
+ return F(t, o);
500
+ }, i;
501
+ }
502
+ function gt(r, e, t) {
503
+ const a = e.width, n = e.height, i = [
504
+ { x: 0, y: 0 },
505
+ { x: a, y: 0 },
506
+ { x: a, y: -n },
507
+ { x: 0, y: -n },
508
+ { x: 0, y: 0 },
509
+ { x: -8, y: 0 },
510
+ { x: a + 8, y: 0 },
511
+ { x: a + 8, y: -n },
512
+ { x: -8, y: -n },
513
+ { x: -8, y: 0 }
514
+ ], o = I(r, a, n, i);
515
+ return t.intersect = function(s) {
516
+ return L(t, i, s);
517
+ }, o;
518
+ }
519
+ function yt(r, e, t) {
520
+ const a = e.width, n = a / 2, i = n / (2.5 + a / 50), o = e.height + i, s = "M 0," + i + " a " + n + "," + i + " 0,0,0 " + a + " 0 a " + n + "," + i + " 0,0,0 " + -a + " 0 l 0," + o + " a " + n + "," + i + " 0,0,0 " + a + " 0 l 0," + -o, d = r.attr("label-offset-y", i).insert("path", ":first-child").attr("d", s).attr("transform", "translate(" + -a / 2 + "," + -(o / 2 + i) + ")");
521
+ return t.intersect = function(u) {
522
+ const l = F(t, u), g = l.x - t.x;
523
+ if (n != 0 && (Math.abs(g) < t.width / 2 || Math.abs(g) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - i)) {
524
+ let c = i * i * (1 - g * g / (n * n));
525
+ c != 0 && (c = Math.sqrt(c)), c = i - c, u.y - t.y > 0 && (c = -c), l.y += c;
526
+ }
527
+ return l;
528
+ }, d;
529
+ }
530
+ function ue(r) {
531
+ r.shapes().question = ot, r.shapes().hexagon = st, r.shapes().stadium = ft, r.shapes().subroutine = gt, r.shapes().cylinder = yt, r.shapes().rect_left_inv_arrow = lt, r.shapes().lean_right = dt, r.shapes().lean_left = ct, r.shapes().trapezoid = ht, r.shapes().inv_trapezoid = ut, r.shapes().rect_right_inv_arrow = pt;
532
+ }
533
+ function pe(r) {
534
+ r({ question: ot }), r({ hexagon: st }), r({ stadium: ft }), r({ subroutine: gt }), r({ cylinder: yt }), r({ rect_left_inv_arrow: lt }), r({ lean_right: dt }), r({ lean_left: ct }), r({ trapezoid: ht }), r({ inv_trapezoid: ut }), r({ rect_right_inv_arrow: pt });
535
+ }
536
+ function I(r, e, t, a) {
537
+ return r.insert("polygon", ":first-child").attr(
538
+ "points",
539
+ a.map(function(n) {
540
+ return n.x + "," + n.y;
541
+ }).join(" ")
542
+ ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
543
+ }
544
+ const fe = {
545
+ addToRender: ue,
546
+ addToRenderV2: pe
547
+ }, wt = {}, ge = function(r) {
548
+ const e = Object.keys(r);
549
+ for (const t of e)
550
+ wt[t] = r[t];
551
+ }, bt = async function(r, e, t, a, n, i) {
552
+ const o = a ? a.select(`[id="${t}"]`) : x(`[id="${t}"]`), s = n || document, d = Object.keys(r);
553
+ for (const u of d) {
554
+ const l = r[u];
555
+ let g = "default";
556
+ l.classes.length > 0 && (g = l.classes.join(" "));
557
+ const c = U(l.styles);
558
+ let h = l.text !== void 0 ? l.text : l.id, f;
559
+ if (Q($().flowchart.htmlLabels)) {
560
+ const w = {
561
+ label: await J(
562
+ h.replace(
563
+ /fa[blrs]?:fa-[\w-]+/g,
564
+ // cspell:disable-line
565
+ (k) => `<i class='${k.replace(":", " ")}'></i>`
566
+ ),
567
+ $()
568
+ )
569
+ };
570
+ f = tt(o, w).node(), f.parentNode.removeChild(f);
571
+ } else {
572
+ const w = s.createElementNS("http://www.w3.org/2000/svg", "text");
573
+ w.setAttribute("style", c.labelStyle.replace("color:", "fill:"));
574
+ const k = h.split(Z.lineBreakRegex);
575
+ for (const T of k) {
576
+ const S = s.createElementNS("http://www.w3.org/2000/svg", "tspan");
577
+ S.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), S.setAttribute("dy", "1em"), S.setAttribute("x", "1"), S.textContent = T, w.appendChild(S);
578
+ }
579
+ f = w;
580
+ }
581
+ let b = 0, p = "";
582
+ switch (l.type) {
583
+ case "round":
584
+ b = 5, p = "rect";
585
+ break;
586
+ case "square":
587
+ p = "rect";
588
+ break;
589
+ case "diamond":
590
+ p = "question";
591
+ break;
592
+ case "hexagon":
593
+ p = "hexagon";
594
+ break;
595
+ case "odd":
596
+ p = "rect_left_inv_arrow";
597
+ break;
598
+ case "lean_right":
599
+ p = "lean_right";
600
+ break;
601
+ case "lean_left":
602
+ p = "lean_left";
603
+ break;
604
+ case "trapezoid":
605
+ p = "trapezoid";
606
+ break;
607
+ case "inv_trapezoid":
608
+ p = "inv_trapezoid";
609
+ break;
610
+ case "odd_right":
611
+ p = "rect_left_inv_arrow";
612
+ break;
613
+ case "circle":
614
+ p = "circle";
615
+ break;
616
+ case "ellipse":
617
+ p = "ellipse";
618
+ break;
619
+ case "stadium":
620
+ p = "stadium";
621
+ break;
622
+ case "subroutine":
623
+ p = "subroutine";
624
+ break;
625
+ case "cylinder":
626
+ p = "cylinder";
627
+ break;
628
+ case "group":
629
+ p = "rect";
630
+ break;
631
+ default:
632
+ p = "rect";
633
+ }
634
+ j.warn("Adding node", l.id, l.domId), e.setNode(i.db.lookUpDomId(l.id), {
635
+ labelType: "svg",
636
+ labelStyle: c.labelStyle,
637
+ shape: p,
638
+ label: f,
639
+ rx: b,
640
+ ry: b,
641
+ class: g,
642
+ style: c.style,
643
+ id: i.db.lookUpDomId(l.id)
644
+ });
645
+ }
646
+ }, xt = async function(r, e, t) {
647
+ let a = 0, n, i;
648
+ if (r.defaultStyle !== void 0) {
649
+ const o = U(r.defaultStyle);
650
+ n = o.style, i = o.labelStyle;
651
+ }
652
+ for (const o of r) {
653
+ a++;
654
+ const s = "L-" + o.start + "-" + o.end, d = "LS-" + o.start, u = "LE-" + o.end, l = {};
655
+ o.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
656
+ let g = "", c = "";
657
+ if (o.style !== void 0) {
658
+ const h = U(o.style);
659
+ g = h.style, c = h.labelStyle;
660
+ } else
661
+ switch (o.stroke) {
662
+ case "normal":
663
+ g = "fill:none", n !== void 0 && (g = n), i !== void 0 && (c = i);
664
+ break;
665
+ case "dotted":
666
+ g = "fill:none;stroke-width:2px;stroke-dasharray:3;";
667
+ break;
668
+ case "thick":
669
+ g = " stroke-width: 3.5px;fill:none";
670
+ break;
671
+ }
672
+ l.style = g, l.labelStyle = c, o.interpolate !== void 0 ? l.curve = R(o.interpolate, C) : r.defaultInterpolate !== void 0 ? l.curve = R(r.defaultInterpolate, C) : l.curve = R(wt.curve, C), o.text === void 0 ? o.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", Q($().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${s}" class="edgeLabel L-${d}' L-${u}" style="${l.labelStyle}">${await J(
673
+ o.text.replace(
674
+ /fa[blrs]?:fa-[\w-]+/g,
675
+ // cspell:disable-line
676
+ (h) => `<i class='${h.replace(":", " ")}'></i>`
677
+ ),
678
+ $()
679
+ )}</span>`) : (l.labelType = "text", l.label = o.text.replace(Z.lineBreakRegex, `
680
+ `), o.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = s, l.class = d + " " + u, l.minlen = o.length || 1, e.setEdge(t.db.lookUpDomId(o.start), t.db.lookUpDomId(o.end), l, a);
681
+ }
682
+ }, ye = function(r, e) {
683
+ return j.info("Extracting classes"), e.db.getClasses();
684
+ }, we = async function(r, e, t, a) {
685
+ j.info("Drawing flowchart");
686
+ const { securityLevel: n, flowchart: i } = $();
687
+ let o;
688
+ n === "sandbox" && (o = x("#i" + e));
689
+ const s = n === "sandbox" ? x(o.nodes()[0].contentDocument.body) : x("body"), d = n === "sandbox" ? o.nodes()[0].contentDocument : document;
690
+ let u = a.db.getDirection();
691
+ u === void 0 && (u = "TD");
692
+ const l = i.nodeSpacing || 50, g = i.rankSpacing || 50, c = new St({
693
+ multigraph: !0,
694
+ compound: !0
695
+ }).setGraph({
696
+ rankdir: u,
697
+ nodesep: l,
698
+ ranksep: g,
699
+ marginx: 8,
700
+ marginy: 8
701
+ }).setDefaultEdgeLabel(function() {
702
+ return {};
703
+ });
704
+ let h;
705
+ const f = a.db.getSubGraphs();
706
+ for (let y = f.length - 1; y >= 0; y--)
707
+ h = f[y], a.db.addVertex(h.id, h.title, "group", void 0, h.classes);
708
+ const b = a.db.getVertices();
709
+ j.warn("Get vertices", b);
710
+ const p = a.db.getEdges();
711
+ let w = 0;
712
+ for (w = f.length - 1; w >= 0; w--) {
713
+ h = f[w], Mt("cluster").append("text");
714
+ for (let y = 0; y < h.nodes.length; y++)
715
+ j.warn(
716
+ "Setting subgraph",
717
+ h.nodes[y],
718
+ a.db.lookUpDomId(h.nodes[y]),
719
+ a.db.lookUpDomId(h.id)
720
+ ), c.setParent(a.db.lookUpDomId(h.nodes[y]), a.db.lookUpDomId(h.id));
721
+ }
722
+ await bt(b, c, e, s, d, a), await xt(p, c, a);
723
+ const k = new se();
724
+ fe.addToRender(k), k.arrows().none = function(y, v, _, m) {
725
+ const M = y.append("marker").attr("id", v).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 0 0 L 0 0 z");
726
+ A(M, _[m + "Style"]);
727
+ }, k.arrows().normal = function(y, v) {
728
+ y.append("marker").attr("id", v).attr("viewBox", "0 0 10 10").attr("refX", 9).attr("refY", 5).attr("markerUnits", "strokeWidth").attr("markerWidth", 8).attr("markerHeight", 6).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowheadPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
729
+ };
730
+ const T = s.select(`[id="${e}"]`), S = s.select("#" + e + " g");
731
+ for (k(S, c), S.selectAll("g.node").attr("title", function() {
732
+ return a.db.getTooltip(this.id);
733
+ }), a.db.indexNodes("subGraph" + w), w = 0; w < f.length; w++)
734
+ if (h = f[w], h.title !== "undefined") {
735
+ const y = d.querySelectorAll(
736
+ "#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"] rect'
737
+ ), v = d.querySelectorAll(
738
+ "#" + e + ' [id="' + a.db.lookUpDomId(h.id) + '"]'
739
+ ), _ = y[0].x.baseVal.value, m = y[0].y.baseVal.value, M = y[0].width.baseVal.value, N = x(v[0]).select(".label");
740
+ N.attr("transform", `translate(${_ + M / 2}, ${m + 14})`), N.attr("id", e + "Text");
741
+ for (let P = 0; P < h.classes.length; P++)
742
+ v[0].classList.add(h.classes[P]);
743
+ }
744
+ if (!i.htmlLabels) {
745
+ const y = d.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
746
+ for (const v of y) {
747
+ const _ = v.getBBox(), m = d.createElementNS("http://www.w3.org/2000/svg", "rect");
748
+ m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", _.width), m.setAttribute("height", _.height), v.insertBefore(m, v.firstChild);
749
+ }
750
+ }
751
+ mt(c, T, i.diagramPadding, i.useMaxWidth), Object.keys(b).forEach(function(y) {
752
+ const v = b[y];
753
+ if (v.link) {
754
+ const _ = s.select("#" + e + ' [id="' + a.db.lookUpDomId(y) + '"]');
755
+ if (_) {
756
+ const m = d.createElementNS("http://www.w3.org/2000/svg", "a");
757
+ m.setAttributeNS("http://www.w3.org/2000/svg", "class", v.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", v.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), n === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : v.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", v.linkTarget);
758
+ const M = _.insert(function() {
759
+ return m;
760
+ }, ":first-child"), N = _.select(".label-container");
761
+ N && M.append(function() {
762
+ return N.node();
763
+ });
764
+ const P = _.select(".label");
765
+ P && M.append(function() {
766
+ return P.node();
767
+ });
768
+ }
769
+ }
770
+ });
771
+ }, be = {
772
+ setConf: ge,
773
+ addVertices: bt,
774
+ addEdges: xt,
775
+ getClasses: ye,
776
+ draw: we
777
+ }, _e = {
778
+ parser: vt,
779
+ db: D,
780
+ renderer: Tt,
781
+ styles: It,
782
+ init: (r) => {
783
+ r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, be.setConf(r.flowchart), D.clear(), D.setGen("gen-1");
784
+ }
785
+ };
786
+ export {
787
+ _e as diagram
788
+ };