@ucap-llm/ai-ui 1.1.6 → 1.1.7

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 (55) hide show
  1. package/_basePickBy-7d00d05e.mjs +153 -0
  2. package/_baseUniq-1876be04.mjs +440 -0
  3. package/ai-ui.es.js +11 -78207
  4. package/ai-ui.umd.js +2701 -143
  5. package/arc-bb1e7b28.mjs +85 -0
  6. package/architecture-4AB2E3PP-26f07d27.mjs +10 -0
  7. package/architectureDiagram-IEHRJDOE-535e4958.mjs +4640 -0
  8. package/blockDiagram-JOT3LUYC-e5536854.mjs +2251 -0
  9. package/c4Diagram-VJAJSXHY-311741c3.mjs +1583 -0
  10. package/channel-5d097975.mjs +5 -0
  11. package/chunk-4BMEZGHF-55420838.mjs +9 -0
  12. package/chunk-A2AXSNBT-5f9de039.mjs +1373 -0
  13. package/chunk-AEK57VVT-bd6e836f.mjs +1416 -0
  14. package/chunk-D6G4REZN-69cf348a.mjs +64 -0
  15. package/chunk-RZ5BOZE2-ebe3985e.mjs +24 -0
  16. package/chunk-XZIHB7SX-ed9a9d65.mjs +15 -0
  17. package/classDiagram-GIVACNV2-4d61f06d.mjs +18 -0
  18. package/classDiagram-v2-COTLJTTW-4d61f06d.mjs +18 -0
  19. package/clone-44064c55.mjs +8 -0
  20. package/cytoscape.esm-bb479f88.mjs +18232 -0
  21. package/dagre-OKDRZEBW-0574359b.mjs +448 -0
  22. package/diagram-SSKATNLV-f4dd04b2.mjs +225 -0
  23. package/diagram-VNBRO52H-f77f925a.mjs +130 -0
  24. package/erDiagram-Q7BY3M3F-8213684f.mjs +843 -0
  25. package/flowDiagram-4HSFHLVR-1decdff6.mjs +1624 -0
  26. package/ganttDiagram-APWFNJXF-461381a5.mjs +2521 -0
  27. package/gitGraph-O2Q2CXLX-d961db16.mjs +10 -0
  28. package/gitGraphDiagram-7IBYFJ6S-be6c39c3.mjs +716 -0
  29. package/graph-7ba79f74.mjs +249 -0
  30. package/index-f5aac161.mjs +93487 -0
  31. package/info-4N47QTOZ-615527c9.mjs +10 -0
  32. package/infoDiagram-PH2N3AL5-064df479.mjs +26 -0
  33. package/init-f9637058.mjs +16 -0
  34. package/journeyDiagram-U35MCT3I-94c54b39.mjs +811 -0
  35. package/kanban-definition-NDS4AKOZ-58a05db1.mjs +720 -0
  36. package/katex-2e45926a.mjs +11700 -0
  37. package/layout-c953b0e7.mjs +1344 -0
  38. package/linear-3c81794f.mjs +447 -0
  39. package/mermaid-parser.core-7afd2b2f.mjs +12845 -0
  40. package/mindmap-definition-ALO5MXBD-60e68e28.mjs +3222 -0
  41. package/ordinal-980380c7.mjs +65 -0
  42. package/package.json +1 -1
  43. package/packet-KVYON367-4b5a305e.mjs +10 -0
  44. package/pie-R6RNRRYF-0f27d16d.mjs +10 -0
  45. package/pieDiagram-IB7DONF6-66cebf11.mjs +167 -0
  46. package/quadrantDiagram-7GDLP6J5-f2cbfc79.mjs +1027 -0
  47. package/radar-MK3ICKWK-9e1913d7.mjs +10 -0
  48. package/requirementDiagram-KVF5MWMF-36d316c2.mjs +853 -0
  49. package/sankeyDiagram-QLVOVGJD-76245efb.mjs +826 -0
  50. package/sequenceDiagram-X6HHIX6F-a0ec0021.mjs +2283 -0
  51. package/stateDiagram-DGXRK772-e6387816.mjs +274 -0
  52. package/stateDiagram-v2-YXO3MK2T-f011ada4.mjs +18 -0
  53. package/style.css +1 -1
  54. package/timeline-definition-BDJGKUSR-a62514a7.mjs +806 -0
  55. package/xychartDiagram-VJFVF3MP-1b807048.mjs +1306 -0
@@ -0,0 +1,826 @@
1
+ import { _ as p, d as lt, g as _t, s as xt, b as vt, c as bt, o as wt, n as St, t as Lt, e as Et, v as At, j as X, V as Tt } from "./index-f5aac161.mjs";
2
+ import { o as Mt } from "./ordinal-980380c7.mjs";
3
+ import "vue";
4
+ import "./init-f9637058.mjs";
5
+ function Nt(t) {
6
+ for (var e = t.length / 6 | 0, i = new Array(e), a = 0; a < e; )
7
+ i[a] = "#" + t.slice(a * 6, ++a * 6);
8
+ return i;
9
+ }
10
+ const It = Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");
11
+ function ct(t, e) {
12
+ let i;
13
+ if (e === void 0)
14
+ for (const a of t)
15
+ a != null && (i < a || i === void 0 && a >= a) && (i = a);
16
+ else {
17
+ let a = -1;
18
+ for (let h of t)
19
+ (h = e(h, ++a, t)) != null && (i < h || i === void 0 && h >= h) && (i = h);
20
+ }
21
+ return i;
22
+ }
23
+ function pt(t, e) {
24
+ let i;
25
+ if (e === void 0)
26
+ for (const a of t)
27
+ a != null && (i > a || i === void 0 && a >= a) && (i = a);
28
+ else {
29
+ let a = -1;
30
+ for (let h of t)
31
+ (h = e(h, ++a, t)) != null && (i > h || i === void 0 && h >= h) && (i = h);
32
+ }
33
+ return i;
34
+ }
35
+ function nt(t, e) {
36
+ let i = 0;
37
+ if (e === void 0)
38
+ for (let a of t)
39
+ (a = +a) && (i += a);
40
+ else {
41
+ let a = -1;
42
+ for (let h of t)
43
+ (h = +e(h, ++a, t)) && (i += h);
44
+ }
45
+ return i;
46
+ }
47
+ function Pt(t) {
48
+ return t.target.depth;
49
+ }
50
+ function Ct(t) {
51
+ return t.depth;
52
+ }
53
+ function Ot(t, e) {
54
+ return e - 1 - t.height;
55
+ }
56
+ function mt(t, e) {
57
+ return t.sourceLinks.length ? t.depth : e - 1;
58
+ }
59
+ function Dt(t) {
60
+ return t.targetLinks.length ? t.depth : t.sourceLinks.length ? pt(t.sourceLinks, Pt) - 1 : 0;
61
+ }
62
+ function q(t) {
63
+ return function() {
64
+ return t;
65
+ };
66
+ }
67
+ function ut(t, e) {
68
+ return Q(t.source, e.source) || t.index - e.index;
69
+ }
70
+ function ht(t, e) {
71
+ return Q(t.target, e.target) || t.index - e.index;
72
+ }
73
+ function Q(t, e) {
74
+ return t.y0 - e.y0;
75
+ }
76
+ function it(t) {
77
+ return t.value;
78
+ }
79
+ function $t(t) {
80
+ return t.index;
81
+ }
82
+ function jt(t) {
83
+ return t.nodes;
84
+ }
85
+ function zt(t) {
86
+ return t.links;
87
+ }
88
+ function ft(t, e) {
89
+ const i = t.get(e);
90
+ if (!i)
91
+ throw new Error("missing: " + e);
92
+ return i;
93
+ }
94
+ function yt({ nodes: t }) {
95
+ for (const e of t) {
96
+ let i = e.y0, a = i;
97
+ for (const h of e.sourceLinks)
98
+ h.y0 = i + h.width / 2, i += h.width;
99
+ for (const h of e.targetLinks)
100
+ h.y1 = a + h.width / 2, a += h.width;
101
+ }
102
+ }
103
+ function Bt() {
104
+ let t = 0, e = 0, i = 1, a = 1, h = 24, d = 8, m, _ = $t, s = mt, o, l, x = jt, v = zt, y = 6;
105
+ function b() {
106
+ const n = { nodes: x.apply(null, arguments), links: v.apply(null, arguments) };
107
+ return M(n), T(n), N(n), C(n), S(n), yt(n), n;
108
+ }
109
+ b.update = function(n) {
110
+ return yt(n), n;
111
+ }, b.nodeId = function(n) {
112
+ return arguments.length ? (_ = typeof n == "function" ? n : q(n), b) : _;
113
+ }, b.nodeAlign = function(n) {
114
+ return arguments.length ? (s = typeof n == "function" ? n : q(n), b) : s;
115
+ }, b.nodeSort = function(n) {
116
+ return arguments.length ? (o = n, b) : o;
117
+ }, b.nodeWidth = function(n) {
118
+ return arguments.length ? (h = +n, b) : h;
119
+ }, b.nodePadding = function(n) {
120
+ return arguments.length ? (d = m = +n, b) : d;
121
+ }, b.nodes = function(n) {
122
+ return arguments.length ? (x = typeof n == "function" ? n : q(n), b) : x;
123
+ }, b.links = function(n) {
124
+ return arguments.length ? (v = typeof n == "function" ? n : q(n), b) : v;
125
+ }, b.linkSort = function(n) {
126
+ return arguments.length ? (l = n, b) : l;
127
+ }, b.size = function(n) {
128
+ return arguments.length ? (t = e = 0, i = +n[0], a = +n[1], b) : [i - t, a - e];
129
+ }, b.extent = function(n) {
130
+ return arguments.length ? (t = +n[0][0], i = +n[1][0], e = +n[0][1], a = +n[1][1], b) : [[t, e], [i, a]];
131
+ }, b.iterations = function(n) {
132
+ return arguments.length ? (y = +n, b) : y;
133
+ };
134
+ function M({ nodes: n, links: f }) {
135
+ for (const [c, r] of n.entries())
136
+ r.index = c, r.sourceLinks = [], r.targetLinks = [];
137
+ const u = new Map(n.map((c, r) => [_(c, r, n), c]));
138
+ for (const [c, r] of f.entries()) {
139
+ r.index = c;
140
+ let { source: k, target: w } = r;
141
+ typeof k != "object" && (k = r.source = ft(u, k)), typeof w != "object" && (w = r.target = ft(u, w)), k.sourceLinks.push(r), w.targetLinks.push(r);
142
+ }
143
+ if (l != null)
144
+ for (const { sourceLinks: c, targetLinks: r } of n)
145
+ c.sort(l), r.sort(l);
146
+ }
147
+ function T({ nodes: n }) {
148
+ for (const f of n)
149
+ f.value = f.fixedValue === void 0 ? Math.max(nt(f.sourceLinks, it), nt(f.targetLinks, it)) : f.fixedValue;
150
+ }
151
+ function N({ nodes: n }) {
152
+ const f = n.length;
153
+ let u = new Set(n), c = /* @__PURE__ */ new Set(), r = 0;
154
+ for (; u.size; ) {
155
+ for (const k of u) {
156
+ k.depth = r;
157
+ for (const { target: w } of k.sourceLinks)
158
+ c.add(w);
159
+ }
160
+ if (++r > f)
161
+ throw new Error("circular link");
162
+ u = c, c = /* @__PURE__ */ new Set();
163
+ }
164
+ }
165
+ function C({ nodes: n }) {
166
+ const f = n.length;
167
+ let u = new Set(n), c = /* @__PURE__ */ new Set(), r = 0;
168
+ for (; u.size; ) {
169
+ for (const k of u) {
170
+ k.height = r;
171
+ for (const { source: w } of k.targetLinks)
172
+ c.add(w);
173
+ }
174
+ if (++r > f)
175
+ throw new Error("circular link");
176
+ u = c, c = /* @__PURE__ */ new Set();
177
+ }
178
+ }
179
+ function O({ nodes: n }) {
180
+ const f = ct(n, (r) => r.depth) + 1, u = (i - t - h) / (f - 1), c = new Array(f);
181
+ for (const r of n) {
182
+ const k = Math.max(0, Math.min(f - 1, Math.floor(s.call(null, r, f))));
183
+ r.layer = k, r.x0 = t + k * u, r.x1 = r.x0 + h, c[k] ? c[k].push(r) : c[k] = [r];
184
+ }
185
+ if (o)
186
+ for (const r of c)
187
+ r.sort(o);
188
+ return c;
189
+ }
190
+ function R(n) {
191
+ const f = pt(n, (u) => (a - e - (u.length - 1) * m) / nt(u, it));
192
+ for (const u of n) {
193
+ let c = e;
194
+ for (const r of u) {
195
+ r.y0 = c, r.y1 = c + r.value * f, c = r.y1 + m;
196
+ for (const k of r.sourceLinks)
197
+ k.width = k.value * f;
198
+ }
199
+ c = (a - c + m) / (u.length + 1);
200
+ for (let r = 0; r < u.length; ++r) {
201
+ const k = u[r];
202
+ k.y0 += c * (r + 1), k.y1 += c * (r + 1);
203
+ }
204
+ A(u);
205
+ }
206
+ }
207
+ function S(n) {
208
+ const f = O(n);
209
+ m = Math.min(d, (a - e) / (ct(f, (u) => u.length) - 1)), R(f);
210
+ for (let u = 0; u < y; ++u) {
211
+ const c = Math.pow(0.99, u), r = Math.max(1 - c, (u + 1) / y);
212
+ z(f, c, r), P(f, c, r);
213
+ }
214
+ }
215
+ function P(n, f, u) {
216
+ for (let c = 1, r = n.length; c < r; ++c) {
217
+ const k = n[c];
218
+ for (const w of k) {
219
+ let L = 0, V = 0;
220
+ for (const { source: U, value: et } of w.targetLinks) {
221
+ let G = et * (w.layer - U.layer);
222
+ L += j(U, w) * G, V += G;
223
+ }
224
+ if (!(V > 0))
225
+ continue;
226
+ let W = (L / V - w.y0) * f;
227
+ w.y0 += W, w.y1 += W, E(w);
228
+ }
229
+ o === void 0 && k.sort(Q), D(k, u);
230
+ }
231
+ }
232
+ function z(n, f, u) {
233
+ for (let c = n.length, r = c - 2; r >= 0; --r) {
234
+ const k = n[r];
235
+ for (const w of k) {
236
+ let L = 0, V = 0;
237
+ for (const { target: U, value: et } of w.sourceLinks) {
238
+ let G = et * (U.layer - w.layer);
239
+ L += I(w, U) * G, V += G;
240
+ }
241
+ if (!(V > 0))
242
+ continue;
243
+ let W = (L / V - w.y0) * f;
244
+ w.y0 += W, w.y1 += W, E(w);
245
+ }
246
+ o === void 0 && k.sort(Q), D(k, u);
247
+ }
248
+ }
249
+ function D(n, f) {
250
+ const u = n.length >> 1, c = n[u];
251
+ g(n, c.y0 - m, u - 1, f), $(n, c.y1 + m, u + 1, f), g(n, a, n.length - 1, f), $(n, e, 0, f);
252
+ }
253
+ function $(n, f, u, c) {
254
+ for (; u < n.length; ++u) {
255
+ const r = n[u], k = (f - r.y0) * c;
256
+ k > 1e-6 && (r.y0 += k, r.y1 += k), f = r.y1 + m;
257
+ }
258
+ }
259
+ function g(n, f, u, c) {
260
+ for (; u >= 0; --u) {
261
+ const r = n[u], k = (r.y1 - f) * c;
262
+ k > 1e-6 && (r.y0 -= k, r.y1 -= k), f = r.y0 - m;
263
+ }
264
+ }
265
+ function E({ sourceLinks: n, targetLinks: f }) {
266
+ if (l === void 0) {
267
+ for (const { source: { sourceLinks: u } } of f)
268
+ u.sort(ht);
269
+ for (const { target: { targetLinks: u } } of n)
270
+ u.sort(ut);
271
+ }
272
+ }
273
+ function A(n) {
274
+ if (l === void 0)
275
+ for (const { sourceLinks: f, targetLinks: u } of n)
276
+ f.sort(ht), u.sort(ut);
277
+ }
278
+ function j(n, f) {
279
+ let u = n.y0 - (n.sourceLinks.length - 1) * m / 2;
280
+ for (const { target: c, width: r } of n.sourceLinks) {
281
+ if (c === f)
282
+ break;
283
+ u += r + m;
284
+ }
285
+ for (const { source: c, width: r } of f.targetLinks) {
286
+ if (c === n)
287
+ break;
288
+ u -= r;
289
+ }
290
+ return u;
291
+ }
292
+ function I(n, f) {
293
+ let u = f.y0 - (f.targetLinks.length - 1) * m / 2;
294
+ for (const { source: c, width: r } of f.targetLinks) {
295
+ if (c === n)
296
+ break;
297
+ u += r + m;
298
+ }
299
+ for (const { target: c, width: r } of n.sourceLinks) {
300
+ if (c === f)
301
+ break;
302
+ u -= r;
303
+ }
304
+ return u;
305
+ }
306
+ return b;
307
+ }
308
+ var st = Math.PI, rt = 2 * st, F = 1e-6, Rt = rt - F;
309
+ function ot() {
310
+ this._x0 = this._y0 = // start of current subpath
311
+ this._x1 = this._y1 = null, this._ = "";
312
+ }
313
+ function kt() {
314
+ return new ot();
315
+ }
316
+ ot.prototype = kt.prototype = {
317
+ constructor: ot,
318
+ moveTo: function(t, e) {
319
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e);
320
+ },
321
+ closePath: function() {
322
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
323
+ },
324
+ lineTo: function(t, e) {
325
+ this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +e);
326
+ },
327
+ quadraticCurveTo: function(t, e, i, a) {
328
+ this._ += "Q" + +t + "," + +e + "," + (this._x1 = +i) + "," + (this._y1 = +a);
329
+ },
330
+ bezierCurveTo: function(t, e, i, a, h, d) {
331
+ this._ += "C" + +t + "," + +e + "," + +i + "," + +a + "," + (this._x1 = +h) + "," + (this._y1 = +d);
332
+ },
333
+ arcTo: function(t, e, i, a, h) {
334
+ t = +t, e = +e, i = +i, a = +a, h = +h;
335
+ var d = this._x1, m = this._y1, _ = i - t, s = a - e, o = d - t, l = m - e, x = o * o + l * l;
336
+ if (h < 0)
337
+ throw new Error("negative radius: " + h);
338
+ if (this._x1 === null)
339
+ this._ += "M" + (this._x1 = t) + "," + (this._y1 = e);
340
+ else if (x > F)
341
+ if (!(Math.abs(l * _ - s * o) > F) || !h)
342
+ this._ += "L" + (this._x1 = t) + "," + (this._y1 = e);
343
+ else {
344
+ var v = i - d, y = a - m, b = _ * _ + s * s, M = v * v + y * y, T = Math.sqrt(b), N = Math.sqrt(x), C = h * Math.tan((st - Math.acos((b + x - M) / (2 * T * N))) / 2), O = C / N, R = C / T;
345
+ Math.abs(O - 1) > F && (this._ += "L" + (t + O * o) + "," + (e + O * l)), this._ += "A" + h + "," + h + ",0,0," + +(l * v > o * y) + "," + (this._x1 = t + R * _) + "," + (this._y1 = e + R * s);
346
+ }
347
+ },
348
+ arc: function(t, e, i, a, h, d) {
349
+ t = +t, e = +e, i = +i, d = !!d;
350
+ var m = i * Math.cos(a), _ = i * Math.sin(a), s = t + m, o = e + _, l = 1 ^ d, x = d ? a - h : h - a;
351
+ if (i < 0)
352
+ throw new Error("negative radius: " + i);
353
+ this._x1 === null ? this._ += "M" + s + "," + o : (Math.abs(this._x1 - s) > F || Math.abs(this._y1 - o) > F) && (this._ += "L" + s + "," + o), i && (x < 0 && (x = x % rt + rt), x > Rt ? this._ += "A" + i + "," + i + ",0,1," + l + "," + (t - m) + "," + (e - _) + "A" + i + "," + i + ",0,1," + l + "," + (this._x1 = s) + "," + (this._y1 = o) : x > F && (this._ += "A" + i + "," + i + ",0," + +(x >= st) + "," + l + "," + (this._x1 = t + i * Math.cos(h)) + "," + (this._y1 = e + i * Math.sin(h))));
354
+ },
355
+ rect: function(t, e, i, a) {
356
+ this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e) + "h" + +i + "v" + +a + "h" + -i + "Z";
357
+ },
358
+ toString: function() {
359
+ return this._;
360
+ }
361
+ };
362
+ function dt(t) {
363
+ return function() {
364
+ return t;
365
+ };
366
+ }
367
+ function Vt(t) {
368
+ return t[0];
369
+ }
370
+ function Ft(t) {
371
+ return t[1];
372
+ }
373
+ var Wt = Array.prototype.slice;
374
+ function Ut(t) {
375
+ return t.source;
376
+ }
377
+ function Gt(t) {
378
+ return t.target;
379
+ }
380
+ function Yt(t) {
381
+ var e = Ut, i = Gt, a = Vt, h = Ft, d = null;
382
+ function m() {
383
+ var _, s = Wt.call(arguments), o = e.apply(this, s), l = i.apply(this, s);
384
+ if (d || (d = _ = kt()), t(d, +a.apply(this, (s[0] = o, s)), +h.apply(this, s), +a.apply(this, (s[0] = l, s)), +h.apply(this, s)), _)
385
+ return d = null, _ + "" || null;
386
+ }
387
+ return m.source = function(_) {
388
+ return arguments.length ? (e = _, m) : e;
389
+ }, m.target = function(_) {
390
+ return arguments.length ? (i = _, m) : i;
391
+ }, m.x = function(_) {
392
+ return arguments.length ? (a = typeof _ == "function" ? _ : dt(+_), m) : a;
393
+ }, m.y = function(_) {
394
+ return arguments.length ? (h = typeof _ == "function" ? _ : dt(+_), m) : h;
395
+ }, m.context = function(_) {
396
+ return arguments.length ? (d = _ ?? null, m) : d;
397
+ }, m;
398
+ }
399
+ function Ht(t, e, i, a, h) {
400
+ t.moveTo(e, i), t.bezierCurveTo(e = (e + a) / 2, i, e, h, a, h);
401
+ }
402
+ function Xt() {
403
+ return Yt(Ht);
404
+ }
405
+ function qt(t) {
406
+ return [t.source.x1, t.y0];
407
+ }
408
+ function Qt(t) {
409
+ return [t.target.x0, t.y1];
410
+ }
411
+ function Kt() {
412
+ return Xt().source(qt).target(Qt);
413
+ }
414
+ var at = function() {
415
+ var t = /* @__PURE__ */ p(function(_, s, o, l) {
416
+ for (o = o || {}, l = _.length; l--; o[_[l]] = s)
417
+ ;
418
+ return o;
419
+ }, "o"), e = [1, 9], i = [1, 10], a = [1, 5, 10, 12], h = {
420
+ trace: /* @__PURE__ */ p(function() {
421
+ }, "trace"),
422
+ yy: {},
423
+ 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 },
424
+ 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" },
425
+ productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
426
+ performAction: /* @__PURE__ */ p(function(s, o, l, x, v, y, b) {
427
+ var M = y.length - 1;
428
+ switch (v) {
429
+ case 7:
430
+ const T = x.findOrCreateNode(y[M - 4].trim().replaceAll('""', '"')), N = x.findOrCreateNode(y[M - 2].trim().replaceAll('""', '"')), C = parseFloat(y[M].trim());
431
+ x.addLink(T, N, C);
432
+ break;
433
+ case 8:
434
+ case 9:
435
+ case 11:
436
+ this.$ = y[M];
437
+ break;
438
+ case 10:
439
+ this.$ = y[M - 1];
440
+ break;
441
+ }
442
+ }, "anonymous"),
443
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: e, 20: i }, { 1: [2, 6], 7: 11, 10: [1, 12] }, t(i, [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(i, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: e, 20: i }, { 15: 18, 16: 7, 17: 8, 18: e, 20: i }, { 18: [1, 19] }, t(i, [2, 3]), { 12: [1, 20] }, t(a, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: e, 20: i }, t([1, 5, 10], [2, 7])],
444
+ defaultActions: { 11: [2, 1], 12: [2, 5] },
445
+ parseError: /* @__PURE__ */ p(function(s, o) {
446
+ if (o.recoverable)
447
+ this.trace(s);
448
+ else {
449
+ var l = new Error(s);
450
+ throw l.hash = o, l;
451
+ }
452
+ }, "parseError"),
453
+ parse: /* @__PURE__ */ p(function(s) {
454
+ var o = this, l = [0], x = [], v = [null], y = [], b = this.table, M = "", T = 0, N = 0, C = 2, O = 1, R = y.slice.call(arguments, 1), S = Object.create(this.lexer), P = { yy: {} };
455
+ for (var z in this.yy)
456
+ Object.prototype.hasOwnProperty.call(this.yy, z) && (P.yy[z] = this.yy[z]);
457
+ S.setInput(s, P.yy), P.yy.lexer = S, P.yy.parser = this, typeof S.yylloc > "u" && (S.yylloc = {});
458
+ var D = S.yylloc;
459
+ y.push(D);
460
+ var $ = S.options && S.options.ranges;
461
+ typeof P.yy.parseError == "function" ? this.parseError = P.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
462
+ function g(L) {
463
+ l.length = l.length - 2 * L, v.length = v.length - L, y.length = y.length - L;
464
+ }
465
+ p(g, "popStack");
466
+ function E() {
467
+ var L;
468
+ return L = x.pop() || S.lex() || O, typeof L != "number" && (L instanceof Array && (x = L, L = x.pop()), L = o.symbols_[L] || L), L;
469
+ }
470
+ p(E, "lex");
471
+ for (var A, j, I, n, f = {}, u, c, r, k; ; ) {
472
+ if (j = l[l.length - 1], this.defaultActions[j] ? I = this.defaultActions[j] : ((A === null || typeof A > "u") && (A = E()), I = b[j] && b[j][A]), typeof I > "u" || !I.length || !I[0]) {
473
+ var w = "";
474
+ k = [];
475
+ for (u in b[j])
476
+ this.terminals_[u] && u > C && k.push("'" + this.terminals_[u] + "'");
477
+ S.showPosition ? w = "Parse error on line " + (T + 1) + `:
478
+ ` + S.showPosition() + `
479
+ Expecting ` + k.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : w = "Parse error on line " + (T + 1) + ": Unexpected " + (A == O ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(w, {
480
+ text: S.match,
481
+ token: this.terminals_[A] || A,
482
+ line: S.yylineno,
483
+ loc: D,
484
+ expected: k
485
+ });
486
+ }
487
+ if (I[0] instanceof Array && I.length > 1)
488
+ throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + A);
489
+ switch (I[0]) {
490
+ case 1:
491
+ l.push(A), v.push(S.yytext), y.push(S.yylloc), l.push(I[1]), A = null, N = S.yyleng, M = S.yytext, T = S.yylineno, D = S.yylloc;
492
+ break;
493
+ case 2:
494
+ if (c = this.productions_[I[1]][1], f.$ = v[v.length - c], f._$ = {
495
+ first_line: y[y.length - (c || 1)].first_line,
496
+ last_line: y[y.length - 1].last_line,
497
+ first_column: y[y.length - (c || 1)].first_column,
498
+ last_column: y[y.length - 1].last_column
499
+ }, $ && (f._$.range = [
500
+ y[y.length - (c || 1)].range[0],
501
+ y[y.length - 1].range[1]
502
+ ]), n = this.performAction.apply(f, [
503
+ M,
504
+ N,
505
+ T,
506
+ P.yy,
507
+ I[1],
508
+ v,
509
+ y
510
+ ].concat(R)), typeof n < "u")
511
+ return n;
512
+ c && (l = l.slice(0, -1 * c * 2), v = v.slice(0, -1 * c), y = y.slice(0, -1 * c)), l.push(this.productions_[I[1]][0]), v.push(f.$), y.push(f._$), r = b[l[l.length - 2]][l[l.length - 1]], l.push(r);
513
+ break;
514
+ case 3:
515
+ return !0;
516
+ }
517
+ }
518
+ return !0;
519
+ }, "parse")
520
+ }, d = /* @__PURE__ */ function() {
521
+ var _ = {
522
+ EOF: 1,
523
+ parseError: /* @__PURE__ */ p(function(o, l) {
524
+ if (this.yy.parser)
525
+ this.yy.parser.parseError(o, l);
526
+ else
527
+ throw new Error(o);
528
+ }, "parseError"),
529
+ // resets the lexer, sets new input
530
+ setInput: /* @__PURE__ */ p(function(s, o) {
531
+ return this.yy = o || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
532
+ first_line: 1,
533
+ first_column: 0,
534
+ last_line: 1,
535
+ last_column: 0
536
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
537
+ }, "setInput"),
538
+ // consumes and returns one char from the input
539
+ input: /* @__PURE__ */ p(function() {
540
+ var s = this._input[0];
541
+ this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
542
+ var o = s.match(/(?:\r\n?|\n).*/g);
543
+ 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), s;
544
+ }, "input"),
545
+ // unshifts one char (or a string) into the input
546
+ unput: /* @__PURE__ */ p(function(s) {
547
+ var o = s.length, l = s.split(/(?:\r\n?|\n)/g);
548
+ this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - o), this.offset -= o;
549
+ var x = this.match.split(/(?:\r\n?|\n)/g);
550
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), l.length - 1 && (this.yylineno -= l.length - 1);
551
+ var v = this.yylloc.range;
552
+ return this.yylloc = {
553
+ first_line: this.yylloc.first_line,
554
+ last_line: this.yylineno + 1,
555
+ first_column: this.yylloc.first_column,
556
+ last_column: l ? (l.length === x.length ? this.yylloc.first_column : 0) + x[x.length - l.length].length - l[0].length : this.yylloc.first_column - o
557
+ }, this.options.ranges && (this.yylloc.range = [v[0], v[0] + this.yyleng - o]), this.yyleng = this.yytext.length, this;
558
+ }, "unput"),
559
+ // When called from action, caches matched text and appends it on next action
560
+ more: /* @__PURE__ */ p(function() {
561
+ return this._more = !0, this;
562
+ }, "more"),
563
+ // 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.
564
+ reject: /* @__PURE__ */ p(function() {
565
+ if (this.options.backtrack_lexer)
566
+ this._backtrack = !0;
567
+ else
568
+ 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).
569
+ ` + this.showPosition(), {
570
+ text: "",
571
+ token: null,
572
+ line: this.yylineno
573
+ });
574
+ return this;
575
+ }, "reject"),
576
+ // retain first n characters of the match
577
+ less: /* @__PURE__ */ p(function(s) {
578
+ this.unput(this.match.slice(s));
579
+ }, "less"),
580
+ // displays already matched input, i.e. for error messages
581
+ pastInput: /* @__PURE__ */ p(function() {
582
+ var s = this.matched.substr(0, this.matched.length - this.match.length);
583
+ return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
584
+ }, "pastInput"),
585
+ // displays upcoming input, i.e. for error messages
586
+ upcomingInput: /* @__PURE__ */ p(function() {
587
+ var s = this.match;
588
+ return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
589
+ }, "upcomingInput"),
590
+ // displays the character position where the lexing error occurred, i.e. for error messages
591
+ showPosition: /* @__PURE__ */ p(function() {
592
+ var s = this.pastInput(), o = new Array(s.length + 1).join("-");
593
+ return s + this.upcomingInput() + `
594
+ ` + o + "^";
595
+ }, "showPosition"),
596
+ // test the lexed token: return FALSE when not a match, otherwise return token
597
+ test_match: /* @__PURE__ */ p(function(s, o) {
598
+ var l, x, v;
599
+ if (this.options.backtrack_lexer && (v = {
600
+ yylineno: this.yylineno,
601
+ yylloc: {
602
+ first_line: this.yylloc.first_line,
603
+ last_line: this.last_line,
604
+ first_column: this.yylloc.first_column,
605
+ last_column: this.yylloc.last_column
606
+ },
607
+ yytext: this.yytext,
608
+ match: this.match,
609
+ matches: this.matches,
610
+ matched: this.matched,
611
+ yyleng: this.yyleng,
612
+ offset: this.offset,
613
+ _more: this._more,
614
+ _input: this._input,
615
+ yy: this.yy,
616
+ conditionStack: this.conditionStack.slice(0),
617
+ done: this.done
618
+ }, this.options.ranges && (v.yylloc.range = this.yylloc.range.slice(0))), x = s[0].match(/(?:\r\n?|\n).*/g), x && (this.yylineno += x.length), this.yylloc = {
619
+ first_line: this.yylloc.last_line,
620
+ last_line: this.yylineno + 1,
621
+ first_column: this.yylloc.last_column,
622
+ last_column: x ? x[x.length - 1].length - x[x.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
623
+ }, this.yytext += s[0], this.match += s[0], this.matches = s, 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(s[0].length), this.matched += s[0], l = this.performAction.call(this, this.yy, this, o, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), l)
624
+ return l;
625
+ if (this._backtrack) {
626
+ for (var y in v)
627
+ this[y] = v[y];
628
+ return !1;
629
+ }
630
+ return !1;
631
+ }, "test_match"),
632
+ // return next match in input
633
+ next: /* @__PURE__ */ p(function() {
634
+ if (this.done)
635
+ return this.EOF;
636
+ this._input || (this.done = !0);
637
+ var s, o, l, x;
638
+ this._more || (this.yytext = "", this.match = "");
639
+ for (var v = this._currentRules(), y = 0; y < v.length; y++)
640
+ if (l = this._input.match(this.rules[v[y]]), l && (!o || l[0].length > o[0].length)) {
641
+ if (o = l, x = y, this.options.backtrack_lexer) {
642
+ if (s = this.test_match(l, v[y]), s !== !1)
643
+ return s;
644
+ if (this._backtrack) {
645
+ o = !1;
646
+ continue;
647
+ } else
648
+ return !1;
649
+ } else if (!this.options.flex)
650
+ break;
651
+ }
652
+ return o ? (s = this.test_match(o, v[x]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
653
+ ` + this.showPosition(), {
654
+ text: "",
655
+ token: null,
656
+ line: this.yylineno
657
+ });
658
+ }, "next"),
659
+ // return next match that has a token
660
+ lex: /* @__PURE__ */ p(function() {
661
+ var o = this.next();
662
+ return o || this.lex();
663
+ }, "lex"),
664
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
665
+ begin: /* @__PURE__ */ p(function(o) {
666
+ this.conditionStack.push(o);
667
+ }, "begin"),
668
+ // pop the previously active lexer condition state off the condition stack
669
+ popState: /* @__PURE__ */ p(function() {
670
+ var o = this.conditionStack.length - 1;
671
+ return o > 0 ? this.conditionStack.pop() : this.conditionStack[0];
672
+ }, "popState"),
673
+ // produce the lexer rule set which is active for the currently active lexer condition state
674
+ _currentRules: /* @__PURE__ */ p(function() {
675
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
676
+ }, "_currentRules"),
677
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
678
+ topState: /* @__PURE__ */ p(function(o) {
679
+ return o = this.conditionStack.length - 1 - Math.abs(o || 0), o >= 0 ? this.conditionStack[o] : "INITIAL";
680
+ }, "topState"),
681
+ // alias for begin(condition)
682
+ pushState: /* @__PURE__ */ p(function(o) {
683
+ this.begin(o);
684
+ }, "pushState"),
685
+ // return the number of states currently on the stack
686
+ stateStackSize: /* @__PURE__ */ p(function() {
687
+ return this.conditionStack.length;
688
+ }, "stateStackSize"),
689
+ options: { "case-insensitive": !0 },
690
+ performAction: /* @__PURE__ */ p(function(o, l, x, v) {
691
+ switch (x) {
692
+ case 0:
693
+ return this.pushState("csv"), 4;
694
+ case 1:
695
+ return 10;
696
+ case 2:
697
+ return 5;
698
+ case 3:
699
+ return 12;
700
+ case 4:
701
+ return this.pushState("escaped_text"), 18;
702
+ case 5:
703
+ return 20;
704
+ case 6:
705
+ return this.popState("escaped_text"), 18;
706
+ case 7:
707
+ return 19;
708
+ }
709
+ }, "anonymous"),
710
+ 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],
711
+ 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 } }
712
+ };
713
+ return _;
714
+ }();
715
+ h.lexer = d;
716
+ function m() {
717
+ this.yy = {};
718
+ }
719
+ return p(m, "Parser"), m.prototype = h, h.Parser = m, new m();
720
+ }();
721
+ at.parser = at;
722
+ var K = at, J = [], tt = [], Z = /* @__PURE__ */ new Map(), Zt = /* @__PURE__ */ p(() => {
723
+ J = [], tt = [], Z = /* @__PURE__ */ new Map(), Lt();
724
+ }, "clear"), Y, Jt = (Y = class {
725
+ constructor(e, i, a = 0) {
726
+ this.source = e, this.target = i, this.value = a;
727
+ }
728
+ }, p(Y, "SankeyLink"), Y), te = /* @__PURE__ */ p((t, e, i) => {
729
+ J.push(new Jt(t, e, i));
730
+ }, "addLink"), H, ee = (H = class {
731
+ constructor(e) {
732
+ this.ID = e;
733
+ }
734
+ }, p(H, "SankeyNode"), H), ne = /* @__PURE__ */ p((t) => {
735
+ t = Et.sanitizeText(t, lt());
736
+ let e = Z.get(t);
737
+ return e === void 0 && (e = new ee(t), Z.set(t, e), tt.push(e)), e;
738
+ }, "findOrCreateNode"), ie = /* @__PURE__ */ p(() => tt, "getNodes"), se = /* @__PURE__ */ p(() => J, "getLinks"), re = /* @__PURE__ */ p(() => ({
739
+ nodes: tt.map((t) => ({ id: t.ID })),
740
+ links: J.map((t) => ({
741
+ source: t.source.ID,
742
+ target: t.target.ID,
743
+ value: t.value
744
+ }))
745
+ }), "getGraph"), oe = {
746
+ nodesMap: Z,
747
+ getConfig: /* @__PURE__ */ p(() => lt().sankey, "getConfig"),
748
+ getNodes: ie,
749
+ getLinks: se,
750
+ getGraph: re,
751
+ addLink: te,
752
+ findOrCreateNode: ne,
753
+ getAccTitle: _t,
754
+ setAccTitle: xt,
755
+ getAccDescription: vt,
756
+ setAccDescription: bt,
757
+ getDiagramTitle: wt,
758
+ setDiagramTitle: St,
759
+ clear: Zt
760
+ }, B, gt = (B = class {
761
+ static next(e) {
762
+ return new B(e + ++B.count);
763
+ }
764
+ constructor(e) {
765
+ this.id = e, this.href = `#${e}`;
766
+ }
767
+ toString() {
768
+ return "url(" + this.href + ")";
769
+ }
770
+ }, p(B, "Uid"), B.count = 0, B), ae = {
771
+ left: Ct,
772
+ right: Ot,
773
+ center: Dt,
774
+ justify: mt
775
+ }, le = /* @__PURE__ */ p(function(t, e, i, a) {
776
+ const { securityLevel: h, sankey: d } = lt(), m = At.sankey;
777
+ let _;
778
+ h === "sandbox" && (_ = X("#i" + e));
779
+ const s = h === "sandbox" ? X(_.nodes()[0].contentDocument.body) : X("body"), o = h === "sandbox" ? s.select(`[id="${e}"]`) : X(`[id="${e}"]`), l = (d == null ? void 0 : d.width) ?? m.width, x = (d == null ? void 0 : d.height) ?? m.width, v = (d == null ? void 0 : d.useMaxWidth) ?? m.useMaxWidth, y = (d == null ? void 0 : d.nodeAlignment) ?? m.nodeAlignment, b = (d == null ? void 0 : d.prefix) ?? m.prefix, M = (d == null ? void 0 : d.suffix) ?? m.suffix, T = (d == null ? void 0 : d.showValues) ?? m.showValues, N = a.db.getGraph(), C = ae[y], O = 10;
780
+ Bt().nodeId((g) => g.id).nodeWidth(O).nodePadding(10 + (T ? 15 : 0)).nodeAlign(C).extent([
781
+ [0, 0],
782
+ [l, x]
783
+ ])(N);
784
+ const S = Mt(It);
785
+ o.append("g").attr("class", "nodes").selectAll(".node").data(N.nodes).join("g").attr("class", "node").attr("id", (g) => (g.uid = gt.next("node-")).id).attr("transform", function(g) {
786
+ return "translate(" + g.x0 + "," + g.y0 + ")";
787
+ }).attr("x", (g) => g.x0).attr("y", (g) => g.y0).append("rect").attr("height", (g) => g.y1 - g.y0).attr("width", (g) => g.x1 - g.x0).attr("fill", (g) => S(g.id));
788
+ const P = /* @__PURE__ */ p(({ id: g, value: E }) => T ? `${g}
789
+ ${b}${Math.round(E * 100) / 100}${M}` : g, "getText");
790
+ o.append("g").attr("class", "node-labels").attr("font-size", 14).selectAll("text").data(N.nodes).join("text").attr("x", (g) => g.x0 < l / 2 ? g.x1 + 6 : g.x0 - 6).attr("y", (g) => (g.y1 + g.y0) / 2).attr("dy", `${T ? "0" : "0.35"}em`).attr("text-anchor", (g) => g.x0 < l / 2 ? "start" : "end").text(P);
791
+ const z = o.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(N.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply"), D = (d == null ? void 0 : d.linkColor) ?? "gradient";
792
+ if (D === "gradient") {
793
+ const g = z.append("linearGradient").attr("id", (E) => (E.uid = gt.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (E) => E.source.x1).attr("x2", (E) => E.target.x0);
794
+ g.append("stop").attr("offset", "0%").attr("stop-color", (E) => S(E.source.id)), g.append("stop").attr("offset", "100%").attr("stop-color", (E) => S(E.target.id));
795
+ }
796
+ let $;
797
+ switch (D) {
798
+ case "gradient":
799
+ $ = /* @__PURE__ */ p((g) => g.uid, "coloring");
800
+ break;
801
+ case "source":
802
+ $ = /* @__PURE__ */ p((g) => S(g.source.id), "coloring");
803
+ break;
804
+ case "target":
805
+ $ = /* @__PURE__ */ p((g) => S(g.target.id), "coloring");
806
+ break;
807
+ default:
808
+ $ = D;
809
+ }
810
+ z.append("path").attr("d", Kt()).attr("stroke", $).attr("stroke-width", (g) => Math.max(1, g.width)), Tt(void 0, o, 0, v);
811
+ }, "draw"), ce = {
812
+ draw: le
813
+ }, ue = /* @__PURE__ */ p((t) => t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, `
814
+ `).trim(), "prepareTextForParsing"), he = /* @__PURE__ */ p((t) => `.label {
815
+ font-family: ${t.fontFamily};
816
+ }`, "getStyles"), fe = he, ye = K.parse.bind(K);
817
+ K.parse = (t) => ye(ue(t));
818
+ var ke = {
819
+ styles: fe,
820
+ parser: K,
821
+ db: oe,
822
+ renderer: ce
823
+ };
824
+ export {
825
+ ke as diagram
826
+ };