@photon-ai/pho-ui 4.16.0 → 4.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{bar-chart-By5gWQqP.js → bar-chart-B-c6dujU.js} +2 -2
- package/dist/chunks/{bar-chart-By5gWQqP.js.map → bar-chart-B-c6dujU.js.map} +1 -1
- package/dist/chunks/{chart-Dx3rjeFn.js → chart-PPuzbeXN.js} +478 -438
- package/dist/chunks/chart-PPuzbeXN.js.map +1 -0
- package/dist/chunks/{line-chart-CAe09fqr.js → line-chart-CNvnFb-M.js} +2 -2
- package/dist/chunks/{line-chart-CAe09fqr.js.map → line-chart-CNvnFb-M.js.map} +1 -1
- package/dist/components/bar-chart.js +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/line-chart.js +1 -1
- package/dist/components/scope.js +1 -1
- package/dist/components/scope.js.map +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunks/chart-Dx3rjeFn.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { FADE_ENTRANCE as
|
|
4
|
-
import { t as
|
|
5
|
-
import { Children as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { useAnimate as
|
|
8
|
-
import { AreaSeries as
|
|
9
|
-
function
|
|
2
|
+
import { t as se } from "./cn-ChIgwEl3.js";
|
|
3
|
+
import { FADE_ENTRANCE as Ut, SPAN_SCALE as $e, SPRING_ENTRANCE as ge } from "../motion.js";
|
|
4
|
+
import { t as pe } from "./skeleton-DwjSl4vC.js";
|
|
5
|
+
import { Children as At, Fragment as Lt, isValidElement as It, useCallback as Kt, useContext as E, useEffect as Yt, useId as Ne, useLayoutEffect as $t, useMemo as L, useRef as Qe, useState as Et } from "react";
|
|
6
|
+
import { Fragment as Ht, jsx as u, jsxs as k } from "react/jsx-runtime";
|
|
7
|
+
import { useAnimate as Wt, useReducedMotion as Rt } from "motion/react";
|
|
8
|
+
import { AreaSeries as Pt, Axis as et, BarGroup as zt, BarSeries as Bt, BarStack as Ot, DataContext as z, DataProvider as jt, Grid as Xt, LineSeries as Gt, TooltipContext as Vt, TooltipProvider as qt, XYChart as Zt, buildChartTheme as Jt } from "@visx/xychart";
|
|
9
|
+
function tt(e) {
|
|
10
10
|
this._context = e;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
tt.prototype = {
|
|
13
13
|
areaStart: function() {
|
|
14
14
|
this._line = 0;
|
|
15
15
|
},
|
|
@@ -34,28 +34,28 @@ Je.prototype = {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
return new
|
|
37
|
+
function Qt(e) {
|
|
38
|
+
return new tt(e);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Ee(e) {
|
|
41
41
|
return e < 0 ? -1 : 1;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function He(e, t, n) {
|
|
44
44
|
var o = e._x1 - e._x0, r = t - e._x1, i = (e._y1 - e._y0) / (o || r < 0 && -0), a = (n - e._y1) / (r || o < 0 && -0), s = (i * r + a * o) / (o + r);
|
|
45
|
-
return (
|
|
45
|
+
return (Ee(i) + Ee(a)) * Math.min(Math.abs(i), Math.abs(a), 0.5 * Math.abs(s)) || 0;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function We(e, t) {
|
|
48
48
|
var n = e._x1 - e._x0;
|
|
49
49
|
return n ? (3 * (e._y1 - e._y0) / n - t) / 2 : t;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ve(e, t, n) {
|
|
52
52
|
var o = e._x0, r = e._y0, i = e._x1, a = e._y1, s = (i - o) / 3;
|
|
53
53
|
e._context.bezierCurveTo(o + s, r + s * t, i - s, a - s * n, i, a);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function le(e) {
|
|
56
56
|
this._context = e;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
le.prototype = {
|
|
59
59
|
areaStart: function() {
|
|
60
60
|
this._line = 0;
|
|
61
61
|
},
|
|
@@ -71,7 +71,7 @@ ae.prototype = {
|
|
|
71
71
|
this._context.lineTo(this._x1, this._y1);
|
|
72
72
|
break;
|
|
73
73
|
case 3:
|
|
74
|
-
|
|
74
|
+
ve(this, this._t0, We(this, this._t0));
|
|
75
75
|
}
|
|
76
76
|
(this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
|
77
77
|
},
|
|
@@ -86,25 +86,25 @@ ae.prototype = {
|
|
|
86
86
|
this._point = 2;
|
|
87
87
|
break;
|
|
88
88
|
case 2:
|
|
89
|
-
this._point = 3,
|
|
89
|
+
this._point = 3, ve(this, We(this, n = He(this, e, t)), n);
|
|
90
90
|
break;
|
|
91
91
|
default:
|
|
92
|
-
|
|
92
|
+
ve(this, this._t0, n = He(this, e, t));
|
|
93
93
|
}
|
|
94
94
|
this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t, this._t0 = n;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
function
|
|
99
|
-
this._context = new
|
|
98
|
+
function en(e) {
|
|
99
|
+
this._context = new nt(e);
|
|
100
100
|
}
|
|
101
|
-
(
|
|
102
|
-
|
|
101
|
+
(en.prototype = Object.create(le.prototype)).point = function(e, t) {
|
|
102
|
+
le.prototype.point.call(this, t, e);
|
|
103
103
|
};
|
|
104
|
-
function
|
|
104
|
+
function nt(e) {
|
|
105
105
|
this._context = e;
|
|
106
106
|
}
|
|
107
|
-
|
|
107
|
+
nt.prototype = {
|
|
108
108
|
moveTo: function(e, t) {
|
|
109
109
|
this._context.moveTo(t, e);
|
|
110
110
|
},
|
|
@@ -118,10 +118,10 @@ Qe.prototype = {
|
|
|
118
118
|
this._context.bezierCurveTo(t, e, o, n, i, r);
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
function
|
|
122
|
-
return new
|
|
121
|
+
function tn(e) {
|
|
122
|
+
return new le(e);
|
|
123
123
|
}
|
|
124
|
-
var
|
|
124
|
+
var Re = [
|
|
125
125
|
"chart-1",
|
|
126
126
|
"chart-2",
|
|
127
127
|
"chart-3",
|
|
@@ -129,11 +129,11 @@ var He = [
|
|
|
129
129
|
"chart-5",
|
|
130
130
|
"chart-6"
|
|
131
131
|
];
|
|
132
|
-
function
|
|
133
|
-
const n = e ??
|
|
132
|
+
function nn(e, t) {
|
|
133
|
+
const n = e ?? Re[t % Re.length];
|
|
134
134
|
return `var(--color-pho-${n.startsWith("chart-") ? n : `chart-${n}`})`;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Pe(e, t = !1) {
|
|
137
137
|
const n = new Intl.NumberFormat(e, t ? {
|
|
138
138
|
notation: "compact",
|
|
139
139
|
maximumFractionDigits: 1
|
|
@@ -144,28 +144,28 @@ function C(e, t) {
|
|
|
144
144
|
const n = e[t];
|
|
145
145
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function rn(e) {
|
|
148
148
|
return e.length <= 1 ? e[0] ?? "" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function on({ data: e, series: t, valueFormat: n, timeFormat: o }) {
|
|
151
151
|
if (e.length === 0) return "No data to show.";
|
|
152
|
-
const r = e[0], i = e[e.length - 1], a = e.length > 1 ? `${o(new Date(r.x))} to ${o(new Date(i.x))}` : o(new Date(r.x)), s = [`${
|
|
152
|
+
const r = e[0], i = e[e.length - 1], a = e.length > 1 ? `${o(new Date(r.x))} to ${o(new Date(i.x))}` : o(new Date(r.x)), s = [`${rn(t.map((c) => c.label))}, ${a}.`];
|
|
153
153
|
for (const c of t) {
|
|
154
154
|
let l = 0, h = 1 / 0, f = -1 / 0, g = null, p = 0;
|
|
155
|
-
for (const
|
|
156
|
-
const
|
|
157
|
-
|
|
155
|
+
for (const N of e) {
|
|
156
|
+
const _ = C(N, c.key);
|
|
157
|
+
_ != null && (p++, l += _, _ < h && (h = _), _ > f && (f = _, g = new Date(N.x)));
|
|
158
158
|
}
|
|
159
159
|
if (p === 0) {
|
|
160
160
|
s.push(`${c.label}: no values.`);
|
|
161
161
|
continue;
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
s.push(c.kind === "bar" ? `${c.label}: ${n(l)} in total${
|
|
163
|
+
const M = g ? `, peak ${n(f)} at ${o(g)}` : "";
|
|
164
|
+
s.push(c.kind === "bar" ? `${c.label}: ${n(l)} in total${M}.` : `${c.label}: from ${n(h)} to ${n(f)}${M}.`);
|
|
165
165
|
}
|
|
166
166
|
return s.join(" ");
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function rt({ color: e, kind: t = "rect", dashed: n }) {
|
|
169
169
|
return t === "line" ? /* @__PURE__ */ u("svg", {
|
|
170
170
|
"aria-hidden": !0,
|
|
171
171
|
width: "14",
|
|
@@ -187,13 +187,13 @@ function et({ color: e, kind: t = "rect", dashed: n }) {
|
|
|
187
187
|
style: { background: e }
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function an({ items: e, className: t, ...n }) {
|
|
191
191
|
return /* @__PURE__ */ u("ul", {
|
|
192
|
-
className:
|
|
192
|
+
className: se("text-pho-secondary flex flex-wrap gap-x-4 gap-y-1 text-xs", t),
|
|
193
193
|
...n,
|
|
194
|
-
children: e.map((o) => /* @__PURE__ */
|
|
194
|
+
children: e.map((o) => /* @__PURE__ */ k("li", {
|
|
195
195
|
className: "flex items-center gap-1.5",
|
|
196
|
-
children: [/* @__PURE__ */ u(
|
|
196
|
+
children: [/* @__PURE__ */ u(rt, {
|
|
197
197
|
color: o.color,
|
|
198
198
|
kind: o.kind,
|
|
199
199
|
dashed: o.dashed
|
|
@@ -201,15 +201,15 @@ function rn({ items: e, className: t, ...n }) {
|
|
|
201
201
|
}, o.label))
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ye(e, t) {
|
|
205
205
|
return e == null || t == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function sn(e, t) {
|
|
208
208
|
return e == null || t == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function ln(e) {
|
|
211
211
|
let t, n, o;
|
|
212
|
-
e.length !== 2 ? (t =
|
|
212
|
+
e.length !== 2 ? (t = ye, n = (s, c) => ye(e(s), c), o = (s, c) => e(s) - c) : (t = e === ye || e === sn ? e : cn, n = e, o = e);
|
|
213
213
|
function r(s, c, l = 0, h = s.length) {
|
|
214
214
|
if (l < h) {
|
|
215
215
|
if (t(c, c) !== 0) return h;
|
|
@@ -240,23 +240,23 @@ function an(e) {
|
|
|
240
240
|
right: i
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function cn() {
|
|
244
244
|
return 0;
|
|
245
245
|
}
|
|
246
|
-
var
|
|
247
|
-
function
|
|
248
|
-
const o = (t - e) / Math.max(0, n), r = Math.floor(Math.log10(o)), i = o / Math.pow(10, r), a = i >=
|
|
246
|
+
var un = Math.sqrt(50), hn = Math.sqrt(10), fn = Math.sqrt(2);
|
|
247
|
+
function ce(e, t, n) {
|
|
248
|
+
const o = (t - e) / Math.max(0, n), r = Math.floor(Math.log10(o)), i = o / Math.pow(10, r), a = i >= un ? 10 : i >= hn ? 5 : i >= fn ? 2 : 1;
|
|
249
249
|
let s, c, l;
|
|
250
|
-
return r < 0 ? (l = Math.pow(10, -r) / a, s = Math.round(e * l), c = Math.round(t * l), s / l < e && ++s, c / l > t && --c, l = -l) : (l = Math.pow(10, r) * a, s = Math.round(e / l), c = Math.round(t / l), s * l < e && ++s, c * l > t && --c), c < s && 0.5 <= n && n < 2 ?
|
|
250
|
+
return r < 0 ? (l = Math.pow(10, -r) / a, s = Math.round(e * l), c = Math.round(t * l), s / l < e && ++s, c / l > t && --c, l = -l) : (l = Math.pow(10, r) * a, s = Math.round(e / l), c = Math.round(t / l), s * l < e && ++s, c * l > t && --c), c < s && 0.5 <= n && n < 2 ? ce(e, t, n * 2) : [
|
|
251
251
|
s,
|
|
252
252
|
c,
|
|
253
253
|
l
|
|
254
254
|
];
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function dn(e, t, n) {
|
|
257
257
|
if (t = +t, e = +e, n = +n, !(n > 0)) return [];
|
|
258
258
|
if (e === t) return [e];
|
|
259
|
-
const o = t < e, [r, i, a] = o ?
|
|
259
|
+
const o = t < e, [r, i, a] = o ? ce(t, e, n) : ce(e, t, n);
|
|
260
260
|
if (!(i >= r)) return [];
|
|
261
261
|
const s = i - r + 1, c = new Array(s);
|
|
262
262
|
if (o)
|
|
@@ -266,15 +266,15 @@ function hn(e, t, n) {
|
|
|
266
266
|
else for (let l = 0; l < s; ++l) c[l] = (r + l) * a;
|
|
267
267
|
return c;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
return t = +t, e = +e, n = +n,
|
|
269
|
+
function ze(e, t, n) {
|
|
270
|
+
return t = +t, e = +e, n = +n, ce(e, t, n)[2];
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function ue(e, t, n) {
|
|
273
273
|
t = +t, e = +e, n = +n;
|
|
274
|
-
const o = t < e, r = o ?
|
|
274
|
+
const o = t < e, r = o ? ze(t, e, n) : ze(e, t, n);
|
|
275
275
|
return (o ? -1 : 1) * (r < 0 ? 1 / -r : r);
|
|
276
276
|
}
|
|
277
|
-
var
|
|
277
|
+
var xe = /* @__PURE__ */ new Date(), be = /* @__PURE__ */ new Date();
|
|
278
278
|
function T(e, t, n, o) {
|
|
279
279
|
function r(i) {
|
|
280
280
|
return e(i = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+i)), i;
|
|
@@ -296,203 +296,203 @@ function T(e, t, n, o) {
|
|
|
296
296
|
if (a >= a)
|
|
297
297
|
if (s < 0) for (; ++s <= 0; ) for (; t(a, -1), !i(a); ) ;
|
|
298
298
|
else for (; --s >= 0; ) for (; t(a, 1), !i(a); ) ;
|
|
299
|
-
}), n && (r.count = (i, a) => (
|
|
299
|
+
}), n && (r.count = (i, a) => (xe.setTime(+i), be.setTime(+a), e(xe), e(be), Math.floor(n(xe, be))), r.every = (i) => (i = Math.floor(i), !isFinite(i) || !(i > 0) ? null : i > 1 ? r.filter(o ? (a) => o(a) % i === 0 : (a) => r.count(0, a) % i === 0) : r)), r;
|
|
300
300
|
}
|
|
301
|
-
var
|
|
301
|
+
var he = T(() => {
|
|
302
302
|
}, (e, t) => {
|
|
303
303
|
e.setTime(+e + t);
|
|
304
304
|
}, (e, t) => t - e);
|
|
305
|
-
|
|
305
|
+
he.every = (e) => (e = Math.floor(e), !isFinite(e) || !(e > 0) ? null : e > 1 ? T((t) => {
|
|
306
306
|
t.setTime(Math.floor(t / e) * e);
|
|
307
307
|
}, (t, n) => {
|
|
308
308
|
t.setTime(+t + n * e);
|
|
309
|
-
}, (t, n) => (n - t) / e) :
|
|
310
|
-
var
|
|
309
|
+
}, (t, n) => (n - t) / e) : he);
|
|
310
|
+
var br = he.range, I = 1e3, S = I * 60, K = S * 60, Y = K * 24, Ce = Y * 7, Be = Y * 30, Te = Y * 365, ne = T((e) => {
|
|
311
311
|
e.setTime(e - e.getMilliseconds());
|
|
312
312
|
}, (e, t) => {
|
|
313
|
-
e.setTime(+e + t *
|
|
314
|
-
}, (e, t) => (t - e) /
|
|
315
|
-
e.setTime(e - e.getMilliseconds() - e.getSeconds() *
|
|
313
|
+
e.setTime(+e + t * I);
|
|
314
|
+
}, (e, t) => (t - e) / I, (e) => e.getUTCSeconds()), Tr = ne.range, it = T((e) => {
|
|
315
|
+
e.setTime(e - e.getMilliseconds() - e.getSeconds() * I);
|
|
316
316
|
}, (e, t) => {
|
|
317
|
-
e.setTime(+e + t *
|
|
318
|
-
}, (e, t) => (t - e) /
|
|
317
|
+
e.setTime(+e + t * S);
|
|
318
|
+
}, (e, t) => (t - e) / S, (e) => e.getMinutes()), Mr = it.range, ot = T((e) => {
|
|
319
319
|
e.setUTCSeconds(0, 0);
|
|
320
320
|
}, (e, t) => {
|
|
321
|
-
e.setTime(+e + t *
|
|
322
|
-
}, (e, t) => (t - e) /
|
|
323
|
-
e.setTime(e - e.getMilliseconds() - e.getSeconds() *
|
|
321
|
+
e.setTime(+e + t * S);
|
|
322
|
+
}, (e, t) => (t - e) / S, (e) => e.getUTCMinutes()), _r = ot.range, at = T((e) => {
|
|
323
|
+
e.setTime(e - e.getMilliseconds() - e.getSeconds() * I - e.getMinutes() * S);
|
|
324
324
|
}, (e, t) => {
|
|
325
|
-
e.setTime(+e + t *
|
|
326
|
-
}, (e, t) => (t - e) /
|
|
325
|
+
e.setTime(+e + t * K);
|
|
326
|
+
}, (e, t) => (t - e) / K, (e) => e.getHours()), kr = at.range, st = T((e) => {
|
|
327
327
|
e.setUTCMinutes(0, 0, 0);
|
|
328
328
|
}, (e, t) => {
|
|
329
|
-
e.setTime(+e + t *
|
|
330
|
-
}, (e, t) => (t - e) /
|
|
329
|
+
e.setTime(+e + t * K);
|
|
330
|
+
}, (e, t) => (t - e) / K, (e) => e.getUTCHours()), wr = st.range, q = T((e) => e.setHours(0, 0, 0, 0), (e, t) => e.setDate(e.getDate() + t), (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * S) / Y, (e) => e.getDate() - 1), Nr = q.range, mn = T((e) => {
|
|
331
331
|
e.setUTCHours(0, 0, 0, 0);
|
|
332
332
|
}, (e, t) => {
|
|
333
333
|
e.setUTCDate(e.getUTCDate() + t);
|
|
334
|
-
}, (e, t) => (t - e) /
|
|
334
|
+
}, (e, t) => (t - e) / Y, (e) => e.getUTCDate() - 1), Cr = mn.range, lt = T((e) => {
|
|
335
335
|
e.setUTCHours(0, 0, 0, 0);
|
|
336
336
|
}, (e, t) => {
|
|
337
337
|
e.setUTCDate(e.getUTCDate() + t);
|
|
338
|
-
}, (e, t) => (t - e) /
|
|
339
|
-
function
|
|
338
|
+
}, (e, t) => (t - e) / Y, (e) => Math.floor(e / Y)), Dr = lt.range;
|
|
339
|
+
function O(e) {
|
|
340
340
|
return T((t) => {
|
|
341
341
|
t.setDate(t.getDate() - (t.getDay() + 7 - e) % 7), t.setHours(0, 0, 0, 0);
|
|
342
342
|
}, (t, n) => {
|
|
343
343
|
t.setDate(t.getDate() + n * 7);
|
|
344
|
-
}, (t, n) => (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) *
|
|
344
|
+
}, (t, n) => (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * S) / Ce);
|
|
345
345
|
}
|
|
346
|
-
var
|
|
346
|
+
var ct = O(0), gn = O(1), pn = O(2), vn = O(3), yn = O(4), xn = O(5), bn = O(6), Sr = ct.range, Fr = gn.range, Ur = pn.range, Ar = vn.range, Lr = yn.range, Ir = xn.range, Kr = bn.range;
|
|
347
347
|
function j(e) {
|
|
348
348
|
return T((t) => {
|
|
349
349
|
t.setUTCDate(t.getUTCDate() - (t.getUTCDay() + 7 - e) % 7), t.setUTCHours(0, 0, 0, 0);
|
|
350
350
|
}, (t, n) => {
|
|
351
351
|
t.setUTCDate(t.getUTCDate() + n * 7);
|
|
352
|
-
}, (t, n) => (n - t) /
|
|
352
|
+
}, (t, n) => (n - t) / Ce);
|
|
353
353
|
}
|
|
354
|
-
var
|
|
354
|
+
var ut = j(0), Tn = j(1), Mn = j(2), _n = j(3), kn = j(4), wn = j(5), Nn = j(6), Yr = ut.range, $r = Tn.range, Er = Mn.range, Hr = _n.range, Wr = kn.range, Rr = wn.range, Pr = Nn.range, ht = T((e) => {
|
|
355
355
|
e.setDate(1), e.setHours(0, 0, 0, 0);
|
|
356
356
|
}, (e, t) => {
|
|
357
357
|
e.setMonth(e.getMonth() + t);
|
|
358
|
-
}, (e, t) => t.getMonth() - e.getMonth() + (t.getFullYear() - e.getFullYear()) * 12, (e) => e.getMonth()),
|
|
358
|
+
}, (e, t) => t.getMonth() - e.getMonth() + (t.getFullYear() - e.getFullYear()) * 12, (e) => e.getMonth()), zr = ht.range, ft = T((e) => {
|
|
359
359
|
e.setUTCDate(1), e.setUTCHours(0, 0, 0, 0);
|
|
360
360
|
}, (e, t) => {
|
|
361
361
|
e.setUTCMonth(e.getUTCMonth() + t);
|
|
362
|
-
}, (e, t) => t.getUTCMonth() - e.getUTCMonth() + (t.getUTCFullYear() - e.getUTCFullYear()) * 12, (e) => e.getUTCMonth()),
|
|
362
|
+
}, (e, t) => t.getUTCMonth() - e.getUTCMonth() + (t.getUTCFullYear() - e.getUTCFullYear()) * 12, (e) => e.getUTCMonth()), Br = ft.range, fe = T((e) => {
|
|
363
363
|
e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
|
|
364
364
|
}, (e, t) => {
|
|
365
365
|
e.setFullYear(e.getFullYear() + t);
|
|
366
366
|
}, (e, t) => t.getFullYear() - e.getFullYear(), (e) => e.getFullYear());
|
|
367
|
-
|
|
367
|
+
fe.every = (e) => !isFinite(e = Math.floor(e)) || !(e > 0) ? null : T((t) => {
|
|
368
368
|
t.setFullYear(Math.floor(t.getFullYear() / e) * e), t.setMonth(0, 1), t.setHours(0, 0, 0, 0);
|
|
369
369
|
}, (t, n) => {
|
|
370
370
|
t.setFullYear(t.getFullYear() + n * e);
|
|
371
371
|
});
|
|
372
|
-
var
|
|
372
|
+
var Or = fe.range, De = T((e) => {
|
|
373
373
|
e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
|
|
374
374
|
}, (e, t) => {
|
|
375
375
|
e.setUTCFullYear(e.getUTCFullYear() + t);
|
|
376
376
|
}, (e, t) => t.getUTCFullYear() - e.getUTCFullYear(), (e) => e.getUTCFullYear());
|
|
377
|
-
|
|
377
|
+
De.every = (e) => !isFinite(e = Math.floor(e)) || !(e > 0) ? null : T((t) => {
|
|
378
378
|
t.setUTCFullYear(Math.floor(t.getUTCFullYear() / e) * e), t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);
|
|
379
379
|
}, (t, n) => {
|
|
380
380
|
t.setUTCFullYear(t.getUTCFullYear() + n * e);
|
|
381
381
|
});
|
|
382
|
-
var
|
|
383
|
-
function
|
|
382
|
+
var jr = De.range;
|
|
383
|
+
function dt(e, t, n, o, r, i) {
|
|
384
384
|
const a = [
|
|
385
385
|
[
|
|
386
|
-
|
|
386
|
+
ne,
|
|
387
387
|
1,
|
|
388
|
-
|
|
388
|
+
I
|
|
389
389
|
],
|
|
390
390
|
[
|
|
391
|
-
|
|
391
|
+
ne,
|
|
392
392
|
5,
|
|
393
|
-
5 *
|
|
393
|
+
5 * I
|
|
394
394
|
],
|
|
395
395
|
[
|
|
396
|
-
|
|
396
|
+
ne,
|
|
397
397
|
15,
|
|
398
|
-
15 *
|
|
398
|
+
15 * I
|
|
399
399
|
],
|
|
400
400
|
[
|
|
401
|
-
|
|
401
|
+
ne,
|
|
402
402
|
30,
|
|
403
|
-
30 *
|
|
403
|
+
30 * I
|
|
404
404
|
],
|
|
405
405
|
[
|
|
406
406
|
i,
|
|
407
407
|
1,
|
|
408
|
-
|
|
408
|
+
S
|
|
409
409
|
],
|
|
410
410
|
[
|
|
411
411
|
i,
|
|
412
412
|
5,
|
|
413
|
-
5 *
|
|
413
|
+
5 * S
|
|
414
414
|
],
|
|
415
415
|
[
|
|
416
416
|
i,
|
|
417
417
|
15,
|
|
418
|
-
15 *
|
|
418
|
+
15 * S
|
|
419
419
|
],
|
|
420
420
|
[
|
|
421
421
|
i,
|
|
422
422
|
30,
|
|
423
|
-
30 *
|
|
423
|
+
30 * S
|
|
424
424
|
],
|
|
425
425
|
[
|
|
426
426
|
r,
|
|
427
427
|
1,
|
|
428
|
-
|
|
428
|
+
K
|
|
429
429
|
],
|
|
430
430
|
[
|
|
431
431
|
r,
|
|
432
432
|
3,
|
|
433
|
-
3 *
|
|
433
|
+
3 * K
|
|
434
434
|
],
|
|
435
435
|
[
|
|
436
436
|
r,
|
|
437
437
|
6,
|
|
438
|
-
6 *
|
|
438
|
+
6 * K
|
|
439
439
|
],
|
|
440
440
|
[
|
|
441
441
|
r,
|
|
442
442
|
12,
|
|
443
|
-
12 *
|
|
443
|
+
12 * K
|
|
444
444
|
],
|
|
445
445
|
[
|
|
446
446
|
o,
|
|
447
447
|
1,
|
|
448
|
-
|
|
448
|
+
Y
|
|
449
449
|
],
|
|
450
450
|
[
|
|
451
451
|
o,
|
|
452
452
|
2,
|
|
453
|
-
2 *
|
|
453
|
+
2 * Y
|
|
454
454
|
],
|
|
455
455
|
[
|
|
456
456
|
n,
|
|
457
457
|
1,
|
|
458
|
-
|
|
458
|
+
Ce
|
|
459
459
|
],
|
|
460
460
|
[
|
|
461
461
|
t,
|
|
462
462
|
1,
|
|
463
|
-
|
|
463
|
+
Be
|
|
464
464
|
],
|
|
465
465
|
[
|
|
466
466
|
t,
|
|
467
467
|
3,
|
|
468
|
-
3 *
|
|
468
|
+
3 * Be
|
|
469
469
|
],
|
|
470
470
|
[
|
|
471
471
|
e,
|
|
472
472
|
1,
|
|
473
|
-
|
|
473
|
+
Te
|
|
474
474
|
]
|
|
475
475
|
];
|
|
476
476
|
function s(l, h, f) {
|
|
477
477
|
const g = h < l;
|
|
478
478
|
g && ([l, h] = [h, l]);
|
|
479
|
-
const p = f && typeof f.range == "function" ? f : c(l, h, f),
|
|
480
|
-
return g ?
|
|
479
|
+
const p = f && typeof f.range == "function" ? f : c(l, h, f), M = p ? p.range(l, +h + 1) : [];
|
|
480
|
+
return g ? M.reverse() : M;
|
|
481
481
|
}
|
|
482
482
|
function c(l, h, f) {
|
|
483
|
-
const g = Math.abs(h - l) / f, p =
|
|
484
|
-
if (p === a.length) return e.every(
|
|
485
|
-
if (p === 0) return
|
|
486
|
-
const [
|
|
487
|
-
return
|
|
483
|
+
const g = Math.abs(h - l) / f, p = ln(([, , _]) => _).right(a, g);
|
|
484
|
+
if (p === a.length) return e.every(ue(l / Te, h / Te, f));
|
|
485
|
+
if (p === 0) return he.every(Math.max(ue(l, h, f), 1));
|
|
486
|
+
const [M, N] = a[g / a[p - 1][2] < a[p][2] / g ? p - 1 : p];
|
|
487
|
+
return M.every(N);
|
|
488
488
|
}
|
|
489
489
|
return [s, c];
|
|
490
490
|
}
|
|
491
|
-
var [
|
|
492
|
-
function
|
|
491
|
+
var [Xr, Gr] = dt(De, ft, ut, lt, st, ot), [Cn, Vr] = dt(fe, ht, ct, q, at, it);
|
|
492
|
+
function $(e) {
|
|
493
493
|
return typeof e == "number" ? e : e.getTime();
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Dn(e, t, n) {
|
|
496
496
|
if (!Number.isFinite(e) || !Number.isFinite(t)) return {
|
|
497
497
|
domain: [0, 1],
|
|
498
498
|
ticks: [0, 1],
|
|
@@ -517,7 +517,7 @@ function Cn(e, t, n) {
|
|
|
517
517
|
t > 0 ? e = 0 : t = 0;
|
|
518
518
|
}
|
|
519
519
|
for (let r = 4; r >= 2; r--) {
|
|
520
|
-
const i = o ?
|
|
520
|
+
const i = o ? Sn(e, t, r) : ue(e, t, r), a = Math.floor(e / i) * i, s = Math.ceil(t / i) * i, c = o ? Fn(a, s, i) : dn(a, s, r);
|
|
521
521
|
if (c.length <= 5 || r === 2) return {
|
|
522
522
|
domain: [a, s],
|
|
523
523
|
ticks: c,
|
|
@@ -530,38 +530,38 @@ function Cn(e, t, n) {
|
|
|
530
530
|
count: 1
|
|
531
531
|
};
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const o =
|
|
533
|
+
function Sn(e, t, n) {
|
|
534
|
+
const o = ue(e, t, n);
|
|
535
535
|
if (o <= 1) return 1;
|
|
536
536
|
if (Number.isInteger(o)) return o;
|
|
537
537
|
const r = 10 ** Math.floor(Math.log10(o)), i = o / r;
|
|
538
538
|
return (i <= 1 ? 1 : i <= 2 ? 2 : i <= 5 ? 5 : 10) * r;
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function Fn(e, t, n) {
|
|
541
541
|
const o = [];
|
|
542
542
|
for (let r = e; r <= t + n / 2; r += n) o.push(r);
|
|
543
543
|
return o;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function Un(e) {
|
|
546
546
|
if (e.length < 2) return 0;
|
|
547
547
|
const t = [];
|
|
548
548
|
for (let n = 1; n < e.length; n++) t.push(e[n] - e[n - 1]);
|
|
549
549
|
return t.sort((n, o) => n - o), t[Math.floor(t.length / 2)];
|
|
550
550
|
}
|
|
551
|
-
var
|
|
552
|
-
function
|
|
551
|
+
var An = 864e5;
|
|
552
|
+
function Ln(e, t, n) {
|
|
553
553
|
if (t <= e || n <= 0) return [new Date(e)];
|
|
554
|
-
const o = Math.max(2, Math.floor(n / 96)), r =
|
|
555
|
-
if (r.length > 2 && r.every((i) =>
|
|
554
|
+
const o = Math.max(2, Math.floor(n / 96)), r = Cn(new Date(e), new Date(t), o);
|
|
555
|
+
if (r.length > 2 && r.every((i) => In(i))) {
|
|
556
556
|
const i = r.slice(1).map((s, c) => q.count(r[c], s)), a = Math.max(...i);
|
|
557
557
|
if (a > 1 && i.some((s) => s !== a)) return q.range(r[0], new Date(t + 1), a);
|
|
558
558
|
}
|
|
559
559
|
return r;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function In(e) {
|
|
562
562
|
return q(e).getTime() === e.getTime();
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function Kn(e) {
|
|
565
565
|
const t = new Intl.DateTimeFormat(e, {
|
|
566
566
|
hour: "numeric",
|
|
567
567
|
minute: "2-digit"
|
|
@@ -572,10 +572,10 @@ function Ln(e) {
|
|
|
572
572
|
month: "short",
|
|
573
573
|
year: "numeric"
|
|
574
574
|
});
|
|
575
|
-
return (r) => q(r).getTime() < r.getTime() ? t.format(r) :
|
|
575
|
+
return (r) => q(r).getTime() < r.getTime() ? t.format(r) : fe(r).getTime() < r.getTime() ? n.format(r) : o.format(r);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
578
|
-
const n = new Intl.DateTimeFormat(e, t >=
|
|
577
|
+
function Yn(e, t) {
|
|
578
|
+
const n = new Intl.DateTimeFormat(e, t >= An ? {
|
|
579
579
|
month: "short",
|
|
580
580
|
day: "numeric"
|
|
581
581
|
} : {
|
|
@@ -586,15 +586,15 @@ function In(e, t) {
|
|
|
586
586
|
});
|
|
587
587
|
return (o) => n.format(o);
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function $n(e) {
|
|
590
590
|
return e.length * 6.5 + 16;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function En(e, t, n) {
|
|
593
593
|
if (e.length < 2) return [...e];
|
|
594
|
-
const o = Math.max(...e.map((a) =>
|
|
594
|
+
const o = Math.max(...e.map((a) => $n(t(a)))), r = Math.max(1, Math.floor(n / o)), i = Math.ceil(e.length / r);
|
|
595
595
|
return i <= 1 ? [...e] : e.filter((a, s) => s % i === 0);
|
|
596
596
|
}
|
|
597
|
-
function
|
|
597
|
+
function mt(e, t) {
|
|
598
598
|
if (e.length === 0) return -1;
|
|
599
599
|
let n = 0, o = e.length - 1;
|
|
600
600
|
for (; n < o; ) {
|
|
@@ -603,37 +603,37 @@ function ht(e, t) {
|
|
|
603
603
|
}
|
|
604
604
|
return n > 0 && t - e[n - 1] < e[n] - t ? n - 1 : n;
|
|
605
605
|
}
|
|
606
|
-
var
|
|
607
|
-
function
|
|
608
|
-
const o = n.reduce((a, s) => Math.max(a, s.length), 0), r = Math.ceil(o * 6.5) + 10, i = t -
|
|
606
|
+
var Me = 8, _e = 8, Oe = 22;
|
|
607
|
+
function Hn(e, t, n) {
|
|
608
|
+
const o = n.reduce((a, s) => Math.max(a, s.length), 0), r = Math.ceil(o * 6.5) + 10, i = t - Oe;
|
|
609
609
|
return {
|
|
610
610
|
width: e,
|
|
611
611
|
height: t,
|
|
612
612
|
left: r,
|
|
613
|
-
top:
|
|
614
|
-
right: e -
|
|
613
|
+
top: Me,
|
|
614
|
+
right: e - _e,
|
|
615
615
|
bottom: i,
|
|
616
|
-
innerWidth: Math.max(0, e - r -
|
|
617
|
-
innerHeight: Math.max(0, i -
|
|
616
|
+
innerWidth: Math.max(0, e - r - _e),
|
|
617
|
+
innerHeight: Math.max(0, i - Me),
|
|
618
618
|
margin: {
|
|
619
|
-
top:
|
|
620
|
-
right:
|
|
621
|
-
bottom:
|
|
619
|
+
top: Me,
|
|
620
|
+
right: _e,
|
|
621
|
+
bottom: Oe,
|
|
622
622
|
left: r
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
625
|
}
|
|
626
|
-
var
|
|
627
|
-
function
|
|
628
|
-
const g =
|
|
629
|
-
return /* @__PURE__ */
|
|
626
|
+
var Wn = { "--pho-chart-surface": "var(--pho-surface, var(--background-color-pho-primary))" };
|
|
627
|
+
function Rn({ label: e, description: t, height: n, containerRef: o, legend: r, loading: i, empty: a, showEmpty: s, placeholder: c, className: l, children: h, ...f }) {
|
|
628
|
+
const g = Ne();
|
|
629
|
+
return /* @__PURE__ */ k("div", {
|
|
630
630
|
"data-chart": "",
|
|
631
|
-
className:
|
|
631
|
+
className: se("flex w-full min-w-0 flex-col gap-3", l),
|
|
632
632
|
...f,
|
|
633
|
-
children: [/* @__PURE__ */
|
|
633
|
+
children: [/* @__PURE__ */ k("div", {
|
|
634
634
|
ref: o,
|
|
635
635
|
"aria-busy": i || void 0,
|
|
636
|
-
className:
|
|
636
|
+
className: se("relative w-full transition-opacity duration-150 ease-out", i && "opacity-50"),
|
|
637
637
|
style: { height: n },
|
|
638
638
|
children: [
|
|
639
639
|
/* @__PURE__ */ u("div", {
|
|
@@ -641,7 +641,7 @@ function Wn({ label: e, description: t, height: n, containerRef: o, legend: r, l
|
|
|
641
641
|
"aria-label": e,
|
|
642
642
|
"aria-describedby": g,
|
|
643
643
|
className: "animate-pho-chart-in relative size-full select-none [&_.visx-bar-stack_.visx-bar]:stroke-(--pho-chart-surface) [&_.visx-bar-stack_.visx-bar]:stroke-2 [&_svg]:block [&_svg]:overflow-visible",
|
|
644
|
-
style:
|
|
644
|
+
style: Wn,
|
|
645
645
|
children: h
|
|
646
646
|
}),
|
|
647
647
|
/* @__PURE__ */ u("p", {
|
|
@@ -658,7 +658,7 @@ function Wn({ label: e, description: t, height: n, containerRef: o, legend: r, l
|
|
|
658
658
|
}), r]
|
|
659
659
|
});
|
|
660
660
|
}
|
|
661
|
-
var
|
|
661
|
+
var Pn = [
|
|
662
662
|
0.42,
|
|
663
663
|
0.58,
|
|
664
664
|
0.5,
|
|
@@ -671,15 +671,15 @@ var Rn = [
|
|
|
671
671
|
0.56,
|
|
672
672
|
0.76,
|
|
673
673
|
0.64
|
|
674
|
-
],
|
|
674
|
+
], ae = [
|
|
675
675
|
0,
|
|
676
676
|
1 / 3,
|
|
677
677
|
2 / 3,
|
|
678
678
|
1
|
|
679
|
-
],
|
|
680
|
-
function
|
|
679
|
+
], zn = 5;
|
|
680
|
+
function Bn({ layout: e }) {
|
|
681
681
|
const { margin: t } = e;
|
|
682
|
-
return /* @__PURE__ */
|
|
682
|
+
return /* @__PURE__ */ k("div", {
|
|
683
683
|
"aria-hidden": !0,
|
|
684
684
|
"data-chart-skeleton": "",
|
|
685
685
|
className: "absolute inset-0 grid",
|
|
@@ -690,21 +690,21 @@ function Pn({ layout: e }) {
|
|
|
690
690
|
children: [
|
|
691
691
|
/* @__PURE__ */ u("div", {
|
|
692
692
|
className: "relative col-start-1 row-start-2",
|
|
693
|
-
children:
|
|
693
|
+
children: ae.map((n) => /* @__PURE__ */ u(pe, {
|
|
694
694
|
"data-bone": "y",
|
|
695
695
|
className: "absolute right-2 h-2.5 w-4 -translate-y-1/2",
|
|
696
696
|
style: { top: `${n * 100}%` }
|
|
697
697
|
}, n))
|
|
698
698
|
}),
|
|
699
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ k("div", {
|
|
700
700
|
className: "relative col-start-2 row-start-2",
|
|
701
|
-
children: [
|
|
702
|
-
"data-bone": o ===
|
|
703
|
-
className:
|
|
701
|
+
children: [ae.map((n, o) => /* @__PURE__ */ u("div", {
|
|
702
|
+
"data-bone": o === ae.length - 1 ? "baseline" : "grid",
|
|
703
|
+
className: se("absolute inset-x-0 border-t", o === ae.length - 1 ? "border-pho-chart-crosshair" : "border-pho-chart-grid"),
|
|
704
704
|
style: { top: `${n * 100}%` }
|
|
705
705
|
}, n)), /* @__PURE__ */ u("div", {
|
|
706
706
|
className: "absolute inset-0 flex items-end justify-between gap-2",
|
|
707
|
-
children:
|
|
707
|
+
children: Pn.map((n, o) => /* @__PURE__ */ u(pe, {
|
|
708
708
|
"data-bone": "bar",
|
|
709
709
|
className: "w-full max-w-6 rounded-t-[4px] rounded-b-none",
|
|
710
710
|
style: { height: `${n * 100}%` }
|
|
@@ -713,7 +713,7 @@ function Pn({ layout: e }) {
|
|
|
713
713
|
}),
|
|
714
714
|
/* @__PURE__ */ u("div", {
|
|
715
715
|
className: "col-start-2 row-start-3 flex items-center justify-between px-1",
|
|
716
|
-
children: Array.from({ length:
|
|
716
|
+
children: Array.from({ length: zn }, (n, o) => /* @__PURE__ */ u(pe, {
|
|
717
717
|
"data-bone": "x",
|
|
718
718
|
className: "h-2.5 w-8"
|
|
719
719
|
}, o))
|
|
@@ -721,7 +721,7 @@ function Pn({ layout: e }) {
|
|
|
721
721
|
]
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
|
-
var
|
|
724
|
+
var je = {
|
|
725
725
|
fontFamily: "inherit",
|
|
726
726
|
fontSize: 11,
|
|
727
727
|
fontWeight: 400,
|
|
@@ -729,15 +729,15 @@ var Be = {
|
|
|
729
729
|
fill: "var(--text-color-pho-description)",
|
|
730
730
|
style: { fontVariantNumeric: "tabular-nums" }
|
|
731
731
|
};
|
|
732
|
-
function
|
|
733
|
-
return
|
|
732
|
+
function On(e) {
|
|
733
|
+
return Jt({
|
|
734
734
|
backgroundColor: "var(--pho-surface, var(--background-color-pho-primary))",
|
|
735
735
|
colors: [...e],
|
|
736
736
|
gridColor: "var(--color-pho-chart-grid)",
|
|
737
737
|
gridColorDark: "var(--color-pho-chart-crosshair)",
|
|
738
738
|
tickLength: 4,
|
|
739
|
-
svgLabelSmall:
|
|
740
|
-
svgLabelBig:
|
|
739
|
+
svgLabelSmall: je,
|
|
740
|
+
svgLabelBig: je,
|
|
741
741
|
htmlLabel: {
|
|
742
742
|
fontFamily: "inherit",
|
|
743
743
|
fontSize: 11,
|
|
@@ -747,9 +747,9 @@ function Bn(e) {
|
|
|
747
747
|
}
|
|
748
748
|
});
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function jn({ x: e, width: t, top: n, heading: o, rows: r, breakdown: i, breakdownTitle: a, valueFormat: s, empty: c }) {
|
|
751
751
|
const l = e > t / 2;
|
|
752
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ k("div", {
|
|
753
753
|
"aria-hidden": !0,
|
|
754
754
|
"data-chart-tooltip": "",
|
|
755
755
|
className: "bg-pho-primary shadow-pho-lg ring-pho-secondary rounded-base pointer-events-none absolute z-10 max-w-72 min-w-40 px-3 py-2 text-xs ring-1 ring-inset",
|
|
@@ -771,11 +771,11 @@ function On({ x: e, width: t, top: n, heading: o, rows: r, breakdown: i, breakdo
|
|
|
771
771
|
}),
|
|
772
772
|
/* @__PURE__ */ u("ul", {
|
|
773
773
|
className: "mt-1 flex flex-col gap-0.5",
|
|
774
|
-
children: r.map((h) => /* @__PURE__ */
|
|
774
|
+
children: r.map((h) => /* @__PURE__ */ k("li", {
|
|
775
775
|
className: "flex items-center justify-between gap-4",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
776
|
+
children: [/* @__PURE__ */ k("span", {
|
|
777
777
|
className: "text-pho-secondary flex min-w-0 items-center gap-1.5",
|
|
778
|
-
children: [/* @__PURE__ */ u(
|
|
778
|
+
children: [/* @__PURE__ */ u(rt, {
|
|
779
779
|
color: h.color,
|
|
780
780
|
kind: h.kind,
|
|
781
781
|
dashed: h.dashed
|
|
@@ -789,14 +789,14 @@ function On({ x: e, width: t, top: n, heading: o, rows: r, breakdown: i, breakdo
|
|
|
789
789
|
})]
|
|
790
790
|
}, h.label))
|
|
791
791
|
}),
|
|
792
|
-
i != null && i.length > 0 && /* @__PURE__ */
|
|
792
|
+
i != null && i.length > 0 && /* @__PURE__ */ k("div", {
|
|
793
793
|
className: "border-pho-secondary mt-2 border-t pt-2",
|
|
794
794
|
children: [a != null && /* @__PURE__ */ u("div", {
|
|
795
795
|
className: "text-pho-description mb-1",
|
|
796
796
|
children: a
|
|
797
797
|
}), /* @__PURE__ */ u("ul", {
|
|
798
798
|
className: "flex flex-col gap-0.5",
|
|
799
|
-
children: i.map((h) => /* @__PURE__ */
|
|
799
|
+
children: i.map((h) => /* @__PURE__ */ k("li", {
|
|
800
800
|
className: "flex items-center justify-between gap-4",
|
|
801
801
|
children: [/* @__PURE__ */ u("span", {
|
|
802
802
|
className: "text-pho-secondary truncate",
|
|
@@ -811,10 +811,10 @@ function On({ x: e, width: t, top: n, heading: o, rows: r, breakdown: i, breakdo
|
|
|
811
811
|
]
|
|
812
812
|
});
|
|
813
813
|
}
|
|
814
|
-
var
|
|
815
|
-
function
|
|
816
|
-
const t =
|
|
817
|
-
return
|
|
814
|
+
var gt = typeof window > "u" ? Yt : $t;
|
|
815
|
+
function Xn(e) {
|
|
816
|
+
const t = Qe(null), [n, o] = Et(0);
|
|
817
|
+
return gt(() => {
|
|
818
818
|
if (e != null) return;
|
|
819
819
|
const r = t.current;
|
|
820
820
|
if (r == null || (o(r.getBoundingClientRect().width), typeof ResizeObserver > "u")) return;
|
|
@@ -825,25 +825,25 @@ function zn(e) {
|
|
|
825
825
|
return i.observe(r), () => i.disconnect();
|
|
826
826
|
}, [e]), [t, e ?? n];
|
|
827
827
|
}
|
|
828
|
-
var
|
|
829
|
-
function
|
|
828
|
+
var Gn = 24, pt = 4, Xe = 1, Ge = 2, Vn = 4, qn = 3, vt = "var(--pho-chart-surface)", Zn = "var(--background-color-pho-ghost-hover)", yt = "var(--color-pho-chart-crosshair)";
|
|
829
|
+
function Se(e) {
|
|
830
830
|
return null;
|
|
831
831
|
}
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
function
|
|
832
|
+
Se.displayName = "Chart.Bar";
|
|
833
|
+
Se.chartPart = "bar";
|
|
834
|
+
function Fe(e) {
|
|
835
835
|
return null;
|
|
836
836
|
}
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
function
|
|
837
|
+
Fe.displayName = "Chart.Line";
|
|
838
|
+
Fe.chartPart = "line";
|
|
839
|
+
function Jn(e) {
|
|
840
840
|
return e?.chartPart;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
return
|
|
844
|
-
if (!
|
|
845
|
-
const o =
|
|
846
|
-
if (n.type ===
|
|
842
|
+
function xt(e, t = []) {
|
|
843
|
+
return At.forEach(e, (n) => {
|
|
844
|
+
if (!It(n)) return;
|
|
845
|
+
const o = Jn(n.type);
|
|
846
|
+
if (n.type === Lt) xt(n.props.children, t);
|
|
847
847
|
else if (o === "bar") {
|
|
848
848
|
const r = n.props;
|
|
849
849
|
t.push({
|
|
@@ -868,21 +868,21 @@ function gt(e, t = []) {
|
|
|
868
868
|
}
|
|
869
869
|
}), t;
|
|
870
870
|
}
|
|
871
|
-
var
|
|
872
|
-
function
|
|
873
|
-
let t =
|
|
874
|
-
return t == null && (t = (n) => C(n, e) ?? 0,
|
|
871
|
+
var ke = (e) => $(e.x), Ve = /* @__PURE__ */ new Map();
|
|
872
|
+
function Qn(e) {
|
|
873
|
+
let t = Ve.get(e);
|
|
874
|
+
return t == null && (t = (n) => C(n, e) ?? 0, Ve.set(e, t)), t;
|
|
875
875
|
}
|
|
876
|
-
var
|
|
877
|
-
function
|
|
878
|
-
let t =
|
|
879
|
-
return t == null && (t = (n) => C(n, e) ?? NaN,
|
|
876
|
+
var qe = /* @__PURE__ */ new Map();
|
|
877
|
+
function Ze(e) {
|
|
878
|
+
let t = qe.get(e);
|
|
879
|
+
return t == null && (t = (n) => C(n, e) ?? NaN, qe.set(e, t)), t;
|
|
880
880
|
}
|
|
881
|
-
var
|
|
882
|
-
function
|
|
881
|
+
var Je = /* @__PURE__ */ new Map();
|
|
882
|
+
function er(e, t) {
|
|
883
883
|
const n = `${e} ${t}`;
|
|
884
|
-
let o =
|
|
885
|
-
return o == null && (o = (r) => C(r, e) ? t : "transparent",
|
|
884
|
+
let o = Je.get(n);
|
|
885
|
+
return o == null && (o = (r) => C(r, e) ? t : "transparent", Je.set(n, o)), o;
|
|
886
886
|
}
|
|
887
887
|
function Z(e) {
|
|
888
888
|
const t = e, n = typeof t.bandwidth == "function" ? t.bandwidth() / 2 : 0;
|
|
@@ -891,48 +891,48 @@ function Z(e) {
|
|
|
891
891
|
return typeof r == "number" && Number.isFinite(r) ? r + n : void 0;
|
|
892
892
|
};
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function Ue(e) {
|
|
895
895
|
const t = e;
|
|
896
896
|
return (n) => {
|
|
897
897
|
const o = t(Number(n));
|
|
898
898
|
return typeof o == "number" && Number.isFinite(o) ? o : void 0;
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function tr(e) {
|
|
902
902
|
const t = e;
|
|
903
903
|
return typeof t.step == "function" ? t.step() : 0;
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
const r = t > 0 ? e / t : 0, i = r >= 6 ? 2 : r >= 3 ? 1 : 0, a = Math.max(1, Math.min(
|
|
905
|
+
function nr(e, t, n, o) {
|
|
906
|
+
const r = t > 0 ? e / t : 0, i = r >= 6 ? 2 : r >= 3 ? 1 : 0, a = Math.max(1, Math.min(Gn, r - i)), s = Math.min(2, i), c = o ? a + s : n > 1 ? a + 2 * s : a, l = Math.min(r, c), h = r > 0 ? 1 - l / r : 0, f = n > 1 && l > s ? Math.min(0.5, s * n / (l - s)) : 0;
|
|
907
907
|
return {
|
|
908
908
|
paddingInner: h,
|
|
909
909
|
paddingOuter: h / 2,
|
|
910
910
|
groupPadding: f
|
|
911
911
|
};
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
const { dataRegistry: t } = E(
|
|
915
|
-
return t?.entries().some((n) => n.data.length > 0) ?? !1 ? /* @__PURE__ */ u(
|
|
913
|
+
function we({ children: e }) {
|
|
914
|
+
const { dataRegistry: t } = E(z);
|
|
915
|
+
return t?.entries().some((n) => n.data.length > 0) ?? !1 ? /* @__PURE__ */ u(Ht, { children: e }) : null;
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
const o = E(
|
|
917
|
+
function Ae(e, t, n) {
|
|
918
|
+
const o = E(Vt);
|
|
919
919
|
if (!o?.tooltipOpen) return null;
|
|
920
920
|
if (n) {
|
|
921
921
|
const i = o.tooltipLeft;
|
|
922
922
|
if (i == null || t == null || e.length === 0) return null;
|
|
923
923
|
const a = Z(t), s = [];
|
|
924
924
|
for (const c of e) {
|
|
925
|
-
const l = a(
|
|
925
|
+
const l = a($(c.x));
|
|
926
926
|
if (l == null) return null;
|
|
927
927
|
s.push(l);
|
|
928
928
|
}
|
|
929
|
-
return
|
|
929
|
+
return mt(s, i);
|
|
930
930
|
}
|
|
931
931
|
const r = o.tooltipData?.nearestDatum?.index;
|
|
932
932
|
return r != null && r >= 0 && r < e.length ? r : null;
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
const { xScale: o } = E(
|
|
934
|
+
function rr({ values: e, format: t, layout: n }) {
|
|
935
|
+
const { xScale: o } = E(z), r = Kt((i) => {
|
|
936
936
|
const a = i, s = Z(o)(a) ?? n.left, c = t(a).length * 6.5 / 2;
|
|
937
937
|
return { textAnchor: s - c < n.left ? "start" : s + c > n.right ? "end" : "middle" };
|
|
938
938
|
}, [
|
|
@@ -941,7 +941,7 @@ function nr({ values: e, format: t, layout: n }) {
|
|
|
941
941
|
n.left,
|
|
942
942
|
n.right
|
|
943
943
|
]);
|
|
944
|
-
return /* @__PURE__ */ u(
|
|
944
|
+
return /* @__PURE__ */ u(et, {
|
|
945
945
|
orientation: "bottom",
|
|
946
946
|
tickValues: [...e],
|
|
947
947
|
tickFormat: (i) => t(i),
|
|
@@ -950,44 +950,44 @@ function nr({ values: e, format: t, layout: n }) {
|
|
|
950
950
|
tickLabelProps: r
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
|
-
function
|
|
954
|
-
const { xScale: o } = E(
|
|
953
|
+
function ir({ data: e, layout: t, hasConnectedLines: n }) {
|
|
954
|
+
const { xScale: o } = E(z), r = Ae(e, o, n);
|
|
955
955
|
if (r == null || o == null) return null;
|
|
956
|
-
const i = Z(o)(
|
|
956
|
+
const i = Z(o)($(e[r].x)), a = tr(o);
|
|
957
957
|
return i == null ? null : /* @__PURE__ */ u("rect", {
|
|
958
958
|
"data-hover-wash": "",
|
|
959
959
|
x: i - a / 2,
|
|
960
960
|
y: t.top,
|
|
961
961
|
width: a,
|
|
962
962
|
height: t.innerHeight,
|
|
963
|
-
fill:
|
|
963
|
+
fill: Zn
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
const { yScale: t } = E(
|
|
966
|
+
function or({ layout: e }) {
|
|
967
|
+
const { yScale: t } = E(z), n = t ? Ue(t)(0) : void 0;
|
|
968
968
|
return n == null ? null : /* @__PURE__ */ u("line", {
|
|
969
969
|
"data-zero": "",
|
|
970
970
|
x1: e.left,
|
|
971
971
|
x2: e.right,
|
|
972
972
|
y1: n,
|
|
973
973
|
y2: n,
|
|
974
|
-
stroke:
|
|
974
|
+
stroke: yt
|
|
975
975
|
});
|
|
976
976
|
}
|
|
977
|
-
function
|
|
978
|
-
const { xScale: i, yScale: a } = E(
|
|
977
|
+
function ar({ data: e, layout: t, lines: n, crosshair: o, hasConnectedLines: r }) {
|
|
978
|
+
const { xScale: i, yScale: a } = E(z), s = Ae(e, i, r);
|
|
979
979
|
if (s == null || i == null || a == null) return null;
|
|
980
|
-
const c = e[s], l = Z(i)(
|
|
980
|
+
const c = e[s], l = Z(i)($(c.x));
|
|
981
981
|
if (l == null) return null;
|
|
982
|
-
const h =
|
|
983
|
-
return /* @__PURE__ */
|
|
982
|
+
const h = Ue(a);
|
|
983
|
+
return /* @__PURE__ */ k("g", {
|
|
984
984
|
"data-hover": "",
|
|
985
985
|
children: [o && /* @__PURE__ */ u("line", {
|
|
986
986
|
x1: l,
|
|
987
987
|
x2: l,
|
|
988
988
|
y1: t.top,
|
|
989
989
|
y2: t.bottom,
|
|
990
|
-
stroke:
|
|
990
|
+
stroke: yt
|
|
991
991
|
}), n.length > 0 && /* @__PURE__ */ u("g", {
|
|
992
992
|
"data-points": "",
|
|
993
993
|
children: n.map((f) => {
|
|
@@ -997,46 +997,46 @@ function or({ data: e, layout: t, lines: n, crosshair: o, hasConnectedLines: r }
|
|
|
997
997
|
cy: p,
|
|
998
998
|
r: Vn,
|
|
999
999
|
fill: f.color,
|
|
1000
|
-
stroke:
|
|
1000
|
+
stroke: vt,
|
|
1001
1001
|
strokeWidth: 2
|
|
1002
1002
|
}, f.dataKey);
|
|
1003
1003
|
})
|
|
1004
1004
|
})]
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
const { xScale: t, yScale: n } = E(
|
|
1007
|
+
function sr({ lines: e }) {
|
|
1008
|
+
const { xScale: t, yScale: n } = E(z);
|
|
1009
1009
|
if (e.length === 0 || t == null || n == null) return null;
|
|
1010
|
-
const o = Z(t), r =
|
|
1010
|
+
const o = Z(t), r = Ue(n);
|
|
1011
1011
|
return /* @__PURE__ */ u("g", {
|
|
1012
1012
|
"data-lone-points": "",
|
|
1013
1013
|
children: e.map((i) => i.points.map((a, s) => {
|
|
1014
|
-
const c = o(
|
|
1014
|
+
const c = o($(a.x)), l = r(a.value);
|
|
1015
1015
|
return c == null || l == null ? null : /* @__PURE__ */ u("circle", {
|
|
1016
1016
|
cx: c,
|
|
1017
1017
|
cy: l,
|
|
1018
|
-
r:
|
|
1018
|
+
r: qn,
|
|
1019
1019
|
fill: i.color,
|
|
1020
|
-
stroke:
|
|
1020
|
+
stroke: vt,
|
|
1021
1021
|
strokeWidth: 2,
|
|
1022
1022
|
paintOrder: "stroke"
|
|
1023
1023
|
}, `${i.dataKey} ${s}`);
|
|
1024
1024
|
}))
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const r =
|
|
1029
|
-
|
|
1027
|
+
function lr({ data: e, range: t, layout: n, children: o }) {
|
|
1028
|
+
const r = Rt(), [i, a] = Wt(), s = Ne(), c = Qe(null);
|
|
1029
|
+
gt(() => {
|
|
1030
1030
|
const h = i.current, f = c.current;
|
|
1031
1031
|
if (c.current = t, e.length === 0 || r || h == null) return;
|
|
1032
|
-
const g = { opacity:
|
|
1032
|
+
const g = { opacity: Ut }, p = f == null ? a(h, {
|
|
1033
1033
|
scaleY: [0, 1],
|
|
1034
1034
|
scaleX: 1,
|
|
1035
1035
|
x: 0,
|
|
1036
1036
|
opacity: [0, 1],
|
|
1037
1037
|
originY: 1
|
|
1038
1038
|
}, {
|
|
1039
|
-
scaleY:
|
|
1039
|
+
scaleY: ge,
|
|
1040
1040
|
...g
|
|
1041
1041
|
}) : f === 0 || t === f ? a(h, {
|
|
1042
1042
|
x: [-12, 0],
|
|
@@ -1044,16 +1044,16 @@ function sr({ data: e, range: t, layout: n, children: o }) {
|
|
|
1044
1044
|
scaleY: 1,
|
|
1045
1045
|
opacity: [0, 1]
|
|
1046
1046
|
}, {
|
|
1047
|
-
x:
|
|
1047
|
+
x: ge,
|
|
1048
1048
|
...g
|
|
1049
1049
|
}) : a(h, {
|
|
1050
|
-
scaleX: [t > f ?
|
|
1050
|
+
scaleX: [t > f ? $e : 1 / $e, 1],
|
|
1051
1051
|
scaleY: 1,
|
|
1052
1052
|
x: 0,
|
|
1053
1053
|
opacity: [0, 1],
|
|
1054
1054
|
originX: 0.5
|
|
1055
1055
|
}, {
|
|
1056
|
-
scaleX:
|
|
1056
|
+
scaleX: ge,
|
|
1057
1057
|
...g
|
|
1058
1058
|
});
|
|
1059
1059
|
return () => p.stop();
|
|
@@ -1063,7 +1063,7 @@ function sr({ data: e, range: t, layout: n, children: o }) {
|
|
|
1063
1063
|
r
|
|
1064
1064
|
]);
|
|
1065
1065
|
const l = 4;
|
|
1066
|
-
return /* @__PURE__ */
|
|
1066
|
+
return /* @__PURE__ */ k("g", {
|
|
1067
1067
|
clipPath: `url(#${s})`,
|
|
1068
1068
|
children: [/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", {
|
|
1069
1069
|
id: s,
|
|
@@ -1080,23 +1080,59 @@ function sr({ data: e, range: t, layout: n, children: o }) {
|
|
|
1080
1080
|
})]
|
|
1081
1081
|
});
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1084
|
-
const { xScale:
|
|
1083
|
+
function cr({ data: e, keys: t, children: n }) {
|
|
1084
|
+
const { xScale: o, yScale: r } = E(z), i = Ne(), a = [], s = o, c = r;
|
|
1085
|
+
if (s != null && c != null && typeof s.bandwidth == "function") {
|
|
1086
|
+
const l = Math.max(0, s.bandwidth() - 2), h = c(0), f = Math.max(...c.range()) + 8 + 2;
|
|
1087
|
+
for (const [g, p] of e.entries()) {
|
|
1088
|
+
const M = s($(p.x));
|
|
1089
|
+
let N = 0;
|
|
1090
|
+
for (const H of t) {
|
|
1091
|
+
const D = C(p, H) ?? 0;
|
|
1092
|
+
D >= 0 && (N += D);
|
|
1093
|
+
}
|
|
1094
|
+
const _ = N > 0 ? c(N) : h;
|
|
1095
|
+
if (M == null || _ == null || h == null || !Number.isFinite(M) || !Number.isFinite(_)) continue;
|
|
1096
|
+
const J = N > 0 ? _ + Xe : _, re = N > 0 ? Math.max(0, Math.min(pt, l / 2, (h - J) / 2)) : 0;
|
|
1097
|
+
a.push(/* @__PURE__ */ u("rect", {
|
|
1098
|
+
"data-stack-top": g,
|
|
1099
|
+
x: M + Xe,
|
|
1100
|
+
y: J,
|
|
1101
|
+
width: l,
|
|
1102
|
+
height: Math.max(0, f - J),
|
|
1103
|
+
rx: re,
|
|
1104
|
+
ry: re
|
|
1105
|
+
}, g));
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
return /* @__PURE__ */ k("g", {
|
|
1109
|
+
"data-stack-clip": "",
|
|
1110
|
+
children: [/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", {
|
|
1111
|
+
id: i,
|
|
1112
|
+
children: a
|
|
1113
|
+
}) }), /* @__PURE__ */ u("g", {
|
|
1114
|
+
clipPath: `url(#${i})`,
|
|
1115
|
+
children: n
|
|
1116
|
+
})]
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
function ur({ data: e, layout: t, parts: n, colors: o, width: r, headingFormat: i, valueFormat: a, breakdownTitle: s, emptyBucket: c, hasConnectedLines: l }) {
|
|
1120
|
+
const { xScale: h } = E(z), f = Ae(e, h, l);
|
|
1085
1121
|
if (f == null || h == null) return null;
|
|
1086
|
-
const g = e[f], p = Z(h)(
|
|
1087
|
-
return p == null ? null : /* @__PURE__ */ u(
|
|
1122
|
+
const g = e[f], p = Z(h)($(g.x));
|
|
1123
|
+
return p == null ? null : /* @__PURE__ */ u(jn, {
|
|
1088
1124
|
x: p,
|
|
1089
1125
|
width: r,
|
|
1090
1126
|
top: t.top,
|
|
1091
1127
|
heading: i(new Date(g.x)),
|
|
1092
|
-
rows: n.flatMap((
|
|
1093
|
-
const
|
|
1094
|
-
return
|
|
1095
|
-
label:
|
|
1096
|
-
value: a(
|
|
1097
|
-
color: o[
|
|
1098
|
-
kind:
|
|
1099
|
-
dashed:
|
|
1128
|
+
rows: n.flatMap((M, N) => {
|
|
1129
|
+
const _ = C(g, M.dataKey);
|
|
1130
|
+
return _ == null ? [] : [{
|
|
1131
|
+
label: M.label,
|
|
1132
|
+
value: a(_),
|
|
1133
|
+
color: o[N],
|
|
1134
|
+
kind: M.kind === "bar" ? "rect" : "line",
|
|
1135
|
+
dashed: M.dashed
|
|
1100
1136
|
}];
|
|
1101
1137
|
}),
|
|
1102
1138
|
breakdown: g.breakdown,
|
|
@@ -1105,298 +1141,302 @@ function lr({ data: e, layout: t, parts: n, colors: o, width: r, headingFormat:
|
|
|
1105
1141
|
empty: c
|
|
1106
1142
|
});
|
|
1107
1143
|
}
|
|
1108
|
-
var
|
|
1144
|
+
var hr = {
|
|
1109
1145
|
dx: "-0.35em",
|
|
1110
1146
|
dy: "0.35em",
|
|
1111
1147
|
width: void 0
|
|
1112
1148
|
};
|
|
1113
|
-
function
|
|
1114
|
-
const [
|
|
1115
|
-
const d = e.map((
|
|
1116
|
-
...
|
|
1117
|
-
color:
|
|
1118
|
-
})).filter((
|
|
1119
|
-
let B = 1 / 0,
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1149
|
+
function Le({ data: e, children: t, label: n, description: o, height: r = 200, width: i, valueFormat: a, timeFormat: s, locale: c, legend: l, baseline: h = "zero", stacked: f = !1, breakdownTitle: g, loading: p, empty: M = "Nothing here yet.", emptyBucket: N, className: _, ...J }) {
|
|
1150
|
+
const [re, H] = Xn(i), D = L(() => xt(t), [t]), m = L(() => {
|
|
1151
|
+
const d = e.map((y) => $(y.x)), x = Un(d), b = a ?? Pe(c, !0), v = a ?? Pe(c), F = s ?? Yn(c, x), ee = D.map((y, U) => nn(y.color, U)), A = D.filter((y) => y.kind === "bar"), te = D.map((y, U) => ({
|
|
1152
|
+
...y,
|
|
1153
|
+
color: ee[U]
|
|
1154
|
+
})).filter((y) => y.kind === "line");
|
|
1155
|
+
let B = 1 / 0, V = -1 / 0;
|
|
1156
|
+
const ie = (y) => {
|
|
1157
|
+
y < B && (B = y), y > V && (V = y);
|
|
1122
1158
|
};
|
|
1123
|
-
if (f &&
|
|
1124
|
-
let
|
|
1125
|
-
for (const
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1159
|
+
if (f && A.length > 1) for (const y of e) {
|
|
1160
|
+
let U = 0, P = 0;
|
|
1161
|
+
for (const Ft of A) {
|
|
1162
|
+
const oe = C(y, Ft.dataKey);
|
|
1163
|
+
oe != null && (oe > 0 ? U += oe : P += oe);
|
|
1128
1164
|
}
|
|
1129
|
-
|
|
1165
|
+
ie(U), ie(P);
|
|
1130
1166
|
}
|
|
1131
|
-
else for (const
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1167
|
+
else for (const y of A) for (const U of e) {
|
|
1168
|
+
const P = C(U, y.dataKey);
|
|
1169
|
+
P != null && ie(P);
|
|
1134
1170
|
}
|
|
1135
|
-
for (const
|
|
1136
|
-
const
|
|
1137
|
-
|
|
1171
|
+
for (const y of te) for (const U of e) {
|
|
1172
|
+
const P = C(U, y.dataKey);
|
|
1173
|
+
P != null && ie(P);
|
|
1138
1174
|
}
|
|
1139
|
-
B === 1 / 0 && (B = 0,
|
|
1140
|
-
const
|
|
1175
|
+
B === 1 / 0 && (B = 0, V = 0), (h === "zero" || A.length > 0) && (B = Math.min(0, B), V = Math.max(0, V));
|
|
1176
|
+
const Ye = Dn(B, V);
|
|
1141
1177
|
return {
|
|
1142
1178
|
times: d,
|
|
1143
|
-
span:
|
|
1144
|
-
colors:
|
|
1145
|
-
bars:
|
|
1146
|
-
lines:
|
|
1147
|
-
hasBars:
|
|
1148
|
-
axisFormat:
|
|
1149
|
-
fullFormat:
|
|
1150
|
-
headingFormat:
|
|
1151
|
-
y:
|
|
1152
|
-
yLabels:
|
|
1153
|
-
described: o ??
|
|
1179
|
+
span: x,
|
|
1180
|
+
colors: ee,
|
|
1181
|
+
bars: A,
|
|
1182
|
+
lines: te,
|
|
1183
|
+
hasBars: A.length > 0,
|
|
1184
|
+
axisFormat: b,
|
|
1185
|
+
fullFormat: v,
|
|
1186
|
+
headingFormat: F,
|
|
1187
|
+
y: Ye,
|
|
1188
|
+
yLabels: Ye.ticks.map(b),
|
|
1189
|
+
described: o ?? on({
|
|
1154
1190
|
data: e,
|
|
1155
|
-
series:
|
|
1156
|
-
key:
|
|
1157
|
-
label:
|
|
1158
|
-
kind:
|
|
1191
|
+
series: D.map((y) => ({
|
|
1192
|
+
key: y.dataKey,
|
|
1193
|
+
label: y.label,
|
|
1194
|
+
kind: y.kind
|
|
1159
1195
|
})),
|
|
1160
|
-
valueFormat:
|
|
1161
|
-
timeFormat:
|
|
1196
|
+
valueFormat: v,
|
|
1197
|
+
timeFormat: F
|
|
1162
1198
|
})
|
|
1163
1199
|
};
|
|
1164
1200
|
}, [
|
|
1165
1201
|
e,
|
|
1166
|
-
|
|
1202
|
+
D,
|
|
1167
1203
|
f,
|
|
1168
1204
|
h,
|
|
1169
1205
|
a,
|
|
1170
1206
|
s,
|
|
1171
1207
|
c,
|
|
1172
1208
|
o
|
|
1173
|
-
]),
|
|
1174
|
-
|
|
1209
|
+
]), W = e.length, R = m.times[0] ?? 0, X = m.times[W - 1] ?? 0, bt = W > 0 ? X - R + m.span : 0, w = L(() => Hn(H, r, m.yLabels), [
|
|
1210
|
+
H,
|
|
1175
1211
|
r,
|
|
1176
1212
|
m.yLabels
|
|
1177
|
-
]),
|
|
1178
|
-
|
|
1179
|
-
|
|
1213
|
+
]), Q = L(() => nr(w.innerWidth, W, m.bars.length, f), [
|
|
1214
|
+
w.innerWidth,
|
|
1215
|
+
W,
|
|
1180
1216
|
m.bars.length,
|
|
1181
1217
|
f
|
|
1182
|
-
]),
|
|
1218
|
+
]), Tt = L(() => m.hasBars ? {
|
|
1183
1219
|
type: "band",
|
|
1184
1220
|
domain: m.times,
|
|
1185
|
-
paddingInner:
|
|
1186
|
-
paddingOuter:
|
|
1221
|
+
paddingInner: Q.paddingInner,
|
|
1222
|
+
paddingOuter: Q.paddingOuter
|
|
1187
1223
|
} : {
|
|
1188
1224
|
type: "time",
|
|
1189
|
-
domain:
|
|
1225
|
+
domain: X > R ? [R, X] : [R - 1, R + 1]
|
|
1190
1226
|
}, [
|
|
1191
1227
|
m.hasBars,
|
|
1192
1228
|
m.times,
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
]),
|
|
1229
|
+
Q.paddingInner,
|
|
1230
|
+
Q.paddingOuter,
|
|
1231
|
+
R,
|
|
1232
|
+
X
|
|
1233
|
+
]), Mt = L(() => ({
|
|
1198
1234
|
type: "linear",
|
|
1199
1235
|
domain: m.y.domain,
|
|
1200
1236
|
zero: !1,
|
|
1201
1237
|
nice: !1
|
|
1202
|
-
}), [m.y.domain]),
|
|
1203
|
-
const d =
|
|
1204
|
-
if (
|
|
1238
|
+
}), [m.y.domain]), _t = L(() => On(m.colors), [m.colors]), Ie = L(() => {
|
|
1239
|
+
const d = Kn(c);
|
|
1240
|
+
if (W === 0 || w.innerWidth <= 0) return {
|
|
1205
1241
|
values: [],
|
|
1206
1242
|
format: () => ""
|
|
1207
1243
|
};
|
|
1208
|
-
const
|
|
1244
|
+
const x = En(Ln(R, X, w.innerWidth), d, w.innerWidth);
|
|
1209
1245
|
if (!m.hasBars) return {
|
|
1210
|
-
values:
|
|
1211
|
-
format: (
|
|
1246
|
+
values: x,
|
|
1247
|
+
format: (v) => d(new Date(v))
|
|
1212
1248
|
};
|
|
1213
|
-
const
|
|
1214
|
-
for (const
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1249
|
+
const b = /* @__PURE__ */ new Map();
|
|
1250
|
+
for (const v of x) {
|
|
1251
|
+
const F = m.times[mt(m.times, v.getTime())];
|
|
1252
|
+
b.has(F) || b.set(F, d(v));
|
|
1217
1253
|
}
|
|
1218
1254
|
return {
|
|
1219
|
-
values: [...
|
|
1220
|
-
format: (
|
|
1255
|
+
values: [...b.keys()],
|
|
1256
|
+
format: (v) => b.get($(v)) ?? d(new Date(v))
|
|
1221
1257
|
};
|
|
1222
1258
|
}, [
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1259
|
+
W,
|
|
1260
|
+
R,
|
|
1261
|
+
X,
|
|
1262
|
+
w.innerWidth,
|
|
1227
1263
|
c,
|
|
1228
1264
|
m.hasBars,
|
|
1229
1265
|
m.times
|
|
1230
|
-
]),
|
|
1266
|
+
]), kt = l ?? D.length > 1, Ke = W === 0 && !p, wt = W === 0 && p === !0, Nt = m.y.domain[0] >= 0 || m.y.domain[1] <= 0, G = e, de = L(() => {
|
|
1231
1267
|
const d = /* @__PURE__ */ new Map();
|
|
1232
|
-
for (const
|
|
1268
|
+
for (const x of m.lines) x.gaps === "connect" && d.set(x.dataKey, G.filter((b) => C(b, x.dataKey) != null));
|
|
1233
1269
|
return d;
|
|
1234
|
-
}, [m.lines,
|
|
1270
|
+
}, [m.lines, G]), me = de.size > 0, Ct = (() => {
|
|
1235
1271
|
const { bars: d } = m;
|
|
1236
1272
|
if (d.length === 0) return null;
|
|
1237
|
-
const
|
|
1238
|
-
const
|
|
1239
|
-
return /* @__PURE__ */ u(
|
|
1240
|
-
dataKey:
|
|
1241
|
-
data:
|
|
1242
|
-
xAccessor:
|
|
1243
|
-
yAccessor:
|
|
1244
|
-
colorAccessor:
|
|
1245
|
-
radius:
|
|
1246
|
-
radiusTop:
|
|
1247
|
-
"data-series":
|
|
1248
|
-
},
|
|
1273
|
+
const x = !f || d.length === 1, b = d.map((v) => {
|
|
1274
|
+
const F = m.colors[D.indexOf(v)];
|
|
1275
|
+
return /* @__PURE__ */ u(Bt, {
|
|
1276
|
+
dataKey: v.dataKey,
|
|
1277
|
+
data: G,
|
|
1278
|
+
xAccessor: ke,
|
|
1279
|
+
yAccessor: Qn(v.dataKey),
|
|
1280
|
+
colorAccessor: er(v.dataKey, F),
|
|
1281
|
+
radius: x ? pt : void 0,
|
|
1282
|
+
radiusTop: x,
|
|
1283
|
+
"data-series": v.dataKey
|
|
1284
|
+
}, v.dataKey);
|
|
1249
1285
|
});
|
|
1250
|
-
return d.length === 1 ?
|
|
1251
|
-
|
|
1252
|
-
|
|
1286
|
+
return d.length === 1 ? b : f ? /* @__PURE__ */ u(cr, {
|
|
1287
|
+
data: G,
|
|
1288
|
+
keys: d.map((v) => v.dataKey),
|
|
1289
|
+
children: /* @__PURE__ */ u(Ot, { children: b })
|
|
1290
|
+
}) : /* @__PURE__ */ u(zt, {
|
|
1291
|
+
padding: Q.groupPadding,
|
|
1292
|
+
children: b
|
|
1253
1293
|
});
|
|
1254
|
-
})(),
|
|
1255
|
-
const
|
|
1256
|
-
return d.area ? /* @__PURE__ */ u(
|
|
1294
|
+
})(), Dt = m.lines.map((d) => {
|
|
1295
|
+
const x = d.curve === "monotone" ? tn : Qt, b = d.dashed ? "4 4" : void 0, v = de.get(d.dataKey) ?? G;
|
|
1296
|
+
return d.area ? /* @__PURE__ */ u(Pt, {
|
|
1257
1297
|
dataKey: d.dataKey,
|
|
1258
|
-
data:
|
|
1259
|
-
xAccessor:
|
|
1260
|
-
yAccessor:
|
|
1261
|
-
curve:
|
|
1298
|
+
data: v,
|
|
1299
|
+
xAccessor: ke,
|
|
1300
|
+
yAccessor: Ze(d.dataKey),
|
|
1301
|
+
curve: x,
|
|
1262
1302
|
fill: d.color,
|
|
1263
1303
|
fillOpacity: 0.1,
|
|
1264
1304
|
lineProps: {
|
|
1265
1305
|
stroke: d.color,
|
|
1266
|
-
strokeWidth:
|
|
1306
|
+
strokeWidth: Ge,
|
|
1267
1307
|
strokeLinejoin: "round",
|
|
1268
|
-
strokeDasharray:
|
|
1308
|
+
strokeDasharray: b
|
|
1269
1309
|
},
|
|
1270
1310
|
"data-series": d.dataKey
|
|
1271
|
-
}, d.dataKey) : /* @__PURE__ */ u(
|
|
1311
|
+
}, d.dataKey) : /* @__PURE__ */ u(Gt, {
|
|
1272
1312
|
dataKey: d.dataKey,
|
|
1273
|
-
data:
|
|
1274
|
-
xAccessor:
|
|
1275
|
-
yAccessor:
|
|
1276
|
-
curve:
|
|
1313
|
+
data: v,
|
|
1314
|
+
xAccessor: ke,
|
|
1315
|
+
yAccessor: Ze(d.dataKey),
|
|
1316
|
+
curve: x,
|
|
1277
1317
|
stroke: d.color,
|
|
1278
|
-
strokeWidth:
|
|
1318
|
+
strokeWidth: Ge,
|
|
1279
1319
|
strokeLinejoin: "round",
|
|
1280
|
-
strokeDasharray:
|
|
1320
|
+
strokeDasharray: b,
|
|
1281
1321
|
"data-series": d.dataKey
|
|
1282
1322
|
}, d.dataKey);
|
|
1283
|
-
}),
|
|
1284
|
-
const
|
|
1285
|
-
const
|
|
1286
|
-
return
|
|
1287
|
-
x:
|
|
1288
|
-
value:
|
|
1323
|
+
}), St = m.lines.flatMap((d) => {
|
|
1324
|
+
const x = de.get(d.dataKey) ?? G, b = x.flatMap((v, F) => {
|
|
1325
|
+
const ee = C(v, d.dataKey), A = x[F - 1], te = x[F + 1];
|
|
1326
|
+
return ee == null || A != null && C(A, d.dataKey) != null || te != null && C(te, d.dataKey) != null ? [] : [{
|
|
1327
|
+
x: v.x,
|
|
1328
|
+
value: ee
|
|
1289
1329
|
}];
|
|
1290
1330
|
});
|
|
1291
|
-
return
|
|
1331
|
+
return b.length === 0 ? [] : [{
|
|
1292
1332
|
dataKey: d.dataKey,
|
|
1293
1333
|
color: d.color,
|
|
1294
|
-
points:
|
|
1334
|
+
points: b
|
|
1295
1335
|
}];
|
|
1296
1336
|
});
|
|
1297
|
-
return /* @__PURE__ */ u(
|
|
1337
|
+
return /* @__PURE__ */ u(Rn, {
|
|
1298
1338
|
label: n,
|
|
1299
1339
|
description: m.described,
|
|
1300
1340
|
height: r,
|
|
1301
|
-
containerRef:
|
|
1341
|
+
containerRef: re,
|
|
1302
1342
|
loading: p,
|
|
1303
|
-
empty:
|
|
1304
|
-
showEmpty:
|
|
1305
|
-
placeholder:
|
|
1306
|
-
className:
|
|
1307
|
-
legend:
|
|
1343
|
+
empty: M,
|
|
1344
|
+
showEmpty: Ke,
|
|
1345
|
+
placeholder: wt ? /* @__PURE__ */ u(Bn, { layout: w }) : null,
|
|
1346
|
+
className: _,
|
|
1347
|
+
legend: kt ? /* @__PURE__ */ u(an, { items: D.map((d, x) => ({
|
|
1308
1348
|
label: d.label,
|
|
1309
|
-
color: m.colors[
|
|
1349
|
+
color: m.colors[x],
|
|
1310
1350
|
kind: d.kind === "bar" ? "rect" : "line",
|
|
1311
1351
|
dashed: d.dashed
|
|
1312
1352
|
})) }) : null,
|
|
1313
|
-
...
|
|
1314
|
-
children:
|
|
1315
|
-
xScale:
|
|
1316
|
-
yScale:
|
|
1317
|
-
theme:
|
|
1353
|
+
...J,
|
|
1354
|
+
children: H > 0 && !Ke && /* @__PURE__ */ u(jt, {
|
|
1355
|
+
xScale: Tt,
|
|
1356
|
+
yScale: Mt,
|
|
1357
|
+
theme: _t,
|
|
1318
1358
|
initialDimensions: {
|
|
1319
|
-
width:
|
|
1359
|
+
width: H,
|
|
1320
1360
|
height: r,
|
|
1321
|
-
margin:
|
|
1361
|
+
margin: w.margin
|
|
1322
1362
|
},
|
|
1323
|
-
children: /* @__PURE__ */
|
|
1363
|
+
children: /* @__PURE__ */ k(qt, {
|
|
1324
1364
|
hideTooltipDebounceMs: 0,
|
|
1325
|
-
children: [/* @__PURE__ */
|
|
1326
|
-
width:
|
|
1365
|
+
children: [/* @__PURE__ */ k(Zt, {
|
|
1366
|
+
width: H,
|
|
1327
1367
|
height: r,
|
|
1328
|
-
margin:
|
|
1368
|
+
margin: w.margin,
|
|
1329
1369
|
accessibilityLabel: n,
|
|
1330
1370
|
children: [
|
|
1331
|
-
/* @__PURE__ */ u(
|
|
1371
|
+
/* @__PURE__ */ u(we, { children: /* @__PURE__ */ u(Xt, {
|
|
1332
1372
|
rows: !0,
|
|
1333
1373
|
columns: !1,
|
|
1334
1374
|
numTicks: m.y.count
|
|
1335
1375
|
}) }),
|
|
1336
|
-
/* @__PURE__ */ u(
|
|
1376
|
+
/* @__PURE__ */ u(et, {
|
|
1337
1377
|
orientation: "left",
|
|
1338
1378
|
tickValues: m.y.ticks,
|
|
1339
1379
|
tickFormat: (d) => m.axisFormat(Number(d)),
|
|
1340
1380
|
hideAxisLine: !0,
|
|
1341
1381
|
hideTicks: !0,
|
|
1342
|
-
tickLabelProps:
|
|
1382
|
+
tickLabelProps: hr
|
|
1343
1383
|
}),
|
|
1344
|
-
/* @__PURE__ */ u(
|
|
1345
|
-
values:
|
|
1346
|
-
format:
|
|
1347
|
-
layout:
|
|
1384
|
+
/* @__PURE__ */ u(rr, {
|
|
1385
|
+
values: Ie.values,
|
|
1386
|
+
format: Ie.format,
|
|
1387
|
+
layout: w
|
|
1348
1388
|
}),
|
|
1349
|
-
m.hasBars && /* @__PURE__ */ u(
|
|
1389
|
+
m.hasBars && /* @__PURE__ */ u(ir, {
|
|
1350
1390
|
data: e,
|
|
1351
|
-
layout:
|
|
1352
|
-
hasConnectedLines:
|
|
1391
|
+
layout: w,
|
|
1392
|
+
hasConnectedLines: me
|
|
1353
1393
|
}),
|
|
1354
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ k(lr, {
|
|
1355
1395
|
data: e,
|
|
1356
|
-
range:
|
|
1357
|
-
layout:
|
|
1396
|
+
range: bt,
|
|
1397
|
+
layout: w,
|
|
1358
1398
|
children: [
|
|
1359
|
-
wt,
|
|
1360
1399
|
Ct,
|
|
1361
|
-
|
|
1400
|
+
Dt,
|
|
1401
|
+
/* @__PURE__ */ u(we, { children: /* @__PURE__ */ u(sr, { lines: St }) })
|
|
1362
1402
|
]
|
|
1363
1403
|
}),
|
|
1364
|
-
m.hasBars &&
|
|
1365
|
-
/* @__PURE__ */ u(
|
|
1404
|
+
m.hasBars && Nt && /* @__PURE__ */ u(we, { children: /* @__PURE__ */ u(or, { layout: w }) }),
|
|
1405
|
+
/* @__PURE__ */ u(ar, {
|
|
1366
1406
|
data: e,
|
|
1367
|
-
layout:
|
|
1407
|
+
layout: w,
|
|
1368
1408
|
lines: m.lines,
|
|
1369
1409
|
crosshair: !m.hasBars,
|
|
1370
|
-
hasConnectedLines:
|
|
1410
|
+
hasConnectedLines: me
|
|
1371
1411
|
})
|
|
1372
1412
|
]
|
|
1373
|
-
}), /* @__PURE__ */ u(
|
|
1413
|
+
}), /* @__PURE__ */ u(ur, {
|
|
1374
1414
|
data: e,
|
|
1375
|
-
layout:
|
|
1376
|
-
parts:
|
|
1415
|
+
layout: w,
|
|
1416
|
+
parts: D,
|
|
1377
1417
|
colors: m.colors,
|
|
1378
|
-
width:
|
|
1418
|
+
width: H,
|
|
1379
1419
|
headingFormat: m.headingFormat,
|
|
1380
1420
|
valueFormat: m.fullFormat,
|
|
1381
1421
|
breakdownTitle: g,
|
|
1382
|
-
emptyBucket:
|
|
1383
|
-
hasConnectedLines:
|
|
1422
|
+
emptyBucket: N,
|
|
1423
|
+
hasConnectedLines: me
|
|
1384
1424
|
})]
|
|
1385
1425
|
})
|
|
1386
1426
|
})
|
|
1387
1427
|
});
|
|
1388
1428
|
}
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1429
|
+
Le.displayName = "Chart";
|
|
1430
|
+
Le.Bar = Se;
|
|
1431
|
+
Le.Line = Fe;
|
|
1392
1432
|
export {
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1433
|
+
rt as a,
|
|
1434
|
+
an as i,
|
|
1435
|
+
Se as n,
|
|
1436
|
+
Re as o,
|
|
1437
|
+
Fe as r,
|
|
1438
|
+
nn as s,
|
|
1439
|
+
Le as t
|
|
1400
1440
|
};
|
|
1401
1441
|
|
|
1402
|
-
//# sourceMappingURL=chart-
|
|
1442
|
+
//# sourceMappingURL=chart-PPuzbeXN.js.map
|