@layers-app/editor 0.3.11 → 0.4.1-progress.1

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 (246) hide show
  1. package/README.md +215 -1
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.d.ts +3 -2
  4. package/dist/index.js +6 -6
  5. package/dist/layers.0EGX3HEy.js +1 -0
  6. package/dist/layers.1RmgGsLp.js +1 -0
  7. package/dist/layers.1df9kFxm.js +40 -0
  8. package/dist/layers.2aPuvps8.js +2235 -0
  9. package/dist/layers.3YvcJPBv.js +7 -0
  10. package/dist/layers.52famHy6.js +1 -0
  11. package/dist/layers.5l4Zrk2L.js +1 -0
  12. package/dist/layers.6hpmGhQ7.js +10 -0
  13. package/dist/layers.7JqFgE4-.js +15 -0
  14. package/dist/layers.7RKu5qAq.js +37 -0
  15. package/dist/layers.9QK1wiQj.js +1 -0
  16. package/dist/layers.9pNaFvaX.js +1 -0
  17. package/dist/layers.AmKAZWLq.js +11 -0
  18. package/dist/layers.B0J4f_xf.js +5 -0
  19. package/dist/layers.B19hGmey.js +1 -0
  20. package/dist/layers.B1O1xaS8.js +33 -0
  21. package/dist/layers.B2AGu32C.js +11692 -0
  22. package/dist/layers.B31bUvoU.js +37 -0
  23. package/dist/layers.B3BB_VRY.js +802 -0
  24. package/dist/layers.B3D4g2HH.js +1 -0
  25. package/dist/layers.B3jz2GM9.js +2479 -0
  26. package/dist/layers.B7pMHVvI.js +230 -0
  27. package/dist/layers.B8vyhX3w.js +40 -0
  28. package/dist/{layers.BnjxHNDK.js → layers.B93hVIUg.js} +84 -84
  29. package/dist/layers.B97E5Ket.js +41 -0
  30. package/dist/layers.B9oGbUwj.js +65 -0
  31. package/dist/layers.B9x4sQmU.js +9 -0
  32. package/dist/layers.B9yJUkZR.js +39 -0
  33. package/dist/layers.BArswBu6.js +1 -0
  34. package/dist/layers.BAtv1CM7.js +1 -0
  35. package/dist/layers.BCCZdUAo.js +6 -0
  36. package/dist/layers.BCpU6Rx2.js +207 -0
  37. package/dist/layers.BEWGfzM9.js +790 -0
  38. package/dist/layers.BFGghBqX.js +84 -0
  39. package/dist/layers.BGSQMYfb.js +3 -0
  40. package/dist/layers.BIOgNBCU.js +118 -0
  41. package/dist/layers.BIeVwYKL.js +1 -0
  42. package/dist/layers.BK7LrtsI.js +8 -0
  43. package/dist/layers.BKEU6fbU.js +268 -0
  44. package/dist/layers.BM5aqSQa.js +904 -0
  45. package/dist/layers.BMWTYLoS.js +1580 -0
  46. package/dist/layers.BNiUL2Vg.js +1283 -0
  47. package/dist/layers.BRbDF_Rn.js +40 -0
  48. package/dist/layers.BSJVn_-a.js +4 -0
  49. package/dist/{layers.C125HTat.js → layers.BSQmbaLA.js} +1 -1
  50. package/dist/layers.BSTBZrFn.js +1 -0
  51. package/dist/layers.BSZN_1IW.js +1 -0
  52. package/dist/layers.BU089OsF.js +160 -0
  53. package/dist/layers.BV_nreRT.js +5 -0
  54. package/dist/layers.BVzXy_Es.js +282 -0
  55. package/dist/layers.BX_VhzvH.js +4 -0
  56. package/dist/layers.BXlqVxG4.js +10 -0
  57. package/dist/layers.BY4eBmlK.js +37 -0
  58. package/dist/layers.BbCfEXyj.js +55 -0
  59. package/dist/layers.BcAvrhb2.js +11 -0
  60. package/dist/layers.Be4S2sq-.js +11 -0
  61. package/dist/layers.BejsVBlP.js +8 -0
  62. package/dist/layers.BfFWkiCr.js +8 -0
  63. package/dist/layers.BgOa2ZQq.js +7 -0
  64. package/dist/layers.BiJ8hfRt.js +1510 -0
  65. package/dist/layers.Bm9A8t2O.js +41 -0
  66. package/dist/layers.BmKPR1Q_.js +803 -0
  67. package/dist/layers.BpLN4VBV.js +35 -0
  68. package/dist/layers.Bp_LzOtD.js +6 -0
  69. package/dist/layers.BpilXLfW.js +6 -0
  70. package/dist/layers.BrlarkcH.js +1 -0
  71. package/dist/layers.BrwdJtoi.js +2966 -0
  72. package/dist/layers.BtWb_X9E.js +1088 -0
  73. package/dist/layers.BuQv8-pQ.js +10 -0
  74. package/dist/layers.BvcJQqPP.js +36 -0
  75. package/dist/layers.BwReZ0XC.js +8 -0
  76. package/dist/layers.C0uya3UC.js +257 -0
  77. package/dist/layers.C3Efr78e.js +1 -0
  78. package/dist/layers.C3kfFCwy.js +37 -0
  79. package/dist/layers.C4DnE7f4.js +9 -0
  80. package/dist/layers.C6dIKT7t.js +32 -0
  81. package/dist/layers.C6rE9oi4.js +5 -0
  82. package/dist/layers.C7lIplJU.js +247 -0
  83. package/dist/layers.C8_lu5UH.js +23 -0
  84. package/dist/layers.C9s4Ga9-.js +139 -0
  85. package/dist/layers.CA3xAcdD.js +84 -0
  86. package/dist/layers.CAt0Toqo.js +39 -0
  87. package/dist/layers.CBmWR4JD.js +41 -0
  88. package/dist/layers.CEnd1x3K.js +7 -0
  89. package/dist/layers.CEpgYsO5.js +10 -0
  90. package/dist/layers.CF3SIE-y.js +9 -0
  91. package/dist/layers.CFMVSllB.js +34 -0
  92. package/dist/layers.CGWEiDtE.js +501 -0
  93. package/dist/layers.CHV4TIWj.js +769 -0
  94. package/dist/layers.CHZsXQcr.js +1 -0
  95. package/dist/layers.CHe9Q8ia.js +9 -0
  96. package/dist/layers.CLX5RFJB.js +39 -0
  97. package/dist/layers.CLz5oPPj.js +1 -0
  98. package/dist/layers.CMV5IiUc.js +5 -0
  99. package/dist/layers.CN0RXanE.js +2 -0
  100. package/dist/layers.CNcbY4HA.js +6 -0
  101. package/dist/layers.COAF7f8g.js +1 -0
  102. package/dist/layers.COPB0bHF.js +2 -0
  103. package/dist/layers.CPGH36Hx.js +38 -0
  104. package/dist/layers.CQ_Gb_tr.js +40 -0
  105. package/dist/layers.CRIXCu9y.js +36 -0
  106. package/dist/layers.CRbZFXp0.js +10 -0
  107. package/dist/layers.CTHKUBrY.js +1 -0
  108. package/dist/layers.CTinG4fA.js +1 -0
  109. package/dist/layers.CUBdNh1l.js +139 -0
  110. package/dist/layers.CUKl38op.js +373 -0
  111. package/dist/layers.CUM6WWJc.js +10 -0
  112. package/dist/layers.CVO2cgHn.js +7 -0
  113. package/dist/layers.CVg-xbVM.js +9148 -0
  114. package/dist/layers.CWQb-v3n.js +59 -0
  115. package/dist/layers.CX7R1NFA.js +42 -0
  116. package/dist/layers.CY2dfUZP.js +220 -0
  117. package/dist/layers.C_YVSLx2.js +19 -0
  118. package/dist/layers.C_kJ5c3l.js +1089 -0
  119. package/dist/layers.CaXcZpWP.js +8 -0
  120. package/dist/layers.CacJtvRK.js +42 -0
  121. package/dist/layers.Cb-u0SLP.js +931 -0
  122. package/dist/layers.Cbk6-WFM.js +1 -0
  123. package/dist/layers.CcEJHfTE.js +6 -0
  124. package/dist/layers.CdKuzWdD.js +1 -0
  125. package/dist/layers.CeljVLEY.js +7 -0
  126. package/dist/layers.CjFEU6yv.js +36 -0
  127. package/dist/layers.CltyxC3q.js +39 -0
  128. package/dist/layers.CnZQE2Pi.js +5 -0
  129. package/dist/layers.Cpp1ZEuF.js +9 -0
  130. package/dist/layers.CpvexSFh.js +202 -0
  131. package/dist/layers.CqVTtuYm.js +6 -0
  132. package/dist/layers.Cs24L6er.js +261 -0
  133. package/dist/layers.CsUFpQDp.js +40 -0
  134. package/dist/layers.CutHJDp4.js +7 -0
  135. package/dist/layers.CvCD8PmL.js +39 -0
  136. package/dist/layers.CwE7GdQT.js +8 -0
  137. package/dist/layers.CwL5PiXG.js +8 -0
  138. package/dist/layers.CyPA2u9-.js +8 -0
  139. package/dist/layers.CzRgGVNU.js +41 -0
  140. package/dist/layers.D0zn4_Mx.js +1 -0
  141. package/dist/layers.D2KUO0dY.js +42 -0
  142. package/dist/layers.D2SIBPjl.js +41 -0
  143. package/dist/layers.D2Tzu1xx.js +116 -0
  144. package/dist/layers.D3rmRYuA.js +10 -0
  145. package/dist/layers.D4fGb2cV.js +1272 -0
  146. package/dist/layers.D56h41PX.js +1 -0
  147. package/dist/layers.D5Wk7Brs.js +10 -0
  148. package/dist/layers.D7jGxypv.js +8 -0
  149. package/dist/layers.D8g04PjT.js +9 -0
  150. package/dist/layers.D97nDwEx.js +9 -0
  151. package/dist/layers.D9Df9NSm.js +14 -0
  152. package/dist/layers.DBFfWJxR.js +51 -0
  153. package/dist/layers.DChAJIDE.js +40 -0
  154. package/dist/layers.DGjpnqy8.js +295 -0
  155. package/dist/layers.DKvSkiyS.js +52 -0
  156. package/dist/layers.DL83jGn_.js +61 -0
  157. package/dist/layers.DLwuMfdd.js +84 -0
  158. package/dist/layers.DMkBISW1.js +1 -0
  159. package/dist/layers.DMyyjog4.js +32 -0
  160. package/dist/layers.DN9HoVxI.js +18 -0
  161. package/dist/layers.DO-43L6O.js +423 -0
  162. package/dist/layers.DOrgOHBr.js +1 -0
  163. package/dist/layers.DPRdtwVX.js +10 -0
  164. package/dist/layers.DPkkvYnI.js +96 -0
  165. package/dist/layers.DRLM7uPa.js +1 -0
  166. package/dist/layers.DRk9pZsP.js +1 -0
  167. package/dist/layers.DRrRO-pI.js +39 -0
  168. package/dist/layers.DS6sUpQY.js +70 -0
  169. package/dist/layers.DSNZlSxG.js +40 -0
  170. package/dist/layers.DT14b_tp.js +122 -0
  171. package/dist/layers.DU9bT12-.js +11 -0
  172. package/dist/layers.DVysgz_L.js +9 -0
  173. package/dist/layers.DWyWcSYq.js +425 -0
  174. package/dist/layers.DYgifwCe.js +1265 -0
  175. package/dist/layers.DYrmRjRC.js +1034 -0
  176. package/dist/layers.DZVdzwBS.js +1 -0
  177. package/dist/layers.DbaKVP5e.js +1 -0
  178. package/dist/layers.Dd8k3mGW.js +32 -0
  179. package/dist/layers.Dera5nI8.js +8 -0
  180. package/dist/layers.DfHyYQto.js +1 -0
  181. package/dist/layers.Dg-bFIGZ.js +6 -0
  182. package/dist/layers.Dj2x2a5K.js +7 -0
  183. package/dist/layers.DjRYd6_J.js +6 -0
  184. package/dist/layers.DjUOC4st.js +16 -0
  185. package/dist/layers.Dlx-9qlV.js +4 -0
  186. package/dist/layers.DmXbI_X6.js +32 -0
  187. package/dist/layers.Dn51Gu3w.js +42 -0
  188. package/dist/layers.DnGlTnoF.js +8 -0
  189. package/dist/layers.DnXE-nI2.js +32 -0
  190. package/dist/layers.DneGJ5YW.js +36 -0
  191. package/dist/layers.DnyqZntR.js +1 -0
  192. package/dist/layers.DvXH8BN-.js +4 -0
  193. package/dist/layers.DvbNClAr.js +11 -0
  194. package/dist/layers.DwlMkCL5.js +1 -0
  195. package/dist/layers.DxA6ocdw.js +70 -0
  196. package/dist/layers.Dy1naDTQ.js +14 -0
  197. package/dist/layers.Fwx6Z-E0.js +7 -0
  198. package/dist/layers.GqCRYDXG.js +1619 -0
  199. package/dist/layers.Iok4Hx4P.js +1 -0
  200. package/dist/layers.JWCLFILJ.js +1 -0
  201. package/dist/layers.JWXTGwdn.js +39 -0
  202. package/dist/layers.Lv1hsK8F.js +42 -0
  203. package/dist/layers.MRw7LhZs.js +185 -0
  204. package/dist/layers.MZxHWl05.js +437 -0
  205. package/dist/layers.MfF8Mar4.js +40 -0
  206. package/dist/layers.NZaKqPGi.js +320 -0
  207. package/dist/layers.O16Qu9DR.js +38 -0
  208. package/dist/layers.OJEt97_Q.js +1 -0
  209. package/dist/layers.OkAEP5sK.js +41 -0
  210. package/dist/layers.QKd6brRD.js +1 -0
  211. package/dist/layers.QgpZpst1.js +1 -0
  212. package/dist/layers.RkLEX3Zh.js +7 -0
  213. package/dist/layers.RskRv7xC.js +33 -0
  214. package/dist/layers.Ru0qupSB.js +32 -0
  215. package/dist/layers.W2ukY1Da.js +960 -0
  216. package/dist/layers.XHdBpBIc.js +38 -0
  217. package/dist/layers.Y42vCoBD.js +40 -0
  218. package/dist/layers.ZQ_-z-aL.js +10 -0
  219. package/dist/layers.b0h5ZBmD.js +61 -0
  220. package/dist/layers.b6DSxQLV.js +186 -0
  221. package/dist/layers.erJbqYPP.js +9 -0
  222. package/dist/layers.gBi0hIYC.js +13 -0
  223. package/dist/layers.lCpg7dOn.js +21 -0
  224. package/dist/layers.ms8NfStk.js +41 -0
  225. package/dist/layers.mwnm89da.js +21763 -0
  226. package/dist/layers.nHHM2gEW.js +39 -0
  227. package/dist/layers.nbOz9XY9.js +44 -0
  228. package/dist/layers.p871JVGx.js +1359 -0
  229. package/dist/layers.pmoMn3BH.js +793 -0
  230. package/dist/layers.pw41pFms.js +35 -0
  231. package/dist/layers.rNpo9CKl.js +1126 -0
  232. package/dist/layers.uf8nbAjB.js +39 -0
  233. package/dist/layers.vXYsjfZS.js +9 -0
  234. package/dist/layers.vggOk4T3.js +48146 -0
  235. package/dist/layers.vmEHkEhU.js +21938 -0
  236. package/dist/{layers.YZkXZvVS.js → layers.vrcLKgWz.js} +14947 -13808
  237. package/dist/layers.vsJbLxBG.js +2 -0
  238. package/dist/layers.wmlkGZ6N.js +41 -0
  239. package/dist/layers.xJXWA8H6.js +35 -0
  240. package/dist/layers.zPlc1039.js +40 -0
  241. package/package.json +32 -16
  242. package/dist/layers.Cjs5EBWM.js +0 -343
  243. package/dist/layers.DPccTctI.js +0 -285
  244. package/dist/layers.DZ8DrrVn.js +0 -53491
  245. package/dist/layers.QVaGPbs3.js +0 -161
  246. package/dist/layers.VK3NB7Nd.js +0 -1
@@ -0,0 +1,803 @@
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.CVg-xbVM.js";
2
+ import "./layers.mwnm89da.js";
3
+ import { o as At } from "./layers.b0h5ZBmD.js";
4
+ import { s as Tt } from "./layers.D7jGxypv.js";
5
+ function ot(t, n) {
6
+ let s;
7
+ if (n === void 0)
8
+ for (const a of t)
9
+ a != null && (s < a || s === void 0 && a >= a) && (s = a);
10
+ else {
11
+ let a = -1;
12
+ for (let u of t)
13
+ (u = n(u, ++a, t)) != null && (s < u || s === void 0 && u >= u) && (s = u);
14
+ }
15
+ return s;
16
+ }
17
+ function yt(t, n) {
18
+ let s;
19
+ if (n === void 0)
20
+ for (const a of t)
21
+ a != null && (s > a || s === void 0 && a >= a) && (s = a);
22
+ else {
23
+ let a = -1;
24
+ for (let u of t)
25
+ (u = n(u, ++a, t)) != null && (s > u || s === void 0 && u >= u) && (s = u);
26
+ }
27
+ return s;
28
+ }
29
+ function Z(t, n) {
30
+ let s = 0;
31
+ if (n === void 0)
32
+ for (let a of t)
33
+ (a = +a) && (s += a);
34
+ else {
35
+ let a = -1;
36
+ for (let u of t)
37
+ (u = +n(u, ++a, t)) && (s += u);
38
+ }
39
+ return s;
40
+ }
41
+ function Mt(t) {
42
+ return t.target.depth;
43
+ }
44
+ function Nt(t) {
45
+ return t.depth;
46
+ }
47
+ function Pt(t, n) {
48
+ return n - 1 - t.height;
49
+ }
50
+ function dt(t, n) {
51
+ return t.sourceLinks.length ? t.depth : n - 1;
52
+ }
53
+ function Ct(t) {
54
+ return t.targetLinks.length ? t.depth : t.sourceLinks.length ? yt(t.sourceLinks, Mt) - 1 : 0;
55
+ }
56
+ function G(t) {
57
+ return function() {
58
+ return t;
59
+ };
60
+ }
61
+ function lt(t, n) {
62
+ return q(t.source, n.source) || t.index - n.index;
63
+ }
64
+ function at(t, n) {
65
+ return q(t.target, n.target) || t.index - n.index;
66
+ }
67
+ function q(t, n) {
68
+ return t.y0 - n.y0;
69
+ }
70
+ function J(t) {
71
+ return t.value;
72
+ }
73
+ function It(t) {
74
+ return t.index;
75
+ }
76
+ function $t(t) {
77
+ return t.nodes;
78
+ }
79
+ function Ot(t) {
80
+ return t.links;
81
+ }
82
+ function ct(t, n) {
83
+ const s = t.get(n);
84
+ if (!s) throw new Error("missing: " + n);
85
+ return s;
86
+ }
87
+ function ut({ nodes: t }) {
88
+ for (const n of t) {
89
+ let s = n.y0, a = s;
90
+ for (const u of n.sourceLinks)
91
+ u.y0 = s + u.width / 2, s += u.width;
92
+ for (const u of n.targetLinks)
93
+ u.y1 = a + u.width / 2, a += u.width;
94
+ }
95
+ }
96
+ function jt() {
97
+ 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;
98
+ function x() {
99
+ const e = { nodes: m.apply(null, arguments), links: b.apply(null, arguments) };
100
+ return E(e), L(e), A(e), N(e), S(e), ut(e), e;
101
+ }
102
+ x.update = function(e) {
103
+ return ut(e), e;
104
+ }, x.nodeId = function(e) {
105
+ return arguments.length ? (p = typeof e == "function" ? e : G(e), x) : p;
106
+ }, x.nodeAlign = function(e) {
107
+ return arguments.length ? (i = typeof e == "function" ? e : G(e), x) : i;
108
+ }, x.nodeSort = function(e) {
109
+ return arguments.length ? (o = e, x) : o;
110
+ }, x.nodeWidth = function(e) {
111
+ return arguments.length ? (u = +e, x) : u;
112
+ }, x.nodePadding = function(e) {
113
+ return arguments.length ? (_ = g = +e, x) : _;
114
+ }, x.nodes = function(e) {
115
+ return arguments.length ? (m = typeof e == "function" ? e : G(e), x) : m;
116
+ }, x.links = function(e) {
117
+ return arguments.length ? (b = typeof e == "function" ? e : G(e), x) : b;
118
+ }, x.linkSort = function(e) {
119
+ return arguments.length ? (c = e, x) : c;
120
+ }, x.size = function(e) {
121
+ return arguments.length ? (t = n = 0, s = +e[0], a = +e[1], x) : [s - t, a - n];
122
+ }, x.extent = function(e) {
123
+ return arguments.length ? (t = +e[0][0], s = +e[1][0], n = +e[0][1], a = +e[1][1], x) : [[t, n], [s, a]];
124
+ }, x.iterations = function(e) {
125
+ return arguments.length ? (y = +e, x) : y;
126
+ };
127
+ function E({ nodes: e, links: f }) {
128
+ for (const [h, r] of e.entries())
129
+ r.index = h, r.sourceLinks = [], r.targetLinks = [];
130
+ const l = new Map(e.map((h, r) => [p(h, r, e), h]));
131
+ for (const [h, r] of f.entries()) {
132
+ r.index = h;
133
+ let { source: k, target: v } = r;
134
+ 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);
135
+ }
136
+ if (c != null)
137
+ for (const { sourceLinks: h, targetLinks: r } of e)
138
+ h.sort(c), r.sort(c);
139
+ }
140
+ function L({ nodes: e }) {
141
+ for (const f of e)
142
+ f.value = f.fixedValue === void 0 ? Math.max(Z(f.sourceLinks, J), Z(f.targetLinks, J)) : f.fixedValue;
143
+ }
144
+ function A({ nodes: e }) {
145
+ const f = e.length;
146
+ let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
147
+ for (; l.size; ) {
148
+ for (const k of l) {
149
+ k.depth = r;
150
+ for (const { target: v } of k.sourceLinks)
151
+ h.add(v);
152
+ }
153
+ if (++r > f) throw new Error("circular link");
154
+ l = h, h = /* @__PURE__ */ new Set();
155
+ }
156
+ }
157
+ function N({ nodes: e }) {
158
+ const f = e.length;
159
+ let l = new Set(e), h = /* @__PURE__ */ new Set(), r = 0;
160
+ for (; l.size; ) {
161
+ for (const k of l) {
162
+ k.height = r;
163
+ for (const { source: v } of k.targetLinks)
164
+ h.add(v);
165
+ }
166
+ if (++r > f) throw new Error("circular link");
167
+ l = h, h = /* @__PURE__ */ new Set();
168
+ }
169
+ }
170
+ function I({ nodes: e }) {
171
+ const f = ot(e, (r) => r.depth) + 1, l = (s - t - u) / (f - 1), h = new Array(f);
172
+ for (const r of e) {
173
+ const k = Math.max(0, Math.min(f - 1, Math.floor(i.call(null, r, f))));
174
+ r.layer = k, r.x0 = t + k * l, r.x1 = r.x0 + u, h[k] ? h[k].push(r) : h[k] = [r];
175
+ }
176
+ if (o) for (const r of h)
177
+ r.sort(o);
178
+ return h;
179
+ }
180
+ function j(e) {
181
+ const f = yt(e, (l) => (a - n - (l.length - 1) * g) / Z(l, J));
182
+ for (const l of e) {
183
+ let h = n;
184
+ for (const r of l) {
185
+ r.y0 = h, r.y1 = h + r.value * f, h = r.y1 + g;
186
+ for (const k of r.sourceLinks)
187
+ k.width = k.value * f;
188
+ }
189
+ h = (a - h + g) / (l.length + 1);
190
+ for (let r = 0; r < l.length; ++r) {
191
+ const k = l[r];
192
+ k.y0 += h * (r + 1), k.y1 += h * (r + 1);
193
+ }
194
+ $(l);
195
+ }
196
+ }
197
+ function S(e) {
198
+ const f = I(e);
199
+ g = Math.min(_, (a - n) / (ot(f, (l) => l.length) - 1)), j(f);
200
+ for (let l = 0; l < y; ++l) {
201
+ const h = Math.pow(0.99, l), r = Math.max(1 - h, (l + 1) / y);
202
+ O(f, h, r), M(f, h, r);
203
+ }
204
+ }
205
+ function M(e, f, l) {
206
+ for (let h = 1, r = e.length; h < r; ++h) {
207
+ const k = e[h];
208
+ for (const v of k) {
209
+ let R = 0, z = 0;
210
+ for (const { source: W, value: K } of v.targetLinks) {
211
+ let F = K * (v.layer - W.layer);
212
+ R += T(W, v) * F, z += F;
213
+ }
214
+ if (!(z > 0)) continue;
215
+ let U = (R / z - v.y0) * f;
216
+ v.y0 += U, v.y1 += U, w(v);
217
+ }
218
+ o === void 0 && k.sort(q), P(k, l);
219
+ }
220
+ }
221
+ function O(e, f, l) {
222
+ for (let h = e.length, r = h - 2; r >= 0; --r) {
223
+ const k = e[r];
224
+ for (const v of k) {
225
+ let R = 0, z = 0;
226
+ for (const { target: W, value: K } of v.sourceLinks) {
227
+ let F = K * (W.layer - v.layer);
228
+ R += V(v, W) * F, z += F;
229
+ }
230
+ if (!(z > 0)) continue;
231
+ let U = (R / z - v.y0) * f;
232
+ v.y0 += U, v.y1 += U, w(v);
233
+ }
234
+ o === void 0 && k.sort(q), P(k, l);
235
+ }
236
+ }
237
+ function P(e, f) {
238
+ const l = e.length >> 1, h = e[l];
239
+ 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);
240
+ }
241
+ function C(e, f, l, h) {
242
+ for (; l < e.length; ++l) {
243
+ const r = e[l], k = (f - r.y0) * h;
244
+ k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + g;
245
+ }
246
+ }
247
+ function d(e, f, l, h) {
248
+ for (; l >= 0; --l) {
249
+ const r = e[l], k = (r.y1 - f) * h;
250
+ k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - g;
251
+ }
252
+ }
253
+ function w({ sourceLinks: e, targetLinks: f }) {
254
+ if (c === void 0) {
255
+ for (const { source: { sourceLinks: l } } of f)
256
+ l.sort(at);
257
+ for (const { target: { targetLinks: l } } of e)
258
+ l.sort(lt);
259
+ }
260
+ }
261
+ function $(e) {
262
+ if (c === void 0)
263
+ for (const { sourceLinks: f, targetLinks: l } of e)
264
+ f.sort(at), l.sort(lt);
265
+ }
266
+ function T(e, f) {
267
+ let l = e.y0 - (e.sourceLinks.length - 1) * g / 2;
268
+ for (const { target: h, width: r } of e.sourceLinks) {
269
+ if (h === f) break;
270
+ l += r + g;
271
+ }
272
+ for (const { source: h, width: r } of f.targetLinks) {
273
+ if (h === e) break;
274
+ l -= r;
275
+ }
276
+ return l;
277
+ }
278
+ function V(e, f) {
279
+ let l = f.y0 - (f.targetLinks.length - 1) * g / 2;
280
+ for (const { source: h, width: r } of f.targetLinks) {
281
+ if (h === e) break;
282
+ l += r + g;
283
+ }
284
+ for (const { target: h, width: r } of e.sourceLinks) {
285
+ if (h === f) break;
286
+ l -= r;
287
+ }
288
+ return l;
289
+ }
290
+ return x;
291
+ }
292
+ var tt = Math.PI, et = 2 * tt, D = 1e-6, zt = et - D;
293
+ function nt() {
294
+ this._x0 = this._y0 = // start of current subpath
295
+ this._x1 = this._y1 = null, this._ = "";
296
+ }
297
+ function gt() {
298
+ return new nt();
299
+ }
300
+ nt.prototype = gt.prototype = {
301
+ constructor: nt,
302
+ moveTo: function(t, n) {
303
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n);
304
+ },
305
+ closePath: function() {
306
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
307
+ },
308
+ lineTo: function(t, n) {
309
+ this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +n);
310
+ },
311
+ quadraticCurveTo: function(t, n, s, a) {
312
+ this._ += "Q" + +t + "," + +n + "," + (this._x1 = +s) + "," + (this._y1 = +a);
313
+ },
314
+ bezierCurveTo: function(t, n, s, a, u, _) {
315
+ this._ += "C" + +t + "," + +n + "," + +s + "," + +a + "," + (this._x1 = +u) + "," + (this._y1 = +_);
316
+ },
317
+ arcTo: function(t, n, s, a, u) {
318
+ t = +t, n = +n, s = +s, a = +a, u = +u;
319
+ var _ = this._x1, g = this._y1, p = s - t, i = a - n, o = _ - t, c = g - n, m = o * o + c * c;
320
+ if (u < 0) throw new Error("negative radius: " + u);
321
+ if (this._x1 === null)
322
+ this._ += "M" + (this._x1 = t) + "," + (this._y1 = n);
323
+ else if (m > D) if (!(Math.abs(c * p - i * o) > D) || !u)
324
+ this._ += "L" + (this._x1 = t) + "," + (this._y1 = n);
325
+ else {
326
+ 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;
327
+ 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);
328
+ }
329
+ },
330
+ arc: function(t, n, s, a, u, _) {
331
+ t = +t, n = +n, s = +s, _ = !!_;
332
+ var g = s * Math.cos(a), p = s * Math.sin(a), i = t + g, o = n + p, c = 1 ^ _, m = _ ? a - u : u - a;
333
+ if (s < 0) throw new Error("negative radius: " + s);
334
+ 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))));
335
+ },
336
+ rect: function(t, n, s, a) {
337
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +n) + "h" + +s + "v" + +a + "h" + -s + "Z";
338
+ },
339
+ toString: function() {
340
+ return this._;
341
+ }
342
+ };
343
+ function ht(t) {
344
+ return function() {
345
+ return t;
346
+ };
347
+ }
348
+ function Dt(t) {
349
+ return t[0];
350
+ }
351
+ function Bt(t) {
352
+ return t[1];
353
+ }
354
+ var Vt = Array.prototype.slice;
355
+ function Rt(t) {
356
+ return t.source;
357
+ }
358
+ function Ut(t) {
359
+ return t.target;
360
+ }
361
+ function Wt(t) {
362
+ var n = Rt, s = Ut, a = Dt, u = Bt, _ = null;
363
+ function g() {
364
+ var p, i = Vt.call(arguments), o = n.apply(this, i), c = s.apply(this, i);
365
+ 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;
366
+ }
367
+ return g.source = function(p) {
368
+ return arguments.length ? (n = p, g) : n;
369
+ }, g.target = function(p) {
370
+ return arguments.length ? (s = p, g) : s;
371
+ }, g.x = function(p) {
372
+ return arguments.length ? (a = typeof p == "function" ? p : ht(+p), g) : a;
373
+ }, g.y = function(p) {
374
+ return arguments.length ? (u = typeof p == "function" ? p : ht(+p), g) : u;
375
+ }, g.context = function(p) {
376
+ return arguments.length ? (_ = p ?? null, g) : _;
377
+ }, g;
378
+ }
379
+ function Ft(t, n, s, a, u) {
380
+ t.moveTo(n, s), t.bezierCurveTo(n = (n + a) / 2, s, n, u, a, u);
381
+ }
382
+ function Yt() {
383
+ return Wt(Ft);
384
+ }
385
+ function Gt(t) {
386
+ return [t.source.x1, t.y0];
387
+ }
388
+ function qt(t) {
389
+ return [t.target.x0, t.y1];
390
+ }
391
+ function Ht() {
392
+ return Yt().source(Gt).target(qt);
393
+ }
394
+ var it = (function() {
395
+ var t = function(p, i, o, c) {
396
+ for (o = o || {}, c = p.length; c--; o[p[c]] = i)
397
+ ;
398
+ return o;
399
+ }, n = [1, 9], s = [1, 10], a = [1, 5, 10, 12], u = {
400
+ trace: function() {
401
+ },
402
+ yy: {},
403
+ 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 },
404
+ 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" },
405
+ productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
406
+ performAction: function(i, o, c, m, b, y, x) {
407
+ var E = y.length - 1;
408
+ switch (b) {
409
+ case 7:
410
+ const L = m.findOrCreateNode(y[E - 4].trim().replaceAll('""', '"')), A = m.findOrCreateNode(y[E - 2].trim().replaceAll('""', '"')), N = parseFloat(y[E].trim());
411
+ m.addLink(L, A, N);
412
+ break;
413
+ case 8:
414
+ case 9:
415
+ case 11:
416
+ this.$ = y[E];
417
+ break;
418
+ case 10:
419
+ this.$ = y[E - 1];
420
+ break;
421
+ }
422
+ },
423
+ 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])],
424
+ defaultActions: { 11: [2, 1], 12: [2, 5] },
425
+ parseError: function(i, o) {
426
+ if (o.recoverable)
427
+ this.trace(i);
428
+ else {
429
+ var c = new Error(i);
430
+ throw c.hash = o, c;
431
+ }
432
+ },
433
+ parse: function(i) {
434
+ 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: {} };
435
+ for (var O in this.yy)
436
+ Object.prototype.hasOwnProperty.call(this.yy, O) && (M.yy[O] = this.yy[O]);
437
+ S.setInput(i, M.yy), M.yy.lexer = S, M.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
438
+ var P = S.yylloc;
439
+ y.push(P);
440
+ var C = S.options && S.options.ranges;
441
+ typeof M.yy.parseError == "function" ? this.parseError = M.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
442
+ function d() {
443
+ var v;
444
+ return v = m.pop() || S.lex() || I, typeof v != "number" && (v instanceof Array && (m = v, v = m.pop()), v = o.symbols_[v] || v), v;
445
+ }
446
+ for (var w, $, T, V, e = {}, f, l, h, r; ; ) {
447
+ 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]) {
448
+ var k = "";
449
+ r = [];
450
+ for (f in x[$])
451
+ this.terminals_[f] && f > N && r.push("'" + this.terminals_[f] + "'");
452
+ S.showPosition ? k = "Parse error on line " + (L + 1) + `:
453
+ ` + S.showPosition() + `
454
+ 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, {
455
+ text: S.match,
456
+ token: this.terminals_[w] || w,
457
+ line: S.yylineno,
458
+ loc: P,
459
+ expected: r
460
+ });
461
+ }
462
+ if (T[0] instanceof Array && T.length > 1)
463
+ throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + w);
464
+ switch (T[0]) {
465
+ case 1:
466
+ 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;
467
+ break;
468
+ case 2:
469
+ if (l = this.productions_[T[1]][1], e.$ = b[b.length - l], e._$ = {
470
+ first_line: y[y.length - (l || 1)].first_line,
471
+ last_line: y[y.length - 1].last_line,
472
+ first_column: y[y.length - (l || 1)].first_column,
473
+ last_column: y[y.length - 1].last_column
474
+ }, C && (e._$.range = [
475
+ y[y.length - (l || 1)].range[0],
476
+ y[y.length - 1].range[1]
477
+ ]), V = this.performAction.apply(e, [
478
+ E,
479
+ A,
480
+ L,
481
+ M.yy,
482
+ T[1],
483
+ b,
484
+ y
485
+ ].concat(j)), typeof V < "u")
486
+ return V;
487
+ 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);
488
+ break;
489
+ case 3:
490
+ return !0;
491
+ }
492
+ }
493
+ return !0;
494
+ }
495
+ }, _ = /* @__PURE__ */ (function() {
496
+ var p = {
497
+ EOF: 1,
498
+ parseError: function(o, c) {
499
+ if (this.yy.parser)
500
+ this.yy.parser.parseError(o, c);
501
+ else
502
+ throw new Error(o);
503
+ },
504
+ // resets the lexer, sets new input
505
+ setInput: function(i, o) {
506
+ 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 = {
507
+ first_line: 1,
508
+ first_column: 0,
509
+ last_line: 1,
510
+ last_column: 0
511
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
512
+ },
513
+ // consumes and returns one char from the input
514
+ input: function() {
515
+ var i = this._input[0];
516
+ this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
517
+ var o = i.match(/(?:\r\n?|\n).*/g);
518
+ 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;
519
+ },
520
+ // unshifts one char (or a string) into the input
521
+ unput: function(i) {
522
+ var o = i.length, c = i.split(/(?:\r\n?|\n)/g);
523
+ this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
524
+ var m = this.match.split(/(?:\r\n?|\n)/g);
525
+ 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);
526
+ var b = this.yylloc.range;
527
+ return this.yylloc = {
528
+ first_line: this.yylloc.first_line,
529
+ last_line: this.yylineno + 1,
530
+ first_column: this.yylloc.first_column,
531
+ 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
532
+ }, this.options.ranges && (this.yylloc.range = [b[0], b[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
533
+ },
534
+ // When called from action, caches matched text and appends it on next action
535
+ more: function() {
536
+ return this._more = !0, this;
537
+ },
538
+ // 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.
539
+ reject: function() {
540
+ if (this.options.backtrack_lexer)
541
+ this._backtrack = !0;
542
+ else
543
+ 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).
544
+ ` + this.showPosition(), {
545
+ text: "",
546
+ token: null,
547
+ line: this.yylineno
548
+ });
549
+ return this;
550
+ },
551
+ // retain first n characters of the match
552
+ less: function(i) {
553
+ this.unput(this.match.slice(i));
554
+ },
555
+ // displays already matched input, i.e. for error messages
556
+ pastInput: function() {
557
+ var i = this.matched.substr(0, this.matched.length - this.match.length);
558
+ return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
559
+ },
560
+ // displays upcoming input, i.e. for error messages
561
+ upcomingInput: function() {
562
+ var i = this.match;
563
+ return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
564
+ },
565
+ // displays the character position where the lexing error occurred, i.e. for error messages
566
+ showPosition: function() {
567
+ var i = this.pastInput(), o = new Array(i.length + 1).join("-");
568
+ return i + this.upcomingInput() + `
569
+ ` + o + "^";
570
+ },
571
+ // test the lexed token: return FALSE when not a match, otherwise return token
572
+ test_match: function(i, o) {
573
+ var c, m, b;
574
+ if (this.options.backtrack_lexer && (b = {
575
+ yylineno: this.yylineno,
576
+ yylloc: {
577
+ first_line: this.yylloc.first_line,
578
+ last_line: this.last_line,
579
+ first_column: this.yylloc.first_column,
580
+ last_column: this.yylloc.last_column
581
+ },
582
+ yytext: this.yytext,
583
+ match: this.match,
584
+ matches: this.matches,
585
+ matched: this.matched,
586
+ yyleng: this.yyleng,
587
+ offset: this.offset,
588
+ _more: this._more,
589
+ _input: this._input,
590
+ yy: this.yy,
591
+ conditionStack: this.conditionStack.slice(0),
592
+ done: this.done
593
+ }, 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 = {
594
+ first_line: this.yylloc.last_line,
595
+ last_line: this.yylineno + 1,
596
+ first_column: this.yylloc.last_column,
597
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
598
+ }, 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)
599
+ return c;
600
+ if (this._backtrack) {
601
+ for (var y in b)
602
+ this[y] = b[y];
603
+ return !1;
604
+ }
605
+ return !1;
606
+ },
607
+ // return next match in input
608
+ next: function() {
609
+ if (this.done)
610
+ return this.EOF;
611
+ this._input || (this.done = !0);
612
+ var i, o, c, m;
613
+ this._more || (this.yytext = "", this.match = "");
614
+ for (var b = this._currentRules(), y = 0; y < b.length; y++)
615
+ if (c = this._input.match(this.rules[b[y]]), c && (!o || c[0].length > o[0].length)) {
616
+ if (o = c, m = y, this.options.backtrack_lexer) {
617
+ if (i = this.test_match(c, b[y]), i !== !1)
618
+ return i;
619
+ if (this._backtrack) {
620
+ o = !1;
621
+ continue;
622
+ } else
623
+ return !1;
624
+ } else if (!this.options.flex)
625
+ break;
626
+ }
627
+ 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.
628
+ ` + this.showPosition(), {
629
+ text: "",
630
+ token: null,
631
+ line: this.yylineno
632
+ });
633
+ },
634
+ // return next match that has a token
635
+ lex: function() {
636
+ var o = this.next();
637
+ return o || this.lex();
638
+ },
639
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
640
+ begin: function(o) {
641
+ this.conditionStack.push(o);
642
+ },
643
+ // pop the previously active lexer condition state off the condition stack
644
+ popState: function() {
645
+ var o = this.conditionStack.length - 1;
646
+ return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
647
+ },
648
+ // produce the lexer rule set which is active for the currently active lexer condition state
649
+ _currentRules: function() {
650
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
651
+ },
652
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
653
+ topState: function(o) {
654
+ return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
655
+ },
656
+ // alias for begin(condition)
657
+ pushState: function(o) {
658
+ this.begin(o);
659
+ },
660
+ // return the number of states currently on the stack
661
+ stateStackSize: function() {
662
+ return this.conditionStack.length;
663
+ },
664
+ options: { "case-insensitive": !0 },
665
+ performAction: function(o, c, m, b) {
666
+ switch (m) {
667
+ case 0:
668
+ return this.pushState("csv"), 4;
669
+ case 1:
670
+ return 10;
671
+ case 2:
672
+ return 5;
673
+ case 3:
674
+ return 12;
675
+ case 4:
676
+ return this.pushState("escaped_text"), 18;
677
+ case 5:
678
+ return 20;
679
+ case 6:
680
+ return this.popState("escaped_text"), 18;
681
+ case 7:
682
+ return 19;
683
+ }
684
+ },
685
+ 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],
686
+ 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 } }
687
+ };
688
+ return p;
689
+ })();
690
+ u.lexer = _;
691
+ function g() {
692
+ this.yy = {};
693
+ }
694
+ return g.prototype = u, u.Parser = g, new g();
695
+ })();
696
+ it.parser = it;
697
+ const H = it;
698
+ let X = [], Q = [], B = {};
699
+ const Xt = () => {
700
+ X = [], Q = [], B = {}, Lt();
701
+ };
702
+ class Qt {
703
+ constructor(n, s, a = 0) {
704
+ this.source = n, this.target = s, this.value = a;
705
+ }
706
+ }
707
+ const Kt = (t, n, s) => {
708
+ X.push(new Qt(t, n, s));
709
+ };
710
+ class Zt {
711
+ constructor(n) {
712
+ this.ID = n;
713
+ }
714
+ }
715
+ 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 = () => ({
716
+ nodes: Q.map((t) => ({ id: t.ID })),
717
+ links: X.map((t) => ({
718
+ source: t.source.ID,
719
+ target: t.target.ID,
720
+ value: t.value
721
+ }))
722
+ }), ie = {
723
+ nodesMap: B,
724
+ getConfig: () => rt().sankey,
725
+ getNodes: te,
726
+ getLinks: ee,
727
+ getGraph: ne,
728
+ addLink: Kt,
729
+ findOrCreateNode: Jt,
730
+ getAccTitle: bt,
731
+ setAccTitle: vt,
732
+ getAccDescription: xt,
733
+ setAccDescription: _t,
734
+ getDiagramTitle: kt,
735
+ setDiagramTitle: mt,
736
+ clear: Xt
737
+ }, pt = class st {
738
+ static next(n) {
739
+ return new st(n + ++st.count);
740
+ }
741
+ constructor(n) {
742
+ this.id = n, this.href = `#${n}`;
743
+ }
744
+ toString() {
745
+ return "url(" + this.href + ")";
746
+ }
747
+ };
748
+ pt.count = 0;
749
+ let ft = pt;
750
+ const se = {
751
+ left: Nt,
752
+ right: Pt,
753
+ center: Ct,
754
+ justify: dt
755
+ }, re = function(t, n, s, a) {
756
+ const { securityLevel: u, sankey: _ } = rt(), g = wt.sankey;
757
+ let p;
758
+ u === "sandbox" && (p = Y("#i" + n));
759
+ 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];
760
+ jt().nodeId((d) => d.id).nodeWidth(10).nodePadding(10 + (L ? 15 : 0)).nodeAlign(N).extent([
761
+ [0, 0],
762
+ [c, m]
763
+ ])(A);
764
+ const S = At(Tt);
765
+ 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) {
766
+ return "translate(" + d.x0 + "," + d.y0 + ")";
767
+ }).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));
768
+ const M = ({ id: d, value: w }) => L ? `${d}
769
+ ${x}${Math.round(w * 100) / 100}${E}` : d;
770
+ 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);
771
+ 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";
772
+ if (P === "gradient") {
773
+ 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);
774
+ 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));
775
+ }
776
+ let C;
777
+ switch (P) {
778
+ case "gradient":
779
+ C = (d) => d.uid;
780
+ break;
781
+ case "source":
782
+ C = (d) => S(d.source.id);
783
+ break;
784
+ case "target":
785
+ C = (d) => S(d.target.id);
786
+ break;
787
+ default:
788
+ C = P;
789
+ }
790
+ O.append("path").attr("d", Ht()).attr("stroke", C).attr("stroke-width", (d) => Math.max(1, d.width)), St(void 0, o, 0, b);
791
+ }, oe = {
792
+ draw: re
793
+ }, le = (t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
794
+ `).trim(), ae = H.parse.bind(H);
795
+ H.parse = (t) => ae(le(t));
796
+ const ye = {
797
+ parser: H,
798
+ db: ie,
799
+ renderer: oe
800
+ };
801
+ export {
802
+ ye as diagram
803
+ };