@layers-app/editor 0.5.1 → 0.5.2

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 (240) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.d.ts +315 -0
  3. package/dist/index.js +13 -0
  4. package/dist/layers.-TbWEgSf.js +425 -0
  5. package/dist/layers.0aivjg14.js +202 -0
  6. package/dist/layers.1kchl9Fg.js +33 -0
  7. package/dist/layers.2RmTpOSe.js +65 -0
  8. package/dist/layers.37cL7YbN.js +40 -0
  9. package/dist/layers.4q_x5roN.js +5 -0
  10. package/dist/layers.52famHy6.js +1 -0
  11. package/dist/layers.68ma6K6f.js +1 -0
  12. package/dist/layers.6HZckrJk.js +1 -0
  13. package/dist/layers.7JqFgE4-.js +15 -0
  14. package/dist/layers.8xliMm_4.js +14 -0
  15. package/dist/layers.9pNaFvaX.js +1 -0
  16. package/dist/layers.A7FX8Cpf.js +220 -0
  17. package/dist/layers.B-MfAaIy.js +1 -0
  18. package/dist/layers.B17DijoR.js +6 -0
  19. package/dist/layers.B1970UjZ.js +282 -0
  20. package/dist/layers.B19hGmey.js +1 -0
  21. package/dist/layers.B1IP0xF5.js +122 -0
  22. package/dist/layers.B1TVCKFc.js +423 -0
  23. package/dist/layers.B2wb1BnV.js +1 -0
  24. package/dist/layers.B3D4g2HH.js +1 -0
  25. package/dist/layers.B3QZKSP7.js +4 -0
  26. package/dist/layers.B4cctrKy.js +2235 -0
  27. package/dist/layers.B5eIpqUm.js +5 -0
  28. package/dist/layers.B5fhqRqQ.js +32 -0
  29. package/dist/layers.B5o5YNLY.js +41 -0
  30. package/dist/layers.B7QKbjTP.js +1 -0
  31. package/dist/layers.B7R5e9nb.js +39 -0
  32. package/dist/layers.B9H_VqGH.js +38 -0
  33. package/dist/layers.B9gDt0mt.js +2 -0
  34. package/dist/layers.BAtv1CM7.js +1 -0
  35. package/dist/layers.BAx1rxXM.js +1 -0
  36. package/dist/layers.BBu8KTxD.js +40 -0
  37. package/dist/layers.BC0UHUHZ.js +6 -0
  38. package/dist/layers.BEsDNARG.js +2966 -0
  39. package/dist/layers.BIFfWqjp.js +6 -0
  40. package/dist/layers.BIRO82v2.js +1 -0
  41. package/dist/layers.BIXkxpJg.js +7 -0
  42. package/dist/layers.BIeVwYKL.js +1 -0
  43. package/dist/layers.BJDrjORS.js +244 -0
  44. package/dist/layers.BJWQnQ1b.js +931 -0
  45. package/dist/layers.BKA3G4tE.js +8 -0
  46. package/dist/layers.BKcOrB7G.js +8 -0
  47. package/dist/layers.BLd2spTm.js +1 -0
  48. package/dist/layers.BLomL8Y1.js +40 -0
  49. package/dist/layers.BOGcxS4S.js +11 -0
  50. package/dist/layers.BPpqQ2zl.js +10 -0
  51. package/dist/layers.BQGV7_aP.js +7 -0
  52. package/dist/layers.BQvMgKOV.js +257 -0
  53. package/dist/layers.BRVeeDcH.js +802 -0
  54. package/dist/layers.BSB9eX8_.js +96 -0
  55. package/dist/layers.BSDp4pjf.js +160 -0
  56. package/dist/layers.BSTBZrFn.js +1 -0
  57. package/dist/layers.BWwCeuKP.js +39 -0
  58. package/dist/layers.BXYVnzZo.js +10 -0
  59. package/dist/layers.BYxlPasW.js +9 -0
  60. package/dist/layers.B_C8Ox8-.js +320 -0
  61. package/dist/layers.B_rZy9ZE.js +10 -0
  62. package/dist/layers.BbCfEXyj.js +55 -0
  63. package/dist/layers.Becl7PvM.js +1 -0
  64. package/dist/layers.BekArbNQ.js +501 -0
  65. package/dist/layers.BgOa2ZQq.js +7 -0
  66. package/dist/layers.BhZmc2PE.js +1 -0
  67. package/dist/layers.BhaSD27u.js +8 -0
  68. package/dist/layers.BiJ8hfRt.js +1510 -0
  69. package/dist/layers.Bm7EN78W.js +5 -0
  70. package/dist/layers.BocrFl_z.js +1265 -0
  71. package/dist/layers.BpilXLfW.js +6 -0
  72. package/dist/layers.BrBnUsI5.js +41 -0
  73. package/dist/layers.BrhJtZkc.js +84 -0
  74. package/dist/layers.Bsxy-Zmv.js +7 -0
  75. package/dist/layers.Bu9go6nF.js +10 -0
  76. package/dist/layers.BuJFmhxG.js +1 -0
  77. package/dist/layers.BuNBio9d.js +10 -0
  78. package/dist/layers.BufbpNF2.js +35 -0
  79. package/dist/layers.Bv6t74Ng.js +37 -0
  80. package/dist/layers.Bw7AFM_C.js +39 -0
  81. package/dist/layers.ByEhw12k.js +40 -0
  82. package/dist/layers.Bz8CGnnD.js +32 -0
  83. package/dist/layers.BzfTuld3.js +304 -0
  84. package/dist/layers.C-f2Ts9u.js +32 -0
  85. package/dist/layers.C0Lgw_Sx.js +11688 -0
  86. package/dist/layers.C0xLKPSB.js +7 -0
  87. package/dist/layers.C8_lu5UH.js +23 -0
  88. package/dist/layers.C8d9V9GQ.js +1619 -0
  89. package/dist/layers.C9KUAI3S.js +9 -0
  90. package/dist/layers.C9Qm4iyY.js +51 -0
  91. package/dist/layers.CAAtHbGC.js +1034 -0
  92. package/dist/layers.CBTk7340.js +41 -0
  93. package/dist/layers.CCGTXI7t.js +37 -0
  94. package/dist/layers.CDnEPiFS.js +13 -0
  95. package/dist/layers.CF0jHwg8.js +36 -0
  96. package/dist/layers.CFEmW02q.js +189 -0
  97. package/dist/layers.CFpY72SE.js +1 -0
  98. package/dist/layers.CG-pQKxy.js +32 -0
  99. package/dist/layers.CHZsXQcr.js +1 -0
  100. package/dist/layers.CIBiA4cp.js +9 -0
  101. package/dist/layers.CJ5oFhK5.js +9 -0
  102. package/dist/layers.CLG-12Ft.js +803 -0
  103. package/dist/layers.CLQVPEWO.js +70 -0
  104. package/dist/layers.CNAZOY0z.js +42 -0
  105. package/dist/layers.CNAp0agL.js +11 -0
  106. package/dist/layers.CNNAjKqx.js +42 -0
  107. package/dist/layers.CO0NalVl.js +1283 -0
  108. package/dist/layers.COTtcXWr.js +38 -0
  109. package/dist/layers.COsJBDU8.js +11 -0
  110. package/dist/layers.CPdjh9hT.js +373 -0
  111. package/dist/layers.CSFyrYzY.js +118 -0
  112. package/dist/layers.CX_ayh7E.js +42 -0
  113. package/dist/layers.CeNyh2LV.js +41 -0
  114. package/dist/layers.Ce_CBSin.js +9 -0
  115. package/dist/layers.CfjCZzg8.js +33 -0
  116. package/dist/layers.CfsQNfbN.js +35 -0
  117. package/dist/layers.CgqehJlq.js +268 -0
  118. package/dist/layers.CildyhOW.js +1 -0
  119. package/dist/layers.CjBfNqWg.js +207 -0
  120. package/dist/layers.CjZ_56YO.js +39 -0
  121. package/dist/layers.CqVTtuYm.js +6 -0
  122. package/dist/layers.Ct7y2KbU.js +1 -0
  123. package/dist/layers.CtASemAs.js +1 -0
  124. package/dist/layers.CvCe_XZO.js +44 -0
  125. package/dist/layers.CvF4WyAB.js +8 -0
  126. package/dist/layers.CvgnifSj.js +10 -0
  127. package/dist/layers.CyGuH0wW.js +84 -0
  128. package/dist/layers.Cyzu9PKQ.js +1 -0
  129. package/dist/layers.CzZCiNn3.js +1 -0
  130. package/dist/layers.Cz_HcKZR.js +9 -0
  131. package/dist/layers.CzqAzeMM.js +295 -0
  132. package/dist/layers.D-0DKizI.js +36 -0
  133. package/dist/layers.D-4uOpUj.js +2479 -0
  134. package/dist/layers.D-P1auk3.js +40 -0
  135. package/dist/layers.D-z4IZwp.js +139 -0
  136. package/dist/layers.D0zn4_Mx.js +1 -0
  137. package/dist/layers.D176Y7Vo.js +437 -0
  138. package/dist/layers.D1TLKJdE.js +2 -0
  139. package/dist/layers.D4SM8Ihn.js +10 -0
  140. package/dist/layers.D4T8fTcj.js +1223 -0
  141. package/dist/layers.D7jGxypv.js +8 -0
  142. package/dist/layers.D819V-1U.js +5 -0
  143. package/dist/layers.D92dwfZm.js +9 -0
  144. package/dist/layers.D9oxm2Q3.js +36 -0
  145. package/dist/layers.DAUiVpfA.js +41 -0
  146. package/dist/layers.DAgjLyi0.js +21938 -0
  147. package/dist/layers.DG5DkMsX.js +4 -0
  148. package/dist/layers.DG5nJvev.js +41 -0
  149. package/dist/layers.DGIvTJgm.js +1 -0
  150. package/dist/layers.DGKHsEgL.js +37 -0
  151. package/dist/layers.DJINSxsc.js +1 -0
  152. package/dist/layers.DJJF7QHv.js +39 -0
  153. package/dist/layers.DLK9DV2V.js +40 -0
  154. package/dist/layers.DLNMmOF6.js +10 -0
  155. package/dist/layers.DLwuMfdd.js +84 -0
  156. package/dist/layers.DMkBISW1.js +1 -0
  157. package/dist/layers.DN9HoVxI.js +18 -0
  158. package/dist/layers.DO3jf13r.js +139 -0
  159. package/dist/layers.DOrgOHBr.js +1 -0
  160. package/dist/layers.DRi0nv8t.js +769 -0
  161. package/dist/layers.DTEtUQ-N.js +11 -0
  162. package/dist/layers.DXM-M_t4.js +904 -0
  163. package/dist/layers.DZ4rueAA.js +1126 -0
  164. package/dist/layers.DZAc2rlA.js +19 -0
  165. package/dist/layers.DZAwluRX.js +7 -0
  166. package/dist/layers.D__Ge0jR.js +1580 -0
  167. package/dist/layers.D_qBxnuW.js +6 -0
  168. package/dist/layers.Da7N3t0o.js +59 -0
  169. package/dist/layers.DbCde96z.js +61 -0
  170. package/dist/layers.DbaKVP5e.js +1 -0
  171. package/dist/layers.Deuxf8WS.js +37 -0
  172. package/dist/layers.DgQ6wjQ6.js +1089 -0
  173. package/dist/layers.Dhs3Sikn.js +230 -0
  174. package/dist/layers.DizdRJDv.js +10 -0
  175. package/dist/layers.DjUOC4st.js +16 -0
  176. package/dist/layers.DkRaFpYI.js +39 -0
  177. package/dist/layers.Dn0j_OK5.js +8 -0
  178. package/dist/layers.DneF9QFl.js +39 -0
  179. package/dist/layers.DnohNr8z.js +2 -0
  180. package/dist/layers.DtjaV33P.js +4 -0
  181. package/dist/layers.DtwPvqvM.js +1359 -0
  182. package/dist/layers.DuQS64hQ.js +35 -0
  183. package/dist/layers.DvcL-c1J.js +10 -0
  184. package/dist/layers.DwGEUGi4.js +1 -0
  185. package/dist/layers.Dwf-cmfl.js +1 -0
  186. package/dist/layers.DxA6ocdw.js +70 -0
  187. package/dist/layers.DxuaZtRi.js +116 -0
  188. package/dist/layers.Dy1naDTQ.js +14 -0
  189. package/dist/layers.DyVeJ5nq.js +41 -0
  190. package/dist/layers.Dz5Fekdu.js +8 -0
  191. package/dist/layers.DzTjTsrg.js +52 -0
  192. package/dist/layers.DzWSztoe.js +8 -0
  193. package/dist/layers.DzWUGmmi.js +21763 -0
  194. package/dist/layers.Fv2UzX_J.js +40 -0
  195. package/dist/layers.GGg0Uela.js +48146 -0
  196. package/dist/layers.HISmbvvZ.js +41 -0
  197. package/dist/layers.J-SBicA2.js +39 -0
  198. package/dist/layers.JWCLFILJ.js +1 -0
  199. package/dist/layers.Jy2BJnrD.js +7 -0
  200. package/dist/layers.KNG61fVD.js +32 -0
  201. package/dist/layers.KZKDnGbd.js +9166 -0
  202. package/dist/layers.Kcxw1ZN5.js +8 -0
  203. package/dist/layers.LG7pZboq.js +42 -0
  204. package/dist/layers.N7uLiJJF.js +791 -0
  205. package/dist/layers.P0mMn9V6.js +4 -0
  206. package/dist/layers.RY1Pc_vI.js +39 -0
  207. package/dist/layers.T5F5IY6f.js +38 -0
  208. package/dist/layers.UBsT16id.js +9 -0
  209. package/dist/layers.Ww9bBIaA.js +32 -0
  210. package/dist/layers.YUbPYUxB.js +1088 -0
  211. package/dist/layers.YejPlmok.js +34 -0
  212. package/dist/layers.YsjMDe1Z.js +8 -0
  213. package/dist/layers._IMfh4Om.js +1 -0
  214. package/dist/layers.b0h5ZBmD.js +61 -0
  215. package/dist/layers.cXShihLV.js +793 -0
  216. package/dist/layers.dBCFbDUQ.js +5 -0
  217. package/dist/layers.dsZSDggl.js +1 -0
  218. package/dist/layers.dzPD2Tq6.js +8 -0
  219. package/dist/layers.fdHV7i_n.js +47540 -0
  220. package/dist/layers.g0MJEmgM.js +36 -0
  221. package/dist/layers.g6KGAlYG.js +7 -0
  222. package/dist/layers.gAwY5NlW.js +6 -0
  223. package/dist/layers.hJXmn9h9.js +3 -0
  224. package/dist/layers.hMr_bHrn.js +1 -0
  225. package/dist/layers.hweLqW3I.js +261 -0
  226. package/dist/layers.ifrGR0tH.js +1 -0
  227. package/dist/layers.jS5D2j9k.js +186 -0
  228. package/dist/layers.k5zSy7kx.js +40 -0
  229. package/dist/layers.ku7sc5w7.js +40 -0
  230. package/dist/layers.l0OsrJxT.js +9 -0
  231. package/dist/layers.lCpg7dOn.js +21 -0
  232. package/dist/layers.mcrEJ5IL.js +1 -0
  233. package/dist/layers.mkPf05Ff.js +960 -0
  234. package/dist/layers.n8BNeBDu.js +40 -0
  235. package/dist/layers.nesKhKqv.js +9 -0
  236. package/dist/layers.o8uxn2z6.js +6 -0
  237. package/dist/layers.qKFGZSrv.js +42 -0
  238. package/dist/layers.tehvhFRL.js +11 -0
  239. package/dist/layers.yaVCGcoo.js +7 -0
  240. package/package.json +1 -1
@@ -0,0 +1,791 @@
1
+ import { f as $, p as St } from "./layers.DZ4rueAA.js";
2
+ import { d as x, a0 as G, l as M, g as D, Y as Lt, _ as V, $ as W, t as Z, V as tt, j as et } from "./layers.KZKDnGbd.js";
3
+ import * as rt from "lodash-es";
4
+ import { pick as _t, defaults as I } from "lodash-es";
5
+ import { l as Et } from "./layers.D4T8fTcj.js";
6
+ import { G as Tt } from "./layers.BJDrjORS.js";
7
+ import { b as T, c as at, i as nt, d as _, e as st, g as it, f as Nt, a as At, s as Pt } from "./layers.D176Y7Vo.js";
8
+ import { l as Ct } from "./layers.1kchl9Fg.js";
9
+ import "./layers.DzWUGmmi.js";
10
+ function It(r) {
11
+ if (!r.ok) throw new Error(r.status + " " + r.statusText);
12
+ return r.text();
13
+ }
14
+ function Bt(r, e) {
15
+ return fetch(r, e).then(It);
16
+ }
17
+ function Mt(r) {
18
+ return (e, t) => Bt(e, t).then((n) => new DOMParser().parseFromString(n, r));
19
+ }
20
+ var Dt = Mt("image/svg+xml"), z = {
21
+ normal: Gt,
22
+ vee: Ot,
23
+ undirected: Ut
24
+ };
25
+ function Rt(r) {
26
+ z = r;
27
+ }
28
+ function Gt(r, e, t, n) {
29
+ 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");
30
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
31
+ }
32
+ function Ot(r, e, t, n) {
33
+ 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");
34
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
35
+ }
36
+ function Ut(r, e, t, n) {
37
+ 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");
38
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
39
+ }
40
+ function $t(r, e) {
41
+ var t = r;
42
+ return t.node().appendChild(e.label), T(t, e.labelStyle), t;
43
+ }
44
+ function Wt(r, e) {
45
+ for (var t = r.append("text"), n = Vt(e.label).split(`
46
+ `), a = 0; a < n.length; a++)
47
+ t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
48
+ return T(t, e.labelStyle), t;
49
+ }
50
+ function Vt(r) {
51
+ for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
52
+ if (n = r[a], t) {
53
+ switch (n) {
54
+ case "n":
55
+ e += `
56
+ `;
57
+ break;
58
+ default:
59
+ e += n;
60
+ }
61
+ t = !1;
62
+ } else n === "\\" ? t = !0 : e += n;
63
+ return e;
64
+ }
65
+ function q(r, e, t) {
66
+ var n = e.label, a = r.append("g");
67
+ e.labelType === "svg" ? $t(a, e) : typeof n != "string" || e.labelType === "html" ? at(a, e) : Wt(a, e);
68
+ var s = a.node().getBBox(), i;
69
+ switch (t) {
70
+ case "top":
71
+ i = -e.height / 2;
72
+ break;
73
+ case "bottom":
74
+ i = e.height / 2 - s.height;
75
+ break;
76
+ default:
77
+ i = -s.height / 2;
78
+ }
79
+ return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
80
+ }
81
+ var Y = function(r, e) {
82
+ var t = e.nodes().filter(function(s) {
83
+ return nt(e, s);
84
+ }), n = r.selectAll("g.cluster").data(t, function(s) {
85
+ return s;
86
+ });
87
+ _(n.exit(), e).style("opacity", 0).remove();
88
+ var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
89
+ var i = e.node(s);
90
+ return i.id;
91
+ }).style("opacity", 0).each(function(s) {
92
+ var i = e.node(s), o = x(this);
93
+ x(this).append("rect");
94
+ var c = o.append("g").attr("class", "label");
95
+ q(c, i, i.clusterLabelPos);
96
+ });
97
+ return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
98
+ var i = e.node(s), o = x(this);
99
+ T(o, i.style);
100
+ }), n;
101
+ };
102
+ function zt(r) {
103
+ Y = r;
104
+ }
105
+ let H = function(r, e) {
106
+ var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
107
+ return st(a);
108
+ }).classed("update", !0);
109
+ t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
110
+ var s = x(this);
111
+ s.select(".label").remove();
112
+ var i = e.edge(a), o = q(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
113
+ i.labelId && o.attr("id", i.labelId), Object.prototype.hasOwnProperty.call(i, "width") || (i.width = c.width), Object.prototype.hasOwnProperty.call(i, "height") || (i.height = c.height);
114
+ });
115
+ var n;
116
+ return t.exit ? n = t.exit() : n = t.selectAll(null), _(n, e).style("opacity", 0).remove(), t;
117
+ };
118
+ function Yt(r) {
119
+ H = r;
120
+ }
121
+ function K(r, e) {
122
+ return r.intersect(e);
123
+ }
124
+ var X = function(r, e, t) {
125
+ var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
126
+ return st(i);
127
+ }).classed("update", !0), a = qt(n, e);
128
+ Qt(n, e);
129
+ var s = n.merge !== void 0 ? n.merge(a) : n;
130
+ return _(s, e).style("opacity", 1), s.each(function(i) {
131
+ var o = x(this), c = e.edge(i);
132
+ c.elem = this, c.id && o.attr("id", c.id), it(
133
+ o,
134
+ c.class,
135
+ (o.classed("update") ? "update " : "") + "edgePath"
136
+ );
137
+ }), s.selectAll("path.path").each(function(i) {
138
+ var o = e.edge(i);
139
+ o.arrowheadId = rt.uniqueId("arrowhead");
140
+ var c = x(this).attr("marker-end", function() {
141
+ return "url(" + Xt(location.href, o.arrowheadId) + ")";
142
+ }).style("fill", "none");
143
+ _(c, e).attr("d", function(d) {
144
+ return Ft(e, d);
145
+ }), T(c, o.style);
146
+ }), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
147
+ var o = e.edge(i), c = t[o.arrowhead];
148
+ c(x(this), o.arrowheadId, o, "arrowhead");
149
+ }), s;
150
+ };
151
+ function Ht(r) {
152
+ X = r;
153
+ }
154
+ function Xt(r, e) {
155
+ var t = r.split("#")[0];
156
+ return t + "#" + e;
157
+ }
158
+ function Ft(r, e) {
159
+ var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
160
+ return s.unshift(K(n, s[0])), s.push(K(a, s[s.length - 1])), ot(t, s);
161
+ }
162
+ function ot(r, e) {
163
+ var t = (Ct || Dt.line)().x(function(n) {
164
+ return n.x;
165
+ }).y(function(n) {
166
+ return n.y;
167
+ });
168
+ return (t.curve || t.interpolate)(r.curve), t(e);
169
+ }
170
+ function jt(r) {
171
+ var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
172
+ return { x: t.e, y: t.f };
173
+ }
174
+ function qt(r, e) {
175
+ var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
176
+ return t.append("path").attr("class", "path").attr("d", function(n) {
177
+ var a = e.edge(n), s = e.node(n.v).elem, i = rt.range(a.points.length).map(function() {
178
+ return jt(s);
179
+ });
180
+ return ot(a, i);
181
+ }), t.append("defs"), t;
182
+ }
183
+ function Qt(r, e) {
184
+ var t = r.exit();
185
+ _(t, e).style("opacity", 0).remove();
186
+ }
187
+ var F = function(r, e, t) {
188
+ var n = e.nodes().filter(function(i) {
189
+ return !nt(e, i);
190
+ }), a = r.selectAll("g.node").data(n, function(i) {
191
+ return i;
192
+ }).classed("update", !0);
193
+ a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
194
+ var o = e.node(i), c = x(this);
195
+ it(
196
+ c,
197
+ o.class,
198
+ (c.classed("update") ? "update " : "") + "node"
199
+ ), c.select("g.label").remove();
200
+ var d = c.append("g").attr("class", "label"), l = q(d, o), y = t[o.shape], h = _t(l.node().getBBox(), "width", "height");
201
+ o.elem = this, o.id && c.attr("id", o.id), o.labelId && d.attr("id", o.labelId), Object.prototype.hasOwnProperty.call(o, "width") && (h.width = o.width), Object.prototype.hasOwnProperty.call(o, "height") && (h.height = o.height), h.width += o.paddingLeft + o.paddingRight, h.height += o.paddingTop + o.paddingBottom, d.attr(
202
+ "transform",
203
+ "translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
204
+ );
205
+ var u = x(this);
206
+ u.select(".label-container").remove();
207
+ var f = y(u, h, o).classed("label-container", !0);
208
+ T(f, o.style);
209
+ var g = f.node().getBBox();
210
+ o.width = g.width, o.height = g.height;
211
+ });
212
+ var s;
213
+ return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
214
+ };
215
+ function Kt(r) {
216
+ F = r;
217
+ }
218
+ function Jt(r, e) {
219
+ var t = r.filter(function() {
220
+ return !x(this).classed("update");
221
+ });
222
+ function n(a) {
223
+ var s = e.node(a);
224
+ return "translate(" + s.x + "," + s.y + ")";
225
+ }
226
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n), _(t.selectAll("rect"), e).attr("width", function(a) {
227
+ return e.node(a).width;
228
+ }).attr("height", function(a) {
229
+ return e.node(a).height;
230
+ }).attr("x", function(a) {
231
+ var s = e.node(a);
232
+ return -s.width / 2;
233
+ }).attr("y", function(a) {
234
+ var s = e.node(a);
235
+ return -s.height / 2;
236
+ });
237
+ }
238
+ function Zt(r, e) {
239
+ var t = r.filter(function() {
240
+ return !x(this).classed("update");
241
+ });
242
+ function n(a) {
243
+ var s = e.edge(a);
244
+ return Object.prototype.hasOwnProperty.call(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
245
+ }
246
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
247
+ }
248
+ function te(r, e) {
249
+ var t = r.filter(function() {
250
+ return !x(this).classed("update");
251
+ });
252
+ function n(a) {
253
+ var s = e.node(a);
254
+ return "translate(" + s.x + "," + s.y + ")";
255
+ }
256
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
257
+ }
258
+ function lt(r, e, t, n) {
259
+ 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);
260
+ n.x < a && (d = -d);
261
+ var l = Math.abs(e * t * o / c);
262
+ return n.y < s && (l = -l), { x: a + d, y: s + l };
263
+ }
264
+ function ee(r, e, t) {
265
+ return lt(r, e, e, t);
266
+ }
267
+ function re(r, e, t, n) {
268
+ var a, s, i, o, c, d, l, y, h, u, f, g, p, v, k;
269
+ 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 && J(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, y = s * e.x + o * e.y + d, !(l !== 0 && y !== 0 && J(l, y)) && (f = a * o - s * i, f !== 0)))
270
+ return g = Math.abs(f / 2), p = i * d - o * c, v = p < 0 ? (p - g) / f : (p + g) / f, p = s * c - a * d, k = p < 0 ? (p - g) / f : (p + g) / f, { x: v, y: k };
271
+ }
272
+ function J(r, e) {
273
+ return r * e > 0;
274
+ }
275
+ function E(r, e, t) {
276
+ var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
277
+ e.forEach(function(f) {
278
+ i = Math.min(i, f.x), o = Math.min(o, f.y);
279
+ });
280
+ for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
281
+ var y = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = re(
282
+ r,
283
+ t,
284
+ { x: c + y.x, y: d + y.y },
285
+ { x: c + h.x, y: d + h.y }
286
+ );
287
+ u && s.push(u);
288
+ }
289
+ return s.length ? (s.length > 1 && s.sort(function(f, g) {
290
+ var p = f.x - t.x, v = f.y - t.y, k = Math.sqrt(p * p + v * v), P = g.x - t.x, L = g.y - t.y, O = Math.sqrt(P * P + L * L);
291
+ return k < O ? -1 : k === O ? 0 : 1;
292
+ }), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
293
+ }
294
+ function Q(r, e) {
295
+ 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;
296
+ 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 };
297
+ }
298
+ var j = {
299
+ rect: ne,
300
+ ellipse: se,
301
+ circle: ie,
302
+ diamond: oe
303
+ };
304
+ function ae(r) {
305
+ j = r;
306
+ }
307
+ function ne(r, e, t) {
308
+ 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);
309
+ return t.intersect = function(a) {
310
+ return Q(t, a);
311
+ }, n;
312
+ }
313
+ function se(r, e, t) {
314
+ 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);
315
+ return t.intersect = function(i) {
316
+ return lt(t, n, a, i);
317
+ }, s;
318
+ }
319
+ function ie(r, e, t) {
320
+ 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);
321
+ return t.intersect = function(s) {
322
+ return ee(t, n, s);
323
+ }, a;
324
+ }
325
+ function oe(r, e, t) {
326
+ var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
327
+ { x: 0, y: -a },
328
+ { x: -n, y: 0 },
329
+ { x: 0, y: a },
330
+ { x: n, y: 0 }
331
+ ], i = r.insert("polygon", ":first-child").attr(
332
+ "points",
333
+ s.map(function(o) {
334
+ return o.x + "," + o.y;
335
+ }).join(" ")
336
+ );
337
+ return t.intersect = function(o) {
338
+ return E(t, s, o);
339
+ }, i;
340
+ }
341
+ function le() {
342
+ var r = function(e, t) {
343
+ he(t);
344
+ var n = B(e, "output"), a = B(n, "clusters"), s = B(n, "edgePaths"), i = H(B(n, "edgeLabels"), t), o = F(B(n, "nodes"), t, j);
345
+ Et(t), te(o, t), Zt(i, t), X(s, t, z);
346
+ var c = Y(a, t);
347
+ Jt(c, t), ue(t);
348
+ };
349
+ return r.createNodes = function(e) {
350
+ return arguments.length ? (Kt(e), r) : F;
351
+ }, r.createClusters = function(e) {
352
+ return arguments.length ? (zt(e), r) : Y;
353
+ }, r.createEdgeLabels = function(e) {
354
+ return arguments.length ? (Yt(e), r) : H;
355
+ }, r.createEdgePaths = function(e) {
356
+ return arguments.length ? (Ht(e), r) : X;
357
+ }, r.shapes = function(e) {
358
+ return arguments.length ? (ae(e), r) : j;
359
+ }, r.arrows = function(e) {
360
+ return arguments.length ? (Rt(e), r) : z;
361
+ }, r;
362
+ }
363
+ var ce = {
364
+ paddingLeft: 10,
365
+ paddingRight: 10,
366
+ paddingTop: 10,
367
+ paddingBottom: 10,
368
+ rx: 0,
369
+ ry: 0,
370
+ shape: "rect"
371
+ }, de = {
372
+ arrowhead: "normal",
373
+ curve: G
374
+ };
375
+ function he(r) {
376
+ r.nodes().forEach((e) => {
377
+ const t = r.node(e);
378
+ !Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && I(t, {
379
+ paddingLeft: t.paddingX,
380
+ paddingRight: t.paddingX
381
+ }), Object.prototype.hasOwnProperty.call(t, "paddingY") && I(t, {
382
+ paddingTop: t.paddingY,
383
+ paddingBottom: t.paddingY
384
+ }), Object.prototype.hasOwnProperty.call(t, "padding") && I(t, {
385
+ paddingLeft: t.padding,
386
+ paddingRight: t.padding,
387
+ paddingTop: t.padding,
388
+ paddingBottom: t.padding
389
+ }), I(t, ce), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((n) => {
390
+ t[n] = Number(t[n]);
391
+ }), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
392
+ }), r.edges().forEach(function(e) {
393
+ var t = r.edge(e);
394
+ Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), I(t, de);
395
+ });
396
+ }
397
+ function ue(r) {
398
+ r.nodes().forEach((e) => {
399
+ var t = r.node(e);
400
+ 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;
401
+ });
402
+ }
403
+ function B(r, e) {
404
+ var t = r.select("g." + e);
405
+ return t.empty() && (t = r.append("g").attr("class", e)), t;
406
+ }
407
+ function ct(r, e, t) {
408
+ const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
409
+ { x: s / 2, y: 0 },
410
+ { x: s, y: -s / 2 },
411
+ { x: s / 2, y: -s },
412
+ { x: 0, y: -s / 2 }
413
+ ], o = N(r, s, s, i);
414
+ return t.intersect = function(c) {
415
+ return E(t, i, c);
416
+ }, o;
417
+ }
418
+ function dt(r, e, t) {
419
+ const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
420
+ { x: s, y: 0 },
421
+ { x: i - s, y: 0 },
422
+ { x: i, y: -a / 2 },
423
+ { x: i - s, y: -a },
424
+ { x: s, y: -a },
425
+ { x: 0, y: -a / 2 }
426
+ ], c = N(r, i, a, o);
427
+ return t.intersect = function(d) {
428
+ return E(t, o, d);
429
+ }, c;
430
+ }
431
+ function ht(r, e, t) {
432
+ const n = e.width, a = e.height, s = [
433
+ { x: -a / 2, y: 0 },
434
+ { x: n, y: 0 },
435
+ { x: n, y: -a },
436
+ { x: -a / 2, y: -a },
437
+ { x: 0, y: -a / 2 }
438
+ ], i = N(r, n, a, s);
439
+ return t.intersect = function(o) {
440
+ return E(t, s, o);
441
+ }, i;
442
+ }
443
+ function ut(r, e, t) {
444
+ const n = e.width, a = e.height, s = [
445
+ { x: -2 * a / 6, y: 0 },
446
+ { x: n - a / 6, y: 0 },
447
+ { x: n + 2 * a / 6, y: -a },
448
+ { x: a / 6, y: -a }
449
+ ], i = N(r, n, a, s);
450
+ return t.intersect = function(o) {
451
+ return E(t, s, o);
452
+ }, i;
453
+ }
454
+ function pt(r, e, t) {
455
+ const n = e.width, a = e.height, s = [
456
+ { x: 2 * a / 6, y: 0 },
457
+ { x: n + a / 6, y: 0 },
458
+ { x: n - 2 * a / 6, y: -a },
459
+ { x: -a / 6, y: -a }
460
+ ], i = N(r, n, a, s);
461
+ return t.intersect = function(o) {
462
+ return E(t, s, o);
463
+ }, i;
464
+ }
465
+ function ft(r, e, t) {
466
+ const n = e.width, a = e.height, s = [
467
+ { x: -2 * a / 6, y: 0 },
468
+ { x: n + 2 * a / 6, y: 0 },
469
+ { x: n - a / 6, y: -a },
470
+ { x: a / 6, y: -a }
471
+ ], i = N(r, n, a, s);
472
+ return t.intersect = function(o) {
473
+ return E(t, s, o);
474
+ }, i;
475
+ }
476
+ function yt(r, e, t) {
477
+ const n = e.width, a = e.height, s = [
478
+ { x: a / 6, y: 0 },
479
+ { x: n - a / 6, y: 0 },
480
+ { x: n + 2 * a / 6, y: -a },
481
+ { x: -2 * a / 6, y: -a }
482
+ ], i = N(r, n, a, s);
483
+ return t.intersect = function(o) {
484
+ return E(t, s, o);
485
+ }, i;
486
+ }
487
+ function vt(r, e, t) {
488
+ const n = e.width, a = e.height, s = [
489
+ { x: 0, y: 0 },
490
+ { x: n + a / 2, y: 0 },
491
+ { x: n, y: -a / 2 },
492
+ { x: n + a / 2, y: -a },
493
+ { x: 0, y: -a }
494
+ ], i = N(r, n, a, s);
495
+ return t.intersect = function(o) {
496
+ return E(t, s, o);
497
+ }, i;
498
+ }
499
+ function gt(r, e, t) {
500
+ 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);
501
+ return t.intersect = function(i) {
502
+ return Q(t, i);
503
+ }, s;
504
+ }
505
+ function wt(r, e, t) {
506
+ const n = e.width, a = e.height, s = [
507
+ { x: 0, y: 0 },
508
+ { x: n, y: 0 },
509
+ { x: n, y: -a },
510
+ { x: 0, y: -a },
511
+ { x: 0, y: 0 },
512
+ { x: -8, y: 0 },
513
+ { x: n + 8, y: 0 },
514
+ { x: n + 8, y: -a },
515
+ { x: -8, y: -a },
516
+ { x: -8, y: 0 }
517
+ ], i = N(r, n, a, s);
518
+ return t.intersect = function(o) {
519
+ return E(t, s, o);
520
+ }, i;
521
+ }
522
+ function mt(r, e, t) {
523
+ 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) + ")");
524
+ return t.intersect = function(d) {
525
+ const l = Q(t, d), y = l.x - t.x;
526
+ if (a != 0 && (Math.abs(y) < t.width / 2 || Math.abs(y) == t.width / 2 && Math.abs(l.y - t.y) > t.height / 2 - s)) {
527
+ let h = s * s * (1 - y * y / (a * a));
528
+ h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
529
+ }
530
+ return l;
531
+ }, c;
532
+ }
533
+ function pe(r) {
534
+ r.shapes().question = ct, r.shapes().hexagon = dt, r.shapes().stadium = gt, r.shapes().subroutine = wt, r.shapes().cylinder = mt, r.shapes().rect_left_inv_arrow = ht, r.shapes().lean_right = ut, r.shapes().lean_left = pt, r.shapes().trapezoid = ft, r.shapes().inv_trapezoid = yt, r.shapes().rect_right_inv_arrow = vt;
535
+ }
536
+ function fe(r) {
537
+ r({ question: ct }), r({ hexagon: dt }), r({ stadium: gt }), r({ subroutine: wt }), r({ cylinder: mt }), r({ rect_left_inv_arrow: ht }), r({ lean_right: ut }), r({ lean_left: pt }), r({ trapezoid: ft }), r({ inv_trapezoid: yt }), r({ rect_right_inv_arrow: vt });
538
+ }
539
+ function N(r, e, t, n) {
540
+ return r.insert("polygon", ":first-child").attr(
541
+ "points",
542
+ n.map(function(a) {
543
+ return a.x + "," + a.y;
544
+ }).join(" ")
545
+ ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
546
+ }
547
+ const ye = {
548
+ addToRender: pe,
549
+ addToRenderV2: fe
550
+ }, xt = {}, ve = function(r) {
551
+ const e = Object.keys(r);
552
+ for (const t of e)
553
+ xt[t] = r[t];
554
+ }, bt = async function(r, e, t, n, a, s) {
555
+ const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, c = Object.keys(r);
556
+ for (const d of c) {
557
+ const l = r[d];
558
+ let y = "default";
559
+ l.classes.length > 0 && (y = l.classes.join(" "));
560
+ const h = V(l.styles);
561
+ let u = l.text !== void 0 ? l.text : l.id, f;
562
+ if (Z(D().flowchart.htmlLabels)) {
563
+ const v = {
564
+ label: await tt(
565
+ u.replace(
566
+ /fa[blrs]?:fa-[\w-]+/g,
567
+ // cspell:disable-line
568
+ (k) => `<i class='${k.replace(":", " ")}'></i>`
569
+ ),
570
+ D()
571
+ )
572
+ };
573
+ f = at(i, v).node(), f.parentNode.removeChild(f);
574
+ } else {
575
+ const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
576
+ v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
577
+ const k = u.split(et.lineBreakRegex);
578
+ for (const P of k) {
579
+ const L = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
580
+ L.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), L.setAttribute("dy", "1em"), L.setAttribute("x", "1"), L.textContent = P, v.appendChild(L);
581
+ }
582
+ f = v;
583
+ }
584
+ let g = 0, p = "";
585
+ switch (l.type) {
586
+ case "round":
587
+ g = 5, p = "rect";
588
+ break;
589
+ case "square":
590
+ p = "rect";
591
+ break;
592
+ case "diamond":
593
+ p = "question";
594
+ break;
595
+ case "hexagon":
596
+ p = "hexagon";
597
+ break;
598
+ case "odd":
599
+ p = "rect_left_inv_arrow";
600
+ break;
601
+ case "lean_right":
602
+ p = "lean_right";
603
+ break;
604
+ case "lean_left":
605
+ p = "lean_left";
606
+ break;
607
+ case "trapezoid":
608
+ p = "trapezoid";
609
+ break;
610
+ case "inv_trapezoid":
611
+ p = "inv_trapezoid";
612
+ break;
613
+ case "odd_right":
614
+ p = "rect_left_inv_arrow";
615
+ break;
616
+ case "circle":
617
+ p = "circle";
618
+ break;
619
+ case "ellipse":
620
+ p = "ellipse";
621
+ break;
622
+ case "stadium":
623
+ p = "stadium";
624
+ break;
625
+ case "subroutine":
626
+ p = "subroutine";
627
+ break;
628
+ case "cylinder":
629
+ p = "cylinder";
630
+ break;
631
+ case "group":
632
+ p = "rect";
633
+ break;
634
+ default:
635
+ p = "rect";
636
+ }
637
+ M.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
638
+ labelType: "svg",
639
+ labelStyle: h.labelStyle,
640
+ shape: p,
641
+ label: f,
642
+ rx: g,
643
+ ry: g,
644
+ class: y,
645
+ style: h.style,
646
+ id: s.db.lookUpDomId(l.id)
647
+ });
648
+ }
649
+ }, kt = async function(r, e, t) {
650
+ let n = 0, a, s;
651
+ if (r.defaultStyle !== void 0) {
652
+ const i = V(r.defaultStyle);
653
+ a = i.style, s = i.labelStyle;
654
+ }
655
+ for (const i of r) {
656
+ n++;
657
+ const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
658
+ i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
659
+ let y = "", h = "";
660
+ if (i.style !== void 0) {
661
+ const u = V(i.style);
662
+ y = u.style, h = u.labelStyle;
663
+ } else
664
+ switch (i.stroke) {
665
+ case "normal":
666
+ y = "fill:none", a !== void 0 && (y = a), s !== void 0 && (h = s);
667
+ break;
668
+ case "dotted":
669
+ y = "fill:none;stroke-width:2px;stroke-dasharray:3;";
670
+ break;
671
+ case "thick":
672
+ y = " stroke-width: 3.5px;fill:none";
673
+ break;
674
+ }
675
+ l.style = y, l.labelStyle = h, i.interpolate !== void 0 ? l.curve = W(i.interpolate, G) : r.defaultInterpolate !== void 0 ? l.curve = W(r.defaultInterpolate, G) : l.curve = W(xt.curve, G), i.text === void 0 ? i.style !== void 0 && (l.arrowheadStyle = "fill: #333") : (l.arrowheadStyle = "fill: #333", l.labelpos = "c", Z(D().flowchart.htmlLabels) ? (l.labelType = "html", l.label = `<span id="L-${o}" class="edgeLabel L-${c}' L-${d}" style="${l.labelStyle}">${await tt(
676
+ i.text.replace(
677
+ /fa[blrs]?:fa-[\w-]+/g,
678
+ // cspell:disable-line
679
+ (u) => `<i class='${u.replace(":", " ")}'></i>`
680
+ ),
681
+ D()
682
+ )}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
683
+ `), 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);
684
+ }
685
+ }, ge = function(r, e) {
686
+ return M.info("Extracting classes"), e.db.getClasses();
687
+ }, we = async function(r, e, t, n) {
688
+ M.info("Drawing flowchart");
689
+ const { securityLevel: a, flowchart: s } = D();
690
+ let i;
691
+ a === "sandbox" && (i = x("#i" + e));
692
+ const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
693
+ let d = n.db.getDirection();
694
+ d === void 0 && (d = "TD");
695
+ const l = s.nodeSpacing || 50, y = s.rankSpacing || 50, h = new Tt({
696
+ multigraph: !0,
697
+ compound: !0
698
+ }).setGraph({
699
+ rankdir: d,
700
+ nodesep: l,
701
+ ranksep: y,
702
+ marginx: 8,
703
+ marginy: 8
704
+ }).setDefaultEdgeLabel(function() {
705
+ return {};
706
+ });
707
+ let u;
708
+ const f = n.db.getSubGraphs();
709
+ for (let w = f.length - 1; w >= 0; w--)
710
+ u = f[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
711
+ const g = n.db.getVertices();
712
+ M.warn("Get vertices", g);
713
+ const p = n.db.getEdges();
714
+ let v = 0;
715
+ for (v = f.length - 1; v >= 0; v--) {
716
+ u = f[v], Pt("cluster").append("text");
717
+ for (let w = 0; w < u.nodes.length; w++)
718
+ M.warn(
719
+ "Setting subgraph",
720
+ u.nodes[w],
721
+ n.db.lookUpDomId(u.nodes[w]),
722
+ n.db.lookUpDomId(u.id)
723
+ ), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
724
+ }
725
+ await bt(g, h, e, o, c, n), await kt(p, h, n);
726
+ const k = new le();
727
+ ye.addToRender(k), k.arrows().none = function(b, S, m, C) {
728
+ const A = b.append("marker").attr("id", S).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");
729
+ T(A, m[C + "Style"]);
730
+ }, k.arrows().normal = function(b, S) {
731
+ b.append("marker").attr("id", S).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");
732
+ };
733
+ const P = o.select(`[id="${e}"]`), L = o.select("#" + e + " g");
734
+ for (k(L, h), L.selectAll("g.node").attr("title", function() {
735
+ return n.db.getTooltip(this.id);
736
+ }), n.db.indexNodes("subGraph" + v), v = 0; v < f.length; v++)
737
+ if (u = f[v], u.title !== "undefined") {
738
+ const w = c.querySelectorAll(
739
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
740
+ ), b = c.querySelectorAll(
741
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
742
+ ), S = w[0].x.baseVal.value, m = w[0].y.baseVal.value, C = w[0].width.baseVal.value, A = x(b[0]).select(".label");
743
+ A.attr("transform", `translate(${S + C / 2}, ${m + 14})`), A.attr("id", e + "Text");
744
+ for (let U = 0; U < u.classes.length; U++)
745
+ b[0].classList.add(u.classes[U]);
746
+ }
747
+ if (!s.htmlLabels) {
748
+ const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
749
+ for (const b of w) {
750
+ const S = b.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
751
+ m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", S.width), m.setAttribute("height", S.height), b.insertBefore(m, b.firstChild);
752
+ }
753
+ }
754
+ Lt(h, P, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
755
+ const b = g[w];
756
+ if (b.link) {
757
+ const S = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
758
+ if (S) {
759
+ const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
760
+ m.setAttributeNS("http://www.w3.org/2000/svg", "class", b.classes.join(" ")), m.setAttributeNS("http://www.w3.org/2000/svg", "href", b.link), m.setAttributeNS("http://www.w3.org/2000/svg", "rel", "noopener"), a === "sandbox" ? m.setAttributeNS("http://www.w3.org/2000/svg", "target", "_top") : b.linkTarget && m.setAttributeNS("http://www.w3.org/2000/svg", "target", b.linkTarget);
761
+ const C = S.insert(function() {
762
+ return m;
763
+ }, ":first-child"), R = S.select(".label-container");
764
+ R && C.append(function() {
765
+ return R.node();
766
+ });
767
+ const A = S.select(".label");
768
+ A && C.append(function() {
769
+ return A.node();
770
+ });
771
+ }
772
+ }
773
+ });
774
+ }, me = {
775
+ setConf: ve,
776
+ addVertices: bt,
777
+ addEdges: kt,
778
+ getClasses: ge,
779
+ draw: we
780
+ }, Ne = {
781
+ parser: St,
782
+ db: $,
783
+ renderer: At,
784
+ styles: Nt,
785
+ init: (r) => {
786
+ r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, me.setConf(r.flowchart), $.clear(), $.setGen("gen-1");
787
+ }
788
+ };
789
+ export {
790
+ Ne as diagram
791
+ };