@actionexec/dashboards 0.5.5 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,39 @@
1
- import { jsx as i, jsxs as w } from "react/jsx-runtime";
2
- import H from "react-datepicker";
3
- import { useState as x, useRef as P, useMemo as O, useLayoutEffect as J, useEffect as V } from "react";
4
- import { createPortal as q } from "react-dom";
5
- const K = "https://action-data-api-7mbrztperq-rj.a.run.app", B = "/external/dashboards";
6
- let C = K;
7
- function ge(e) {
8
- C = e.replace(/\/$/, "");
1
+ import { jsx as i, jsxs as T } from "react/jsx-runtime";
2
+ import K from "react-datepicker";
3
+ import { useState as P, useRef as R, useMemo as $, useLayoutEffect as B, useEffect as Q } from "react";
4
+ import { createPortal as Z } from "react-dom";
5
+ const ee = "https://action-data-api-7mbrztperq-rj.a.run.app", te = "/external/dashboards";
6
+ let U = ee;
7
+ function Ee(e) {
8
+ U = e.replace(/\/$/, "");
9
9
  }
10
- class Q extends Error {
10
+ class ae extends Error {
11
11
  constructor(t, a, r) {
12
12
  super(t), this.status = a, this.payload = r, this.name = "ApiError";
13
13
  }
14
14
  }
15
- async function R(e, t, a) {
16
- const r = new URL(`${C}${B}${e}`);
15
+ async function G(e, t, a) {
16
+ const r = new URL(`${U}${te}${e}`);
17
17
  if (a)
18
18
  for (const [o, l] of Object.entries(a)) r.searchParams.set(o, l);
19
- const s = await fetch(r.toString(), {
19
+ const n = await fetch(r.toString(), {
20
20
  headers: { Authorization: `Bearer ${t}` }
21
21
  });
22
- if (!s.ok) {
22
+ if (!n.ok) {
23
23
  let o;
24
24
  try {
25
- o = await s.json();
25
+ o = await n.json();
26
26
  } catch {
27
27
  }
28
- throw new Q(
29
- `Requisicao falhou (${s.status}) em ${e}`,
30
- s.status,
28
+ throw new ae(
29
+ `Requisicao falhou (${n.status}) em ${e}`,
30
+ n.status,
31
31
  o
32
32
  );
33
33
  }
34
- return await s.json();
34
+ return await n.json();
35
35
  }
36
- const pe = (e) => R("/layout", e), me = (e, t) => R("/render", e, t), m = {
36
+ const Se = (e) => G("/layout", e), we = (e, t) => G("/render", e, t), m = {
37
37
  series0: 0,
38
38
  series1: 1,
39
39
  series2: 2,
@@ -47,7 +47,7 @@ const pe = (e) => R("/layout", e), me = (e, t) => R("/render", e, t), m = {
47
47
  accent: 10,
48
48
  success: 11,
49
49
  error: 12
50
- }, X = 5, N = 13, Z = {
50
+ }, re = 5, L = 13, ne = {
51
51
  series0: "Série 1",
52
52
  series1: "Série 2",
53
53
  series2: "Série 3",
@@ -152,20 +152,20 @@ const pe = (e) => R("/layout", e), me = (e, t) => R("/render", e, t), m = {
152
152
  "#e11d48"
153
153
  ]
154
154
  }
155
- }, $ = v.action.colors;
156
- function D(e) {
157
- const t = $;
155
+ }, Y = v.action.colors;
156
+ function N(e) {
157
+ const t = Y;
158
158
  if (!e || e.length === 0) return [...t];
159
- if (e.length >= N) return e.slice(0, N);
159
+ if (e.length >= L) return e.slice(0, L);
160
160
  const a = [...e];
161
- for (let r = e.length; r < N; r++) a.push(t[r]);
161
+ for (let r = e.length; r < L; r++) a.push(t[r]);
162
162
  return a;
163
163
  }
164
- function ee(e) {
165
- return D(e).slice(0, X);
164
+ function se(e) {
165
+ return N(e).slice(0, re);
166
166
  }
167
- function he(e) {
168
- const t = D(e);
167
+ function De(e) {
168
+ const t = N(e);
169
169
  return {
170
170
  "--bg-dark": t[m.bgDark],
171
171
  "--bg-paper": t[m.bgPaper],
@@ -181,60 +181,81 @@ function he(e) {
181
181
  "--color-warning": t[m.series3]
182
182
  };
183
183
  }
184
- const te = $, ae = 30, re = 10, be = {
185
- gridColumns: ae,
186
- gridRows: re,
184
+ const oe = Y, ce = 30, le = 10, ye = {
185
+ gridColumns: ce,
186
+ gridRows: le,
187
187
  widgets: []
188
- }, _e = {
188
+ }, Ne = {
189
189
  kpi_card: "KPI Card",
190
190
  gauge: "Gauge",
191
191
  chart: "Gráfico",
192
+ table: "Tabela",
192
193
  filter: "Filtro",
193
194
  variable: "Variável",
194
195
  color_palette: "Paleta de Cores"
195
- }, we = ["kpi_card", "gauge", "chart"], Te = ["filter", "variable", "color_palette"], Se = /* @__PURE__ */ new Set(["filter", "variable", "color_palette"]), Ee = {
196
+ }, Le = ["kpi_card", "gauge", "chart", "table"], ve = ["filter", "variable", "color_palette"], Me = /* @__PURE__ */ new Set(["filter", "variable", "color_palette"]), Pe = {
196
197
  sum: "Soma",
197
198
  avg: "Média",
198
199
  count: "Contagem",
199
200
  min: "Mínimo",
200
201
  max: "Máximo",
201
202
  count_distinct: "Contagem Distinta"
202
- }, se = {
203
+ }, ie = {
203
204
  currency: "Moeda (R$)",
204
205
  number: "Número",
205
206
  integer: "Inteiro",
206
207
  percentage: "Porcentagem",
207
208
  date: "Data",
208
209
  text: "Texto"
209
- }, ye = Object.entries(se).filter(([e]) => e !== "date" && e !== "text"), De = {
210
+ }, xe = Object.entries(ie).filter(([e]) => e !== "date" && e !== "text"), Ae = {
210
211
  yoy: "vs Ano Anterior",
211
212
  mom: "vs Mês Anterior",
212
213
  target: "vs Meta",
213
214
  none: "Nenhuma"
214
- }, Ne = {
215
+ }, Ce = {
215
216
  bar: "Barras",
216
217
  line: "Linhas",
217
218
  area: "Área",
218
219
  pie: "Pizza"
219
- }, ve = {
220
+ }, ke = {
220
221
  date_range: "Periodo",
221
222
  select: "Seleção Única",
222
223
  multi_select: "Seleção Múltipla"
223
- }, k = "", Le = {
224
+ }, F = "", Oe = {
224
225
  kpi_card: { x: 0, y: 0, w: 6, h: 3 },
225
226
  gauge: { x: 0, y: 0, w: 6, h: 5 },
226
227
  chart: { x: 0, y: 0, w: 6, h: 6 },
228
+ table: { x: 0, y: 0, w: 12, h: 7 },
227
229
  filter: { x: 0, y: 0, w: 4, h: 2 },
228
230
  variable: { x: 0, y: 0, w: 4, h: 2 },
229
231
  color_palette: { x: 0, y: 0, w: 4, h: 2 }
230
- }, xe = {
232
+ }, Ie = {
231
233
  kpi_card: { label: "Novo KPI", aggregation: "sum", format: "number" },
232
234
  gauge: { label: "Novo Gauge", aggregation: "sum" },
233
235
  chart: { label: "Novo Grafico", chartType: "bar", xAxis: { column: "", granularity: "day" }, series: [] },
236
+ table: { label: "Nova Tabela", columns: [] },
234
237
  filter: { label: "Novo Filtro", filterType: "select" },
235
238
  variable: { label: "Nova Variavel", variableValue: 0, variableFormat: "number", locked: !1 },
236
- color_palette: { label: "Paleta de Cores", paletteColors: te, locked: !1 }
237
- }, Me = [
239
+ color_palette: { label: "Paleta de Cores", paletteColors: oe, locked: !1 }
240
+ }, A = 6, C = 16, k = 1, x = 24, ue = 80, de = (e, t, a) => Math.min(Math.max(e, t), a), E = (e) => Number.isFinite(e) && e > 0;
241
+ function Re(e, t, a = A, r = C) {
242
+ if (!E(t) || !Number.isFinite(e)) return 0;
243
+ const n = e - r * 2 - a * (t - 1);
244
+ return Math.max(0, n / t);
245
+ }
246
+ function $e(e, t = k) {
247
+ return !E(e) || !E(t) ? x : de(e / t, x, ue);
248
+ }
249
+ function Fe(e, t, a = A, r = C) {
250
+ return e <= 0 ? r * 2 : e * t + (e - 1) * a + r * 2;
251
+ }
252
+ function Ue(e, t, a = k) {
253
+ return !E(e) || !E(t) || !E(a) ? 1 : e * a / t;
254
+ }
255
+ function Ge(e, t = k, a = A, r = C) {
256
+ return !E(e) || !E(t) ? 0 : x * t * e + a * (e - 1) + r * 2;
257
+ }
258
+ const Ye = [
238
259
  "Jan",
239
260
  "Fev",
240
261
  "Mar",
@@ -247,7 +268,7 @@ const te = $, ae = 30, re = 10, be = {
247
268
  "Out",
248
269
  "Nov",
249
270
  "Dez"
250
- ], Ae = [
271
+ ], He = [
251
272
  "Janeiro",
252
273
  "Fevereiro",
253
274
  "Marco",
@@ -261,84 +282,84 @@ const te = $, ae = 30, re = 10, be = {
261
282
  "Novembro",
262
283
  "Dezembro"
263
284
  ];
264
- function Pe(e) {
285
+ function We(e) {
265
286
  return { start: `${e}-01-01`, end: `${e}-12-31` };
266
287
  }
267
- function Oe(e) {
288
+ function je(e) {
268
289
  if (!e) return null;
269
290
  const t = e.match(/^(\d{4})/);
270
291
  return t ? { year: parseInt(t[1]) } : null;
271
292
  }
272
- function ke(e, t) {
273
- const a = new Date(e, t, 0).getDate(), r = (s) => String(s).padStart(2, "0");
293
+ function ze(e, t) {
294
+ const a = new Date(e, t, 0).getDate(), r = (n) => String(n).padStart(2, "0");
274
295
  return {
275
296
  start: `${e}-${r(t)}-01`,
276
297
  end: `${e}-${r(t)}-${r(a)}`
277
298
  };
278
299
  }
279
- function F(e) {
300
+ function H(e) {
280
301
  const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()));
281
302
  t.setUTCDate(t.getUTCDate() + 4 - (t.getUTCDay() || 7));
282
303
  const a = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
283
304
  return Math.ceil(((t.getTime() - a.getTime()) / 864e5 + 1) / 7);
284
305
  }
285
- function Ce(e, t) {
286
- const a = new Date(e, 0, 4), r = (a.getDay() + 6) % 7, s = new Date(a.getTime() - r * 864e5), o = new Date(s.getTime() + (t - 1) * 7 * 864e5), l = new Date(o.getTime() + 6 * 864e5), d = (h) => String(h).padStart(2, "0"), f = (h) => `${h.getFullYear()}-${d(h.getMonth() + 1)}-${d(h.getDate())}`;
306
+ function Je(e, t) {
307
+ const a = new Date(e, 0, 4), r = (a.getDay() + 6) % 7, n = new Date(a.getTime() - r * 864e5), o = new Date(n.getTime() + (t - 1) * 7 * 864e5), l = new Date(o.getTime() + 6 * 864e5), d = (h) => String(h).padStart(2, "0"), f = (h) => `${h.getFullYear()}-${d(h.getMonth() + 1)}-${d(h.getDate())}`;
287
308
  return { start: f(o), end: f(l) };
288
309
  }
289
- function Re(e, t) {
310
+ function Ve(e, t) {
290
311
  const a = /* @__PURE__ */ new Set(), r = new Date(e, t, 0).getDate();
291
- for (let s = 1; s <= r; s++)
292
- a.add(F(new Date(e, t - 1, s)));
293
- return Array.from(a).sort((s, o) => s - o);
312
+ for (let n = 1; n <= r; n++)
313
+ a.add(H(new Date(e, t - 1, n)));
314
+ return Array.from(a).sort((n, o) => n - o);
294
315
  }
295
- function $e(e, t) {
296
- const a = new Date(e, t, 0).getDate(), r = (d) => String(d).padStart(2, "0"), s = [];
316
+ function Xe(e, t) {
317
+ const a = new Date(e, t, 0).getDate(), r = (d) => String(d).padStart(2, "0"), n = [];
297
318
  let o = 1, l = 1;
298
319
  for (; o <= a; ) {
299
320
  const d = o, f = Math.min(o + 6, a), h = `${e}-${r(t)}-${r(d)}`, c = `${e}-${r(t)}-${r(f)}`, u = `${l}° Semana (${r(d)}/${r(t)} - ${r(f)}/${r(t)})`;
300
- s.push({ index: l, startDay: d, endDay: f, start: h, end: c, label: u }), o = f + 1, l++;
321
+ n.push({ index: l, startDay: d, endDay: f, start: h, end: c, label: u }), o = f + 1, l++;
301
322
  }
302
- return s;
323
+ return n;
303
324
  }
304
- function Fe(e, t, a) {
325
+ function qe(e, t, a) {
305
326
  if (!e) return 1;
306
- const r = (l) => String(l).padStart(2, "0"), s = e.match(new RegExp(`^${t}-${r(a)}-(\\d{2})`));
307
- if (!s) return 1;
308
- const o = parseInt(s[1]);
327
+ const r = (l) => String(l).padStart(2, "0"), n = e.match(new RegExp(`^${t}-${r(a)}-(\\d{2})`));
328
+ if (!n) return 1;
329
+ const o = parseInt(n[1]);
309
330
  return Math.ceil(o / 7);
310
331
  }
311
- function Ie(e) {
332
+ function Ke(e) {
312
333
  if (!e) return null;
313
334
  const t = e.match(/^(\d{4})-(\d{2})/);
314
335
  return t ? { year: parseInt(t[1]), month: parseInt(t[2]) } : null;
315
336
  }
316
- function Ue(e) {
337
+ function Be(e) {
317
338
  if (!e) return null;
318
339
  const t = /* @__PURE__ */ new Date(e + "T00:00:00");
319
- return isNaN(t.getTime()) ? null : { year: t.getFullYear(), week: F(t) };
340
+ return isNaN(t.getTime()) ? null : { year: t.getFullYear(), week: H(t) };
320
341
  }
321
- function Ye(e) {
322
- const t = /* @__PURE__ */ new Date(), a = e != null && e.min ? parseInt(e.min.slice(0, 4)) : t.getFullYear() - 2, r = e != null && e.max ? parseInt(e.max.slice(0, 4)) : t.getFullYear(), s = [];
323
- for (let o = r; o >= a; o--) s.push(o);
324
- return s;
342
+ function Qe(e) {
343
+ const t = /* @__PURE__ */ new Date(), a = e != null && e.min ? parseInt(e.min.slice(0, 4)) : t.getFullYear() - 2, r = e != null && e.max ? parseInt(e.max.slice(0, 4)) : t.getFullYear(), n = [];
344
+ for (let o = r; o >= a; o--) n.push(o);
345
+ return n;
325
346
  }
326
347
  function y(e) {
327
348
  if (!e) return null;
328
349
  const [t, a, r] = e.split("-").map(Number);
329
350
  return !t || !a || !r ? null : new Date(t, a - 1, r);
330
351
  }
331
- function ne(e) {
352
+ function fe(e) {
332
353
  if (!e) return "";
333
354
  const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
334
355
  return `${t}-${a}-${r}`;
335
356
  }
336
- function Ge({
357
+ function Ze({
337
358
  value: e,
338
359
  onChange: t,
339
360
  minIso: a,
340
361
  maxIso: r,
341
- placeholder: s,
362
+ placeholder: n,
342
363
  selectsStart: o,
343
364
  selectsEnd: l,
344
365
  startIso: d,
@@ -347,10 +368,10 @@ function Ge({
347
368
  disabled: c
348
369
  }) {
349
370
  return /* @__PURE__ */ i("div", { className: `ddp-field ${h ?? ""}`, children: /* @__PURE__ */ i(
350
- H,
371
+ K,
351
372
  {
352
373
  selected: y(e),
353
- onChange: (u) => t(ne(u)),
374
+ onChange: (u) => t(fe(u)),
354
375
  selectsStart: o,
355
376
  selectsEnd: l,
356
377
  startDate: y(d) ?? void 0,
@@ -358,7 +379,7 @@ function Ge({
358
379
  minDate: y(a) ?? void 0,
359
380
  maxDate: y(r) ?? void 0,
360
381
  dateFormat: "dd/MM/yyyy",
361
- placeholderText: s ?? "Selecione...",
382
+ placeholderText: n ?? "Selecione...",
362
383
  disabled: c,
363
384
  portalId: "ddp-portal",
364
385
  popperPlacement: "bottom-start",
@@ -372,54 +393,54 @@ function Ge({
372
393
  }
373
394
  ) });
374
395
  }
375
- function We({ options: e, value: t, multi: a, onChange: r }) {
376
- const [s, o] = x(!1), [l, d] = x(""), [f, h] = x(null), c = P(null), u = P(null), g = O(
377
- () => t ? t.split(k).filter(Boolean) : [],
396
+ function et({ options: e, value: t, multi: a, onChange: r }) {
397
+ const [n, o] = P(!1), [l, d] = P(""), [f, h] = P(null), c = R(null), u = R(null), g = $(
398
+ () => t ? t.split(F).filter(Boolean) : [],
378
399
  [t]
379
- ), b = O(() => {
380
- const n = l.trim().toLowerCase();
381
- return n ? e.filter((p) => p.toLowerCase().includes(n)) : e;
382
- }, [e, l]), T = () => {
383
- const n = c.current;
384
- if (!n) return;
385
- const p = n.getBoundingClientRect(), _ = 4, S = window.innerHeight - p.bottom - _, E = p.top - _, A = S < 200 && E > S, z = Math.max(150, Math.min(360, A ? E : S));
400
+ ), b = $(() => {
401
+ const s = l.trim().toLowerCase();
402
+ return s ? e.filter((p) => p.toLowerCase().includes(s)) : e;
403
+ }, [e, l]), S = () => {
404
+ const s = c.current;
405
+ if (!s) return;
406
+ const p = s.getBoundingClientRect(), _ = 4, w = window.innerHeight - p.bottom - _, D = p.top - _, I = w < 200 && D > w, q = Math.max(150, Math.min(360, I ? D : w));
386
407
  h({
387
408
  left: p.left,
388
409
  width: p.width,
389
- maxHeight: z,
390
- ...A ? { bottom: window.innerHeight - p.top + _ } : { top: p.bottom + _ }
410
+ maxHeight: q,
411
+ ...I ? { bottom: window.innerHeight - p.top + _ } : { top: p.bottom + _ }
391
412
  });
392
413
  };
393
- J(() => {
394
- if (!s) return;
395
- T();
396
- const n = () => T();
397
- return window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), () => {
398
- window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n);
414
+ B(() => {
415
+ if (!n) return;
416
+ S();
417
+ const s = () => S();
418
+ return window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
419
+ window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
399
420
  };
400
- }, [s]), V(() => {
401
- if (!s) return;
402
- const n = (p) => {
403
- var S, E;
421
+ }, [n]), Q(() => {
422
+ if (!n) return;
423
+ const s = (p) => {
424
+ var w, D;
404
425
  const _ = p.target;
405
- (S = c.current) != null && S.contains(_) || (E = u.current) != null && E.contains(_) || o(!1);
426
+ (w = c.current) != null && w.contains(_) || (D = u.current) != null && D.contains(_) || o(!1);
406
427
  };
407
- return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
408
- }, [s]);
409
- const I = () => {
428
+ return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
429
+ }, [n]);
430
+ const W = () => {
410
431
  o(!1), d("");
411
- }, L = (n) => {
432
+ }, M = (s) => {
412
433
  var p;
413
- r(n), d(""), o(!1), (p = c.current) == null || p.blur();
414
- }, M = (n) => {
415
- const p = g.includes(n) ? g.filter((_) => _ !== n) : [...g, n];
416
- r(p.join(k));
417
- }, U = () => {
434
+ r(s), d(""), o(!1), (p = c.current) == null || p.blur();
435
+ }, O = (s) => {
436
+ const p = g.includes(s) ? g.filter((_) => _ !== s) : [...g, s];
437
+ r(p.join(F));
438
+ }, j = () => {
418
439
  o(!0), a || d("");
419
- }, Y = (n) => {
440
+ }, z = (s) => {
420
441
  var p;
421
- n.key === "Escape" ? (I(), (p = c.current) == null || p.blur()) : n.key === "Enter" && b.length > 0 && (n.preventDefault(), a ? (M(b[0]), d("")) : L(b[0]));
422
- }, G = a || s ? l : t || "", W = a && g.length > 0 ? `${g.length} selecionado(s)` : s ? "Buscar..." : "Todos", j = s && f ? q(
442
+ s.key === "Escape" ? (W(), (p = c.current) == null || p.blur()) : s.key === "Enter" && b.length > 0 && (s.preventDefault(), a ? (O(b[0]), d("")) : M(b[0]));
443
+ }, J = a || n ? l : t || "", V = a && g.length > 0 ? `${g.length} selecionado(s)` : n ? "Buscar..." : "Todos", X = n && f ? Z(
423
444
  /* @__PURE__ */ i(
424
445
  "div",
425
446
  {
@@ -433,7 +454,7 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
433
454
  bottom: f.bottom,
434
455
  maxHeight: f.maxHeight
435
456
  },
436
- children: /* @__PURE__ */ w("div", { className: "widget-filter__search-list", children: [
457
+ children: /* @__PURE__ */ T("div", { className: "widget-filter__search-list", children: [
437
458
  a && g.length > 0 && /* @__PURE__ */ i(
438
459
  "button",
439
460
  {
@@ -443,12 +464,12 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
443
464
  children: "Limpar seleção"
444
465
  }
445
466
  ),
446
- !a && /* @__PURE__ */ w(
467
+ !a && /* @__PURE__ */ T(
447
468
  "button",
448
469
  {
449
470
  type: "button",
450
471
  className: `widget-filter__search-option${t ? "" : " is-selected"}`,
451
- onClick: () => L(""),
472
+ onClick: () => M(""),
452
473
  children: [
453
474
  /* @__PURE__ */ i("span", { className: "widget-filter__search-check", "aria-hidden": !0, children: t ? "" : "✓" }),
454
475
  "Todos"
@@ -456,35 +477,35 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
456
477
  }
457
478
  ),
458
479
  b.length === 0 ? /* @__PURE__ */ i("span", { className: "widget-filter__search-empty", children: "Nenhuma opção" }) : b.map(
459
- (n) => a ? /* @__PURE__ */ w(
480
+ (s) => a ? /* @__PURE__ */ T(
460
481
  "label",
461
482
  {
462
- className: `widget-filter__search-option${g.includes(n) ? " is-selected" : ""}`,
483
+ className: `widget-filter__search-option${g.includes(s) ? " is-selected" : ""}`,
463
484
  children: [
464
485
  /* @__PURE__ */ i(
465
486
  "input",
466
487
  {
467
488
  type: "checkbox",
468
- checked: g.includes(n),
469
- onChange: () => M(n)
489
+ checked: g.includes(s),
490
+ onChange: () => O(s)
470
491
  }
471
492
  ),
472
- n
493
+ s
473
494
  ]
474
495
  },
475
- n
476
- ) : /* @__PURE__ */ w(
496
+ s
497
+ ) : /* @__PURE__ */ T(
477
498
  "button",
478
499
  {
479
500
  type: "button",
480
- className: `widget-filter__search-option${t === n ? " is-selected" : ""}`,
481
- onClick: () => L(n),
501
+ className: `widget-filter__search-option${t === s ? " is-selected" : ""}`,
502
+ onClick: () => M(s),
482
503
  children: [
483
- /* @__PURE__ */ i("span", { className: "widget-filter__search-check", "aria-hidden": !0, children: t === n ? "✓" : "" }),
484
- n
504
+ /* @__PURE__ */ i("span", { className: "widget-filter__search-check", "aria-hidden": !0, children: t === s ? "✓" : "" }),
505
+ s
485
506
  ]
486
507
  },
487
- n
508
+ s
488
509
  )
489
510
  )
490
511
  ] })
@@ -492,74 +513,74 @@ function We({ options: e, value: t, multi: a, onChange: r }) {
492
513
  ),
493
514
  document.body
494
515
  ) : null;
495
- return /* @__PURE__ */ w("div", { className: "widget-filter__search", children: [
516
+ return /* @__PURE__ */ T("div", { className: "widget-filter__search", children: [
496
517
  /* @__PURE__ */ i(
497
518
  "input",
498
519
  {
499
520
  ref: c,
500
521
  type: "text",
501
522
  className: "widget-filter__search-field",
502
- value: G,
503
- placeholder: W,
504
- onFocus: U,
523
+ value: J,
524
+ placeholder: V,
525
+ onFocus: j,
505
526
  onClick: () => o(!0),
506
- onChange: (n) => {
507
- d(n.target.value), o(!0);
527
+ onChange: (s) => {
528
+ d(s.target.value), o(!0);
508
529
  },
509
- onKeyDown: Y
530
+ onKeyDown: z
510
531
  }
511
532
  ),
512
- j
533
+ X
513
534
  ] });
514
535
  }
515
- const oe = [
536
+ const ge = [
516
537
  m.bgDark,
517
538
  m.bgPaper,
518
539
  m.bgElevated,
519
540
  m.accent,
520
541
  m.success
521
542
  ];
522
- function ce(e) {
543
+ function pe(e) {
523
544
  if (!e) return !0;
524
- const t = D(e);
545
+ const t = N(e);
525
546
  return Object.values(v).some(
526
547
  (a) => JSON.stringify(a.colors) === JSON.stringify(t)
527
548
  );
528
549
  }
529
- const le = [
550
+ const me = [
530
551
  { label: "Series", slots: ["series0", "series1", "series2", "series3", "series4"] },
531
552
  { label: "Tema", slots: ["bgDark", "bgPaper", "bgElevated", "textPrimary", "textMuted"] },
532
553
  { label: "Estados", slots: ["accent", "success", "error"] }
533
554
  ];
534
- function je({
555
+ function tt({
535
556
  selected: e,
536
557
  onSelect: t,
537
558
  customMode: a,
538
559
  onCustomModeChange: r,
539
- disabled: s
560
+ disabled: n
540
561
  }) {
541
562
  var h;
542
- const o = a ?? !ce(e), l = D(e), d = o || (h = Object.entries(v).find(
563
+ const o = a ?? !pe(e), l = N(e), d = o || (h = Object.entries(v).find(
543
564
  ([, c]) => JSON.stringify(c.colors) === JSON.stringify(l)
544
565
  )) == null ? void 0 : h[0], f = (c, u) => {
545
566
  const g = [...l];
546
- for (; g.length < N; ) g.push("#000000");
567
+ for (; g.length < L; ) g.push("#000000");
547
568
  g[c] = u, t(g);
548
569
  };
549
- return /* @__PURE__ */ w("div", { className: `palette-selector ${s ? "palette-selector--disabled" : ""}`, children: [
550
- r && /* @__PURE__ */ w("label", { className: "config-panel__checkbox", children: [
570
+ return /* @__PURE__ */ T("div", { className: `palette-selector ${n ? "palette-selector--disabled" : ""}`, children: [
571
+ r && /* @__PURE__ */ T("label", { className: "config-panel__checkbox", children: [
551
572
  /* @__PURE__ */ i(
552
573
  "input",
553
574
  {
554
575
  type: "checkbox",
555
576
  checked: o,
556
577
  onChange: (c) => r(c.target.checked),
557
- disabled: s
578
+ disabled: n
558
579
  }
559
580
  ),
560
581
  "Customizar"
561
582
  ] }),
562
- o ? /* @__PURE__ */ i("div", { className: "palette-selector__custom", children: le.map((c) => /* @__PURE__ */ w("div", { className: "palette-selector__row", children: [
583
+ o ? /* @__PURE__ */ i("div", { className: "palette-selector__custom", children: me.map((c) => /* @__PURE__ */ T("div", { className: "palette-selector__row", children: [
563
584
  /* @__PURE__ */ i("span", { className: "palette-selector__row-label", children: c.label }),
564
585
  /* @__PURE__ */ i("div", { className: "palette-selector__row-slots", children: c.slots.map((u) => {
565
586
  const g = m[u];
@@ -570,36 +591,36 @@ function je({
570
591
  className: "palette-selector__color-input",
571
592
  value: l[g] || "#000000",
572
593
  onChange: (b) => f(g, b.target.value),
573
- disabled: s,
574
- title: Z[u]
594
+ disabled: n,
595
+ title: ne[u]
575
596
  },
576
597
  u
577
598
  );
578
599
  }) })
579
600
  ] }, c.label)) }) : /* @__PURE__ */ i("div", { className: "palette-selector__options", children: Object.entries(v).map(([c, u]) => {
580
- const g = D(u.colors);
581
- return /* @__PURE__ */ w(
601
+ const g = N(u.colors);
602
+ return /* @__PURE__ */ T(
582
603
  "button",
583
604
  {
584
605
  className: `palette-selector__option ${d === c ? "palette-selector__option--active" : ""}`,
585
606
  onClick: () => t(u.colors),
586
- disabled: s,
607
+ disabled: n,
587
608
  children: [
588
- /* @__PURE__ */ i("div", { className: "palette-selector__bar", children: ee(u.colors).map((b, T) => /* @__PURE__ */ i(
609
+ /* @__PURE__ */ i("div", { className: "palette-selector__bar", children: se(u.colors).map((b, S) => /* @__PURE__ */ i(
589
610
  "span",
590
611
  {
591
612
  className: "palette-selector__swatch",
592
613
  style: { backgroundColor: b }
593
614
  },
594
- T
615
+ S
595
616
  )) }),
596
- /* @__PURE__ */ i("div", { className: "palette-selector__bar palette-selector__bar--theme", children: oe.map((b, T) => /* @__PURE__ */ i(
617
+ /* @__PURE__ */ i("div", { className: "palette-selector__bar palette-selector__bar--theme", children: ge.map((b, S) => /* @__PURE__ */ i(
597
618
  "span",
598
619
  {
599
620
  className: "palette-selector__swatch",
600
621
  style: { backgroundColor: g[b] }
601
622
  },
602
- T
623
+ S
603
624
  )) }),
604
625
  /* @__PURE__ */ i("span", { className: "palette-selector__label", children: u.label })
605
626
  ]
@@ -610,53 +631,63 @@ function je({
610
631
  ] });
611
632
  }
612
633
  export {
613
- Ee as A,
614
- Re as B,
615
- Ne as C,
616
- we as D,
617
- be as E,
618
- ve as F,
619
- Ye as G,
620
- y as H,
621
- Ie as I,
622
- Fe as J,
623
- Ue as K,
624
- Oe as L,
625
- Ae as M,
626
- ye as N,
627
- ge as O,
634
+ je as $,
635
+ Pe as A,
636
+ fe as B,
637
+ k as C,
638
+ Le as D,
639
+ ye as E,
640
+ ke as F,
641
+ A as G,
642
+ N as H,
643
+ We as I,
644
+ H as J,
645
+ ze as K,
646
+ Xe as L,
647
+ ue as M,
648
+ xe as N,
649
+ De as O,
628
650
  v as P,
629
- pe as Q,
630
- me as R,
631
- X as S,
632
- N as T,
633
- Q as U,
634
- _e as W,
635
- De as a,
636
- Se as b,
637
- Te as c,
638
- je as d,
639
- xe as e,
640
- Le as f,
641
- ae as g,
642
- re as h,
643
- te as i,
644
- $ as j,
645
- Ge as k,
646
- se as l,
647
- Me as m,
648
- k as n,
649
- m as o,
650
- Z as p,
651
- We as q,
652
- ne as r,
653
- D as s,
654
- Pe as t,
655
- F as u,
656
- ke as v,
657
- $e as w,
658
- he as x,
659
- ee as y,
660
- Ce as z
651
+ se as Q,
652
+ Je as R,
653
+ re as S,
654
+ L as T,
655
+ Ve as U,
656
+ Qe as V,
657
+ Ne as W,
658
+ y as X,
659
+ Ke as Y,
660
+ qe as Z,
661
+ Be as _,
662
+ Ce as a,
663
+ Ee as a0,
664
+ Se as a1,
665
+ we as a2,
666
+ ae as a3,
667
+ Ae as b,
668
+ Me as c,
669
+ ve as d,
670
+ tt as e,
671
+ Ie as f,
672
+ Oe as g,
673
+ ce as h,
674
+ le as i,
675
+ oe as j,
676
+ Y as k,
677
+ Ze as l,
678
+ ie as m,
679
+ C as n,
680
+ x as o,
681
+ He as p,
682
+ Ye as q,
683
+ F as r,
684
+ m as s,
685
+ ne as t,
686
+ et as u,
687
+ $e as v,
688
+ Re as w,
689
+ Fe as x,
690
+ Ge as y,
691
+ Ue as z
661
692
  };
662
- //# sourceMappingURL=ColorPaletteSelector-B4ojsspD.js.map
693
+ //# sourceMappingURL=ColorPaletteSelector-BSAe2YMH.js.map