@alfadocs/ui-kit-debug 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/notes-panel-CCz0J140.js +370 -0
- package/dist/_chunks/notes-panel-CCz0J140.js.map +1 -0
- package/dist/_chunks/sparkline-DJtZBe7O.js +501 -0
- package/dist/_chunks/sparkline-DJtZBe7O.js.map +1 -0
- package/dist/agent-catalog.json +27 -1
- package/dist/agent-i18n/en.json +4 -2
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.agent.d.ts.map +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +45 -2
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/sparkline/index.js +1 -1
- package/dist/components/sparkline/sparkline.agent.d.ts.map +1 -1
- package/dist/components/sparkline/sparkline.d.ts +24 -0
- package/dist/components/sparkline/sparkline.d.ts.map +1 -1
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +2 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +2 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +2 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +2 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +2 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +2 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +2 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +2 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +2 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +2 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +2 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +2 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +2 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +2 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +2 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +2 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +2 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +2 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +2 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +2 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +2 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +2 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +2 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +2 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +2 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +2 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +2 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +2 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +2 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +2 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +2 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +2 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +2 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/locales/ar.json +2 -0
- package/dist/locales/de.json +2 -0
- package/dist/locales/el.json +2 -0
- package/dist/locales/en.json +2 -0
- package/dist/locales/es.json +2 -0
- package/dist/locales/fr.json +2 -0
- package/dist/locales/hi.json +2 -0
- package/dist/locales/it.json +2 -0
- package/dist/locales/ja.json +2 -0
- package/dist/locales/nl.json +2 -0
- package/dist/locales/pl.json +2 -0
- package/dist/locales/pt.json +2 -0
- package/dist/locales/ro.json +2 -0
- package/dist/locales/ru.json +2 -0
- package/dist/locales/sq.json +2 -0
- package/dist/locales/sv.json +2 -0
- package/dist/locales/tr.json +2 -0
- package/dist/locales/zh.json +2 -0
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/notes-panel-CTcOLLVo.js +0 -324
- package/dist/_chunks/notes-panel-CTcOLLVo.js.map +0 -1
- package/dist/_chunks/sparkline-DLq7xwic.js +0 -394
- package/dist/_chunks/sparkline-DLq7xwic.js.map +0 -1
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
import { jsx as i, jsxs as G } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Y, useId as ee, useMemo as x, useRef as te, useState as $, useEffect as j, useImperativeHandle as re } from "react";
|
|
3
|
-
import { c as B } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as ne } from "react-i18next";
|
|
5
|
-
import ae from "react-apexcharts";
|
|
6
|
-
import T from "apexcharts";
|
|
7
|
-
import { g as L, u as se } from "./apexcharts-theme-B_AxGC_h.js";
|
|
8
|
-
import { m as oe } from "./annotation-marker-CsUJGZjQ.js";
|
|
9
|
-
import { u as ie } from "./registry-DvAUVLHh.js";
|
|
10
|
-
function de(r) {
|
|
11
|
-
if (r.length < 2)
|
|
12
|
-
return { slope: 0, direction: "steady" };
|
|
13
|
-
const a = r.length, d = (a - 1) / 2, m = r.reduce((n, o) => n + o, 0) / a;
|
|
14
|
-
let c = 0, h = 0;
|
|
15
|
-
for (let n = 0; n < a; n++) {
|
|
16
|
-
const o = n - d;
|
|
17
|
-
c += o * (r[n] - m), h += o * o;
|
|
18
|
-
}
|
|
19
|
-
const l = h === 0 ? 0 : c / h, I = 0.01 * (Math.max(...r) - Math.min(...r) || 1), f = Math.abs(l) < I ? "steady" : l > 0 ? "increasing" : "decreasing";
|
|
20
|
-
return { slope: l, direction: f };
|
|
21
|
-
}
|
|
22
|
-
const ce = {
|
|
23
|
-
id: "sparkline",
|
|
24
|
-
capabilities: [],
|
|
25
|
-
state: {},
|
|
26
|
-
actions: {
|
|
27
|
-
update_series: {
|
|
28
|
-
// Replacing the rendered series mutates what the chart displays — write,
|
|
29
|
-
// not read.
|
|
30
|
-
safety: "write",
|
|
31
|
-
argsType: "{ data: number[] }",
|
|
32
|
-
argsSchema: {
|
|
33
|
-
type: "object",
|
|
34
|
-
properties: {
|
|
35
|
-
data: {
|
|
36
|
-
type: "array",
|
|
37
|
-
items: { type: "number" },
|
|
38
|
-
description: "The new data points to render."
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
required: ["data"]
|
|
42
|
-
},
|
|
43
|
-
idempotent: !0,
|
|
44
|
-
descriptionKey: "ui.agent.sparkline.actions.updateSeries",
|
|
45
|
-
description: "Replace the sparkline data without remounting.",
|
|
46
|
-
invoke: (r, a) => {
|
|
47
|
-
r.updateSeries(a.data);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
export_png: {
|
|
51
|
-
// Pure getter — returns an image of the current chart, no state change.
|
|
52
|
-
safety: "read",
|
|
53
|
-
returns: "string",
|
|
54
|
-
returnsSchema: {
|
|
55
|
-
type: "string",
|
|
56
|
-
description: "A PNG image of the sparkline encoded as a data URI."
|
|
57
|
-
},
|
|
58
|
-
descriptionKey: "ui.agent.sparkline.actions.exportPng",
|
|
59
|
-
description: "Return a PNG data URI of the sparkline.",
|
|
60
|
-
invoke: (r) => r.dataURI()
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
domHooks: {
|
|
64
|
-
root: { attr: "data-component", value: "sparkline" },
|
|
65
|
-
instanceId: {
|
|
66
|
-
attr: "data-component-id",
|
|
67
|
-
sourceProp: "id",
|
|
68
|
-
description: "Sourced from the id prop."
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}, V = B("ds:relative ds:inline-block ds:w-full", {
|
|
72
|
-
variants: {
|
|
73
|
-
size: {
|
|
74
|
-
xs: "ds:h-6",
|
|
75
|
-
sm: "ds:h-8",
|
|
76
|
-
md: "ds:h-10",
|
|
77
|
-
// Applied when an explicit `height` prop is given: the wrapper
|
|
78
|
-
// grows with the svg instead of clipping at the size's fixed height.
|
|
79
|
-
auto: ""
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
defaultVariants: { size: "md" }
|
|
83
|
-
}), le = B("", {
|
|
84
|
-
variants: {
|
|
85
|
-
tone: {
|
|
86
|
-
neutral: "ds:[--annotation-color:var(--muted-foreground)]",
|
|
87
|
-
info: "ds:[--annotation-color:var(--info)]",
|
|
88
|
-
success: "ds:[--annotation-color:var(--success)]",
|
|
89
|
-
/* `--warning-readable`, not `--warning`: a 1.5px dashed line is a
|
|
90
|
-
* non-text graphic (WCAG 1.4.11, 3:1), and yellow-500 is ~1.6:1 on a
|
|
91
|
-
* light card. The token aliases back to `--warning` in dark. */
|
|
92
|
-
warning: "ds:[--annotation-color:var(--warning-readable)]",
|
|
93
|
-
error: "ds:[--annotation-color:var(--destructive)]",
|
|
94
|
-
accent: "ds:[--annotation-color:var(--accent)]"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
defaultVariants: { tone: "neutral" }
|
|
98
|
-
}), ue = {
|
|
99
|
-
increasing: "↑",
|
|
100
|
-
decreasing: "↓",
|
|
101
|
-
steady: "→"
|
|
102
|
-
}, pe = {
|
|
103
|
-
xs: 24,
|
|
104
|
-
sm: 32,
|
|
105
|
-
md: 40
|
|
106
|
-
}, w = 2, W = 2.5;
|
|
107
|
-
function me(r) {
|
|
108
|
-
return Number.isFinite(r) ? Math.min(1, Math.max(0, r)) : 0;
|
|
109
|
-
}
|
|
110
|
-
function he(r) {
|
|
111
|
-
return r.filter((a) => a != null);
|
|
112
|
-
}
|
|
113
|
-
function fe() {
|
|
114
|
-
return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
115
|
-
}
|
|
116
|
-
const ge = Y(
|
|
117
|
-
({
|
|
118
|
-
id: r,
|
|
119
|
-
data: a,
|
|
120
|
-
variant: d = "line",
|
|
121
|
-
size: m = "md",
|
|
122
|
-
label: c,
|
|
123
|
-
color: h,
|
|
124
|
-
showEndpoint: l = !1,
|
|
125
|
-
showTooltip: C = !1,
|
|
126
|
-
width: I,
|
|
127
|
-
height: f,
|
|
128
|
-
annotations: n,
|
|
129
|
-
className: o,
|
|
130
|
-
...O
|
|
131
|
-
}, K) => {
|
|
132
|
-
var E;
|
|
133
|
-
const { t: u, i18n: S } = ne(), z = ee(), g = x(
|
|
134
|
-
() => `sparkline-${z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
135
|
-
[z]
|
|
136
|
-
), k = te(null), [D, Z] = $(0), s = x(() => he(a), [a]), { direction: N } = de(s), _ = x(() => {
|
|
137
|
-
const e = n && n.length > 0 ? u("sparkline.annotations", {
|
|
138
|
-
list: n.map((p) => p.label).join(", ")
|
|
139
|
-
}) : "", t = (p) => e ? `${p}. ${e}` : p;
|
|
140
|
-
if (s.length === 0)
|
|
141
|
-
return t(u("sparkline.noData", "No data"));
|
|
142
|
-
const v = (p) => new Intl.NumberFormat(S.language).format(p), b = u(`sparkline.direction.${N}`), F = {
|
|
143
|
-
min: v(Math.min(...s)),
|
|
144
|
-
max: v(Math.max(...s)),
|
|
145
|
-
current: v(s[s.length - 1]),
|
|
146
|
-
direction: b
|
|
147
|
-
};
|
|
148
|
-
return t(c ? u("sparkline.summary", { label: c, ...F }) : u("sparkline.summaryNoLabel", F));
|
|
149
|
-
}, [s, n, c, N, S.language, u]), [y, q] = $(
|
|
150
|
-
() => {
|
|
151
|
-
try {
|
|
152
|
-
return L();
|
|
153
|
-
} catch {
|
|
154
|
-
return {};
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
j(() => {
|
|
159
|
-
let e;
|
|
160
|
-
const t = new MutationObserver(() => {
|
|
161
|
-
clearTimeout(e), e = setTimeout(() => {
|
|
162
|
-
try {
|
|
163
|
-
q(L());
|
|
164
|
-
} catch {
|
|
165
|
-
}
|
|
166
|
-
}, 50);
|
|
167
|
-
});
|
|
168
|
-
return t.observe(document.documentElement, {
|
|
169
|
-
attributes: !0,
|
|
170
|
-
attributeFilter: ["class"]
|
|
171
|
-
}), () => {
|
|
172
|
-
clearTimeout(e), t.disconnect();
|
|
173
|
-
};
|
|
174
|
-
}, []), j(() => {
|
|
175
|
-
const e = k.current;
|
|
176
|
-
if (!e) return;
|
|
177
|
-
const t = new ResizeObserver((v) => {
|
|
178
|
-
const b = v[0];
|
|
179
|
-
b && Z(Math.floor(b.contentRect.width));
|
|
180
|
-
});
|
|
181
|
-
return t.observe(e), () => t.disconnect();
|
|
182
|
-
}, []), se(k);
|
|
183
|
-
const R = x(
|
|
184
|
-
() => ({
|
|
185
|
-
updateSeries(e) {
|
|
186
|
-
var t;
|
|
187
|
-
(t = T.getChartByID(g)) == null || t.updateSeries([{ data: e }]);
|
|
188
|
-
},
|
|
189
|
-
updateOptions(e) {
|
|
190
|
-
var t;
|
|
191
|
-
(t = T.getChartByID(g)) == null || t.updateOptions(e);
|
|
192
|
-
},
|
|
193
|
-
async dataURI() {
|
|
194
|
-
const e = T.getChartByID(g);
|
|
195
|
-
return e ? (await e.dataURI()).imgURI : "";
|
|
196
|
-
}
|
|
197
|
-
}),
|
|
198
|
-
[g]
|
|
199
|
-
);
|
|
200
|
-
re(K, () => R, [R]), ie(ce, R, r);
|
|
201
|
-
const M = h ?? ((E = y.colors) == null ? void 0 : E[0]) ?? "currentColor";
|
|
202
|
-
if (s.length === 0)
|
|
203
|
-
return /* @__PURE__ */ i(
|
|
204
|
-
"div",
|
|
205
|
-
{
|
|
206
|
-
ref: k,
|
|
207
|
-
role: "img",
|
|
208
|
-
"aria-label": _,
|
|
209
|
-
dir: "ltr",
|
|
210
|
-
className: V({
|
|
211
|
-
size: f !== void 0 ? "auto" : m,
|
|
212
|
-
className: o
|
|
213
|
-
}),
|
|
214
|
-
"data-component": "sparkline",
|
|
215
|
-
"data-component-id": r,
|
|
216
|
-
...O
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
const P = fe(), A = a.length > s.length, H = A ? a.flatMap((e, t) => e == null ? [] : [{ x: t, y: e }]) : s, J = {
|
|
220
|
-
...y,
|
|
221
|
-
chart: {
|
|
222
|
-
...y.chart,
|
|
223
|
-
id: g,
|
|
224
|
-
type: d,
|
|
225
|
-
sparkline: { enabled: !0 },
|
|
226
|
-
toolbar: { show: !1 },
|
|
227
|
-
animations: {
|
|
228
|
-
enabled: !P,
|
|
229
|
-
// A gapped series is re-rendered as {x, y} pairs, and Apex's
|
|
230
|
-
// update tween interpolates between the old and new paths point by
|
|
231
|
-
// point. Across a width change the two have different lengths and
|
|
232
|
-
// the tween emits `d="… NaN …"` for a few frames. The finished
|
|
233
|
-
// render is correct either way; switching the tween off keeps the
|
|
234
|
-
// console clean.
|
|
235
|
-
dynamicAnimation: { enabled: !P && !A }
|
|
236
|
-
},
|
|
237
|
-
zoom: { enabled: !1 },
|
|
238
|
-
parentHeightOffset: 0
|
|
239
|
-
},
|
|
240
|
-
colors: [M],
|
|
241
|
-
stroke: {
|
|
242
|
-
curve: "smooth",
|
|
243
|
-
width: d === "bar" ? 0 : 2
|
|
244
|
-
},
|
|
245
|
-
fill: {
|
|
246
|
-
opacity: d === "area" ? 0.15 : 1
|
|
247
|
-
},
|
|
248
|
-
xaxis: {
|
|
249
|
-
crosshairs: { show: !1 },
|
|
250
|
-
// Pin the extent to the slot count so a gap at either end still holds
|
|
251
|
-
// its place — otherwise the plot would rescale to the measurements
|
|
252
|
-
// and the annotation fractions would no longer mean the same thing.
|
|
253
|
-
...A ? { type: "numeric", min: 0, max: a.length - 1 } : {}
|
|
254
|
-
},
|
|
255
|
-
tooltip: { enabled: C },
|
|
256
|
-
markers: l ? {
|
|
257
|
-
size: [0],
|
|
258
|
-
discrete: [
|
|
259
|
-
{
|
|
260
|
-
// An index into the SERIES, whose holes have already been
|
|
261
|
-
// removed — so this is the last MEASURED point, never a slot
|
|
262
|
-
// the parameter was not measured at.
|
|
263
|
-
seriesIndex: 0,
|
|
264
|
-
dataPointIndex: H.length - 1,
|
|
265
|
-
fillColor: M,
|
|
266
|
-
strokeColor: M,
|
|
267
|
-
size: 4
|
|
268
|
-
}
|
|
269
|
-
]
|
|
270
|
-
} : { size: 0 },
|
|
271
|
-
grid: {
|
|
272
|
-
...y.grid,
|
|
273
|
-
show: !1,
|
|
274
|
-
// ApexCharts grid.padding uses physical keys (not CSS logical properties).
|
|
275
|
-
// The chart wrapper enforces dir="ltr" so these always resolve correctly.
|
|
276
|
-
padding: {
|
|
277
|
-
top: w,
|
|
278
|
-
right: w,
|
|
279
|
-
bottom: w,
|
|
280
|
-
left: w
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}, Q = I ?? (D > 0 ? D : "100%"), X = f ?? pe[m ?? "md"], U = n != null && n.length ? n : void 0;
|
|
284
|
-
return /* @__PURE__ */ G(
|
|
285
|
-
"div",
|
|
286
|
-
{
|
|
287
|
-
ref: k,
|
|
288
|
-
role: "img",
|
|
289
|
-
"aria-label": _,
|
|
290
|
-
dir: "ltr",
|
|
291
|
-
className: V({
|
|
292
|
-
size: f !== void 0 ? "auto" : m,
|
|
293
|
-
className: o
|
|
294
|
-
}),
|
|
295
|
-
"data-component": "sparkline",
|
|
296
|
-
"data-component-id": r,
|
|
297
|
-
...O,
|
|
298
|
-
children: [
|
|
299
|
-
/* @__PURE__ */ i(
|
|
300
|
-
ae,
|
|
301
|
-
{
|
|
302
|
-
type: d,
|
|
303
|
-
series: [{ data: H }],
|
|
304
|
-
options: J,
|
|
305
|
-
width: Q,
|
|
306
|
-
height: X,
|
|
307
|
-
"aria-hidden": "true"
|
|
308
|
-
}
|
|
309
|
-
),
|
|
310
|
-
U && /* Drawn over the plot rather than through ApexCharts' own xaxis
|
|
311
|
-
annotations: a fraction of the measured extent is the one
|
|
312
|
-
positioning rule that survives series of different lengths, which
|
|
313
|
-
is what makes a column of sparklines share an x. */
|
|
314
|
-
/* The inset lives on a div: an <svg> is a replaced element, so
|
|
315
|
-
left+right do not size it and it would fall back to its intrinsic
|
|
316
|
-
300px. The div is the plot box; the svg fills it. The 2px MUST
|
|
317
|
-
equal PLOT_EDGE_PADDING — Tailwind needs a static literal, so the
|
|
318
|
-
two cannot share one source; change them together or the first and
|
|
319
|
-
last annotation drift off the first and last data point. */
|
|
320
|
-
/* @__PURE__ */ i("div", { className: "ds:pointer-events-none ds:absolute ds:inset-y-0 ds:inset-x-[2px]", children: /* @__PURE__ */ i(
|
|
321
|
-
"svg",
|
|
322
|
-
{
|
|
323
|
-
"aria-hidden": "true",
|
|
324
|
-
focusable: "false",
|
|
325
|
-
"data-testid": "sparkline-annotations",
|
|
326
|
-
className: "ds:size-full",
|
|
327
|
-
children: U.map((e) => {
|
|
328
|
-
const t = me(e.position);
|
|
329
|
-
return (
|
|
330
|
-
/* A nested viewport placed at a percentage of the plot: the
|
|
331
|
-
one positioning rule that needs no measurement, so a column
|
|
332
|
-
of sparklines shares an x whatever their widths. */
|
|
333
|
-
/* @__PURE__ */ G(
|
|
334
|
-
"svg",
|
|
335
|
-
{
|
|
336
|
-
x: `${t * 100}%`,
|
|
337
|
-
y: "0",
|
|
338
|
-
width: "1",
|
|
339
|
-
height: "100%",
|
|
340
|
-
overflow: "visible",
|
|
341
|
-
"data-annotation-id": e.id,
|
|
342
|
-
"data-annotation-position": t,
|
|
343
|
-
className: le({ tone: e.tone }),
|
|
344
|
-
children: [
|
|
345
|
-
/* @__PURE__ */ i(
|
|
346
|
-
"line",
|
|
347
|
-
{
|
|
348
|
-
x1: 0,
|
|
349
|
-
x2: 0,
|
|
350
|
-
y1: 0,
|
|
351
|
-
y2: "100%",
|
|
352
|
-
className: "ds:[stroke:var(--annotation-color)] ds:[stroke-dasharray:2_3] ds:[stroke-width:1]"
|
|
353
|
-
}
|
|
354
|
-
),
|
|
355
|
-
/* @__PURE__ */ i(
|
|
356
|
-
"path",
|
|
357
|
-
{
|
|
358
|
-
d: oe(
|
|
359
|
-
e.shape ?? "diamond",
|
|
360
|
-
0,
|
|
361
|
-
W,
|
|
362
|
-
W
|
|
363
|
-
),
|
|
364
|
-
className: "ds:[fill:var(--annotation-color)]"
|
|
365
|
-
}
|
|
366
|
-
)
|
|
367
|
-
]
|
|
368
|
-
},
|
|
369
|
-
e.id
|
|
370
|
-
)
|
|
371
|
-
);
|
|
372
|
-
})
|
|
373
|
-
}
|
|
374
|
-
) }),
|
|
375
|
-
l && /* @__PURE__ */ i(
|
|
376
|
-
"span",
|
|
377
|
-
{
|
|
378
|
-
"aria-hidden": "true",
|
|
379
|
-
className: "ds:pointer-events-none ds:absolute ds:end-0 ds:top-0 ds:text-[length:var(--font-size-xs)] ds:leading-none",
|
|
380
|
-
children: ue[N]
|
|
381
|
-
}
|
|
382
|
-
)
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
);
|
|
388
|
-
ge.displayName = "Sparkline";
|
|
389
|
-
export {
|
|
390
|
-
ge as S,
|
|
391
|
-
ce as s,
|
|
392
|
-
de as u
|
|
393
|
-
};
|
|
394
|
-
//# sourceMappingURL=sparkline-DLq7xwic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sparkline-DLq7xwic.js","sources":["../../src/components/sparkline/use-linear-trend.ts","../../src/components/sparkline/sparkline.agent.ts","../../src/components/sparkline/sparkline.tsx"],"sourcesContent":["export type TrendDirection = 'increasing' | 'decreasing' | 'steady';\n\nexport interface LinearTrendResult {\n slope: number;\n direction: TrendDirection;\n}\n\nexport function useLinearTrend(data: number[]): LinearTrendResult {\n if (data.length < 2) {\n return { slope: 0, direction: 'steady' };\n }\n\n const n = data.length;\n const xMean = (n - 1) / 2;\n const yMean = data.reduce((sum, y) => sum + y, 0) / n;\n\n let numerator = 0;\n let denominator = 0;\n\n for (let i = 0; i < n; i++) {\n const dx = i - xMean;\n numerator += dx * (data[i] - yMean);\n denominator += dx * dx;\n }\n\n const slope = denominator === 0 ? 0 : numerator / denominator;\n const range = Math.max(...data) - Math.min(...data);\n const threshold = 0.01 * (range || 1);\n\n const direction: TrendDirection =\n Math.abs(slope) < threshold\n ? 'steady'\n : slope > 0\n ? 'increasing'\n : 'decreasing';\n\n return { slope, direction };\n}\n","import type { AgentAdapter } from '../../agent/types';\nimport type { SparklineHandle } from './sparkline';\n\nexport const sparklineAgent: AgentAdapter<SparklineHandle> = {\n id: 'sparkline',\n capabilities: [],\n state: {},\n actions: {\n update_series: {\n // Replacing the rendered series mutates what the chart displays — write,\n // not read.\n safety: 'write',\n argsType: '{ data: number[] }',\n argsSchema: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: { type: 'number' },\n description: 'The new data points to render.',\n },\n },\n required: ['data'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.sparkline.actions.updateSeries',\n description: 'Replace the sparkline data without remounting.',\n invoke: (handle, args: { data: number[] }) => {\n handle.updateSeries(args.data);\n },\n },\n export_png: {\n // Pure getter — returns an image of the current chart, no state change.\n safety: 'read',\n returns: 'string',\n returnsSchema: {\n type: 'string',\n description: 'A PNG image of the sparkline encoded as a data URI.',\n },\n descriptionKey: 'ui.agent.sparkline.actions.exportPng',\n description: 'Return a PNG data URI of the sparkline.',\n invoke: (handle) => handle.dataURI(),\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'sparkline' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport ReactApexChart from 'react-apexcharts';\nimport ApexCharts from 'apexcharts';\nimport { getApexChartsTheme } from '../../tokens/apexcharts-theme';\nimport { useNeutraliseHiddenFocus } from '../_shared/use-neutralize-hidden-focus';\nimport { markerPath, type MarkerShape } from '../annotation-marker';\nimport { useLinearTrend } from './use-linear-trend';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { sparklineAgent } from './sparkline.agent';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst sparklineVariants = cva('ds:relative ds:inline-block ds:w-full', {\n variants: {\n size: {\n xs: 'ds:h-6',\n sm: 'ds:h-8',\n md: 'ds:h-10',\n // Applied when an explicit `height` prop is given: the wrapper\n // grows with the svg instead of clipping at the size's fixed height.\n auto: '',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\n/* Tone only TINTS the annotation — the shape is what distinguishes one\n * event from another (WCAG 1.4.1), matching AnnotationMarker's vocabulary. */\nconst annotationVariants = cva('', {\n variants: {\n tone: {\n neutral: 'ds:[--annotation-color:var(--muted-foreground)]',\n info: 'ds:[--annotation-color:var(--info)]',\n success: 'ds:[--annotation-color:var(--success)]',\n /* `--warning-readable`, not `--warning`: a 1.5px dashed line is a\n * non-text graphic (WCAG 1.4.11, 3:1), and yellow-500 is ~1.6:1 on a\n * light card. The token aliases back to `--warning` in dark. */\n warning: 'ds:[--annotation-color:var(--warning-readable)]',\n error: 'ds:[--annotation-color:var(--destructive)]',\n accent: 'ds:[--annotation-color:var(--accent)]',\n },\n },\n defaultVariants: { tone: 'neutral' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Constants */\n/* ------------------------------------------------------------------ */\n\nconst DIRECTION_ARROW = {\n increasing: '↑',\n decreasing: '↓',\n steady: '→',\n} as const;\n\nconst SIZE_HEIGHT: Record<'xs' | 'sm' | 'md', number> = {\n xs: 24,\n sm: 32,\n md: 40,\n};\n\n/** ApexCharts grid padding, in px. The plotted extent is the wrapper inset by\n * this on each edge, so the annotation overlay has to use the same number to\n * land its first/last position on the first/last data point. */\nconst PLOT_EDGE_PADDING = 2;\n\n/** Radius of an annotation's shape cap, in svg user units (= px here). Sized\n * against the SMALLEST sparkline it has to sit on (`xs`, 24px): a 5px cap is\n * ~a fifth of that height, still shape-legible, and no longer competes with\n * the series it annotates. */\nconst ANNOTATION_CAP_RADIUS = 2.5;\n\nfunction clampFraction(value: number): number {\n if (!Number.isFinite(value)) return 0;\n return Math.min(1, Math.max(0, value));\n}\n\n/** The measurements in a series, gaps dropped. A `null` is an unmeasured\n * position, not a zero — it must not reach the min/max/trend maths. */\nfunction measured(data: readonly (number | null)[]): number[] {\n return data.filter((value): value is number => value != null);\n}\n\nfunction prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface SparklineHandle {\n updateSeries: (data: (number | null)[]) => void;\n updateOptions: (opts: ApexCharts.ApexOptions) => void;\n dataURI: () => Promise<string>;\n}\n\n/** Semantic tint for an annotation. Decorative reinforcement of `shape` —\n * never the only channel carrying which event this is. */\nexport type SparklineAnnotationTone =\n | 'neutral'\n | 'info'\n | 'success'\n | 'warning'\n | 'error'\n | 'accent';\n\n/**\n * A vertical reference line dropped across the plot — the release-annotation\n * pattern: \"something happened here, look at what the line does around it\".\n *\n * `position` is a FRACTION of the plotted x extent, not an index: `0` is the\n * first data point, `1` the last, `0.5` exactly halfway between them. That is\n * what lets an event that falls BETWEEN two points be placed at all, and what\n * lets the same event land at the same x in a column of stacked sparklines —\n * the caller derives the fraction once, from a domain the whole column shares,\n * rather than per-series from a point count that differs row to row.\n */\nexport interface SparklineAnnotation {\n /** Stable key — also emitted as `data-annotation-id` for test/agent hooks. */\n id: string;\n /** Fraction of the plotted x extent: 0 = first point, 1 = last. Clamped. */\n position: number;\n /** Accessible label, already localised by the caller. Folded into the\n * sparkline's own `aria-label` — the line itself says nothing aloud. */\n label: string;\n /** Shape of the cap drawn at the top of the line. The accessible channel. */\n shape?: MarkerShape;\n tone?: SparklineAnnotationTone;\n}\n\nexport interface SparklineProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'role' | 'children'>,\n VariantProps<typeof sparklineVariants> {\n /** Data points in plot order. `null` is an unmeasured position — it holds\n * the point's place on the x extent and draws a gap, so a series measured\n * at some positions and not others stays aligned with one that was measured\n * at all of them. */\n data: (number | null)[];\n /** Chart visual style */\n variant?: 'line' | 'bar' | 'area';\n /** Size preset */\n size?: 'xs' | 'sm' | 'md';\n /** Accessible label prefix, e.g. \"Revenue, 30 days\" */\n label?: string;\n /** Stroke / bar colour override — defaults to var(--primary) via bridge */\n color?: string;\n /** Show end-point dot with trend direction arrow */\n showEndpoint?: boolean;\n /**\n * Show Apex's hover tooltip with the data point value. Defaults to\n * `false` — sparklines are intentionally minimal — opt in when the\n * sparkline is large enough to be a primary metric surface (e.g.\n * dashboard widgets) and the user benefits from per-point readout.\n */\n showTooltip?: boolean;\n /** Width override — defaults to 100% of container */\n width?: string | number;\n /** Height override — defaults to the size variant height */\n height?: string | number;\n /** Vertical reference lines dropped across the plot. Omitted = none, so\n * every existing consumer is unaffected. */\n annotations?: readonly SparklineAnnotation[];\n}\n\n/* ------------------------------------------------------------------ */\n/* Sparkline component */\n/* ------------------------------------------------------------------ */\n\nexport const Sparkline = forwardRef<SparklineHandle, SparklineProps>(\n (\n {\n id,\n data,\n variant = 'line',\n size = 'md',\n label,\n color,\n showEndpoint = false,\n showTooltip = false,\n width,\n height,\n annotations,\n className,\n ...props\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const rawId = useId();\n const chartId = useMemo(\n () => `sparkline-${rawId.replace(/[^a-zA-Z0-9-_]/g, '')}`,\n [rawId],\n );\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState(0);\n\n // Gaps are positions, not values: they hold the point's place on the x\n // extent but never reach the trend, the min/max, or the endpoint dot.\n const points = useMemo(() => measured(data), [data]);\n const { direction } = useLinearTrend(points);\n\n /* ---- accessible summary ---------------------------------------- */\n const ariaLabel = useMemo(() => {\n // The annotations are the only thing a vertical line in an SVG can say\n // aloud, so they ride the summary in every branch — including \"no data\",\n // where the marked events are all there is left to report.\n const marks =\n annotations && annotations.length > 0\n ? t('sparkline.annotations', {\n list: annotations.map((a) => a.label).join(', '),\n })\n : '';\n const withMarks = (summary: string) =>\n marks ? `${summary}. ${marks}` : summary;\n\n if (points.length === 0) {\n return withMarks(t('sparkline.noData', 'No data'));\n }\n const fmt = (n: number) => new Intl.NumberFormat(i18n.language).format(n);\n const dirText = t(`sparkline.direction.${direction}`);\n const nums = {\n min: fmt(Math.min(...points)),\n max: fmt(Math.max(...points)),\n current: fmt(points[points.length - 1]),\n direction: dirText,\n };\n if (label) {\n return withMarks(t('sparkline.summary', { label, ...nums }));\n }\n return withMarks(t('sparkline.summaryNoLabel', nums));\n }, [points, annotations, label, direction, i18n.language, t]);\n\n /* ---- theme-reactive state -------------------------------------- */\n const [themeOptions, setThemeOptions] = useState<ApexCharts.ApexOptions>(\n () => {\n try {\n return getApexChartsTheme();\n } catch {\n return {};\n }\n },\n );\n\n /* ---- MutationObserver: re-read theme on class change ----------- */\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout>;\n const observer = new MutationObserver(() => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n try {\n setThemeOptions(getApexChartsTheme());\n } catch {\n /* no-op in non-browser environments */\n }\n }, 50);\n });\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class'],\n });\n return () => {\n clearTimeout(timer);\n observer.disconnect();\n };\n }, []);\n\n /* ---- ResizeObserver: track container width -------------------- */\n useEffect(() => {\n const el = wrapperRef.current;\n if (!el) return;\n const ro = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) setContainerWidth(Math.floor(entry.contentRect.width));\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n /* ApexCharts injects focusable canvases inside the `aria-hidden` */\n /* chart wrapper. Neutralise their tabindex so axe's */\n /* `aria-hidden-focus` rule passes. Shared hook — same fix in */\n /* `Chart` (full apex) and the calendar's mirror events. */\n useNeutraliseHiddenFocus(wrapperRef);\n\n /* ---- imperative handle ---------------------------------------- */\n const agentHandle = useMemo<SparklineHandle>(\n () => ({\n updateSeries(newData: (number | null)[]) {\n ApexCharts.getChartByID(chartId)?.updateSeries([{ data: newData }]);\n },\n updateOptions(opts: ApexCharts.ApexOptions) {\n ApexCharts.getChartByID(chartId)?.updateOptions(opts);\n },\n async dataURI(): Promise<string> {\n const instance = ApexCharts.getChartByID(chartId);\n if (!instance) return '';\n const result = await instance.dataURI();\n return (result as { imgURI: string }).imgURI;\n },\n }),\n [chartId],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(sparklineAgent, agentHandle, id);\n\n /* ---- resolve color -------------------------------------------- */\n const resolvedColor = color ?? themeOptions.colors?.[0] ?? 'currentColor';\n\n /* ---- empty state ---------------------------------------------- */\n if (points.length === 0) {\n return (\n <div\n ref={wrapperRef}\n role=\"img\"\n aria-label={ariaLabel}\n dir=\"ltr\"\n className={sparklineVariants({\n size: height !== undefined ? 'auto' : size,\n className,\n })}\n data-component=\"sparkline\"\n data-component-id={id}\n {...props}\n />\n );\n }\n\n /* ---- chart config ---------------------------------------------- */\n const reducedMotion = prefersReducedMotion();\n\n // A gapped series is plotted as {x, y} pairs on a NUMERIC axis pinned to\n // the full slot count, not as an array with holes in it: ApexCharts draws\n // a line only between consecutive non-null points, so a lab measured at\n // slots 0, 4 and 8 would render as three isolated points and no trend at\n // all. Pairs keep each measurement at its own slot, connect across the\n // gap, and leave the extent — and so every annotation — unchanged.\n // Gapless data keeps the plain-array form, so every existing consumer\n // renders byte-identically.\n const gapped = data.length > points.length;\n const seriesData = gapped\n ? data.flatMap((y, x) => (y == null ? [] : [{ x, y }]))\n : points;\n\n const chartOptions: ApexCharts.ApexOptions = {\n ...themeOptions,\n chart: {\n ...themeOptions.chart,\n id: chartId,\n type: variant,\n sparkline: { enabled: true },\n toolbar: { show: false },\n animations: {\n enabled: !reducedMotion,\n // A gapped series is re-rendered as {x, y} pairs, and Apex's\n // update tween interpolates between the old and new paths point by\n // point. Across a width change the two have different lengths and\n // the tween emits `d=\"… NaN …\"` for a few frames. The finished\n // render is correct either way; switching the tween off keeps the\n // console clean.\n dynamicAnimation: { enabled: !reducedMotion && !gapped },\n },\n zoom: { enabled: false },\n parentHeightOffset: 0,\n },\n colors: [resolvedColor],\n stroke: {\n curve: 'smooth',\n width: variant === 'bar' ? 0 : 2,\n },\n fill: {\n opacity: variant === 'area' ? 0.15 : 1,\n },\n xaxis: {\n crosshairs: { show: false },\n // Pin the extent to the slot count so a gap at either end still holds\n // its place — otherwise the plot would rescale to the measurements\n // and the annotation fractions would no longer mean the same thing.\n ...(gapped\n ? { type: 'numeric' as const, min: 0, max: data.length - 1 }\n : {}),\n },\n tooltip: { enabled: showTooltip },\n markers: showEndpoint\n ? {\n size: [0],\n discrete: [\n {\n // An index into the SERIES, whose holes have already been\n // removed — so this is the last MEASURED point, never a slot\n // the parameter was not measured at.\n seriesIndex: 0,\n dataPointIndex: seriesData.length - 1,\n fillColor: resolvedColor,\n strokeColor: resolvedColor,\n size: 4,\n },\n ],\n }\n : { size: 0 },\n grid: {\n ...themeOptions.grid,\n show: false,\n // ApexCharts grid.padding uses physical keys (not CSS logical properties).\n // The chart wrapper enforces dir=\"ltr\" so these always resolve correctly.\n padding: {\n top: PLOT_EDGE_PADDING,\n right: PLOT_EDGE_PADDING,\n bottom: PLOT_EDGE_PADDING,\n left: PLOT_EDGE_PADDING,\n },\n },\n };\n\n const resolvedWidth =\n width ?? (containerWidth > 0 ? containerWidth : '100%');\n const resolvedHeight = height ?? SIZE_HEIGHT[size ?? 'md'];\n\n // Positioned as a percentage of the overlay's own box rather than from a\n // measured width: the overlay is inset to the plot area, so a fraction is\n // exact at any size and cannot lag or disagree with the plot.\n const drawnAnnotations = annotations?.length ? annotations : undefined;\n\n return (\n <div\n ref={wrapperRef}\n role=\"img\"\n aria-label={ariaLabel}\n dir=\"ltr\"\n className={sparklineVariants({\n size: height !== undefined ? 'auto' : size,\n className,\n })}\n data-component=\"sparkline\"\n data-component-id={id}\n {...props}\n >\n <ReactApexChart\n type={variant}\n series={[{ data: seriesData }]}\n options={chartOptions}\n width={resolvedWidth}\n height={resolvedHeight}\n aria-hidden=\"true\"\n />\n {drawnAnnotations && (\n /* Drawn over the plot rather than through ApexCharts' own xaxis\n annotations: a fraction of the measured extent is the one\n positioning rule that survives series of different lengths, which\n is what makes a column of sparklines share an x. */\n /* The inset lives on a div: an <svg> is a replaced element, so\n left+right do not size it and it would fall back to its intrinsic\n 300px. The div is the plot box; the svg fills it. The 2px MUST\n equal PLOT_EDGE_PADDING — Tailwind needs a static literal, so the\n two cannot share one source; change them together or the first and\n last annotation drift off the first and last data point. */\n <div className=\"ds:pointer-events-none ds:absolute ds:inset-y-0 ds:inset-x-[2px]\">\n <svg\n aria-hidden=\"true\"\n focusable=\"false\"\n data-testid=\"sparkline-annotations\"\n className=\"ds:size-full\"\n >\n {drawnAnnotations.map((annotation) => {\n const fraction = clampFraction(annotation.position);\n return (\n /* A nested viewport placed at a percentage of the plot: the\n one positioning rule that needs no measurement, so a column\n of sparklines shares an x whatever their widths. */\n <svg\n key={annotation.id}\n x={`${fraction * 100}%`}\n y=\"0\"\n width=\"1\"\n height=\"100%\"\n overflow=\"visible\"\n data-annotation-id={annotation.id}\n data-annotation-position={fraction}\n className={annotationVariants({ tone: annotation.tone })}\n >\n <line\n x1={0}\n x2={0}\n y1={0}\n y2=\"100%\"\n /* 1px, more gap than dash: the line marks WHERE, the\n series is what is read, and at 1.5px the annotation\n was the louder of the two. */\n className=\"ds:[stroke:var(--annotation-color)] ds:[stroke-dasharray:2_3] ds:[stroke-width:1]\"\n />\n <path\n d={markerPath(\n annotation.shape ?? 'diamond',\n 0,\n ANNOTATION_CAP_RADIUS,\n ANNOTATION_CAP_RADIUS,\n )}\n className=\"ds:[fill:var(--annotation-color)]\"\n />\n </svg>\n );\n })}\n </svg>\n </div>\n )}\n {showEndpoint && (\n <span\n aria-hidden=\"true\"\n className=\"ds:pointer-events-none ds:absolute ds:end-0 ds:top-0 ds:text-[length:var(--font-size-xs)] ds:leading-none\"\n >\n {DIRECTION_ARROW[direction]}\n </span>\n )}\n </div>\n );\n },\n);\n\nSparkline.displayName = 'Sparkline';\n"],"names":["useLinearTrend","data","n","xMean","yMean","sum","y","numerator","denominator","i","dx","slope","threshold","direction","sparklineAgent","handle","args","sparklineVariants","cva","annotationVariants","DIRECTION_ARROW","SIZE_HEIGHT","PLOT_EDGE_PADDING","ANNOTATION_CAP_RADIUS","clampFraction","value","measured","prefersReducedMotion","Sparkline","forwardRef","id","variant","size","label","color","showEndpoint","showTooltip","width","height","annotations","className","props","ref","t","i18n","useTranslation","rawId","useId","chartId","useMemo","wrapperRef","useRef","containerWidth","setContainerWidth","useState","points","ariaLabel","marks","a","withMarks","summary","fmt","dirText","nums","themeOptions","setThemeOptions","getApexChartsTheme","useEffect","timer","observer","el","ro","entries","entry","useNeutraliseHiddenFocus","agentHandle","newData","_a","ApexCharts","opts","instance","useImperativeHandle","useAgentRegistration","resolvedColor","jsx","reducedMotion","gapped","seriesData","x","chartOptions","resolvedWidth","resolvedHeight","drawnAnnotations","jsxs","ReactApexChart","annotation","fraction","markerPath"],"mappings":";;;;;;;;;AAOO,SAASA,GAAeC,GAAmC;AAChE,MAAIA,EAAK,SAAS;AAChB,WAAO,EAAE,OAAO,GAAG,WAAW,SAAA;AAGhC,QAAMC,IAAID,EAAK,QACTE,KAASD,IAAI,KAAK,GAClBE,IAAQH,EAAK,OAAO,CAACI,GAAKC,MAAMD,IAAMC,GAAG,CAAC,IAAIJ;AAEpD,MAAIK,IAAY,GACZC,IAAc;AAElB,WAASC,IAAI,GAAGA,IAAIP,GAAGO,KAAK;AAC1B,UAAMC,IAAKD,IAAIN;AACf,IAAAI,KAAaG,KAAMT,EAAKQ,CAAC,IAAIL,IAC7BI,KAAeE,IAAKA;AAAA,EACtB;AAEA,QAAMC,IAAQH,MAAgB,IAAI,IAAID,IAAYC,GAE5CI,IAAY,QADJ,KAAK,IAAI,GAAGX,CAAI,IAAI,KAAK,IAAI,GAAGA,CAAI,KACf,IAE7BY,IACJ,KAAK,IAAIF,CAAK,IAAIC,IACd,WACAD,IAAQ,IACN,eACA;AAER,SAAO,EAAE,OAAAA,GAAO,WAAAE,EAAA;AAClB;AClCO,MAAMC,KAAgD;AAAA,EAC3D,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS;AAAA,IACP,eAAe;AAAA;AAAA;AAAA,MAGb,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,MAAM;AAAA,YACJ,MAAM;AAAA,YACN,OAAO,EAAE,MAAM,SAAA;AAAA,YACf,aAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAEF,UAAU,CAAC,MAAM;AAAA,MAAA;AAAA,MAEnB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aA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