@adyen/lume 0.1.8 → 0.2.0

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