@carto/ps-react-ui 4.4.2 → 4.4.3

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 (65) hide show
  1. package/dist/download-config-Dqu78h2a.js +57 -0
  2. package/dist/download-config-Dqu78h2a.js.map +1 -0
  3. package/dist/formatter-B9Bxn1k7.js +6 -0
  4. package/dist/formatter-B9Bxn1k7.js.map +1 -0
  5. package/dist/styles-Y8q7Jff3.js +118 -0
  6. package/dist/styles-Y8q7Jff3.js.map +1 -0
  7. package/dist/types/widgets/actions/brush-toggle/types.d.ts +8 -2
  8. package/dist/types/widgets/category/components/category-row-multi.d.ts +2 -1
  9. package/dist/types/widgets/category/components/category-row-single.d.ts +2 -1
  10. package/dist/types/widgets/category/types.d.ts +1 -0
  11. package/dist/types/widgets/echart/types.d.ts +2 -0
  12. package/dist/types/widgets/histogram/config.d.ts +15 -3
  13. package/dist/types/widgets/histogram/index.d.ts +2 -1
  14. package/dist/types/widgets/histogram/types.d.ts +6 -3
  15. package/dist/types/widgets/stores/types.d.ts +2 -0
  16. package/dist/types/widgets/utils/chart-config/index.d.ts +1 -1
  17. package/dist/types/widgets/utils/chart-config/option-builders.d.ts +13 -8
  18. package/dist/types/widgets/utils/formatter.d.ts +1 -0
  19. package/dist/types/widgets/utils/index.d.ts +1 -1
  20. package/dist/widgets/actions.js +455 -439
  21. package/dist/widgets/actions.js.map +1 -1
  22. package/dist/widgets/bar.js +52 -46
  23. package/dist/widgets/bar.js.map +1 -1
  24. package/dist/widgets/category.js +206 -197
  25. package/dist/widgets/category.js.map +1 -1
  26. package/dist/widgets/formula.js +1 -1
  27. package/dist/widgets/histogram.js +119 -79
  28. package/dist/widgets/histogram.js.map +1 -1
  29. package/dist/widgets/pie.js +110 -98
  30. package/dist/widgets/pie.js.map +1 -1
  31. package/dist/widgets/range.js +1 -1
  32. package/dist/widgets/scatterplot.js +49 -43
  33. package/dist/widgets/scatterplot.js.map +1 -1
  34. package/dist/widgets/spread.js +1 -1
  35. package/dist/widgets/timeseries.js +51 -45
  36. package/dist/widgets/timeseries.js.map +1 -1
  37. package/dist/widgets/toolbar-actions.js +101 -6693
  38. package/dist/widgets/toolbar-actions.js.map +1 -1
  39. package/dist/widgets/utils.js +16 -14
  40. package/dist/widgets/utils.js.map +1 -1
  41. package/package.json +5 -4
  42. package/src/widgets/README.md +3 -3
  43. package/src/widgets/actions/brush-toggle/brush-toggle.tsx +42 -47
  44. package/src/widgets/actions/brush-toggle/types.ts +8 -2
  45. package/src/widgets/bar/config.ts +22 -14
  46. package/src/widgets/category/category-ui.tsx +9 -1
  47. package/src/widgets/category/components/category-row-multi.tsx +6 -2
  48. package/src/widgets/category/components/category-row-single.tsx +5 -1
  49. package/src/widgets/category/types.ts +1 -0
  50. package/src/widgets/echart/types.ts +2 -0
  51. package/src/widgets/histogram/config.ts +101 -20
  52. package/src/widgets/histogram/index.ts +6 -1
  53. package/src/widgets/histogram/types.ts +9 -3
  54. package/src/widgets/pie/config.ts +17 -5
  55. package/src/widgets/scatterplot/config.ts +8 -3
  56. package/src/widgets/stores/types.ts +2 -0
  57. package/src/widgets/timeseries/config.ts +21 -13
  58. package/src/widgets/utils/chart-config/index.ts +1 -1
  59. package/src/widgets/utils/chart-config/option-builders.ts +22 -12
  60. package/src/widgets/utils/formatter.ts +2 -1
  61. package/src/widgets/utils/index.ts +1 -1
  62. package/dist/formatter-B1Xh8XDH.js +0 -5
  63. package/dist/formatter-B1Xh8XDH.js.map +0 -1
  64. package/dist/styles-C_8vOEep.js +0 -167
  65. package/dist/styles-C_8vOEep.js.map +0 -1
@@ -1,19 +1,19 @@
1
- import { jsx as m, jsxs as k } from "react/jsx-runtime";
2
- import { c as V } from "react/compiler-runtime";
3
- import { Box as b, Typography as T, useTheme as te, Skeleton as K } from "@mui/material";
4
- import { u as R } from "../widget-store-CzDt8oSK.js";
5
- import { useShallow as D } from "zustand/shallow";
6
- import { useState as oe } from "react";
7
- import { d as le } from "../formatter-B1Xh8XDH.js";
1
+ import { jsx as g, jsxs as $ } from "react/jsx-runtime";
2
+ import { c as B } from "react/compiler-runtime";
3
+ import { Box as C, Typography as V, useTheme as re, Skeleton as Y } from "@mui/material";
4
+ import { u as F } from "../widget-store-CzDt8oSK.js";
5
+ import { useShallow as I } from "zustand/shallow";
6
+ import { useState as ne } from "react";
7
+ import { a as ie, d as ae } from "../formatter-B9Bxn1k7.js";
8
8
  import "@mui/icons-material";
9
9
  import "react-markdown";
10
- import { d as Y, a as Q } from "../exports-Cr43OCul.js";
10
+ import { d as te, a as Z } from "../exports-Cr43OCul.js";
11
11
  import "../lasso-tool-BYbxrJ-7.js";
12
12
  import "../cjs-D4KH3azB.js";
13
13
  import "@dnd-kit/core";
14
14
  import "@dnd-kit/sortable";
15
15
  import "@dnd-kit/utilities";
16
- const d = {
16
+ const u = {
17
17
  root: {
18
18
  display: "flex",
19
19
  flexDirection: "column",
@@ -143,120 +143,126 @@ const d = {
143
143
  color: "text.disabled"
144
144
  }
145
145
  };
146
- function Z(o) {
147
- const e = V(6), {
146
+ function oe(o) {
147
+ const e = B(6), {
148
148
  value: t,
149
149
  maxValue: r,
150
150
  color: l,
151
- selected: c
152
- } = o, i = c === void 0 ? !0 : c, s = r > 0 ? t / r * 100 : 0;
153
- let g;
154
- e[0] !== l || e[1] !== s || e[2] !== i ? (g = i ? {
155
- ...d.barFill,
156
- width: `${s}%`,
151
+ selected: s
152
+ } = o, n = s === void 0 ? !0 : s, i = r > 0 ? t / r * 100 : 0;
153
+ let c;
154
+ e[0] !== l || e[1] !== i || e[2] !== n ? (c = n ? {
155
+ ...u.barFill,
156
+ width: `${i}%`,
157
157
  backgroundColor: l
158
158
  } : {
159
- ...d.barFill,
160
- ...d.barFillMuted,
161
- width: `${s}%`
162
- }, e[0] = l, e[1] = s, e[2] = i, e[3] = g) : g = e[3];
163
- const n = g;
159
+ ...u.barFill,
160
+ ...u.barFillMuted,
161
+ width: `${i}%`
162
+ }, e[0] = l, e[1] = i, e[2] = n, e[3] = c) : c = e[3];
163
+ const d = c;
164
164
  let a;
165
- return e[4] !== n ? (a = /* @__PURE__ */ m(b, { sx: d.bar, children: /* @__PURE__ */ m(b, { sx: n }) }), e[4] = n, e[5] = a) : a = e[5], a;
165
+ return e[4] !== d ? (a = /* @__PURE__ */ g(C, { sx: u.bar, children: /* @__PURE__ */ g(C, { sx: d }) }), e[4] = d, e[5] = a) : a = e[5], a;
166
166
  }
167
- function re(o) {
168
- const e = V(23), {
167
+ function se(o) {
168
+ const e = B(26), {
169
169
  name: t,
170
170
  value: r,
171
171
  maxValue: l,
172
- color: c,
173
- formatter: i,
174
- onClick: s,
175
- selected: g
176
- } = o, n = g === void 0 ? !0 : g;
177
- let a;
178
- e[0] !== t || e[1] !== s ? (a = s ? () => s({
172
+ color: s,
173
+ formatter: n,
174
+ labelFormatter: i,
175
+ onClick: c,
176
+ selected: d
177
+ } = o, a = d === void 0 ? !0 : d;
178
+ let f;
179
+ e[0] !== t || e[1] !== c ? (f = c ? () => c({
179
180
  name: t
180
- }) : void 0, e[0] = t, e[1] = s, e[2] = a) : a = e[2];
181
- const u = a, y = s ? d.rowClickable : d.row;
182
- let h;
183
- e[3] !== t ? (h = /* @__PURE__ */ m(T, { sx: d.rowLabel, children: t }), e[3] = t, e[4] = h) : h = e[4];
181
+ }) : void 0, e[0] = t, e[1] = c, e[2] = f) : f = e[2];
182
+ const y = f, k = c ? u.rowClickable : u.row;
184
183
  let p;
185
- e[5] !== i || e[6] !== r ? (p = i(r), e[5] = i, e[6] = r, e[7] = p) : p = e[7];
184
+ e[3] !== i || e[4] !== t ? (p = i ? i(t) : t, e[3] = i, e[4] = t, e[5] = p) : p = e[5];
185
+ let h;
186
+ e[6] !== p ? (h = /* @__PURE__ */ g(V, { sx: u.rowLabel, children: p }), e[6] = p, e[7] = h) : h = e[7];
187
+ let b;
188
+ e[8] !== n || e[9] !== r ? (b = n(r), e[8] = n, e[9] = r, e[10] = b) : b = e[10];
186
189
  let x;
187
- e[8] !== p ? (x = /* @__PURE__ */ m(T, { sx: d.rowValue, children: p }), e[8] = p, e[9] = x) : x = e[9];
188
- let C;
189
- e[10] !== h || e[11] !== x ? (C = /* @__PURE__ */ k(b, { sx: d.rowHeader, children: [
190
+ e[11] !== b ? (x = /* @__PURE__ */ g(V, { sx: u.rowValue, children: b }), e[11] = b, e[12] = x) : x = e[12];
191
+ let w;
192
+ e[13] !== h || e[14] !== x ? (w = /* @__PURE__ */ $(C, { sx: u.rowHeader, children: [
190
193
  h,
191
194
  x
192
- ] }), e[10] = h, e[11] = x, e[12] = C) : C = e[12];
193
- let w;
194
- e[13] !== c || e[14] !== l || e[15] !== n || e[16] !== r ? (w = /* @__PURE__ */ m(Z, { value: r, maxValue: l, color: c, selected: n }), e[13] = c, e[14] = l, e[15] = n, e[16] = r, e[17] = w) : w = e[17];
195
+ ] }), e[13] = h, e[14] = x, e[15] = w) : w = e[15];
195
196
  let v;
196
- return e[18] !== u || e[19] !== y || e[20] !== C || e[21] !== w ? (v = /* @__PURE__ */ k(b, { sx: y, onClick: u, children: [
197
- C,
198
- w
199
- ] }), e[18] = u, e[19] = y, e[20] = C, e[21] = w, e[22] = v) : v = e[22], v;
197
+ e[16] !== s || e[17] !== l || e[18] !== a || e[19] !== r ? (v = /* @__PURE__ */ g(oe, { value: r, maxValue: l, color: s, selected: a }), e[16] = s, e[17] = l, e[18] = a, e[19] = r, e[20] = v) : v = e[20];
198
+ let S;
199
+ return e[21] !== y || e[22] !== k || e[23] !== w || e[24] !== v ? (S = /* @__PURE__ */ $(C, { sx: k, onClick: y, children: [
200
+ w,
201
+ v
202
+ ] }), e[21] = y, e[22] = k, e[23] = w, e[24] = v, e[25] = S) : S = e[25], S;
200
203
  }
201
- function ne(o) {
202
- const e = V(25), {
204
+ function ce(o) {
205
+ const e = B(28), {
203
206
  name: t,
204
207
  values: r,
205
208
  maxValue: l,
206
- colors: c,
207
- formatter: i,
208
- onClick: s,
209
- selected: g
210
- } = o, n = g === void 0 ? !0 : g;
211
- let a;
212
- e[0] !== t || e[1] !== s ? (a = s ? () => s({
209
+ colors: s,
210
+ formatter: n,
211
+ labelFormatter: i,
212
+ onClick: c,
213
+ selected: d
214
+ } = o, a = d === void 0 ? !0 : d;
215
+ let f;
216
+ e[0] !== t || e[1] !== c ? (f = c ? () => c({
213
217
  name: t
214
- }) : void 0, e[0] = t, e[1] = s, e[2] = a) : a = e[2];
215
- const u = a, y = s ? d.rowClickable : d.row;
216
- let h;
217
- e[3] !== t ? (h = /* @__PURE__ */ m(T, { sx: d.rowLabel, children: t }), e[3] = t, e[4] = h) : h = e[4];
218
+ }) : void 0, e[0] = t, e[1] = c, e[2] = f) : f = e[2];
219
+ const y = f, k = c ? u.rowClickable : u.row;
218
220
  let p;
219
- if (e[5] !== c || e[6] !== i || e[7] !== l || e[8] !== t || e[9] !== n || e[10] !== r) {
220
- let w;
221
- e[12] !== c || e[13] !== i || e[14] !== l || e[15] !== t || e[16] !== n ? (w = (v, E) => /* @__PURE__ */ k(b, { sx: d.multiBarRow, children: [
222
- /* @__PURE__ */ m(b, { sx: d.multiBarContainer, children: /* @__PURE__ */ m(Z, { value: v, maxValue: l, color: c[E % c.length] ?? "", selected: n }) }),
223
- /* @__PURE__ */ m(T, { sx: d.multiBarValue, children: i(v) })
224
- ] }, `${t}-${v}`), e[12] = c, e[13] = i, e[14] = l, e[15] = t, e[16] = n, e[17] = w) : w = e[17], p = r.map(w), e[5] = c, e[6] = i, e[7] = l, e[8] = t, e[9] = n, e[10] = r, e[11] = p;
221
+ e[3] !== i || e[4] !== t ? (p = i ? i(t) : t, e[3] = i, e[4] = t, e[5] = p) : p = e[5];
222
+ let h;
223
+ e[6] !== p ? (h = /* @__PURE__ */ g(V, { sx: u.rowLabel, children: p }), e[6] = p, e[7] = h) : h = e[7];
224
+ let b;
225
+ if (e[8] !== s || e[9] !== n || e[10] !== l || e[11] !== t || e[12] !== a || e[13] !== r) {
226
+ let v;
227
+ e[15] !== s || e[16] !== n || e[17] !== l || e[18] !== t || e[19] !== a ? (v = (S, _) => /* @__PURE__ */ $(C, { sx: u.multiBarRow, children: [
228
+ /* @__PURE__ */ g(C, { sx: u.multiBarContainer, children: /* @__PURE__ */ g(oe, { value: S, maxValue: l, color: s[_ % s.length] ?? "", selected: a }) }),
229
+ /* @__PURE__ */ g(V, { sx: u.multiBarValue, children: n(S) })
230
+ ] }, `${t}-${S}-${_}`), e[15] = s, e[16] = n, e[17] = l, e[18] = t, e[19] = a, e[20] = v) : v = e[20], b = r.map(v), e[8] = s, e[9] = n, e[10] = l, e[11] = t, e[12] = a, e[13] = r, e[14] = b;
225
231
  } else
226
- p = e[11];
232
+ b = e[14];
227
233
  let x;
228
- e[18] !== p ? (x = /* @__PURE__ */ m(b, { sx: d.barContainer, children: p }), e[18] = p, e[19] = x) : x = e[19];
229
- let C;
230
- return e[20] !== u || e[21] !== y || e[22] !== h || e[23] !== x ? (C = /* @__PURE__ */ k(b, { sx: y, onClick: u, children: [
234
+ e[21] !== b ? (x = /* @__PURE__ */ g(C, { sx: u.barContainer, children: b }), e[21] = b, e[22] = x) : x = e[22];
235
+ let w;
236
+ return e[23] !== y || e[24] !== k || e[25] !== h || e[26] !== x ? (w = /* @__PURE__ */ $(C, { sx: k, onClick: y, children: [
231
237
  h,
232
238
  x
233
- ] }), e[20] = u, e[21] = y, e[22] = h, e[23] = x, e[24] = C) : C = e[24], C;
239
+ ] }), e[23] = y, e[24] = k, e[25] = h, e[26] = x, e[27] = w) : w = e[27], w;
234
240
  }
235
- function ie(o) {
236
- const e = V(10), {
241
+ function de(o) {
242
+ const e = B(10), {
237
243
  hiddenCount: t,
238
244
  otherLabel: r,
239
245
  otherCountLabel: l
240
- } = o, c = r === void 0 ? "Other" : r, i = l === void 0 ? "{count} more" : l;
241
- let s;
242
- e[0] !== t || e[1] !== i ? (s = i.replace("{count}", String(t)), e[0] = t, e[1] = i, e[2] = s) : s = e[2];
243
- const g = s;
244
- let n;
245
- e[3] !== c ? (n = /* @__PURE__ */ m(T, { sx: d.otherLabel, children: c }), e[3] = c, e[4] = n) : n = e[4];
246
+ } = o, s = r === void 0 ? "Other" : r, n = l === void 0 ? "{count} more" : l;
247
+ let i;
248
+ e[0] !== t || e[1] !== n ? (i = n.replace("{count}", String(t)), e[0] = t, e[1] = n, e[2] = i) : i = e[2];
249
+ const c = i;
250
+ let d;
251
+ e[3] !== s ? (d = /* @__PURE__ */ g(V, { sx: u.otherLabel, children: s }), e[3] = s, e[4] = d) : d = e[4];
246
252
  let a;
247
- e[5] !== g ? (a = /* @__PURE__ */ k(T, { sx: d.otherCount, children: [
253
+ e[5] !== c ? (a = /* @__PURE__ */ $(V, { sx: u.otherCount, children: [
248
254
  "(",
249
- g,
255
+ c,
250
256
  ")"
251
- ] }), e[5] = g, e[6] = a) : a = e[6];
252
- let u;
253
- return e[7] !== n || e[8] !== a ? (u = /* @__PURE__ */ k(b, { sx: d.otherRow, children: [
254
- n,
257
+ ] }), e[5] = c, e[6] = a) : a = e[6];
258
+ let f;
259
+ return e[7] !== d || e[8] !== a ? (f = /* @__PURE__ */ $(C, { sx: u.otherRow, children: [
260
+ d,
255
261
  a
256
- ] }), e[7] = n, e[8] = a, e[9] = u) : u = e[9], u;
262
+ ] }), e[7] = d, e[8] = a, e[9] = f) : f = e[9], f;
257
263
  }
258
- function se(o) {
259
- const e = V(7), {
264
+ function ue(o) {
265
+ const e = B(7), {
260
266
  series: t,
261
267
  colors: r
262
268
  } = o;
@@ -264,103 +270,106 @@ function se(o) {
264
270
  return null;
265
271
  let l;
266
272
  if (e[0] !== r || e[1] !== t) {
267
- let i;
268
- e[3] !== r ? (i = (s, g) => /* @__PURE__ */ k(b, { sx: d.legendItem, children: [
269
- /* @__PURE__ */ m(b, { sx: {
270
- ...d.legendDot,
271
- backgroundColor: s.color ?? r[g % r.length]
273
+ let n;
274
+ e[3] !== r ? (n = (i, c) => /* @__PURE__ */ $(C, { sx: u.legendItem, children: [
275
+ /* @__PURE__ */ g(C, { sx: {
276
+ ...u.legendDot,
277
+ backgroundColor: i.color ?? r[c % r.length]
272
278
  } }),
273
- /* @__PURE__ */ m(T, { sx: d.legendLabel, children: s.name })
274
- ] }, s.name), e[3] = r, e[4] = i) : i = e[4], l = t.map(i), e[0] = r, e[1] = t, e[2] = l;
279
+ /* @__PURE__ */ g(V, { sx: u.legendLabel, children: i.name })
280
+ ] }, i.name), e[3] = r, e[4] = n) : n = e[4], l = t.map(n), e[0] = r, e[1] = t, e[2] = l;
275
281
  } else
276
282
  l = e[2];
277
- let c;
278
- return e[5] !== l ? (c = /* @__PURE__ */ m(b, { sx: d.legend, children: l }), e[5] = l, e[6] = c) : c = e[6], c;
283
+ let s;
284
+ return e[5] !== l ? (s = /* @__PURE__ */ g(C, { sx: u.legend, children: l }), e[5] = l, e[6] = s) : s = e[6], s;
279
285
  }
280
- function We(o) {
281
- const e = V(55), {
286
+ function De(o) {
287
+ const e = B(58), {
282
288
  id: t
283
- } = o, r = te();
289
+ } = o, r = re();
284
290
  let l;
285
- e[0] !== t ? (l = (f) => f.getWidget(t)?.formatter, e[0] = t, e[1] = l) : l = e[1];
286
- const c = R(D(l));
287
- let i;
288
- e[2] !== t ? (i = (f) => f.getWidget(t)?.series, e[2] = t, e[3] = i) : i = e[3];
289
- const s = R(D(i));
290
- let g;
291
- e[4] !== t ? (g = (f) => f.getWidget(t)?.data, e[4] = t, e[5] = g) : g = e[5];
292
- const n = R(D(g));
291
+ e[0] !== t ? (l = (m) => m.getWidget(t)?.formatter, e[0] = t, e[1] = l) : l = e[1];
292
+ const s = F(I(l));
293
+ let n;
294
+ e[2] !== t ? (n = (m) => m.getWidget(t)?.labelFormatter, e[2] = t, e[3] = n) : n = e[3];
295
+ const i = F(I(n));
296
+ let c;
297
+ e[4] !== t ? (c = (m) => m.getWidget(t)?.series, e[4] = t, e[5] = c) : c = e[5];
298
+ const d = F(I(c));
293
299
  let a;
294
- e[6] !== t ? (a = (f) => f.getWidget(t)?.maxItems, e[6] = t, e[7] = a) : a = e[7];
295
- const u = R(D(a));
300
+ e[6] !== t ? (a = (m) => m.getWidget(t)?.data, e[6] = t, e[7] = a) : a = e[7];
301
+ const f = F(I(a));
296
302
  let y;
297
- e[8] !== t ? (y = (f) => f.getWidget(t)?.labels, e[8] = t, e[9] = y) : y = e[9];
298
- const h = R(D(y));
303
+ e[8] !== t ? (y = (m) => m.getWidget(t)?.maxItems, e[8] = t, e[9] = y) : y = e[9];
304
+ const k = F(I(y));
299
305
  let p;
300
- e[10] !== t ? (p = (f) => f.getWidget(t)?.onRowClick, e[10] = t, e[11] = p) : p = e[11];
301
- const x = R(D(p));
302
- let C;
303
- e[12] !== t ? (C = (f) => f.getWidget(t)?.selected, e[12] = t, e[13] = C) : C = e[13];
304
- const w = R(D(C));
305
- let v;
306
- e[14] !== t ? (v = (f) => f.getWidget(t)?.max, e[14] = t, e[15] = v) : v = e[15];
307
- const E = R(D(v)), P = c ?? le, S = s ?? [], [G] = oe(u ? 40 * (S.length || 1) * u : void 0), X = Object.values(r.palette.qualitative.bold), M = S.length > 0 ? S.map((f, U) => f.color ?? X[U % X.length] ?? r.palette.secondary.main) : [r.palette.secondary.main];
308
- let B, _, L, W, F, I, j, A;
309
- if (e[16] !== M || e[17] !== n || e[18] !== P || e[19] !== E || e[20] !== G || e[21] !== u || e[22] !== x || e[23] !== w || e[24] !== S) {
310
- j = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
306
+ e[10] !== t ? (p = (m) => m.getWidget(t)?.labels, e[10] = t, e[11] = p) : p = e[11];
307
+ const h = F(I(p));
308
+ let b;
309
+ e[12] !== t ? (b = (m) => m.getWidget(t)?.onRowClick, e[12] = t, e[13] = b) : b = e[13];
310
+ const x = F(I(b));
311
+ let w;
312
+ e[14] !== t ? (w = (m) => m.getWidget(t)?.selected, e[14] = t, e[15] = w) : w = e[15];
313
+ const v = F(I(w));
314
+ let S;
315
+ e[16] !== t ? (S = (m) => m.getWidget(t)?.max, e[16] = t, e[17] = S) : S = e[17];
316
+ const _ = F(I(S)), U = s ?? ae, z = i ?? ie, L = d ?? [], [N] = ne(k ? 40 * (L.length || 1) * k : void 0), ee = Object.values(r.palette.qualitative.bold), T = L.length > 0 ? L.map((m, K) => m.color ?? ee[K % ee.length] ?? r.palette.secondary.main) : [r.palette.secondary.main];
317
+ let j, A, R, O, D, H, M, q;
318
+ if (e[18] !== T || e[19] !== f || e[20] !== U || e[21] !== z || e[22] !== _ || e[23] !== N || e[24] !== k || e[25] !== x || e[26] !== v || e[27] !== L) {
319
+ q = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
311
320
  e: {
312
- const f = ce({
313
- data: n
321
+ const m = fe({
322
+ data: f
314
323
  });
315
- if (f.length === 0) {
316
- j = null;
324
+ if (m.length === 0) {
325
+ q = null;
317
326
  break e;
318
327
  }
319
- const U = E ?? Math.max(...f.flatMap(ae)), z = u !== void 0 && u >= 0 ? f.slice(0, u) : f;
320
- L = f.length - z.length;
321
- const ee = S.length > 1;
322
- _ = b, e[33] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = {
323
- ...d.root
324
- }, e[33] = I) : I = e[33], B = b, A = d.list;
325
- const J = L === 0 ? "auto" : "hidden";
326
- e[34] !== G || e[35] !== J ? (W = {
327
- maxHeight: G,
328
- overflow: J
329
- }, e[34] = G, e[35] = J, e[36] = W) : W = e[36], F = ee ? z.map(($) => /* @__PURE__ */ m(ne, { name: $.name, values: $.values, maxValue: U, colors: M, formatter: P, onClick: x, selected: w?.($.name) ?? !0 }, $.name)) : z.map(($) => /* @__PURE__ */ m(re, { name: $.name, value: $.values[0] ?? 0, selected: w?.($.name) ?? !0, maxValue: U, color: M[0], formatter: P, onClick: x }, $.name));
328
+ const K = _ ?? Math.max(...m.flatMap(me)), Q = k !== void 0 && k >= 0 ? m.slice(0, k) : m;
329
+ R = m.length - Q.length;
330
+ const le = L.length > 1;
331
+ A = C, e[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = {
332
+ ...u.root
333
+ }, e[36] = M) : M = e[36], j = C, O = u.list;
334
+ const X = R === 0 ? "auto" : "hidden";
335
+ e[37] !== N || e[38] !== X ? (D = {
336
+ maxHeight: N,
337
+ overflow: X
338
+ }, e[37] = N, e[38] = X, e[39] = D) : D = e[39], H = le ? Q.map((W) => /* @__PURE__ */ g(ce, { name: W.name, values: W.values, maxValue: K, colors: T, formatter: U, labelFormatter: z, onClick: x, selected: v?.(W.name) ?? !0 }, W.name)) : Q.map((W) => /* @__PURE__ */ g(se, { name: W.name, value: W.values[0] ?? 0, selected: v?.(W.name) ?? !0, maxValue: K, color: T[0], formatter: U, labelFormatter: z, onClick: x }, W.name));
330
339
  }
331
- e[16] = M, e[17] = n, e[18] = P, e[19] = E, e[20] = G, e[21] = u, e[22] = x, e[23] = w, e[24] = S, e[25] = B, e[26] = _, e[27] = L, e[28] = W, e[29] = F, e[30] = I, e[31] = j, e[32] = A;
340
+ e[18] = T, e[19] = f, e[20] = U, e[21] = z, e[22] = _, e[23] = N, e[24] = k, e[25] = x, e[26] = v, e[27] = L, e[28] = j, e[29] = A, e[30] = R, e[31] = O, e[32] = D, e[33] = H, e[34] = M, e[35] = q;
332
341
  } else
333
- B = e[25], _ = e[26], L = e[27], W = e[28], F = e[29], I = e[30], j = e[31], A = e[32];
334
- if (j !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
335
- return j;
336
- let O;
337
- e[37] !== L || e[38] !== h?.other || e[39] !== h?.otherCount ? (O = L > 0 && /* @__PURE__ */ m(ie, { hiddenCount: L, otherLabel: h?.other, otherCountLabel: h?.otherCount }), e[37] = L, e[38] = h?.other, e[39] = h?.otherCount, e[40] = O) : O = e[40];
338
- let H;
339
- e[41] !== B || e[42] !== W || e[43] !== F || e[44] !== O || e[45] !== A ? (H = /* @__PURE__ */ k(B, { sx: A, style: W, children: [
340
- F,
341
- O
342
- ] }), e[41] = B, e[42] = W, e[43] = F, e[44] = O, e[45] = A, e[46] = H) : H = e[46];
343
- let q;
344
- e[47] !== M || e[48] !== S ? (q = S.length > 0 && /* @__PURE__ */ m(se, { series: S, colors: M }), e[47] = M, e[48] = S, e[49] = q) : q = e[49];
345
- let N;
346
- return e[50] !== _ || e[51] !== I || e[52] !== H || e[53] !== q ? (N = /* @__PURE__ */ k(_, { sx: I, children: [
342
+ j = e[28], A = e[29], R = e[30], O = e[31], D = e[32], H = e[33], M = e[34], q = e[35];
343
+ if (q !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
344
+ return q;
345
+ let E;
346
+ e[40] !== R || e[41] !== h?.other || e[42] !== h?.otherCount ? (E = R > 0 && /* @__PURE__ */ g(de, { hiddenCount: R, otherLabel: h?.other, otherCountLabel: h?.otherCount }), e[40] = R, e[41] = h?.other, e[42] = h?.otherCount, e[43] = E) : E = e[43];
347
+ let G;
348
+ e[44] !== j || e[45] !== O || e[46] !== D || e[47] !== H || e[48] !== E ? (G = /* @__PURE__ */ $(j, { sx: O, style: D, children: [
347
349
  H,
348
- q
349
- ] }), e[50] = _, e[51] = I, e[52] = H, e[53] = q, e[54] = N) : N = e[54], N;
350
+ E
351
+ ] }), e[44] = j, e[45] = O, e[46] = D, e[47] = H, e[48] = E, e[49] = G) : G = e[49];
352
+ let P;
353
+ e[50] !== T || e[51] !== L ? (P = L.length > 0 && /* @__PURE__ */ g(ue, { series: L, colors: T }), e[50] = T, e[51] = L, e[52] = P) : P = e[52];
354
+ let J;
355
+ return e[53] !== A || e[54] !== M || e[55] !== G || e[56] !== P ? (J = /* @__PURE__ */ $(A, { sx: M, children: [
356
+ G,
357
+ P
358
+ ] }), e[53] = A, e[54] = M, e[55] = G, e[56] = P, e[57] = J) : J = e[57], J;
350
359
  }
351
- function ae(o) {
360
+ function me(o) {
352
361
  return o.values;
353
362
  }
354
- function ce({
363
+ function fe({
355
364
  data: o
356
365
  }) {
357
366
  if (!o || o.length === 0) return [];
358
367
  const e = Math.max(o.length, 1), t = /* @__PURE__ */ new Map(), r = [];
359
368
  for (let l = 0; l < o.length; l++) {
360
- const c = o[l];
361
- for (const i of c) {
362
- let s = t.get(i.name);
363
- s || (s = new Array(e).fill(0), t.set(i.name, s), r.push(i.name)), s[l] = i.value;
369
+ const s = o[l];
370
+ for (const n of s) {
371
+ let i = t.get(n.name);
372
+ i || (i = new Array(e).fill(0), t.set(n.name, i), r.push(n.name)), i[l] = n.value;
364
373
  }
365
374
  }
366
375
  return r.map((l) => ({
@@ -368,54 +377,54 @@ function ce({
368
377
  values: t.get(l)
369
378
  }));
370
379
  }
371
- const de = [85, 70, 55, 75, 60];
372
- function Ie() {
373
- const o = V(1);
380
+ const ge = [85, 70, 55, 75, 60];
381
+ function Me() {
382
+ const o = B(1);
374
383
  let e;
375
- return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ m(b, { sx: d.list, "aria-label": "Category skeleton", children: Array.from({
384
+ return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ g(C, { sx: u.list, "aria-label": "Category skeleton", children: Array.from({
376
385
  length: 5
377
- }).map(ue) }), o[0] = e) : e = o[0], e;
386
+ }).map(he) }), o[0] = e) : e = o[0], e;
378
387
  }
379
- function ue(o, e) {
380
- return /* @__PURE__ */ k(b, { sx: d.row, children: [
381
- /* @__PURE__ */ k(b, { sx: d.rowHeader, children: [
382
- /* @__PURE__ */ m(K, { width: 80, height: 16 }),
383
- /* @__PURE__ */ m(K, { width: 40, height: 16 })
388
+ function he(o, e) {
389
+ return /* @__PURE__ */ $(C, { sx: u.row, children: [
390
+ /* @__PURE__ */ $(C, { sx: u.rowHeader, children: [
391
+ /* @__PURE__ */ g(Y, { width: 80, height: 16 }),
392
+ /* @__PURE__ */ g(Y, { width: 40, height: 16 })
384
393
  ] }),
385
- /* @__PURE__ */ m(K, { variant: "rectangular", height: 4, sx: {
394
+ /* @__PURE__ */ g(Y, { variant: "rectangular", height: 4, sx: {
386
395
  borderRadius: 2,
387
- width: `${de[e]}%`
396
+ width: `${ge[e]}%`
388
397
  } })
389
398
  ] }, e);
390
399
  }
391
- function Re({
400
+ function Te({
392
401
  refUI: o,
393
402
  series: e
394
403
  }) {
395
404
  return [{
396
- ...Y,
397
- modifier: () => Y.modifier(o)
405
+ ...te,
406
+ modifier: () => te.modifier(o)
398
407
  }, {
399
- ...Q,
408
+ ...Z,
400
409
  modifier: async (t) => {
401
410
  if (!t?.length || t[0]?.length === 0)
402
- return Q.modifier([]);
403
- const r = t.length, l = /* @__PURE__ */ new Map(), c = [];
404
- for (let n = 0; n < r; n++) {
405
- const a = t[n];
406
- for (const u of a) {
407
- let y = l.get(u.name);
408
- y || (y = new Array(r).fill(0), l.set(u.name, y), c.push(u.name)), y[n] = u.value;
411
+ return Z.modifier([]);
412
+ const r = t.length, l = /* @__PURE__ */ new Map(), s = [];
413
+ for (let d = 0; d < r; d++) {
414
+ const a = t[d];
415
+ for (const f of a) {
416
+ let y = l.get(f.name);
417
+ y || (y = new Array(r).fill(0), l.set(f.name, y), s.push(f.name)), y[d] = f.value;
409
418
  }
410
419
  }
411
- const i = c.map((n) => [n, ...l.get(n)]), g = r > 1 ? ["Category", ...e?.map((n) => n.name) ?? Array.from({
420
+ const n = s.map((d) => [d, ...l.get(d)]), c = r > 1 ? ["Category", ...e?.map((d) => d.name) ?? Array.from({
412
421
  length: r
413
- }, (n, a) => `Series ${a + 1}`)] : ["Category", "Value"];
414
- return Q.modifier([g, ...i]);
422
+ }, (d, a) => `Series ${a + 1}`)] : ["Category", "Value"];
423
+ return Z.modifier([c, ...n]);
415
424
  }
416
425
  }];
417
426
  }
418
- function De() {
427
+ function Ve() {
419
428
  return {
420
429
  series: [],
421
430
  maxItems: 10,
@@ -423,14 +432,14 @@ function De() {
423
432
  };
424
433
  }
425
434
  export {
426
- Z as CategoryBar,
427
- se as CategoryLegend,
428
- ne as CategoryRowMulti,
429
- ie as CategoryRowOther,
430
- re as CategoryRowSingle,
431
- Ie as CategorySkeleton,
432
- We as CategoryUI,
433
- De as categoryConfig,
434
- Re as categoryDownloadConfig
435
+ oe as CategoryBar,
436
+ ue as CategoryLegend,
437
+ ce as CategoryRowMulti,
438
+ de as CategoryRowOther,
439
+ se as CategoryRowSingle,
440
+ Me as CategorySkeleton,
441
+ De as CategoryUI,
442
+ Ve as categoryConfig,
443
+ Te as categoryDownloadConfig
435
444
  };
436
445
  //# sourceMappingURL=category.js.map