@adyen/lume 1.11.0 → 1.11.2

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