@layers-app/editor 0.0.21 → 0.0.23

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 (242) hide show
  1. package/README.md +47 -2
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +195 -2
  4. package/dist/index.js +2 -2
  5. package/dist/layers.-RxAm5pH.js +795 -0
  6. package/dist/layers.-rS-aTo2.js +33 -0
  7. package/dist/layers.2ODaB2Pd.js +8 -0
  8. package/dist/layers.5BbX0Xoz.js +769 -0
  9. package/dist/layers.7JqFgE4-.js +15 -0
  10. package/dist/layers.9QK1wiQj.js +1 -0
  11. package/dist/layers.9pNaFvaX.js +1 -0
  12. package/dist/layers.B-6oGNjd.js +40 -0
  13. package/dist/layers.B-ie1_cm.js +6 -0
  14. package/dist/layers.B0EkntbT.js +32 -0
  15. package/dist/layers.B0pdr1hX.js +1619 -0
  16. package/dist/layers.B19hGmey.js +1 -0
  17. package/dist/layers.B39TZ2WV.js +11 -0
  18. package/dist/layers.B3odqoHb.js +9 -0
  19. package/dist/layers.B64g6Zx2.js +1 -0
  20. package/dist/layers.B6UkAKu5.js +434 -0
  21. package/dist/layers.B8i9d7Qz.js +192 -0
  22. package/dist/layers.B9NSFeaj.js +35 -0
  23. package/dist/layers.B9zrmkst.js +11 -0
  24. package/dist/layers.BAtv1CM7.js +1 -0
  25. package/dist/layers.BBB7YGK1.js +3 -0
  26. package/dist/layers.BBU3ik5q.js +51 -0
  27. package/dist/layers.BBwDvE6l.js +9122 -0
  28. package/dist/layers.BCFHxkpM.js +6 -0
  29. package/dist/layers.BD5uUnI2.js +1265 -0
  30. package/dist/layers.BDhuxbhX.js +44 -0
  31. package/dist/layers.BDxQSquK.js +10 -0
  32. package/dist/layers.BEE5yqs5.js +9 -0
  33. package/dist/layers.BFLg4UGe.js +8 -0
  34. package/dist/layers.BFOl7cA-.js +41 -0
  35. package/dist/layers.BHDiP2sq.js +21836 -0
  36. package/dist/layers.BIDnkNut.js +1510 -0
  37. package/dist/layers.BIVmclKv.js +41 -0
  38. package/dist/layers.BIeVwYKL.js +1 -0
  39. package/dist/layers.BJMMuP5r.js +9 -0
  40. package/dist/layers.BK01wvsE.js +10 -0
  41. package/dist/layers.BLB-feoT.js +8 -0
  42. package/dist/layers.BLSqqbWP.js +207 -0
  43. package/dist/layers.BO3dqWyO.js +10 -0
  44. package/dist/layers.BPe9NQzP.js +2963 -0
  45. package/dist/layers.BPnpanwd.js +39 -0
  46. package/dist/layers.BQLZhz6B.js +6 -0
  47. package/dist/layers.BST6tR9a.js +4 -0
  48. package/dist/layers.BSTBZrFn.js +1 -0
  49. package/dist/layers.BUSnd1Ro.js +5 -0
  50. package/dist/layers.BUkDq4ln.js +84 -0
  51. package/dist/layers.BUsBCyiL.js +202 -0
  52. package/dist/layers.BXGiOI1Z.js +7 -0
  53. package/dist/layers.BYVHkqLR.js +39 -0
  54. package/dist/layers.BYzN4Zxz.js +7 -0
  55. package/dist/layers.BZcZF6Ct.js +41 -0
  56. package/dist/layers.B_Hf0SF-.js +1359 -0
  57. package/dist/{layers.BYmCD0mp.js → layers.Ba97nTEK.js} +1 -1
  58. package/dist/layers.Bbl6qitU.js +40 -0
  59. package/dist/layers.BdanmQPF.js +11 -0
  60. package/dist/layers.Bfd5bOAD.js +37 -0
  61. package/dist/layers.BhM2iCwB.js +5 -0
  62. package/dist/layers.BjZInKjA.js +2 -0
  63. package/dist/layers.Bk2PdkMX.js +10 -0
  64. package/dist/layers.BkMfeJ9R.js +41 -0
  65. package/dist/layers.BkjjkAwW.js +2 -0
  66. package/dist/layers.Blho0qwc.js +1 -0
  67. package/dist/layers.BoabOlrX.js +36 -0
  68. package/dist/layers.BpXiFzvR.js +36 -0
  69. package/dist/layers.BpilXLfW.js +6 -0
  70. package/dist/layers.BuQ1nJmP.js +1 -0
  71. package/dist/layers.Bv0tGvGl.js +40 -0
  72. package/dist/layers.BvZFIFgz.js +9 -0
  73. package/dist/layers.BwfB_nzW.js +8 -0
  74. package/dist/layers.Bwpn7zKE.js +9 -0
  75. package/dist/layers.Bz0ApNUe.js +70 -0
  76. package/dist/layers.C-G7-Jg3.js +7 -0
  77. package/dist/layers.C0bumYdC.js +7 -0
  78. package/dist/layers.C1KhBpGU.js +7 -0
  79. package/dist/layers.C3K_Whht.js +42 -0
  80. package/dist/layers.C51kZnWr.js +37 -0
  81. package/dist/layers.C5rttXXy.js +10 -0
  82. package/dist/{layers.CKC0lJDn.js → layers.C5uR7AiN.js} +1 -1
  83. package/dist/layers.C6Rn8zoI.js +42 -0
  84. package/dist/layers.C7lIplJU.js +247 -0
  85. package/dist/layers.CBXpUMze.js +96 -0
  86. package/dist/layers.CCRe_IA7.js +36 -0
  87. package/dist/{layers.CFJiIrku.js → layers.CClfR9Rs.js} +14180 -12682
  88. package/dist/layers.CDLdte-o.js +9 -0
  89. package/dist/layers.CDzPpnhN.js +52 -0
  90. package/dist/layers.CEXVJbhn.js +8 -0
  91. package/dist/layers.CGX7Piy7.js +1 -0
  92. package/dist/layers.CGc04km7.js +42 -0
  93. package/dist/layers.CH23k4XD.js +6 -0
  94. package/dist/layers.CHHqQlm1.js +9 -0
  95. package/dist/layers.CHZsXQcr.js +1 -0
  96. package/dist/layers.CMS1o_sE.js +40 -0
  97. package/dist/layers.CO4NHmK3.js +40 -0
  98. package/dist/layers.COAF7f8g.js +1 -0
  99. package/dist/layers.CPV5PaJ7.js +33 -0
  100. package/dist/layers.CPqqkX8Z.js +23 -0
  101. package/dist/layers.CQXDzk5h.js +1 -0
  102. package/dist/layers.CQv0GMRl.js +1 -0
  103. package/dist/layers.CR10RAJi.js +116 -0
  104. package/dist/layers.CR4riLSc.js +2235 -0
  105. package/dist/layers.CSjWzlk9.js +1 -0
  106. package/dist/layers.CTmkjIN6.js +5 -0
  107. package/dist/layers.CZMy0ug4.js +6 -0
  108. package/dist/layers.CZh7NZyl.js +42 -0
  109. package/dist/layers.C_dOgKfE.js +10 -0
  110. package/dist/layers.CcJ28sUd.js +9 -0
  111. package/dist/layers.CeMe5scF.js +1 -0
  112. package/dist/layers.CeVpKhli.js +122 -0
  113. package/dist/layers.Ch7C0MR9.js +39 -0
  114. package/dist/layers.ChAMqLmE.js +160 -0
  115. package/dist/layers.ChJyurjQ.js +7 -0
  116. package/dist/layers.ChPHYv68.js +41 -0
  117. package/dist/layers.ChykDTOy.js +11 -0
  118. package/dist/layers.Ci0QS82_.js +1 -0
  119. package/dist/layers.Ci0x4aAi.js +139 -0
  120. package/dist/layers.CiNAQOA-.js +50 -0
  121. package/dist/layers.Ck0iJfoW.js +39 -0
  122. package/dist/layers.Ckbp-T9r.js +32 -0
  123. package/dist/layers.Cl9Tl2nd.js +1 -0
  124. package/dist/layers.ClQj75nc.js +11 -0
  125. package/dist/layers.ClaqpFnu.js +233 -0
  126. package/dist/layers.CmHSmrZm.js +40 -0
  127. package/dist/layers.Cn6OfRlw.js +40 -0
  128. package/dist/layers.CnD3z0eZ.js +8 -0
  129. package/dist/layers.CnloMtKN.js +268 -0
  130. package/dist/layers.Cp82yltX.js +32 -0
  131. package/dist/layers.CphCG076.js +6 -0
  132. package/dist/layers.CqM3rL4-.js +5 -0
  133. package/dist/layers.CqVTtuYm.js +6 -0
  134. package/dist/layers.CvJxfPxo.js +9 -0
  135. package/dist/layers.CwPFdFUT.js +34 -0
  136. package/dist/layers.Cx14IKzN.js +4 -0
  137. package/dist/layers.Cxmncz59.js +32 -0
  138. package/dist/layers.D-ZYFolm.js +1 -0
  139. package/dist/layers.D0zn4_Mx.js +1 -0
  140. package/dist/layers.D18RSmmQ.js +7 -0
  141. package/dist/layers.D1cZq8tq.js +373 -0
  142. package/dist/layers.D2q8ZYi2.js +425 -0
  143. package/dist/layers.D2vOkfMK.js +38 -0
  144. package/dist/layers.D3Hkinja.js +5 -0
  145. package/dist/layers.D4fGb2cV.js +1272 -0
  146. package/dist/layers.D68FZk66.js +39 -0
  147. package/dist/layers.D7HvMBb6.js +39 -0
  148. package/dist/layers.D7jGxypv.js +8 -0
  149. package/dist/layers.D90-hSDT.js +4 -0
  150. package/dist/layers.D9A031XO.js +803 -0
  151. package/dist/layers.DARK07JA.js +42 -0
  152. package/dist/layers.DAx0hT2g.js +32 -0
  153. package/dist/layers.DCvUAfE1.js +40 -0
  154. package/dist/layers.DDRgaMwu.js +10 -0
  155. package/dist/layers.DEfJs03Z.js +1 -0
  156. package/dist/layers.DElpVOY-.js +8 -0
  157. package/dist/layers.DFd9A85i.js +14 -0
  158. package/dist/layers.DGZUGztZ.js +220 -0
  159. package/dist/layers.DHbdkCCU.js +38 -0
  160. package/dist/layers.DIrkcLlA.js +790 -0
  161. package/dist/layers.DKPzrygv.js +1 -0
  162. package/dist/layers.DK_t52oS.js +1126 -0
  163. package/dist/layers.DLwuMfdd.js +84 -0
  164. package/dist/layers.DMkBISW1.js +1 -0
  165. package/dist/layers.DMvWe0pJ.js +7 -0
  166. package/dist/layers.DN9HoVxI.js +18 -0
  167. package/dist/layers.DO-G3uLL.js +8 -0
  168. package/dist/layers.DOrgOHBr.js +1 -0
  169. package/dist/layers.DQCPMqIN.js +9 -0
  170. package/dist/layers.DTDpNGfk.js +1 -0
  171. package/dist/layers.DXTPaWjN.js +37 -0
  172. package/dist/layers.DXaSAlDN.js +13 -0
  173. package/dist/layers.DYx3Ot6h.js +139 -0
  174. package/dist/layers.D_MU5WlI.js +40 -0
  175. package/dist/layers.DalYdEkL.js +19 -0
  176. package/dist/layers.DbaKVP5e.js +1 -0
  177. package/dist/layers.Dbuivk7d.js +36 -0
  178. package/dist/layers.DdTLZZKb.js +48146 -0
  179. package/dist/layers.DeB3waPT.js +8 -0
  180. package/dist/layers.Dg8Wbn90.js +35 -0
  181. package/dist/layers.DhiFm4jW.js +10 -0
  182. package/dist/layers.DhzTwBn5.js +37 -0
  183. package/dist/layers.DjUOC4st.js +16 -0
  184. package/dist/layers.Dk9dbz6F.js +118 -0
  185. package/dist/layers.Dklz2JqP.js +41 -0
  186. package/dist/layers.Dol0x5Jd.js +61 -0
  187. package/dist/layers.DrtkQKK7.js +1 -0
  188. package/dist/layers.Ds95POLS.js +1 -0
  189. package/dist/layers.DsAtBUs-.js +1283 -0
  190. package/dist/layers.DtoCH9Nn.js +1 -0
  191. package/dist/layers.DwLw5o0M.js +38 -0
  192. package/dist/layers.DxA6ocdw.js +70 -0
  193. package/dist/layers.DxGDxkXA.js +164 -0
  194. package/dist/layers.Dxrm0nEM.js +2479 -0
  195. package/dist/layers.Dy1naDTQ.js +14 -0
  196. package/dist/layers.Dyor8Hot.js +186 -0
  197. package/dist/layers.Dyqg_e4P.js +41 -0
  198. package/dist/layers.DzaH7mDC.js +65 -0
  199. package/dist/layers.Dzc83sE7.js +1 -0
  200. package/dist/layers.FstVqdQC.js +804 -0
  201. package/dist/layers.HcI9cOEd.js +1089 -0
  202. package/dist/layers.I-MG0ir4.js +21461 -0
  203. package/dist/layers.I5-pSyca.js +1 -0
  204. package/dist/layers.JWCLFILJ.js +1 -0
  205. package/dist/layers.LOjND5R4.js +320 -0
  206. package/dist/{layers.BKFthpnI.js → layers.L_XjkGw6.js} +24 -24
  207. package/dist/layers.Lhl12ohc.js +1 -0
  208. package/dist/layers.N4wL2Xyj.js +1083 -0
  209. package/dist/layers.OEP2K3db.js +4 -0
  210. package/dist/layers.PO65UmTA.js +10 -0
  211. package/dist/layers.PhLwHKUM.js +40 -0
  212. package/dist/layers.Tatx7z0m.js +55 -0
  213. package/dist/layers.UbqG2dp_.js +10 -0
  214. package/dist/layers.WsdOSV4y.js +2 -0
  215. package/dist/{layers.C99LCymA.js → layers.Y41CVpLS.js} +70 -70
  216. package/dist/layers.Ym7pRGM7.js +84 -0
  217. package/dist/layers.b0h5ZBmD.js +61 -0
  218. package/dist/layers.c_QDfgff.js +257 -0
  219. package/dist/layers.cp645rbn.js +7 -0
  220. package/dist/layers.dqI-yLmM.js +41 -0
  221. package/dist/layers.fTcEk1do.js +261 -0
  222. package/dist/layers.gRKbOYG-.js +960 -0
  223. package/dist/layers.gaT5_-NN.js +32 -0
  224. package/dist/layers.gzGcAwbO.js +904 -0
  225. package/dist/layers.h0tSRttU.js +1 -0
  226. package/dist/layers.hkFN-BS0.js +39 -0
  227. package/dist/layers.iw01AOuQ.js +931 -0
  228. package/dist/layers.k2UyvrHI.js +35 -0
  229. package/dist/layers.kY3ZYtED.js +1 -0
  230. package/dist/layers.kthR742N.js +39 -0
  231. package/dist/layers.lCpg7dOn.js +21 -0
  232. package/dist/layers.lLRqycMO.js +39 -0
  233. package/dist/layers.oFAtdeQ1.js +501 -0
  234. package/dist/layers.p9hSNB6N.js +1 -0
  235. package/dist/layers.paz6tc0L.js +1034 -0
  236. package/dist/layers.rRMBW9ET.js +1580 -0
  237. package/dist/layers.tbRLuldN.js +1 -0
  238. package/dist/layers.x6Qk2Mwl.js +8 -0
  239. package/dist/layers.x6ioP3u0.js +423 -0
  240. package/dist/layers.za1sylgg.js +11692 -0
  241. package/package.json +6 -5
  242. package/dist/layers.F7W7VvW1.js +0 -164
@@ -0,0 +1,790 @@
1
+ import { f as W, p as kt } from "./layers.DK_t52oS.js";
2
+ import { G as St } from "./layers.C7lIplJU.js";
3
+ import { d as b, a0 as P, l as D, g as R, Y as Lt, _ as z, $ as V, t as j, V as tt, j as et } from "./layers.BBwDvE6l.js";
4
+ import * as y from "lodash-es";
5
+ import { l as _t } from "./layers.D4fGb2cV.js";
6
+ import { b as N, c as rt, i as at, d as E, e as nt, g as st, f as Et, a as Tt, s as Nt } from "./layers.B6UkAKu5.js";
7
+ import { l as At } from "./layers.-rS-aTo2.js";
8
+ import "./layers.I-MG0ir4.js";
9
+ function Ct(r) {
10
+ if (!r.ok) throw new Error(r.status + " " + r.statusText);
11
+ return r.text();
12
+ }
13
+ function It(r, e) {
14
+ return fetch(r, e).then(Ct);
15
+ }
16
+ function Bt(r) {
17
+ return (e, t) => It(e, t).then((n) => new DOMParser().parseFromString(n, r));
18
+ }
19
+ var Mt = Bt("image/svg+xml"), Y = {
20
+ normal: Rt,
21
+ vee: Gt,
22
+ undirected: Pt
23
+ };
24
+ function Dt(r) {
25
+ Y = r;
26
+ }
27
+ function Rt(r, e, t, n) {
28
+ var a = 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"), s = a.append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
29
+ N(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
30
+ }
31
+ function Gt(r, e, t, n) {
32
+ var a = 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"), s = a.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");
33
+ N(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
34
+ }
35
+ function Pt(r, e, t, n) {
36
+ var a = 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"), s = a.append("path").attr("d", "M 0 5 L 10 5").style("stroke-width", 1).style("stroke-dasharray", "1,0");
37
+ N(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
38
+ }
39
+ function Ut(r, e) {
40
+ var t = r;
41
+ return t.node().appendChild(e.label), N(t, e.labelStyle), t;
42
+ }
43
+ function $t(r, e) {
44
+ for (var t = r.append("text"), n = Wt(e.label).split(`
45
+ `), a = 0; a < n.length; a++)
46
+ t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
47
+ return N(t, e.labelStyle), t;
48
+ }
49
+ function Wt(r) {
50
+ for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
51
+ if (n = r[a], t) {
52
+ switch (n) {
53
+ case "n":
54
+ e += `
55
+ `;
56
+ break;
57
+ default:
58
+ e += n;
59
+ }
60
+ t = !1;
61
+ } else n === "\\" ? t = !0 : e += n;
62
+ return e;
63
+ }
64
+ function K(r, e, t) {
65
+ var n = e.label, a = r.append("g");
66
+ e.labelType === "svg" ? Ut(a, e) : typeof n != "string" || e.labelType === "html" ? rt(a, e) : $t(a, e);
67
+ var s = a.node().getBBox(), i;
68
+ switch (t) {
69
+ case "top":
70
+ i = -e.height / 2;
71
+ break;
72
+ case "bottom":
73
+ i = e.height / 2 - s.height;
74
+ break;
75
+ default:
76
+ i = -s.height / 2;
77
+ }
78
+ return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
79
+ }
80
+ var H = function(r, e) {
81
+ var t = e.nodes().filter(function(s) {
82
+ return at(e, s);
83
+ }), n = r.selectAll("g.cluster").data(t, function(s) {
84
+ return s;
85
+ });
86
+ E(n.exit(), e).style("opacity", 0).remove();
87
+ var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
88
+ var i = e.node(s);
89
+ return i.id;
90
+ }).style("opacity", 0).each(function(s) {
91
+ var i = e.node(s), o = b(this);
92
+ b(this).append("rect");
93
+ var c = o.append("g").attr("class", "label");
94
+ K(c, i, i.clusterLabelPos);
95
+ });
96
+ return n = n.merge(a), n = E(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
97
+ var i = e.node(s), o = b(this);
98
+ N(o, i.style);
99
+ }), n;
100
+ };
101
+ function Vt(r) {
102
+ H = r;
103
+ }
104
+ let X = function(r, e) {
105
+ var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
106
+ return nt(a);
107
+ }).classed("update", !0);
108
+ t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
109
+ var s = b(this);
110
+ s.select(".label").remove();
111
+ var i = e.edge(a), o = K(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
112
+ i.labelId && o.attr("id", i.labelId), y.has(i, "width") || (i.width = c.width), y.has(i, "height") || (i.height = c.height);
113
+ });
114
+ var n;
115
+ return t.exit ? n = t.exit() : n = t.selectAll(null), E(n, e).style("opacity", 0).remove(), t;
116
+ };
117
+ function zt(r) {
118
+ X = r;
119
+ }
120
+ function Z(r, e) {
121
+ return r.intersect(e);
122
+ }
123
+ var F = function(r, e, t) {
124
+ var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
125
+ return nt(i);
126
+ }).classed("update", !0), a = qt(n, e);
127
+ Qt(n, e);
128
+ var s = n.merge !== void 0 ? n.merge(a) : n;
129
+ return E(s, e).style("opacity", 1), s.each(function(i) {
130
+ var o = b(this), c = e.edge(i);
131
+ c.elem = this, c.id && o.attr("id", c.id), st(
132
+ o,
133
+ c.class,
134
+ (o.classed("update") ? "update " : "") + "edgePath"
135
+ );
136
+ }), s.selectAll("path.path").each(function(i) {
137
+ var o = e.edge(i);
138
+ o.arrowheadId = y.uniqueId("arrowhead");
139
+ var c = b(this).attr("marker-end", function() {
140
+ return "url(" + Ht(location.href, o.arrowheadId) + ")";
141
+ }).style("fill", "none");
142
+ E(c, e).attr("d", function(d) {
143
+ return Xt(e, d);
144
+ }), N(c, o.style);
145
+ }), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
146
+ var o = e.edge(i), c = t[o.arrowhead];
147
+ c(b(this), o.arrowheadId, o, "arrowhead");
148
+ }), s;
149
+ };
150
+ function Yt(r) {
151
+ F = r;
152
+ }
153
+ function Ht(r, e) {
154
+ var t = r.split("#")[0];
155
+ return t + "#" + e;
156
+ }
157
+ function Xt(r, e) {
158
+ var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
159
+ return s.unshift(Z(n, s[0])), s.push(Z(a, s[s.length - 1])), it(t, s);
160
+ }
161
+ function it(r, e) {
162
+ var t = (At || Mt.line)().x(function(n) {
163
+ return n.x;
164
+ }).y(function(n) {
165
+ return n.y;
166
+ });
167
+ return (t.curve || t.interpolate)(r.curve), t(e);
168
+ }
169
+ function Ft(r) {
170
+ var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
171
+ return { x: t.e, y: t.f };
172
+ }
173
+ function qt(r, e) {
174
+ var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
175
+ return t.append("path").attr("class", "path").attr("d", function(n) {
176
+ var a = e.edge(n), s = e.node(n.v).elem, i = y.range(a.points.length).map(function() {
177
+ return Ft(s);
178
+ });
179
+ return it(a, i);
180
+ }), t.append("defs"), t;
181
+ }
182
+ function Qt(r, e) {
183
+ var t = r.exit();
184
+ E(t, e).style("opacity", 0).remove();
185
+ }
186
+ var q = function(r, e, t) {
187
+ var n = e.nodes().filter(function(i) {
188
+ return !at(e, i);
189
+ }), a = r.selectAll("g.node").data(n, function(i) {
190
+ return i;
191
+ }).classed("update", !0);
192
+ a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
193
+ var o = e.node(i), c = b(this);
194
+ st(
195
+ c,
196
+ o.class,
197
+ (c.classed("update") ? "update " : "") + "node"
198
+ ), c.select("g.label").remove();
199
+ var d = c.append("g").attr("class", "label"), l = K(d, o), g = t[o.shape], h = y.pick(l.node().getBBox(), "width", "height");
200
+ o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId), y.has(o, "width") && (h.width = o.width), y.has(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
201
+ "transform",
202
+ "translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
203
+ );
204
+ var u = b(this);
205
+ u.select(".label-container").remove();
206
+ var p = g(u, h, o).classed("label-container", !0);
207
+ N(p, o.style);
208
+ var w = p.node().getBBox();
209
+ o.width = w.width, o.height = w.height;
210
+ });
211
+ var s;
212
+ return a.exit ? s = a.exit() : s = a.selectAll(null), E(s, e).style("opacity", 0).remove(), a;
213
+ };
214
+ function Kt(r) {
215
+ q = r;
216
+ }
217
+ function Jt(r, e) {
218
+ var t = r.filter(function() {
219
+ return !b(this).classed("update");
220
+ });
221
+ function n(a) {
222
+ var s = e.node(a);
223
+ return "translate(" + s.x + "," + s.y + ")";
224
+ }
225
+ t.attr("transform", n), E(r, e).style("opacity", 1).attr("transform", n), E(t.selectAll("rect"), e).attr("width", function(a) {
226
+ return e.node(a).width;
227
+ }).attr("height", function(a) {
228
+ return e.node(a).height;
229
+ }).attr("x", function(a) {
230
+ var s = e.node(a);
231
+ return -s.width / 2;
232
+ }).attr("y", function(a) {
233
+ var s = e.node(a);
234
+ return -s.height / 2;
235
+ });
236
+ }
237
+ function Zt(r, e) {
238
+ var t = r.filter(function() {
239
+ return !b(this).classed("update");
240
+ });
241
+ function n(a) {
242
+ var s = e.edge(a);
243
+ return y.has(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
244
+ }
245
+ t.attr("transform", n), E(r, e).style("opacity", 1).attr("transform", n);
246
+ }
247
+ function Ot(r, e) {
248
+ var t = r.filter(function() {
249
+ return !b(this).classed("update");
250
+ });
251
+ function n(a) {
252
+ var s = e.node(a);
253
+ return "translate(" + s.x + "," + s.y + ")";
254
+ }
255
+ t.attr("transform", n), E(r, e).style("opacity", 1).attr("transform", n);
256
+ }
257
+ function ot(r, e, t, n) {
258
+ var a = r.x, s = r.y, i = a - n.x, o = s - n.y, c = Math.sqrt(e * e * o * o + t * t * i * i), d = Math.abs(e * t * i / c);
259
+ n.x < a && (d = -d);
260
+ var l = Math.abs(e * t * o / c);
261
+ return n.y < s && (l = -l), { x: a + d, y: s + l };
262
+ }
263
+ function jt(r, e, t) {
264
+ return ot(r, e, e, t);
265
+ }
266
+ function te(r, e, t, n) {
267
+ var a, s, i, o, c, d, l, g, h, u, p, w, f, v, S;
268
+ if (a = e.y - r.y, i = r.x - e.x, c = e.x * r.y - r.x * e.y, h = a * t.x + i * t.y + c, u = a * n.x + i * n.y + c, !(h !== 0 && u !== 0 && O(h, u)) && (s = n.y - t.y, o = t.x - n.x, d = n.x * t.y - t.x * n.y, l = s * r.x + o * r.y + d, g = s * e.x + o * e.y + d, !(l !== 0 && g !== 0 && O(l, g)) && (p = a * o - s * i, p !== 0)))
269
+ return w = Math.abs(p / 2), f = i * d - o * c, v = f < 0 ? (f - w) / p : (f + w) / p, f = s * c - a * d, S = f < 0 ? (f - w) / p : (f + w) / p, { x: v, y: S };
270
+ }
271
+ function O(r, e) {
272
+ return r * e > 0;
273
+ }
274
+ function T(r, e, t) {
275
+ var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
276
+ e.forEach(function(p) {
277
+ i = Math.min(i, p.x), o = Math.min(o, p.y);
278
+ });
279
+ for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
280
+ var g = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = te(
281
+ r,
282
+ t,
283
+ { x: c + g.x, y: d + g.y },
284
+ { x: c + h.x, y: d + h.y }
285
+ );
286
+ u && s.push(u);
287
+ }
288
+ return s.length ? (s.length > 1 && s.sort(function(p, w) {
289
+ var f = p.x - t.x, v = p.y - t.y, S = Math.sqrt(f * f + v * v), I = w.x - t.x, _ = w.y - t.y, U = Math.sqrt(I * I + _ * _);
290
+ return S < U ? -1 : S === U ? 0 : 1;
291
+ }), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
292
+ }
293
+ function J(r, e) {
294
+ var t = r.x, n = r.y, a = e.x - t, s = e.y - n, i = r.width / 2, o = r.height / 2, c, d;
295
+ return Math.abs(s) * i > Math.abs(a) * o ? (s < 0 && (o = -o), c = s === 0 ? 0 : o * a / s, d = o) : (a < 0 && (i = -i), c = i, d = a === 0 ? 0 : i * s / a), { x: t + c, y: n + d };
296
+ }
297
+ var Q = {
298
+ rect: re,
299
+ ellipse: ae,
300
+ circle: ne,
301
+ diamond: se
302
+ };
303
+ function ee(r) {
304
+ Q = r;
305
+ }
306
+ function re(r, e, t) {
307
+ var n = 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);
308
+ return t.intersect = function(a) {
309
+ return J(t, a);
310
+ }, n;
311
+ }
312
+ function ae(r, e, t) {
313
+ var n = e.width / 2, a = e.height / 2, s = r.insert("ellipse", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("rx", n).attr("ry", a);
314
+ return t.intersect = function(i) {
315
+ return ot(t, n, a, i);
316
+ }, s;
317
+ }
318
+ function ne(r, e, t) {
319
+ var n = Math.max(e.width, e.height) / 2, a = r.insert("circle", ":first-child").attr("x", -e.width / 2).attr("y", -e.height / 2).attr("r", n);
320
+ return t.intersect = function(s) {
321
+ return jt(t, n, s);
322
+ }, a;
323
+ }
324
+ function se(r, e, t) {
325
+ var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
326
+ { x: 0, y: -a },
327
+ { x: -n, y: 0 },
328
+ { x: 0, y: a },
329
+ { x: n, y: 0 }
330
+ ], i = r.insert("polygon", ":first-child").attr(
331
+ "points",
332
+ s.map(function(o) {
333
+ return o.x + "," + o.y;
334
+ }).join(" ")
335
+ );
336
+ return t.intersect = function(o) {
337
+ return T(t, s, o);
338
+ }, i;
339
+ }
340
+ function ie() {
341
+ var r = function(e, t) {
342
+ ce(t);
343
+ var n = M(e, "output"), a = M(n, "clusters"), s = M(n, "edgePaths"), i = X(M(n, "edgeLabels"), t), o = q(M(n, "nodes"), t, Q);
344
+ _t(t), Ot(o, t), Zt(i, t), F(s, t, Y);
345
+ var c = H(a, t);
346
+ Jt(c, t), de(t);
347
+ };
348
+ return r.createNodes = function(e) {
349
+ return arguments.length ? (Kt(e), r) : q;
350
+ }, r.createClusters = function(e) {
351
+ return arguments.length ? (Vt(e), r) : H;
352
+ }, r.createEdgeLabels = function(e) {
353
+ return arguments.length ? (zt(e), r) : X;
354
+ }, r.createEdgePaths = function(e) {
355
+ return arguments.length ? (Yt(e), r) : F;
356
+ }, r.shapes = function(e) {
357
+ return arguments.length ? (ee(e), r) : Q;
358
+ }, r.arrows = function(e) {
359
+ return arguments.length ? (Dt(e), r) : Y;
360
+ }, r;
361
+ }
362
+ var oe = {
363
+ paddingLeft: 10,
364
+ paddingRight: 10,
365
+ paddingTop: 10,
366
+ paddingBottom: 10,
367
+ rx: 0,
368
+ ry: 0,
369
+ shape: "rect"
370
+ }, le = {
371
+ arrowhead: "normal",
372
+ curve: P
373
+ };
374
+ function ce(r) {
375
+ r.nodes().forEach(function(e) {
376
+ var t = r.node(e);
377
+ !y.has(t, "label") && !r.children(e).length && (t.label = e), y.has(t, "paddingX") && y.defaults(t, {
378
+ paddingLeft: t.paddingX,
379
+ paddingRight: t.paddingX
380
+ }), y.has(t, "paddingY") && y.defaults(t, {
381
+ paddingTop: t.paddingY,
382
+ paddingBottom: t.paddingY
383
+ }), y.has(t, "padding") && y.defaults(t, {
384
+ paddingLeft: t.padding,
385
+ paddingRight: t.padding,
386
+ paddingTop: t.padding,
387
+ paddingBottom: t.padding
388
+ }), y.defaults(t, oe), y.each(["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"], function(n) {
389
+ t[n] = Number(t[n]);
390
+ }), y.has(t, "width") && (t._prevWidth = t.width), y.has(t, "height") && (t._prevHeight = t.height);
391
+ }), r.edges().forEach(function(e) {
392
+ var t = r.edge(e);
393
+ y.has(t, "label") || (t.label = ""), y.defaults(t, le);
394
+ });
395
+ }
396
+ function de(r) {
397
+ y.each(r.nodes(), function(e) {
398
+ var t = r.node(e);
399
+ y.has(t, "_prevWidth") ? t.width = t._prevWidth : delete t.width, y.has(t, "_prevHeight") ? t.height = t._prevHeight : delete t.height, delete t._prevWidth, delete t._prevHeight;
400
+ });
401
+ }
402
+ function M(r, e) {
403
+ var t = r.select("g." + e);
404
+ return t.empty() && (t = r.append("g").attr("class", e)), t;
405
+ }
406
+ function lt(r, e, t) {
407
+ const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
408
+ { x: s / 2, y: 0 },
409
+ { x: s, y: -s / 2 },
410
+ { x: s / 2, y: -s },
411
+ { x: 0, y: -s / 2 }
412
+ ], o = A(r, s, s, i);
413
+ return t.intersect = function(c) {
414
+ return T(t, i, c);
415
+ }, o;
416
+ }
417
+ function ct(r, e, t) {
418
+ const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
419
+ { x: s, y: 0 },
420
+ { x: i - s, y: 0 },
421
+ { x: i, y: -a / 2 },
422
+ { x: i - s, y: -a },
423
+ { x: s, y: -a },
424
+ { x: 0, y: -a / 2 }
425
+ ], c = A(r, i, a, o);
426
+ return t.intersect = function(d) {
427
+ return T(t, o, d);
428
+ }, c;
429
+ }
430
+ function dt(r, e, t) {
431
+ const n = e.width, a = e.height, s = [
432
+ { x: -a / 2, y: 0 },
433
+ { x: n, y: 0 },
434
+ { x: n, y: -a },
435
+ { x: -a / 2, y: -a },
436
+ { x: 0, y: -a / 2 }
437
+ ], i = A(r, n, a, s);
438
+ return t.intersect = function(o) {
439
+ return T(t, s, o);
440
+ }, i;
441
+ }
442
+ function ht(r, e, t) {
443
+ const n = e.width, a = e.height, s = [
444
+ { x: -2 * a / 6, y: 0 },
445
+ { x: n - a / 6, y: 0 },
446
+ { x: n + 2 * a / 6, y: -a },
447
+ { x: a / 6, y: -a }
448
+ ], i = A(r, n, a, s);
449
+ return t.intersect = function(o) {
450
+ return T(t, s, o);
451
+ }, i;
452
+ }
453
+ function ut(r, e, t) {
454
+ const n = e.width, a = e.height, s = [
455
+ { x: 2 * a / 6, y: 0 },
456
+ { x: n + a / 6, y: 0 },
457
+ { x: n - 2 * a / 6, y: -a },
458
+ { x: -a / 6, y: -a }
459
+ ], i = A(r, n, a, s);
460
+ return t.intersect = function(o) {
461
+ return T(t, s, o);
462
+ }, i;
463
+ }
464
+ function ft(r, e, t) {
465
+ const n = e.width, a = e.height, s = [
466
+ { x: -2 * a / 6, y: 0 },
467
+ { x: n + 2 * a / 6, y: 0 },
468
+ { x: n - a / 6, y: -a },
469
+ { x: a / 6, y: -a }
470
+ ], i = A(r, n, a, s);
471
+ return t.intersect = function(o) {
472
+ return T(t, s, o);
473
+ }, i;
474
+ }
475
+ function pt(r, e, t) {
476
+ const n = e.width, a = e.height, s = [
477
+ { x: a / 6, y: 0 },
478
+ { x: n - a / 6, y: 0 },
479
+ { x: n + 2 * a / 6, y: -a },
480
+ { x: -2 * a / 6, y: -a }
481
+ ], i = A(r, n, a, s);
482
+ return t.intersect = function(o) {
483
+ return T(t, s, o);
484
+ }, i;
485
+ }
486
+ function gt(r, e, t) {
487
+ const n = e.width, a = e.height, s = [
488
+ { x: 0, y: 0 },
489
+ { x: n + a / 2, y: 0 },
490
+ { x: n, y: -a / 2 },
491
+ { x: n + a / 2, y: -a },
492
+ { x: 0, y: -a }
493
+ ], i = A(r, n, a, s);
494
+ return t.intersect = function(o) {
495
+ return T(t, s, o);
496
+ }, i;
497
+ }
498
+ function yt(r, e, t) {
499
+ const n = e.height, a = e.width + n / 4, s = r.insert("rect", ":first-child").attr("rx", n / 2).attr("ry", n / 2).attr("x", -a / 2).attr("y", -n / 2).attr("width", a).attr("height", n);
500
+ return t.intersect = function(i) {
501
+ return J(t, i);
502
+ }, s;
503
+ }
504
+ function vt(r, e, t) {
505
+ const n = e.width, a = e.height, s = [
506
+ { x: 0, y: 0 },
507
+ { x: n, y: 0 },
508
+ { x: n, y: -a },
509
+ { x: 0, y: -a },
510
+ { x: 0, y: 0 },
511
+ { x: -8, y: 0 },
512
+ { x: n + 8, y: 0 },
513
+ { x: n + 8, y: -a },
514
+ { x: -8, y: -a },
515
+ { x: -8, y: 0 }
516
+ ], i = A(r, n, a, s);
517
+ return t.intersect = function(o) {
518
+ return T(t, s, o);
519
+ }, i;
520
+ }
521
+ function wt(r, e, t) {
522
+ const n = e.width, a = n / 2, s = a / (2.5 + n / 50), i = e.height + s, o = "M 0," + s + " a " + a + "," + s + " 0,0,0 " + n + " 0 a " + a + "," + s + " 0,0,0 " + -n + " 0 l 0," + i + " a " + a + "," + s + " 0,0,0 " + n + " 0 l 0," + -i, c = r.attr("label-offset-y", s).insert("path", ":first-child").attr("d", o).attr("transform", "translate(" + -n / 2 + "," + -(i / 2 + s) + ")");
523
+ return t.intersect = function(d) {
524
+ const l = J(t, d), g = l.x - t.x;
525
+ if (a != 0 && (Math.abs(g) < t.width / 2 || Math.abs(g) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - s)) {
526
+ let h = s * s * (1 - g * g / (a * a));
527
+ h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
528
+ }
529
+ return l;
530
+ }, c;
531
+ }
532
+ function he(r) {
533
+ r.shapes().question = lt, r.shapes().hexagon = ct, r.shapes().stadium = yt, r.shapes().subroutine = vt, r.shapes().cylinder = wt, r.shapes().rect_left_inv_arrow = dt, r.shapes().lean_right = ht, r.shapes().lean_left = ut, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = pt, r.shapes().rect_right_inv_arrow = gt;
534
+ }
535
+ function ue(r) {
536
+ r({ question: lt }), r({ hexagon: ct }), r({ stadium: yt }), r({ subroutine: vt }), r({ cylinder: wt }), r({ rect_left_inv_arrow: dt }), r({ lean_right: ht }), r({ lean_left: ut }), r({ trapezoid: ft }), r({ inv_trapezoid: pt }), r({ rect_right_inv_arrow: gt });
537
+ }
538
+ function A(r, e, t, n) {
539
+ return r.insert("polygon", ":first-child").attr(
540
+ "points",
541
+ n.map(function(a) {
542
+ return a.x + "," + a.y;
543
+ }).join(" ")
544
+ ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
545
+ }
546
+ const fe = {
547
+ addToRender: he,
548
+ addToRenderV2: ue
549
+ }, xt = {}, pe = function(r) {
550
+ const e = Object.keys(r);
551
+ for (const t of e)
552
+ xt[t] = r[t];
553
+ }, mt = async function(r, e, t, n, a, s) {
554
+ const i = n ? n.select(`[id="${t}"]`) : b(`[id="${t}"]`), o = a || document, c = Object.keys(r);
555
+ for (const d of c) {
556
+ const l = r[d];
557
+ let g = "default";
558
+ l.classes.length > 0 && (g = l.classes.join(" "));
559
+ const h = z(l.styles);
560
+ let u = l.text !== void 0 ? l.text : l.id, p;
561
+ if (j(R().flowchart.htmlLabels)) {
562
+ const v = {
563
+ label: await tt(
564
+ u.replace(
565
+ /fa[blrs]?:fa-[\w-]+/g,
566
+ // cspell:disable-line
567
+ (S) => `<i class='${S.replace(":", " ")}'></i>`
568
+ ),
569
+ R()
570
+ )
571
+ };
572
+ p = rt(i, v).node(), p.parentNode.removeChild(p);
573
+ } else {
574
+ const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
575
+ v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
576
+ const S = u.split(et.lineBreakRegex);
577
+ for (const I of S) {
578
+ const _ = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
579
+ _.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), _.setAttribute("dy", "1em"), _.setAttribute("x", "1"), _.textContent = I, v.appendChild(_);
580
+ }
581
+ p = v;
582
+ }
583
+ let w = 0, f = "";
584
+ switch (l.type) {
585
+ case "round":
586
+ w = 5, f = "rect";
587
+ break;
588
+ case "square":
589
+ f = "rect";
590
+ break;
591
+ case "diamond":
592
+ f = "question";
593
+ break;
594
+ case "hexagon":
595
+ f = "hexagon";
596
+ break;
597
+ case "odd":
598
+ f = "rect_left_inv_arrow";
599
+ break;
600
+ case "lean_right":
601
+ f = "lean_right";
602
+ break;
603
+ case "lean_left":
604
+ f = "lean_left";
605
+ break;
606
+ case "trapezoid":
607
+ f = "trapezoid";
608
+ break;
609
+ case "inv_trapezoid":
610
+ f = "inv_trapezoid";
611
+ break;
612
+ case "odd_right":
613
+ f = "rect_left_inv_arrow";
614
+ break;
615
+ case "circle":
616
+ f = "circle";
617
+ break;
618
+ case "ellipse":
619
+ f = "ellipse";
620
+ break;
621
+ case "stadium":
622
+ f = "stadium";
623
+ break;
624
+ case "subroutine":
625
+ f = "subroutine";
626
+ break;
627
+ case "cylinder":
628
+ f = "cylinder";
629
+ break;
630
+ case "group":
631
+ f = "rect";
632
+ break;
633
+ default:
634
+ f = "rect";
635
+ }
636
+ D.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
637
+ labelType: "svg",
638
+ labelStyle: h.labelStyle,
639
+ shape: f,
640
+ label: p,
641
+ rx: w,
642
+ ry: w,
643
+ class: g,
644
+ style: h.style,
645
+ id: s.db.lookUpDomId(l.id)
646
+ });
647
+ }
648
+ }, bt = async function(r, e, t) {
649
+ let n = 0, a, s;
650
+ if (r.defaultStyle !== void 0) {
651
+ const i = z(r.defaultStyle);
652
+ a = i.style, s = i.labelStyle;
653
+ }
654
+ for (const i of r) {
655
+ n++;
656
+ const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
657
+ i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
658
+ let g = "", h = "";
659
+ if (i.style !== void 0) {
660
+ const u = z(i.style);
661
+ g = u.style, h = u.labelStyle;
662
+ } else
663
+ switch (i.stroke) {
664
+ case "normal":
665
+ g = "fill:none", a !== void 0 && (g = a), s !== void 0 && (h = s);
666
+ break;
667
+ case "dotted":
668
+ g = "fill:none;stroke-width:2px;stroke-dasharray:3;";
669
+ break;
670
+ case "thick":
671
+ g = " stroke-width: 3.5px;fill:none";
672
+ break;
673
+ }
674
+ l.style = g, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = V(i.interpolate, P) : r.defaultInterpolate !== void 0 ? l.curve = V(r.defaultInterpolate, P) : l.curve = V(xt.curve, P), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", j(R().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await tt(
675
+ i.text.replace(
676
+ /fa[blrs]?:fa-[\w-]+/g,
677
+ // cspell:disable-line
678
+ (u) => `<i class='${u.replace(":", " ")}'></i>`
679
+ ),
680
+ R()
681
+ )}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
682
+ `), i.style === void 0 && (l.style = l.style || "stroke: #333; stroke-width: 1.5px;fill:none"), l.labelStyle = l.labelStyle.replace("color:", "fill:"))), l.id = o, l.class = c + " " + d, l.minlen = i.length || 1, e.setEdge(t.db.lookUpDomId(i.start), t.db.lookUpDomId(i.end), l, n);
683
+ }
684
+ }, ge = function(r, e) {
685
+ return D.info("Extracting classes"), e.db.getClasses();
686
+ }, ye = async function(r, e, t, n) {
687
+ D.info("Drawing flowchart");
688
+ const { securityLevel: a, flowchart: s } = R();
689
+ let i;
690
+ a === "sandbox" && (i = b("#i" + e));
691
+ const o = a === "sandbox" ? b(i.nodes()[0].contentDocument.body) : b("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
692
+ let d = n.db.getDirection();
693
+ d === void 0 && (d = "TD");
694
+ const l = s.nodeSpacing || 50, g = s.rankSpacing || 50, h = new St({
695
+ multigraph: !0,
696
+ compound: !0
697
+ }).setGraph({
698
+ rankdir: d,
699
+ nodesep: l,
700
+ ranksep: g,
701
+ marginx: 8,
702
+ marginy: 8
703
+ }).setDefaultEdgeLabel(function() {
704
+ return {};
705
+ });
706
+ let u;
707
+ const p = n.db.getSubGraphs();
708
+ for (let x = p.length - 1; x >= 0; x--)
709
+ u = p[x], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
710
+ const w = n.db.getVertices();
711
+ D.warn("Get vertices", w);
712
+ const f = n.db.getEdges();
713
+ let v = 0;
714
+ for (v = p.length - 1; v >= 0; v--) {
715
+ u = p[v], Nt("cluster").append("text");
716
+ for (let x = 0; x < u.nodes.length; x++)
717
+ D.warn(
718
+ "Setting subgraph",
719
+ u.nodes[x],
720
+ n.db.lookUpDomId(u.nodes[x]),
721
+ n.db.lookUpDomId(u.id)
722
+ ), h.setParent(n.db.lookUpDomId(u.nodes[x]), n.db.lookUpDomId(u.id));
723
+ }
724
+ await mt(w, h, e, o, c, n), await bt(f, h, n);
725
+ const S = new ie();
726
+ fe.addToRender(S), S.arrows().none = function(k, L, m, B) {
727
+ const C = k.append("marker").attr("id", L).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");
728
+ N(C, m[B + "Style"]);
729
+ }, S.arrows().normal = function(k, L) {
730
+ k.append("marker").attr("id", L).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");
731
+ };
732
+ const I = o.select(`[id="${e}"]`), _ = o.select("#" + e + " g");
733
+ for (S(_, h), _.selectAll("g.node").attr("title", function() {
734
+ return n.db.getTooltip(this.id);
735
+ }), n.db.indexNodes("subGraph" + v), v = 0; v < p.length; v++)
736
+ if (u = p[v], u.title !== "undefined") {
737
+ const x = c.querySelectorAll(
738
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
739
+ ), k = c.querySelectorAll(
740
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
741
+ ), L = x[0].x.baseVal.value, m = x[0].y.baseVal.value, B = x[0].width.baseVal.value, C = b(k[0]).select(".label");
742
+ C.attr("transform", `translate(${L + B / 2}, ${m + 14})`), C.attr("id", e + "Text");
743
+ for (let $ = 0; $ < u.classes.length; $++)
744
+ k[0].classList.add(u.classes[$]);
745
+ }
746
+ if (!s.htmlLabels) {
747
+ const x = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
748
+ for (const k of x) {
749
+ const L = k.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
750
+ m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", L.width), m.setAttribute("height", L.height), k.insertBefore(m, k.firstChild);
751
+ }
752
+ }
753
+ Lt(h, I, s.diagramPadding, s.useMaxWidth), Object.keys(w).forEach(function(x) {
754
+ const k = w[x];
755
+ if (k.link) {
756
+ const L = o.select("#" + e + ' [id="' + n.db.lookUpDomId(x) + '"]');
757
+ if (L) {
758
+ const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
759
+ m.setAttributeNS("http://www.w3.org/2000/svg", "class", k.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", k.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), a === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : k.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", k.linkTarget);
760
+ const B = L.insert(function() {
761
+ return m;
762
+ }, ":first-child"), G = L.select(".label-container");
763
+ G && B.append(function() {
764
+ return G.node();
765
+ });
766
+ const C = L.select(".label");
767
+ C && B.append(function() {
768
+ return C.node();
769
+ });
770
+ }
771
+ }
772
+ });
773
+ }, ve = {
774
+ setConf: pe,
775
+ addVertices: mt,
776
+ addEdges: bt,
777
+ getClasses: ge,
778
+ draw: ye
779
+ }, _e = {
780
+ parser: kt,
781
+ db: W,
782
+ renderer: Tt,
783
+ styles: Et,
784
+ init: (r) => {
785
+ r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, ve.setConf(r.flowchart), W.clear(), W.setGen("gen-1");
786
+ }
787
+ };
788
+ export {
789
+ _e as diagram
790
+ };