@adyen/lume 1.12.4 → 1.14.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 (46) hide show
  1. package/README.md +1 -1
  2. package/dist/@types/components/charts/lume-alluvial-diagram/defaults.d.ts.map +1 -1
  3. package/dist/@types/components/groups/lume-alluvial-group/components/lume-alluvial-node-header/lume-alluvial-node-header.vue.d.ts +13 -1
  4. package/dist/@types/components/groups/lume-alluvial-group/components/lume-alluvial-node-header/lume-alluvial-node-header.vue.d.ts.map +1 -1
  5. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-expandable-nodes.d.ts +46 -0
  6. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-expandable-nodes.d.ts.map +1 -0
  7. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-graph.d.ts +2 -0
  8. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-graph.d.ts.map +1 -1
  9. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-hover.d.ts +22 -0
  10. package/dist/@types/components/groups/lume-alluvial-group/composables/alluvial-hover.d.ts.map +1 -1
  11. package/dist/@types/components/groups/lume-alluvial-group/constants.d.ts +2 -0
  12. package/dist/@types/components/groups/lume-alluvial-group/constants.d.ts.map +1 -1
  13. package/dist/@types/components/groups/lume-alluvial-group/helpers.d.ts +20 -2
  14. package/dist/@types/components/groups/lume-alluvial-group/helpers.d.ts.map +1 -1
  15. package/dist/@types/components/groups/lume-alluvial-group/lume-alluvial-group.vue.d.ts +12 -1
  16. package/dist/@types/components/groups/lume-alluvial-group/lume-alluvial-group.vue.d.ts.map +1 -1
  17. package/dist/@types/docs/storybook-data/alluvial-data.d.ts +11 -0
  18. package/dist/@types/docs/storybook-data/alluvial-data.d.ts.map +1 -1
  19. package/dist/@types/types/alluvial.d.ts +6 -0
  20. package/dist/@types/types/alluvial.d.ts.map +1 -1
  21. package/dist/@types/types/events.d.ts +1 -1
  22. package/dist/@types/types/events.d.ts.map +1 -1
  23. package/dist/@types/types/options.d.ts +3 -1
  24. package/dist/@types/types/options.d.ts.map +1 -1
  25. package/dist/common/BvvJadxi.js +3470 -0
  26. package/dist/common/BvvJadxi.js.map +1 -0
  27. package/dist/common/DHB3p6kw.js +5 -0
  28. package/dist/common/DHB3p6kw.js.map +1 -0
  29. package/dist/common/DWtV4D8X.js +5 -0
  30. package/dist/common/DWtV4D8X.js.map +1 -0
  31. package/dist/common/DiDq9ch9.js +5 -0
  32. package/dist/common/DiDq9ch9.js.map +1 -0
  33. package/dist/index.js +1 -1
  34. package/dist/plugin.js +1 -1
  35. package/dist/scss/components/lume-alluvial-group.scss +34 -1
  36. package/dist/scss/main.scss +5 -5
  37. package/dist/styles/main.css +1 -1
  38. package/package.json +3 -3
  39. package/dist/common/Bf3mzdra.js +0 -5
  40. package/dist/common/Bf3mzdra.js.map +0 -1
  41. package/dist/common/D07hdVCr.js +0 -3125
  42. package/dist/common/D07hdVCr.js.map +0 -1
  43. package/dist/common/D3x45w3A.js +0 -5
  44. package/dist/common/D3x45w3A.js.map +0 -1
  45. package/dist/common/D5uNnipU.js +0 -5
  46. package/dist/common/D5uNnipU.js.map +0 -1
@@ -0,0 +1,3470 @@
1
+ import { defineComponent as P, ref as I, isRef as It, computed as f, watch as H, toRefs as j, inject as $e, reactive as we, onMounted as re, watchEffect as Nt, onBeforeUnmount as Et, useSlots as Z, nextTick as Ce, provide as Pe, defineAsyncComponent as Re } from "vue";
2
+ import { sankeyLinkHorizontal as Jt, sankey as Qt, sankeyJustify as qt } from "d3-sankey";
3
+ import { format as en, ticks as tn, scaleLinear as be, scaleBand as ke, link as nn, line as rn, area as an } from "d3";
4
+ import { createPopper as on } from "@popperjs/core";
5
+ const un = /* @__PURE__ */ P({
6
+ __name: "lume-tick",
7
+ props: {
8
+ value: {
9
+ type: [String, Number],
10
+ required: !0
11
+ },
12
+ group: {
13
+ type: Object,
14
+ required: !0
15
+ },
16
+ ghost: {
17
+ type: Object,
18
+ required: !0
19
+ },
20
+ label: {
21
+ type: Object,
22
+ required: !0
23
+ },
24
+ gridline: {
25
+ type: Object,
26
+ required: !0
27
+ },
28
+ isHovered: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ isHidden: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ withGridlines: {
37
+ type: Boolean,
38
+ default: !0
39
+ }
40
+ },
41
+ emits: ["click", "mouseenter"],
42
+ setup(t, { expose: e, emit: r }) {
43
+ const n = I(null);
44
+ return e({ ref: n }), { __sfc: !0, emit: r, labelRef: n };
45
+ }
46
+ });
47
+ function S(t, e, r, n, a, o, u, i) {
48
+ var l = typeof t == "function" ? t.options : t;
49
+ return e && (l.render = e, l.staticRenderFns = r, l._compiled = !0), o && (l._scopeId = "data-v-" + o), {
50
+ exports: t,
51
+ options: l
52
+ };
53
+ }
54
+ var ln = function() {
55
+ var e = this, r = e._self._c, n = e._self._setupProxy;
56
+ return r("g", e._b({ staticClass: "axis__tick", class: {
57
+ "axis__tick--hovered": e.isHovered,
58
+ "axis__tick--hidden": e.isHidden
59
+ }, attrs: { "data-j-axis__tick": "" }, on: { mouseenter: function(a) {
60
+ return n.emit("mouseenter", a);
61
+ }, click: function(a) {
62
+ return n.emit("click", a);
63
+ } } }, "g", e.group, !1), [r("g", { staticClass: "axis__tick-label lume-typography--axis", attrs: { "pointer-events": "all", "data-j-axis__tick-label": "" } }, [r("rect", e._b({ staticClass: "axis__ghost", attrs: { fill: "url(#lume-tick-gradient)" } }, "rect", e.ghost, !1)), r("text", e._b({ ref: "labelRef", staticClass: "axis__label" }, "text", e.label, !1), [e._v(" " + e._s(e.value) + " ")])]), e.withGridlines ? r("line", e._b({ staticClass: "axis__grid-line" }, "line", e.gridline, !1)) : e._e()]);
64
+ }, sn = [], cn = /* @__PURE__ */ S(
65
+ un,
66
+ ln,
67
+ sn,
68
+ !1,
69
+ null,
70
+ "59ddc0a6"
71
+ );
72
+ const dn = cn.exports, vn = [
73
+ "controls",
74
+ "legend",
75
+ "axes",
76
+ "groups",
77
+ "tooltip",
78
+ "tooltip-content"
79
+ ];
80
+ function $t() {
81
+ return process.env.NODE_ENV === "production";
82
+ }
83
+ function wt(t) {
84
+ return (t == null ? void 0 : t.map(
85
+ (e) => e.values.map((r) => r == null ? void 0 : r.value).flat()
86
+ ).flat()) || [];
87
+ }
88
+ function Ke(t) {
89
+ return t.length === 1;
90
+ }
91
+ function fn(t) {
92
+ return !!t && t.every(
93
+ (e) => "color" in e
94
+ );
95
+ }
96
+ function Be(t) {
97
+ return !!t && typeof t == "object" && !Array.isArray(t);
98
+ }
99
+ function Dt(t, e) {
100
+ const r = { ...t };
101
+ return Object.entries(e).forEach(([n, a]) => {
102
+ r[n] = Be(t[n]) && Be(a) ? Dt(t[n], a) : a;
103
+ }), r;
104
+ }
105
+ function pn(t) {
106
+ return t != null && Be(t) && "value" in t;
107
+ }
108
+ function K(t) {
109
+ return (t == null ? void 0 : t.bandwidth) !== void 0;
110
+ }
111
+ function mn(t) {
112
+ return K(t) ? t.step() : Math.max(...t.range()) / Math.max(...t.domain());
113
+ }
114
+ function _n(t) {
115
+ const [e, r] = t.domain();
116
+ return e == null || r == null || e === 0 && r === 0;
117
+ }
118
+ const gn = (t, e) => {
119
+ if (!t)
120
+ throw new Error("Data is not a valid array");
121
+ if (t.length === 0)
122
+ throw new Error("Cannot get highest value from empty array");
123
+ t.some(
124
+ ({ values: n }) => n.length - 1 >= e
125
+ ) || ne(J.IndexExceedsLengthOfDataSets);
126
+ };
127
+ function hn(t, e) {
128
+ var r;
129
+ return gn(t, e), ((r = t.reduce(
130
+ (n, a) => {
131
+ var o, u;
132
+ return (((o = n.values[e]) == null ? void 0 : o.value) ?? 0) > (((u = a.values[e]) == null ? void 0 : u.value) ?? 0) ? n : a;
133
+ }
134
+ ).values[e]) == null ? void 0 : r.value) || 0;
135
+ }
136
+ function Ht(t) {
137
+ const e = It(t) ? t.value : t;
138
+ if (!e)
139
+ throw new Error("No empty array can be created from specified data value");
140
+ const r = Math.max(
141
+ ...e.map((n) => n.values.length),
142
+ 0
143
+ );
144
+ return Array(r).fill(null);
145
+ }
146
+ function yn(t) {
147
+ return K(t) ? t.domain().length : Math.max(...t.domain());
148
+ }
149
+ function bn(t, e) {
150
+ return (r) => Math.round(t * (1 - r) + e * r);
151
+ }
152
+ function kn(t, e, r) {
153
+ const n = e, a = t.slice(0, n);
154
+ return t.slice(n).concat(a);
155
+ }
156
+ function se(t) {
157
+ if (t.groups) {
158
+ const e = Object.keys(t);
159
+ return Object.assign(
160
+ {},
161
+ ...e.map((r) => r !== "groups" ? { [r]: t[r] } : {})
162
+ );
163
+ }
164
+ return t;
165
+ }
166
+ function xn(t) {
167
+ return Object.assign(
168
+ {},
169
+ ...Object.keys(t).map(
170
+ (e) => vn.includes(e) ? {} : { [e]: t[e] }
171
+ )
172
+ );
173
+ }
174
+ function Je(t, e) {
175
+ const r = e - t.length;
176
+ return r > 0 ? [...t, ...Array(r).fill({ value: null })] : t;
177
+ }
178
+ var J = /* @__PURE__ */ ((t) => (t.DatasetLength = `Our guidelines highly recommend not having more than 5 datasets in one chart.
179
+ Learn more: https://lume.design/guidelines/datasets`, t.ColorLoop = "Colors will loop around after the 5th dataset. You can prevent this by setting specific colors for your datasets.", t.Empty = "The dataset(s) provided are empty.", t.InvalidFormat = "The string provided to format is invalid. Please refer to https://github.com/d3/d3-format for valid arguments.", t.NotContainedInSvg = "This component is an `SVGElement`, thus it is required to be inside an `<svg>` container.", t.InvalidHoveredIndex = "The provided hovered index is not valid for the data of this chart.", t.InvalidHoveredElement = "The provided hovered element is not valid for the data of this diagram.", t.IndexExceedsLengthOfDataSets = "Index exceeds length of all of the datasets", t))(J || {});
180
+ const Ln = "[lume] ";
181
+ function ne(t, e = !0) {
182
+ e && $t() || console.warn(Ln + "Warning: " + t);
183
+ }
184
+ const Ne = (t) => {
185
+ let e = null;
186
+ switch (typeof t) {
187
+ case "string":
188
+ try {
189
+ e = en(t);
190
+ } catch {
191
+ ne(J.InvalidFormat), e = null;
192
+ }
193
+ break;
194
+ case "function":
195
+ e = t;
196
+ break;
197
+ default:
198
+ e = null;
199
+ }
200
+ function r(...n) {
201
+ return e ? e(...n) : n[0];
202
+ }
203
+ return r;
204
+ }, xe = () => ({
205
+ options: {
206
+ type: Object,
207
+ default: () => ({})
208
+ }
209
+ });
210
+ function Q(t, e) {
211
+ return { allOptions: f(() => {
212
+ const n = It(e) ? e == null ? void 0 : e.value : e;
213
+ return n ? Dt(n, t.value) : t.value;
214
+ }) };
215
+ }
216
+ const An = 0.2;
217
+ function Tn(t, e, r) {
218
+ const n = I(), a = f(() => Math.max(...t.value.range())), o = f(() => e.value.length);
219
+ function u() {
220
+ if (!e.value) return;
221
+ const l = e.value.reduce(
222
+ (s, v) => s + v.ref.getBoundingClientRect().width,
223
+ 0
224
+ ), c = Math.ceil(l / o.value);
225
+ n.value = c + c * An;
226
+ }
227
+ function i(l) {
228
+ if (!e.value) return !0;
229
+ const c = r.value.skip, s = e.value.length;
230
+ if (l === 0) return !0;
231
+ const v = a.value / s, m = typeof c == "number" && c > 0 && c + 1 || Math.ceil(n.value / v);
232
+ return l % m === 0;
233
+ }
234
+ return H(e, u), { showTick: i };
235
+ }
236
+ const O = {
237
+ HORIZONTAL: "horizontal",
238
+ VERTICAL: "vertical"
239
+ }, On = {
240
+ SINGLE: "single",
241
+ GROUPED: "grouped",
242
+ STACKED: "stacked"
243
+ }, St = "No data", it = 20, Pt = 0.33, Rt = 0.5, Ct = 12, Le = 8, In = 1, Nn = [
244
+ "auto",
245
+ "auto-start",
246
+ "auto-end",
247
+ "top",
248
+ "top-start",
249
+ "top-end",
250
+ "right",
251
+ "right-start",
252
+ "right-end",
253
+ "bottom",
254
+ "bottom-start",
255
+ "bottom-end",
256
+ "left",
257
+ "left-start",
258
+ "left-end"
259
+ ];
260
+ function De(t) {
261
+ t != null && t.closest("svg") || ne(J.NotContainedInSvg);
262
+ }
263
+ const Bt = {
264
+ /** Displays a line for each tick. */
265
+ gridLines: !1,
266
+ /** Displays the axis title. */
267
+ withTitle: !0,
268
+ //
269
+ //// Tick settings
270
+ //
271
+ /** Controls if the tick labels should be displayed. */
272
+ showTicks: !0,
273
+ /** Amount of ticks to display in the axis. */
274
+ tickCount: 10,
275
+ /** Formatting string/function for the tick label. */
276
+ tickFormat: null,
277
+ /** Space between the tick label and the axis line. */
278
+ tickPadding: 12
279
+ }, En = {
280
+ ...Bt,
281
+ withTitle: !1,
282
+ skip: !0
283
+ }, $n = {
284
+ ...Bt,
285
+ gridLines: !0
286
+ }, wn = function(t, e, r) {
287
+ const n = f(() => t.value.step() * t.value.paddingInner() / 2);
288
+ function a(l, c) {
289
+ return {
290
+ transform: `translate(${(t.value(c) ?? t.value(l)) - n.value}, 0)`
291
+ };
292
+ }
293
+ function o(l) {
294
+ var s;
295
+ const c = Math.max(
296
+ t.value.step(),
297
+ (l ? (s = l.getComputedTextLength) == null ? void 0 : s.call(l) : t.value.step()) + 20
298
+ );
299
+ return {
300
+ x: -(c - t.value.step()) / 2,
301
+ width: c,
302
+ height: r.value.tickPadding + Ct + Le
303
+ };
304
+ }
305
+ function u() {
306
+ const l = t.value.step() / 2;
307
+ return {
308
+ x1: l,
309
+ x2: l,
310
+ y1: -e.value.height
311
+ // Negative height means it goes from bottom to top
312
+ };
313
+ }
314
+ function i() {
315
+ return {
316
+ x: t.value.step() / 2,
317
+ y: r.value.tickPadding,
318
+ dy: "0.8em",
319
+ "text-anchor": "middle"
320
+ };
321
+ }
322
+ return {
323
+ getGridLinesAttributes: u,
324
+ getTickGhostAttributes: o,
325
+ getTickGroupAttributes: a,
326
+ getTickLabelAttributes: i
327
+ };
328
+ }, Dn = function(t, e, r) {
329
+ const n = f(() => t.value.step() * t.value.paddingInner() / 2);
330
+ function a(l, c) {
331
+ return {
332
+ transform: `translate(0, ${(t.value(c) ?? t.value(l)) - n.value})`
333
+ };
334
+ }
335
+ function o(l) {
336
+ var s;
337
+ const c = (l ? (s = l.getComputedTextLength) == null ? void 0 : s.call(l) : 42) + r.value.tickPadding + Le;
338
+ return {
339
+ x: -c,
340
+ width: c,
341
+ height: t.value.step()
342
+ };
343
+ }
344
+ function u() {
345
+ const l = t.value.step() / 2;
346
+ return {
347
+ y1: l,
348
+ y2: l,
349
+ x1: e.value.width
350
+ };
351
+ }
352
+ function i() {
353
+ return {
354
+ x: -r.value.tickPadding,
355
+ y: t.value.step() / 2,
356
+ "text-anchor": "end",
357
+ "alignment-baseline": "middle"
358
+ };
359
+ }
360
+ return {
361
+ getGridLinesAttributes: u,
362
+ getTickGhostAttributes: o,
363
+ getTickGroupAttributes: a,
364
+ getTickLabelAttributes: i
365
+ };
366
+ }, Hn = function(t, e, r) {
367
+ const n = f(() => {
368
+ const l = t.value.ticks();
369
+ return l.length > 1 ? t.value(l[1]) - t.value(l[0]) : 0;
370
+ });
371
+ function a(l) {
372
+ return {
373
+ transform: `translate(${t.value(l)}, 0)`
374
+ };
375
+ }
376
+ function o() {
377
+ return {
378
+ height: r.value.tickPadding + Ct + Le,
379
+ width: n.value,
380
+ x: -(n.value / 2)
381
+ };
382
+ }
383
+ function u() {
384
+ return {
385
+ y1: -e.value.height
386
+ };
387
+ }
388
+ function i() {
389
+ return {
390
+ y: r.value.tickPadding,
391
+ dy: "0.8em",
392
+ "text-anchor": "middle"
393
+ };
394
+ }
395
+ return {
396
+ getGridLinesAttributes: u,
397
+ getTickGhostAttributes: o,
398
+ getTickGroupAttributes: a,
399
+ getTickLabelAttributes: i
400
+ };
401
+ }, Sn = function(t, e, r) {
402
+ const n = f(() => {
403
+ const l = t.value.ticks();
404
+ return l.length > 1 ? t.value(l[1]) - t.value(l[0]) : 0;
405
+ });
406
+ function a(l) {
407
+ return {
408
+ transform: `translate(0, ${t.value(l)})`
409
+ };
410
+ }
411
+ function o(l) {
412
+ var s;
413
+ const c = (((s = l == null ? void 0 : l.getComputedTextLength) == null ? void 0 : s.call(l)) || 0) + r.value.tickPadding + Le;
414
+ return {
415
+ width: c,
416
+ height: n.value,
417
+ x: -c,
418
+ y: -(n.value / 2)
419
+ };
420
+ }
421
+ function u() {
422
+ return {
423
+ x1: e.value.width
424
+ };
425
+ }
426
+ function i() {
427
+ return {
428
+ x: -r.value.tickPadding,
429
+ dy: "0.4em",
430
+ "text-anchor": "end"
431
+ };
432
+ }
433
+ return {
434
+ getGridLinesAttributes: u,
435
+ getTickGhostAttributes: o,
436
+ getTickGroupAttributes: a,
437
+ getTickLabelAttributes: i
438
+ };
439
+ }, Pn = {
440
+ "x-band-scale-axis": wn,
441
+ "y-band-scale-axis": Dn,
442
+ "x-linear-scale-axis": Hn,
443
+ "y-linear-scale-axis": Sn
444
+ };
445
+ var Fe = /* @__PURE__ */ ((t) => (t.bandScale = "band-scale-axis", t.linearScale = "linear-scale-axis", t))(Fe || {}), Ge = /* @__PURE__ */ ((t) => (t.left = "left", t.bottom = "bottom", t))(Ge || {}), Ie = /* @__PURE__ */ ((t) => (t.x = "bottom", t.y = "left", t))(Ie || {});
446
+ const Rn = /* @__PURE__ */ P({
447
+ __name: "lume-axis",
448
+ props: {
449
+ scale: {
450
+ type: Function,
451
+ default: null
452
+ },
453
+ type: {
454
+ type: String,
455
+ default: void 0,
456
+ validator: (t) => t in Ie
457
+ },
458
+ position: {
459
+ type: String,
460
+ default: void 0,
461
+ validator: (t) => t in Ge
462
+ },
463
+ containerSize: {
464
+ type: Object,
465
+ default: () => ({ width: 0, height: 0 })
466
+ },
467
+ hoveredIndex: {
468
+ type: Number,
469
+ default: -1
470
+ },
471
+ orientation: {
472
+ type: String,
473
+ default: O.VERTICAL
474
+ },
475
+ ...xe()
476
+ },
477
+ emits: ["mouseenter", "click", "mouseleave", "lume__internal--axis-size"],
478
+ setup(t, { emit: e }) {
479
+ const r = t, n = 16, { scale: a, containerSize: o, hoveredIndex: u, options: i, orientation: l } = j(r), c = $e("isEmpty", I(!1)), s = we({}), v = I(null), m = I(null), h = I(null), g = f(
480
+ () => r.type ? Ie[r.type] : r.position
481
+ ), _ = f(
482
+ () => r.type || (g.value === "left" ? "y" : "x")
483
+ ), x = f(
484
+ () => _.value === "x" && l.value === O.VERTICAL || _.value === "y" && l.value === O.HORIZONTAL
485
+ ), { allOptions: d } = Q(
486
+ i,
487
+ _.value === "x" ? En : $n
488
+ ), { showTick: p } = Tn(a, v, d), y = f(
489
+ () => c.value || !a.value || _n(a.value)
490
+ ), b = f(() => {
491
+ var E, w, C, te;
492
+ return _.value === "y" && y.value ? `translate(0, ${((E = o.value) == null ? void 0 : E.height) / 2})` : _.value === "x" && y.value ? `translate(-${((w = o.value) == null ? void 0 : w.width) / 2}, ${(C = o.value) == null ? void 0 : C.height})` : `translate(0, ${_.value === "x" ? (te = o.value) == null ? void 0 : te.height : 0})`;
493
+ }), A = f(() => {
494
+ if (!a.value) return [];
495
+ if (K(a.value))
496
+ return a.value.labels || a.value.domain();
497
+ const { tickCount: E } = d.value, [w, C] = a.value.domain();
498
+ return tn(w, C, E);
499
+ }), N = f(() => {
500
+ const { tickFormat: E } = d.value;
501
+ return Ne(E);
502
+ }), T = f(
503
+ () => d.value.withHover && x.value && u.value > -1
504
+ ), $ = f(
505
+ () => d.value.tickPadding + Le || n
506
+ ), R = f(() => _.value === "x" ? (
507
+ // If x axis, get the tick height
508
+ Math.max(
509
+ ...(v.value || []).map(
510
+ (E) => {
511
+ var w, C;
512
+ return ((C = (w = E.ref).getBBox) == null ? void 0 : C.call(w).height) + $.value;
513
+ }
514
+ )
515
+ )
516
+ ) : (
517
+ // If y axis, get the tick width
518
+ Math.max(
519
+ ...(v.value || []).map(
520
+ (E) => {
521
+ var w, C;
522
+ return ((C = (w = E.ref).getBBox) == null ? void 0 : C.call(w).width) + $.value;
523
+ }
524
+ )
525
+ )
526
+ ));
527
+ function G(E) {
528
+ const { showTicks: w } = d.value;
529
+ return w === !1 ? "" : N.value(E);
530
+ }
531
+ function V(E, w, C) {
532
+ e("mouseenter", { index: x.value ? E : null, value: w, event: C });
533
+ }
534
+ function ee(E, w, C) {
535
+ e("click", { index: E, value: w, event: C });
536
+ }
537
+ function ce(E) {
538
+ var w;
539
+ if (!(!v.value || !v.value.length))
540
+ return (w = v.value[E]) == null ? void 0 : w.ref;
541
+ }
542
+ function ae() {
543
+ h.value = A.value.map(
544
+ (E, w) => ({
545
+ value: G(E),
546
+ group: s.getTickGroupAttributes(E, w),
547
+ ghost: s.getTickGhostAttributes(ce(w)),
548
+ label: s.getTickLabelAttributes(),
549
+ gridline: s.getGridLinesAttributes()
550
+ })
551
+ );
552
+ }
553
+ function oe() {
554
+ h.value && h.value.map((E) => (E.gridline = s.getGridLinesAttributes(), E));
555
+ }
556
+ function ue() {
557
+ if (!a.value) return;
558
+ const E = a.value.step ? "bandScale" : "linearScale", w = Pn[`${_.value}-${Fe[E]}`];
559
+ Object.entries(w(a, o, d) || []).forEach(
560
+ ([C, te]) => {
561
+ s[C] = te;
562
+ }
563
+ );
564
+ }
565
+ return H(a, ue, { flush: "sync", immediate: !0 }), H(a, ae, { immediate: !0 }), H(v, ae), H(R, (E) => e("lume__internal--axis-size", E)), H(r.containerSize, oe), re(() => De(m.value)), { __sfc: !0, SCALE_MIXIN_MAP: Fe, POSITIONS: Ge, TYPES: Ie, AXIS_LABEL_OFFSET: n, props: r, emit: e, scale: a, containerSize: o, hoveredIndex: u, options: i, orientation: l, isEmpty: c, mixins: s, tickRefs: v, root: m, ticksWithAttributes: h, computedPosition: g, computedType: _, shouldHover: x, allOptions: d, showTick: p, alignAxisBaseline: y, axisTransform: b, ticks: A, tickFormatter: N, isHovering: T, axisLabelOffset: $, axisSize: R, formatTick: G, handleTickMouseenter: V, handleTickClick: ee, getTextNode: ce, setTicks: ae, updateGridlines: oe, init: ue, LumeTick: dn };
566
+ }
567
+ });
568
+ var Cn = function() {
569
+ var e = this, r = e._self._c, n = e._self._setupProxy;
570
+ return n.scale ? r("g", { ref: "root", staticClass: "axis", attrs: { transform: n.axisTransform, "data-j-axis": "" }, on: { mouseleave: function(a) {
571
+ return n.emit("mouseleave", a);
572
+ } } }, [n.computedType === "x" ? r("defs", [r("linearGradient", { attrs: { id: "lume-tick-gradient" } }, [r("stop", { attrs: { offset: "0%", "stop-color": "rgba(255,255,255,0)" } }), r("stop", { attrs: { offset: "10%", "stop-color": "var(--lume-chart-background-color)" } }), r("stop", { attrs: { offset: "90%", "stop-color": "var(--lume-chart-background-color)" } }), r("stop", { attrs: { offset: "100%", "stop-color": "rgba(255,255,255,0)" } })], 1)], 1) : e._e(), e._l(n.ticksWithAttributes, function(a, o) {
573
+ return r(n.LumeTick, e._b({ key: `${a.value}_${o}`, ref: "tickRefs", refInFor: !0, attrs: { "is-hidden": n.allOptions.skip && !n.showTick(o), "with-gridlines": n.allOptions.gridLines }, on: { mouseenter: function(u) {
574
+ return n.handleTickMouseenter(o, a.value, u);
575
+ }, click: function(u) {
576
+ return n.handleTickClick(o, a.value, u);
577
+ } } }, "lume-tick", a, !1));
578
+ }), n.isHovering ? r(n.LumeTick, e._b({ attrs: { "with-gridlines": !1, "is-hovered": "" }, on: { click: function(a) {
579
+ return n.handleTickClick(
580
+ n.hoveredIndex,
581
+ n.ticksWithAttributes[n.hoveredIndex].value,
582
+ a
583
+ );
584
+ } } }, "lume-tick", n.ticksWithAttributes[n.hoveredIndex], !1)) : e._e()], 2) : e._e();
585
+ }, Bn = [], Fn = /* @__PURE__ */ S(
586
+ Rn,
587
+ Cn,
588
+ Bn,
589
+ !1,
590
+ null,
591
+ null
592
+ );
593
+ const Gn = Fn.exports;
594
+ function jn(t, e, r, n) {
595
+ const a = f(() => r.value > 0 && r.value < 1), o = f(
596
+ () => n.value > 0 && n.value < 1
597
+ ), u = f(
598
+ () => a.value ? t.value - 0.5 : t.value
599
+ // draws the 1px bar closer to the axis
600
+ ), i = f(
601
+ () => o.value ? e.value - 0.5 : e.value
602
+ // draws the 1px bar closer to the axis
603
+ );
604
+ return { computedX: u, computedY: i, shouldHaveMinWidth: a, shouldHaveMinHeight: o };
605
+ }
606
+ function Vn(t, e, r, n) {
607
+ const a = I(0), o = I(0), u = f(() => `${t.value + r.value / 2}px ${e.value + n.value / 2}px`);
608
+ return re(() => {
609
+ a.value = r.value, o.value = n.value;
610
+ }), H(r, (i) => a.value = i), H(n, (i) => o.value = i), { computedWidth: a, computedHeight: o, transformOrigin: u };
611
+ }
612
+ const Mn = /* @__PURE__ */ P({
613
+ __name: "lume-bar",
614
+ props: {
615
+ x: {
616
+ type: Number,
617
+ default: 0
618
+ },
619
+ y: {
620
+ type: Number,
621
+ default: 0
622
+ },
623
+ width: {
624
+ type: Number,
625
+ required: !0
626
+ },
627
+ height: {
628
+ type: Number,
629
+ required: !0
630
+ },
631
+ classList: {
632
+ type: [String, Array],
633
+ default: ""
634
+ },
635
+ isFaded: {
636
+ type: Boolean,
637
+ default: !1
638
+ },
639
+ isNegative: {
640
+ type: Boolean,
641
+ default: !1
642
+ },
643
+ transition: {
644
+ type: [String, Boolean],
645
+ default: !1
646
+ }
647
+ },
648
+ emits: ["click", "mouseover", "mouseleave"],
649
+ setup(t, { emit: e }) {
650
+ const r = t, { x: n, y: a, width: o, height: u, transition: i, classList: l } = j(r), c = I(null), s = f(
651
+ () => typeof l.value == "string" ? [l.value] : l.value
652
+ ), v = f(() => i.value === "width"), m = f(() => i.value === "height"), h = Vn(n, a, o, u), { computedX: g, computedY: _, shouldHaveMinWidth: x, shouldHaveMinHeight: d } = jn(n, a, o, u), p = f(() => x.value ? 1 : (v.value ? h.computedWidth : o).value), y = f(() => d.value ? 1 : (m.value ? h.computedHeight : u).value), b = v.value || m.value ? h.transformOrigin : null;
653
+ return re(() => De(c.value)), { __sfc: !0, props: r, emit: e, x: n, y: a, width: o, height: u, transition: i, classList: l, root: c, computedClasses: s, shouldTransitionWidth: v, shouldTransitionHeight: m, transitionProps: h, computedX: g, computedY: _, shouldHaveMinWidth: x, shouldHaveMinHeight: d, computedWidth: p, computedHeight: y, transformOrigin: b };
654
+ }
655
+ });
656
+ var zn = function() {
657
+ var e = this, r = e._self._c, n = e._self._setupProxy;
658
+ return r("rect", { ref: "root", staticClass: "lume-bar", class: [
659
+ {
660
+ "lume-fill--faded": e.isFaded,
661
+ "lume-bar--negative": e.isNegative,
662
+ "lume-bar--transition-width": n.shouldTransitionWidth,
663
+ "lume-bar--transition-height": n.shouldTransitionHeight
664
+ },
665
+ ...n.computedClasses
666
+ ], style: { transformOrigin: n.transformOrigin }, attrs: { x: n.computedX, y: n.computedY, width: n.computedWidth, height: n.computedHeight, "data-j-bar": "" }, on: { click: function(a) {
667
+ return n.emit("click", a);
668
+ }, mouseover: function(a) {
669
+ return n.emit("mouseover", a);
670
+ }, mouseleave: function(a) {
671
+ return n.emit("mouseleave", a);
672
+ } } });
673
+ }, Wn = [], Un = /* @__PURE__ */ S(
674
+ Mn,
675
+ zn,
676
+ Wn,
677
+ !1,
678
+ null,
679
+ "8e8f732a"
680
+ );
681
+ const Qe = Un.exports;
682
+ var le = /* @__PURE__ */ ((t) => (t.Categorical = "categorical", t.Sequential = "sequential", t.Divergent = "divergent", t))(le || {}), X = /* @__PURE__ */ ((t) => (t.Skyblue = "skyblue", t.Royalblue = "royalblue", t.Violet = "violet", t.Darkteal = "darkteal", t.Gold = "gold", t))(X || {}), Ft = /* @__PURE__ */ ((t) => (t.Skyblue10 = "skyblue-10", t.Skyblue20 = "skyblue-20", t.Skyblue30 = "skyblue-30", t.Skyblue40 = "skyblue-40", t.Skyblue50 = "skyblue-50", t.Skyblue60 = "skyblue-60", t.Skyblue70 = "skyblue-70", t.Skyblue80 = "skyblue-80", t.Skyblue90 = "skyblue-90", t.Skyblue100 = "skyblue-100", t.Royalblue10 = "royalblue-10", t.Royalblue20 = "royalblue-20", t.Royalblue30 = "royalblue-30", t.Royalblue40 = "royalblue-40", t.Royalblue50 = "royalblue-50", t.Royalblue60 = "royalblue-60", t.Royalblue70 = "royalblue-70", t.Royalblue80 = "royalblue-80", t.Royalblue90 = "royalblue-90", t.Royalblue100 = "royalblue-100", t.Violet10 = "violet-10", t.Violet20 = "violet-20", t.Violet30 = "violet-30", t.Violet40 = "violet-40", t.Violet50 = "violet-50", t.Violet60 = "violet-60", t.Violet70 = "violet-70", t.Violet80 = "violet-80", t.Violet90 = "violet-90", t.Violet100 = "violet-100", t.Darkteal10 = "darkteal-10", t.Darkteal20 = "darkteal-20", t.Darkteal30 = "darkteal-30", t.Darkteal40 = "darkteal-40", t.Darkteal50 = "darkteal-50", t.Darkteal60 = "darkteal-60", t.Darkteal70 = "darkteal-70", t.Darkteal80 = "darkteal-80", t.Darkteal90 = "darkteal-90", t.Darkteal100 = "darkteal-100", t.Gold10 = "gold-10", t.Gold20 = "gold-20", t.Gold30 = "gold-30", t.Gold40 = "gold-40", t.Gold50 = "gold-50", t.Gold60 = "gold-60", t.Gold70 = "gold-70", t.Gold80 = "gold-80", t.Gold90 = "gold-90", t.Gold100 = "gold-100", t))(Ft || {}), qe = /* @__PURE__ */ ((t) => (t.SkyTeal = "skyblue-darkteal", t.VioletRoyal = "violet-royalblue", t.VioletTeal = "violet-darkteal", t.GoldTeal = "gold-darkteal", t.GoldRoyal = "gold-royalblue", t))(qe || {}), et = /* @__PURE__ */ ((t) => (t.White = "white", t.Black = "black", t.Green = "green", t.Orange = "orange", t.Red = "red", t.Grey = "grey", t.Grey10 = "grey-10", t.Grey20 = "grey-20", t.Grey30 = "grey-30", t.Grey40 = "grey-40", t.Grey50 = "grey-50", t.Grey60 = "grey-60", t.Grey70 = "grey-70", t.Grey80 = "grey-80", t.Grey90 = "grey-90", t.Grey100 = "grey-100", t))(et || {}), tt = /* @__PURE__ */ ((t) => (t["01"] = "01", t["02"] = "02", t["03"] = "03", t["04"] = "04", t["05"] = "05", t["06"] = "06", t["07"] = "07", t["08"] = "08", t["09"] = "09", t))(tt || {});
683
+ const Zn = le.Categorical, Ae = X.Skyblue, Xn = qe.SkyTeal;
684
+ function Yn(t) {
685
+ return t === le.Divergent ? Xn : Ae;
686
+ }
687
+ function Kn(t) {
688
+ return Object.values(tt).includes(t);
689
+ }
690
+ function st(t, e) {
691
+ return e === le.Divergent ? Object.values(qe).includes(t) : Object.values({
692
+ ...X,
693
+ ...Ft,
694
+ ...et,
695
+ ...tt
696
+ }).includes(t);
697
+ }
698
+ function Jn(t, e) {
699
+ const r = Object.values(X).indexOf(t);
700
+ return kn(Object.values(X), r > -1 ? r : 0)[e];
701
+ }
702
+ function Qn(t, e) {
703
+ const r = 50 + e * 10;
704
+ return `${t}-${r}`;
705
+ }
706
+ function qn(t, e) {
707
+ const r = (e + 1) * 10;
708
+ return `${t}-${r}`;
709
+ }
710
+ function ct(t, e, r) {
711
+ switch (e) {
712
+ default:
713
+ case le.Categorical:
714
+ return Kn(t) ? t : Jn(t, r);
715
+ case le.Sequential:
716
+ return Qn(t, r);
717
+ case le.Divergent:
718
+ return qn(t, r);
719
+ }
720
+ }
721
+ function er(t, e, r = Zn, n) {
722
+ return st(t, r) ? t : (n > 4 && (ne(J.ColorLoop), n = n % 5), st(e, r) ? ct(e, r, n) : ct(Yn(r), r, n));
723
+ }
724
+ function tr(t) {
725
+ return t.map((e) => pn(e) ? e : { value: e });
726
+ }
727
+ function nr(t) {
728
+ return t.__internal === !0;
729
+ }
730
+ const nt = (t = null) => ({
731
+ data: {
732
+ type: Array,
733
+ required: !0,
734
+ validator: t || void 0
735
+ },
736
+ labels: {
737
+ type: Array,
738
+ default: void 0
739
+ },
740
+ color: {
741
+ type: String,
742
+ default: X.Skyblue
743
+ },
744
+ title: {
745
+ type: String,
746
+ default: null
747
+ }
748
+ });
749
+ function rt(t, e, r, n, a) {
750
+ const o = we({
751
+ width: 0,
752
+ height: 0
753
+ }), u = crypto.randomUUID(), i = f(() => {
754
+ var s;
755
+ return t.value.length > 5 && ne(J.DatasetLength), (s = t.value) == null ? void 0 : s.map(
756
+ (v, m) => {
757
+ if (nr(v)) return v;
758
+ const h = tr(v.values), g = er(
759
+ v.color,
760
+ r == null ? void 0 : r.value,
761
+ n == null ? void 0 : n.value.colorPalette,
762
+ m
763
+ );
764
+ return {
765
+ ...v,
766
+ values: h,
767
+ color: g,
768
+ __internal: !0
769
+ };
770
+ }
771
+ );
772
+ }), l = f(() => Array.isArray(e.value) ? e.value : Ht(t.value).map((s, v) => v));
773
+ function c(s) {
774
+ const v = (a == null ? void 0 : a.value) === O.HORIZONTAL && l.value.length * (((n == null ? void 0 : n.value.barHeight) || it) * 2) + ((n == null ? void 0 : n.value.barHeight) || it) || s.height;
775
+ o.width = s.width, o.height = v;
776
+ }
777
+ return {
778
+ chartID: u,
779
+ computedLabels: l,
780
+ containerSize: o,
781
+ internalData: i,
782
+ updateSize: c
783
+ };
784
+ }
785
+ const rr = () => ({
786
+ xScale: {
787
+ type: Function,
788
+ default: null
789
+ },
790
+ yScale: {
791
+ type: Function,
792
+ default: null
793
+ }
794
+ });
795
+ function ar(t, e, r, n, a) {
796
+ const o = I(null), u = I(null);
797
+ function i() {
798
+ var s, v, m, h;
799
+ const { width: l, height: c } = r;
800
+ !l && !c || (n.value === O.HORIZONTAL ? (o.value = (s = t.value) != null && s.length ? vt(
801
+ t.value,
802
+ l,
803
+ n.value,
804
+ a.value.startOnZero
805
+ ) : null, u.value = (v = e.value) != null && v.length ? dt(
806
+ e.value,
807
+ c,
808
+ n.value,
809
+ a.value
810
+ ) : null) : (o.value = (m = e.value) != null && m.length ? dt(
811
+ e.value,
812
+ l,
813
+ n.value,
814
+ a.value
815
+ ) : null, u.value = (h = t.value) != null && h.length ? vt(
816
+ t.value,
817
+ c,
818
+ n.value,
819
+ a.value.startOnZero
820
+ ) : null));
821
+ }
822
+ return Nt(i), { xScale: o, yScale: u };
823
+ }
824
+ function dt(t, e, r, n) {
825
+ const a = [0, e], { padding: o, paddingInner: u, paddingOuter: i } = n, l = o ?? (r === O.HORIZONTAL ? Rt : Pt);
826
+ return Object.assign(
827
+ ke().range(a).paddingInner(u ?? l).paddingOuter(i ?? l).domain(t.map((c, s) => s)),
828
+ { labels: t }
829
+ );
830
+ }
831
+ function vt(t, e, r, n) {
832
+ const a = wt(t).filter((s) => s != null), o = [0, e];
833
+ if (a.length === 0)
834
+ return be().range(o).domain([0, 0]).nice();
835
+ const u = Math.min(...a), i = n && u > 0 ? 0 : u;
836
+ let l = Math.max(...a);
837
+ n && l < 0 && (l = 0);
838
+ const c = r === O.HORIZONTAL ? [i, l] : [l, i];
839
+ return be().range(o).domain(c).nice();
840
+ }
841
+ function ft(t) {
842
+ return (t == null ? void 0 : t.range) !== void 0 || (t == null ? void 0 : t.copy) !== void 0;
843
+ }
844
+ function je(t, e) {
845
+ return K(t) ? t.bandwidth() / 2 + t(t.domain()[e]) : t(e);
846
+ }
847
+ function pt(t, e, {
848
+ padding: r,
849
+ paddingInner: n,
850
+ paddingOuter: a
851
+ } = {}) {
852
+ const o = r ?? (e === O.HORIZONTAL ? Rt : Pt);
853
+ return t.copy().paddingInner(n ?? o).paddingOuter(a ?? o);
854
+ }
855
+ function at(t) {
856
+ return Object.values(O).includes(t);
857
+ }
858
+ const fe = (t, e = !0) => ({
859
+ ...nt(t),
860
+ ...rr(),
861
+ ...xe(),
862
+ classList: {
863
+ type: [String, Array],
864
+ default: () => []
865
+ },
866
+ hoveredIndex: {
867
+ type: Number,
868
+ default: null
869
+ },
870
+ ...e ? {
871
+ orientation: {
872
+ type: String,
873
+ default: O.VERTICAL,
874
+ validator: at
875
+ }
876
+ } : {}
877
+ }), or = (t) => ({
878
+ ...nt(t),
879
+ ...xe(),
880
+ hoveredElement: {
881
+ type: [Number, String],
882
+ default: null
883
+ }
884
+ });
885
+ function ur() {
886
+ const t = I(), e = we({
887
+ dimensions: {}
888
+ }), r = new ResizeObserver((n) => {
889
+ n.forEach((a) => {
890
+ e.dimensions = a.contentRect;
891
+ });
892
+ });
893
+ return re(() => {
894
+ r.observe(t.value);
895
+ }), Et(() => {
896
+ r.unobserve(t.value);
897
+ }), { resizeState: e, resizeRef: t };
898
+ }
899
+ const lr = /* @__PURE__ */ P({
900
+ __name: "lume-chart-container",
901
+ props: {
902
+ margins: {
903
+ type: Object,
904
+ required: !0
905
+ },
906
+ containerSize: {
907
+ type: Object,
908
+ default: () => ({ width: 0, height: 0 })
909
+ },
910
+ transparentBackground: {
911
+ type: Boolean,
912
+ default: !1
913
+ },
914
+ noMinSize: {
915
+ type: Boolean,
916
+ default: !1
917
+ },
918
+ orientation: {
919
+ type: String,
920
+ default: O.VERTICAL,
921
+ validator: at
922
+ }
923
+ },
924
+ emits: ["click", "mouseenter", "mouseleave", "resize"],
925
+ setup(t, { emit: e }) {
926
+ const r = t, { margins: n, containerSize: a } = j(r), o = I(null), { resizeRef: u, resizeState: i } = ur(), l = f(
927
+ () => a.value.height + n.value.top + n.value.bottom
928
+ );
929
+ return Nt(() => {
930
+ if (!o.value) return;
931
+ const { width: c } = i.dimensions, { height: s } = o.value.getBoundingClientRect();
932
+ if (!c || r.orientation === O.VERTICAL && !s)
933
+ return;
934
+ const v = c - n.value.left - n.value.right, m = s - n.value.top - n.value.bottom, h = {
935
+ width: v > 0 ? v : 0,
936
+ height: m > 0 ? m : 0,
937
+ outerWidth: c,
938
+ outerHeight: s
939
+ };
940
+ e("resize", h);
941
+ }), { __sfc: !0, props: r, emit: e, margins: n, containerSize: a, root: o, resizeRef: u, resizeState: i, svgHeight: l };
942
+ }
943
+ });
944
+ var ir = function() {
945
+ var e = this, r = e._self._c, n = e._self._setupProxy;
946
+ return r("div", { ref: "resizeRef", staticClass: "lume-chart-container", class: {
947
+ "lume-chart-container--minimum": !e.noMinSize
948
+ }, attrs: { "data-j-chart-container": "" } }, [e._t("header"), r("svg", { ref: "root", staticClass: "lume-chart-container__svg", class: {
949
+ "lume-chart-container__svg--transparent": e.transparentBackground
950
+ }, attrs: { height: n.svgHeight, "data-j-chart-container__root": "" }, on: { click: function(a) {
951
+ return n.emit("click", a);
952
+ }, mouseenter: function(a) {
953
+ return n.emit("mouseenter", a);
954
+ }, mouseleave: function(a) {
955
+ return n.emit("mouseleave", a);
956
+ } } }, [r("g", { staticClass: "lume-chart-container__group", attrs: { transform: `translate(${n.margins.left}, ${n.margins.top})`, "data-j-chart-container__group": "" } }, [e._t("default")], 2)]), e._t("footer"), e._t("extra")], 2);
957
+ }, sr = [], cr = /* @__PURE__ */ S(
958
+ lr,
959
+ ir,
960
+ sr,
961
+ !1,
962
+ null,
963
+ "d53cdc3e"
964
+ );
965
+ const dr = cr.exports, vr = /* @__PURE__ */ P({
966
+ __name: "lume-chart-legend",
967
+ props: {
968
+ data: {
969
+ type: Array,
970
+ validator: fn,
971
+ required: !0
972
+ }
973
+ },
974
+ emits: ["click", "mouseenter", "mouseleave"],
975
+ setup(t, { emit: e }) {
976
+ return { __sfc: !0, emit: e };
977
+ }
978
+ });
979
+ var fr = function() {
980
+ var e = this, r = e._self._c, n = e._self._setupProxy;
981
+ return r("div", { staticClass: "lume-chart-legend", attrs: { "data-j-chart-legend": "" }, on: { mouseleave: function(a) {
982
+ return n.emit("mouseleave");
983
+ } } }, e._l(e.data, function(a, o) {
984
+ return r("div", { key: `legend-item-${o}`, staticClass: "lume-chart-legend__item lume-typography--caption", attrs: { tabindex: "0", "data-j-chart-legend__symbol-wrapper": "" }, on: { click: function(u) {
985
+ return n.emit("click", { index: o, dataset: a, event: u });
986
+ }, mouseenter: function(u) {
987
+ return n.emit("mouseenter", { index: o, dataset: a, event: u });
988
+ } } }, [r("span", { staticClass: "lume-chart-legend__symbol", class: `lume-background-color--${a.color}`, attrs: { "data-j-chart-legend__symbol": "" } }), e._v(" " + e._s(a.label || o) + " ")]);
989
+ }), 0);
990
+ }, pr = [], mr = /* @__PURE__ */ S(
991
+ vr,
992
+ fr,
993
+ pr,
994
+ !1,
995
+ null,
996
+ "6f1d1c44"
997
+ );
998
+ const _r = mr.exports, gr = {};
999
+ var hr = function() {
1000
+ var e = this, r = e._self._c;
1001
+ return r("div", { staticClass: "lume-tooltip__title", attrs: { "data-j-tooltip__title": "" } }, [e._t("default")], 2);
1002
+ }, yr = [], br = /* @__PURE__ */ S(
1003
+ gr,
1004
+ hr,
1005
+ yr,
1006
+ !1,
1007
+ null,
1008
+ "8af3fac6"
1009
+ );
1010
+ const kr = br.exports, xr = {};
1011
+ var Lr = function() {
1012
+ var e = this, r = e._self._c;
1013
+ return r("li", { staticClass: "lume-tooltip__item", attrs: { "data-j-tooltip__summary-item": "" } }, [r("span", [e._t("default")], 2), r("strong", { staticClass: "lume-tooltip__value" }, [e._t("value")], 2)]);
1014
+ }, Ar = [], Tr = /* @__PURE__ */ S(
1015
+ xr,
1016
+ Lr,
1017
+ Ar,
1018
+ !1,
1019
+ null,
1020
+ "4ed7ec1b"
1021
+ );
1022
+ const Or = Tr.exports, Ir = /* @__PURE__ */ P({
1023
+ __name: "lume-tooltip-item",
1024
+ props: {
1025
+ color: {
1026
+ type: String,
1027
+ default: null
1028
+ }
1029
+ },
1030
+ setup(t) {
1031
+ return { __sfc: !0 };
1032
+ }
1033
+ });
1034
+ var Nr = function() {
1035
+ var e = this, r = e._self._c;
1036
+ return e._self._setupProxy, r("li", { staticClass: "lume-tooltip__item", attrs: { "data-j-tooltip__item": "" } }, [e.color ? r("span", { staticClass: "lume-tooltip__symbol", class: [`lume-background-color--${e.color}`], attrs: { "data-j-tooltip__item__symbol": "" } }) : e._e(), r("span", { attrs: { "data-j-tooltip__item__label": "" } }, [e._t("label")], 2), r("strong", { staticClass: "lume-tooltip__value", attrs: { "data-j-tooltip__item__value": "" } }, [e._t("value")], 2)]);
1037
+ }, Er = [], $r = /* @__PURE__ */ S(
1038
+ Ir,
1039
+ Nr,
1040
+ Er,
1041
+ !1,
1042
+ null,
1043
+ "4f995c3c"
1044
+ );
1045
+ const wr = $r.exports, Dr = /* @__PURE__ */ P({
1046
+ __name: "lume-tooltip",
1047
+ props: {
1048
+ opened: {
1049
+ type: Boolean,
1050
+ default: !1
1051
+ },
1052
+ targetElement: {
1053
+ type: Element,
1054
+ default: null
1055
+ },
1056
+ items: {
1057
+ type: Array,
1058
+ required: !0
1059
+ },
1060
+ position: {
1061
+ type: String,
1062
+ default: "auto",
1063
+ validator: (t) => Nn.includes(t)
1064
+ },
1065
+ fixedPositioning: {
1066
+ type: Boolean,
1067
+ default: !1
1068
+ },
1069
+ inverse: {
1070
+ type: Boolean,
1071
+ default: !1
1072
+ },
1073
+ modifiers: {
1074
+ type: Array,
1075
+ default: null
1076
+ },
1077
+ title: {
1078
+ type: [String, Number],
1079
+ default: null
1080
+ },
1081
+ summary: {
1082
+ type: String,
1083
+ default: null
1084
+ },
1085
+ ...xe()
1086
+ },
1087
+ emits: ["opened", "moved", "closed", "tooltip-mouseenter", "tooltip-mouseleave"],
1088
+ setup(t, { emit: e }) {
1089
+ const r = t, n = I(null), { items: a, options: o } = j(r), u = Z(), i = I(null), { allOptions: l } = Q(o), c = f(
1090
+ () => l.value.fixedPositioning ?? r.fixedPositioning
1091
+ ), s = f(
1092
+ () => c.value ? "fixed" : "absolute"
1093
+ ), v = f(() => [
1094
+ {
1095
+ name: "computeStyles",
1096
+ options: {
1097
+ adaptive: !1
1098
+ // so that we can have smooth transitions
1099
+ }
1100
+ },
1101
+ {
1102
+ name: "offset",
1103
+ options: { offset: [0, l.value.offset || 8] }
1104
+ },
1105
+ ...r.modifiers || []
1106
+ ]), m = f(
1107
+ () => l.value.showTitle !== !1 && r.title != null
1108
+ ), h = f(() => Ne(l.value.valueFormat)), g = f(() => Ne(l.value.titleFormat)), _ = f(
1109
+ () => {
1110
+ var A;
1111
+ return ((A = a.value) == null ? void 0 : A.find((N) => N.isSummary)) || {
1112
+ label: l.value.summary ?? r.summary
1113
+ };
1114
+ }
1115
+ ), x = f(() => u.summary || _.value.label), d = f(() => r.inverse || l.value.inverse ? [...a.value].reverse() : a.value);
1116
+ function p() {
1117
+ r.targetElement && n.value && (i.value = on(r.targetElement, n.value, {
1118
+ placement: r.position,
1119
+ strategy: s.value,
1120
+ modifiers: v.value
1121
+ }), e("opened", r.targetElement));
1122
+ }
1123
+ function y() {
1124
+ i.value && (i.value.destroy(), e("closed"), n.value && n.value.classList.remove("lume-tooltip--animated"));
1125
+ }
1126
+ function b() {
1127
+ i.value && (l.value.withAnimation !== !1 && n.value && n.value.classList.add("lume-tooltip--animated"), r.targetElement ? (function() {
1128
+ i.value.state.elements.reference = r.targetElement, i.value.update(), e("moved", r.targetElement);
1129
+ })() : y());
1130
+ }
1131
+ return H(
1132
+ () => r.targetElement,
1133
+ async (A, N) => {
1134
+ !N && A ? (await Ce(), p()) : b();
1135
+ }
1136
+ ), re(p), Et(y), { __sfc: !0, props: r, emit: e, root: n, items: a, options: o, slots: u, popper: i, allOptions: l, computedFixedPositioning: c, strategy: s, allModifiers: v, showTitle: m, formatValue: h, formatTitle: g, summaryItem: _, hasSummary: x, computedItems: d, initPopper: p, destroyPopper: y, updatePopper: b, LumeTooltipTitle: kr, LumeTooltipSummary: Or, LumeTooltipItem: wr };
1137
+ }
1138
+ });
1139
+ var Hr = function() {
1140
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1141
+ return e.opened && e.targetElement ? r("div", { ref: "root", staticClass: "lume-tooltip lume-typography--caption", class: {
1142
+ "lume-tooltip--pointer-events": n.options.withPointerEvents
1143
+ }, attrs: { "data-j-tooltip": "" }, on: { mouseenter: function(a) {
1144
+ return n.emit("tooltip-mouseenter");
1145
+ }, mouseleave: function(a) {
1146
+ return n.emit("tooltip-mouseleave");
1147
+ } } }, [e._t("default", function() {
1148
+ return [e._t("title", function() {
1149
+ return [n.showTitle ? r(n.LumeTooltipTitle, [e._v(" " + e._s(n.formatTitle(e.title)) + " ")]) : e._e()];
1150
+ }), r("ul", { staticClass: "lume-tooltip__items" }, [e._t("summary", function() {
1151
+ return [n.hasSummary ? r(n.LumeTooltipSummary, { scopedSlots: e._u([n.summaryItem.value ? { key: "value", fn: function() {
1152
+ return [e._v(" " + e._s(n.formatValue(n.summaryItem.value)) + " ")];
1153
+ }, proxy: !0 } : null], null, !0) }, [e._v(" " + e._s(n.summaryItem.label) + " ")]) : e._e()];
1154
+ }), n.hasSummary ? r("li", { staticClass: "lume-tooltip__break" }, [r("hr")]) : e._e(), e._t("items", function() {
1155
+ return e._l(n.computedItems, function(a) {
1156
+ return r(n.LumeTooltipItem, { key: a.label, attrs: { color: a.color }, scopedSlots: e._u([{ key: "label", fn: function() {
1157
+ return [e._v(" " + e._s(a.label) + " ")];
1158
+ }, proxy: !0 }, { key: "value", fn: function() {
1159
+ return [e._v(" " + e._s(n.formatValue(a.value)) + " ")];
1160
+ }, proxy: !0 }], null, !0) });
1161
+ });
1162
+ })], 2)];
1163
+ })], 2) : e._e();
1164
+ }, Sr = [], Pr = /* @__PURE__ */ S(
1165
+ Dr,
1166
+ Hr,
1167
+ Sr,
1168
+ !1,
1169
+ null,
1170
+ "6f13599d"
1171
+ );
1172
+ const Rr = Pr.exports, He = () => ({
1173
+ data: {
1174
+ type: Array,
1175
+ required: !0
1176
+ },
1177
+ labels: {
1178
+ type: Array,
1179
+ default: () => []
1180
+ },
1181
+ options: {
1182
+ type: Object,
1183
+ default: () => ({})
1184
+ },
1185
+ orientation: {
1186
+ type: String,
1187
+ default: O.VERTICAL,
1188
+ validator: at
1189
+ },
1190
+ xScale: {
1191
+ type: Function,
1192
+ default: () => null
1193
+ },
1194
+ yScale: {
1195
+ type: Function,
1196
+ default: () => null
1197
+ },
1198
+ hoveredIndex: {
1199
+ type: Number,
1200
+ default: -1
1201
+ },
1202
+ containerSize: {
1203
+ type: Object,
1204
+ default: () => ({ width: 0, height: 0 })
1205
+ },
1206
+ transition: {
1207
+ type: Boolean,
1208
+ default: !0
1209
+ },
1210
+ classList: {
1211
+ type: [String, Array],
1212
+ default: () => []
1213
+ }
1214
+ }), Cr = /* @__PURE__ */ P({
1215
+ __name: "lume-overlay-group",
1216
+ props: {
1217
+ ...He(),
1218
+ orientation: {
1219
+ type: String,
1220
+ default: O.VERTICAL
1221
+ }
1222
+ },
1223
+ emits: ["click", "lume__internal--hover", "mouseover"],
1224
+ setup(t, { emit: e }) {
1225
+ const r = t, { data: n, orientation: a, xScale: o, yScale: u } = j(r), i = f(() => Ht(n));
1226
+ function l(c) {
1227
+ var x;
1228
+ const s = a.value === O.HORIZONTAL ? u.value : o.value, v = s.domain(), m = mn(s), h = ((x = s.paddingInner) == null ? void 0 : x.call(s)) ?? 0, g = m * h, _ = K(s) ? s(v[c]) - g / 2 : s(c) - m / 2;
1229
+ return a.value === O.HORIZONTAL ? {
1230
+ width: Math.max(...o.value.range()),
1231
+ height: m,
1232
+ transform: `translate(0, ${_})`
1233
+ } : {
1234
+ width: m,
1235
+ height: Math.max(...u.value.range()),
1236
+ transform: `translate(${_}, 0)`
1237
+ };
1238
+ }
1239
+ return { __sfc: !0, props: r, emit: e, data: n, orientation: a, xScale: o, yScale: u, overlayData: i, getOverlayBarAttributes: l, LumeBar: Qe };
1240
+ }
1241
+ });
1242
+ var Br = function() {
1243
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1244
+ return r("g", { staticClass: "lume-overlay-group" }, e._l(n.overlayData, function(a, o) {
1245
+ return r(n.LumeBar, e._b({ key: `overlay-${o}`, attrs: { "data-j-lume-overlay-group": o, transition: !1, "class-list": "lume-fill--transparent" }, on: { mouseover: function(u) {
1246
+ return n.emit("lume__internal--hover", o);
1247
+ }, click: function(u) {
1248
+ return n.emit("click", { index: o, event: u });
1249
+ } } }, "lume-bar", n.getOverlayBarAttributes(o), !1));
1250
+ }), 1);
1251
+ }, Fr = [], Gr = /* @__PURE__ */ S(
1252
+ Cr,
1253
+ Br,
1254
+ Fr,
1255
+ !1,
1256
+ null,
1257
+ null
1258
+ );
1259
+ const jr = Gr.exports, Vr = [
1260
+ "axis-click",
1261
+ "axis-mouseenter",
1262
+ "axis-mouseleave",
1263
+ "rendered",
1264
+ "resize",
1265
+ "data-changed",
1266
+ "labels-changed",
1267
+ "chart-click",
1268
+ "chart-mouseenter",
1269
+ "chart-mouseleave",
1270
+ "legend-click",
1271
+ "legend-mouseenter",
1272
+ "legend-mouseleave",
1273
+ "bar-click",
1274
+ "line-click",
1275
+ "point-click",
1276
+ "node-click",
1277
+ "node-mouseenter",
1278
+ "node-mouseleave",
1279
+ "link-click",
1280
+ "link-mouseenter",
1281
+ "link-mouseleave",
1282
+ "tooltip-opened",
1283
+ "tooltip-moved",
1284
+ "tooltip-closed",
1285
+ "hovered-index-changed",
1286
+ "update:hoveredIndex"
1287
+ ], q = (t, e) => {
1288
+ function r(o, ...u) {
1289
+ document.dispatchEvent(
1290
+ new CustomEvent(`${e}_${o}`, {
1291
+ detail: [...u]
1292
+ })
1293
+ );
1294
+ }
1295
+ function n(o, u) {
1296
+ document.addEventListener(
1297
+ `${e}_${o}`,
1298
+ (i) => u(...i.detail)
1299
+ );
1300
+ }
1301
+ return { componentEventPropagator: Vr.reduce((o, u) => (o[u] = (i) => t(u, i), o), {}), emitInternalEvent: r, listenInternalEvent: n };
1302
+ };
1303
+ function Mr(t) {
1304
+ return { hasNegativeValues: f(
1305
+ () => wt(t.value).some((r) => r < 0)
1306
+ ) };
1307
+ }
1308
+ function zr(t, e, r, n) {
1309
+ const a = f(
1310
+ () => n.value === O.HORIZONTAL
1311
+ ), o = f(
1312
+ () => {
1313
+ var c;
1314
+ return t.height - (a != null && a.value ? 0 : ((c = r.value) == null ? void 0 : c.call(r, 0)) || 0);
1315
+ }
1316
+ ), u = f(
1317
+ () => {
1318
+ var c;
1319
+ return a != null && a.value ? ((c = e.value) == null ? void 0 : c.call(e, 0)) || 0 : t.width;
1320
+ }
1321
+ ), i = f(
1322
+ () => {
1323
+ var c;
1324
+ return a != null && a.value ? "translate(0, 0)" : `translate(0, ${((c = r.value) == null ? void 0 : c.call(r, 0)) || 0})`;
1325
+ }
1326
+ );
1327
+ return { negativeBarAttributes: f(() => ({
1328
+ width: u.value,
1329
+ height: o.value,
1330
+ transform: i.value
1331
+ })) };
1332
+ }
1333
+ function Wr(t, e) {
1334
+ return t.reduce((r, n) => Je(n.values, e).map(
1335
+ (a, o) => r[o] ? a.value > r[o] ? a.value : r[o] : a.value ?? 0
1336
+ ), []);
1337
+ }
1338
+ function Ur(t, e) {
1339
+ return t.reduce((r, n) => Je(n.values, e).map(
1340
+ (a, o) => {
1341
+ const u = a.value == null || a.value < 0 ? 0 : a.value;
1342
+ return r[o] ? r[o] + u : u;
1343
+ }
1344
+ ), []);
1345
+ }
1346
+ const mt = {
1347
+ "stacked-bar": Ur
1348
+ };
1349
+ function Gt(t, e, r, n, a, o, u, i) {
1350
+ const l = f(
1351
+ () => {
1352
+ var s;
1353
+ return e.value.withTooltip !== !1 && !((s = e.value.tooltipOptions) != null && s.targetElement);
1354
+ }
1355
+ );
1356
+ function c(s) {
1357
+ var h;
1358
+ const v = ((h = a == null ? void 0 : a.value) == null ? void 0 : h.length) ?? 0, m = i != null && i.value && mt[i.value] ? mt[i.value](
1359
+ s,
1360
+ v
1361
+ ) : Wr(s, v);
1362
+ t.value = m.map((g, _) => ({
1363
+ cx: (o == null ? void 0 : o.value) === O.HORIZONTAL ? r.value(g) : je(r.value, _),
1364
+ cy: (o == null ? void 0 : o.value) === O.HORIZONTAL ? je(n.value, _) : n.value(g)
1365
+ }));
1366
+ }
1367
+ return H(
1368
+ [r, n],
1369
+ () => {
1370
+ r.value && n.value && (u != null && u.value) && l.value && c(u.value);
1371
+ },
1372
+ { immediate: !0 }
1373
+ ), { shouldGenerateTooltipAnchors: l, updateTooltipAnchorAttributes: c };
1374
+ }
1375
+ function Zr() {
1376
+ const t = we({
1377
+ opened: !1,
1378
+ targetElement: null
1379
+ });
1380
+ return { tooltipConfig: t, showTooltip: (n) => {
1381
+ t.opened = !0, t.targetElement = n;
1382
+ }, hideTooltip: () => {
1383
+ t.opened = !1, t.targetElement = null;
1384
+ } };
1385
+ }
1386
+ function Xr(t) {
1387
+ return { getTooltipItems: f(
1388
+ () => (r) => t.value.map(({ color: n, label: a, values: o }) => {
1389
+ var u, i, l;
1390
+ return {
1391
+ color: ((u = o[r]) == null ? void 0 : u.color) || n,
1392
+ label: a,
1393
+ value: ((i = o[r]) == null ? void 0 : i.label) ?? ((l = o[r]) == null ? void 0 : l.value) ?? St
1394
+ };
1395
+ })
1396
+ ) };
1397
+ }
1398
+ const Ve = 16, Me = 8, ze = 28, We = 24, ie = {
1399
+ VERTICAL: {
1400
+ top: Ve,
1401
+ right: Me,
1402
+ bottom: ze,
1403
+ left: We
1404
+ },
1405
+ HORIZONTAL: {
1406
+ top: Ve,
1407
+ right: Me,
1408
+ bottom: ze,
1409
+ left: We
1410
+ }
1411
+ };
1412
+ function Yr(t) {
1413
+ return !t || t === "auto" || t.top == null || t.top === "auto" ? Ve : t.top;
1414
+ }
1415
+ function Kr(t) {
1416
+ return !t || t === "auto" || t.right == null || t.right === "auto" ? Me : t.right;
1417
+ }
1418
+ function Jr(t, e) {
1419
+ return !t || t === "auto" || t.bottom == null || t.bottom === "auto" ? e || ze : t.bottom;
1420
+ }
1421
+ function Qr(t, e) {
1422
+ return !t || t === "auto" || t.left == null || t.left === "auto" ? e || We : t.left;
1423
+ }
1424
+ const qr = /* @__PURE__ */ P({
1425
+ __name: "lume-chart",
1426
+ props: {
1427
+ ...fe(),
1428
+ chartType: {
1429
+ type: String,
1430
+ default: null
1431
+ }
1432
+ },
1433
+ setup(t, { emit: e }) {
1434
+ const r = t, n = Z(), { data: a, labels: o, color: u, options: i, orientation: l, chartType: c } = j(r), s = I(-1), v = I(null), m = I(null), h = I([]), g = I(null), _ = I(0), x = I(0), { allOptions: d } = Q(i), { internalData: p, computedLabels: y, containerSize: b, updateSize: A, chartID: N } = rt(a, o, u, d, l), { listenInternalEvent: T } = q(e, N), { xScale: $, yScale: R } = ar(
1435
+ p,
1436
+ y,
1437
+ b,
1438
+ l,
1439
+ d
1440
+ ), G = f(() => ({
1441
+ top: Yr(d.value.margins),
1442
+ right: Kr(d.value.margins),
1443
+ bottom: Jr(d.value.margins, _.value),
1444
+ left: Qr(d.value.margins, x.value)
1445
+ })), V = f(() => {
1446
+ var k;
1447
+ return r.xScale ? ft(r.xScale) ? r.xScale : (k = r.xScale) == null ? void 0 : k.call(r, p.value, o.value, b) : $.value;
1448
+ }), ee = f(() => {
1449
+ var k;
1450
+ return r.yScale ? ft(r.yScale) ? r.yScale : (k = r.yScale) == null ? void 0 : k.call(r, p.value, o.value, b) : R.value;
1451
+ }), ce = f(() => ({
1452
+ ...d.value.xAxisOptions,
1453
+ withHover: l.value === O.VERTICAL
1454
+ })), ae = f(() => ({
1455
+ ...d.value.yAxisOptions,
1456
+ withHover: l.value === O.HORIZONTAL
1457
+ })), oe = f(() => {
1458
+ var k;
1459
+ return (k = d.value.xAxisOptions) == null ? void 0 : k.title;
1460
+ }), ue = f(() => {
1461
+ var k;
1462
+ return (k = d.value.yAxisOptions) == null ? void 0 : k.title;
1463
+ }), E = f(() => {
1464
+ var k;
1465
+ return ((k = d.value.xAxisOptions) == null ? void 0 : k.withTitle) !== !1 && oe.value;
1466
+ }), w = f(() => {
1467
+ var k;
1468
+ return ((k = d.value.yAxisOptions) == null ? void 0 : k.withTitle) !== !1 && ue.value;
1469
+ }), C = f(
1470
+ () => a.value.every((k) => !k.values.length) || a.value.every((k) => k.values.every((F) => F === null))
1471
+ ), te = f(() => {
1472
+ const k = [], { noBaseScales: F } = d.value;
1473
+ return F || k.push(() => !!(V.value && ee.value)), k.every((U) => U() === !0);
1474
+ }), { hasNegativeValues: me } = Mr(p), { negativeBarAttributes: Se } = zr(
1475
+ b,
1476
+ V,
1477
+ ee,
1478
+ l
1479
+ ), { shouldGenerateTooltipAnchors: _e } = Gt(
1480
+ h,
1481
+ d,
1482
+ V,
1483
+ ee,
1484
+ o,
1485
+ l,
1486
+ p,
1487
+ c
1488
+ ), { tooltipConfig: L, showTooltip: D, hideTooltip: B } = Zr(), { getTooltipItems: M } = Xr(p), Y = f(
1489
+ () => {
1490
+ var k;
1491
+ return ((k = d.value.tooltipOptions) == null ? void 0 : k.position) || "top";
1492
+ }
1493
+ ), z = f(() => {
1494
+ var F;
1495
+ const k = (F = d.value.tooltipOptions) == null ? void 0 : F.withPointerEvents;
1496
+ return L.opened && (!k || k && g.value === !1);
1497
+ });
1498
+ function ge(k) {
1499
+ var U;
1500
+ if (d.value.withHover === !1 || k === s.value) return;
1501
+ const F = s.value;
1502
+ if (s.value = k, d.value.withTooltip !== !1) {
1503
+ const Kt = (U = d.value.tooltipOptions) != null && U.targetElement ? d.value.tooltipOptions.targetElement === "self" ? m.value.$el : d.value.tooltipOptions.targetElement : v.value[k];
1504
+ D(Kt);
1505
+ }
1506
+ e("hovered-index-changed", { newIndex: k, oldIndex: F }), e("update:hoveredIndex", k);
1507
+ }
1508
+ function de() {
1509
+ B(), s.value = -1, e("update:hoveredIndex", -1);
1510
+ }
1511
+ function he(k) {
1512
+ if (!a.value.some(
1513
+ ({ values: U }) => k <= U.length - 1
1514
+ )) {
1515
+ ne(J.InvalidHoveredIndex);
1516
+ return;
1517
+ }
1518
+ k == null || k === -1 ? de() : ge(k);
1519
+ }
1520
+ function Te() {
1521
+ setTimeout(() => {
1522
+ z.value && de(), e("chart-mouseleave");
1523
+ }, 0);
1524
+ }
1525
+ function Oe(k) {
1526
+ A(k), e("resize", k);
1527
+ }
1528
+ function ve({ index: k, value: F, event: U }) {
1529
+ k !== null && ge(k), e("axis-mouseenter", { index: k, value: F, event: U });
1530
+ }
1531
+ function Yt({ index: k, value: F, event: U }) {
1532
+ e("axis-click", { index: k, value: F, event: U });
1533
+ }
1534
+ return H(
1535
+ a,
1536
+ (k, F) => e("data-changed", { newValue: k, oldValue: F })
1537
+ ), H(
1538
+ o,
1539
+ (k, F) => e("labels-changed", { newValue: k, oldValue: F })
1540
+ ), H(C, (k) => k && ne(J.Empty), { immediate: !0 }), H(() => r.hoveredIndex, he), H(
1541
+ h,
1542
+ (k) => {
1543
+ k && r.hoveredIndex != null && s.value === -1 && he(r.hoveredIndex);
1544
+ },
1545
+ { flush: "post" }
1546
+ ), H(g, (k) => {
1547
+ k === !1 && L.opened && de();
1548
+ }), re(async () => {
1549
+ e("rendered"), n.groups || console.error('"groups" `<slot>` must have content.'), T("lume__internal--hover", ge);
1550
+ }), Pe("chartID", N), Pe("isEmpty", C), Pe("tooltipAnchorAttributes", h), { __sfc: !0, props: r, slots: n, emit: e, data: a, labels: o, color: u, options: i, orientation: l, chartType: c, internalHoveredIndex: s, tooltipAnchor: v, chartContainer: m, tooltipAnchorAttributes: h, isHoveringTooltip: g, xAxisHeight: _, yAxisWidth: x, allOptions: d, internalData: p, computedLabels: y, containerSize: b, updateSize: A, chartID: N, listenInternalEvent: T, xScale: $, yScale: R, computedMargins: G, computedXScale: V, computedYScale: ee, computedXAxisOptions: ce, computedYAxisOptions: ae, xAxisTitle: oe, yAxisTitle: ue, showXAxisTitle: E, showYAxisTitle: w, isEmpty: C, isReady: te, hasNegativeValues: me, negativeBarAttributes: Se, shouldGenerateTooltipAnchors: _e, tooltipConfig: L, showTooltip: D, hideTooltip: B, getTooltipItems: M, tooltipPosition: Y, shouldHideTooltip: z, handleInternalHover: ge, handleHideTooltip: de, handleExternalHover: he, handleMouseleave: Te, handleResize: Oe, handleAxisMouseenter: ve, handleAxisClick: Yt, LumeAxis: Gn, LumeBar: Qe, LumeChartContainer: dr, LumeChartLegend: _r, LumeTooltip: Rr, LumeOverlayGroup: jr, TOOLTIP_ANCHOR_RADIUS: In };
1551
+ }
1552
+ });
1553
+ var ea = function() {
1554
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1555
+ return r(n.LumeChartContainer, { ref: "chartContainer", attrs: { id: `lume-chart_${n.chartID}`, margins: n.computedMargins, "container-size": n.containerSize, "no-min-size": n.allOptions.noMinSize, "transparent-background": n.allOptions.transparentBackground, orientation: n.orientation, "data-j-lume-chart": "" }, on: { resize: n.handleResize, click: function(a) {
1556
+ return n.emit("chart-click", a);
1557
+ }, mouseenter: function(a) {
1558
+ return n.emit("chart-mouseenter", a);
1559
+ }, mouseleave: n.handleMouseleave }, scopedSlots: e._u([{ key: "header", fn: function() {
1560
+ return [r("div", { staticClass: "lume-chart__header" }, [r("div", { staticClass: "lume-chart__header-section" }, [e.title ? r("h1", { staticClass: "lume-chart__title lume-chart-title lume-typography--display" }, [e._v(" " + e._s(e.title) + " ")]) : e._e(), r("div", { staticClass: "lume-chart__controls" }, [e._t("controls")], 2)]), r("div", { staticClass: "lume-chart__header-section" }, [n.showYAxisTitle ? r("h3", { staticClass: "lume-chart__axis-title lume-axis-title lume-typography--caption" }, [e._v(" " + e._s(n.yAxisTitle) + " ")]) : e._e(), e._t("legend", function() {
1561
+ return [n.allOptions.withLegend !== !1 && n.allOptions.legendPosition !== "bottom" ? r(n.LumeChartLegend, { staticClass: "lume-chart__legend", attrs: { data: n.internalData, "data-j-lume-chart__legend": "" }, on: { click: function(a) {
1562
+ return n.emit("legend-click", a);
1563
+ }, mouseenter: function(a) {
1564
+ return n.emit("legend-mouseenter", a);
1565
+ }, mouseleave: function(a) {
1566
+ return n.emit("legend-mouseleave");
1567
+ } } }) : e._e()];
1568
+ }, { data: n.internalData })], 2)])];
1569
+ }, proxy: !0 }, { key: "footer", fn: function() {
1570
+ return [n.showXAxisTitle ? r("h3", { staticClass: "lume-chart__axis-title lume-chart__axis-title--centered lume-axis-title lume-typography--body" }, [e._v(" " + e._s(n.xAxisTitle) + " ")]) : e._e(), n.allOptions.withLegend !== !1 && n.allOptions.legendPosition == "bottom" ? r(n.LumeChartLegend, { staticClass: "lume-chart__legend lume-chart__legend--bottom", attrs: { data: n.internalData, "data-j-lume-chart__legend": "" }, on: { click: function(a) {
1571
+ return n.emit("legend-click", a);
1572
+ }, mouseenter: function(a) {
1573
+ return n.emit("legend-mouseenter", a);
1574
+ }, mouseleave: function(a) {
1575
+ return n.emit("legend-mouseleave");
1576
+ } } }) : e._e()];
1577
+ }, proxy: !0 }, { key: "extra", fn: function() {
1578
+ return [e._t("tooltip", function() {
1579
+ return [n.allOptions.withTooltip !== !1 ? r(n.LumeTooltip, e._b({ attrs: { position: n.tooltipPosition, title: n.computedLabels[n.internalHoveredIndex], items: n.getTooltipItems(n.internalHoveredIndex), options: n.allOptions.tooltipOptions, "data-j-lume-chart__tooltip": "" }, on: { opened: function(a) {
1580
+ return n.emit("tooltip-opened", {
1581
+ index: n.internalHoveredIndex,
1582
+ targetElement: a
1583
+ });
1584
+ }, moved: function(a) {
1585
+ return n.emit("tooltip-moved", {
1586
+ index: n.internalHoveredIndex,
1587
+ targetElement: a
1588
+ });
1589
+ }, closed: function(a) {
1590
+ return n.emit("tooltip-closed");
1591
+ }, "tooltip-mouseenter": function(a) {
1592
+ n.isHoveringTooltip = !0;
1593
+ }, "tooltip-mouseleave": function(a) {
1594
+ n.isHoveringTooltip = !1;
1595
+ } } }, "lume-tooltip", n.tooltipConfig, !1), [e._t("tooltip-content", null, { data: n.internalData, labels: n.computedLabels, hoveredIndex: n.internalHoveredIndex })], 2) : e._e()];
1596
+ }, { data: n.internalData, labels: n.computedLabels, title: n.computedLabels[n.internalHoveredIndex], items: n.getTooltipItems(n.internalHoveredIndex), position: n.tooltipPosition, withTooltip: n.allOptions.withTooltip !== !1, hoveredIndex: n.internalHoveredIndex, handleMouseEnter: () => n.isHoveringTooltip = !0, handleMouseLeave: () => n.isHoveringTooltip = !1, options: n.allOptions.tooltipOptions }, n.tooltipConfig)];
1597
+ }, proxy: !0 }], null, !0) }, [n.isReady ? [n.hasNegativeValues ? r(n.LumeBar, e._b({ attrs: { "class-list": "lume-fill--negative", transition: !1, "data-j-lume-chart__negative-values": "" } }, "lume-bar", n.negativeBarAttributes, !1)) : e._e(), n.allOptions.withAxes !== !1 ? e._t("axes", function() {
1598
+ return [r(n.LumeAxis, { attrs: { type: "x", scale: n.computedXScale, "container-size": n.containerSize, options: n.computedXAxisOptions, "hovered-index": n.internalHoveredIndex, orientation: n.orientation, "data-j-lume-chart__x-axis": "" }, on: { click: n.handleAxisClick, mouseenter: n.handleAxisMouseenter, mouseleave: function(a) {
1599
+ return n.emit("axis-mouseleave");
1600
+ }, "lume__internal--axis-size": function(a) {
1601
+ n.xAxisHeight = a;
1602
+ } } }), r(n.LumeAxis, { attrs: { type: "y", scale: n.computedYScale, "container-size": n.containerSize, options: n.computedYAxisOptions, "hovered-index": n.internalHoveredIndex, orientation: n.orientation, "data-j-lume-chart__y-axis": "" }, on: { click: n.handleAxisClick, mouseenter: n.handleAxisMouseenter, mouseleave: function(a) {
1603
+ return n.emit("axis-mouseleave");
1604
+ }, "lume__internal--axis-size": function(a) {
1605
+ n.yAxisWidth = a;
1606
+ } } })];
1607
+ }, { xScale: n.computedXScale, yScale: n.computedYScale, containerSize: n.containerSize, options: n.allOptions, hoveredIndex: n.internalHoveredIndex }) : e._e(), n.allOptions.withHover !== !1 ? r(n.LumeOverlayGroup, { attrs: { data: n.internalData, orientation: n.orientation, "x-scale": n.computedXScale, "y-scale": n.computedYScale, "data-j-lume-chart__overlay-group": "" }, on: { "lume__internal--hover": n.handleInternalHover } }) : e._e(), n.shouldGenerateTooltipAnchors ? r("g", e._l(n.tooltipAnchorAttributes, function(a, o) {
1608
+ return r("circle", e._b({ key: `anchor_${o}`, ref: "tooltipAnchor", refInFor: !0, staticClass: "lume-fill--transparent", attrs: { r: n.TOOLTIP_ANCHOR_RADIUS } }, "circle", a, !1));
1609
+ }), 0) : e._e(), e._t("groups", null, { data: n.internalData, labels: n.computedLabels, options: n.allOptions, orientation: n.orientation, xScale: n.computedXScale, yScale: n.computedYScale, hoveredIndex: n.internalHoveredIndex, containerSize: n.containerSize, transition: n.allOptions.withTransition !== !1, classList: e.classList })] : e._e()], 2);
1610
+ }, ta = [], na = /* @__PURE__ */ S(
1611
+ qr,
1612
+ ea,
1613
+ ta,
1614
+ !1,
1615
+ null,
1616
+ "17c48844"
1617
+ );
1618
+ const pe = na.exports, _t = 8, ra = 8, aa = 20, ye = 2, oa = 3, ua = 4, gt = 2, la = /* @__PURE__ */ P({
1619
+ __name: "lume-alluvial-node-label",
1620
+ props: {
1621
+ bottom: { type: Boolean, default: !1 },
1622
+ left: { type: Boolean, default: !1 },
1623
+ maxWidth: { type: Number, default: 0 }
1624
+ },
1625
+ emits: ["lume__internal--node-resize"],
1626
+ setup(t, { emit: e }) {
1627
+ const r = t, n = I(null), a = I(r.maxWidth), o = I(1);
1628
+ return H(
1629
+ [n, () => r.maxWidth],
1630
+ async ([u, i]) => {
1631
+ if (u && i) {
1632
+ a.value = i, await Ce();
1633
+ const { width: l, height: c } = u.getBoundingClientRect();
1634
+ a.value = l + gt > i ? i : l + gt, o.value = Math.ceil(c);
1635
+ }
1636
+ },
1637
+ { immediate: !0 }
1638
+ ), H(a, async (u) => {
1639
+ u !== r.maxWidth && (await Ce(), e("lume__internal--node-resize"));
1640
+ }), { __sfc: !0, props: r, emit: e, text: n, foreignObjectWidth: a, foreignObjectHeight: o };
1641
+ }
1642
+ });
1643
+ var ia = function() {
1644
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1645
+ return e.maxWidth ? r("foreignObject", { staticClass: "lume-alluvial-group__node-foreign", attrs: { y: e.bottom ? "0.1em" : -n.foreignObjectHeight + 1, x: e.left ? -n.foreignObjectWidth : 0, width: n.foreignObjectWidth, height: n.foreignObjectHeight } }, [r("div", { staticClass: "lume-alluvial-group__label-wrapper" }, [r("span", { ref: "text", staticClass: "lume-alluvial-group__node-label" }, [e._t("default")], 2)])]) : r("text", { staticClass: "lume-alluvial-group__node-label", attrs: { dy: e.bottom ? ".2em" : "-.2em", "dominant-baseline": e.bottom ? "hanging" : "auto" } }, [e._t("default")], 2);
1646
+ }, sa = [], ca = /* @__PURE__ */ S(
1647
+ la,
1648
+ ia,
1649
+ sa,
1650
+ !1,
1651
+ null,
1652
+ "7126dfdb"
1653
+ );
1654
+ const da = ca.exports, va = /* @__PURE__ */ P({
1655
+ __name: "lume-alluvial-node-value",
1656
+ props: {
1657
+ bottom: { type: Boolean, default: !0 }
1658
+ },
1659
+ setup(t) {
1660
+ return { __sfc: !0 };
1661
+ }
1662
+ });
1663
+ var fa = function() {
1664
+ var e = this, r = e._self._c;
1665
+ return e._self._setupProxy, r("text", { staticClass: "lume-alluvial-group__node-value", attrs: { y: e.bottom ? ".2em" : "-.2em", "dominant-baseline": e.bottom ? "hanging" : "auto" } }, [e._t("default")], 2);
1666
+ }, pa = [], ma = /* @__PURE__ */ S(
1667
+ va,
1668
+ fa,
1669
+ pa,
1670
+ !1,
1671
+ null,
1672
+ "b4fc758b"
1673
+ );
1674
+ const _a = ma.exports, ga = /* @__PURE__ */ P({
1675
+ __name: "lume-alluvial-node-header",
1676
+ props: {
1677
+ align: {
1678
+ type: String,
1679
+ default: "center"
1680
+ },
1681
+ x: { type: Number, required: !0 },
1682
+ y: { type: Number, required: !0 }
1683
+ },
1684
+ setup(t) {
1685
+ const e = t, r = I(null), n = f(() => {
1686
+ var i;
1687
+ return ((i = r.value) == null ? void 0 : i.getBBox().width) ?? 0;
1688
+ }), a = f(() => e.align === "left" ? 0 : e.align === "right" ? -n.value : -n.value / 2), o = f(
1689
+ () => r.value && `translate(${a.value}, 0)`
1690
+ ), u = f(
1691
+ () => r.value && `translate(${a.value + n.value}, 0)`
1692
+ );
1693
+ return { __sfc: !0, props: e, textRef: r, textWidth: n, textStart: a, beforeTransform: o, afterTransform: u };
1694
+ }
1695
+ });
1696
+ var ha = function() {
1697
+ var e = this, r = e._self._c, n = e._self._setupProxy;
1698
+ return r("g", { attrs: { transform: `translate(${e.x}, ${e.y})` } }, [r("g", { attrs: { transform: n.beforeTransform } }, [e._t("before")], 2), r("text", { ref: "textRef", staticClass: "lume-alluvial-group__node-header lume-typography--caption", class: {
1699
+ [`lume-alluvial-group__node-header--${e.align}`]: e.align !== "center"
1700
+ } }, [e._t("default")], 2), r("g", { attrs: { transform: n.afterTransform } }, [e._t("after")], 2)]);
1701
+ }, ya = [], ba = /* @__PURE__ */ S(
1702
+ ga,
1703
+ ha,
1704
+ ya,
1705
+ !1,
1706
+ null,
1707
+ "ee436a8d"
1708
+ );
1709
+ const ka = ba.exports;
1710
+ function ht(t, e) {
1711
+ return {
1712
+ x0: 0 + (e ? e.left : 0),
1713
+ y0: 0 + (e ? e.top : 0),
1714
+ x1: t.width - (e ? e.right : 0),
1715
+ y1: t.height - (e ? e.bottom : 0)
1716
+ };
1717
+ }
1718
+ function xa(t) {
1719
+ const e = I(ht(t));
1720
+ function r(n) {
1721
+ e.value = ht(t, n);
1722
+ }
1723
+ return { extents: e, updateExtents: r };
1724
+ }
1725
+ var Ee = /* @__PURE__ */ ((t) => (t.GraphProblem = "There was an issue generating your alluvial graph.", t.BarScaleDomainAbove0 = "Bar linear scale domain cannot start above 0!", t.BarScaleNull = "Bar linear scale cannot be `null`", t))(Ee || {});
1726
+ const La = "[lume] ";
1727
+ function Ue(t, e, r = !0) {
1728
+ r && $t() || console.error(La + "Error: " + t, e);
1729
+ }
1730
+ const Aa = 200;
1731
+ function W(t) {
1732
+ return typeof t == "string" || typeof t == "number" ? t : t.id ?? t.label;
1733
+ }
1734
+ function Ta(t, e) {
1735
+ return e.nodes.find((r) => r.id === t);
1736
+ }
1737
+ function Oa(t, e) {
1738
+ return e.links.find((r) => r.id === t);
1739
+ }
1740
+ function jt(t) {
1741
+ return !!(t.sourceLinks && t.targetLinks);
1742
+ }
1743
+ function ot(t) {
1744
+ return Math.max(
1745
+ ...t.filter((e) => e.parentNodeId == null).map(({ layer: e }) => e)
1746
+ );
1747
+ }
1748
+ function Vt(t) {
1749
+ return t.layer === 0;
1750
+ }
1751
+ function Mt(t, e) {
1752
+ return t.parentNodeId == null && t.layer === e;
1753
+ }
1754
+ function zt(t, e, r) {
1755
+ return Vt(t) ? e.alignFirstNodeLabels !== "right" : Mt(t, r) ? e.alignLastNodeLabels === "left" : !1;
1756
+ }
1757
+ function Ia(t, e, r) {
1758
+ if (!e) return;
1759
+ const n = ot(t.nodes), a = t.nodes.filter((l) => Vt(l)).map((l) => `${l.id}`), o = t.nodes.filter((l) => Mt(l, n)).map((l) => `${l.id}`), u = e.filter((l) => a.includes(l.dataset.id)).reduce(
1760
+ (l, c) => Math.max(l, c.getBBox().width),
1761
+ -1 / 0
1762
+ ), i = e.filter((l) => o.includes(l.dataset.id)).reduce(
1763
+ (l, c) => Math.max(l, c.getBBox().width),
1764
+ -1 / 0
1765
+ );
1766
+ return {
1767
+ left: r.alignFirstNodeLabels === "right" ? 0 : u,
1768
+ top: 0,
1769
+ right: r.alignLastNodeLabels === "left" ? 0 : i,
1770
+ bottom: 0
1771
+ };
1772
+ }
1773
+ function Na(t, e) {
1774
+ const r = ot(t);
1775
+ return t.map((n) => {
1776
+ const a = n.y1 - n.y0 < ye;
1777
+ return {
1778
+ x: n.x0,
1779
+ y: n.y0 - (a ? ye / 2 : 0),
1780
+ // Negative offset to account for the min. height
1781
+ width: n.x1 - n.x0,
1782
+ height: a ? ye : n.y1 - n.y0,
1783
+ textTransform: {
1784
+ x: zt(n, e, r) ? n.x0 - _t : n.x1 + _t,
1785
+ y: (n.y1 + n.y0) / 2
1786
+ },
1787
+ node: n
1788
+ };
1789
+ });
1790
+ }
1791
+ function Ea(t) {
1792
+ return [t.source.x1, t.y0];
1793
+ }
1794
+ function $a(t) {
1795
+ return [t.target.x0, t.y1];
1796
+ }
1797
+ function wa(t) {
1798
+ return t.curveFunction ? nn(t.curveFunction).source(Ea).target($a) : Jt();
1799
+ }
1800
+ function Da(t) {
1801
+ return t.map((e) => {
1802
+ var r;
1803
+ return {
1804
+ id: e.id,
1805
+ color: e.color || ((r = e.source) == null ? void 0 : r.color) || Ae,
1806
+ d: wa(e)(e),
1807
+ strokeWidth: Math.max(1, e.width),
1808
+ link: e
1809
+ };
1810
+ });
1811
+ }
1812
+ function yt(t, e, r, n, a) {
1813
+ if (n === !1) {
1814
+ t.node = {
1815
+ ...t.node,
1816
+ transitionValue: a ? void 0 : r
1817
+ };
1818
+ return;
1819
+ }
1820
+ const o = Date.now(), u = bn(e, r), i = () => {
1821
+ let c = (Date.now() - o) / Aa;
1822
+ c > 1 && (c = 1), t.node = {
1823
+ ...t.node,
1824
+ transitionValue: a && c === 1 ? void 0 : u(c)
1825
+ }, c < 1 && requestAnimationFrame(i);
1826
+ };
1827
+ requestAnimationFrame(i);
1828
+ }
1829
+ const Ha = ":aggregated";
1830
+ function Sa(t) {
1831
+ const e = I([]), r = f(() => {
1832
+ var c, s;
1833
+ const l = /* @__PURE__ */ new Map();
1834
+ return (s = (c = t.value) == null ? void 0 : c[0]) == null || s.values.forEach(({ value: v, expandableNodes: m }) => {
1835
+ m != null && m.length && l.set(v, [...m]);
1836
+ }), l;
1837
+ }), n = f(
1838
+ () => {
1839
+ const l = /* @__PURE__ */ new Map();
1840
+ return r.value.forEach((c, s) => {
1841
+ c.forEach((v) => l.set(v, s));
1842
+ }), l;
1843
+ }
1844
+ );
1845
+ function a(l) {
1846
+ return r.value.has(l);
1847
+ }
1848
+ function o(l) {
1849
+ return n.value.has(l);
1850
+ }
1851
+ function u(l) {
1852
+ return e.value.includes(l);
1853
+ }
1854
+ function i(l) {
1855
+ a(l) && (e.value = u(l) ? e.value.filter((c) => c !== l) : [...e.value, l]);
1856
+ }
1857
+ return H(t, () => e.value = []), {
1858
+ childIdsByParentId: r,
1859
+ expandedNodeIds: e,
1860
+ isExpandableNode: a,
1861
+ isExpandedNode: u,
1862
+ isSubNode: o,
1863
+ parentIdByChildId: n,
1864
+ toggleNodeExpansion: i
1865
+ };
1866
+ }
1867
+ function Pa(t, e, r, n) {
1868
+ if (!t || !e || n.size === 0)
1869
+ return { nodes: t, links: e };
1870
+ const a = e.filter(
1871
+ (u) => !n.has(W(u.source)) && !n.has(W(u.target))
1872
+ ), o = new Set(a.map(({ id: u }) => u));
1873
+ return r.forEach((u, i) => {
1874
+ const l = /* @__PURE__ */ new Map();
1875
+ u.forEach((c) => {
1876
+ Wt(e, c).forEach((s) => {
1877
+ const v = W(s.target), m = l.get(v);
1878
+ if (m) {
1879
+ m.value += s.value;
1880
+ return;
1881
+ }
1882
+ const h = `${i}:${v}`;
1883
+ l.set(v, {
1884
+ id: o.has(h) ? `${h}${Ha}` : h,
1885
+ aggregatedFrom: i,
1886
+ color: s.color,
1887
+ curveFunction: s.curveFunction,
1888
+ source: i,
1889
+ target: v,
1890
+ value: s.value
1891
+ });
1892
+ });
1893
+ }), a.push(...l.values());
1894
+ }), {
1895
+ nodes: t.filter((u) => !n.has(u.id)),
1896
+ links: a
1897
+ };
1898
+ }
1899
+ function Ra({
1900
+ graph: t,
1901
+ nodes: e,
1902
+ linkDefinitions: r,
1903
+ expandedNodeIds: n,
1904
+ childIdsByParentId: a,
1905
+ options: o,
1906
+ extents: u
1907
+ }) {
1908
+ var i;
1909
+ (i = t == null ? void 0 : t.nodes) != null && i.length && n.forEach((l) => {
1910
+ const c = t.nodes.find((v) => v.id === l), s = (a.get(l) ?? []).map((v) => e.find((m) => m.id === v)).filter(Boolean);
1911
+ !c || !s.length || Ca({ graph: t, parent: c, children: s, linkDefinitions: r, options: o, extents: u });
1912
+ });
1913
+ }
1914
+ function Ca({
1915
+ graph: t,
1916
+ parent: e,
1917
+ children: r,
1918
+ linkDefinitions: n,
1919
+ options: a,
1920
+ extents: o
1921
+ }) {
1922
+ const u = r.map(
1923
+ (s) => za(n, e, s)
1924
+ ), i = u.reduce((s, v) => s + v, 0);
1925
+ if (!i) return;
1926
+ const l = (e.y1 - e.y0) / i;
1927
+ Ba({
1928
+ parent: e,
1929
+ children: r,
1930
+ childValues: u,
1931
+ scale: l,
1932
+ graph: t,
1933
+ options: a,
1934
+ extents: o
1935
+ });
1936
+ const c = ja({
1937
+ parent: e,
1938
+ children: r,
1939
+ childValues: u,
1940
+ scale: l,
1941
+ linkDefinitions: n
1942
+ });
1943
+ Ma(t, e).forEach((s) => {
1944
+ const v = Va({
1945
+ children: r,
1946
+ aggregatedLink: s,
1947
+ scale: l,
1948
+ linkDefinitions: n
1949
+ });
1950
+ bt(t.links, s, v), bt(
1951
+ s.target.targetLinks,
1952
+ s,
1953
+ v
1954
+ );
1955
+ }), e.sourceLinks = [
1956
+ ...e.sourceLinks.filter(
1957
+ (s) => s.aggregatedFrom !== e.id
1958
+ ),
1959
+ ...c
1960
+ ], t.links.push(...c), t.nodes.push(...r);
1961
+ }
1962
+ function Ba({
1963
+ parent: t,
1964
+ children: e,
1965
+ childValues: r,
1966
+ scale: n,
1967
+ graph: a,
1968
+ options: o,
1969
+ extents: u
1970
+ }) {
1971
+ const i = t.x1 - t.x0, l = t.x1, c = Wa(a, t) ?? u.x1, s = Math.max(l, l + (c - l - i) / 2), v = r.map((_) => _ * n), m = Fa(e, o.nodePadding ?? 0), h = [...v, ...m].reduce(
1972
+ (_, x) => _ + x,
1973
+ 0
1974
+ );
1975
+ let g = Ga({ parent: t, children: e, totalHeight: h, extents: u });
1976
+ e.forEach((_, x) => {
1977
+ g += m[x], _.x0 = s, _.x1 = s + i, _.y0 = g, _.y1 = g + v[x], _.depth = t.depth + 0.5, _.layer = t.layer + 0.5, _.parentNodeId = t.id, _.value = r[x], _.sourceLinks = [], _.targetLinks = [], g = _.y1;
1978
+ });
1979
+ }
1980
+ function Fa(t, e) {
1981
+ return t.map(({ offset: r }, n) => n === 0 ? 0 : typeof r == "number" ? r : e);
1982
+ }
1983
+ function Ga({
1984
+ parent: t,
1985
+ children: e,
1986
+ totalHeight: r,
1987
+ extents: n
1988
+ }) {
1989
+ const { offset: a } = e[0];
1990
+ return typeof a == "number" ? t.y0 + a : Ua(
1991
+ (t.y0 + t.y1) / 2 - r / 2,
1992
+ n.y0,
1993
+ Math.max(n.y0, n.y1 - r)
1994
+ );
1995
+ }
1996
+ function ja({
1997
+ parent: t,
1998
+ children: e,
1999
+ childValues: r,
2000
+ scale: n,
2001
+ linkDefinitions: a
2002
+ }) {
2003
+ let o = t.y0;
2004
+ return e.map((u, i) => {
2005
+ const l = ut(a, t.id, u.id), c = r[i] * n, s = {
2006
+ id: (l == null ? void 0 : l.id) ?? `${t.id}:${u.id}`,
2007
+ color: l == null ? void 0 : l.color,
2008
+ curveFunction: l == null ? void 0 : l.curveFunction,
2009
+ source: t,
2010
+ target: u,
2011
+ value: r[i],
2012
+ width: c,
2013
+ y0: o + c / 2,
2014
+ y1: (u.y0 + u.y1) / 2
2015
+ };
2016
+ return o += c, u.targetLinks.push(s), s;
2017
+ });
2018
+ }
2019
+ function Va({
2020
+ children: t,
2021
+ aggregatedLink: e,
2022
+ scale: r,
2023
+ linkDefinitions: n
2024
+ }) {
2025
+ const a = e.target;
2026
+ let o = e.y1 - e.width / 2;
2027
+ return t.reduce((u, i) => {
2028
+ const l = ut(n, i.id, a.id);
2029
+ if (!l) return u;
2030
+ const c = l.value * r, s = i.sourceLinks.reduce(
2031
+ (m, { width: h }) => m + h,
2032
+ i.y0
2033
+ ), v = {
2034
+ id: l.id,
2035
+ color: l.color,
2036
+ curveFunction: l.curveFunction,
2037
+ source: i,
2038
+ target: a,
2039
+ value: l.value,
2040
+ width: c,
2041
+ y0: s + c / 2,
2042
+ y1: o + c / 2
2043
+ };
2044
+ return o += c, i.sourceLinks.push(v), u.push(v), u;
2045
+ }, []);
2046
+ }
2047
+ function Ma(t, e) {
2048
+ return t.links.filter(
2049
+ (r) => r.aggregatedFrom === e.id
2050
+ );
2051
+ }
2052
+ function Wt(t, e) {
2053
+ return t.filter(
2054
+ (r) => W(r.source) === e
2055
+ );
2056
+ }
2057
+ function ut(t, e, r) {
2058
+ return t.find(
2059
+ (n) => W(n.source) === e && W(n.target) === r
2060
+ );
2061
+ }
2062
+ function za(t, e, r) {
2063
+ const n = ut(t, e.id, r.id);
2064
+ return n ? n.value : Wt(t, r.id).reduce(
2065
+ (a, { value: o }) => a + o,
2066
+ 0
2067
+ );
2068
+ }
2069
+ function Wa(t, e) {
2070
+ const r = t.nodes.filter(
2071
+ (n) => n.layer === e.layer + 1
2072
+ );
2073
+ return r.length ? Math.min(...r.map(({ x0: n }) => n)) : null;
2074
+ }
2075
+ function bt(t, e, r) {
2076
+ const n = t.indexOf(e);
2077
+ if (n === -1) {
2078
+ t.push(...r);
2079
+ return;
2080
+ }
2081
+ t.splice(n, 1, ...r);
2082
+ }
2083
+ function Ua(t, e, r) {
2084
+ return Math.max(e, Math.min(t, r));
2085
+ }
2086
+ const Za = {
2087
+ nodes: [],
2088
+ links: []
2089
+ };
2090
+ function kt(t, e) {
2091
+ return e.find((r) => r.every((n) => n.layer === t.layer));
2092
+ }
2093
+ function Xa(t, e, r) {
2094
+ const n = I(null), {
2095
+ childIdsByParentId: a,
2096
+ expandedNodeIds: o,
2097
+ isExpandableNode: u,
2098
+ isSubNode: i,
2099
+ parentIdByChildId: l,
2100
+ toggleNodeExpansion: c
2101
+ } = Sa(t), s = f(() => {
2102
+ var d, p;
2103
+ return (p = (d = t.value) == null ? void 0 : d[0]) == null ? void 0 : p.values.map(
2104
+ ({
2105
+ label: y,
2106
+ color: b,
2107
+ value: A,
2108
+ deriveColorFromIncomingLinks: N,
2109
+ expandableNodes: T,
2110
+ offset: $
2111
+ }) => ({
2112
+ label: y || A.toString(),
2113
+ color: b,
2114
+ fallbackColor: b || Ae,
2115
+ id: A,
2116
+ deriveColorFromIncomingLinks: N,
2117
+ expandableNodes: T,
2118
+ offset: $
2119
+ })
2120
+ );
2121
+ }), v = f(
2122
+ () => {
2123
+ var d, p;
2124
+ return (p = (d = t.value) == null ? void 0 : d[0]) == null ? void 0 : p.values.map(
2125
+ (y) => {
2126
+ var b;
2127
+ return (b = y.targets) == null ? void 0 : b.map(
2128
+ ({ node: A, value: N, color: T, curveFunction: $ }) => ({
2129
+ id: `${y.value}:${A}`,
2130
+ color: T,
2131
+ curveFunction: $,
2132
+ source: y.value ?? y.label,
2133
+ target: A,
2134
+ value: N
2135
+ })
2136
+ );
2137
+ }
2138
+ ).filter(Boolean).flat();
2139
+ }
2140
+ ), m = f(() => Qt().nodeId(W).nodeAlign(e.value.nodeAlign).nodePadding(e.value.nodePadding).nodeSort(e.value.nodeSort).nodeWidth(e.value.nodeWidth).linkSort(e.value.linkSort).iterations(e.value.iterations)), h = f(() => {
2141
+ var d;
2142
+ return (d = n.value) == null ? void 0 : d.nodes.filter((p) => p.parentNodeId == null).reduce((p, y) => {
2143
+ const b = kt(y, p);
2144
+ return b ? (b.push(y), b.sort((A, N) => (A._y0 || A.y0) - (N._y0 || N.y0))) : p.push([y]), p;
2145
+ }, []).sort((p, y) => p[0].layer - y[0].layer);
2146
+ });
2147
+ function g(d) {
2148
+ const { offset: p } = d, y = kt(d, h.value);
2149
+ if (!y) return;
2150
+ const b = y[y.findIndex((N) => N.id === d.id) - 1], A = b && y.length !== 1 ? b.y1 + p : p;
2151
+ d._y0 = d.y0, d._y1 = d.y1, d.y0 = A, d.y1 = d.y0 + (d._y1 - d._y0);
2152
+ }
2153
+ function _(d, p) {
2154
+ const { id: y, _y0: b, y0: A } = d, N = p.links.filter(
2155
+ (R) => R.source.id === y
2156
+ ), T = p.links.filter(
2157
+ (R) => R.target.id === y
2158
+ ), $ = A - b;
2159
+ N.forEach((R) => R.y0 += $), T.forEach((R) => R.y1 += $);
2160
+ }
2161
+ const x = f(() => {
2162
+ var d;
2163
+ return n.value && ((d = s.value) == null || d.forEach((p) => {
2164
+ p.value === 0 && (p.fallbackColor = et.Grey), typeof p.offset == "number" && !i(p.id) && (g(p), _(p, n.value));
2165
+ })), n.value;
2166
+ });
2167
+ return H([m, r, o], () => {
2168
+ try {
2169
+ const { x0: d, y0: p, x1: y, y1: b } = r.value, A = m.value.extent([
2170
+ [d, p],
2171
+ [y, b]
2172
+ ])(
2173
+ Pa(
2174
+ s.value,
2175
+ v.value,
2176
+ a.value,
2177
+ l.value
2178
+ )
2179
+ );
2180
+ Ra({
2181
+ graph: A,
2182
+ nodes: s.value,
2183
+ linkDefinitions: v.value,
2184
+ expandedNodeIds: o.value,
2185
+ childIdsByParentId: a.value,
2186
+ options: e.value,
2187
+ extents: r.value
2188
+ }), n.value = A;
2189
+ } catch (d) {
2190
+ Ue(Ee.GraphProblem, d), n.value = Za;
2191
+ }
2192
+ }), { columns: h, graph: x, isExpandableNode: u, toggleNodeExpansion: c };
2193
+ }
2194
+ function Ze(t, e) {
2195
+ return e || (e = {}), t.targetLinks && t.targetLinks.forEach(({ source: r, value: n }) => {
2196
+ e[r.id] = n, Ze(
2197
+ r,
2198
+ e
2199
+ );
2200
+ }), e;
2201
+ }
2202
+ function Xe(t, e) {
2203
+ return e || (e = {}), t.sourceLinks && t.sourceLinks.forEach(({ target: r, value: n }) => {
2204
+ e[r.id] = n, Xe(
2205
+ r,
2206
+ e
2207
+ );
2208
+ }), e;
2209
+ }
2210
+ function Ya(t, e) {
2211
+ return e.links.reduce((r, n) => (n.source.id in t && n.target.id in t && r.push(n.id), r), []);
2212
+ }
2213
+ const Ka = (t, e) => {
2214
+ let r;
2215
+ jt(t) ? r = {
2216
+ [t.id]: t.value,
2217
+ ...Ze(t),
2218
+ ...Xe(t)
2219
+ } : r = {
2220
+ [t.source.id]: t.source.value,
2221
+ [t.target.id]: t.target.value,
2222
+ ...Ze(t.source),
2223
+ ...Xe(t.target)
2224
+ };
2225
+ const n = Ya(r, e);
2226
+ return { nodes: r, links: n };
2227
+ }, Ja = (t) => {
2228
+ if (jt(t)) {
2229
+ const e = [...t.sourceLinks, ...t.targetLinks];
2230
+ return {
2231
+ nodes: e.reduce(
2232
+ (r, { source: n, target: a, value: o }) => n === t ? { ...r, [W(a)]: o } : { ...r, [W(n)]: o },
2233
+ { [W(t)]: t.value }
2234
+ ),
2235
+ links: e.map(({ id: r }) => r)
2236
+ };
2237
+ }
2238
+ return {
2239
+ nodes: {
2240
+ [W(t.target)]: t.value,
2241
+ [W(t.source)]: t.source.value
2242
+ },
2243
+ links: [t.id]
2244
+ };
2245
+ };
2246
+ function Qa(t, e, r) {
2247
+ const n = I(null), a = f(() => n.value ? typeof e.value.highlightedElements == "function" ? e.value.highlightedElements(
2248
+ n.value,
2249
+ r.value
2250
+ ) : e.value.highlightedElements === "closest" ? Ja(n.value, r.value) : Ka(n.value, r.value) : { nodes: {}, links: [] });
2251
+ return H(a, (o, u) => {
2252
+ if (o.links.length === 0 && Object.keys(o.nodes).length === 0) {
2253
+ t.value.forEach((i) => {
2254
+ i.node.id in u.nodes && yt(
2255
+ i,
2256
+ u.nodes[i.node.id],
2257
+ i.node.value,
2258
+ e.value.withTransition,
2259
+ !0
2260
+ );
2261
+ });
2262
+ return;
2263
+ }
2264
+ t.value.forEach((i) => {
2265
+ i.node.id in o.nodes && yt(
2266
+ i,
2267
+ i.node.value,
2268
+ o.nodes[i.node.id],
2269
+ e.value.withTransition
2270
+ );
2271
+ });
2272
+ }), { highlightedElements: a, hoveredElement: n };
2273
+ }
2274
+ const qa = /* @__PURE__ */ P({
2275
+ __name: "lume-alluvial-group",
2276
+ props: {
2277
+ ...He(),
2278
+ hoveredElementId: {
2279
+ type: [Number, String],
2280
+ default: null
2281
+ }
2282
+ },
2283
+ emits: ["node-click", "node-mouseenter", "node-mouseleave", "link-click", "link-mouseenter", "link-mouseleave"],
2284
+ setup(t, { emit: e }) {
2285
+ const r = t, n = $e("chartID"), { data: a, options: o } = j(r), u = I([]), i = I([]), l = I(null), c = I(null), s = I(null), { extents: v, updateExtents: m } = xa(r.containerSize), { columns: h, graph: g, isExpandableNode: _, toggleNodeExpansion: x } = Xa(a, o, v), { hoveredElement: d, highlightedElements: p } = Qa(
2286
+ u,
2287
+ o,
2288
+ g
2289
+ ), y = f(() => Ne(o.value.valueFormat)), b = f(
2290
+ () => Object.keys(p.value.nodes)
2291
+ ), A = f(
2292
+ () => {
2293
+ var L, D;
2294
+ return (D = (L = g.value) == null ? void 0 : L.nodes) != null && D.length ? ot(g.value.nodes) : 0;
2295
+ }
2296
+ ), N = f(() => {
2297
+ if (!h.value) return [];
2298
+ const L = h.value.length - 1;
2299
+ return h.value.map(([{ x0: D, x1: B }], M) => M === 0 && o.value.alignFirstNodeLabels === "right" ? { x: D, align: "left" } : M === L && o.value.alignLastNodeLabels === "left" ? { x: B, align: "right" } : { x: (D + B) / 2, align: "center" });
2300
+ }), T = f(() => {
2301
+ if (!(!o.value.nodeHeaders || !o.value.nodeHeaders.length))
2302
+ return o.value.nodeHeaders.slice(0, N.value.length).map((L, D) => ({
2303
+ label: L,
2304
+ ...N.value[D]
2305
+ }));
2306
+ }), $ = f(
2307
+ () => o.value.nodeHeaderPadding ?? aa
2308
+ ), R = f(() => {
2309
+ if (!(!o.value.gradient || !g.value))
2310
+ return g.value.links.reduce((L, D) => {
2311
+ const { source: B, target: M } = D, Y = B.color || B.fallbackColor, z = M.deriveColorFromIncomingLinks ? Y : M.color || M.fallbackColor;
2312
+ return L[D.id] = {
2313
+ source: Y,
2314
+ target: z,
2315
+ x1: B.x1,
2316
+ x2: M.x0
2317
+ }, L;
2318
+ }, {});
2319
+ }), G = f(() => {
2320
+ const L = u.value.filter(
2321
+ (B) => E(B)
2322
+ ), D = [];
2323
+ return L.forEach((B) => {
2324
+ const M = [];
2325
+ i.value.filter(({ link: Y }) => Y.target.id === B.node.id).reverse().reduce((Y, z, ge, de) => {
2326
+ const he = z.link.target.y1 - z.link.target.y0 > ye;
2327
+ let Te, Oe, ve;
2328
+ return he ? (Te = z.link.target.y1 - z.link.target.y0, Oe = z.link.value / B.node.value, ve = Oe * Te) : ve = ye / de.length, M.push({
2329
+ x: B.x,
2330
+ y: B.y + Y,
2331
+ height: ve,
2332
+ width: B.width,
2333
+ key: `node-block-${B.node.id}-source-link-${z.link.source.id}`,
2334
+ class: `lume-alluvial-group__node-block lume-fill--${z.link.source.color || Ae}`
2335
+ }), Y + ve;
2336
+ }, 0), D.push({
2337
+ id: B.node.id,
2338
+ subNodes: M
2339
+ });
2340
+ }), D;
2341
+ });
2342
+ function V(L) {
2343
+ return o.value.gradient && `url('#${n}_${L.id}')`;
2344
+ }
2345
+ function ee(L) {
2346
+ return b.value.length > 0 && !b.value.includes(L.toString());
2347
+ }
2348
+ function ce(L) {
2349
+ return b.value.length > 0 && b.value.includes(L.toString());
2350
+ }
2351
+ function ae(L) {
2352
+ return p.value.links.length > 0 && !p.value.links.includes(L);
2353
+ }
2354
+ function oe(L) {
2355
+ return p.value.links.length > 0 && p.value.links.includes(L);
2356
+ }
2357
+ function ue(L) {
2358
+ return zt(L, o.value, A.value);
2359
+ }
2360
+ function E(L) {
2361
+ return !L.node.color && L.node.deriveColorFromIncomingLinks;
2362
+ }
2363
+ function w(L, D) {
2364
+ _(L.id) && x(L.id), e("node-click", { node: L, event: D });
2365
+ }
2366
+ function C(L, D) {
2367
+ L !== d.value && (d.value = L, e("link-mouseenter", { link: L, event: D }));
2368
+ }
2369
+ function te(L) {
2370
+ const D = d.value;
2371
+ d.value = null, e("link-mouseleave", { link: D, event: L });
2372
+ }
2373
+ function me(L) {
2374
+ if (L == null) {
2375
+ d.value = null;
2376
+ return;
2377
+ }
2378
+ const D = Ta(L, g.value) || Oa(L, g.value);
2379
+ if (!D) {
2380
+ ne(J.InvalidHoveredElement);
2381
+ return;
2382
+ }
2383
+ d.value = D;
2384
+ }
2385
+ function Se(L) {
2386
+ var D;
2387
+ return ((D = G.value.find(({ id: B }) => L === B)) == null ? void 0 : D.subNodes) ?? [];
2388
+ }
2389
+ function _e() {
2390
+ const L = Ia(
2391
+ g.value,
2392
+ l.value,
2393
+ o.value
2394
+ );
2395
+ m(L);
2396
+ }
2397
+ return H(g, (L) => {
2398
+ u.value = Na(L.nodes, o.value), i.value = Da(L.links).reverse(), d.value == null && r.hoveredElementId != null && me(r.hoveredElementId);
2399
+ }), H([c, s], () => {
2400
+ d.value = c.value ?? s.value;
2401
+ }), H([r.containerSize, l], () => {
2402
+ r.containerSize.width && r.containerSize.height && _e();
2403
+ }), H(
2404
+ () => [o.value.alignFirstNodeLabels, o.value.alignLastNodeLabels],
2405
+ _e
2406
+ ), H(() => r.hoveredElementId, me), { __sfc: !0, props: r, emit: e, chartID: n, data: a, options: o, nodeBlocks: u, linkPaths: i, nodeTextRefs: l, pointedNode: c, focusedNode: s, extents: v, updateExtents: m, columns: h, graph: g, isExpandableNode: _, toggleNodeExpansion: x, hoveredElement: d, highlightedElements: p, formatValue: y, hoveredNodeIds: b, lastNodeLayer: A, nodeColumnPositions: N, nodeHeaders: T, computedNodeHeaderPadding: $, gradients: R, nodesDerivingColorFromIncomingLinks: G, getLinkStroke: V, isNodeFaded: ee, isNodeFocused: ce, isLinkFaded: ae, isLinkFocused: oe, isLabelBeforeNode: ue, shouldDeriveNodeColorFromIncomingLinks: E, handleNodeClick: w, handleLinkMouseover: C, handleLinkMouseleave: te, handleExternalHover: me, getSubNodesDerivingColorFromIncomingLinks: Se, updateMargins: _e, LumeAlluvialNodeLabel: da, LumeAlluvialNodeValue: _a, LumeAlluvialNodeHeader: ka, GHOST_STROKE_WIDTH_OFFSET: ra, NODE_OUTLINE_PADDING: oa, NODE_OUTLINE_RADIUS: ua };
2407
+ }
2408
+ });
2409
+ var eo = function() {
2410
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2411
+ return r("g", { staticClass: "lume-alluvial-group", attrs: { "data-j-alluvial-group": "" } }, [n.nodeHeaders ? r("g", [e._l(n.nodeHeaders, function(a, o) {
2412
+ return [e._t(`node-header-${o}`, function() {
2413
+ return [r(n.LumeAlluvialNodeHeader, { key: `header_${a.x}`, attrs: { align: a.align, x: a.x, y: -n.computedNodeHeaderPadding } }, [e._v(" " + e._s(a.label) + " ")])];
2414
+ }, { align: a.align, x: a.x, y: -n.computedNodeHeaderPadding })];
2415
+ })], 2) : e._e(), r("g", { staticClass: "lume-alluvial-link-group", on: { mouseleave: n.handleLinkMouseleave } }, [n.options.gradient ? r("defs", e._l(n.gradients, function(a, o) {
2416
+ return r("linearGradient", { key: o, attrs: { id: `${n.chartID}_${o}`, gradientUnits: "userSpaceOnUse", x1: a.x1, x2: a.x2 } }, [r("stop", { attrs: { offset: "0%", "stop-color": `var(--lume-color--${a.source})` } }), r("stop", { attrs: { offset: "100%", "stop-color": `var(--lume-color--${a.target})` } })], 1);
2417
+ }), 1) : e._e(), e._l(n.linkPaths, function(a) {
2418
+ return r("path", { key: `link-ghost_${a.id}`, staticClass: "lume-alluvial-group__link", class: [
2419
+ "lume-stroke--transparent",
2420
+ "lume-alluvial-group__link--ghost"
2421
+ ], attrs: { d: a.d, "stroke-width": a.strokeWidth + n.GHOST_STROKE_WIDTH_OFFSET, "data-j-alluvial-ghost": "" }, on: { click: function(o) {
2422
+ return n.emit("link-click", { link: a.link, event: o });
2423
+ }, mouseover: function(o) {
2424
+ return n.handleLinkMouseover(a.link, o);
2425
+ } } });
2426
+ }), e._l(n.linkPaths, function(a) {
2427
+ return r("path", { key: `link_${a.id}`, staticClass: "lume-alluvial-group__link", class: {
2428
+ [`lume-stroke--${a.color}`]: !n.options.gradient && a.color,
2429
+ "lume-alluvial-group__link--faded": n.isLinkFaded(a.id),
2430
+ "lume-alluvial-group__link--focused": n.isLinkFocused(a.id)
2431
+ }, attrs: { d: a.d, stroke: n.getLinkStroke(a.link), "stroke-dasharray": e.containerSize.width, "stroke-dashoffset": e.containerSize.width, "stroke-width": a.strokeWidth, "data-j-alluvial-path": "", "data-id": a.id }, on: { click: function(o) {
2432
+ return n.emit("link-click", { link: a.link, event: o });
2433
+ }, mouseover: function(o) {
2434
+ return n.handleLinkMouseover(a.link, o);
2435
+ } } });
2436
+ })], 2), e._l(n.nodeBlocks, function(a, o) {
2437
+ return r("g", { key: `node-block_${o}`, staticClass: "lume-alluvial-group__node", class: {
2438
+ "lume-alluvial-group__node--expandable": n.isExpandableNode(
2439
+ a.node.id
2440
+ ),
2441
+ "lume-alluvial-group__node--faded": n.isNodeFaded(a.node.id),
2442
+ "lume-alluvial-group__node--focused": n.isNodeFocused(a.node.id)
2443
+ }, attrs: { "data-j-alluvial-group__node-block": "" } }, [r("g", { attrs: { tabindex: n.isExpandableNode(a.node.id) ? "0" : null }, on: { click: function(u) {
2444
+ return n.handleNodeClick(a.node, u);
2445
+ }, keydown: [function(u) {
2446
+ return !u.type.indexOf("key") && e._k(u.keyCode, "enter", 13, u.key, "Enter") ? null : (u.preventDefault(), n.handleNodeClick(a.node, u));
2447
+ }, function(u) {
2448
+ return !u.type.indexOf("key") && e._k(u.keyCode, "space", 32, u.key, [" ", "Spacebar"]) ? null : (u.preventDefault(), n.handleNodeClick(a.node, u));
2449
+ }], mouseenter: function(u) {
2450
+ return n.emit("node-mouseenter", { node: a.node, event: u });
2451
+ }, mouseleave: function(u) {
2452
+ return n.emit("node-mouseleave", { node: a.node, event: u });
2453
+ }, mouseover: function(u) {
2454
+ n.pointedNode = a.node;
2455
+ }, mouseout: function(u) {
2456
+ n.pointedNode = null;
2457
+ }, focus: function(u) {
2458
+ n.focusedNode = a.node;
2459
+ }, blur: function(u) {
2460
+ n.focusedNode = null;
2461
+ } } }, [n.shouldDeriveNodeColorFromIncomingLinks(a) ? e._l(n.getSubNodesDerivingColorFromIncomingLinks(
2462
+ a.node.id
2463
+ ), function(u) {
2464
+ return r("rect", e._b({ key: u.key, attrs: { "data-j-alluvial-sub-nodes": "" } }, "rect", u, !1));
2465
+ }) : r("rect", { staticClass: "lume-alluvial-group__node-block", class: `lume-fill--${a.node.color || a.node.fallbackColor}`, attrs: { x: a.x, y: a.y, height: a.height, width: a.width } }), n.isExpandableNode(a.node.id) ? r("rect", { staticClass: "lume-alluvial-group__node-outline", class: `lume-stroke--${a.node.color || a.node.fallbackColor}`, attrs: { x: a.x - n.NODE_OUTLINE_PADDING, y: a.y - n.NODE_OUTLINE_PADDING, height: a.height + n.NODE_OUTLINE_PADDING * 2, width: a.width + n.NODE_OUTLINE_PADDING * 2, rx: n.NODE_OUTLINE_RADIUS, "data-j-alluvial-node-outline": "" } }) : e._e(), r("g", { ref: "nodeTextRefs", refInFor: !0, staticClass: "lume-alluvial-group__node-text lume-typography--caption", class: {
2466
+ "lume-alluvial-group__node-text--left": n.isLabelBeforeNode(
2467
+ a.node
2468
+ )
2469
+ }, attrs: { transform: `translate(${a.textTransform.x},${a.textTransform.y})`, "data-id": a.node.id, width: n.options.nodeLabelMaxWidth } }, [e._t(`node-text-${a.node.id}`, function() {
2470
+ return [r(n.LumeAlluvialNodeLabel, { attrs: { bottom: n.options.switchText, left: n.isLabelBeforeNode(a.node), "max-width": n.options.nodeLabelMaxWidth }, on: { "lume__internal--node-resize": n.updateMargins } }, [e._v(" " + e._s(a.node.label) + " ")]), r(n.LumeAlluvialNodeValue, { attrs: { bottom: !n.options.switchText } }, [e._v(" " + e._s(n.formatValue(a.node.transitionValue || a.node.value, a.node.value)) + " ")])];
2471
+ }, { node: a.node, value: n.formatValue(
2472
+ a.node.transitionValue || a.node.value,
2473
+ a.node.value
2474
+ ) })], 2)], 2)]);
2475
+ })], 2);
2476
+ }, to = [], no = /* @__PURE__ */ S(
2477
+ qa,
2478
+ eo,
2479
+ to,
2480
+ !1,
2481
+ null,
2482
+ "8a5c4359"
2483
+ );
2484
+ const ro = no.exports, ao = {
2485
+ margins: {
2486
+ top: 0,
2487
+ right: 0,
2488
+ bottom: 0,
2489
+ left: 0
2490
+ },
2491
+ withAxes: !1,
2492
+ withTooltip: !1,
2493
+ withHover: !1,
2494
+ withLegend: !1,
2495
+ // Alluvial options
2496
+ alignFirstNodeLabels: "left",
2497
+ alignLastNodeLabels: "right",
2498
+ gradient: !1,
2499
+ highlightedElements: "closest",
2500
+ nodePadding: 16,
2501
+ nodeWidth: 16,
2502
+ nodeAlign: qt,
2503
+ valueFormat: (t) => String(t),
2504
+ iterations: 6
2505
+ }, oo = /* @__PURE__ */ P({
2506
+ __name: "lume-alluvial-diagram",
2507
+ props: {
2508
+ ...or(Ke)
2509
+ },
2510
+ setup(t, { emit: e }) {
2511
+ const r = t, { componentEventPropagator: n } = q(e), a = se(Z()), o = xn(Z()), { options: u } = j(r), { allOptions: i } = Q(u, ao);
2512
+ function l(c) {
2513
+ return {
2514
+ ...c,
2515
+ noBaseScales: !0
2516
+ // Alluvial chart never uses base scales
2517
+ };
2518
+ }
2519
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, groupSlots: o, options: u, allOptions: i, getAlluvialDiagramOptions: l, LumeChart: pe, LumeAlluvialGroup: ro };
2520
+ }
2521
+ });
2522
+ var uo = function() {
2523
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2524
+ return r(n.LumeChart, e._g(e._b({ attrs: { options: n.getAlluvialDiagramOptions(n.allOptions), "data-j-alluvial-diagram": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2525
+ return [r(n.LumeAlluvialGroup, e._g(e._b({ attrs: { "hovered-element-id": e.hoveredElement }, scopedSlots: e._u([e._l(n.groupSlots, function(o, u) {
2526
+ return { key: u, fn: function(i) {
2527
+ return [e._t(u, null, null, i || {})];
2528
+ } };
2529
+ })], null, !0) }, "lume-alluvial-group", a, !1), n.componentEventPropagator))];
2530
+ } }, e._l(n.slots, function(a, o) {
2531
+ return { key: o, fn: function(u) {
2532
+ return [e._t(o, null, null, u || {})];
2533
+ } };
2534
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2535
+ }, lo = [], io = /* @__PURE__ */ S(
2536
+ oo,
2537
+ uo,
2538
+ lo,
2539
+ !1,
2540
+ null,
2541
+ null
2542
+ );
2543
+ const xu = io.exports;
2544
+ var Ye = /* @__PURE__ */ ((t) => (t.grouped = "grouped", t.stacked = "stacked", t))(Ye || {});
2545
+ const so = /* @__PURE__ */ P({
2546
+ __name: "lume-bar-chart",
2547
+ props: {
2548
+ ...fe(),
2549
+ type: {
2550
+ type: String,
2551
+ default: null,
2552
+ validator: (t) => t in Ye || t == null
2553
+ }
2554
+ },
2555
+ setup(t, { emit: e }) {
2556
+ const r = t, n = Re(
2557
+ () => import("./DHB3p6kw.js")
2558
+ ), a = Re(
2559
+ () => import("./DiDq9ch9.js")
2560
+ ), o = Re(
2561
+ () => import("./DWtV4D8X.js")
2562
+ ), u = /* @__PURE__ */ new Map([
2563
+ ["single", n],
2564
+ ["grouped", a],
2565
+ ["stacked", o]
2566
+ ]), { componentEventPropagator: i } = q(e), l = se(Z());
2567
+ function c(v) {
2568
+ return {
2569
+ ...v,
2570
+ startOnZero: !0,
2571
+ // Bar chart always starts on zero,
2572
+ tooltipOptions: {
2573
+ ...(v == null ? void 0 : v.tooltipOptions) || {},
2574
+ position: r.orientation === O.HORIZONTAL ? "right" : void 0
2575
+ }
2576
+ };
2577
+ }
2578
+ const s = f(() => {
2579
+ if (Ke(r.data)) return u.get("single");
2580
+ if (!r.type)
2581
+ throw new Error("Bar chart needs a type when there's multiple datasets.");
2582
+ return u.get(r.type);
2583
+ });
2584
+ return { __sfc: !0, TYPES: Ye, LumeSingleBarChart: n, LumeGroupedBarChart: a, LumeStackedBarChart: o, COMPONENT_MAP: u, props: r, emit: e, componentEventPropagator: i, slots: l, getBarChartOptions: c, component: s };
2585
+ }
2586
+ });
2587
+ var co = function() {
2588
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2589
+ return r(n.component, e._g(e._b({ tag: "component", attrs: { options: n.getBarChartOptions(e.options) }, scopedSlots: e._u([e._l(n.slots, function(a, o) {
2590
+ return { key: o, fn: function(u) {
2591
+ return [e._t(o, null, null, u || {})];
2592
+ } };
2593
+ })], null, !0) }, "component", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2594
+ }, vo = [], fo = /* @__PURE__ */ S(
2595
+ so,
2596
+ co,
2597
+ vo,
2598
+ !1,
2599
+ null,
2600
+ null
2601
+ );
2602
+ const Lu = fo.exports;
2603
+ function po(t) {
2604
+ return Object.values(On).includes(t) || t == null;
2605
+ }
2606
+ function mo(t) {
2607
+ return Object.values(O).includes(t);
2608
+ }
2609
+ const _o = (t = !1) => ({
2610
+ type: {
2611
+ type: String,
2612
+ default: null,
2613
+ validator: po
2614
+ },
2615
+ ...t ? {
2616
+ orientation: {
2617
+ type: String,
2618
+ default: O.VERTICAL,
2619
+ validator: mo
2620
+ }
2621
+ } : {}
2622
+ });
2623
+ function Ut(t, e) {
2624
+ const r = f(() => t.value.map((a) => {
2625
+ var o;
2626
+ return {
2627
+ ...a,
2628
+ values: Je(
2629
+ a.values,
2630
+ ((o = e == null ? void 0 : e.value) == null ? void 0 : o.length) ?? 0
2631
+ ).map((u) => ({
2632
+ ...u,
2633
+ value: (u == null ? void 0 : u.value) || 0
2634
+ }))
2635
+ };
2636
+ })), n = f(() => {
2637
+ var a;
2638
+ return (a = r.value) == null ? void 0 : a.reduce((o, u) => (u.values.forEach((i, l) => {
2639
+ o[l] ? o[l].push(i) : o[l] = [i];
2640
+ }), o), []);
2641
+ });
2642
+ return { multiBarData: r, groupedData: n };
2643
+ }
2644
+ function go(t, e) {
2645
+ return t.value.length === 1 ? "single" : e.value;
2646
+ }
2647
+ function ho(t, e, r) {
2648
+ const n = f(
2649
+ () => r.value === O.HORIZONTAL
2650
+ );
2651
+ function a(i) {
2652
+ i || Ue(Ee.BarScaleNull), Math.min(...i.domain()) > 0 && Ue(Ee.BarScaleDomainAbove0);
2653
+ }
2654
+ const o = f(() => n.value ? (a(t.value), t.value) : t.value), u = f(() => n.value ? e.value : (a(e.value), e.value));
2655
+ return { barXScale: o, barYScale: u };
2656
+ }
2657
+ const yo = {
2658
+ x: 0,
2659
+ y: 0,
2660
+ width: 0,
2661
+ height: 0
2662
+ };
2663
+ function bo(t, e, r, n, a, o) {
2664
+ const u = f(
2665
+ () => n.value === O.HORIZONTAL
2666
+ );
2667
+ function i(v, m) {
2668
+ let h, g;
2669
+ return u.value ? (h = v >= 0 ? e.value(0) : e.value(v), g = r.value(r.value.domain()[m])) : (h = e.value(e.value.domain()[m]), g = v < 0 ? r.value(0) : r.value(v)), { x: h, y: g };
2670
+ }
2671
+ function l(v) {
2672
+ return u.value ? v < 0 ? e.value(0) - e.value(v) : e.value(v) - e.value(0) : e.value.bandwidth();
2673
+ }
2674
+ function c(v) {
2675
+ return u.value ? r.value.bandwidth() : v < 0 ? r.value(v) - r.value(0) : r.value(0) - r.value(v);
2676
+ }
2677
+ function s(v, m, h) {
2678
+ if (!(e.value && r.value)) return yo;
2679
+ const { value: _, color: x } = v, d = x ?? t.value[m].color ?? Ae, { x: p, y } = i(_, h), b = l(_), A = c(_);
2680
+ return {
2681
+ classList: [`lume-fill--${d}`, ...o],
2682
+ x: p,
2683
+ y,
2684
+ width: b,
2685
+ height: A,
2686
+ isFaded: a.value !== -1 && a.value !== h,
2687
+ isNegative: _ < 0
2688
+ };
2689
+ }
2690
+ return { barAttributeGenerator: s };
2691
+ }
2692
+ const ko = {
2693
+ x: 0,
2694
+ y: 0,
2695
+ width: 0,
2696
+ height: 0
2697
+ };
2698
+ function xo(t, e, r, n, a, o) {
2699
+ const u = f(
2700
+ () => n.value === O.HORIZONTAL
2701
+ ), i = f(() => ke().domain(t.value.map((g, _) => _)).range([0, e.value.bandwidth()]).padding(0)), l = f(() => ke().domain(t.value.map((g, _) => _)).range([0, r.value.bandwidth()]).padding(0));
2702
+ function c(g, _, x) {
2703
+ if (u.value)
2704
+ return g >= 0 ? e.value(0) : e.value(g);
2705
+ const d = e.value.domain();
2706
+ return e.value(d[_]) + i.value(x);
2707
+ }
2708
+ function s(g, _, x) {
2709
+ if (u.value) {
2710
+ const d = r.value.domain();
2711
+ return r.value(d[_]) + l.value(x);
2712
+ }
2713
+ return g < 0 ? r.value(0) : r.value(g);
2714
+ }
2715
+ function v(g) {
2716
+ return u.value ? g < 0 ? e.value(0) - e.value(g) : e.value(g) - e.value(0) : i.value.bandwidth();
2717
+ }
2718
+ function m(g) {
2719
+ return u.value ? l.value.bandwidth() : g < 0 ? r.value(g) - r.value(0) : r.value(0) - r.value(g);
2720
+ }
2721
+ function h(g, _, x) {
2722
+ if (!(e.value && r.value)) return ko;
2723
+ const { value: p, color: y } = g, b = y ?? t.value[_].color ?? Object.values(X)[_], A = c(p, x, _), N = s(p, x, _), T = v(p), $ = m(p);
2724
+ return {
2725
+ classList: [`lume-fill--${b}`, ...o],
2726
+ x: A,
2727
+ y: N,
2728
+ width: T,
2729
+ height: $,
2730
+ isFaded: a.value !== -1 && a.value !== x,
2731
+ isNegative: p < 0
2732
+ };
2733
+ }
2734
+ return { barAttributeGenerator: h };
2735
+ }
2736
+ function Lo(t, e, r) {
2737
+ const n = f(
2738
+ () => e.value === O.HORIZONTAL
2739
+ ), a = f(() => {
2740
+ const l = t.value.map(
2741
+ (c) => c.filter((s) => s.value < 0).reduce((s, v) => s + v.value, 0)
2742
+ );
2743
+ return Math.min(...l);
2744
+ }), o = f(() => {
2745
+ const l = t.value.map(
2746
+ (c) => c.reduce(
2747
+ (s, v) => v.value >= 0 ? s + v.value : s,
2748
+ 0
2749
+ )
2750
+ );
2751
+ return Math.max(...l);
2752
+ });
2753
+ function u(l, c, s) {
2754
+ return c.length ? n.value ? be().domain([a.value, o.value]).range([0, s.width]) : Object.assign(
2755
+ pt(
2756
+ ke().domain(c.map((v, m) => m)).range([0, s.width]),
2757
+ e.value,
2758
+ r.value
2759
+ ),
2760
+ { labels: c }
2761
+ ) : null;
2762
+ }
2763
+ function i(l, c, s) {
2764
+ return c.length ? n.value ? Object.assign(
2765
+ pt(
2766
+ ke().domain(c.map((v, m) => m)).range([0, s.height]),
2767
+ e.value,
2768
+ r.value
2769
+ ),
2770
+ { labels: c }
2771
+ ) : be().domain([o.value, a.value]).range([0, s.height]) : null;
2772
+ }
2773
+ return { stackedXScaleGenerator: u, stackedYScaleGenerator: i };
2774
+ }
2775
+ function Ao(t, e, r, n, a, o) {
2776
+ const u = f(
2777
+ () => n.value === O.HORIZONTAL
2778
+ ), i = f(
2779
+ () => u.value ? r.value.domain() : e.value.domain()
2780
+ ), l = f(
2781
+ () => t.value.map((d) => d.values.map((p) => p == null ? void 0 : p.value))
2782
+ );
2783
+ function c(d, p, y) {
2784
+ let b, A;
2785
+ return u.value ? (b = e.value(d >= 0 ? 0 + y : d + y), A = r.value(i.value[p])) : (b = e.value(i.value[p]), A = r.value(d >= 0 ? d + y : 0 + y)), { x: b, y: A };
2786
+ }
2787
+ function s(d) {
2788
+ return u.value ? e.value(d) - e.value(0) : e.value.bandwidth();
2789
+ }
2790
+ function v(d) {
2791
+ return u.value ? e.value(0) - e.value(d) : e.value.bandwidth();
2792
+ }
2793
+ function m(d) {
2794
+ return u.value ? r.value.bandwidth() : r.value(0) - r.value(d);
2795
+ }
2796
+ function h(d) {
2797
+ return u.value ? r.value.bandwidth() : r.value(d) - r.value(0);
2798
+ }
2799
+ function g(d, p) {
2800
+ return d ? l.value.reduce((y, b, A) => (A < d && b[p] >= 0 && (y += b[p]), y), 0) : 0;
2801
+ }
2802
+ function _(d, p) {
2803
+ return d ? l.value.reduce((y, b, A) => (A < d && b[p] < 0 && (y += b[p]), y), 0) : 0;
2804
+ }
2805
+ function x(d, p, y) {
2806
+ const { value: b, color: A } = d, N = b >= 0 ? s(b) : v(b), T = b >= 0 ? m(b) : h(b), $ = b >= 0 ? g(p, y) : _(p, y), { x: R, y: G } = c(b, y, $);
2807
+ return {
2808
+ classList: [`lume-fill--${A ?? t.value[p].color ?? Object.values(X)[p]}`, ...o],
2809
+ width: N,
2810
+ height: T,
2811
+ x: R,
2812
+ y: G,
2813
+ isFaded: a.value !== -1 && a.value !== y,
2814
+ isNegative: b < 0
2815
+ };
2816
+ }
2817
+ return { barAttributeGenerator: x };
2818
+ }
2819
+ const xt = {
2820
+ single: bo,
2821
+ grouped: xo,
2822
+ stacked: Ao
2823
+ }, To = /* @__PURE__ */ P({
2824
+ __name: "lume-bar-group",
2825
+ props: {
2826
+ ...He(),
2827
+ classList: {
2828
+ type: [String, Array],
2829
+ default: () => []
2830
+ },
2831
+ ..._o(!0),
2832
+ transition: {
2833
+ type: Boolean,
2834
+ default: !0
2835
+ }
2836
+ },
2837
+ emits: ["bar-click", "lume__internal--hover"],
2838
+ setup(t, { emit: e }) {
2839
+ const r = t, {
2840
+ data: n,
2841
+ hoveredIndex: a,
2842
+ orientation: o,
2843
+ transition: u,
2844
+ type: i,
2845
+ xScale: l,
2846
+ yScale: c,
2847
+ classList: s,
2848
+ labels: v
2849
+ } = j(r), m = $e("chartID"), { emitInternalEvent: h } = q(e, m), { groupedData: g } = Ut(n, v), { barXScale: _, barYScale: x } = ho(l, c, o), d = f(() => typeof s.value == "string" ? [s.value] : s.value), p = f(() => {
2850
+ const A = go(n, i), { barAttributeGenerator: N } = xt[A](
2851
+ n,
2852
+ _,
2853
+ x,
2854
+ o,
2855
+ a,
2856
+ d.value
2857
+ );
2858
+ return N;
2859
+ }), y = f(() => {
2860
+ if (u.value)
2861
+ return o.value === O.HORIZONTAL ? "width" : "height";
2862
+ });
2863
+ async function b(A) {
2864
+ e("lume__internal--hover", A), h("lume__internal--hover", A);
2865
+ }
2866
+ return { __sfc: !0, MIXIN_MAP: xt, props: r, emit: e, data: n, hoveredIndex: a, orientation: o, transition: u, type: i, xScale: l, yScale: c, classList: s, labels: v, chartID: m, emitInternalEvent: h, groupedData: g, barXScale: _, barYScale: x, computedClasses: d, getBarAttributes: p, computedTransition: y, handleInternalHover: b, LumeBar: Qe };
2867
+ }
2868
+ });
2869
+ var Oo = function() {
2870
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2871
+ return r("g", { staticClass: "lume-bar-group", attrs: { "data-j-bars-group": "" } }, e._l(n.groupedData, function(a, o) {
2872
+ return r("g", { key: o, on: { mouseenter: function(u) {
2873
+ return n.handleInternalHover(o);
2874
+ } } }, e._l(a, function(u, i) {
2875
+ return r(n.LumeBar, e._b({ key: `bar-${i}`, attrs: { transition: n.computedTransition, "data-j-lume-bar": "" }, on: { click: function(l) {
2876
+ return n.emit("bar-click", {
2877
+ index: o,
2878
+ datasetIndex: i,
2879
+ event: l
2880
+ });
2881
+ } } }, "lume-bar", n.getBarAttributes(u, i, o, a), !1));
2882
+ }), 1);
2883
+ }), 0);
2884
+ }, Io = [], No = /* @__PURE__ */ S(
2885
+ To,
2886
+ Oo,
2887
+ Io,
2888
+ !1,
2889
+ null,
2890
+ null
2891
+ );
2892
+ const lt = No.exports, Eo = {
2893
+ [O.VERTICAL]: {
2894
+ withTooltip: !0,
2895
+ xAxisOptions: {},
2896
+ yAxisOptions: { gridLines: !0 },
2897
+ margins: ie.VERTICAL
2898
+ },
2899
+ [O.HORIZONTAL]: {
2900
+ withTooltip: !0,
2901
+ xAxisOptions: { gridLines: !0 },
2902
+ yAxisOptions: { gridLines: !1 },
2903
+ margins: ie.HORIZONTAL
2904
+ }
2905
+ }, $o = /* @__PURE__ */ P({
2906
+ __name: "lume-single-bar-chart",
2907
+ props: {
2908
+ ...fe(Ke)
2909
+ },
2910
+ setup(t, { emit: e }) {
2911
+ const r = t, { componentEventPropagator: n } = q(e), a = se(Z()), { orientation: o, options: u } = j(r), i = f(
2912
+ () => Eo[o.value || O.VERTICAL]
2913
+ // needs to be computed so that default options are reactive
2914
+ ), { allOptions: l } = Q(u, i);
2915
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, orientation: o, options: u, baseOptions: i, allOptions: l, LumeChart: pe, LumeBarGroup: lt };
2916
+ }
2917
+ });
2918
+ var wo = function() {
2919
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2920
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "single-bar", options: n.allOptions, "data-j-single-bar-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2921
+ return [r(n.LumeBarGroup, e._g(e._b({ attrs: { orientation: n.orientation } }, "lume-bar-group", a, !1), n.componentEventPropagator))];
2922
+ } }, e._l(n.slots, function(a, o) {
2923
+ return { key: o, fn: function(u) {
2924
+ return [e._t(o, null, null, u || {})];
2925
+ } };
2926
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2927
+ }, Do = [], Ho = /* @__PURE__ */ S(
2928
+ $o,
2929
+ wo,
2930
+ Do,
2931
+ !1,
2932
+ null,
2933
+ null
2934
+ );
2935
+ const Au = Ho.exports, So = {
2936
+ [O.VERTICAL]: {
2937
+ withTooltip: !0,
2938
+ xAxisOptions: {},
2939
+ yAxisOptions: { gridLines: !0 },
2940
+ margins: ie.VERTICAL
2941
+ },
2942
+ [O.HORIZONTAL]: {
2943
+ withTooltip: !0,
2944
+ xAxisOptions: { gridLines: !0 },
2945
+ yAxisOptions: { gridLines: !1 },
2946
+ margins: ie.HORIZONTAL,
2947
+ tooltipOptions: { position: "right" }
2948
+ }
2949
+ }, Po = /* @__PURE__ */ P({
2950
+ __name: "lume-grouped-bar-chart",
2951
+ props: {
2952
+ ...fe()
2953
+ },
2954
+ setup(t, { emit: e }) {
2955
+ const r = t, { componentEventPropagator: n } = q(e), a = se(Z()), { orientation: o, options: u } = j(r), i = f(
2956
+ () => So[o.value || O.VERTICAL]
2957
+ // needs to be computed so that default options are reactive
2958
+ ), { allOptions: l } = Q(
2959
+ u,
2960
+ i
2961
+ );
2962
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, orientation: o, options: u, baseOptions: i, allOptions: l, LumeChart: pe, LumeBarGroup: lt };
2963
+ }
2964
+ });
2965
+ var Ro = function() {
2966
+ var e = this, r = e._self._c, n = e._self._setupProxy;
2967
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "grouped-bar", options: n.allOptions, "data-j-grouped-bar-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
2968
+ return [r(n.LumeBarGroup, e._g(e._b({ attrs: { type: "grouped" } }, "lume-bar-group", a, !1), n.componentEventPropagator))];
2969
+ } }, e._l(n.slots, function(a, o) {
2970
+ return { key: o, fn: function(u) {
2971
+ return [e._t(o, null, null, u || {})];
2972
+ } };
2973
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
2974
+ }, Co = [], Bo = /* @__PURE__ */ S(
2975
+ Po,
2976
+ Ro,
2977
+ Co,
2978
+ !1,
2979
+ null,
2980
+ null
2981
+ );
2982
+ const Tu = Bo.exports, Fo = {
2983
+ [O.VERTICAL]: {
2984
+ withTooltip: !0,
2985
+ xAxisOptions: {},
2986
+ yAxisOptions: { gridLines: !0 },
2987
+ margins: ie.VERTICAL,
2988
+ tooltipOptions: { inverse: !0 }
2989
+ },
2990
+ [O.HORIZONTAL]: {
2991
+ withTooltip: !0,
2992
+ xAxisOptions: { gridLines: !0 },
2993
+ yAxisOptions: { gridLines: !1 },
2994
+ margins: ie.HORIZONTAL,
2995
+ tooltipOptions: { position: "right" }
2996
+ }
2997
+ }, Go = /* @__PURE__ */ P({
2998
+ __name: "lume-stacked-bar-chart",
2999
+ props: {
3000
+ ...fe()
3001
+ },
3002
+ setup(t, { emit: e }) {
3003
+ const r = t, { componentEventPropagator: n } = q(e), a = se(Z()), { data: o, orientation: u, options: i, labels: l } = j(r), c = f(
3004
+ () => Fo[u.value || O.VERTICAL]
3005
+ // needs to be computed so that default options are reactive
3006
+ ), { allOptions: s } = Q(
3007
+ i,
3008
+ c
3009
+ ), { internalData: v } = rt(o), { groupedData: m } = Ut(v, l), { stackedXScaleGenerator: h, stackedYScaleGenerator: g } = Lo(
3010
+ m,
3011
+ u,
3012
+ i
3013
+ ), _ = f(() => r.xScale || h), x = f(() => r.yScale || g);
3014
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, data: o, orientation: u, options: i, labels: l, baseOptions: c, allOptions: s, internalData: v, groupedData: m, stackedXScaleGenerator: h, stackedYScaleGenerator: g, xScale: _, yScale: x, LumeChart: pe, LumeBarGroup: lt };
3015
+ }
3016
+ });
3017
+ var jo = function() {
3018
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3019
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "stacked-bar", options: n.allOptions, "x-scale": n.xScale, "y-scale": n.yScale, "data-j-stacked-bar-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
3020
+ return [r(n.LumeBarGroup, e._g(e._b({ attrs: { type: "stacked" } }, "lume-bar-group", a, !1), n.componentEventPropagator))];
3021
+ } }, e._l(n.slots, function(a, o) {
3022
+ return { key: o, fn: function(u) {
3023
+ return [e._t(o, null, null, u || {})];
3024
+ } };
3025
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
3026
+ }, Vo = [], Mo = /* @__PURE__ */ S(
3027
+ Go,
3028
+ jo,
3029
+ Vo,
3030
+ !1,
3031
+ null,
3032
+ null
3033
+ );
3034
+ const Ou = Mo.exports, Lt = 2, zo = /* @__PURE__ */ P({
3035
+ __name: "lume-line",
3036
+ props: {
3037
+ pathDefinition: {
3038
+ type: String,
3039
+ required: !0
3040
+ },
3041
+ width: {
3042
+ type: Number,
3043
+ default: Lt
3044
+ },
3045
+ color: {
3046
+ type: String,
3047
+ default: X.Skyblue
3048
+ },
3049
+ dashed: {
3050
+ type: Boolean,
3051
+ default: !1
3052
+ },
3053
+ transition: {
3054
+ type: Boolean,
3055
+ default: !0
3056
+ },
3057
+ animationDelay: {
3058
+ type: Number,
3059
+ default: 0
3060
+ },
3061
+ animationDuration: {
3062
+ type: Number,
3063
+ default: 0.2
3064
+ }
3065
+ },
3066
+ emits: ["click"],
3067
+ setup(t, { emit: e }) {
3068
+ const r = I(null);
3069
+ return re(() => De(r.value)), { __sfc: !0, DEFAULT_LINE_WIDTH: Lt, emit: e, root: r };
3070
+ }
3071
+ });
3072
+ var Wo = function() {
3073
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3074
+ return r("path", { ref: "root", staticClass: "lume-line", class: {
3075
+ [`lume-stroke--${e.color}`]: !0,
3076
+ "lume-line--dashed": e.dashed,
3077
+ "lume-line--transition": e.transition
3078
+ }, style: {
3079
+ animationDelay: e.transition && e.animationDelay + "s",
3080
+ animationDuration: e.transition && e.animationDuration + "s"
3081
+ }, attrs: { d: e.pathDefinition, "stroke-width": e.width, "data-j-line": "" }, on: { click: function(a) {
3082
+ return n.emit("click", a);
3083
+ } } });
3084
+ }, Uo = [], Zo = /* @__PURE__ */ S(
3085
+ zo,
3086
+ Wo,
3087
+ Uo,
3088
+ !1,
3089
+ null,
3090
+ "59449838"
3091
+ );
3092
+ const Xo = Zo.exports, At = 4, Tt = 3, Yo = /* @__PURE__ */ P({
3093
+ __name: "lume-point",
3094
+ props: {
3095
+ x: null,
3096
+ y: null,
3097
+ color: { default: X.Skyblue },
3098
+ radius: { default: At },
3099
+ active: { type: Boolean, default: !1 },
3100
+ visible: { type: Boolean, default: !1 }
3101
+ },
3102
+ emits: ["click"],
3103
+ setup(t, { emit: e }) {
3104
+ const r = t, n = I(null), a = f(() => r.radius / 2), o = f(() => r.active ? r.radius : r.visible ? Tt : 0);
3105
+ return re(() => De(n.value)), { __sfc: !0, DEFAULT_RADIUS: At, DEFAULT_VISIBLE_RADIUS: Tt, props: r, emit: e, root: n, strokeWidth: a, computedRadius: o };
3106
+ }
3107
+ });
3108
+ var Ko = function() {
3109
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3110
+ return r("circle", { ref: "root", staticClass: "lume-point", class: {
3111
+ [`lume-stroke--${e.color}`]: !0,
3112
+ "lume-point--active": e.active,
3113
+ [`lume-point--visible lume-fill--${e.color}`]: e.visible
3114
+ }, attrs: { cx: e.x, cy: e.y, r: n.computedRadius, "stroke-width": n.strokeWidth, "data-j-point": "" }, on: { click: function(a) {
3115
+ return n.emit("click", a);
3116
+ } } });
3117
+ }, Jo = [], Qo = /* @__PURE__ */ S(
3118
+ Yo,
3119
+ Ko,
3120
+ Jo,
3121
+ !1,
3122
+ null,
3123
+ "080270c0"
3124
+ );
3125
+ const qo = Qo.exports;
3126
+ function Zt(t, e) {
3127
+ function r(u) {
3128
+ let i = null;
3129
+ return u == null ? void 0 : u.reduce((l, c, s) => (c == null || c.value == null ? (i ? i.push(s) : i = [s], s === (u == null ? void 0 : u.length) - 1 && l.push(i)) : i && (l.push(i), i = null), l), []);
3130
+ }
3131
+ function n(u, i, l, c) {
3132
+ const m = Math.abs(u - i) / (l + 1) * (c + 1);
3133
+ return u == null && i == null ? null : u > i ? u - m : u + m;
3134
+ }
3135
+ function a(u) {
3136
+ return function(l) {
3137
+ return !!u.find(
3138
+ (c) => c.includes(l) || c.includes(l - 1)
3139
+ );
3140
+ };
3141
+ }
3142
+ return { computedLineData: f(
3143
+ () => t.value.map((u) => {
3144
+ const i = r(u.values);
3145
+ return {
3146
+ ...u,
3147
+ isDashed: a(i),
3148
+ values: u.values.map((l, c) => {
3149
+ var v, m, h, g;
3150
+ const s = i.find(
3151
+ (_) => _.includes(c)
3152
+ );
3153
+ if (s) {
3154
+ const _ = s[0] - 1, x = s[s.length - 1] + 1;
3155
+ let d = (v = u.values[_]) == null ? void 0 : v.value, p = (m = u.values[x]) == null ? void 0 : m.value;
3156
+ if (d == null) {
3157
+ const y = (g = (h = e == null ? void 0 : e.value) == null ? void 0 : h.domain) == null ? void 0 : g.call(h);
3158
+ d = (y == null ? void 0 : y[1]) ?? 0, p = d;
3159
+ } else p == null && (p = d);
3160
+ return {
3161
+ value: n(
3162
+ d,
3163
+ p,
3164
+ s.length,
3165
+ s.indexOf(c)
3166
+ ),
3167
+ label: St,
3168
+ isNull: !0
3169
+ };
3170
+ }
3171
+ return l;
3172
+ })
3173
+ };
3174
+ })
3175
+ ) };
3176
+ }
3177
+ function eu(t, e) {
3178
+ const r = t.bandwidth() / 2;
3179
+ return (n, a) => t(t.domain()[e + (a - 1)]) + r;
3180
+ }
3181
+ function tu(t, e) {
3182
+ return (r, n) => t(e + (n - 1));
3183
+ }
3184
+ function nu(t, e, r, n) {
3185
+ const a = rn().x(
3186
+ K(r) ? eu(r, t) : tu(r, t)
3187
+ ).y((o) => n(o));
3188
+ return e.every((o) => o == null) ? null : a(e);
3189
+ }
3190
+ const Ot = 1, ru = /* @__PURE__ */ P({
3191
+ __name: "lume-line-group",
3192
+ props: {
3193
+ ...He(),
3194
+ withPoints: {
3195
+ type: [Boolean, String],
3196
+ default: !0
3197
+ },
3198
+ transition: {
3199
+ type: Boolean,
3200
+ default: !0
3201
+ }
3202
+ },
3203
+ emits: ["line-click", "point-click", "lume__internal--hover"],
3204
+ setup(t, { emit: e }) {
3205
+ const r = t, { data: n, options: a, xScale: o, yScale: u, labels: i } = j(r), l = $e(
3206
+ "tooltipAnchorAttributes",
3207
+ null
3208
+ ), { updateTooltipAnchorAttributes: c } = Gt(
3209
+ l,
3210
+ a,
3211
+ o,
3212
+ u,
3213
+ i
3214
+ ), s = f(() => {
3215
+ if (n.value.every(($) => $.isDashed))
3216
+ return n.value;
3217
+ const { computedLineData: T } = Zt(
3218
+ n,
3219
+ u
3220
+ );
3221
+ return a.value.withTooltip !== !1 && (l != null && l.value) && c(T.value), T.value;
3222
+ }), v = f(() => {
3223
+ if (r.hoveredIndex === -1) return;
3224
+ const T = hn(
3225
+ s.value,
3226
+ r.hoveredIndex
3227
+ );
3228
+ return {
3229
+ d: `M ${je(o.value, r.hoveredIndex)},${u.value.range()[1]}
3230
+ V ${u.value(T)}`
3231
+ // Move to X index, Vertical line to the highest point
3232
+ };
3233
+ }), m = f(
3234
+ () => o.value && Ot / (yn(o.value) - 1)
3235
+ // Subtracting the first line (read below)
3236
+ ), h = f(
3237
+ () => {
3238
+ var T;
3239
+ return ((T = a.value) == null ? void 0 : T.lineWidth) * 2 || void 0;
3240
+ }
3241
+ // If no `lineWidth`, returns NaN which needs to be undefined
3242
+ ), g = f(
3243
+ () => o.value.bandwidth() / 2
3244
+ ), _ = f(() => o.value.domain()), x = f(
3245
+ () => a.value.withPoints ?? r.withPoints
3246
+ ), d = f(
3247
+ () => a.value.withPoints === "visible" || r.withPoints === "visible"
3248
+ );
3249
+ function p(T) {
3250
+ return s.value[T].values;
3251
+ }
3252
+ function y(T, $) {
3253
+ var G, V;
3254
+ const R = T === 0 ? [] : [
3255
+ (G = p($)[T - 1]) == null ? void 0 : G.value,
3256
+ (V = p($)[T]) == null ? void 0 : V.value
3257
+ ];
3258
+ return nu(
3259
+ T,
3260
+ R,
3261
+ o.value,
3262
+ u.value
3263
+ ) || "";
3264
+ }
3265
+ function b(T) {
3266
+ return {
3267
+ animationDelay: T < 2 ? 0 : (T - 1) * m.value,
3268
+ animationDuration: m.value
3269
+ };
3270
+ }
3271
+ function A(T, $) {
3272
+ var G;
3273
+ const R = (G = p($)[T]) == null ? void 0 : G.value;
3274
+ return {
3275
+ x: K(o.value) ? r.xScale(_.value[T]) + g.value : r.xScale(T),
3276
+ y: R === null ? u.value(u.value.domain()[1]) : u.value(R)
3277
+ };
3278
+ }
3279
+ function N(T) {
3280
+ return r.hoveredIndex === T;
3281
+ }
3282
+ return { __sfc: !0, LUME_TRANSITION_TIME_FULL: Ot, props: r, emit: e, data: n, options: a, xScale: o, yScale: u, labels: i, tooltipAnchorAttributes: l, updateTooltipAnchorAttributes: c, computedGroupData: s, overlayLineAttributes: v, animationDuration: m, pointRadius: h, xAxisOffset: g, domain: _, computedWithPoints: x, computedVisiblePoints: d, getValuesFromDataset: p, getPathDefinition: y, getLineTransitionParams: b, getPointPosition: A, isPointActive: N, LumeLine: Xo, LumePoint: qo };
3283
+ }
3284
+ });
3285
+ var au = function() {
3286
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3287
+ return r("g", { staticClass: "lume-line-group", attrs: { "data-j-lume-line-group": "" } }, [r("path", e._b({ staticClass: "lume-line-group__overlay-line", attrs: { "data-j-lume-line-group__overlay-line": "" } }, "path", n.overlayLineAttributes, !1)), e._l(n.computedGroupData, function(a, o) {
3288
+ return r("g", { key: a.label, staticClass: "lume-line-group__group" }, [r("g", { staticClass: "lume-line-group__lines" }, e._l(a.values, function(u, i) {
3289
+ return r(n.LumeLine, e._b({ key: `line-${i}`, attrs: { color: a.color, dashed: a.isDashed(i), "path-definition": n.getPathDefinition(i, o), transition: e.transition, width: n.options.lineWidth }, on: { click: function(l) {
3290
+ return n.emit("line-click", { index: i, datasetIndex: o, event: l });
3291
+ } } }, "lume-line", n.getLineTransitionParams(i), !1));
3292
+ }), 1), n.computedWithPoints ? r("g", { staticClass: "lume-line-group__points", attrs: { "data-j-lume-line-group__points": "" } }, [e._l(a.values, function(u, i) {
3293
+ return [u.isNull ? e._e() : r(n.LumePoint, e._b({ attrs: { active: n.isPointActive(i), color: a.color, index: i, radius: n.pointRadius, visible: n.computedVisiblePoints }, on: { click: function(l) {
3294
+ return n.emit("point-click", { index: i, datasetIndex: o, event: l });
3295
+ } } }, "lume-point", n.getPointPosition(i, o), !1))];
3296
+ })], 2) : e._e()]);
3297
+ })], 2);
3298
+ }, ou = [], uu = /* @__PURE__ */ S(
3299
+ ru,
3300
+ au,
3301
+ ou,
3302
+ !1,
3303
+ null,
3304
+ "898c2e7a"
3305
+ );
3306
+ const Xt = uu.exports, lu = {
3307
+ margins: ie.VERTICAL,
3308
+ startOnZero: !0,
3309
+ withTooltip: !0,
3310
+ xAxisOptions: {},
3311
+ yAxisOptions: { gridLines: !0 }
3312
+ }, iu = /* @__PURE__ */ P({
3313
+ __name: "lume-line-chart",
3314
+ props: {
3315
+ ...fe(null, !1)
3316
+ },
3317
+ setup(t, { emit: e }) {
3318
+ const r = t, { componentEventPropagator: n } = q(e), a = se(Z()), { options: o } = j(r), { allOptions: u } = Q(o, lu);
3319
+ return { __sfc: !0, props: r, emit: e, componentEventPropagator: n, slots: a, options: o, allOptions: u, LumeChart: pe, LumeLineGroup: Xt };
3320
+ }
3321
+ });
3322
+ var su = function() {
3323
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3324
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "line", options: n.allOptions, "data-j-lume-line-chart": "" }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
3325
+ return [r(n.LumeLineGroup, e._g(e._b({}, "lume-line-group", a, !1), n.componentEventPropagator))];
3326
+ } }, e._l(n.slots, function(a, o) {
3327
+ return { key: o, fn: function(u) {
3328
+ return [e._t(o, null, null, u || {})];
3329
+ } };
3330
+ })], null, !0) }, "lume-chart", { ...n.props, ...e.$attrs }, !1), n.componentEventPropagator));
3331
+ }, cu = [], du = /* @__PURE__ */ S(
3332
+ iu,
3333
+ su,
3334
+ cu,
3335
+ !1,
3336
+ null,
3337
+ null
3338
+ );
3339
+ const Iu = du.exports;
3340
+ function vu(t) {
3341
+ return { areaPathDefinition: f(
3342
+ () => function(r, n) {
3343
+ if (!r || !n || K(r) || K(n))
3344
+ return;
3345
+ const a = t.value[0].values;
3346
+ return an().x((o, u) => r(u)).y0(n(Math.min(...n.domain()))).y1((o) => n(o.value))(a);
3347
+ }
3348
+ ) };
3349
+ }
3350
+ const fu = {
3351
+ margins: {
3352
+ top: 0,
3353
+ right: 0,
3354
+ bottom: 0,
3355
+ left: 0
3356
+ },
3357
+ withAxes: !1,
3358
+ showArea: !0,
3359
+ startOnZero: !0,
3360
+ withLegend: !1,
3361
+ tooltipOptions: {
3362
+ showTitle: !1
3363
+ }
3364
+ }, pu = /* @__PURE__ */ P({
3365
+ __name: "lume-sparkline-chart",
3366
+ props: {
3367
+ ...nt(null),
3368
+ ...xe()
3369
+ },
3370
+ setup(t, { expose: e, emit: r }) {
3371
+ const n = t, { componentEventPropagator: a } = q(r), o = se(Z()), { data: u, options: i } = j(n), { internalData: l } = rt(u), { allOptions: c } = Q(i, fu), { computedLineData: s } = Zt(l), { areaPathDefinition: v } = vu(s), m = f(() => {
3372
+ var x, d;
3373
+ return (d = (x = l.value) == null ? void 0 : x[0]) == null ? void 0 : d.color;
3374
+ }), h = f(
3375
+ () => {
3376
+ var x, d;
3377
+ return ((d = (x = u.value) == null ? void 0 : x[0]) == null ? void 0 : d.areaColor) || m.value;
3378
+ }
3379
+ );
3380
+ function g(x) {
3381
+ return {
3382
+ ...x,
3383
+ noMinSize: !0
3384
+ };
3385
+ }
3386
+ function _(x, d, p) {
3387
+ if (x.length)
3388
+ return be().range([0, p.width]).domain([0, x[0].values.length - 1]);
3389
+ }
3390
+ return e({
3391
+ areaPathDefinition: v
3392
+ }), { __sfc: !0, props: n, emit: r, componentEventPropagator: a, slots: o, data: u, options: i, internalData: l, allOptions: c, computedLineData: s, areaPathDefinition: v, computedColor: m, areaColor: h, getSparklineOptions: g, xScaleGenerator: _, LumeChart: pe, LumeLineGroup: Xt };
3393
+ }
3394
+ });
3395
+ var mu = function() {
3396
+ var e = this, r = e._self._c, n = e._self._setupProxy;
3397
+ return r(n.LumeChart, e._g(e._b({ attrs: { "chart-type": "line", options: n.getSparklineOptions(n.allOptions), "x-scale": n.xScaleGenerator }, scopedSlots: e._u([{ key: "groups", fn: function(a) {
3398
+ return [n.allOptions.showArea ? r("path", { class: [
3399
+ "sparkline-chart__area",
3400
+ n.options.withTransition !== !1 ? "sparkline-chart__area--transition" : "",
3401
+ `lume-fill--${n.areaColor || n.computedColor}`,
3402
+ "lume-fill--faded"
3403
+ ], attrs: { d: n.areaPathDefinition(a.xScale, a.yScale), "data-j-sparkline__area": "" } }) : e._e(), r(n.LumeLineGroup, e._g(e._b({ attrs: { "with-points": !1 } }, "lume-line-group", a, !1), n.componentEventPropagator))];
3404
+ } }, e._l(n.slots, function(a, o) {
3405
+ return { key: o, fn: function(u) {
3406
+ return [e._t(o, null, null, u || {})];
3407
+ } };
3408
+ })], null, !0) }, "lume-chart", n.props, !1), n.componentEventPropagator));
3409
+ }, _u = [], gu = /* @__PURE__ */ S(
3410
+ pu,
3411
+ mu,
3412
+ _u,
3413
+ !1,
3414
+ null,
3415
+ "579f7e32"
3416
+ );
3417
+ const Nu = gu.exports;
3418
+ export {
3419
+ Mr as A,
3420
+ pt as B,
3421
+ le as C,
3422
+ qe as D,
3423
+ je as E,
3424
+ ft as F,
3425
+ at as G,
3426
+ rt as H,
3427
+ ar as I,
3428
+ Zt as J,
3429
+ zr as K,
3430
+ tt as L,
3431
+ Q as M,
3432
+ ur as N,
3433
+ et as O,
3434
+ Zr as P,
3435
+ Gt as Q,
3436
+ Xr as R,
3437
+ Ft as S,
3438
+ nt as T,
3439
+ fe as U,
3440
+ or as V,
3441
+ xe as W,
3442
+ rr as X,
3443
+ X as a,
3444
+ ro as b,
3445
+ ka as c,
3446
+ da as d,
3447
+ _a as e,
3448
+ Gn as f,
3449
+ Qe as g,
3450
+ Lu as h,
3451
+ lt as i,
3452
+ pe as j,
3453
+ dr as k,
3454
+ xu as l,
3455
+ _r as m,
3456
+ Tu as n,
3457
+ Xo as o,
3458
+ Iu as p,
3459
+ Xt as q,
3460
+ jr as r,
3461
+ qo as s,
3462
+ Au as t,
3463
+ Nu as u,
3464
+ Ou as v,
3465
+ Rr as w,
3466
+ wr as x,
3467
+ Or as y,
3468
+ kr as z
3469
+ };
3470
+ //# sourceMappingURL=BvvJadxi.js.map