@aspprev/versi-ds 0.4.0 → 0.4.1

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 (79) hide show
  1. package/README.md +7 -0
  2. package/dist/charts.js +1 -2
  3. package/dist/{chunk-ATWH3MA6.js → chunk-2XXVEFFY.js} +18 -35
  4. package/dist/{chunk-ATWH3MA6.js.map → chunk-2XXVEFFY.js.map} +1 -1
  5. package/dist/{chunk-V66QL3TD.js → chunk-5MRS4PDD.js} +200 -211
  6. package/dist/{chunk-V66QL3TD.js.map → chunk-5MRS4PDD.js.map} +1 -1
  7. package/dist/{chunk-LPLXAKPJ.js → chunk-6NVJWI5B.js} +551 -603
  8. package/dist/chunk-6NVJWI5B.js.map +1 -0
  9. package/dist/chunk-7IY43S3Y.js +2833 -0
  10. package/dist/chunk-7IY43S3Y.js.map +1 -0
  11. package/dist/{chunk-LTW323JQ.js → chunk-JGCZAVYV.js} +420 -594
  12. package/dist/{chunk-LTW323JQ.js.map → chunk-JGCZAVYV.js.map} +1 -1
  13. package/dist/{chunk-FTRF27XF.js → chunk-MMTKCHRP.js} +7 -17
  14. package/dist/{chunk-FTRF27XF.js.map → chunk-MMTKCHRP.js.map} +1 -1
  15. package/dist/{chunk-7JI5637G.js → chunk-YIUITJ4V.js} +45 -77
  16. package/dist/{chunk-7JI5637G.js.map → chunk-YIUITJ4V.js.map} +1 -1
  17. package/dist/{chunk-WOD44OEH.js → chunk-ZPY72ILO.js} +41 -58
  18. package/dist/{chunk-WOD44OEH.js.map → chunk-ZPY72ILO.js.map} +1 -1
  19. package/dist/core.js +3 -4
  20. package/dist/countries-browser.d.ts +11 -0
  21. package/dist/countries-browser.js +44 -0
  22. package/dist/countries-browser.js.map +1 -0
  23. package/dist/countries.d.ts +6 -46
  24. package/dist/countries.js +280 -7
  25. package/dist/countries.js.map +1 -1
  26. package/dist/country-metadata-DOgzawAc.d.ts +27 -0
  27. package/dist/documents.js +2 -3
  28. package/dist/flags-00-MPU4ISEM.js +85 -0
  29. package/dist/flags-00-MPU4ISEM.js.map +1 -0
  30. package/dist/flags-01-PWC64NSQ.js +13 -0
  31. package/dist/flags-01-PWC64NSQ.js.map +1 -0
  32. package/dist/flags-02-GNF7X6MP.js +10 -0
  33. package/dist/flags-02-GNF7X6MP.js.map +1 -0
  34. package/dist/flags-03-STVDA6UG.js +82 -0
  35. package/dist/flags-03-STVDA6UG.js.map +1 -0
  36. package/dist/flags-04-Z6AHZIWG.js +31 -0
  37. package/dist/flags-04-Z6AHZIWG.js.map +1 -0
  38. package/dist/flags-05-QBADBC6C.js +13 -0
  39. package/dist/flags-05-QBADBC6C.js.map +1 -0
  40. package/dist/flags-06-O55E67OI.js +28 -0
  41. package/dist/flags-06-O55E67OI.js.map +1 -0
  42. package/dist/flags-07-RSWJQIRW.js +64 -0
  43. package/dist/flags-07-RSWJQIRW.js.map +1 -0
  44. package/dist/flags-08-HHXIPTKX.js +31 -0
  45. package/dist/flags-08-HHXIPTKX.js.map +1 -0
  46. package/dist/flags-09-OEZBQ62G.js +64 -0
  47. package/dist/flags-09-OEZBQ62G.js.map +1 -0
  48. package/dist/flags-10-XJY5UMQR.js +73 -0
  49. package/dist/flags-10-XJY5UMQR.js.map +1 -0
  50. package/dist/flags-11-7M75OPUJ.js +34 -0
  51. package/dist/flags-11-7M75OPUJ.js.map +1 -0
  52. package/dist/flags-12-JY22PFQH.js +31 -0
  53. package/dist/flags-12-JY22PFQH.js.map +1 -0
  54. package/dist/flags-13-BERDGZCT.js +52 -0
  55. package/dist/flags-13-BERDGZCT.js.map +1 -0
  56. package/dist/flags-14-XVPM2GQ2.js +31 -0
  57. package/dist/flags-14-XVPM2GQ2.js.map +1 -0
  58. package/dist/flags-15-WESIXIDR.js +64 -0
  59. package/dist/flags-15-WESIXIDR.js.map +1 -0
  60. package/dist/flags-16-PTNHBPYG.js +40 -0
  61. package/dist/flags-16-PTNHBPYG.js.map +1 -0
  62. package/dist/flags-17-UYXBV5BH.js +10 -0
  63. package/dist/flags-17-UYXBV5BH.js.map +1 -0
  64. package/dist/flags-18-VMKDO7W4.js +91 -0
  65. package/dist/flags-18-VMKDO7W4.js.map +1 -0
  66. package/dist/flags-19-635PQOEQ.js +43 -0
  67. package/dist/flags-19-635PQOEQ.js.map +1 -0
  68. package/dist/forms.d.ts +2 -2
  69. package/dist/forms.js +3 -4
  70. package/dist/index.d.ts +1 -1
  71. package/dist/index.js +8 -9
  72. package/dist/manifest.json +32 -10
  73. package/dist/overlays.js +1 -2
  74. package/package.json +4 -2
  75. package/dist/chunk-2NMEKWO5.js +0 -38
  76. package/dist/chunk-2NMEKWO5.js.map +0 -1
  77. package/dist/chunk-LPLXAKPJ.js.map +0 -1
  78. package/dist/chunk-YCW3REQK.js +0 -3102
  79. package/dist/chunk-YCW3REQK.js.map +0 -1
@@ -1,9 +1,3 @@
1
- import {
2
- __objRest,
3
- __spreadProps,
4
- __spreadValues
5
- } from "./chunk-2NMEKWO5.js";
6
-
7
1
  // src/components/chart/LazyApexChart.tsx
8
2
  import { useEffect, useState } from "react";
9
3
  import { jsx } from "react/jsx-runtime";
@@ -29,7 +23,7 @@ function LazyApexChart(props) {
29
23
  }
30
24
  );
31
25
  }
32
- return /* @__PURE__ */ jsx(ApexChart, __spreadValues({}, props));
26
+ return /* @__PURE__ */ jsx(ApexChart, { ...props });
33
27
  }
34
28
 
35
29
  // src/utils/chart-theme.ts
@@ -62,9 +56,8 @@ var MUTED_SERIES_FALLBACKS = [
62
56
  "#aeb5bd"
63
57
  ];
64
58
  var readColorToken = (token, fallback) => {
65
- var _a;
66
59
  if (typeof window === "undefined") return fallback;
67
- const value = window.getComputedStyle((_a = document.body) != null ? _a : document.documentElement).getPropertyValue(token).trim();
60
+ const value = window.getComputedStyle(document.body ?? document.documentElement).getPropertyValue(token).trim();
68
61
  return value ? `rgb(${value})` : fallback;
69
62
  };
70
63
  var getChartTheme = () => ({
@@ -93,7 +86,7 @@ var getChartSeriesRecord = (backendColors, count = 5) => {
93
86
  );
94
87
  const isDarkSchemeActive = typeof document !== "undefined" && document.documentElement.dataset.colorScheme === "dark";
95
88
  const highContrastActive = typeof document !== "undefined" && document.documentElement.dataset.contrast === "high";
96
- return highContrastActive || isDarkSchemeActive ? fallbackColors : __spreadValues(__spreadValues({}, fallbackColors), backendColors);
89
+ return highContrastActive || isDarkSchemeActive ? fallbackColors : { ...fallbackColors, ...backendColors };
97
90
  };
98
91
 
99
92
  // src/components/chart/interactive-donut-utils.ts
@@ -127,7 +120,7 @@ var TOOLTIP_ENTITIES = {
127
120
  "'": "'"
128
121
  };
129
122
  function escapeDonutTooltipText(value) {
130
- return String(value != null ? value : "").replace(
123
+ return String(value ?? "").replace(
131
124
  /[&<>"']/g,
132
125
  (character) => TOOLTIP_ENTITIES[character]
133
126
  );
@@ -160,36 +153,24 @@ import {
160
153
  useState as useState3
161
154
  } from "react";
162
155
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
163
- function InteractiveDonutChart(_a) {
164
- var _b = _a, {
165
- options = {},
166
- series,
167
- colors,
168
- mutedColors,
169
- valueFormatter = (value) => new Intl.NumberFormat("pt-BR", {
170
- style: "currency",
171
- currency: "BRL"
172
- }).format(value),
173
- ariaLabel = "Gr\xE1fico de distribui\xE7\xE3o",
174
- className,
175
- chartClassName,
176
- responsiveHeight = false,
177
- highContrastOverride
178
- } = _b, rest = __objRest(_b, [
179
- "options",
180
- "series",
181
- "colors",
182
- "mutedColors",
183
- "valueFormatter",
184
- "ariaLabel",
185
- "className",
186
- "chartClassName",
187
- "responsiveHeight",
188
- "highContrastOverride"
189
- ]);
190
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i;
156
+ function InteractiveDonutChart({
157
+ options = {},
158
+ series,
159
+ colors,
160
+ mutedColors,
161
+ valueFormatter = (value) => new Intl.NumberFormat("pt-BR", {
162
+ style: "currency",
163
+ currency: "BRL"
164
+ }).format(value),
165
+ ariaLabel = "Gr\xE1fico de distribui\xE7\xE3o",
166
+ className,
167
+ chartClassName,
168
+ responsiveHeight = false,
169
+ highContrastOverride,
170
+ ...rest
171
+ }) {
191
172
  const storedHighContrast = useHighContrastPreference();
192
- const highContrast = highContrastOverride != null ? highContrastOverride : storedHighContrast;
173
+ const highContrast = highContrastOverride ?? storedHighContrast;
193
174
  const [selectedIndex, setSelectedIndex] = useState3(null);
194
175
  const [legendSelectedIndex, setLegendSelectedIndex] = useState3(
195
176
  null
@@ -197,12 +178,9 @@ function InteractiveDonutChart(_a) {
197
178
  const containerRef = useRef(null);
198
179
  const instructionsId = useId();
199
180
  const chartTheme = getChartTheme();
200
- const baseColors = !highContrast && (colors == null ? void 0 : colors.length) ? colors : chartTheme.donutSeries;
201
- const neutralColors = !highContrast && (mutedColors == null ? void 0 : mutedColors.length) ? mutedColors : chartTheme.mutedSeries;
202
- const labels = useMemo(() => {
203
- var _a3;
204
- return (_a3 = options.labels) != null ? _a3 : [];
205
- }, [options.labels]);
181
+ const baseColors = !highContrast && colors?.length ? colors : chartTheme.donutSeries;
182
+ const neutralColors = !highContrast && mutedColors?.length ? mutedColors : chartTheme.mutedSeries;
183
+ const labels = useMemo(() => options.labels ?? [], [options.labels]);
206
184
  useEffect3(() => {
207
185
  setSelectedIndex(
208
186
  (current) => current !== null && current >= series.length ? null : current
@@ -213,8 +191,7 @@ function InteractiveDonutChart(_a) {
213
191
  }, [series.length]);
214
192
  useEffect3(() => {
215
193
  const resetOnOutsideClick = (event) => {
216
- var _a3;
217
- if ((_a3 = containerRef.current) == null ? void 0 : _a3.contains(event.target)) return;
194
+ if (containerRef.current?.contains(event.target)) return;
218
195
  setSelectedIndex(null);
219
196
  setLegendSelectedIndex(null);
220
197
  };
@@ -279,11 +256,10 @@ function InteractiveDonutChart(_a) {
279
256
  };
280
257
  }, [responsiveHeight, rest.height, series.length]);
281
258
  const donutSizeRatio = useMemo(() => {
282
- var _a3, _b3, _c2, _d2;
283
- const size = (_d2 = (_c2 = (_b3 = (_a3 = options.plotOptions) == null ? void 0 : _a3.pie) == null ? void 0 : _b3.donut) == null ? void 0 : _c2.size) != null ? _d2 : "65%";
259
+ const size = options.plotOptions?.pie?.donut?.size ?? "65%";
284
260
  const parsed = parseFloat(String(size));
285
261
  return Number.isFinite(parsed) ? parsed / 100 : 0.65;
286
- }, [(_c = (_b2 = (_a2 = options.plotOptions) == null ? void 0 : _a2.pie) == null ? void 0 : _b2.donut) == null ? void 0 : _c.size]);
262
+ }, [options.plotOptions?.pie?.donut?.size]);
287
263
  const displayColors = resolveInteractiveDonutColors({
288
264
  count: series.length,
289
265
  colors: baseColors,
@@ -291,14 +267,14 @@ function InteractiveDonutChart(_a) {
291
267
  selectedIndex
292
268
  });
293
269
  const legendValue = legendSelectedIndex !== null ? {
294
- label: (_d = labels[legendSelectedIndex]) != null ? _d : `Categoria ${legendSelectedIndex + 1}`,
295
- value: Number((_e = series[legendSelectedIndex]) != null ? _e : 0)
270
+ label: labels[legendSelectedIndex] ?? `Categoria ${legendSelectedIndex + 1}`,
271
+ value: Number(series[legendSelectedIndex] ?? 0)
296
272
  } : null;
297
273
  const interactiveOptions = useMemo(() => {
298
- var _a3, _b3, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m;
299
- const originalSelection = (_b3 = (_a3 = options.chart) == null ? void 0 : _a3.events) == null ? void 0 : _b3.dataPointSelection;
300
- const originalLegendClick = (_d2 = (_c2 = options.chart) == null ? void 0 : _c2.events) == null ? void 0 : _d2.legendClick;
301
- return __spreadProps(__spreadValues({}, options), {
274
+ const originalSelection = options.chart?.events?.dataPointSelection;
275
+ const originalLegendClick = options.chart?.events?.legendClick;
276
+ return {
277
+ ...options,
302
278
  colors: displayColors,
303
279
  fill: highContrast ? {
304
280
  type: "pattern",
@@ -314,61 +290,70 @@ function InteractiveDonutChart(_a) {
314
290
  height: 6,
315
291
  strokeWidth: 2
316
292
  }
317
- } : __spreadProps(__spreadValues({}, options.fill), {
318
- type: (_f2 = (_e2 = options.fill) == null ? void 0 : _e2.type) != null ? _f2 : "solid",
319
- opacity: (_h2 = (_g2 = options.fill) == null ? void 0 : _g2.opacity) != null ? _h2 : 1
320
- }),
321
- stroke: highContrast ? __spreadProps(__spreadValues({}, options.stroke), { colors: ["#ffffff"], width: 2 }) : options.stroke,
322
- chart: __spreadProps(__spreadValues({}, options.chart), {
323
- events: __spreadProps(__spreadValues({}, (_i2 = options.chart) == null ? void 0 : _i2.events), {
293
+ } : {
294
+ ...options.fill,
295
+ type: options.fill?.type ?? "solid",
296
+ opacity: options.fill?.opacity ?? 1
297
+ },
298
+ stroke: highContrast ? { ...options.stroke, colors: ["#ffffff"], width: 2 } : options.stroke,
299
+ chart: {
300
+ ...options.chart,
301
+ events: {
302
+ ...options.chart?.events,
324
303
  dataPointSelection(event, chart, config) {
325
- originalSelection == null ? void 0 : originalSelection(event, chart, config);
326
- const nextIndex = Number(config == null ? void 0 : config.dataPointIndex);
304
+ originalSelection?.(event, chart, config);
305
+ const nextIndex = Number(config?.dataPointIndex);
327
306
  if (!Number.isInteger(nextIndex) || nextIndex < 0) return;
328
307
  setSelectedIndex(
329
308
  (current) => current === nextIndex ? null : nextIndex
330
309
  );
331
310
  },
332
311
  legendClick(chartContext, seriesIndex, config) {
333
- originalLegendClick == null ? void 0 : originalLegendClick(chartContext, seriesIndex, config);
312
+ originalLegendClick?.(chartContext, seriesIndex, config);
334
313
  if (typeof seriesIndex !== "number" || seriesIndex < 0) return;
335
314
  setLegendSelectedIndex(
336
315
  (current) => current === seriesIndex ? null : seriesIndex
337
316
  );
338
317
  }
339
- })
340
- }),
341
- legend: __spreadProps(__spreadValues({}, options.legend), {
342
- labels: __spreadProps(__spreadValues({}, (_j = options.legend) == null ? void 0 : _j.labels), {
318
+ }
319
+ },
320
+ legend: {
321
+ ...options.legend,
322
+ labels: {
323
+ ...options.legend?.labels,
343
324
  colors: chartTheme.axis
344
- }),
345
- onItemClick: __spreadProps(__spreadValues({}, (_k = options.legend) == null ? void 0 : _k.onItemClick), {
325
+ },
326
+ onItemClick: {
327
+ ...options.legend?.onItemClick,
346
328
  toggleDataSeries: false
347
- })
348
- }),
349
- states: __spreadProps(__spreadValues({}, options.states), {
350
- hover: __spreadProps(__spreadValues({}, (_l = options.states) == null ? void 0 : _l.hover), {
329
+ }
330
+ },
331
+ states: {
332
+ ...options.states,
333
+ hover: {
334
+ ...options.states?.hover,
351
335
  filter: { type: "none" }
352
- }),
353
- active: __spreadProps(__spreadValues({}, (_m = options.states) == null ? void 0 : _m.active), {
336
+ },
337
+ active: {
338
+ ...options.states?.active,
354
339
  allowMultipleDataPointsSelection: false,
355
340
  filter: { type: "none" }
356
- })
357
- }),
358
- tooltip: __spreadProps(__spreadValues({}, options.tooltip), {
341
+ }
342
+ },
343
+ tooltip: {
344
+ ...options.tooltip,
359
345
  enabled: true,
360
346
  followCursor: true,
361
347
  custom({ series: tooltipSeries, seriesIndex }) {
362
- var _a4, _b4;
363
- const value = Number((_a4 = tooltipSeries == null ? void 0 : tooltipSeries[seriesIndex]) != null ? _a4 : 0);
348
+ const value = Number(tooltipSeries?.[seriesIndex] ?? 0);
364
349
  const label = escapeDonutTooltipText(
365
- (_b4 = labels[seriesIndex]) != null ? _b4 : `Categoria ${seriesIndex + 1}`
350
+ labels[seriesIndex] ?? `Categoria ${seriesIndex + 1}`
366
351
  );
367
352
  const formattedValue = escapeDonutTooltipText(valueFormatter(value));
368
353
  return `<div class="donut-chart-tooltip"><span class="donut-chart-tooltip-label">${label}</span><strong class="donut-chart-tooltip-value">${formattedValue}</strong></div>`;
369
354
  }
370
- })
371
- });
355
+ }
356
+ };
372
357
  }, [
373
358
  chartTheme.axis,
374
359
  displayColors,
@@ -377,10 +362,10 @@ function InteractiveDonutChart(_a) {
377
362
  options,
378
363
  valueFormatter
379
364
  ]);
380
- const selectedLabel = selectedIndex === null ? "Nenhuma categoria selecionada" : `${(_f = labels[selectedIndex]) != null ? _f : `Categoria ${selectedIndex + 1}`}: ${valueFormatter(
381
- Number((_g = series[selectedIndex]) != null ? _g : 0)
365
+ const selectedLabel = selectedIndex === null ? "Nenhuma categoria selecionada" : `${labels[selectedIndex] ?? `Categoria ${selectedIndex + 1}`}: ${valueFormatter(
366
+ Number(series[selectedIndex] ?? 0)
382
367
  )}`;
383
- const legendValueLabel = legendSelectedIndex === null ? "" : `Valor em destaque: ${(_h = labels[legendSelectedIndex]) != null ? _h : `Categoria ${legendSelectedIndex + 1}`}: ${valueFormatter(Number((_i = series[legendSelectedIndex]) != null ? _i : 0))}`;
368
+ const legendValueLabel = legendSelectedIndex === null ? "" : `Valor em destaque: ${labels[legendSelectedIndex] ?? `Categoria ${legendSelectedIndex + 1}`}: ${valueFormatter(Number(series[legendSelectedIndex] ?? 0))}`;
384
369
  const handleKeyDown = (event) => {
385
370
  if (["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp"].includes(event.key)) {
386
371
  event.preventDefault();
@@ -407,17 +392,18 @@ function InteractiveDonutChart(_a) {
407
392
  "aria-label": ariaLabel,
408
393
  "aria-describedby": instructionsId,
409
394
  onKeyDown: handleKeyDown,
410
- className: `chart-keyboard-focus-ring relative min-w-0 rounded-sm ${className != null ? className : ""}`.trim(),
395
+ className: `chart-keyboard-focus-ring relative min-w-0 rounded-sm ${className ?? ""}`.trim(),
411
396
  children: [
412
397
  /* @__PURE__ */ jsx2(
413
398
  LazyApexChart,
414
- __spreadProps(__spreadValues({}, rest), {
399
+ {
400
+ ...rest,
415
401
  className: chartClassName,
416
402
  height: responsiveHeight && measuredChartHeight ? measuredChartHeight : rest.height,
417
403
  options: interactiveOptions,
418
404
  series,
419
405
  type: "donut"
420
- }),
406
+ },
421
407
  highContrast ? "donut-high-contrast" : "donut-standard"
422
408
  ),
423
409
  legendValue && pieCircle && /* @__PURE__ */ jsxs(
@@ -448,25 +434,17 @@ function InteractiveDonutChart(_a) {
448
434
  // src/components/chart/TimeSeriesChart.tsx
449
435
  import { useEffect as useEffect4, useRef as useRef2, useState as useState4 } from "react";
450
436
  import { jsx as jsx3 } from "react/jsx-runtime";
451
- function TimeSeriesChart(_a) {
452
- var _b = _a, {
453
- options,
454
- ariaLabel,
455
- className,
456
- chartClassName,
457
- responsiveHeight = false,
458
- highContrastOverride
459
- } = _b, chartProps = __objRest(_b, [
460
- "options",
461
- "ariaLabel",
462
- "className",
463
- "chartClassName",
464
- "responsiveHeight",
465
- "highContrastOverride"
466
- ]);
467
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
437
+ function TimeSeriesChart({
438
+ options,
439
+ ariaLabel,
440
+ className,
441
+ chartClassName,
442
+ responsiveHeight = false,
443
+ highContrastOverride,
444
+ ...chartProps
445
+ }) {
468
446
  const storedHighContrast = useHighContrastPreference();
469
- const highContrast = highContrastOverride != null ? highContrastOverride : storedHighContrast;
447
+ const highContrast = highContrastOverride ?? storedHighContrast;
470
448
  const theme = getChartTheme();
471
449
  const containerRef = useRef2(null);
472
450
  const [measuredHeight, setMeasuredHeight] = useState4(null);
@@ -521,7 +499,7 @@ function TimeSeriesChart(_a) {
521
499
  const renderedHeight = responsiveHeight && measuredHeight ? measuredHeight : chartProps.height;
522
500
  const renderedWidth = responsiveHeight && measuredWidth ? measuredWidth : chartProps.width;
523
501
  const xAxis = options.xaxis;
524
- const xAxisCategories = Array.isArray(xAxis == null ? void 0 : xAxis.categories) ? xAxis.categories : [];
502
+ const xAxisCategories = Array.isArray(xAxis?.categories) ? xAxis.categories : [];
525
503
  const availableWidth = typeof renderedWidth === "number" ? renderedWidth : 720;
526
504
  const maxVisibleXAxisLabels = Math.max(
527
505
  4,
@@ -534,140 +512,150 @@ function TimeSeriesChart(_a) {
534
512
  const hasDenseXAxis = xAxisCategories.length > maxVisibleXAxisLabels;
535
513
  const xAxisCategoriesKey = JSON.stringify(xAxisCategories);
536
514
  const responsiveXAxisFormatter = xAxisCategories.length ? (value, _timestamp, opts) => {
537
- var _a3, _b3;
538
515
  const fallbackIndex = xAxisCategories.findIndex(
539
516
  (category) => String(category) === String(value)
540
517
  );
541
- const index = (_a3 = opts == null ? void 0 : opts.dataPointIndex) != null ? _a3 : fallbackIndex >= 0 ? fallbackIndex : 0;
518
+ const index = opts?.dataPointIndex ?? (fallbackIndex >= 0 ? fallbackIndex : 0);
542
519
  const isLast = index === xAxisCategories.length - 1;
543
- return index % xAxisLabelStep === 0 || isLast ? String((_b3 = xAxisCategories[index]) != null ? _b3 : value) : "";
544
- } : (_a2 = xAxis == null ? void 0 : xAxis.labels) == null ? void 0 : _a2.formatter;
520
+ return index % xAxisLabelStep === 0 || isLast ? String(xAxisCategories[index] ?? value) : "";
521
+ } : xAxis?.labels?.formatter;
545
522
  const renderKey = [
546
523
  themeKey,
547
- renderedWidth != null ? renderedWidth : "auto-width",
548
- renderedHeight != null ? renderedHeight : "auto-height",
524
+ renderedWidth ?? "auto-width",
525
+ renderedHeight ?? "auto-height",
549
526
  xAxisCategoriesKey
550
527
  ].join("|");
551
- const yAxis = Array.isArray(options.yaxis) ? options.yaxis.map((axis) => {
552
- var _a3;
553
- return __spreadProps(__spreadValues({}, axis), {
554
- labels: __spreadProps(__spreadValues({}, axis.labels), {
555
- show: true,
556
- style: __spreadProps(__spreadValues({
557
- fontSize: "11px",
558
- fontWeight: 500
559
- }, (_a3 = axis.labels) == null ? void 0 : _a3.style), {
560
- colors: theme.axis
561
- })
562
- })
563
- });
564
- }) : __spreadProps(__spreadValues({}, options.yaxis), {
565
- labels: __spreadProps(__spreadValues({}, (_b2 = options.yaxis) == null ? void 0 : _b2.labels), {
528
+ const yAxis = Array.isArray(options.yaxis) ? options.yaxis.map((axis) => ({
529
+ ...axis,
530
+ labels: {
531
+ ...axis.labels,
566
532
  show: true,
567
- style: __spreadProps(__spreadValues({
533
+ style: {
568
534
  fontSize: "11px",
569
- fontWeight: 500
570
- }, (_d = (_c = options.yaxis) == null ? void 0 : _c.labels) == null ? void 0 : _d.style), {
535
+ fontWeight: 500,
536
+ ...axis.labels?.style,
571
537
  colors: theme.axis
572
- })
573
- })
574
- });
575
- const sharedOptions = __spreadProps(__spreadValues({}, options), {
538
+ }
539
+ }
540
+ })) : {
541
+ ...options.yaxis,
542
+ labels: {
543
+ ...options.yaxis?.labels,
544
+ show: true,
545
+ style: {
546
+ fontSize: "11px",
547
+ fontWeight: 500,
548
+ ...options.yaxis?.labels?.style,
549
+ colors: theme.axis
550
+ }
551
+ }
552
+ };
553
+ const sharedOptions = {
554
+ ...options,
576
555
  colors: highContrast ? [...theme.series] : options.colors,
577
- chart: __spreadProps(__spreadValues({
556
+ chart: {
578
557
  toolbar: { show: false },
579
558
  zoom: { enabled: false },
580
559
  parentHeightOffset: 0,
581
560
  redrawOnParentResize: true,
582
- redrawOnWindowResize: true
583
- }, options.chart), {
561
+ redrawOnWindowResize: true,
562
+ ...options.chart,
584
563
  foreColor: theme.axis
585
- }),
586
- dataLabels: __spreadValues({
587
- enabled: false
588
- }, options.dataLabels),
589
- grid: __spreadProps(__spreadValues({
564
+ },
565
+ dataLabels: {
566
+ enabled: false,
567
+ ...options.dataLabels
568
+ },
569
+ grid: {
590
570
  show: true,
591
571
  borderColor: theme.grid,
592
- strokeDashArray: 0
593
- }, options.grid), {
572
+ strokeDashArray: 0,
573
+ ...options.grid,
594
574
  xaxis: {
595
- lines: __spreadProps(__spreadValues({}, (_f = (_e = options.grid) == null ? void 0 : _e.xaxis) == null ? void 0 : _f.lines), {
596
- show: hasDenseXAxis ? false : (_j = (_i = (_h = (_g = options.grid) == null ? void 0 : _g.xaxis) == null ? void 0 : _h.lines) == null ? void 0 : _i.show) != null ? _j : true
597
- })
575
+ lines: {
576
+ ...options.grid?.xaxis?.lines,
577
+ show: hasDenseXAxis ? false : options.grid?.xaxis?.lines?.show ?? true
578
+ }
598
579
  },
599
580
  yaxis: {
600
- lines: __spreadValues({ show: true }, (_l = (_k = options.grid) == null ? void 0 : _k.yaxis) == null ? void 0 : _l.lines)
581
+ lines: { show: true, ...options.grid?.yaxis?.lines }
601
582
  },
602
- padding: __spreadValues({
583
+ padding: {
603
584
  top: 0,
604
585
  right: 8,
605
586
  bottom: 8,
606
- left: 8
607
- }, (_m = options.grid) == null ? void 0 : _m.padding)
608
- }),
609
- stroke: __spreadProps(__spreadValues({
587
+ left: 8,
588
+ ...options.grid?.padding
589
+ }
590
+ },
591
+ stroke: {
610
592
  width: 2,
611
- curve: "straight"
612
- }, options.stroke), {
613
- colors: highContrast ? [...theme.series] : (_n = options.stroke) == null ? void 0 : _n.colors,
614
- dashArray: highContrast ? [0, 6, 2, 8, 4, 10, 1, 7, 3, 9, 5, 11] : (_p = (_o = options.stroke) == null ? void 0 : _o.dashArray) != null ? _p : 0
615
- }),
616
- markers: __spreadProps(__spreadValues({
593
+ curve: "straight",
594
+ ...options.stroke,
595
+ colors: highContrast ? [...theme.series] : options.stroke?.colors,
596
+ dashArray: highContrast ? [0, 6, 2, 8, 4, 10, 1, 7, 3, 9, 5, 11] : options.stroke?.dashArray ?? 0
597
+ },
598
+ markers: {
617
599
  strokeWidth: 1,
618
- strokeColors: [theme.surface]
619
- }, options.markers), {
620
- size: highContrast ? 4 : (_r = (_q = options.markers) == null ? void 0 : _q.size) != null ? _r : 3,
621
- hover: __spreadValues({ size: 4 }, (_s = options.markers) == null ? void 0 : _s.hover)
622
- }),
623
- annotations: highContrast ? __spreadProps(__spreadValues({}, options.annotations), {
624
- xaxis: (_u = (_t = options.annotations) == null ? void 0 : _t.xaxis) == null ? void 0 : _u.map((annotation, index) => __spreadProps(__spreadValues({}, annotation), {
600
+ strokeColors: [theme.surface],
601
+ ...options.markers,
602
+ size: highContrast ? 4 : options.markers?.size ?? 3,
603
+ hover: { size: 4, ...options.markers?.hover }
604
+ },
605
+ annotations: highContrast ? {
606
+ ...options.annotations,
607
+ xaxis: options.annotations?.xaxis?.map((annotation, index) => ({
608
+ ...annotation,
625
609
  fillColor: theme.series[index % theme.series.length],
626
610
  opacity: 0.28
627
611
  }))
628
- }) : options.annotations,
629
- xaxis: __spreadProps(__spreadValues({
612
+ } : options.annotations,
613
+ xaxis: {
630
614
  tooltip: { enabled: false },
631
- axisBorder: { color: theme.axisBorder }
632
- }, xAxis), {
633
- tickAmount: xAxisCategories.length ? void 0 : xAxis == null ? void 0 : xAxis.tickAmount,
634
- axisTicks: __spreadProps(__spreadValues({
635
- color: theme.axisBorder
636
- }, xAxis == null ? void 0 : xAxis.axisTicks), {
637
- show: hasDenseXAxis ? false : (_w = (_v = xAxis == null ? void 0 : xAxis.axisTicks) == null ? void 0 : _v.show) != null ? _w : true
638
- }),
639
- labels: __spreadProps(__spreadValues({}, xAxis == null ? void 0 : xAxis.labels), {
615
+ axisBorder: { color: theme.axisBorder },
616
+ ...xAxis,
617
+ tickAmount: xAxisCategories.length ? void 0 : xAxis?.tickAmount,
618
+ axisTicks: {
619
+ color: theme.axisBorder,
620
+ ...xAxis?.axisTicks,
621
+ show: hasDenseXAxis ? false : xAxis?.axisTicks?.show ?? true
622
+ },
623
+ labels: {
624
+ ...xAxis?.labels,
640
625
  show: true,
641
626
  formatter: responsiveXAxisFormatter,
642
- style: __spreadProps(__spreadValues({
627
+ style: {
643
628
  fontSize: "11px",
644
- fontWeight: 500
645
- }, (_x = xAxis == null ? void 0 : xAxis.labels) == null ? void 0 : _x.style), {
629
+ fontWeight: 500,
630
+ ...xAxis?.labels?.style,
646
631
  colors: theme.axis
647
- })
648
- })
649
- }),
632
+ }
633
+ }
634
+ },
650
635
  yaxis: yAxis,
651
- tooltip: __spreadValues({
636
+ tooltip: {
652
637
  shared: true,
653
638
  intersect: false,
654
- followCursor: true
655
- }, options.tooltip),
656
- legend: __spreadProps(__spreadValues({}, options.legend), {
657
- labels: __spreadProps(__spreadValues({}, (_y = options.legend) == null ? void 0 : _y.labels), {
639
+ followCursor: true,
640
+ ...options.tooltip
641
+ },
642
+ legend: {
643
+ ...options.legend,
644
+ labels: {
645
+ ...options.legend?.labels,
658
646
  colors: theme.axis
659
- })
660
- }),
661
- noData: __spreadProps(__spreadValues({
662
- text: "Nenhum dado dispon\xEDvel no per\xEDodo selecionado"
663
- }, options.noData), {
664
- style: __spreadProps(__spreadValues({
665
- fontSize: "15px"
666
- }, (_z = options.noData) == null ? void 0 : _z.style), {
647
+ }
648
+ },
649
+ noData: {
650
+ text: "Nenhum dado dispon\xEDvel no per\xEDodo selecionado",
651
+ ...options.noData,
652
+ style: {
653
+ fontSize: "15px",
654
+ ...options.noData?.style,
667
655
  color: theme.axis
668
- })
669
- })
670
- });
656
+ }
657
+ }
658
+ };
671
659
  return /* @__PURE__ */ jsx3(
672
660
  "div",
673
661
  {
@@ -677,12 +665,13 @@ function TimeSeriesChart(_a) {
677
665
  className,
678
666
  children: /* @__PURE__ */ jsx3(
679
667
  LazyApexChart,
680
- __spreadProps(__spreadValues({}, chartProps), {
668
+ {
669
+ ...chartProps,
681
670
  className: chartClassName,
682
671
  width: renderedWidth,
683
672
  height: renderedHeight,
684
673
  options: sharedOptions
685
- }),
674
+ },
686
675
  renderKey
687
676
  )
688
677
  }
@@ -703,7 +692,7 @@ function TimeRangeSelector({
703
692
  {
704
693
  role: "group",
705
694
  "aria-label": ariaLabel,
706
- className: `flex min-w-0 flex-wrap justify-start gap-1.5 ${className != null ? className : ""}`.trim(),
695
+ className: `flex min-w-0 flex-wrap justify-start gap-1.5 ${className ?? ""}`.trim(),
707
696
  children: options.map((range) => {
708
697
  const isSelected = selected === range;
709
698
  return /* @__PURE__ */ jsx4(
@@ -731,14 +720,14 @@ var TOOLTIP_ENTITIES2 = {
731
720
  "'": "&#039;"
732
721
  };
733
722
  function escapeTimeSeriesTooltipText(value) {
734
- return String(value != null ? value : "").replace(
723
+ return String(value ?? "").replace(
735
724
  /[&<>"']/g,
736
725
  (character) => TOOLTIP_ENTITIES2[character]
737
726
  );
738
727
  }
739
728
  var SAFE_TOOLTIP_COLOR = /^(?:#[\da-f]{3,8}|rgba?\([\d\s.,%]+\)|hsla?\([\d\s.,%]+\)|var\(--[\w-]+\)|[a-z]+)$/i;
740
729
  function normalizeTimeSeriesTooltipColor(value) {
741
- const color = String(value != null ? value : "").trim();
730
+ const color = String(value ?? "").trim();
742
731
  return SAFE_TOOLTIP_COLOR.test(color) ? color : "currentColor";
743
732
  }
744
733
  function buildTimeSeriesTooltip({
@@ -766,4 +755,4 @@ export {
766
755
  normalizeTimeSeriesTooltipColor,
767
756
  buildTimeSeriesTooltip
768
757
  };
769
- //# sourceMappingURL=chunk-V66QL3TD.js.map
758
+ //# sourceMappingURL=chunk-5MRS4PDD.js.map