@adyen/lume 0.5.3 → 0.6.1

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