@alfadocs/ui-kit-debug 1.62.0 → 1.64.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.
Files changed (87) hide show
  1. package/dist/_chunks/{balance-badge-cell-F7p_ZKEg.js → balance-badge-cell-ejODZU7R.js} +2 -2
  2. package/dist/_chunks/{balance-badge-cell-F7p_ZKEg.js.map → balance-badge-cell-ejODZU7R.js.map} +1 -1
  3. package/dist/_chunks/{calendar-workspace-Dvfl9Vf6.js → calendar-workspace-BArq9vkD.js} +5 -5
  4. package/dist/_chunks/{calendar-workspace-Dvfl9Vf6.js.map → calendar-workspace-BArq9vkD.js.map} +1 -1
  5. package/dist/_chunks/{care-plan-card-BU3p5cLr.js → care-plan-card-DJzbwJLl.js} +2 -2
  6. package/dist/_chunks/{care-plan-card-BU3p5cLr.js.map → care-plan-card-DJzbwJLl.js.map} +1 -1
  7. package/dist/_chunks/{care-plan-header-CgFjQLBd.js → care-plan-header-1HzbkYcR.js} +2 -2
  8. package/dist/_chunks/{care-plan-header-CgFjQLBd.js.map → care-plan-header-1HzbkYcR.js.map} +1 -1
  9. package/dist/_chunks/chart-CzTF8yhH.js +1123 -0
  10. package/dist/_chunks/chart-CzTF8yhH.js.map +1 -0
  11. package/dist/_chunks/{clinical-note-card-BgURrgL5.js → clinical-note-card-D2bbWksq.js} +2 -2
  12. package/dist/_chunks/{clinical-note-card-BgURrgL5.js.map → clinical-note-card-D2bbWksq.js.map} +1 -1
  13. package/dist/_chunks/{contact-card-C8rEsC4Q.js → contact-card-Czu60UvU.js} +2 -2
  14. package/dist/_chunks/{contact-card-C8rEsC4Q.js.map → contact-card-Czu60UvU.js.map} +1 -1
  15. package/dist/_chunks/{contact-profile-card-VTCAmQqj.js → contact-profile-card-B4sjoIqf.js} +2 -2
  16. package/dist/_chunks/{contact-profile-card-VTCAmQqj.js.map → contact-profile-card-B4sjoIqf.js.map} +1 -1
  17. package/dist/_chunks/{data-table-m7GbLJZy.js → data-table-C6ft3fSd.js} +2 -2
  18. package/dist/_chunks/{data-table-m7GbLJZy.js.map → data-table-C6ft3fSd.js.map} +1 -1
  19. package/dist/_chunks/{entity-summary-DXIr5_x2.js → entity-summary-BQ9_KA8S.js} +2 -2
  20. package/dist/_chunks/{entity-summary-DXIr5_x2.js.map → entity-summary-BQ9_KA8S.js.map} +1 -1
  21. package/dist/_chunks/{file-manager-G0t8MWbE.js → file-manager-w1UEprw8.js} +2 -2
  22. package/dist/_chunks/{file-manager-G0t8MWbE.js.map → file-manager-w1UEprw8.js.map} +1 -1
  23. package/dist/_chunks/{heatmap-Bb0-M88T.js → heatmap-DuDfTIII.js} +2 -2
  24. package/dist/_chunks/{heatmap-Bb0-M88T.js.map → heatmap-DuDfTIII.js.map} +1 -1
  25. package/dist/_chunks/{link-gRw3NtOt.js → link-N5_YpLtm.js} +7 -6
  26. package/dist/_chunks/link-N5_YpLtm.js.map +1 -0
  27. package/dist/_chunks/{nav-grid-Byx8PxuB.js → nav-grid-Oc4aCPrg.js} +2 -2
  28. package/dist/_chunks/{nav-grid-Byx8PxuB.js.map → nav-grid-Oc4aCPrg.js.map} +1 -1
  29. package/dist/_chunks/{note-attachment-DoVWvjWR.js → note-attachment-D8V7PUiR.js} +2 -2
  30. package/dist/_chunks/{note-attachment-DoVWvjWR.js.map → note-attachment-D8V7PUiR.js.map} +1 -1
  31. package/dist/_chunks/{note-timeline-B7l3t5DZ.js → note-timeline-CwxPQ2Ak.js} +2 -2
  32. package/dist/_chunks/{note-timeline-B7l3t5DZ.js.map → note-timeline-CwxPQ2Ak.js.map} +1 -1
  33. package/dist/_chunks/{notes-panel-CTmvrqQn.js → notes-panel-BRLc2ozF.js} +2 -2
  34. package/dist/_chunks/{notes-panel-CTmvrqQn.js.map → notes-panel-BRLc2ozF.js.map} +1 -1
  35. package/dist/_chunks/{patient-details-BNDS69Zx.js → patient-details-BY8Rwwpi.js} +2 -2
  36. package/dist/_chunks/{patient-details-BNDS69Zx.js.map → patient-details-BY8Rwwpi.js.map} +1 -1
  37. package/dist/_chunks/{patient-field-row-BLBi-PjO.js → patient-field-row-C8ymfffP.js} +2 -2
  38. package/dist/_chunks/{patient-field-row-BLBi-PjO.js.map → patient-field-row-C8ymfffP.js.map} +1 -1
  39. package/dist/_chunks/{patient-summary-card-T9umuZJF.js → patient-summary-card-cmqjIXMk.js} +3 -3
  40. package/dist/_chunks/{patient-summary-card-T9umuZJF.js.map → patient-summary-card-cmqjIXMk.js.map} +1 -1
  41. package/dist/_chunks/{payment-request-card-BmzNMY2a.js → payment-request-card-0DjQgVgX.js} +2 -2
  42. package/dist/_chunks/{payment-request-card-BmzNMY2a.js.map → payment-request-card-0DjQgVgX.js.map} +1 -1
  43. package/dist/_chunks/{product-hub-panel-D-UELdo0.js → product-hub-panel-C_ZosrBt.js} +2 -2
  44. package/dist/_chunks/{product-hub-panel-D-UELdo0.js.map → product-hub-panel-C_ZosrBt.js.map} +1 -1
  45. package/dist/_chunks/{public-footer-ZWTEG1Rq.js → public-footer-CXOrdAaS.js} +2 -2
  46. package/dist/_chunks/{public-footer-ZWTEG1Rq.js.map → public-footer-CXOrdAaS.js.map} +1 -1
  47. package/dist/_chunks/{signed-out-frame-D5DzqATh.js → signed-out-frame-Rg_GVDnl.js} +2 -2
  48. package/dist/_chunks/{signed-out-frame-D5DzqATh.js.map → signed-out-frame-Rg_GVDnl.js.map} +1 -1
  49. package/dist/_chunks/{use-appointment-details-read-Gu0ehyxj.js → use-appointment-details-read-D6Gb_OuN.js} +4 -4
  50. package/dist/_chunks/{use-appointment-details-read-Gu0ehyxj.js.map → use-appointment-details-read-D6Gb_OuN.js.map} +1 -1
  51. package/dist/agent-catalog.json +1 -1
  52. package/dist/components/_shared/use-apex-legend-scroll.d.ts +7 -3
  53. package/dist/components/_shared/use-apex-legend-scroll.d.ts.map +1 -1
  54. package/dist/components/_shared/use-apex-x-label-spacing.d.ts +11 -0
  55. package/dist/components/_shared/use-apex-x-label-spacing.d.ts.map +1 -0
  56. package/dist/components/appointment-details-panel/index.js +1 -1
  57. package/dist/components/care-plan-card/index.js +1 -1
  58. package/dist/components/care-plan-header/index.js +1 -1
  59. package/dist/components/chart/chart.d.ts.map +1 -1
  60. package/dist/components/chart/index.js +1 -1
  61. package/dist/components/clinical-note-card/index.js +1 -1
  62. package/dist/components/contact-card/index.js +1 -1
  63. package/dist/components/contact-profile-card/index.js +1 -1
  64. package/dist/components/data-table/data-table.d.ts.map +1 -1
  65. package/dist/components/data-table/index.js +1 -1
  66. package/dist/components/entity-summary/index.js +1 -1
  67. package/dist/components/file-manager/index.js +1 -1
  68. package/dist/components/heatmap/index.js +1 -1
  69. package/dist/components/link/index.js +1 -1
  70. package/dist/components/link/link.d.ts.map +1 -1
  71. package/dist/components/nav-grid/index.js +1 -1
  72. package/dist/components/note-timeline/index.js +1 -1
  73. package/dist/components/notes-panel/index.js +1 -1
  74. package/dist/components/patient-details/index.js +1 -1
  75. package/dist/components/patient-summary-card/index.js +1 -1
  76. package/dist/components/patient-table/index.js +1 -1
  77. package/dist/components/payment-card/index.js +1 -1
  78. package/dist/components/product-hub-tray/index.js +1 -1
  79. package/dist/components/public-footer/index.js +1 -1
  80. package/dist/index.js +23 -23
  81. package/dist/patterns/calendar/index.js +1 -1
  82. package/dist/patterns/signed-out-frame/index.js +1 -1
  83. package/dist/tokens.css +7 -4
  84. package/package.json +1 -1
  85. package/dist/_chunks/chart-DgYHN8Xq.js +0 -991
  86. package/dist/_chunks/chart-DgYHN8Xq.js.map +0 -1
  87. package/dist/_chunks/link-gRw3NtOt.js.map +0 -1
@@ -1,991 +0,0 @@
1
- import { jsx as v, jsxs as Y } from "react/jsx-runtime";
2
- import { useEffect as X, forwardRef as tt, useId as rt, useMemo as w, useRef as G, useState as B, useImperativeHandle as at } from "react";
3
- import { c as ge } from "./index-D2ZczOXr.js";
4
- import { useTranslation as nt } from "react-i18next";
5
- import st from "react-apexcharts";
6
- import De from "apexcharts";
7
- import { u as ot, a as it, g as Ge, b as ct, r as lt } from "./apexcharts-theme-DNoXvgnZ.js";
8
- import { u as dt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
9
- import { u as ut } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
10
- import { c as pt } from "./compose-refs-C0k0tdqF.js";
11
- import { u as ht } from "./registry-DvAUVLHh.js";
12
- import { I as mt } from "./icon-button-C_1TgRiK.js";
13
- import { I as ft } from "./icon-button-group-NIHji7_y.js";
14
- import { c as J } from "./createLucideIcon-DhHxpK9K.js";
15
- /**
16
- * @license lucide-react v1.22.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- const bt = [
22
- ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
23
- [
24
- "path",
25
- {
26
- d: "M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",
27
- key: "q0gr47"
28
- }
29
- ]
30
- ], yt = J("chart-area", bt);
31
- /**
32
- * @license lucide-react v1.22.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */
37
- const vt = [
38
- ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
39
- ["path", { d: "M18 17V9", key: "2bz60n" }],
40
- ["path", { d: "M13 17V5", key: "1frdt8" }],
41
- ["path", { d: "M8 17v-3", key: "17ska0" }]
42
- ], gt = J("chart-column", vt);
43
- /**
44
- * @license lucide-react v1.22.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */
49
- const xt = [
50
- ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
51
- ["path", { d: "m19 9-5 5-4-4-3 3", key: "2osh9i" }]
52
- ], St = J("chart-line", xt);
53
- /**
54
- * @license lucide-react v1.22.0 - ISC
55
- *
56
- * This source code is licensed under the ISC license.
57
- * See the LICENSE file in the root directory of this source tree.
58
- */
59
- const wt = [
60
- [
61
- "path",
62
- {
63
- d: "M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",
64
- key: "pzmjnu"
65
- }
66
- ],
67
- ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }]
68
- ], At = J("chart-pie", wt);
69
- /**
70
- * @license lucide-react v1.22.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */
75
- const Tt = [
76
- [
77
- "path",
78
- {
79
- d: "M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3",
80
- key: "19sr3x"
81
- }
82
- ],
83
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
84
- ], Et = J("donut", Tt), Ct = ".apexcharts-legend, .apexcharts-toolbar";
85
- function de(e, r, t) {
86
- !e || e.getAttribute(r) === t || (t === null ? e.removeAttribute(r) : e.setAttribute(r, t));
87
- }
88
- function Lt(e, r) {
89
- X(() => {
90
- if (!e) return;
91
- const t = () => {
92
- e.querySelectorAll(".apexcharts-canvas").forEach((d) => {
93
- Array.from(d.children).forEach((h) => {
94
- h.matches(Ct) || de(h, "aria-hidden", "true");
95
- });
96
- }), e.querySelectorAll(".apexcharts-toolbar").forEach((d) => {
97
- var s;
98
- const h = ((s = d.querySelector(".apexcharts-menu-icon")) == null ? void 0 : s.getAttribute("aria-expanded")) === "true";
99
- de(
100
- d.querySelector(".apexcharts-menu"),
101
- "inert",
102
- h ? null : ""
103
- );
104
- }), e.querySelectorAll(
105
- '.apexcharts-legend-series[role="button"]'
106
- ).forEach((d) => {
107
- de(d, "aria-label", null);
108
- const h = d.getAttribute("data:collapsed") === "true" ? "false" : "true";
109
- de(d, "aria-pressed", r ? h : null);
110
- });
111
- };
112
- let i = 0;
113
- const p = (d) => {
114
- const h = d.target instanceof Element ? d.target.closest(".apexcharts-legend-series") : null, s = h == null ? void 0 : h.getAttribute("rel");
115
- s && (cancelAnimationFrame(i), i = requestAnimationFrame(() => {
116
- var l;
117
- const g = document.activeElement;
118
- g && g !== document.body || (l = e.querySelector(
119
- `.apexcharts-legend-series[rel="${CSS.escape(s)}"]`
120
- )) == null || l.focus();
121
- }));
122
- };
123
- t();
124
- const c = new MutationObserver(t);
125
- return c.observe(e, {
126
- childList: !0,
127
- subtree: !0,
128
- attributes: !0,
129
- attributeFilter: [
130
- "aria-hidden",
131
- "aria-label",
132
- "aria-pressed",
133
- "aria-expanded"
134
- ]
135
- }), e.addEventListener("click", p), () => {
136
- c.disconnect(), e.removeEventListener("click", p), cancelAnimationFrame(i);
137
- };
138
- }, [e, r]);
139
- }
140
- function ue(e, r, t) {
141
- t && e.getAttribute(r) !== "true" ? e.setAttribute(r, "true") : !t && e.hasAttribute(r) && e.removeAttribute(r);
142
- }
143
- function It(e, r) {
144
- X(() => {
145
- if (!e || !r) return;
146
- let t = null;
147
- const i = () => {
148
- if (!t) return;
149
- const s = Math.abs(t.scrollLeft), g = t.scrollWidth - t.clientWidth;
150
- ue(t, "data-fade-start", s > 1), ue(t, "data-fade-end", g - s > 1);
151
- }, p = () => {
152
- const s = e.querySelector(".apexcharts-legend");
153
- s !== t && (t == null || t.removeEventListener("scroll", i), t = s, t == null || t.addEventListener("scroll", i, { passive: !0 })), i();
154
- }, c = (s) => {
155
- const { target: g } = s;
156
- !t || !(g instanceof HTMLElement) || !t.contains(g) || !g.matches(":focus-visible") || g.scrollIntoView({ block: "nearest", inline: "nearest" });
157
- }, d = (s) => s instanceof Element && (s.closest(".apexcharts-legend") !== null || s.querySelector(".apexcharts-legend") !== null), h = new MutationObserver((s) => {
158
- s.some(
159
- (l) => [l.target, ...l.addedNodes, ...l.removedNodes].some(
160
- d
161
- )
162
- ) && p();
163
- });
164
- return p(), h.observe(e, { childList: !0, subtree: !0 }), e.addEventListener("focusin", c), () => {
165
- h.disconnect(), e.removeEventListener("focusin", c), t && (t.removeEventListener("scroll", i), ue(t, "data-fade-start", !1), ue(t, "data-fade-end", !1));
166
- };
167
- }, [e, r]);
168
- }
169
- const Rt = {
170
- id: "chart",
171
- // view_change backs the opt-in type switcher (`switchableTypes` prop):
172
- // the same chart re-presented as line / bar / area / pie / donut.
173
- capabilities: ["view_change"],
174
- state: {
175
- declaredType: {
176
- type: "'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'",
177
- descriptionKey: "ui.agent.chart.state.declaredType",
178
- description: "The consumer-declared chart type — the shape `update_series` expects.",
179
- read: (e) => e.getTypeState().declaredType
180
- },
181
- effectiveType: {
182
- type: "'line' | 'bar' | 'pie' | 'donut' | 'area' | 'radialBar'",
183
- descriptionKey: "ui.agent.chart.state.effectiveType",
184
- description: "The type currently rendered — differs from declaredType after a type-switcher pick.",
185
- read: (e) => e.getTypeState().effectiveType
186
- },
187
- availableTypes: {
188
- type: "ChartType[]",
189
- descriptionKey: "ui.agent.chart.state.availableTypes",
190
- description: "Types the switcher offers. Empty when the chart has no type switcher.",
191
- read: (e) => e.getTypeState().availableTypes
192
- }
193
- },
194
- actions: {
195
- change_view: {
196
- // Switching the presentation is a write (it changes what the user
197
- // sees) but is trivially reversible by switching back.
198
- safety: "write",
199
- argsType: "type",
200
- argsSchema: {
201
- type: "object",
202
- properties: {
203
- type: {
204
- type: "string",
205
- enum: ["line", "bar", "area", "pie", "donut"],
206
- description: "The chart type to render."
207
- }
208
- },
209
- required: ["type"]
210
- },
211
- returns: "boolean (accepted)",
212
- returnsSchema: {
213
- type: "boolean",
214
- description: "True when the switch was applied; false when the chart has no type switcher or the type is not offered (check availableTypes first)."
215
- },
216
- idempotent: !0,
217
- descriptionKey: "ui.agent.chart.actions.changeView",
218
- description: "Switch the rendered chart type via the type switcher. No-op (returns false) when the chart has no switcher or the type is not offered.",
219
- invoke: (e, r) => e.setType(r.type)
220
- },
221
- update_series: {
222
- // Replacing the rendered series mutates what the chart displays — it
223
- // is a write, reversible by pushing the prior series back.
224
- safety: "write",
225
- argsType: "series",
226
- // `series` is `ChartSeries[]` (line/bar/area) OR `number[]`
227
- // (pie/donut/radialBar). Both shapes are accepted; the handle routes
228
- // by chart type internally.
229
- argsSchema: {
230
- type: "object",
231
- properties: {
232
- series: {
233
- oneOf: [
234
- {
235
- type: "array",
236
- description: "Categorical series for line / bar / area charts.",
237
- items: {
238
- type: "object",
239
- properties: {
240
- name: { type: "string" },
241
- data: { type: "array", items: { type: "number" } },
242
- role: {
243
- type: "string",
244
- enum: ["primary", "compare"],
245
- description: "Optional. 'compare' renders this series as a secondary, colour-blind-safe overlay (e.g. the previous period) — a dotted stroke in its paired primary's colour for line/area, a tinted bar with a dotted outline for bar. Omit for a normal primary series."
246
- }
247
- },
248
- required: ["name", "data"]
249
- }
250
- },
251
- {
252
- type: "array",
253
- description: "Flat values for pie / donut / radialBar charts.",
254
- items: { type: "number" }
255
- }
256
- ]
257
- }
258
- },
259
- required: ["series"]
260
- },
261
- idempotent: !0,
262
- descriptionKey: "ui.agent.chart.actions.updateSeries",
263
- description: "Replace the chart series without remounting. Pass the DECLARED type’s shape (see declaredType state); when the user has switched the view cross-shape the values are converted to the rendered shape. The data and its summary table persist across type switches, resizes and theme changes until the host passes a new series prop.",
264
- invoke: (e, r) => {
265
- e.updateSeries(r.series);
266
- }
267
- },
268
- export_png: {
269
- safety: "read",
270
- returns: "string (PNG data URI)",
271
- returnsSchema: {
272
- type: "string",
273
- description: "A `data:image/png;base64,…` URI of the rendered chart."
274
- },
275
- idempotent: !0,
276
- descriptionKey: "ui.agent.chart.actions.exportPng",
277
- description: "Return a PNG data URI of the chart for export or screenshotting. Waits until series pushed with update_series are drawn.",
278
- invoke: (e) => e.dataURI()
279
- }
280
- },
281
- domHooks: {
282
- root: { attr: "data-component", value: "chart" },
283
- instanceId: {
284
- attr: "data-component-id",
285
- sourceProp: "id",
286
- description: "Sourced from the id prop."
287
- }
288
- }
289
- }, kt = ge(
290
- "ds:relative ds:block ds:w-full apex-theme-alfadocs",
291
- {
292
- variants: {
293
- density: {
294
- compact: "ds:min-h-[var(--chart-min-height-compact)]",
295
- comfortable: "ds:min-h-[var(--chart-min-height-comfortable)]",
296
- // Applied when an explicit `height` prop is given and no density was
297
- // requested: the wrapper must not exceed the caller's height (a 96px
298
- // KPI chart inside a card must not reserve 320px).
299
- none: ""
300
- }
301
- },
302
- defaultVariants: { density: "comfortable" }
303
- }
304
- ), _t = ge("", {
305
- variants: {
306
- fill: {
307
- none: "",
308
- // The figure is the root: it takes the share itself, and as a flex item
309
- // may still shrink below what it last drew.
310
- root: "ds:h-[var(--chart-fill-size)] ds:min-h-0",
311
- // Below the switcher row: the rest, whatever ApexCharts draws inside.
312
- rest: "ds:min-h-0 ds:flex-1"
313
- }
314
- },
315
- defaultVariants: { fill: "none" }
316
- }), Ot = ge("ds:w-full", {
317
- variants: {
318
- fill: {
319
- false: "ds:block",
320
- true: "ds:flex ds:flex-col ds:h-[var(--chart-fill-size)] ds:min-h-0"
321
- }
322
- },
323
- defaultVariants: { fill: !1 }
324
- }), Nt = [
325
- "verticalLines",
326
- "horizontalLines",
327
- "slantedLines",
328
- "squares",
329
- "circles"
330
- ], Mt = ["line", "bar", "area"], Bt = ["pie", "donut", "radialBar"], Ve = [
331
- "line",
332
- "bar",
333
- "area",
334
- "pie",
335
- "donut"
336
- ], Ht = {
337
- line: "chart.typeSwitcher.line",
338
- bar: "chart.typeSwitcher.bar",
339
- area: "chart.typeSwitcher.area",
340
- pie: "chart.typeSwitcher.pie",
341
- donut: "chart.typeSwitcher.donut"
342
- }, zt = {
343
- line: /* @__PURE__ */ v(St, {}),
344
- bar: /* @__PURE__ */ v(gt, {}),
345
- area: /* @__PURE__ */ v(yt, {}),
346
- pie: /* @__PURE__ */ v(At, {}),
347
- donut: /* @__PURE__ */ v(Et, {})
348
- }, Pt = 2, Ye = "0 6", qt = 5, $t = -45, Wt = 640, Ft = 300, Dt = 160;
349
- function Gt(e, r) {
350
- !e || r.length === 0 || e.querySelectorAll(
351
- ".apexcharts-bar-series > .apexcharts-series"
352
- ).forEach((t) => {
353
- const i = Number(t.getAttribute("data:realIndex"));
354
- r.includes(i) && t.querySelectorAll("path.apexcharts-bar-area").forEach(
355
- (p) => {
356
- if (typeof p.getBBox != "function") return;
357
- const c = p.getBBox();
358
- p.setAttribute(
359
- "d",
360
- `M ${c.x} ${c.y + c.height} L ${c.x} ${c.y} L ${c.x + c.width} ${c.y} L ${c.x + c.width} ${c.y + c.height}`
361
- ), p.setAttribute("stroke-dasharray", Ye), p.setAttribute("stroke-linecap", "round");
362
- }
363
- );
364
- });
365
- }
366
- function Ke(e) {
367
- const r = getComputedStyle(e), t = (i) => Number.parseFloat(r.getPropertyValue(i)) || 0;
368
- return t("--min-target-size") + t("--focus-ring-offset") + t("--focus-ring-width");
369
- }
370
- function Vt(e, r) {
371
- if (e === void 0) return r;
372
- if (typeof e == "number") return e;
373
- const t = Number.parseInt(e, 10);
374
- return e.trim().endsWith("%") ? r * t / 100 : t;
375
- }
376
- function Kt(e) {
377
- return typeof e == "number" ? e : e.trim().endsWith("%") ? Number.NaN : Number.parseInt(e, 10);
378
- }
379
- function je(e, r, t, i, p, c) {
380
- if (i === p)
381
- return {
382
- effectiveSeries: e,
383
- effectiveCategories: r,
384
- effectiveLabels: t
385
- };
386
- if (!i) {
387
- const s = e.filter((l) => l.role !== "compare");
388
- return {
389
- effectiveSeries: s.map((l) => l.data.reduce((R, $) => R + $, 0)),
390
- effectiveCategories: void 0,
391
- effectiveLabels: s.map((l) => l.name)
392
- };
393
- }
394
- return {
395
- effectiveSeries: [{ name: c, data: e }],
396
- effectiveCategories: t ?? [],
397
- effectiveLabels: void 0
398
- };
399
- }
400
- function Ue({
401
- themeOptions: e,
402
- toolbarBand: r,
403
- chartId: t,
404
- toolbar: i,
405
- reducedMotion: p,
406
- toolbarLocale: c,
407
- locale: d,
408
- effectiveLabels: h,
409
- formatValue: s,
410
- noDataText: g,
411
- effectiveType: l,
412
- effectiveSeries: R,
413
- effectiveCategories: $,
414
- isRtl: H,
415
- patterns: he,
416
- stacked: z,
417
- orientation: W,
418
- curve: F,
419
- colors: P,
420
- radialValueFormatter: Q,
421
- narrow: ee,
422
- wrapperRef: me
423
- }) {
424
- var re, K, D, ae, C, ne;
425
- const o = e, L = pe(l) && Array.isArray(R) ? R.map((n) => n.role === "compare") : [], I = L.some(Boolean), k = I && l === "bar", V = k && R.some(
426
- (n) => n.role === "compare" && n.data.some((m) => m < 0)
427
- ), te = k && W === "vertical" && !V, f = I ? ct() : 0.3, u = {
428
- ...o,
429
- chart: {
430
- ...o.chart,
431
- id: t,
432
- toolbar: { show: i },
433
- zoom: { enabled: i },
434
- animations: {
435
- enabled: !p,
436
- dynamicAnimation: { enabled: !p }
437
- },
438
- locales: [c],
439
- defaultLocale: d,
440
- parentHeightOffset: 0,
441
- // Keep the keyboard-operable legend; drop Apex's data-point navigation
442
- // and live announcements (English-only, and the summary table covers them).
443
- accessibility: {
444
- enabled: !0,
445
- announcements: { enabled: !1 },
446
- keyboard: { enabled: !0, navigation: { enabled: !1 } }
447
- },
448
- // Stacking is axis-only, so a slice or radial chart never receives it.
449
- // Sent as false too: ApexCharts merges an update into its config, so
450
- // leaving it out would keep an earlier `true`.
451
- ...pe(l) ? { stacked: z } : {}
452
- },
453
- // Only set `labels` when the effective type actually has them (slice
454
- // charts). Emitting `labels: undefined` crashes ApexCharts' bar
455
- // renderer — `parseDataAxisCharts` reads `labels.length` and throws
456
- // "Cannot read properties of undefined (reading 'length')", which
457
- // aborts the render and leaves a blank chart. Absent is safe; area /
458
- // line tolerate the undefined but bar does not, so never pass it.
459
- ...h ? { labels: h } : {},
460
- legend: {
461
- ...o.legend,
462
- position: "bottom",
463
- // ApexCharts legend.horizontalAlign is a physical prop mapped internally
464
- // to the chart's own text flow. For RTL we flip via `yaxis.opposite`
465
- // and ApexCharts' own `direction: 'rtl'` handling; legend stays anchored
466
- // to the inline-start by asking for 'left' on LTR and 'right' on RTL.
467
- horizontalAlign: H ? "right" : "left",
468
- fontFamily: "inherit",
469
- // apexcharts-theme.css sizes the legend hit areas and ring room from
470
- // this 4px; pinned so an ApexCharts default change cannot break them.
471
- itemMargin: { horizontal: 5, vertical: 4 }
472
- },
473
- tooltip: {
474
- ...o.tooltip,
475
- y: {
476
- formatter: (n) => s(n)
477
- }
478
- },
479
- noData: {
480
- text: g
481
- }
482
- };
483
- if (u.title = i && r ? { ...u.title, text: "", margin: r } : { ...u.title, text: void 0, margin: qt }, P && P.length > 0 && (u.colors = P), I) {
484
- const n = u.colors ?? o.colors ?? [], m = (T) => n[T % Math.max(n.length, 1)], A = R.map((T, N) => T.role === "compare" ? -1 : N).filter((T) => T >= 0);
485
- let O = 0;
486
- u.colors = R.map((T, N) => {
487
- if (T.role !== "compare") return m(N);
488
- const M = A.length ? A[Math.min(O++, A.length - 1)] : N;
489
- return m(M);
490
- });
491
- const j = u.colors.map(
492
- (T, N) => L[N] ? lt(T) : T
493
- );
494
- u.legend = {
495
- ...u.legend,
496
- markers: {
497
- ...((re = u.legend) == null ? void 0 : re.markers) ?? {},
498
- fillColors: j
499
- }
500
- };
501
- }
502
- if (pe(l)) {
503
- const n = l === "bar" && W === "horizontal";
504
- u.xaxis = {
505
- ...o.xaxis,
506
- categories: $ ?? [],
507
- labels: {
508
- ...(K = o.xaxis) == null ? void 0 : K.labels,
509
- formatter: n ? (m) => s(Number(m)) : void 0,
510
- // A narrow chart thins crowded labels rather than turning them sideways.
511
- // Sent both ways, so a widened chart rotates; the thinning is pinned
512
- // so an ApexCharts default change cannot leave narrow labels overlapping.
513
- rotate: ee ? 0 : $t,
514
- hideOverlappingLabels: !0
515
- }
516
- }, u.yaxis = {
517
- ...o.yaxis,
518
- opposite: H,
519
- ...n ? {} : { labels: { formatter: (m) => s(m) } }
520
- }, u.stroke = {
521
- curve: F,
522
- width: l === "bar" ? I ? L.map((m) => m ? Pt : 0) : 0 : 2,
523
- ...I ? {
524
- lineCap: "round",
525
- // Runtime accepts a string dash; the published types say
526
- // `number` → one documented cast. `'0 6'` + round cap ⇒ dots.
527
- dashArray: L.map(
528
- (m) => m ? Ye : 0
529
- )
530
- } : {}
531
- }, u.dataLabels = { enabled: !1 };
532
- }
533
- if (l === "radialBar" && Q) {
534
- const n = o.plotOptions ?? {};
535
- u.plotOptions = {
536
- ...n,
537
- radialBar: {
538
- ...n.radialBar ?? {},
539
- dataLabels: {
540
- ...((D = n.radialBar) == null ? void 0 : D.dataLabels) ?? {},
541
- value: {
542
- ...((C = (ae = n.radialBar) == null ? void 0 : ae.dataLabels) == null ? void 0 : C.value) ?? {},
543
- formatter: (m) => Q(Number(m))
544
- }
545
- }
546
- }
547
- };
548
- }
549
- if (l === "bar") {
550
- const n = o.plotOptions ?? {};
551
- u.plotOptions = {
552
- ...n,
553
- bar: {
554
- ...n.bar ?? {},
555
- horizontal: W === "horizontal"
556
- }
557
- };
558
- }
559
- if (he ? u.fill = {
560
- type: I ? L.map((n) => n ? "solid" : "pattern") : "pattern",
561
- opacity: I ? L.map(
562
- (n) => n ? f : l === "area" ? 0.3 : 1
563
- ) : l === "area" ? 0.3 : 1,
564
- pattern: {
565
- style: [...Nt],
566
- strokeWidth: 2
567
- }
568
- } : k ? u.fill = {
569
- type: "solid",
570
- opacity: L.map((n) => n ? f : 1)
571
- } : l === "area" && (u.fill = I ? {
572
- type: "gradient",
573
- opacity: L.map((n) => n ? f : 0.3)
574
- } : {
575
- type: "gradient",
576
- opacity: 0.3
577
- }), te) {
578
- const n = L.map((O, j) => O ? j : -1).filter((O) => O >= 0), m = () => Gt(me.current, n), A = () => typeof requestAnimationFrame == "function" ? requestAnimationFrame(m) : m();
579
- u.chart = {
580
- ...u.chart,
581
- events: {
582
- ...((ne = u.chart) == null ? void 0 : ne.events) ?? {},
583
- mounted: () => A(),
584
- updated: () => A(),
585
- animationEnd: () => m()
586
- }
587
- };
588
- }
589
- return jt(u, l);
590
- }
591
- function jt(e, r) {
592
- var i, p, c, d, h, s;
593
- if (!pe(r)) return e;
594
- const t = (i = e.chart) == null ? void 0 : i.events;
595
- return {
596
- ...e,
597
- colors: e.colors,
598
- chart: {
599
- ...e.chart,
600
- events: {
601
- ...t,
602
- mounted: t == null ? void 0 : t.mounted,
603
- updated: t == null ? void 0 : t.updated,
604
- animationEnd: t == null ? void 0 : t.animationEnd
605
- }
606
- },
607
- stroke: {
608
- ...e.stroke,
609
- lineCap: ((p = e.stroke) == null ? void 0 : p.lineCap) ?? (r === "bar" ? "square" : "butt"),
610
- dashArray: ((c = e.stroke) == null ? void 0 : c.dashArray) ?? 0
611
- },
612
- legend: {
613
- ...e.legend,
614
- markers: {
615
- ...(d = e.legend) == null ? void 0 : d.markers,
616
- fillColors: (s = (h = e.legend) == null ? void 0 : h.markers) == null ? void 0 : s.fillColors
617
- }
618
- },
619
- fill: e.fill ?? { type: "solid", opacity: 0.85 }
620
- };
621
- }
622
- function Z(e) {
623
- return Bt.includes(e);
624
- }
625
- function pe(e) {
626
- return Mt.includes(e);
627
- }
628
- function Ut(e, r) {
629
- return Z(r) ? [
630
- {
631
- name: "",
632
- data: e
633
- }
634
- ] : e;
635
- }
636
- const Yt = tt(
637
- ({
638
- title: e,
639
- id: r,
640
- type: t,
641
- series: i,
642
- categories: p,
643
- labels: c,
644
- height: d,
645
- width: h,
646
- patterns: s = !1,
647
- stacked: g = !1,
648
- orientation: l = "vertical",
649
- curve: R = "smooth",
650
- colors: $,
651
- toolbar: H = !1,
652
- locale: he,
653
- radialValueFormatter: z,
654
- valueFormatter: W,
655
- switchableTypes: F,
656
- onTypeChange: P,
657
- density: Q,
658
- className: ee
659
- }, me) => {
660
- const { t: o, i18n: L } = nt("ui"), I = rt(), k = w(
661
- () => `chart-${I.replace(/[^a-zA-Z0-9-_]/g, "")}`,
662
- [I]
663
- ), V = `${k}-summary`, te = G(null), [f, u] = B(null), re = w(
664
- () => pt(te, u),
665
- []
666
- ), K = w(() => ({ current: f }), [f]), [D, ae] = B(0), C = typeof d == "string" && d.trim().endsWith("%") ? d.trim() : void 0, [ne, n] = B(0), m = G(!1);
667
- m.current = C !== void 0, ut(() => {
668
- C && f && n(Math.floor(f.clientHeight));
669
- }, [C, f]), ot(K), it(K);
670
- const A = he ?? L.language ?? "en", [O, j] = B(() => {
671
- try {
672
- return Ge();
673
- } catch {
674
- return {};
675
- }
676
- });
677
- X(() => {
678
- if (typeof document > "u") return;
679
- let a;
680
- const y = new MutationObserver(() => {
681
- clearTimeout(a), a = setTimeout(() => {
682
- try {
683
- j(Ge());
684
- } catch {
685
- }
686
- }, 50);
687
- });
688
- return y.observe(document.documentElement, {
689
- attributes: !0,
690
- attributeFilter: ["class"]
691
- }), () => {
692
- clearTimeout(a), y.disconnect();
693
- };
694
- }, []);
695
- const [T, N] = B(
696
- () => typeof document > "u" ? 0 : Ke(document.documentElement)
697
- );
698
- X(() => {
699
- if (!f || !H) return;
700
- const a = new ResizeObserver(() => y()), y = () => {
701
- const S = f.querySelector(".apexcharts-toolbar");
702
- S && a.observe(S), N(
703
- Math.max(Ke(f), (S == null ? void 0 : S.offsetHeight) ?? 0)
704
- );
705
- };
706
- y();
707
- const x = new MutationObserver(y);
708
- for (let S = f.parentElement; S; S = S.parentElement)
709
- x.observe(S, { attributes: !0, attributeFilter: ["class"] });
710
- const E = new MutationObserver((S) => {
711
- S.flatMap((U) => [...U.addedNodes]).some(
712
- (U) => U instanceof Element && (U.matches(".apexcharts-toolbar") || U.querySelector(".apexcharts-toolbar"))
713
- ) && y();
714
- });
715
- return E.observe(f, { childList: !0, subtree: !0 }), () => {
716
- a.disconnect(), x.disconnect(), E.disconnect();
717
- };
718
- }, [f, H]), X(() => {
719
- const a = f;
720
- if (!a || typeof ResizeObserver > "u") return;
721
- const y = new ResizeObserver((x) => {
722
- const E = x[0];
723
- E && (ae(Math.floor(E.contentRect.width)), m.current && n(Math.floor(E.contentRect.height)));
724
- });
725
- return y.observe(a), () => y.disconnect();
726
- }, [f]);
727
- const M = w(() => {
728
- if (!F || F.length === 0) return [];
729
- const a = F.filter(
730
- (x) => Ve.includes(x)
731
- );
732
- if (!Ve.includes(t))
733
- return [];
734
- const y = a.includes(t) ? a : [t, ...a];
735
- return [...new Set(y)];
736
- }, [F, t]), _ = M.length >= 2, [fe, xe] = B(null), b = _ && fe && M.includes(fe) ? fe : t;
737
- Lt(
738
- f,
739
- b !== "pie" && b !== "donut"
740
- );
741
- const be = Z(t), ye = Z(b), [se, Se] = B(null), [we, Ze] = B(i);
742
- we !== i && (Ze(i), se && Se(null));
743
- const Ae = se && se.base === i && we === i ? se.next : i, Te = G(i);
744
- Te.current = i;
745
- const { effectiveSeries: q, effectiveCategories: oe, effectiveLabels: ie } = w(
746
- () => je(
747
- Ae,
748
- p,
749
- c,
750
- be,
751
- ye,
752
- o("chart.table.value")
753
- ),
754
- [Ae, p, c, be, ye, o]
755
- ), Ee = (a) => je(
756
- a,
757
- p,
758
- c,
759
- be,
760
- ye,
761
- o("chart.table.value")
762
- ), Ce = G(Ee);
763
- Ce.current = Ee;
764
- const Le = G(Promise.resolve()), ve = w(
765
- () => ({
766
- async dataURI() {
767
- await Le.current;
768
- const a = De.getChartByID(k);
769
- return a ? (await a.dataURI()).imgURI : "";
770
- },
771
- updateSeries(a) {
772
- Se({ base: Te.current, next: a });
773
- const y = De.getChartByID(k);
774
- if (!y) return;
775
- const x = Ce.current(a), E = { ...He.current, ...x };
776
- Le.current = y.updateOptions(
777
- { ...Ue(E), series: x.effectiveSeries },
778
- !1,
779
- !0
780
- ).catch(() => {
781
- });
782
- },
783
- setType(a) {
784
- return !_ || !M.includes(a) ? !1 : (xe(a), !0);
785
- },
786
- getTypeState() {
787
- return {
788
- declaredType: t,
789
- effectiveType: b,
790
- availableTypes: _ ? [...M] : []
791
- };
792
- }
793
- }),
794
- [k, t, b, _, M]
795
- );
796
- at(me, () => ve, [ve]), ht(Rt, ve, r);
797
- const Ie = typeof document < "u" && document.documentElement.dir === "rtl", Re = w(
798
- () => Ut(q, b),
799
- [q, b]
800
- ), ke = w(
801
- () => new Intl.NumberFormat(A),
802
- [A]
803
- ), ce = w(
804
- () => W ?? ((a) => ke.format(a)),
805
- [W, ke]
806
- ), _e = w(
807
- () => ({
808
- name: A,
809
- options: {
810
- toolbar: {
811
- download: o("chart.toolbar.download"),
812
- // Names the button that opens the export menu (Apex: "Menu").
813
- menu: o("chart.toolbar.download"),
814
- selection: o("chart.toolbar.selection"),
815
- selectionZoom: o("chart.toolbar.selectionZoom"),
816
- zoomIn: o("chart.toolbar.zoomIn"),
817
- zoomOut: o("chart.toolbar.zoomOut"),
818
- pan: o("chart.toolbar.pan"),
819
- reset: o("chart.toolbar.reset"),
820
- exportToSVG: o("chart.toolbar.exportToSVG"),
821
- exportToPNG: o("chart.toolbar.exportToPNG"),
822
- exportToCSV: o("chart.toolbar.exportToCSV")
823
- }
824
- }
825
- }),
826
- [A, o]
827
- ), Oe = dt(), Ne = o("chart.noData"), Me = Vt(h, D), Be = Me > 0 && Me < Wt, le = w(
828
- () => ({
829
- themeOptions: O,
830
- toolbarBand: T,
831
- chartId: k,
832
- toolbar: H,
833
- reducedMotion: Oe,
834
- toolbarLocale: _e,
835
- locale: A,
836
- effectiveLabels: ie,
837
- formatValue: ce,
838
- noDataText: Ne,
839
- effectiveType: b,
840
- effectiveSeries: q,
841
- effectiveCategories: oe,
842
- isRtl: Ie,
843
- patterns: s,
844
- stacked: g,
845
- orientation: l,
846
- curve: R,
847
- colors: $,
848
- radialValueFormatter: z,
849
- narrow: Be,
850
- wrapperRef: te
851
- }),
852
- [
853
- O,
854
- T,
855
- k,
856
- H,
857
- Oe,
858
- _e,
859
- A,
860
- ie,
861
- ce,
862
- Ne,
863
- b,
864
- q,
865
- oe,
866
- Ie,
867
- s,
868
- g,
869
- l,
870
- R,
871
- $,
872
- z,
873
- Be
874
- ]
875
- ), Xe = w(
876
- () => Ue(le),
877
- [le]
878
- ), He = G(le);
879
- He.current = le;
880
- const Je = h ?? (D > 0 ? D : "100%"), ze = C ? Math.max(ne, Dt) : d ?? 320, Pe = Kt(ze), qe = Pe > 0 && Pe < Ft;
881
- It(f, qe);
882
- const Qe = w(() => {
883
- const a = Z(b) ? ie ?? [] : oe ?? [], y = Re;
884
- return /* @__PURE__ */ v("div", { className: "ds:sr-only", children: /* @__PURE__ */ Y("table", { id: V, children: [
885
- /* @__PURE__ */ v("caption", { children: e }),
886
- /* @__PURE__ */ v("thead", { children: /* @__PURE__ */ Y("tr", { children: [
887
- /* @__PURE__ */ v("th", { scope: "col", children: o("chart.table.series") }),
888
- a.map((x, E) => /* @__PURE__ */ v("th", { scope: "col", children: x }, `${x}-${E}`))
889
- ] }) }),
890
- /* @__PURE__ */ v("tbody", { children: y.map((x, E) => /* @__PURE__ */ Y("tr", { children: [
891
- /* @__PURE__ */ v("th", { scope: "row", children: x.name || o("chart.table.value") }),
892
- x.data.map((S, Fe) => /* @__PURE__ */ v("td", { children: b === "radialBar" && z ? z(S) : ce(S) }, `${E}-${Fe}`))
893
- ] }, `${x.name}-${E}`)) })
894
- ] }) });
895
- }, [
896
- b,
897
- Re,
898
- ie,
899
- oe,
900
- V,
901
- e,
902
- o,
903
- ce,
904
- z
905
- ]), et = w(() => (Z(b), q), [q, b]), $e = C ? {
906
- "--chart-fill-size": C
907
- } : void 0, We = /* @__PURE__ */ Y(
908
- "div",
909
- {
910
- ref: re,
911
- role: "figure",
912
- "aria-label": e,
913
- "aria-describedby": V,
914
- "data-legend-layout": qe ? "row" : void 0,
915
- className: kt({
916
- // Explicit height wins over the density min-height unless the
917
- // caller also asked for a density explicitly.
918
- // A `%` height takes its height from the parent, never a density.
919
- density: C ? "none" : Q ?? (d !== void 0 ? "none" : void 0),
920
- className: [
921
- _t({
922
- fill: C ? _ ? "rest" : "root" : "none"
923
- }),
924
- _ ? void 0 : ee
925
- ].filter(Boolean).join(" ")
926
- }),
927
- style: _ ? void 0 : $e,
928
- ..._ ? {} : { "data-component": "chart", "data-component-id": r },
929
- children: [
930
- Qe,
931
- /* @__PURE__ */ v(
932
- st,
933
- {
934
- type: b,
935
- series: et,
936
- options: Xe,
937
- width: Je,
938
- height: ze
939
- },
940
- b
941
- )
942
- ]
943
- }
944
- );
945
- return _ ? /* @__PURE__ */ Y(
946
- "div",
947
- {
948
- "data-component": "chart",
949
- "data-component-id": r,
950
- className: Ot({
951
- fill: C !== void 0,
952
- className: ee
953
- }),
954
- style: $e,
955
- children: [
956
- /* @__PURE__ */ v("div", { className: "ds:mb-[var(--spacing-xs)] ds:flex ds:justify-end", children: /* @__PURE__ */ v(
957
- ft,
958
- {
959
- role: "radiogroup",
960
- mode: "toggle-single",
961
- size: "sm",
962
- "aria-label": o("chart.typeSwitcher.label"),
963
- value: b,
964
- onValueChange: (a) => {
965
- a !== b && (xe(a), P == null || P(a));
966
- },
967
- children: M.map((a) => /* @__PURE__ */ v(
968
- mt,
969
- {
970
- value: a,
971
- type: "button",
972
- icon: zt[a],
973
- "aria-label": o(Ht[a])
974
- },
975
- a
976
- ))
977
- }
978
- ) }),
979
- We
980
- ]
981
- }
982
- ) : We;
983
- }
984
- );
985
- Yt.displayName = "Chart";
986
- export {
987
- Yt as C,
988
- kt as a,
989
- Rt as c
990
- };
991
- //# sourceMappingURL=chart-DgYHN8Xq.js.map