@fibery/custom-app-text-editor 1.2.0

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 (105) hide show
  1. package/LICENSE +214 -0
  2. package/README.md +33 -0
  3. package/lib/abnfDiagram-VRR7QNED-BgjOQqEh.js +89 -0
  4. package/lib/arc-Dp0rqagO.js +82 -0
  5. package/lib/architecture-TIHT7OUA-DDwCCw0y.js +3 -0
  6. package/lib/architectureDiagram-ZJ3FMSHR-BucIluTN.js +4129 -0
  7. package/lib/array-CApNbSU9.js +6 -0
  8. package/lib/blockDiagram-677ZJIJ3-CWYuHThP.js +3157 -0
  9. package/lib/c4Diagram-LMCZKHZV-Cr3_W-xe.js +2982 -0
  10. package/lib/channel-Bb7a6w5c.js +5 -0
  11. package/lib/chunk-2Q5K7J3B-CINvUK-A.js +15 -0
  12. package/lib/chunk-32BRIVSS-b-BvyGz0.js +61 -0
  13. package/lib/chunk-52WLFC77-Cf8zEoqs.js +593 -0
  14. package/lib/chunk-5VM5RSS4-Dnx15xMv.js +5 -0
  15. package/lib/chunk-7BUUIJ7U-B018BbRy.js +82 -0
  16. package/lib/chunk-C7G6YPKG-CmOuVFlJ.js +67 -0
  17. package/lib/chunk-EX3LRPZG-LynZw14I.js +2042 -0
  18. package/lib/chunk-HOUHSVGY-Br7ZSMKe.js +275 -0
  19. package/lib/chunk-ICXQ74PX-VqT5WUTt.js +1330 -0
  20. package/lib/chunk-JWPE2WC7-Ch0jmUXM.js +8 -0
  21. package/lib/chunk-KEIR6QF5-RwFi50en.js +21456 -0
  22. package/lib/chunk-MOJQB5TN-rQ4AfTd9.js +490 -0
  23. package/lib/chunk-OGEWGWER-BvF6eV9Q.js +32 -0
  24. package/lib/chunk-PUDLZKDR-BW7SZvCB.js +4135 -0
  25. package/lib/chunk-Q4XR5HBZ-CRgGP3ez.js +1635 -0
  26. package/lib/chunk-RYQCIY6F-CHlASUpG.js +241 -0
  27. package/lib/chunk-V7JOEXUC-OY39ml6X.js +3357 -0
  28. package/lib/chunk-VR4S4FIN-Bk7IFdYB.js +26 -0
  29. package/lib/chunk-WYO6CB5R-MV-yOaop.js +3769 -0
  30. package/lib/chunk-XXDRQBXY-Djd1ChwJ.js +9 -0
  31. package/lib/chunk-Y2CYZVJY-QdJ4V9rh.js +12 -0
  32. package/lib/chunk-ZGVPDNZ5-l81xl1BI.js +3738 -0
  33. package/lib/classDiagram-OUVF2IWQ--wRzSvLt.js +30 -0
  34. package/lib/classDiagram-v2-EOCWNBFH-ChMCdPO-.js +30 -0
  35. package/lib/cose-bilkent-JH36ORCC-CyVZn5M3.js +2254 -0
  36. package/lib/custom-app-text-editor.css +2 -0
  37. package/lib/custom-app-text-editor.js +81102 -0
  38. package/lib/cynefin-VYW2F7L2-CMgnLl46.js +3 -0
  39. package/lib/cynefinDiagram-TSTJHNR4-988Y73wV.js +355 -0
  40. package/lib/cytoscape.esm-DMXbtFI-.js +18145 -0
  41. package/lib/dagre-Dmarb1s8.js +1699 -0
  42. package/lib/dagre-VKFMJZFB-Bf-pz2Lx.js +328 -0
  43. package/lib/defaultLocale-A87O3snN.js +198 -0
  44. package/lib/diagram-FQU43EPY-BT8WeVzc.js +432 -0
  45. package/lib/diagram-G47NLZAW-vZ2XG37l.js +527 -0
  46. package/lib/diagram-NH7WQ7WH-CH0IfHB0.js +134 -0
  47. package/lib/diagram-OA4YK3LP-BgwQcJfp.js +300 -0
  48. package/lib/diagram-WEI45ONY-Cd3sVPil.js +214 -0
  49. package/lib/dist-PGS6ynRO.js +59 -0
  50. package/lib/ebnfDiagram-CCIWWBDH-CwBFb2Fm.js +100 -0
  51. package/lib/erDiagram-Q63AITRT-BshRACvj.js +1727 -0
  52. package/lib/eventmodeling-45OFAUF4-BDhzj03B.js +3 -0
  53. package/lib/flowDiagram-23GEKE2U-C3zDgFvZ.js +16 -0
  54. package/lib/ganttDiagram-NO4QXBWP-BD5PiE8x.js +3073 -0
  55. package/lib/gitGraph-TEB2WS4Q-DJA_hE4G.js +3 -0
  56. package/lib/gitGraphDiagram-IHSO6WYX-BAhccBh3.js +733 -0
  57. package/lib/graphlib-DglfpsVp.js +1267 -0
  58. package/lib/index.browser-Dv9K8IAp.js +26 -0
  59. package/lib/info-DKCQHKI2-BD_vOCz6.js +3 -0
  60. package/lib/infoDiagram-FWYZ7A6U-CGZnf03G.js +20 -0
  61. package/lib/init-sjaVZO3f.js +13 -0
  62. package/lib/ishikawaDiagram-FXEZZL3T-PFfVM0NO.js +719 -0
  63. package/lib/journeyDiagram-5HDEW3XC-CRGz7dcx.js +884 -0
  64. package/lib/kanban-definition-HUTT4EX6-BBH4Yn5e.js +974 -0
  65. package/lib/line-CJQicKfr.js +34 -0
  66. package/lib/linear-B9Cv96-J.js +288 -0
  67. package/lib/map-C7KALUOH.js +241 -0
  68. package/lib/mermaid-parser.core-BupC9XGF.js +638 -0
  69. package/lib/mermaid-renderer-Cp0xusfR.js +2425 -0
  70. package/lib/mindmap-definition-LN4V7U3C-CWL1sg0K.js +978 -0
  71. package/lib/ordinal-CNQzPcrr.js +65 -0
  72. package/lib/packet-7NZHBO7P-CgBlALV1.js +3 -0
  73. package/lib/path-DVvH25eQ.js +84 -0
  74. package/lib/pegDiagram-2B236MQR-BKv8dTtv.js +94 -0
  75. package/lib/pie-RZYD4A2V-CryPC-P_.js +3 -0
  76. package/lib/pieDiagram-ENE6RG2P-CXeFg_cL.js +203 -0
  77. package/lib/quadrantDiagram-ABIIQ3AL-v_u3aC8Y.js +2001 -0
  78. package/lib/radar-I7S5WNFK-DgzJDRy3.js +3 -0
  79. package/lib/railroad-3IZDKUUU-DFp3mbpB.js +3 -0
  80. package/lib/railroad-abnf-AHOZXSZD-BRjidKH0.js +3 -0
  81. package/lib/railroad-ebnf-EBAXGLYW-PgrDWact.js +3 -0
  82. package/lib/railroad-peg-LSFZ7HO6-CMKir81Y.js +3 -0
  83. package/lib/railroadDiagram-RFXS5EU6-mEC9tVS-.js +76 -0
  84. package/lib/requirementDiagram-TGXJPOKE-BAEzI7V4.js +2223 -0
  85. package/lib/rolldown-runtime-DArdT4gl.js +23 -0
  86. package/lib/rough.esm-B2w_aYoc.js +1361 -0
  87. package/lib/sankeyDiagram-HTMAVEWB-Dbu-sl2E.js +972 -0
  88. package/lib/sequenceDiagram-DBY2YBRQ-DCuWmWHX.js +4156 -0
  89. package/lib/sizeCapture-X5ZJPWSS-BEIM84He.js +46 -0
  90. package/lib/src-DQbL46sB.js +2139 -0
  91. package/lib/src-DuuHKEe6.js +704 -0
  92. package/lib/stateDiagram-2N3HPSRC-fs9QmDMR.js +220 -0
  93. package/lib/stateDiagram-v2-6OUMAXLB-wWxYbttN.js +30 -0
  94. package/lib/swimlanes-5IMT3BWC-QaXUd9db.js +5069 -0
  95. package/lib/swimlanesDiagram-G3AALYLV-BtGToCzH.js +30 -0
  96. package/lib/timeline-definition-FHXFAJF6-CAsyJrsw.js +1069 -0
  97. package/lib/treeView-QDETBFTQ-DVp4aTZQ.js +3 -0
  98. package/lib/treemap-6X3UGDF4-BbBnHMHJ.js +3 -0
  99. package/lib/types.d.ts +44 -0
  100. package/lib/v4-CZv9Hsqq.js +33 -0
  101. package/lib/vennDiagram-L72KCM5P-C87u0gjr.js +1880 -0
  102. package/lib/wardley-OPB4EBWU-B-RXhnoN.js +3 -0
  103. package/lib/wardleyDiagram-EHGQE667-BxviBDl_.js +645 -0
  104. package/lib/xychartDiagram-FW5EYKEG-BQQhanuH.js +2098 -0
  105. package/package.json +29 -0
@@ -0,0 +1,972 @@
1
+ import { n as e } from "./chunk-Y2CYZVJY-QdJ4V9rh.js";
2
+ import { p as t } from "./src-DQbL46sB.js";
3
+ import { H as n, J as r, K as i, U as a, a as o, d as s, s as c, v as l, w as u, x as d, y as f } from "./chunk-WYO6CB5R-MV-yOaop.js";
4
+ import { t as p } from "./ordinal-CNQzPcrr.js";
5
+ //#region ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/colors.js
6
+ function m(e) {
7
+ for (var t = e.length / 6 | 0, n = Array(t), r = 0; r < t;) n[r] = "#" + e.slice(r * 6, ++r * 6);
8
+ return n;
9
+ }
10
+ //#endregion
11
+ //#region ../../node_modules/.pnpm/d3-scale-chromatic@3.1.0/node_modules/d3-scale-chromatic/src/categorical/Tableau10.js
12
+ var h = m("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
13
+ //#endregion
14
+ //#region ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/max.js
15
+ function g(e, t) {
16
+ let n;
17
+ if (t === void 0) for (let t of e) t != null && (n < t || n === void 0 && t >= t) && (n = t);
18
+ else {
19
+ let r = -1;
20
+ for (let i of e) (i = t(i, ++r, e)) != null && (n < i || n === void 0 && i >= i) && (n = i);
21
+ }
22
+ return n;
23
+ }
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/min.js
26
+ function _(e, t) {
27
+ let n;
28
+ if (t === void 0) for (let t of e) t != null && (n > t || n === void 0 && t >= t) && (n = t);
29
+ else {
30
+ let r = -1;
31
+ for (let i of e) (i = t(i, ++r, e)) != null && (n > i || n === void 0 && i >= i) && (n = i);
32
+ }
33
+ return n;
34
+ }
35
+ //#endregion
36
+ //#region ../../node_modules/.pnpm/d3-array@2.12.1/node_modules/d3-array/src/sum.js
37
+ function v(e, t) {
38
+ let n = 0;
39
+ if (t === void 0) for (let t of e) (t = +t) && (n += t);
40
+ else {
41
+ let r = -1;
42
+ for (let i of e) (i = +t(i, ++r, e)) && (n += i);
43
+ }
44
+ return n;
45
+ }
46
+ //#endregion
47
+ //#region ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/align.js
48
+ function y(e) {
49
+ return e.target.depth;
50
+ }
51
+ function b(e) {
52
+ return e.depth;
53
+ }
54
+ function x(e, t) {
55
+ return t - 1 - e.height;
56
+ }
57
+ function S(e, t) {
58
+ return e.sourceLinks.length ? e.depth : t - 1;
59
+ }
60
+ function C(e) {
61
+ return e.targetLinks.length ? e.depth : e.sourceLinks.length ? _(e.sourceLinks, y) - 1 : 0;
62
+ }
63
+ //#endregion
64
+ //#region ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/constant.js
65
+ function w(e) {
66
+ return function() {
67
+ return e;
68
+ };
69
+ }
70
+ //#endregion
71
+ //#region ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/sankey.js
72
+ function T(e, t) {
73
+ return D(e.source, t.source) || e.index - t.index;
74
+ }
75
+ function E(e, t) {
76
+ return D(e.target, t.target) || e.index - t.index;
77
+ }
78
+ function D(e, t) {
79
+ return e.y0 - t.y0;
80
+ }
81
+ function O(e) {
82
+ return e.value;
83
+ }
84
+ function k(e) {
85
+ return e.index;
86
+ }
87
+ function A(e) {
88
+ return e.nodes;
89
+ }
90
+ function j(e) {
91
+ return e.links;
92
+ }
93
+ function M(e, t) {
94
+ let n = e.get(t);
95
+ if (!n) throw Error("missing: " + t);
96
+ return n;
97
+ }
98
+ function N({ nodes: e }) {
99
+ for (let t of e) {
100
+ let e = t.y0, n = e;
101
+ for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;
102
+ for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;
103
+ }
104
+ }
105
+ function P() {
106
+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = k, c = S, l, u, d = A, f = j, p = 6;
107
+ function m() {
108
+ let e = {
109
+ nodes: d.apply(null, arguments),
110
+ links: f.apply(null, arguments)
111
+ };
112
+ return h(e), y(e), b(e), x(e), F(e), N(e), e;
113
+ }
114
+ m.update = function(e) {
115
+ return N(e), e;
116
+ }, m.nodeId = function(e) {
117
+ return arguments.length ? (s = typeof e == "function" ? e : w(e), m) : s;
118
+ }, m.nodeAlign = function(e) {
119
+ return arguments.length ? (c = typeof e == "function" ? e : w(e), m) : c;
120
+ }, m.nodeSort = function(e) {
121
+ return arguments.length ? (l = e, m) : l;
122
+ }, m.nodeWidth = function(e) {
123
+ return arguments.length ? (i = +e, m) : i;
124
+ }, m.nodePadding = function(e) {
125
+ return arguments.length ? (a = o = +e, m) : a;
126
+ }, m.nodes = function(e) {
127
+ return arguments.length ? (d = typeof e == "function" ? e : w(e), m) : d;
128
+ }, m.links = function(e) {
129
+ return arguments.length ? (f = typeof e == "function" ? e : w(e), m) : f;
130
+ }, m.linkSort = function(e) {
131
+ return arguments.length ? (u = e, m) : u;
132
+ }, m.size = function(i) {
133
+ return arguments.length ? (e = t = 0, n = +i[0], r = +i[1], m) : [n - e, r - t];
134
+ }, m.extent = function(i) {
135
+ return arguments.length ? (e = +i[0][0], n = +i[1][0], t = +i[0][1], r = +i[1][1], m) : [[e, t], [n, r]];
136
+ }, m.iterations = function(e) {
137
+ return arguments.length ? (p = +e, m) : p;
138
+ };
139
+ function h({ nodes: e, links: t }) {
140
+ for (let [t, n] of e.entries()) n.index = t, n.sourceLinks = [], n.targetLinks = [];
141
+ let n = new Map(e.map((t, n) => [s(t, n, e), t]));
142
+ for (let [e, r] of t.entries()) {
143
+ r.index = e;
144
+ let { source: t, target: i } = r;
145
+ typeof t != "object" && (t = r.source = M(n, t)), typeof i != "object" && (i = r.target = M(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);
146
+ }
147
+ if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);
148
+ }
149
+ function y({ nodes: e }) {
150
+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(v(t.sourceLinks, O), v(t.targetLinks, O)) : t.fixedValue;
151
+ }
152
+ function b({ nodes: e }) {
153
+ let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
154
+ for (; n.size;) {
155
+ for (let e of n) {
156
+ e.depth = i;
157
+ for (let { target: t } of e.sourceLinks) r.add(t);
158
+ }
159
+ if (++i > t) throw Error("circular link");
160
+ n = r, r = /* @__PURE__ */ new Set();
161
+ }
162
+ }
163
+ function x({ nodes: e }) {
164
+ let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;
165
+ for (; n.size;) {
166
+ for (let e of n) {
167
+ e.height = i;
168
+ for (let { source: t } of e.targetLinks) r.add(t);
169
+ }
170
+ if (++i > t) throw Error("circular link");
171
+ n = r, r = /* @__PURE__ */ new Set();
172
+ }
173
+ }
174
+ function C({ nodes: t }) {
175
+ let r = g(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);
176
+ for (let n of t) {
177
+ let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));
178
+ n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];
179
+ }
180
+ if (l) for (let e of o) e.sort(l);
181
+ return o;
182
+ }
183
+ function P(e) {
184
+ let n = _(e, (e) => (r - t - (e.length - 1) * o) / v(e, O));
185
+ for (let i of e) {
186
+ let e = t;
187
+ for (let t of i) {
188
+ t.y0 = e, t.y1 = e + t.value * n, e = t.y1 + o;
189
+ for (let e of t.sourceLinks) e.width = e.value * n;
190
+ }
191
+ e = (r - e + o) / (i.length + 1);
192
+ for (let t = 0; t < i.length; ++t) {
193
+ let n = i[t];
194
+ n.y0 += e * (t + 1), n.y1 += e * (t + 1);
195
+ }
196
+ H(i);
197
+ }
198
+ }
199
+ function F(e) {
200
+ let n = C(e);
201
+ o = Math.min(a, (r - t) / (g(n, (e) => e.length) - 1)), P(n);
202
+ for (let e = 0; e < p; ++e) {
203
+ let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);
204
+ L(n, t, r), I(n, t, r);
205
+ }
206
+ }
207
+ function I(e, t, n) {
208
+ for (let r = 1, i = e.length; r < i; ++r) {
209
+ let i = e[r];
210
+ for (let e of i) {
211
+ let n = 0, r = 0;
212
+ for (let { source: t, value: i } of e.targetLinks) {
213
+ let a = i * (e.layer - t.layer);
214
+ n += U(t, e) * a, r += a;
215
+ }
216
+ if (!(r > 0)) continue;
217
+ let i = (n / r - e.y0) * t;
218
+ e.y0 += i, e.y1 += i, V(e);
219
+ }
220
+ l === void 0 && i.sort(D), R(i, n);
221
+ }
222
+ }
223
+ function L(e, t, n) {
224
+ for (let r = e.length - 2; r >= 0; --r) {
225
+ let i = e[r];
226
+ for (let e of i) {
227
+ let n = 0, r = 0;
228
+ for (let { target: t, value: i } of e.sourceLinks) {
229
+ let a = i * (t.layer - e.layer);
230
+ n += W(e, t) * a, r += a;
231
+ }
232
+ if (!(r > 0)) continue;
233
+ let i = (n / r - e.y0) * t;
234
+ e.y0 += i, e.y1 += i, V(e);
235
+ }
236
+ l === void 0 && i.sort(D), R(i, n);
237
+ }
238
+ }
239
+ function R(e, n) {
240
+ let i = e.length >> 1, a = e[i];
241
+ B(e, a.y0 - o, i - 1, n), z(e, a.y1 + o, i + 1, n), B(e, r, e.length - 1, n), z(e, t, 0, n);
242
+ }
243
+ function z(e, t, n, r) {
244
+ for (; n < e.length; ++n) {
245
+ let i = e[n], a = (t - i.y0) * r;
246
+ a > 1e-6 && (i.y0 += a, i.y1 += a), t = i.y1 + o;
247
+ }
248
+ }
249
+ function B(e, t, n, r) {
250
+ for (; n >= 0; --n) {
251
+ let i = e[n], a = (i.y1 - t) * r;
252
+ a > 1e-6 && (i.y0 -= a, i.y1 -= a), t = i.y0 - o;
253
+ }
254
+ }
255
+ function V({ sourceLinks: e, targetLinks: t }) {
256
+ if (u === void 0) {
257
+ for (let { source: { sourceLinks: e } } of t) e.sort(E);
258
+ for (let { target: { targetLinks: t } } of e) t.sort(T);
259
+ }
260
+ }
261
+ function H(e) {
262
+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(E), n.sort(T);
263
+ }
264
+ function U(e, t) {
265
+ let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;
266
+ for (let { target: r, width: i } of e.sourceLinks) {
267
+ if (r === t) break;
268
+ n += i + o;
269
+ }
270
+ for (let { source: r, width: i } of t.targetLinks) {
271
+ if (r === e) break;
272
+ n -= i;
273
+ }
274
+ return n;
275
+ }
276
+ function W(e, t) {
277
+ let n = t.y0 - (t.targetLinks.length - 1) * o / 2;
278
+ for (let { source: r, width: i } of t.targetLinks) {
279
+ if (r === e) break;
280
+ n += i + o;
281
+ }
282
+ for (let { target: r, width: i } of e.sourceLinks) {
283
+ if (r === t) break;
284
+ n -= i;
285
+ }
286
+ return n;
287
+ }
288
+ return m;
289
+ }
290
+ //#endregion
291
+ //#region ../../node_modules/.pnpm/d3-path@1.0.9/node_modules/d3-path/src/path.js
292
+ var F = Math.PI, I = 2 * F, L = 1e-6, R = I - L;
293
+ function z() {
294
+ this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
295
+ }
296
+ function B() {
297
+ return new z();
298
+ }
299
+ z.prototype = B.prototype = {
300
+ constructor: z,
301
+ moveTo: function(e, t) {
302
+ this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t);
303
+ },
304
+ closePath: function() {
305
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
306
+ },
307
+ lineTo: function(e, t) {
308
+ this._ += "L" + (this._x1 = +e) + "," + (this._y1 = +t);
309
+ },
310
+ quadraticCurveTo: function(e, t, n, r) {
311
+ this._ += "Q" + +e + "," + +t + "," + (this._x1 = +n) + "," + (this._y1 = +r);
312
+ },
313
+ bezierCurveTo: function(e, t, n, r, i, a) {
314
+ this._ += "C" + +e + "," + +t + "," + +n + "," + +r + "," + (this._x1 = +i) + "," + (this._y1 = +a);
315
+ },
316
+ arcTo: function(e, t, n, r, i) {
317
+ e = +e, t = +t, n = +n, r = +r, i = +i;
318
+ var a = this._x1, o = this._y1, s = n - e, c = r - t, l = a - e, u = o - t, d = l * l + u * u;
319
+ if (i < 0) throw Error("negative radius: " + i);
320
+ if (this._x1 === null) this._ += "M" + (this._x1 = e) + "," + (this._y1 = t);
321
+ else if (d > L) {
322
+ if (!(Math.abs(u * s - c * l) > L) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);
323
+ else {
324
+ var f = n - a, p = r - o, m = s * s + c * c, h = f * f + p * p, g = Math.sqrt(m), _ = Math.sqrt(d), v = i * Math.tan((F - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;
325
+ Math.abs(y - 1) > L && (this._ += "L" + (e + y * l) + "," + (t + y * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = e + b * s) + "," + (this._y1 = t + b * c);
326
+ }
327
+ }
328
+ },
329
+ arc: function(e, t, n, r, i, a) {
330
+ e = +e, t = +t, n = +n, a = !!a;
331
+ var o = n * Math.cos(r), s = n * Math.sin(r), c = e + o, l = t + s, u = 1 ^ a, d = a ? r - i : i - r;
332
+ if (n < 0) throw Error("negative radius: " + n);
333
+ this._x1 === null ? this._ += "M" + c + "," + l : (Math.abs(this._x1 - c) > L || Math.abs(this._y1 - l) > L) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % I + I), d > R ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > L && (this._ += "A" + n + "," + n + ",0," + +(d >= F) + "," + u + "," + (this._x1 = e + n * Math.cos(i)) + "," + (this._y1 = t + n * Math.sin(i))));
334
+ },
335
+ rect: function(e, t, n, r) {
336
+ this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t) + "h" + +n + "v" + +r + "h" + -n + "Z";
337
+ },
338
+ toString: function() {
339
+ return this._;
340
+ }
341
+ };
342
+ //#endregion
343
+ //#region ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/constant.js
344
+ function V(e) {
345
+ return function() {
346
+ return e;
347
+ };
348
+ }
349
+ //#endregion
350
+ //#region ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/point.js
351
+ function H(e) {
352
+ return e[0];
353
+ }
354
+ function U(e) {
355
+ return e[1];
356
+ }
357
+ //#endregion
358
+ //#region ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/array.js
359
+ var W = Array.prototype.slice;
360
+ //#endregion
361
+ //#region ../../node_modules/.pnpm/d3-shape@1.3.7/node_modules/d3-shape/src/link/index.js
362
+ function G(e) {
363
+ return e.source;
364
+ }
365
+ function ee(e) {
366
+ return e.target;
367
+ }
368
+ function te(e) {
369
+ var t = G, n = ee, r = H, i = U, a = null;
370
+ function o() {
371
+ var o, s = W.call(arguments), c = t.apply(this, s), l = n.apply(this, s);
372
+ if (a ||= o = B(), e(a, +r.apply(this, (s[0] = c, s)), +i.apply(this, s), +r.apply(this, (s[0] = l, s)), +i.apply(this, s)), o) return a = null, o + "" || null;
373
+ }
374
+ return o.source = function(e) {
375
+ return arguments.length ? (t = e, o) : t;
376
+ }, o.target = function(e) {
377
+ return arguments.length ? (n = e, o) : n;
378
+ }, o.x = function(e) {
379
+ return arguments.length ? (r = typeof e == "function" ? e : V(+e), o) : r;
380
+ }, o.y = function(e) {
381
+ return arguments.length ? (i = typeof e == "function" ? e : V(+e), o) : i;
382
+ }, o.context = function(e) {
383
+ return arguments.length ? (a = e ?? null, o) : a;
384
+ }, o;
385
+ }
386
+ function ne(e, t, n, r, i) {
387
+ e.moveTo(t, n), e.bezierCurveTo(t = (t + r) / 2, n, t, i, r, i);
388
+ }
389
+ function re() {
390
+ return te(ne);
391
+ }
392
+ //#endregion
393
+ //#region ../../node_modules/.pnpm/d3-sankey@0.12.3/node_modules/d3-sankey/src/sankeyLinkHorizontal.js
394
+ function ie(e) {
395
+ return [e.source.x1, e.y0];
396
+ }
397
+ function ae(e) {
398
+ return [e.target.x0, e.y1];
399
+ }
400
+ function K() {
401
+ return re().source(ie).target(ae);
402
+ }
403
+ //#endregion
404
+ //#region ../../node_modules/.pnpm/mermaid@11.16.0/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-HTMAVEWB.mjs
405
+ var q = (function() {
406
+ var t = /* @__PURE__ */ e(function(e, t, n, r) {
407
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
408
+ return n;
409
+ }, "o"), n = [1, 9], r = [1, 10], i = [
410
+ 1,
411
+ 5,
412
+ 10,
413
+ 12
414
+ ], a = {
415
+ trace: /* @__PURE__ */ e(function() {}, "trace"),
416
+ yy: {},
417
+ symbols_: {
418
+ error: 2,
419
+ start: 3,
420
+ SANKEY: 4,
421
+ NEWLINE: 5,
422
+ csv: 6,
423
+ opt_eof: 7,
424
+ record: 8,
425
+ csv_tail: 9,
426
+ EOF: 10,
427
+ "field[source]": 11,
428
+ COMMA: 12,
429
+ "field[target]": 13,
430
+ "field[value]": 14,
431
+ field: 15,
432
+ escaped: 16,
433
+ non_escaped: 17,
434
+ DQUOTE: 18,
435
+ ESCAPED_TEXT: 19,
436
+ NON_ESCAPED_TEXT: 20,
437
+ $accept: 0,
438
+ $end: 1
439
+ },
440
+ terminals_: {
441
+ 2: "error",
442
+ 4: "SANKEY",
443
+ 5: "NEWLINE",
444
+ 10: "EOF",
445
+ 11: "field[source]",
446
+ 12: "COMMA",
447
+ 13: "field[target]",
448
+ 14: "field[value]",
449
+ 18: "DQUOTE",
450
+ 19: "ESCAPED_TEXT",
451
+ 20: "NON_ESCAPED_TEXT"
452
+ },
453
+ productions_: [
454
+ 0,
455
+ [3, 4],
456
+ [6, 2],
457
+ [9, 2],
458
+ [9, 0],
459
+ [7, 1],
460
+ [7, 0],
461
+ [8, 5],
462
+ [15, 1],
463
+ [15, 1],
464
+ [16, 3],
465
+ [17, 1]
466
+ ],
467
+ performAction: /* @__PURE__ */ e(function(e, t, n, r, i, a, o) {
468
+ var s = a.length - 1;
469
+ switch (i) {
470
+ case 7:
471
+ let e = r.findOrCreateNode(a[s - 4].trim().replaceAll("\"\"", "\"")), t = r.findOrCreateNode(a[s - 2].trim().replaceAll("\"\"", "\"")), n = parseFloat(a[s].trim());
472
+ r.addLink(e, t, n);
473
+ break;
474
+ case 8:
475
+ case 9:
476
+ case 11:
477
+ this.$ = a[s];
478
+ break;
479
+ case 10: this.$ = a[s - 1];
480
+ }
481
+ }, "anonymous"),
482
+ table: [
483
+ {
484
+ 3: 1,
485
+ 4: [1, 2]
486
+ },
487
+ { 1: [3] },
488
+ { 5: [1, 3] },
489
+ {
490
+ 6: 4,
491
+ 8: 5,
492
+ 15: 6,
493
+ 16: 7,
494
+ 17: 8,
495
+ 18: n,
496
+ 20: r
497
+ },
498
+ {
499
+ 1: [2, 6],
500
+ 7: 11,
501
+ 10: [1, 12]
502
+ },
503
+ t(r, [2, 4], {
504
+ 9: 13,
505
+ 5: [1, 14]
506
+ }),
507
+ { 12: [1, 15] },
508
+ t(i, [2, 8]),
509
+ t(i, [2, 9]),
510
+ { 19: [1, 16] },
511
+ t(i, [2, 11]),
512
+ { 1: [2, 1] },
513
+ { 1: [2, 5] },
514
+ t(r, [2, 2]),
515
+ {
516
+ 6: 17,
517
+ 8: 5,
518
+ 15: 6,
519
+ 16: 7,
520
+ 17: 8,
521
+ 18: n,
522
+ 20: r
523
+ },
524
+ {
525
+ 15: 18,
526
+ 16: 7,
527
+ 17: 8,
528
+ 18: n,
529
+ 20: r
530
+ },
531
+ { 18: [1, 19] },
532
+ t(r, [2, 3]),
533
+ { 12: [1, 20] },
534
+ t(i, [2, 10]),
535
+ {
536
+ 15: 21,
537
+ 16: 7,
538
+ 17: 8,
539
+ 18: n,
540
+ 20: r
541
+ },
542
+ t([
543
+ 1,
544
+ 5,
545
+ 10
546
+ ], [2, 7])
547
+ ],
548
+ defaultActions: {
549
+ 11: [2, 1],
550
+ 12: [2, 5]
551
+ },
552
+ parseError: /* @__PURE__ */ e(function(e, t) {
553
+ if (t.recoverable) this.trace(e);
554
+ else {
555
+ var n = Error(e);
556
+ throw n.hash = t, n;
557
+ }
558
+ }, "parseError"),
559
+ parse: /* @__PURE__ */ e(function(t) {
560
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
561
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
562
+ h.setInput(t, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
563
+ var v = h.yylloc;
564
+ o.push(v);
565
+ var y = h.options && h.options.ranges;
566
+ this.parseError = typeof g.yy.parseError == "function" ? g.yy.parseError : Object.getPrototypeOf(this).parseError;
567
+ function b(e) {
568
+ r.length -= 2 * e, a.length -= e, o.length -= e;
569
+ }
570
+ e(b, "popStack");
571
+ function x() {
572
+ var e = i.pop() || h.lex() || p;
573
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
574
+ }
575
+ e(x, "lex");
576
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
577
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
578
+ var M = "";
579
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
580
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
581
+ text: h.match,
582
+ token: this.terminals_[S] || S,
583
+ line: h.yylineno,
584
+ loc: v,
585
+ expected: j
586
+ });
587
+ }
588
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
589
+ switch (T[0]) {
590
+ case 1:
591
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
592
+ break;
593
+ case 2:
594
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
595
+ first_line: o[o.length - (k || 1)].first_line,
596
+ last_line: o[o.length - 1].last_line,
597
+ first_column: o[o.length - (k || 1)].first_column,
598
+ last_column: o[o.length - 1].last_column
599
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
600
+ c,
601
+ u,
602
+ l,
603
+ g.yy,
604
+ T[1],
605
+ a,
606
+ o
607
+ ].concat(m)), E !== void 0) return E;
608
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
609
+ break;
610
+ case 3: return !0;
611
+ }
612
+ }
613
+ return !0;
614
+ }, "parse")
615
+ };
616
+ a.lexer = /* @__PURE__ */ (function() {
617
+ return {
618
+ EOF: 1,
619
+ parseError: /* @__PURE__ */ e(function(e, t) {
620
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
621
+ else throw Error(e);
622
+ }, "parseError"),
623
+ setInput: /* @__PURE__ */ e(function(e, t) {
624
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
625
+ first_line: 1,
626
+ first_column: 0,
627
+ last_line: 1,
628
+ last_column: 0
629
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
630
+ }, "setInput"),
631
+ input: /* @__PURE__ */ e(function() {
632
+ var e = this._input[0];
633
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
634
+ }, "input"),
635
+ unput: /* @__PURE__ */ e(function(e) {
636
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
637
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
638
+ var r = this.match.split(/(?:\r\n?|\n)/g);
639
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
640
+ var i = this.yylloc.range;
641
+ return this.yylloc = {
642
+ first_line: this.yylloc.first_line,
643
+ last_line: this.yylineno + 1,
644
+ first_column: this.yylloc.first_column,
645
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
646
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
647
+ }, "unput"),
648
+ more: /* @__PURE__ */ e(function() {
649
+ return this._more = !0, this;
650
+ }, "more"),
651
+ reject: /* @__PURE__ */ e(function() {
652
+ if (this.options.backtrack_lexer) this._backtrack = !0;
653
+ else 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).\n" + this.showPosition(), {
654
+ text: "",
655
+ token: null,
656
+ line: this.yylineno
657
+ });
658
+ return this;
659
+ }, "reject"),
660
+ less: /* @__PURE__ */ e(function(e) {
661
+ this.unput(this.match.slice(e));
662
+ }, "less"),
663
+ pastInput: /* @__PURE__ */ e(function() {
664
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
665
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
666
+ }, "pastInput"),
667
+ upcomingInput: /* @__PURE__ */ e(function() {
668
+ var e = this.match;
669
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
670
+ }, "upcomingInput"),
671
+ showPosition: /* @__PURE__ */ e(function() {
672
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
673
+ return e + this.upcomingInput() + "\n" + t + "^";
674
+ }, "showPosition"),
675
+ test_match: /* @__PURE__ */ e(function(e, t) {
676
+ var n, r, i;
677
+ if (this.options.backtrack_lexer && (i = {
678
+ yylineno: this.yylineno,
679
+ yylloc: {
680
+ first_line: this.yylloc.first_line,
681
+ last_line: this.last_line,
682
+ first_column: this.yylloc.first_column,
683
+ last_column: this.yylloc.last_column
684
+ },
685
+ yytext: this.yytext,
686
+ match: this.match,
687
+ matches: this.matches,
688
+ matched: this.matched,
689
+ yyleng: this.yyleng,
690
+ offset: this.offset,
691
+ _more: this._more,
692
+ _input: this._input,
693
+ yy: this.yy,
694
+ conditionStack: this.conditionStack.slice(0),
695
+ done: this.done
696
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
697
+ first_line: this.yylloc.last_line,
698
+ last_line: this.yylineno + 1,
699
+ first_column: this.yylloc.last_column,
700
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
701
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
702
+ if (this._backtrack) {
703
+ for (var a in i) this[a] = i[a];
704
+ return !1;
705
+ }
706
+ return !1;
707
+ }, "test_match"),
708
+ next: /* @__PURE__ */ e(function() {
709
+ if (this.done) return this.EOF;
710
+ this._input || (this.done = !0);
711
+ var e, t, n, r;
712
+ this._more || (this.yytext = "", this.match = "");
713
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
714
+ if (t = n, r = a, this.options.backtrack_lexer) {
715
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
716
+ if (this._backtrack) {
717
+ t = !1;
718
+ continue;
719
+ }
720
+ return !1;
721
+ }
722
+ if (!this.options.flex) break;
723
+ }
724
+ return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
725
+ text: "",
726
+ token: null,
727
+ line: this.yylineno
728
+ });
729
+ }, "next"),
730
+ lex: /* @__PURE__ */ e(function() {
731
+ return this.next() || this.lex();
732
+ }, "lex"),
733
+ begin: /* @__PURE__ */ e(function(e) {
734
+ this.conditionStack.push(e);
735
+ }, "begin"),
736
+ popState: /* @__PURE__ */ e(function() {
737
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
738
+ }, "popState"),
739
+ _currentRules: /* @__PURE__ */ e(function() {
740
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
741
+ }, "_currentRules"),
742
+ topState: /* @__PURE__ */ e(function(e) {
743
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
744
+ }, "topState"),
745
+ pushState: /* @__PURE__ */ e(function(e) {
746
+ this.begin(e);
747
+ }, "pushState"),
748
+ stateStackSize: /* @__PURE__ */ e(function() {
749
+ return this.conditionStack.length;
750
+ }, "stateStackSize"),
751
+ options: { "case-insensitive": !0 },
752
+ performAction: /* @__PURE__ */ e(function(e, t, n, r) {
753
+ switch (n) {
754
+ case 0: return this.pushState("csv"), 4;
755
+ case 1: return this.pushState("csv"), 4;
756
+ case 2: return 10;
757
+ case 3: return 5;
758
+ case 4: return 12;
759
+ case 5: return this.pushState("escaped_text"), 18;
760
+ case 6: return 20;
761
+ case 7: return this.popState("escaped_text"), 18;
762
+ case 8: return 19;
763
+ }
764
+ }, "anonymous"),
765
+ rules: [
766
+ /^(?:sankey-beta\b)/i,
767
+ /^(?:sankey\b)/i,
768
+ /^(?:$)/i,
769
+ /^(?:((\u000D\u000A)|(\u000A)))/i,
770
+ /^(?:(\u002C))/i,
771
+ /^(?:(\u0022))/i,
772
+ /^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,
773
+ /^(?:(\u0022)(?!(\u0022)))/i,
774
+ /^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i
775
+ ],
776
+ conditions: {
777
+ csv: {
778
+ rules: [
779
+ 2,
780
+ 3,
781
+ 4,
782
+ 5,
783
+ 6,
784
+ 7,
785
+ 8
786
+ ],
787
+ inclusive: !1
788
+ },
789
+ escaped_text: {
790
+ rules: [7, 8],
791
+ inclusive: !1
792
+ },
793
+ INITIAL: {
794
+ rules: [
795
+ 0,
796
+ 1,
797
+ 2,
798
+ 3,
799
+ 4,
800
+ 5,
801
+ 6,
802
+ 7,
803
+ 8
804
+ ],
805
+ inclusive: !0
806
+ }
807
+ }
808
+ };
809
+ })();
810
+ function o() {
811
+ this.yy = {};
812
+ }
813
+ return e(o, "Parser"), o.prototype = a, a.Parser = o, new o();
814
+ })();
815
+ q.parser = q;
816
+ var J = q, Y = [], X = [], Z = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ e(() => {
817
+ Y = [], X = [], Z = /* @__PURE__ */ new Map(), o();
818
+ }, "clear"), se = class {
819
+ constructor(e, t, n = 0) {
820
+ this.source = e, this.target = t, this.value = n;
821
+ }
822
+ static {
823
+ e(this, "SankeyLink");
824
+ }
825
+ }, ce = /* @__PURE__ */ e((e, t, n) => {
826
+ Y.push(new se(e, t, n));
827
+ }, "addLink"), le = class {
828
+ constructor(e) {
829
+ this.ID = e;
830
+ }
831
+ static {
832
+ e(this, "SankeyNode");
833
+ }
834
+ }, ue = {
835
+ nodesMap: Z,
836
+ getConfig: /* @__PURE__ */ e(() => d().sankey, "getConfig"),
837
+ getNodes: /* @__PURE__ */ e(() => X, "getNodes"),
838
+ getLinks: /* @__PURE__ */ e(() => Y, "getLinks"),
839
+ getGraph: /* @__PURE__ */ e(() => ({
840
+ nodes: X.map((e) => ({ id: e.ID })),
841
+ links: Y.map((e) => ({
842
+ source: e.source.ID,
843
+ target: e.target.ID,
844
+ value: e.value
845
+ }))
846
+ }), "getGraph"),
847
+ addLink: ce,
848
+ findOrCreateNode: /* @__PURE__ */ e((e) => {
849
+ e = c.sanitizeText(e, d());
850
+ let t = Z.get(e);
851
+ return t === void 0 && (t = new le(e), Z.set(e, t), X.push(t)), t;
852
+ }, "findOrCreateNode"),
853
+ getAccTitle: f,
854
+ setAccTitle: a,
855
+ getAccDescription: l,
856
+ setAccDescription: n,
857
+ getDiagramTitle: u,
858
+ setDiagramTitle: i,
859
+ clear: oe
860
+ }, Q = class t {
861
+ static {
862
+ e(this, "Uid");
863
+ }
864
+ static {
865
+ this.count = 0;
866
+ }
867
+ static next(e) {
868
+ return new t(e + ++t.count);
869
+ }
870
+ constructor(e) {
871
+ this.id = e, this.href = `#${e}`;
872
+ }
873
+ toString() {
874
+ return "url(" + this.href + ")";
875
+ }
876
+ }, $ = {
877
+ left: b,
878
+ right: x,
879
+ center: C,
880
+ justify: S
881
+ }, de = /* @__PURE__ */ e((e) => {
882
+ let t = 0, n = 0;
883
+ for (let r of e) {
884
+ let e = r.value ?? 0;
885
+ e > t && (t = e, n = r.layer ?? 0);
886
+ }
887
+ return n;
888
+ }, "findCentralNodeLayer"), fe = { draw: /* @__PURE__ */ e(function(n, i, a, o) {
889
+ let { securityLevel: c, sankey: l } = d(), u = s.sankey, f;
890
+ c === "sandbox" && (f = t("#i" + i));
891
+ let m = t(c === "sandbox" ? f.nodes()[0].contentDocument.body : "body"), g = c === "sandbox" ? m.select(`[id="${i}"]`) : t(`[id="${i}"]`), _ = l?.width ?? u.width, v = l?.height ?? u.width, y = l?.useMaxWidth ?? u.useMaxWidth, b = l?.nodeAlignment ?? u.nodeAlignment, x = l?.prefix ?? u.prefix, S = l?.suffix ?? u.suffix, C = l?.showValues ?? u.showValues, w = l?.nodeWidth ?? u.nodeWidth ?? 10, T = l?.nodePadding ?? u.nodePadding ?? 12, E = l?.labelStyle ?? u.labelStyle ?? "legacy", D = l?.nodeColors ?? {}, O = o.db.getGraph(), k = $[b];
892
+ P().nodeId((e) => e.id).nodeWidth(w).nodePadding(T + (C ? 15 : 0)).nodeAlign(k).extent([[0, 0], [_, v]])(O);
893
+ let A = de(O.nodes), j = p(h), M = /* @__PURE__ */ e((e) => D[e] ?? j(e), "getNodeColor");
894
+ g.append("g").attr("class", "nodes").selectAll(".node").data(O.nodes).join("g").attr("class", "node").attr("id", (e) => (e.uid = Q.next("node-")).id).attr("transform", function(e) {
895
+ return "translate(" + e.x0 + "," + e.y0 + ")";
896
+ }).attr("x", (e) => e.x0).attr("y", (e) => e.y0).append("rect").attr("height", (e) => e.y1 - e.y0).attr("width", (e) => e.x1 - e.x0).attr("fill", (e) => M(e.id));
897
+ let N = /* @__PURE__ */ e(({ id: e, value: t }) => C ? `${e}
898
+ ${x}${Math.round(t * 100) / 100}${S}` : e, "getText"), F = /* @__PURE__ */ e((e) => E === "outlined" ? (e.layer ?? 0) < A ? {
899
+ x: e.x0 - 6,
900
+ anchor: "end"
901
+ } : {
902
+ x: e.x1 + 6,
903
+ anchor: "start"
904
+ } : e.x0 < _ / 2 ? {
905
+ x: e.x1 + 6,
906
+ anchor: "start"
907
+ } : {
908
+ x: e.x0 - 6,
909
+ anchor: "end"
910
+ }, "getLabelPosition"), I = g.append("g").attr("class", "node-labels").attr("font-size", 14), L = /* @__PURE__ */ e((e) => I.selectAll(e ? `.${e}` : "text").data(O.nodes).join("text").attr("class", e ?? null).attr("x", (e) => F(e).x).attr("y", (e) => (e.y1 + e.y0) / 2).attr("dy", `${C ? "0" : "0.35"}em`).attr("text-anchor", (e) => F(e).anchor).text(N), "appendLabel");
911
+ E === "outlined" ? (L("sankey-label-bg"), L("sankey-label-fg")) : L();
912
+ let R = g.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", .5).selectAll(".link").data(O.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), z = l?.linkColor ?? "gradient";
913
+ if (z === "gradient") {
914
+ let e = R.append("linearGradient").attr("id", (e) => (e.uid = Q.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (e) => e.source.x1).attr("x2", (e) => e.target.x0);
915
+ e.append("stop").attr("offset", "0%").attr("stop-color", (e) => M(e.source.id)), e.append("stop").attr("offset", "100%").attr("stop-color", (e) => M(e.target.id));
916
+ }
917
+ let B;
918
+ switch (z) {
919
+ case "gradient":
920
+ B = /* @__PURE__ */ e((e) => e.uid, "coloring");
921
+ break;
922
+ case "source":
923
+ B = /* @__PURE__ */ e((e) => M(e.source.id), "coloring");
924
+ break;
925
+ case "target":
926
+ B = /* @__PURE__ */ e((e) => M(e.target.id), "coloring");
927
+ break;
928
+ default: B = z;
929
+ }
930
+ R.append("path").attr("d", K()).attr("stroke", B).attr("stroke-width", (e) => Math.max(1, e.width)), r(void 0, g, 0, y);
931
+ }, "draw") }, pe = /* @__PURE__ */ e((e) => e.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, "\n").trim(), "prepareTextForParsing"), me = /* @__PURE__ */ e((e) => `.label {
932
+ font-family: ${e.fontFamily};
933
+ }
934
+
935
+ .node-labels {
936
+ font-family: ${e.fontFamily};
937
+ }
938
+
939
+ /* Outlined label style - background stroke for better readability */
940
+ .sankey-label-bg {
941
+ stroke: ${e.mainBkg || e.background || "#fff"};
942
+ stroke-width: 4px;
943
+ stroke-linejoin: round;
944
+ paint-order: stroke;
945
+ }
946
+
947
+ /* Foreground label text */
948
+ .sankey-label-fg {
949
+ fill: ${e.textColor};
950
+ }
951
+
952
+ /* Node styling */
953
+ .node rect {
954
+ shape-rendering: crispEdges;
955
+ }
956
+
957
+ /* Link styling */
958
+ .link {
959
+ fill: none;
960
+ stroke-opacity: 0.5;
961
+ mix-blend-mode: multiply;
962
+ }
963
+ `, "getStyles"), he = J.parse.bind(J);
964
+ J.parse = (e) => he(pe(e));
965
+ var ge = {
966
+ styles: me,
967
+ parser: J,
968
+ db: ue,
969
+ renderer: fe
970
+ };
971
+ //#endregion
972
+ export { ge as diagram };