@oxide/design-system 1.7.7--canary.fdd8ab6.0 → 1.7.7--canary.87d60df.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 (130) hide show
  1. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js +14 -0
  2. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js.map +1 -0
  3. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js +8846 -0
  4. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js.map +1 -0
  5. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js +3721 -0
  6. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js.map +1 -0
  7. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js +2599 -0
  8. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js.map +1 -0
  9. package/components/dist/chunk-2DDKDUUO.js +439 -0
  10. package/components/dist/chunk-2DDKDUUO.js.map +1 -0
  11. package/components/dist/chunk-2NHDMTP7.js +26905 -0
  12. package/components/dist/chunk-2NHDMTP7.js.map +1 -0
  13. package/components/dist/chunk-4IJS44L3.js +22 -0
  14. package/components/dist/chunk-4IJS44L3.js.map +1 -0
  15. package/components/dist/chunk-562WOS3Z.js +1109 -0
  16. package/components/dist/chunk-562WOS3Z.js.map +1 -0
  17. package/components/dist/chunk-6UD2HOKB.js +17082 -0
  18. package/components/dist/chunk-6UD2HOKB.js.map +1 -0
  19. package/components/dist/chunk-76BOQ7BT.js +63 -0
  20. package/components/dist/chunk-76BOQ7BT.js.map +1 -0
  21. package/components/dist/chunk-7I5DT373.js +97 -0
  22. package/components/dist/chunk-7I5DT373.js.map +1 -0
  23. package/components/dist/chunk-BPREMNVP.js +1875 -0
  24. package/components/dist/chunk-BPREMNVP.js.map +1 -0
  25. package/components/dist/chunk-BVYAEHG3.js +122 -0
  26. package/components/dist/chunk-BVYAEHG3.js.map +1 -0
  27. package/components/dist/chunk-BW7DFBOS.js +152 -0
  28. package/components/dist/chunk-BW7DFBOS.js.map +1 -0
  29. package/components/dist/chunk-EZG2MNHW.js +59 -0
  30. package/components/dist/chunk-EZG2MNHW.js.map +1 -0
  31. package/components/dist/chunk-G6QWNAHJ.js +43 -0
  32. package/components/dist/chunk-G6QWNAHJ.js.map +1 -0
  33. package/components/dist/chunk-H72D3HRR.js +1244 -0
  34. package/components/dist/chunk-H72D3HRR.js.map +1 -0
  35. package/components/dist/chunk-K532NZMW.js +46 -0
  36. package/components/dist/chunk-K532NZMW.js.map +1 -0
  37. package/components/dist/chunk-LC3BX2KL.js +25 -0
  38. package/components/dist/chunk-LC3BX2KL.js.map +1 -0
  39. package/components/dist/chunk-LQ2ABR7F.js +5665 -0
  40. package/components/dist/chunk-LQ2ABR7F.js.map +1 -0
  41. package/components/dist/chunk-M6L3MM6K.js +22 -0
  42. package/components/dist/chunk-M6L3MM6K.js.map +1 -0
  43. package/components/dist/chunk-MWA4PRRW.js +122 -0
  44. package/components/dist/chunk-MWA4PRRW.js.map +1 -0
  45. package/components/dist/chunk-ND3FLKHU.js +570 -0
  46. package/components/dist/chunk-ND3FLKHU.js.map +1 -0
  47. package/components/dist/chunk-NIVHLOPB.js +2621 -0
  48. package/components/dist/chunk-NIVHLOPB.js.map +1 -0
  49. package/components/dist/chunk-R6F6FFK7.js +65 -0
  50. package/components/dist/chunk-R6F6FFK7.js.map +1 -0
  51. package/components/dist/chunk-RN5R3L7O.js +2041 -0
  52. package/components/dist/chunk-RN5R3L7O.js.map +1 -0
  53. package/components/dist/chunk-RWDBBMDN.js +10910 -0
  54. package/components/dist/chunk-RWDBBMDN.js.map +1 -0
  55. package/components/dist/chunk-T7HPDS4Z.js +573 -0
  56. package/components/dist/chunk-T7HPDS4Z.js.map +1 -0
  57. package/components/dist/chunk-TG4YEU4Q.js +23 -0
  58. package/components/dist/chunk-TG4YEU4Q.js.map +1 -0
  59. package/components/dist/chunk-U5WCXBW2.js +48 -0
  60. package/components/dist/chunk-U5WCXBW2.js.map +1 -0
  61. package/components/dist/chunk-V6PWN6OH.js +1875 -0
  62. package/components/dist/chunk-V6PWN6OH.js.map +1 -0
  63. package/components/dist/chunk-VLTHNCSD.js +48 -0
  64. package/components/dist/chunk-VLTHNCSD.js.map +1 -0
  65. package/components/dist/chunk-WDK4G4UR.js +2791 -0
  66. package/components/dist/chunk-WDK4G4UR.js.map +1 -0
  67. package/components/dist/chunk-WLVQWTC6.js +77 -0
  68. package/components/dist/chunk-WLVQWTC6.js.map +1 -0
  69. package/components/dist/chunk-YDLS5R4M.js +48 -0
  70. package/components/dist/chunk-YDLS5R4M.js.map +1 -0
  71. package/components/dist/chunk-YGFBWU2Q.js +7 -0
  72. package/components/dist/chunk-YGFBWU2Q.js.map +1 -0
  73. package/components/dist/chunk-ZBL4CWCH.js +2120 -0
  74. package/components/dist/chunk-ZBL4CWCH.js.map +1 -0
  75. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js +40 -0
  76. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js.map +1 -0
  77. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js +40 -0
  78. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js.map +1 -0
  79. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js +734 -0
  80. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js.map +1 -0
  81. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js +226 -0
  82. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js.map +1 -0
  83. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js +1381 -0
  84. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js.map +1 -0
  85. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js +2349 -0
  86. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js.map +1 -0
  87. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js +2413 -0
  88. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js.map +1 -0
  89. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js +14 -0
  90. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js.map +1 -0
  91. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js +1763 -0
  92. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js.map +1 -0
  93. package/components/dist/index.d.ts +5 -2
  94. package/components/dist/index.js +1729 -126
  95. package/components/dist/index.js.map +1 -1
  96. package/components/dist/info-46DW6VJ7-43TTIEYF.js +14 -0
  97. package/components/dist/info-46DW6VJ7-43TTIEYF.js.map +1 -0
  98. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js +54 -0
  99. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js.map +1 -0
  100. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js +1244 -0
  101. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js.map +1 -0
  102. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js +1119 -0
  103. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js.map +1 -0
  104. package/components/dist/katex-WNZY3CE5.js +14484 -0
  105. package/components/dist/katex-WNZY3CE5.js.map +1 -0
  106. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js +6013 -0
  107. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js.map +1 -0
  108. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js +14 -0
  109. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js.map +1 -0
  110. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js +14 -0
  111. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js.map +1 -0
  112. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js +223 -0
  113. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js.map +1 -0
  114. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js +1408 -0
  115. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js.map +1 -0
  116. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js +1175 -0
  117. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js.map +1 -0
  118. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js +1278 -0
  119. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js.map +1 -0
  120. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js +3529 -0
  121. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js.map +1 -0
  122. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js +505 -0
  123. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js.map +1 -0
  124. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js +40 -0
  125. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js.map +1 -0
  126. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js +1260 -0
  127. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js.map +1 -0
  128. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js +1877 -0
  129. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js.map +1 -0
  130. package/package.json +2 -1
@@ -0,0 +1,1278 @@
1
+ import {
2
+ Tableau10_default,
3
+ __name,
4
+ clear,
5
+ common_default,
6
+ defaultConfig2,
7
+ getAccDescription,
8
+ getAccTitle,
9
+ getConfig2,
10
+ getDiagramTitle,
11
+ ordinal,
12
+ select_default,
13
+ setAccDescription,
14
+ setAccTitle,
15
+ setDiagramTitle,
16
+ setupGraphViewbox
17
+ } from "./chunk-RWDBBMDN.js";
18
+ import "./chunk-K532NZMW.js";
19
+
20
+ // node_modules/d3-sankey/node_modules/d3-array/src/max.js
21
+ function max(values, valueof) {
22
+ let max2;
23
+ if (valueof === void 0) {
24
+ for (const value2 of values) {
25
+ if (value2 != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
26
+ max2 = value2;
27
+ }
28
+ }
29
+ } else {
30
+ let index = -1;
31
+ for (let value2 of values) {
32
+ if ((value2 = valueof(value2, ++index, values)) != null && (max2 < value2 || max2 === void 0 && value2 >= value2)) {
33
+ max2 = value2;
34
+ }
35
+ }
36
+ }
37
+ return max2;
38
+ }
39
+
40
+ // node_modules/d3-sankey/node_modules/d3-array/src/min.js
41
+ function min(values, valueof) {
42
+ let min2;
43
+ if (valueof === void 0) {
44
+ for (const value2 of values) {
45
+ if (value2 != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) {
46
+ min2 = value2;
47
+ }
48
+ }
49
+ } else {
50
+ let index = -1;
51
+ for (let value2 of values) {
52
+ if ((value2 = valueof(value2, ++index, values)) != null && (min2 > value2 || min2 === void 0 && value2 >= value2)) {
53
+ min2 = value2;
54
+ }
55
+ }
56
+ }
57
+ return min2;
58
+ }
59
+
60
+ // node_modules/d3-sankey/node_modules/d3-array/src/sum.js
61
+ function sum(values, valueof) {
62
+ let sum2 = 0;
63
+ if (valueof === void 0) {
64
+ for (let value2 of values) {
65
+ if (value2 = +value2) {
66
+ sum2 += value2;
67
+ }
68
+ }
69
+ } else {
70
+ let index = -1;
71
+ for (let value2 of values) {
72
+ if (value2 = +valueof(value2, ++index, values)) {
73
+ sum2 += value2;
74
+ }
75
+ }
76
+ }
77
+ return sum2;
78
+ }
79
+
80
+ // node_modules/d3-sankey/src/align.js
81
+ function targetDepth(d) {
82
+ return d.target.depth;
83
+ }
84
+ function left(node) {
85
+ return node.depth;
86
+ }
87
+ function right(node, n) {
88
+ return n - 1 - node.height;
89
+ }
90
+ function justify(node, n) {
91
+ return node.sourceLinks.length ? node.depth : n - 1;
92
+ }
93
+ function center(node) {
94
+ return node.targetLinks.length ? node.depth : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1 : 0;
95
+ }
96
+
97
+ // node_modules/d3-sankey/src/constant.js
98
+ function constant(x2) {
99
+ return function() {
100
+ return x2;
101
+ };
102
+ }
103
+
104
+ // node_modules/d3-sankey/src/sankey.js
105
+ function ascendingSourceBreadth(a, b) {
106
+ return ascendingBreadth(a.source, b.source) || a.index - b.index;
107
+ }
108
+ function ascendingTargetBreadth(a, b) {
109
+ return ascendingBreadth(a.target, b.target) || a.index - b.index;
110
+ }
111
+ function ascendingBreadth(a, b) {
112
+ return a.y0 - b.y0;
113
+ }
114
+ function value(d) {
115
+ return d.value;
116
+ }
117
+ function defaultId(d) {
118
+ return d.index;
119
+ }
120
+ function defaultNodes(graph) {
121
+ return graph.nodes;
122
+ }
123
+ function defaultLinks(graph) {
124
+ return graph.links;
125
+ }
126
+ function find(nodeById, id) {
127
+ const node = nodeById.get(id);
128
+ if (!node)
129
+ throw new Error("missing: " + id);
130
+ return node;
131
+ }
132
+ function computeLinkBreadths({ nodes: nodes2 }) {
133
+ for (const node of nodes2) {
134
+ let y0 = node.y0;
135
+ let y1 = y0;
136
+ for (const link2 of node.sourceLinks) {
137
+ link2.y0 = y0 + link2.width / 2;
138
+ y0 += link2.width;
139
+ }
140
+ for (const link2 of node.targetLinks) {
141
+ link2.y1 = y1 + link2.width / 2;
142
+ y1 += link2.width;
143
+ }
144
+ }
145
+ }
146
+ function Sankey() {
147
+ let x0 = 0, y0 = 0, x1 = 1, y1 = 1;
148
+ let dx = 24;
149
+ let dy = 8, py;
150
+ let id = defaultId;
151
+ let align = justify;
152
+ let sort;
153
+ let linkSort;
154
+ let nodes2 = defaultNodes;
155
+ let links2 = defaultLinks;
156
+ let iterations = 6;
157
+ function sankey() {
158
+ const graph = { nodes: nodes2.apply(null, arguments), links: links2.apply(null, arguments) };
159
+ computeNodeLinks(graph);
160
+ computeNodeValues(graph);
161
+ computeNodeDepths(graph);
162
+ computeNodeHeights(graph);
163
+ computeNodeBreadths(graph);
164
+ computeLinkBreadths(graph);
165
+ return graph;
166
+ }
167
+ sankey.update = function(graph) {
168
+ computeLinkBreadths(graph);
169
+ return graph;
170
+ };
171
+ sankey.nodeId = function(_) {
172
+ return arguments.length ? (id = typeof _ === "function" ? _ : constant(_), sankey) : id;
173
+ };
174
+ sankey.nodeAlign = function(_) {
175
+ return arguments.length ? (align = typeof _ === "function" ? _ : constant(_), sankey) : align;
176
+ };
177
+ sankey.nodeSort = function(_) {
178
+ return arguments.length ? (sort = _, sankey) : sort;
179
+ };
180
+ sankey.nodeWidth = function(_) {
181
+ return arguments.length ? (dx = +_, sankey) : dx;
182
+ };
183
+ sankey.nodePadding = function(_) {
184
+ return arguments.length ? (dy = py = +_, sankey) : dy;
185
+ };
186
+ sankey.nodes = function(_) {
187
+ return arguments.length ? (nodes2 = typeof _ === "function" ? _ : constant(_), sankey) : nodes2;
188
+ };
189
+ sankey.links = function(_) {
190
+ return arguments.length ? (links2 = typeof _ === "function" ? _ : constant(_), sankey) : links2;
191
+ };
192
+ sankey.linkSort = function(_) {
193
+ return arguments.length ? (linkSort = _, sankey) : linkSort;
194
+ };
195
+ sankey.size = function(_) {
196
+ return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];
197
+ };
198
+ sankey.extent = function(_) {
199
+ return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];
200
+ };
201
+ sankey.iterations = function(_) {
202
+ return arguments.length ? (iterations = +_, sankey) : iterations;
203
+ };
204
+ function computeNodeLinks({ nodes: nodes3, links: links3 }) {
205
+ for (const [i, node] of nodes3.entries()) {
206
+ node.index = i;
207
+ node.sourceLinks = [];
208
+ node.targetLinks = [];
209
+ }
210
+ const nodeById = new Map(nodes3.map((d, i) => [id(d, i, nodes3), d]));
211
+ for (const [i, link2] of links3.entries()) {
212
+ link2.index = i;
213
+ let { source, target } = link2;
214
+ if (typeof source !== "object")
215
+ source = link2.source = find(nodeById, source);
216
+ if (typeof target !== "object")
217
+ target = link2.target = find(nodeById, target);
218
+ source.sourceLinks.push(link2);
219
+ target.targetLinks.push(link2);
220
+ }
221
+ if (linkSort != null) {
222
+ for (const { sourceLinks, targetLinks } of nodes3) {
223
+ sourceLinks.sort(linkSort);
224
+ targetLinks.sort(linkSort);
225
+ }
226
+ }
227
+ }
228
+ function computeNodeValues({ nodes: nodes3 }) {
229
+ for (const node of nodes3) {
230
+ node.value = node.fixedValue === void 0 ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value)) : node.fixedValue;
231
+ }
232
+ }
233
+ function computeNodeDepths({ nodes: nodes3 }) {
234
+ const n = nodes3.length;
235
+ let current = new Set(nodes3);
236
+ let next = /* @__PURE__ */ new Set();
237
+ let x2 = 0;
238
+ while (current.size) {
239
+ for (const node of current) {
240
+ node.depth = x2;
241
+ for (const { target } of node.sourceLinks) {
242
+ next.add(target);
243
+ }
244
+ }
245
+ if (++x2 > n)
246
+ throw new Error("circular link");
247
+ current = next;
248
+ next = /* @__PURE__ */ new Set();
249
+ }
250
+ }
251
+ function computeNodeHeights({ nodes: nodes3 }) {
252
+ const n = nodes3.length;
253
+ let current = new Set(nodes3);
254
+ let next = /* @__PURE__ */ new Set();
255
+ let x2 = 0;
256
+ while (current.size) {
257
+ for (const node of current) {
258
+ node.height = x2;
259
+ for (const { source } of node.targetLinks) {
260
+ next.add(source);
261
+ }
262
+ }
263
+ if (++x2 > n)
264
+ throw new Error("circular link");
265
+ current = next;
266
+ next = /* @__PURE__ */ new Set();
267
+ }
268
+ }
269
+ function computeNodeLayers({ nodes: nodes3 }) {
270
+ const x2 = max(nodes3, (d) => d.depth) + 1;
271
+ const kx = (x1 - x0 - dx) / (x2 - 1);
272
+ const columns = new Array(x2);
273
+ for (const node of nodes3) {
274
+ const i = Math.max(0, Math.min(x2 - 1, Math.floor(align.call(null, node, x2))));
275
+ node.layer = i;
276
+ node.x0 = x0 + i * kx;
277
+ node.x1 = node.x0 + dx;
278
+ if (columns[i])
279
+ columns[i].push(node);
280
+ else
281
+ columns[i] = [node];
282
+ }
283
+ if (sort)
284
+ for (const column of columns) {
285
+ column.sort(sort);
286
+ }
287
+ return columns;
288
+ }
289
+ function initializeNodeBreadths(columns) {
290
+ const ky = min(columns, (c) => (y1 - y0 - (c.length - 1) * py) / sum(c, value));
291
+ for (const nodes3 of columns) {
292
+ let y2 = y0;
293
+ for (const node of nodes3) {
294
+ node.y0 = y2;
295
+ node.y1 = y2 + node.value * ky;
296
+ y2 = node.y1 + py;
297
+ for (const link2 of node.sourceLinks) {
298
+ link2.width = link2.value * ky;
299
+ }
300
+ }
301
+ y2 = (y1 - y2 + py) / (nodes3.length + 1);
302
+ for (let i = 0; i < nodes3.length; ++i) {
303
+ const node = nodes3[i];
304
+ node.y0 += y2 * (i + 1);
305
+ node.y1 += y2 * (i + 1);
306
+ }
307
+ reorderLinks(nodes3);
308
+ }
309
+ }
310
+ function computeNodeBreadths(graph) {
311
+ const columns = computeNodeLayers(graph);
312
+ py = Math.min(dy, (y1 - y0) / (max(columns, (c) => c.length) - 1));
313
+ initializeNodeBreadths(columns);
314
+ for (let i = 0; i < iterations; ++i) {
315
+ const alpha = Math.pow(0.99, i);
316
+ const beta = Math.max(1 - alpha, (i + 1) / iterations);
317
+ relaxRightToLeft(columns, alpha, beta);
318
+ relaxLeftToRight(columns, alpha, beta);
319
+ }
320
+ }
321
+ function relaxLeftToRight(columns, alpha, beta) {
322
+ for (let i = 1, n = columns.length; i < n; ++i) {
323
+ const column = columns[i];
324
+ for (const target of column) {
325
+ let y2 = 0;
326
+ let w = 0;
327
+ for (const { source, value: value2 } of target.targetLinks) {
328
+ let v = value2 * (target.layer - source.layer);
329
+ y2 += targetTop(source, target) * v;
330
+ w += v;
331
+ }
332
+ if (!(w > 0))
333
+ continue;
334
+ let dy2 = (y2 / w - target.y0) * alpha;
335
+ target.y0 += dy2;
336
+ target.y1 += dy2;
337
+ reorderNodeLinks(target);
338
+ }
339
+ if (sort === void 0)
340
+ column.sort(ascendingBreadth);
341
+ resolveCollisions(column, beta);
342
+ }
343
+ }
344
+ function relaxRightToLeft(columns, alpha, beta) {
345
+ for (let n = columns.length, i = n - 2; i >= 0; --i) {
346
+ const column = columns[i];
347
+ for (const source of column) {
348
+ let y2 = 0;
349
+ let w = 0;
350
+ for (const { target, value: value2 } of source.sourceLinks) {
351
+ let v = value2 * (target.layer - source.layer);
352
+ y2 += sourceTop(source, target) * v;
353
+ w += v;
354
+ }
355
+ if (!(w > 0))
356
+ continue;
357
+ let dy2 = (y2 / w - source.y0) * alpha;
358
+ source.y0 += dy2;
359
+ source.y1 += dy2;
360
+ reorderNodeLinks(source);
361
+ }
362
+ if (sort === void 0)
363
+ column.sort(ascendingBreadth);
364
+ resolveCollisions(column, beta);
365
+ }
366
+ }
367
+ function resolveCollisions(nodes3, alpha) {
368
+ const i = nodes3.length >> 1;
369
+ const subject = nodes3[i];
370
+ resolveCollisionsBottomToTop(nodes3, subject.y0 - py, i - 1, alpha);
371
+ resolveCollisionsTopToBottom(nodes3, subject.y1 + py, i + 1, alpha);
372
+ resolveCollisionsBottomToTop(nodes3, y1, nodes3.length - 1, alpha);
373
+ resolveCollisionsTopToBottom(nodes3, y0, 0, alpha);
374
+ }
375
+ function resolveCollisionsTopToBottom(nodes3, y2, i, alpha) {
376
+ for (; i < nodes3.length; ++i) {
377
+ const node = nodes3[i];
378
+ const dy2 = (y2 - node.y0) * alpha;
379
+ if (dy2 > 1e-6)
380
+ node.y0 += dy2, node.y1 += dy2;
381
+ y2 = node.y1 + py;
382
+ }
383
+ }
384
+ function resolveCollisionsBottomToTop(nodes3, y2, i, alpha) {
385
+ for (; i >= 0; --i) {
386
+ const node = nodes3[i];
387
+ const dy2 = (node.y1 - y2) * alpha;
388
+ if (dy2 > 1e-6)
389
+ node.y0 -= dy2, node.y1 -= dy2;
390
+ y2 = node.y0 - py;
391
+ }
392
+ }
393
+ function reorderNodeLinks({ sourceLinks, targetLinks }) {
394
+ if (linkSort === void 0) {
395
+ for (const { source: { sourceLinks: sourceLinks2 } } of targetLinks) {
396
+ sourceLinks2.sort(ascendingTargetBreadth);
397
+ }
398
+ for (const { target: { targetLinks: targetLinks2 } } of sourceLinks) {
399
+ targetLinks2.sort(ascendingSourceBreadth);
400
+ }
401
+ }
402
+ }
403
+ function reorderLinks(nodes3) {
404
+ if (linkSort === void 0) {
405
+ for (const { sourceLinks, targetLinks } of nodes3) {
406
+ sourceLinks.sort(ascendingTargetBreadth);
407
+ targetLinks.sort(ascendingSourceBreadth);
408
+ }
409
+ }
410
+ }
411
+ function targetTop(source, target) {
412
+ let y2 = source.y0 - (source.sourceLinks.length - 1) * py / 2;
413
+ for (const { target: node, width } of source.sourceLinks) {
414
+ if (node === target)
415
+ break;
416
+ y2 += width + py;
417
+ }
418
+ for (const { source: node, width } of target.targetLinks) {
419
+ if (node === source)
420
+ break;
421
+ y2 -= width;
422
+ }
423
+ return y2;
424
+ }
425
+ function sourceTop(source, target) {
426
+ let y2 = target.y0 - (target.targetLinks.length - 1) * py / 2;
427
+ for (const { source: node, width } of target.targetLinks) {
428
+ if (node === source)
429
+ break;
430
+ y2 += width + py;
431
+ }
432
+ for (const { target: node, width } of source.sourceLinks) {
433
+ if (node === target)
434
+ break;
435
+ y2 -= width;
436
+ }
437
+ return y2;
438
+ }
439
+ return sankey;
440
+ }
441
+
442
+ // node_modules/d3-sankey/node_modules/d3-path/src/path.js
443
+ var pi = Math.PI;
444
+ var tau = 2 * pi;
445
+ var epsilon = 1e-6;
446
+ var tauEpsilon = tau - epsilon;
447
+ function Path() {
448
+ this._x0 = this._y0 = // start of current subpath
449
+ this._x1 = this._y1 = null;
450
+ this._ = "";
451
+ }
452
+ function path() {
453
+ return new Path();
454
+ }
455
+ Path.prototype = path.prototype = {
456
+ constructor: Path,
457
+ moveTo: function(x2, y2) {
458
+ this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2);
459
+ },
460
+ closePath: function() {
461
+ if (this._x1 !== null) {
462
+ this._x1 = this._x0, this._y1 = this._y0;
463
+ this._ += "Z";
464
+ }
465
+ },
466
+ lineTo: function(x2, y2) {
467
+ this._ += "L" + (this._x1 = +x2) + "," + (this._y1 = +y2);
468
+ },
469
+ quadraticCurveTo: function(x1, y1, x2, y2) {
470
+ this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x2) + "," + (this._y1 = +y2);
471
+ },
472
+ bezierCurveTo: function(x1, y1, x2, y2, x3, y3) {
473
+ this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x3) + "," + (this._y1 = +y3);
474
+ },
475
+ arcTo: function(x1, y1, x2, y2, r) {
476
+ x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
477
+ var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
478
+ if (r < 0)
479
+ throw new Error("negative radius: " + r);
480
+ if (this._x1 === null) {
481
+ this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
482
+ } else if (!(l01_2 > epsilon))
483
+ ;
484
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
485
+ this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
486
+ } else {
487
+ var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
488
+ if (Math.abs(t01 - 1) > epsilon) {
489
+ this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
490
+ }
491
+ this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
492
+ }
493
+ },
494
+ arc: function(x2, y2, r, a0, a1, ccw) {
495
+ x2 = +x2, y2 = +y2, r = +r, ccw = !!ccw;
496
+ var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
497
+ if (r < 0)
498
+ throw new Error("negative radius: " + r);
499
+ if (this._x1 === null) {
500
+ this._ += "M" + x0 + "," + y0;
501
+ } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
502
+ this._ += "L" + x0 + "," + y0;
503
+ }
504
+ if (!r)
505
+ return;
506
+ if (da < 0)
507
+ da = da % tau + tau;
508
+ if (da > tauEpsilon) {
509
+ this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x2 - dx) + "," + (y2 - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
510
+ } else if (da > epsilon) {
511
+ this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x2 + r * Math.cos(a1)) + "," + (this._y1 = y2 + r * Math.sin(a1));
512
+ }
513
+ },
514
+ rect: function(x2, y2, w, h) {
515
+ this._ += "M" + (this._x0 = this._x1 = +x2) + "," + (this._y0 = this._y1 = +y2) + "h" + +w + "v" + +h + "h" + -w + "Z";
516
+ },
517
+ toString: function() {
518
+ return this._;
519
+ }
520
+ };
521
+ var path_default = path;
522
+
523
+ // node_modules/d3-sankey/node_modules/d3-shape/src/constant.js
524
+ function constant_default(x2) {
525
+ return function constant2() {
526
+ return x2;
527
+ };
528
+ }
529
+
530
+ // node_modules/d3-sankey/node_modules/d3-shape/src/point.js
531
+ function x(p) {
532
+ return p[0];
533
+ }
534
+ function y(p) {
535
+ return p[1];
536
+ }
537
+
538
+ // node_modules/d3-sankey/node_modules/d3-shape/src/array.js
539
+ var slice = Array.prototype.slice;
540
+
541
+ // node_modules/d3-sankey/node_modules/d3-shape/src/link/index.js
542
+ function linkSource(d) {
543
+ return d.source;
544
+ }
545
+ function linkTarget(d) {
546
+ return d.target;
547
+ }
548
+ function link(curve) {
549
+ var source = linkSource, target = linkTarget, x2 = x, y2 = y, context = null;
550
+ function link2() {
551
+ var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
552
+ if (!context)
553
+ context = buffer = path_default();
554
+ curve(context, +x2.apply(this, (argv[0] = s, argv)), +y2.apply(this, argv), +x2.apply(this, (argv[0] = t, argv)), +y2.apply(this, argv));
555
+ if (buffer)
556
+ return context = null, buffer + "" || null;
557
+ }
558
+ link2.source = function(_) {
559
+ return arguments.length ? (source = _, link2) : source;
560
+ };
561
+ link2.target = function(_) {
562
+ return arguments.length ? (target = _, link2) : target;
563
+ };
564
+ link2.x = function(_) {
565
+ return arguments.length ? (x2 = typeof _ === "function" ? _ : constant_default(+_), link2) : x2;
566
+ };
567
+ link2.y = function(_) {
568
+ return arguments.length ? (y2 = typeof _ === "function" ? _ : constant_default(+_), link2) : y2;
569
+ };
570
+ link2.context = function(_) {
571
+ return arguments.length ? (context = _ == null ? null : _, link2) : context;
572
+ };
573
+ return link2;
574
+ }
575
+ function curveHorizontal(context, x0, y0, x1, y1) {
576
+ context.moveTo(x0, y0);
577
+ context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
578
+ }
579
+ function linkHorizontal() {
580
+ return link(curveHorizontal);
581
+ }
582
+
583
+ // node_modules/d3-sankey/src/sankeyLinkHorizontal.js
584
+ function horizontalSource(d) {
585
+ return [d.source.x1, d.y0];
586
+ }
587
+ function horizontalTarget(d) {
588
+ return [d.target.x0, d.y1];
589
+ }
590
+ function sankeyLinkHorizontal_default() {
591
+ return linkHorizontal().source(horizontalSource).target(horizontalTarget);
592
+ }
593
+
594
+ // node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-Y46BX6SQ.mjs
595
+ var parser = function() {
596
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
597
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
598
+ ;
599
+ return o2;
600
+ }, "o"), $V0 = [1, 9], $V1 = [1, 10], $V2 = [1, 5, 10, 12];
601
+ var parser2 = {
602
+ trace: /* @__PURE__ */ __name(function trace() {
603
+ }, "trace"),
604
+ yy: {},
605
+ 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 },
606
+ 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" },
607
+ productions_: [0, [3, 4], [6, 2], [9, 2], [9, 0], [7, 1], [7, 0], [8, 5], [15, 1], [15, 1], [16, 3], [17, 1]],
608
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
609
+ var $0 = $$.length - 1;
610
+ switch (yystate) {
611
+ case 7:
612
+ const source = yy.findOrCreateNode($$[$0 - 4].trim().replaceAll('""', '"'));
613
+ const target = yy.findOrCreateNode($$[$0 - 2].trim().replaceAll('""', '"'));
614
+ const value2 = parseFloat($$[$0].trim());
615
+ yy.addLink(source, target, value2);
616
+ break;
617
+ case 8:
618
+ case 9:
619
+ case 11:
620
+ this.$ = $$[$0];
621
+ break;
622
+ case 10:
623
+ this.$ = $$[$0 - 1];
624
+ break;
625
+ }
626
+ }, "anonymous"),
627
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, { 5: [1, 3] }, { 6: 4, 8: 5, 15: 6, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 1: [2, 6], 7: 11, 10: [1, 12] }, o($V1, [2, 4], { 9: 13, 5: [1, 14] }), { 12: [1, 15] }, o($V2, [2, 8]), o($V2, [2, 9]), { 19: [1, 16] }, o($V2, [2, 11]), { 1: [2, 1] }, { 1: [2, 5] }, o($V1, [2, 2]), { 6: 17, 8: 5, 15: 6, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 15: 18, 16: 7, 17: 8, 18: $V0, 20: $V1 }, { 18: [1, 19] }, o($V1, [2, 3]), { 12: [1, 20] }, o($V2, [2, 10]), { 15: 21, 16: 7, 17: 8, 18: $V0, 20: $V1 }, o([1, 5, 10], [2, 7])],
628
+ defaultActions: { 11: [2, 1], 12: [2, 5] },
629
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
630
+ if (hash.recoverable) {
631
+ this.trace(str);
632
+ } else {
633
+ var error = new Error(str);
634
+ error.hash = hash;
635
+ throw error;
636
+ }
637
+ }, "parseError"),
638
+ parse: /* @__PURE__ */ __name(function parse(input) {
639
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
640
+ var args = lstack.slice.call(arguments, 1);
641
+ var lexer2 = Object.create(this.lexer);
642
+ var sharedState = { yy: {} };
643
+ for (var k in this.yy) {
644
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
645
+ sharedState.yy[k] = this.yy[k];
646
+ }
647
+ }
648
+ lexer2.setInput(input, sharedState.yy);
649
+ sharedState.yy.lexer = lexer2;
650
+ sharedState.yy.parser = this;
651
+ if (typeof lexer2.yylloc == "undefined") {
652
+ lexer2.yylloc = {};
653
+ }
654
+ var yyloc = lexer2.yylloc;
655
+ lstack.push(yyloc);
656
+ var ranges = lexer2.options && lexer2.options.ranges;
657
+ if (typeof sharedState.yy.parseError === "function") {
658
+ this.parseError = sharedState.yy.parseError;
659
+ } else {
660
+ this.parseError = Object.getPrototypeOf(this).parseError;
661
+ }
662
+ function popStack(n) {
663
+ stack.length = stack.length - 2 * n;
664
+ vstack.length = vstack.length - n;
665
+ lstack.length = lstack.length - n;
666
+ }
667
+ __name(popStack, "popStack");
668
+ function lex() {
669
+ var token;
670
+ token = tstack.pop() || lexer2.lex() || EOF;
671
+ if (typeof token !== "number") {
672
+ if (token instanceof Array) {
673
+ tstack = token;
674
+ token = tstack.pop();
675
+ }
676
+ token = self.symbols_[token] || token;
677
+ }
678
+ return token;
679
+ }
680
+ __name(lex, "lex");
681
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
682
+ while (true) {
683
+ state = stack[stack.length - 1];
684
+ if (this.defaultActions[state]) {
685
+ action = this.defaultActions[state];
686
+ } else {
687
+ if (symbol === null || typeof symbol == "undefined") {
688
+ symbol = lex();
689
+ }
690
+ action = table[state] && table[state][symbol];
691
+ }
692
+ if (typeof action === "undefined" || !action.length || !action[0]) {
693
+ var errStr = "";
694
+ expected = [];
695
+ for (p in table[state]) {
696
+ if (this.terminals_[p] && p > TERROR) {
697
+ expected.push("'" + this.terminals_[p] + "'");
698
+ }
699
+ }
700
+ if (lexer2.showPosition) {
701
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
702
+ } else {
703
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
704
+ }
705
+ this.parseError(errStr, {
706
+ text: lexer2.match,
707
+ token: this.terminals_[symbol] || symbol,
708
+ line: lexer2.yylineno,
709
+ loc: yyloc,
710
+ expected
711
+ });
712
+ }
713
+ if (action[0] instanceof Array && action.length > 1) {
714
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
715
+ }
716
+ switch (action[0]) {
717
+ case 1:
718
+ stack.push(symbol);
719
+ vstack.push(lexer2.yytext);
720
+ lstack.push(lexer2.yylloc);
721
+ stack.push(action[1]);
722
+ symbol = null;
723
+ if (!preErrorSymbol) {
724
+ yyleng = lexer2.yyleng;
725
+ yytext = lexer2.yytext;
726
+ yylineno = lexer2.yylineno;
727
+ yyloc = lexer2.yylloc;
728
+ if (recovering > 0) {
729
+ recovering--;
730
+ }
731
+ } else {
732
+ symbol = preErrorSymbol;
733
+ preErrorSymbol = null;
734
+ }
735
+ break;
736
+ case 2:
737
+ len = this.productions_[action[1]][1];
738
+ yyval.$ = vstack[vstack.length - len];
739
+ yyval._$ = {
740
+ first_line: lstack[lstack.length - (len || 1)].first_line,
741
+ last_line: lstack[lstack.length - 1].last_line,
742
+ first_column: lstack[lstack.length - (len || 1)].first_column,
743
+ last_column: lstack[lstack.length - 1].last_column
744
+ };
745
+ if (ranges) {
746
+ yyval._$.range = [
747
+ lstack[lstack.length - (len || 1)].range[0],
748
+ lstack[lstack.length - 1].range[1]
749
+ ];
750
+ }
751
+ r = this.performAction.apply(yyval, [
752
+ yytext,
753
+ yyleng,
754
+ yylineno,
755
+ sharedState.yy,
756
+ action[1],
757
+ vstack,
758
+ lstack
759
+ ].concat(args));
760
+ if (typeof r !== "undefined") {
761
+ return r;
762
+ }
763
+ if (len) {
764
+ stack = stack.slice(0, -1 * len * 2);
765
+ vstack = vstack.slice(0, -1 * len);
766
+ lstack = lstack.slice(0, -1 * len);
767
+ }
768
+ stack.push(this.productions_[action[1]][0]);
769
+ vstack.push(yyval.$);
770
+ lstack.push(yyval._$);
771
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
772
+ stack.push(newState);
773
+ break;
774
+ case 3:
775
+ return true;
776
+ }
777
+ }
778
+ return true;
779
+ }, "parse")
780
+ };
781
+ var lexer = /* @__PURE__ */ function() {
782
+ var lexer2 = {
783
+ EOF: 1,
784
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
785
+ if (this.yy.parser) {
786
+ this.yy.parser.parseError(str, hash);
787
+ } else {
788
+ throw new Error(str);
789
+ }
790
+ }, "parseError"),
791
+ // resets the lexer, sets new input
792
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
793
+ this.yy = yy || this.yy || {};
794
+ this._input = input;
795
+ this._more = this._backtrack = this.done = false;
796
+ this.yylineno = this.yyleng = 0;
797
+ this.yytext = this.matched = this.match = "";
798
+ this.conditionStack = ["INITIAL"];
799
+ this.yylloc = {
800
+ first_line: 1,
801
+ first_column: 0,
802
+ last_line: 1,
803
+ last_column: 0
804
+ };
805
+ if (this.options.ranges) {
806
+ this.yylloc.range = [0, 0];
807
+ }
808
+ this.offset = 0;
809
+ return this;
810
+ }, "setInput"),
811
+ // consumes and returns one char from the input
812
+ input: /* @__PURE__ */ __name(function() {
813
+ var ch = this._input[0];
814
+ this.yytext += ch;
815
+ this.yyleng++;
816
+ this.offset++;
817
+ this.match += ch;
818
+ this.matched += ch;
819
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
820
+ if (lines) {
821
+ this.yylineno++;
822
+ this.yylloc.last_line++;
823
+ } else {
824
+ this.yylloc.last_column++;
825
+ }
826
+ if (this.options.ranges) {
827
+ this.yylloc.range[1]++;
828
+ }
829
+ this._input = this._input.slice(1);
830
+ return ch;
831
+ }, "input"),
832
+ // unshifts one char (or a string) into the input
833
+ unput: /* @__PURE__ */ __name(function(ch) {
834
+ var len = ch.length;
835
+ var lines = ch.split(/(?:\r\n?|\n)/g);
836
+ this._input = ch + this._input;
837
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
838
+ this.offset -= len;
839
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
840
+ this.match = this.match.substr(0, this.match.length - 1);
841
+ this.matched = this.matched.substr(0, this.matched.length - 1);
842
+ if (lines.length - 1) {
843
+ this.yylineno -= lines.length - 1;
844
+ }
845
+ var r = this.yylloc.range;
846
+ this.yylloc = {
847
+ first_line: this.yylloc.first_line,
848
+ last_line: this.yylineno + 1,
849
+ first_column: this.yylloc.first_column,
850
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
851
+ };
852
+ if (this.options.ranges) {
853
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
854
+ }
855
+ this.yyleng = this.yytext.length;
856
+ return this;
857
+ }, "unput"),
858
+ // When called from action, caches matched text and appends it on next action
859
+ more: /* @__PURE__ */ __name(function() {
860
+ this._more = true;
861
+ return this;
862
+ }, "more"),
863
+ // 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.
864
+ reject: /* @__PURE__ */ __name(function() {
865
+ if (this.options.backtrack_lexer) {
866
+ this._backtrack = true;
867
+ } else {
868
+ 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(), {
869
+ text: "",
870
+ token: null,
871
+ line: this.yylineno
872
+ });
873
+ }
874
+ return this;
875
+ }, "reject"),
876
+ // retain first n characters of the match
877
+ less: /* @__PURE__ */ __name(function(n) {
878
+ this.unput(this.match.slice(n));
879
+ }, "less"),
880
+ // displays already matched input, i.e. for error messages
881
+ pastInput: /* @__PURE__ */ __name(function() {
882
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
883
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
884
+ }, "pastInput"),
885
+ // displays upcoming input, i.e. for error messages
886
+ upcomingInput: /* @__PURE__ */ __name(function() {
887
+ var next = this.match;
888
+ if (next.length < 20) {
889
+ next += this._input.substr(0, 20 - next.length);
890
+ }
891
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
892
+ }, "upcomingInput"),
893
+ // displays the character position where the lexing error occurred, i.e. for error messages
894
+ showPosition: /* @__PURE__ */ __name(function() {
895
+ var pre = this.pastInput();
896
+ var c = new Array(pre.length + 1).join("-");
897
+ return pre + this.upcomingInput() + "\n" + c + "^";
898
+ }, "showPosition"),
899
+ // test the lexed token: return FALSE when not a match, otherwise return token
900
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
901
+ var token, lines, backup;
902
+ if (this.options.backtrack_lexer) {
903
+ backup = {
904
+ yylineno: this.yylineno,
905
+ yylloc: {
906
+ first_line: this.yylloc.first_line,
907
+ last_line: this.last_line,
908
+ first_column: this.yylloc.first_column,
909
+ last_column: this.yylloc.last_column
910
+ },
911
+ yytext: this.yytext,
912
+ match: this.match,
913
+ matches: this.matches,
914
+ matched: this.matched,
915
+ yyleng: this.yyleng,
916
+ offset: this.offset,
917
+ _more: this._more,
918
+ _input: this._input,
919
+ yy: this.yy,
920
+ conditionStack: this.conditionStack.slice(0),
921
+ done: this.done
922
+ };
923
+ if (this.options.ranges) {
924
+ backup.yylloc.range = this.yylloc.range.slice(0);
925
+ }
926
+ }
927
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
928
+ if (lines) {
929
+ this.yylineno += lines.length;
930
+ }
931
+ this.yylloc = {
932
+ first_line: this.yylloc.last_line,
933
+ last_line: this.yylineno + 1,
934
+ first_column: this.yylloc.last_column,
935
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
936
+ };
937
+ this.yytext += match[0];
938
+ this.match += match[0];
939
+ this.matches = match;
940
+ this.yyleng = this.yytext.length;
941
+ if (this.options.ranges) {
942
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
943
+ }
944
+ this._more = false;
945
+ this._backtrack = false;
946
+ this._input = this._input.slice(match[0].length);
947
+ this.matched += match[0];
948
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
949
+ if (this.done && this._input) {
950
+ this.done = false;
951
+ }
952
+ if (token) {
953
+ return token;
954
+ } else if (this._backtrack) {
955
+ for (var k in backup) {
956
+ this[k] = backup[k];
957
+ }
958
+ return false;
959
+ }
960
+ return false;
961
+ }, "test_match"),
962
+ // return next match in input
963
+ next: /* @__PURE__ */ __name(function() {
964
+ if (this.done) {
965
+ return this.EOF;
966
+ }
967
+ if (!this._input) {
968
+ this.done = true;
969
+ }
970
+ var token, match, tempMatch, index;
971
+ if (!this._more) {
972
+ this.yytext = "";
973
+ this.match = "";
974
+ }
975
+ var rules = this._currentRules();
976
+ for (var i = 0; i < rules.length; i++) {
977
+ tempMatch = this._input.match(this.rules[rules[i]]);
978
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
979
+ match = tempMatch;
980
+ index = i;
981
+ if (this.options.backtrack_lexer) {
982
+ token = this.test_match(tempMatch, rules[i]);
983
+ if (token !== false) {
984
+ return token;
985
+ } else if (this._backtrack) {
986
+ match = false;
987
+ continue;
988
+ } else {
989
+ return false;
990
+ }
991
+ } else if (!this.options.flex) {
992
+ break;
993
+ }
994
+ }
995
+ }
996
+ if (match) {
997
+ token = this.test_match(match, rules[index]);
998
+ if (token !== false) {
999
+ return token;
1000
+ }
1001
+ return false;
1002
+ }
1003
+ if (this._input === "") {
1004
+ return this.EOF;
1005
+ } else {
1006
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
1007
+ text: "",
1008
+ token: null,
1009
+ line: this.yylineno
1010
+ });
1011
+ }
1012
+ }, "next"),
1013
+ // return next match that has a token
1014
+ lex: /* @__PURE__ */ __name(function lex() {
1015
+ var r = this.next();
1016
+ if (r) {
1017
+ return r;
1018
+ } else {
1019
+ return this.lex();
1020
+ }
1021
+ }, "lex"),
1022
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1023
+ begin: /* @__PURE__ */ __name(function begin(condition) {
1024
+ this.conditionStack.push(condition);
1025
+ }, "begin"),
1026
+ // pop the previously active lexer condition state off the condition stack
1027
+ popState: /* @__PURE__ */ __name(function popState() {
1028
+ var n = this.conditionStack.length - 1;
1029
+ if (n > 0) {
1030
+ return this.conditionStack.pop();
1031
+ } else {
1032
+ return this.conditionStack[0];
1033
+ }
1034
+ }, "popState"),
1035
+ // produce the lexer rule set which is active for the currently active lexer condition state
1036
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
1037
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1038
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1039
+ } else {
1040
+ return this.conditions["INITIAL"].rules;
1041
+ }
1042
+ }, "_currentRules"),
1043
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1044
+ topState: /* @__PURE__ */ __name(function topState(n) {
1045
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1046
+ if (n >= 0) {
1047
+ return this.conditionStack[n];
1048
+ } else {
1049
+ return "INITIAL";
1050
+ }
1051
+ }, "topState"),
1052
+ // alias for begin(condition)
1053
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
1054
+ this.begin(condition);
1055
+ }, "pushState"),
1056
+ // return the number of states currently on the stack
1057
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
1058
+ return this.conditionStack.length;
1059
+ }, "stateStackSize"),
1060
+ options: { "case-insensitive": true },
1061
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1062
+ var YYSTATE = YY_START;
1063
+ switch ($avoiding_name_collisions) {
1064
+ case 0:
1065
+ this.pushState("csv");
1066
+ return 4;
1067
+ break;
1068
+ case 1:
1069
+ return 10;
1070
+ break;
1071
+ case 2:
1072
+ return 5;
1073
+ break;
1074
+ case 3:
1075
+ return 12;
1076
+ break;
1077
+ case 4:
1078
+ this.pushState("escaped_text");
1079
+ return 18;
1080
+ break;
1081
+ case 5:
1082
+ return 20;
1083
+ break;
1084
+ case 6:
1085
+ this.popState("escaped_text");
1086
+ return 18;
1087
+ break;
1088
+ case 7:
1089
+ return 19;
1090
+ break;
1091
+ }
1092
+ }, "anonymous"),
1093
+ 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],
1094
+ conditions: { "csv": { "rules": [1, 2, 3, 4, 5, 6, 7], "inclusive": false }, "escaped_text": { "rules": [6, 7], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7], "inclusive": true } }
1095
+ };
1096
+ return lexer2;
1097
+ }();
1098
+ parser2.lexer = lexer;
1099
+ function Parser() {
1100
+ this.yy = {};
1101
+ }
1102
+ __name(Parser, "Parser");
1103
+ Parser.prototype = parser2;
1104
+ parser2.Parser = Parser;
1105
+ return new Parser();
1106
+ }();
1107
+ parser.parser = parser;
1108
+ var sankey_default = parser;
1109
+ var links = [];
1110
+ var nodes = [];
1111
+ var nodesMap = /* @__PURE__ */ new Map();
1112
+ var clear2 = /* @__PURE__ */ __name(() => {
1113
+ links = [];
1114
+ nodes = [];
1115
+ nodesMap = /* @__PURE__ */ new Map();
1116
+ clear();
1117
+ }, "clear");
1118
+ var SankeyLink = class {
1119
+ constructor(source, target, value2 = 0) {
1120
+ this.source = source;
1121
+ this.target = target;
1122
+ this.value = value2;
1123
+ }
1124
+ static {
1125
+ __name(this, "SankeyLink");
1126
+ }
1127
+ };
1128
+ var addLink = /* @__PURE__ */ __name((source, target, value2) => {
1129
+ links.push(new SankeyLink(source, target, value2));
1130
+ }, "addLink");
1131
+ var SankeyNode = class {
1132
+ constructor(ID) {
1133
+ this.ID = ID;
1134
+ }
1135
+ static {
1136
+ __name(this, "SankeyNode");
1137
+ }
1138
+ };
1139
+ var findOrCreateNode = /* @__PURE__ */ __name((ID) => {
1140
+ ID = common_default.sanitizeText(ID, getConfig2());
1141
+ let node = nodesMap.get(ID);
1142
+ if (node === void 0) {
1143
+ node = new SankeyNode(ID);
1144
+ nodesMap.set(ID, node);
1145
+ nodes.push(node);
1146
+ }
1147
+ return node;
1148
+ }, "findOrCreateNode");
1149
+ var getNodes = /* @__PURE__ */ __name(() => nodes, "getNodes");
1150
+ var getLinks = /* @__PURE__ */ __name(() => links, "getLinks");
1151
+ var getGraph = /* @__PURE__ */ __name(() => ({
1152
+ nodes: nodes.map((node) => ({ id: node.ID })),
1153
+ links: links.map((link2) => ({
1154
+ source: link2.source.ID,
1155
+ target: link2.target.ID,
1156
+ value: link2.value
1157
+ }))
1158
+ }), "getGraph");
1159
+ var sankeyDB_default = {
1160
+ nodesMap,
1161
+ getConfig: /* @__PURE__ */ __name(() => getConfig2().sankey, "getConfig"),
1162
+ getNodes,
1163
+ getLinks,
1164
+ getGraph,
1165
+ addLink,
1166
+ findOrCreateNode,
1167
+ getAccTitle,
1168
+ setAccTitle,
1169
+ getAccDescription,
1170
+ setAccDescription,
1171
+ getDiagramTitle,
1172
+ setDiagramTitle,
1173
+ clear: clear2
1174
+ };
1175
+ var Uid = class _Uid {
1176
+ static {
1177
+ __name(this, "Uid");
1178
+ }
1179
+ static {
1180
+ this.count = 0;
1181
+ }
1182
+ static next(name) {
1183
+ return new _Uid(name + ++_Uid.count);
1184
+ }
1185
+ constructor(id) {
1186
+ this.id = id;
1187
+ this.href = `#${id}`;
1188
+ }
1189
+ toString() {
1190
+ return "url(" + this.href + ")";
1191
+ }
1192
+ };
1193
+ var alignmentsMap = {
1194
+ left,
1195
+ right,
1196
+ center,
1197
+ justify
1198
+ };
1199
+ var draw = /* @__PURE__ */ __name(function(text, id, _version, diagObj) {
1200
+ const { securityLevel, sankey: conf } = getConfig2();
1201
+ const defaultSankeyConfig = defaultConfig2.sankey;
1202
+ let sandboxElement;
1203
+ if (securityLevel === "sandbox") {
1204
+ sandboxElement = select_default("#i" + id);
1205
+ }
1206
+ const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
1207
+ const svg = securityLevel === "sandbox" ? root.select(`[id="${id}"]`) : select_default(`[id="${id}"]`);
1208
+ const width = conf?.width ?? defaultSankeyConfig.width;
1209
+ const height = conf?.height ?? defaultSankeyConfig.width;
1210
+ const useMaxWidth = conf?.useMaxWidth ?? defaultSankeyConfig.useMaxWidth;
1211
+ const nodeAlignment = conf?.nodeAlignment ?? defaultSankeyConfig.nodeAlignment;
1212
+ const prefix = conf?.prefix ?? defaultSankeyConfig.prefix;
1213
+ const suffix = conf?.suffix ?? defaultSankeyConfig.suffix;
1214
+ const showValues = conf?.showValues ?? defaultSankeyConfig.showValues;
1215
+ const graph = diagObj.db.getGraph();
1216
+ const nodeAlign = alignmentsMap[nodeAlignment];
1217
+ const nodeWidth = 10;
1218
+ const sankey = Sankey().nodeId((d) => d.id).nodeWidth(nodeWidth).nodePadding(10 + (showValues ? 15 : 0)).nodeAlign(nodeAlign).extent([
1219
+ [0, 0],
1220
+ [width, height]
1221
+ ]);
1222
+ sankey(graph);
1223
+ const colorScheme = ordinal(Tableau10_default);
1224
+ svg.append("g").attr("class", "nodes").selectAll(".node").data(graph.nodes).join("g").attr("class", "node").attr("id", (d) => (d.uid = Uid.next("node-")).id).attr("transform", function(d) {
1225
+ return "translate(" + d.x0 + "," + d.y0 + ")";
1226
+ }).attr("x", (d) => d.x0).attr("y", (d) => d.y0).append("rect").attr("height", (d) => {
1227
+ return d.y1 - d.y0;
1228
+ }).attr("width", (d) => d.x1 - d.x0).attr("fill", (d) => colorScheme(d.id));
1229
+ const getText = /* @__PURE__ */ __name(({ id: id2, value: value2 }) => {
1230
+ if (!showValues) {
1231
+ return id2;
1232
+ }
1233
+ return `${id2}
1234
+ ${prefix}${Math.round(value2 * 100) / 100}${suffix}`;
1235
+ }, "getText");
1236
+ svg.append("g").attr("class", "node-labels").attr("font-family", "sans-serif").attr("font-size", 14).selectAll("text").data(graph.nodes).join("text").attr("x", (d) => d.x0 < width / 2 ? d.x1 + 6 : d.x0 - 6).attr("y", (d) => (d.y1 + d.y0) / 2).attr("dy", `${showValues ? "0" : "0.35"}em`).attr("text-anchor", (d) => d.x0 < width / 2 ? "start" : "end").text(getText);
1237
+ const link2 = svg.append("g").attr("class", "links").attr("fill", "none").attr("stroke-opacity", 0.5).selectAll(".link").data(graph.links).join("g").attr("class", "link").style("mix-blend-mode", "multiply");
1238
+ const linkColor = conf?.linkColor ?? "gradient";
1239
+ if (linkColor === "gradient") {
1240
+ const gradient = link2.append("linearGradient").attr("id", (d) => (d.uid = Uid.next("linearGradient-")).id).attr("gradientUnits", "userSpaceOnUse").attr("x1", (d) => d.source.x1).attr("x2", (d) => d.target.x0);
1241
+ gradient.append("stop").attr("offset", "0%").attr("stop-color", (d) => colorScheme(d.source.id));
1242
+ gradient.append("stop").attr("offset", "100%").attr("stop-color", (d) => colorScheme(d.target.id));
1243
+ }
1244
+ let coloring;
1245
+ switch (linkColor) {
1246
+ case "gradient":
1247
+ coloring = /* @__PURE__ */ __name((d) => d.uid, "coloring");
1248
+ break;
1249
+ case "source":
1250
+ coloring = /* @__PURE__ */ __name((d) => colorScheme(d.source.id), "coloring");
1251
+ break;
1252
+ case "target":
1253
+ coloring = /* @__PURE__ */ __name((d) => colorScheme(d.target.id), "coloring");
1254
+ break;
1255
+ default:
1256
+ coloring = linkColor;
1257
+ }
1258
+ link2.append("path").attr("d", sankeyLinkHorizontal_default()).attr("stroke", coloring).attr("stroke-width", (d) => Math.max(1, d.width));
1259
+ setupGraphViewbox(void 0, svg, 0, useMaxWidth);
1260
+ }, "draw");
1261
+ var sankeyRenderer_default = {
1262
+ draw
1263
+ };
1264
+ var prepareTextForParsing = /* @__PURE__ */ __name((text) => {
1265
+ const textToParse = text.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g, "").replaceAll(/([\n\r])+/g, "\n").trim();
1266
+ return textToParse;
1267
+ }, "prepareTextForParsing");
1268
+ var originalParse = sankey_default.parse.bind(sankey_default);
1269
+ sankey_default.parse = (text) => originalParse(prepareTextForParsing(text));
1270
+ var diagram = {
1271
+ parser: sankey_default,
1272
+ db: sankeyDB_default,
1273
+ renderer: sankeyRenderer_default
1274
+ };
1275
+ export {
1276
+ diagram
1277
+ };
1278
+ //# sourceMappingURL=sankeyDiagram-Y46BX6SQ-5RKUGG63.js.map