@carto/ps-react-ui 5.0.0-widgets.10 → 5.0.0-widgets.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,22 @@
1
- import { jsx as h, jsxs as R } from "react/jsx-runtime";
1
+ import { jsx as h, jsxs as S } from "react/jsx-runtime";
2
2
  import { c as M } from "react/compiler-runtime";
3
- import { Box as C, Typography as L, useTheme as Q, Skeleton as N } from "@mui/material";
4
- import "react";
5
- import { u as X } from "../widget-store-CB6Trp_0.js";
6
- import { useShallow as Y } from "zustand/shallow";
3
+ import { Box as b, Typography as D, useTheme as N, Skeleton as H } from "@mui/material";
4
+ import { u as U } from "../widget-store-CB6Trp_0.js";
5
+ import { useShallow as z } from "zustand/shallow";
6
+ import { useState as J } from "react";
7
7
  import "@mui/icons-material";
8
8
  import "react-markdown";
9
- import { d as z, a as U } from "../exports-Cr43OCul.js";
9
+ import { d as E, a as q } from "../exports-Cr43OCul.js";
10
10
  import "../lasso-tool-CYn3ivf-.js";
11
11
  import "../cjs-D9ro6BXv.js";
12
12
  import "@dnd-kit/core";
13
13
  import "@dnd-kit/sortable";
14
14
  import "@dnd-kit/utilities";
15
- const u = {
15
+ const d = {
16
16
  root: {
17
17
  display: "flex",
18
18
  flexDirection: "column",
19
- position: "relative",
20
- overflow: "auto"
19
+ position: "relative"
21
20
  },
22
21
  list: {
23
22
  display: "flex",
@@ -143,310 +142,271 @@ const u = {
143
142
  color: "text.disabled"
144
143
  }
145
144
  };
146
- function J(t) {
145
+ function G(t) {
147
146
  const e = M(6), {
148
- value: r,
149
- maxValue: o,
150
- color: i,
151
- selected: n
152
- } = t, c = n === void 0 ? !0 : n, a = o > 0 ? r / o * 100 : 0;
153
- let d;
154
- e[0] !== i || e[1] !== a || e[2] !== c ? (d = c ? {
155
- ...u.barFill,
156
- width: `${a}%`,
157
- backgroundColor: i
147
+ value: o,
148
+ maxValue: i,
149
+ color: l,
150
+ selected: a
151
+ } = t, s = a === void 0 ? !0 : a, r = i > 0 ? o / i * 100 : 0;
152
+ let u;
153
+ e[0] !== l || e[1] !== r || e[2] !== s ? (u = s ? {
154
+ ...d.barFill,
155
+ width: `${r}%`,
156
+ backgroundColor: l
158
157
  } : {
159
- ...u.barFill,
160
- ...u.barFillMuted,
161
- width: `${a}%`
162
- }, e[0] = i, e[1] = a, e[2] = c, e[3] = d) : d = e[3];
163
- const l = d;
164
- let m;
165
- return e[4] !== l ? (m = /* @__PURE__ */ h(C, { sx: u.bar, children: /* @__PURE__ */ h(C, { sx: l }) }), e[4] = l, e[5] = m) : m = e[5], m;
158
+ ...d.barFill,
159
+ ...d.barFillMuted,
160
+ width: `${r}%`
161
+ }, e[0] = l, e[1] = r, e[2] = s, e[3] = u) : u = e[3];
162
+ const n = u;
163
+ let c;
164
+ return e[4] !== n ? (c = /* @__PURE__ */ h(b, { sx: d.bar, children: /* @__PURE__ */ h(b, { sx: n }) }), e[4] = n, e[5] = c) : c = e[5], c;
166
165
  }
167
- function Z(t) {
166
+ function K(t) {
168
167
  const e = M(23), {
169
- name: r,
170
- value: o,
171
- maxValue: i,
172
- color: n,
173
- formatter: c,
174
- onClick: a,
175
- selected: d
176
- } = t, l = d === void 0 ? !0 : d;
177
- let m;
178
- e[0] !== r || e[1] !== a ? (m = a ? () => a({
179
- name: r
180
- }) : void 0, e[0] = r, e[1] = a, e[2] = m) : m = e[2];
181
- const f = m, y = a ? u.rowClickable : u.row;
168
+ name: o,
169
+ value: i,
170
+ maxValue: l,
171
+ color: a,
172
+ formatter: s,
173
+ onClick: r,
174
+ selected: u
175
+ } = t, n = u === void 0 ? !0 : u;
176
+ let c;
177
+ e[0] !== o || e[1] !== r ? (c = r ? () => r({
178
+ name: o
179
+ }) : void 0, e[0] = o, e[1] = r, e[2] = c) : c = e[2];
180
+ const m = c, x = r ? d.rowClickable : d.row;
181
+ let y;
182
+ e[3] !== o ? (y = /* @__PURE__ */ h(D, { sx: d.rowLabel, children: o }), e[3] = o, e[4] = y) : y = e[4];
183
+ let f;
184
+ e[5] !== s || e[6] !== i ? (f = s(i), e[5] = s, e[6] = i, e[7] = f) : f = e[7];
185
+ let C;
186
+ e[8] !== f ? (C = /* @__PURE__ */ h(D, { sx: d.rowValue, children: f }), e[8] = f, e[9] = C) : C = e[9];
182
187
  let g;
183
- e[3] !== r ? (g = /* @__PURE__ */ h(L, { sx: u.rowLabel, children: r }), e[3] = r, e[4] = g) : g = e[4];
188
+ e[10] !== y || e[11] !== C ? (g = /* @__PURE__ */ S(b, { sx: d.rowHeader, children: [
189
+ y,
190
+ C
191
+ ] }), e[10] = y, e[11] = C, e[12] = g) : g = e[12];
192
+ let p;
193
+ e[13] !== a || e[14] !== l || e[15] !== n || e[16] !== i ? (p = /* @__PURE__ */ h(G, { value: i, maxValue: l, color: a, selected: n }), e[13] = a, e[14] = l, e[15] = n, e[16] = i, e[17] = p) : p = e[17];
184
194
  let w;
185
- e[5] !== c || e[6] !== o ? (w = c(o), e[5] = c, e[6] = o, e[7] = w) : w = e[7];
186
- let x;
187
- e[8] !== w ? (x = /* @__PURE__ */ h(L, { sx: u.rowValue, children: w }), e[8] = w, e[9] = x) : x = e[9];
188
- let b;
189
- e[10] !== g || e[11] !== x ? (b = /* @__PURE__ */ R(C, { sx: u.rowHeader, children: [
195
+ return e[18] !== m || e[19] !== x || e[20] !== g || e[21] !== p ? (w = /* @__PURE__ */ S(b, { sx: x, onClick: m, children: [
190
196
  g,
191
- x
192
- ] }), e[10] = g, e[11] = x, e[12] = b) : b = e[12];
193
- let k;
194
- e[13] !== n || e[14] !== i || e[15] !== l || e[16] !== o ? (k = /* @__PURE__ */ h(J, { value: o, maxValue: i, color: n, selected: l }), e[13] = n, e[14] = i, e[15] = l, e[16] = o, e[17] = k) : k = e[17];
195
- let v;
196
- return e[18] !== f || e[19] !== y || e[20] !== b || e[21] !== k ? (v = /* @__PURE__ */ R(C, { sx: y, onClick: f, children: [
197
- b,
198
- k
199
- ] }), e[18] = f, e[19] = y, e[20] = b, e[21] = k, e[22] = v) : v = e[22], v;
197
+ p
198
+ ] }), e[18] = m, e[19] = x, e[20] = g, e[21] = p, e[22] = w) : w = e[22], w;
200
199
  }
201
- function ee(t) {
200
+ function Q(t) {
202
201
  const e = M(25), {
203
- name: r,
204
- values: o,
205
- maxValue: i,
206
- colors: n,
207
- formatter: c,
208
- onClick: a,
209
- selected: d
210
- } = t, l = d === void 0 ? !0 : d;
211
- let m;
212
- e[0] !== r || e[1] !== a ? (m = a ? () => a({
213
- name: r
214
- }) : void 0, e[0] = r, e[1] = a, e[2] = m) : m = e[2];
215
- const f = m, y = a ? u.rowClickable : u.row;
216
- let g;
217
- e[3] !== r ? (g = /* @__PURE__ */ h(L, { sx: u.rowLabel, children: r }), e[3] = r, e[4] = g) : g = e[4];
218
- let w;
219
- if (e[5] !== n || e[6] !== c || e[7] !== i || e[8] !== r || e[9] !== l || e[10] !== o) {
220
- let k;
221
- e[12] !== n || e[13] !== c || e[14] !== i || e[15] !== r || e[16] !== l ? (k = (v, D) => /* @__PURE__ */ R(C, { sx: u.multiBarRow, children: [
222
- /* @__PURE__ */ h(C, { sx: u.multiBarContainer, children: /* @__PURE__ */ h(J, { value: v, maxValue: i, color: n[D % n.length] ?? "", selected: l }) }),
223
- /* @__PURE__ */ h(L, { sx: u.multiBarValue, children: c(v) })
224
- ] }, `${r}-${v}-${D}`), e[12] = n, e[13] = c, e[14] = i, e[15] = r, e[16] = l, e[17] = k) : k = e[17], w = o.map(k), e[5] = n, e[6] = c, e[7] = i, e[8] = r, e[9] = l, e[10] = o, e[11] = w;
202
+ name: o,
203
+ values: i,
204
+ maxValue: l,
205
+ colors: a,
206
+ formatter: s,
207
+ onClick: r,
208
+ selected: u
209
+ } = t, n = u === void 0 ? !0 : u;
210
+ let c;
211
+ e[0] !== o || e[1] !== r ? (c = r ? () => r({
212
+ name: o
213
+ }) : void 0, e[0] = o, e[1] = r, e[2] = c) : c = e[2];
214
+ const m = c, x = r ? d.rowClickable : d.row;
215
+ let y;
216
+ e[3] !== o ? (y = /* @__PURE__ */ h(D, { sx: d.rowLabel, children: o }), e[3] = o, e[4] = y) : y = e[4];
217
+ let f;
218
+ if (e[5] !== a || e[6] !== s || e[7] !== l || e[8] !== o || e[9] !== n || e[10] !== i) {
219
+ let p;
220
+ e[12] !== a || e[13] !== s || e[14] !== l || e[15] !== o || e[16] !== n ? (p = (w, k) => /* @__PURE__ */ S(b, { sx: d.multiBarRow, children: [
221
+ /* @__PURE__ */ h(b, { sx: d.multiBarContainer, children: /* @__PURE__ */ h(G, { value: w, maxValue: l, color: a[k % a.length] ?? "", selected: n }) }),
222
+ /* @__PURE__ */ h(D, { sx: d.multiBarValue, children: s(w) })
223
+ ] }, `${o}-${w}-${k}`), e[12] = a, e[13] = s, e[14] = l, e[15] = o, e[16] = n, e[17] = p) : p = e[17], f = i.map(p), e[5] = a, e[6] = s, e[7] = l, e[8] = o, e[9] = n, e[10] = i, e[11] = f;
225
224
  } else
226
- w = e[11];
227
- let x;
228
- e[18] !== w ? (x = /* @__PURE__ */ h(C, { sx: u.barContainer, children: w }), e[18] = w, e[19] = x) : x = e[19];
229
- let b;
230
- return e[20] !== f || e[21] !== y || e[22] !== g || e[23] !== x ? (b = /* @__PURE__ */ R(C, { sx: y, onClick: f, children: [
231
- g,
232
- x
233
- ] }), e[20] = f, e[21] = y, e[22] = g, e[23] = x, e[24] = b) : b = e[24], b;
225
+ f = e[11];
226
+ let C;
227
+ e[18] !== f ? (C = /* @__PURE__ */ h(b, { sx: d.barContainer, children: f }), e[18] = f, e[19] = C) : C = e[19];
228
+ let g;
229
+ return e[20] !== m || e[21] !== x || e[22] !== y || e[23] !== C ? (g = /* @__PURE__ */ S(b, { sx: x, onClick: m, children: [
230
+ y,
231
+ C
232
+ ] }), e[20] = m, e[21] = x, e[22] = y, e[23] = C, e[24] = g) : g = e[24], g;
234
233
  }
235
- function te(t) {
234
+ function X(t) {
236
235
  const e = M(10), {
237
- hiddenCount: r,
238
- otherLabel: o,
239
- otherCountLabel: i
240
- } = t, n = o === void 0 ? "Other" : o, c = i === void 0 ? "{count} more" : i;
241
- let a;
242
- e[0] !== r || e[1] !== c ? (a = c.replace("{count}", String(r)), e[0] = r, e[1] = c, e[2] = a) : a = e[2];
243
- const d = a;
244
- let l;
245
- e[3] !== n ? (l = /* @__PURE__ */ h(L, { sx: u.otherLabel, children: n }), e[3] = n, e[4] = l) : l = e[4];
246
- let m;
247
- e[5] !== d ? (m = /* @__PURE__ */ R(L, { sx: u.otherCount, children: [
236
+ hiddenCount: o,
237
+ otherLabel: i,
238
+ otherCountLabel: l
239
+ } = t, a = i === void 0 ? "Other" : i, s = l === void 0 ? "{count} more" : l;
240
+ let r;
241
+ e[0] !== o || e[1] !== s ? (r = s.replace("{count}", String(o)), e[0] = o, e[1] = s, e[2] = r) : r = e[2];
242
+ const u = r;
243
+ let n;
244
+ e[3] !== a ? (n = /* @__PURE__ */ h(D, { sx: d.otherLabel, children: a }), e[3] = a, e[4] = n) : n = e[4];
245
+ let c;
246
+ e[5] !== u ? (c = /* @__PURE__ */ S(D, { sx: d.otherCount, children: [
248
247
  "(",
249
- d,
248
+ u,
250
249
  ")"
251
- ] }), e[5] = d, e[6] = m) : m = e[6];
252
- let f;
253
- return e[7] !== l || e[8] !== m ? (f = /* @__PURE__ */ R(C, { sx: u.otherRow, children: [
254
- l,
255
- m
256
- ] }), e[7] = l, e[8] = m, e[9] = f) : f = e[9], f;
250
+ ] }), e[5] = u, e[6] = c) : c = e[6];
251
+ let m;
252
+ return e[7] !== n || e[8] !== c ? (m = /* @__PURE__ */ S(b, { sx: d.otherRow, children: [
253
+ n,
254
+ c
255
+ ] }), e[7] = n, e[8] = c, e[9] = m) : m = e[9], m;
257
256
  }
258
- function oe(t) {
257
+ function Y(t) {
259
258
  const e = M(7), {
260
- series: r,
261
- colors: o
259
+ series: o,
260
+ colors: i
262
261
  } = t;
263
- if (r.length === 0)
262
+ if (o.length === 0)
264
263
  return null;
265
- let i;
266
- if (e[0] !== o || e[1] !== r) {
267
- let c;
268
- e[3] !== o ? (c = (a, d) => /* @__PURE__ */ R(C, { sx: u.legendItem, children: [
269
- /* @__PURE__ */ h(C, { sx: {
270
- ...u.legendDot,
271
- backgroundColor: a.color ?? o[d % o.length]
264
+ let l;
265
+ if (e[0] !== i || e[1] !== o) {
266
+ let s;
267
+ e[3] !== i ? (s = (r, u) => /* @__PURE__ */ S(b, { sx: d.legendItem, children: [
268
+ /* @__PURE__ */ h(b, { sx: {
269
+ ...d.legendDot,
270
+ backgroundColor: r.color ?? i[u % i.length]
272
271
  } }),
273
- /* @__PURE__ */ h(L, { sx: u.legendLabel, children: a.name })
274
- ] }, a.name), e[3] = o, e[4] = c) : c = e[4], i = r.map(c), e[0] = o, e[1] = r, e[2] = i;
272
+ /* @__PURE__ */ h(D, { sx: d.legendLabel, children: r.name })
273
+ ] }, r.name), e[3] = i, e[4] = s) : s = e[4], l = o.map(s), e[0] = i, e[1] = o, e[2] = l;
275
274
  } else
276
- i = e[2];
277
- let n;
278
- return e[5] !== i ? (n = /* @__PURE__ */ h(C, { sx: u.legend, children: i }), e[5] = i, e[6] = n) : n = e[6], n;
275
+ l = e[2];
276
+ let a;
277
+ return e[5] !== l ? (a = /* @__PURE__ */ h(b, { sx: d.legend, children: l }), e[5] = l, e[6] = a) : a = e[6], a;
279
278
  }
280
- const le = (t) => t.toString();
281
- function we(t) {
282
- const e = M(46), {
283
- id: r
284
- } = t, o = Q();
285
- let i;
286
- e[0] !== r ? (i = (s) => {
287
- const p = s.getWidget(r);
279
+ const Z = (t) => t.toString();
280
+ function ye(t) {
281
+ const e = M(42), {
282
+ id: o
283
+ } = t, i = N();
284
+ let l;
285
+ e[0] !== o ? (l = ($) => {
286
+ const v = $.getWidget(o);
288
287
  return {
289
- formatter: p?.formatter,
290
- series: p?.series,
291
- data: p?.data,
292
- maxItems: p?.maxItems,
293
- labels: p?.labels,
294
- onRowClick: p?.onRowClick,
295
- selected: p?.selected,
296
- max: p?.max
288
+ formatter: v?.formatter,
289
+ series: v?.series,
290
+ data: v?.data,
291
+ maxItems: v?.maxItems,
292
+ labels: v?.labels,
293
+ onRowClick: v?.onRowClick,
294
+ selected: v?.selected,
295
+ max: v?.max
297
296
  };
298
- }, e[0] = r, e[1] = i) : i = e[1];
299
- const n = X(Y(i)), c = n?.formatter ?? le;
300
- n?.series;
301
- let a;
302
- e[2] !== n?.series ? (a = n?.series ?? [], e[2] = n?.series, e[3] = a) : a = e[3];
303
- const d = a, l = n?.data, m = n?.maxItems, f = n?.labels, y = n?.onRowClick, g = n?.selected, w = n?.max;
304
- let x;
305
- e[4] !== o.palette.qualitative.bold ? (x = Object.values(o.palette.qualitative.bold), e[4] = o.palette.qualitative.bold, e[5] = x) : x = e[5];
306
- const b = x;
307
- let k;
308
- e: {
309
- if (d.length > 0) {
310
- let p;
311
- if (e[6] !== b || e[7] !== d || e[8] !== o.palette.primary.main) {
312
- let $;
313
- e[10] !== b || e[11] !== o.palette.primary.main ? ($ = (_, S) => _.color ?? b[S % b.length] ?? o.palette.primary.main, e[10] = b, e[11] = o.palette.primary.main, e[12] = $) : $ = e[12], p = d.map($), e[6] = b, e[7] = d, e[8] = o.palette.primary.main, e[9] = p;
314
- } else
315
- p = e[9];
316
- k = p;
317
- break e;
318
- }
319
- let s;
320
- e[13] !== o.palette.primary.main ? (s = [o.palette.primary.main], e[13] = o.palette.primary.main, e[14] = s) : s = e[14], k = s;
321
- }
322
- const v = k;
323
- let D;
324
- e: {
325
- if (!l || l.length === 0) {
326
- let $;
327
- e[15] === Symbol.for("react.memo_cache_sentinel") ? ($ = [], e[15] = $) : $ = e[15], D = $;
328
- break e;
329
- }
330
- const s = Math.max(l.length, 1);
331
- let p;
332
- if (e[16] !== l || e[17] !== s) {
333
- const $ = /* @__PURE__ */ new Map(), _ = [];
334
- for (let S = 0; S < l.length; S++) {
335
- const K = l[S];
336
- for (const E of K) {
337
- let P = $.get(E.name);
338
- P || (P = new Array(s).fill(0), $.set(E.name, P), _.push(E.name)), P[S] = E.value;
339
- }
297
+ }, e[0] = o, e[1] = l) : l = e[1];
298
+ const a = U(z(l)), s = a?.formatter ?? Z, r = a?.series ?? [], u = a?.data, n = a?.maxItems, c = a?.labels, m = a?.onRowClick, x = a?.selected, y = a?.max, [f] = J(n ? 40 * (r.length || 1) * n : void 0), C = Object.values(i.palette.qualitative.bold), g = r.length > 0 ? r.map(($, v) => $.color ?? C[v % C.length] ?? i.palette.primary.main) : [i.palette.primary.main];
299
+ let p, w, k, T, R, V, L, B;
300
+ if (e[2] !== g || e[3] !== u || e[4] !== s || e[5] !== y || e[6] !== f || e[7] !== n || e[8] !== m || e[9] !== x || e[10] !== r || e[11] !== i.palette.primary) {
301
+ B = Symbol.for("react.early_return_sentinel");
302
+ e: {
303
+ const $ = te({
304
+ data: u
305
+ });
306
+ if ($.length === 0) {
307
+ B = null;
308
+ break e;
340
309
  }
341
- p = _.map((S) => ({
342
- name: S,
343
- values: $.get(S)
344
- })), e[16] = l, e[17] = s, e[18] = p;
345
- } else
346
- p = e[18];
347
- D = p;
348
- }
349
- const I = D;
350
- let j;
351
- e: {
352
- if (w !== void 0) {
353
- j = w;
354
- break e;
355
- }
356
- if (I.length === 0) {
357
- j = 0;
358
- break e;
359
- }
360
- let s;
361
- e[19] !== I ? (s = I.flatMap(re), e[19] = I, e[20] = s) : s = e[20], j = Math.max(...s);
362
- }
363
- const A = j;
364
- let O;
365
- e: {
366
- if (m === void 0) {
367
- O = I;
368
- break e;
310
+ const v = y ?? Math.max(...$.flatMap(ee)), A = n !== void 0 && n >= 0 ? $.slice(0, n) : $;
311
+ k = $.length - A.length;
312
+ const P = r.length > 1;
313
+ w = b, e[20] === Symbol.for("react.memo_cache_sentinel") ? (L = {
314
+ ...d.root
315
+ }, e[20] = L) : L = e[20], p = b, T = d.list;
316
+ const O = k === 0 ? "auto" : "hidden";
317
+ e[21] !== f || e[22] !== O ? (R = {
318
+ maxHeight: f,
319
+ overflow: O
320
+ }, e[21] = f, e[22] = O, e[23] = R) : R = e[23], V = P ? A.map((I) => /* @__PURE__ */ h(Q, { name: I.name, values: I.values, maxValue: v, colors: g, formatter: s, onClick: m, selected: x?.(I.name) ?? !0 }, I.name)) : A.map((I) => /* @__PURE__ */ h(K, { name: I.name, value: I.values[0] ?? 0, selected: x?.(I.name) ?? !0, maxValue: v, color: g[0] ?? i.palette.primary.main, formatter: s, onClick: m }, I.name));
369
321
  }
370
- const s = Math.max(0, m);
371
- if (s >= I.length) {
372
- O = I;
373
- break e;
374
- }
375
- let p;
376
- e[21] !== I || e[22] !== s ? (p = I.slice(0, s), e[21] = I, e[22] = s, e[23] = p) : p = e[23], O = p;
377
- }
378
- const W = O, q = I.length - W.length;
379
- if (I.length === 0)
380
- return null;
381
- const G = d.length > 1;
382
- let V;
383
- e[24] !== v || e[25] !== c || e[26] !== G || e[27] !== A || e[28] !== y || e[29] !== g || e[30] !== o || e[31] !== W ? (V = G ? W.map((s) => /* @__PURE__ */ h(ee, { name: s.name, values: s.values, maxValue: A, colors: v, formatter: c, onClick: y, selected: g?.(s.name) ?? !0 }, s.name)) : W.map((s) => /* @__PURE__ */ h(Z, { name: s.name, value: s.values[0] ?? 0, selected: g?.(s.name) ?? !0, maxValue: A, color: v[0] ?? o.palette.primary.main, formatter: c, onClick: y }, s.name)), e[24] = v, e[25] = c, e[26] = G, e[27] = A, e[28] = y, e[29] = g, e[30] = o, e[31] = W, e[32] = V) : V = e[32];
384
- let B;
385
- e[33] !== q || e[34] !== f?.other || e[35] !== f?.otherCount ? (B = q > 0 && /* @__PURE__ */ h(te, { hiddenCount: q, otherLabel: f?.other, otherCountLabel: f?.otherCount }), e[33] = q, e[34] = f?.other, e[35] = f?.otherCount, e[36] = B) : B = e[36];
386
- let T;
387
- e[37] !== V || e[38] !== B ? (T = /* @__PURE__ */ R(C, { sx: u.list, children: [
388
- V,
389
- B
390
- ] }), e[37] = V, e[38] = B, e[39] = T) : T = e[39];
322
+ e[2] = g, e[3] = u, e[4] = s, e[5] = y, e[6] = f, e[7] = n, e[8] = m, e[9] = x, e[10] = r, e[11] = i.palette.primary, e[12] = p, e[13] = w, e[14] = k, e[15] = T, e[16] = R, e[17] = V, e[18] = L, e[19] = B;
323
+ } else
324
+ p = e[12], w = e[13], k = e[14], T = e[15], R = e[16], V = e[17], L = e[18], B = e[19];
325
+ if (B !== Symbol.for("react.early_return_sentinel"))
326
+ return B;
391
327
  let F;
392
- e[40] !== v || e[41] !== d ? (F = d.length > 0 && /* @__PURE__ */ h(oe, { series: d, colors: v }), e[40] = v, e[41] = d, e[42] = F) : F = e[42];
393
- let H;
394
- return e[43] !== T || e[44] !== F ? (H = /* @__PURE__ */ R(C, { sx: u.root, children: [
395
- T,
328
+ e[24] !== k || e[25] !== c?.other || e[26] !== c?.otherCount ? (F = k > 0 && /* @__PURE__ */ h(X, { hiddenCount: k, otherLabel: c?.other, otherCountLabel: c?.otherCount }), e[24] = k, e[25] = c?.other, e[26] = c?.otherCount, e[27] = F) : F = e[27];
329
+ let W;
330
+ e[28] !== p || e[29] !== T || e[30] !== R || e[31] !== V || e[32] !== F ? (W = /* @__PURE__ */ S(p, { sx: T, style: R, children: [
331
+ V,
396
332
  F
397
- ] }), e[43] = T, e[44] = F, e[45] = H) : H = e[45], H;
333
+ ] }), e[28] = p, e[29] = T, e[30] = R, e[31] = V, e[32] = F, e[33] = W) : W = e[33];
334
+ let _;
335
+ e[34] !== g || e[35] !== r ? (_ = r.length > 0 && /* @__PURE__ */ h(Y, { series: r, colors: g }), e[34] = g, e[35] = r, e[36] = _) : _ = e[36];
336
+ let j;
337
+ return e[37] !== w || e[38] !== L || e[39] !== W || e[40] !== _ ? (j = /* @__PURE__ */ S(w, { sx: L, children: [
338
+ W,
339
+ _
340
+ ] }), e[37] = w, e[38] = L, e[39] = W, e[40] = _, e[41] = j) : j = e[41], j;
398
341
  }
399
- function re(t) {
342
+ function ee(t) {
400
343
  return t.values;
401
344
  }
402
- const ne = [85, 70, 55, 75, 60];
403
- function ve() {
345
+ function te({
346
+ data: t
347
+ }) {
348
+ if (!t || t.length === 0) return [];
349
+ const e = Math.max(t.length, 1), o = /* @__PURE__ */ new Map(), i = [];
350
+ for (let l = 0; l < t.length; l++) {
351
+ const a = t[l];
352
+ for (const s of a) {
353
+ let r = o.get(s.name);
354
+ r || (r = new Array(e).fill(0), o.set(s.name, r), i.push(s.name)), r[l] = s.value;
355
+ }
356
+ }
357
+ return i.map((l) => ({
358
+ name: l,
359
+ values: o.get(l)
360
+ }));
361
+ }
362
+ const oe = [85, 70, 55, 75, 60];
363
+ function be() {
404
364
  const t = M(1);
405
365
  let e;
406
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ h(C, { sx: u.list, "aria-label": "Category skeleton", children: Array.from({
366
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ h(b, { sx: d.list, "aria-label": "Category skeleton", children: Array.from({
407
367
  length: 5
408
- }).map(ie) }), t[0] = e) : e = t[0], e;
368
+ }).map(re) }), t[0] = e) : e = t[0], e;
409
369
  }
410
- function ie(t, e) {
411
- return /* @__PURE__ */ R(C, { sx: u.row, children: [
412
- /* @__PURE__ */ R(C, { sx: u.rowHeader, children: [
413
- /* @__PURE__ */ h(N, { width: 80, height: 16 }),
414
- /* @__PURE__ */ h(N, { width: 40, height: 16 })
370
+ function re(t, e) {
371
+ return /* @__PURE__ */ S(b, { sx: d.row, children: [
372
+ /* @__PURE__ */ S(b, { sx: d.rowHeader, children: [
373
+ /* @__PURE__ */ h(H, { width: 80, height: 16 }),
374
+ /* @__PURE__ */ h(H, { width: 40, height: 16 })
415
375
  ] }),
416
- /* @__PURE__ */ h(N, { variant: "rectangular", height: 4, sx: {
376
+ /* @__PURE__ */ h(H, { variant: "rectangular", height: 4, sx: {
417
377
  borderRadius: 2,
418
- width: `${ne[e]}%`
378
+ width: `${oe[e]}%`
419
379
  } })
420
380
  ] }, e);
421
381
  }
422
- function ke({
382
+ function Ce({
423
383
  refUI: t,
424
384
  series: e
425
385
  }) {
426
386
  return [{
427
- ...z,
428
- modifier: () => z.modifier(t)
387
+ ...E,
388
+ modifier: () => E.modifier(t)
429
389
  }, {
430
- ...U,
431
- modifier: async (r) => {
432
- if (!r?.length || r[0]?.length === 0)
433
- return U.modifier([]);
434
- const o = r.length, i = /* @__PURE__ */ new Map(), n = [];
435
- for (let l = 0; l < o; l++) {
436
- const m = r[l];
437
- for (const f of m) {
438
- let y = i.get(f.name);
439
- y || (y = new Array(o).fill(0), i.set(f.name, y), n.push(f.name)), y[l] = f.value;
390
+ ...q,
391
+ modifier: async (o) => {
392
+ if (!o?.length || o[0]?.length === 0)
393
+ return q.modifier([]);
394
+ const i = o.length, l = /* @__PURE__ */ new Map(), a = [];
395
+ for (let n = 0; n < i; n++) {
396
+ const c = o[n];
397
+ for (const m of c) {
398
+ let x = l.get(m.name);
399
+ x || (x = new Array(i).fill(0), l.set(m.name, x), a.push(m.name)), x[n] = m.value;
440
400
  }
441
401
  }
442
- const c = n.map((l) => [l, ...i.get(l)]), d = o > 1 ? ["Category", ...e?.map((l) => l.name) ?? Array.from({
443
- length: o
444
- }, (l, m) => `Series ${m + 1}`)] : ["Category", "Value"];
445
- return U.modifier([d, ...c]);
402
+ const s = a.map((n) => [n, ...l.get(n)]), u = i > 1 ? ["Category", ...e?.map((n) => n.name) ?? Array.from({
403
+ length: i
404
+ }, (n, c) => `Series ${c + 1}`)] : ["Category", "Value"];
405
+ return q.modifier([u, ...s]);
446
406
  }
447
407
  }];
448
408
  }
449
- function $e() {
409
+ function we() {
450
410
  return {
451
411
  series: [],
452
412
  maxItems: void 0,
@@ -454,14 +414,14 @@ function $e() {
454
414
  };
455
415
  }
456
416
  export {
457
- J as CategoryBar,
458
- oe as CategoryLegend,
459
- ee as CategoryRowMulti,
460
- te as CategoryRowOther,
461
- Z as CategoryRowSingle,
462
- ve as CategorySkeleton,
463
- we as CategoryUI,
464
- $e as categoryConfig,
465
- ke as categoryDownloadConfig
417
+ G as CategoryBar,
418
+ Y as CategoryLegend,
419
+ Q as CategoryRowMulti,
420
+ X as CategoryRowOther,
421
+ K as CategoryRowSingle,
422
+ be as CategorySkeleton,
423
+ ye as CategoryUI,
424
+ we as categoryConfig,
425
+ Ce as categoryDownloadConfig
466
426
  };
467
427
  //# sourceMappingURL=category.js.map