serverside_pivot 0.0.91 → 0.0.95

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 (166) hide show
  1. package/README.md +182 -182
  2. package/dist/react/chunks/{ContextMenu-Bt5_3bmD.mjs → ContextMenu-1G-o1ms9.mjs} +52 -49
  3. package/dist/react/chunks/{DetailDrawer-Eb4EpVHG.mjs → DetailDrawer-DCKIxSpW.mjs} +1 -1
  4. package/dist/react/chunks/{DetailSidePanel-BTcHOiKr.mjs → DetailSidePanel-DgUWPBQk.mjs} +1 -1
  5. package/dist/react/chunks/{DetailSurfaceContent-B3ZNKh7q.mjs → DetailSurfaceContent-BEL6xuaZ.mjs} +46 -37
  6. package/dist/react/chunks/{ECharts2dRenderer-C3Qv0uAa.mjs → ECharts2dRenderer-Dgkp9_1P.mjs} +412 -410
  7. package/dist/react/chunks/{ECharts3dRenderer-BB_7-fOt.mjs → ECharts3dRenderer-70VOp8V0.mjs} +2211 -3197
  8. package/dist/react/chunks/{EditSidePanel-C2cAvxlK.mjs → EditSidePanel-CygqVXLX.mjs} +77 -65
  9. package/dist/react/chunks/{InlineDetailPanel-BXLAw1o3.mjs → InlineDetailPanel-BUBRWdFW.mjs} +1 -1
  10. package/dist/react/chunks/{PivotCharts-Bw6Swoa3.mjs → PivotCharts-VX5-mEEp.mjs} +2206 -1396
  11. package/dist/react/chunks/{ReportEditor-D4V0ry2B.mjs → ReportEditor-B5j-CU9-.mjs} +614 -319
  12. package/dist/react/chunks/{SidebarPanel-xO59p_2o.mjs → SidebarPanel-LXUE6nPd.mjs} +1793 -1390
  13. package/dist/react/chunks/{SparklineDetailGraph-Bu85X7OJ.mjs → SparklineDetailGraph-Cfe2KcOp.mjs} +88 -58
  14. package/dist/react/chunks/installCanvasRenderer-C4h5pc1p.mjs +21174 -0
  15. package/dist/react/chunks/react-CDa-ADnG.mjs +31199 -0
  16. package/dist/react/chunks/{xlsx.mini.min-vfxHk3Ry.mjs → xlsx.mini.min-CzdkdH3N.mjs} +5 -5
  17. package/dist/react/components/Charts/ChartRenderers.d.ts +5 -73
  18. package/dist/react/components/Charts/ChartWorkspace.d.ts +3 -34
  19. package/dist/react/components/Charts/ECharts2dRenderer.d.ts +2 -5
  20. package/dist/react/components/Charts/ECharts3dRenderer.d.ts +2 -6
  21. package/dist/react/components/Charts/PivotCharts.d.ts +2 -9
  22. package/dist/react/components/Charts/chartEnhancements.d.ts +17 -66
  23. package/dist/react/components/Charts/chartExportPresentation.d.ts +5 -19
  24. package/dist/react/components/Charts/chartMath.d.ts +4 -4
  25. package/dist/react/components/Charts/useChartExportMenu.d.ts +4 -12
  26. package/dist/react/components/DashTanstackPivot.react.d.ts +36 -0
  27. package/dist/react/components/Filters/ColumnFilter.d.ts +2 -12
  28. package/dist/react/components/Filters/DateRangeFilter.d.ts +2 -7
  29. package/dist/react/components/Filters/FilterPopover.d.ts +2 -13
  30. package/dist/react/components/Filters/MultiSelectFilter.d.ts +2 -11
  31. package/dist/react/components/Filters/NumericRangeFilter.d.ts +2 -7
  32. package/dist/react/components/Notification.d.ts +2 -6
  33. package/dist/react/components/PivotAppBar.d.ts +2 -2
  34. package/dist/react/components/PivotErrorBoundary.d.ts +11 -7
  35. package/dist/react/components/PivotSmallComponents.d.ts +2 -3
  36. package/dist/react/components/PivotWorkspaceCanvas.d.ts +2 -5
  37. package/dist/react/components/PivotWorkspaceControls.d.ts +4 -8
  38. package/dist/react/components/PivotWorkspaceShell.d.ts +4 -12
  39. package/dist/react/components/RuntimeDataError.d.ts +2 -7
  40. package/dist/react/components/Sidebar/ColumnTreeItem.d.ts +2 -13
  41. package/dist/react/components/Sidebar/ReportEditor.d.ts +7 -20
  42. package/dist/react/components/Sidebar/SidebarFilterItem.d.ts +2 -13
  43. package/dist/react/components/Sidebar/SidebarPanel.d.ts +1 -2
  44. package/dist/react/components/Sidebar/ToolPanelSection.d.ts +2 -13
  45. package/dist/react/components/Sidebar/customCategoryUtils.d.ts +31 -62
  46. package/dist/react/components/Sidebar/formulaUtils.d.ts +16 -18
  47. package/dist/react/components/SkeletonRow.d.ts +2 -5
  48. package/dist/react/components/Table/ContextMenu.d.ts +2 -8
  49. package/dist/react/components/Table/DetailDrawer.d.ts +2 -11
  50. package/dist/react/components/Table/DetailSidePanel.d.ts +2 -11
  51. package/dist/react/components/Table/DetailSurfaceContent.d.ts +2 -11
  52. package/dist/react/components/Table/EditSidePanel.d.ts +2 -20
  53. package/dist/react/components/Table/EditableCell.d.ts +2 -28
  54. package/dist/react/components/Table/InlineDetailPanel.d.ts +2 -13
  55. package/dist/react/components/Table/PivotTableBody.d.ts +3 -3
  56. package/dist/react/components/Table/SparklineCell.d.ts +2 -17
  57. package/dist/react/components/Table/SparklineDetailGraph.d.ts +2 -5
  58. package/dist/react/components/Table/StatusBar.d.ts +2 -7
  59. package/dist/react/contexts/PivotConfigContext.d.ts +5 -33
  60. package/dist/react/contexts/PivotThemeContext.d.ts +7 -4
  61. package/dist/react/contexts/PivotValueDisplayContext.d.ts +5 -9
  62. package/dist/react/hooks/useChartState.d.ts +2 -71
  63. package/dist/react/hooks/useColumnDefs.d.ts +3 -68
  64. package/dist/react/hooks/useColumnVirtualizer.d.ts +1 -30
  65. package/dist/react/hooks/useDetailDrillThrough.d.ts +2 -36
  66. package/dist/react/hooks/useFilteredData.d.ts +4 -2
  67. package/dist/react/hooks/useFormatState.d.ts +2 -39
  68. package/dist/react/hooks/usePersistence.d.ts +4 -5
  69. package/dist/react/hooks/usePivotFieldInteractions.d.ts +2 -23
  70. package/dist/react/hooks/usePivotNormalization.d.ts +127 -461
  71. package/dist/react/hooks/usePivotRenderCounter.d.ts +2 -1
  72. package/dist/react/hooks/usePivotTransactions.d.ts +2 -23
  73. package/dist/react/hooks/useRenderHelpers.d.ts +3 -71
  74. package/dist/react/hooks/useReportMode.d.ts +2 -28
  75. package/dist/react/hooks/useRowCache.d.ts +16 -15
  76. package/dist/react/hooks/useRuntimeDataCommit.d.ts +2 -22
  77. package/dist/react/hooks/useRuntimeProfiling.d.ts +2 -13
  78. package/dist/react/hooks/useRuntimeTransport.d.ts +2 -18
  79. package/dist/react/hooks/useServerSideRowModel.d.ts +1 -50
  80. package/dist/react/hooks/useServerSideViewportController.d.ts +1 -64
  81. package/dist/react/hooks/useSidebarUI.d.ts +2 -32
  82. package/dist/react/hooks/useStickyStyles.d.ts +2 -23
  83. package/dist/react/index.mjs +15 -9
  84. package/dist/react/presentation/headerFormatting.d.ts +28 -11
  85. package/dist/react/presentation/safeCellContent.d.ts +22 -5
  86. package/dist/react/react.d.ts +3 -0
  87. package/dist/react/runtime/PivotRuntimeRoot.d.ts +1 -1
  88. package/dist/react/runtime/client/clientPivotTransport.d.ts +5 -1
  89. package/dist/react/runtime/client/clientResponsePostProcessor.d.ts +50 -0
  90. package/dist/react/runtime/client/types.d.ts +5 -0
  91. package/dist/react/runtime/createRuntimeCellPresentation.d.ts +2 -7
  92. package/dist/react/runtime/createRuntimeExportCommands.d.ts +2 -71
  93. package/dist/react/runtime/createRuntimeRowPinCommand.d.ts +2 -9
  94. package/dist/react/runtime/displayColumnOrder.d.ts +4 -4
  95. package/dist/react/runtime/httpTransport.d.ts +1 -0
  96. package/dist/react/runtime/runtime-contract.generated.d.ts +3 -0
  97. package/dist/react/runtime/runtimeContract.d.ts +3 -0
  98. package/dist/react/runtime/runtimeDomains.d.ts +18 -0
  99. package/dist/react/runtime/useChartWorkspacePresentation.d.ts +2 -45
  100. package/dist/react/runtime/useCoreRuntime.d.ts +4 -1
  101. package/dist/react/runtime/useCoreRuntimeStage.d.ts +1 -1
  102. package/dist/react/runtime/useRuntimeCellSelection.d.ts +2 -40
  103. package/dist/react/runtime/useRuntimeChartCanvasCommands.d.ts +7 -31
  104. package/dist/react/runtime/useRuntimeChartCanvasResize.d.ts +2 -13
  105. package/dist/react/runtime/useRuntimeChartCanvasVerticalResize.d.ts +2 -9
  106. package/dist/react/runtime/useRuntimeChartDefinitionCommands.d.ts +2 -14
  107. package/dist/react/runtime/useRuntimeChartFloatingInteractions.d.ts +2 -28
  108. package/dist/react/runtime/useRuntimeChartModels.d.ts +2 -62
  109. package/dist/react/runtime/useRuntimeChartPanelSizing.d.ts +2 -12
  110. package/dist/react/runtime/useRuntimeChartRequestDispatch.d.ts +2 -4
  111. package/dist/react/runtime/useRuntimeClipboardExportPresentation.d.ts +2 -152
  112. package/dist/react/runtime/useRuntimeClipboardPaste.d.ts +2 -7
  113. package/dist/react/runtime/useRuntimeColorScalePresentation.d.ts +2 -55
  114. package/dist/react/runtime/useRuntimeColumnAutoSizing.d.ts +2 -26
  115. package/dist/react/runtime/useRuntimeColumnCommands.d.ts +2 -22
  116. package/dist/react/runtime/useRuntimeColumnMeasurement.d.ts +2 -11
  117. package/dist/react/runtime/useRuntimeDataRetry.d.ts +2 -12
  118. package/dist/react/runtime/useRuntimeDisplayNavigation.d.ts +2 -11
  119. package/dist/react/runtime/useRuntimeEditCellIdentity.d.ts +2 -18
  120. package/dist/react/runtime/useRuntimeEditChangeTracking.d.ts +2 -28
  121. package/dist/react/runtime/useRuntimeEditComparisonState.d.ts +2 -35
  122. package/dist/react/runtime/useRuntimeEditDispatch.d.ts +2 -43
  123. package/dist/react/runtime/useRuntimeEditOwnership.d.ts +2 -28
  124. package/dist/react/runtime/useRuntimeEditPresentation.d.ts +2 -32
  125. package/dist/react/runtime/useRuntimeEditStatePersistence.d.ts +2 -24
  126. package/dist/react/runtime/useRuntimeExportState.d.ts +5 -5
  127. package/dist/react/runtime/useRuntimeFilterPopover.d.ts +2 -19
  128. package/dist/react/runtime/useRuntimeLayoutHistory.d.ts +2 -40
  129. package/dist/react/runtime/useRuntimeOptimisticCellState.d.ts +2 -27
  130. package/dist/react/runtime/useRuntimeRequestSession.d.ts +2 -76
  131. package/dist/react/runtime/useRuntimeResponseLifecycle.d.ts +2 -43
  132. package/dist/react/runtime/useRuntimeResponsePostCommit.d.ts +2 -15
  133. package/dist/react/runtime/useRuntimeRowEditSessions.d.ts +2 -28
  134. package/dist/react/runtime/useRuntimeRowEditing.d.ts +2 -18
  135. package/dist/react/runtime/useRuntimeRowSelection.d.ts +2 -14
  136. package/dist/react/runtime/useRuntimeSelectionFormatting.d.ts +2 -30
  137. package/dist/react/runtime/useRuntimeStructuralSync.d.ts +2 -61
  138. package/dist/react/runtime/useRuntimeViewRestoreScroll.d.ts +2 -5
  139. package/dist/react/runtime/useRuntimeViewSnapshot.d.ts +2 -196
  140. package/dist/react/runtime/useRuntimeViewportTableData.d.ts +2 -23
  141. package/dist/react/runtime/useWorkspaceStatusPresentation.d.ts +2 -109
  142. package/dist/react/utils/Icons.d.ts +2 -45
  143. package/dist/react/utils/chartModelBuilders.d.ts +76 -230
  144. package/dist/react/utils/columnOrder.d.ts +8 -12
  145. package/dist/react/utils/dataBars.d.ts +3 -7
  146. package/dist/react/utils/domEvents.d.ts +1 -1
  147. package/dist/react/utils/editing.d.ts +12 -47
  148. package/dist/react/utils/exportUtils.d.ts +30 -101
  149. package/dist/react/utils/fieldPanelLayout.d.ts +12 -61
  150. package/dist/react/utils/filterOptions.d.ts +4 -4
  151. package/dist/react/utils/helpers.d.ts +16 -18
  152. package/dist/react/utils/horizontalViewport.d.ts +1 -12
  153. package/dist/react/utils/layoutRows.d.ts +3 -3
  154. package/dist/react/utils/measureAxis.d.ts +6 -22
  155. package/dist/react/utils/pivotLayoutUtils.d.ts +3 -2
  156. package/dist/react/utils/pivotProfiler.d.ts +3 -3
  157. package/dist/react/utils/reportEditorSelection.d.ts +1 -23
  158. package/dist/react/utils/rowSpanning.d.ts +3 -6
  159. package/dist/react/utils/savedReports.d.ts +4 -7
  160. package/dist/react/utils/sorting.d.ts +8 -14
  161. package/dist/react/utils/sparklineDetail.d.ts +5 -8
  162. package/dist/react/utils/sparklines.d.ts +10 -78
  163. package/dist/react/utils/styles.d.ts +19 -308
  164. package/package.json +114 -114
  165. package/dist/react/chunks/installCanvasRenderer-B7sfDGoL.mjs +0 -21281
  166. package/dist/react/chunks/react-CPZZxtSo.mjs +0 -26999
@@ -1,6 +1,6 @@
1
1
  import e, { useRef as Fe, useState as _, useLayoutEffect as Hr, useMemo as ot, useEffect as He, useCallback as je } from "react";
2
2
  import { createPortal as un } from "react-dom";
3
- import { C as or, r as Kr, c as pn, a as Wr, n as Yt, e as Wt, t as ge, l as dn, g as Ce, b as xn, d as Fr, f as fn, p as ur, h as Or, i as Yr, j as gr, k as Vr, m as zt, M as _r, o as Xr, q as zr, s as gn, I as mn, u as yn, v as bn, w as Zr, x as qr, y as lr, z as hn, A as vn, V as En, B as Qr, D as Jr, E as kn, F as mr, G as wn, H as Sn, J as Mn, K as An, L as jr, N as Cn, O as $n, P as Wn, Q as Gr, R as zn } from "./react-CPZZxtSo.mjs";
3
+ import { C as or, r as Kr, c as pn, a as Wr, n as Yt, e as Wt, t as ge, l as dn, b as Ce, d as xn, f as Fr, h as fn, p as ur, i as Or, j as Yr, k as gr, m as Vr, o as zt, M as _r, q as Xr, s as zr, u as gn, I as mn, v as yn, w as bn, x as Zr, y as qr, z as lr, A as hn, B as vn, V as En, D as Qr, E as Jr, F as kn, G as mr, H as wn, J as Sn, K as Mn, L as An, N as jr, O as Cn, P as $n, Q as Wn, R as Gr, S as zn } from "./react-CDa-ADnG.mjs";
4
4
  function Bn(t, n, o) {
5
5
  const f = Math.min(n.width, Math.max(0, o.width - 16)), h = Math.max(0, o.height - 8 - t.bottom - 6), S = Math.max(0, t.top - 6 - 8), $ = n.height > h && S > h, R = $ ? S : h, C = Math.min(n.height, R);
6
6
  return {
@@ -87,7 +87,11 @@ const Lr = [
87
87
  const o = [...t];
88
88
  if (n === "alpha_asc") return o.sort((r, f) => String(r.name || "").localeCompare(String(f.name || "")));
89
89
  if (n === "alpha_desc") return o.sort((r, f) => String(f.name || "").localeCompare(String(r.name || "")));
90
- const i = (r) => (r.values || []).reduce((f, h) => f + (Number.isFinite(Number(h)) ? Number(h) : 0), 0);
90
+ const i = (r) => (r.values || []).reduce(
91
+ /** @param {any} [acc] @param {any} [v] @returns {any} */
92
+ (f, h) => f + (Number.isFinite(Number(h)) ? Number(h) : 0),
93
+ 0
94
+ );
91
95
  return n === "value_desc" ? o.sort((r, f) => i(f) - i(r)) : n === "value_asc" ? o.sort((r, f) => i(r) - i(f)) : o;
92
96
  }, Hn = ({ model: t, maxCategories: n, maxSeries: o, theme: i }) => {
93
97
  const r = Array.isArray(t && t.categories) ? t.categories.length : 0, f = Array.isArray(t && t.series) ? t.series.length : 0, h = r >= n * 0.9, S = f >= o * 0.9, $ = r >= n, R = f >= o;
@@ -120,17 +124,23 @@ const Lr = [
120
124
  const r = Array.isArray(t) && t.length > 0 ? t : ["#2563EB", "#F97316", "#0F766E", "#7C3AED", "#DC2626", "#0891B2"], f = ($, R) => {
121
125
  const C = [...r];
122
126
  C[$] = R, n(C);
123
- }, h = () => n([...r, "#888888"]), S = ($) => n(r.filter((R, C) => C !== $));
124
- return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px", alignItems: "center" } }, r.map(($, R) => /* @__PURE__ */ e.createElement("div", { key: R, style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px" } }, /* @__PURE__ */ e.createElement(
125
- "input",
126
- {
127
- type: "color",
128
- value: $,
129
- onChange: (C) => f(R, C.target.value),
130
- style: { width: "28px", height: "28px", padding: 0, border: `1px solid ${o.border}`, borderRadius: "4px", cursor: "pointer", background: "none" },
131
- title: `Color ${R + 1}`
132
- }
133
- ), r.length > 2 && /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => S(R), style: { border: "none", background: "none", color: o.textSec, cursor: "pointer", fontSize: "9px", padding: 0, lineHeight: 1 } }, "✕"))), r.length < 12 && /* @__PURE__ */ e.createElement("button", { type: "button", onClick: h, style: { ...i, padding: "5px 8px", flexShrink: 0 } }, "+")));
127
+ }, h = () => n([...r, "#888888"]), S = ($) => n(r.filter(
128
+ /** @param {any} [_] @param {any} [i] @returns {any} */
129
+ (R, C) => C !== $
130
+ ));
131
+ return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px", alignItems: "center" } }, r.map(
132
+ /** @param {any} [hex] @param {any} [i] @returns {any} */
133
+ ($, R) => /* @__PURE__ */ e.createElement("div", { key: R, style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "2px" } }, /* @__PURE__ */ e.createElement(
134
+ "input",
135
+ {
136
+ type: "color",
137
+ value: $,
138
+ onChange: (C) => f(R, C.target.value),
139
+ style: { width: "28px", height: "28px", padding: 0, border: `1px solid ${o.border}`, borderRadius: "4px", cursor: "pointer", background: "none" },
140
+ title: `Color ${R + 1}`
141
+ }
142
+ ), r.length > 2 && /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => S(R), style: { border: "none", background: "none", color: o.textSec, cursor: "pointer", fontSize: "9px", padding: 0, lineHeight: 1 } }, "✕"))
143
+ ), r.length < 12 && /* @__PURE__ */ e.createElement("button", { type: "button", onClick: h, style: { ...i, padding: "5px 8px", flexShrink: 0 } }, "+")));
134
144
  }, ze = 16, Yn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "1", y: "9", width: "4", height: "6", fill: t, opacity: "0.85", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "6", y: "5", width: "4", height: "10", fill: t, opacity: "0.85", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "11", y: "7", width: "4", height: "8", fill: t, opacity: "0.85", rx: "0.5" })), Vn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("polyline", { points: "1,13 5,7 9,10 15,3", stroke: t, strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ e.createElement("circle", { cx: "1", cy: "13", r: "1.4", fill: t }), /* @__PURE__ */ e.createElement("circle", { cx: "5", cy: "7", r: "1.4", fill: t }), /* @__PURE__ */ e.createElement("circle", { cx: "9", cy: "10", r: "1.4", fill: t }), /* @__PURE__ */ e.createElement("circle", { cx: "15", cy: "3", r: "1.4", fill: t })), _n = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("path", { d: "M8,8 L8,1 A7,7 0 0,1 15,8 Z", fill: t, opacity: "0.9" }), /* @__PURE__ */ e.createElement("path", { d: "M8,8 L15,8 A7,7 0 0,1 6,15 Z", fill: t, opacity: "0.55" }), /* @__PURE__ */ e.createElement("path", { d: "M8,8 L6,15 A7,7 1 1,1 8,1 Z", fill: t, opacity: "0.3" })), Xn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("circle", { cx: "3", cy: "12", r: "1.8", fill: t, opacity: "0.85" }), /* @__PURE__ */ e.createElement("circle", { cx: "7", cy: "5", r: "1.8", fill: t, opacity: "0.85" }), /* @__PURE__ */ e.createElement("circle", { cx: "12", cy: "9", r: "1.8", fill: t, opacity: "0.85" }), /* @__PURE__ */ e.createElement("circle", { cx: "13", cy: "3", r: "1.8", fill: t, opacity: "0.85" }), /* @__PURE__ */ e.createElement("circle", { cx: "5", cy: "11", r: "1.8", fill: t, opacity: "0.85" })), jn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "1", y: "9", width: "4", height: "6", fill: t, opacity: "0.5", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "6", y: "5", width: "4", height: "10", fill: t, opacity: "0.5", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "11", y: "8", width: "4", height: "7", fill: t, opacity: "0.5", rx: "0.5" }), /* @__PURE__ */ e.createElement("polyline", { points: "1,9 5,4 9,7 15,2", stroke: t, strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" })), Gn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "1", y: "4", width: "3", height: "7", fill: t, opacity: "0.85", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "5", y: "8", width: "3", height: "3", fill: t, opacity: "0.5", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "9", y: "5", width: "3", height: "6", fill: t, opacity: "0.85", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "13", y: "10", width: "3", height: "1", fill: t, opacity: "0.4", rx: "0.5" }), /* @__PURE__ */ e.createElement("line", { x1: "0", y1: "15", x2: "16", y2: "15", stroke: t, strokeWidth: "0.7", opacity: "0.35" })), Tn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "2", y: "6", width: "12", height: "5", fill: "none", stroke: t, strokeWidth: "1.2", rx: "1", opacity: "0.85" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "6", x2: "8", y2: "11", stroke: t, strokeWidth: "1.2", opacity: "0.85" }), /* @__PURE__ */ e.createElement("line", { x1: "5", y1: "3", x2: "5", y2: "13", stroke: t, strokeWidth: "1.1", opacity: "0.55" }), /* @__PURE__ */ e.createElement("line", { x1: "11", y1: "3", x2: "11", y2: "13", stroke: t, strokeWidth: "1.1", opacity: "0.55" }), /* @__PURE__ */ e.createElement("line", { x1: "4", y1: "3", x2: "6", y2: "3", stroke: t, strokeWidth: "1.1", opacity: "0.55" }), /* @__PURE__ */ e.createElement("line", { x1: "10", y1: "3", x2: "12", y2: "3", stroke: t, strokeWidth: "1.1", opacity: "0.55" }), /* @__PURE__ */ e.createElement("line", { x1: "4", y1: "13", x2: "6", y2: "13", stroke: t, strokeWidth: "1.1", opacity: "0.55" }), /* @__PURE__ */ e.createElement("line", { x1: "10", y1: "13", x2: "12", y2: "13", stroke: t, strokeWidth: "1.1", opacity: "0.55" })), Un = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("polygon", { points: "8,2 14,6 12,13 4,13 2,6", fill: "none", stroke: t, strokeWidth: "1", opacity: "0.35" }), /* @__PURE__ */ e.createElement("polygon", { points: "8,5 11,7.5 9.5,11 6.5,11 5,7.5", fill: t, opacity: "0.65" })), Kn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "1", y: "1", width: "4", height: "4", fill: t, opacity: "0.9", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "6", y: "1", width: "4", height: "4", fill: t, opacity: "0.4", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "11", y: "1", width: "4", height: "4", fill: t, opacity: "0.7", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "1", y: "6", width: "4", height: "4", fill: t, opacity: "0.3", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "6", y: "6", width: "4", height: "4", fill: t, opacity: "0.85", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "11", y: "6", width: "4", height: "4", fill: t, opacity: "0.5", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "1", y: "11", width: "4", height: "4", fill: t, opacity: "0.6", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "6", y: "11", width: "4", height: "4", fill: t, opacity: "0.95", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "11", y: "11", width: "4", height: "4", fill: t, opacity: "0.35", rx: "0.5" })), Zn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "1", y: "9", width: "5", height: "6", fill: t, opacity: "0.65", rx: "0.5" }), /* @__PURE__ */ e.createElement("rect", { x: "7", y: "4", width: "5", height: "11", fill: t, opacity: "0.85", rx: "0.5" }), /* @__PURE__ */ e.createElement("polygon", { points: "1,9 4,5 9,5 7,9", fill: t, opacity: "0.45" }), /* @__PURE__ */ e.createElement("polygon", { points: "7,4 12,4 12,9 7,9", fill: t, opacity: "0.55" })), qn = ({ color: t }) => /* @__PURE__ */ e.createElement("svg", { width: ze, height: ze, viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ e.createElement("rect", { x: "4", y: "1", width: "8", height: "5", fill: t, opacity: "0.85", rx: "1" }), /* @__PURE__ */ e.createElement("rect", { x: "1", y: "10", width: "6", height: "5", fill: t, opacity: "0.6", rx: "1" }), /* @__PURE__ */ e.createElement("rect", { x: "9", y: "10", width: "6", height: "5", fill: t, opacity: "0.6", rx: "1" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "6", x2: "4", y2: "10", stroke: t, strokeWidth: "1", opacity: "0.45" }), /* @__PURE__ */ e.createElement("line", { x1: "8", y1: "6", x2: "12", y2: "10", stroke: t, strokeWidth: "1", opacity: "0.45" })), Tr = [
135
145
  { name: "Bar", Icon: Yn, types: [{ value: "bar", label: "Bar / Column" }] },
136
146
  { name: "Line / Area", Icon: Vn, types: [{ value: "line", label: "Line" }, { value: "area", label: "Area" }, { value: "sparkline", label: "Sparkline" }] },
@@ -145,58 +155,70 @@ const Lr = [
145
155
  { name: "Hierarchical", Icon: qn, types: [{ value: "icicle", label: "Icicle" }, { value: "sunburst", label: "Sunburst" }, { value: "sankey", label: "Sankey" }], hierarchyOnly: !0 }
146
156
  ], Qn = ({ chartType: t, onChange: n, theme: o, includeHierarchyCharts: i = !0 }) => {
147
157
  const [r, f] = _(null), h = i ? Tr : Tr.filter((S) => !S.hierarchyOnly);
148
- return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "3px" } }, h.map(({ name: S, Icon: $, types: R }) => {
149
- const C = R.some((X) => X.value === t), O = R.find((X) => X.value === t), J = R.length === 1, K = r === S || C, a = C ? o.primary : o.textSec || o.text;
150
- return /* @__PURE__ */ e.createElement("div", { key: S }, /* @__PURE__ */ e.createElement(
151
- "button",
152
- {
153
- type: "button",
154
- "aria-expanded": J ? void 0 : K,
155
- onClick: () => {
156
- J ? n(R[0].value) : f(K && !C ? null : S);
157
- },
158
- style: {
159
- width: "100%",
160
- display: "flex",
161
- alignItems: "center",
162
- gap: "7px",
163
- padding: "5px 8px",
164
- border: `1px solid ${C ? o.primary : o.border}`,
165
- background: C ? o.select : o.headerSubtleBg || o.hover,
166
- color: C ? o.primary : o.text,
167
- borderRadius: o.radiusSm || "8px",
168
- fontSize: "11px",
169
- fontWeight: C ? 700 : 600,
170
- cursor: "pointer",
171
- textAlign: "left"
172
- }
173
- },
174
- /* @__PURE__ */ e.createElement($, { color: a }),
175
- /* @__PURE__ */ e.createElement("span", { style: { flex: 1 } }, O ? O.label : S),
176
- !J && /* @__PURE__ */ e.createElement("span", { style: { fontSize: "8px", color: a, transform: K ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.12s", flexShrink: 0 } }, "▼")
177
- ), !J && K && /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "3px", padding: "4px 0 2px 24px" } }, R.map((X) => /* @__PURE__ */ e.createElement(
178
- "button",
179
- {
180
- key: X.value,
181
- type: "button",
182
- "aria-pressed": t === X.value,
183
- onClick: () => {
184
- n(X.value), f(null);
158
+ return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "3px" } }, h.map(
159
+ /** @param {any} p0 @returns {any} */
160
+ ({ name: S, Icon: $, types: R }) => {
161
+ const C = R.some(
162
+ /** @param {any} [t] @returns {any} */
163
+ (X) => X.value === t
164
+ ), O = R.find(
165
+ /** @param {any} [t] @returns {any} */
166
+ (X) => X.value === t
167
+ ), J = R.length === 1, K = r === S || C, a = C ? o.primary : o.textSec || o.text;
168
+ return /* @__PURE__ */ e.createElement("div", { key: S }, /* @__PURE__ */ e.createElement(
169
+ "button",
170
+ {
171
+ type: "button",
172
+ "aria-expanded": J ? void 0 : K,
173
+ onClick: () => {
174
+ J ? n(R[0].value) : f(K && !C ? null : S);
175
+ },
176
+ style: {
177
+ width: "100%",
178
+ display: "flex",
179
+ alignItems: "center",
180
+ gap: "7px",
181
+ padding: "5px 8px",
182
+ border: `1px solid ${C ? o.primary : o.border}`,
183
+ background: C ? o.select : o.headerSubtleBg || o.hover,
184
+ color: C ? o.primary : o.text,
185
+ borderRadius: o.radiusSm || "8px",
186
+ fontSize: "11px",
187
+ fontWeight: C ? 700 : 600,
188
+ cursor: "pointer",
189
+ textAlign: "left"
190
+ }
185
191
  },
186
- style: {
187
- border: `1px solid ${t === X.value ? o.primary : o.border}`,
188
- background: t === X.value ? o.select : o.headerSubtleBg || o.hover,
189
- color: t === X.value ? o.primary : o.text,
190
- borderRadius: o.radiusSm || "8px",
191
- padding: "4px 9px",
192
- fontSize: "10px",
193
- fontWeight: t === X.value ? 700 : 600,
194
- cursor: "pointer"
195
- }
196
- },
197
- X.label
198
- ))));
199
- }));
192
+ /* @__PURE__ */ e.createElement($, { color: a }),
193
+ /* @__PURE__ */ e.createElement("span", { style: { flex: 1 } }, O ? O.label : S),
194
+ !J && /* @__PURE__ */ e.createElement("span", { style: { fontSize: "8px", color: a, transform: K ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.12s", flexShrink: 0 } }, "▼")
195
+ ), !J && K && /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "3px", padding: "4px 0 2px 24px" } }, R.map(
196
+ /** @param {any} [t] @returns {any} */
197
+ (X) => /* @__PURE__ */ e.createElement(
198
+ "button",
199
+ {
200
+ key: X.value,
201
+ type: "button",
202
+ "aria-pressed": t === X.value,
203
+ onClick: () => {
204
+ n(X.value), f(null);
205
+ },
206
+ style: {
207
+ border: `1px solid ${t === X.value ? o.primary : o.border}`,
208
+ background: t === X.value ? o.select : o.headerSubtleBg || o.hover,
209
+ color: t === X.value ? o.primary : o.text,
210
+ borderRadius: o.radiusSm || "8px",
211
+ padding: "4px 9px",
212
+ fontSize: "10px",
213
+ fontWeight: t === X.value ? 700 : 600,
214
+ cursor: "pointer"
215
+ }
216
+ },
217
+ X.label
218
+ )
219
+ )));
220
+ }
221
+ ));
200
222
  }, Jn = ({ line: t, onUpdate: n, onRemove: o, exportButtonStyle: i, compactInputStyle: r, theme: f }) => /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "4px", alignItems: "center", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement(
201
223
  "button",
202
224
  {
@@ -246,18 +268,50 @@ const Lr = [
246
268
  const r = Number(t), f = Number(n), h = Number.isFinite(r) ? r : Number.isFinite(f) ? f : 430;
247
269
  return Math.max(o, Math.min(i, Math.floor(h)));
248
270
  }, ea = (t) => {
249
- const n = t.map((C, O) => [O, Number(C)]).filter(([, C]) => Number.isFinite(C));
271
+ const n = t.map(
272
+ /** @param {any} [value] @param {any} [index] @returns {any} */
273
+ (C, O) => [O, Number(C)]
274
+ ).filter(
275
+ /** @param {any} p0 @returns {any} */
276
+ ([, C]) => Number.isFinite(C)
277
+ );
250
278
  if (n.length < 2) return null;
251
- const o = n.length, i = n.reduce((C, [O]) => C + O, 0), r = n.reduce((C, [, O]) => C + O, 0), f = n.reduce((C, [O, J]) => C + O * J, 0), h = n.reduce((C, [O]) => C + O * O, 0), S = o * h - i * i;
279
+ const o = n.length, i = n.reduce(
280
+ /** @param {any} sum @param {any} p1 @returns {any} */
281
+ (C, [O]) => C + O,
282
+ 0
283
+ ), r = n.reduce(
284
+ /** @param {any} sum @param {any} p1 @returns {any} */
285
+ (C, [, O]) => C + O,
286
+ 0
287
+ ), f = n.reduce(
288
+ /** @param {any} sum @param {any} p1 @returns {any} */
289
+ (C, [O, J]) => C + O * J,
290
+ 0
291
+ ), h = n.reduce(
292
+ /** @param {any} sum @param {any} p1 @returns {any} */
293
+ (C, [O]) => C + O * O,
294
+ 0
295
+ ), S = o * h - i * i;
252
296
  if (S === 0) return null;
253
297
  const $ = (o * f - i * r) / S, R = (r - $ * i) / o;
254
- return t.map((C, O) => $ * O + R);
298
+ return t.map(
299
+ /** @param {any} [_] @param {any} [index] @returns {any} */
300
+ (C, O) => $ * O + R
301
+ );
255
302
  }, ta = (t, n) => {
256
303
  const o = Math.max(2, Math.floor(Number(n) || 3));
257
- return t.map((i, r) => {
258
- const f = t.slice(Math.max(0, r - o + 1), r + 1).map(Number).filter(Number.isFinite);
259
- return f.length > 0 ? f.reduce((h, S) => h + S, 0) / f.length : null;
260
- });
304
+ return t.map(
305
+ /** @param {any} [_] @param {any} [index] @returns {any} */
306
+ (i, r) => {
307
+ const f = t.slice(Math.max(0, r - o + 1), r + 1).map(Number).filter(Number.isFinite);
308
+ return f.length > 0 ? f.reduce(
309
+ /** @param {any} [sum] @param {any} [value] @returns {any} */
310
+ (h, S) => h + S,
311
+ 0
312
+ ) / f.length : null;
313
+ }
314
+ );
261
315
  }, en = (t) => Array.isArray(t && t.series) && t.series.length > 1, hr = (t, n) => {
262
316
  if (typeof window > "u" || !t) return;
263
317
  const o = window.URL.createObjectURL(t), i = document.createElement("a");
@@ -265,7 +319,10 @@ const Lr = [
265
319
  }, vr = (t = {}) => ({
266
320
  title: String(t.title || "").trim(),
267
321
  legendPosition: t.legendPosition === "top" ? "top" : "bottom",
268
- legendItems: Array.isArray(t.legendItems) ? t.legendItems.filter((n) => n && n.label) : [],
322
+ legendItems: Array.isArray(t.legendItems) ? t.legendItems.filter(
323
+ /** @param {any} [item] @returns {any} */
324
+ (n) => n && n.label
325
+ ) : [],
269
326
  background: t.background || "#ffffff",
270
327
  textColor: t.textColor || "#111827",
271
328
  secondaryTextColor: t.secondaryTextColor || "#4b5563"
@@ -286,10 +343,13 @@ const Lr = [
286
343
  }, tn = (t, n, o) => {
287
344
  const i = [];
288
345
  let r = [], f = 0;
289
- return t.forEach((h) => {
290
- const S = Math.max(48, o(h.label) + 30);
291
- r.length > 0 && f + S > Math.max(80, n - 24) && (i.push(r), r = [], f = 0), r.push({ ...h, width: S }), f += S;
292
- }), r.length > 0 && i.push(r), i;
346
+ return t.forEach(
347
+ /** @param {any} [item] @returns {any} */
348
+ (h) => {
349
+ const S = Math.max(48, o(h.label) + 30);
350
+ r.length > 0 && f + S > Math.max(80, n - 24) && (i.push(r), r = [], f = 0), r.push({ ...h, width: S }), f += S;
351
+ }
352
+ ), r.length > 0 && i.push(r), i;
293
353
  }, br = (t) => {
294
354
  const n = String(t ?? ""), o = typeof t == "string" && /^[=+\-@]/.test(n) ? `'${n}` : n;
295
355
  return o.includes(",") || o.includes('"') || o.includes(`
@@ -298,15 +358,30 @@ const Lr = [
298
358
  if (!t) return;
299
359
  const i = Array.isArray(t.categories) ? t.categories : [], r = Array.isArray(t.series) ? t.series : [];
300
360
  if (i.length === 0 || r.length === 0) return;
301
- const f = ["Category", ...r.map((C) => C.name)].map(br).join(","), h = i.map((C, O) => [C, ...r.map((J) => J.values[O] ?? "")].map(br).join(",")), S = vr(o), $ = S.legendItems.length > 0 ? S.legendItems.map((C) => C.label) : r.map((C) => C.name).filter(Boolean), R = [];
361
+ const f = ["Category", ...r.map(
362
+ /** @param {any} [seriesItem] @returns {any} */
363
+ (C) => C.name
364
+ )].map(br).join(","), h = i.map(
365
+ /** @param {any} [category] @param {any} [index] @returns {any} */
366
+ (C, O) => [C, ...r.map(
367
+ /** @param {any} [seriesItem] @returns {any} */
368
+ (J) => J.values[O] ?? ""
369
+ )].map(br).join(",")
370
+ ), S = vr(o), $ = S.legendItems.length > 0 ? S.legendItems.map(
371
+ /** @param {any} [item] @returns {any} */
372
+ (C) => C.label
373
+ ) : r.map(
374
+ /** @param {any} [item] @returns {any} */
375
+ (C) => C.name
376
+ ).filter(Boolean), R = [];
302
377
  S.title && R.push(["Title", S.title].map(br).join(",")), $.length > 0 && R.push(["Legend", ...$].map(br).join(",")), R.length > 0 && R.push(""), hr(new Blob([`\uFEFF${[...R, f, ...h].join(`
303
378
  `)}`], { type: "text/csv;charset=utf-8" }), `${n}.csv`);
304
379
  }, aa = /* @__PURE__ */ new Set(["bar3d", "line3d", "scatter3d", "range", "boxplot", "nightingale"]), la = /* @__PURE__ */ new Set(["bar3d", "line3d", "scatter3d"]), oa = e.lazy(() => import(
305
380
  /* webpackChunkName: "pivot-echarts-2d" */
306
- "./ECharts2dRenderer-C3Qv0uAa.mjs"
381
+ "./ECharts2dRenderer-Dgkp9_1P.mjs"
307
382
  )), ia = e.lazy(() => import(
308
383
  /* webpackChunkName: "pivot-echarts-3d" */
309
- "./ECharts3dRenderer-BB_7-fOt.mjs"
384
+ "./ECharts3dRenderer-70VOp8V0.mjs"
310
385
  )), nr = ({ chartType: t, echartsRef: n, option: o }) => {
311
386
  const i = la.has(t) ? ia : oa;
312
387
  return /* @__PURE__ */ e.createElement(e.Suspense, { fallback: /* @__PURE__ */ e.createElement("div", { "aria-label": "Loading chart", style: { width: "100%", height: "100%" } }) }, /* @__PURE__ */ e.createElement(i, { echartsRef: n, option: o }));
@@ -325,14 +400,23 @@ const Lr = [
325
400
  } }, t), sa = ({ model: t, theme: n }) => {
326
401
  const o = ot(() => {
327
402
  const r = [];
328
- return (t && t.series ? t.series : []).forEach((f) => {
329
- (f.values || []).forEach((h) => {
330
- typeof h == "number" && Number.isFinite(h) && r.push(h);
331
- });
332
- }), r.length === 0 && t && Array.isArray(t.icicleNodes) && t.icicleNodes.forEach((f) => {
333
- const h = Number(f && f.value);
334
- Number.isFinite(h) && r.push(h);
335
- }), r.length === 0 ? null : {
403
+ return (t && t.series ? t.series : []).forEach(
404
+ /** @param {any} [series] @returns {any} */
405
+ (f) => {
406
+ (f.values || []).forEach(
407
+ /** @param {any} [value] @returns {any} */
408
+ (h) => {
409
+ typeof h == "number" && Number.isFinite(h) && r.push(h);
410
+ }
411
+ );
412
+ }
413
+ ), r.length === 0 && t && Array.isArray(t.icicleNodes) && t.icicleNodes.forEach(
414
+ /** @param {any} [node] @returns {any} */
415
+ (f) => {
416
+ const h = Number(f && f.value);
417
+ Number.isFinite(h) && r.push(h);
418
+ }
419
+ ), r.length === 0 ? null : {
336
420
  categories: Array.isArray(t.categories) ? t.categories.length : 0,
337
421
  seriesCount: Array.isArray(t.series) ? t.series.length : 0,
338
422
  hierarchyNodes: Array.isArray(t.icicleNodes) ? t.icicleNodes.length : 0,
@@ -398,7 +482,10 @@ const Lr = [
398
482
  );
399
483
  }));
400
484
  }, ca = (t, n, o, i = 10) => {
401
- const f = (Array.isArray(t) ? t.map((T) => Number.isFinite(Number(T)) ? Number(T) : null) : []).map((T, V) => T === null ? null : { value: T, index: V }).filter(Boolean);
485
+ const f = (Array.isArray(t) ? t.map((T) => Number.isFinite(Number(T)) ? Number(T) : null) : []).map(
486
+ /** @param {any} [value] @param {any} [index] @returns {any} */
487
+ (T, V) => T === null ? null : { value: T, index: V }
488
+ ).filter(Boolean);
402
489
  if (f.length === 0)
403
490
  return {
404
491
  linePath: "",
@@ -411,14 +498,32 @@ const Lr = [
411
498
  firstValue: null,
412
499
  lastValue: null
413
500
  };
414
- const h = Math.min(...f.map((T) => T.value)), S = Math.max(...f.map((T) => T.value)), $ = Math.max(1, S - h), R = f.length > 1 ? (n - i * 2) / (f.length - 1) : 0, C = f.map((T, V) => {
415
- const Y = i + V * R, F = (T.value - h) / $, U = o - i - F * Math.max(1, o - i * 2);
416
- return {
417
- ...T,
418
- x: Y,
419
- y: U
420
- };
421
- }), O = C.map((T, V) => `${V === 0 ? "M" : "L"} ${T.x.toFixed(2)} ${T.y.toFixed(2)}`).join(" "), J = C.length > 1 ? `${O} L ${C[C.length - 1].x.toFixed(2)} ${(o - i).toFixed(2)} L ${C[0].x.toFixed(2)} ${(o - i).toFixed(2)} Z` : "", K = C.find((T) => T.value === h) || C[0], a = C.find((T) => T.value === S) || C[0], X = C[C.length - 1];
501
+ const h = Math.min(...f.map(
502
+ /** @param {any} [point] @returns {any} */
503
+ (T) => T.value
504
+ )), S = Math.max(...f.map(
505
+ /** @param {any} [point] @returns {any} */
506
+ (T) => T.value
507
+ )), $ = Math.max(1, S - h), R = f.length > 1 ? (n - i * 2) / (f.length - 1) : 0, C = f.map(
508
+ /** @param {any} [point] @param {any} [pointIndex] @returns {any} */
509
+ (T, V) => {
510
+ const Y = i + V * R, F = (T.value - h) / $, U = o - i - F * Math.max(1, o - i * 2);
511
+ return {
512
+ ...T,
513
+ x: Y,
514
+ y: U
515
+ };
516
+ }
517
+ ), O = C.map(
518
+ /** @param {any} [point] @param {any} [pointIndex] @returns {any} */
519
+ (T, V) => `${V === 0 ? "M" : "L"} ${T.x.toFixed(2)} ${T.y.toFixed(2)}`
520
+ ).join(" "), J = C.length > 1 ? `${O} L ${C[C.length - 1].x.toFixed(2)} ${(o - i).toFixed(2)} L ${C[0].x.toFixed(2)} ${(o - i).toFixed(2)} Z` : "", K = C.find(
521
+ /** @param {any} [point] @returns {any} */
522
+ (T) => T.value === h
523
+ ) || C[0], a = C.find(
524
+ /** @param {any} [point] @returns {any} */
525
+ (T) => T.value === S
526
+ ) || C[0], X = C[C.length - 1];
422
527
  return {
423
528
  linePath: O,
424
529
  areaPath: J,
@@ -456,60 +561,66 @@ const Lr = [
456
561
  paddingRight: "2px"
457
562
  }
458
563
  },
459
- h.map((O, J) => {
460
- const K = Ce(J, n, i), a = ca(O.values || [], R, C, 10), X = Array.isArray(O.values) && O.values.length > 1 ? Number(O.values[O.values.length - 2]) : null, T = a.lastValue, V = Number.isFinite(X) && Number.isFinite(T) ? T - X : null, Y = V === null ? n.textSec : V >= 0 ? n.isDark ? "#7DD3A7" : "#2E7D5B" : n.isDark ? "#F7A3A3" : "#B45353";
461
- return /* @__PURE__ */ e.createElement(
462
- "div",
463
- {
464
- key: O.id || O.name || `spark-${J}`,
465
- "data-chart-sparkline-card": O.id || O.name || `spark-${J}`,
466
- style: {
467
- minHeight: `${$}px`,
468
- border: `1px solid ${n.border}`,
469
- borderRadius: n.radiusSm || "10px",
470
- background: n.surfaceBg || n.background || "#fff",
471
- boxShadow: n.shadowInset || "none",
472
- padding: "10px 12px",
473
- display: "flex",
474
- flexDirection: "column",
475
- gap: "8px"
476
- }
477
- },
478
- /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "12px", fontWeight: 800, color: n.text, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }, O.name || `Series ${J + 1}`), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: n.textSec } }, S.length > 0 ? `${S.length} points` : "Trend")), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: "2px", flexShrink: 0 } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "12px", fontWeight: 800, color: n.text } }, T === null ? "—" : zt(T, r)), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: Y } }, V === null ? "No delta" : `${V >= 0 ? "+" : ""}${zt(V, r)}`))),
479
- /* @__PURE__ */ e.createElement(
480
- "svg",
564
+ h.map(
565
+ /** @param {any} [series] @param {any} [index] @returns {any} */
566
+ (O, J) => {
567
+ const K = Ce(J, n, i), a = ca(O.values || [], R, C, 10), X = Array.isArray(O.values) && O.values.length > 1 ? Number(O.values[O.values.length - 2]) : null, T = a.lastValue, V = Number.isFinite(X) && Number.isFinite(T) ? T - X : null, Y = V === null ? n.textSec : V >= 0 ? n.isDark ? "#7DD3A7" : "#2E7D5B" : n.isDark ? "#F7A3A3" : "#B45353";
568
+ return /* @__PURE__ */ e.createElement(
569
+ "div",
481
570
  {
482
- viewBox: `0 0 ${R} ${C}`,
483
- style: { width: "100%", height: "64px", display: "block" },
484
- "aria-label": `${O.name || `Series ${J + 1}`} sparkline`
571
+ key: O.id || O.name || `spark-${J}`,
572
+ "data-chart-sparkline-card": O.id || O.name || `spark-${J}`,
573
+ style: {
574
+ minHeight: `${$}px`,
575
+ border: `1px solid ${n.border}`,
576
+ borderRadius: n.radiusSm || "10px",
577
+ background: n.surfaceBg || n.background || "#fff",
578
+ boxShadow: n.shadowInset || "none",
579
+ padding: "10px 12px",
580
+ display: "flex",
581
+ flexDirection: "column",
582
+ gap: "8px"
583
+ }
485
584
  },
486
- a.areaPath ? /* @__PURE__ */ e.createElement("path", { d: a.areaPath, fill: K, opacity: "0.12" }) : null,
487
- a.linePath ? /* @__PURE__ */ e.createElement(
488
- "path",
585
+ /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { style: { minWidth: 0 } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "12px", fontWeight: 800, color: n.text, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" } }, O.name || `Series ${J + 1}`), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: n.textSec } }, S.length > 0 ? `${S.length} points` : "Trend")), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: "2px", flexShrink: 0 } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "12px", fontWeight: 800, color: n.text } }, T === null ? "—" : zt(T, r)), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: Y } }, V === null ? "No delta" : `${V >= 0 ? "+" : ""}${zt(V, r)}`))),
586
+ /* @__PURE__ */ e.createElement(
587
+ "svg",
489
588
  {
490
- d: a.linePath,
491
- fill: "none",
492
- stroke: K,
493
- strokeWidth: "2.5",
494
- strokeLinecap: "round",
495
- strokeLinejoin: "round"
496
- }
497
- ) : null,
498
- a.minPoint ? /* @__PURE__ */ e.createElement("circle", { cx: a.minPoint.x, cy: a.minPoint.y, r: "2.6", fill: n.surfaceBg || n.background || "#fff", stroke: K, strokeWidth: "1.4", opacity: "0.7" }) : null,
499
- a.maxPoint ? /* @__PURE__ */ e.createElement("circle", { cx: a.maxPoint.x, cy: a.maxPoint.y, r: "2.8", fill: n.surfaceBg || n.background || "#fff", stroke: K, strokeWidth: "1.6", opacity: "0.9" }) : null,
500
- a.currentPoint ? /* @__PURE__ */ e.createElement("circle", { cx: a.currentPoint.x, cy: a.currentPoint.y, r: "3.2", fill: K }) : null,
501
- f.map((F, U) => {
502
- const ue = Number(F.value);
503
- if (!Number.isFinite(ue) || F.orient === "v" || a.minValue === null || a.maxValue === null) return null;
504
- const ne = a.maxValue - a.minValue || 1, ie = C - 10 - (ue - a.minValue) / ne * (C - 20);
505
- if (ie < 0 || ie > C) return null;
506
- const pe = F.color || n.primary;
507
- return /* @__PURE__ */ e.createElement("g", { key: `spark-rl-${U}` }, /* @__PURE__ */ e.createElement("line", { x1: 10, y1: ie, x2: R - 10, y2: ie, stroke: pe, strokeWidth: "1", strokeDasharray: "4 2", style: { pointerEvents: "none" } }), F.label ? /* @__PURE__ */ e.createElement("text", { x: R - 11, y: ie - 2, textAnchor: "end", fontSize: "8", fontWeight: "700", fill: pe, style: { pointerEvents: "none" } }, F.label) : null);
508
- })
509
- ),
510
- /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "8px", fontSize: "10px", color: n.textSec } }, /* @__PURE__ */ e.createElement("span", null, S[0] ? ge(String(S[0]), 14) : "Start"), /* @__PURE__ */ e.createElement("span", null, "Min ", a.minValue === null ? "—" : zt(a.minValue, r), " · ", "Max ", a.maxValue === null ? "—" : zt(a.maxValue, r)), /* @__PURE__ */ e.createElement("span", null, S.length > 0 ? ge(String(S[S.length - 1]), 14) : "End"))
511
- );
512
- })
589
+ viewBox: `0 0 ${R} ${C}`,
590
+ style: { width: "100%", height: "64px", display: "block" },
591
+ "aria-label": `${O.name || `Series ${J + 1}`} sparkline`
592
+ },
593
+ a.areaPath ? /* @__PURE__ */ e.createElement("path", { d: a.areaPath, fill: K, opacity: "0.12" }) : null,
594
+ a.linePath ? /* @__PURE__ */ e.createElement(
595
+ "path",
596
+ {
597
+ d: a.linePath,
598
+ fill: "none",
599
+ stroke: K,
600
+ strokeWidth: "2.5",
601
+ strokeLinecap: "round",
602
+ strokeLinejoin: "round"
603
+ }
604
+ ) : null,
605
+ a.minPoint ? /* @__PURE__ */ e.createElement("circle", { cx: a.minPoint.x, cy: a.minPoint.y, r: "2.6", fill: n.surfaceBg || n.background || "#fff", stroke: K, strokeWidth: "1.4", opacity: "0.7" }) : null,
606
+ a.maxPoint ? /* @__PURE__ */ e.createElement("circle", { cx: a.maxPoint.x, cy: a.maxPoint.y, r: "2.8", fill: n.surfaceBg || n.background || "#fff", stroke: K, strokeWidth: "1.6", opacity: "0.9" }) : null,
607
+ a.currentPoint ? /* @__PURE__ */ e.createElement("circle", { cx: a.currentPoint.x, cy: a.currentPoint.y, r: "3.2", fill: K }) : null,
608
+ f.map(
609
+ /** @param {any} [rl] @param {any} [rli] @returns {any} */
610
+ (F, U) => {
611
+ const ue = Number(F.value);
612
+ if (!Number.isFinite(ue) || F.orient === "v" || a.minValue === null || a.maxValue === null) return null;
613
+ const ne = a.maxValue - a.minValue || 1, ie = C - 10 - (ue - a.minValue) / ne * (C - 20);
614
+ if (ie < 0 || ie > C) return null;
615
+ const pe = F.color || n.primary;
616
+ return /* @__PURE__ */ e.createElement("g", { key: `spark-rl-${U}` }, /* @__PURE__ */ e.createElement("line", { x1: 10, y1: ie, x2: R - 10, y2: ie, stroke: pe, strokeWidth: "1", strokeDasharray: "4 2", style: { pointerEvents: "none" } }), F.label ? /* @__PURE__ */ e.createElement("text", { x: R - 11, y: ie - 2, textAnchor: "end", fontSize: "8", fontWeight: "700", fill: pe, style: { pointerEvents: "none" } }, F.label) : null);
617
+ }
618
+ )
619
+ ),
620
+ /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "8px", fontSize: "10px", color: n.textSec } }, /* @__PURE__ */ e.createElement("span", null, S[0] ? ge(String(S[0]), 14) : "Start"), /* @__PURE__ */ e.createElement("span", null, "Min ", a.minValue === null ? "—" : zt(a.minValue, r), " · ", "Max ", a.maxValue === null ? "—" : zt(a.maxValue, r)), /* @__PURE__ */ e.createElement("span", null, S.length > 0 ? ge(String(S[S.length - 1]), 14) : "End"))
621
+ );
622
+ }
623
+ )
513
624
  );
514
625
  }, pa = ({
515
626
  model: t,
@@ -583,13 +694,19 @@ const Lr = [
583
694
  default:
584
695
  return /* @__PURE__ */ e.createElement("circle", { cx: l, cy: c, r: g, ...m });
585
696
  }
586
- }, ve = ot(() => !Pe || !t || !Array.isArray(t.categories) ? null : t.categories.map((l, c) => {
587
- let s = 0;
588
- return (t.series || []).forEach((p) => {
589
- const x = p.values && p.values[c];
590
- typeof x == "number" && Number.isFinite(x) && (s += Math.abs(x));
591
- }), s || 1;
592
- }), [Pe, t]), bt = Array.isArray(t && t.icicleNodes) ? t.icicleNodes : [], pt = Math.max(1, Number(t && t.icicleDepth) || 1), Ye = Fe(null), [Mt, sr] = _(Wr), Z = Math.max(Wr, Number.isFinite(Mt) ? Math.floor(Mt) : Wr);
697
+ }, ve = ot(() => !Pe || !t || !Array.isArray(t.categories) ? null : t.categories.map(
698
+ /** @param {any} [_] @param {any} [catIndex] @returns {any} */
699
+ (l, c) => {
700
+ let s = 0;
701
+ return (t.series || []).forEach(
702
+ /** @param {any} [s] @returns {any} */
703
+ (p) => {
704
+ const x = p.values && p.values[c];
705
+ typeof x == "number" && Number.isFinite(x) && (s += Math.abs(x));
706
+ }
707
+ ), s || 1;
708
+ }
709
+ ), [Pe, t]), bt = Array.isArray(t && t.icicleNodes) ? t.icicleNodes : [], pt = Math.max(1, Number(t && t.icicleDepth) || 1), Ye = Fe(null), [Mt, sr] = _(Wr), Z = Math.max(Wr, Number.isFinite(Mt) ? Math.floor(Mt) : Wr);
593
710
  He(() => {
594
711
  const l = Ye.current;
595
712
  if (!l) return;
@@ -602,14 +719,20 @@ const Lr = [
602
719
  return s.observe(l), () => s.disconnect();
603
720
  }, []);
604
721
  const [ee, Dt] = _(/* @__PURE__ */ new Set()), Qe = je((l) => {
605
- Dt((c) => {
606
- const s = new Set(c);
607
- return s.has(l) ? s.delete(l) : s.add(l), s;
608
- });
722
+ Dt(
723
+ /** @param {any} [prev] @returns {any} */
724
+ (c) => {
725
+ const s = new Set(c);
726
+ return s.has(l) ? s.delete(l) : s.add(l), s;
727
+ }
728
+ );
609
729
  }, []), [$e, Ue] = _(null), Ke = je((l) => {
610
730
  const c = l.target, s = c.getAttribute("data-tip-cat");
611
731
  if (!s) {
612
- Ue((g) => g && null);
732
+ Ue(
733
+ /** @param {any} [prev] @returns {any} */
734
+ (g) => g && null
735
+ );
613
736
  return;
614
737
  }
615
738
  const x = l.currentTarget.getBoundingClientRect();
@@ -648,10 +771,13 @@ const Lr = [
648
771
  boxShadow: "0 4px 12px rgba(0,0,0,0.15)",
649
772
  whiteSpace: "nowrap"
650
773
  } }, /* @__PURE__ */ e.createElement("div", { style: { fontWeight: 800, marginBottom: $e.series ? "2px" : 0 } }, $e.category), $e.series ? /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px" } }, $e.color ? /* @__PURE__ */ e.createElement("span", { style: { width: "8px", height: "8px", borderRadius: "50%", background: $e.color, flexShrink: 0 } }) : null, /* @__PURE__ */ e.createElement("span", null, $e.series, ": ", $e.value)) : $e.value ? /* @__PURE__ */ e.createElement("div", null, $e.value) : null) : null, [Le, _t] = _(1), [at, Re] = _({ x: 0, y: 0 }), Je = Fe(null), [vt, Et] = _(null), lt = je((l) => {
651
- l.preventDefault(), _t((c) => {
652
- const s = l.deltaY < 0 ? c * 1.15 : c / 1.15, p = Math.min(10, Math.max(1, s));
653
- return p === 1 && Re({ x: 0, y: 0 }), p;
654
- });
774
+ l.preventDefault(), _t(
775
+ /** @param {any} [prev] @returns {any} */
776
+ (c) => {
777
+ const s = l.deltaY < 0 ? c * 1.15 : c / 1.15, p = Math.min(10, Math.max(1, s));
778
+ return p === 1 && Re({ x: 0, y: 0 }), p;
779
+ }
780
+ );
655
781
  }, []), Ze = je((l) => {
656
782
  Le <= 1 || l.button !== 0 || (Je.current = { startX: l.clientX, startY: l.clientY, startPan: { ...at } });
657
783
  }, [Le, at]), xt = je((l) => {
@@ -770,29 +896,60 @@ const Lr = [
770
896
  } }, Y)
771
897
  ) : null, d = ot(() => {
772
898
  if (n === "heatmap" || n === "icicle" || n === "sunburst" || n === "sankey" || n === "pie" || n === "donut" || n === "scatter" || n === "waterfall" || n === "combo" || n === "sparkline" || n === "bubble" || n === "radar" || n === "funnel" || n === "histogram" || aa.has(n)) return null;
773
- const l = Oe ? (t.stackedGroups || []).reduce((L, ce) => {
774
- let oe = 0, ae = 0;
775
- return (ce.segments || []).forEach((N) => {
776
- const re = N && typeof N.value == "number" && Number.isFinite(N.value) ? N.value : null;
777
- re !== null && (re >= 0 ? oe += re : ae += re);
778
- }), L.push(oe, ae), L;
779
- }, []) : Lt ? (t.categories || []).reduce((L, ce, oe) => {
780
- let ae = 0, N = 0;
781
- return (t.series || []).forEach((re) => {
782
- const fe = re && Array.isArray(re.values) ? re.values[oe] : null;
783
- typeof fe != "number" || !Number.isFinite(fe) || (fe >= 0 ? ae += fe : N += fe);
784
- }), L.push(ae, N), L;
785
- }, []) : yt ? t.categories.reduce((L, ce, oe) => {
786
- let ae = 0, N = 0;
787
- return (t.series || []).forEach((re) => {
788
- const fe = re && Array.isArray(re.values) ? re.values[oe] : null;
789
- typeof fe != "number" || !Number.isFinite(fe) || (fe >= 0 ? ae += fe : N += fe);
790
- }), L.push(ae, N), L;
791
- }, []) : (t.series || []).reduce((L, ce) => ((ce.values || []).forEach((oe) => {
792
- typeof oe == "number" && Number.isFinite(oe) && L.push(oe);
793
- }), L), []);
899
+ const l = Oe ? (t.stackedGroups || []).reduce(
900
+ /** @param {any} [acc] @param {any} [group] @returns {any} */
901
+ (L, ce) => {
902
+ let oe = 0, ae = 0;
903
+ return (ce.segments || []).forEach(
904
+ /** @param {any} [segment] @returns {any} */
905
+ (N) => {
906
+ const re = N && typeof N.value == "number" && Number.isFinite(N.value) ? N.value : null;
907
+ re !== null && (re >= 0 ? oe += re : ae += re);
908
+ }
909
+ ), L.push(oe, ae), L;
910
+ },
911
+ []
912
+ ) : Lt ? (t.categories || []).reduce(
913
+ /** @param {any} [acc] @param {any} [_] @param {any} [categoryIndex] @returns {any} */
914
+ (L, ce, oe) => {
915
+ let ae = 0, N = 0;
916
+ return (t.series || []).forEach(
917
+ /** @param {any} [series] @returns {any} */
918
+ (re) => {
919
+ const fe = re && Array.isArray(re.values) ? re.values[oe] : null;
920
+ typeof fe != "number" || !Number.isFinite(fe) || (fe >= 0 ? ae += fe : N += fe);
921
+ }
922
+ ), L.push(ae, N), L;
923
+ },
924
+ []
925
+ ) : yt ? t.categories.reduce(
926
+ /** @param {any} [acc] @param {any} [_] @param {any} [categoryIndex] @returns {any} */
927
+ (L, ce, oe) => {
928
+ let ae = 0, N = 0;
929
+ return (t.series || []).forEach(
930
+ /** @param {any} [series] @returns {any} */
931
+ (re) => {
932
+ const fe = re && Array.isArray(re.values) ? re.values[oe] : null;
933
+ typeof fe != "number" || !Number.isFinite(fe) || (fe >= 0 ? ae += fe : N += fe);
934
+ }
935
+ ), L.push(ae, N), L;
936
+ },
937
+ []
938
+ ) : (t.series || []).reduce(
939
+ /** @param {any} [acc] @param {any} [series] @returns {any} */
940
+ (L, ce) => ((ce.values || []).forEach(
941
+ /** @param {any} [value] @returns {any} */
942
+ (oe) => {
943
+ typeof oe == "number" && Number.isFinite(oe) && L.push(oe);
944
+ }
945
+ ), L),
946
+ []
947
+ );
794
948
  if (l.length === 0) return null;
795
- const c = !Oe && n === "bar" && Array.isArray(t.categoryBands) && t.categoryBands.length === t.categories.length && t.categoryBands.some((L) => L && L.outerLabel);
949
+ const c = !Oe && n === "bar" && Array.isArray(t.categoryBands) && t.categoryBands.length === t.categories.length && t.categoryBands.some(
950
+ /** @param {any} [band] @returns {any} */
951
+ (L) => L && L.outerLabel
952
+ );
796
953
  let s = Math.min(...l, 0), p = Math.max(...l, 0);
797
954
  if (Pe)
798
955
  s = 0, p = 100;
@@ -803,10 +960,43 @@ const Lr = [
803
960
  }
804
961
  Number.isFinite(Number(a)) && a !== "" && (s = Number(a)), Number.isFinite(Number(X)) && X !== "" && (p = Number(X)), s >= p && (p = s + 1);
805
962
  }
806
- const g = Yt(s, p, 5).map((L) => Pe ? `${Math.round(L)}%` : P(L)).reduce((L, ce) => Math.max(L, Wt(ce)), 0), E = Oe ? (t.stackedGroups || []).map((L) => ge(L && L.label, 22)) : c ? (t.categoryBands || []).map((L) => ge(L && L.innerLabel, 18)) : (t.categories || []).map((L) => ge(L, 22)), m = c ? (t.categoryBands || []).map((L) => ge(L && L.outerLabel, 18)) : [], w = E.reduce((L, ce) => Math.max(L, Wt(ce)), 0), k = m.reduce((L, ce) => Math.max(L, Wt(ce, 11)), 0), y = ut ? Math.max(
963
+ const g = Yt(s, p, 5).map(
964
+ /** @param {any} [v] @returns {any} */
965
+ (L) => Pe ? `${Math.round(L)}%` : P(L)
966
+ ).reduce(
967
+ /** @param {any} [maxWidth] @param {any} [label] @returns {any} */
968
+ (L, ce) => Math.max(L, Wt(ce)),
969
+ 0
970
+ ), E = Oe ? (t.stackedGroups || []).map(
971
+ /** @param {any} [group] @returns {any} */
972
+ (L) => ge(L && L.label, 22)
973
+ ) : c ? (t.categoryBands || []).map(
974
+ /** @param {any} [band] @returns {any} */
975
+ (L) => ge(L && L.innerLabel, 18)
976
+ ) : (t.categories || []).map(
977
+ /** @param {any} [category] @returns {any} */
978
+ (L) => ge(L, 22)
979
+ ), m = c ? (t.categoryBands || []).map(
980
+ /** @param {any} [band] @returns {any} */
981
+ (L) => ge(L && L.outerLabel, 18)
982
+ ) : [], w = E.reduce(
983
+ /** @param {any} [maxWidth] @param {any} [label] @returns {any} */
984
+ (L, ce) => Math.max(L, Wt(ce)),
985
+ 0
986
+ ), k = m.reduce(
987
+ /** @param {any} [maxWidth] @param {any} [label] @returns {any} */
988
+ (L, ce) => Math.max(L, Wt(ce, 11)),
989
+ 0
990
+ ), y = ut ? Math.max(
807
991
  c ? 176 : 132,
808
992
  c ? k + w + 38 : w + 22
809
- ) : Math.max(66, g + 18), I = ke === 0 ? 40 : ke <= 30 ? 62 : ke <= 45 ? 80 : ke <= 60 ? 98 : 118, j = ut ? { top: 24, right: 18, bottom: 42, left: y } : { top: 24, right: 18, bottom: c ? 118 : I, left: y }, M = Z - j.left - j.right, v = W - j.top - j.bottom, B = n === "bar" ? 0 : Math.min(Math.max(0, s), p), D = p - s || 1, H = ut ? null : ((L) => j.top + (p - L) / D * v), G = ut ? ((L) => j.left + (L - s) / D * M) : null, se = H ? H(B) : null, b = G ? G(B) : null, q = Math.max(t.categories.length, 1), le = (ut ? v : M) / q, A = Math.max(10, le * 0.72);
993
+ ) : Math.max(66, g + 18), I = ke === 0 ? 40 : ke <= 30 ? 62 : ke <= 45 ? 80 : ke <= 60 ? 98 : 118, j = ut ? { top: 24, right: 18, bottom: 42, left: y } : { top: 24, right: 18, bottom: c ? 118 : I, left: y }, M = Z - j.left - j.right, v = W - j.top - j.bottom, B = n === "bar" ? 0 : Math.min(Math.max(0, s), p), D = p - s || 1, H = ut ? null : (
994
+ /** @param {any} [value] @returns {any} */
995
+ ((L) => j.top + (p - L) / D * v)
996
+ ), G = ut ? (
997
+ /** @param {any} [value] @returns {any} */
998
+ ((L) => j.left + (L - s) / D * M)
999
+ ) : null, se = H ? H(B) : null, b = G ? G(B) : null, q = Math.max(t.categories.length, 1), le = (ut ? v : M) / q, A = Math.max(10, le * 0.72);
810
1000
  return {
811
1001
  margin: j,
812
1002
  plotWidth: M,
@@ -827,7 +1017,11 @@ const Lr = [
827
1017
  return { visibleIndexes: null, maxChars: 20, stride: 1 };
828
1018
  const l = Array.isArray(t && t.categories) ? t.categories : [];
829
1019
  if (l.length <= 1) return { visibleIndexes: null, maxChars: 20, stride: 1 };
830
- const c = d.step < 42 ? 12 : d.step < 70 ? 16 : 20, s = l.reduce((k, y) => Math.max(k, Wt(ge(y, c), 11)), 0), p = Math.abs(ke) * (Math.PI / 180), x = ke === 0 ? s : Math.abs(Math.cos(p)) * s + Math.abs(Math.sin(p)) * 12, g = Math.max(1, Math.ceil((x + 12) / Math.max(d.step, 1)));
1020
+ const c = d.step < 42 ? 12 : d.step < 70 ? 16 : 20, s = l.reduce(
1021
+ /** @param {any} [width] @param {any} [category] @returns {any} */
1022
+ (k, y) => Math.max(k, Wt(ge(y, c), 11)),
1023
+ 0
1024
+ ), p = Math.abs(ke) * (Math.PI / 180), x = ke === 0 ? s : Math.abs(Math.cos(p)) * s + Math.abs(Math.sin(p)) * 12, g = Math.max(1, Math.ceil((x + 12) / Math.max(d.step, 1)));
831
1025
  if (g === 1) return { visibleIndexes: null, maxChars: c, stride: g };
832
1026
  const E = /* @__PURE__ */ new Set();
833
1027
  for (let k = 0; k < l.length; k += g) E.add(k);
@@ -879,49 +1073,52 @@ const Lr = [
879
1073
  role: "img",
880
1074
  "aria-label": t.title || "Icicle chart"
881
1075
  },
882
- c.map((s, p) => {
883
- const x = Ce(Math.max(0, s.depth - 1), r, Ee), g = s.width >= 54;
884
- return /* @__PURE__ */ e.createElement(
885
- "g",
886
- {
887
- key: `icicle-node-${s.rowPath || p}`,
888
- onClick: () => {
889
- typeof $ == "function" && $(s);
890
- },
891
- style: typeof $ == "function" ? { cursor: "pointer" } : void 0
892
- },
893
- /* @__PURE__ */ e.createElement(
894
- "rect",
895
- {
896
- x: s.x,
897
- y: s.y,
898
- width: Math.max(1, s.width - 1),
899
- height: Math.max(20, s.height - 2),
900
- rx: "4",
901
- fill: x,
902
- opacity: "0.86",
903
- stroke: r.surfaceBg || r.background || "#fff",
904
- strokeWidth: "1",
905
- "data-tip-cat": s.label || "",
906
- "data-tip-val": typeof s.value == "number" ? P(s.value) : "",
907
- "data-tip-color": x
908
- }
909
- ),
910
- g ? /* @__PURE__ */ e.createElement(
911
- "text",
1076
+ c.map(
1077
+ /** @param {any} [node] @param {any} [index] @returns {any} */
1078
+ (s, p) => {
1079
+ const x = Ce(Math.max(0, s.depth - 1), r, Ee), g = s.width >= 54;
1080
+ return /* @__PURE__ */ e.createElement(
1081
+ "g",
912
1082
  {
913
- x: s.x + 8,
914
- y: s.y + Math.min(s.height - 10, 22),
915
- textAnchor: "start",
916
- fontSize: "11",
917
- fontWeight: "700",
918
- fill: "#fff",
919
- style: { pointerEvents: "none" }
1083
+ key: `icicle-node-${s.rowPath || p}`,
1084
+ onClick: () => {
1085
+ typeof $ == "function" && $(s);
1086
+ },
1087
+ style: typeof $ == "function" ? { cursor: "pointer" } : void 0
920
1088
  },
921
- ge(s.label, Math.max(6, Math.floor(s.width / 9)))
922
- ) : null
923
- );
924
- })
1089
+ /* @__PURE__ */ e.createElement(
1090
+ "rect",
1091
+ {
1092
+ x: s.x,
1093
+ y: s.y,
1094
+ width: Math.max(1, s.width - 1),
1095
+ height: Math.max(20, s.height - 2),
1096
+ rx: "4",
1097
+ fill: x,
1098
+ opacity: "0.86",
1099
+ stroke: r.surfaceBg || r.background || "#fff",
1100
+ strokeWidth: "1",
1101
+ "data-tip-cat": s.label || "",
1102
+ "data-tip-val": typeof s.value == "number" ? P(s.value) : "",
1103
+ "data-tip-color": x
1104
+ }
1105
+ ),
1106
+ g ? /* @__PURE__ */ e.createElement(
1107
+ "text",
1108
+ {
1109
+ x: s.x + 8,
1110
+ y: s.y + Math.min(s.height - 10, 22),
1111
+ textAnchor: "start",
1112
+ fontSize: "11",
1113
+ fontWeight: "700",
1114
+ fill: "#fff",
1115
+ style: { pointerEvents: "none" }
1116
+ },
1117
+ ge(s.label, Math.max(6, Math.floor(s.width / 9)))
1118
+ ) : null
1119
+ );
1120
+ }
1121
+ )
925
1122
  ), De, we, Ie, Xe));
926
1123
  }
927
1124
  if (n === "sunburst") {
@@ -943,52 +1140,58 @@ const Lr = [
943
1140
  role: "img",
944
1141
  "aria-label": t.title || "Sunburst chart"
945
1142
  },
946
- x.map((g, E) => {
947
- const m = Ce(Math.max(0, g.depth - 1), r, Ee), w = Fr(c, s, g.innerRadius, g.outerRadius, g.startAngle, g.endAngle), k = g.startAngle + (g.endAngle - g.startAngle) / 2, y = g.innerRadius + (g.outerRadius - g.innerRadius) / 2, I = ur(c, s, y, k), j = g.endAngle - g.startAngle, M = j > 0.2 && g.outerRadius - g.innerRadius >= 18;
948
- return /* @__PURE__ */ e.createElement(
949
- "g",
950
- {
951
- key: `sunburst-node-${g.rowPath || E}`,
952
- onClick: () => {
953
- typeof $ == "function" && $(g);
954
- },
955
- style: typeof $ == "function" ? { cursor: "pointer" } : void 0
956
- },
957
- /* @__PURE__ */ e.createElement(
958
- "path",
959
- {
960
- d: w,
961
- fill: m,
962
- opacity: "0.88",
963
- stroke: r.surfaceBg || r.background || "#fff",
964
- strokeWidth: "1",
965
- "data-tip-cat": g.label || "",
966
- "data-tip-val": typeof g.value == "number" ? P(g.value) : "",
967
- "data-tip-color": m
968
- }
969
- ),
970
- M ? /* @__PURE__ */ e.createElement(
971
- "text",
1143
+ x.map(
1144
+ /** @param {any} [node] @param {any} [index] @returns {any} */
1145
+ (g, E) => {
1146
+ const m = Ce(Math.max(0, g.depth - 1), r, Ee), w = Fr(c, s, g.innerRadius, g.outerRadius, g.startAngle, g.endAngle), k = g.startAngle + (g.endAngle - g.startAngle) / 2, y = g.innerRadius + (g.outerRadius - g.innerRadius) / 2, I = ur(c, s, y, k), j = g.endAngle - g.startAngle, M = j > 0.2 && g.outerRadius - g.innerRadius >= 18;
1147
+ return /* @__PURE__ */ e.createElement(
1148
+ "g",
972
1149
  {
973
- x: I.x,
974
- y: I.y,
975
- textAnchor: "middle",
976
- fontSize: "10",
977
- fontWeight: "700",
978
- fill: "#fff",
979
- style: { pointerEvents: "none" }
1150
+ key: `sunburst-node-${g.rowPath || E}`,
1151
+ onClick: () => {
1152
+ typeof $ == "function" && $(g);
1153
+ },
1154
+ style: typeof $ == "function" ? { cursor: "pointer" } : void 0
980
1155
  },
981
- ge(g.label, Math.max(5, Math.floor(j * 24)))
982
- ) : null
983
- );
984
- })
1156
+ /* @__PURE__ */ e.createElement(
1157
+ "path",
1158
+ {
1159
+ d: w,
1160
+ fill: m,
1161
+ opacity: "0.88",
1162
+ stroke: r.surfaceBg || r.background || "#fff",
1163
+ strokeWidth: "1",
1164
+ "data-tip-cat": g.label || "",
1165
+ "data-tip-val": typeof g.value == "number" ? P(g.value) : "",
1166
+ "data-tip-color": m
1167
+ }
1168
+ ),
1169
+ M ? /* @__PURE__ */ e.createElement(
1170
+ "text",
1171
+ {
1172
+ x: I.x,
1173
+ y: I.y,
1174
+ textAnchor: "middle",
1175
+ fontSize: "10",
1176
+ fontWeight: "700",
1177
+ fill: "#fff",
1178
+ style: { pointerEvents: "none" }
1179
+ },
1180
+ ge(g.label, Math.max(5, Math.floor(j * 24)))
1181
+ ) : null
1182
+ );
1183
+ }
1184
+ )
985
1185
  ), De, we, Ie, Xe));
986
1186
  }
987
1187
  if (n === "sankey") {
988
1188
  const l = Array.isArray(t && t.sankeyNodes) ? t.sankeyNodes : [], c = Array.isArray(t && t.sankeyLinks) ? t.sankeyLinks : [];
989
1189
  if (l.length === 0 || c.length === 0)
990
1190
  return /* @__PURE__ */ e.createElement(Se, { message: "Sankey charts need expanded hierarchical rows with child flows.", theme: r, chartHeight: W });
991
- const s = fn(l, c, Z, W), p = s.nodes.length > 0 ? Math.max(...s.nodes.map((x) => x.x)) : 0;
1191
+ const s = fn(l, c, Z, W), p = s.nodes.length > 0 ? Math.max(...s.nodes.map(
1192
+ /** @param {any} [n] @returns {any} */
1193
+ (x) => x.x
1194
+ )) : 0;
992
1195
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative" }, ...We }, /* @__PURE__ */ e.createElement(
993
1196
  "svg",
994
1197
  {
@@ -1005,89 +1208,111 @@ const Lr = [
1005
1208
  role: "img",
1006
1209
  "aria-label": t.title || "Sankey chart"
1007
1210
  },
1008
- s.links.map((x, g) => {
1009
- const E = x.sourceNode.x + x.sourceNode.width, m = x.targetNode.x, w = E + (m - E) / 2, k = [
1010
- `M ${E} ${x.sourceY}`,
1011
- `C ${w} ${x.sourceY}, ${w} ${x.targetY}, ${m} ${x.targetY}`
1012
- ].join(" ");
1013
- return /* @__PURE__ */ e.createElement(
1014
- "path",
1015
- {
1016
- key: `sankey-link-${x.source}-${x.target}-${g}`,
1017
- d: k,
1018
- fill: "none",
1019
- stroke: r.primary,
1020
- strokeOpacity: "0.22",
1021
- strokeWidth: x.thickness,
1022
- "data-tip-cat": `${x.sourceNode.label || ""} → ${x.targetNode.label || ""}`,
1023
- "data-tip-val": typeof x.value == "number" ? P(x.value) : ""
1024
- }
1025
- );
1026
- }),
1027
- s.nodes.map((x, g) => {
1028
- const E = Ce(Math.max(0, x.depth - 1), r, Ee);
1029
- return /* @__PURE__ */ e.createElement(
1030
- "g",
1031
- {
1032
- key: `sankey-node-${x.rowPath || g}`,
1033
- onClick: () => {
1034
- typeof $ == "function" && $(x);
1035
- },
1036
- style: typeof $ == "function" ? { cursor: "pointer" } : void 0
1037
- },
1038
- /* @__PURE__ */ e.createElement(
1039
- "rect",
1211
+ s.links.map(
1212
+ /** @param {any} [link] @param {any} [index] @returns {any} */
1213
+ (x, g) => {
1214
+ const E = x.sourceNode.x + x.sourceNode.width, m = x.targetNode.x, w = E + (m - E) / 2, k = [
1215
+ `M ${E} ${x.sourceY}`,
1216
+ `C ${w} ${x.sourceY}, ${w} ${x.targetY}, ${m} ${x.targetY}`
1217
+ ].join(" ");
1218
+ return /* @__PURE__ */ e.createElement(
1219
+ "path",
1040
1220
  {
1041
- x: x.x,
1042
- y: x.y,
1043
- width: x.width,
1044
- height: x.height,
1045
- rx: "4",
1046
- fill: E,
1047
- opacity: "0.92",
1048
- stroke: r.surfaceBg || r.background || "#fff",
1049
- strokeWidth: "1",
1050
- "data-tip-cat": x.label || "",
1051
- "data-tip-val": typeof x.value == "number" ? P(x.value) : "",
1052
- "data-tip-color": E
1221
+ key: `sankey-link-${x.source}-${x.target}-${g}`,
1222
+ d: k,
1223
+ fill: "none",
1224
+ stroke: r.primary,
1225
+ strokeOpacity: "0.22",
1226
+ strokeWidth: x.thickness,
1227
+ "data-tip-cat": `${x.sourceNode.label || ""} → ${x.targetNode.label || ""}`,
1228
+ "data-tip-val": typeof x.value == "number" ? P(x.value) : ""
1053
1229
  }
1054
- ),
1055
- /* @__PURE__ */ e.createElement(
1056
- "text",
1230
+ );
1231
+ }
1232
+ ),
1233
+ s.nodes.map(
1234
+ /** @param {any} [node] @param {any} [index] @returns {any} */
1235
+ (x, g) => {
1236
+ const E = Ce(Math.max(0, x.depth - 1), r, Ee);
1237
+ return /* @__PURE__ */ e.createElement(
1238
+ "g",
1057
1239
  {
1058
- x: x.x === p ? x.x - 6 : x.x + x.width + 6,
1059
- y: x.y + Math.min(x.height / 2 + 4, x.height - 4),
1060
- textAnchor: x.x === p ? "end" : "start",
1061
- fontSize: "11",
1062
- fill: r.text,
1063
- fontWeight: "700",
1064
- style: { pointerEvents: "none" }
1240
+ key: `sankey-node-${x.rowPath || g}`,
1241
+ onClick: () => {
1242
+ typeof $ == "function" && $(x);
1243
+ },
1244
+ style: typeof $ == "function" ? { cursor: "pointer" } : void 0
1065
1245
  },
1066
- ge(x.label, 24)
1067
- )
1068
- );
1069
- })
1246
+ /* @__PURE__ */ e.createElement(
1247
+ "rect",
1248
+ {
1249
+ x: x.x,
1250
+ y: x.y,
1251
+ width: x.width,
1252
+ height: x.height,
1253
+ rx: "4",
1254
+ fill: E,
1255
+ opacity: "0.92",
1256
+ stroke: r.surfaceBg || r.background || "#fff",
1257
+ strokeWidth: "1",
1258
+ "data-tip-cat": x.label || "",
1259
+ "data-tip-val": typeof x.value == "number" ? P(x.value) : "",
1260
+ "data-tip-color": E
1261
+ }
1262
+ ),
1263
+ /* @__PURE__ */ e.createElement(
1264
+ "text",
1265
+ {
1266
+ x: x.x === p ? x.x - 6 : x.x + x.width + 6,
1267
+ y: x.y + Math.min(x.height / 2 + 4, x.height - 4),
1268
+ textAnchor: x.x === p ? "end" : "start",
1269
+ fontSize: "11",
1270
+ fill: r.text,
1271
+ fontWeight: "700",
1272
+ style: { pointerEvents: "none" }
1273
+ },
1274
+ ge(x.label, 24)
1275
+ )
1276
+ );
1277
+ }
1278
+ )
1070
1279
  ), De, we, Ie, Xe));
1071
1280
  }
1072
1281
  if (n === "pie" || n === "donut") {
1073
1282
  const l = Array.isArray(t && t.series) && t.series.length > 0 ? t.series[0] : null, c = Array.isArray(t && t.categories) ? t.categories : [];
1074
1283
  if (!l || c.length === 0)
1075
1284
  return /* @__PURE__ */ e.createElement(Se, { message: "Pie charts need categories and at least one numeric measure.", theme: r, chartHeight: W });
1076
- const s = c.map((M, v) => {
1077
- const B = l.values[v], D = typeof B == "number" && Number.isFinite(B) ? B : 0;
1078
- return { category: M, value: Math.abs(D), originalValue: D, index: v };
1079
- }).filter((M) => M.value > 0 && !ee.has(M.category)), p = s.reduce((M, v) => M + v.value, 0);
1285
+ const s = c.map(
1286
+ /** @param {any} [category] @param {any} [index] @returns {any} */
1287
+ (M, v) => {
1288
+ const B = l.values[v], D = typeof B == "number" && Number.isFinite(B) ? B : 0;
1289
+ return { category: M, value: Math.abs(D), originalValue: D, index: v };
1290
+ }
1291
+ ).filter(
1292
+ /** @param {any} [slice] @returns {any} */
1293
+ (M) => M.value > 0 && !ee.has(M.category)
1294
+ ), p = s.reduce(
1295
+ /** @param {any} [sum] @param {any} [slice] @returns {any} */
1296
+ (M, v) => M + v.value,
1297
+ 0
1298
+ );
1080
1299
  if (p === 0)
1081
1300
  return /* @__PURE__ */ e.createElement(Se, { message: "All values are zero — nothing to display.", theme: r, chartHeight: W });
1082
1301
  const x = n === "donut", g = Math.min(Z, W) / 2 - 24, E = x ? g * 0.52 : 0, m = Z / 2, w = W / 2, k = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [];
1083
1302
  let y = -Math.PI / 2;
1084
- const I = s.map((M) => {
1085
- const v = M.value / p, B = v * Math.PI * 2, D = y, H = y + B;
1086
- return y = H, { ...M, startAngle: D, endAngle: H, fraction: v };
1087
- }), j = I.map((M) => ({
1088
- label: `${M.category} (${(M.fraction * 100).toFixed(1)}%)`,
1089
- color: Ce(M.index, r, Ee)
1090
- }));
1303
+ const I = s.map(
1304
+ /** @param {any} [slice] @returns {any} */
1305
+ (M) => {
1306
+ const v = M.value / p, B = v * Math.PI * 2, D = y, H = y + B;
1307
+ return y = H, { ...M, startAngle: D, endAngle: H, fraction: v };
1308
+ }
1309
+ ), j = I.map(
1310
+ /** @param {any} [slice] @returns {any} */
1311
+ (M) => ({
1312
+ label: `${M.category} (${(M.fraction * 100).toFixed(1)}%)`,
1313
+ color: Ce(M.index, r, Ee)
1314
+ })
1315
+ );
1091
1316
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative" }, ...We }, /* @__PURE__ */ e.createElement(
1092
1317
  "svg",
1093
1318
  {
@@ -1103,85 +1328,88 @@ const Lr = [
1103
1328
  role: "img",
1104
1329
  "aria-label": t.title || (x ? "Donut chart" : "Pie chart")
1105
1330
  },
1106
- I.map((M) => {
1107
- const v = Ce(M.index, r, Ee), B = Fr(m, w, E, g, M.startAngle, M.endAngle), D = M.startAngle + (M.endAngle - M.startAngle) / 2, H = x ? E + (g - E) / 2 : g * 0.62, G = ur(m, w, H, D), se = M.endAngle - M.startAngle > 0.3, b = ur(m, w, g + (be ? 26 : 14), D), q = M.endAngle - M.startAngle > 0.15, le = k[M.index] || null;
1108
- return /* @__PURE__ */ e.createElement(
1109
- "g",
1110
- {
1111
- key: `pie-slice-${M.index}`,
1112
- onClick: () => {
1113
- typeof $ == "function" && le && $(le);
1114
- },
1115
- style: typeof $ == "function" && le ? { cursor: "pointer" } : void 0
1116
- },
1117
- /* @__PURE__ */ e.createElement(
1118
- "path",
1119
- {
1120
- d: B,
1121
- fill: v,
1122
- opacity: "0.9",
1123
- stroke: r.surfaceBg || r.background || "#fff",
1124
- strokeWidth: "2",
1125
- "data-tip-cat": M.category,
1126
- "data-tip-ser": l.name,
1127
- "data-tip-val": `${P(M.originalValue)} (${(M.fraction * 100).toFixed(1)}%)`,
1128
- "data-tip-color": v
1129
- }
1130
- ),
1131
- se ? /* @__PURE__ */ e.createElement(
1132
- "text",
1133
- {
1134
- x: G.x,
1135
- y: G.y,
1136
- textAnchor: "middle",
1137
- dominantBaseline: "central",
1138
- fontSize: "10",
1139
- fontWeight: "700",
1140
- fill: "#fff",
1141
- style: { pointerEvents: "none" }
1142
- },
1143
- (M.fraction * 100).toFixed(1),
1144
- "%"
1145
- ) : null,
1146
- (S || be) && q ? /* @__PURE__ */ e.createElement("g", null, be ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
1147
- "line",
1148
- {
1149
- x1: ur(m, w, g * 0.97, D).x,
1150
- y1: ur(m, w, g * 0.97, D).y,
1151
- x2: b.x,
1152
- y2: b.y,
1153
- stroke: v,
1154
- strokeWidth: "1",
1155
- style: { pointerEvents: "none" }
1156
- }
1157
- ), /* @__PURE__ */ e.createElement(
1158
- "text",
1159
- {
1160
- x: D > Math.PI / 2 && D < 3 * Math.PI / 2 ? b.x - 4 : b.x + 4,
1161
- y: b.y + 4,
1162
- textAnchor: D > Math.PI / 2 && D < 3 * Math.PI / 2 ? "end" : "start",
1163
- fontSize: "9",
1164
- fontWeight: "700",
1165
- fill: r.textSec,
1166
- style: { pointerEvents: "none" }
1167
- },
1168
- ge(M.category, 14)
1169
- )) : null, S ? /* @__PURE__ */ e.createElement(
1170
- "text",
1331
+ I.map(
1332
+ /** @param {any} [slice] @returns {any} */
1333
+ (M) => {
1334
+ const v = Ce(M.index, r, Ee), B = Fr(m, w, E, g, M.startAngle, M.endAngle), D = M.startAngle + (M.endAngle - M.startAngle) / 2, H = x ? E + (g - E) / 2 : g * 0.62, G = ur(m, w, H, D), se = M.endAngle - M.startAngle > 0.3, b = ur(m, w, g + (be ? 26 : 14), D), q = M.endAngle - M.startAngle > 0.15, le = k[M.index] || null;
1335
+ return /* @__PURE__ */ e.createElement(
1336
+ "g",
1171
1337
  {
1172
- x: b.x,
1173
- y: be ? b.y + 14 : b.y,
1174
- textAnchor: D > Math.PI / 2 && D < 3 * Math.PI / 2 ? "end" : "start",
1175
- dominantBaseline: "central",
1176
- fontSize: "9",
1177
- fontWeight: "700",
1178
- fill: r.textSec,
1179
- style: { pointerEvents: "none" }
1338
+ key: `pie-slice-${M.index}`,
1339
+ onClick: () => {
1340
+ typeof $ == "function" && le && $(le);
1341
+ },
1342
+ style: typeof $ == "function" && le ? { cursor: "pointer" } : void 0
1180
1343
  },
1181
- P(M.originalValue)
1182
- ) : null) : null
1183
- );
1184
- }),
1344
+ /* @__PURE__ */ e.createElement(
1345
+ "path",
1346
+ {
1347
+ d: B,
1348
+ fill: v,
1349
+ opacity: "0.9",
1350
+ stroke: r.surfaceBg || r.background || "#fff",
1351
+ strokeWidth: "2",
1352
+ "data-tip-cat": M.category,
1353
+ "data-tip-ser": l.name,
1354
+ "data-tip-val": `${P(M.originalValue)} (${(M.fraction * 100).toFixed(1)}%)`,
1355
+ "data-tip-color": v
1356
+ }
1357
+ ),
1358
+ se ? /* @__PURE__ */ e.createElement(
1359
+ "text",
1360
+ {
1361
+ x: G.x,
1362
+ y: G.y,
1363
+ textAnchor: "middle",
1364
+ dominantBaseline: "central",
1365
+ fontSize: "10",
1366
+ fontWeight: "700",
1367
+ fill: "#fff",
1368
+ style: { pointerEvents: "none" }
1369
+ },
1370
+ (M.fraction * 100).toFixed(1),
1371
+ "%"
1372
+ ) : null,
1373
+ (S || be) && q ? /* @__PURE__ */ e.createElement("g", null, be ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
1374
+ "line",
1375
+ {
1376
+ x1: ur(m, w, g * 0.97, D).x,
1377
+ y1: ur(m, w, g * 0.97, D).y,
1378
+ x2: b.x,
1379
+ y2: b.y,
1380
+ stroke: v,
1381
+ strokeWidth: "1",
1382
+ style: { pointerEvents: "none" }
1383
+ }
1384
+ ), /* @__PURE__ */ e.createElement(
1385
+ "text",
1386
+ {
1387
+ x: D > Math.PI / 2 && D < 3 * Math.PI / 2 ? b.x - 4 : b.x + 4,
1388
+ y: b.y + 4,
1389
+ textAnchor: D > Math.PI / 2 && D < 3 * Math.PI / 2 ? "end" : "start",
1390
+ fontSize: "9",
1391
+ fontWeight: "700",
1392
+ fill: r.textSec,
1393
+ style: { pointerEvents: "none" }
1394
+ },
1395
+ ge(M.category, 14)
1396
+ )) : null, S ? /* @__PURE__ */ e.createElement(
1397
+ "text",
1398
+ {
1399
+ x: b.x,
1400
+ y: be ? b.y + 14 : b.y,
1401
+ textAnchor: D > Math.PI / 2 && D < 3 * Math.PI / 2 ? "end" : "start",
1402
+ dominantBaseline: "central",
1403
+ fontSize: "9",
1404
+ fontWeight: "700",
1405
+ fill: r.textSec,
1406
+ style: { pointerEvents: "none" }
1407
+ },
1408
+ P(M.originalValue)
1409
+ ) : null) : null
1410
+ );
1411
+ }
1412
+ ),
1185
1413
  x ? /* @__PURE__ */ e.createElement(
1186
1414
  "text",
1187
1415
  {
@@ -1199,10 +1427,19 @@ const Lr = [
1199
1427
  ), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: j, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1200
1428
  }
1201
1429
  if (n === "bubble") {
1202
- const l = Array.isArray(t && t.series) ? t.series.filter((N) => !ee.has(N.name)) : [], c = Array.isArray(t && t.categories) ? t.categories : [], s = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [];
1430
+ const l = Array.isArray(t && t.series) ? t.series.filter(
1431
+ /** @param {any} [s] @returns {any} */
1432
+ (N) => !ee.has(N.name)
1433
+ ) : [], c = Array.isArray(t && t.categories) ? t.categories : [], s = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [];
1203
1434
  if (l.length < 2)
1204
1435
  return /* @__PURE__ */ e.createElement(Se, { message: "Bubble charts need at least two measures (X and Y). A third measure sets bubble size.", theme: r, chartHeight: W });
1205
- const p = l[0], x = l[1], g = l[2] || null, E = (p.values || []).filter((N) => typeof N == "number" && Number.isFinite(N)), m = (x.values || []).filter((N) => typeof N == "number" && Number.isFinite(N));
1436
+ const p = l[0], x = l[1], g = l[2] || null, E = (p.values || []).filter(
1437
+ /** @param {any} [v] @returns {any} */
1438
+ (N) => typeof N == "number" && Number.isFinite(N)
1439
+ ), m = (x.values || []).filter(
1440
+ /** @param {any} [v] @returns {any} */
1441
+ (N) => typeof N == "number" && Number.isFinite(N)
1442
+ );
1206
1443
  if (E.length === 0 || m.length === 0)
1207
1444
  return /* @__PURE__ */ e.createElement(Se, { message: "Not enough numeric data for a bubble chart.", theme: r, chartHeight: W });
1208
1445
  let w = Math.min(...E), k = Math.max(...E), y = Math.min(...m), I = Math.max(...m);
@@ -1216,107 +1453,170 @@ const Lr = [
1216
1453
  }
1217
1454
  const j = (k - w) * 0.08, M = (I - y) * 0.08;
1218
1455
  w -= j, k += j, y -= M, I += M;
1219
- const v = g ? (g.values || []).filter((N) => typeof N == "number" && Number.isFinite(N)) : [], B = v.length ? Math.min(...v) : 0, H = (v.length ? Math.max(...v) : 1) - B || 1, G = (N) => {
1456
+ const v = g ? (g.values || []).filter(
1457
+ /** @param {any} [v] @returns {any} */
1458
+ (N) => typeof N == "number" && Number.isFinite(N)
1459
+ ) : [], B = v.length ? Math.min(...v) : 0, H = (v.length ? Math.max(...v) : 1) - B || 1, G = (N) => {
1220
1460
  if (!g) return 7;
1221
1461
  const re = g.values && g.values[N];
1222
1462
  return typeof re != "number" || !Number.isFinite(re) ? 7 : 4 + (re - B) / H * 20;
1223
1463
  }, b = { top: 24, right: 20, bottom: 64, left: Math.max(52, Wt(P(I), 11) + 16) }, q = Z - b.left - b.right, le = W - b.top - b.bottom, A = (N) => b.left + (N - w) / (k - w) * q, L = (N) => b.top + (I - N) / (I - y) * le, ce = Yt(w, k, 5), oe = Yt(y, I, 5), ae = he(x.name, 0);
1224
- return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", overflow: "visible", ...qe } }, oe.map((N, re) => /* @__PURE__ */ e.createElement("g", { key: `y-${re}` }, /* @__PURE__ */ e.createElement("line", { x1: b.left, y1: L(N), x2: Z - b.right, y2: L(N), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: b.left - 8, y: L(N) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec }, P(N)))), ce.map((N, re) => /* @__PURE__ */ e.createElement("g", { key: `x-${re}` }, /* @__PURE__ */ e.createElement("line", { x1: A(N), y1: b.top, x2: A(N), y2: W - b.bottom, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: A(N), y: W - b.bottom + 18, textAnchor: "middle", fontSize: "11", fill: r.textSec }, P(N)))), /* @__PURE__ */ e.createElement("line", { x1: b.left, y1: W - b.bottom, x2: Z - b.right, y2: W - b.bottom, stroke: r.border }), /* @__PURE__ */ e.createElement("line", { x1: b.left, y1: b.top, x2: b.left, y2: W - b.bottom, stroke: r.border }), /* @__PURE__ */ e.createElement("text", { x: Z / 2, y: W - 8, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec }, p.name), K ? /* @__PURE__ */ e.createElement("text", { x: 14, y: (b.top + W - b.bottom) / 2, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec, transform: `rotate(-90, 14, ${(b.top + W - b.bottom) / 2})` }, K) : null, (p.values || []).map((N, re) => {
1225
- const fe = x.values[re];
1226
- if (typeof N != "number" || !Number.isFinite(N) || typeof fe != "number" || !Number.isFinite(fe)) return null;
1227
- const Ne = G(re), er = c[re] || `Point ${re + 1}`, wt = g ? ` | ${g.name}: ${P(g.values[re])}` : "", tr = { "data-tip-cat": er, "data-tip-ser": `${x.name} (X:${P(N)})${wt}`, "data-tip-val": P(fe), "data-tip-color": ae }, Ot = s[re];
1228
- return /* @__PURE__ */ e.createElement(
1229
- "circle",
1230
- {
1231
- key: `bubble-${re}`,
1232
- cx: A(N),
1233
- cy: L(fe),
1234
- r: Ne,
1235
- fill: ae,
1236
- opacity: "0.72",
1237
- stroke: r.surfaceBg || r.background || "#fff",
1238
- strokeWidth: "1.5",
1239
- style: typeof $ == "function" && Ot ? { cursor: "pointer" } : void 0,
1240
- onClick: typeof $ == "function" && Ot ? () => $(Ot) : void 0,
1241
- ...tr
1242
- }
1243
- );
1244
- }), S && (p.values || []).map((N, re) => {
1245
- const fe = x.values[re];
1246
- if (typeof N != "number" || !Number.isFinite(N) || typeof fe != "number" || !Number.isFinite(fe)) return null;
1247
- const Ne = G(re);
1248
- return /* @__PURE__ */ e.createElement("text", { key: `bubble-lbl-${re}`, x: A(N), y: L(fe) - Ne - 4, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, c[re] || P(fe));
1249
- })), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: [{ label: `${p.name} vs ${x.name}${g ? ` (size: ${g.name})` : ""}`, color: ae }], theme: r, hiddenSet: ee, onToggle: Qe, position: _e }) : null);
1464
+ return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", overflow: "visible", ...qe } }, oe.map(
1465
+ /** @param {any} [tick] @param {any} [i] @returns {any} */
1466
+ (N, re) => /* @__PURE__ */ e.createElement("g", { key: `y-${re}` }, /* @__PURE__ */ e.createElement("line", { x1: b.left, y1: L(N), x2: Z - b.right, y2: L(N), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: b.left - 8, y: L(N) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec }, P(N)))
1467
+ ), ce.map(
1468
+ /** @param {any} [tick] @param {any} [i] @returns {any} */
1469
+ (N, re) => /* @__PURE__ */ e.createElement("g", { key: `x-${re}` }, /* @__PURE__ */ e.createElement("line", { x1: A(N), y1: b.top, x2: A(N), y2: W - b.bottom, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: A(N), y: W - b.bottom + 18, textAnchor: "middle", fontSize: "11", fill: r.textSec }, P(N)))
1470
+ ), /* @__PURE__ */ e.createElement("line", { x1: b.left, y1: W - b.bottom, x2: Z - b.right, y2: W - b.bottom, stroke: r.border }), /* @__PURE__ */ e.createElement("line", { x1: b.left, y1: b.top, x2: b.left, y2: W - b.bottom, stroke: r.border }), /* @__PURE__ */ e.createElement("text", { x: Z / 2, y: W - 8, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec }, p.name), K ? /* @__PURE__ */ e.createElement("text", { x: 14, y: (b.top + W - b.bottom) / 2, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec, transform: `rotate(-90, 14, ${(b.top + W - b.bottom) / 2})` }, K) : null, (p.values || []).map(
1471
+ /** @param {any} [xVal] @param {any} [i] @returns {any} */
1472
+ (N, re) => {
1473
+ const fe = x.values[re];
1474
+ if (typeof N != "number" || !Number.isFinite(N) || typeof fe != "number" || !Number.isFinite(fe)) return null;
1475
+ const Ne = G(re), er = c[re] || `Point ${re + 1}`, wt = g ? ` | ${g.name}: ${P(g.values[re])}` : "", tr = { "data-tip-cat": er, "data-tip-ser": `${x.name} (X:${P(N)})${wt}`, "data-tip-val": P(fe), "data-tip-color": ae }, Ot = s[re];
1476
+ return /* @__PURE__ */ e.createElement(
1477
+ "circle",
1478
+ {
1479
+ key: `bubble-${re}`,
1480
+ cx: A(N),
1481
+ cy: L(fe),
1482
+ r: Ne,
1483
+ fill: ae,
1484
+ opacity: "0.72",
1485
+ stroke: r.surfaceBg || r.background || "#fff",
1486
+ strokeWidth: "1.5",
1487
+ style: typeof $ == "function" && Ot ? { cursor: "pointer" } : void 0,
1488
+ onClick: typeof $ == "function" && Ot ? () => $(Ot) : void 0,
1489
+ ...tr
1490
+ }
1491
+ );
1492
+ }
1493
+ ), S && (p.values || []).map(
1494
+ /** @param {any} [xVal] @param {any} [i] @returns {any} */
1495
+ (N, re) => {
1496
+ const fe = x.values[re];
1497
+ if (typeof N != "number" || !Number.isFinite(N) || typeof fe != "number" || !Number.isFinite(fe)) return null;
1498
+ const Ne = G(re);
1499
+ return /* @__PURE__ */ e.createElement("text", { key: `bubble-lbl-${re}`, x: A(N), y: L(fe) - Ne - 4, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, c[re] || P(fe));
1500
+ }
1501
+ )), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: [{ label: `${p.name} vs ${x.name}${g ? ` (size: ${g.name})` : ""}`, color: ae }], theme: r, hiddenSet: ee, onToggle: Qe, position: _e }) : null);
1250
1502
  }
1251
1503
  if (n === "radar") {
1252
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((M) => !ee.has(M.name)) : [];
1504
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
1505
+ /** @param {any} [s] @returns {any} */
1506
+ (M) => !ee.has(M.name)
1507
+ ) : [];
1253
1508
  if (l.length < 3)
1254
1509
  return /* @__PURE__ */ e.createElement(Se, { message: "Radar charts need at least 3 categories (spokes).", theme: r, chartHeight: W });
1255
1510
  if (c.length === 0)
1256
1511
  return /* @__PURE__ */ e.createElement(Se, { message: "Radar charts need at least one measure series.", theme: r, chartHeight: W });
1257
- const s = c.flatMap((M) => (M.values || []).filter((v) => typeof v == "number" && Number.isFinite(v))), p = s.length ? Math.max(...s, 0) : 1, x = 60, g = Z / 2, E = W / 2, m = Math.min(g, E) - x, w = l.length, k = 2 * Math.PI / w, y = (M, v) => {
1512
+ const s = c.flatMap(
1513
+ /** @param {any} [s] @returns {any} */
1514
+ (M) => (M.values || []).filter(
1515
+ /** @param {any} [v] @returns {any} */
1516
+ (v) => typeof v == "number" && Number.isFinite(v)
1517
+ )
1518
+ ), p = s.length ? Math.max(...s, 0) : 1, x = 60, g = Z / 2, E = W / 2, m = Math.min(g, E) - x, w = l.length, k = 2 * Math.PI / w, y = (M, v) => {
1258
1519
  const B = M * k - Math.PI / 2, D = m * (v / (p || 1));
1259
1520
  return { x: g + D * Math.cos(B), y: E + D * Math.sin(B) };
1260
1521
  }, I = (M) => {
1261
1522
  const v = M * k - Math.PI / 2, B = m + 18;
1262
1523
  return { x: g + B * Math.cos(v), y: E + B * Math.sin(v) };
1263
- }, j = c.map((M, v) => ({ label: M.name, color: he(M.name, v) }));
1524
+ }, j = c.map(
1525
+ /** @param {any} [s] @param {any} [i] @returns {any} */
1526
+ (M, v) => ({ label: M.name, color: he(M.name, v) })
1527
+ );
1264
1528
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", ...qe } }, [0.25, 0.5, 0.75, 1].map((M) => {
1265
- const v = l.map((B, D) => y(D, p * M));
1266
- return /* @__PURE__ */ e.createElement("polygon", { key: `grid-${M}`, points: v.map((B) => `${B.x},${B.y}`).join(" "), fill: "none", stroke: r.border, strokeWidth: "1" });
1267
- }), l.map((M, v) => {
1268
- const B = y(v, p);
1269
- return /* @__PURE__ */ e.createElement("line", { key: `spoke-${v}`, x1: g, y1: E, x2: B.x, y2: B.y, stroke: r.border, strokeWidth: "1" });
1270
- }), l.map((M, v) => {
1271
- const B = I(v), D = Math.abs(B.x - g) < 10 ? "middle" : B.x < g ? "end" : "start";
1272
- return /* @__PURE__ */ e.createElement("text", { key: `spoke-lbl-${v}`, x: B.x, y: B.y + 4, textAnchor: D, fontSize: "10", fill: r.textSec }, ge(M, 14));
1273
- }), c.map((M, v) => {
1274
- const B = he(M.name, v), D = l.map((G, se) => {
1275
- const b = M.values && M.values[se];
1276
- return y(se, typeof b == "number" && Number.isFinite(b) ? b : 0);
1277
- }), H = D.map((G) => `${G.x},${G.y}`).join(" ");
1278
- return /* @__PURE__ */ e.createElement("g", { key: `radar-${v}` }, /* @__PURE__ */ e.createElement("polygon", { points: H, fill: B, fillOpacity: "0.18", stroke: B, strokeWidth: "2", style: { pointerEvents: "none" } }), D.map((G, se) => {
1279
- const b = M.values && M.values[se], q = { "data-tip-cat": l[se], "data-tip-ser": M.name, "data-tip-val": P(b), "data-tip-color": B };
1280
- return /* @__PURE__ */ e.createElement("circle", { key: `radar-dot-${v}-${se}`, cx: G.x, cy: G.y, r: "4", fill: B, stroke: r.surfaceBg || "#fff", strokeWidth: "1.5", ...q });
1281
- }));
1282
- }), [0.5, 1].map((M) => /* @__PURE__ */ e.createElement("text", { key: `scale-${M}`, x: g + 4, y: E - m * M + 4, fontSize: "9", fill: r.textSec }, P(p * M)))), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: j, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1283
- }
1284
- if (n === "funnel") {
1285
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) && t.series.length > 0 ? t.series[0] : null;
1286
- if (!c || l.length === 0)
1529
+ const v = l.map(
1530
+ /** @param {any} [_] @param {any} [i] @returns {any} */
1531
+ (B, D) => y(D, p * M)
1532
+ );
1533
+ return /* @__PURE__ */ e.createElement("polygon", { key: `grid-${M}`, points: v.map(
1534
+ /** @param {any} [p] @returns {any} */
1535
+ (B) => `${B.x},${B.y}`
1536
+ ).join(" "), fill: "none", stroke: r.border, strokeWidth: "1" });
1537
+ }), l.map(
1538
+ /** @param {any} [_] @param {any} [i] @returns {any} */
1539
+ (M, v) => {
1540
+ const B = y(v, p);
1541
+ return /* @__PURE__ */ e.createElement("line", { key: `spoke-${v}`, x1: g, y1: E, x2: B.x, y2: B.y, stroke: r.border, strokeWidth: "1" });
1542
+ }
1543
+ ), l.map(
1544
+ /** @param {any} [cat] @param {any} [i] @returns {any} */
1545
+ (M, v) => {
1546
+ const B = I(v), D = Math.abs(B.x - g) < 10 ? "middle" : B.x < g ? "end" : "start";
1547
+ return /* @__PURE__ */ e.createElement("text", { key: `spoke-lbl-${v}`, x: B.x, y: B.y + 4, textAnchor: D, fontSize: "10", fill: r.textSec }, ge(M, 14));
1548
+ }
1549
+ ), c.map(
1550
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
1551
+ (M, v) => {
1552
+ const B = he(M.name, v), D = l.map(
1553
+ /** @param {any} [_] @param {any} [i] @returns {any} */
1554
+ (G, se) => {
1555
+ const b = M.values && M.values[se];
1556
+ return y(se, typeof b == "number" && Number.isFinite(b) ? b : 0);
1557
+ }
1558
+ ), H = D.map(
1559
+ /** @param {any} [p] @returns {any} */
1560
+ (G) => `${G.x},${G.y}`
1561
+ ).join(" ");
1562
+ return /* @__PURE__ */ e.createElement("g", { key: `radar-${v}` }, /* @__PURE__ */ e.createElement("polygon", { points: H, fill: B, fillOpacity: "0.18", stroke: B, strokeWidth: "2", style: { pointerEvents: "none" } }), D.map(
1563
+ /** @param {any} [p] @param {any} [i] @returns {any} */
1564
+ (G, se) => {
1565
+ const b = M.values && M.values[se], q = { "data-tip-cat": l[se], "data-tip-ser": M.name, "data-tip-val": P(b), "data-tip-color": B };
1566
+ return /* @__PURE__ */ e.createElement("circle", { key: `radar-dot-${v}-${se}`, cx: G.x, cy: G.y, r: "4", fill: B, stroke: r.surfaceBg || "#fff", strokeWidth: "1.5", ...q });
1567
+ }
1568
+ ));
1569
+ }
1570
+ ), [0.5, 1].map((M) => /* @__PURE__ */ e.createElement("text", { key: `scale-${M}`, x: g + 4, y: E - m * M + 4, fontSize: "9", fill: r.textSec }, P(p * M)))), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: j, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1571
+ }
1572
+ if (n === "funnel") {
1573
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) && t.series.length > 0 ? t.series[0] : null;
1574
+ if (!c || l.length === 0)
1287
1575
  return /* @__PURE__ */ e.createElement(Se, { message: "Funnel charts need categories and at least one measure.", theme: r, chartHeight: W });
1288
- const s = l.map((k, y) => {
1289
- const I = c.values && c.values[y];
1290
- return typeof I == "number" && Number.isFinite(I) ? Math.abs(I) : 0;
1291
- }), p = Math.max(...s, 1), x = { top: 24, right: 20, bottom: 24, left: 20 }, g = Z - x.left - x.right, m = (W - x.top - x.bottom) / l.length, w = l.map((k, y) => ({ label: k, color: he(k, y) }));
1292
- return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", ...qe } }, l.map((k, y) => {
1293
- const I = s[y] / p, j = y + 1 < l.length ? s[y + 1] / p : s[y] / p * 0.5, M = g * I, v = g * j, B = Z / 2, D = x.top + y * m, H = he(k, y), G = [
1294
- `${B - M / 2},${D}`,
1295
- `${B + M / 2},${D}`,
1296
- `${B + v / 2},${D + m - 1}`,
1297
- `${B - v / 2},${D + m - 1}`
1298
- ].join(" ");
1299
- return /* @__PURE__ */ e.createElement("g", { key: `funnel-${y}` }, /* @__PURE__ */ e.createElement(
1300
- "polygon",
1301
- {
1302
- points: G,
1303
- fill: H,
1304
- opacity: "0.88",
1305
- stroke: r.surfaceBg || "#fff",
1306
- strokeWidth: "1.5",
1307
- "data-tip-cat": k,
1308
- "data-tip-ser": c.name,
1309
- "data-tip-val": P(s[y]),
1310
- "data-tip-color": H
1311
- }
1312
- ), /* @__PURE__ */ e.createElement("text", { x: B, y: D + m / 2 + 4, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: "#fff", style: { pointerEvents: "none" } }, ge(k, Math.max(4, Math.floor(M / 7))), " ", S ? `— ${P(s[y])}` : ""));
1313
- })), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: w, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1576
+ const s = l.map(
1577
+ /** @param {any} [_] @param {any} [i] @returns {any} */
1578
+ (k, y) => {
1579
+ const I = c.values && c.values[y];
1580
+ return typeof I == "number" && Number.isFinite(I) ? Math.abs(I) : 0;
1581
+ }
1582
+ ), p = Math.max(...s, 1), x = { top: 24, right: 20, bottom: 24, left: 20 }, g = Z - x.left - x.right, m = (W - x.top - x.bottom) / l.length, w = l.map(
1583
+ /** @param {any} [cat] @param {any} [i] @returns {any} */
1584
+ (k, y) => ({ label: k, color: he(k, y) })
1585
+ );
1586
+ return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", ...qe } }, l.map(
1587
+ /** @param {any} [cat] @param {any} [i] @returns {any} */
1588
+ (k, y) => {
1589
+ const I = s[y] / p, j = y + 1 < l.length ? s[y + 1] / p : s[y] / p * 0.5, M = g * I, v = g * j, B = Z / 2, D = x.top + y * m, H = he(k, y), G = [
1590
+ `${B - M / 2},${D}`,
1591
+ `${B + M / 2},${D}`,
1592
+ `${B + v / 2},${D + m - 1}`,
1593
+ `${B - v / 2},${D + m - 1}`
1594
+ ].join(" ");
1595
+ return /* @__PURE__ */ e.createElement("g", { key: `funnel-${y}` }, /* @__PURE__ */ e.createElement(
1596
+ "polygon",
1597
+ {
1598
+ points: G,
1599
+ fill: H,
1600
+ opacity: "0.88",
1601
+ stroke: r.surfaceBg || "#fff",
1602
+ strokeWidth: "1.5",
1603
+ "data-tip-cat": k,
1604
+ "data-tip-ser": c.name,
1605
+ "data-tip-val": P(s[y]),
1606
+ "data-tip-color": H
1607
+ }
1608
+ ), /* @__PURE__ */ e.createElement("text", { x: B, y: D + m / 2 + 4, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: "#fff", style: { pointerEvents: "none" } }, ge(k, Math.max(4, Math.floor(M / 7))), " ", S ? `— ${P(s[y])}` : ""));
1609
+ }
1610
+ )), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: w, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1314
1611
  }
1315
1612
  if (n === "histogram") {
1316
1613
  const l = Array.isArray(t && t.series) && t.series.length > 0 ? t.series[0] : null;
1317
1614
  if (!l)
1318
1615
  return /* @__PURE__ */ e.createElement(Se, { message: "Histogram needs at least one numeric measure.", theme: r, chartHeight: W });
1319
- const c = (l.values || []).filter((D) => typeof D == "number" && Number.isFinite(D));
1616
+ const c = (l.values || []).filter(
1617
+ /** @param {any} [v] @returns {any} */
1618
+ (D) => typeof D == "number" && Number.isFinite(D)
1619
+ );
1320
1620
  if (c.length === 0)
1321
1621
  return /* @__PURE__ */ e.createElement(Se, { message: "No numeric values for histogram.", theme: r, chartHeight: W });
1322
1622
  const s = Math.max(4, Math.min(20, Math.ceil(1 + Math.log2(c.length)))), p = Math.min(...c), g = (Math.max(...c) - p) / s || 1, E = Array.from({ length: s }, (D, H) => ({
@@ -1324,47 +1624,81 @@ const Lr = [
1324
1624
  high: p + (H + 1) * g,
1325
1625
  count: 0
1326
1626
  }));
1327
- c.forEach((D) => {
1328
- const H = Math.min(Math.floor((D - p) / g), s - 1);
1329
- E[H].count++;
1330
- });
1331
- const m = Math.max(...E.map((D) => D.count), 1), k = { top: 24, right: 16, bottom: 44, left: Math.max(46, Wt(String(m), 11) + 16) }, y = Z - k.left - k.right, I = W - k.top - k.bottom, j = y / s, M = (D) => k.top + (m - D) / m * I, v = he(l.name, 0), B = Yt(0, m, U || 5);
1332
- return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", ...qe } }, B.map((D, H) => /* @__PURE__ */ e.createElement("g", { key: `htick-${H}` }, /* @__PURE__ */ e.createElement("line", { x1: k.left, y1: M(D), x2: Z - k.right, y2: M(D), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: k.left - 8, y: M(D) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec }, D))), /* @__PURE__ */ e.createElement("line", { x1: k.left, y1: k.top + I, x2: Z - k.right, y2: k.top + I, stroke: r.textSec, strokeWidth: "1" }), E.map((D, H) => {
1333
- const G = k.left + H * j, se = M(D.count), b = Math.max(1, k.top + I - se);
1334
- return /* @__PURE__ */ e.createElement("g", { key: `hbar-${H}` }, /* @__PURE__ */ e.createElement(
1335
- "rect",
1336
- {
1337
- x: G,
1338
- y: se,
1339
- width: Math.max(1, j - 1),
1340
- height: b,
1341
- fill: v,
1342
- opacity: "0.88",
1343
- "data-tip-cat": `${P(D.low)}–${P(D.high)}`,
1344
- "data-tip-ser": "Count",
1345
- "data-tip-val": String(D.count),
1346
- "data-tip-color": v
1347
- }
1348
- ), S && D.count > 0 ? /* @__PURE__ */ e.createElement("text", { x: G + j / 2, y: se - 4, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, D.count) : null);
1349
- }), E.filter((D, H) => H % Math.max(1, Math.floor(s / 6)) === 0 || H === s - 1).map((D, H) => /* @__PURE__ */ e.createElement("text", { key: `hlbl-${H}`, x: k.left + E.indexOf(D) * j + j / 2, y: k.top + I + 18, textAnchor: "middle", fontSize: "10", fill: r.textSec }, P(D.low)))), De, we, Ie, Xe));
1627
+ c.forEach(
1628
+ /** @param {any} [v] @returns {any} */
1629
+ (D) => {
1630
+ const H = Math.min(Math.floor((D - p) / g), s - 1);
1631
+ E[H].count++;
1632
+ }
1633
+ );
1634
+ const m = Math.max(...E.map(
1635
+ /** @param {any} [b] @returns {any} */
1636
+ (D) => D.count
1637
+ ), 1), k = { top: 24, right: 16, bottom: 44, left: Math.max(46, Wt(String(m), 11) + 16) }, y = Z - k.left - k.right, I = W - k.top - k.bottom, j = y / s, M = (D) => k.top + (m - D) / m * I, v = he(l.name, 0), B = Yt(0, m, U || 5);
1638
+ return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement("svg", { ref: R, viewBox: `0 0 ${Z} ${W}`, width: "100%", preserveAspectRatio: "xMidYMid meet", style: { display: "block", ...qe } }, B.map(
1639
+ /** @param {any} [tick] @param {any} [i] @returns {any} */
1640
+ (D, H) => /* @__PURE__ */ e.createElement("g", { key: `htick-${H}` }, /* @__PURE__ */ e.createElement("line", { x1: k.left, y1: M(D), x2: Z - k.right, y2: M(D), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: k.left - 8, y: M(D) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec }, D))
1641
+ ), /* @__PURE__ */ e.createElement("line", { x1: k.left, y1: k.top + I, x2: Z - k.right, y2: k.top + I, stroke: r.textSec, strokeWidth: "1" }), E.map(
1642
+ /** @param {any} [bin] @param {any} [i] @returns {any} */
1643
+ (D, H) => {
1644
+ const G = k.left + H * j, se = M(D.count), b = Math.max(1, k.top + I - se);
1645
+ return /* @__PURE__ */ e.createElement("g", { key: `hbar-${H}` }, /* @__PURE__ */ e.createElement(
1646
+ "rect",
1647
+ {
1648
+ x: G,
1649
+ y: se,
1650
+ width: Math.max(1, j - 1),
1651
+ height: b,
1652
+ fill: v,
1653
+ opacity: "0.88",
1654
+ "data-tip-cat": `${P(D.low)}–${P(D.high)}`,
1655
+ "data-tip-ser": "Count",
1656
+ "data-tip-val": String(D.count),
1657
+ "data-tip-color": v
1658
+ }
1659
+ ), S && D.count > 0 ? /* @__PURE__ */ e.createElement("text", { x: G + j / 2, y: se - 4, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, D.count) : null);
1660
+ }
1661
+ ), E.filter(
1662
+ /** @param {any} [_] @param {any} [i] @returns {any} */
1663
+ (D, H) => H % Math.max(1, Math.floor(s / 6)) === 0 || H === s - 1
1664
+ ).map(
1665
+ /** @param {any} [bin] @param {any} [i] @returns {any} */
1666
+ (D, H) => /* @__PURE__ */ e.createElement("text", { key: `hlbl-${H}`, x: k.left + E.indexOf(D) * j + j / 2, y: k.top + I + 18, textAnchor: "middle", fontSize: "10", fill: r.textSec }, P(D.low))
1667
+ )), De, we, Ie, Xe));
1350
1668
  }
1351
1669
  if (n === "boxplot") {
1352
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((k) => !ee.has(k.name)) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = r.gridLine || r.border || "#eee";
1670
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
1671
+ /** @param {any} [s] @returns {any} */
1672
+ (k) => !ee.has(k.name)
1673
+ ) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = r.gridLine || r.border || "#eee";
1353
1674
  if (c.length < 5)
1354
1675
  return /* @__PURE__ */ e.createElement(Se, { message: "Box Plot needs 5 measures: Min, Q1, Median, Q3, Max.", theme: r, chartHeight: W });
1355
- const E = l.map((k, y) => [
1356
- c[0].values[y] ?? 0,
1357
- c[1].values[y] ?? 0,
1358
- c[2].values[y] ?? 0,
1359
- c[3].values[y] ?? 0,
1360
- c[4].values[y] ?? 0
1361
- ]), m = he(c[2].name, 0), w = {
1676
+ const E = l.map(
1677
+ /** @param {any} [_] @param {any} [ci] @returns {any} */
1678
+ (k, y) => [
1679
+ c[0].values[y] ?? 0,
1680
+ c[1].values[y] ?? 0,
1681
+ c[2].values[y] ?? 0,
1682
+ c[3].values[y] ?? 0,
1683
+ c[4].values[y] ?? 0
1684
+ ]
1685
+ ), m = he(c[2].name, 0), w = {
1362
1686
  backgroundColor: s,
1363
- tooltip: { trigger: "axis", formatter: (k) => {
1364
- const y = k[0];
1365
- return `${y.name}<br/>Min: ${P(y.data[1])}<br/>Q1: ${P(y.data[2])}<br/>Median: ${P(y.data[3])}<br/>Q3: ${P(y.data[4])}<br/>Max: ${P(y.data[5])}`;
1366
- } },
1367
- xAxis: { type: "category", data: l.map((k) => ge(String(k), 14)), axisLabel: { color: p, fontSize: 10 }, axisLine: { lineStyle: { color: x } } },
1687
+ tooltip: {
1688
+ trigger: "axis",
1689
+ /** @param {any} [params] @returns {any} */
1690
+ formatter: (
1691
+ /** @param {any} [params] @returns {any} */
1692
+ ((k) => {
1693
+ const y = k[0];
1694
+ return `${y.name}<br/>Min: ${P(y.data[1])}<br/>Q1: ${P(y.data[2])}<br/>Median: ${P(y.data[3])}<br/>Q3: ${P(y.data[4])}<br/>Max: ${P(y.data[5])}`;
1695
+ })
1696
+ )
1697
+ },
1698
+ xAxis: { type: "category", data: l.map(
1699
+ /** @param {any} [c] @returns {any} */
1700
+ (k) => ge(String(k), 14)
1701
+ ), axisLabel: { color: p, fontSize: 10 }, axisLine: { lineStyle: { color: x } } },
1368
1702
  yAxis: { type: "value", axisLabel: { color: p, fontSize: 10, formatter: P }, axisLine: { lineStyle: { color: x } }, splitLine: { lineStyle: { color: g } }, name: K || "", nameTextStyle: { color: p } },
1369
1703
  grid: { left: 60, right: 20, top: 20, bottom: 60 },
1370
1704
  series: [{ type: "boxplot", data: E, itemStyle: { color: m, borderColor: m } }]
@@ -1372,36 +1706,78 @@ const Lr = [
1372
1706
  return /* @__PURE__ */ e.createElement("div", { style: { width: "100%", height: f, background: s, borderRadius: r.radiusSm || "8px", overflow: "hidden" } }, /* @__PURE__ */ e.createElement(nr, { chartType: n, echartsRef: C, option: w }));
1373
1707
  }
1374
1708
  if (n === "nightingale") {
1375
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((E) => !ee.has(E.name)) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333";
1709
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
1710
+ /** @param {any} [s] @returns {any} */
1711
+ (E) => !ee.has(E.name)
1712
+ ) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333";
1376
1713
  if (l.length === 0 || c.length === 0)
1377
1714
  return /* @__PURE__ */ e.createElement(Se, { message: "Nightingale charts need categories and at least one measure.", theme: r, chartHeight: W });
1378
- const x = l.map((E, m) => {
1379
- const w = c[0] && c[0].values ? c[0].values[m] ?? 0 : 0;
1380
- return { name: String(E), value: w, itemStyle: { color: he(String(E), m) } };
1381
- }), g = {
1715
+ const x = l.map(
1716
+ /** @param {any} [cat] @param {any} [ci] @returns {any} */
1717
+ (E, m) => {
1718
+ const w = c[0] && c[0].values ? c[0].values[m] ?? 0 : 0;
1719
+ return { name: String(E), value: w, itemStyle: { color: he(String(E), m) } };
1720
+ }
1721
+ ), g = {
1382
1722
  backgroundColor: s,
1383
- tooltip: { trigger: "item", formatter: (E) => `${E.name}: ${P(E.value)}` },
1723
+ tooltip: {
1724
+ trigger: "item",
1725
+ /** @param {any} [p] @returns {any} */
1726
+ formatter: (
1727
+ /** @param {any} [p] @returns {any} */
1728
+ ((E) => `${E.name}: ${P(E.value)}`)
1729
+ )
1730
+ },
1384
1731
  legend: { show: h, textStyle: { color: p }, type: "scroll" },
1385
1732
  series: [{
1386
1733
  type: "bar",
1387
1734
  coordinateSystem: "polar",
1388
1735
  data: x,
1389
- label: { show: S, position: "outside", formatter: (E) => P(E.value), color: p, fontSize: 10 }
1736
+ label: {
1737
+ show: S,
1738
+ position: "outside",
1739
+ /** @param {any} [p] @returns {any} */
1740
+ formatter: (
1741
+ /** @param {any} [p] @returns {any} */
1742
+ ((E) => P(E.value))
1743
+ ),
1744
+ color: p,
1745
+ fontSize: 10
1746
+ }
1390
1747
  }],
1391
1748
  polar: { radius: ["10%", "75%"] },
1392
- angleAxis: { type: "category", data: l.map((E) => ge(String(E), 12)), axisLabel: { color: p, fontSize: 9 } },
1749
+ angleAxis: { type: "category", data: l.map(
1750
+ /** @param {any} [c] @returns {any} */
1751
+ (E) => ge(String(E), 12)
1752
+ ), axisLabel: { color: p, fontSize: 9 } },
1393
1753
  radiusAxis: { axisLabel: { color: p, fontSize: 9, formatter: P } }
1394
1754
  };
1395
1755
  return /* @__PURE__ */ e.createElement("div", { style: { width: "100%", height: f, background: s, borderRadius: r.radiusSm || "8px", overflow: "hidden" } }, /* @__PURE__ */ e.createElement(nr, { chartType: n, echartsRef: C, option: g }));
1396
1756
  }
1397
1757
  if (n === "heatmap") {
1398
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((H) => !ee.has(H.name)) : [];
1758
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
1759
+ /** @param {any} [s] @returns {any} */
1760
+ (H) => !ee.has(H.name)
1761
+ ) : [];
1399
1762
  if (l.length === 0 || c.length === 0)
1400
1763
  return /* @__PURE__ */ e.createElement(Se, { message: "Heatmap needs categories and at least one measure.", theme: r, chartHeight: W });
1401
- const s = c.flatMap((H) => (H.values || []).filter((G) => typeof G == "number" && Number.isFinite(G))), p = s.length ? Math.min(...s) : 0, g = (s.length ? Math.max(...s) : 1) - p || 1, E = (H) => {
1764
+ const s = c.flatMap(
1765
+ /** @param {any} [s] @returns {any} */
1766
+ (H) => (H.values || []).filter(
1767
+ /** @param {any} [v] @returns {any} */
1768
+ (G) => typeof G == "number" && Number.isFinite(G)
1769
+ )
1770
+ ), p = s.length ? Math.min(...s) : 0, g = (s.length ? Math.max(...s) : 1) - p || 1, E = (H) => {
1402
1771
  const G = Math.max(0, Math.min(1, (H - p) / g)), se = Math.round(59 + G * 180), b = Math.round(130 - G * 62), q = Math.round(246 - G * 178);
1403
1772
  return `rgb(${se},${b},${q})`;
1404
- }, m = 2, w = Math.min(140, Math.max(60, c.reduce((H, G) => Math.max(H, Wt(G.name, 11)), 0) + 10)), k = 32, y = Z, I = W, j = y - w - 8, M = I - k - 8, v = Math.max(20, j / l.length), B = Math.max(20, M / c.length), D = c.map((H, G) => ({ label: H.name, color: Ce(G, r, Ee) }));
1773
+ }, m = 2, w = Math.min(140, Math.max(60, c.reduce(
1774
+ /** @param {any} [m] @param {any} [s] @returns {any} */
1775
+ (H, G) => Math.max(H, Wt(G.name, 11)),
1776
+ 0
1777
+ ) + 10)), k = 32, y = Z, I = W, j = y - w - 8, M = I - k - 8, v = Math.max(20, j / l.length), B = Math.max(20, M / c.length), D = c.map(
1778
+ /** @param {any} [s] @param {any} [i] @returns {any} */
1779
+ (H, G) => ({ label: H.name, color: Ce(G, r, Ee) })
1780
+ );
1405
1781
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement(
1406
1782
  "svg",
1407
1783
  {
@@ -1412,95 +1788,122 @@ const Lr = [
1412
1788
  role: "img",
1413
1789
  "aria-label": t.title || "Heatmap"
1414
1790
  },
1415
- l.map((H, G) => /* @__PURE__ */ e.createElement(
1416
- "text",
1417
- {
1418
- key: `hm-col-${G}`,
1419
- x: w + G * v + v / 2,
1420
- y: k - 6,
1421
- textAnchor: "middle",
1422
- fontSize: "10",
1423
- fill: r.textSec,
1424
- style: { pointerEvents: "none" }
1425
- },
1426
- ge(H, Math.max(4, Math.floor(v / 6.5)))
1427
- )),
1428
- c.map((H, G) => /* @__PURE__ */ e.createElement(
1429
- "text",
1430
- {
1431
- key: `hm-row-${G}`,
1432
- x: w - 6,
1433
- y: k + G * B + B / 2 + 4,
1434
- textAnchor: "end",
1435
- fontSize: "11",
1436
- fill: r.textSec,
1437
- style: { pointerEvents: "none" }
1438
- },
1439
- ge(H.name, Math.max(6, Math.floor(w / 6.5)))
1440
- )),
1791
+ l.map(
1792
+ /** @param {any} [cat] @param {any} [ci] @returns {any} */
1793
+ (H, G) => /* @__PURE__ */ e.createElement(
1794
+ "text",
1795
+ {
1796
+ key: `hm-col-${G}`,
1797
+ x: w + G * v + v / 2,
1798
+ y: k - 6,
1799
+ textAnchor: "middle",
1800
+ fontSize: "10",
1801
+ fill: r.textSec,
1802
+ style: { pointerEvents: "none" }
1803
+ },
1804
+ ge(H, Math.max(4, Math.floor(v / 6.5)))
1805
+ )
1806
+ ),
1441
1807
  c.map(
1442
- (H, G) => l.map((se, b) => {
1443
- const q = H.values && H.values[b];
1444
- if (q == null) return null;
1445
- const le = E(q), A = w + b * v, L = k + G * B;
1446
- return /* @__PURE__ */ e.createElement(
1447
- "rect",
1448
- {
1449
- key: `hm-cell-${G}-${b}`,
1450
- x: A + m,
1451
- y: L + m,
1452
- width: Math.max(1, v - m * 2),
1453
- height: Math.max(1, B - m * 2),
1454
- rx: "3",
1455
- fill: le,
1456
- "data-tip-cat": se,
1457
- "data-tip-ser": H.name,
1458
- "data-tip-val": P(q),
1459
- "data-tip-color": le
1460
- }
1461
- );
1462
- })
1808
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
1809
+ (H, G) => /* @__PURE__ */ e.createElement(
1810
+ "text",
1811
+ {
1812
+ key: `hm-row-${G}`,
1813
+ x: w - 6,
1814
+ y: k + G * B + B / 2 + 4,
1815
+ textAnchor: "end",
1816
+ fontSize: "11",
1817
+ fill: r.textSec,
1818
+ style: { pointerEvents: "none" }
1819
+ },
1820
+ ge(H.name, Math.max(6, Math.floor(w / 6.5)))
1821
+ )
1822
+ ),
1823
+ c.map(
1824
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
1825
+ (H, G) => l.map(
1826
+ /** @param {any} [cat] @param {any} [ci] @returns {any} */
1827
+ (se, b) => {
1828
+ const q = H.values && H.values[b];
1829
+ if (q == null) return null;
1830
+ const le = E(q), A = w + b * v, L = k + G * B;
1831
+ return /* @__PURE__ */ e.createElement(
1832
+ "rect",
1833
+ {
1834
+ key: `hm-cell-${G}-${b}`,
1835
+ x: A + m,
1836
+ y: L + m,
1837
+ width: Math.max(1, v - m * 2),
1838
+ height: Math.max(1, B - m * 2),
1839
+ rx: "3",
1840
+ fill: le,
1841
+ "data-tip-cat": se,
1842
+ "data-tip-ser": H.name,
1843
+ "data-tip-val": P(q),
1844
+ "data-tip-color": le
1845
+ }
1846
+ );
1847
+ }
1848
+ )
1463
1849
  ),
1464
1850
  S && c.map(
1465
- (H, G) => l.map((se, b) => {
1466
- const q = H.values && H.values[b];
1467
- if (q == null || v < 36 || B < 18) return null;
1468
- const A = Math.max(0, Math.min(1, (q - p) / g)) > 0.5 ? "#fff" : r.text;
1469
- return /* @__PURE__ */ e.createElement(
1470
- "text",
1471
- {
1472
- key: `hm-label-${G}-${b}`,
1473
- x: w + b * v + v / 2,
1474
- y: k + G * B + B / 2 + 4,
1475
- textAnchor: "middle",
1476
- fontSize: "9",
1477
- fontWeight: "700",
1478
- fill: A,
1479
- style: { pointerEvents: "none" }
1480
- },
1481
- P(q)
1482
- );
1483
- })
1851
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
1852
+ (H, G) => l.map(
1853
+ /** @param {any} [cat] @param {any} [ci] @returns {any} */
1854
+ (se, b) => {
1855
+ const q = H.values && H.values[b];
1856
+ if (q == null || v < 36 || B < 18) return null;
1857
+ const A = Math.max(0, Math.min(1, (q - p) / g)) > 0.5 ? "#fff" : r.text;
1858
+ return /* @__PURE__ */ e.createElement(
1859
+ "text",
1860
+ {
1861
+ key: `hm-label-${G}-${b}`,
1862
+ x: w + b * v + v / 2,
1863
+ y: k + G * B + B / 2 + 4,
1864
+ textAnchor: "middle",
1865
+ fontSize: "9",
1866
+ fontWeight: "700",
1867
+ fill: A,
1868
+ style: { pointerEvents: "none" }
1869
+ },
1870
+ P(q)
1871
+ );
1872
+ }
1873
+ )
1484
1874
  )
1485
1875
  ), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: D, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1486
1876
  }
1487
1877
  if (n === "bar3d") {
1488
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((m) => !ee.has(m.name)) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = [];
1489
- c.forEach((m, w) => {
1490
- l.forEach((k, y) => {
1491
- const I = m.values[y];
1492
- I != null && g.push([y, w, I]);
1493
- });
1494
- });
1878
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
1879
+ /** @param {any} [s] @returns {any} */
1880
+ (m) => !ee.has(m.name)
1881
+ ) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = [];
1882
+ c.forEach(
1883
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
1884
+ (m, w) => {
1885
+ l.forEach(
1886
+ /** @param {any} [cat] @param {any} [ci] @returns {any} */
1887
+ (k, y) => {
1888
+ const I = m.values[y];
1889
+ I != null && g.push([y, w, I]);
1890
+ }
1891
+ );
1892
+ }
1893
+ );
1495
1894
  const E = {
1496
1895
  backgroundColor: s,
1497
1896
  legend: {
1498
1897
  show: h,
1499
- data: c.map((m) => m.name),
1898
+ data: c.map(
1899
+ /** @param {any} [s] @returns {any} */
1900
+ (m) => m.name
1901
+ ),
1500
1902
  textStyle: { color: p },
1501
1903
  type: "scroll"
1502
1904
  },
1503
1905
  tooltip: {
1906
+ /** @param {any} [params] @returns {any} */
1504
1907
  formatter: (m) => {
1505
1908
  const w = l[m.value[0]] || "", k = c[m.value[1]] ? c[m.value[1]].name : "";
1506
1909
  return `${w} / ${k}: <b>${P(m.value[2])}</b>`;
@@ -1514,14 +1917,20 @@ const Lr = [
1514
1917
  },
1515
1918
  xAxis3D: {
1516
1919
  type: "category",
1517
- data: l.map((m) => ge(String(m), 12)),
1920
+ data: l.map(
1921
+ /** @param {any} [c] @returns {any} */
1922
+ (m) => ge(String(m), 12)
1923
+ ),
1518
1924
  axisLabel: { color: p, fontSize: 10 },
1519
1925
  axisLine: { lineStyle: { color: x } },
1520
1926
  name: ""
1521
1927
  },
1522
1928
  yAxis3D: {
1523
1929
  type: "category",
1524
- data: c.map((m) => ge(String(m.name), 12)),
1930
+ data: c.map(
1931
+ /** @param {any} [s] @returns {any} */
1932
+ (m) => ge(String(m.name), 12)
1933
+ ),
1525
1934
  axisLabel: { color: p, fontSize: 10 },
1526
1935
  axisLine: { lineStyle: { color: x } }
1527
1936
  },
@@ -1541,6 +1950,7 @@ const Lr = [
1541
1950
  shading: "lambert",
1542
1951
  label: {
1543
1952
  show: S,
1953
+ /** @param {any} [p] @returns {any} */
1544
1954
  formatter: (m) => P(m.value[2]),
1545
1955
  textStyle: { color: p, fontSize: 10 }
1546
1956
  },
@@ -1550,18 +1960,31 @@ const Lr = [
1550
1960
  return /* @__PURE__ */ e.createElement("div", { style: { width: "100%", height: f, background: s, borderRadius: r.radiusSm || "8px", overflow: "hidden" } }, /* @__PURE__ */ e.createElement(nr, { chartType: n, echartsRef: C, option: E }));
1551
1961
  }
1552
1962
  if (n === "line3d") {
1553
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((m) => !ee.has(m.name)) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = c.map((m, w) => ({
1554
- type: "line3D",
1555
- data: l.map((k, y) => {
1556
- const I = m.values[y];
1557
- return [y, w, I ?? 0];
1558
- }),
1559
- lineStyle: { color: Ce(w, r, Ee), width: 3, opacity: 0.9 },
1560
- name: m.name
1561
- })), E = {
1963
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
1964
+ /** @param {any} [s] @returns {any} */
1965
+ (m) => !ee.has(m.name)
1966
+ ) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = c.map(
1967
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
1968
+ (m, w) => ({
1969
+ type: "line3D",
1970
+ data: l.map(
1971
+ /** @param {any} [_] @param {any} [ci] @returns {any} */
1972
+ (k, y) => {
1973
+ const I = m.values[y];
1974
+ return [y, w, I ?? 0];
1975
+ }
1976
+ ),
1977
+ lineStyle: { color: Ce(w, r, Ee), width: 3, opacity: 0.9 },
1978
+ name: m.name
1979
+ })
1980
+ ), E = {
1562
1981
  backgroundColor: s,
1563
- legend: { show: h, data: c.map((m) => m.name), textStyle: { color: p }, type: "scroll" },
1982
+ legend: { show: h, data: c.map(
1983
+ /** @param {any} [s] @returns {any} */
1984
+ (m) => m.name
1985
+ ), textStyle: { color: p }, type: "scroll" },
1564
1986
  tooltip: {
1987
+ /** @param {any} [params] @returns {any} */
1565
1988
  formatter: (m) => {
1566
1989
  const w = l[m.value[0]] || "", k = c[m.value[1]] ? c[m.value[1]].name : "";
1567
1990
  return `${w} / ${k}: <b>${P(m.value[2])}</b>`;
@@ -1575,13 +1998,19 @@ const Lr = [
1575
1998
  },
1576
1999
  xAxis3D: {
1577
2000
  type: "category",
1578
- data: l.map((m) => ge(String(m), 12)),
2001
+ data: l.map(
2002
+ /** @param {any} [c] @returns {any} */
2003
+ (m) => ge(String(m), 12)
2004
+ ),
1579
2005
  axisLabel: { color: p, fontSize: 10 },
1580
2006
  axisLine: { lineStyle: { color: x } }
1581
2007
  },
1582
2008
  yAxis3D: {
1583
2009
  type: "category",
1584
- data: c.map((m) => ge(String(m.name), 12)),
2010
+ data: c.map(
2011
+ /** @param {any} [s] @returns {any} */
2012
+ (m) => ge(String(m.name), 12)
2013
+ ),
1585
2014
  axisLabel: { color: p, fontSize: 10 },
1586
2015
  axisLine: { lineStyle: { color: x } }
1587
2016
  },
@@ -1597,15 +2026,22 @@ const Lr = [
1597
2026
  return /* @__PURE__ */ e.createElement("div", { style: { width: "100%", height: f, background: s, borderRadius: r.radiusSm || "8px", overflow: "hidden" } }, /* @__PURE__ */ e.createElement(nr, { chartType: n, echartsRef: C, option: E }));
1598
2027
  }
1599
2028
  if (n === "scatter3d") {
1600
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((y) => !ee.has(y.name)) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc";
2029
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
2030
+ /** @param {any} [s] @returns {any} */
2031
+ (y) => !ee.has(y.name)
2032
+ ) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc";
1601
2033
  if (c.length < 2)
1602
2034
  return /* @__PURE__ */ e.createElement(Se, { message: "3D Scatter needs at least two numeric measures (X and Y).", theme: r, chartHeight: W });
1603
- const g = c[0], E = c[1], m = c[2] || null, w = l.map((y, I) => ({
1604
- value: [g.values[I] ?? 0, E.values[I] ?? 0, m ? m.values[I] ?? 0 : I],
1605
- name: String(y)
1606
- })), k = {
2035
+ const g = c[0], E = c[1], m = c[2] || null, w = l.map(
2036
+ /** @param {any} [cat] @param {any} [ci] @returns {any} */
2037
+ (y, I) => ({
2038
+ value: [g.values[I] ?? 0, E.values[I] ?? 0, m ? m.values[I] ?? 0 : I],
2039
+ name: String(y)
2040
+ })
2041
+ ), k = {
1607
2042
  backgroundColor: s,
1608
2043
  tooltip: {
2044
+ /** @param {any} [params] @returns {any} */
1609
2045
  formatter: (y) => `${l[y.dataIndex] || ""}<br/>X=${P(y.value[0])}, Y=${P(y.value[1])}, Z=${P(y.value[2])}`
1610
2046
  },
1611
2047
  grid3D: {
@@ -1642,6 +2078,7 @@ const Lr = [
1642
2078
  itemStyle: { color: Ce(0, r, Ee), opacity: 0.85 },
1643
2079
  label: {
1644
2080
  show: S,
2081
+ /** @param {any} [params] @returns {any} */
1645
2082
  formatter: (y) => String(l[y.dataIndex] || ""),
1646
2083
  textStyle: { color: p, fontSize: 10 }
1647
2084
  },
@@ -1651,7 +2088,10 @@ const Lr = [
1651
2088
  return /* @__PURE__ */ e.createElement("div", { style: { width: "100%", height: f, background: s, borderRadius: r.radiusSm || "8px", overflow: "hidden" } }, /* @__PURE__ */ e.createElement(nr, { chartType: n, echartsRef: C, option: k }));
1652
2089
  }
1653
2090
  if (n === "range") {
1654
- const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter((y) => !ee.has(y.name)) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = r.gridLine || r.border || "#eee";
2091
+ const l = Array.isArray(t && t.categories) ? t.categories : [], c = Array.isArray(t && t.series) ? t.series.filter(
2092
+ /** @param {any} [s] @returns {any} */
2093
+ (y) => !ee.has(y.name)
2094
+ ) : [], s = r.chartBg || r.surface || "#fff", p = r.text || "#333", x = r.border || "#ccc", g = r.gridLine || r.border || "#eee";
1655
2095
  if (c.length < 2)
1656
2096
  return /* @__PURE__ */ e.createElement(Se, { message: "Range chart needs at least two measures (low and high values).", theme: r, chartHeight: W });
1657
2097
  const E = [];
@@ -1663,7 +2103,10 @@ const Lr = [
1663
2103
  m.push({
1664
2104
  type: "bar",
1665
2105
  name: `_base_${I}`,
1666
- data: l.map((M, v) => Math.min(y.low.values[v] ?? 0, y.high.values[v] ?? 0)),
2106
+ data: l.map(
2107
+ /** @param {any} [_] @param {any} [ci] @returns {any} */
2108
+ (M, v) => Math.min(y.low.values[v] ?? 0, y.high.values[v] ?? 0)
2109
+ ),
1667
2110
  stack: `range_${I}`,
1668
2111
  itemStyle: { opacity: 0 },
1669
2112
  emphasis: { disabled: !0 },
@@ -1672,12 +2115,16 @@ const Lr = [
1672
2115
  }), m.push({
1673
2116
  type: "bar",
1674
2117
  name: `${y.low.name} – ${y.high.name}`,
1675
- data: l.map((M, v) => Math.abs((y.high.values[v] ?? 0) - (y.low.values[v] ?? 0))),
2118
+ data: l.map(
2119
+ /** @param {any} [_] @param {any} [ci] @returns {any} */
2120
+ (M, v) => Math.abs((y.high.values[v] ?? 0) - (y.low.values[v] ?? 0))
2121
+ ),
1676
2122
  stack: `range_${I}`,
1677
2123
  itemStyle: { color: j, opacity: 0.9 },
1678
2124
  label: {
1679
2125
  show: S,
1680
2126
  position: "inside",
2127
+ /** @param {any} [params] @returns {any} */
1681
2128
  formatter: (M) => {
1682
2129
  const v = M.dataIndex, B = y.low.values[v] ?? 0, D = y.high.values[v] ?? 0;
1683
2130
  return `${P(Math.min(B, D))}–${P(Math.max(B, D))}`;
@@ -1686,6 +2133,7 @@ const Lr = [
1686
2133
  fontSize: 10
1687
2134
  },
1688
2135
  tooltip: {
2136
+ /** @param {any} [params] @returns {any} */
1689
2137
  formatter: (M) => {
1690
2138
  const v = M.dataIndex;
1691
2139
  return `${l[v]}<br/>${y.low.name}: ${P(y.low.values[v] ?? 0)}<br/>${y.high.name}: ${P(y.high.values[v] ?? 0)}`;
@@ -1698,7 +2146,10 @@ const Lr = [
1698
2146
  tooltip: { trigger: "axis" },
1699
2147
  xAxis: {
1700
2148
  type: "category",
1701
- data: l.map((y) => ge(String(y), 14)),
2149
+ data: l.map(
2150
+ /** @param {any} [c] @returns {any} */
2151
+ (y) => ge(String(y), 14)
2152
+ ),
1702
2153
  axisLabel: { color: p, fontSize: 10 },
1703
2154
  axisLine: { lineStyle: { color: x } },
1704
2155
  splitLine: { show: !1 }
@@ -1717,10 +2168,22 @@ const Lr = [
1717
2168
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { style: { width: "100%", height: f, background: s, borderRadius: r.radiusSm || "8px", overflow: "hidden" } }, /* @__PURE__ */ e.createElement(nr, { chartType: n, echartsRef: C, option: k })), h ? /* @__PURE__ */ e.createElement(St, { items: w, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1718
2169
  }
1719
2170
  if (n === "scatter") {
1720
- const l = Array.isArray(t && t.series) ? t.series.filter((A) => !ee.has(A.name)) : [], c = Array.isArray(t && t.categories) ? t.categories : [], s = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [];
2171
+ const l = Array.isArray(t && t.series) ? t.series.filter(
2172
+ /** @param {any} [s] @returns {any} */
2173
+ (A) => !ee.has(A.name)
2174
+ ) : [], c = Array.isArray(t && t.categories) ? t.categories : [], s = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [];
1721
2175
  if (l.length < 2)
1722
2176
  return /* @__PURE__ */ e.createElement(Se, { message: "Scatter charts need at least two numeric measures (X and Y).", theme: r, chartHeight: W });
1723
- const p = l[0], x = l.slice(1), g = (p.values || []).filter((A) => typeof A == "number" && Number.isFinite(A)), E = x.flatMap((A) => (A.values || []).filter((L) => typeof L == "number" && Number.isFinite(L)));
2177
+ const p = l[0], x = l.slice(1), g = (p.values || []).filter(
2178
+ /** @param {any} [v] @returns {any} */
2179
+ (A) => typeof A == "number" && Number.isFinite(A)
2180
+ ), E = x.flatMap(
2181
+ /** @param {any} [s] @returns {any} */
2182
+ (A) => (A.values || []).filter(
2183
+ /** @param {any} [v] @returns {any} */
2184
+ (L) => typeof L == "number" && Number.isFinite(L)
2185
+ )
2186
+ );
1724
2187
  if (g.length === 0 || E.length === 0)
1725
2188
  return /* @__PURE__ */ e.createElement(Se, { message: "Not enough numeric data for a scatter chart.", theme: r, chartHeight: W });
1726
2189
  let m = Math.min(...g), w = Math.max(...g), k = Math.min(...E), y = Math.max(...E);
@@ -1734,7 +2197,10 @@ const Lr = [
1734
2197
  }
1735
2198
  const I = (w - m) * 0.06, j = (y - k) * 0.06;
1736
2199
  m -= I, w += I, k -= j, y += j;
1737
- const v = { top: 24, right: 20, bottom: 64, left: Math.max(52, Wt(P(y), 11) + 16) }, B = Z - v.left - v.right, D = W - v.top - v.bottom, H = (A) => v.left + (A - m) / (w - m) * B, G = (A) => v.top + (y - A) / (y - k) * D, se = Yt(m, w, 5), b = Yt(k, y, 5), q = x.map((A, L) => ({ label: A.name, color: he(A.name, L) })), le = typeof $ == "function";
2200
+ const v = { top: 24, right: 20, bottom: 64, left: Math.max(52, Wt(P(y), 11) + 16) }, B = Z - v.left - v.right, D = W - v.top - v.bottom, H = (A) => v.left + (A - m) / (w - m) * B, G = (A) => v.top + (y - A) / (y - k) * D, se = Yt(m, w, 5), b = Yt(k, y, 5), q = x.map(
2201
+ /** @param {any} [s] @param {any} [i] @returns {any} */
2202
+ (A, L) => ({ label: A.name, color: he(A.name, L) })
2203
+ ), le = typeof $ == "function";
1738
2204
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { style: { position: "relative", width: "100%" }, ...We }, /* @__PURE__ */ e.createElement(
1739
2205
  "svg",
1740
2206
  {
@@ -1744,59 +2210,80 @@ const Lr = [
1744
2210
  preserveAspectRatio: "xMidYMid meet",
1745
2211
  style: { display: "block", overflow: "visible" }
1746
2212
  },
1747
- b.map((A, L) => /* @__PURE__ */ e.createElement("g", { key: `y-tick-${L}` }, /* @__PURE__ */ e.createElement("line", { x1: v.left, y1: G(A), x2: Z - v.right, y2: G(A), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: v.left - 8, y: G(A) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec, style: { pointerEvents: "none" } }, P(A)))),
1748
- se.map((A, L) => /* @__PURE__ */ e.createElement("g", { key: `x-tick-${L}` }, /* @__PURE__ */ e.createElement("line", { x1: H(A), y1: v.top, x2: H(A), y2: W - v.bottom, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: H(A), y: W - v.bottom + 18, textAnchor: "middle", fontSize: "11", fill: r.textSec, style: { pointerEvents: "none" } }, P(A)))),
2213
+ b.map(
2214
+ /** @param {any} [tick] @param {any} [i] @returns {any} */
2215
+ (A, L) => /* @__PURE__ */ e.createElement("g", { key: `y-tick-${L}` }, /* @__PURE__ */ e.createElement("line", { x1: v.left, y1: G(A), x2: Z - v.right, y2: G(A), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: v.left - 8, y: G(A) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec, style: { pointerEvents: "none" } }, P(A)))
2216
+ ),
2217
+ se.map(
2218
+ /** @param {any} [tick] @param {any} [i] @returns {any} */
2219
+ (A, L) => /* @__PURE__ */ e.createElement("g", { key: `x-tick-${L}` }, /* @__PURE__ */ e.createElement("line", { x1: H(A), y1: v.top, x2: H(A), y2: W - v.bottom, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: H(A), y: W - v.bottom + 18, textAnchor: "middle", fontSize: "11", fill: r.textSec, style: { pointerEvents: "none" } }, P(A)))
2220
+ ),
1749
2221
  /* @__PURE__ */ e.createElement("line", { x1: v.left, y1: W - v.bottom, x2: Z - v.right, y2: W - v.bottom, stroke: r.border }),
1750
2222
  /* @__PURE__ */ e.createElement("line", { x1: v.left, y1: v.top, x2: v.left, y2: W - v.bottom, stroke: r.border }),
1751
2223
  /* @__PURE__ */ e.createElement("text", { x: Z / 2, y: W - 8, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, p.name),
1752
2224
  K ? /* @__PURE__ */ e.createElement("text", { x: 14, y: (v.top + W - v.bottom) / 2, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec, transform: `rotate(-90, 14, ${(v.top + W - v.bottom) / 2})`, style: { pointerEvents: "none" } }, K) : null,
1753
- x.map((A, L) => {
1754
- const ce = he(A.name, L);
1755
- return (A.values || []).map((oe, ae) => {
1756
- const N = p.values[ae];
1757
- if (typeof N != "number" || !Number.isFinite(N) || typeof oe != "number" || !Number.isFinite(oe)) return null;
1758
- const re = H(N), fe = G(oe), Ne = c[ae] || `Point ${ae + 1}`, er = s[ae], wt = {
1759
- "data-tip-cat": Ne,
1760
- "data-tip-ser": `${A.name} (${p.name}=${P(N)})`,
1761
- "data-tip-val": P(oe),
1762
- "data-tip-color": ce
1763
- };
1764
- return e.cloneElement(Rt(re, fe, ce, wt, {
1765
- style: le && er ? { cursor: "pointer" } : void 0,
1766
- onClick: le && er ? () => $(er) : void 0
1767
- }), { key: `scatter-${L}-${ae}` });
1768
- });
1769
- }),
1770
- S ? x.map((A, L) => {
1771
- const ce = he(A.name, L);
1772
- return (A.values || []).map((oe, ae) => {
1773
- const N = p.values[ae];
1774
- return typeof N != "number" || !Number.isFinite(N) || typeof oe != "number" || !Number.isFinite(oe) ? null : /* @__PURE__ */ e.createElement(
1775
- "text",
1776
- {
1777
- key: `scatter-label-${L}-${ae}`,
1778
- x: H(N),
1779
- y: G(oe) - 8,
1780
- textAnchor: "middle",
1781
- fontSize: "10",
1782
- fontWeight: "700",
1783
- fill: ce,
1784
- style: { pointerEvents: "none" }
1785
- },
1786
- P(oe)
2225
+ x.map(
2226
+ /** @param {any} [series] @param {any} [seriesIndex] @returns {any} */
2227
+ (A, L) => {
2228
+ const ce = he(A.name, L);
2229
+ return (A.values || []).map(
2230
+ /** @param {any} [yVal] @param {any} [pointIndex] @returns {any} */
2231
+ (oe, ae) => {
2232
+ const N = p.values[ae];
2233
+ if (typeof N != "number" || !Number.isFinite(N) || typeof oe != "number" || !Number.isFinite(oe)) return null;
2234
+ const re = H(N), fe = G(oe), Ne = c[ae] || `Point ${ae + 1}`, er = s[ae], wt = {
2235
+ "data-tip-cat": Ne,
2236
+ "data-tip-ser": `${A.name} (${p.name}=${P(N)})`,
2237
+ "data-tip-val": P(oe),
2238
+ "data-tip-color": ce
2239
+ };
2240
+ return e.cloneElement(Rt(re, fe, ce, wt, {
2241
+ style: le && er ? { cursor: "pointer" } : void 0,
2242
+ onClick: le && er ? () => $(er) : void 0
2243
+ }), { key: `scatter-${L}-${ae}` });
2244
+ }
1787
2245
  );
1788
- });
1789
- }) : null
2246
+ }
2247
+ ),
2248
+ S ? x.map(
2249
+ /** @param {any} [series] @param {any} [seriesIndex] @returns {any} */
2250
+ (A, L) => {
2251
+ const ce = he(A.name, L);
2252
+ return (A.values || []).map(
2253
+ /** @param {any} [yVal] @param {any} [pointIndex] @returns {any} */
2254
+ (oe, ae) => {
2255
+ const N = p.values[ae];
2256
+ return typeof N != "number" || !Number.isFinite(N) || typeof oe != "number" || !Number.isFinite(oe) ? null : /* @__PURE__ */ e.createElement(
2257
+ "text",
2258
+ {
2259
+ key: `scatter-label-${L}-${ae}`,
2260
+ x: H(N),
2261
+ y: G(oe) - 8,
2262
+ textAnchor: "middle",
2263
+ fontSize: "10",
2264
+ fontWeight: "700",
2265
+ fill: ce,
2266
+ style: { pointerEvents: "none" }
2267
+ },
2268
+ P(oe)
2269
+ );
2270
+ }
2271
+ );
2272
+ }
2273
+ ) : null
1790
2274
  ), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: q, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1791
2275
  }
1792
2276
  if (n === "waterfall") {
1793
2277
  const l = Array.isArray(t && t.series) && t.series.length > 0 ? t.series[0] : null, c = Array.isArray(t && t.categories) ? t.categories : [], s = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [];
1794
2278
  if (!l || c.length === 0)
1795
2279
  return /* @__PURE__ */ e.createElement(Se, { message: "Waterfall charts need categories and at least one numeric measure.", theme: r, chartHeight: W });
1796
- const p = c.map((A, L) => {
1797
- const ce = l.values[L];
1798
- return typeof ce == "number" && Number.isFinite(ce) ? ce : 0;
1799
- }), x = [];
2280
+ const p = c.map(
2281
+ /** @param {any} [_] @param {any} [i] @returns {any} */
2282
+ (A, L) => {
2283
+ const ce = l.values[L];
2284
+ return typeof ce == "number" && Number.isFinite(ce) ? ce : 0;
2285
+ }
2286
+ ), x = [];
1800
2287
  let g = 0;
1801
2288
  for (let A = 0; A < p.length; A++) {
1802
2289
  const L = g;
@@ -1825,7 +2312,10 @@ const Lr = [
1825
2312
  preserveAspectRatio: "xMidYMid meet",
1826
2313
  style: { display: "block", overflow: "visible" }
1827
2314
  },
1828
- y.map((A, L) => /* @__PURE__ */ e.createElement("g", { key: `wf-tick-${L}` }, /* @__PURE__ */ e.createElement("line", { x1: j.left, y1: B(A), x2: Z - j.right, y2: B(A), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: j.left - 8, y: B(A) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec, style: { pointerEvents: "none" } }, P(A)))),
2315
+ y.map(
2316
+ /** @param {any} [tick] @param {any} [i] @returns {any} */
2317
+ (A, L) => /* @__PURE__ */ e.createElement("g", { key: `wf-tick-${L}` }, /* @__PURE__ */ e.createElement("line", { x1: j.left, y1: B(A), x2: Z - j.right, y2: B(A), stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: j.left - 8, y: B(A) + 4, textAnchor: "end", fontSize: "11", fill: r.textSec, style: { pointerEvents: "none" } }, P(A)))
2318
+ ),
1829
2319
  /* @__PURE__ */ e.createElement("line", { x1: j.left, y1: B(0), x2: Z - j.right, y2: B(0), stroke: r.textSec, strokeOpacity: "0.5" }),
1830
2320
  K ? /* @__PURE__ */ e.createElement("text", { x: 14, y: (j.top + W - j.bottom) / 2, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec, transform: `rotate(-90, 14, ${(j.top + W - j.bottom) / 2})`, style: { pointerEvents: "none" } }, K) : null,
1831
2321
  x.map((A, L) => {
@@ -1887,21 +2377,60 @@ const Lr = [
1887
2377
  ), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: le, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
1888
2378
  }
1889
2379
  if (n === "combo") {
1890
- const l = (Array.isArray(t && t.layers) ? t.layers : []).filter((b) => b && !b.hidden && !ee.has(b.name) && Array.isArray(b.values) && b.values.some((q) => q !== null));
2380
+ const l = (Array.isArray(t && t.layers) ? t.layers : []).filter(
2381
+ /** @param {any} [layer] @returns {any} */
2382
+ (b) => b && !b.hidden && !ee.has(b.name) && Array.isArray(b.values) && b.values.some(
2383
+ /** @param {any} [value] @returns {any} */
2384
+ (q) => q !== null
2385
+ )
2386
+ );
1891
2387
  if (l.length === 0)
1892
2388
  return /* @__PURE__ */ e.createElement(Se, { message: t.emptyMessage || "No combo layers are configured.", theme: r, chartHeight: W });
1893
- const c = l.some((b) => b.axis === "right"), s = { top: 24, right: c ? 76 : 20, bottom: 96, left: 72 }, p = Math.max(1, Array.isArray(t.categories) ? t.categories.length : 0), x = Math.max(1, (Z - s.left - s.right) / p), g = Math.max(22, Math.min(72, x * 0.72)), E = l.filter((b) => b.type === "bar"), m = l.filter((b) => b.type === "area"), w = l.filter((b) => b.type === "line"), k = Or(
1894
- l.filter((b) => b.axis !== "right").flatMap((b) => b.values),
2389
+ const c = l.some(
2390
+ /** @param {any} [layer] @returns {any} */
2391
+ (b) => b.axis === "right"
2392
+ ), s = { top: 24, right: c ? 76 : 20, bottom: 96, left: 72 }, p = Math.max(1, Array.isArray(t.categories) ? t.categories.length : 0), x = Math.max(1, (Z - s.left - s.right) / p), g = Math.max(22, Math.min(72, x * 0.72)), E = l.filter(
2393
+ /** @param {any} [layer] @returns {any} */
2394
+ (b) => b.type === "bar"
2395
+ ), m = l.filter(
2396
+ /** @param {any} [layer] @returns {any} */
2397
+ (b) => b.type === "area"
2398
+ ), w = l.filter(
2399
+ /** @param {any} [layer] @returns {any} */
2400
+ (b) => b.type === "line"
2401
+ ), k = Or(
2402
+ l.filter(
2403
+ /** @param {any} [layer] @returns {any} */
2404
+ (b) => b.axis !== "right"
2405
+ ).flatMap(
2406
+ /** @param {any} [layer] @returns {any} */
2407
+ (b) => b.values
2408
+ ),
1895
2409
  W,
1896
2410
  s
1897
2411
  ), y = c ? Or(
1898
- l.filter((b) => b.axis === "right").flatMap((b) => b.values),
2412
+ l.filter(
2413
+ /** @param {any} [layer] @returns {any} */
2414
+ (b) => b.axis === "right"
2415
+ ).flatMap(
2416
+ /** @param {any} [layer] @returns {any} */
2417
+ (b) => b.values
2418
+ ),
1899
2419
  W,
1900
2420
  s
1901
- ) : k, I = Array.isArray(t.categoryTargets) ? t.categoryTargets : [], j = l.map((b, q) => ({
1902
- label: b.name,
1903
- color: b.color || Ce(q, r, Ee)
1904
- })), M = (b) => b.axis === "right" ? y.scaleY : k.scaleY, v = (b) => b.axis === "right" ? y.baselineY : k.baselineY, B = (b) => (q) => zt(q, b.valueFormat || J || "auto"), D = l.find((b) => b.axis === "right"), H = D ? B(D) : P, G = 4, se = Math.max(8, (g - (Math.max(E.length, 1) - 1) * G) / Math.max(E.length, 1));
2421
+ ) : k, I = Array.isArray(t.categoryTargets) ? t.categoryTargets : [], j = l.map(
2422
+ /** @param {any} [layer] @param {any} [index] @returns {any} */
2423
+ (b, q) => ({
2424
+ label: b.name,
2425
+ color: b.color || Ce(q, r, Ee)
2426
+ })
2427
+ ), M = (b) => b.axis === "right" ? y.scaleY : k.scaleY, v = (b) => b.axis === "right" ? y.baselineY : k.baselineY, B = (b) => (
2428
+ /** @param {any} [v] @returns {any} */
2429
+ ((q) => zt(q, b.valueFormat || J || "auto"))
2430
+ ), D = l.find(
2431
+ /** @param {any} [layer] @returns {any} */
2432
+ (b) => b.axis === "right"
2433
+ ), H = D ? B(D) : P, G = 4, se = Math.max(8, (g - (Math.max(E.length, 1) - 1) * G) / Math.max(E.length, 1));
1905
2434
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement(
1906
2435
  "svg",
1907
2436
  {
@@ -1918,46 +2447,52 @@ const Lr = [
1918
2447
  role: "img",
1919
2448
  "aria-label": t.title || "Combo chart"
1920
2449
  },
1921
- k.tickValues.map((b, q) => {
1922
- const le = k.scaleY(b);
1923
- return /* @__PURE__ */ e.createElement("g", { key: `combo-left-tick-${q}` }, /* @__PURE__ */ e.createElement(
1924
- "line",
1925
- {
1926
- x1: s.left,
1927
- x2: Z - s.right,
1928
- y1: le,
1929
- y2: le,
1930
- stroke: r.border,
1931
- strokeOpacity: "0.7",
1932
- strokeDasharray: "4 4"
1933
- }
1934
- ), /* @__PURE__ */ e.createElement(
1935
- "text",
1936
- {
1937
- x: s.left - 10,
1938
- y: le + 4,
1939
- textAnchor: "end",
1940
- fontSize: "11",
1941
- fill: r.textSec
1942
- },
1943
- P(b)
1944
- ));
1945
- }),
1946
- c ? y.tickValues.map((b, q) => {
1947
- const le = y.scaleY(b);
1948
- return /* @__PURE__ */ e.createElement(
1949
- "text",
1950
- {
1951
- key: `combo-right-tick-${q}`,
1952
- x: Z - s.right + 10,
1953
- y: le + 4,
1954
- textAnchor: "start",
1955
- fontSize: "11",
1956
- fill: r.textSec
1957
- },
1958
- H(b)
1959
- );
1960
- }) : null,
2450
+ k.tickValues.map(
2451
+ /** @param {any} [tickValue] @param {any} [index] @returns {any} */
2452
+ (b, q) => {
2453
+ const le = k.scaleY(b);
2454
+ return /* @__PURE__ */ e.createElement("g", { key: `combo-left-tick-${q}` }, /* @__PURE__ */ e.createElement(
2455
+ "line",
2456
+ {
2457
+ x1: s.left,
2458
+ x2: Z - s.right,
2459
+ y1: le,
2460
+ y2: le,
2461
+ stroke: r.border,
2462
+ strokeOpacity: "0.7",
2463
+ strokeDasharray: "4 4"
2464
+ }
2465
+ ), /* @__PURE__ */ e.createElement(
2466
+ "text",
2467
+ {
2468
+ x: s.left - 10,
2469
+ y: le + 4,
2470
+ textAnchor: "end",
2471
+ fontSize: "11",
2472
+ fill: r.textSec
2473
+ },
2474
+ P(b)
2475
+ ));
2476
+ }
2477
+ ),
2478
+ c ? y.tickValues.map(
2479
+ /** @param {any} [tickValue] @param {any} [index] @returns {any} */
2480
+ (b, q) => {
2481
+ const le = y.scaleY(b);
2482
+ return /* @__PURE__ */ e.createElement(
2483
+ "text",
2484
+ {
2485
+ key: `combo-right-tick-${q}`,
2486
+ x: Z - s.right + 10,
2487
+ y: le + 4,
2488
+ textAnchor: "start",
2489
+ fontSize: "11",
2490
+ fill: r.textSec
2491
+ },
2492
+ H(b)
2493
+ );
2494
+ }
2495
+ ) : null,
1961
2496
  K ? /* @__PURE__ */ e.createElement("text", { x: 14, y: (s.top + W - s.bottom) / 2, textAnchor: "middle", fontSize: "11", fontWeight: "700", fill: r.textSec, transform: `rotate(-90, 14, ${(s.top + W - s.bottom) / 2})`, style: { pointerEvents: "none" } }, K) : null,
1962
2497
  /* @__PURE__ */ e.createElement(
1963
2498
  "line",
@@ -1970,143 +2505,194 @@ const Lr = [
1970
2505
  strokeOpacity: "0.45"
1971
2506
  }
1972
2507
  ),
1973
- E.map((b, q) => t.categories.map((le, A) => {
1974
- const L = b.values[A];
1975
- if (L == null) return null;
1976
- const ce = s.left + A * x + (x - g) / 2, oe = M(b), ae = v(b), N = oe(L), re = b.color || Ce(q, r, Ee), fe = ce + q * (se + G), Ne = B(b);
1977
- return /* @__PURE__ */ e.createElement(e.Fragment, { key: `${b.id}-${le}-${q}` }, /* @__PURE__ */ e.createElement(
1978
- "rect",
1979
- {
1980
- x: fe,
1981
- y: Math.min(N, ae),
1982
- width: se,
1983
- height: Math.max(1, Math.abs(ae - N)),
1984
- rx: "3",
1985
- fill: re,
1986
- opacity: "0.9",
1987
- "data-tip-cat": le,
1988
- "data-tip-ser": b.name,
1989
- "data-tip-val": Ne(L),
1990
- "data-tip-color": re
1991
- }
1992
- ), S ? /* @__PURE__ */ e.createElement(
1993
- "text",
1994
- {
1995
- x: fe + se / 2,
1996
- y: L >= 0 ? Math.min(N, ae) - 4 : Math.max(N, ae) + 12,
1997
- textAnchor: "middle",
1998
- fontSize: "9",
1999
- fontWeight: "700",
2000
- fill: r.textSec,
2001
- style: { pointerEvents: "none" }
2002
- },
2003
- Ne(L)
2004
- ) : null);
2005
- })),
2006
- m.map((b, q) => {
2007
- const le = t.categories.map((ae, N) => {
2008
- const re = b.values[N];
2009
- if (re == null) return null;
2010
- const fe = s.left + N * x + x / 2, Ne = M(b);
2011
- return {
2012
- x: fe,
2013
- y: Ne(re),
2014
- baseY: v(b),
2015
- rawValue: re
2016
- };
2017
- }), A = Yr(le), L = gr(le), ce = b.color || Ce(E.length + q, r, Ee), oe = B(b);
2018
- return /* @__PURE__ */ e.createElement("g", { key: `combo-area-${b.id}` }, A ? /* @__PURE__ */ e.createElement("path", { d: A, fill: ce, opacity: "0.16", style: { pointerEvents: "none" } }) : null, L ? /* @__PURE__ */ e.createElement("path", { d: L, fill: "none", stroke: ce, strokeWidth: "2.5", strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: yr(mt[b.name]), style: { pointerEvents: "none" } }) : null, le.map((ae, N) => ae ? /* @__PURE__ */ e.createElement(e.Fragment, { key: `${b.id}-area-pt-${N}` }, /* @__PURE__ */ e.createElement(
2019
- "circle",
2020
- {
2021
- cx: ae.x,
2022
- cy: ae.y,
2023
- r: "4",
2024
- fill: ce,
2025
- stroke: r.surfaceBg || r.background || "#fff",
2026
- strokeWidth: "2",
2027
- "data-tip-cat": t.categories[N],
2028
- "data-tip-ser": b.name,
2029
- "data-tip-val": oe(ae.rawValue),
2030
- "data-tip-color": ce
2031
- }
2032
- ), S ? /* @__PURE__ */ e.createElement("text", { x: ae.x, y: ae.y - 8, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, oe(ae.rawValue)) : null) : null));
2033
- }),
2034
- w.map((b, q) => {
2035
- const le = t.categories.map((oe, ae) => {
2036
- const N = b.values[ae];
2037
- return N == null ? null : {
2038
- x: s.left + ae * x + x / 2,
2039
- y: M(b)(N),
2040
- rawValue: N
2041
- };
2042
- }), A = gr(le), L = b.color || Ce(E.length + m.length + q, r, Ee), ce = B(b);
2043
- return /* @__PURE__ */ e.createElement("g", { key: `combo-line-${b.id}` }, A ? /* @__PURE__ */ e.createElement("path", { d: A, fill: "none", stroke: L, strokeWidth: "3", strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: yr(mt[b.name]), style: { pointerEvents: "none" } }) : null, le.map((oe, ae) => oe ? /* @__PURE__ */ e.createElement(e.Fragment, { key: `${b.id}-point-${ae}` }, /* @__PURE__ */ e.createElement(
2044
- "circle",
2045
- {
2046
- cx: oe.x,
2047
- cy: oe.y,
2048
- r: "4",
2049
- fill: L,
2050
- stroke: r.surfaceBg || r.background || "#fff",
2051
- strokeWidth: "2",
2052
- "data-tip-cat": t.categories[ae],
2053
- "data-tip-ser": b.name,
2054
- "data-tip-val": ce(oe.rawValue),
2055
- "data-tip-color": L
2056
- }
2057
- ), S ? /* @__PURE__ */ e.createElement("text", { x: oe.x, y: oe.y - 8, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, ce(oe.rawValue)) : null) : null));
2058
- }),
2059
- t.categories.map((b, q) => {
2060
- const le = s.left + q * x + x / 2;
2061
- return /* @__PURE__ */ e.createElement(
2062
- "text",
2063
- {
2064
- key: `combo-label-${q}`,
2065
- x: le,
2066
- y: W - s.bottom + 28,
2067
- textAnchor: "middle",
2068
- fontSize: "11",
2069
- fill: r.textSec
2070
- },
2071
- ge(b, 18)
2072
- );
2073
- }),
2074
- typeof $ == "function" ? t.categories.map((b, q) => {
2075
- const le = I[q];
2076
- return le ? /* @__PURE__ */ e.createElement(
2077
- "rect",
2078
- {
2079
- key: `combo-hit-${q}`,
2080
- x: s.left + q * x,
2081
- y: s.top,
2082
- width: x,
2083
- height: W - s.top - s.bottom,
2084
- fill: "transparent",
2085
- style: { cursor: "pointer" },
2086
- onClick: () => $(le)
2508
+ E.map(
2509
+ /** @param {any} [layer] @param {any} [barLayerIndex] @returns {any} */
2510
+ (b, q) => t.categories.map(
2511
+ /** @param {any} [category] @param {any} [categoryIndex] @returns {any} */
2512
+ (le, A) => {
2513
+ const L = b.values[A];
2514
+ if (L == null) return null;
2515
+ const ce = s.left + A * x + (x - g) / 2, oe = M(b), ae = v(b), N = oe(L), re = b.color || Ce(q, r, Ee), fe = ce + q * (se + G), Ne = B(b);
2516
+ return /* @__PURE__ */ e.createElement(e.Fragment, { key: `${b.id}-${le}-${q}` }, /* @__PURE__ */ e.createElement(
2517
+ "rect",
2518
+ {
2519
+ x: fe,
2520
+ y: Math.min(N, ae),
2521
+ width: se,
2522
+ height: Math.max(1, Math.abs(ae - N)),
2523
+ rx: "3",
2524
+ fill: re,
2525
+ opacity: "0.9",
2526
+ "data-tip-cat": le,
2527
+ "data-tip-ser": b.name,
2528
+ "data-tip-val": Ne(L),
2529
+ "data-tip-color": re
2530
+ }
2531
+ ), S ? /* @__PURE__ */ e.createElement(
2532
+ "text",
2533
+ {
2534
+ x: fe + se / 2,
2535
+ y: L >= 0 ? Math.min(N, ae) - 4 : Math.max(N, ae) + 12,
2536
+ textAnchor: "middle",
2537
+ fontSize: "9",
2538
+ fontWeight: "700",
2539
+ fill: r.textSec,
2540
+ style: { pointerEvents: "none" }
2541
+ },
2542
+ Ne(L)
2543
+ ) : null);
2087
2544
  }
2088
- ) : null;
2089
- }) : null
2545
+ )
2546
+ ),
2547
+ m.map(
2548
+ /** @param {any} [layer] @param {any} [layerIndex] @returns {any} */
2549
+ (b, q) => {
2550
+ const le = t.categories.map(
2551
+ /** @param {any} [_] @param {any} [categoryIndex] @returns {any} */
2552
+ (ae, N) => {
2553
+ const re = b.values[N];
2554
+ if (re == null) return null;
2555
+ const fe = s.left + N * x + x / 2, Ne = M(b);
2556
+ return {
2557
+ x: fe,
2558
+ y: Ne(re),
2559
+ baseY: v(b),
2560
+ rawValue: re
2561
+ };
2562
+ }
2563
+ ), A = Yr(le), L = gr(le), ce = b.color || Ce(E.length + q, r, Ee), oe = B(b);
2564
+ return /* @__PURE__ */ e.createElement("g", { key: `combo-area-${b.id}` }, A ? /* @__PURE__ */ e.createElement("path", { d: A, fill: ce, opacity: "0.16", style: { pointerEvents: "none" } }) : null, L ? /* @__PURE__ */ e.createElement("path", { d: L, fill: "none", stroke: ce, strokeWidth: "2.5", strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: yr(mt[b.name]), style: { pointerEvents: "none" } }) : null, le.map(
2565
+ /** @param {any} [point] @param {any} [pointIndex] @returns {any} */
2566
+ (ae, N) => ae ? /* @__PURE__ */ e.createElement(e.Fragment, { key: `${b.id}-area-pt-${N}` }, /* @__PURE__ */ e.createElement(
2567
+ "circle",
2568
+ {
2569
+ cx: ae.x,
2570
+ cy: ae.y,
2571
+ r: "4",
2572
+ fill: ce,
2573
+ stroke: r.surfaceBg || r.background || "#fff",
2574
+ strokeWidth: "2",
2575
+ "data-tip-cat": t.categories[N],
2576
+ "data-tip-ser": b.name,
2577
+ "data-tip-val": oe(ae.rawValue),
2578
+ "data-tip-color": ce
2579
+ }
2580
+ ), S ? /* @__PURE__ */ e.createElement("text", { x: ae.x, y: ae.y - 8, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, oe(ae.rawValue)) : null) : null
2581
+ ));
2582
+ }
2583
+ ),
2584
+ w.map(
2585
+ /** @param {any} [layer] @param {any} [layerIndex] @returns {any} */
2586
+ (b, q) => {
2587
+ const le = t.categories.map(
2588
+ /** @param {any} [_] @param {any} [categoryIndex] @returns {any} */
2589
+ (oe, ae) => {
2590
+ const N = b.values[ae];
2591
+ return N == null ? null : {
2592
+ x: s.left + ae * x + x / 2,
2593
+ y: M(b)(N),
2594
+ rawValue: N
2595
+ };
2596
+ }
2597
+ ), A = gr(le), L = b.color || Ce(E.length + m.length + q, r, Ee), ce = B(b);
2598
+ return /* @__PURE__ */ e.createElement("g", { key: `combo-line-${b.id}` }, A ? /* @__PURE__ */ e.createElement("path", { d: A, fill: "none", stroke: L, strokeWidth: "3", strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: yr(mt[b.name]), style: { pointerEvents: "none" } }) : null, le.map(
2599
+ /** @param {any} [point] @param {any} [pointIndex] @returns {any} */
2600
+ (oe, ae) => oe ? /* @__PURE__ */ e.createElement(e.Fragment, { key: `${b.id}-point-${ae}` }, /* @__PURE__ */ e.createElement(
2601
+ "circle",
2602
+ {
2603
+ cx: oe.x,
2604
+ cy: oe.y,
2605
+ r: "4",
2606
+ fill: L,
2607
+ stroke: r.surfaceBg || r.background || "#fff",
2608
+ strokeWidth: "2",
2609
+ "data-tip-cat": t.categories[ae],
2610
+ "data-tip-ser": b.name,
2611
+ "data-tip-val": ce(oe.rawValue),
2612
+ "data-tip-color": L
2613
+ }
2614
+ ), S ? /* @__PURE__ */ e.createElement("text", { x: oe.x, y: oe.y - 8, textAnchor: "middle", fontSize: "9", fontWeight: "700", fill: r.textSec, style: { pointerEvents: "none" } }, ce(oe.rawValue)) : null) : null
2615
+ ));
2616
+ }
2617
+ ),
2618
+ t.categories.map(
2619
+ /** @param {any} [category] @param {any} [categoryIndex] @returns {any} */
2620
+ (b, q) => {
2621
+ const le = s.left + q * x + x / 2;
2622
+ return /* @__PURE__ */ e.createElement(
2623
+ "text",
2624
+ {
2625
+ key: `combo-label-${q}`,
2626
+ x: le,
2627
+ y: W - s.bottom + 28,
2628
+ textAnchor: "middle",
2629
+ fontSize: "11",
2630
+ fill: r.textSec
2631
+ },
2632
+ ge(b, 18)
2633
+ );
2634
+ }
2635
+ ),
2636
+ typeof $ == "function" ? t.categories.map(
2637
+ /** @param {any} [_] @param {any} [categoryIndex] @returns {any} */
2638
+ (b, q) => {
2639
+ const le = I[q];
2640
+ return le ? /* @__PURE__ */ e.createElement(
2641
+ "rect",
2642
+ {
2643
+ key: `combo-hit-${q}`,
2644
+ x: s.left + q * x,
2645
+ y: s.top,
2646
+ width: x,
2647
+ height: W - s.top - s.bottom,
2648
+ fill: "transparent",
2649
+ style: { cursor: "pointer" },
2650
+ onClick: () => $(le)
2651
+ }
2652
+ ) : null;
2653
+ }
2654
+ ) : null
2090
2655
  ), De, we, Ie, Xe), h ? /* @__PURE__ */ e.createElement(St, { items: j, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
2091
2656
  }
2092
2657
  if (!d)
2093
2658
  return /* @__PURE__ */ e.createElement(Se, { message: "No numeric data available for this chart.", theme: r, chartHeight: W });
2094
2659
  const wr = Yt(d.minValue, d.maxValue, U || 5), Ct = Oe ? Array.from(new Set(
2095
- (t.stackedGroups || []).reduce((l, c) => ((c.segments || []).forEach((s) => {
2096
- s && s.label && l.push(s.label);
2097
- }), l), [])
2098
- )) : [], dr = Ct.reduce((l, c, s) => (l[c] = Ce(s, r, Ee), l), {}), $t = Oe ? Ct.map((l) => ({ label: l, color: dr[l] || Ce(0, r, Ee) })) : (t.series || []).map((l, c) => ({
2099
- label: l.name,
2100
- color: he(l.name, c)
2101
- })), Jt = d.hasHierarchicalBands ? t.categoryBands.reduce((l, c, s) => {
2102
- const p = l[l.length - 1];
2103
- return p && p.groupKey === c.groupKey ? (p.endIndex = s, l) : (l.push({
2104
- groupKey: c.groupKey,
2105
- outerLabel: c.outerLabel,
2106
- startIndex: s,
2107
- endIndex: s
2108
- }), l);
2109
- }, []) : [], Xt = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [], Sr = typeof $ == "function" && Xt.length === t.categories.length;
2660
+ (t.stackedGroups || []).reduce(
2661
+ /** @param {any} [labels] @param {any} [group] @returns {any} */
2662
+ (l, c) => ((c.segments || []).forEach(
2663
+ /** @param {any} [segment] @returns {any} */
2664
+ (s) => {
2665
+ s && s.label && l.push(s.label);
2666
+ }
2667
+ ), l),
2668
+ []
2669
+ )
2670
+ )) : [], dr = Ct.reduce(
2671
+ /** @param {any} [acc] @param {any} [label] @param {any} [index] @returns {any} */
2672
+ (l, c, s) => (l[c] = Ce(s, r, Ee), l),
2673
+ {}
2674
+ ), $t = Oe ? Ct.map(
2675
+ /** @param {any} [label] @returns {any} */
2676
+ (l) => ({ label: l, color: dr[l] || Ce(0, r, Ee) })
2677
+ ) : (t.series || []).map(
2678
+ /** @param {any} [series] @param {any} [index] @returns {any} */
2679
+ (l, c) => ({
2680
+ label: l.name,
2681
+ color: he(l.name, c)
2682
+ })
2683
+ ), Jt = d.hasHierarchicalBands ? t.categoryBands.reduce(
2684
+ /** @param {any} [groups] @param {any} [band] @param {any} [index] @returns {any} */
2685
+ (l, c, s) => {
2686
+ const p = l[l.length - 1];
2687
+ return p && p.groupKey === c.groupKey ? (p.endIndex = s, l) : (l.push({
2688
+ groupKey: c.groupKey,
2689
+ outerLabel: c.outerLabel,
2690
+ startIndex: s,
2691
+ endIndex: s
2692
+ }), l);
2693
+ },
2694
+ []
2695
+ ) : [], Xt = Array.isArray(t && t.categoryTargets) ? t.categoryTargets : [], Sr = typeof $ == "function" && Xt.length === t.categories.length;
2110
2696
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "10px" } }, /* @__PURE__ */ e.createElement("div", { ref: Ye, style: { width: "100%", minWidth: 0, position: "relative", ...Be }, ...We }, /* @__PURE__ */ e.createElement(
2111
2697
  "svg",
2112
2698
  {
@@ -2124,14 +2710,20 @@ const Lr = [
2124
2710
  "aria-label": t.title,
2125
2711
  onClick: de ? dt : void 0
2126
2712
  },
2127
- ie ? /* @__PURE__ */ e.createElement("defs", null, (t.series || []).map((l, c) => {
2128
- const s = he(l.name, c), p = Br.find((g) => g.value === ir) || Br[0], x = Rn(s, nt);
2129
- return /* @__PURE__ */ e.createElement("linearGradient", { key: `grad-${c}`, id: `pg-grad-${c}`, x1: p.x1, y1: p.y1, x2: p.x2, y2: p.y2 }, /* @__PURE__ */ e.createElement("stop", { offset: x[0].offset, stopColor: s, stopOpacity: x[0].stopOpacity }), /* @__PURE__ */ e.createElement("stop", { offset: x[1].offset, stopColor: s, stopOpacity: x[1].stopOpacity }));
2130
- })) : null,
2131
- wr.map((l, c) => {
2132
- const s = d.scaleY ? d.scaleY(l) : null, p = d.scaleX ? d.scaleX(l) : null, x = Pe ? `${Math.round(l)}%` : P(l);
2133
- return /* @__PURE__ */ e.createElement("g", { key: `tick-${c}` }, d.horizontalBarMode ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("line", { x1: p, y1: d.margin.top, x2: p, y2: W - d.margin.bottom, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: p, y: W - d.margin.bottom + 18, textAnchor: "middle", fontSize: "11", fill: r.textSec, "data-chart-element-type": "axis", "data-chart-element-id": "x", style: de ? { cursor: "pointer" } : void 0 }, x)) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("line", { x1: d.margin.left, y1: s, x2: Z - d.margin.right, y2: s, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: d.margin.left - 8, y: s + 4, textAnchor: "end", fontSize: "11", fill: r.textSec, "data-chart-element-type": "axis", "data-chart-element-id": "y", style: de ? { cursor: "pointer" } : void 0 }, x)));
2134
- }),
2713
+ ie ? /* @__PURE__ */ e.createElement("defs", null, (t.series || []).map(
2714
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
2715
+ (l, c) => {
2716
+ const s = he(l.name, c), p = Br.find((g) => g.value === ir) || Br[0], x = Rn(s, nt);
2717
+ return /* @__PURE__ */ e.createElement("linearGradient", { key: `grad-${c}`, id: `pg-grad-${c}`, x1: p.x1, y1: p.y1, x2: p.x2, y2: p.y2 }, /* @__PURE__ */ e.createElement("stop", { offset: x[0].offset, stopColor: s, stopOpacity: x[0].stopOpacity }), /* @__PURE__ */ e.createElement("stop", { offset: x[1].offset, stopColor: s, stopOpacity: x[1].stopOpacity }));
2718
+ }
2719
+ )) : null,
2720
+ wr.map(
2721
+ /** @param {any} [tickValue] @param {any} [index] @returns {any} */
2722
+ (l, c) => {
2723
+ const s = d.scaleY ? d.scaleY(l) : null, p = d.scaleX ? d.scaleX(l) : null, x = Pe ? `${Math.round(l)}%` : P(l);
2724
+ return /* @__PURE__ */ e.createElement("g", { key: `tick-${c}` }, d.horizontalBarMode ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("line", { x1: p, y1: d.margin.top, x2: p, y2: W - d.margin.bottom, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: p, y: W - d.margin.bottom + 18, textAnchor: "middle", fontSize: "11", fill: r.textSec, "data-chart-element-type": "axis", "data-chart-element-id": "x", style: de ? { cursor: "pointer" } : void 0 }, x)) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("line", { x1: d.margin.left, y1: s, x2: Z - d.margin.right, y2: s, stroke: r.border, strokeDasharray: "3 4" }), /* @__PURE__ */ e.createElement("text", { x: d.margin.left - 8, y: s + 4, textAnchor: "end", fontSize: "11", fill: r.textSec, "data-chart-element-type": "axis", "data-chart-element-id": "y", style: de ? { cursor: "pointer" } : void 0 }, x)));
2725
+ }
2726
+ ),
2135
2727
  /* @__PURE__ */ e.createElement(
2136
2728
  "line",
2137
2729
  {
@@ -2170,9 +2762,13 @@ const Lr = [
2170
2762
  if (M <= 0) return;
2171
2763
  const v = (D) => {
2172
2764
  const H = k - (D.clientY - w) / y * M;
2173
- Te((G) => G.map(
2174
- (se, b) => b === c ? { ...se, value: String(Math.round(H * 1e3) / 1e3) } : se
2175
- ));
2765
+ Te(
2766
+ /** @param {any} [prev] @returns {any} */
2767
+ (G) => G.map(
2768
+ /** @param {any} [l] @param {any} [j] @returns {any} */
2769
+ (se, b) => b === c ? { ...se, value: String(Math.round(H * 1e3) / 1e3) } : se
2770
+ )
2771
+ );
2176
2772
  }, B = () => {
2177
2773
  window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", B);
2178
2774
  };
@@ -2181,371 +2777,425 @@ const Lr = [
2181
2777
  }
2182
2778
  ) : null);
2183
2779
  }),
2184
- Vt && !d.horizontalBarMode && (n === "bar" || n === "line" || n === "area" || n === "scatter") && Array.isArray(t.series) && t.series.length > 0 && d.scaleY ? t.series.filter((c) => !ee.has(c.name)).map((c, s) => {
2185
- const p = c.values || [], x = ct === "moving_avg" ? ta(p, et) : ea(p);
2186
- if (!x) return null;
2187
- const g = x.map((k, y) => Number.isFinite(k) ? { x: d.margin.left + y * d.step + d.step / 2, y: d.scaleY(k) } : null), E = gr(g);
2188
- if (!E) return null;
2189
- const m = he(c.name, s), w = Tt || m;
2190
- return /* @__PURE__ */ e.createElement(
2191
- "path",
2192
- {
2193
- key: `trendline-${s}`,
2194
- d: E,
2195
- fill: "none",
2196
- stroke: w,
2197
- strokeWidth: String(Ut || 2),
2198
- strokeDasharray: "8 4",
2199
- strokeLinecap: "round",
2200
- opacity: "0.78",
2201
- style: { pointerEvents: "none" }
2202
- }
2203
- );
2204
- }) : null,
2205
- d.hasHierarchicalBands && Jt.map((l, c) => {
2206
- if (c === Jt.length - 1) return null;
2207
- const s = d.horizontalBarMode ? d.margin.top + (l.endIndex + 1) * d.step : d.margin.left + (l.endIndex + 1) * d.step;
2208
- return /* @__PURE__ */ e.createElement(
2209
- "line",
2210
- {
2211
- key: `group-divider-${l.groupKey}-${c}`,
2212
- x1: d.horizontalBarMode ? d.margin.left : s,
2213
- y1: d.horizontalBarMode ? s : d.margin.top,
2214
- x2: d.horizontalBarMode ? Z - d.margin.right : s,
2215
- y2: d.horizontalBarMode ? s : W - d.margin.bottom + 58,
2216
- stroke: r.border,
2217
- strokeDasharray: "4 4"
2218
- }
2219
- );
2220
- }),
2221
- Oe && (t.stackedGroups || []).map((l, c) => {
2222
- const s = d.horizontalBarMode ? d.margin.top + c * d.step + (d.step - d.groupWidth) / 2 : d.margin.left + c * d.step + (d.step - d.groupWidth) / 2, p = Math.max(14, d.groupWidth * 0.64);
2223
- let x = 0, g = 0;
2224
- return /* @__PURE__ */ e.createElement("g", { key: `stacked-group-${l.key}` }, (l.segments || []).map((E) => {
2225
- const m = E && typeof E.value == "number" && Number.isFinite(E.value) ? E.value : null;
2226
- if (m === null) return null;
2227
- const w = m >= 0 ? x : g, k = w + m;
2228
- m >= 0 ? x = k : g = k;
2229
- const y = dr[E.label] || Ce(0, r, Ee);
2230
- if (d.horizontalBarMode) {
2231
- const B = d.scaleX(w), D = d.scaleX(k);
2232
- return /* @__PURE__ */ e.createElement(
2233
- "rect",
2234
- {
2235
- key: `${l.key}-${E.path || E.label}`,
2236
- x: Math.min(B, D),
2237
- y: s,
2238
- width: Math.max(1, Math.abs(D - B)),
2239
- height: p,
2240
- rx: "3",
2241
- fill: y,
2242
- opacity: "0.94",
2243
- "data-tip-cat": l.label,
2244
- "data-tip-ser": E.label,
2245
- "data-tip-val": P(m),
2246
- "data-tip-color": y
2247
- }
2248
- );
2249
- }
2250
- const I = d.scaleY(w), j = d.scaleY(k), M = Math.min(I, j), v = Math.max(1, Math.abs(j - I));
2780
+ Vt && !d.horizontalBarMode && (n === "bar" || n === "line" || n === "area" || n === "scatter") && Array.isArray(t.series) && t.series.length > 0 && d.scaleY ? t.series.filter(
2781
+ /** @param {any} [s] @returns {any} */
2782
+ (c) => !ee.has(c.name)
2783
+ ).map(
2784
+ /** @param {any} [ser] @param {any} [tsi] @returns {any} */
2785
+ (c, s) => {
2786
+ const p = c.values || [], x = ct === "moving_avg" ? ta(p, et) : ea(p);
2787
+ if (!x) return null;
2788
+ const g = x.map(
2789
+ /** @param {any} [v] @param {any} [i] @returns {any} */
2790
+ (k, y) => Number.isFinite(k) ? { x: d.margin.left + y * d.step + d.step / 2, y: d.scaleY(k) } : null
2791
+ ), E = gr(g);
2792
+ if (!E) return null;
2793
+ const m = he(c.name, s), w = Tt || m;
2251
2794
  return /* @__PURE__ */ e.createElement(
2252
- "rect",
2795
+ "path",
2253
2796
  {
2254
- key: `${l.key}-${E.path || E.label}`,
2255
- x: s,
2256
- y: M,
2257
- width: p,
2258
- height: v,
2259
- rx: "3",
2260
- fill: y,
2261
- opacity: "0.94",
2262
- "data-tip-cat": l.label,
2263
- "data-tip-ser": E.label,
2264
- "data-tip-val": P(m),
2265
- "data-tip-color": y
2797
+ key: `trendline-${s}`,
2798
+ d: E,
2799
+ fill: "none",
2800
+ stroke: w,
2801
+ strokeWidth: String(Ut || 2),
2802
+ strokeDasharray: "8 4",
2803
+ strokeLinecap: "round",
2804
+ opacity: "0.78",
2805
+ style: { pointerEvents: "none" }
2266
2806
  }
2267
2807
  );
2268
- }), d.horizontalBarMode ? /* @__PURE__ */ e.createElement(
2269
- "text",
2270
- {
2271
- x: d.margin.left - 10,
2272
- y: s + p / 2 + 4,
2273
- textAnchor: "end",
2274
- fontSize: "11",
2275
- fill: r.textSec
2276
- },
2277
- ge(l.label, 22)
2278
- ) : /* @__PURE__ */ e.createElement(
2279
- "text",
2280
- {
2281
- x: s + p / 2,
2282
- y: W - d.margin.bottom + 30,
2283
- textAnchor: "middle",
2284
- fontSize: "11",
2285
- fill: r.textSec
2286
- },
2287
- ge(l.label, 20)
2288
- ));
2289
- }),
2290
- !Oe && n === "bar" && t.categories.map((l, c) => {
2291
- const s = d.horizontalBarMode ? d.margin.top + c * d.step + (d.step - d.groupWidth) / 2 : d.margin.left + c * d.step + (d.step - d.groupWidth) / 2, p = Lt || Pe ? Math.max(14, d.groupWidth * 0.64) : Math.max(6, d.groupWidth / Math.max(t.series.length, 1) - 4);
2292
- let x = 0, g = 0;
2293
- return /* @__PURE__ */ e.createElement("g", { key: `bar-group-${l}` }, t.series.map((E, m) => {
2294
- if (ee.has(E.name)) return null;
2295
- const w = E.values[c];
2296
- if (w == null) return null;
2297
- const k = he(E.name, m), y = ie ? `url(#pg-grad-${m})` : k;
2298
- if (Lt || Pe) {
2299
- const v = Pe && ve ? ve[c] : null, B = Pe && v ? w / v * 100 : w, D = B >= 0 ? x : g, H = D + B;
2300
- B >= 0 ? x = H : g = H;
2301
- const G = Pe ? `${(Math.abs(w / v) * 100).toFixed(1)}% (${P(w)})` : P(w), se = { "data-tip-cat": l, "data-tip-ser": E.name, "data-tip-val": G, "data-tip-color": k };
2302
- if (d.horizontalBarMode) {
2303
- const le = d.scaleX(D), A = d.scaleX(H);
2808
+ }
2809
+ ) : null,
2810
+ d.hasHierarchicalBands && Jt.map(
2811
+ /** @param {any} [group] @param {any} [groupIndex] @returns {any} */
2812
+ (l, c) => {
2813
+ if (c === Jt.length - 1) return null;
2814
+ const s = d.horizontalBarMode ? d.margin.top + (l.endIndex + 1) * d.step : d.margin.left + (l.endIndex + 1) * d.step;
2815
+ return /* @__PURE__ */ e.createElement(
2816
+ "line",
2817
+ {
2818
+ key: `group-divider-${l.groupKey}-${c}`,
2819
+ x1: d.horizontalBarMode ? d.margin.left : s,
2820
+ y1: d.horizontalBarMode ? s : d.margin.top,
2821
+ x2: d.horizontalBarMode ? Z - d.margin.right : s,
2822
+ y2: d.horizontalBarMode ? s : W - d.margin.bottom + 58,
2823
+ stroke: r.border,
2824
+ strokeDasharray: "4 4"
2825
+ }
2826
+ );
2827
+ }
2828
+ ),
2829
+ Oe && (t.stackedGroups || []).map(
2830
+ /** @param {any} [group] @param {any} [groupIndex] @returns {any} */
2831
+ (l, c) => {
2832
+ const s = d.horizontalBarMode ? d.margin.top + c * d.step + (d.step - d.groupWidth) / 2 : d.margin.left + c * d.step + (d.step - d.groupWidth) / 2, p = Math.max(14, d.groupWidth * 0.64);
2833
+ let x = 0, g = 0;
2834
+ return /* @__PURE__ */ e.createElement("g", { key: `stacked-group-${l.key}` }, (l.segments || []).map(
2835
+ /** @param {any} [segment] @returns {any} */
2836
+ (E) => {
2837
+ const m = E && typeof E.value == "number" && Number.isFinite(E.value) ? E.value : null;
2838
+ if (m === null) return null;
2839
+ const w = m >= 0 ? x : g, k = w + m;
2840
+ m >= 0 ? x = k : g = k;
2841
+ const y = dr[E.label] || Ce(0, r, Ee);
2842
+ if (d.horizontalBarMode) {
2843
+ const B = d.scaleX(w), D = d.scaleX(k);
2844
+ return /* @__PURE__ */ e.createElement(
2845
+ "rect",
2846
+ {
2847
+ key: `${l.key}-${E.path || E.label}`,
2848
+ x: Math.min(B, D),
2849
+ y: s,
2850
+ width: Math.max(1, Math.abs(D - B)),
2851
+ height: p,
2852
+ rx: "3",
2853
+ fill: y,
2854
+ opacity: "0.94",
2855
+ "data-tip-cat": l.label,
2856
+ "data-tip-ser": E.label,
2857
+ "data-tip-val": P(m),
2858
+ "data-tip-color": y
2859
+ }
2860
+ );
2861
+ }
2862
+ const I = d.scaleY(w), j = d.scaleY(k), M = Math.min(I, j), v = Math.max(1, Math.abs(j - I));
2304
2863
  return /* @__PURE__ */ e.createElement(
2305
2864
  "rect",
2306
2865
  {
2307
- key: `${E.name}-${l}`,
2308
- x: Math.min(le, A),
2309
- y: s,
2310
- width: Math.max(1, Math.abs(A - le)),
2311
- height: p,
2866
+ key: `${l.key}-${E.path || E.label}`,
2867
+ x: s,
2868
+ y: M,
2869
+ width: p,
2870
+ height: v,
2312
2871
  rx: "3",
2313
2872
  fill: y,
2314
- opacity: "0.92",
2315
- style: { transition: it ? "width 0.35s ease, x 0.35s ease" : void 0 },
2316
- ...se
2873
+ opacity: "0.94",
2874
+ "data-tip-cat": l.label,
2875
+ "data-tip-ser": E.label,
2876
+ "data-tip-val": P(m),
2877
+ "data-tip-color": y
2317
2878
  }
2318
2879
  );
2319
2880
  }
2320
- const b = d.scaleY(D), q = d.scaleY(H);
2321
- return /* @__PURE__ */ e.createElement(
2322
- "rect",
2323
- {
2324
- key: `${E.name}-${l}`,
2325
- x: s,
2326
- y: Math.min(b, q),
2327
- width: p,
2328
- height: Math.max(1, Math.abs(q - b)),
2329
- rx: "3",
2330
- fill: y,
2331
- opacity: "0.92",
2332
- style: { transition: it ? "height 0.35s ease, y 0.35s ease" : void 0 },
2333
- ...se
2881
+ ), d.horizontalBarMode ? /* @__PURE__ */ e.createElement(
2882
+ "text",
2883
+ {
2884
+ x: d.margin.left - 10,
2885
+ y: s + p / 2 + 4,
2886
+ textAnchor: "end",
2887
+ fontSize: "11",
2888
+ fill: r.textSec
2889
+ },
2890
+ ge(l.label, 22)
2891
+ ) : /* @__PURE__ */ e.createElement(
2892
+ "text",
2893
+ {
2894
+ x: s + p / 2,
2895
+ y: W - d.margin.bottom + 30,
2896
+ textAnchor: "middle",
2897
+ fontSize: "11",
2898
+ fill: r.textSec
2899
+ },
2900
+ ge(l.label, 20)
2901
+ ));
2902
+ }
2903
+ ),
2904
+ !Oe && n === "bar" && t.categories.map(
2905
+ /** @param {any} [category] @param {any} [categoryIndex] @returns {any} */
2906
+ (l, c) => {
2907
+ const s = d.horizontalBarMode ? d.margin.top + c * d.step + (d.step - d.groupWidth) / 2 : d.margin.left + c * d.step + (d.step - d.groupWidth) / 2, p = Lt || Pe ? Math.max(14, d.groupWidth * 0.64) : Math.max(6, d.groupWidth / Math.max(t.series.length, 1) - 4);
2908
+ let x = 0, g = 0;
2909
+ return /* @__PURE__ */ e.createElement("g", { key: `bar-group-${l}` }, t.series.map(
2910
+ /** @param {any} [series] @param {any} [seriesIndex] @returns {any} */
2911
+ (E, m) => {
2912
+ if (ee.has(E.name)) return null;
2913
+ const w = E.values[c];
2914
+ if (w == null) return null;
2915
+ const k = he(E.name, m), y = ie ? `url(#pg-grad-${m})` : k;
2916
+ if (Lt || Pe) {
2917
+ const v = Pe && ve ? ve[c] : null, B = Pe && v ? w / v * 100 : w, D = B >= 0 ? x : g, H = D + B;
2918
+ B >= 0 ? x = H : g = H;
2919
+ const G = Pe ? `${(Math.abs(w / v) * 100).toFixed(1)}% (${P(w)})` : P(w), se = { "data-tip-cat": l, "data-tip-ser": E.name, "data-tip-val": G, "data-tip-color": k };
2920
+ if (d.horizontalBarMode) {
2921
+ const le = d.scaleX(D), A = d.scaleX(H);
2922
+ return /* @__PURE__ */ e.createElement(
2923
+ "rect",
2924
+ {
2925
+ key: `${E.name}-${l}`,
2926
+ x: Math.min(le, A),
2927
+ y: s,
2928
+ width: Math.max(1, Math.abs(A - le)),
2929
+ height: p,
2930
+ rx: "3",
2931
+ fill: y,
2932
+ opacity: "0.92",
2933
+ style: { transition: it ? "width 0.35s ease, x 0.35s ease" : void 0 },
2934
+ ...se
2935
+ }
2936
+ );
2937
+ }
2938
+ const b = d.scaleY(D), q = d.scaleY(H);
2939
+ return /* @__PURE__ */ e.createElement(
2940
+ "rect",
2941
+ {
2942
+ key: `${E.name}-${l}`,
2943
+ x: s,
2944
+ y: Math.min(b, q),
2945
+ width: p,
2946
+ height: Math.max(1, Math.abs(q - b)),
2947
+ rx: "3",
2948
+ fill: y,
2949
+ opacity: "0.92",
2950
+ style: { transition: it ? "height 0.35s ease, y 0.35s ease" : void 0 },
2951
+ ...se
2952
+ }
2953
+ );
2334
2954
  }
2335
- );
2336
- }
2337
- if (d.horizontalBarMode) {
2338
- const v = d.scaleX(w), B = s + m * (p + 4);
2339
- return /* @__PURE__ */ e.createElement(e.Fragment, { key: `${E.name}-${l}` }, /* @__PURE__ */ e.createElement(
2340
- "rect",
2341
- {
2342
- x: Math.min(v, d.baselineX),
2343
- y: B,
2344
- width: Math.max(1, Math.abs(d.baselineX - v)),
2345
- height: p,
2346
- rx: "3",
2347
- fill: y,
2348
- opacity: "0.9",
2349
- style: { transition: it ? "width 0.35s ease, x 0.35s ease" : void 0 },
2350
- "data-tip-cat": l,
2351
- "data-tip-ser": E.name,
2352
- "data-tip-val": P(w),
2353
- "data-tip-color": k
2955
+ if (d.horizontalBarMode) {
2956
+ const v = d.scaleX(w), B = s + m * (p + 4);
2957
+ return /* @__PURE__ */ e.createElement(e.Fragment, { key: `${E.name}-${l}` }, /* @__PURE__ */ e.createElement(
2958
+ "rect",
2959
+ {
2960
+ x: Math.min(v, d.baselineX),
2961
+ y: B,
2962
+ width: Math.max(1, Math.abs(d.baselineX - v)),
2963
+ height: p,
2964
+ rx: "3",
2965
+ fill: y,
2966
+ opacity: "0.9",
2967
+ style: { transition: it ? "width 0.35s ease, x 0.35s ease" : void 0 },
2968
+ "data-tip-cat": l,
2969
+ "data-tip-ser": E.name,
2970
+ "data-tip-val": P(w),
2971
+ "data-tip-color": k
2972
+ }
2973
+ ), S ? /* @__PURE__ */ e.createElement(
2974
+ "text",
2975
+ {
2976
+ x: w >= 0 ? Math.max(v, d.baselineX) + 4 : Math.min(v, d.baselineX) - 4,
2977
+ y: B + p / 2 + 3,
2978
+ textAnchor: w >= 0 ? "start" : "end",
2979
+ fontSize: "9",
2980
+ fontWeight: "700",
2981
+ fill: r.textSec,
2982
+ style: { pointerEvents: "none" }
2983
+ },
2984
+ P(w)
2985
+ ) : null);
2354
2986
  }
2355
- ), S ? /* @__PURE__ */ e.createElement(
2356
- "text",
2357
- {
2358
- x: w >= 0 ? Math.max(v, d.baselineX) + 4 : Math.min(v, d.baselineX) - 4,
2359
- y: B + p / 2 + 3,
2360
- textAnchor: w >= 0 ? "start" : "end",
2361
- fontSize: "9",
2362
- fontWeight: "700",
2363
- fill: r.textSec,
2364
- style: { pointerEvents: "none" }
2365
- },
2366
- P(w)
2367
- ) : null);
2987
+ const I = d.scaleY(w), j = Math.max(1, Math.abs(d.baselineY - I)), M = s + m * (p + 4);
2988
+ return /* @__PURE__ */ e.createElement(e.Fragment, { key: `${E.name}-${l}` }, /* @__PURE__ */ e.createElement(
2989
+ "rect",
2990
+ {
2991
+ x: M,
2992
+ y: Math.min(I, d.baselineY),
2993
+ width: p,
2994
+ height: j,
2995
+ rx: "3",
2996
+ fill: y,
2997
+ opacity: "0.9",
2998
+ style: { transition: it ? "height 0.35s ease, y 0.35s ease" : void 0, cursor: de ? "pointer" : void 0 },
2999
+ "data-tip-cat": l,
3000
+ "data-tip-ser": E.name,
3001
+ "data-tip-val": P(w),
3002
+ "data-tip-color": k,
3003
+ "data-chart-element-type": "series",
3004
+ "data-chart-element-id": E.name
3005
+ }
3006
+ ), S ? /* @__PURE__ */ e.createElement(
3007
+ "text",
3008
+ {
3009
+ x: M + p / 2,
3010
+ y: w >= 0 ? Math.min(I, d.baselineY) - 4 : Math.max(I, d.baselineY) + 12,
3011
+ textAnchor: "middle",
3012
+ fontSize: "9",
3013
+ fontWeight: "700",
3014
+ fill: r.textSec,
3015
+ style: { pointerEvents: "none" }
3016
+ },
3017
+ P(w)
3018
+ ) : null);
3019
+ }
3020
+ ));
3021
+ }
3022
+ ),
3023
+ (n === "line" || n === "area") && (() => {
3024
+ const l = t.categories.map(() => 0), c = t.categories.map(() => 0);
3025
+ return t.series.map(
3026
+ /** @param {any} [series] @param {any} [seriesIndex] @returns {any} */
3027
+ (s, p) => {
3028
+ if (ee.has(s.name)) return null;
3029
+ const x = he(s.name, p), g = t.categories.map(
3030
+ /** @param {any} [_] @param {any} [categoryIndex] @returns {any} */
3031
+ (w, k) => {
3032
+ const y = s.values[k];
3033
+ if (y == null) return null;
3034
+ const I = d.margin.left + k * d.step + d.step / 2;
3035
+ if (yt || Pe) {
3036
+ const j = Pe && ve ? ve[k] : null, M = Pe && j ? y / j * 100 : y, v = M >= 0 ? l[k] : c[k], B = v + M;
3037
+ return M >= 0 ? l[k] = B : c[k] = B, {
3038
+ x: I,
3039
+ y: d.scaleY(B),
3040
+ baseY: d.scaleY(v),
3041
+ rawValue: y
3042
+ };
3043
+ }
3044
+ return {
3045
+ x: I,
3046
+ y: d.scaleY(y),
3047
+ baseY: d.baselineY,
3048
+ rawValue: y
3049
+ };
3050
+ }
3051
+ ), E = gr(g), m = n === "area" ? Yr(g) : "";
3052
+ return /* @__PURE__ */ e.createElement("g", { key: `${s.name}-${n}` }, n === "area" && m && /* @__PURE__ */ e.createElement("path", { d: m, fill: ie ? `url(#pg-grad-${p})` : x, opacity: yt || Pe ? "0.46" : "0.16", style: { pointerEvents: "none" } }), E && /* @__PURE__ */ e.createElement("path", { d: E, fill: "none", stroke: x, strokeWidth: "3", strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: yr(mt[s.name]), style: { pointerEvents: "none" } }), g.map(
3053
+ /** @param {any} [point] @param {any} [pointIndex] @returns {any} */
3054
+ (w, k) => w ? /* @__PURE__ */ e.createElement(e.Fragment, { key: `${s.name}-${k}` }, e.cloneElement(Rt(w.x, w.y, x, {
3055
+ "data-tip-cat": t.categories[k],
3056
+ "data-tip-ser": s.name,
3057
+ "data-tip-val": P(w.rawValue),
3058
+ "data-tip-color": x
3059
+ }), { key: `marker-${p}-${k}` }), S ? /* @__PURE__ */ e.createElement(
3060
+ "text",
3061
+ {
3062
+ x: w.x,
3063
+ y: w.y - 8,
3064
+ textAnchor: "middle",
3065
+ fontSize: "9",
3066
+ fontWeight: "700",
3067
+ fill: r.textSec,
3068
+ style: { pointerEvents: "none" }
3069
+ },
3070
+ P(w.rawValue)
3071
+ ) : null) : null
3072
+ ));
2368
3073
  }
2369
- const I = d.scaleY(w), j = Math.max(1, Math.abs(d.baselineY - I)), M = s + m * (p + 4);
2370
- return /* @__PURE__ */ e.createElement(e.Fragment, { key: `${E.name}-${l}` }, /* @__PURE__ */ e.createElement(
3074
+ );
3075
+ })(),
3076
+ Sr && t.categories.map(
3077
+ /** @param {any} [_] @param {any} [categoryIndex] @returns {any} */
3078
+ (l, c) => {
3079
+ const s = Xt[c];
3080
+ return s ? d.horizontalBarMode ? /* @__PURE__ */ e.createElement(
2371
3081
  "rect",
2372
3082
  {
2373
- x: M,
2374
- y: Math.min(I, d.baselineY),
2375
- width: p,
2376
- height: j,
2377
- rx: "3",
2378
- fill: y,
2379
- opacity: "0.9",
2380
- style: { transition: it ? "height 0.35s ease, y 0.35s ease" : void 0, cursor: de ? "pointer" : void 0 },
2381
- "data-tip-cat": l,
2382
- "data-tip-ser": E.name,
2383
- "data-tip-val": P(w),
2384
- "data-tip-color": k,
2385
- "data-chart-element-type": "series",
2386
- "data-chart-element-id": E.name
3083
+ key: `category-hit-horizontal-${c}`,
3084
+ x: d.margin.left,
3085
+ y: d.margin.top + c * d.step,
3086
+ width: Z - d.margin.left - d.margin.right,
3087
+ height: d.step,
3088
+ fill: "transparent",
3089
+ style: { cursor: "pointer" },
3090
+ onClick: () => $(s)
2387
3091
  }
2388
- ), S ? /* @__PURE__ */ e.createElement(
3092
+ ) : /* @__PURE__ */ e.createElement(
3093
+ "rect",
3094
+ {
3095
+ key: `category-hit-vertical-${c}`,
3096
+ x: d.margin.left + c * d.step,
3097
+ y: d.margin.top,
3098
+ width: d.step,
3099
+ height: W - d.margin.top - d.margin.bottom,
3100
+ fill: "transparent",
3101
+ style: { cursor: "pointer" },
3102
+ onClick: () => $(s)
3103
+ }
3104
+ ) : null;
3105
+ }
3106
+ ),
3107
+ Oe ? null : d.horizontalBarMode ? d.hasHierarchicalBands ? /* @__PURE__ */ e.createElement(e.Fragment, null, Jt.map(
3108
+ /** @param {any} [group] @returns {any} */
3109
+ (l) => {
3110
+ const c = d.margin.top + l.startIndex * d.step, s = d.margin.top + (l.endIndex + 1) * d.step, p = (c + s) / 2;
3111
+ return /* @__PURE__ */ e.createElement("g", { key: `outer-label-horizontal-${l.groupKey}` }, /* @__PURE__ */ e.createElement(
2389
3112
  "text",
2390
3113
  {
2391
- x: M + p / 2,
2392
- y: w >= 0 ? Math.min(I, d.baselineY) - 4 : Math.max(I, d.baselineY) + 12,
2393
- textAnchor: "middle",
2394
- fontSize: "9",
3114
+ x: 10,
3115
+ y: p + 4,
3116
+ textAnchor: "start",
3117
+ fontSize: "11",
2395
3118
  fontWeight: "700",
2396
- fill: r.textSec,
2397
- style: { pointerEvents: "none" }
3119
+ fill: r.text
2398
3120
  },
2399
- P(w)
2400
- ) : null);
2401
- }));
2402
- }),
2403
- (n === "line" || n === "area") && (() => {
2404
- const l = t.categories.map(() => 0), c = t.categories.map(() => 0);
2405
- return t.series.map((s, p) => {
2406
- if (ee.has(s.name)) return null;
2407
- const x = he(s.name, p), g = t.categories.map((w, k) => {
2408
- const y = s.values[k];
2409
- if (y == null) return null;
2410
- const I = d.margin.left + k * d.step + d.step / 2;
2411
- if (yt || Pe) {
2412
- const j = Pe && ve ? ve[k] : null, M = Pe && j ? y / j * 100 : y, v = M >= 0 ? l[k] : c[k], B = v + M;
2413
- return M >= 0 ? l[k] = B : c[k] = B, {
2414
- x: I,
2415
- y: d.scaleY(B),
2416
- baseY: d.scaleY(v),
2417
- rawValue: y
2418
- };
2419
- }
2420
- return {
2421
- x: I,
2422
- y: d.scaleY(y),
2423
- baseY: d.baselineY,
2424
- rawValue: y
2425
- };
2426
- }), E = gr(g), m = n === "area" ? Yr(g) : "";
2427
- return /* @__PURE__ */ e.createElement("g", { key: `${s.name}-${n}` }, n === "area" && m && /* @__PURE__ */ e.createElement("path", { d: m, fill: ie ? `url(#pg-grad-${p})` : x, opacity: yt || Pe ? "0.46" : "0.16", style: { pointerEvents: "none" } }), E && /* @__PURE__ */ e.createElement("path", { d: E, fill: "none", stroke: x, strokeWidth: "3", strokeLinejoin: "round", strokeLinecap: "round", strokeDasharray: yr(mt[s.name]), style: { pointerEvents: "none" } }), g.map((w, k) => w ? /* @__PURE__ */ e.createElement(e.Fragment, { key: `${s.name}-${k}` }, e.cloneElement(Rt(w.x, w.y, x, {
2428
- "data-tip-cat": t.categories[k],
2429
- "data-tip-ser": s.name,
2430
- "data-tip-val": P(w.rawValue),
2431
- "data-tip-color": x
2432
- }), { key: `marker-${p}-${k}` }), S ? /* @__PURE__ */ e.createElement(
3121
+ ge(l.outerLabel, 18)
3122
+ ));
3123
+ }
3124
+ ), t.categoryBands.map(
3125
+ /** @param {any} [band] @param {any} [categoryIndex] @returns {any} */
3126
+ (l, c) => {
3127
+ const s = d.margin.top + c * d.step + d.step / 2, p = l && l.innerLabel ? String(l.innerLabel) : "";
3128
+ return p ? /* @__PURE__ */ e.createElement(
3129
+ "text",
3130
+ {
3131
+ key: `inner-label-horizontal-${c}`,
3132
+ x: d.margin.left - 10,
3133
+ y: s + 4,
3134
+ textAnchor: "end",
3135
+ fontSize: "11",
3136
+ fill: r.textSec
3137
+ },
3138
+ ge(p, 18)
3139
+ ) : null;
3140
+ }
3141
+ )) : t.categories.map(
3142
+ /** @param {any} [category] @param {any} [categoryIndex] @returns {any} */
3143
+ (l, c) => {
3144
+ const s = d.margin.top + c * d.step + d.step / 2;
3145
+ return /* @__PURE__ */ e.createElement(
3146
+ "text",
3147
+ {
3148
+ key: `label-horizontal-${c}`,
3149
+ x: d.margin.left - 10,
3150
+ y: s + 4,
3151
+ textAnchor: "end",
3152
+ fontSize: "11",
3153
+ fill: r.textSec
3154
+ },
3155
+ ge(l, 22)
3156
+ );
3157
+ }
3158
+ ) : d.hasHierarchicalBands ? /* @__PURE__ */ e.createElement(e.Fragment, null, Jt.map(
3159
+ /** @param {any} [group] @returns {any} */
3160
+ (l) => {
3161
+ const c = d.margin.left + l.startIndex * d.step, s = d.margin.left + (l.endIndex + 1) * d.step, p = (c + s) / 2;
3162
+ return /* @__PURE__ */ e.createElement("g", { key: `outer-label-${l.groupKey}` }, /* @__PURE__ */ e.createElement(
2433
3163
  "text",
2434
3164
  {
2435
- x: w.x,
2436
- y: w.y - 8,
3165
+ x: p,
3166
+ y: W - d.margin.bottom + 68,
2437
3167
  textAnchor: "middle",
2438
- fontSize: "9",
3168
+ fontSize: "11",
2439
3169
  fontWeight: "700",
2440
- fill: r.textSec,
2441
- style: { pointerEvents: "none" }
3170
+ fill: r.text
2442
3171
  },
2443
- P(w.rawValue)
2444
- ) : null) : null));
2445
- });
2446
- })(),
2447
- Sr && t.categories.map((l, c) => {
2448
- const s = Xt[c];
2449
- return s ? d.horizontalBarMode ? /* @__PURE__ */ e.createElement(
2450
- "rect",
2451
- {
2452
- key: `category-hit-horizontal-${c}`,
2453
- x: d.margin.left,
2454
- y: d.margin.top + c * d.step,
2455
- width: Z - d.margin.left - d.margin.right,
2456
- height: d.step,
2457
- fill: "transparent",
2458
- style: { cursor: "pointer" },
2459
- onClick: () => $(s)
2460
- }
2461
- ) : /* @__PURE__ */ e.createElement(
2462
- "rect",
2463
- {
2464
- key: `category-hit-vertical-${c}`,
2465
- x: d.margin.left + c * d.step,
2466
- y: d.margin.top,
2467
- width: d.step,
2468
- height: W - d.margin.top - d.margin.bottom,
2469
- fill: "transparent",
2470
- style: { cursor: "pointer" },
2471
- onClick: () => $(s)
2472
- }
2473
- ) : null;
2474
- }),
2475
- Oe ? null : d.horizontalBarMode ? d.hasHierarchicalBands ? /* @__PURE__ */ e.createElement(e.Fragment, null, Jt.map((l) => {
2476
- const c = d.margin.top + l.startIndex * d.step, s = d.margin.top + (l.endIndex + 1) * d.step, p = (c + s) / 2;
2477
- return /* @__PURE__ */ e.createElement("g", { key: `outer-label-horizontal-${l.groupKey}` }, /* @__PURE__ */ e.createElement(
2478
- "text",
2479
- {
2480
- x: 10,
2481
- y: p + 4,
2482
- textAnchor: "start",
2483
- fontSize: "11",
2484
- fontWeight: "700",
2485
- fill: r.text
2486
- },
2487
- ge(l.outerLabel, 18)
2488
- ));
2489
- }), t.categoryBands.map((l, c) => {
2490
- const s = d.margin.top + c * d.step + d.step / 2, p = l && l.innerLabel ? String(l.innerLabel) : "";
2491
- return p ? /* @__PURE__ */ e.createElement(
2492
- "text",
2493
- {
2494
- key: `inner-label-horizontal-${c}`,
2495
- x: d.margin.left - 10,
2496
- y: s + 4,
2497
- textAnchor: "end",
2498
- fontSize: "11",
2499
- fill: r.textSec
2500
- },
2501
- ge(p, 18)
2502
- ) : null;
2503
- })) : t.categories.map((l, c) => {
2504
- const s = d.margin.top + c * d.step + d.step / 2;
2505
- return /* @__PURE__ */ e.createElement(
2506
- "text",
2507
- {
2508
- key: `label-horizontal-${c}`,
2509
- x: d.margin.left - 10,
2510
- y: s + 4,
2511
- textAnchor: "end",
2512
- fontSize: "11",
2513
- fill: r.textSec
2514
- },
2515
- ge(l, 22)
2516
- );
2517
- }) : d.hasHierarchicalBands ? /* @__PURE__ */ e.createElement(e.Fragment, null, Jt.map((l) => {
2518
- const c = d.margin.left + l.startIndex * d.step, s = d.margin.left + (l.endIndex + 1) * d.step, p = (c + s) / 2;
2519
- return /* @__PURE__ */ e.createElement("g", { key: `outer-label-${l.groupKey}` }, /* @__PURE__ */ e.createElement(
2520
- "text",
2521
- {
2522
- x: p,
2523
- y: W - d.margin.bottom + 68,
2524
- textAnchor: "middle",
2525
- fontSize: "11",
2526
- fontWeight: "700",
2527
- fill: r.text
2528
- },
2529
- ge(l.outerLabel, 22)
2530
- ));
2531
- }), t.categoryBands.map((l, c) => {
2532
- const s = d.margin.left + c * d.step + d.step / 2, p = l && l.innerLabel ? String(l.innerLabel) : "";
2533
- return /* @__PURE__ */ e.createElement("g", { key: `inner-label-${c}` }, p ? /* @__PURE__ */ e.createElement(
2534
- "text",
2535
- {
2536
- x: s,
2537
- y: W - d.margin.bottom + 30,
2538
- textAnchor: "middle",
2539
- fontSize: "11",
2540
- fill: r.textSec
2541
- },
2542
- ge(p, 18)
2543
- ) : null);
2544
- })) : t.categories.map((l, c) => {
2545
- if (Ft.visibleIndexes && !Ft.visibleIndexes.has(c)) return null;
2546
- const s = d.margin.left + c * d.step + d.step / 2;
2547
- return /* @__PURE__ */ e.createElement("g", { key: `label-${c}`, transform: `translate(${s}, ${W - d.margin.bottom + 18}) rotate(${ke})` }, /* @__PURE__ */ e.createElement("text", { textAnchor: ke === 0 ? "middle" : "start", fontSize: "11", fill: r.textSec, "data-chart-element-type": "axis", "data-chart-element-id": "x", style: de ? { cursor: "pointer" } : void 0 }, /* @__PURE__ */ e.createElement("title", null, String(l)), ge(l, Ft.maxChars)));
2548
- })
3172
+ ge(l.outerLabel, 22)
3173
+ ));
3174
+ }
3175
+ ), t.categoryBands.map(
3176
+ /** @param {any} [band] @param {any} [categoryIndex] @returns {any} */
3177
+ (l, c) => {
3178
+ const s = d.margin.left + c * d.step + d.step / 2, p = l && l.innerLabel ? String(l.innerLabel) : "";
3179
+ return /* @__PURE__ */ e.createElement("g", { key: `inner-label-${c}` }, p ? /* @__PURE__ */ e.createElement(
3180
+ "text",
3181
+ {
3182
+ x: s,
3183
+ y: W - d.margin.bottom + 30,
3184
+ textAnchor: "middle",
3185
+ fontSize: "11",
3186
+ fill: r.textSec
3187
+ },
3188
+ ge(p, 18)
3189
+ ) : null);
3190
+ }
3191
+ )) : t.categories.map(
3192
+ /** @param {any} [category] @param {any} [categoryIndex] @returns {any} */
3193
+ (l, c) => {
3194
+ if (Ft.visibleIndexes && !Ft.visibleIndexes.has(c)) return null;
3195
+ const s = d.margin.left + c * d.step + d.step / 2;
3196
+ return /* @__PURE__ */ e.createElement("g", { key: `label-${c}`, transform: `translate(${s}, ${W - d.margin.bottom + 18}) rotate(${ke})` }, /* @__PURE__ */ e.createElement("text", { textAnchor: ke === 0 ? "middle" : "start", fontSize: "11", fill: r.textSec, "data-chart-element-type": "axis", "data-chart-element-id": "x", style: de ? { cursor: "pointer" } : void 0 }, /* @__PURE__ */ e.createElement("title", null, String(l)), ge(l, Ft.maxChars)));
3197
+ }
3198
+ )
2549
3199
  ), De, Ie), h ? /* @__PURE__ */ e.createElement(St, { items: $t, theme: r, hiddenSet: ee, onToggle: Qe, position: _e, onElementSelect: de }) : null);
2550
3200
  }, da = ({ chartType: t, barLayout: n, onChange: o, canStack: i, theme: r }) => {
2551
3201
  const f = (h, S = !1) => ({
@@ -2653,9 +3303,12 @@ const Lr = [
2653
3303
  color: r.textSec,
2654
3304
  fontSize: "11px",
2655
3305
  fontWeight: 700
2656
- }, S = ($, R) => (C) => {
2657
- $ && $(zn(C.target.value, R));
2658
- };
3306
+ }, S = ($, R) => (
3307
+ /** @param {any} [event] @returns {any} */
3308
+ ((C) => {
3309
+ $ && $(zn(C.target.value, R));
3310
+ })
3311
+ );
2659
3312
  return /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "8px", alignItems: "center", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement("label", { style: h }, "Rows", /* @__PURE__ */ e.createElement(
2660
3313
  "input",
2661
3314
  {
@@ -2687,16 +3340,25 @@ const Lr = [
2687
3340
  () => An(r),
2688
3341
  [r]
2689
3342
  ), R = ot(
2690
- () => new Map($.map((Y) => [Y.id, Y])),
3343
+ () => new Map($.map(
3344
+ /** @param {any} [option] @returns {any} */
3345
+ (Y) => [Y.id, Y]
3346
+ )),
2691
3347
  [$]
2692
3348
  ), C = h.trim().toLowerCase(), O = ot(
2693
- () => C ? $.filter((Y) => Y.searchText.includes(C)) : $,
3349
+ () => C ? $.filter(
3350
+ /** @param {any} [option] @returns {any} */
3351
+ (Y) => Y.searchText.includes(C)
3352
+ ) : $,
2694
3353
  [$, C]
2695
3354
  ), J = ot(() => {
2696
3355
  const Y = /* @__PURE__ */ new Map();
2697
- return O.forEach((F) => {
2698
- Y.has(F.groupLabel) || Y.set(F.groupLabel, []), Y.get(F.groupLabel).push(F);
2699
- }), Array.from(Y.entries()).map(([F, U]) => ({ label: F, options: U }));
3356
+ return O.forEach(
3357
+ /** @param {any} [option] @returns {any} */
3358
+ (F) => {
3359
+ Y.has(F.groupLabel) || Y.set(F.groupLabel, []), Y.get(F.groupLabel).push(F);
3360
+ }
3361
+ ), Array.from(Y.entries()).map(([F, U]) => ({ label: F, options: U }));
2700
3362
  }, [O]), K = {
2701
3363
  border: `1px solid ${i.border}`,
2702
3364
  background: i.surfaceBg || i.background || "#fff",
@@ -2706,20 +3368,35 @@ const Lr = [
2706
3368
  fontSize: "11px",
2707
3369
  fontWeight: 700
2708
3370
  }, a = (Y, F) => {
2709
- typeof n == "function" && n(f.map((U) => U.id === Y ? { ...U, ...F || {} } : U));
3371
+ typeof n == "function" && n(f.map(
3372
+ /** @param {any} [layer] @returns {any} */
3373
+ (U) => U.id === Y ? { ...U, ...F || {} } : U
3374
+ ));
2710
3375
  }, X = (Y, F) => {
2711
3376
  if (typeof n != "function") return;
2712
- const U = f.findIndex((pe) => pe.id === Y), ue = U + F;
3377
+ const U = f.findIndex(
3378
+ /** @param {any} [layer] @returns {any} */
3379
+ (pe) => pe.id === Y
3380
+ ), ue = U + F;
2713
3381
  if (U < 0 || ue < 0 || ue >= f.length) return;
2714
3382
  const ne = [...f], [ie] = ne.splice(U, 1);
2715
3383
  ne.splice(ue, 0, ie), n(ne);
2716
3384
  }, T = (Y) => {
2717
3385
  if (typeof n != "function") return;
2718
- const F = f.filter((U) => U.id !== Y);
3386
+ const F = f.filter(
3387
+ /** @param {any} [layer] @returns {any} */
3388
+ (U) => U.id !== Y
3389
+ );
2719
3390
  n(F.length > 0 ? F : Cn(r, 1));
2720
3391
  }, V = () => {
2721
3392
  if (typeof n != "function") return;
2722
- const Y = new Set(f.map((ue) => ue.columnId)), F = r.find((ue) => !Y.has(ue.id)) || r[0];
3393
+ const Y = new Set(f.map(
3394
+ /** @param {any} [layer] @returns {any} */
3395
+ (ue) => ue.columnId
3396
+ )), F = r.find(
3397
+ /** @param {any} [column] @returns {any} */
3398
+ (ue) => !Y.has(ue.id)
3399
+ ) || r[0];
2723
3400
  if (!F) return;
2724
3401
  const U = $n({
2725
3402
  id: `layer-${f.length + 1}`,
@@ -2749,144 +3426,159 @@ const Lr = [
2749
3426
  placeholder: "Search measures, groups, or column ids",
2750
3427
  style: { ...K, width: "100%", maxWidth: "360px" }
2751
3428
  }
2752
- ), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: i.textSec, whiteSpace: "nowrap" } }, O.length, " / ", $.length))), O.length === 0 ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", color: i.textSec, padding: "2px 2px 0 2px" } }, "No measures match the current search. Clear the search to see the full catalog.") : null, f.map((Y, F) => {
2753
- const U = R.get(Y.columnId) || null, ue = J.some((ne) => ne.options.some((ie) => ie.id === Y.columnId));
2754
- return /* @__PURE__ */ e.createElement(
2755
- "div",
2756
- {
2757
- key: Y.id,
2758
- style: {
2759
- display: "flex",
2760
- flexDirection: "column",
2761
- gap: "10px",
2762
- width: "100%",
2763
- padding: "12px",
2764
- border: `1px solid ${i.border}`,
2765
- borderRadius: i.radiusSm || "8px",
2766
- background: i.surfaceBg || i.background || "#fff",
2767
- boxShadow: i.shadowInset || "none"
2768
- }
2769
- },
2770
- /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "4px", minWidth: "180px" } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", fontWeight: 800, color: i.text } }, `Layer ${F + 1}`), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", color: i.textSec } }, U ? U.fullLabel : Y.name || "Select a measure"), U ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: i.textSec } }, `${U.groupLabel} | ${U.id}`) : null), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement(
2771
- "button",
2772
- {
2773
- type: "button",
2774
- onClick: () => X(Y.id, -1),
2775
- disabled: F === 0,
2776
- style: {
2777
- border: `1px solid ${i.border}`,
2778
- background: i.headerSubtleBg || i.hover,
2779
- color: i.textSec,
2780
- borderRadius: i.radiusSm || "8px",
2781
- padding: "6px 8px",
2782
- fontSize: "11px",
2783
- fontWeight: 700,
2784
- cursor: F === 0 ? "not-allowed" : "pointer",
2785
- opacity: F === 0 ? 0.45 : 1
2786
- }
2787
- },
2788
- "Up"
2789
- ), /* @__PURE__ */ e.createElement(
2790
- "button",
2791
- {
2792
- type: "button",
2793
- onClick: () => X(Y.id, 1),
2794
- disabled: F === f.length - 1,
2795
- style: {
2796
- border: `1px solid ${i.border}`,
2797
- background: i.headerSubtleBg || i.hover,
2798
- color: i.textSec,
2799
- borderRadius: i.radiusSm || "8px",
2800
- padding: "6px 8px",
2801
- fontSize: "11px",
2802
- fontWeight: 700,
2803
- cursor: F === f.length - 1 ? "not-allowed" : "pointer",
2804
- opacity: F === f.length - 1 ? 0.45 : 1
2805
- }
2806
- },
2807
- "Down"
2808
- ), /* @__PURE__ */ e.createElement(
2809
- "button",
3429
+ ), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: i.textSec, whiteSpace: "nowrap" } }, O.length, " / ", $.length))), O.length === 0 ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", color: i.textSec, padding: "2px 2px 0 2px" } }, "No measures match the current search. Clear the search to see the full catalog.") : null, f.map(
3430
+ /** @param {any} [layer] @param {any} [layerIndex] @returns {any} */
3431
+ (Y, F) => {
3432
+ const U = R.get(Y.columnId) || null, ue = J.some(
3433
+ /** @param {any} [group] @returns {any} */
3434
+ (ne) => ne.options.some(
3435
+ /** @param {any} [option] @returns {any} */
3436
+ (ie) => ie.id === Y.columnId
3437
+ )
3438
+ );
3439
+ return /* @__PURE__ */ e.createElement(
3440
+ "div",
2810
3441
  {
2811
- type: "button",
2812
- onClick: () => T(Y.id),
3442
+ key: Y.id,
2813
3443
  style: {
3444
+ display: "flex",
3445
+ flexDirection: "column",
3446
+ gap: "10px",
3447
+ width: "100%",
3448
+ padding: "12px",
2814
3449
  border: `1px solid ${i.border}`,
2815
- background: i.headerSubtleBg || i.hover,
2816
- color: i.textSec,
2817
3450
  borderRadius: i.radiusSm || "8px",
2818
- padding: "6px 8px",
2819
- fontSize: "11px",
2820
- fontWeight: 700,
2821
- cursor: "pointer"
3451
+ background: i.surfaceBg || i.background || "#fff",
3452
+ boxShadow: i.shadowInset || "none"
2822
3453
  }
2823
3454
  },
2824
- "Remove"
2825
- ))),
2826
- /* @__PURE__ */ e.createElement("div", { style: {
2827
- display: "grid",
2828
- gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))",
2829
- gap: "8px",
2830
- alignItems: "start",
2831
- width: "100%"
2832
- } }, /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", minWidth: 0 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Measure"), /* @__PURE__ */ e.createElement(
2833
- "select",
2834
- {
2835
- value: Y.columnId || "",
2836
- onChange: (ne) => {
2837
- const ie = R.get(ne.target.value) || null;
2838
- a(Y.id, {
2839
- columnId: ne.target.value,
2840
- name: ie ? ie.fullLabel : Y.name
2841
- });
3455
+ /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "10px", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "4px", minWidth: "180px" } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", fontWeight: 800, color: i.text } }, `Layer ${F + 1}`), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", color: i.textSec } }, U ? U.fullLabel : Y.name || "Select a measure"), U ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: i.textSec } }, `${U.groupLabel} | ${U.id}`) : null), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement(
3456
+ "button",
3457
+ {
3458
+ type: "button",
3459
+ onClick: () => X(Y.id, -1),
3460
+ disabled: F === 0,
3461
+ style: {
3462
+ border: `1px solid ${i.border}`,
3463
+ background: i.headerSubtleBg || i.hover,
3464
+ color: i.textSec,
3465
+ borderRadius: i.radiusSm || "8px",
3466
+ padding: "6px 8px",
3467
+ fontSize: "11px",
3468
+ fontWeight: 700,
3469
+ cursor: F === 0 ? "not-allowed" : "pointer",
3470
+ opacity: F === 0 ? 0.45 : 1
3471
+ }
2842
3472
  },
2843
- style: K
2844
- },
2845
- !ue && U ? /* @__PURE__ */ e.createElement("optgroup", { label: "Current Layer Measure" }, /* @__PURE__ */ e.createElement("option", { value: U.id }, U.fullLabel)) : null,
2846
- J.map((ne) => /* @__PURE__ */ e.createElement("optgroup", { key: ne.label, label: `${ne.label} (${ne.options.length})` }, ne.options.map((ie) => /* @__PURE__ */ e.createElement("option", { key: ie.id, value: ie.id }, ie.leafLabel))))
2847
- )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Layer Type"), /* @__PURE__ */ e.createElement(
2848
- "select",
2849
- {
2850
- value: Y.type,
2851
- onChange: (ne) => a(Y.id, { type: ne.target.value }),
2852
- style: K
2853
- },
2854
- /* @__PURE__ */ e.createElement("option", { value: "bar" }, "Bar"),
2855
- /* @__PURE__ */ e.createElement("option", { value: "line" }, "Line"),
2856
- /* @__PURE__ */ e.createElement("option", { value: "area" }, "Area")
2857
- )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Axis"), /* @__PURE__ */ e.createElement(
2858
- "select",
2859
- {
2860
- value: Y.axis,
2861
- onChange: (ne) => a(Y.id, { axis: ne.target.value }),
2862
- style: K
2863
- },
2864
- /* @__PURE__ */ e.createElement("option", { value: "left" }, "Left Axis"),
2865
- /* @__PURE__ */ e.createElement("option", { value: "right" }, "Right Axis")
2866
- )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Format"), /* @__PURE__ */ e.createElement(
2867
- "select",
2868
- {
2869
- value: Y.valueFormat || "auto",
2870
- onChange: (ne) => a(Y.id, { valueFormat: ne.target.value }),
2871
- style: K
2872
- },
2873
- /* @__PURE__ */ e.createElement("option", { value: "auto" }, "Auto"),
2874
- /* @__PURE__ */ e.createElement("option", { value: "number" }, "Number"),
2875
- /* @__PURE__ */ e.createElement("option", { value: "compact" }, "Compact (K/M)"),
2876
- /* @__PURE__ */ e.createElement("option", { value: "percent" }, "Percent"),
2877
- /* @__PURE__ */ e.createElement("option", { value: "currency" }, "Currency ($)")
2878
- )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Color"), /* @__PURE__ */ e.createElement(
2879
- "input",
2880
- {
2881
- type: "color",
2882
- value: Y.color || "#6366f1",
2883
- onChange: (ne) => a(Y.id, { color: ne.target.value }),
2884
- style: { width: "100%", height: "34px", padding: "2px 4px", border: `1px solid ${i.border}`, borderRadius: i.radiusSm || "8px", cursor: "pointer", background: "none" },
2885
- title: "Override color for this layer"
2886
- }
2887
- )))
2888
- );
2889
- }), /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
3473
+ "Up"
3474
+ ), /* @__PURE__ */ e.createElement(
3475
+ "button",
3476
+ {
3477
+ type: "button",
3478
+ onClick: () => X(Y.id, 1),
3479
+ disabled: F === f.length - 1,
3480
+ style: {
3481
+ border: `1px solid ${i.border}`,
3482
+ background: i.headerSubtleBg || i.hover,
3483
+ color: i.textSec,
3484
+ borderRadius: i.radiusSm || "8px",
3485
+ padding: "6px 8px",
3486
+ fontSize: "11px",
3487
+ fontWeight: 700,
3488
+ cursor: F === f.length - 1 ? "not-allowed" : "pointer",
3489
+ opacity: F === f.length - 1 ? 0.45 : 1
3490
+ }
3491
+ },
3492
+ "Down"
3493
+ ), /* @__PURE__ */ e.createElement(
3494
+ "button",
3495
+ {
3496
+ type: "button",
3497
+ onClick: () => T(Y.id),
3498
+ style: {
3499
+ border: `1px solid ${i.border}`,
3500
+ background: i.headerSubtleBg || i.hover,
3501
+ color: i.textSec,
3502
+ borderRadius: i.radiusSm || "8px",
3503
+ padding: "6px 8px",
3504
+ fontSize: "11px",
3505
+ fontWeight: 700,
3506
+ cursor: "pointer"
3507
+ }
3508
+ },
3509
+ "Remove"
3510
+ ))),
3511
+ /* @__PURE__ */ e.createElement("div", { style: {
3512
+ display: "grid",
3513
+ gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))",
3514
+ gap: "8px",
3515
+ alignItems: "start",
3516
+ width: "100%"
3517
+ } }, /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px", minWidth: 0 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Measure"), /* @__PURE__ */ e.createElement(
3518
+ "select",
3519
+ {
3520
+ value: Y.columnId || "",
3521
+ onChange: (ne) => {
3522
+ const ie = R.get(ne.target.value) || null;
3523
+ a(Y.id, {
3524
+ columnId: ne.target.value,
3525
+ name: ie ? ie.fullLabel : Y.name
3526
+ });
3527
+ },
3528
+ style: K
3529
+ },
3530
+ !ue && U ? /* @__PURE__ */ e.createElement("optgroup", { label: "Current Layer Measure" }, /* @__PURE__ */ e.createElement("option", { value: U.id }, U.fullLabel)) : null,
3531
+ J.map(
3532
+ /** @param {any} [group] @returns {any} */
3533
+ (ne) => /* @__PURE__ */ e.createElement("optgroup", { key: ne.label, label: `${ne.label} (${ne.options.length})` }, ne.options.map(
3534
+ /** @param {any} [option] @returns {any} */
3535
+ (ie) => /* @__PURE__ */ e.createElement("option", { key: ie.id, value: ie.id }, ie.leafLabel)
3536
+ ))
3537
+ )
3538
+ )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Layer Type"), /* @__PURE__ */ e.createElement(
3539
+ "select",
3540
+ {
3541
+ value: Y.type,
3542
+ onChange: (ne) => a(Y.id, { type: ne.target.value }),
3543
+ style: K
3544
+ },
3545
+ /* @__PURE__ */ e.createElement("option", { value: "bar" }, "Bar"),
3546
+ /* @__PURE__ */ e.createElement("option", { value: "line" }, "Line"),
3547
+ /* @__PURE__ */ e.createElement("option", { value: "area" }, "Area")
3548
+ )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Axis"), /* @__PURE__ */ e.createElement(
3549
+ "select",
3550
+ {
3551
+ value: Y.axis,
3552
+ onChange: (ne) => a(Y.id, { axis: ne.target.value }),
3553
+ style: K
3554
+ },
3555
+ /* @__PURE__ */ e.createElement("option", { value: "left" }, "Left Axis"),
3556
+ /* @__PURE__ */ e.createElement("option", { value: "right" }, "Right Axis")
3557
+ )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Format"), /* @__PURE__ */ e.createElement(
3558
+ "select",
3559
+ {
3560
+ value: Y.valueFormat || "auto",
3561
+ onChange: (ne) => a(Y.id, { valueFormat: ne.target.value }),
3562
+ style: K
3563
+ },
3564
+ /* @__PURE__ */ e.createElement("option", { value: "auto" }, "Auto"),
3565
+ /* @__PURE__ */ e.createElement("option", { value: "number" }, "Number"),
3566
+ /* @__PURE__ */ e.createElement("option", { value: "compact" }, "Compact (K/M)"),
3567
+ /* @__PURE__ */ e.createElement("option", { value: "percent" }, "Percent"),
3568
+ /* @__PURE__ */ e.createElement("option", { value: "currency" }, "Currency ($)")
3569
+ )), /* @__PURE__ */ e.createElement("label", { style: { display: "flex", flexDirection: "column", gap: "5px" } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.06em", textTransform: "uppercase", color: i.textSec } }, "Color"), /* @__PURE__ */ e.createElement(
3570
+ "input",
3571
+ {
3572
+ type: "color",
3573
+ value: Y.color || "#6366f1",
3574
+ onChange: (ne) => a(Y.id, { color: ne.target.value }),
3575
+ style: { width: "100%", height: "34px", padding: "2px 4px", border: `1px solid ${i.border}`, borderRadius: i.radiusSm || "8px", cursor: "pointer", background: "none" },
3576
+ title: "Override color for this layer"
3577
+ }
3578
+ )))
3579
+ );
3580
+ }
3581
+ ), /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
2890
3582
  "button",
2891
3583
  {
2892
3584
  type: "button",
@@ -2960,9 +3652,13 @@ const Lr = [
2960
3652
  const o = vr(n), i = t.cloneNode(!0), r = (i.getAttribute("viewBox") || "").split(/[\s,]+/).map(Number), f = r.length === 4 && r[2] > 0 ? r[2] : t.clientWidth || 800, h = r.length === 4 && r[3] > 0 ? r[3] : t.clientHeight || 400, S = o.title ? 42 : 0, $ = tn(
2961
3653
  o.legendItems,
2962
3654
  f,
3655
+ /** @param {any} [label] @returns {any} */
2963
3656
  (T) => String(T || "").length * 6.4
2964
3657
  ), R = $.length > 0 ? $.length * 22 + 14 : 0, C = o.legendPosition === "top" ? R : 0, O = S + C, J = S + h + R, K = Array.from(i.childNodes), a = document.createElementNS(ar, "g");
2965
- a.setAttribute("transform", `translate(0 ${O})`), K.forEach((T) => a.appendChild(T)), i.appendChild(a), i.setAttribute("viewBox", `0 0 ${f} ${J}`), i.setAttribute("width", String(f)), i.setAttribute("height", String(J)), i.setAttribute("xmlns", ar);
3658
+ a.setAttribute("transform", `translate(0 ${O})`), K.forEach(
3659
+ /** @param {any} [child] @returns {any} */
3660
+ (T) => a.appendChild(T)
3661
+ ), i.appendChild(a), i.setAttribute("viewBox", `0 0 ${f} ${J}`), i.setAttribute("width", String(f)), i.setAttribute("height", String(J)), i.setAttribute("xmlns", ar);
2966
3662
  const X = document.createElementNS(ar, "rect");
2967
3663
  if (X.setAttribute("x", "0"), X.setAttribute("y", "0"), X.setAttribute("width", String(f)), X.setAttribute("height", String(J)), X.setAttribute("fill", o.background), i.insertBefore(X, a), o.title) {
2968
3664
  const T = document.createElementNS(ar, "text");
@@ -2970,15 +3666,21 @@ const Lr = [
2970
3666
  }
2971
3667
  if ($.length > 0) {
2972
3668
  const T = o.legendPosition === "top" ? S + 16 : S + h + 18;
2973
- $.forEach((V, Y) => {
2974
- let F = 16;
2975
- V.forEach((U) => {
2976
- const ue = T + Y * 22, ne = document.createElementNS(ar, "circle");
2977
- ne.setAttribute("cx", String(F + 5)), ne.setAttribute("cy", String(ue - 4)), ne.setAttribute("r", "5"), ne.setAttribute("fill", U.hidden ? o.secondaryTextColor : U.color || "#2563eb"), ne.setAttribute("opacity", U.hidden ? "0.35" : "1"), i.appendChild(ne);
2978
- const ie = document.createElementNS(ar, "text");
2979
- ie.setAttribute("x", String(F + 16)), ie.setAttribute("y", String(ue)), ie.setAttribute("fill", o.secondaryTextColor), ie.setAttribute("font-size", "11"), ie.setAttribute("font-family", "Inter, Arial, sans-serif"), ie.setAttribute("opacity", U.hidden ? "0.45" : "1"), ie.textContent = U.label, i.appendChild(ie), F += U.width;
2980
- });
2981
- });
3669
+ $.forEach(
3670
+ /** @param {any} [row] @param {any} [rowIndex] @returns {any} */
3671
+ (V, Y) => {
3672
+ let F = 16;
3673
+ V.forEach(
3674
+ /** @param {any} [item] @returns {any} */
3675
+ (U) => {
3676
+ const ue = T + Y * 22, ne = document.createElementNS(ar, "circle");
3677
+ ne.setAttribute("cx", String(F + 5)), ne.setAttribute("cy", String(ue - 4)), ne.setAttribute("r", "5"), ne.setAttribute("fill", U.hidden ? o.secondaryTextColor : U.color || "#2563eb"), ne.setAttribute("opacity", U.hidden ? "0.35" : "1"), i.appendChild(ne);
3678
+ const ie = document.createElementNS(ar, "text");
3679
+ ie.setAttribute("x", String(F + 16)), ie.setAttribute("y", String(ue)), ie.setAttribute("fill", o.secondaryTextColor), ie.setAttribute("font-size", "11"), ie.setAttribute("font-family", "Inter, Arial, sans-serif"), ie.setAttribute("opacity", U.hidden ? "0.45" : "1"), ie.textContent = U.label, i.appendChild(ie), F += U.width;
3680
+ }
3681
+ );
3682
+ }
3683
+ );
2982
3684
  }
2983
3685
  return i;
2984
3686
  }, ka = async (t, n, o) => {
@@ -3010,9 +3712,13 @@ const Lr = [
3010
3712
  }, C.src = J;
3011
3713
  }), wa = async (t, n, o) => {
3012
3714
  const i = await rn(Rr(t, o));
3013
- i && i.toBlob((r) => {
3014
- r && hr(r, `${n}.png`);
3015
- }, "image/png");
3715
+ i && i.toBlob(
3716
+ /** @param {any} [blob] @returns {any} */
3717
+ (r) => {
3718
+ r && hr(r, `${n}.png`);
3719
+ },
3720
+ "image/png"
3721
+ );
3016
3722
  }, Sa = async (t, n) => {
3017
3723
  if (typeof navigator > "u" || !navigator.clipboard || !navigator.clipboard.write) return !1;
3018
3724
  const o = await rn(Rr(t, n));
@@ -3036,26 +3742,37 @@ const Lr = [
3036
3742
  const C = tn(
3037
3743
  i.legendItems,
3038
3744
  o.getWidth(),
3745
+ /** @param {any} [label] @returns {any} */
3039
3746
  (T) => R.measureText(String(T || "")).width
3040
3747
  ), O = C.length > 0 ? Math.round((C.length * 22 + 14) * h) : 0, J = i.legendPosition === "top" ? O : 0, K = S + J, a = document.createElement("canvas");
3041
3748
  a.width = f.naturalWidth, a.height = S + f.naturalHeight + O;
3042
3749
  const X = a.getContext("2d");
3043
3750
  if (X.fillStyle = i.background, X.fillRect(0, 0, a.width, a.height), X.drawImage(f, 0, K), i.title && (X.fillStyle = i.textColor, X.font = `700 ${Math.round(16 * h)}px Inter, Arial, sans-serif`, X.textBaseline = "alphabetic", X.fillText(i.title, Math.round(16 * h), Math.round(27 * h))), C.length > 0) {
3044
3751
  const T = i.legendPosition === "top" ? S + Math.round(16 * h) : S + f.naturalHeight + Math.round(18 * h);
3045
- X.font = `${Math.round(11 * h)}px Inter, Arial, sans-serif`, C.forEach((V, Y) => {
3046
- let F = Math.round(16 * h);
3047
- V.forEach((U) => {
3048
- const ue = T + Math.round(Y * 22 * h);
3049
- X.globalAlpha = U.hidden ? 0.35 : 1, X.fillStyle = U.hidden ? i.secondaryTextColor : U.color || "#2563eb", X.beginPath(), X.arc(F + Math.round(5 * h), ue - Math.round(4 * h), Math.round(5 * h), 0, Math.PI * 2), X.fill(), X.globalAlpha = U.hidden ? 0.45 : 1, X.fillStyle = i.secondaryTextColor, X.fillText(U.label, F + Math.round(16 * h), ue), X.globalAlpha = 1, F += Math.round(U.width * h);
3050
- });
3051
- });
3752
+ X.font = `${Math.round(11 * h)}px Inter, Arial, sans-serif`, C.forEach(
3753
+ /** @param {any} [row] @param {any} [rowIndex] @returns {any} */
3754
+ (V, Y) => {
3755
+ let F = Math.round(16 * h);
3756
+ V.forEach(
3757
+ /** @param {any} [item] @returns {any} */
3758
+ (U) => {
3759
+ const ue = T + Math.round(Y * 22 * h);
3760
+ X.globalAlpha = U.hidden ? 0.35 : 1, X.fillStyle = U.hidden ? i.secondaryTextColor : U.color || "#2563eb", X.beginPath(), X.arc(F + Math.round(5 * h), ue - Math.round(4 * h), Math.round(5 * h), 0, Math.PI * 2), X.fill(), X.globalAlpha = U.hidden ? 0.45 : 1, X.fillStyle = i.secondaryTextColor, X.fillText(U.label, F + Math.round(16 * h), ue), X.globalAlpha = 1, F += Math.round(U.width * h);
3761
+ }
3762
+ );
3763
+ }
3764
+ );
3052
3765
  }
3053
3766
  return a;
3054
3767
  }, Aa = async (t, n, o) => {
3055
3768
  const i = await nn(t, o);
3056
- i && i.toBlob((r) => {
3057
- r && hr(r, `${n}.png`);
3058
- }, "image/png");
3769
+ i && i.toBlob(
3770
+ /** @param {any} [blob] @returns {any} */
3771
+ (r) => {
3772
+ r && hr(r, `${n}.png`);
3773
+ },
3774
+ "image/png"
3775
+ );
3059
3776
  }, Ca = async (t, n) => {
3060
3777
  if (!(t && t.current && t.current.getEchartsInstance()) || typeof navigator > "u" || !navigator.clipboard || !navigator.clipboard.write) return !1;
3061
3778
  try {
@@ -3340,11 +4057,17 @@ const Lr = [
3340
4057
  const $r = ot(() => {
3341
4058
  if (!t || !Array.isArray(t.series)) return null;
3342
4059
  let u = 1 / 0, Q = -1 / 0;
3343
- return t.series.forEach((me) => {
3344
- (me.values || []).forEach((ye) => {
3345
- typeof ye == "number" && Number.isFinite(ye) && (u = Math.min(u, ye), Q = Math.max(Q, ye));
3346
- });
3347
- }), Number.isFinite(u) && u !== Q ? { min: u, max: Q } : null;
4060
+ return t.series.forEach(
4061
+ /** @param {any} [ser] @returns {any} */
4062
+ (me) => {
4063
+ (me.values || []).forEach(
4064
+ /** @param {any} [v] @returns {any} */
4065
+ (ye) => {
4066
+ typeof ye == "number" && Number.isFinite(ye) && (u = Math.min(u, ye), Q = Math.max(Q, ye));
4067
+ }
4068
+ );
4069
+ }
4070
+ ), Number.isFinite(u) && u !== Q ? { min: u, max: Q } : null;
3348
4071
  }, [t]);
3349
4072
  return /* @__PURE__ */ e.createElement(
3350
4073
  "div",
@@ -3372,7 +4095,10 @@ const Lr = [
3372
4095
  {
3373
4096
  type: "button",
3374
4097
  ref: q,
3375
- onClick: () => b((u) => !u),
4098
+ onClick: () => b(
4099
+ /** @param {any} [isOpen] @returns {any} */
4100
+ (u) => !u
4101
+ ),
3376
4102
  onKeyDown: (u) => {
3377
4103
  (u.key === "ArrowDown" || u.key === "ArrowUp") && (u.preventDefault(), b(!0));
3378
4104
  },
@@ -3662,7 +4388,13 @@ const Lr = [
3662
4388
  background: a.sidebarBg || a.surfaceBg || a.background
3663
4389
  }
3664
4390
  },
3665
- x === "chart" && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => m((u) => !u), style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", background: "none", border: "none", borderBottom: `1px solid ${a.border}`, padding: "4px 0", cursor: "pointer", marginBottom: E ? "6px" : 0 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec } }, "Chart Type"), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", color: a.textSec, transform: E ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.15s" } }, "▾")), E && /* @__PURE__ */ e.createElement(Qn, { chartType: n, onChange: S, theme: a, includeHierarchyCharts: ir }), /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => k((u) => !u), style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", background: "none", border: "none", borderBottom: `1px solid ${a.border}`, padding: "4px 0", cursor: "pointer", marginTop: "8px", marginBottom: w ? "6px" : 0 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec } }, "Parameters"), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", color: a.textSec, transform: w ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.15s" } }, "▾")), w && /* @__PURE__ */ e.createElement(e.Fragment, null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "scatter" && n !== "waterfall" && !gt.has(n) && !de ? /* @__PURE__ */ e.createElement(xe, { label: "Source", theme: a }, /* @__PURE__ */ e.createElement(xa, { orientation: C, onChange: O, theme: a })) : null, n === "bar" ? /* @__PURE__ */ e.createElement(xe, { label: "Direction", theme: a }, /* @__PURE__ */ e.createElement(fa, { axisMode: h, onChange: R, theme: a })) : null, (n === "bar" || n === "area") && !de && /* @__PURE__ */ e.createElement(xe, { label: "Layout", theme: a }, /* @__PURE__ */ e.createElement(da, { chartType: n, barLayout: f, onChange: $, canStack: P, theme: a })), xr ? /* @__PURE__ */ e.createElement(xe, { label: "Level", theme: a }, /* @__PURE__ */ e.createElement(ga, { level: J, onChange: K, maxLevel: Dr, theme: a })) : null, de ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Layers"), /* @__PURE__ */ e.createElement(ba, { layers: o, onChange: i, availableColumns: r, theme: a })) : null, !(n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "scatter" && n !== "waterfall" && !gt.has(n) && !de) && n !== "bar" && !((n === "bar" || n === "area") && !de) && !xr && !de ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", color: a.textSec, padding: "4px 0" } }, "No parameters for this chart type.") : null)),
4391
+ x === "chart" && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => m(
4392
+ /** @param {any} [o] @returns {any} */
4393
+ (u) => !u
4394
+ ), style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", background: "none", border: "none", borderBottom: `1px solid ${a.border}`, padding: "4px 0", cursor: "pointer", marginBottom: E ? "6px" : 0 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec } }, "Chart Type"), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", color: a.textSec, transform: E ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.15s" } }, "▾")), E && /* @__PURE__ */ e.createElement(Qn, { chartType: n, onChange: S, theme: a, includeHierarchyCharts: ir }), /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => k(
4395
+ /** @param {any} [o] @returns {any} */
4396
+ (u) => !u
4397
+ ), style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%", background: "none", border: "none", borderBottom: `1px solid ${a.border}`, padding: "4px 0", cursor: "pointer", marginTop: "8px", marginBottom: w ? "6px" : 0 } }, /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec } }, "Parameters"), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "10px", color: a.textSec, transform: w ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.15s" } }, "▾")), w && /* @__PURE__ */ e.createElement(e.Fragment, null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "scatter" && n !== "waterfall" && !gt.has(n) && !de ? /* @__PURE__ */ e.createElement(xe, { label: "Source", theme: a }, /* @__PURE__ */ e.createElement(xa, { orientation: C, onChange: O, theme: a })) : null, n === "bar" ? /* @__PURE__ */ e.createElement(xe, { label: "Direction", theme: a }, /* @__PURE__ */ e.createElement(fa, { axisMode: h, onChange: R, theme: a })) : null, (n === "bar" || n === "area") && !de && /* @__PURE__ */ e.createElement(xe, { label: "Layout", theme: a }, /* @__PURE__ */ e.createElement(da, { chartType: n, barLayout: f, onChange: $, canStack: P, theme: a })), xr ? /* @__PURE__ */ e.createElement(xe, { label: "Level", theme: a }, /* @__PURE__ */ e.createElement(ga, { level: J, onChange: K, maxLevel: Dr, theme: a })) : null, de ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Layers"), /* @__PURE__ */ e.createElement(ba, { layers: o, onChange: i, availableColumns: r, theme: a })) : null, !(n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "scatter" && n !== "waterfall" && !gt.has(n) && !de) && n !== "bar" && !((n === "bar" || n === "area") && !de) && !xr && !de ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "11px", color: a.textSec, padding: "4px 0" } }, "No parameters for this chart type.") : null)),
3666
4398
  x === "data" && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "General"), typeof T == "function" ? /* @__PURE__ */ e.createElement(xe, { label: "Title", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("input", { type: "text", value: Oe || "", onChange: (u) => T(u.target.value), placeholder: "Chart title", style: { ...Ae, width: "100%" } })) : null, /* @__PURE__ */ e.createElement(xe, { label: "Subtitle", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("input", { type: "text", value: Le, onChange: (u) => _t(u.target.value), placeholder: "Chart subtitle", style: { ...Ae, width: "100%" } })), typeof U == "function" ? /* @__PURE__ */ e.createElement(xe, { label: "Height", theme: a, controlMinWidth: "96px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "180", step: "20", value: j, onChange: (u) => M(u.target.value), onBlur: () => {
3667
4399
  typeof U == "function" && U(j);
3668
4400
  }, onKeyDown: (u) => {
@@ -3674,8 +4406,38 @@ const Lr = [
3674
4406
  { key: "flow", label: "Flow" },
3675
4407
  { key: "sparkline", label: "Sparkline" }
3676
4408
  ].map((u) => /* @__PURE__ */ e.createElement("button", { key: u.key, type: "button", "data-chart-preset": u.key, onClick: () => on(u.key), style: { ...jt, textAlign: "left" } }, u.label)))),
3677
- x === "axes" && /* @__PURE__ */ e.createElement(e.Fragment, null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "sparkline" ? /* @__PURE__ */ e.createElement(xe, { label: "Y-Axis Title", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("input", { type: "text", value: Mt, onChange: (u) => sr(u.target.value), placeholder: "Y-axis title", style: { ...Ae, width: "100%" } })) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Y Range", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px" } }, /* @__PURE__ */ e.createElement("input", { type: "number", value: Z, onChange: (u) => ee(u.target.value), placeholder: "Min", style: { ...Ae, width: "50%" } }), /* @__PURE__ */ e.createElement("input", { type: "number", value: Dt, onChange: (u) => Qe(u.target.value), placeholder: "Max", style: { ...Ae, width: "50%" } }))), /* @__PURE__ */ e.createElement(xe, { label: "Y Ticks", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "2", max: "20", value: at, onChange: (u) => Re(Math.max(2, Math.min(20, Number(u.target.value) || 5))), style: { ...Ae, width: "80px" } })), /* @__PURE__ */ e.createElement(xe, { label: "X Angle", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "4px", alignItems: "center", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "0", max: "90", value: dt, onChange: (u) => Ie(Math.max(0, Math.min(90, Number(u.target.value) || 0))), style: { ...Ae, width: "58px" }, title: "X-axis label angle (0–90°)" }), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "11px", color: a.textSec } }, "°"), [0, 30, 45, 90].map((u) => /* @__PURE__ */ e.createElement("button", { key: u, type: "button", onClick: () => Ie(u), style: { ...Ae, padding: "4px 6px", background: dt === u ? a.select : a.headerSubtleBg || a.hover, color: dt === u ? a.primary : a.text, border: `1px solid ${dt === u ? a.primary : a.border}` } }, u, "°"))))) : null, de ? /* @__PURE__ */ e.createElement(xe, { label: "Right Axis Range", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px" } }, /* @__PURE__ */ e.createElement("input", { type: "number", value: l, onChange: (u) => c(u.target.value), placeholder: "Min", style: { ...Ae, width: "50%" } }), /* @__PURE__ */ e.createElement("input", { type: "number", value: s, onChange: (u) => p(u.target.value), placeholder: "Max", style: { ...Ae, width: "50%" } }))) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && !gt.has(n) ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Reference Lines"), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "6px" } }, $e.map((u, Q) => /* @__PURE__ */ e.createElement(Jn, { key: u.id, line: u, onUpdate: (me) => Ue((ye) => ye.map((Ge, rr) => rr === Q ? me : Ge)), onRemove: () => Ue((me) => me.filter((ye, Ge) => Ge !== Q)), exportButtonStyle: jt, compactInputStyle: Ae, theme: a })), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "4px", alignItems: "center" } }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => ht((u) => ({ ...u, orient: u.orient === "v" ? "h" : "v" })), style: { ...jt, padding: "4px 7px", flexShrink: 0, fontWeight: 800, color: Ke.orient === "v" ? a.primary : a.textSec } }, Ke.orient === "v" ? "|" : "—"), /* @__PURE__ */ e.createElement("input", { type: "number", value: Ke.value, onChange: (u) => ht((Q) => ({ ...Q, value: u.target.value })), placeholder: Ke.orient === "v" ? "Cat index" : "Value", style: { ...Ae, width: "60px", flexShrink: 0 } }), /* @__PURE__ */ e.createElement("input", { type: "text", value: Ke.label, onChange: (u) => ht((Q) => ({ ...Q, label: u.target.value })), placeholder: "Label", style: { ...Ae, flex: 1, minWidth: 0 } }), /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => {
3678
- Ke.value !== "" && (Ue((u) => [...u, { id: Date.now(), value: Ke.value, label: Ke.label, orient: Ke.orient, color: "", dash: "dashed" }]), ht({ value: "", label: "", orient: Ke.orient }));
4409
+ x === "axes" && /* @__PURE__ */ e.createElement(e.Fragment, null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "sparkline" ? /* @__PURE__ */ e.createElement(xe, { label: "Y-Axis Title", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("input", { type: "text", value: Mt, onChange: (u) => sr(u.target.value), placeholder: "Y-axis title", style: { ...Ae, width: "100%" } })) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Y Range", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px" } }, /* @__PURE__ */ e.createElement("input", { type: "number", value: Z, onChange: (u) => ee(u.target.value), placeholder: "Min", style: { ...Ae, width: "50%" } }), /* @__PURE__ */ e.createElement("input", { type: "number", value: Dt, onChange: (u) => Qe(u.target.value), placeholder: "Max", style: { ...Ae, width: "50%" } }))), /* @__PURE__ */ e.createElement(xe, { label: "Y Ticks", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "2", max: "20", value: at, onChange: (u) => Re(Math.max(2, Math.min(20, Number(u.target.value) || 5))), style: { ...Ae, width: "80px" } })), /* @__PURE__ */ e.createElement(xe, { label: "X Angle", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "4px", alignItems: "center", flexWrap: "wrap" } }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "0", max: "90", value: dt, onChange: (u) => Ie(Math.max(0, Math.min(90, Number(u.target.value) || 0))), style: { ...Ae, width: "58px" }, title: "X-axis label angle (0–90°)" }), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "11px", color: a.textSec } }, "°"), [0, 30, 45, 90].map((u) => /* @__PURE__ */ e.createElement("button", { key: u, type: "button", onClick: () => Ie(u), style: { ...Ae, padding: "4px 6px", background: dt === u ? a.select : a.headerSubtleBg || a.hover, color: dt === u ? a.primary : a.text, border: `1px solid ${dt === u ? a.primary : a.border}` } }, u, "°"))))) : null, de ? /* @__PURE__ */ e.createElement(xe, { label: "Right Axis Range", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px" } }, /* @__PURE__ */ e.createElement("input", { type: "number", value: l, onChange: (u) => c(u.target.value), placeholder: "Min", style: { ...Ae, width: "50%" } }), /* @__PURE__ */ e.createElement("input", { type: "number", value: s, onChange: (u) => p(u.target.value), placeholder: "Max", style: { ...Ae, width: "50%" } }))) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && !gt.has(n) ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Reference Lines"), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "6px" } }, $e.map(
4410
+ /** @param {any} [line] @param {any} [lineIdx] @returns {any} */
4411
+ (u, Q) => /* @__PURE__ */ e.createElement(Jn, { key: u.id, line: u, onUpdate: (
4412
+ /** @param {any} [updated] @returns {any} */
4413
+ ((me) => Ue(
4414
+ /** @param {any} [prev] @returns {any} */
4415
+ (ye) => ye.map(
4416
+ /** @param {any} [l] @param {any} [j] @returns {any} */
4417
+ (Ge, rr) => rr === Q ? me : Ge
4418
+ )
4419
+ ))
4420
+ ), onRemove: () => Ue(
4421
+ /** @param {any} [prev] @returns {any} */
4422
+ (me) => me.filter(
4423
+ /** @param {any} [_] @param {any} [j] @returns {any} */
4424
+ (ye, Ge) => Ge !== Q
4425
+ )
4426
+ ), exportButtonStyle: jt, compactInputStyle: Ae, theme: a })
4427
+ ), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "4px", alignItems: "center" } }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => ht(
4428
+ /** @param {any} [d] @returns {any} */
4429
+ (u) => ({ ...u, orient: u.orient === "v" ? "h" : "v" })
4430
+ ), style: { ...jt, padding: "4px 7px", flexShrink: 0, fontWeight: 800, color: Ke.orient === "v" ? a.primary : a.textSec } }, Ke.orient === "v" ? "|" : "—"), /* @__PURE__ */ e.createElement("input", { type: "number", value: Ke.value, onChange: (u) => ht(
4431
+ /** @param {any} [d] @returns {any} */
4432
+ (Q) => ({ ...Q, value: u.target.value })
4433
+ ), placeholder: Ke.orient === "v" ? "Cat index" : "Value", style: { ...Ae, width: "60px", flexShrink: 0 } }), /* @__PURE__ */ e.createElement("input", { type: "text", value: Ke.label, onChange: (u) => ht(
4434
+ /** @param {any} [d] @returns {any} */
4435
+ (Q) => ({ ...Q, label: u.target.value })
4436
+ ), placeholder: "Label", style: { ...Ae, flex: 1, minWidth: 0 } }), /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => {
4437
+ Ke.value !== "" && (Ue(
4438
+ /** @param {any} [prev] @returns {any} */
4439
+ (u) => [...u, { id: Date.now(), value: Ke.value, label: Ke.label, orient: Ke.orient, color: "", dash: "dashed" }]
4440
+ ), ht({ value: "", label: "", orient: Ke.orient }));
3679
4441
  }, style: { ...jt, padding: "4px 10px", flexShrink: 0 } }, "+")), $r ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: a.textSec } }, "Data range: ", zt($r.min, pt), " — ", zt($r.max, pt)) : null)) : null),
3680
4442
  x === "style" && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}` } }, "Colors"), /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "6px" } }, [...hn, ...$t.length >= 2 ? ["custom"] : []].map((u) => {
3681
4443
  const Q = ve === u, me = u === "custom" ? $t : vn[u];
@@ -3688,14 +4450,47 @@ const Lr = [
3688
4450
  title: u.charAt(0).toUpperCase() + u.slice(1),
3689
4451
  style: { display: "flex", alignItems: "center", gap: "3px", padding: "3px 6px", border: `1.5px solid ${Q ? a.primary : a.border}`, background: Q ? a.select : a.headerSubtleBg || a.hover, borderRadius: a.radiusSm || "8px", cursor: "pointer" }
3690
4452
  },
3691
- (me || []).slice(0, 4).map((ye, Ge) => /* @__PURE__ */ e.createElement("span", { key: Ge, style: { width: "8px", height: "8px", borderRadius: "50%", background: ye, flexShrink: 0 } })),
4453
+ (me || []).slice(0, 4).map(
4454
+ /** @param {any} [hex] @param {any} [i] @returns {any} */
4455
+ (ye, Ge) => /* @__PURE__ */ e.createElement("span", { key: Ge, style: { width: "8px", height: "8px", borderRadius: "50%", background: ye, flexShrink: 0 } })
4456
+ ),
3692
4457
  /* @__PURE__ */ e.createElement("span", { style: { fontSize: "9px", fontWeight: Q ? 700 : 600, color: Q ? a.primary : a.textSec, marginLeft: "1px", textTransform: "capitalize" } }, u === "a11y" ? "A11y" : u)
3693
4458
  );
3694
- })), Array.isArray(t && t.series) && t.series.length > 0 ? /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "4px" } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: a.textSec, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "2px" } }, "Override per series"), t.series.slice(0, 20).map((u, Q) => /* @__PURE__ */ e.createElement("div", { key: u.name || Q, style: { display: "flex", alignItems: "center", gap: "5px" } }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "2px", flexShrink: 0 } }, I.slice(0, 6).map((me, ye) => /* @__PURE__ */ e.createElement("button", { key: ye, type: "button", onClick: () => Nt((Ge) => ({ ...Ge, [u.name]: me })), style: { width: "14px", height: "14px", borderRadius: "50%", background: me, border: `2px solid ${(Ve[u.name] || Ce(Q, a, I)) === me ? a.text : "transparent"}`, cursor: "pointer", padding: 0, flexShrink: 0 }, title: me }))), /* @__PURE__ */ e.createElement("input", { type: "color", value: Ve[u.name] || Ce(Q, a, I), onChange: (me) => Nt((ye) => ({ ...ye, [u.name]: me.target.value })), style: { width: "24px", height: "24px", padding: 0, border: `1px solid ${a.border}`, borderRadius: "4px", cursor: "pointer", background: "none", flexShrink: 0 }, title: `Custom color for ${u.name}` }), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "11px", color: a.text, flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, u.name || `Series ${Q + 1}`), Ve[u.name] ? /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => Nt((me) => {
3695
- const ye = { ...me };
3696
- return delete ye[u.name], ye;
3697
- }), style: { border: "none", background: "none", color: a.textSec, cursor: "pointer", fontSize: "10px", padding: "0 2px" }, title: "Reset to palette" }, "↺") : null)), t.series.length > 20 ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: a.textSec } }, `…${t.series.length - 20} more`) : null) : null, /* @__PURE__ */ e.createElement("div", { style: { borderTop: `1px solid ${a.border}`, paddingTop: "8px" } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: a.textSec, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "6px" } }, "Custom Palette"), /* @__PURE__ */ e.createElement(On, { customColors: $t, onChange: Jt, theme: a, compactInputStyle: Ae }), $t.length >= 2 ? /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => bt("custom"), style: { ...jt, marginTop: "6px", background: ve === "custom" ? a.select : void 0, color: ve === "custom" ? a.primary : void 0, border: `1px solid ${ve === "custom" ? a.primary : a.border}` } }, ve === "custom" ? "Custom active" : "Use custom palette") : null), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Effects"), /* @__PURE__ */ e.createElement(xe, { label: "Animate", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => At((u) => !u), style: { border: `1px solid ${ft ? a.primary : a.border}`, background: ft ? a.select : a.headerSubtleBg || a.hover, color: ft ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, ft ? "On" : "Off")), n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Gradient", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => xt((u) => !u), style: { border: `1px solid ${Ze ? a.primary : a.border}`, background: Ze ? a.select : a.headerSubtleBg || a.hover, color: Ze ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, Ze ? "On" : "Off")), Ze ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Grad Dir", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "5px" } }, Br.map((u) => /* @__PURE__ */ e.createElement("button", { key: u.value, type: "button", onClick: () => Er(u.value), style: { border: `1px solid ${It === u.value ? a.primary : a.border}`, background: It === u.value ? a.select : a.headerSubtleBg || a.hover, color: It === u.value ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "5px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, u.label)))), /* @__PURE__ */ e.createElement(xe, { label: "Grad Opacity", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px", alignItems: "center" } }, /* @__PURE__ */ e.createElement("input", { type: "range", min: "10", max: "100", step: "5", value: Ht, onChange: (u) => kr(Number(u.target.value)), style: { flex: 1 } }), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "11px", color: a.textSec, minWidth: "30px" } }, Ht, "%")))) : null) : null, n === "line" || n === "scatter" || n === "bubble" || n === "area" || n === "radar" || de ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Markers"), /* @__PURE__ */ e.createElement(xe, { label: "Shape", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: Je, onChange: (u) => vt(u.target.value), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: "none" }, "None (line only)"), /* @__PURE__ */ e.createElement("option", { value: "circle" }, "Circle"), /* @__PURE__ */ e.createElement("option", { value: "square" }, "Square"), /* @__PURE__ */ e.createElement("option", { value: "diamond" }, "Diamond"), /* @__PURE__ */ e.createElement("option", { value: "triangle" }, "Triangle"), /* @__PURE__ */ e.createElement("option", { value: "cross" }, "Cross"))), /* @__PURE__ */ e.createElement(xe, { label: "Size", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("select", { value: Et, onChange: (u) => lt(Number(u.target.value)), style: { ...Ae, width: "80px" } }, /* @__PURE__ */ e.createElement("option", { value: 3 }, "Small"), /* @__PURE__ */ e.createElement("option", { value: 5 }, "Medium"), /* @__PURE__ */ e.createElement("option", { value: 7 }, "Large"), /* @__PURE__ */ e.createElement("option", { value: 10 }, "XLarge")))) : null, (n === "line" || n === "area" || de) && Array.isArray(t && t.series) && t.series.length > 0 ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Line Style"), /* @__PURE__ */ e.createElement(Fn, { series: t.series, lineDashStyles: Xt, onChange: Sr, seriesColors: Ve, paletteColors: I, getColorForIndex: Ce, theme: a, compactInputStyle: Ae })) : null, n === "bar" || n === "line" || n === "area" || n === "scatter" || de ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Trendline"), /* @__PURE__ */ e.createElement(xe, { label: "Show", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => qe((u) => !u), style: { border: `1px solid ${Be ? a.primary : a.border}`, background: Be ? a.select : a.headerSubtleBg || a.hover, color: Be ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, Be ? "On" : "Off")), Be ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Type", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: we, onChange: (u) => Xe(u.target.value), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: "linear" }, "Linear Regression"), /* @__PURE__ */ e.createElement("option", { value: "moving_avg" }, "Moving Average"), /* @__PURE__ */ e.createElement("option", { value: "exponential" }, "Exponential Smoothing"))), we === "moving_avg" ? /* @__PURE__ */ e.createElement(xe, { label: "Period", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "2", max: "50", value: rt, onChange: (u) => cr(Math.max(2, Math.min(50, Number(u.target.value) || 3))), style: { ...Ae, width: "80px" } })) : null, /* @__PURE__ */ e.createElement(xe, { label: "Color", theme: a }, /* @__PURE__ */ e.createElement("input", { type: "color", value: De || "#888888", onChange: (u) => d(u.target.value), style: { width: "32px", height: "28px", padding: 0, border: `1px solid ${a.border}`, borderRadius: "4px", cursor: "pointer", background: "none" }, title: "Trendline color" }), De ? /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => d(""), style: { border: "none", background: "none", color: a.textSec, cursor: "pointer", fontSize: "10px", padding: "0 4px" }, title: "Reset to auto" }, "↺") : null), /* @__PURE__ */ e.createElement(xe, { label: "Width", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "1", max: "8", value: Ft, onChange: (u) => wr(Math.max(1, Math.min(8, Number(u.target.value) || 2))), style: { ...Ae, width: "80px" } }))) : null) : null),
3698
- x === "labels" && /* @__PURE__ */ e.createElement(e.Fragment, null, n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "sparkline" ? /* @__PURE__ */ e.createElement(xe, { label: "Data Labels", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => Rt((u) => !u), style: { border: `1px solid ${he ? a.primary : a.border}`, background: he ? a.select : a.headerSubtleBg || a.hover, color: he ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, he ? "On" : "Off")) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" ? /* @__PURE__ */ e.createElement(xe, { label: "Format", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: pt, onChange: (u) => Ye(u.target.value), style: { ...Ae, width: "100%" }, title: "Value format for axis labels" }, En.map((u) => /* @__PURE__ */ e.createElement("option", { key: u.value, value: u.value }, u.label)))) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(xe, { label: "Decimals", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: qt, onChange: (u) => Qt(Number(u.target.value)), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: -1 }, "Auto"), /* @__PURE__ */ e.createElement("option", { value: 0 }, "0 (e.g. 1,234)"), /* @__PURE__ */ e.createElement("option", { value: 1 }, "1 (e.g. 1.2)"), /* @__PURE__ */ e.createElement("option", { value: 2 }, "2 (e.g. 1.23)"), /* @__PURE__ */ e.createElement("option", { value: 3 }, "3 (e.g. 1.234)"))) : null, he && n === "bar" ? /* @__PURE__ */ e.createElement(xe, { label: "Position", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: Pt, onChange: (u) => Zt(u.target.value), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: "outside" }, "Outside"), /* @__PURE__ */ e.createElement("option", { value: "inside" }, "Inside top"), /* @__PURE__ */ e.createElement("option", { value: "center" }, "Center"))) : null, n === "pie" || n === "donut" ? /* @__PURE__ */ e.createElement(xe, { label: "Callouts", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => te((u) => !u), style: { border: `1px solid ${We ? a.primary : a.border}`, background: We ? a.select : a.headerSubtleBg || a.hover, color: We ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, We ? "On" : "Off")) : null, n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(xe, { label: "Legend", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement(Nn, { legendPosition: kt, onChange: pr, theme: a })) : null)
4459
+ })), Array.isArray(t && t.series) && t.series.length > 0 ? /* @__PURE__ */ e.createElement("div", { style: { display: "flex", flexDirection: "column", gap: "4px" } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: a.textSec, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "2px" } }, "Override per series"), t.series.slice(0, 20).map(
4460
+ /** @param {any} [ser] @param {any} [si] @returns {any} */
4461
+ (u, Q) => /* @__PURE__ */ e.createElement("div", { key: u.name || Q, style: { display: "flex", alignItems: "center", gap: "5px" } }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "2px", flexShrink: 0 } }, I.slice(0, 6).map(
4462
+ /** @param {any} [hex] @param {any} [pi] @returns {any} */
4463
+ (me, ye) => /* @__PURE__ */ e.createElement("button", { key: ye, type: "button", onClick: () => Nt(
4464
+ /** @param {any} [prev] @returns {any} */
4465
+ (Ge) => ({ ...Ge, [u.name]: me })
4466
+ ), style: { width: "14px", height: "14px", borderRadius: "50%", background: me, border: `2px solid ${(Ve[u.name] || Ce(Q, a, I)) === me ? a.text : "transparent"}`, cursor: "pointer", padding: 0, flexShrink: 0 }, title: me })
4467
+ )), /* @__PURE__ */ e.createElement("input", { type: "color", value: Ve[u.name] || Ce(Q, a, I), onChange: (me) => Nt(
4468
+ /** @param {any} [prev] @returns {any} */
4469
+ (ye) => ({ ...ye, [u.name]: me.target.value })
4470
+ ), style: { width: "24px", height: "24px", padding: 0, border: `1px solid ${a.border}`, borderRadius: "4px", cursor: "pointer", background: "none", flexShrink: 0 }, title: `Custom color for ${u.name}` }), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "11px", color: a.text, flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, u.name || `Series ${Q + 1}`), Ve[u.name] ? /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => Nt(
4471
+ /** @param {any} [prev] @returns {any} */
4472
+ (me) => {
4473
+ const ye = { ...me };
4474
+ return delete ye[u.name], ye;
4475
+ }
4476
+ ), style: { border: "none", background: "none", color: a.textSec, cursor: "pointer", fontSize: "10px", padding: "0 2px" }, title: "Reset to palette" }, "↺") : null)
4477
+ ), t.series.length > 20 ? /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", color: a.textSec } }, `…${t.series.length - 20} more`) : null) : null, /* @__PURE__ */ e.createElement("div", { style: { borderTop: `1px solid ${a.border}`, paddingTop: "8px" } }, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 700, color: a.textSec, textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: "6px" } }, "Custom Palette"), /* @__PURE__ */ e.createElement(On, { customColors: $t, onChange: Jt, theme: a, compactInputStyle: Ae }), $t.length >= 2 ? /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => bt("custom"), style: { ...jt, marginTop: "6px", background: ve === "custom" ? a.select : void 0, color: ve === "custom" ? a.primary : void 0, border: `1px solid ${ve === "custom" ? a.primary : a.border}` } }, ve === "custom" ? "Custom active" : "Use custom palette") : null), /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Effects"), /* @__PURE__ */ e.createElement(xe, { label: "Animate", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => At(
4478
+ /** @param {any} [v] @returns {any} */
4479
+ (u) => !u
4480
+ ), style: { border: `1px solid ${ft ? a.primary : a.border}`, background: ft ? a.select : a.headerSubtleBg || a.hover, color: ft ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, ft ? "On" : "Off")), n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" && n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Gradient", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => xt(
4481
+ /** @param {any} [v] @returns {any} */
4482
+ (u) => !u
4483
+ ), style: { border: `1px solid ${Ze ? a.primary : a.border}`, background: Ze ? a.select : a.headerSubtleBg || a.hover, color: Ze ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, Ze ? "On" : "Off")), Ze ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Grad Dir", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "5px" } }, Br.map((u) => /* @__PURE__ */ e.createElement("button", { key: u.value, type: "button", onClick: () => Er(u.value), style: { border: `1px solid ${It === u.value ? a.primary : a.border}`, background: It === u.value ? a.select : a.headerSubtleBg || a.hover, color: It === u.value ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "5px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, u.label)))), /* @__PURE__ */ e.createElement(xe, { label: "Grad Opacity", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px", alignItems: "center" } }, /* @__PURE__ */ e.createElement("input", { type: "range", min: "10", max: "100", step: "5", value: Ht, onChange: (u) => kr(Number(u.target.value)), style: { flex: 1 } }), /* @__PURE__ */ e.createElement("span", { style: { fontSize: "11px", color: a.textSec, minWidth: "30px" } }, Ht, "%")))) : null) : null, n === "line" || n === "scatter" || n === "bubble" || n === "area" || n === "radar" || de ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Markers"), /* @__PURE__ */ e.createElement(xe, { label: "Shape", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: Je, onChange: (u) => vt(u.target.value), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: "none" }, "None (line only)"), /* @__PURE__ */ e.createElement("option", { value: "circle" }, "Circle"), /* @__PURE__ */ e.createElement("option", { value: "square" }, "Square"), /* @__PURE__ */ e.createElement("option", { value: "diamond" }, "Diamond"), /* @__PURE__ */ e.createElement("option", { value: "triangle" }, "Triangle"), /* @__PURE__ */ e.createElement("option", { value: "cross" }, "Cross"))), /* @__PURE__ */ e.createElement(xe, { label: "Size", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("select", { value: Et, onChange: (u) => lt(Number(u.target.value)), style: { ...Ae, width: "80px" } }, /* @__PURE__ */ e.createElement("option", { value: 3 }, "Small"), /* @__PURE__ */ e.createElement("option", { value: 5 }, "Medium"), /* @__PURE__ */ e.createElement("option", { value: 7 }, "Large"), /* @__PURE__ */ e.createElement("option", { value: 10 }, "XLarge")))) : null, (n === "line" || n === "area" || de) && Array.isArray(t && t.series) && t.series.length > 0 ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Line Style"), /* @__PURE__ */ e.createElement(Fn, { series: t.series, lineDashStyles: Xt, onChange: Sr, seriesColors: Ve, paletteColors: I, getColorForIndex: Ce, theme: a, compactInputStyle: Ae })) : null, n === "bar" || n === "line" || n === "area" || n === "scatter" || de ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: { fontSize: "10px", fontWeight: 800, letterSpacing: "0.08em", textTransform: "uppercase", color: a.textSec, paddingBottom: "4px", borderBottom: `1px solid ${a.border}`, marginTop: "4px" } }, "Trendline"), /* @__PURE__ */ e.createElement(xe, { label: "Show", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => qe(
4484
+ /** @param {any} [v] @returns {any} */
4485
+ (u) => !u
4486
+ ), style: { border: `1px solid ${Be ? a.primary : a.border}`, background: Be ? a.select : a.headerSubtleBg || a.hover, color: Be ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, Be ? "On" : "Off")), Be ? /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(xe, { label: "Type", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: we, onChange: (u) => Xe(u.target.value), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: "linear" }, "Linear Regression"), /* @__PURE__ */ e.createElement("option", { value: "moving_avg" }, "Moving Average"), /* @__PURE__ */ e.createElement("option", { value: "exponential" }, "Exponential Smoothing"))), we === "moving_avg" ? /* @__PURE__ */ e.createElement(xe, { label: "Period", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "2", max: "50", value: rt, onChange: (u) => cr(Math.max(2, Math.min(50, Number(u.target.value) || 3))), style: { ...Ae, width: "80px" } })) : null, /* @__PURE__ */ e.createElement(xe, { label: "Color", theme: a }, /* @__PURE__ */ e.createElement("input", { type: "color", value: De || "#888888", onChange: (u) => d(u.target.value), style: { width: "32px", height: "28px", padding: 0, border: `1px solid ${a.border}`, borderRadius: "4px", cursor: "pointer", background: "none" }, title: "Trendline color" }), De ? /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => d(""), style: { border: "none", background: "none", color: a.textSec, cursor: "pointer", fontSize: "10px", padding: "0 4px" }, title: "Reset to auto" }, "↺") : null), /* @__PURE__ */ e.createElement(xe, { label: "Width", theme: a, controlMinWidth: "80px" }, /* @__PURE__ */ e.createElement("input", { type: "number", min: "1", max: "8", value: Ft, onChange: (u) => wr(Math.max(1, Math.min(8, Number(u.target.value) || 2))), style: { ...Ae, width: "80px" } }))) : null) : null),
4487
+ x === "labels" && /* @__PURE__ */ e.createElement(e.Fragment, null, n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "sparkline" ? /* @__PURE__ */ e.createElement(xe, { label: "Data Labels", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => Rt(
4488
+ /** @param {any} [v] @returns {any} */
4489
+ (u) => !u
4490
+ ), style: { border: `1px solid ${he ? a.primary : a.border}`, background: he ? a.select : a.headerSubtleBg || a.hover, color: he ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, he ? "On" : "Off")) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "pie" && n !== "donut" ? /* @__PURE__ */ e.createElement(xe, { label: "Format", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: pt, onChange: (u) => Ye(u.target.value), style: { ...Ae, width: "100%" }, title: "Value format for axis labels" }, En.map((u) => /* @__PURE__ */ e.createElement("option", { key: u.value, value: u.value }, u.label)))) : null, n !== "heatmap" && n !== "icicle" && n !== "sunburst" && n !== "sankey" && n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(xe, { label: "Decimals", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: qt, onChange: (u) => Qt(Number(u.target.value)), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: -1 }, "Auto"), /* @__PURE__ */ e.createElement("option", { value: 0 }, "0 (e.g. 1,234)"), /* @__PURE__ */ e.createElement("option", { value: 1 }, "1 (e.g. 1.2)"), /* @__PURE__ */ e.createElement("option", { value: 2 }, "2 (e.g. 1.23)"), /* @__PURE__ */ e.createElement("option", { value: 3 }, "3 (e.g. 1.234)"))) : null, he && n === "bar" ? /* @__PURE__ */ e.createElement(xe, { label: "Position", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement("select", { value: Pt, onChange: (u) => Zt(u.target.value), style: { ...Ae, width: "100%" } }, /* @__PURE__ */ e.createElement("option", { value: "outside" }, "Outside"), /* @__PURE__ */ e.createElement("option", { value: "inside" }, "Inside top"), /* @__PURE__ */ e.createElement("option", { value: "center" }, "Center"))) : null, n === "pie" || n === "donut" ? /* @__PURE__ */ e.createElement(xe, { label: "Callouts", theme: a }, /* @__PURE__ */ e.createElement("button", { type: "button", onClick: () => te(
4491
+ /** @param {any} [v] @returns {any} */
4492
+ (u) => !u
4493
+ ), style: { border: `1px solid ${We ? a.primary : a.border}`, background: We ? a.select : a.headerSubtleBg || a.hover, color: We ? a.primary : a.text, borderRadius: a.radiusSm || "8px", padding: "6px 8px", fontSize: "11px", fontWeight: 700, cursor: "pointer" } }, We ? "On" : "Off")) : null, n !== "sparkline" && !gt.has(n) ? /* @__PURE__ */ e.createElement(xe, { label: "Legend", theme: a, controlMinWidth: "100%" }, /* @__PURE__ */ e.createElement(Nn, { legendPosition: kt, onChange: pr, theme: a })) : null)
3699
4494
  )
3700
4495
  )) : null),
3701
4496
  Ne ? /* @__PURE__ */ e.createElement("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap", alignItems: "center" } }, /* @__PURE__ */ e.createElement(sa, { model: t, theme: a }), /* @__PURE__ */ e.createElement(Hn, { model: t, maxCategories: Jr, maxSeries: Qr, theme: a })) : null
@@ -3958,7 +4753,10 @@ const Lr = [
3958
4753
  "button",
3959
4754
  {
3960
4755
  type: "button",
3961
- onClick: () => Dt((te) => !te),
4756
+ onClick: () => Dt(
4757
+ /** @param {any} [isActive] @returns {any} */
4758
+ (te) => !te
4759
+ ),
3962
4760
  style: lt(ee),
3963
4761
  title: ee ? "Exit full screen" : "Open chart full screen",
3964
4762
  "aria-label": ee ? "Exit full screen" : "Open chart full screen"
@@ -4099,9 +4897,21 @@ const Lr = [
4099
4897
  const et = gn(t.selectionMap, t.visibleRows, t.visibleCols);
4100
4898
  if (!et) return [];
4101
4899
  const _e = new Set(
4102
- (et.colIndexes || []).map((Me) => t.visibleCols[Me]).filter((Me) => Me && Me.id && !mn.has(Me.id)).map((Me) => Me.id)
4900
+ (et.colIndexes || []).map(
4901
+ /** @param {any} [index] @returns {any} */
4902
+ (Me) => t.visibleCols[Me]
4903
+ ).filter(
4904
+ /** @param {any} [column] @returns {any} */
4905
+ (Me) => Me && Me.id && !mn.has(Me.id)
4906
+ ).map(
4907
+ /** @param {any} [column] @returns {any} */
4908
+ (Me) => Me.id
4909
+ )
4910
+ );
4911
+ return zr(t.visibleCols).filter(
4912
+ /** @param {any} [column] @returns {any} */
4913
+ (Me) => _e.has(Me.id)
4103
4914
  );
4104
- return zr(t.visibleCols).filter((Me) => _e.has(Me.id));
4105
4915
  }, [t]), be = ot(() => t ? t.selectionMap && t.visibleRows && t.visibleCols ? f === "combo" ? yn(t.selectionMap, t.visibleRows, t.visibleCols, {
4106
4916
  hierarchyLevel: K,
4107
4917
  maxHierarchyLevel: t.maxHierarchyLevel || 1,