@photon-ai/pho-ui 4.18.2 → 4.18.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/chunks/{bar-chart-B-c6dujU.js → bar-chart-CNCmuhQV.js} +2 -2
  2. package/dist/chunks/{bar-chart-B-c6dujU.js.map → bar-chart-CNCmuhQV.js.map} +1 -1
  3. package/dist/chunks/{basic-page-Bfcda8w5.js → basic-page-D_Wgu2pJ.js} +3 -3
  4. package/dist/chunks/{basic-page-Bfcda8w5.js.map → basic-page-D_Wgu2pJ.js.map} +1 -1
  5. package/dist/chunks/{chart-PPuzbeXN.js → chart-B5wjhkBu.js} +99 -99
  6. package/dist/chunks/chart-B5wjhkBu.js.map +1 -0
  7. package/dist/chunks/{combobox-D4LiGJB2.js → combobox-BJusx5b2.js} +82 -76
  8. package/dist/chunks/combobox-BJusx5b2.js.map +1 -0
  9. package/dist/chunks/{line-chart-CNvnFb-M.js → line-chart-BODTNBrX.js} +2 -2
  10. package/dist/chunks/{line-chart-CNvnFb-M.js.map → line-chart-BODTNBrX.js.map} +1 -1
  11. package/dist/chunks/popup-anchor-C3_iXdbh.js +40 -0
  12. package/dist/chunks/popup-anchor-C3_iXdbh.js.map +1 -0
  13. package/dist/chunks/{select-COFV0NLb.js → select-DU_0zVbn.js} +62 -56
  14. package/dist/chunks/select-DU_0zVbn.js.map +1 -0
  15. package/dist/components/bar-chart.js +1 -1
  16. package/dist/components/chart.js +1 -1
  17. package/dist/components/combobox.js +1 -1
  18. package/dist/components/line-chart.js +1 -1
  19. package/dist/components/phone-input.js +1 -1
  20. package/dist/components/scope.js +1 -1
  21. package/dist/components/select.js +1 -1
  22. package/dist/index.js +4 -4
  23. package/dist/sections/basic-page.js +1 -1
  24. package/dist/src/components/chart/scale.d.ts +5 -2
  25. package/dist/src/components/combobox/combobox.d.ts +1 -1
  26. package/dist/src/components/select/select.d.ts +1 -1
  27. package/dist/src/utils/popup-anchor.d.ts +28 -0
  28. package/package.json +1 -1
  29. package/dist/chunks/chart-PPuzbeXN.js.map +0 -1
  30. package/dist/chunks/combobox-D4LiGJB2.js.map +0 -1
  31. package/dist/chunks/select-COFV0NLb.js.map +0 -1
@@ -2,10 +2,10 @@
2
2
  import { t as se } from "./cn-ChIgwEl3.js";
3
3
  import { FADE_ENTRANCE as Ut, SPAN_SCALE as $e, SPRING_ENTRANCE as ge } from "../motion.js";
4
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";
5
+ import { Children as At, Fragment as It, isValidElement as Lt, useCallback as Kt, useContext as H, useEffect as Yt, useId as Ne, useLayoutEffect as $t, useMemo as L, useRef as Qe, useState as Et } from "react";
6
6
  import { Fragment as Ht, jsx as u, jsxs as k } from "react/jsx-runtime";
7
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";
8
+ import { AreaSeries as Pt, Axis as et, BarGroup as Bt, BarSeries as zt, BarStack as Ot, DataContext as B, 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
9
  function tt(e) {
10
10
  this._context = e;
11
11
  }
@@ -266,12 +266,12 @@ function dn(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 ze(e, t, n) {
269
+ function Be(e, t, n) {
270
270
  return t = +t, e = +e, n = +n, ce(e, t, n)[2];
271
271
  }
272
272
  function ue(e, t, n) {
273
273
  t = +t, e = +e, n = +n;
274
- const o = t < e, r = o ? ze(t, e, n) : ze(e, t, n);
274
+ const o = t < e, r = o ? Be(t, e, n) : Be(e, t, n);
275
275
  return (o ? -1 : 1) * (r < 0 ? 1 / -r : r);
276
276
  }
277
277
  var xe = /* @__PURE__ */ new Date(), be = /* @__PURE__ */ new Date();
@@ -307,12 +307,12 @@ he.every = (e) => (e = Math.floor(e), !isFinite(e) || !(e > 0) ? null : e > 1 ?
307
307
  }, (t, n) => {
308
308
  t.setTime(+t + n * e);
309
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) => {
310
+ var br = he.range, K = 1e3, S = K * 60, Y = S * 60, $ = Y * 24, Ce = $ * 7, ze = $ * 30, Te = $ * 365, ne = T((e) => {
311
311
  e.setTime(e - e.getMilliseconds());
312
312
  }, (e, t) => {
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);
313
+ e.setTime(+e + t * K);
314
+ }, (e, t) => (t - e) / K, (e) => e.getUTCSeconds()), Tr = ne.range, it = T((e) => {
315
+ e.setTime(e - e.getMilliseconds() - e.getSeconds() * K);
316
316
  }, (e, t) => {
317
317
  e.setTime(+e + t * S);
318
318
  }, (e, t) => (t - e) / S, (e) => e.getMinutes()), Mr = it.range, ot = T((e) => {
@@ -320,22 +320,22 @@ var br = he.range, I = 1e3, S = I * 60, K = S * 60, Y = K * 24, Ce = Y * 7, Be =
320
320
  }, (e, t) => {
321
321
  e.setTime(+e + t * S);
322
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);
323
+ e.setTime(e - e.getMilliseconds() - e.getSeconds() * K - e.getMinutes() * S);
324
324
  }, (e, t) => {
325
- e.setTime(+e + t * K);
326
- }, (e, t) => (t - e) / K, (e) => e.getHours()), kr = at.range, st = T((e) => {
325
+ e.setTime(+e + t * Y);
326
+ }, (e, t) => (t - e) / Y, (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 * 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) => {
329
+ e.setTime(+e + t * Y);
330
+ }, (e, t) => (t - e) / Y, (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) / $, (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) / Y, (e) => e.getUTCDate() - 1), Cr = mn.range, lt = T((e) => {
334
+ }, (e, t) => (t - e) / $, (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) / Y, (e) => Math.floor(e / Y)), Dr = lt.range;
338
+ }, (e, t) => (t - e) / $, (e) => Math.floor(e / $)), Dr = lt.range;
339
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);
@@ -343,7 +343,7 @@ function O(e) {
343
343
  t.setDate(t.getDate() + n * 7);
344
344
  }, (t, n) => (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * S) / Ce);
345
345
  }
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;
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, Ir = yn.range, Lr = 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);
@@ -355,11 +355,11 @@ var ut = j(0), Tn = j(1), Mn = j(2), _n = j(3), kn = j(4), wn = j(5), Nn = j(6),
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()), zr = ht.range, ft = T((e) => {
358
+ }, (e, t) => t.getMonth() - e.getMonth() + (t.getFullYear() - e.getFullYear()) * 12, (e) => e.getMonth()), Br = 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()), Br = ft.range, fe = T((e) => {
362
+ }, (e, t) => t.getUTCMonth() - e.getUTCMonth() + (t.getUTCFullYear() - e.getUTCFullYear()) * 12, (e) => e.getUTCMonth()), zr = 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);
@@ -385,22 +385,22 @@ function dt(e, t, n, o, r, i) {
385
385
  [
386
386
  ne,
387
387
  1,
388
- I
388
+ K
389
389
  ],
390
390
  [
391
391
  ne,
392
392
  5,
393
- 5 * I
393
+ 5 * K
394
394
  ],
395
395
  [
396
396
  ne,
397
397
  15,
398
- 15 * I
398
+ 15 * K
399
399
  ],
400
400
  [
401
401
  ne,
402
402
  30,
403
- 30 * I
403
+ 30 * K
404
404
  ],
405
405
  [
406
406
  i,
@@ -425,32 +425,32 @@ function dt(e, t, n, o, r, i) {
425
425
  [
426
426
  r,
427
427
  1,
428
- K
428
+ Y
429
429
  ],
430
430
  [
431
431
  r,
432
432
  3,
433
- 3 * K
433
+ 3 * Y
434
434
  ],
435
435
  [
436
436
  r,
437
437
  6,
438
- 6 * K
438
+ 6 * Y
439
439
  ],
440
440
  [
441
441
  r,
442
442
  12,
443
- 12 * K
443
+ 12 * Y
444
444
  ],
445
445
  [
446
446
  o,
447
447
  1,
448
- Y
448
+ $
449
449
  ],
450
450
  [
451
451
  o,
452
452
  2,
453
- 2 * Y
453
+ 2 * $
454
454
  ],
455
455
  [
456
456
  n,
@@ -460,12 +460,12 @@ function dt(e, t, n, o, r, i) {
460
460
  [
461
461
  t,
462
462
  1,
463
- Be
463
+ ze
464
464
  ],
465
465
  [
466
466
  t,
467
467
  3,
468
- 3 * Be
468
+ 3 * ze
469
469
  ],
470
470
  [
471
471
  e,
@@ -489,7 +489,7 @@ function dt(e, t, n, o, r, i) {
489
489
  return [s, c];
490
490
  }
491
491
  var [Xr, Gr] = dt(De, ft, ut, lt, st, ot), [Cn, Vr] = dt(fe, ht, ct, q, at, it);
492
- function $(e) {
492
+ function E(e) {
493
493
  return typeof e == "number" ? e : e.getTime();
494
494
  }
495
495
  function Dn(e, t, n) {
@@ -549,16 +549,16 @@ function Un(e) {
549
549
  return t.sort((n, o) => n - o), t[Math.floor(t.length / 2)];
550
550
  }
551
551
  var An = 864e5;
552
- function Ln(e, t, n) {
552
+ function In(e, t, n, o = 1 / 0) {
553
553
  if (t <= e || n <= 0) return [new Date(e)];
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
- const i = r.slice(1).map((s, c) => q.count(r[c], s)), a = Math.max(...i);
557
- if (a > 1 && i.some((s) => s !== a)) return q.range(r[0], new Date(t + 1), a);
554
+ const r = Math.min(Math.max(2, Math.floor(n / 96)), o), i = Cn(new Date(e), new Date(t), r);
555
+ if (i.length > 2 && i.every((a) => Ln(a))) {
556
+ const a = i.slice(1).map((c, l) => q.count(i[l], c)), s = Math.max(...a);
557
+ if (s > 1 && a.some((c) => c !== s)) return q.range(i[0], new Date(t + 1), s);
558
558
  }
559
- return r;
559
+ return i;
560
560
  }
561
- function In(e) {
561
+ function Ln(e) {
562
562
  return q(e).getTime() === e.getTime();
563
563
  }
564
564
  function Kn(e) {
@@ -676,8 +676,8 @@ var Pn = [
676
676
  1 / 3,
677
677
  2 / 3,
678
678
  1
679
- ], zn = 5;
680
- function Bn({ layout: e }) {
679
+ ], Bn = 5;
680
+ function zn({ layout: e }) {
681
681
  const { margin: t } = e;
682
682
  return /* @__PURE__ */ k("div", {
683
683
  "aria-hidden": !0,
@@ -713,7 +713,7 @@ function Bn({ 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: zn }, (n, o) => /* @__PURE__ */ u(pe, {
716
+ children: Array.from({ length: Bn }, (n, o) => /* @__PURE__ */ u(pe, {
717
717
  "data-bone": "x",
718
718
  className: "h-2.5 w-8"
719
719
  }, o))
@@ -841,9 +841,9 @@ function Jn(e) {
841
841
  }
842
842
  function xt(e, t = []) {
843
843
  return At.forEach(e, (n) => {
844
- if (!It(n)) return;
844
+ if (!Lt(n)) return;
845
845
  const o = Jn(n.type);
846
- if (n.type === Lt) xt(n.props.children, t);
846
+ if (n.type === It) xt(n.props.children, t);
847
847
  else if (o === "bar") {
848
848
  const r = n.props;
849
849
  t.push({
@@ -868,7 +868,7 @@ function xt(e, t = []) {
868
868
  }
869
869
  }), t;
870
870
  }
871
- var ke = (e) => $(e.x), Ve = /* @__PURE__ */ new Map();
871
+ var ke = (e) => e == null ? NaN : E(e.x), Ve = /* @__PURE__ */ new Map();
872
872
  function Qn(e) {
873
873
  let t = Ve.get(e);
874
874
  return t == null && (t = (n) => C(n, e) ?? 0, Ve.set(e, t)), t;
@@ -911,18 +911,18 @@ function nr(e, t, n, o) {
911
911
  };
912
912
  }
913
913
  function we({ children: e }) {
914
- const { dataRegistry: t } = E(z);
914
+ const { dataRegistry: t } = H(B);
915
915
  return t?.entries().some((n) => n.data.length > 0) ?? !1 ? /* @__PURE__ */ u(Ht, { children: e }) : null;
916
916
  }
917
917
  function Ae(e, t, n) {
918
- const o = E(Vt);
918
+ const o = H(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($(c.x));
925
+ const l = a(E(c.x));
926
926
  if (l == null) return null;
927
927
  s.push(l);
928
928
  }
@@ -932,7 +932,7 @@ function Ae(e, t, n) {
932
932
  return r != null && r >= 0 && r < e.length ? r : null;
933
933
  }
934
934
  function rr({ values: e, format: t, layout: n }) {
935
- const { xScale: o } = E(z), r = Kt((i) => {
935
+ const { xScale: o } = H(B), 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
  }, [
@@ -951,9 +951,9 @@ function rr({ values: e, format: t, layout: n }) {
951
951
  });
952
952
  }
953
953
  function ir({ data: e, layout: t, hasConnectedLines: n }) {
954
- const { xScale: o } = E(z), r = Ae(e, o, n);
954
+ const { xScale: o } = H(B), r = Ae(e, o, n);
955
955
  if (r == null || o == null) return null;
956
- const i = Z(o)($(e[r].x)), a = tr(o);
956
+ const i = Z(o)(E(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,
@@ -964,7 +964,7 @@ function ir({ data: e, layout: t, hasConnectedLines: n }) {
964
964
  });
965
965
  }
966
966
  function or({ layout: e }) {
967
- const { yScale: t } = E(z), n = t ? Ue(t)(0) : void 0;
967
+ const { yScale: t } = H(B), 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,
@@ -975,9 +975,9 @@ function or({ layout: e }) {
975
975
  });
976
976
  }
977
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);
978
+ const { xScale: i, yScale: a } = H(B), s = Ae(e, i, r);
979
979
  if (s == null || i == null || a == null) return null;
980
- const c = e[s], l = Z(i)($(c.x));
980
+ const c = e[s], l = Z(i)(E(c.x));
981
981
  if (l == null) return null;
982
982
  const h = Ue(a);
983
983
  return /* @__PURE__ */ k("g", {
@@ -1005,13 +1005,13 @@ function ar({ data: e, layout: t, lines: n, crosshair: o, hasConnectedLines: r }
1005
1005
  });
1006
1006
  }
1007
1007
  function sr({ lines: e }) {
1008
- const { xScale: t, yScale: n } = E(z);
1008
+ const { xScale: t, yScale: n } = H(B);
1009
1009
  if (e.length === 0 || t == null || n == null) return null;
1010
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($(a.x)), l = r(a.value);
1014
+ const c = o(E(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,
@@ -1081,14 +1081,14 @@ function lr({ data: e, range: t, layout: n, children: o }) {
1081
1081
  });
1082
1082
  }
1083
1083
  function cr({ data: e, keys: t, children: n }) {
1084
- const { xScale: o, yScale: r } = E(z), i = Ne(), a = [], s = o, c = r;
1084
+ const { xScale: o, yScale: r } = H(B), i = Ne(), a = [], s = o, c = r;
1085
1085
  if (s != null && c != null && typeof s.bandwidth == "function") {
1086
1086
  const l = Math.max(0, s.bandwidth() - 2), h = c(0), f = Math.max(...c.range()) + 8 + 2;
1087
1087
  for (const [g, p] of e.entries()) {
1088
- const M = s($(p.x));
1088
+ const M = s(E(p.x));
1089
1089
  let N = 0;
1090
- for (const H of t) {
1091
- const D = C(p, H) ?? 0;
1090
+ for (const W of t) {
1091
+ const D = C(p, W) ?? 0;
1092
1092
  D >= 0 && (N += D);
1093
1093
  }
1094
1094
  const _ = N > 0 ? c(N) : h;
@@ -1117,9 +1117,9 @@ function cr({ data: e, keys: t, children: n }) {
1117
1117
  });
1118
1118
  }
1119
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);
1120
+ const { xScale: h } = H(B), f = Ae(e, h, l);
1121
1121
  if (f == null || h == null) return null;
1122
- const g = e[f], p = Z(h)($(g.x));
1122
+ const g = e[f], p = Z(h)(E(g.x));
1123
1123
  return p == null ? null : /* @__PURE__ */ u(jn, {
1124
1124
  x: p,
1125
1125
  width: r,
@@ -1146,25 +1146,25 @@ var hr = {
1146
1146
  dy: "0.35em",
1147
1147
  width: void 0
1148
1148
  };
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) => ({
1149
+ function Ie({ 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, W] = Xn(i), D = L(() => xt(t), [t]), m = L(() => {
1151
+ const d = e.map((y) => E(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)), I = D.filter((y) => y.kind === "bar"), te = D.map((y, U) => ({
1152
1152
  ...y,
1153
1153
  color: ee[U]
1154
1154
  })).filter((y) => y.kind === "line");
1155
- let B = 1 / 0, V = -1 / 0;
1155
+ let z = 1 / 0, V = -1 / 0;
1156
1156
  const ie = (y) => {
1157
- y < B && (B = y), y > V && (V = y);
1157
+ y < z && (z = y), y > V && (V = y);
1158
1158
  };
1159
- if (f && A.length > 1) for (const y of e) {
1159
+ if (f && I.length > 1) for (const y of e) {
1160
1160
  let U = 0, P = 0;
1161
- for (const Ft of A) {
1161
+ for (const Ft of I) {
1162
1162
  const oe = C(y, Ft.dataKey);
1163
1163
  oe != null && (oe > 0 ? U += oe : P += oe);
1164
1164
  }
1165
1165
  ie(U), ie(P);
1166
1166
  }
1167
- else for (const y of A) for (const U of e) {
1167
+ else for (const y of I) for (const U of e) {
1168
1168
  const P = C(U, y.dataKey);
1169
1169
  P != null && ie(P);
1170
1170
  }
@@ -1172,15 +1172,15 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1172
1172
  const P = C(U, y.dataKey);
1173
1173
  P != null && ie(P);
1174
1174
  }
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);
1175
+ z === 1 / 0 && (z = 0, V = 0), (h === "zero" || I.length > 0) && (z = Math.min(0, z), V = Math.max(0, V));
1176
+ const Ye = Dn(z, V);
1177
1177
  return {
1178
1178
  times: d,
1179
1179
  span: x,
1180
1180
  colors: ee,
1181
- bars: A,
1181
+ bars: I,
1182
1182
  lines: te,
1183
- hasBars: A.length > 0,
1183
+ hasBars: I.length > 0,
1184
1184
  axisFormat: b,
1185
1185
  fullFormat: v,
1186
1186
  headingFormat: F,
@@ -1206,13 +1206,13 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1206
1206
  s,
1207
1207
  c,
1208
1208
  o
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,
1209
+ ]), A = e.length, R = m.times[0] ?? 0, X = m.times[A - 1] ?? 0, bt = A > 0 ? X - R + m.span : 0, w = L(() => Hn(W, r, m.yLabels), [
1210
+ W,
1211
1211
  r,
1212
1212
  m.yLabels
1213
- ]), Q = L(() => nr(w.innerWidth, W, m.bars.length, f), [
1213
+ ]), Q = L(() => nr(w.innerWidth, A, m.bars.length, f), [
1214
1214
  w.innerWidth,
1215
- W,
1215
+ A,
1216
1216
  m.bars.length,
1217
1217
  f
1218
1218
  ]), Tt = L(() => m.hasBars ? {
@@ -1235,13 +1235,13 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1235
1235
  domain: m.y.domain,
1236
1236
  zero: !1,
1237
1237
  nice: !1
1238
- }), [m.y.domain]), _t = L(() => On(m.colors), [m.colors]), Ie = L(() => {
1238
+ }), [m.y.domain]), _t = L(() => On(m.colors), [m.colors]), Le = L(() => {
1239
1239
  const d = Kn(c);
1240
- if (W === 0 || w.innerWidth <= 0) return {
1240
+ if (A === 0 || w.innerWidth <= 0) return {
1241
1241
  values: [],
1242
1242
  format: () => ""
1243
1243
  };
1244
- const x = En(Ln(R, X, w.innerWidth), d, w.innerWidth);
1244
+ const x = En(In(R, X, w.innerWidth, m.hasBars ? Math.max(1, A - 1) : void 0), d, w.innerWidth);
1245
1245
  if (!m.hasBars) return {
1246
1246
  values: x,
1247
1247
  format: (v) => d(new Date(v))
@@ -1253,17 +1253,17 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1253
1253
  }
1254
1254
  return {
1255
1255
  values: [...b.keys()],
1256
- format: (v) => b.get($(v)) ?? d(new Date(v))
1256
+ format: (v) => b.get(E(v)) ?? d(new Date(v))
1257
1257
  };
1258
1258
  }, [
1259
- W,
1259
+ A,
1260
1260
  R,
1261
1261
  X,
1262
1262
  w.innerWidth,
1263
1263
  c,
1264
1264
  m.hasBars,
1265
1265
  m.times
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(() => {
1266
+ ]), kt = l ?? D.length > 1, Ke = A === 0 && !p, wt = A === 0 && p === !0, Nt = m.y.domain[0] >= 0 || m.y.domain[1] <= 0, G = e, de = L(() => {
1267
1267
  const d = /* @__PURE__ */ new Map();
1268
1268
  for (const x of m.lines) x.gaps === "connect" && d.set(x.dataKey, G.filter((b) => C(b, x.dataKey) != null));
1269
1269
  return d;
@@ -1272,7 +1272,7 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1272
1272
  if (d.length === 0) return null;
1273
1273
  const x = !f || d.length === 1, b = d.map((v) => {
1274
1274
  const F = m.colors[D.indexOf(v)];
1275
- return /* @__PURE__ */ u(Bt, {
1275
+ return /* @__PURE__ */ u(zt, {
1276
1276
  dataKey: v.dataKey,
1277
1277
  data: G,
1278
1278
  xAccessor: ke,
@@ -1287,7 +1287,7 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1287
1287
  data: G,
1288
1288
  keys: d.map((v) => v.dataKey),
1289
1289
  children: /* @__PURE__ */ u(Ot, { children: b })
1290
- }) : /* @__PURE__ */ u(zt, {
1290
+ }) : /* @__PURE__ */ u(Bt, {
1291
1291
  padding: Q.groupPadding,
1292
1292
  children: b
1293
1293
  });
@@ -1322,8 +1322,8 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1322
1322
  }, d.dataKey);
1323
1323
  }), St = m.lines.flatMap((d) => {
1324
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 ? [] : [{
1325
+ const ee = C(v, d.dataKey), I = x[F - 1], te = x[F + 1];
1326
+ return ee == null || I != null && C(I, d.dataKey) != null || te != null && C(te, d.dataKey) != null ? [] : [{
1327
1327
  x: v.x,
1328
1328
  value: ee
1329
1329
  }];
@@ -1342,7 +1342,7 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1342
1342
  loading: p,
1343
1343
  empty: M,
1344
1344
  showEmpty: Ke,
1345
- placeholder: wt ? /* @__PURE__ */ u(Bn, { layout: w }) : null,
1345
+ placeholder: wt ? /* @__PURE__ */ u(zn, { layout: w }) : null,
1346
1346
  className: _,
1347
1347
  legend: kt ? /* @__PURE__ */ u(an, { items: D.map((d, x) => ({
1348
1348
  label: d.label,
@@ -1351,19 +1351,19 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1351
1351
  dashed: d.dashed
1352
1352
  })) }) : null,
1353
1353
  ...J,
1354
- children: H > 0 && !Ke && /* @__PURE__ */ u(jt, {
1354
+ children: W > 0 && !Ke && /* @__PURE__ */ u(jt, {
1355
1355
  xScale: Tt,
1356
1356
  yScale: Mt,
1357
1357
  theme: _t,
1358
1358
  initialDimensions: {
1359
- width: H,
1359
+ width: W,
1360
1360
  height: r,
1361
1361
  margin: w.margin
1362
1362
  },
1363
1363
  children: /* @__PURE__ */ k(qt, {
1364
1364
  hideTooltipDebounceMs: 0,
1365
1365
  children: [/* @__PURE__ */ k(Zt, {
1366
- width: H,
1366
+ width: W,
1367
1367
  height: r,
1368
1368
  margin: w.margin,
1369
1369
  accessibilityLabel: n,
@@ -1382,8 +1382,8 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1382
1382
  tickLabelProps: hr
1383
1383
  }),
1384
1384
  /* @__PURE__ */ u(rr, {
1385
- values: Ie.values,
1386
- format: Ie.format,
1385
+ values: Le.values,
1386
+ format: Le.format,
1387
1387
  layout: w
1388
1388
  }),
1389
1389
  m.hasBars && /* @__PURE__ */ u(ir, {
@@ -1415,7 +1415,7 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1415
1415
  layout: w,
1416
1416
  parts: D,
1417
1417
  colors: m.colors,
1418
- width: H,
1418
+ width: W,
1419
1419
  headingFormat: m.headingFormat,
1420
1420
  valueFormat: m.fullFormat,
1421
1421
  breakdownTitle: g,
@@ -1426,9 +1426,9 @@ function Le({ data: e, children: t, label: n, description: o, height: r = 200, w
1426
1426
  })
1427
1427
  });
1428
1428
  }
1429
- Le.displayName = "Chart";
1430
- Le.Bar = Se;
1431
- Le.Line = Fe;
1429
+ Ie.displayName = "Chart";
1430
+ Ie.Bar = Se;
1431
+ Ie.Line = Fe;
1432
1432
  export {
1433
1433
  rt as a,
1434
1434
  an as i,
@@ -1436,7 +1436,7 @@ export {
1436
1436
  Re as o,
1437
1437
  Fe as r,
1438
1438
  nn as s,
1439
- Le as t
1439
+ Ie as t
1440
1440
  };
1441
1441
 
1442
- //# sourceMappingURL=chart-PPuzbeXN.js.map
1442
+ //# sourceMappingURL=chart-B5wjhkBu.js.map