@layers-app/editor 0.7.47 → 0.7.49

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 (251) hide show
  1. package/README.md +830 -830
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +5 -5
  4. package/dist/index.js +4 -4
  5. package/dist/layers.2sxk2h9p.js +423 -0
  6. package/dist/layers.3fhqDXGQ.js +32 -0
  7. package/dist/layers.52famHy6.js +1 -0
  8. package/dist/layers.6LJL3iMX.js +960 -0
  9. package/dist/layers.6lVF0vjp.js +806 -0
  10. package/dist/layers.6vQhCrMO.js +42 -0
  11. package/dist/layers.7JqFgE4-.js +15 -0
  12. package/dist/layers.8jPh7nZ7.js +10 -0
  13. package/dist/layers.9YYn67yF.js +34 -0
  14. package/dist/layers.9o0Jdg-U.js +36 -0
  15. package/dist/layers.9pNaFvaX.js +1 -0
  16. package/dist/layers.B0L7owR9.js +1286 -0
  17. package/dist/layers.B124trWB.js +40 -0
  18. package/dist/layers.B19hGmey.js +1 -0
  19. package/dist/layers.B3D4g2HH.js +1 -0
  20. package/dist/layers.B4bJKqOt.js +1 -0
  21. package/dist/layers.B50R5EaK.js +41 -0
  22. package/dist/layers.B74E_Mhu.js +6 -0
  23. package/dist/layers.B7K7JjK6.js +1510 -0
  24. package/dist/layers.B7c71bAt.js +32 -0
  25. package/dist/layers.B96L1hG2.js +11 -0
  26. package/dist/layers.B9Rx2foX.js +805 -0
  27. package/dist/layers.BAtv1CM7.js +1 -0
  28. package/dist/layers.BB461pvX.js +1 -0
  29. package/dist/layers.BBix4GLX.js +76 -0
  30. package/dist/layers.BIeVwYKL.js +1 -0
  31. package/dist/layers.BJDrjORS.js +244 -0
  32. package/dist/layers.BKyEhTMV.js +41 -0
  33. package/dist/layers.BLUQsSE-.js +9 -0
  34. package/dist/layers.BLd2spTm.js +1 -0
  35. package/dist/layers.BNuBcDIb.js +35 -0
  36. package/dist/layers.BPHAY1-9.js +22 -0
  37. package/dist/layers.BQ2I5acy.js +9 -0
  38. package/dist/layers.BRWyWzwh.js +10 -0
  39. package/dist/layers.BS6VvqxC.js +40 -0
  40. package/dist/layers.BSTBZrFn.js +1 -0
  41. package/dist/layers.BTbPm8pR.js +39 -0
  42. package/dist/layers.BV-egvVp.js +8 -0
  43. package/dist/layers.BVr10oU3.js +9 -0
  44. package/dist/layers.BWw1mK7X.js +10 -0
  45. package/dist/layers.BXIUEFQw.js +37 -0
  46. package/dist/layers.BXS2uNb0.js +40 -0
  47. package/dist/layers.BaGJS1l7.js +40 -0
  48. package/dist/layers.BbCfEXyj.js +55 -0
  49. package/dist/layers.Bc8eVF2x.js +10 -0
  50. package/dist/layers.BdYtCOnE.js +11 -0
  51. package/dist/layers.Be6CBZHC.js +2 -0
  52. package/dist/layers.BeKf3u57.js +5 -0
  53. package/dist/layers.BgQO_ULY.js +207 -0
  54. package/dist/layers.BhDueLVc.js +40 -0
  55. package/dist/layers.BhDyoOpp.js +1089 -0
  56. package/dist/layers.BiakMAVz.js +36 -0
  57. package/dist/layers.BpilXLfW.js +6 -0
  58. package/dist/layers.Bpw9JnCv.js +52 -0
  59. package/dist/layers.Bq2f36dx.js +1 -0
  60. package/dist/layers.BsA7eoz8.js +2966 -0
  61. package/dist/layers.BsxmtGhi.js +4 -0
  62. package/dist/layers.BszXwlqm.js +1 -0
  63. package/dist/layers.Bt2v9ZR3.js +44 -0
  64. package/dist/layers.BtKGefaP.js +39 -0
  65. package/dist/layers.BtLFUN9L.js +33 -0
  66. package/dist/layers.BtTn3DWi.js +1 -0
  67. package/dist/layers.BtWDGtLj.js +160 -0
  68. package/dist/layers.Bw7qkQsX.js +8 -0
  69. package/dist/layers.BwxPrRZD.js +4 -0
  70. package/dist/layers.Bxcxrsy_.js +1583 -0
  71. package/dist/layers.C-XVPziT.js +1 -0
  72. package/dist/layers.C3E0dLDD.js +37 -0
  73. package/dist/layers.C3ctqQ_d.js +1225 -0
  74. package/dist/layers.C57RR3BP.js +5 -0
  75. package/dist/layers.C5TvEQpd.js +4 -0
  76. package/dist/layers.C5XJmJhy.js +794 -0
  77. package/dist/layers.C5XRUPsP.js +504 -0
  78. package/dist/layers.C6lFx_9o.js +32 -0
  79. package/dist/layers.C6vIa6gn.js +11 -0
  80. package/dist/layers.C8_lu5UH.js +23 -0
  81. package/dist/layers.CAXlMwAW.js +7 -0
  82. package/dist/layers.CBwlQeze.js +38 -0
  83. package/dist/layers.CCVxi5hB.js +1 -0
  84. package/dist/layers.CDVEdgbo.js +10 -0
  85. package/dist/layers.CEWorf-C.js +7 -0
  86. package/dist/layers.CFHq5644.js +10 -0
  87. package/dist/layers.CG7r3vnU.js +41 -0
  88. package/dist/layers.CGJlI-Xk.js +37 -0
  89. package/dist/layers.CHZsXQcr.js +1 -0
  90. package/dist/layers.CHh5bEfC.js +41 -0
  91. package/dist/layers.CI55as3L.js +205 -0
  92. package/dist/layers.CIleDfVS.js +21941 -0
  93. package/dist/layers.CImHWuWy.js +1 -0
  94. package/dist/layers.CJaUnfvI.js +122 -0
  95. package/dist/layers.CKmkJeNx.js +8 -0
  96. package/dist/layers.CLCDYoNw.js +40 -0
  97. package/dist/layers.CLLW_-MM.js +1 -0
  98. package/dist/{layers.Hq0pIRX3.js → layers.CLSq6d5G.js} +21 -21
  99. package/dist/layers.CPK-8aJ9.js +8 -0
  100. package/dist/layers.CQrT2kiR.js +4 -0
  101. package/dist/layers.CROEZPe3.js +1 -0
  102. package/dist/layers.CTizu7k3.js +1 -0
  103. package/dist/layers.CTtXyJIC.js +51 -0
  104. package/dist/layers.CUFmR0uO.js +2238 -0
  105. package/dist/layers.CUQCdPfS.js +1 -0
  106. package/dist/layers.CXwIo_E2.js +934 -0
  107. package/dist/layers.C_IvrzZ3.js +7 -0
  108. package/dist/layers.Cbh8488l.js +9 -0
  109. package/dist/layers.CeWHZgFl.js +223 -0
  110. package/dist/layers.ChByNJR4.js +1 -0
  111. package/dist/layers.CiayK_jX.js +7 -0
  112. package/dist/layers.CiloWOji.js +2 -0
  113. package/dist/layers.CivvhzLf.js +11 -0
  114. package/dist/layers.CjKkiQ-5.js +40 -0
  115. package/dist/layers.Cm1JRCTb.js +189 -0
  116. package/dist/layers.Cn0EJP31.js +1126 -0
  117. package/dist/layers.CoUMygdc.js +9 -0
  118. package/dist/layers.CqJ3U1Dv.js +1 -0
  119. package/dist/layers.CqVTtuYm.js +6 -0
  120. package/dist/layers.CrTPxY8M.js +40 -0
  121. package/dist/layers.CrhlCVRH.js +8 -0
  122. package/dist/layers.CvKfVfgR.js +41 -0
  123. package/dist/layers.Cw1UVYRF.js +39 -0
  124. package/dist/{layers.Cfvta__C.js → layers.Cw6AQ1zH.js} +1 -1
  125. package/dist/layers.Cw76BJN2.js +32 -0
  126. package/dist/layers.CxuRP1lw.js +6 -0
  127. package/dist/layers.Cyu04oeV.js +7 -0
  128. package/dist/layers.Cyzu9PKQ.js +1 -0
  129. package/dist/layers.CzYE0Ooc.js +42 -0
  130. package/dist/layers.D0zn4_Mx.js +1 -0
  131. package/dist/layers.D16HelAS.js +213 -0
  132. package/dist/layers.D1BZqHRU.js +38 -0
  133. package/dist/layers.D2PgPKOo.js +13 -0
  134. package/dist/layers.D4T8fTcj.js +1223 -0
  135. package/dist/layers.D5Kikhmz.js +295 -0
  136. package/dist/layers.D5vKDO3Z.js +1 -0
  137. package/dist/layers.D634RCv2.js +6 -0
  138. package/dist/layers.D6fxuXiV.js +39 -0
  139. package/dist/layers.D77Lwa5B.js +10 -0
  140. package/dist/layers.D7jGxypv.js +8 -0
  141. package/dist/layers.D9Aq-VH-.js +36 -0
  142. package/dist/layers.DAN-8W9x.js +48149 -0
  143. package/dist/layers.DB59_4ZT.js +118 -0
  144. package/dist/layers.DBKCfxsn.js +7 -0
  145. package/dist/layers.DC44PHoe.js +1 -0
  146. package/dist/layers.DDIKIPEl.js +425 -0
  147. package/dist/layers.DDNSbyH9.js +11 -0
  148. package/dist/layers.DE-1MOCW.js +6 -0
  149. package/dist/layers.DEJLOhUD.js +5 -0
  150. package/dist/layers.DF5Jf3M9.js +9 -0
  151. package/dist/layers.DFEtOzCz.js +37 -0
  152. package/dist/layers.DFiKSx4e.js +9 -0
  153. package/dist/layers.DGwBwWGl.js +373 -0
  154. package/dist/layers.DJtJoK2T.js +8 -0
  155. package/dist/layers.DJugFK-r.js +129 -0
  156. package/dist/layers.DJuxVMes.js +39 -0
  157. package/dist/layers.DLOvj2ew.js +70 -0
  158. package/dist/layers.DLmk4e9A.js +8 -0
  159. package/dist/layers.DLwuMfdd.js +84 -0
  160. package/dist/layers.DMRUFJsX.js +8 -0
  161. package/dist/layers.DMkBISW1.js +1 -0
  162. package/dist/layers.DN9HoVxI.js +18 -0
  163. package/dist/layers.DO0X6c0O.js +323 -0
  164. package/dist/layers.DOrgOHBr.js +1 -0
  165. package/dist/layers.DPlZKJgj.js +437 -0
  166. package/dist/layers.DQxhNW5R.js +9 -0
  167. package/dist/layers.DReq7_oC.js +296 -0
  168. package/dist/layers.DT9rsUtv.js +198 -0
  169. package/dist/layers.DU05EaWA.js +907 -0
  170. package/dist/layers.DUEmMZLx.js +41 -0
  171. package/dist/layers.DWAsYusl.js +116 -0
  172. package/dist/layers.DWYk3UK6.js +40 -0
  173. package/dist/layers.DWhMR9ZJ.js +139 -0
  174. package/dist/layers.DXS1j64l.js +271 -0
  175. package/dist/layers.DYURS4FP.js +84 -0
  176. package/dist/layers.D_RUDzWv.js +21620 -0
  177. package/dist/layers.DbVdGKld.js +1 -0
  178. package/dist/layers.DbaKVP5e.js +1 -0
  179. package/dist/layers.DcAdQwtK.js +7 -0
  180. package/dist/layers.DcMkjKaG.js +6 -0
  181. package/dist/layers.DgvrVyqi.js +96 -0
  182. package/dist/layers.Dhq37bku.js +10 -0
  183. package/dist/layers.DjUOC4st.js +16 -0
  184. package/dist/layers.DjkEwMtb.js +796 -0
  185. package/dist/layers.Dl8xQWMG.js +39 -0
  186. package/dist/layers.DlufDKX8.js +139 -0
  187. package/dist/layers.DnJXYiZP.js +40 -0
  188. package/dist/layers.DnXs_pNB.js +39 -0
  189. package/dist/layers.Do15drP1.js +3 -0
  190. package/dist/layers.DokfH0hd.js +39 -0
  191. package/dist/layers.DpNZa-jp.js +9 -0
  192. package/dist/layers.Dr3MCGOM.js +1088 -0
  193. package/dist/layers.DrQ8hvnX.js +5 -0
  194. package/dist/layers.DsptZoFe.js +42 -0
  195. package/dist/layers.DtD3skoW.js +1619 -0
  196. package/dist/layers.Dtms4fW5.js +5 -0
  197. package/dist/layers.Du0f9MLd.js +42 -0
  198. package/dist/layers.DuZA4Xas.js +32 -0
  199. package/dist/layers.Dwh8gx1i.js +1 -0
  200. package/dist/layers.DwizeusR.js +9 -0
  201. package/dist/layers.DxA6ocdw.js +70 -0
  202. package/dist/layers.Dy1naDTQ.js +14 -0
  203. package/dist/layers.DyL1tlRE.js +276 -0
  204. package/dist/layers.DyRolv1I.js +8 -0
  205. package/dist/layers.DzFqkluR.js +2482 -0
  206. package/dist/layers.DzSq4y89.js +14 -0
  207. package/dist/layers.Gsg2l9lj.js +1 -0
  208. package/dist/layers.H6NhhT0Z.js +35 -0
  209. package/dist/layers.JWCLFILJ.js +1 -0
  210. package/dist/{layers.BtvuN20E.js → layers.MmOx3Q5y.js} +10159 -9401
  211. package/dist/layers.NYVxQ2J0.js +38 -0
  212. package/dist/layers.Oz9AvXqT.js +772 -0
  213. package/dist/layers.R8mPlCA0.js +261 -0
  214. package/dist/layers.TMqEBNpX.js +1 -0
  215. package/dist/layers.Te010ICg.js +8583 -0
  216. package/dist/layers.VN0Yeq2V.js +1 -0
  217. package/dist/layers.WnvKMTKL.js +61 -0
  218. package/dist/layers.WxQ6m-UP.js +36 -0
  219. package/dist/layers.X0_Gx5lN.js +42 -0
  220. package/dist/layers.Y9FRICz5.js +10 -0
  221. package/dist/layers.ZGwk_KWb.js +7 -0
  222. package/dist/layers.b0h5ZBmD.js +61 -0
  223. package/dist/{layers.CsQlovyR.js → layers.b9B2NY7n.js} +1950 -2191
  224. package/dist/layers.blh6SXpL.js +8 -0
  225. package/dist/layers.d5j1lEFQ.js +2 -0
  226. package/dist/layers.eGX8dSo1.js +1 -0
  227. package/dist/layers.eIIS5NDC.js +1 -0
  228. package/dist/layers.fxqbBEns.js +35 -0
  229. package/dist/layers.hAT_4n_i.js +6 -0
  230. package/dist/layers.jPwVCOt0.js +39 -0
  231. package/dist/layers.jgfr1mFT.js +65 -0
  232. package/dist/layers.lCpg7dOn.js +21 -0
  233. package/dist/layers.lMAyLkuo.js +1 -0
  234. package/dist/layers.lX16IRwc.js +10 -0
  235. package/dist/layers.oFuJymzn.js +41 -0
  236. package/dist/layers.p872qi0O.js +1034 -0
  237. package/dist/layers.pHpJOB6N.js +1 -0
  238. package/dist/layers.pgbpWh46.js +84 -0
  239. package/dist/layers.pixPTfNv.js +33 -0
  240. package/dist/layers.rmoiicvu.js +41 -0
  241. package/dist/layers.rvTNl4lr.js +7 -0
  242. package/dist/layers.ssiSYLMt.js +32 -0
  243. package/dist/layers.xcmbrsYu.js +257 -0
  244. package/dist/layers.xtkyz0Y7.js +1268 -0
  245. package/package.json +2 -2
  246. package/dist/layers.B88sQYuh.js +0 -297
  247. package/dist/layers.BgMykHnn.js +0 -154
  248. package/dist/layers.Ct1ojjl3.js +0 -1
  249. package/dist/layers.JT_kEFH5.js +0 -129
  250. package/dist/layers.NW1lST7i.js +0 -1
  251. package/dist/layers.pwc3O6Es.js +0 -261
@@ -0,0 +1,794 @@
1
+ import { f as $, p as St } from "./layers.Cn0EJP31.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.Te010ICg.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.DPlZKJgj.js";
8
+ import { l as Ct } from "./layers.pixPTfNv.js";
9
+ import "./layers.D_RUDzWv.js";
10
+ import "lodash-es/memoize.js";
11
+ import "lodash-es/merge.js";
12
+ import "lodash-es/isEmpty.js";
13
+ function It(r) {
14
+ if (!r.ok) throw new Error(r.status + " " + r.statusText);
15
+ return r.text();
16
+ }
17
+ function Bt(r, e) {
18
+ return fetch(r, e).then(It);
19
+ }
20
+ function Mt(r) {
21
+ return (e, t) => Bt(e, t).then((n) => new DOMParser().parseFromString(n, r));
22
+ }
23
+ var Dt = Mt("image/svg+xml"), z = {
24
+ normal: Gt,
25
+ vee: Ot,
26
+ undirected: Ut
27
+ };
28
+ function Rt(r) {
29
+ z = r;
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 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
33
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
34
+ }
35
+ function Ot(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 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width", 1).style("stroke-dasharray", "1,0");
37
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
38
+ }
39
+ function Ut(r, e, t, n) {
40
+ 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");
41
+ T(s, t[n + "Style"]), t[n + "Class"] && s.attr("class", t[n + "Class"]);
42
+ }
43
+ function $t(r, e) {
44
+ var t = r;
45
+ return t.node().appendChild(e.label), T(t, e.labelStyle), t;
46
+ }
47
+ function Wt(r, e) {
48
+ for (var t = r.append("text"), n = Vt(e.label).split(`
49
+ `), a = 0; a < n.length; a++)
50
+ t.append("tspan").attr("xml:space", "preserve").attr("dy", "1em").attr("x", "1").text(n[a]);
51
+ return T(t, e.labelStyle), t;
52
+ }
53
+ function Vt(r) {
54
+ for (var e = "", t = !1, n, a = 0; a < r.length; ++a)
55
+ if (n = r[a], t) {
56
+ switch (n) {
57
+ case "n":
58
+ e += `
59
+ `;
60
+ break;
61
+ default:
62
+ e += n;
63
+ }
64
+ t = !1;
65
+ } else n === "\\" ? t = !0 : e += n;
66
+ return e;
67
+ }
68
+ function q(r, e, t) {
69
+ var n = e.label, a = r.append("g");
70
+ e.labelType === "svg" ? $t(a, e) : typeof n != "string" || e.labelType === "html" ? at(a, e) : Wt(a, e);
71
+ var s = a.node().getBBox(), i;
72
+ switch (t) {
73
+ case "top":
74
+ i = -e.height / 2;
75
+ break;
76
+ case "bottom":
77
+ i = e.height / 2 - s.height;
78
+ break;
79
+ default:
80
+ i = -s.height / 2;
81
+ }
82
+ return a.attr("transform", "translate(" + -s.width / 2 + "," + i + ")"), a;
83
+ }
84
+ var Y = function(r, e) {
85
+ var t = e.nodes().filter(function(s) {
86
+ return nt(e, s);
87
+ }), n = r.selectAll("g.cluster").data(t, function(s) {
88
+ return s;
89
+ });
90
+ _(n.exit(), e).style("opacity", 0).remove();
91
+ var a = n.enter().append("g").attr("class", "cluster").attr("id", function(s) {
92
+ var i = e.node(s);
93
+ return i.id;
94
+ }).style("opacity", 0).each(function(s) {
95
+ var i = e.node(s), o = x(this);
96
+ x(this).append("rect");
97
+ var c = o.append("g").attr("class", "label");
98
+ q(c, i, i.clusterLabelPos);
99
+ });
100
+ return n = n.merge(a), n = _(n, e).style("opacity", 1), n.selectAll("rect").each(function(s) {
101
+ var i = e.node(s), o = x(this);
102
+ T(o, i.style);
103
+ }), n;
104
+ };
105
+ function zt(r) {
106
+ Y = r;
107
+ }
108
+ let H = function(r, e) {
109
+ var t = r.selectAll("g.edgeLabel").data(e.edges(), function(a) {
110
+ return st(a);
111
+ }).classed("update", !0);
112
+ t.exit().remove(), t.enter().append("g").classed("edgeLabel", !0).style("opacity", 0), t = r.selectAll("g.edgeLabel"), t.each(function(a) {
113
+ var s = x(this);
114
+ s.select(".label").remove();
115
+ var i = e.edge(a), o = q(s, e.edge(a), 0).classed("label", !0), c = o.node().getBBox();
116
+ 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);
117
+ });
118
+ var n;
119
+ return t.exit ? n = t.exit() : n = t.selectAll(null), _(n, e).style("opacity", 0).remove(), t;
120
+ };
121
+ function Yt(r) {
122
+ H = r;
123
+ }
124
+ function K(r, e) {
125
+ return r.intersect(e);
126
+ }
127
+ var X = function(r, e, t) {
128
+ var n = r.selectAll("g.edgePath").data(e.edges(), function(i) {
129
+ return st(i);
130
+ }).classed("update", !0), a = qt(n, e);
131
+ Qt(n, e);
132
+ var s = n.merge !== void 0 ? n.merge(a) : n;
133
+ return _(s, e).style("opacity", 1), s.each(function(i) {
134
+ var o = x(this), c = e.edge(i);
135
+ c.elem = this, c.id && o.attr("id", c.id), it(
136
+ o,
137
+ c.class,
138
+ (o.classed("update") ? "update " : "") + "edgePath"
139
+ );
140
+ }), s.selectAll("path.path").each(function(i) {
141
+ var o = e.edge(i);
142
+ o.arrowheadId = rt.uniqueId("arrowhead");
143
+ var c = x(this).attr("marker-end", function() {
144
+ return "url(" + Xt(location.href, o.arrowheadId) + ")";
145
+ }).style("fill", "none");
146
+ _(c, e).attr("d", function(d) {
147
+ return Ft(e, d);
148
+ }), T(c, o.style);
149
+ }), s.selectAll("defs *").remove(), s.selectAll("defs").each(function(i) {
150
+ var o = e.edge(i), c = t[o.arrowhead];
151
+ c(x(this), o.arrowheadId, o, "arrowhead");
152
+ }), s;
153
+ };
154
+ function Ht(r) {
155
+ X = r;
156
+ }
157
+ function Xt(r, e) {
158
+ var t = r.split("#")[0];
159
+ return t + "#" + e;
160
+ }
161
+ function Ft(r, e) {
162
+ var t = r.edge(e), n = r.node(e.v), a = r.node(e.w), s = t.points.slice(1, t.points.length - 1);
163
+ return s.unshift(K(n, s[0])), s.push(K(a, s[s.length - 1])), ot(t, s);
164
+ }
165
+ function ot(r, e) {
166
+ var t = (Ct || Dt.line)().x(function(n) {
167
+ return n.x;
168
+ }).y(function(n) {
169
+ return n.y;
170
+ });
171
+ return (t.curve || t.interpolate)(r.curve), t(e);
172
+ }
173
+ function jt(r) {
174
+ var e = r.getBBox(), t = r.ownerSVGElement.getScreenCTM().inverse().multiply(r.getScreenCTM()).translate(e.width / 2, e.height / 2);
175
+ return { x: t.e, y: t.f };
176
+ }
177
+ function qt(r, e) {
178
+ var t = r.enter().append("g").attr("class", "edgePath").style("opacity", 0);
179
+ return t.append("path").attr("class", "path").attr("d", function(n) {
180
+ var a = e.edge(n), s = e.node(n.v).elem, i = rt.range(a.points.length).map(function() {
181
+ return jt(s);
182
+ });
183
+ return ot(a, i);
184
+ }), t.append("defs"), t;
185
+ }
186
+ function Qt(r, e) {
187
+ var t = r.exit();
188
+ _(t, e).style("opacity", 0).remove();
189
+ }
190
+ var F = function(r, e, t) {
191
+ var n = e.nodes().filter(function(i) {
192
+ return !nt(e, i);
193
+ }), a = r.selectAll("g.node").data(n, function(i) {
194
+ return i;
195
+ }).classed("update", !0);
196
+ a.exit().remove(), a.enter().append("g").attr("class", "node").style("opacity", 0), a = r.selectAll("g.node"), a.each(function(i) {
197
+ var o = e.node(i), c = x(this);
198
+ it(
199
+ c,
200
+ o.class,
201
+ (c.classed("update") ? "update " : "") + "node"
202
+ ), c.select("g.label").remove();
203
+ var d = c.append("g").attr("class", "label"), l = q(d, o), y = t[o.shape], h = _t(l.node().getBBox(), "width", "height");
204
+ 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(
205
+ "transform",
206
+ "translate(" + (o.paddingLeft - o.paddingRight) / 2 + "," + (o.paddingTop - o.paddingBottom) / 2 + ")"
207
+ );
208
+ var u = x(this);
209
+ u.select(".label-container").remove();
210
+ var f = y(u, h, o).classed("label-container", !0);
211
+ T(f, o.style);
212
+ var g = f.node().getBBox();
213
+ o.width = g.width, o.height = g.height;
214
+ });
215
+ var s;
216
+ return a.exit ? s = a.exit() : s = a.selectAll(null), _(s, e).style("opacity", 0).remove(), a;
217
+ };
218
+ function Kt(r) {
219
+ F = r;
220
+ }
221
+ function Jt(r, e) {
222
+ var t = r.filter(function() {
223
+ return !x(this).classed("update");
224
+ });
225
+ function n(a) {
226
+ var s = e.node(a);
227
+ return "translate(" + s.x + "," + s.y + ")";
228
+ }
229
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n), _(t.selectAll("rect"), e).attr("width", function(a) {
230
+ return e.node(a).width;
231
+ }).attr("height", function(a) {
232
+ return e.node(a).height;
233
+ }).attr("x", function(a) {
234
+ var s = e.node(a);
235
+ return -s.width / 2;
236
+ }).attr("y", function(a) {
237
+ var s = e.node(a);
238
+ return -s.height / 2;
239
+ });
240
+ }
241
+ function Zt(r, e) {
242
+ var t = r.filter(function() {
243
+ return !x(this).classed("update");
244
+ });
245
+ function n(a) {
246
+ var s = e.edge(a);
247
+ return Object.prototype.hasOwnProperty.call(s, "x") ? "translate(" + s.x + "," + s.y + ")" : "";
248
+ }
249
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
250
+ }
251
+ function te(r, e) {
252
+ var t = r.filter(function() {
253
+ return !x(this).classed("update");
254
+ });
255
+ function n(a) {
256
+ var s = e.node(a);
257
+ return "translate(" + s.x + "," + s.y + ")";
258
+ }
259
+ t.attr("transform", n), _(r, e).style("opacity", 1).attr("transform", n);
260
+ }
261
+ function lt(r, e, t, n) {
262
+ 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);
263
+ n.x < a && (d = -d);
264
+ var l = Math.abs(e * t * o / c);
265
+ return n.y < s && (l = -l), { x: a + d, y: s + l };
266
+ }
267
+ function ee(r, e, t) {
268
+ return lt(r, e, e, t);
269
+ }
270
+ function re(r, e, t, n) {
271
+ var a, s, i, o, c, d, l, y, h, u, f, g, p, v, k;
272
+ 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)))
273
+ 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 };
274
+ }
275
+ function J(r, e) {
276
+ return r * e > 0;
277
+ }
278
+ function E(r, e, t) {
279
+ var n = r.x, a = r.y, s = [], i = Number.POSITIVE_INFINITY, o = Number.POSITIVE_INFINITY;
280
+ e.forEach(function(f) {
281
+ i = Math.min(i, f.x), o = Math.min(o, f.y);
282
+ });
283
+ for (var c = n - r.width / 2 - i, d = a - r.height / 2 - o, l = 0; l < e.length; l++) {
284
+ var y = e[l], h = e[l < e.length - 1 ? l + 1 : 0], u = re(
285
+ r,
286
+ t,
287
+ { x: c + y.x, y: d + y.y },
288
+ { x: c + h.x, y: d + h.y }
289
+ );
290
+ u && s.push(u);
291
+ }
292
+ return s.length ? (s.length > 1 && s.sort(function(f, g) {
293
+ 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);
294
+ return k < O ? -1 : k === O ? 0 : 1;
295
+ }), s[0]) : (console.log("NO INTERSECTION FOUND, RETURN NODE CENTER", r), r);
296
+ }
297
+ function Q(r, e) {
298
+ 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;
299
+ 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 };
300
+ }
301
+ var j = {
302
+ rect: ne,
303
+ ellipse: se,
304
+ circle: ie,
305
+ diamond: oe
306
+ };
307
+ function ae(r) {
308
+ j = r;
309
+ }
310
+ function ne(r, e, t) {
311
+ 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);
312
+ return t.intersect = function(a) {
313
+ return Q(t, a);
314
+ }, n;
315
+ }
316
+ function se(r, e, t) {
317
+ 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);
318
+ return t.intersect = function(i) {
319
+ return lt(t, n, a, i);
320
+ }, s;
321
+ }
322
+ function ie(r, e, t) {
323
+ 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);
324
+ return t.intersect = function(s) {
325
+ return ee(t, n, s);
326
+ }, a;
327
+ }
328
+ function oe(r, e, t) {
329
+ var n = e.width * Math.SQRT2 / 2, a = e.height * Math.SQRT2 / 2, s = [
330
+ { x: 0, y: -a },
331
+ { x: -n, y: 0 },
332
+ { x: 0, y: a },
333
+ { x: n, y: 0 }
334
+ ], i = r.insert("polygon", ":first-child").attr(
335
+ "points",
336
+ s.map(function(o) {
337
+ return o.x + "," + o.y;
338
+ }).join(" ")
339
+ );
340
+ return t.intersect = function(o) {
341
+ return E(t, s, o);
342
+ }, i;
343
+ }
344
+ function le() {
345
+ var r = function(e, t) {
346
+ he(t);
347
+ 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);
348
+ Et(t), te(o, t), Zt(i, t), X(s, t, z);
349
+ var c = Y(a, t);
350
+ Jt(c, t), ue(t);
351
+ };
352
+ return r.createNodes = function(e) {
353
+ return arguments.length ? (Kt(e), r) : F;
354
+ }, r.createClusters = function(e) {
355
+ return arguments.length ? (zt(e), r) : Y;
356
+ }, r.createEdgeLabels = function(e) {
357
+ return arguments.length ? (Yt(e), r) : H;
358
+ }, r.createEdgePaths = function(e) {
359
+ return arguments.length ? (Ht(e), r) : X;
360
+ }, r.shapes = function(e) {
361
+ return arguments.length ? (ae(e), r) : j;
362
+ }, r.arrows = function(e) {
363
+ return arguments.length ? (Rt(e), r) : z;
364
+ }, r;
365
+ }
366
+ var ce = {
367
+ paddingLeft: 10,
368
+ paddingRight: 10,
369
+ paddingTop: 10,
370
+ paddingBottom: 10,
371
+ rx: 0,
372
+ ry: 0,
373
+ shape: "rect"
374
+ }, de = {
375
+ arrowhead: "normal",
376
+ curve: G
377
+ };
378
+ function he(r) {
379
+ r.nodes().forEach((e) => {
380
+ const t = r.node(e);
381
+ !Object.prototype.hasOwnProperty.call(t, "label") && !r.children(e).length && (t.label = e), Object.prototype.hasOwnProperty.call(t, "paddingX") && I(t, {
382
+ paddingLeft: t.paddingX,
383
+ paddingRight: t.paddingX
384
+ }), Object.prototype.hasOwnProperty.call(t, "paddingY") && I(t, {
385
+ paddingTop: t.paddingY,
386
+ paddingBottom: t.paddingY
387
+ }), Object.prototype.hasOwnProperty.call(t, "padding") && I(t, {
388
+ paddingLeft: t.padding,
389
+ paddingRight: t.padding,
390
+ paddingTop: t.padding,
391
+ paddingBottom: t.padding
392
+ }), I(t, ce), ["paddingLeft", "paddingRight", "paddingTop", "paddingBottom"].forEach((n) => {
393
+ t[n] = Number(t[n]);
394
+ }), Object.prototype.hasOwnProperty.call(t, "width") && (t._prevWidth = t.width), Object.prototype.hasOwnProperty.call(t, "height") && (t._prevHeight = t.height);
395
+ }), r.edges().forEach(function(e) {
396
+ var t = r.edge(e);
397
+ Object.prototype.hasOwnProperty.call(t, "label") || (t.label = ""), I(t, de);
398
+ });
399
+ }
400
+ function ue(r) {
401
+ r.nodes().forEach((e) => {
402
+ var t = r.node(e);
403
+ 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;
404
+ });
405
+ }
406
+ function B(r, e) {
407
+ var t = r.select("g." + e);
408
+ return t.empty() && (t = r.append("g").attr("class", e)), t;
409
+ }
410
+ function ct(r, e, t) {
411
+ const n = e.width, a = e.height, s = (n + a) * 0.9, i = [
412
+ { x: s / 2, y: 0 },
413
+ { x: s, y: -s / 2 },
414
+ { x: s / 2, y: -s },
415
+ { x: 0, y: -s / 2 }
416
+ ], o = N(r, s, s, i);
417
+ return t.intersect = function(c) {
418
+ return E(t, i, c);
419
+ }, o;
420
+ }
421
+ function dt(r, e, t) {
422
+ const a = e.height, s = a / 4, i = e.width + 2 * s, o = [
423
+ { x: s, y: 0 },
424
+ { x: i - s, y: 0 },
425
+ { x: i, y: -a / 2 },
426
+ { x: i - s, y: -a },
427
+ { x: s, y: -a },
428
+ { x: 0, y: -a / 2 }
429
+ ], c = N(r, i, a, o);
430
+ return t.intersect = function(d) {
431
+ return E(t, o, d);
432
+ }, c;
433
+ }
434
+ function ht(r, e, t) {
435
+ const n = e.width, a = e.height, s = [
436
+ { x: -a / 2, y: 0 },
437
+ { x: n, y: 0 },
438
+ { x: n, y: -a },
439
+ { x: -a / 2, y: -a },
440
+ { x: 0, y: -a / 2 }
441
+ ], i = N(r, n, a, s);
442
+ return t.intersect = function(o) {
443
+ return E(t, s, o);
444
+ }, i;
445
+ }
446
+ function ut(r, e, t) {
447
+ const n = e.width, a = e.height, s = [
448
+ { x: -2 * a / 6, y: 0 },
449
+ { x: n - a / 6, y: 0 },
450
+ { x: n + 2 * a / 6, y: -a },
451
+ { x: a / 6, y: -a }
452
+ ], i = N(r, n, a, s);
453
+ return t.intersect = function(o) {
454
+ return E(t, s, o);
455
+ }, i;
456
+ }
457
+ function pt(r, e, t) {
458
+ const n = e.width, a = e.height, s = [
459
+ { x: 2 * a / 6, y: 0 },
460
+ { x: n + a / 6, y: 0 },
461
+ { x: n - 2 * a / 6, y: -a },
462
+ { x: -a / 6, y: -a }
463
+ ], i = N(r, n, a, s);
464
+ return t.intersect = function(o) {
465
+ return E(t, s, o);
466
+ }, i;
467
+ }
468
+ function ft(r, e, t) {
469
+ const n = e.width, a = e.height, s = [
470
+ { x: -2 * a / 6, y: 0 },
471
+ { x: n + 2 * a / 6, y: 0 },
472
+ { x: n - a / 6, y: -a },
473
+ { x: a / 6, y: -a }
474
+ ], i = N(r, n, a, s);
475
+ return t.intersect = function(o) {
476
+ return E(t, s, o);
477
+ }, i;
478
+ }
479
+ function yt(r, e, t) {
480
+ const n = e.width, a = e.height, s = [
481
+ { x: a / 6, y: 0 },
482
+ { x: n - a / 6, y: 0 },
483
+ { x: n + 2 * a / 6, y: -a },
484
+ { x: -2 * a / 6, y: -a }
485
+ ], i = N(r, n, a, s);
486
+ return t.intersect = function(o) {
487
+ return E(t, s, o);
488
+ }, i;
489
+ }
490
+ function vt(r, e, t) {
491
+ const n = e.width, a = e.height, s = [
492
+ { x: 0, y: 0 },
493
+ { x: n + a / 2, y: 0 },
494
+ { x: n, y: -a / 2 },
495
+ { x: n + a / 2, y: -a },
496
+ { x: 0, y: -a }
497
+ ], i = N(r, n, a, s);
498
+ return t.intersect = function(o) {
499
+ return E(t, s, o);
500
+ }, i;
501
+ }
502
+ function gt(r, e, t) {
503
+ 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);
504
+ return t.intersect = function(i) {
505
+ return Q(t, i);
506
+ }, s;
507
+ }
508
+ function wt(r, e, t) {
509
+ const n = e.width, a = e.height, s = [
510
+ { x: 0, y: 0 },
511
+ { x: n, y: 0 },
512
+ { x: n, y: -a },
513
+ { x: 0, y: -a },
514
+ { x: 0, y: 0 },
515
+ { x: -8, y: 0 },
516
+ { x: n + 8, y: 0 },
517
+ { x: n + 8, y: -a },
518
+ { x: -8, y: -a },
519
+ { x: -8, y: 0 }
520
+ ], i = N(r, n, a, s);
521
+ return t.intersect = function(o) {
522
+ return E(t, s, o);
523
+ }, i;
524
+ }
525
+ function mt(r, e, t) {
526
+ 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) + ")");
527
+ return t.intersect = function(d) {
528
+ const l = Q(t, d), y = l.x - t.x;
529
+ 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)) {
530
+ let h = s * s * (1 - y * y / (a * a));
531
+ h != 0 && (h = Math.sqrt(h)), h = s - h, d.y - t.y > 0 && (h = -h), l.y += h;
532
+ }
533
+ return l;
534
+ }, c;
535
+ }
536
+ function pe(r) {
537
+ 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;
538
+ }
539
+ function fe(r) {
540
+ 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 });
541
+ }
542
+ function N(r, e, t, n) {
543
+ return r.insert("polygon", ":first-child").attr(
544
+ "points",
545
+ n.map(function(a) {
546
+ return a.x + "," + a.y;
547
+ }).join(" ")
548
+ ).attr("transform", "translate(" + -e / 2 + "," + t / 2 + ")");
549
+ }
550
+ const ye = {
551
+ addToRender: pe,
552
+ addToRenderV2: fe
553
+ }, xt = {}, ve = function(r) {
554
+ const e = Object.keys(r);
555
+ for (const t of e)
556
+ xt[t] = r[t];
557
+ }, bt = async function(r, e, t, n, a, s) {
558
+ const i = n ? n.select(`[id="${t}"]`) : x(`[id="${t}"]`), o = a || document, c = Object.keys(r);
559
+ for (const d of c) {
560
+ const l = r[d];
561
+ let y = "default";
562
+ l.classes.length > 0 && (y = l.classes.join(" "));
563
+ const h = V(l.styles);
564
+ let u = l.text !== void 0 ? l.text : l.id, f;
565
+ if (Z(D().flowchart.htmlLabels)) {
566
+ const v = {
567
+ label: await tt(
568
+ u.replace(
569
+ /fa[blrs]?:fa-[\w-]+/g,
570
+ // cspell:disable-line
571
+ (k) => `<i class='${k.replace(":", " ")}'></i>`
572
+ ),
573
+ D()
574
+ )
575
+ };
576
+ f = at(i, v).node(), f.parentNode.removeChild(f);
577
+ } else {
578
+ const v = o.createElementNS("http://www.w3.org/2000/svg", "text");
579
+ v.setAttribute("style", h.labelStyle.replace("color:", "fill:"));
580
+ const k = u.split(et.lineBreakRegex);
581
+ for (const P of k) {
582
+ const L = o.createElementNS("http://www.w3.org/2000/svg", "tspan");
583
+ 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);
584
+ }
585
+ f = v;
586
+ }
587
+ let g = 0, p = "";
588
+ switch (l.type) {
589
+ case "round":
590
+ g = 5, p = "rect";
591
+ break;
592
+ case "square":
593
+ p = "rect";
594
+ break;
595
+ case "diamond":
596
+ p = "question";
597
+ break;
598
+ case "hexagon":
599
+ p = "hexagon";
600
+ break;
601
+ case "odd":
602
+ p = "rect_left_inv_arrow";
603
+ break;
604
+ case "lean_right":
605
+ p = "lean_right";
606
+ break;
607
+ case "lean_left":
608
+ p = "lean_left";
609
+ break;
610
+ case "trapezoid":
611
+ p = "trapezoid";
612
+ break;
613
+ case "inv_trapezoid":
614
+ p = "inv_trapezoid";
615
+ break;
616
+ case "odd_right":
617
+ p = "rect_left_inv_arrow";
618
+ break;
619
+ case "circle":
620
+ p = "circle";
621
+ break;
622
+ case "ellipse":
623
+ p = "ellipse";
624
+ break;
625
+ case "stadium":
626
+ p = "stadium";
627
+ break;
628
+ case "subroutine":
629
+ p = "subroutine";
630
+ break;
631
+ case "cylinder":
632
+ p = "cylinder";
633
+ break;
634
+ case "group":
635
+ p = "rect";
636
+ break;
637
+ default:
638
+ p = "rect";
639
+ }
640
+ M.warn("Adding node", l.id, l.domId), e.setNode(s.db.lookUpDomId(l.id), {
641
+ labelType: "svg",
642
+ labelStyle: h.labelStyle,
643
+ shape: p,
644
+ label: f,
645
+ rx: g,
646
+ ry: g,
647
+ class: y,
648
+ style: h.style,
649
+ id: s.db.lookUpDomId(l.id)
650
+ });
651
+ }
652
+ }, kt = async function(r, e, t) {
653
+ let n = 0, a, s;
654
+ if (r.defaultStyle !== void 0) {
655
+ const i = V(r.defaultStyle);
656
+ a = i.style, s = i.labelStyle;
657
+ }
658
+ for (const i of r) {
659
+ n++;
660
+ const o = "L-" + i.start + "-" + i.end, c = "LS-" + i.start, d = "LE-" + i.end, l = {};
661
+ i.type === "arrow_open" ? l.arrowhead = "none" : l.arrowhead = "normal";
662
+ let y = "", h = "";
663
+ if (i.style !== void 0) {
664
+ const u = V(i.style);
665
+ y = u.style, h = u.labelStyle;
666
+ } else
667
+ switch (i.stroke) {
668
+ case "normal":
669
+ y = "fill:none", a !== void 0 && (y = a), s !== void 0 && (h = s);
670
+ break;
671
+ case "dotted":
672
+ y = "fill:none;stroke-width:2px;stroke-dasharray:3;";
673
+ break;
674
+ case "thick":
675
+ y = " stroke-width: 3.5px;fill:none";
676
+ break;
677
+ }
678
+ 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(
679
+ i.text.replace(
680
+ /fa[blrs]?:fa-[\w-]+/g,
681
+ // cspell:disable-line
682
+ (u) => `<i class='${u.replace(":", " ")}'></i>`
683
+ ),
684
+ D()
685
+ )}</span>`) : (l.labelType = "text", l.label = i.text.replace(et.lineBreakRegex, `
686
+ `), 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);
687
+ }
688
+ }, ge = function(r, e) {
689
+ return M.info("Extracting classes"), e.db.getClasses();
690
+ }, we = async function(r, e, t, n) {
691
+ M.info("Drawing flowchart");
692
+ const { securityLevel: a, flowchart: s } = D();
693
+ let i;
694
+ a === "sandbox" && (i = x("#i" + e));
695
+ const o = a === "sandbox" ? x(i.nodes()[0].contentDocument.body) : x("body"), c = a === "sandbox" ? i.nodes()[0].contentDocument : document;
696
+ let d = n.db.getDirection();
697
+ d === void 0 && (d = "TD");
698
+ const l = s.nodeSpacing || 50, y = s.rankSpacing || 50, h = new Tt({
699
+ multigraph: !0,
700
+ compound: !0
701
+ }).setGraph({
702
+ rankdir: d,
703
+ nodesep: l,
704
+ ranksep: y,
705
+ marginx: 8,
706
+ marginy: 8
707
+ }).setDefaultEdgeLabel(function() {
708
+ return {};
709
+ });
710
+ let u;
711
+ const f = n.db.getSubGraphs();
712
+ for (let w = f.length - 1; w >= 0; w--)
713
+ u = f[w], n.db.addVertex(u.id, u.title, "group", void 0, u.classes);
714
+ const g = n.db.getVertices();
715
+ M.warn("Get vertices", g);
716
+ const p = n.db.getEdges();
717
+ let v = 0;
718
+ for (v = f.length - 1; v >= 0; v--) {
719
+ u = f[v], Pt("cluster").append("text");
720
+ for (let w = 0; w < u.nodes.length; w++)
721
+ M.warn(
722
+ "Setting subgraph",
723
+ u.nodes[w],
724
+ n.db.lookUpDomId(u.nodes[w]),
725
+ n.db.lookUpDomId(u.id)
726
+ ), h.setParent(n.db.lookUpDomId(u.nodes[w]), n.db.lookUpDomId(u.id));
727
+ }
728
+ await bt(g, h, e, o, c, n), await kt(p, h, n);
729
+ const k = new le();
730
+ ye.addToRender(k), k.arrows().none = function(b, S, m, C) {
731
+ 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");
732
+ T(A, m[C + "Style"]);
733
+ }, k.arrows().normal = function(b, S) {
734
+ 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");
735
+ };
736
+ const P = o.select(`[id="${e}"]`), L = o.select("#" + e + " g");
737
+ for (k(L, h), L.selectAll("g.node").attr("title", function() {
738
+ return n.db.getTooltip(this.id);
739
+ }), n.db.indexNodes("subGraph" + v), v = 0; v < f.length; v++)
740
+ if (u = f[v], u.title !== "undefined") {
741
+ const w = c.querySelectorAll(
742
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"] rect'
743
+ ), b = c.querySelectorAll(
744
+ "#" + e + ' [id="' + n.db.lookUpDomId(u.id) + '"]'
745
+ ), S = w[0].x.baseVal.value, m = w[0].y.baseVal.value, C = w[0].width.baseVal.value, A = x(b[0]).select(".label");
746
+ A.attr("transform", `translate(${S + C / 2}, ${m + 14})`), A.attr("id", e + "Text");
747
+ for (let U = 0; U < u.classes.length; U++)
748
+ b[0].classList.add(u.classes[U]);
749
+ }
750
+ if (!s.htmlLabels) {
751
+ const w = c.querySelectorAll('[id="' + e + '"] .edgeLabel .label');
752
+ for (const b of w) {
753
+ const S = b.getBBox(), m = c.createElementNS("http://www.w3.org/2000/svg", "rect");
754
+ m.setAttribute("rx", 0), m.setAttribute("ry", 0), m.setAttribute("width", S.width), m.setAttribute("height", S.height), b.insertBefore(m, b.firstChild);
755
+ }
756
+ }
757
+ Lt(h, P, s.diagramPadding, s.useMaxWidth), Object.keys(g).forEach(function(w) {
758
+ const b = g[w];
759
+ if (b.link) {
760
+ const S = o.select("#" + e + ' [id="' + n.db.lookUpDomId(w) + '"]');
761
+ if (S) {
762
+ const m = c.createElementNS("http://www.w3.org/2000/svg", "a");
763
+ 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);
764
+ const C = S.insert(function() {
765
+ return m;
766
+ }, ":first-child"), R = S.select(".label-container");
767
+ R && C.append(function() {
768
+ return R.node();
769
+ });
770
+ const A = S.select(".label");
771
+ A && C.append(function() {
772
+ return A.node();
773
+ });
774
+ }
775
+ }
776
+ });
777
+ }, me = {
778
+ setConf: ve,
779
+ addVertices: bt,
780
+ addEdges: kt,
781
+ getClasses: ge,
782
+ draw: we
783
+ }, Ce = {
784
+ parser: St,
785
+ db: $,
786
+ renderer: At,
787
+ styles: Nt,
788
+ init: (r) => {
789
+ r.flowchart || (r.flowchart = {}), r.flowchart.arrowMarkerAbsolute = r.arrowMarkerAbsolute, me.setConf(r.flowchart), $.clear(), $.setGen("gen-1");
790
+ }
791
+ };
792
+ export {
793
+ Ce as diagram
794
+ };