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