@layers-app/editor 0.7.18 → 0.7.20

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 (249) hide show
  1. package/dist/index.cjs +2 -2
  2. package/dist/index.d.ts +77 -1
  3. package/dist/index.js +15 -9
  4. package/dist/layers.-pxItkuK.js +11 -0
  5. package/dist/layers.4783bPvO.js +39 -0
  6. package/dist/layers.4XOTUH37.js +1089 -0
  7. package/dist/layers.4peyl00A.js +2 -0
  8. package/dist/layers.4wAcqQtQ.js +423 -0
  9. package/dist/layers.4ykD0YcM.js +40 -0
  10. package/dist/layers.52famHy6.js +1 -0
  11. package/dist/layers.6Feq9YXQ.js +40 -0
  12. package/dist/layers.6GQPwq_6.js +960 -0
  13. package/dist/layers.7JqFgE4-.js +15 -0
  14. package/dist/layers.7wQbmwwB.js +1034 -0
  15. package/dist/layers.8JNx1FTq.js +35 -0
  16. package/dist/layers.8jhm9FEJ.js +10 -0
  17. package/dist/layers.8lNrKfca.js +41 -0
  18. package/dist/layers.9kQUqqYe.js +139 -0
  19. package/dist/layers.9pNaFvaX.js +1 -0
  20. package/dist/layers.AO3vHISA.js +33 -0
  21. package/dist/layers.Ab6Lx44l.js +129 -0
  22. package/dist/layers.B-w9_4cB.js +22 -0
  23. package/dist/layers.B0bpRgNT.js +122 -0
  24. package/dist/layers.B19hGmey.js +1 -0
  25. package/dist/layers.B2OK_mI8.js +1 -0
  26. package/dist/layers.B3D4g2HH.js +1 -0
  27. package/dist/layers.B3mzJc8P.js +907 -0
  28. package/dist/layers.B5YhL7Gw.js +40 -0
  29. package/dist/layers.B7K7JjK6.js +1510 -0
  30. package/dist/layers.B885pkJL.js +794 -0
  31. package/dist/layers.B961U-Vk.js +1 -0
  32. package/dist/layers.B9jATAXU.js +42 -0
  33. package/dist/layers.BAtv1CM7.js +1 -0
  34. package/dist/layers.BBv6P-Uu.js +37 -0
  35. package/dist/layers.BC6JEDP2.js +796 -0
  36. package/dist/layers.BEagxCE_.js +35 -0
  37. package/dist/layers.BH34WCDb.js +6 -0
  38. package/dist/layers.BIeVwYKL.js +1 -0
  39. package/dist/layers.BIkD0WQr.js +10 -0
  40. package/dist/layers.BIlhFIEz.js +37 -0
  41. package/dist/layers.BJDrjORS.js +244 -0
  42. package/dist/{layers.D99OBX9u.js → layers.BJLOp9cg.js} +88 -86
  43. package/dist/layers.BJsWSYrS.js +323 -0
  44. package/dist/layers.BKwcxD8A.js +5 -0
  45. package/dist/layers.BLd2spTm.js +1 -0
  46. package/dist/layers.BLv_frn1.js +10 -0
  47. package/dist/layers.BO2V23mI.js +1 -0
  48. package/dist/layers.BO_D4q5p.js +42 -0
  49. package/dist/layers.BP7EcZBZ.js +1 -0
  50. package/dist/layers.BP8OcU0T.js +10 -0
  51. package/dist/layers.BRaRY9tU.js +373 -0
  52. package/dist/layers.BSTBZrFn.js +1 -0
  53. package/dist/layers.BT2iHuSm.js +8 -0
  54. package/dist/layers.BU-tjKWq.js +33 -0
  55. package/dist/layers.BWEUOe94.js +40 -0
  56. package/dist/layers.BXAu7G4b.js +4 -0
  57. package/dist/layers.BZ9zcjtY.js +8 -0
  58. package/dist/layers.BZa5A6cg.js +425 -0
  59. package/dist/layers.BZlzQFiI.js +51 -0
  60. package/dist/layers.BagtOD0V.js +1 -0
  61. package/dist/layers.BbCfEXyj.js +55 -0
  62. package/dist/layers.Be94M_F4.js +7 -0
  63. package/dist/layers.BhdUQN6J.js +1583 -0
  64. package/dist/layers.Bj915C_T.js +5 -0
  65. package/dist/layers.BnHSrOPr.js +40 -0
  66. package/dist/layers.BngaRys_.js +8583 -0
  67. package/dist/layers.BoRvGzPp.js +1 -0
  68. package/dist/layers.Bob38w8X.js +5 -0
  69. package/dist/layers.BpTkSHkL.js +38 -0
  70. package/dist/layers.BpVR__4s.js +32 -0
  71. package/dist/layers.BpilXLfW.js +6 -0
  72. package/dist/layers.Br9HAzwf.js +2482 -0
  73. package/dist/layers.Bt7brqhi.js +116 -0
  74. package/dist/layers.BtqAfMks.js +1 -0
  75. package/dist/layers.BtvHse58.js +1 -0
  76. package/dist/layers.BwzogUnt.js +41 -0
  77. package/dist/layers.ByB5f2g3.js +7 -0
  78. package/dist/layers.ByipH4AB.js +207 -0
  79. package/dist/layers.BzC5N3hu.js +1619 -0
  80. package/dist/layers.C-KP-jFZ.js +8 -0
  81. package/dist/layers.C0iFGBoQ.js +213 -0
  82. package/dist/layers.C1AULvj_.js +40 -0
  83. package/dist/layers.C2f7uCzl.js +21620 -0
  84. package/dist/layers.C47t6lve.js +2 -0
  85. package/dist/layers.C4gRYt-z.js +9 -0
  86. package/dist/layers.C4nmPqDc.js +9 -0
  87. package/dist/layers.C5UKJ24R.js +271 -0
  88. package/dist/layers.C5qsYNKq.js +7 -0
  89. package/dist/layers.C70jnpZq.js +42 -0
  90. package/dist/layers.C7Qg5l_Q.js +5 -0
  91. package/dist/layers.C7v0beLV.js +9 -0
  92. package/dist/layers.C8_lu5UH.js +23 -0
  93. package/dist/layers.CAcCDIzK.js +32 -0
  94. package/dist/layers.CCWJVHwX.js +26946 -0
  95. package/dist/layers.CF2BAIC-.js +1 -0
  96. package/dist/layers.CFUGAgBV.js +805 -0
  97. package/dist/layers.CHZsXQcr.js +1 -0
  98. package/dist/layers.CIo6HbVI.js +37 -0
  99. package/dist/layers.CJaSQy6k.js +70 -0
  100. package/dist/layers.CJhFGqXY.js +1 -0
  101. package/dist/layers.CKU_klOZ.js +41 -0
  102. package/dist/layers.CKrtSnTU.js +7 -0
  103. package/dist/layers.CNoIsdHV.js +223 -0
  104. package/dist/layers.CQ-g_IO8.js +39 -0
  105. package/dist/layers.CRWtU7Vx.js +1268 -0
  106. package/dist/layers.CSattQNk.js +8 -0
  107. package/dist/layers.CT-8Geho.js +118 -0
  108. package/dist/layers.CWTjwUqI.js +9 -0
  109. package/dist/layers.CY3nuiOZ.js +39 -0
  110. package/dist/layers.CYDGmR2c.js +1 -0
  111. package/dist/layers.CYPtUh0S.js +36 -0
  112. package/dist/layers.CYjyWg9h.js +139 -0
  113. package/dist/layers.CZCoH1Jq.js +189 -0
  114. package/dist/layers.CZVe7Rrz.js +4 -0
  115. package/dist/layers.C_8NFZw0.js +84 -0
  116. package/dist/layers.C_IvrzZ3.js +7 -0
  117. package/dist/layers.C_vVmOaW.js +7 -0
  118. package/dist/layers.Cb3vLPzi.js +1 -0
  119. package/dist/layers.Cblg5KAJ.js +1286 -0
  120. package/dist/layers.CeUsnn-s.js +41 -0
  121. package/dist/layers.Cfwoj-CP.js +76 -0
  122. package/dist/layers.Cfxt2JbX.js +160 -0
  123. package/dist/layers.CjixIcYE.js +205 -0
  124. package/dist/layers.CliEt_s4.js +8 -0
  125. package/dist/layers.Cmumbtn4.js +11 -0
  126. package/dist/layers.Cnkh0zSn.js +5 -0
  127. package/dist/layers.Co0MEzNt.js +32 -0
  128. package/dist/layers.CpgPovn6.js +32 -0
  129. package/dist/layers.CqVTtuYm.js +6 -0
  130. package/dist/layers.Cr_8J_Ls.js +36 -0
  131. package/dist/layers.Cs7THreY.js +42 -0
  132. package/dist/layers.CtQHRQJd.js +65 -0
  133. package/dist/layers.Cuv2Lipq.js +10 -0
  134. package/dist/layers.Cuy--_Li.js +14 -0
  135. package/dist/layers.Cxrjuyke.js +38 -0
  136. package/dist/layers.Cxuu78R8.js +1 -0
  137. package/dist/layers.Cy_jbtrS.js +198 -0
  138. package/dist/layers.CyabQ7I1.js +40 -0
  139. package/dist/layers.CyqF5h2Z.js +1 -0
  140. package/dist/layers.Cyzu9PKQ.js +1 -0
  141. package/dist/layers.CzDyzzM2.js +36 -0
  142. package/dist/layers.D-LL79P8.js +32 -0
  143. package/dist/layers.D-uQN6e4.js +271 -0
  144. package/dist/layers.D00djYUT.js +9 -0
  145. package/dist/layers.D0zn4_Mx.js +1 -0
  146. package/dist/layers.D1PMEoqL.js +41 -0
  147. package/dist/layers.D1WSB9zI.js +806 -0
  148. package/dist/layers.D2dRxQww.js +10 -0
  149. package/dist/layers.D3KEnhiI.js +6 -0
  150. package/dist/layers.D3SlAvNp.js +934 -0
  151. package/dist/layers.D3eKKoAb.js +1 -0
  152. package/dist/layers.D4T8fTcj.js +1223 -0
  153. package/dist/layers.D7gfmd9A.js +36 -0
  154. package/dist/layers.D7jGxypv.js +8 -0
  155. package/dist/layers.DA1OUhKy.js +10 -0
  156. package/dist/layers.DB4o6Xfv.js +42 -0
  157. package/dist/layers.DBUjVgMd.js +1 -0
  158. package/dist/layers.DCkmUFPh.js +2966 -0
  159. package/dist/layers.DD4QPdYS.js +96 -0
  160. package/dist/layers.DE2Io1k7.js +295 -0
  161. package/dist/layers.DKnEcoKx.js +1088 -0
  162. package/dist/layers.DKsXm_hK.js +9 -0
  163. package/dist/layers.DLeGllIz.js +1 -0
  164. package/dist/layers.DLwuMfdd.js +84 -0
  165. package/dist/layers.DMkBISW1.js +1 -0
  166. package/dist/layers.DN9HoVxI.js +18 -0
  167. package/dist/layers.DOrgOHBr.js +1 -0
  168. package/dist/layers.DPipd7Yf.js +1 -0
  169. package/dist/layers.DQpNkl-s.js +39 -0
  170. package/dist/layers.DSNr6P6_.js +40 -0
  171. package/dist/layers.DWGLEZg1.js +34 -0
  172. package/dist/layers.DWxUDz1V.js +13 -0
  173. package/dist/layers.DYk9FILk.js +8 -0
  174. package/dist/layers.DZ3Nv-_j.js +8 -0
  175. package/dist/layers.DZGvjyDH.js +1 -0
  176. package/dist/layers.DZucH9TB.js +40 -0
  177. package/dist/layers.D__NkOsa.js +7 -0
  178. package/dist/layers.DbaKVP5e.js +1 -0
  179. package/dist/layers.DfkAyTyX.js +39 -0
  180. package/dist/layers.Dgie_iy2.js +772 -0
  181. package/dist/layers.DhHIDfZ5.js +1 -0
  182. package/dist/layers.Di-7t8Xt.js +6 -0
  183. package/dist/layers.DiPSTN4q.js +1 -0
  184. package/dist/layers.DjLIeP8d.js +257 -0
  185. package/dist/layers.DjUOC4st.js +16 -0
  186. package/dist/layers.Dk6h-6Wb.js +2 -0
  187. package/dist/layers.DkRR3p16.js +61 -0
  188. package/dist/layers.DnXxZJQo.js +48149 -0
  189. package/dist/layers.DpahuC02.js +6 -0
  190. package/dist/layers.Dpqc2FAN.js +40 -0
  191. package/dist/layers.DqScp2vq.js +1126 -0
  192. package/dist/layers.Dr1JRZ_S.js +4 -0
  193. package/dist/layers.DrTaVUsA.js +39 -0
  194. package/dist/layers.DrXLa4el.js +44 -0
  195. package/dist/layers.DtKxMd0g.js +4 -0
  196. package/dist/layers.DxA6ocdw.js +70 -0
  197. package/dist/layers.DxRZNwMP.js +1 -0
  198. package/dist/layers.Dy1naDTQ.js +14 -0
  199. package/dist/layers.FArKPCKA.js +21941 -0
  200. package/dist/layers.FXdB_jrR.js +9 -0
  201. package/dist/layers.GbuD0dtx.js +6 -0
  202. package/dist/layers.ILs-xE7i.js +11 -0
  203. package/dist/layers.JWCLFILJ.js +1 -0
  204. package/dist/layers.L9obQAvP.js +10 -0
  205. package/dist/layers.Lb5VQ9U4.js +504 -0
  206. package/dist/layers.MCy444Ia.js +41 -0
  207. package/dist/layers.QyDQqf0G.js +39 -0
  208. package/dist/layers.R4CPUhiF.js +8 -0
  209. package/dist/layers.R8mPlCA0.js +261 -0
  210. package/dist/layers.Sjtd5SpD.js +84 -0
  211. package/dist/layers.XlzBx5CM.js +437 -0
  212. package/dist/layers.YD8zq7G1.js +41 -0
  213. package/dist/layers.YWM6eRUH.js +1 -0
  214. package/dist/layers.a6EbdnVa.js +37 -0
  215. package/dist/layers.b0h5ZBmD.js +61 -0
  216. package/dist/layers.b9B2NY7n.js +11690 -0
  217. package/dist/layers.bS5nz97o.js +3 -0
  218. package/dist/layers.biaV5QcU.js +7 -0
  219. package/dist/layers.dxw35GiE.js +52 -0
  220. package/dist/layers.gFW_9pGM.js +1225 -0
  221. package/dist/layers.ge00jJfz.js +38 -0
  222. package/dist/layers.iryDeY19.js +9 -0
  223. package/dist/layers.jN02hLg8.js +7 -0
  224. package/dist/layers.jqEynR2I.js +8 -0
  225. package/dist/layers.lCpg7dOn.js +21 -0
  226. package/dist/layers.lIg0cncJ.js +39 -0
  227. package/dist/layers.lKk6bx4R.js +1 -0
  228. package/dist/layers.m4XcFQDd.js +6 -0
  229. package/dist/layers.m6FDW_ho.js +8 -0
  230. package/dist/layers.r6u8p96p.js +2238 -0
  231. package/dist/layers.rWob7btU.js +10 -0
  232. package/dist/layers.rYZbXo4d.js +32 -0
  233. package/dist/layers.sldWqHdD.js +11 -0
  234. package/dist/layers.tFqdqg82.js +10 -0
  235. package/dist/layers.v25uTBY8.js +39 -0
  236. package/dist/layers.wNarGMxP.js +9 -0
  237. package/dist/layers.wxYowcaq.js +41 -0
  238. package/dist/layers.xjN3ile4.js +9 -0
  239. package/dist/layers.yNlD-OCA.js +35 -0
  240. package/dist/layers.z-RuimGg.js +11 -0
  241. package/dist/layers.zvsP8spW.js +1 -0
  242. package/package.json +1 -1
  243. package/dist/layers.94hwidA2.js +0 -198
  244. package/dist/layers.B4l6ta1Q.js +0 -1
  245. package/dist/layers.BMrOAD_P.js +0 -1
  246. package/dist/layers.DOzLBYZr.js +0 -304
  247. package/dist/layers.YRyXopy_.js +0 -151
  248. package/dist/layers.usKC_Id5.js +0 -1
  249. package/dist/layers.zu-IYGYU.js +0 -47463
@@ -0,0 +1,806 @@
1
+ import { o as mt, n as kt, s as _t, a as xt, c as vt, b as bt, g as rt, p as wt, d as Y, Y as St, q as Lt, j as Et } from "./layers.BngaRys_.js";
2
+ import "./layers.C2f7uCzl.js";
3
+ import "lodash-es/memoize.js";
4
+ import "lodash-es/merge.js";
5
+ import "lodash-es/isEmpty.js";
6
+ import { o as At } from "./layers.b0h5ZBmD.js";
7
+ import { s as Tt } from "./layers.D7jGxypv.js";
8
+ function ot(t, n) {
9
+ let s;
10
+ if (n === void 0)
11
+ for (const a of t)
12
+ a != null && (s < a || s === void 0 && a >= a) && (s = a);
13
+ else {
14
+ let a = -1;
15
+ for (let u of t)
16
+ (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
17
+ }
18
+ return s;
19
+ }
20
+ function yt(t, n) {
21
+ let s;
22
+ if (n === void 0)
23
+ for (const a of t)
24
+ a != null && (s > a || s === void 0 && a >= a) && (s = a);
25
+ else {
26
+ let a = -1;
27
+ for (let u of t)
28
+ (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
29
+ }
30
+ return s;
31
+ }
32
+ function Z(t, n) {
33
+ let s = 0;
34
+ if (n === void 0)
35
+ for (let a of t)
36
+ (a = +a) && (s += a);
37
+ else {
38
+ let a = -1;
39
+ for (let u of t)
40
+ (u = +n(u, ++a, t)) && (s += u);
41
+ }
42
+ return s;
43
+ }
44
+ function Mt(t) {
45
+ return t.target.depth;
46
+ }
47
+ function Nt(t) {
48
+ return t.depth;
49
+ }
50
+ function Pt(t, n) {
51
+ return n - 1 - t.height;
52
+ }
53
+ function dt(t, n) {
54
+ return t.sourceLinks.length ? t.depth : n - 1;
55
+ }
56
+ function Ct(t) {
57
+ return t.targetLinks.length ? t.depth : t.sourceLinks.length ? yt(t.sourceLinks, Mt) - 1 : 0;
58
+ }
59
+ function G(t) {
60
+ return function() {
61
+ return t;
62
+ };
63
+ }
64
+ function lt(t, n) {
65
+ return q(t.source, n.source) || t.index - n.index;
66
+ }
67
+ function at(t, n) {
68
+ return q(t.target, n.target) || t.index - n.index;
69
+ }
70
+ function q(t, n) {
71
+ return t.y0 - n.y0;
72
+ }
73
+ function J(t) {
74
+ return t.value;
75
+ }
76
+ function It(t) {
77
+ return t.index;
78
+ }
79
+ function $t(t) {
80
+ return t.nodes;
81
+ }
82
+ function Ot(t) {
83
+ return t.links;
84
+ }
85
+ function ct(t, n) {
86
+ const s = t.get(n);
87
+ if (!s) throw new Error("missing: " + n);
88
+ return s;
89
+ }
90
+ function ut({ nodes: t }) {
91
+ for (const n of t) {
92
+ let s = n.y0, a = s;
93
+ for (const u of n.sourceLinks)
94
+ u.y0 = s + u.width / 2, s += u.width;
95
+ for (const u of n.targetLinks)
96
+ u.y1 = a + u.width / 2, a += u.width;
97
+ }
98
+ }
99
+ function jt() {
100
+ let t = 0, n = 0, s = 1, a = 1, u = 24, _ = 8, g, p = It, i = dt, o, c, m = $t, b = Ot, y = 6;
101
+ function x() {
102
+ const e = { nodes: m.apply(null, arguments), links: b.apply(null, arguments) };
103
+ return E(e), L(e), A(e), N(e), S(e), ut(e), e;
104
+ }
105
+ x.update = function(e) {
106
+ return ut(e), e;
107
+ }, x.nodeId = function(e) {
108
+ return arguments.length ? (p = typeof e == "function" ? e : G(e), x) : p;
109
+ }, x.nodeAlign = function(e) {
110
+ return arguments.length ? (i = typeof e == "function" ? e : G(e), x) : i;
111
+ }, x.nodeSort = function(e) {
112
+ return arguments.length ? (o = e, x) : o;
113
+ }, x.nodeWidth = function(e) {
114
+ return arguments.length ? (u = +e, x) : u;
115
+ }, x.nodePadding = function(e) {
116
+ return arguments.length ? (_ = g = +e, x) : _;
117
+ }, x.nodes = function(e) {
118
+ return arguments.length ? (m = typeof e == "function" ? e : G(e), x) : m;
119
+ }, x.links = function(e) {
120
+ return arguments.length ? (b = typeof e == "function" ? e : G(e), x) : b;
121
+ }, x.linkSort = function(e) {
122
+ return arguments.length ? (c = e, x) : c;
123
+ }, x.size = function(e) {
124
+ return arguments.length ? (t = n = 0, s = +e[0], a = +e[1], x) : [s - t, a - n];
125
+ }, x.extent = function(e) {
126
+ return arguments.length ? (t = +e[0][0], s = +e[1][0], n = +e[0][1], a = +e[1][1], x) : [[t, n], [s, a]];
127
+ }, x.iterations = function(e) {
128
+ return arguments.length ? (y = +e, x) : y;
129
+ };
130
+ function E({ nodes: e, links: f }) {
131
+ for (const [h, r] of e.entries())
132
+ r.index = h, r.sourceLinks = [], r.targetLinks = [];
133
+ const l = new Map(e.map((h, r) => [p(h, r, e), h]));
134
+ for (const [h, r] of f.entries()) {
135
+ r.index = h;
136
+ let { source: k, target: v } = r;
137
+ typeof k != "object" && (k = r.source = ct(l, k)), typeof v != "object" && (v = r.target = ct(l, v)), k.sourceLinks.push(r), v.targetLinks.push(r);
138
+ }
139
+ if (c != null)
140
+ for (const { sourceLinks: h, targetLinks: r } of e)
141
+ h.sort(c), r.sort(c);
142
+ }
143
+ function L({ nodes: e }) {
144
+ for (const f of e)
145
+ f.value = f.fixedValue === void 0 ? Math.max(Z(f.sourceLinks, J), Z(f.targetLinks, J)) : f.fixedValue;
146
+ }
147
+ function A({ nodes: e }) {
148
+ const f = e.length;
149
+ let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
150
+ for (; l.size; ) {
151
+ for (const k of l) {
152
+ k.depth = r;
153
+ for (const { target: v } of k.sourceLinks)
154
+ h.add(v);
155
+ }
156
+ if (++r > f) throw new Error("circular link");
157
+ l = h, h = /* @__PURE__ */ new Set();
158
+ }
159
+ }
160
+ function N({ nodes: e }) {
161
+ const f = e.length;
162
+ let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
163
+ for (; l.size; ) {
164
+ for (const k of l) {
165
+ k.height = r;
166
+ for (const { source: v } of k.targetLinks)
167
+ h.add(v);
168
+ }
169
+ if (++r > f) throw new Error("circular link");
170
+ l = h, h = /* @__PURE__ */ new Set();
171
+ }
172
+ }
173
+ function I({ nodes: e }) {
174
+ const f = ot(e, (r) => r.depth) + 1, l = (s - t - u) / (f - 1), h = new Array(f);
175
+ for (const r of e) {
176
+ const k = Math.max(0, Math.min(f - 1, Math.floor(i.call(null, r, f))));
177
+ r.layer = k, r.x0 = t + k * l, r.x1 = r.x0 + u, h[k] ? h[k].push(r) : h[k] = [r];
178
+ }
179
+ if (o) for (const r of h)
180
+ r.sort(o);
181
+ return h;
182
+ }
183
+ function j(e) {
184
+ const f = yt(e, (l) => (a - n - (l.length - 1) * g) / Z(l, J));
185
+ for (const l of e) {
186
+ let h = n;
187
+ for (const r of l) {
188
+ r.y0 = h, r.y1 = h + r.value * f, h = r.y1 + g;
189
+ for (const k of r.sourceLinks)
190
+ k.width = k.value * f;
191
+ }
192
+ h = (a - h + g) / (l.length + 1);
193
+ for (let r = 0; r < l.length; ++r) {
194
+ const k = l[r];
195
+ k.y0 += h * (r + 1), k.y1 += h * (r + 1);
196
+ }
197
+ $(l);
198
+ }
199
+ }
200
+ function S(e) {
201
+ const f = I(e);
202
+ g = Math.min(_, (a - n) / (ot(f, (l) => l.length) - 1)), j(f);
203
+ for (let l = 0; l < y; ++l) {
204
+ const h = Math.pow(0.99, l), r = Math.max(1 - h, (l + 1) / y);
205
+ O(f, h, r), M(f, h, r);
206
+ }
207
+ }
208
+ function M(e, f, l) {
209
+ for (let h = 1, r = e.length; h < r; ++h) {
210
+ const k = e[h];
211
+ for (const v of k) {
212
+ let R = 0, z = 0;
213
+ for (const { source: W, value: K } of v.targetLinks) {
214
+ let F = K * (v.layer - W.layer);
215
+ R += T(W, v) * F, z += F;
216
+ }
217
+ if (!(z > 0)) continue;
218
+ let U = (R / z - v.y0) * f;
219
+ v.y0 += U, v.y1 += U, w(v);
220
+ }
221
+ o === void 0 && k.sort(q), P(k, l);
222
+ }
223
+ }
224
+ function O(e, f, l) {
225
+ for (let h = e.length, r = h - 2; r >= 0; --r) {
226
+ const k = e[r];
227
+ for (const v of k) {
228
+ let R = 0, z = 0;
229
+ for (const { target: W, value: K } of v.sourceLinks) {
230
+ let F = K * (W.layer - v.layer);
231
+ R += V(v, W) * F, z += F;
232
+ }
233
+ if (!(z > 0)) continue;
234
+ let U = (R / z - v.y0) * f;
235
+ v.y0 += U, v.y1 += U, w(v);
236
+ }
237
+ o === void 0 && k.sort(q), P(k, l);
238
+ }
239
+ }
240
+ function P(e, f) {
241
+ const l = e.length >> 1, h = e[l];
242
+ d(e, h.y0 - g, l - 1, f), C(e, h.y1 + g, l + 1, f), d(e, a, e.length - 1, f), C(e, n, 0, f);
243
+ }
244
+ function C(e, f, l, h) {
245
+ for (; l < e.length; ++l) {
246
+ const r = e[l], k = (f - r.y0) * h;
247
+ k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + g;
248
+ }
249
+ }
250
+ function d(e, f, l, h) {
251
+ for (; l >= 0; --l) {
252
+ const r = e[l], k = (r.y1 - f) * h;
253
+ k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - g;
254
+ }
255
+ }
256
+ function w({ sourceLinks: e, targetLinks: f }) {
257
+ if (c === void 0) {
258
+ for (const { source: { sourceLinks: l } } of f)
259
+ l.sort(at);
260
+ for (const { target: { targetLinks: l } } of e)
261
+ l.sort(lt);
262
+ }
263
+ }
264
+ function $(e) {
265
+ if (c === void 0)
266
+ for (const { sourceLinks: f, targetLinks: l } of e)
267
+ f.sort(at), l.sort(lt);
268
+ }
269
+ function T(e, f) {
270
+ let l = e.y0 - (e.sourceLinks.length - 1) * g / 2;
271
+ for (const { target: h, width: r } of e.sourceLinks) {
272
+ if (h === f) break;
273
+ l += r + g;
274
+ }
275
+ for (const { source: h, width: r } of f.targetLinks) {
276
+ if (h === e) break;
277
+ l -= r;
278
+ }
279
+ return l;
280
+ }
281
+ function V(e, f) {
282
+ let l = f.y0 - (f.targetLinks.length - 1) * g / 2;
283
+ for (const { source: h, width: r } of f.targetLinks) {
284
+ if (h === e) break;
285
+ l += r + g;
286
+ }
287
+ for (const { target: h, width: r } of e.sourceLinks) {
288
+ if (h === f) break;
289
+ l -= r;
290
+ }
291
+ return l;
292
+ }
293
+ return x;
294
+ }
295
+ var tt = Math.PI, et = 2 * tt, D = 1e-6, zt = et - D;
296
+ function nt() {
297
+ this._x0 = this._y0 = // start of current subpath
298
+ this._x1 = this._y1 = null, this._ = "";
299
+ }
300
+ function gt() {
301
+ return new nt();
302
+ }
303
+ nt.prototype = gt.prototype = {
304
+ constructor: nt,
305
+ moveTo: function(t, n) {
306
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
307
+ },
308
+ closePath: function() {
309
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
310
+ },
311
+ lineTo: function(t, n) {
312
+ this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
313
+ },
314
+ quadraticCurveTo: function(t, n, s, a) {
315
+ this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
316
+ },
317
+ bezierCurveTo: function(t, n, s, a, u, _) {
318
+ this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +_);
319
+ },
320
+ arcTo: function(t, n, s, a, u) {
321
+ t = +t, n = +n, s = +s, a = +a, u = +u;
322
+ var _ = this._x1, g = this._y1, p = s - t, i = a - n, o = _ - t, c = g - n, m = o * o + c * c;
323
+ if (u < 0) throw new Error("negative radius: " + u);
324
+ if (this._x1 === null)
325
+ this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
326
+ else if (m > D) if (!(Math.abs(c * p - i * o) > D) || !u)
327
+ this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
328
+ else {
329
+ var b = s - _, y = a - g, x = p * p + i * i, E = b * b + y * y, L = Math.sqrt(x), A = Math.sqrt(m), N = u * Math.tan((tt - Math.acos((x + m - E) / (2 * L * A))) / 2), I = N / A, j = N / L;
330
+ Math.abs(I - 1) > D && (this._ += "L" + (t + I * o) + "," + (n + I * c)), this._ += "A" + u + "," + u + ",0,0," + +(c * b > o * y) + "," + (this._x1 = t + j * p) + "," + (this._y1 = n + j * i);
331
+ }
332
+ },
333
+ arc: function(t, n, s, a, u, _) {
334
+ t = +t, n = +n, s = +s, _ = !!_;
335
+ var g = s * Math.cos(a), p = s * Math.sin(a), i = t + g, o = n + p, c = 1 ^ _, m = _ ? a - u : u - a;
336
+ if (s < 0) throw new Error("negative radius: " + s);
337
+ this._x1 === null ? this._ += "M" + i + "," + o : (Math.abs(this._x1 - i) > D || Math.abs(this._y1 - o) > D) && (this._ += "L" + i + "," + o), s && (m < 0 && (m = m % et + et), m > zt ? this._ += "A" + s + "," + s + ",0,1," + c + "," + (t - g) + "," + (n - p) + "A" + s + "," + s + ",0,1," + c + "," + (this._x1 = i) + "," + (this._y1 = o) : m > D && (this._ += "A" + s + "," + s + ",0," + +(m >= tt) + "," + c + "," + (this._x1 = t + s * Math.cos(u)) + "," + (this._y1 = n + s * Math.sin(u))));
338
+ },
339
+ rect: function(t, n, s, a) {
340
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
341
+ },
342
+ toString: function() {
343
+ return this._;
344
+ }
345
+ };
346
+ function ht(t) {
347
+ return function() {
348
+ return t;
349
+ };
350
+ }
351
+ function Dt(t) {
352
+ return t[0];
353
+ }
354
+ function Bt(t) {
355
+ return t[1];
356
+ }
357
+ var Vt = Array.prototype.slice;
358
+ function Rt(t) {
359
+ return t.source;
360
+ }
361
+ function Ut(t) {
362
+ return t.target;
363
+ }
364
+ function Wt(t) {
365
+ var n = Rt, s = Ut, a = Dt, u = Bt, _ = null;
366
+ function g() {
367
+ var p, i = Vt.call(arguments), o = n.apply(this, i), c = s.apply(this, i);
368
+ if (_ || (_ = p = gt()), t(_, +a.apply(this, (i[0] = o, i)), +u.apply(this, i), +a.apply(this, (i[0] = c, i)), +u.apply(this, i)), p) return _ = null, p + "" || null;
369
+ }
370
+ return g.source = function(p) {
371
+ return arguments.length ? (n = p, g) : n;
372
+ }, g.target = function(p) {
373
+ return arguments.length ? (s = p, g) : s;
374
+ }, g.x = function(p) {
375
+ return arguments.length ? (a = typeof p == "function" ? p : ht(+p), g) : a;
376
+ }, g.y = function(p) {
377
+ return arguments.length ? (u = typeof p == "function" ? p : ht(+p), g) : u;
378
+ }, g.context = function(p) {
379
+ return arguments.length ? (_ = p ?? null, g) : _;
380
+ }, g;
381
+ }
382
+ function Ft(t, n, s, a, u) {
383
+ t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
384
+ }
385
+ function Yt() {
386
+ return Wt(Ft);
387
+ }
388
+ function Gt(t) {
389
+ return [t.source.x1, t.y0];
390
+ }
391
+ function qt(t) {
392
+ return [t.target.x0, t.y1];
393
+ }
394
+ function Ht() {
395
+ return Yt().source(Gt).target(qt);
396
+ }
397
+ var it = (function() {
398
+ var t = function(p, i, o, c) {
399
+ for (o = o || {}, c = p.length; c--; o[p[c]] = i)
400
+ ;
401
+ return o;
402
+ }, n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
403
+ trace: function() {
404
+ },
405
+ yy: {},
406
+ symbols_: { error: 2, start: 3, SANKEY: 4, NEWLINE: 5, csv: 6, opt_eof: 7, record: 8, csv_tail: 9, EOF: 10, "field[source]": 11, COMMA: 12, "field[target]": 13, "field[value]": 14, field: 15, escaped: 16, non_escaped: 17, DQUOTE: 18, ESCAPED_TEXT: 19, NON_ESCAPED_TEXT: 20, $accept: 0, $end: 1 },
407
+ terminals_: { 2: "error", 4: "SANKEY", 5: "NEWLINE", 10: "EOF", 11: "field[source]", 12: "COMMA", 13: "field[target]", 14: "field[value]", 18: "DQUOTE", 19: "ESCAPED_TEXT", 20: "NON_ESCAPED_TEXT" },
408
+ productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
409
+ performAction: function(i, o, c, m, b, y, x) {
410
+ var E = y.length - 1;
411
+ switch (b) {
412
+ case 7:
413
+ const L = m.findOrCreateNode(y[E - 4].trim().replaceAll('""', '"')), A = m.findOrCreateNode(y[E - 2].trim().replaceAll('""', '"')), N = parseFloat(y[E].trim());
414
+ m.addLink(L, A, N);
415
+ break;
416
+ case 8:
417
+ case 9:
418
+ case 11:
419
+ this.$ = y[E];
420
+ break;
421
+ case 10:
422
+ this.$ = y[E - 1];
423
+ break;
424
+ }
425
+ },
426
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(s, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, t(a, [2, 8]), t(a, [2, 9]), { 19: [1, 16] }, t(a, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, t(s, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: n, 20: s }, { 15: 18, 16: 7, 17: 8, 18: n, 20: s }, { 18: [1, 19] }, t(s, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: n, 20: s }, t([1, 5, 10], [2, 7])],
427
+ defaultActions: { 11: [2, 1], 12: [2, 5] },
428
+ parseError: function(i, o) {
429
+ if (o.recoverable)
430
+ this.trace(i);
431
+ else {
432
+ var c = new Error(i);
433
+ throw c.hash = o, c;
434
+ }
435
+ },
436
+ parse: function(i) {
437
+ var o = this, c = [0], m = [], b = [null], y = [], x = this.table, E = "", L = 0, A = 0, N = 2, I = 1, j = y.slice.call(arguments, 1), S = Object.create(this.lexer), M = { yy: {} };
438
+ for (var O in this.yy)
439
+ Object.prototype.hasOwnProperty.call(this.yy, O) && (M.yy[O] = this.yy[O]);
440
+ S.setInput(i, M.yy), M.yy.lexer = S, M.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
441
+ var P = S.yylloc;
442
+ y.push(P);
443
+ var C = S.options && S.options.ranges;
444
+ typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
445
+ function d() {
446
+ var v;
447
+ return v = m.pop() || S.lex() || I, typeof v != "number" && (v instanceof Array && (m = v, v = m.pop()), v = o.symbols_[v] || v), v;
448
+ }
449
+ for (var w, $, T, V, e = {}, f, l, h, r; ; ) {
450
+ if ($ = c[c.length - 1], this.defaultActions[$] ? T = this.defaultActions[$] : ((w === null || typeof w > "u") && (w = d()), T = x[$] && x[$][w]), typeof T > "u" || !T.length || !T[0]) {
451
+ var k = "";
452
+ r = [];
453
+ for (f in x[$])
454
+ this.terminals_[f] && f > N && r.push("'" + this.terminals_[f] + "'");
455
+ S.showPosition ? k = "Parse error on line " + (L + 1) + `:
456
+ ` + S.showPosition() + `
457
+ Expecting ` + r.join(", ") + ", got '" + (this.terminals_[w] || w) + "'" : k = "Parse error on line " + (L + 1) + ": Unexpected " + (w == I ? "end of input" : "'" + (this.terminals_[w] || w) + "'"), this.parseError(k, {
458
+ text: S.match,
459
+ token: this.terminals_[w] || w,
460
+ line: S.yylineno,
461
+ loc: P,
462
+ expected: r
463
+ });
464
+ }
465
+ if (T[0] instanceof Array && T.length > 1)
466
+ throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + w);
467
+ switch (T[0]) {
468
+ case 1:
469
+ c.push(w), b.push(S.yytext), y.push(S.yylloc), c.push(T[1]), w = null, A = S.yyleng, E = S.yytext, L = S.yylineno, P = S.yylloc;
470
+ break;
471
+ case 2:
472
+ if (l = this.productions_[T[1]][1], e.$ = b[b.length - l], e._$ = {
473
+ first_line: y[y.length - (l || 1)].first_line,
474
+ last_line: y[y.length - 1].last_line,
475
+ first_column: y[y.length - (l || 1)].first_column,
476
+ last_column: y[y.length - 1].last_column
477
+ }, C && (e._$.range = [
478
+ y[y.length - (l || 1)].range[0],
479
+ y[y.length - 1].range[1]
480
+ ]), V = this.performAction.apply(e, [
481
+ E,
482
+ A,
483
+ L,
484
+ M.yy,
485
+ T[1],
486
+ b,
487
+ y
488
+ ].concat(j)), typeof V < "u")
489
+ return V;
490
+ l && (c = c.slice(0, -1 * l * 2), b = b.slice(0, -1 * l), y = y.slice(0, -1 * l)), c.push(this.productions_[T[1]][0]), b.push(e.$), y.push(e._$), h = x[c[c.length - 2]][c[c.length - 1]], c.push(h);
491
+ break;
492
+ case 3:
493
+ return !0;
494
+ }
495
+ }
496
+ return !0;
497
+ }
498
+ }, _ = /* @__PURE__ */ (function() {
499
+ var p = {
500
+ EOF: 1,
501
+ parseError: function(o, c) {
502
+ if (this.yy.parser)
503
+ this.yy.parser.parseError(o, c);
504
+ else
505
+ throw new Error(o);
506
+ },
507
+ // resets the lexer, sets new input
508
+ setInput: function(i, o) {
509
+ return this.yy = o || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
510
+ first_line: 1,
511
+ first_column: 0,
512
+ last_line: 1,
513
+ last_column: 0
514
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
515
+ },
516
+ // consumes and returns one char from the input
517
+ input: function() {
518
+ var i = this._input[0];
519
+ this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
520
+ var o = i.match(/(?:\r\n?|\n).*/g);
521
+ return o ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
522
+ },
523
+ // unshifts one char (or a string) into the input
524
+ unput: function(i) {
525
+ var o = i.length, c = i.split(/(?:\r\n?|\n)/g);
526
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
527
+ var m = this.match.split(/(?:\r\n?|\n)/g);
528
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
529
+ var b = this.yylloc.range;
530
+ return this.yylloc = {
531
+ first_line: this.yylloc.first_line,
532
+ last_line: this.yylineno + 1,
533
+ first_column: this.yylloc.first_column,
534
+ last_column: c ? (c.length === m.length ? this.yylloc.first_column : 0) + m[m.length - c.length].length - c[0].length : this.yylloc.first_column - o
535
+ }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
536
+ },
537
+ // When called from action, caches matched text and appends it on next action
538
+ more: function() {
539
+ return this._more = !0, this;
540
+ },
541
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
542
+ reject: function() {
543
+ if (this.options.backtrack_lexer)
544
+ this._backtrack = !0;
545
+ else
546
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
547
+ ` + this.showPosition(), {
548
+ text: "",
549
+ token: null,
550
+ line: this.yylineno
551
+ });
552
+ return this;
553
+ },
554
+ // retain first n characters of the match
555
+ less: function(i) {
556
+ this.unput(this.match.slice(i));
557
+ },
558
+ // displays already matched input, i.e. for error messages
559
+ pastInput: function() {
560
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
561
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
562
+ },
563
+ // displays upcoming input, i.e. for error messages
564
+ upcomingInput: function() {
565
+ var i = this.match;
566
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
567
+ },
568
+ // displays the character position where the lexing error occurred, i.e. for error messages
569
+ showPosition: function() {
570
+ var i = this.pastInput(), o = new Array(i.length + 1).join("-");
571
+ return i + this.upcomingInput() + `
572
+ ` + o + "^";
573
+ },
574
+ // test the lexed token: return FALSE when not a match, otherwise return token
575
+ test_match: function(i, o) {
576
+ var c, m, b;
577
+ if (this.options.backtrack_lexer && (b = {
578
+ yylineno: this.yylineno,
579
+ yylloc: {
580
+ first_line: this.yylloc.first_line,
581
+ last_line: this.last_line,
582
+ first_column: this.yylloc.first_column,
583
+ last_column: this.yylloc.last_column
584
+ },
585
+ yytext: this.yytext,
586
+ match: this.match,
587
+ matches: this.matches,
588
+ matched: this.matched,
589
+ yyleng: this.yyleng,
590
+ offset: this.offset,
591
+ _more: this._more,
592
+ _input: this._input,
593
+ yy: this.yy,
594
+ conditionStack: this.conditionStack.slice(0),
595
+ done: this.done
596
+ }, this.options.ranges && (b.yylloc.range = this.yylloc.range.slice(0))), m = i[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
597
+ first_line: this.yylloc.last_line,
598
+ last_line: this.yylineno + 1,
599
+ first_column: this.yylloc.last_column,
600
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
601
+ }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], c = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
602
+ return c;
603
+ if (this._backtrack) {
604
+ for (var y in b)
605
+ this[y] = b[y];
606
+ return !1;
607
+ }
608
+ return !1;
609
+ },
610
+ // return next match in input
611
+ next: function() {
612
+ if (this.done)
613
+ return this.EOF;
614
+ this._input || (this.done = !0);
615
+ var i, o, c, m;
616
+ this._more || (this.yytext = "", this.match = "");
617
+ for (var b = this._currentRules(), y = 0; y < b.length; y++)
618
+ if (c = this._input.match(this.rules[b[y]]), c && (!o || c[0].length > o[0].length)) {
619
+ if (o = c, m = y, this.options.backtrack_lexer) {
620
+ if (i = this.test_match(c, b[y]), i !== !1)
621
+ return i;
622
+ if (this._backtrack) {
623
+ o = !1;
624
+ continue;
625
+ } else
626
+ return !1;
627
+ } else if (!this.options.flex)
628
+ break;
629
+ }
630
+ return o ? (i = this.test_match(o, b[m]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
631
+ ` + this.showPosition(), {
632
+ text: "",
633
+ token: null,
634
+ line: this.yylineno
635
+ });
636
+ },
637
+ // return next match that has a token
638
+ lex: function() {
639
+ var o = this.next();
640
+ return o || this.lex();
641
+ },
642
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
643
+ begin: function(o) {
644
+ this.conditionStack.push(o);
645
+ },
646
+ // pop the previously active lexer condition state off the condition stack
647
+ popState: function() {
648
+ var o = this.conditionStack.length - 1;
649
+ return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
650
+ },
651
+ // produce the lexer rule set which is active for the currently active lexer condition state
652
+ _currentRules: function() {
653
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
654
+ },
655
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
656
+ topState: function(o) {
657
+ return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
658
+ },
659
+ // alias for begin(condition)
660
+ pushState: function(o) {
661
+ this.begin(o);
662
+ },
663
+ // return the number of states currently on the stack
664
+ stateStackSize: function() {
665
+ return this.conditionStack.length;
666
+ },
667
+ options: { "case-insensitive": !0 },
668
+ performAction: function(o, c, m, b) {
669
+ switch (m) {
670
+ case 0:
671
+ return this.pushState("csv"), 4;
672
+ case 1:
673
+ return 10;
674
+ case 2:
675
+ return 5;
676
+ case 3:
677
+ return 12;
678
+ case 4:
679
+ return this.pushState("escaped_text"), 18;
680
+ case 5:
681
+ return 20;
682
+ case 6:
683
+ return this.popState("escaped_text"), 18;
684
+ case 7:
685
+ return 19;
686
+ }
687
+ },
688
+ rules: [/^(?:sankey-beta\b)/i, /^(?:$)/i, /^(?:((\u000D\u000A)|(\u000A)))/i, /^(?:(\u002C))/i, /^(?:(\u0022))/i, /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i, /^(?:(\u0022)(?!(\u0022)))/i, /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],
689
+ conditions: { csv: { rules: [1, 2, 3, 4, 5, 6, 7], inclusive: !1 }, escaped_text: { rules: [6, 7], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7], inclusive: !0 } }
690
+ };
691
+ return p;
692
+ })();
693
+ u.lexer = _;
694
+ function g() {
695
+ this.yy = {};
696
+ }
697
+ return g.prototype = u, u.Parser = g, new g();
698
+ })();
699
+ it.parser = it;
700
+ const H = it;
701
+ let X = [], Q = [], B = {};
702
+ const Xt = () => {
703
+ X = [], Q = [], B = {}, Lt();
704
+ };
705
+ class Qt {
706
+ constructor(n, s, a = 0) {
707
+ this.source = n, this.target = s, this.value = a;
708
+ }
709
+ }
710
+ const Kt = (t, n, s) => {
711
+ X.push(new Qt(t, n, s));
712
+ };
713
+ class Zt {
714
+ constructor(n) {
715
+ this.ID = n;
716
+ }
717
+ }
718
+ const Jt = (t) => (t = Et.sanitizeText(t, rt()), B[t] || (B[t] = new Zt(t), Q.push(B[t])), B[t]), te = () => Q, ee = () => X, ne = () => ({
719
+ nodes: Q.map((t) => ({ id: t.ID })),
720
+ links: X.map((t) => ({
721
+ source: t.source.ID,
722
+ target: t.target.ID,
723
+ value: t.value
724
+ }))
725
+ }), ie = {
726
+ nodesMap: B,
727
+ getConfig: () => rt().sankey,
728
+ getNodes: te,
729
+ getLinks: ee,
730
+ getGraph: ne,
731
+ addLink: Kt,
732
+ findOrCreateNode: Jt,
733
+ getAccTitle: bt,
734
+ setAccTitle: vt,
735
+ getAccDescription: xt,
736
+ setAccDescription: _t,
737
+ getDiagramTitle: kt,
738
+ setDiagramTitle: mt,
739
+ clear: Xt
740
+ }, pt = class st {
741
+ static next(n) {
742
+ return new st(n + ++st.count);
743
+ }
744
+ constructor(n) {
745
+ this.id = n, this.href = `#${n}`;
746
+ }
747
+ toString() {
748
+ return "url(" + this.href + ")";
749
+ }
750
+ };
751
+ pt.count = 0;
752
+ let ft = pt;
753
+ const se = {
754
+ left: Nt,
755
+ right: Pt,
756
+ center: Ct,
757
+ justify: dt
758
+ }, re = function(t, n, s, a) {
759
+ const { securityLevel: u, sankey: _ } = rt(), g = wt.sankey;
760
+ let p;
761
+ u === "sandbox" && (p = Y("#i" + n));
762
+ const i = u === "sandbox" ? Y(p.nodes()[0].contentDocument.body) : Y("body"), o = u === "sandbox" ? i.select(`[id="${n}"]`) : Y(`[id="${n}"]`), c = (_ == null ? void 0 : _.width) ?? g.width, m = (_ == null ? void 0 : _.height) ?? g.width, b = (_ == null ? void 0 : _.useMaxWidth) ?? g.useMaxWidth, y = (_ == null ? void 0 : _.nodeAlignment) ?? g.nodeAlignment, x = (_ == null ? void 0 : _.prefix) ?? g.prefix, E = (_ == null ? void 0 : _.suffix) ?? g.suffix, L = (_ == null ? void 0 : _.showValues) ?? g.showValues, A = a.db.getGraph(), N = se[y];
763
+ jt().nodeId((d) => d.id).nodeWidth(10).nodePadding(10 + (L ? 15 : 0)).nodeAlign(N).extent([
764
+ [0, 0],
765
+ [c, m]
766
+ ])(A);
767
+ const S = At(Tt);
768
+ o.append("g").attr("class", "nodes").selectAll(".node").data(A.nodes).join("g").attr("class", "node").attr("id", (d) => (d.uid = ft.next("node-")).id).attr("transform", function(d) {
769
+ return "translate(" + d.x0 + "," + d.y0 + ")";
770
+ }).attr("x", (d) => d.x0).attr("y", (d) => d.y0).append("rect").attr("height", (d) => d.y1 - d.y0).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => S(d.id));
771
+ const M = ({ id: d, value: w }) => L ? `${d}
772
+ ${x}${Math.round(w * 100) / 100}${E}` : d;
773
+ o.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(A.nodes).join("text").attr("x", (d) => d.x0 < c / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", `${L ? "0" : "0.35"}em`).attr("text-anchor", (d) => d.x0 < c / 2 ? "start" : "end").text(M);
774
+ const O = o.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(A.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), P = (_ == null ? void 0 : _.linkColor) || "gradient";
775
+ if (P === "gradient") {
776
+ const d = O.append("linearGradient").attr("id", (w) => (w.uid = ft.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (w) => w.source.x1).attr("x2", (w) => w.target.x0);
777
+ d.append("stop").attr("offset", "0%").attr("stop-color", (w) => S(w.source.id)), d.append("stop").attr("offset", "100%").attr("stop-color", (w) => S(w.target.id));
778
+ }
779
+ let C;
780
+ switch (P) {
781
+ case "gradient":
782
+ C = (d) => d.uid;
783
+ break;
784
+ case "source":
785
+ C = (d) => S(d.source.id);
786
+ break;
787
+ case "target":
788
+ C = (d) => S(d.target.id);
789
+ break;
790
+ default:
791
+ C = P;
792
+ }
793
+ O.append("path").attr("d", Ht()).attr("stroke", C).attr("stroke-width", (d) => Math.max(1, d.width)), St(void 0, o, 0, b);
794
+ }, oe = {
795
+ draw: re
796
+ }, le = (t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
797
+ `).trim(), ae = H.parse.bind(H);
798
+ H.parse = (t) => ae(le(t));
799
+ const pe = {
800
+ parser: H,
801
+ db: ie,
802
+ renderer: oe
803
+ };
804
+ export {
805
+ pe as diagram
806
+ };