@overdoser/react-toolkit 0.0.12 → 0.0.14
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/components/Chart/TradingChart.d.ts +8 -3
- package/components/Chart/trading/period.d.ts +3 -0
- package/components/Chart/trading/types.d.ts +5 -1
- package/components/inputs/Select/Select.d.ts +6 -0
- package/index.js +1336 -1323
- package/llms.txt +2 -1
- package/manifest.json +2 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { forwardRef as
|
|
2
|
-
import { jsxs as z, jsx as s, Fragment as
|
|
1
|
+
import { forwardRef as Ne, createElement as an, useState as Re, useCallback as pe, useMemo as ke, useEffect as Le, useLayoutEffect as zt, useRef as oe, useId as Ue, isValidElement as dn, cloneElement as jt, createContext as _t, useContext as ft, useImperativeHandle as un } from "react";
|
|
2
|
+
import { jsxs as z, jsx as s, Fragment as ze } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal as pt } from "react-dom";
|
|
4
4
|
import { FormProvider as hn, useFormContext as mn, useController as fn } from "react-hook-form";
|
|
5
|
-
function
|
|
5
|
+
function Yt(e) {
|
|
6
6
|
var t, n, r = "";
|
|
7
7
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
8
8
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
9
9
|
var o = e.length;
|
|
10
|
-
for (t = 0; t < o; t++) e[t] && (n =
|
|
10
|
+
for (t = 0; t < o; t++) e[t] && (n = Yt(e[t])) && (r && (r += " "), r += n);
|
|
11
11
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
12
12
|
return r;
|
|
13
13
|
}
|
|
14
14
|
function m() {
|
|
15
|
-
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t =
|
|
15
|
+
for (var e, t, n = 0, r = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Yt(e)) && (r && (r += " "), r += t);
|
|
16
16
|
return r;
|
|
17
17
|
}
|
|
18
|
-
const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY", Mn = "crk-md-nDnOD", wn = "crk-lg-qD-Qh", $n = "crk-fullWidth-AHpSl", Nn = "crk-iconOnly-FNrSu", Ln = "crk-content-PpYVU",
|
|
18
|
+
const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY", vn = "crk-secondary-j-3rj", bn = "crk-danger-Hxs5n", xn = "crk-ghost-kQ0A8", kn = "crk-sm-RXFPY", Mn = "crk-md-nDnOD", wn = "crk-lg-qD-Qh", $n = "crk-fullWidth-AHpSl", Nn = "crk-iconOnly-FNrSu", Ln = "crk-content-PpYVU", Rn = "crk-shimmer-8iQSU", Sn = "crk-loadingShimmer-BVvFw", Tn = "crk-shimmerSweep-uiZ01", Cn = "crk-dots-U8wss", An = "crk-loadingDots-eKv64", Bn = "crk-dot-Owuk1", In = "crk-dotBounce-FwdcC", Dn = "crk-loadingBorder-9ULFw", En = "crk-borderSpin-EJ2gW", Be = {
|
|
19
19
|
root: pn,
|
|
20
20
|
loading: gn,
|
|
21
21
|
primary: yn,
|
|
@@ -28,8 +28,8 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
28
28
|
fullWidth: $n,
|
|
29
29
|
iconOnly: Nn,
|
|
30
30
|
content: Ln,
|
|
31
|
-
shimmer:
|
|
32
|
-
loadingShimmer:
|
|
31
|
+
shimmer: Rn,
|
|
32
|
+
loadingShimmer: Sn,
|
|
33
33
|
shimmerSweep: Tn,
|
|
34
34
|
dots: Cn,
|
|
35
35
|
loadingDots: An,
|
|
@@ -41,7 +41,7 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
41
41
|
dots: Be.loadingDots,
|
|
42
42
|
shimmer: Be.loadingShimmer,
|
|
43
43
|
border: Be.loadingBorder
|
|
44
|
-
},
|
|
44
|
+
}, Ut = Ne(
|
|
45
45
|
({
|
|
46
46
|
variant: e = "primary",
|
|
47
47
|
size: t = "md",
|
|
@@ -86,14 +86,14 @@ const pn = "crk-root-8RX49", gn = "crk-loading-QfItr", yn = "crk-primary-st6yY",
|
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
88
|
);
|
|
89
|
-
|
|
89
|
+
Ut.displayName = "Button";
|
|
90
90
|
const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn = "crk-srOnly-LGQgs", $t = {
|
|
91
91
|
root: Wn,
|
|
92
92
|
default: "crk-default-3TBlr",
|
|
93
93
|
muted: Hn,
|
|
94
94
|
danger: On,
|
|
95
95
|
srOnly: Fn
|
|
96
|
-
},
|
|
96
|
+
}, Xn = Ne(
|
|
97
97
|
({
|
|
98
98
|
variant: e = "default",
|
|
99
99
|
external: t = !1,
|
|
@@ -119,13 +119,13 @@ const Wn = "crk-root-2j4Vp", Hn = "crk-muted-vReNc", On = "crk-danger-ugf9r", Fn
|
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
121
|
);
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
root:
|
|
125
|
-
h1:
|
|
122
|
+
Xn.displayName = "Link";
|
|
123
|
+
const zn = "crk-root-U-oiq", jn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Yn = "crk-h3-lrbrK", Un = "crk-h4--jkC1", Vn = "crk-h5-GnQvD", qn = "crk-h6-MKlIN", Gn = "crk-p-FzRtm", Zn = "crk-span-NZvLx", Kn = "crk-label-Cwi6a", Qn = "crk-normal-7AeZz", Jn = "crk-medium-36OXr", er = "crk-semibold-oQixc", tr = "crk-bold-bk4b4", nr = "crk-muted-itOSW", rr = "crk-primary-rp36t", or = "crk-danger-SyOy-", ir = "crk-success-w8PpD", cr = "crk-align-left-3AGYw", lr = "crk-align-center-h-x--", sr = "crk-align-right-IXFhK", ar = "crk-truncate-eqr85", Ye = {
|
|
124
|
+
root: zn,
|
|
125
|
+
h1: jn,
|
|
126
126
|
h2: _n,
|
|
127
|
-
h3:
|
|
128
|
-
h4:
|
|
127
|
+
h3: Yn,
|
|
128
|
+
h4: Un,
|
|
129
129
|
h5: Vn,
|
|
130
130
|
h6: qn,
|
|
131
131
|
p: Gn,
|
|
@@ -144,7 +144,7 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Un = "crk
|
|
|
144
144
|
alignCenter: lr,
|
|
145
145
|
alignRight: sr,
|
|
146
146
|
truncate: ar
|
|
147
|
-
}, dr =
|
|
147
|
+
}, dr = Ne(
|
|
148
148
|
({
|
|
149
149
|
variant: e = "p",
|
|
150
150
|
weight: t,
|
|
@@ -160,12 +160,12 @@ const jn = "crk-root-U-oiq", Xn = "crk-h1-Aivwz", _n = "crk-h2-CV8Oo", Un = "crk
|
|
|
160
160
|
{
|
|
161
161
|
ref: h,
|
|
162
162
|
className: m(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
t &&
|
|
166
|
-
n &&
|
|
167
|
-
r &&
|
|
168
|
-
o &&
|
|
163
|
+
Ye.root,
|
|
164
|
+
Ye[e],
|
|
165
|
+
t && Ye[t],
|
|
166
|
+
n && Ye[n],
|
|
167
|
+
r && Ye[`align-${r}`],
|
|
168
|
+
o && Ye.truncate,
|
|
169
169
|
c
|
|
170
170
|
),
|
|
171
171
|
style: i,
|
|
@@ -184,7 +184,7 @@ const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82",
|
|
|
184
184
|
sm: gr,
|
|
185
185
|
md: yr,
|
|
186
186
|
lg: vr
|
|
187
|
-
}, br =
|
|
187
|
+
}, br = Ne(
|
|
188
188
|
({
|
|
189
189
|
variant: e = "unordered",
|
|
190
190
|
spacing: t = "md",
|
|
@@ -209,7 +209,7 @@ const ur = "crk-root-PVrgx", hr = "crk-unordered-FhCWT", mr = "crk-item-TfW82",
|
|
|
209
209
|
)
|
|
210
210
|
);
|
|
211
211
|
br.displayName = "List";
|
|
212
|
-
const xr =
|
|
212
|
+
const xr = Ne(
|
|
213
213
|
({ className: e, style: t, children: n, ...r }, o) => /* @__PURE__ */ s(
|
|
214
214
|
"li",
|
|
215
215
|
{
|
|
@@ -222,15 +222,15 @@ const xr = $e(
|
|
|
222
222
|
)
|
|
223
223
|
);
|
|
224
224
|
xr.displayName = "ListItem";
|
|
225
|
-
const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZW", $r = "crk-headerCellSortable-NMybk", Nr = "crk-sortIndicator-WGD2S", Lr = "crk-sortArrow-1-ok4",
|
|
225
|
+
const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZW", $r = "crk-headerCellSortable-NMybk", Nr = "crk-sortIndicator-WGD2S", Lr = "crk-sortArrow-1-ok4", Rr = "crk-sortArrowActive-yhWrO", Sr = "crk-sortIndex-HGoca", Tr = "crk-row-H0wL1", Cr = "crk-cell-ZfnbG", Ar = "crk-emptyRow-AoPfj", Br = "crk-emptyCell-99-7C", Ir = "crk-striped-6Qckq", Dr = "crk-hoverable-ljU9B", Er = "crk-compact-2-UWr", Pr = "crk-paginator-UlYIY", Wr = "crk-paginatorInfo-BVca4", Hr = "crk-paginatorText-sqWS0", Or = "crk-pageSizeSelect-yhqJQ", Fr = "crk-paginatorNav-MDSui", Xr = "crk-pageButton-1PX-g", zr = "crk-pageButtonActive--D7Q7", jr = "crk-pageEllipsis-en59J", ve = {
|
|
226
226
|
wrapper: kr,
|
|
227
227
|
root: Mr,
|
|
228
228
|
headerCell: wr,
|
|
229
229
|
headerCellSortable: $r,
|
|
230
230
|
sortIndicator: Nr,
|
|
231
231
|
sortArrow: Lr,
|
|
232
|
-
sortArrowActive:
|
|
233
|
-
sortIndex:
|
|
232
|
+
sortArrowActive: Rr,
|
|
233
|
+
sortIndex: Sr,
|
|
234
234
|
row: Tr,
|
|
235
235
|
cell: Cr,
|
|
236
236
|
emptyRow: Ar,
|
|
@@ -243,20 +243,20 @@ const kr = "crk-wrapper-zxjMt", Mr = "crk-root-Gf85-", wr = "crk-headerCell-ePPZ
|
|
|
243
243
|
paginatorText: Hr,
|
|
244
244
|
pageSizeSelect: Or,
|
|
245
245
|
paginatorNav: Fr,
|
|
246
|
-
pageButton:
|
|
247
|
-
pageButtonActive:
|
|
248
|
-
pageEllipsis:
|
|
246
|
+
pageButton: Xr,
|
|
247
|
+
pageButtonActive: zr,
|
|
248
|
+
pageEllipsis: jr
|
|
249
249
|
};
|
|
250
250
|
function _r(e, t) {
|
|
251
251
|
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
252
252
|
}
|
|
253
|
-
function
|
|
254
|
-
const [n, r] =
|
|
253
|
+
function Yr(e, t = []) {
|
|
254
|
+
const [n, r] = Re(t), o = pe((a) => {
|
|
255
255
|
r((h) => {
|
|
256
256
|
const u = h.find((d) => d.key === a);
|
|
257
257
|
return u ? u.direction === "asc" ? [{ key: a, direction: "desc" }] : [] : [{ key: a, direction: "asc" }];
|
|
258
258
|
});
|
|
259
|
-
}, []), c =
|
|
259
|
+
}, []), c = pe((a) => {
|
|
260
260
|
r((h) => {
|
|
261
261
|
const u = h.findIndex((f) => f.key === a);
|
|
262
262
|
if (u === -1)
|
|
@@ -265,9 +265,9 @@ function Ur(e, t = []) {
|
|
|
265
265
|
const f = [...h];
|
|
266
266
|
return f[u] = { key: a, direction: "desc" }, f;
|
|
267
267
|
}
|
|
268
|
-
return h.filter((f,
|
|
268
|
+
return h.filter((f, p) => p !== u);
|
|
269
269
|
});
|
|
270
|
-
}, []), i =
|
|
270
|
+
}, []), i = pe(() => {
|
|
271
271
|
r([]);
|
|
272
272
|
}, []);
|
|
273
273
|
return { sortedData: ke(() => n.length === 0 ? e : [...e].sort((a, h) => {
|
|
@@ -279,7 +279,7 @@ function Ur(e, t = []) {
|
|
|
279
279
|
return 0;
|
|
280
280
|
}), [e, n]), sortConfig: n, requestSort: o, requestMultiSort: c, resetSort: i };
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ur({ direction: e, sortIndex: t }) {
|
|
283
283
|
return /* @__PURE__ */ z("span", { className: ve.sortIndicator, "aria-hidden": "true", children: [
|
|
284
284
|
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "asc" && ve.sortArrowActive), children: "▲" }),
|
|
285
285
|
/* @__PURE__ */ s("span", { className: m(ve.sortArrow, e === "desc" && ve.sortArrowActive), children: "▼" }),
|
|
@@ -377,50 +377,50 @@ function qr({
|
|
|
377
377
|
rowKey: u,
|
|
378
378
|
rowClassName: d,
|
|
379
379
|
rowStyle: f,
|
|
380
|
-
emptyMessage:
|
|
380
|
+
emptyMessage: p = "No data",
|
|
381
381
|
pagination: L,
|
|
382
|
-
classes:
|
|
382
|
+
classes: b
|
|
383
383
|
}) {
|
|
384
|
-
const
|
|
385
|
-
sortedData:
|
|
386
|
-
sortConfig:
|
|
387
|
-
requestSort:
|
|
388
|
-
requestMultiSort:
|
|
389
|
-
} =
|
|
390
|
-
if (!L ||
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
}, [
|
|
394
|
-
(
|
|
395
|
-
const
|
|
396
|
-
if (
|
|
397
|
-
if (
|
|
398
|
-
const
|
|
399
|
-
let
|
|
400
|
-
|
|
401
|
-
(
|
|
402
|
-
) :
|
|
384
|
+
const R = r !== void 0, {
|
|
385
|
+
sortedData: w,
|
|
386
|
+
sortConfig: Q,
|
|
387
|
+
requestSort: W,
|
|
388
|
+
requestMultiSort: D
|
|
389
|
+
} = Yr(e, n), Z = R ? n ?? [] : Q, T = R ? e : w, $ = ke(() => {
|
|
390
|
+
if (!L || R) return T;
|
|
391
|
+
const S = (L.page - 1) * L.pageSize;
|
|
392
|
+
return T.slice(S, S + L.pageSize);
|
|
393
|
+
}, [T, L, R]), ie = L?.totalRows ?? T.length, ne = pe(
|
|
394
|
+
(S, re) => {
|
|
395
|
+
const F = o && (re.ctrlKey || re.metaKey);
|
|
396
|
+
if (R)
|
|
397
|
+
if (F) {
|
|
398
|
+
const j = Z.findIndex((X) => X.key === S);
|
|
399
|
+
let C;
|
|
400
|
+
j === -1 ? C = [...Z, { key: S, direction: "asc" }] : Z[j].direction === "asc" ? C = Z.map(
|
|
401
|
+
(X, se) => se === j ? { key: S, direction: "desc" } : X
|
|
402
|
+
) : C = Z.filter((X, se) => se !== j), r(C);
|
|
403
403
|
} else {
|
|
404
|
-
const
|
|
405
|
-
|
|
404
|
+
const j = Z.find((C) => C.key === S);
|
|
405
|
+
j ? j.direction === "asc" ? r([{ key: S, direction: "desc" }]) : r([]) : r([{ key: S, direction: "asc" }]);
|
|
406
406
|
}
|
|
407
407
|
else
|
|
408
|
-
|
|
408
|
+
F ? D(S) : W(S);
|
|
409
409
|
},
|
|
410
410
|
[
|
|
411
|
-
|
|
411
|
+
R,
|
|
412
412
|
o,
|
|
413
|
-
|
|
413
|
+
Z,
|
|
414
414
|
r,
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
W,
|
|
416
|
+
D
|
|
417
417
|
]
|
|
418
|
-
),
|
|
419
|
-
if (
|
|
420
|
-
const
|
|
421
|
-
return
|
|
418
|
+
), V = (S) => Z.find((F) => F.key === S)?.direction, ue = (S) => {
|
|
419
|
+
if (Z.length <= 1) return;
|
|
420
|
+
const re = Z.findIndex((F) => F.key === S);
|
|
421
|
+
return re >= 0 ? re : void 0;
|
|
422
422
|
};
|
|
423
|
-
return /* @__PURE__ */ z("div", { className: m(ve.wrapper,
|
|
423
|
+
return /* @__PURE__ */ z("div", { className: m(ve.wrapper, b?.wrapper), children: [
|
|
424
424
|
/* @__PURE__ */ z(
|
|
425
425
|
"table",
|
|
426
426
|
{
|
|
@@ -429,56 +429,56 @@ function qr({
|
|
|
429
429
|
c && ve.striped,
|
|
430
430
|
i && ve.hoverable,
|
|
431
431
|
l && ve.compact,
|
|
432
|
-
|
|
432
|
+
b?.root,
|
|
433
433
|
a
|
|
434
434
|
),
|
|
435
435
|
style: h,
|
|
436
436
|
children: [
|
|
437
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((
|
|
437
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ s("tr", { children: t.map((S) => /* @__PURE__ */ z(
|
|
438
438
|
"th",
|
|
439
439
|
{
|
|
440
440
|
className: m(
|
|
441
441
|
ve.headerCell,
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
S.sortable && ve.headerCellSortable,
|
|
443
|
+
b?.headerCell
|
|
444
444
|
),
|
|
445
445
|
style: {
|
|
446
|
-
width:
|
|
447
|
-
textAlign:
|
|
446
|
+
width: S.width,
|
|
447
|
+
textAlign: S.align
|
|
448
448
|
},
|
|
449
|
-
onClick:
|
|
450
|
-
"aria-sort":
|
|
449
|
+
onClick: S.sortable ? (re) => ne(S.key, re) : void 0,
|
|
450
|
+
"aria-sort": S.sortable ? V(S.key) === "asc" ? "ascending" : V(S.key) === "desc" ? "descending" : "none" : void 0,
|
|
451
451
|
children: [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
452
|
+
S.header,
|
|
453
|
+
S.sortable && /* @__PURE__ */ s(
|
|
454
|
+
Ur,
|
|
455
455
|
{
|
|
456
|
-
direction:
|
|
457
|
-
sortIndex:
|
|
456
|
+
direction: V(S.key),
|
|
457
|
+
sortIndex: ue(S.key)
|
|
458
458
|
}
|
|
459
459
|
)
|
|
460
460
|
]
|
|
461
461
|
},
|
|
462
|
-
|
|
462
|
+
S.key
|
|
463
463
|
)) }) }),
|
|
464
|
-
/* @__PURE__ */ s("tbody", { children: $.length === 0 ? /* @__PURE__ */ s("tr", { className: ve.emptyRow, children: /* @__PURE__ */ s("td", { className: m(ve.emptyCell,
|
|
465
|
-
const
|
|
464
|
+
/* @__PURE__ */ s("tbody", { children: $.length === 0 ? /* @__PURE__ */ s("tr", { className: ve.emptyRow, children: /* @__PURE__ */ s("td", { className: m(ve.emptyCell, b?.emptyCell), colSpan: t.length, children: p }) }) : $.map((S, re) => {
|
|
465
|
+
const F = u ? String(S[u]) : re, j = typeof d == "function" ? d(S, re) : d, C = typeof f == "function" ? f(S, re) : f;
|
|
466
466
|
return /* @__PURE__ */ s(
|
|
467
467
|
"tr",
|
|
468
468
|
{
|
|
469
|
-
className: m(ve.row,
|
|
470
|
-
style:
|
|
471
|
-
children: t.map((
|
|
469
|
+
className: m(ve.row, b?.row, j),
|
|
470
|
+
style: C,
|
|
471
|
+
children: t.map((X) => /* @__PURE__ */ s(
|
|
472
472
|
"td",
|
|
473
473
|
{
|
|
474
|
-
className: m(ve.cell,
|
|
475
|
-
style: { textAlign:
|
|
476
|
-
children:
|
|
474
|
+
className: m(ve.cell, b?.cell),
|
|
475
|
+
style: { textAlign: X.align },
|
|
476
|
+
children: X.render ? X.render(S[X.key], S, re) : S[X.key]
|
|
477
477
|
},
|
|
478
|
-
|
|
478
|
+
X.key
|
|
479
479
|
))
|
|
480
480
|
},
|
|
481
|
-
|
|
481
|
+
F
|
|
482
482
|
);
|
|
483
483
|
}) })
|
|
484
484
|
]
|
|
@@ -488,13 +488,13 @@ function qr({
|
|
|
488
488
|
Vr,
|
|
489
489
|
{
|
|
490
490
|
...L,
|
|
491
|
-
totalRows:
|
|
492
|
-
paginatorClasses: { paginator:
|
|
491
|
+
totalRows: ie,
|
|
492
|
+
paginatorClasses: { paginator: b?.paginator, pageButton: b?.pageButton }
|
|
493
493
|
}
|
|
494
494
|
)
|
|
495
495
|
] });
|
|
496
496
|
}
|
|
497
|
-
const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trigger-LwPaD", Qr = "crk-triggerOpen-U4pa9", Jr = "crk-triggerLabel-QLITs", eo = "crk-triggerError-3jlu1", to = "crk-placeholder-fWdch", no = "crk-chevron-jmDNe", ro = "crk-menu-fxnKL", oo = "crk-menuOpen-HF-Y1", io = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo",
|
|
497
|
+
const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trigger-LwPaD", Qr = "crk-triggerOpen-U4pa9", Jr = "crk-triggerLabel-QLITs", eo = "crk-triggerError-3jlu1", to = "crk-placeholder-fWdch", no = "crk-chevron-jmDNe", ro = "crk-menu-fxnKL", oo = "crk-menuOpen-HF-Y1", io = "crk-alignLeft-buCDJ", co = "crk-alignRight-05P9w", lo = "crk-item-f-Rhh", so = "crk-itemDisabled-L-d6i", ao = "crk-itemSelected-Fwmuo", we = {
|
|
498
498
|
root: Gr,
|
|
499
499
|
fullWidth: Zr,
|
|
500
500
|
trigger: Kr,
|
|
@@ -511,15 +511,15 @@ const El = qr, Gr = "crk-root-an8Cf", Zr = "crk-fullWidth-S-uVk", Kr = "crk-trig
|
|
|
511
511
|
itemDisabled: so,
|
|
512
512
|
itemSelected: ao
|
|
513
513
|
};
|
|
514
|
-
function
|
|
515
|
-
const n =
|
|
514
|
+
function St(e, t = !0) {
|
|
515
|
+
const n = pe(
|
|
516
516
|
(r) => {
|
|
517
517
|
const o = e[r.key];
|
|
518
518
|
o && o(r);
|
|
519
519
|
},
|
|
520
520
|
[e]
|
|
521
521
|
);
|
|
522
|
-
|
|
522
|
+
Le(() => {
|
|
523
523
|
if (t)
|
|
524
524
|
return document.addEventListener("keydown", n), () => {
|
|
525
525
|
document.removeEventListener("keydown", n);
|
|
@@ -527,8 +527,8 @@ function Rt(e, t = !0) {
|
|
|
527
527
|
}, [t, n]);
|
|
528
528
|
}
|
|
529
529
|
function Tt(e, t) {
|
|
530
|
-
const [n, r] =
|
|
531
|
-
return
|
|
530
|
+
const [n, r] = Re({ top: 0, left: 0, width: 0 });
|
|
531
|
+
return zt(() => {
|
|
532
532
|
if (!t) return;
|
|
533
533
|
const o = () => {
|
|
534
534
|
const c = e.current;
|
|
@@ -542,7 +542,7 @@ function Tt(e, t) {
|
|
|
542
542
|
};
|
|
543
543
|
}, [t, e]), n;
|
|
544
544
|
}
|
|
545
|
-
const Vt =
|
|
545
|
+
const Vt = Ne(
|
|
546
546
|
({
|
|
547
547
|
trigger: e,
|
|
548
548
|
children: t,
|
|
@@ -557,113 +557,113 @@ const Vt = $e(
|
|
|
557
557
|
value: u,
|
|
558
558
|
onChange: d,
|
|
559
559
|
error: f = !1,
|
|
560
|
-
fullWidth:
|
|
560
|
+
fullWidth: p = !0,
|
|
561
561
|
portal: L = !0,
|
|
562
|
-
classes:
|
|
563
|
-
},
|
|
564
|
-
const [
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}, [
|
|
568
|
-
const $ =
|
|
569
|
-
|
|
570
|
-
}, [l]),
|
|
571
|
-
|
|
572
|
-
const
|
|
573
|
-
return
|
|
562
|
+
classes: b
|
|
563
|
+
}, R) => {
|
|
564
|
+
const [w, Q] = Re(!1), W = oe(null), D = oe(null), Z = oe(null), T = Ue();
|
|
565
|
+
Le(() => {
|
|
566
|
+
w && D.current && D.current.querySelector('[role="menuitem"]:not(:disabled)')?.focus();
|
|
567
|
+
}, [w]);
|
|
568
|
+
const $ = pe(() => {
|
|
569
|
+
Q(!1), l?.(), Z.current?.focus();
|
|
570
|
+
}, [l]), ie = pe(() => {
|
|
571
|
+
Q((C) => {
|
|
572
|
+
const X = !C;
|
|
573
|
+
return X ? i?.() : l?.(), X;
|
|
574
574
|
});
|
|
575
|
-
}, [i, l]),
|
|
576
|
-
(
|
|
577
|
-
d?.(
|
|
575
|
+
}, [i, l]), ne = pe(
|
|
576
|
+
(C) => {
|
|
577
|
+
d?.(C), $();
|
|
578
578
|
},
|
|
579
579
|
[d, $]
|
|
580
580
|
);
|
|
581
|
-
|
|
582
|
-
if (!
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
|
|
581
|
+
Le(() => {
|
|
582
|
+
if (!w) return;
|
|
583
|
+
const C = (X) => {
|
|
584
|
+
const se = X.target;
|
|
585
|
+
W.current?.contains(se) || D.current?.contains(se) || $();
|
|
586
586
|
};
|
|
587
|
-
return document.addEventListener("mousedown",
|
|
588
|
-
}, [
|
|
587
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
588
|
+
}, [w, $]), St(
|
|
589
589
|
{
|
|
590
590
|
Escape: () => $()
|
|
591
591
|
},
|
|
592
|
-
|
|
592
|
+
w
|
|
593
593
|
);
|
|
594
|
-
const
|
|
594
|
+
const V = Tt(Z, w && L), ue = a?.find((C) => C.value === u)?.label, S = a ? ue || h : e, re = a && !ue, F = a ? a.map((C) => /* @__PURE__ */ s(
|
|
595
595
|
"button",
|
|
596
596
|
{
|
|
597
597
|
type: "button",
|
|
598
598
|
role: "menuitem",
|
|
599
599
|
className: m(
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
600
|
+
we.item,
|
|
601
|
+
C.disabled && we.itemDisabled,
|
|
602
|
+
C.value === u && we.itemSelected,
|
|
603
|
+
b?.item
|
|
604
604
|
),
|
|
605
|
-
disabled:
|
|
606
|
-
onClick: () =>
|
|
607
|
-
children:
|
|
605
|
+
disabled: C.disabled,
|
|
606
|
+
onClick: () => ne(C.value),
|
|
607
|
+
children: C.label
|
|
608
608
|
},
|
|
609
|
-
|
|
610
|
-
)) : t,
|
|
609
|
+
C.value
|
|
610
|
+
)) : t, j = (C) => /* @__PURE__ */ s(
|
|
611
611
|
"div",
|
|
612
612
|
{
|
|
613
|
-
ref:
|
|
614
|
-
id:
|
|
613
|
+
ref: D,
|
|
614
|
+
id: T,
|
|
615
615
|
className: m(
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
n === "left" ?
|
|
619
|
-
!L &&
|
|
620
|
-
|
|
616
|
+
we.menu,
|
|
617
|
+
w && we.menuOpen,
|
|
618
|
+
n === "left" ? we.alignLeft : we.alignRight,
|
|
619
|
+
!L && p && we.fullWidth,
|
|
620
|
+
b?.menu
|
|
621
621
|
),
|
|
622
|
-
style:
|
|
622
|
+
style: C,
|
|
623
623
|
role: "menu",
|
|
624
|
-
children:
|
|
624
|
+
children: F
|
|
625
625
|
}
|
|
626
626
|
);
|
|
627
627
|
return /* @__PURE__ */ z(
|
|
628
628
|
"div",
|
|
629
629
|
{
|
|
630
|
-
ref:
|
|
631
|
-
className: m(
|
|
630
|
+
ref: R,
|
|
631
|
+
className: m(we.root, p && we.fullWidth, b?.root, r),
|
|
632
632
|
style: o,
|
|
633
633
|
children: [
|
|
634
|
-
/* @__PURE__ */ z("div", { ref:
|
|
634
|
+
/* @__PURE__ */ z("div", { ref: W, style: p ? { width: "100%" } : void 0, children: [
|
|
635
635
|
/* @__PURE__ */ z(
|
|
636
636
|
"button",
|
|
637
637
|
{
|
|
638
|
-
ref:
|
|
638
|
+
ref: Z,
|
|
639
639
|
id: c,
|
|
640
640
|
type: "button",
|
|
641
641
|
className: m(
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
f &&
|
|
645
|
-
|
|
646
|
-
|
|
642
|
+
we.trigger,
|
|
643
|
+
w && we.triggerOpen,
|
|
644
|
+
f && we.triggerError,
|
|
645
|
+
p && we.fullWidth,
|
|
646
|
+
b?.trigger
|
|
647
647
|
),
|
|
648
|
-
onClick:
|
|
649
|
-
"aria-expanded":
|
|
648
|
+
onClick: ie,
|
|
649
|
+
"aria-expanded": w,
|
|
650
650
|
"aria-haspopup": "menu",
|
|
651
|
-
"aria-controls":
|
|
651
|
+
"aria-controls": w ? T : void 0,
|
|
652
652
|
children: [
|
|
653
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
654
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
653
|
+
/* @__PURE__ */ s("span", { className: m(we.triggerLabel, re && we.placeholder, b?.triggerLabel), children: S }),
|
|
654
|
+
/* @__PURE__ */ s("span", { className: m(we.chevron, b?.chevron), "aria-hidden": "true" })
|
|
655
655
|
]
|
|
656
656
|
}
|
|
657
657
|
),
|
|
658
|
-
!L &&
|
|
658
|
+
!L && j()
|
|
659
659
|
] }),
|
|
660
|
-
L &&
|
|
661
|
-
|
|
660
|
+
L && w && typeof document < "u" && pt(
|
|
661
|
+
j({
|
|
662
662
|
position: "fixed",
|
|
663
|
-
top:
|
|
664
|
-
left: n === "right" ? void 0 :
|
|
665
|
-
right: n === "right" ? window.innerWidth - (
|
|
666
|
-
minWidth:
|
|
663
|
+
top: V.top + 4,
|
|
664
|
+
left: n === "right" ? void 0 : V.left,
|
|
665
|
+
right: n === "right" ? window.innerWidth - (V.left + V.width) : void 0,
|
|
666
|
+
minWidth: V.width,
|
|
667
667
|
zIndex: "var(--crk-z-floating)"
|
|
668
668
|
}),
|
|
669
669
|
document.body
|
|
@@ -674,7 +674,7 @@ const Vt = $e(
|
|
|
674
674
|
}
|
|
675
675
|
);
|
|
676
676
|
Vt.displayName = "Dropdown";
|
|
677
|
-
const uo =
|
|
677
|
+
const uo = Ne(
|
|
678
678
|
({
|
|
679
679
|
disabled: e = !1,
|
|
680
680
|
className: t,
|
|
@@ -687,8 +687,8 @@ const uo = $e(
|
|
|
687
687
|
type: "button",
|
|
688
688
|
role: "menuitem",
|
|
689
689
|
className: m(
|
|
690
|
-
|
|
691
|
-
e &&
|
|
690
|
+
we.item,
|
|
691
|
+
e && we.itemDisabled,
|
|
692
692
|
t
|
|
693
693
|
),
|
|
694
694
|
disabled: e,
|
|
@@ -709,7 +709,7 @@ const ho = "crk-root-8H-L9", mo = "crk-trigger-Zn1nQ", fo = "crk-popover-rvS3X",
|
|
|
709
709
|
right: bo
|
|
710
710
|
};
|
|
711
711
|
function xo(e, t, n = !0) {
|
|
712
|
-
|
|
712
|
+
Le(() => {
|
|
713
713
|
if (!n) return;
|
|
714
714
|
const r = (o) => {
|
|
715
715
|
!e.current || e.current.contains(o.target) || t();
|
|
@@ -725,7 +725,7 @@ function ko(...e) {
|
|
|
725
725
|
n && (typeof n == "function" ? n(t) : n.current = t);
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
|
-
const qt =
|
|
728
|
+
const qt = Ne(
|
|
729
729
|
({
|
|
730
730
|
trigger: e,
|
|
731
731
|
asChild: t = !1,
|
|
@@ -737,53 +737,53 @@ const qt = $e(
|
|
|
737
737
|
className: l,
|
|
738
738
|
style: a
|
|
739
739
|
}, h) => {
|
|
740
|
-
const [u, d] =
|
|
741
|
-
(
|
|
742
|
-
|
|
740
|
+
const [u, d] = Re(!1), f = oe(null), p = oe(null), L = oe(null), b = Ue(), R = o !== void 0, w = R ? o : u, Q = pe(
|
|
741
|
+
(T) => {
|
|
742
|
+
R || d(T), c?.(T);
|
|
743
743
|
},
|
|
744
|
-
[
|
|
745
|
-
),
|
|
746
|
-
|
|
747
|
-
}, [
|
|
748
|
-
|
|
749
|
-
}, [
|
|
750
|
-
xo(f,
|
|
744
|
+
[R, c]
|
|
745
|
+
), W = pe(() => {
|
|
746
|
+
Q(!1), L.current?.focus();
|
|
747
|
+
}, [Q]), D = pe(() => {
|
|
748
|
+
Q(!w);
|
|
749
|
+
}, [w, Q]);
|
|
750
|
+
xo(f, W, w), St(
|
|
751
751
|
{
|
|
752
|
-
Escape: () =>
|
|
752
|
+
Escape: () => W()
|
|
753
753
|
},
|
|
754
|
-
|
|
755
|
-
),
|
|
756
|
-
if (
|
|
757
|
-
const
|
|
754
|
+
w
|
|
755
|
+
), Le(() => {
|
|
756
|
+
if (w && p.current) {
|
|
757
|
+
const T = p.current.querySelector(
|
|
758
758
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
759
759
|
);
|
|
760
|
-
|
|
760
|
+
T ? T.focus() : p.current.focus();
|
|
761
761
|
}
|
|
762
|
-
}, [
|
|
763
|
-
let
|
|
762
|
+
}, [w]);
|
|
763
|
+
let Z;
|
|
764
764
|
if (t && dn(e)) {
|
|
765
|
-
const
|
|
766
|
-
|
|
765
|
+
const T = e, $ = T.ref;
|
|
766
|
+
Z = jt(T, {
|
|
767
767
|
ref: ko(L, $),
|
|
768
|
-
onClick: (
|
|
769
|
-
|
|
768
|
+
onClick: (ie) => {
|
|
769
|
+
T.props.onClick?.(ie), D();
|
|
770
770
|
},
|
|
771
|
-
className: m(
|
|
772
|
-
"aria-expanded":
|
|
771
|
+
className: m(T.props.className, i?.trigger),
|
|
772
|
+
"aria-expanded": w,
|
|
773
773
|
"aria-haspopup": "dialog",
|
|
774
|
-
"aria-controls":
|
|
774
|
+
"aria-controls": w ? b : void 0
|
|
775
775
|
});
|
|
776
776
|
} else
|
|
777
|
-
|
|
777
|
+
Z = /* @__PURE__ */ s(
|
|
778
778
|
"button",
|
|
779
779
|
{
|
|
780
780
|
ref: L,
|
|
781
781
|
type: "button",
|
|
782
782
|
className: m(at.trigger, i?.trigger),
|
|
783
|
-
onClick:
|
|
784
|
-
"aria-expanded":
|
|
783
|
+
onClick: D,
|
|
784
|
+
"aria-expanded": w,
|
|
785
785
|
"aria-haspopup": "dialog",
|
|
786
|
-
"aria-controls":
|
|
786
|
+
"aria-controls": w ? b : void 0,
|
|
787
787
|
children: e
|
|
788
788
|
}
|
|
789
789
|
);
|
|
@@ -794,12 +794,12 @@ const qt = $e(
|
|
|
794
794
|
className: m(at.root, i?.root, l),
|
|
795
795
|
style: a,
|
|
796
796
|
children: /* @__PURE__ */ z("div", { ref: f, children: [
|
|
797
|
-
|
|
798
|
-
|
|
797
|
+
Z,
|
|
798
|
+
w && /* @__PURE__ */ s(
|
|
799
799
|
"div",
|
|
800
800
|
{
|
|
801
|
-
ref:
|
|
802
|
-
id:
|
|
801
|
+
ref: p,
|
|
802
|
+
id: b,
|
|
803
803
|
role: "dialog",
|
|
804
804
|
tabIndex: -1,
|
|
805
805
|
className: m(at.popover, at[r], i?.popover),
|
|
@@ -821,7 +821,7 @@ const It = [
|
|
|
821
821
|
'[tabindex]:not([tabindex="-1"])'
|
|
822
822
|
].join(", ");
|
|
823
823
|
function Mo(e, t) {
|
|
824
|
-
const n =
|
|
824
|
+
const n = oe(null), r = pe(
|
|
825
825
|
(o) => {
|
|
826
826
|
if (o.key !== "Tab" || !e.current)
|
|
827
827
|
return;
|
|
@@ -837,7 +837,7 @@ function Mo(e, t) {
|
|
|
837
837
|
},
|
|
838
838
|
[e]
|
|
839
839
|
);
|
|
840
|
-
|
|
840
|
+
Le(() => {
|
|
841
841
|
if (!t || !e.current)
|
|
842
842
|
return;
|
|
843
843
|
n.current = document.activeElement;
|
|
@@ -847,13 +847,13 @@ function Mo(e, t) {
|
|
|
847
847
|
};
|
|
848
848
|
}, [t, e, r]);
|
|
849
849
|
}
|
|
850
|
-
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm",
|
|
850
|
+
const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yNG-7", Lo = "crk-modalIn-xFUwm", Ro = "crk-sm--xyY9", So = "crk-md-ETTfh", To = "crk-lg-5DBb7", Co = "crk-fullscreen-b4jQ-", Ao = "crk-header-NS30G", Bo = "crk-headerWithClose-4davm", Io = "crk-closeButton-JX-aq", Do = "crk-body-3zIj9", Eo = "crk-footer-Oyz-R", Xe = {
|
|
851
851
|
backdrop: wo,
|
|
852
852
|
backdropIn: $o,
|
|
853
853
|
modal: No,
|
|
854
854
|
modalIn: Lo,
|
|
855
|
-
sm:
|
|
856
|
-
md:
|
|
855
|
+
sm: Ro,
|
|
856
|
+
md: So,
|
|
857
857
|
lg: To,
|
|
858
858
|
fullscreen: Co,
|
|
859
859
|
header: Ao,
|
|
@@ -867,7 +867,7 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
867
867
|
"div",
|
|
868
868
|
{
|
|
869
869
|
id: c,
|
|
870
|
-
className: m(
|
|
870
|
+
className: m(Xe.header, r && Xe.headerWithClose, o.header, t),
|
|
871
871
|
style: n,
|
|
872
872
|
children: [
|
|
873
873
|
e,
|
|
@@ -875,7 +875,7 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
875
875
|
"button",
|
|
876
876
|
{
|
|
877
877
|
type: "button",
|
|
878
|
-
className: m(
|
|
878
|
+
className: m(Xe.closeButton, o.closeButton),
|
|
879
879
|
onClick: r,
|
|
880
880
|
"aria-label": "Close",
|
|
881
881
|
children: "×"
|
|
@@ -888,15 +888,15 @@ const wo = "crk-backdrop-jYpTA", $o = "crk-backdropIn-x5Z-A", No = "crk-modal-yN
|
|
|
888
888
|
Gt.displayName = "Modal.Header";
|
|
889
889
|
const Zt = ({ children: e, className: t, style: n }) => {
|
|
890
890
|
const { classes: r } = ft(gt);
|
|
891
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
891
|
+
return /* @__PURE__ */ s("div", { className: m(Xe.body, r.body, t), style: n, children: e });
|
|
892
892
|
};
|
|
893
893
|
Zt.displayName = "Modal.Body";
|
|
894
894
|
const Kt = ({ children: e, className: t, style: n }) => {
|
|
895
895
|
const { classes: r } = ft(gt);
|
|
896
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
896
|
+
return /* @__PURE__ */ s("div", { className: m(Xe.footer, r.footer, t), style: n, children: e });
|
|
897
897
|
};
|
|
898
898
|
Kt.displayName = "Modal.Footer";
|
|
899
|
-
const yt =
|
|
899
|
+
const yt = Ne(
|
|
900
900
|
({
|
|
901
901
|
open: e,
|
|
902
902
|
onClose: t,
|
|
@@ -910,9 +910,9 @@ const yt = $e(
|
|
|
910
910
|
"aria-label": h,
|
|
911
911
|
"aria-labelledby": u
|
|
912
912
|
}, d) => {
|
|
913
|
-
const f =
|
|
914
|
-
Mo(
|
|
915
|
-
const
|
|
913
|
+
const f = oe(null), p = d ?? f, L = Ue(), b = u ?? `${L}-title`;
|
|
914
|
+
Mo(p, e);
|
|
915
|
+
const R = ke(
|
|
916
916
|
() => ({
|
|
917
917
|
Escape: () => {
|
|
918
918
|
r && t();
|
|
@@ -920,34 +920,34 @@ const yt = $e(
|
|
|
920
920
|
}),
|
|
921
921
|
[r, t]
|
|
922
922
|
);
|
|
923
|
-
|
|
923
|
+
St(R, e), Le(() => {
|
|
924
924
|
if (!e) return;
|
|
925
|
-
const
|
|
925
|
+
const Q = document.body.style.overflow;
|
|
926
926
|
return document.body.style.overflow = "hidden", () => {
|
|
927
|
-
document.body.style.overflow =
|
|
927
|
+
document.body.style.overflow = Q;
|
|
928
928
|
};
|
|
929
929
|
}, [e]);
|
|
930
|
-
const
|
|
931
|
-
n &&
|
|
930
|
+
const w = (Q) => {
|
|
931
|
+
n && Q.target === Q.currentTarget && t();
|
|
932
932
|
};
|
|
933
933
|
return e ? pt(
|
|
934
934
|
/* @__PURE__ */ s(
|
|
935
935
|
"div",
|
|
936
936
|
{
|
|
937
|
-
className: m(
|
|
938
|
-
onClick:
|
|
937
|
+
className: m(Xe.backdrop, c?.backdrop),
|
|
938
|
+
onClick: w,
|
|
939
939
|
role: "presentation",
|
|
940
940
|
children: /* @__PURE__ */ s(
|
|
941
941
|
"div",
|
|
942
942
|
{
|
|
943
|
-
ref:
|
|
944
|
-
className: m(
|
|
943
|
+
ref: p,
|
|
944
|
+
className: m(Xe.modal, Xe[o], c?.modal, i),
|
|
945
945
|
style: l,
|
|
946
946
|
role: "dialog",
|
|
947
947
|
"aria-modal": "true",
|
|
948
948
|
"aria-label": h,
|
|
949
|
-
"aria-labelledby": h ? void 0 :
|
|
950
|
-
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId:
|
|
949
|
+
"aria-labelledby": h ? void 0 : b,
|
|
950
|
+
children: /* @__PURE__ */ s(gt.Provider, { value: { classes: c ?? {}, titleId: b }, children: a })
|
|
951
951
|
}
|
|
952
952
|
)
|
|
953
953
|
}
|
|
@@ -960,17 +960,17 @@ yt.displayName = "Modal";
|
|
|
960
960
|
yt.Header = Gt;
|
|
961
961
|
yt.Body = Zt;
|
|
962
962
|
yt.Footer = Kt;
|
|
963
|
-
const Po = "crk-root-jHIIP", Wo = "crk-formErrors-eh-OP", Ho = "crk-formError-XEuWv", Oo = "crk-field-OUlYz", Fo = "crk-label-udkR7",
|
|
963
|
+
const Po = "crk-root-jHIIP", Wo = "crk-formErrors-eh-OP", Ho = "crk-formError-XEuWv", Oo = "crk-field-OUlYz", Fo = "crk-label-udkR7", Xo = "crk-labelError-LOgKi", zo = "crk-required-IYiA2", jo = "crk-error-yFZXm", _o = "crk-helperText-Dm-rb", Yo = "crk-row-nNbx-", We = {
|
|
964
964
|
root: Po,
|
|
965
965
|
formErrors: Wo,
|
|
966
966
|
formError: Ho,
|
|
967
967
|
field: Oo,
|
|
968
968
|
label: Fo,
|
|
969
|
-
labelError:
|
|
970
|
-
required:
|
|
971
|
-
error:
|
|
969
|
+
labelError: Xo,
|
|
970
|
+
required: zo,
|
|
971
|
+
error: jo,
|
|
972
972
|
helperText: _o,
|
|
973
|
-
row:
|
|
973
|
+
row: Yo
|
|
974
974
|
};
|
|
975
975
|
function Pl({
|
|
976
976
|
form: e,
|
|
@@ -994,7 +994,7 @@ function Pl({
|
|
|
994
994
|
}
|
|
995
995
|
) });
|
|
996
996
|
}
|
|
997
|
-
const
|
|
997
|
+
const Uo = /* @__PURE__ */ new Set([
|
|
998
998
|
"Select",
|
|
999
999
|
"NativeSelect",
|
|
1000
1000
|
"SearchableSelect",
|
|
@@ -1012,15 +1012,15 @@ function Wl({
|
|
|
1012
1012
|
style: l,
|
|
1013
1013
|
children: a
|
|
1014
1014
|
}) {
|
|
1015
|
-
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type,
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
(
|
|
1019
|
-
if (
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1015
|
+
const { control: h } = mn(), { field: u, fieldState: d } = fn({ name: e, control: h, rules: o }), f = a.type, p = typeof f == "string" ? "" : f?.displayName ?? f?.name ?? "", L = Uo.has(p), { ref: b, ...R } = u, w = oe(b);
|
|
1016
|
+
w.current = b;
|
|
1017
|
+
const Q = pe(
|
|
1018
|
+
(W) => {
|
|
1019
|
+
if (W) {
|
|
1020
|
+
const D = W.matches("input, select, textarea, button, [tabindex]") ? W : W.querySelector('input, select, textarea, button, [tabindex]:not([tabindex="-1"])');
|
|
1021
|
+
w.current(D ?? W);
|
|
1022
1022
|
} else
|
|
1023
|
-
|
|
1023
|
+
w.current(null);
|
|
1024
1024
|
},
|
|
1025
1025
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1026
1026
|
[]
|
|
@@ -1030,9 +1030,9 @@ function Wl({
|
|
|
1030
1030
|
t,
|
|
1031
1031
|
r && /* @__PURE__ */ s("span", { className: We.required, children: "*" })
|
|
1032
1032
|
] }),
|
|
1033
|
-
|
|
1034
|
-
...
|
|
1035
|
-
ref:
|
|
1033
|
+
jt(a, {
|
|
1034
|
+
...R,
|
|
1035
|
+
ref: Q,
|
|
1036
1036
|
id: e,
|
|
1037
1037
|
error: !!d.error,
|
|
1038
1038
|
"aria-invalid": d.error ? !0 : void 0,
|
|
@@ -1041,11 +1041,11 @@ function Wl({
|
|
|
1041
1041
|
// Skip for native-input wrappers (Input, Textarea, Checkbox, Radio) so the unknown
|
|
1042
1042
|
// handler doesn't leak onto the DOM and trip React's "Unknown event handler" warning.
|
|
1043
1043
|
...L && {
|
|
1044
|
-
onValueChange:
|
|
1045
|
-
onValuesChange:
|
|
1044
|
+
onValueChange: R.onChange,
|
|
1045
|
+
onValuesChange: R.onChange
|
|
1046
1046
|
},
|
|
1047
1047
|
// Bridge for Checkbox (expects checked, not value)
|
|
1048
|
-
checked: typeof
|
|
1048
|
+
checked: typeof R.value == "boolean" ? R.value : void 0
|
|
1049
1049
|
}),
|
|
1050
1050
|
d.error?.message ? /* @__PURE__ */ s("span", { id: `${e}-error`, className: m(We.error, c?.error), role: "alert", children: d.error.message }) : n ? /* @__PURE__ */ s("span", { id: `${e}-helper`, className: m(We.helperText, c?.helperText), children: n }) : null
|
|
1051
1051
|
] });
|
|
@@ -1064,7 +1064,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1064
1064
|
suffix: ei,
|
|
1065
1065
|
hasPrefix: ti,
|
|
1066
1066
|
hasSuffix: ni
|
|
1067
|
-
}, ri =
|
|
1067
|
+
}, ri = Ne(
|
|
1068
1068
|
({
|
|
1069
1069
|
inputSize: e = "md",
|
|
1070
1070
|
error: t = !1,
|
|
@@ -1107,7 +1107,7 @@ const Vo = "crk-root-rSgdy", qo = "crk-wrapper-GHy8V", Go = "crk-sm-DptM5", Zo =
|
|
|
1107
1107
|
}
|
|
1108
1108
|
);
|
|
1109
1109
|
ri.displayName = "Input";
|
|
1110
|
-
const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "crk-lg-24Xd3", si = "crk-root-Uu9Ah", ai = "crk-error-9oRU6", di = "crk-arrow-WU8ZW", ui = "crk-searchableWrapper-7AL4l", hi = "crk-hiddenSelect-s3DEx", mi = "crk-searchableTrigger-m-GWV", fi = "crk-triggerOpen-Lo8-j", pi = "crk-triggerLabel-5rETZ", gi = "crk-placeholder-teBBh", yi = "crk-arrowInline-m-roG", vi = "crk-disabled-pcSeq", bi = "crk-visuallyHidden-2tTD5", xi = "crk-menu--i-je", ki = "crk-menuEnter-vJjLV", Mi = "crk-menuItems-VrZnE", wi = "crk-item-fU3XI", $i = "crk-itemHighlighted-MvR41", Ni = "crk-itemDisabled-KTUO8", Li = "crk-itemSelected-42-BG",
|
|
1110
|
+
const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "crk-lg-24Xd3", si = "crk-root-Uu9Ah", ai = "crk-error-9oRU6", di = "crk-arrow-WU8ZW", ui = "crk-searchableWrapper-7AL4l", hi = "crk-hiddenSelect-s3DEx", mi = "crk-searchableTrigger-m-GWV", fi = "crk-triggerOpen-Lo8-j", pi = "crk-triggerLabel-5rETZ", gi = "crk-placeholder-teBBh", yi = "crk-arrowInline-m-roG", vi = "crk-disabled-pcSeq", bi = "crk-visuallyHidden-2tTD5", xi = "crk-menu--i-je", ki = "crk-menuEnter-vJjLV", Mi = "crk-menuItems-VrZnE", wi = "crk-item-fU3XI", $i = "crk-itemHighlighted-MvR41", Ni = "crk-itemDisabled-KTUO8", Li = "crk-itemSelected-42-BG", Ri = "crk-noResults-uicSW", Si = "crk-multiTrigger-Pd3wJ", Ti = "crk-multiTriggerDisabled-9ajge", Ci = "crk-chip-TuYUB", Ai = "crk-chipLabel-H4JWu", Bi = "crk-chipRemove-Lfk0R", Ii = "crk-multiSearch-OrVeS", Di = "crk-arrowMulti-Nh9Hr", Ei = "crk-itemCheck-DPB5A", P = {
|
|
1111
1111
|
wrapper: oi,
|
|
1112
1112
|
sm: ii,
|
|
1113
1113
|
md: ci,
|
|
@@ -1131,8 +1131,8 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1131
1131
|
itemHighlighted: $i,
|
|
1132
1132
|
itemDisabled: Ni,
|
|
1133
1133
|
itemSelected: Li,
|
|
1134
|
-
noResults:
|
|
1135
|
-
multiTrigger:
|
|
1134
|
+
noResults: Ri,
|
|
1135
|
+
multiTrigger: Si,
|
|
1136
1136
|
multiTriggerDisabled: Ti,
|
|
1137
1137
|
chip: Ci,
|
|
1138
1138
|
chipLabel: Ai,
|
|
@@ -1140,7 +1140,7 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1140
1140
|
multiSearch: Ii,
|
|
1141
1141
|
arrowMulti: Di,
|
|
1142
1142
|
itemCheck: Ei
|
|
1143
|
-
}, Qt =
|
|
1143
|
+
}, Qt = Ne(
|
|
1144
1144
|
({
|
|
1145
1145
|
inputSize: e = "md",
|
|
1146
1146
|
error: t = !1,
|
|
@@ -1154,24 +1154,24 @@ const oi = "crk-wrapper-SP2JE", ii = "crk-sm-DqshL", ci = "crk-md-j4AKI", li = "
|
|
|
1154
1154
|
searchPlaceholder: h,
|
|
1155
1155
|
onValueChange: u,
|
|
1156
1156
|
...d
|
|
1157
|
-
}, f) => /* @__PURE__ */ z("div", { className: m(
|
|
1157
|
+
}, f) => /* @__PURE__ */ z("div", { className: m(P.wrapper, P[e], t && P.error, o?.wrapper, c), style: i, children: [
|
|
1158
1158
|
/* @__PURE__ */ z(
|
|
1159
1159
|
"select",
|
|
1160
1160
|
{
|
|
1161
1161
|
ref: f,
|
|
1162
|
-
className: m(
|
|
1162
|
+
className: m(P.root, P[e], t && P.error, o?.root),
|
|
1163
1163
|
...d,
|
|
1164
1164
|
children: [
|
|
1165
1165
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
1166
|
-
n ? n.map((
|
|
1166
|
+
n ? n.map((p) => /* @__PURE__ */ s("option", { value: p.value, disabled: p.disabled, children: p.label }, p.value)) : l
|
|
1167
1167
|
]
|
|
1168
1168
|
}
|
|
1169
1169
|
),
|
|
1170
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1170
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, o?.arrow) })
|
|
1171
1171
|
] })
|
|
1172
1172
|
);
|
|
1173
1173
|
Qt.displayName = "NativeSelect";
|
|
1174
|
-
const Jt =
|
|
1174
|
+
const Jt = Ne(
|
|
1175
1175
|
({
|
|
1176
1176
|
inputSize: e = "md",
|
|
1177
1177
|
error: t = !1,
|
|
@@ -1186,84 +1186,84 @@ const Jt = $e(
|
|
|
1186
1186
|
searchPlaceholder: u = "Search...",
|
|
1187
1187
|
onChange: d,
|
|
1188
1188
|
onValueChange: f,
|
|
1189
|
-
portal:
|
|
1189
|
+
portal: p = !0
|
|
1190
1190
|
}, L) => {
|
|
1191
|
-
const [
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
}, [
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
}, []),
|
|
1198
|
-
a || (
|
|
1199
|
-
}, [a]),
|
|
1200
|
-
(
|
|
1201
|
-
if (f?.(
|
|
1191
|
+
const [b, R] = Re(!1), [w, Q] = Re(""), [W, D] = Re(0), Z = oe(null), T = oe(null), $ = oe(null), ie = oe(null), ne = oe(null), V = Ue(), ue = Tt($, b && p), S = oe(null), re = L ?? S, F = oe(!1);
|
|
1192
|
+
Le(() => {
|
|
1193
|
+
F.current && !b && $.current?.focus(), F.current = b;
|
|
1194
|
+
}, [b]);
|
|
1195
|
+
const j = pe(() => {
|
|
1196
|
+
R(!1), Q(""), D(0);
|
|
1197
|
+
}, []), C = pe(() => {
|
|
1198
|
+
a || (R(!0), Q(""), D(0), setTimeout(() => T.current?.focus(), 0));
|
|
1199
|
+
}, [a]), X = pe(
|
|
1200
|
+
(N) => {
|
|
1201
|
+
if (f?.(N), re.current) {
|
|
1202
1202
|
Object.getOwnPropertyDescriptor(
|
|
1203
1203
|
HTMLSelectElement.prototype,
|
|
1204
1204
|
"value"
|
|
1205
|
-
)?.set?.call(
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1205
|
+
)?.set?.call(re.current, N);
|
|
1206
|
+
const v = new Event("change", { bubbles: !0 });
|
|
1207
|
+
re.current.dispatchEvent(v), d?.(v);
|
|
1208
1208
|
}
|
|
1209
|
-
|
|
1209
|
+
j();
|
|
1210
1210
|
},
|
|
1211
|
-
[f, d,
|
|
1212
|
-
),
|
|
1213
|
-
if (!
|
|
1214
|
-
const
|
|
1215
|
-
return n.filter((
|
|
1216
|
-
}, [n,
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
}, [
|
|
1221
|
-
if (!
|
|
1222
|
-
const
|
|
1223
|
-
if (!
|
|
1224
|
-
|
|
1225
|
-
}, [
|
|
1226
|
-
const
|
|
1227
|
-
(
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
if (
|
|
1231
|
-
|
|
1232
|
-
const
|
|
1233
|
-
return
|
|
1211
|
+
[f, d, re, j]
|
|
1212
|
+
), se = ke(() => {
|
|
1213
|
+
if (!w) return n;
|
|
1214
|
+
const N = w.toLowerCase();
|
|
1215
|
+
return n.filter((y) => y.label.toLowerCase().includes(N));
|
|
1216
|
+
}, [n, w]);
|
|
1217
|
+
Le(() => {
|
|
1218
|
+
const N = se.findIndex((y) => !y.disabled);
|
|
1219
|
+
D(N >= 0 ? N : 0);
|
|
1220
|
+
}, [se]), Le(() => {
|
|
1221
|
+
if (!b) return;
|
|
1222
|
+
const N = ne.current;
|
|
1223
|
+
if (!N) return;
|
|
1224
|
+
N.querySelectorAll('[role="option"]')[W]?.scrollIntoView?.({ block: "nearest" });
|
|
1225
|
+
}, [W, b]);
|
|
1226
|
+
const me = pe(
|
|
1227
|
+
(N) => {
|
|
1228
|
+
const y = se.map((v, A) => v.disabled ? -1 : A).filter((v) => v >= 0);
|
|
1229
|
+
if (y.length !== 0)
|
|
1230
|
+
if (N.key === "ArrowDown")
|
|
1231
|
+
N.preventDefault(), D((v) => {
|
|
1232
|
+
const A = y.indexOf(v);
|
|
1233
|
+
return A < y.length - 1 ? y[A + 1] : y[0];
|
|
1234
1234
|
});
|
|
1235
|
-
else if (
|
|
1236
|
-
|
|
1237
|
-
const
|
|
1238
|
-
return
|
|
1235
|
+
else if (N.key === "ArrowUp")
|
|
1236
|
+
N.preventDefault(), D((v) => {
|
|
1237
|
+
const A = y.indexOf(v);
|
|
1238
|
+
return A > 0 ? y[A - 1] : y[y.length - 1];
|
|
1239
1239
|
});
|
|
1240
|
-
else if (
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
} else
|
|
1240
|
+
else if (N.key === "Enter") {
|
|
1241
|
+
N.preventDefault();
|
|
1242
|
+
const v = se[W];
|
|
1243
|
+
v && !v.disabled && X(v.value);
|
|
1244
|
+
} else N.key === "Escape" && (N.preventDefault(), j());
|
|
1245
1245
|
},
|
|
1246
|
-
[
|
|
1246
|
+
[se, W, X, j]
|
|
1247
1247
|
);
|
|
1248
|
-
|
|
1249
|
-
if (!
|
|
1250
|
-
const
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1248
|
+
Le(() => {
|
|
1249
|
+
if (!b) return;
|
|
1250
|
+
const N = (y) => {
|
|
1251
|
+
const v = y.target;
|
|
1252
|
+
Z.current?.contains(v) || ie.current?.contains(v) || j();
|
|
1253
1253
|
};
|
|
1254
|
-
return document.addEventListener("mousedown",
|
|
1255
|
-
}, [
|
|
1256
|
-
const K = n.find((
|
|
1254
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
1255
|
+
}, [b, j]);
|
|
1256
|
+
const K = n.find((N) => N.value === l)?.label, H = se.filter((N) => !N.disabled);
|
|
1257
1257
|
return /* @__PURE__ */ z(
|
|
1258
1258
|
"div",
|
|
1259
1259
|
{
|
|
1260
|
-
ref:
|
|
1260
|
+
ref: Z,
|
|
1261
1261
|
className: m(
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
t &&
|
|
1266
|
-
a &&
|
|
1262
|
+
P.wrapper,
|
|
1263
|
+
P.searchableWrapper,
|
|
1264
|
+
P[e],
|
|
1265
|
+
t && P.error,
|
|
1266
|
+
a && P.disabled,
|
|
1267
1267
|
o?.wrapper,
|
|
1268
1268
|
c
|
|
1269
1269
|
),
|
|
@@ -1272,15 +1272,15 @@ const Jt = $e(
|
|
|
1272
1272
|
/* @__PURE__ */ s(
|
|
1273
1273
|
"select",
|
|
1274
1274
|
{
|
|
1275
|
-
ref:
|
|
1276
|
-
className:
|
|
1275
|
+
ref: re,
|
|
1276
|
+
className: P.hiddenSelect,
|
|
1277
1277
|
value: l ?? "",
|
|
1278
1278
|
disabled: a,
|
|
1279
1279
|
tabIndex: -1,
|
|
1280
1280
|
"aria-hidden": "true",
|
|
1281
1281
|
onChange: () => {
|
|
1282
1282
|
},
|
|
1283
|
-
children: n.map((
|
|
1283
|
+
children: n.map((N) => /* @__PURE__ */ s("option", { value: N.value, children: N.label }, N.value))
|
|
1284
1284
|
}
|
|
1285
1285
|
),
|
|
1286
1286
|
/* @__PURE__ */ z(
|
|
@@ -1290,90 +1290,90 @@ const Jt = $e(
|
|
|
1290
1290
|
id: h,
|
|
1291
1291
|
type: "button",
|
|
1292
1292
|
className: m(
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
t &&
|
|
1298
|
-
|
|
1293
|
+
P.root,
|
|
1294
|
+
P.searchableTrigger,
|
|
1295
|
+
P[e],
|
|
1296
|
+
b && P.triggerOpen,
|
|
1297
|
+
t && P.error,
|
|
1298
|
+
b && P.visuallyHidden,
|
|
1299
1299
|
o?.root
|
|
1300
1300
|
),
|
|
1301
|
-
onClick:
|
|
1301
|
+
onClick: C,
|
|
1302
1302
|
disabled: a,
|
|
1303
|
-
"aria-expanded":
|
|
1303
|
+
"aria-expanded": b,
|
|
1304
1304
|
"aria-haspopup": "listbox",
|
|
1305
|
-
"aria-controls":
|
|
1305
|
+
"aria-controls": b ? V : void 0,
|
|
1306
1306
|
children: [
|
|
1307
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1308
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1307
|
+
/* @__PURE__ */ s("span", { className: m(P.triggerLabel, !K && P.placeholder), children: K || r }),
|
|
1308
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, P.arrowInline, o?.arrow) })
|
|
1309
1309
|
]
|
|
1310
1310
|
}
|
|
1311
1311
|
),
|
|
1312
|
-
|
|
1312
|
+
b && /* @__PURE__ */ s(
|
|
1313
1313
|
"input",
|
|
1314
1314
|
{
|
|
1315
|
-
ref:
|
|
1315
|
+
ref: T,
|
|
1316
1316
|
type: "text",
|
|
1317
1317
|
role: "combobox",
|
|
1318
1318
|
className: m(
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
t &&
|
|
1319
|
+
P.root,
|
|
1320
|
+
P.searchableTrigger,
|
|
1321
|
+
P[e],
|
|
1322
|
+
P.triggerOpen,
|
|
1323
|
+
t && P.error,
|
|
1324
1324
|
o?.root,
|
|
1325
1325
|
o?.search
|
|
1326
1326
|
),
|
|
1327
1327
|
placeholder: K || r,
|
|
1328
|
-
value:
|
|
1329
|
-
onChange: (
|
|
1330
|
-
onKeyDown:
|
|
1328
|
+
value: w,
|
|
1329
|
+
onChange: (N) => Q(N.target.value),
|
|
1330
|
+
onKeyDown: me,
|
|
1331
1331
|
"aria-expanded": !0,
|
|
1332
1332
|
"aria-haspopup": "listbox",
|
|
1333
|
-
"aria-controls":
|
|
1334
|
-
"aria-activedescendant":
|
|
1333
|
+
"aria-controls": V,
|
|
1334
|
+
"aria-activedescendant": H.length > 0 ? `select-option-${se[W]?.value}` : void 0
|
|
1335
1335
|
}
|
|
1336
1336
|
),
|
|
1337
|
-
|
|
1338
|
-
const
|
|
1337
|
+
b && (() => {
|
|
1338
|
+
const N = p ? {
|
|
1339
1339
|
position: "fixed",
|
|
1340
|
-
top:
|
|
1341
|
-
left:
|
|
1340
|
+
top: ue.top + 4,
|
|
1341
|
+
left: ue.left,
|
|
1342
1342
|
right: "auto",
|
|
1343
|
-
width:
|
|
1343
|
+
width: ue.width,
|
|
1344
1344
|
zIndex: "var(--crk-z-floating)"
|
|
1345
|
-
} : void 0,
|
|
1345
|
+
} : void 0, y = /* @__PURE__ */ s(
|
|
1346
1346
|
"div",
|
|
1347
1347
|
{
|
|
1348
|
-
id:
|
|
1349
|
-
ref:
|
|
1350
|
-
className: m(
|
|
1351
|
-
style:
|
|
1348
|
+
id: V,
|
|
1349
|
+
ref: ie,
|
|
1350
|
+
className: m(P.menu, o?.menu),
|
|
1351
|
+
style: N,
|
|
1352
1352
|
role: "listbox",
|
|
1353
|
-
children: /* @__PURE__ */ s("div", { className:
|
|
1353
|
+
children: /* @__PURE__ */ s("div", { className: P.menuItems, ref: ne, children: se.length === 0 ? /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }) : se.map((v, A) => /* @__PURE__ */ s(
|
|
1354
1354
|
"button",
|
|
1355
1355
|
{
|
|
1356
|
-
id: `select-option-${
|
|
1356
|
+
id: `select-option-${v.value}`,
|
|
1357
1357
|
type: "button",
|
|
1358
1358
|
role: "option",
|
|
1359
|
-
"aria-selected":
|
|
1359
|
+
"aria-selected": v.value === l,
|
|
1360
1360
|
className: m(
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1361
|
+
P.item,
|
|
1362
|
+
v.disabled && P.itemDisabled,
|
|
1363
|
+
v.value === l && P.itemSelected,
|
|
1364
|
+
A === W && P.itemHighlighted,
|
|
1365
1365
|
o?.item
|
|
1366
1366
|
),
|
|
1367
|
-
disabled:
|
|
1368
|
-
onClick: () =>
|
|
1369
|
-
onMouseEnter: () =>
|
|
1370
|
-
children:
|
|
1367
|
+
disabled: v.disabled,
|
|
1368
|
+
onClick: () => X(v.value),
|
|
1369
|
+
onMouseEnter: () => D(A),
|
|
1370
|
+
children: v.content ?? v.label
|
|
1371
1371
|
},
|
|
1372
|
-
|
|
1372
|
+
v.value
|
|
1373
1373
|
)) })
|
|
1374
1374
|
}
|
|
1375
1375
|
);
|
|
1376
|
-
return
|
|
1376
|
+
return p && typeof document < "u" ? pt(y, document.body) : y;
|
|
1377
1377
|
})()
|
|
1378
1378
|
]
|
|
1379
1379
|
}
|
|
@@ -1381,7 +1381,7 @@ const Jt = $e(
|
|
|
1381
1381
|
}
|
|
1382
1382
|
);
|
|
1383
1383
|
Jt.displayName = "SearchableSelect";
|
|
1384
|
-
const en =
|
|
1384
|
+
const en = Ne(
|
|
1385
1385
|
({
|
|
1386
1386
|
inputSize: e = "md",
|
|
1387
1387
|
error: t = !1,
|
|
@@ -1396,96 +1396,97 @@ const en = $e(
|
|
|
1396
1396
|
searchPlaceholder: u,
|
|
1397
1397
|
onValuesChange: d,
|
|
1398
1398
|
clearSearchOnSelect: f = !0,
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1399
|
+
closeOnSelect: p = !0,
|
|
1400
|
+
allowCreate: L = !1,
|
|
1401
|
+
onCreate: b,
|
|
1402
|
+
createLabel: R,
|
|
1403
|
+
portal: w = !0
|
|
1404
|
+
}, Q) => {
|
|
1405
|
+
const W = Array.isArray(l) ? l : l ? [l] : [], [D, Z] = Re(!1), [T, $] = Re(""), [ie, ne] = Re(0), V = oe(null), ue = oe(null), S = oe(null), re = oe(null), F = oe(null), j = Ue(), C = Tt(F, D && w), X = oe(null), se = Q ?? X, me = pe(() => {
|
|
1406
|
+
Z(!1), $(""), ne(0);
|
|
1407
|
+
}, []), K = pe(() => {
|
|
1408
|
+
a || (Z(!0), $(""), ne(0), setTimeout(() => ue.current?.focus(), 0));
|
|
1409
|
+
}, [a]), H = pe(
|
|
1410
|
+
(k) => {
|
|
1411
|
+
const G = W.includes(k) ? W.filter((O) => O !== k) : [...W, k];
|
|
1412
|
+
d?.(G), p ? me() : f && $("");
|
|
1412
1413
|
},
|
|
1413
|
-
[
|
|
1414
|
-
),
|
|
1415
|
-
(
|
|
1416
|
-
|
|
1414
|
+
[W, d, p, me, f]
|
|
1415
|
+
), N = pe(
|
|
1416
|
+
(k, G) => {
|
|
1417
|
+
G.stopPropagation(), d?.(W.filter((O) => O !== k));
|
|
1417
1418
|
},
|
|
1418
|
-
[
|
|
1419
|
-
),
|
|
1420
|
-
if (!
|
|
1421
|
-
const
|
|
1422
|
-
return n.filter((
|
|
1423
|
-
}, [n,
|
|
1424
|
-
(
|
|
1425
|
-
) && !
|
|
1426
|
-
|
|
1427
|
-
}, [
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1431
|
-
}, [
|
|
1432
|
-
if (!
|
|
1433
|
-
const
|
|
1434
|
-
if (!
|
|
1435
|
-
|
|
1436
|
-
}, [
|
|
1437
|
-
const
|
|
1438
|
-
(
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1419
|
+
[W, d]
|
|
1420
|
+
), y = ke(() => {
|
|
1421
|
+
if (!T) return n;
|
|
1422
|
+
const k = T.toLowerCase();
|
|
1423
|
+
return n.filter((G) => G.label.toLowerCase().includes(k));
|
|
1424
|
+
}, [n, T]), v = T.trim(), A = L && v.length > 0 && !n.some(
|
|
1425
|
+
(k) => k.label.toLowerCase() === v.toLowerCase() || k.value === v
|
|
1426
|
+
) && !W.includes(v), _ = pe(() => {
|
|
1427
|
+
v && (W.includes(v) || (b?.(v), d?.([...W, v]), p ? me() : f && $("")));
|
|
1428
|
+
}, [v, W, b, d, p, me, f]);
|
|
1429
|
+
Le(() => {
|
|
1430
|
+
const k = y.findIndex((G) => !G.disabled);
|
|
1431
|
+
ne(k >= 0 ? k : 0);
|
|
1432
|
+
}, [y]), Le(() => {
|
|
1433
|
+
if (!D) return;
|
|
1434
|
+
const k = re.current;
|
|
1435
|
+
if (!k) return;
|
|
1436
|
+
k.querySelectorAll('[role="option"]')[ie]?.scrollIntoView?.({ block: "nearest" });
|
|
1437
|
+
}, [ie, D]);
|
|
1438
|
+
const q = y.length, Y = pe(
|
|
1439
|
+
(k) => {
|
|
1440
|
+
const G = y.map((O, de) => O.disabled ? -1 : de).filter((O) => O >= 0);
|
|
1441
|
+
if (A && G.push(q), k.key === "Backspace" && T === "" && W.length > 0) {
|
|
1442
|
+
k.preventDefault(), d?.(W.slice(0, -1));
|
|
1442
1443
|
return;
|
|
1443
1444
|
}
|
|
1444
|
-
if (
|
|
1445
|
-
if (
|
|
1446
|
-
if (
|
|
1447
|
-
|
|
1445
|
+
if (G.length !== 0)
|
|
1446
|
+
if (k.key === "ArrowDown") {
|
|
1447
|
+
if (k.preventDefault(), !D) {
|
|
1448
|
+
K();
|
|
1448
1449
|
return;
|
|
1449
1450
|
}
|
|
1450
|
-
|
|
1451
|
-
const de =
|
|
1452
|
-
return de <
|
|
1451
|
+
ne((O) => {
|
|
1452
|
+
const de = G.indexOf(O);
|
|
1453
|
+
return de < G.length - 1 ? G[de + 1] : G[0];
|
|
1453
1454
|
});
|
|
1454
|
-
} else if (
|
|
1455
|
-
|
|
1456
|
-
const de =
|
|
1457
|
-
return de > 0 ?
|
|
1455
|
+
} else if (k.key === "ArrowUp")
|
|
1456
|
+
k.preventDefault(), ne((O) => {
|
|
1457
|
+
const de = G.indexOf(O);
|
|
1458
|
+
return de > 0 ? G[de - 1] : G[G.length - 1];
|
|
1458
1459
|
});
|
|
1459
|
-
else if (
|
|
1460
|
-
if (
|
|
1461
|
-
|
|
1460
|
+
else if (k.key === "Enter") {
|
|
1461
|
+
if (k.preventDefault(), A && ie === q) {
|
|
1462
|
+
_();
|
|
1462
1463
|
return;
|
|
1463
1464
|
}
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
} else
|
|
1465
|
+
const O = y[ie];
|
|
1466
|
+
O && !O.disabled ? H(O.value) : A && _();
|
|
1467
|
+
} else k.key === "Escape" && (k.preventDefault(), me());
|
|
1467
1468
|
},
|
|
1468
|
-
[
|
|
1469
|
+
[y, ie, H, me, T, W, d, D, K, A, _, q]
|
|
1469
1470
|
);
|
|
1470
|
-
|
|
1471
|
-
if (!
|
|
1472
|
-
const
|
|
1473
|
-
const
|
|
1474
|
-
|
|
1471
|
+
Le(() => {
|
|
1472
|
+
if (!D) return;
|
|
1473
|
+
const k = (G) => {
|
|
1474
|
+
const O = G.target;
|
|
1475
|
+
V.current?.contains(O) || S.current?.contains(O) || me();
|
|
1475
1476
|
};
|
|
1476
|
-
return document.addEventListener("mousedown",
|
|
1477
|
-
}, [
|
|
1478
|
-
const
|
|
1477
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
1478
|
+
}, [D, me]);
|
|
1479
|
+
const J = W.map((k) => n.find((O) => O.value === k) ?? { value: k, label: k });
|
|
1479
1480
|
return /* @__PURE__ */ z(
|
|
1480
1481
|
"div",
|
|
1481
1482
|
{
|
|
1482
|
-
ref:
|
|
1483
|
+
ref: V,
|
|
1483
1484
|
className: m(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
t &&
|
|
1488
|
-
a &&
|
|
1485
|
+
P.wrapper,
|
|
1486
|
+
P.searchableWrapper,
|
|
1487
|
+
P[e],
|
|
1488
|
+
t && P.error,
|
|
1489
|
+
a && P.disabled,
|
|
1489
1490
|
o?.wrapper,
|
|
1490
1491
|
c
|
|
1491
1492
|
),
|
|
@@ -1494,135 +1495,135 @@ const en = $e(
|
|
|
1494
1495
|
/* @__PURE__ */ s(
|
|
1495
1496
|
"select",
|
|
1496
1497
|
{
|
|
1497
|
-
ref:
|
|
1498
|
-
className:
|
|
1498
|
+
ref: se,
|
|
1499
|
+
className: P.hiddenSelect,
|
|
1499
1500
|
multiple: !0,
|
|
1500
|
-
value:
|
|
1501
|
+
value: W,
|
|
1501
1502
|
disabled: a,
|
|
1502
1503
|
tabIndex: -1,
|
|
1503
1504
|
"aria-hidden": "true",
|
|
1504
1505
|
onChange: () => {
|
|
1505
1506
|
},
|
|
1506
|
-
children: n.map((
|
|
1507
|
+
children: n.map((k) => /* @__PURE__ */ s("option", { value: k.value, children: k.label }, k.value))
|
|
1507
1508
|
}
|
|
1508
1509
|
),
|
|
1509
1510
|
/* @__PURE__ */ z(
|
|
1510
1511
|
"div",
|
|
1511
1512
|
{
|
|
1512
|
-
ref:
|
|
1513
|
+
ref: F,
|
|
1513
1514
|
className: m(
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
t &&
|
|
1518
|
-
a &&
|
|
1515
|
+
P.multiTrigger,
|
|
1516
|
+
P[e],
|
|
1517
|
+
D && P.triggerOpen,
|
|
1518
|
+
t && P.error,
|
|
1519
|
+
a && P.multiTriggerDisabled,
|
|
1519
1520
|
o?.root
|
|
1520
1521
|
),
|
|
1521
1522
|
onClick: () => {
|
|
1522
|
-
|
|
1523
|
+
D ? ue.current?.focus() : K();
|
|
1523
1524
|
},
|
|
1524
1525
|
role: "combobox",
|
|
1525
|
-
"aria-expanded":
|
|
1526
|
+
"aria-expanded": D,
|
|
1526
1527
|
"aria-haspopup": "listbox",
|
|
1527
|
-
"aria-controls":
|
|
1528
|
+
"aria-controls": D ? j : void 0,
|
|
1528
1529
|
children: [
|
|
1529
|
-
|
|
1530
|
-
/* @__PURE__ */ s("span", { className:
|
|
1530
|
+
J.map((k) => /* @__PURE__ */ z("span", { className: m(P.chip, o?.chip), children: [
|
|
1531
|
+
/* @__PURE__ */ s("span", { className: P.chipLabel, children: k.content ?? k.label }),
|
|
1531
1532
|
/* @__PURE__ */ s(
|
|
1532
1533
|
"button",
|
|
1533
1534
|
{
|
|
1534
1535
|
type: "button",
|
|
1535
|
-
className: m(
|
|
1536
|
-
onClick: (
|
|
1537
|
-
"aria-label": `Remove ${
|
|
1536
|
+
className: m(P.chipRemove, o?.chipRemove),
|
|
1537
|
+
onClick: (G) => N(k.value, G),
|
|
1538
|
+
"aria-label": `Remove ${k.label}`,
|
|
1538
1539
|
tabIndex: -1,
|
|
1539
1540
|
children: "×"
|
|
1540
1541
|
}
|
|
1541
1542
|
)
|
|
1542
|
-
] },
|
|
1543
|
+
] }, k.value)),
|
|
1543
1544
|
/* @__PURE__ */ s(
|
|
1544
1545
|
"input",
|
|
1545
1546
|
{
|
|
1546
|
-
ref:
|
|
1547
|
+
ref: ue,
|
|
1547
1548
|
id: h,
|
|
1548
1549
|
type: "text",
|
|
1549
|
-
className:
|
|
1550
|
-
placeholder:
|
|
1551
|
-
value:
|
|
1552
|
-
onChange: (
|
|
1553
|
-
|
|
1550
|
+
className: P.multiSearch,
|
|
1551
|
+
placeholder: W.length === 0 ? r : "",
|
|
1552
|
+
value: T,
|
|
1553
|
+
onChange: (k) => {
|
|
1554
|
+
$(k.target.value), D || K();
|
|
1554
1555
|
},
|
|
1555
|
-
onKeyDown:
|
|
1556
|
+
onKeyDown: Y,
|
|
1556
1557
|
disabled: a,
|
|
1557
1558
|
"aria-label": "Search options"
|
|
1558
1559
|
}
|
|
1559
1560
|
),
|
|
1560
|
-
/* @__PURE__ */ s("span", { className: m(
|
|
1561
|
+
/* @__PURE__ */ s("span", { className: m(P.arrow, P.arrowMulti, o?.arrow) })
|
|
1561
1562
|
]
|
|
1562
1563
|
}
|
|
1563
1564
|
),
|
|
1564
|
-
|
|
1565
|
-
const
|
|
1565
|
+
D && (() => {
|
|
1566
|
+
const k = w ? {
|
|
1566
1567
|
position: "fixed",
|
|
1567
|
-
top:
|
|
1568
|
-
left:
|
|
1568
|
+
top: C.top + 4,
|
|
1569
|
+
left: C.left,
|
|
1569
1570
|
right: "auto",
|
|
1570
|
-
width:
|
|
1571
|
+
width: C.width,
|
|
1571
1572
|
zIndex: "var(--crk-z-floating)"
|
|
1572
|
-
} : void 0,
|
|
1573
|
+
} : void 0, G = /* @__PURE__ */ s(
|
|
1573
1574
|
"div",
|
|
1574
1575
|
{
|
|
1575
|
-
id:
|
|
1576
|
-
ref:
|
|
1577
|
-
className: m(
|
|
1578
|
-
style:
|
|
1576
|
+
id: j,
|
|
1577
|
+
ref: S,
|
|
1578
|
+
className: m(P.menu, o?.menu),
|
|
1579
|
+
style: k,
|
|
1579
1580
|
role: "listbox",
|
|
1580
1581
|
"aria-multiselectable": "true",
|
|
1581
|
-
children: /* @__PURE__ */ z("div", { className:
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1582
|
+
children: /* @__PURE__ */ z("div", { className: P.menuItems, ref: re, children: [
|
|
1583
|
+
y.length === 0 && !A && /* @__PURE__ */ s("div", { className: P.noResults, children: "No results" }),
|
|
1584
|
+
y.map((O, de) => {
|
|
1585
|
+
const ge = W.includes(O.value);
|
|
1585
1586
|
return /* @__PURE__ */ z(
|
|
1586
1587
|
"button",
|
|
1587
1588
|
{
|
|
1588
|
-
id: `select-option-${
|
|
1589
|
+
id: `select-option-${O.value}`,
|
|
1589
1590
|
type: "button",
|
|
1590
1591
|
role: "option",
|
|
1591
|
-
"aria-selected":
|
|
1592
|
+
"aria-selected": ge,
|
|
1592
1593
|
className: m(
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
de ===
|
|
1594
|
+
P.item,
|
|
1595
|
+
O.disabled && P.itemDisabled,
|
|
1596
|
+
ge && P.itemSelected,
|
|
1597
|
+
de === ie && P.itemHighlighted,
|
|
1597
1598
|
o?.item
|
|
1598
1599
|
),
|
|
1599
|
-
disabled:
|
|
1600
|
-
onClick: () =>
|
|
1601
|
-
onMouseEnter: () =>
|
|
1600
|
+
disabled: O.disabled,
|
|
1601
|
+
onClick: () => H(O.value),
|
|
1602
|
+
onMouseEnter: () => ne(de),
|
|
1602
1603
|
children: [
|
|
1603
|
-
|
|
1604
|
-
|
|
1604
|
+
ge && /* @__PURE__ */ s("span", { className: P.itemCheck, "aria-hidden": "true" }),
|
|
1605
|
+
O.content ?? O.label
|
|
1605
1606
|
]
|
|
1606
1607
|
},
|
|
1607
|
-
|
|
1608
|
+
O.value
|
|
1608
1609
|
);
|
|
1609
1610
|
}),
|
|
1610
|
-
|
|
1611
|
+
A && /* @__PURE__ */ s(
|
|
1611
1612
|
"button",
|
|
1612
1613
|
{
|
|
1613
1614
|
type: "button",
|
|
1614
1615
|
role: "option",
|
|
1615
1616
|
"aria-selected": !1,
|
|
1616
1617
|
className: m(
|
|
1617
|
-
|
|
1618
|
-
|
|
1618
|
+
P.item,
|
|
1619
|
+
ie === q && P.itemHighlighted,
|
|
1619
1620
|
o?.item
|
|
1620
1621
|
),
|
|
1621
|
-
onClick:
|
|
1622
|
-
onMouseEnter: () =>
|
|
1623
|
-
children:
|
|
1622
|
+
onClick: _,
|
|
1623
|
+
onMouseEnter: () => ne(q),
|
|
1624
|
+
children: R ? R(v) : /* @__PURE__ */ z(ze, { children: [
|
|
1624
1625
|
"Create “",
|
|
1625
|
-
/* @__PURE__ */ s("strong", { children:
|
|
1626
|
+
/* @__PURE__ */ s("strong", { children: v }),
|
|
1626
1627
|
"”"
|
|
1627
1628
|
] })
|
|
1628
1629
|
},
|
|
@@ -1631,7 +1632,7 @@ const en = $e(
|
|
|
1631
1632
|
] })
|
|
1632
1633
|
}
|
|
1633
1634
|
);
|
|
1634
|
-
return
|
|
1635
|
+
return w && typeof document < "u" ? pt(G, document.body) : G;
|
|
1635
1636
|
})()
|
|
1636
1637
|
]
|
|
1637
1638
|
}
|
|
@@ -1639,7 +1640,7 @@ const en = $e(
|
|
|
1639
1640
|
}
|
|
1640
1641
|
);
|
|
1641
1642
|
en.displayName = "MultiSelect";
|
|
1642
|
-
const Pi =
|
|
1643
|
+
const Pi = Ne(
|
|
1643
1644
|
(e, t) => e.multiple ? /* @__PURE__ */ s(en, { ref: t, ...e }) : e.searchable ? /* @__PURE__ */ s(Jt, { ref: t, ...e }) : /* @__PURE__ */ s(Qt, { ref: t, ...e })
|
|
1644
1645
|
);
|
|
1645
1646
|
Pi.displayName = "Select";
|
|
@@ -1648,7 +1649,7 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1648
1649
|
input: Hi,
|
|
1649
1650
|
label: Oi,
|
|
1650
1651
|
indeterminate: Fi
|
|
1651
|
-
},
|
|
1652
|
+
}, Xi = Ne(
|
|
1652
1653
|
({
|
|
1653
1654
|
label: e,
|
|
1654
1655
|
indeterminate: t = !1,
|
|
@@ -1657,8 +1658,8 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1657
1658
|
style: o,
|
|
1658
1659
|
...c
|
|
1659
1660
|
}, i) => {
|
|
1660
|
-
const l =
|
|
1661
|
-
return
|
|
1661
|
+
const l = oe(null);
|
|
1662
|
+
return Le(() => {
|
|
1662
1663
|
l.current && (l.current.indeterminate = t);
|
|
1663
1664
|
}, [t]), /* @__PURE__ */ z(
|
|
1664
1665
|
"label",
|
|
@@ -1683,13 +1684,13 @@ const Wi = "crk-root-61cKD", Hi = "crk-input-bAjPU", Oi = "crk-label-W9IeS", Fi
|
|
|
1683
1684
|
);
|
|
1684
1685
|
}
|
|
1685
1686
|
);
|
|
1686
|
-
|
|
1687
|
-
const
|
|
1688
|
-
group:
|
|
1689
|
-
root:
|
|
1687
|
+
Xi.displayName = "Checkbox";
|
|
1688
|
+
const zi = "crk-group-NNwCD", ji = "crk-root-7fGik", _i = "crk-input-43PQW", Yi = "crk-label-aW30x", ht = {
|
|
1689
|
+
group: zi,
|
|
1690
|
+
root: ji,
|
|
1690
1691
|
input: _i,
|
|
1691
|
-
label:
|
|
1692
|
-
}, tn = _t(null),
|
|
1692
|
+
label: Yi
|
|
1693
|
+
}, tn = _t(null), Ui = ({
|
|
1693
1694
|
name: e,
|
|
1694
1695
|
value: t,
|
|
1695
1696
|
onChange: n,
|
|
@@ -1714,8 +1715,8 @@ const ji = "crk-group-NNwCD", Xi = "crk-root-7fGik", _i = "crk-input-43PQW", Ui
|
|
|
1714
1715
|
children: c
|
|
1715
1716
|
}
|
|
1716
1717
|
) });
|
|
1717
|
-
|
|
1718
|
-
const Vi =
|
|
1718
|
+
Ui.displayName = "RadioGroup";
|
|
1719
|
+
const Vi = Ne(
|
|
1719
1720
|
({
|
|
1720
1721
|
label: e,
|
|
1721
1722
|
value: t,
|
|
@@ -1727,7 +1728,7 @@ const Vi = $e(
|
|
|
1727
1728
|
name: l,
|
|
1728
1729
|
...a
|
|
1729
1730
|
}, h) => {
|
|
1730
|
-
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i,
|
|
1731
|
+
const u = ft(tn), d = u?.name ?? l, f = u ? u.value === t : i, p = (L) => {
|
|
1731
1732
|
u?.onChange?.(t), c?.(L);
|
|
1732
1733
|
};
|
|
1733
1734
|
return /* @__PURE__ */ z("label", { className: m(ht.root, n?.root, r), style: o, children: [
|
|
@@ -1740,7 +1741,7 @@ const Vi = $e(
|
|
|
1740
1741
|
name: d,
|
|
1741
1742
|
value: t,
|
|
1742
1743
|
checked: f,
|
|
1743
|
-
onChange:
|
|
1744
|
+
onChange: p,
|
|
1744
1745
|
...a
|
|
1745
1746
|
}
|
|
1746
1747
|
),
|
|
@@ -1765,7 +1766,7 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1765
1766
|
vertical: "resizeVertical",
|
|
1766
1767
|
horizontal: "resizeHorizontal",
|
|
1767
1768
|
both: "resizeBoth"
|
|
1768
|
-
}, ic =
|
|
1769
|
+
}, ic = Ne(
|
|
1769
1770
|
({
|
|
1770
1771
|
inputSize: e = "md",
|
|
1771
1772
|
error: t = !1,
|
|
@@ -1776,24 +1777,24 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1776
1777
|
onChange: i,
|
|
1777
1778
|
...l
|
|
1778
1779
|
}, a) => {
|
|
1779
|
-
const h =
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1780
|
+
const h = oe(null), u = pe(() => {
|
|
1781
|
+
const p = h.current;
|
|
1782
|
+
p && (p.style.height = "auto", p.style.height = `${p.scrollHeight}px`);
|
|
1782
1783
|
}, []), d = l.value ?? "";
|
|
1783
|
-
|
|
1784
|
+
Le(() => {
|
|
1784
1785
|
r && u();
|
|
1785
1786
|
}, [r, u, d]);
|
|
1786
|
-
const f =
|
|
1787
|
-
(
|
|
1788
|
-
r && u(), i?.(
|
|
1787
|
+
const f = pe(
|
|
1788
|
+
(p) => {
|
|
1789
|
+
r && u(), i?.(p);
|
|
1789
1790
|
},
|
|
1790
1791
|
[r, u, i]
|
|
1791
1792
|
);
|
|
1792
1793
|
return /* @__PURE__ */ s(
|
|
1793
1794
|
"textarea",
|
|
1794
1795
|
{
|
|
1795
|
-
ref: (
|
|
1796
|
-
h.current =
|
|
1796
|
+
ref: (p) => {
|
|
1797
|
+
h.current = p, typeof a == "function" ? a(p) : a && (a.current = p);
|
|
1797
1798
|
},
|
|
1798
1799
|
className: m(
|
|
1799
1800
|
Ke.root,
|
|
@@ -1812,8 +1813,8 @@ const qi = "crk-root-IGgdn", Gi = "crk-sm-N-5I2", Zi = "crk-md-bbyFl", Ki = "crk
|
|
|
1812
1813
|
);
|
|
1813
1814
|
ic.displayName = "Textarea";
|
|
1814
1815
|
function cc(e, t = { width: 600, height: 300 }) {
|
|
1815
|
-
const [n, r] =
|
|
1816
|
-
return
|
|
1816
|
+
const [n, r] = Re(t), o = oe(t);
|
|
1817
|
+
return Le(() => {
|
|
1817
1818
|
const c = e.current;
|
|
1818
1819
|
if (!c || typeof ResizeObserver > "u") return;
|
|
1819
1820
|
const i = (h, u) => {
|
|
@@ -1830,7 +1831,7 @@ function cc(e, t = { width: 600, height: 300 }) {
|
|
|
1830
1831
|
return a.observe(c), () => a.disconnect();
|
|
1831
1832
|
}, [e]), n;
|
|
1832
1833
|
}
|
|
1833
|
-
const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc = "crk-gridLine-K2Gx9", uc = "crk-axis-Zum8-", hc = "crk-axisLabel-Ilv3u", mc = "crk-cursorLine-iNHim", fc = "crk-linePath-E4eYA", pc = "crk-areaPath-ZwMc6", gc = "crk-point-DTAoa", yc = "crk-bar-9sYbq", vc = "crk-barLabelInside-dlQh5", bc = "crk-activeBar-FJhPJ", xc = "crk-interactionLayer-dHNAG", kc = "crk-legend-JL6YI", Mc = "crk-legendItem-rcdvO", wc = "crk-legendSwatch-eJBsF", $c = "crk-legendIcon-6gzcO", Nc = "crk-legendLabel-C-eu3", Lc = "crk-tooltip-m55-N",
|
|
1834
|
+
const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc = "crk-gridLine-K2Gx9", uc = "crk-axis-Zum8-", hc = "crk-axisLabel-Ilv3u", mc = "crk-cursorLine-iNHim", fc = "crk-linePath-E4eYA", pc = "crk-areaPath-ZwMc6", gc = "crk-point-DTAoa", yc = "crk-bar-9sYbq", vc = "crk-barLabelInside-dlQh5", bc = "crk-activeBar-FJhPJ", xc = "crk-interactionLayer-dHNAG", kc = "crk-legend-JL6YI", Mc = "crk-legendItem-rcdvO", wc = "crk-legendSwatch-eJBsF", $c = "crk-legendIcon-6gzcO", Nc = "crk-legendLabel-C-eu3", Lc = "crk-tooltip-m55-N", Rc = "crk-tooltipTitle-0EfoX", Sc = "crk-tooltipRows-MC0wM", Tc = "crk-tooltipRow-ZQomr", Cc = "crk-tooltipLabel-s4OKX", Ac = "crk-tooltipValue-iwj1s", Bc = "crk-empty-aa4vk", Ic = "crk-sparkline-3-eRc", Dc = "crk-tradingHeader-Pb9wS", M = {
|
|
1834
1835
|
root: lc,
|
|
1835
1836
|
canvas: sc,
|
|
1836
1837
|
svg: ac,
|
|
@@ -1851,31 +1852,31 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1851
1852
|
legendIcon: $c,
|
|
1852
1853
|
legendLabel: Nc,
|
|
1853
1854
|
tooltip: Lc,
|
|
1854
|
-
tooltipTitle:
|
|
1855
|
-
tooltipRows:
|
|
1855
|
+
tooltipTitle: Rc,
|
|
1856
|
+
tooltipRows: Sc,
|
|
1856
1857
|
tooltipRow: Tc,
|
|
1857
1858
|
tooltipLabel: Cc,
|
|
1858
1859
|
tooltipValue: Ac,
|
|
1859
1860
|
empty: Bc,
|
|
1860
1861
|
sparkline: Ic,
|
|
1861
1862
|
tradingHeader: Dc
|
|
1862
|
-
}, Ve =
|
|
1863
|
+
}, Ve = Ne(
|
|
1863
1864
|
({ aspectRatio: e = 16 / 9, height: t, className: n, style: r, classes: o, legend: c, overlay: i, children: l }, a) => {
|
|
1864
|
-
const h =
|
|
1865
|
+
const h = oe(null);
|
|
1865
1866
|
un(a, () => h.current);
|
|
1866
1867
|
const { width: u } = cc(h), d = Math.max(0, u), f = t ?? Math.round(d / e);
|
|
1867
1868
|
return /* @__PURE__ */ z(
|
|
1868
1869
|
"div",
|
|
1869
1870
|
{
|
|
1870
1871
|
ref: h,
|
|
1871
|
-
className: m(
|
|
1872
|
+
className: m(M.root, o?.root, n),
|
|
1872
1873
|
style: r,
|
|
1873
1874
|
children: [
|
|
1874
|
-
/* @__PURE__ */ z("div", { className:
|
|
1875
|
+
/* @__PURE__ */ z("div", { className: M.canvas, style: { height: f || void 0 }, children: [
|
|
1875
1876
|
d > 0 && f > 0 && /* @__PURE__ */ s(
|
|
1876
1877
|
"svg",
|
|
1877
1878
|
{
|
|
1878
|
-
className: m(
|
|
1879
|
+
className: m(M.svg, o?.svg),
|
|
1879
1880
|
width: d,
|
|
1880
1881
|
height: f,
|
|
1881
1882
|
viewBox: `0 0 ${d} ${f}`,
|
|
@@ -1894,13 +1895,13 @@ const lc = "crk-root-uMSq0", sc = "crk-canvas-zhFr0", ac = "crk-svg-waPLB", dc =
|
|
|
1894
1895
|
Ve.displayName = "ChartContainer";
|
|
1895
1896
|
function vt({ config: e, order: t, classes: n }) {
|
|
1896
1897
|
const r = t ?? Object.keys(e);
|
|
1897
|
-
return /* @__PURE__ */ s("div", { className: m(
|
|
1898
|
+
return /* @__PURE__ */ s("div", { className: m(M.legend, n?.legend), role: "list", children: r.map((o) => {
|
|
1898
1899
|
const c = e[o];
|
|
1899
|
-
return c ? /* @__PURE__ */ z("div", { className: m(
|
|
1900
|
+
return c ? /* @__PURE__ */ z("div", { className: m(M.legendItem, n?.legendItem), role: "listitem", children: [
|
|
1900
1901
|
c.icon ? /* @__PURE__ */ s(
|
|
1901
1902
|
"span",
|
|
1902
1903
|
{
|
|
1903
|
-
className:
|
|
1904
|
+
className: M.legendIcon,
|
|
1904
1905
|
style: { color: c.color },
|
|
1905
1906
|
"aria-hidden": "true",
|
|
1906
1907
|
children: c.icon
|
|
@@ -1908,12 +1909,12 @@ function vt({ config: e, order: t, classes: n }) {
|
|
|
1908
1909
|
) : /* @__PURE__ */ s(
|
|
1909
1910
|
"span",
|
|
1910
1911
|
{
|
|
1911
|
-
className:
|
|
1912
|
+
className: M.legendSwatch,
|
|
1912
1913
|
style: { background: c.color },
|
|
1913
1914
|
"aria-hidden": "true"
|
|
1914
1915
|
}
|
|
1915
1916
|
),
|
|
1916
|
-
/* @__PURE__ */ s("span", { className:
|
|
1917
|
+
/* @__PURE__ */ s("span", { className: M.legendLabel, children: c.label })
|
|
1917
1918
|
] }, o) : null;
|
|
1918
1919
|
}) });
|
|
1919
1920
|
}
|
|
@@ -1930,23 +1931,23 @@ function et({
|
|
|
1930
1931
|
classes: h
|
|
1931
1932
|
}) {
|
|
1932
1933
|
if (!e) return null;
|
|
1933
|
-
const u = 180, f = t + u + 16 > r ? t - u - 12 : t + 12,
|
|
1934
|
+
const u = 180, f = t + u + 16 > r ? t - u - 12 : t + 12, p = Math.max(8, n - 16);
|
|
1934
1935
|
return /* @__PURE__ */ s(
|
|
1935
1936
|
"div",
|
|
1936
1937
|
{
|
|
1937
|
-
className: m(
|
|
1938
|
-
style: { left: f, top:
|
|
1938
|
+
className: m(M.tooltip, h?.tooltip),
|
|
1939
|
+
style: { left: f, top: p, width: u },
|
|
1939
1940
|
role: "tooltip",
|
|
1940
|
-
children: c ? c(e) : /* @__PURE__ */ z(
|
|
1941
|
-
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className:
|
|
1942
|
-
/* @__PURE__ */ s("div", { className:
|
|
1943
|
-
const
|
|
1944
|
-
if (
|
|
1945
|
-
const
|
|
1946
|
-
return /* @__PURE__ */ z("div", { className:
|
|
1947
|
-
/* @__PURE__ */ s("span", { className:
|
|
1948
|
-
/* @__PURE__ */ s("span", { className:
|
|
1949
|
-
/* @__PURE__ */ s("span", { className:
|
|
1941
|
+
children: c ? c(e) : /* @__PURE__ */ z(ze, { children: [
|
|
1942
|
+
l && e[l] !== void 0 && /* @__PURE__ */ s("div", { className: M.tooltipTitle, children: String(e[l]) }),
|
|
1943
|
+
/* @__PURE__ */ s("div", { className: M.tooltipRows, children: Object.entries(o).map(([L, b]) => {
|
|
1944
|
+
const R = e[L];
|
|
1945
|
+
if (R == null) return null;
|
|
1946
|
+
const w = typeof R == "number" ? i(R) : String(R), Q = a?.(L) ?? b.color;
|
|
1947
|
+
return /* @__PURE__ */ z("div", { className: M.tooltipRow, children: [
|
|
1948
|
+
/* @__PURE__ */ s("span", { className: M.legendSwatch, style: { background: Q }, "aria-hidden": "true" }),
|
|
1949
|
+
/* @__PURE__ */ s("span", { className: M.tooltipLabel, children: b.label }),
|
|
1950
|
+
/* @__PURE__ */ s("span", { className: M.tooltipValue, children: w })
|
|
1950
1951
|
] }, L);
|
|
1951
1952
|
}) })
|
|
1952
1953
|
] })
|
|
@@ -1954,11 +1955,11 @@ function et({
|
|
|
1954
1955
|
);
|
|
1955
1956
|
}
|
|
1956
1957
|
function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes: c }) {
|
|
1957
|
-
return /* @__PURE__ */ s("g", { className: m(
|
|
1958
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, c?.axis), children: e.map(({ value: i, y: l }) => /* @__PURE__ */ z("g", { children: [
|
|
1958
1959
|
o && /* @__PURE__ */ s(
|
|
1959
1960
|
"line",
|
|
1960
1961
|
{
|
|
1961
|
-
className: m(
|
|
1962
|
+
className: m(M.gridLine, c?.grid),
|
|
1962
1963
|
x1: t,
|
|
1963
1964
|
x2: t + n,
|
|
1964
1965
|
y1: l,
|
|
@@ -1968,7 +1969,7 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1968
1969
|
/* @__PURE__ */ s(
|
|
1969
1970
|
"text",
|
|
1970
1971
|
{
|
|
1971
|
-
className: m(
|
|
1972
|
+
className: m(M.axisLabel, c?.axisLabel),
|
|
1972
1973
|
x: t - 8,
|
|
1973
1974
|
y: l,
|
|
1974
1975
|
textAnchor: "end",
|
|
@@ -1979,10 +1980,10 @@ function nn({ ticks: e, x: t, plotWidth: n, format: r, showGrid: o = !0, classes
|
|
|
1979
1980
|
] }, `y-${i}`)) });
|
|
1980
1981
|
}
|
|
1981
1982
|
function rn({ ticks: e, y: t, format: n, classes: r }) {
|
|
1982
|
-
return /* @__PURE__ */ s("g", { className: m(
|
|
1983
|
+
return /* @__PURE__ */ s("g", { className: m(M.axis, r?.axis), children: e.map(({ label: o, x: c }) => /* @__PURE__ */ s(
|
|
1983
1984
|
"text",
|
|
1984
1985
|
{
|
|
1985
|
-
className: m(
|
|
1986
|
+
className: m(M.axisLabel, r?.axisLabel),
|
|
1986
1987
|
x: c,
|
|
1987
1988
|
y: t + 16,
|
|
1988
1989
|
textAnchor: "middle",
|
|
@@ -2004,7 +2005,7 @@ function Je(e, t) {
|
|
|
2004
2005
|
const [n, r] = e, [o, c] = t, i = r - n || 1, l = c - o, a = (h) => o + (h - n) / i * l;
|
|
2005
2006
|
return a.invert = (h) => n + (h - o) / l * i, a;
|
|
2006
2007
|
}
|
|
2007
|
-
function
|
|
2008
|
+
function je(e, t, n = 0.2) {
|
|
2008
2009
|
const [r, o] = t, i = (o - r) / Math.max(1, e.length), l = i * (1 - n), a = /* @__PURE__ */ new Map();
|
|
2009
2010
|
for (let u = 0; u < e.length; u++) a.set(e[u], u);
|
|
2010
2011
|
const h = (u) => {
|
|
@@ -2062,179 +2063,179 @@ function Ol({
|
|
|
2062
2063
|
valuePosition: u = "top",
|
|
2063
2064
|
renderLabel: d,
|
|
2064
2065
|
activeIndex: f,
|
|
2065
|
-
onPointClick:
|
|
2066
|
+
onPointClick: p,
|
|
2066
2067
|
showGrid: L = !0,
|
|
2067
|
-
showLegend:
|
|
2068
|
-
showTooltip:
|
|
2069
|
-
yTickCount:
|
|
2070
|
-
yFormat:
|
|
2071
|
-
xFormat:
|
|
2072
|
-
valueFormat:
|
|
2073
|
-
renderTooltip:
|
|
2074
|
-
margin:
|
|
2068
|
+
showLegend: b = !0,
|
|
2069
|
+
showTooltip: R = !0,
|
|
2070
|
+
yTickCount: w = 5,
|
|
2071
|
+
yFormat: Q,
|
|
2072
|
+
xFormat: W,
|
|
2073
|
+
valueFormat: D,
|
|
2074
|
+
renderTooltip: Z,
|
|
2075
|
+
margin: T,
|
|
2075
2076
|
emptyMessage: $ = "No data",
|
|
2076
|
-
className:
|
|
2077
|
-
style:
|
|
2078
|
-
classes:
|
|
2077
|
+
className: ie,
|
|
2078
|
+
style: ne,
|
|
2079
|
+
classes: V
|
|
2079
2080
|
}) {
|
|
2080
|
-
const
|
|
2081
|
+
const ue = { ...Ec, ...T }, S = ke(() => Object.keys(n), [n]), [re, F] = Re(null), j = oe(null), C = f ?? re, X = (me, K) => {
|
|
2081
2082
|
if (l) {
|
|
2082
|
-
const
|
|
2083
|
-
if (typeof
|
|
2083
|
+
const H = e[K]?.[l];
|
|
2084
|
+
if (typeof H == "string") return H;
|
|
2084
2085
|
}
|
|
2085
|
-
return n[
|
|
2086
|
+
return n[me]?.color ?? "var(--crk-chart-1)";
|
|
2086
2087
|
};
|
|
2087
2088
|
if (e.length === 0)
|
|
2088
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2089
|
-
const
|
|
2089
|
+
return /* @__PURE__ */ s("div", { ref: j, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2090
|
+
const se = R && C !== null ? /* @__PURE__ */ s(
|
|
2090
2091
|
et,
|
|
2091
2092
|
{
|
|
2092
|
-
row: e[
|
|
2093
|
-
x: Hc(e, t,
|
|
2093
|
+
row: e[C],
|
|
2094
|
+
x: Hc(e, t, ue, C, j),
|
|
2094
2095
|
y: 16,
|
|
2095
|
-
containerWidth:
|
|
2096
|
+
containerWidth: j.current?.getBoundingClientRect().width ?? 0,
|
|
2096
2097
|
config: n,
|
|
2097
|
-
render:
|
|
2098
|
-
valueFormat:
|
|
2098
|
+
render: Z ? () => Z(e[C]) : void 0,
|
|
2099
|
+
valueFormat: D,
|
|
2099
2100
|
titleKey: t,
|
|
2100
|
-
resolveColor: l ? (
|
|
2101
|
-
classes:
|
|
2101
|
+
resolveColor: l ? (me) => X(me, C) : void 0,
|
|
2102
|
+
classes: V
|
|
2102
2103
|
}
|
|
2103
2104
|
) : null;
|
|
2104
2105
|
return /* @__PURE__ */ s(
|
|
2105
2106
|
Ve,
|
|
2106
2107
|
{
|
|
2107
|
-
ref:
|
|
2108
|
+
ref: j,
|
|
2108
2109
|
aspectRatio: r,
|
|
2109
2110
|
height: o,
|
|
2110
|
-
className:
|
|
2111
|
-
style:
|
|
2112
|
-
classes:
|
|
2113
|
-
legend:
|
|
2114
|
-
overlay:
|
|
2115
|
-
children: ({ width:
|
|
2116
|
-
const
|
|
2117
|
-
for (const
|
|
2111
|
+
className: ie,
|
|
2112
|
+
style: ne,
|
|
2113
|
+
classes: V,
|
|
2114
|
+
legend: b ? /* @__PURE__ */ s(vt, { config: n, classes: V }) : void 0,
|
|
2115
|
+
overlay: se,
|
|
2116
|
+
children: ({ width: me, height: K }) => {
|
|
2117
|
+
const H = ue.left, N = me - ue.right, y = ue.top, v = K - ue.bottom, A = Math.max(0, N - H), _ = Math.max(0, v - y), q = e.map((g) => String(g[t])), Y = je(q, [H, N], 0), J = [];
|
|
2118
|
+
for (const g of S)
|
|
2118
2119
|
for (const x of e) {
|
|
2119
|
-
const ee = x[
|
|
2120
|
-
typeof ee == "number" &&
|
|
2120
|
+
const ee = x[g];
|
|
2121
|
+
typeof ee == "number" && J.push(ee);
|
|
2121
2122
|
}
|
|
2122
|
-
const [
|
|
2123
|
-
return /* @__PURE__ */ z(
|
|
2123
|
+
const [k, G] = bt(J), O = Math.min(0, k), de = qe(O, G, w), ge = Je([de[0], de[de.length - 1]], [v, y]), be = de.map((g) => ({ value: g, y: ge(g) })), Se = Wc(q).map((g) => ({ label: g, x: Y(g) }));
|
|
2124
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2124
2125
|
/* @__PURE__ */ s(
|
|
2125
2126
|
nn,
|
|
2126
2127
|
{
|
|
2127
2128
|
ticks: be,
|
|
2128
|
-
x:
|
|
2129
|
-
plotWidth:
|
|
2130
|
-
format:
|
|
2129
|
+
x: H,
|
|
2130
|
+
plotWidth: A,
|
|
2131
|
+
format: Q,
|
|
2131
2132
|
showGrid: L,
|
|
2132
|
-
classes:
|
|
2133
|
+
classes: V
|
|
2133
2134
|
}
|
|
2134
2135
|
),
|
|
2135
|
-
/* @__PURE__ */ s(rn, { ticks: Se, y:
|
|
2136
|
-
|
|
2137
|
-
const x = n[
|
|
2138
|
-
const I =
|
|
2139
|
-
return { x: Y(
|
|
2136
|
+
/* @__PURE__ */ s(rn, { ticks: Se, y: v, format: W, classes: V }),
|
|
2137
|
+
S.map((g) => {
|
|
2138
|
+
const x = n[g], ee = e.map((E, U) => {
|
|
2139
|
+
const I = E[g], fe = typeof I == "number" ? I : 0;
|
|
2140
|
+
return { x: Y(q[U]), y: ge(fe), value: fe, row: E };
|
|
2140
2141
|
});
|
|
2141
|
-
return /* @__PURE__ */ z("g", { className: m(
|
|
2142
|
+
return /* @__PURE__ */ z("g", { className: m(M.series, V?.series), children: [
|
|
2142
2143
|
/* @__PURE__ */ s(
|
|
2143
2144
|
"path",
|
|
2144
2145
|
{
|
|
2145
|
-
className: m(
|
|
2146
|
+
className: m(M.linePath),
|
|
2146
2147
|
d: Pc(ee, c),
|
|
2147
2148
|
stroke: x.color
|
|
2148
2149
|
}
|
|
2149
2150
|
),
|
|
2150
|
-
i && ee.map((
|
|
2151
|
-
const I =
|
|
2151
|
+
i && ee.map((E, U) => {
|
|
2152
|
+
const I = X(g, U), fe = C === U, ce = f !== void 0 && !fe, B = p ? () => p({ row: E.row, value: E.value, seriesKey: g, index: U }) : void 0;
|
|
2152
2153
|
return a ? /* @__PURE__ */ s(
|
|
2153
2154
|
"g",
|
|
2154
2155
|
{
|
|
2155
|
-
onClick:
|
|
2156
|
-
style:
|
|
2157
|
-
opacity:
|
|
2156
|
+
onClick: B,
|
|
2157
|
+
style: B ? { cursor: "pointer" } : void 0,
|
|
2158
|
+
opacity: ce ? 0.45 : 1,
|
|
2158
2159
|
children: a({
|
|
2159
|
-
row:
|
|
2160
|
-
value:
|
|
2161
|
-
seriesKey:
|
|
2162
|
-
index:
|
|
2163
|
-
x:
|
|
2164
|
-
y:
|
|
2160
|
+
row: E.row,
|
|
2161
|
+
value: E.value,
|
|
2162
|
+
seriesKey: g,
|
|
2163
|
+
index: U,
|
|
2164
|
+
x: E.x,
|
|
2165
|
+
y: E.y,
|
|
2165
2166
|
color: I,
|
|
2166
|
-
active:
|
|
2167
|
+
active: fe
|
|
2167
2168
|
})
|
|
2168
2169
|
},
|
|
2169
|
-
`${
|
|
2170
|
+
`${g}-${U}`
|
|
2170
2171
|
) : /* @__PURE__ */ s(
|
|
2171
2172
|
"circle",
|
|
2172
2173
|
{
|
|
2173
|
-
className: m(
|
|
2174
|
-
cx:
|
|
2175
|
-
cy:
|
|
2176
|
-
r:
|
|
2174
|
+
className: m(M.point, V?.point),
|
|
2175
|
+
cx: E.x,
|
|
2176
|
+
cy: E.y,
|
|
2177
|
+
r: fe ? 5 : 3.5,
|
|
2177
2178
|
fill: I,
|
|
2178
|
-
onClick:
|
|
2179
|
-
style:
|
|
2180
|
-
opacity:
|
|
2179
|
+
onClick: B,
|
|
2180
|
+
style: B ? { cursor: "pointer" } : void 0,
|
|
2181
|
+
opacity: ce ? 0.45 : 1
|
|
2181
2182
|
},
|
|
2182
|
-
`${
|
|
2183
|
+
`${g}-${U}`
|
|
2183
2184
|
);
|
|
2184
2185
|
}),
|
|
2185
|
-
(h || d) && ee.map((
|
|
2186
|
-
const I = d ? d({ row:
|
|
2186
|
+
(h || d) && ee.map((E, U) => {
|
|
2187
|
+
const I = d ? d({ row: E.row, value: E.value, seriesKey: g, index: U }) : h ? D ? D(E.value) : String(E.value) : null;
|
|
2187
2188
|
if (I == null) return null;
|
|
2188
|
-
const
|
|
2189
|
+
const fe = 10, ce = u === "top" ? E.y - fe : E.y + fe + 4;
|
|
2189
2190
|
return /* @__PURE__ */ s(
|
|
2190
2191
|
"text",
|
|
2191
2192
|
{
|
|
2192
|
-
className: m(
|
|
2193
|
-
x:
|
|
2194
|
-
y:
|
|
2193
|
+
className: m(M.axisLabel),
|
|
2194
|
+
x: E.x,
|
|
2195
|
+
y: ce,
|
|
2195
2196
|
textAnchor: "middle",
|
|
2196
2197
|
dominantBaseline: u === "top" ? "auto" : "middle",
|
|
2197
2198
|
children: I
|
|
2198
2199
|
},
|
|
2199
|
-
`label-${
|
|
2200
|
+
`label-${g}-${U}`
|
|
2200
2201
|
);
|
|
2201
2202
|
})
|
|
2202
|
-
] },
|
|
2203
|
+
] }, g);
|
|
2203
2204
|
}),
|
|
2204
|
-
|
|
2205
|
+
C !== null && /* @__PURE__ */ s(
|
|
2205
2206
|
"line",
|
|
2206
2207
|
{
|
|
2207
|
-
className:
|
|
2208
|
-
x1: Y(
|
|
2209
|
-
x2: Y(
|
|
2210
|
-
y1:
|
|
2211
|
-
y2:
|
|
2208
|
+
className: M.cursorLine,
|
|
2209
|
+
x1: Y(q[C]),
|
|
2210
|
+
x2: Y(q[C]),
|
|
2211
|
+
y1: y,
|
|
2212
|
+
y2: v
|
|
2212
2213
|
}
|
|
2213
2214
|
),
|
|
2214
2215
|
/* @__PURE__ */ s(
|
|
2215
2216
|
"rect",
|
|
2216
2217
|
{
|
|
2217
|
-
className:
|
|
2218
|
-
x:
|
|
2219
|
-
y
|
|
2220
|
-
width:
|
|
2218
|
+
className: M.interactionLayer,
|
|
2219
|
+
x: H,
|
|
2220
|
+
y,
|
|
2221
|
+
width: A,
|
|
2221
2222
|
height: _,
|
|
2222
|
-
onMouseMove: (
|
|
2223
|
-
const x =
|
|
2223
|
+
onMouseMove: (g) => {
|
|
2224
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left + H, E = Y.step(), U = Math.max(
|
|
2224
2225
|
0,
|
|
2225
|
-
Math.min(e.length - 1, Math.round((ee -
|
|
2226
|
+
Math.min(e.length - 1, Math.round((ee - H - E / 2) / E))
|
|
2226
2227
|
);
|
|
2227
|
-
|
|
2228
|
+
F(U);
|
|
2228
2229
|
},
|
|
2229
|
-
onMouseLeave: () =>
|
|
2230
|
-
onClick:
|
|
2231
|
-
const x =
|
|
2230
|
+
onMouseLeave: () => F(null),
|
|
2231
|
+
onClick: p ? (g) => {
|
|
2232
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left + H, E = Y.step(), U = Math.max(
|
|
2232
2233
|
0,
|
|
2233
|
-
Math.min(e.length - 1, Math.round((ee -
|
|
2234
|
-
), I =
|
|
2235
|
-
|
|
2234
|
+
Math.min(e.length - 1, Math.round((ee - H - E / 2) / E))
|
|
2235
|
+
), I = S[0], fe = e[U][I], ce = typeof fe == "number" ? fe : 0;
|
|
2236
|
+
p({ row: e[U], value: ce, seriesKey: I, index: U });
|
|
2236
2237
|
} : void 0,
|
|
2237
|
-
style:
|
|
2238
|
+
style: p ? { cursor: "pointer" } : void 0
|
|
2238
2239
|
}
|
|
2239
2240
|
)
|
|
2240
2241
|
] });
|
|
@@ -2246,10 +2247,10 @@ function Hc(e, t, n, r, o) {
|
|
|
2246
2247
|
const c = o.current;
|
|
2247
2248
|
if (!c) return 0;
|
|
2248
2249
|
const i = c.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
|
|
2249
|
-
return
|
|
2250
|
+
return je(l, [n.left, i - n.right], 0)(l[r]);
|
|
2250
2251
|
}
|
|
2251
2252
|
const Oc = { top: 12, right: 16, bottom: 28, left: 48 };
|
|
2252
|
-
function
|
|
2253
|
+
function Rt(e, t) {
|
|
2253
2254
|
if (e.length === 0) return "";
|
|
2254
2255
|
if (e.length === 1) return `M ${e[0].x} ${e[0].y}`;
|
|
2255
2256
|
if (t === "linear")
|
|
@@ -2269,12 +2270,12 @@ function St(e, t) {
|
|
|
2269
2270
|
}
|
|
2270
2271
|
function Dt(e, t, n) {
|
|
2271
2272
|
if (e.length === 0) return "";
|
|
2272
|
-
const r =
|
|
2273
|
+
const r = Rt(e, n);
|
|
2273
2274
|
if (typeof t == "number") {
|
|
2274
2275
|
const l = e[e.length - 1], a = e[0];
|
|
2275
2276
|
return `${r} L ${l.x} ${t} L ${a.x} ${t} Z`;
|
|
2276
2277
|
}
|
|
2277
|
-
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), i =
|
|
2278
|
+
const o = e.map((l, a) => ({ x: l.x, y: t[a] })).reverse(), i = Rt(o, n).replace(/^M /, "L ");
|
|
2278
2279
|
return `${r} ${i} Z`;
|
|
2279
2280
|
}
|
|
2280
2281
|
function Fc(e, t = 8) {
|
|
@@ -2296,177 +2297,177 @@ function Fl({
|
|
|
2296
2297
|
showXAxis: u = !0,
|
|
2297
2298
|
showYAxis: d = !0,
|
|
2298
2299
|
showLegend: f = !0,
|
|
2299
|
-
showTooltip:
|
|
2300
|
+
showTooltip: p = !0,
|
|
2300
2301
|
yTickCount: L = 5,
|
|
2301
|
-
yFormat:
|
|
2302
|
-
xFormat:
|
|
2303
|
-
valueFormat:
|
|
2304
|
-
renderTooltip:
|
|
2305
|
-
margin:
|
|
2306
|
-
emptyMessage:
|
|
2307
|
-
className:
|
|
2308
|
-
style:
|
|
2302
|
+
yFormat: b,
|
|
2303
|
+
xFormat: R,
|
|
2304
|
+
valueFormat: w,
|
|
2305
|
+
renderTooltip: Q,
|
|
2306
|
+
margin: W,
|
|
2307
|
+
emptyMessage: D = "No data",
|
|
2308
|
+
className: Z,
|
|
2309
|
+
style: T,
|
|
2309
2310
|
classes: $
|
|
2310
2311
|
}) {
|
|
2311
|
-
const
|
|
2312
|
+
const ie = ke(
|
|
2312
2313
|
() => ({
|
|
2313
2314
|
...Oc,
|
|
2314
2315
|
...d ? {} : { left: 16 },
|
|
2315
|
-
...
|
|
2316
|
+
...W
|
|
2316
2317
|
}),
|
|
2317
|
-
[
|
|
2318
|
-
),
|
|
2318
|
+
[W, d]
|
|
2319
|
+
), ne = ke(() => Object.keys(n), [n]), V = i && ne.length > 0, ue = V && l === "expand", [S, re] = Re(null), F = oe(null), j = Ue();
|
|
2319
2320
|
if (e.length === 0)
|
|
2320
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2321
|
-
const
|
|
2322
|
-
const
|
|
2323
|
-
for (let
|
|
2324
|
-
let
|
|
2325
|
-
if (
|
|
2326
|
-
for (const _ of
|
|
2327
|
-
const
|
|
2328
|
-
typeof
|
|
2321
|
+
return /* @__PURE__ */ s("div", { ref: F, className: m(M.root, $?.root, Z), style: T, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: D }) }) });
|
|
2322
|
+
const C = ke(() => {
|
|
2323
|
+
const H = ne.map(() => []), N = ne.map(() => []);
|
|
2324
|
+
for (let y = 0; y < e.length; y++) {
|
|
2325
|
+
let v = 0;
|
|
2326
|
+
if (ue) {
|
|
2327
|
+
for (const _ of ne) {
|
|
2328
|
+
const q = e[y][_];
|
|
2329
|
+
typeof q == "number" && q > 0 && (v += q);
|
|
2329
2330
|
}
|
|
2330
|
-
|
|
2331
|
+
v === 0 && (v = 1);
|
|
2331
2332
|
}
|
|
2332
|
-
let
|
|
2333
|
-
for (let _ = 0; _ <
|
|
2334
|
-
const
|
|
2335
|
-
if (
|
|
2336
|
-
const
|
|
2337
|
-
|
|
2333
|
+
let A = 0;
|
|
2334
|
+
for (let _ = 0; _ < ne.length; _++) {
|
|
2335
|
+
const q = ne[_], Y = e[y][q], J = typeof Y == "number" ? Y : 0;
|
|
2336
|
+
if (V) {
|
|
2337
|
+
const k = ue ? J / v : J;
|
|
2338
|
+
N[_][y] = A, A += k, H[_][y] = A;
|
|
2338
2339
|
} else
|
|
2339
|
-
|
|
2340
|
+
N[_][y] = 0, H[_][y] = J;
|
|
2340
2341
|
}
|
|
2341
2342
|
}
|
|
2342
|
-
return { tops:
|
|
2343
|
-
}, [e,
|
|
2344
|
-
if (
|
|
2345
|
-
let
|
|
2346
|
-
for (const
|
|
2347
|
-
for (const
|
|
2348
|
-
|
|
2349
|
-
for (const
|
|
2350
|
-
for (const
|
|
2351
|
-
|
|
2352
|
-
return [Math.min(0,
|
|
2353
|
-
}, [
|
|
2343
|
+
return { tops: H, bottoms: N };
|
|
2344
|
+
}, [e, ne, V, ue]), { tops: X, bottoms: se } = C, [me, K] = ke(() => {
|
|
2345
|
+
if (ue) return [0, 1];
|
|
2346
|
+
let H = 0, N = 0;
|
|
2347
|
+
for (const y of X)
|
|
2348
|
+
for (const v of y)
|
|
2349
|
+
v < H && (H = v), v > N && (N = v);
|
|
2350
|
+
for (const y of se)
|
|
2351
|
+
for (const v of y)
|
|
2352
|
+
v < H && (H = v);
|
|
2353
|
+
return [Math.min(0, H), N];
|
|
2354
|
+
}, [X, se, ue]);
|
|
2354
2355
|
return /* @__PURE__ */ s(
|
|
2355
2356
|
Ve,
|
|
2356
2357
|
{
|
|
2357
|
-
ref:
|
|
2358
|
+
ref: F,
|
|
2358
2359
|
aspectRatio: r,
|
|
2359
2360
|
height: o,
|
|
2360
|
-
className:
|
|
2361
|
-
style:
|
|
2361
|
+
className: Z,
|
|
2362
|
+
style: T,
|
|
2362
2363
|
classes: $,
|
|
2363
2364
|
legend: f ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
2364
|
-
overlay:
|
|
2365
|
+
overlay: p && S !== null ? /* @__PURE__ */ s(
|
|
2365
2366
|
et,
|
|
2366
2367
|
{
|
|
2367
|
-
row: e[
|
|
2368
|
-
x:
|
|
2368
|
+
row: e[S],
|
|
2369
|
+
x: Xc(e, t, ie, S, F),
|
|
2369
2370
|
y: 16,
|
|
2370
|
-
containerWidth:
|
|
2371
|
+
containerWidth: F.current?.getBoundingClientRect().width ?? 0,
|
|
2371
2372
|
config: n,
|
|
2372
|
-
render:
|
|
2373
|
-
valueFormat:
|
|
2373
|
+
render: Q ? () => Q(e[S]) : void 0,
|
|
2374
|
+
valueFormat: ue ? (H) => `${Math.round(H * 100)}%` : w,
|
|
2374
2375
|
titleKey: t,
|
|
2375
2376
|
classes: $
|
|
2376
2377
|
}
|
|
2377
2378
|
) : null,
|
|
2378
|
-
children: ({ width:
|
|
2379
|
-
const
|
|
2380
|
-
return /* @__PURE__ */ z(
|
|
2381
|
-
a && /* @__PURE__ */ s("defs", { children:
|
|
2379
|
+
children: ({ width: H, height: N }) => {
|
|
2380
|
+
const y = ie.left, v = H - ie.right, A = ie.top, _ = N - ie.bottom, q = Math.max(0, v - y), Y = Math.max(0, _ - A), J = e.map((g) => String(g[t])), k = je(J, [y, v], 0), G = ue ? [0, 0.25, 0.5, 0.75, 1] : qe(me, K, L), O = Je([G[0], G[G.length - 1]], [_, A]), de = O(0), ge = G.map((g) => ({ value: g, y: O(g) })), Ce = Fc(J).map((g) => ({ label: g, x: k(g) })), Se = ue ? (g) => `${Math.round(g * 100)}%` : b;
|
|
2381
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2382
|
+
a && /* @__PURE__ */ s("defs", { children: ne.map((g) => /* @__PURE__ */ z(
|
|
2382
2383
|
"linearGradient",
|
|
2383
2384
|
{
|
|
2384
|
-
id: `${
|
|
2385
|
+
id: `${j}-${g}`,
|
|
2385
2386
|
x1: "0",
|
|
2386
2387
|
y1: "0",
|
|
2387
2388
|
x2: "0",
|
|
2388
2389
|
y2: "1",
|
|
2389
2390
|
children: [
|
|
2390
|
-
/* @__PURE__ */ s("stop", { offset: "5%", stopColor: n[
|
|
2391
|
-
/* @__PURE__ */ s("stop", { offset: "95%", stopColor: n[
|
|
2391
|
+
/* @__PURE__ */ s("stop", { offset: "5%", stopColor: n[g].color, stopOpacity: 0.6 }),
|
|
2392
|
+
/* @__PURE__ */ s("stop", { offset: "95%", stopColor: n[g].color, stopOpacity: 0.05 })
|
|
2392
2393
|
]
|
|
2393
2394
|
},
|
|
2394
|
-
|
|
2395
|
+
g
|
|
2395
2396
|
)) }),
|
|
2396
2397
|
d ? /* @__PURE__ */ s(
|
|
2397
2398
|
nn,
|
|
2398
2399
|
{
|
|
2399
|
-
ticks:
|
|
2400
|
-
x:
|
|
2401
|
-
plotWidth:
|
|
2400
|
+
ticks: ge,
|
|
2401
|
+
x: y,
|
|
2402
|
+
plotWidth: q,
|
|
2402
2403
|
format: Se,
|
|
2403
2404
|
showGrid: h,
|
|
2404
2405
|
classes: $
|
|
2405
2406
|
}
|
|
2406
|
-
) : h && /* @__PURE__ */ s("g", { className: m(
|
|
2407
|
+
) : h && /* @__PURE__ */ s("g", { className: m(M.axis, $?.axis), children: ge.map(({ value: g, y: x }) => /* @__PURE__ */ s(
|
|
2407
2408
|
"line",
|
|
2408
2409
|
{
|
|
2409
|
-
className: m(
|
|
2410
|
-
x1:
|
|
2411
|
-
x2:
|
|
2410
|
+
className: m(M.gridLine, $?.grid),
|
|
2411
|
+
x1: y,
|
|
2412
|
+
x2: v,
|
|
2412
2413
|
y1: x,
|
|
2413
2414
|
y2: x
|
|
2414
2415
|
},
|
|
2415
|
-
`grid-${
|
|
2416
|
+
`grid-${g}`
|
|
2416
2417
|
)) }),
|
|
2417
|
-
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format:
|
|
2418
|
-
|
|
2419
|
-
const ee = n[
|
|
2420
|
-
x:
|
|
2421
|
-
y:
|
|
2422
|
-
})),
|
|
2423
|
-
return /* @__PURE__ */ z("g", { className: m(
|
|
2418
|
+
u && /* @__PURE__ */ s(rn, { ticks: Ce, y: _, format: R, classes: $ }),
|
|
2419
|
+
ne.map((g, x) => {
|
|
2420
|
+
const ee = n[g], E = e.map((ce, B) => ({
|
|
2421
|
+
x: k(J[B]),
|
|
2422
|
+
y: O(X[x][B])
|
|
2423
|
+
})), U = a ? `url(#${j}-${g})` : ee.color, I = a ? 1 : 0.18, fe = V ? Dt(E, se[x].map((ce) => O(ce)), c) : Dt(E, de, c);
|
|
2424
|
+
return /* @__PURE__ */ z("g", { className: m(M.series, $?.series), children: [
|
|
2424
2425
|
/* @__PURE__ */ s(
|
|
2425
2426
|
"path",
|
|
2426
2427
|
{
|
|
2427
|
-
className:
|
|
2428
|
-
d:
|
|
2429
|
-
fill:
|
|
2428
|
+
className: M.areaPath,
|
|
2429
|
+
d: fe,
|
|
2430
|
+
fill: U,
|
|
2430
2431
|
fillOpacity: I
|
|
2431
2432
|
}
|
|
2432
2433
|
),
|
|
2433
|
-
/* @__PURE__ */ s("path", { className:
|
|
2434
|
-
!
|
|
2434
|
+
/* @__PURE__ */ s("path", { className: M.linePath, d: Rt(E, c), stroke: ee.color }),
|
|
2435
|
+
!V && E.map((ce, B) => /* @__PURE__ */ s(
|
|
2435
2436
|
"circle",
|
|
2436
2437
|
{
|
|
2437
|
-
className: m(
|
|
2438
|
-
cx:
|
|
2439
|
-
cy:
|
|
2440
|
-
r:
|
|
2438
|
+
className: m(M.point, $?.point),
|
|
2439
|
+
cx: ce.x,
|
|
2440
|
+
cy: ce.y,
|
|
2441
|
+
r: S === B ? 5 : 3,
|
|
2441
2442
|
fill: ee.color
|
|
2442
2443
|
},
|
|
2443
|
-
`${
|
|
2444
|
+
`${g}-${B}`
|
|
2444
2445
|
))
|
|
2445
|
-
] },
|
|
2446
|
+
] }, g);
|
|
2446
2447
|
}),
|
|
2447
|
-
|
|
2448
|
+
S !== null && /* @__PURE__ */ s(
|
|
2448
2449
|
"line",
|
|
2449
2450
|
{
|
|
2450
|
-
className:
|
|
2451
|
-
x1:
|
|
2452
|
-
x2:
|
|
2453
|
-
y1:
|
|
2451
|
+
className: M.cursorLine,
|
|
2452
|
+
x1: k(J[S]),
|
|
2453
|
+
x2: k(J[S]),
|
|
2454
|
+
y1: A,
|
|
2454
2455
|
y2: _
|
|
2455
2456
|
}
|
|
2456
2457
|
),
|
|
2457
2458
|
/* @__PURE__ */ s(
|
|
2458
2459
|
"rect",
|
|
2459
2460
|
{
|
|
2460
|
-
className:
|
|
2461
|
-
x:
|
|
2462
|
-
y:
|
|
2463
|
-
width:
|
|
2461
|
+
className: M.interactionLayer,
|
|
2462
|
+
x: y,
|
|
2463
|
+
y: A,
|
|
2464
|
+
width: q,
|
|
2464
2465
|
height: Y,
|
|
2465
|
-
onMouseMove: (
|
|
2466
|
-
const x =
|
|
2467
|
-
|
|
2466
|
+
onMouseMove: (g) => {
|
|
2467
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left + y, E = k.step(), U = Math.max(0, Math.min(e.length - 1, Math.round((ee - y - E / 2) / E)));
|
|
2468
|
+
re(U);
|
|
2468
2469
|
},
|
|
2469
|
-
onMouseLeave: () =>
|
|
2470
|
+
onMouseLeave: () => re(null)
|
|
2470
2471
|
}
|
|
2471
2472
|
)
|
|
2472
2473
|
] });
|
|
@@ -2474,25 +2475,25 @@ function Fl({
|
|
|
2474
2475
|
}
|
|
2475
2476
|
);
|
|
2476
2477
|
}
|
|
2477
|
-
function
|
|
2478
|
+
function Xc(e, t, n, r, o) {
|
|
2478
2479
|
const c = o.current;
|
|
2479
2480
|
if (!c) return 0;
|
|
2480
2481
|
const i = c.getBoundingClientRect().width, l = e.map((h) => String(h[t]));
|
|
2481
|
-
return
|
|
2482
|
+
return je(l, [n.left, i - n.right], 0)(l[r]);
|
|
2482
2483
|
}
|
|
2483
|
-
const
|
|
2484
|
+
const zc = [
|
|
2484
2485
|
"var(--crk-chart-1)",
|
|
2485
2486
|
"var(--crk-chart-2)",
|
|
2486
2487
|
"var(--crk-chart-3)",
|
|
2487
2488
|
"var(--crk-chart-4)",
|
|
2488
2489
|
"var(--crk-chart-5)"
|
|
2489
|
-
],
|
|
2490
|
-
function
|
|
2490
|
+
], jc = { top: 12, right: 16, bottom: 28, left: 48 }, _c = { top: 12, right: 16, bottom: 28, left: 72 };
|
|
2491
|
+
function Yc(e, t = 8) {
|
|
2491
2492
|
if (e.length <= t) return e;
|
|
2492
2493
|
const n = Math.ceil(e.length / t);
|
|
2493
2494
|
return e.filter((r, o) => o % n === 0);
|
|
2494
2495
|
}
|
|
2495
|
-
function
|
|
2496
|
+
function Xl({
|
|
2496
2497
|
data: e,
|
|
2497
2498
|
xKey: t,
|
|
2498
2499
|
config: n,
|
|
@@ -2506,177 +2507,177 @@ function zl({
|
|
|
2506
2507
|
showGrid: u = !0,
|
|
2507
2508
|
showLegend: d = !0,
|
|
2508
2509
|
showTooltip: f = !0,
|
|
2509
|
-
showValues:
|
|
2510
|
+
showValues: p = !1,
|
|
2510
2511
|
valuePosition: L = "outside",
|
|
2511
|
-
renderLabel:
|
|
2512
|
-
colorBy:
|
|
2513
|
-
colors:
|
|
2514
|
-
negativeColor:
|
|
2515
|
-
activeIndex:
|
|
2516
|
-
onBarClick:
|
|
2517
|
-
yTickCount:
|
|
2518
|
-
yFormat:
|
|
2512
|
+
renderLabel: b,
|
|
2513
|
+
colorBy: R = "series",
|
|
2514
|
+
colors: w = zc,
|
|
2515
|
+
negativeColor: Q,
|
|
2516
|
+
activeIndex: W,
|
|
2517
|
+
onBarClick: D,
|
|
2518
|
+
yTickCount: Z = 5,
|
|
2519
|
+
yFormat: T,
|
|
2519
2520
|
xFormat: $,
|
|
2520
|
-
valueFormat:
|
|
2521
|
-
renderTooltip:
|
|
2522
|
-
margin:
|
|
2523
|
-
emptyMessage:
|
|
2524
|
-
className:
|
|
2525
|
-
style:
|
|
2526
|
-
classes:
|
|
2521
|
+
valueFormat: ie,
|
|
2522
|
+
renderTooltip: ne,
|
|
2523
|
+
margin: V,
|
|
2524
|
+
emptyMessage: ue = "No data",
|
|
2525
|
+
className: S,
|
|
2526
|
+
style: re,
|
|
2527
|
+
classes: F
|
|
2527
2528
|
}) {
|
|
2528
|
-
const
|
|
2529
|
+
const j = r === "horizontal", C = { ...j ? _c : jc, ...V }, X = ke(() => Object.keys(n), [n]), se = o && X.length > 1, [me, K] = Re(null), H = oe(null);
|
|
2529
2530
|
if (e.length === 0)
|
|
2530
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2531
|
-
const
|
|
2532
|
-
if (
|
|
2533
|
-
let
|
|
2531
|
+
return /* @__PURE__ */ s("div", { ref: H, className: m(M.root, F?.root, S), style: re, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: ue }) }) });
|
|
2532
|
+
const N = e.map((k) => String(k[t])), y = W ?? me, v = ke(() => {
|
|
2533
|
+
if (se) {
|
|
2534
|
+
let de = 0, ge = 0;
|
|
2534
2535
|
for (const be of e) {
|
|
2535
2536
|
let Ce = 0, Se = 0;
|
|
2536
|
-
for (const
|
|
2537
|
-
const x = be[
|
|
2537
|
+
for (const g of X) {
|
|
2538
|
+
const x = be[g];
|
|
2538
2539
|
typeof x == "number" && (x >= 0 ? Ce += x : Se += x);
|
|
2539
2540
|
}
|
|
2540
|
-
Ce >
|
|
2541
|
+
Ce > de && (de = Ce), Se < ge && (ge = Se);
|
|
2541
2542
|
}
|
|
2542
|
-
return [
|
|
2543
|
+
return [ge, de];
|
|
2543
2544
|
}
|
|
2544
|
-
const
|
|
2545
|
-
for (const
|
|
2546
|
-
for (const
|
|
2547
|
-
const be =
|
|
2548
|
-
typeof be == "number" &&
|
|
2545
|
+
const k = [];
|
|
2546
|
+
for (const de of e)
|
|
2547
|
+
for (const ge of X) {
|
|
2548
|
+
const be = de[ge];
|
|
2549
|
+
typeof be == "number" && k.push(be);
|
|
2549
2550
|
}
|
|
2550
|
-
const [
|
|
2551
|
-
return [Math.min(0,
|
|
2552
|
-
}, [e,
|
|
2551
|
+
const [G, O] = bt(k);
|
|
2552
|
+
return [Math.min(0, G), Math.max(0, O)];
|
|
2553
|
+
}, [e, X, se]), A = qe(v[0], v[1], Z), _ = A[0], q = A[A.length - 1], Y = (k, G) => R === "index" ? w[G % w.length] : n[k]?.color ?? w[0], J = f && y !== null && e[y] ? /* @__PURE__ */ s(
|
|
2553
2554
|
et,
|
|
2554
2555
|
{
|
|
2555
|
-
row: e[
|
|
2556
|
-
x: Vc(e, t,
|
|
2557
|
-
y:
|
|
2558
|
-
containerWidth:
|
|
2556
|
+
row: e[y],
|
|
2557
|
+
x: Vc(e, t, C, y, H, j, l),
|
|
2558
|
+
y: j ? qc(e, t, C, y, H, l) : 16,
|
|
2559
|
+
containerWidth: H.current?.getBoundingClientRect().width ?? 0,
|
|
2559
2560
|
config: n,
|
|
2560
|
-
render:
|
|
2561
|
-
valueFormat:
|
|
2561
|
+
render: ne ? () => ne(e[y]) : void 0,
|
|
2562
|
+
valueFormat: ie,
|
|
2562
2563
|
titleKey: t,
|
|
2563
|
-
resolveColor: (
|
|
2564
|
-
const
|
|
2565
|
-
return typeof
|
|
2564
|
+
resolveColor: (k) => {
|
|
2565
|
+
const G = e[y][k], O = Y(k, y);
|
|
2566
|
+
return typeof G != "number" ? O : Q !== void 0 && G < 0 ? Q : O;
|
|
2566
2567
|
},
|
|
2567
|
-
classes:
|
|
2568
|
+
classes: F
|
|
2568
2569
|
}
|
|
2569
2570
|
) : null;
|
|
2570
2571
|
return /* @__PURE__ */ s(
|
|
2571
2572
|
Ve,
|
|
2572
2573
|
{
|
|
2573
|
-
ref:
|
|
2574
|
+
ref: H,
|
|
2574
2575
|
aspectRatio: c,
|
|
2575
2576
|
height: i,
|
|
2576
|
-
className:
|
|
2577
|
-
style:
|
|
2578
|
-
classes:
|
|
2579
|
-
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes:
|
|
2580
|
-
overlay:
|
|
2581
|
-
children: ({ width:
|
|
2582
|
-
const
|
|
2583
|
-
value:
|
|
2584
|
-
pos:
|
|
2585
|
-
})),
|
|
2586
|
-
return /* @__PURE__ */ z(
|
|
2587
|
-
u && /* @__PURE__ */ s("g", { className: m(
|
|
2588
|
-
({ value:
|
|
2577
|
+
className: S,
|
|
2578
|
+
style: re,
|
|
2579
|
+
classes: F,
|
|
2580
|
+
legend: d ? /* @__PURE__ */ s(vt, { config: n, classes: F }) : void 0,
|
|
2581
|
+
overlay: J,
|
|
2582
|
+
children: ({ width: k, height: G }) => {
|
|
2583
|
+
const O = C.left, de = k - C.right, ge = C.top, be = G - C.bottom, Ce = Math.max(0, de - O), Se = Math.max(0, be - ge), x = je(N, j ? [ge, be] : [O, de], l), ee = x.bandWidth(), U = Je([_, q], j ? [O, de] : [be, ge]), I = U(0), fe = se ? 1 : Math.max(1, X.length), ce = ee / fe, B = ce * (1 - a), le = A.map((te) => ({
|
|
2584
|
+
value: te,
|
|
2585
|
+
pos: U(te)
|
|
2586
|
+
})), ye = Yc(N);
|
|
2587
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2588
|
+
u && /* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: le.map(
|
|
2589
|
+
({ value: te, pos: ae }) => j ? /* @__PURE__ */ s(
|
|
2589
2590
|
"line",
|
|
2590
2591
|
{
|
|
2591
|
-
className: m(
|
|
2592
|
-
x1:
|
|
2593
|
-
x2:
|
|
2594
|
-
y1:
|
|
2592
|
+
className: m(M.gridLine, F?.grid),
|
|
2593
|
+
x1: ae,
|
|
2594
|
+
x2: ae,
|
|
2595
|
+
y1: ge,
|
|
2595
2596
|
y2: be
|
|
2596
2597
|
},
|
|
2597
|
-
`g-${
|
|
2598
|
+
`g-${te}`
|
|
2598
2599
|
) : /* @__PURE__ */ s(
|
|
2599
2600
|
"line",
|
|
2600
2601
|
{
|
|
2601
|
-
className: m(
|
|
2602
|
-
x1:
|
|
2603
|
-
x2:
|
|
2604
|
-
y1:
|
|
2605
|
-
y2:
|
|
2602
|
+
className: m(M.gridLine, F?.grid),
|
|
2603
|
+
x1: O,
|
|
2604
|
+
x2: de,
|
|
2605
|
+
y1: ae,
|
|
2606
|
+
y2: ae
|
|
2606
2607
|
},
|
|
2607
|
-
`g-${
|
|
2608
|
+
`g-${te}`
|
|
2608
2609
|
)
|
|
2609
2610
|
) }),
|
|
2610
|
-
/* @__PURE__ */ s("g", { className: m(
|
|
2611
|
-
const Ae =
|
|
2612
|
-
return
|
|
2611
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: le.map(({ value: te, pos: ae }) => {
|
|
2612
|
+
const Ae = T ? T(te) : String(te);
|
|
2613
|
+
return j ? /* @__PURE__ */ s(
|
|
2613
2614
|
"text",
|
|
2614
2615
|
{
|
|
2615
|
-
className: m(
|
|
2616
|
-
x:
|
|
2616
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2617
|
+
x: ae,
|
|
2617
2618
|
y: be + 16,
|
|
2618
2619
|
textAnchor: "middle",
|
|
2619
2620
|
children: Ae
|
|
2620
2621
|
},
|
|
2621
|
-
`vt-${
|
|
2622
|
+
`vt-${te}`
|
|
2622
2623
|
) : /* @__PURE__ */ s(
|
|
2623
2624
|
"text",
|
|
2624
2625
|
{
|
|
2625
|
-
className: m(
|
|
2626
|
-
x:
|
|
2627
|
-
y:
|
|
2626
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2627
|
+
x: O - 8,
|
|
2628
|
+
y: ae,
|
|
2628
2629
|
textAnchor: "end",
|
|
2629
2630
|
dominantBaseline: "middle",
|
|
2630
2631
|
children: Ae
|
|
2631
2632
|
},
|
|
2632
|
-
`vt-${
|
|
2633
|
+
`vt-${te}`
|
|
2633
2634
|
);
|
|
2634
2635
|
}) }),
|
|
2635
|
-
/* @__PURE__ */ s("g", { className: m(
|
|
2636
|
-
const
|
|
2637
|
-
return
|
|
2636
|
+
/* @__PURE__ */ s("g", { className: m(M.axis, F?.axis), children: ye.map((te) => {
|
|
2637
|
+
const ae = x(te), Ae = $ ? $(te) : te;
|
|
2638
|
+
return j ? /* @__PURE__ */ s(
|
|
2638
2639
|
"text",
|
|
2639
2640
|
{
|
|
2640
|
-
className: m(
|
|
2641
|
-
x:
|
|
2642
|
-
y:
|
|
2641
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2642
|
+
x: O - 8,
|
|
2643
|
+
y: ae,
|
|
2643
2644
|
textAnchor: "end",
|
|
2644
2645
|
dominantBaseline: "middle",
|
|
2645
2646
|
children: Ae
|
|
2646
2647
|
},
|
|
2647
|
-
`c-${
|
|
2648
|
+
`c-${te}`
|
|
2648
2649
|
) : /* @__PURE__ */ s(
|
|
2649
2650
|
"text",
|
|
2650
2651
|
{
|
|
2651
|
-
className: m(
|
|
2652
|
-
x:
|
|
2652
|
+
className: m(M.axisLabel, F?.axisLabel),
|
|
2653
|
+
x: ae,
|
|
2653
2654
|
y: be + 16,
|
|
2654
2655
|
textAnchor: "middle",
|
|
2655
2656
|
children: Ae
|
|
2656
2657
|
},
|
|
2657
|
-
`c-${
|
|
2658
|
+
`c-${te}`
|
|
2658
2659
|
);
|
|
2659
2660
|
}) }),
|
|
2660
|
-
e.map((
|
|
2661
|
-
const De = x(
|
|
2662
|
-
let xe = 0,
|
|
2663
|
-
return /* @__PURE__ */ s("g", { className: m(
|
|
2664
|
-
const Ge =
|
|
2661
|
+
e.map((te, ae) => {
|
|
2662
|
+
const De = x(N[ae]) - ee / 2;
|
|
2663
|
+
let xe = 0, he = 0;
|
|
2664
|
+
return /* @__PURE__ */ s("g", { className: m(M.series, F?.series), children: X.map((Ie, He) => {
|
|
2665
|
+
const Ge = te[Ie];
|
|
2665
2666
|
if (typeof Ge != "number") return null;
|
|
2666
|
-
const Ee = Ge, xt = Y(Ie,
|
|
2667
|
+
const Ee = Ge, xt = Y(Ie, ae), kt = Q !== void 0 && Ee < 0 ? Q : xt, Oe = W !== void 0 ? W === ae : me === ae, tt = W !== void 0 && !Oe;
|
|
2667
2668
|
let nt, _e;
|
|
2668
|
-
|
|
2669
|
-
const rt =
|
|
2669
|
+
se ? Ee >= 0 ? (nt = xe, _e = xe + Ee, xe = _e) : (nt = he, _e = he + Ee, he = _e) : (nt = 0, _e = Ee);
|
|
2670
|
+
const rt = U(nt), ot = U(_e), Bt = se ? (ee - B) / 2 : He * ce + (ce - B) / 2;
|
|
2670
2671
|
let it = 0, ct = 0, lt = 0, st = 0;
|
|
2671
|
-
if (
|
|
2672
|
+
if (j) {
|
|
2672
2673
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2673
|
-
it = Ze, lt = wt - Ze, ct = De + Bt, st =
|
|
2674
|
+
it = Ze, lt = wt - Ze, ct = De + Bt, st = B;
|
|
2674
2675
|
} else {
|
|
2675
2676
|
const Ze = Math.min(rt, ot), wt = Math.max(rt, ot);
|
|
2676
|
-
it = De + Bt, lt =
|
|
2677
|
+
it = De + Bt, lt = B, ct = Ze, st = wt - Ze;
|
|
2677
2678
|
}
|
|
2678
|
-
const Mt =
|
|
2679
|
-
isHorizontal:
|
|
2679
|
+
const Mt = b ? b({ row: te, value: Ee, seriesKey: Ie, index: ae }) : p ? ie ? ie(Ee) : String(Ee) : null, Fe = Uc({
|
|
2680
|
+
isHorizontal: j,
|
|
2680
2681
|
valuePosition: L,
|
|
2681
2682
|
x: it,
|
|
2682
2683
|
y: ct,
|
|
@@ -2689,9 +2690,9 @@ function zl({
|
|
|
2689
2690
|
"rect",
|
|
2690
2691
|
{
|
|
2691
2692
|
className: m(
|
|
2692
|
-
|
|
2693
|
-
Oe &&
|
|
2694
|
-
|
|
2693
|
+
M.bar,
|
|
2694
|
+
Oe && M.activeBar,
|
|
2695
|
+
F?.point
|
|
2695
2696
|
),
|
|
2696
2697
|
x: it,
|
|
2697
2698
|
y: ct,
|
|
@@ -2701,16 +2702,16 @@ function zl({
|
|
|
2701
2702
|
ry: h,
|
|
2702
2703
|
fill: kt,
|
|
2703
2704
|
opacity: tt ? 0.35 : 1,
|
|
2704
|
-
onClick:
|
|
2705
|
-
style:
|
|
2705
|
+
onClick: D ? () => D({ row: te, value: Ee, seriesKey: Ie, index: ae }) : void 0,
|
|
2706
|
+
style: D ? { cursor: "pointer" } : void 0
|
|
2706
2707
|
}
|
|
2707
2708
|
),
|
|
2708
2709
|
Mt != null && /* @__PURE__ */ s(
|
|
2709
2710
|
"text",
|
|
2710
2711
|
{
|
|
2711
2712
|
className: m(
|
|
2712
|
-
|
|
2713
|
-
(L === "inside" || L === "inside-start") &&
|
|
2713
|
+
M.axisLabel,
|
|
2714
|
+
(L === "inside" || L === "inside-start") && M.barLabelInside
|
|
2714
2715
|
),
|
|
2715
2716
|
x: Fe.x,
|
|
2716
2717
|
y: Fe.y,
|
|
@@ -2722,31 +2723,31 @@ function zl({
|
|
|
2722
2723
|
}
|
|
2723
2724
|
)
|
|
2724
2725
|
] }, Ie);
|
|
2725
|
-
}) }, `group-${
|
|
2726
|
+
}) }, `group-${ae}`);
|
|
2726
2727
|
}),
|
|
2727
|
-
_ < 0 &&
|
|
2728
|
+
_ < 0 && q > 0 && /* @__PURE__ */ s(
|
|
2728
2729
|
"line",
|
|
2729
2730
|
{
|
|
2730
|
-
className: m(
|
|
2731
|
-
x1:
|
|
2732
|
-
x2:
|
|
2733
|
-
y1:
|
|
2734
|
-
y2:
|
|
2731
|
+
className: m(M.gridLine),
|
|
2732
|
+
x1: j ? I : O,
|
|
2733
|
+
x2: j ? I : de,
|
|
2734
|
+
y1: j ? ge : I,
|
|
2735
|
+
y2: j ? be : I,
|
|
2735
2736
|
opacity: 0.9
|
|
2736
2737
|
}
|
|
2737
2738
|
),
|
|
2738
2739
|
/* @__PURE__ */ s(
|
|
2739
2740
|
"rect",
|
|
2740
2741
|
{
|
|
2741
|
-
className:
|
|
2742
|
-
x:
|
|
2743
|
-
y:
|
|
2742
|
+
className: M.interactionLayer,
|
|
2743
|
+
x: O,
|
|
2744
|
+
y: ge,
|
|
2744
2745
|
width: Ce,
|
|
2745
2746
|
height: Se,
|
|
2746
|
-
onMouseMove: (
|
|
2747
|
-
const
|
|
2747
|
+
onMouseMove: (te) => {
|
|
2748
|
+
const ae = te.currentTarget.getBoundingClientRect(), Ae = te.clientX - ae.left + O, De = te.clientY - ae.top + ge, xe = x.step(), he = j ? De - ge : Ae - O, Ie = Math.max(
|
|
2748
2749
|
0,
|
|
2749
|
-
Math.min(e.length - 1, Math.round((
|
|
2750
|
+
Math.min(e.length - 1, Math.round((he - xe / 2) / xe))
|
|
2750
2751
|
);
|
|
2751
2752
|
K(Ie);
|
|
2752
2753
|
},
|
|
@@ -2758,7 +2759,7 @@ function zl({
|
|
|
2758
2759
|
}
|
|
2759
2760
|
);
|
|
2760
2761
|
}
|
|
2761
|
-
function
|
|
2762
|
+
function Uc({
|
|
2762
2763
|
isHorizontal: e,
|
|
2763
2764
|
valuePosition: t,
|
|
2764
2765
|
x: n,
|
|
@@ -2814,13 +2815,13 @@ function Vc(e, t, n, r, o, c, i) {
|
|
|
2814
2815
|
const l = o.current;
|
|
2815
2816
|
if (!l) return 0;
|
|
2816
2817
|
const a = l.getBoundingClientRect(), h = e.map((d) => String(d[t]));
|
|
2817
|
-
return c ? a.width / 2 :
|
|
2818
|
+
return c ? a.width / 2 : je(h, [n.left, a.width - n.right], i)(h[r]);
|
|
2818
2819
|
}
|
|
2819
2820
|
function qc(e, t, n, r, o, c) {
|
|
2820
2821
|
const i = o.current;
|
|
2821
2822
|
if (!i) return 16;
|
|
2822
2823
|
const l = i.getBoundingClientRect(), a = e.map((u) => String(u[t]));
|
|
2823
|
-
return
|
|
2824
|
+
return je(a, [n.top, l.height - n.bottom], c)(a[r]);
|
|
2824
2825
|
}
|
|
2825
2826
|
const Gc = [
|
|
2826
2827
|
"var(--crk-chart-1)",
|
|
@@ -2852,12 +2853,12 @@ function Zc(e, t, n, r, o, c) {
|
|
|
2852
2853
|
].join(" ");
|
|
2853
2854
|
const i = (o - 90) * Math.PI / 180, l = (c - 90) * Math.PI / 180, a = c - o > 180 ? 1 : 0, h = e + n * Math.cos(i), u = t + n * Math.sin(i), d = e + n * Math.cos(l), f = t + n * Math.sin(l);
|
|
2854
2855
|
if (r > 0) {
|
|
2855
|
-
const
|
|
2856
|
+
const p = e + r * Math.cos(l), L = t + r * Math.sin(l), b = e + r * Math.cos(i), R = t + r * Math.sin(i);
|
|
2856
2857
|
return [
|
|
2857
2858
|
`M ${h} ${u}`,
|
|
2858
2859
|
`A ${n} ${n} 0 ${a} 1 ${d} ${f}`,
|
|
2859
|
-
`L ${
|
|
2860
|
-
`A ${r} ${r} 0 ${a} 0 ${
|
|
2860
|
+
`L ${p} ${L}`,
|
|
2861
|
+
`A ${r} ${r} 0 ${a} 0 ${b} ${R}`,
|
|
2861
2862
|
"Z"
|
|
2862
2863
|
].join(" ");
|
|
2863
2864
|
}
|
|
@@ -2872,7 +2873,7 @@ function Pt(e, t, n, r, o) {
|
|
|
2872
2873
|
const i = ((r + o) / 2 - 90) * Math.PI / 180;
|
|
2873
2874
|
return { x: e + n * Math.cos(i), y: t + n * Math.sin(i) };
|
|
2874
2875
|
}
|
|
2875
|
-
function
|
|
2876
|
+
function zl({
|
|
2876
2877
|
data: e,
|
|
2877
2878
|
valueKey: t,
|
|
2878
2879
|
nameKey: n,
|
|
@@ -2886,119 +2887,119 @@ function jl({
|
|
|
2886
2887
|
strokeColor: u = "var(--crk-color-bg)",
|
|
2887
2888
|
padAngle: d = 0,
|
|
2888
2889
|
showLabels: f = !1,
|
|
2889
|
-
valuePosition:
|
|
2890
|
+
valuePosition: p = "outside",
|
|
2890
2891
|
showLabelLines: L = !0,
|
|
2891
|
-
renderLabel:
|
|
2892
|
-
centerLabel:
|
|
2893
|
-
activeIndex:
|
|
2894
|
-
onSliceClick:
|
|
2895
|
-
showLegend:
|
|
2896
|
-
showTooltip:
|
|
2897
|
-
valueFormat:
|
|
2898
|
-
renderTooltip:
|
|
2892
|
+
renderLabel: b,
|
|
2893
|
+
centerLabel: R,
|
|
2894
|
+
activeIndex: w,
|
|
2895
|
+
onSliceClick: Q,
|
|
2896
|
+
showLegend: W = !0,
|
|
2897
|
+
showTooltip: D = !0,
|
|
2898
|
+
valueFormat: Z,
|
|
2899
|
+
renderTooltip: T,
|
|
2899
2900
|
emptyMessage: $ = "No data",
|
|
2900
|
-
className:
|
|
2901
|
-
style:
|
|
2902
|
-
classes:
|
|
2901
|
+
className: ie,
|
|
2902
|
+
style: ne,
|
|
2903
|
+
classes: V
|
|
2903
2904
|
}) {
|
|
2904
|
-
const [
|
|
2905
|
+
const [ue, S] = Re(null), re = oe(null), F = w ?? ue, j = (K) => {
|
|
2905
2906
|
if (r) {
|
|
2906
|
-
const
|
|
2907
|
-
if (typeof
|
|
2907
|
+
const H = e[K]?.[r];
|
|
2908
|
+
if (typeof H == "string") return H;
|
|
2908
2909
|
}
|
|
2909
2910
|
return o[K % o.length];
|
|
2910
|
-
},
|
|
2911
|
+
}, C = ke(() => {
|
|
2911
2912
|
let K = 0;
|
|
2912
|
-
for (const
|
|
2913
|
-
const
|
|
2914
|
-
typeof
|
|
2913
|
+
for (const H of e) {
|
|
2914
|
+
const N = H[t];
|
|
2915
|
+
typeof N == "number" && N > 0 && (K += N);
|
|
2915
2916
|
}
|
|
2916
2917
|
return K;
|
|
2917
2918
|
}, [e, t]);
|
|
2918
|
-
if (e.length === 0 ||
|
|
2919
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
2920
|
-
const
|
|
2919
|
+
if (e.length === 0 || C === 0)
|
|
2920
|
+
return /* @__PURE__ */ s("div", { ref: re, className: m(M.root, V?.root, ie), style: ne, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: i ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: $ }) }) });
|
|
2921
|
+
const X = ke(() => {
|
|
2921
2922
|
const K = [];
|
|
2922
|
-
let
|
|
2923
|
-
for (let
|
|
2924
|
-
const
|
|
2925
|
-
if (
|
|
2926
|
-
const _ =
|
|
2927
|
-
K.push({ index:
|
|
2923
|
+
let H = 0;
|
|
2924
|
+
for (let N = 0; N < e.length; N++) {
|
|
2925
|
+
const y = e[N], v = y[t], A = typeof v == "number" && v > 0 ? v : 0;
|
|
2926
|
+
if (A === 0) continue;
|
|
2927
|
+
const _ = A / C, q = _ * 360;
|
|
2928
|
+
K.push({ index: N, row: y, value: A, start: H, end: H + q, fraction: _ }), H += q;
|
|
2928
2929
|
}
|
|
2929
2930
|
return K;
|
|
2930
|
-
}, [e, t,
|
|
2931
|
+
}, [e, t, C]), se = W ? /* @__PURE__ */ s("div", { className: m(M.legend, V?.legend), role: "list", children: X.map((K) => /* @__PURE__ */ z("div", { className: m(M.legendItem, V?.legendItem), role: "listitem", children: [
|
|
2931
2932
|
/* @__PURE__ */ s(
|
|
2932
2933
|
"span",
|
|
2933
2934
|
{
|
|
2934
|
-
className:
|
|
2935
|
-
style: { background:
|
|
2935
|
+
className: M.legendSwatch,
|
|
2936
|
+
style: { background: j(K.index) },
|
|
2936
2937
|
"aria-hidden": "true"
|
|
2937
2938
|
}
|
|
2938
2939
|
),
|
|
2939
|
-
/* @__PURE__ */ s("span", { className:
|
|
2940
|
-
] }, K.index)) }) : void 0,
|
|
2940
|
+
/* @__PURE__ */ s("span", { className: M.legendLabel, children: String(K.row[n]) })
|
|
2941
|
+
] }, K.index)) }) : void 0, me = ke(() => {
|
|
2941
2942
|
const K = {};
|
|
2942
|
-
for (const
|
|
2943
|
-
K[
|
|
2944
|
-
label: String(
|
|
2945
|
-
color:
|
|
2943
|
+
for (const H of X)
|
|
2944
|
+
K[H.index.toString()] = {
|
|
2945
|
+
label: String(H.row[n]),
|
|
2946
|
+
color: j(H.index)
|
|
2946
2947
|
};
|
|
2947
2948
|
return K;
|
|
2948
|
-
}, [
|
|
2949
|
+
}, [X]);
|
|
2949
2950
|
return /* @__PURE__ */ s(
|
|
2950
2951
|
Ve,
|
|
2951
2952
|
{
|
|
2952
|
-
ref:
|
|
2953
|
+
ref: re,
|
|
2953
2954
|
aspectRatio: c,
|
|
2954
2955
|
height: i,
|
|
2955
|
-
className:
|
|
2956
|
-
style:
|
|
2957
|
-
classes:
|
|
2958
|
-
legend:
|
|
2959
|
-
overlay:
|
|
2956
|
+
className: ie,
|
|
2957
|
+
style: ne,
|
|
2958
|
+
classes: V,
|
|
2959
|
+
legend: se,
|
|
2960
|
+
overlay: D && F !== null && e[F] ? /* @__PURE__ */ s(
|
|
2960
2961
|
et,
|
|
2961
2962
|
{
|
|
2962
|
-
row: { [
|
|
2963
|
-
x:
|
|
2963
|
+
row: { [F.toString()]: e[F][t] },
|
|
2964
|
+
x: re.current ? re.current.getBoundingClientRect().width / 2 : 0,
|
|
2964
2965
|
y: 16,
|
|
2965
|
-
containerWidth:
|
|
2966
|
-
config: { [
|
|
2967
|
-
render:
|
|
2968
|
-
valueFormat:
|
|
2966
|
+
containerWidth: re.current?.getBoundingClientRect().width ?? 0,
|
|
2967
|
+
config: { [F.toString()]: me[F.toString()] },
|
|
2968
|
+
render: T ? () => T(e[F]) : void 0,
|
|
2969
|
+
valueFormat: Z,
|
|
2969
2970
|
titleKey: void 0,
|
|
2970
|
-
classes:
|
|
2971
|
+
classes: V
|
|
2971
2972
|
}
|
|
2972
2973
|
) : null,
|
|
2973
|
-
children: ({ width: K, height:
|
|
2974
|
-
const
|
|
2975
|
-
return /* @__PURE__ */ z(
|
|
2976
|
-
/* @__PURE__ */ s("g", { children:
|
|
2977
|
-
const
|
|
2974
|
+
children: ({ width: K, height: H }) => {
|
|
2975
|
+
const N = K / 2, y = H / 2, v = Math.min(K, H) / 2 - 4, A = Et(a, v), _ = Math.min(A - 1, Et(l, v)), q = Math.max(4, A * 0.06);
|
|
2976
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
2977
|
+
/* @__PURE__ */ s("g", { children: X.map((Y) => {
|
|
2978
|
+
const J = d / 2, k = Math.min(Y.end, Y.start + J), G = Math.max(Y.start, Y.end - J), O = j(Y.index), de = F === Y.index, ge = w !== void 0 && !de, be = de && w !== void 0 ? A + q : A, Ce = Zc(N, y, be, _, k, G), Se = Q ? () => Q({ row: Y.row, value: Y.value, index: Y.index }) : void 0;
|
|
2978
2979
|
return /* @__PURE__ */ s(
|
|
2979
2980
|
"path",
|
|
2980
2981
|
{
|
|
2981
2982
|
d: Ce,
|
|
2982
|
-
fill:
|
|
2983
|
+
fill: O,
|
|
2983
2984
|
stroke: h > 0 ? u : "none",
|
|
2984
2985
|
strokeWidth: h,
|
|
2985
|
-
opacity:
|
|
2986
|
-
onMouseEnter: () =>
|
|
2987
|
-
onMouseLeave: () =>
|
|
2986
|
+
opacity: ge ? 0.45 : 1,
|
|
2987
|
+
onMouseEnter: () => S(Y.index),
|
|
2988
|
+
onMouseLeave: () => S(null),
|
|
2988
2989
|
onClick: Se,
|
|
2989
2990
|
style: Se ? { cursor: "pointer" } : void 0
|
|
2990
2991
|
},
|
|
2991
2992
|
Y.index
|
|
2992
2993
|
);
|
|
2993
2994
|
}) }),
|
|
2994
|
-
(f ||
|
|
2995
|
-
const
|
|
2996
|
-
if (
|
|
2997
|
-
const
|
|
2995
|
+
(f || b) && X.map((Y) => {
|
|
2996
|
+
const J = b ? b({ row: Y.row, value: Y.value, fraction: Y.fraction, index: Y.index }) : f ? `${String(Y.row[n])} ${Z ? Z(Y.value) : Math.round(Y.fraction * 100) + "%"}` : null;
|
|
2997
|
+
if (J == null) return null;
|
|
2998
|
+
const k = p === "inside", G = Math.max(16, A * 0.12), O = k ? (A + _) / 2 : A + G, de = Pt(N, y, O, Y.start, Y.end), ge = k ? "middle" : de.x < N - 1 ? "end" : de.x > N + 1 ? "start" : "middle";
|
|
2998
2999
|
let be = null;
|
|
2999
|
-
if (!
|
|
3000
|
-
const Ce = Pt(
|
|
3001
|
-
be = { x1: Ce.x, y1: Ce.y, x2:
|
|
3000
|
+
if (!k && L) {
|
|
3001
|
+
const Ce = Pt(N, y, A, Y.start, Y.end), Se = 4, g = ge === "end" ? Se : ge === "start" ? -Se : 0;
|
|
3002
|
+
be = { x1: Ce.x, y1: Ce.y, x2: de.x + g, y2: de.y };
|
|
3002
3003
|
}
|
|
3003
3004
|
return /* @__PURE__ */ z("g", { children: [
|
|
3004
3005
|
be && /* @__PURE__ */ s(
|
|
@@ -3008,7 +3009,7 @@ function jl({
|
|
|
3008
3009
|
y1: be.y1,
|
|
3009
3010
|
x2: be.x2,
|
|
3010
3011
|
y2: be.y2,
|
|
3011
|
-
stroke:
|
|
3012
|
+
stroke: j(Y.index),
|
|
3012
3013
|
strokeWidth: 1,
|
|
3013
3014
|
opacity: 0.7
|
|
3014
3015
|
}
|
|
@@ -3016,24 +3017,24 @@ function jl({
|
|
|
3016
3017
|
/* @__PURE__ */ s(
|
|
3017
3018
|
"text",
|
|
3018
3019
|
{
|
|
3019
|
-
x:
|
|
3020
|
-
y:
|
|
3020
|
+
x: de.x,
|
|
3021
|
+
y: de.y,
|
|
3021
3022
|
className: m(
|
|
3022
|
-
|
|
3023
|
-
|
|
3023
|
+
M.axisLabel,
|
|
3024
|
+
k && M.barLabelInside
|
|
3024
3025
|
),
|
|
3025
|
-
textAnchor:
|
|
3026
|
+
textAnchor: ge,
|
|
3026
3027
|
dominantBaseline: "middle",
|
|
3027
|
-
children:
|
|
3028
|
+
children: J
|
|
3028
3029
|
}
|
|
3029
3030
|
)
|
|
3030
3031
|
] }, `label-${Y.index}`);
|
|
3031
3032
|
}),
|
|
3032
|
-
|
|
3033
|
+
R !== void 0 && /* @__PURE__ */ s(
|
|
3033
3034
|
"foreignObject",
|
|
3034
3035
|
{
|
|
3035
|
-
x:
|
|
3036
|
-
y:
|
|
3036
|
+
x: N - _,
|
|
3037
|
+
y: y - _,
|
|
3037
3038
|
width: Math.max(0, _ * 2),
|
|
3038
3039
|
height: Math.max(0, _ * 2),
|
|
3039
3040
|
style: { pointerEvents: "none" },
|
|
@@ -3051,7 +3052,7 @@ function jl({
|
|
|
3051
3052
|
color: "var(--crk-color-text)",
|
|
3052
3053
|
fontFamily: "var(--crk-font-family)"
|
|
3053
3054
|
},
|
|
3054
|
-
children:
|
|
3055
|
+
children: R
|
|
3055
3056
|
}
|
|
3056
3057
|
)
|
|
3057
3058
|
}
|
|
@@ -3071,7 +3072,7 @@ function Kc(e, t, n, r) {
|
|
|
3071
3072
|
return `${c.x},${c.y}`;
|
|
3072
3073
|
}).join(" ");
|
|
3073
3074
|
}
|
|
3074
|
-
function
|
|
3075
|
+
function jl({
|
|
3075
3076
|
data: e,
|
|
3076
3077
|
axisKey: t,
|
|
3077
3078
|
config: n,
|
|
@@ -3085,185 +3086,185 @@ function Xl({
|
|
|
3085
3086
|
levels: u = 5,
|
|
3086
3087
|
showPoints: d = !0,
|
|
3087
3088
|
fillOpacity: f = 0.4,
|
|
3088
|
-
strokeWidth:
|
|
3089
|
+
strokeWidth: p = 2,
|
|
3089
3090
|
renderAxisLabel: L,
|
|
3090
|
-
axisFormat:
|
|
3091
|
-
valueFormat:
|
|
3092
|
-
renderTooltip:
|
|
3093
|
-
showLegend:
|
|
3094
|
-
showTooltip:
|
|
3095
|
-
emptyMessage:
|
|
3096
|
-
className:
|
|
3097
|
-
style:
|
|
3091
|
+
axisFormat: b,
|
|
3092
|
+
valueFormat: R,
|
|
3093
|
+
renderTooltip: w,
|
|
3094
|
+
showLegend: Q = !0,
|
|
3095
|
+
showTooltip: W = !0,
|
|
3096
|
+
emptyMessage: D = "No data",
|
|
3097
|
+
className: Z,
|
|
3098
|
+
style: T,
|
|
3098
3099
|
classes: $
|
|
3099
3100
|
}) {
|
|
3100
|
-
const [
|
|
3101
|
+
const [ie, ne] = Re(null), V = oe(null), ue = ke(() => Object.keys(n), [n]);
|
|
3101
3102
|
if (e.length === 0)
|
|
3102
|
-
return /* @__PURE__ */ s("div", { ref:
|
|
3103
|
-
const
|
|
3104
|
-
() => e.map((
|
|
3103
|
+
return /* @__PURE__ */ s("div", { ref: V, className: m(M.root, $?.root, Z), style: T, children: /* @__PURE__ */ s("div", { className: M.canvas, style: { height: o ?? 240 }, children: /* @__PURE__ */ s("div", { className: M.empty, children: D }) }) });
|
|
3104
|
+
const S = ke(
|
|
3105
|
+
() => e.map((C, X) => X / e.length * 360),
|
|
3105
3106
|
[e]
|
|
3106
|
-
),
|
|
3107
|
-
const
|
|
3108
|
-
for (const
|
|
3109
|
-
for (const
|
|
3110
|
-
const K =
|
|
3111
|
-
typeof K == "number" &&
|
|
3107
|
+
), re = ke(() => {
|
|
3108
|
+
const C = [];
|
|
3109
|
+
for (const se of ue)
|
|
3110
|
+
for (const me of e) {
|
|
3111
|
+
const K = me[se];
|
|
3112
|
+
typeof K == "number" && C.push(K);
|
|
3112
3113
|
}
|
|
3113
|
-
const [,
|
|
3114
|
-
return Math.max(1,
|
|
3115
|
-
}, [e,
|
|
3114
|
+
const [, X] = bt(C);
|
|
3115
|
+
return Math.max(1, X);
|
|
3116
|
+
}, [e, ue]), F = ke(() => qe(0, re, u).filter((X) => X > 0), [re, u]), j = F[F.length - 1] ?? re;
|
|
3116
3117
|
return /* @__PURE__ */ s(
|
|
3117
3118
|
Ve,
|
|
3118
3119
|
{
|
|
3119
|
-
ref:
|
|
3120
|
+
ref: V,
|
|
3120
3121
|
aspectRatio: r,
|
|
3121
3122
|
height: o,
|
|
3122
|
-
className:
|
|
3123
|
-
style:
|
|
3123
|
+
className: Z,
|
|
3124
|
+
style: T,
|
|
3124
3125
|
classes: $,
|
|
3125
|
-
legend:
|
|
3126
|
-
overlay:
|
|
3126
|
+
legend: Q ? /* @__PURE__ */ s(vt, { config: n, classes: $ }) : void 0,
|
|
3127
|
+
overlay: W && ie !== null ? /* @__PURE__ */ s(
|
|
3127
3128
|
et,
|
|
3128
3129
|
{
|
|
3129
|
-
row: e[
|
|
3130
|
-
x: (
|
|
3130
|
+
row: e[ie],
|
|
3131
|
+
x: (V.current?.getBoundingClientRect().width ?? 0) / 2,
|
|
3131
3132
|
y: 16,
|
|
3132
|
-
containerWidth:
|
|
3133
|
+
containerWidth: V.current?.getBoundingClientRect().width ?? 0,
|
|
3133
3134
|
config: n,
|
|
3134
|
-
render:
|
|
3135
|
-
valueFormat:
|
|
3135
|
+
render: w ? () => w(e[ie]) : void 0,
|
|
3136
|
+
valueFormat: R,
|
|
3136
3137
|
titleKey: t,
|
|
3137
3138
|
classes: $
|
|
3138
3139
|
}
|
|
3139
3140
|
) : null,
|
|
3140
|
-
children: ({ width:
|
|
3141
|
-
const
|
|
3142
|
-
return /* @__PURE__ */ z(
|
|
3143
|
-
i &&
|
|
3144
|
-
const
|
|
3141
|
+
children: ({ width: C, height: X }) => {
|
|
3142
|
+
const se = a ? 32 : 8, me = C / 2, K = X / 2, H = Math.max(0, Math.min(C, X) / 2 - se), N = (y) => Math.max(0, y) / j * H;
|
|
3143
|
+
return /* @__PURE__ */ z(ze, { children: [
|
|
3144
|
+
i && F.map((y) => {
|
|
3145
|
+
const v = N(y);
|
|
3145
3146
|
return c === "circle" ? /* @__PURE__ */ s(
|
|
3146
3147
|
"circle",
|
|
3147
3148
|
{
|
|
3148
|
-
className: m(
|
|
3149
|
-
cx:
|
|
3149
|
+
className: m(M.gridLine, $?.grid),
|
|
3150
|
+
cx: me,
|
|
3150
3151
|
cy: K,
|
|
3151
|
-
r:
|
|
3152
|
+
r: v,
|
|
3152
3153
|
fill: "none"
|
|
3153
3154
|
},
|
|
3154
|
-
`ring-${
|
|
3155
|
+
`ring-${y}`
|
|
3155
3156
|
) : /* @__PURE__ */ s(
|
|
3156
3157
|
"polygon",
|
|
3157
3158
|
{
|
|
3158
|
-
className: m(
|
|
3159
|
-
points: Kc(
|
|
3159
|
+
className: m(M.gridLine, $?.grid),
|
|
3160
|
+
points: Kc(me, K, v, S),
|
|
3160
3161
|
fill: "none"
|
|
3161
3162
|
},
|
|
3162
|
-
`ring-${
|
|
3163
|
+
`ring-${y}`
|
|
3163
3164
|
);
|
|
3164
3165
|
}),
|
|
3165
|
-
l &&
|
|
3166
|
-
const
|
|
3166
|
+
l && S.map((y, v) => {
|
|
3167
|
+
const A = mt(me, K, H, y);
|
|
3167
3168
|
return /* @__PURE__ */ s(
|
|
3168
3169
|
"line",
|
|
3169
3170
|
{
|
|
3170
|
-
className: m(
|
|
3171
|
-
x1:
|
|
3171
|
+
className: m(M.gridLine, $?.grid),
|
|
3172
|
+
x1: me,
|
|
3172
3173
|
y1: K,
|
|
3173
|
-
x2:
|
|
3174
|
-
y2:
|
|
3174
|
+
x2: A.x,
|
|
3175
|
+
y2: A.y
|
|
3175
3176
|
},
|
|
3176
|
-
`spoke-${
|
|
3177
|
+
`spoke-${v}`
|
|
3177
3178
|
);
|
|
3178
3179
|
}),
|
|
3179
|
-
h &&
|
|
3180
|
-
const
|
|
3180
|
+
h && F.map((y) => {
|
|
3181
|
+
const v = N(y);
|
|
3181
3182
|
return /* @__PURE__ */ s(
|
|
3182
3183
|
"text",
|
|
3183
3184
|
{
|
|
3184
|
-
className: m(
|
|
3185
|
-
x:
|
|
3186
|
-
y: K -
|
|
3185
|
+
className: m(M.axisLabel, $?.axisLabel),
|
|
3186
|
+
x: me + 4,
|
|
3187
|
+
y: K - v,
|
|
3187
3188
|
textAnchor: "start",
|
|
3188
3189
|
dominantBaseline: "middle",
|
|
3189
|
-
children:
|
|
3190
|
+
children: R ? R(y) : y
|
|
3190
3191
|
},
|
|
3191
|
-
`raxis-${
|
|
3192
|
+
`raxis-${y}`
|
|
3192
3193
|
);
|
|
3193
3194
|
}),
|
|
3194
|
-
a && e.map((
|
|
3195
|
-
const
|
|
3195
|
+
a && e.map((y, v) => {
|
|
3196
|
+
const A = S[v], _ = mt(me, K, H + 14, A), q = _.x < me - 1 ? "end" : _.x > me + 1 ? "start" : "middle";
|
|
3196
3197
|
if (L)
|
|
3197
3198
|
return /* @__PURE__ */ s("g", { children: L({
|
|
3198
|
-
row:
|
|
3199
|
-
index:
|
|
3200
|
-
angle:
|
|
3199
|
+
row: y,
|
|
3200
|
+
index: v,
|
|
3201
|
+
angle: A,
|
|
3201
3202
|
x: _.x,
|
|
3202
3203
|
y: _.y,
|
|
3203
|
-
textAnchor:
|
|
3204
|
-
}) }, `label-${
|
|
3205
|
-
const Y = String(
|
|
3204
|
+
textAnchor: q
|
|
3205
|
+
}) }, `label-${v}`);
|
|
3206
|
+
const Y = String(y[t]), J = b ? b(Y) : Y;
|
|
3206
3207
|
return /* @__PURE__ */ s(
|
|
3207
3208
|
"text",
|
|
3208
3209
|
{
|
|
3209
|
-
className: m(
|
|
3210
|
+
className: m(M.axisLabel, $?.axisLabel),
|
|
3210
3211
|
x: _.x,
|
|
3211
3212
|
y: _.y,
|
|
3212
|
-
textAnchor:
|
|
3213
|
+
textAnchor: q,
|
|
3213
3214
|
dominantBaseline: "middle",
|
|
3214
|
-
children:
|
|
3215
|
+
children: J
|
|
3215
3216
|
},
|
|
3216
|
-
`label-${
|
|
3217
|
+
`label-${v}`
|
|
3217
3218
|
);
|
|
3218
3219
|
}),
|
|
3219
|
-
|
|
3220
|
-
const
|
|
3221
|
-
const
|
|
3222
|
-
return mt(
|
|
3223
|
-
}), _ =
|
|
3224
|
-
return /* @__PURE__ */ z("g", { className: m(
|
|
3220
|
+
ue.map((y) => {
|
|
3221
|
+
const v = n[y], A = e.map((q, Y) => {
|
|
3222
|
+
const J = q[y], G = N(typeof J == "number" ? J : 0);
|
|
3223
|
+
return mt(me, K, G, S[Y]);
|
|
3224
|
+
}), _ = A.map((q) => `${q.x},${q.y}`).join(" ");
|
|
3225
|
+
return /* @__PURE__ */ z("g", { className: m(M.series, $?.series), children: [
|
|
3225
3226
|
/* @__PURE__ */ s(
|
|
3226
3227
|
"polygon",
|
|
3227
3228
|
{
|
|
3228
3229
|
points: _,
|
|
3229
|
-
fill:
|
|
3230
|
+
fill: v.color,
|
|
3230
3231
|
fillOpacity: f,
|
|
3231
|
-
stroke:
|
|
3232
|
-
strokeWidth:
|
|
3232
|
+
stroke: v.color,
|
|
3233
|
+
strokeWidth: p,
|
|
3233
3234
|
strokeLinejoin: "round",
|
|
3234
3235
|
strokeLinecap: "round"
|
|
3235
3236
|
}
|
|
3236
3237
|
),
|
|
3237
|
-
d &&
|
|
3238
|
+
d && A.map((q, Y) => /* @__PURE__ */ s(
|
|
3238
3239
|
"circle",
|
|
3239
3240
|
{
|
|
3240
|
-
className: m(
|
|
3241
|
-
cx:
|
|
3242
|
-
cy:
|
|
3243
|
-
r:
|
|
3244
|
-
fill:
|
|
3241
|
+
className: m(M.point, $?.point),
|
|
3242
|
+
cx: q.x,
|
|
3243
|
+
cy: q.y,
|
|
3244
|
+
r: ie === Y ? 5 : 3.5,
|
|
3245
|
+
fill: v.color
|
|
3245
3246
|
},
|
|
3246
|
-
`${
|
|
3247
|
+
`${y}-${Y}`
|
|
3247
3248
|
))
|
|
3248
|
-
] },
|
|
3249
|
+
] }, y);
|
|
3249
3250
|
}),
|
|
3250
3251
|
/* @__PURE__ */ s(
|
|
3251
3252
|
"rect",
|
|
3252
3253
|
{
|
|
3253
|
-
className:
|
|
3254
|
+
className: M.interactionLayer,
|
|
3254
3255
|
x: 0,
|
|
3255
3256
|
y: 0,
|
|
3256
|
-
width:
|
|
3257
|
-
height:
|
|
3258
|
-
onMouseMove: (
|
|
3259
|
-
const
|
|
3260
|
-
if (
|
|
3261
|
-
let
|
|
3262
|
-
|
|
3263
|
-
const Y = 360 / e.length,
|
|
3264
|
-
|
|
3257
|
+
width: C,
|
|
3258
|
+
height: X,
|
|
3259
|
+
onMouseMove: (y) => {
|
|
3260
|
+
const v = y.currentTarget.getBoundingClientRect(), A = y.clientX - v.left - me, _ = y.clientY - v.top - K;
|
|
3261
|
+
if (A === 0 && _ === 0) return;
|
|
3262
|
+
let q = Math.atan2(_, A) * 180 / Math.PI + 90;
|
|
3263
|
+
q < 0 && (q += 360), q >= 360 && (q -= 360);
|
|
3264
|
+
const Y = 360 / e.length, J = Math.round(q / Y) % e.length;
|
|
3265
|
+
ne(J);
|
|
3265
3266
|
},
|
|
3266
|
-
onMouseLeave: () =>
|
|
3267
|
+
onMouseLeave: () => ne(null)
|
|
3267
3268
|
}
|
|
3268
3269
|
)
|
|
3269
3270
|
] });
|
|
@@ -3302,8 +3303,8 @@ function el(e, t, n = 2) {
|
|
|
3302
3303
|
const h = a / t;
|
|
3303
3304
|
let u = 0;
|
|
3304
3305
|
for (let f = l - t + 1; f <= l; f++) {
|
|
3305
|
-
const
|
|
3306
|
-
u +=
|
|
3306
|
+
const p = e[f].close - h;
|
|
3307
|
+
u += p * p;
|
|
3307
3308
|
}
|
|
3308
3309
|
u /= t;
|
|
3309
3310
|
const d = Math.sqrt(u);
|
|
@@ -3332,36 +3333,42 @@ function Wt(e, t) {
|
|
|
3332
3333
|
function _l(e) {
|
|
3333
3334
|
return e.map((t) => typeof t.volume == "number" ? t.volume : null);
|
|
3334
3335
|
}
|
|
3335
|
-
const
|
|
3336
|
+
const Me = 86400;
|
|
3336
3337
|
function on(e) {
|
|
3337
3338
|
switch (e) {
|
|
3338
3339
|
case "1D":
|
|
3339
|
-
return
|
|
3340
|
+
return Me;
|
|
3340
3341
|
case "5D":
|
|
3341
|
-
return 5 *
|
|
3342
|
+
return 5 * Me;
|
|
3342
3343
|
case "1M":
|
|
3343
|
-
return 30 *
|
|
3344
|
+
return 30 * Me;
|
|
3344
3345
|
case "3M":
|
|
3345
|
-
return 90 *
|
|
3346
|
+
return 90 * Me;
|
|
3346
3347
|
case "6M":
|
|
3347
|
-
return 180 *
|
|
3348
|
+
return 180 * Me;
|
|
3348
3349
|
case "1Y":
|
|
3349
|
-
return 365 *
|
|
3350
|
+
return 365 * Me;
|
|
3350
3351
|
case "5Y":
|
|
3351
|
-
return 5 * 365 *
|
|
3352
|
+
return 5 * 365 * Me;
|
|
3353
|
+
case "10Y":
|
|
3354
|
+
return 10 * 365 * Me;
|
|
3355
|
+
case "20Y":
|
|
3356
|
+
return 20 * 365 * Me;
|
|
3357
|
+
case "MAX":
|
|
3358
|
+
return 100 * 365 * Me;
|
|
3352
3359
|
}
|
|
3353
3360
|
const t = /^(\d+)\s*([dDwWmMyYhH])$/.exec(e);
|
|
3354
3361
|
if (t) {
|
|
3355
3362
|
const n = Number(t[1]), r = t[2].toLowerCase();
|
|
3356
3363
|
if (r === "h") return n * 3600;
|
|
3357
|
-
if (r === "d") return n *
|
|
3358
|
-
if (r === "w") return n * 7 *
|
|
3359
|
-
if (r === "m") return n * 30 *
|
|
3360
|
-
if (r === "y") return n * 365 *
|
|
3364
|
+
if (r === "d") return n * Me;
|
|
3365
|
+
if (r === "w") return n * 7 * Me;
|
|
3366
|
+
if (r === "m") return n * 30 * Me;
|
|
3367
|
+
if (r === "y") return n * 365 * Me;
|
|
3361
3368
|
}
|
|
3362
|
-
return 30 *
|
|
3369
|
+
return 30 * Me;
|
|
3363
3370
|
}
|
|
3364
|
-
function
|
|
3371
|
+
function Yl(e) {
|
|
3365
3372
|
switch (e) {
|
|
3366
3373
|
case "1D":
|
|
3367
3374
|
return "5";
|
|
@@ -3377,11 +3384,17 @@ function Ul(e) {
|
|
|
3377
3384
|
return "D";
|
|
3378
3385
|
case "5Y":
|
|
3379
3386
|
return "W";
|
|
3387
|
+
case "10Y":
|
|
3388
|
+
return "W";
|
|
3389
|
+
case "20Y":
|
|
3390
|
+
return "M";
|
|
3391
|
+
case "MAX":
|
|
3392
|
+
return "M";
|
|
3380
3393
|
}
|
|
3381
3394
|
const t = on(e);
|
|
3382
|
-
return t >= 3 * 365 *
|
|
3395
|
+
return t >= 3 * 365 * Me ? "W" : t >= 180 * Me ? "D" : t >= 60 * Me ? "240" : t >= 14 * Me ? "60" : t >= 3 * Me ? "15" : "5";
|
|
3383
3396
|
}
|
|
3384
|
-
function
|
|
3397
|
+
function Ul(e) {
|
|
3385
3398
|
if (e === "W" || e === "M") return "5Y";
|
|
3386
3399
|
if (e === "D") return "1Y";
|
|
3387
3400
|
const t = Number(e);
|
|
@@ -3402,208 +3415,208 @@ function Vl({
|
|
|
3402
3415
|
downColor: u = "var(--crk-color-danger)",
|
|
3403
3416
|
lineColor: d = "var(--crk-chart-1)",
|
|
3404
3417
|
timezone: f,
|
|
3405
|
-
defaultTimezone:
|
|
3418
|
+
defaultTimezone: p = "local",
|
|
3406
3419
|
onTimezoneChange: L,
|
|
3407
|
-
showConfigPanel:
|
|
3408
|
-
onCrosshair:
|
|
3409
|
-
onVisibleRangeChange:
|
|
3410
|
-
className:
|
|
3411
|
-
style:
|
|
3420
|
+
showConfigPanel: b = !0,
|
|
3421
|
+
onCrosshair: R,
|
|
3422
|
+
onVisibleRangeChange: w,
|
|
3423
|
+
className: Q,
|
|
3424
|
+
style: W
|
|
3412
3425
|
}) {
|
|
3413
|
-
const
|
|
3414
|
-
}),
|
|
3415
|
-
|
|
3416
|
-
const [
|
|
3417
|
-
(
|
|
3418
|
-
f === void 0 &&
|
|
3426
|
+
const D = oe(null), Z = oe(null), T = oe([]), $ = oe({ from: 0, to: 0 }), ie = oe(null), ne = oe(null), V = oe(!1), ue = oe(null), S = oe(null), re = oe(1), F = oe({ width: 0, height: 0 }), j = oe(() => {
|
|
3427
|
+
}), C = oe(R), X = oe(w);
|
|
3428
|
+
C.current = R, X.current = w;
|
|
3429
|
+
const [se, me] = Re(null), [K, H] = Re(p), N = f ?? K, y = pe(
|
|
3430
|
+
(g) => {
|
|
3431
|
+
f === void 0 && H(g), L?.(g);
|
|
3419
3432
|
},
|
|
3420
3433
|
[f, L]
|
|
3421
|
-
),
|
|
3434
|
+
), v = ke(
|
|
3422
3435
|
() => ({ up: h, down: u, line: d }),
|
|
3423
3436
|
[h, u, d]
|
|
3424
|
-
),
|
|
3425
|
-
const
|
|
3426
|
-
if (!
|
|
3427
|
-
const x =
|
|
3437
|
+
), A = c, _ = A.some((g) => g.type === "rsi"), q = A.some((g) => g.type === "volume"), Y = pe(() => {
|
|
3438
|
+
const g = Z.current;
|
|
3439
|
+
if (!g) return;
|
|
3440
|
+
const x = g.getContext("2d");
|
|
3428
3441
|
if (!x) return;
|
|
3429
|
-
const { width: ee, height:
|
|
3430
|
-
if (ee === 0 ||
|
|
3431
|
-
const
|
|
3432
|
-
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0,
|
|
3433
|
-
const I = pl(
|
|
3434
|
-
if (
|
|
3435
|
-
gl(x, ee,
|
|
3442
|
+
const { width: ee, height: E } = F.current;
|
|
3443
|
+
if (ee === 0 || E === 0) return;
|
|
3444
|
+
const U = re.current;
|
|
3445
|
+
x.save(), x.setTransform(1, 0, 0, 1, 0, 0), x.clearRect(0, 0, g.width, g.height), x.scale(U, U);
|
|
3446
|
+
const I = pl(D.current, v), fe = ln(D.current), ce = T.current;
|
|
3447
|
+
if (ce.length === 0) {
|
|
3448
|
+
gl(x, ee, E, I), x.restore();
|
|
3436
3449
|
return;
|
|
3437
3450
|
}
|
|
3438
|
-
const
|
|
3439
|
-
$.current = { from: le, to:
|
|
3440
|
-
const
|
|
3441
|
-
const Ie =
|
|
3442
|
-
return
|
|
3443
|
-
}, Ae =
|
|
3444
|
-
Lt(x,
|
|
3445
|
-
for (let
|
|
3446
|
-
const Ie =
|
|
3447
|
-
He && kl(x, He, Ie,
|
|
3451
|
+
const B = Nt(ee, E, _, q), { from: le, to: ye } = hl($.current, ce.length);
|
|
3452
|
+
$.current = { from: le, to: ye };
|
|
3453
|
+
const te = ce.slice(Math.max(0, Math.floor(le)), Math.min(ce.length, Math.ceil(ye) + 1)), ae = (he) => {
|
|
3454
|
+
const Ie = ye - le + 1, He = B.plotWidth / Ie;
|
|
3455
|
+
return B.plotLeft + (he - le + 0.5) * He;
|
|
3456
|
+
}, Ae = B.plotWidth / (ye - le + 1), De = A.map((he) => ml(he, ce)).filter((he) => he !== null).map((he) => ({ ...he, color: fe(he.color) })), xe = cn(B.main, te, De, le, ye);
|
|
3457
|
+
Lt(x, B.plotLeft, B.plotRight, xe, I), yl(x, B, xe, i, I), x.save(), x.beginPath(), x.rect(B.plotLeft, xe.paneTop, B.plotWidth, xe.paneHeight), x.clip();
|
|
3458
|
+
for (let he = 0; he < A.length; he++) {
|
|
3459
|
+
const Ie = A[he], He = De[he];
|
|
3460
|
+
He && kl(x, He, Ie, ce, le, ye, ae, xe);
|
|
3448
3461
|
}
|
|
3449
|
-
if (o === "candle" ? vl(x,
|
|
3450
|
-
const
|
|
3451
|
-
Lt(x,
|
|
3462
|
+
if (o === "candle" ? vl(x, ce, le, ye, ae, Ae, xe, { up: I.up, down: I.down }) : o === "bar" ? bl(x, ce, le, ye, ae, Ae, xe, { up: I.up, down: I.down }) : xl(x, ce, le, ye, ae, xe, I.line, o === "area"), x.restore(), B.volume) {
|
|
3463
|
+
const he = fl(B.volume, ce, le, ye);
|
|
3464
|
+
Lt(x, B.plotLeft, B.plotRight, he, I, !0), Ft(x, B, B.volume, "Volume", I), x.save(), x.beginPath(), x.rect(B.plotLeft, he.paneTop, B.plotWidth, he.paneHeight), x.clip(), Ml(x, ce, le, ye, ae, Ae, he, { up: I.up, down: I.down }), x.restore();
|
|
3452
3465
|
}
|
|
3453
|
-
if (
|
|
3454
|
-
const
|
|
3455
|
-
paneTop:
|
|
3456
|
-
paneBottom:
|
|
3457
|
-
paneHeight:
|
|
3466
|
+
if (B.rsi) {
|
|
3467
|
+
const he = A.find((tt) => tt.type === "rsi"), Ie = he && he.type === "rsi" ? he.period ?? 14 : 14, He = he && he.type === "rsi" ? he.overbought ?? 70 : 70, Ge = he && he.type === "rsi" ? he.oversold ?? 30 : 30, Ee = (he && he.type === "rsi" ? he.color : void 0) ?? "var(--crk-chart-5)", xt = fe(Ee), kt = tl(ce, Ie), Oe = {
|
|
3468
|
+
paneTop: B.rsi.top,
|
|
3469
|
+
paneBottom: B.rsi.bottom,
|
|
3470
|
+
paneHeight: B.rsi.height,
|
|
3458
3471
|
priceMin: 0,
|
|
3459
3472
|
priceMax: 100,
|
|
3460
3473
|
ticks: [Ge, 50, He]
|
|
3461
3474
|
};
|
|
3462
|
-
Lt(x,
|
|
3475
|
+
Lt(x, B.plotLeft, B.plotRight, Oe, I, !0), Ft(x, B, B.rsi, `RSI ${Ie}`, I), x.save(), x.beginPath(), x.rect(B.plotLeft, Oe.paneTop, B.plotWidth, Oe.paneHeight), x.clip(), Qe(x, kt, le, ye, ae, Oe, xt), x.restore(), wl(x, B, Oe, He, Ge, I);
|
|
3463
3476
|
}
|
|
3464
|
-
$l(x,
|
|
3465
|
-
}, [o,
|
|
3466
|
-
|
|
3467
|
-
const
|
|
3468
|
-
if (
|
|
3477
|
+
$l(x, B, ce, le, ye, n, I), ie.current && Nl(x, B, ie.current, ce, le, ye, ae, i, xe, N, I), x.restore();
|
|
3478
|
+
}, [o, A, _, q, i, v, n, N]);
|
|
3479
|
+
j.current = Y;
|
|
3480
|
+
const J = pe(() => {
|
|
3481
|
+
if (S.current === null) {
|
|
3469
3482
|
if (typeof requestAnimationFrame > "u") {
|
|
3470
|
-
|
|
3483
|
+
j.current();
|
|
3471
3484
|
return;
|
|
3472
3485
|
}
|
|
3473
|
-
|
|
3474
|
-
|
|
3486
|
+
S.current = requestAnimationFrame(() => {
|
|
3487
|
+
S.current = null, j.current();
|
|
3475
3488
|
});
|
|
3476
3489
|
}
|
|
3477
3490
|
}, []);
|
|
3478
|
-
|
|
3479
|
-
const
|
|
3480
|
-
if (!
|
|
3491
|
+
zt(() => {
|
|
3492
|
+
const g = D.current;
|
|
3493
|
+
if (!g) return;
|
|
3481
3494
|
const x = () => {
|
|
3482
|
-
const
|
|
3483
|
-
|
|
3484
|
-
const I =
|
|
3485
|
-
I && (I.width = Math.round(
|
|
3495
|
+
const E = g.getBoundingClientRect(), U = typeof window < "u" && window.devicePixelRatio || 1;
|
|
3496
|
+
re.current = U, F.current = { width: E.width, height: E.height };
|
|
3497
|
+
const I = Z.current;
|
|
3498
|
+
I && (I.width = Math.round(E.width * U), I.height = Math.round(E.height * U), I.style.width = `${E.width}px`, I.style.height = `${E.height}px`), J();
|
|
3486
3499
|
};
|
|
3487
3500
|
if (x(), typeof ResizeObserver > "u") return;
|
|
3488
3501
|
const ee = new ResizeObserver(x);
|
|
3489
|
-
return ee.observe(
|
|
3490
|
-
}, [
|
|
3491
|
-
let
|
|
3492
|
-
const x = Math.floor(Date.now() / 1e3), ee =
|
|
3493
|
-
|
|
3494
|
-
if (
|
|
3495
|
-
const
|
|
3496
|
-
|
|
3497
|
-
const
|
|
3502
|
+
return ee.observe(g), () => ee.disconnect();
|
|
3503
|
+
}, [J]), Le(() => {
|
|
3504
|
+
let g = !1;
|
|
3505
|
+
const x = Math.floor(Date.now() / 1e3), ee = Xt(n), E = r === "MAX", U = r !== void 0 ? on(r) : ee * l, I = r !== void 0 ? Math.max(10, Math.ceil(U / ee)) : l, fe = E ? 0 : x - U;
|
|
3506
|
+
T.current = [], $.current = { from: 0, to: 0 }, J(), e.getBars({ symbol: t, resolution: n, from: fe, to: x, countBack: I }).then((B) => {
|
|
3507
|
+
if (g) return;
|
|
3508
|
+
const le = [...B].sort((te, ae) => te.time - ae.time);
|
|
3509
|
+
T.current = le;
|
|
3510
|
+
const ye = le.length - 1;
|
|
3498
3511
|
if (r !== void 0)
|
|
3499
|
-
$.current = { from: 0, to:
|
|
3512
|
+
$.current = { from: 0, to: ye };
|
|
3500
3513
|
else {
|
|
3501
|
-
const
|
|
3514
|
+
const te = Math.min(le.length, Math.min(200, l));
|
|
3502
3515
|
$.current = {
|
|
3503
|
-
from: Math.max(0,
|
|
3504
|
-
to:
|
|
3516
|
+
from: Math.max(0, ye - te + 1),
|
|
3517
|
+
to: ye
|
|
3505
3518
|
};
|
|
3506
3519
|
}
|
|
3507
|
-
|
|
3520
|
+
X.current?.($.current, le), J();
|
|
3508
3521
|
}).catch(() => {
|
|
3509
3522
|
});
|
|
3510
|
-
const
|
|
3523
|
+
const ce = e.subscribeBars({
|
|
3511
3524
|
symbol: t,
|
|
3512
3525
|
resolution: n,
|
|
3513
|
-
onTick: (
|
|
3514
|
-
if (
|
|
3515
|
-
const
|
|
3516
|
-
if (
|
|
3517
|
-
|
|
3518
|
-
else if (!
|
|
3519
|
-
|
|
3520
|
-
const
|
|
3521
|
-
|
|
3526
|
+
onTick: (B) => {
|
|
3527
|
+
if (g) return;
|
|
3528
|
+
const le = T.current, ye = le[le.length - 1];
|
|
3529
|
+
if (ye && ye.time === B.time)
|
|
3530
|
+
le[le.length - 1] = B;
|
|
3531
|
+
else if (!ye || B.time > ye.time) {
|
|
3532
|
+
le.push(B);
|
|
3533
|
+
const te = $.current;
|
|
3534
|
+
te.to >= le.length - 2 && ($.current = { from: te.from + 1, to: te.to + 1 });
|
|
3522
3535
|
}
|
|
3523
|
-
|
|
3536
|
+
J();
|
|
3524
3537
|
}
|
|
3525
3538
|
});
|
|
3526
|
-
return
|
|
3527
|
-
|
|
3539
|
+
return ue.current = ce, () => {
|
|
3540
|
+
g = !0, ue.current !== null && (e.unsubscribeBars(ue.current), ue.current = null);
|
|
3528
3541
|
};
|
|
3529
3542
|
}, [e, t, n, r, l]);
|
|
3530
|
-
const
|
|
3531
|
-
|
|
3532
|
-
}, []),
|
|
3533
|
-
|
|
3543
|
+
const k = pe((g) => {
|
|
3544
|
+
me(g), C.current?.(g);
|
|
3545
|
+
}, []), G = pe((g) => {
|
|
3546
|
+
g.currentTarget.setPointerCapture(g.pointerId);
|
|
3534
3547
|
const x = $.current;
|
|
3535
|
-
|
|
3536
|
-
}, []),
|
|
3537
|
-
(
|
|
3538
|
-
const x =
|
|
3539
|
-
if (
|
|
3540
|
-
const { startX:
|
|
3541
|
-
let De =
|
|
3542
|
-
const
|
|
3543
|
-
De < 0 && (Se(), De = 0, xe =
|
|
3548
|
+
ne.current = { startX: g.clientX, from: x.from, to: x.to };
|
|
3549
|
+
}, []), O = pe(
|
|
3550
|
+
(g) => {
|
|
3551
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left, E = g.clientY - x.top;
|
|
3552
|
+
if (ie.current = { x: ee, y: E }, ne.current) {
|
|
3553
|
+
const { startX: fe, from: ce, to: B } = ne.current, { width: le } = F.current, ye = Math.max(1, le - Ct), te = B - ce + 1, ae = ye / te, Ae = -(g.clientX - fe) / ae;
|
|
3554
|
+
let De = ce + Ae, xe = B + Ae;
|
|
3555
|
+
const he = T.current.length;
|
|
3556
|
+
De < 0 && (Se(), De = 0, xe = te - 1), xe > he - 1 && (xe = he - 1, De = xe - te + 1), $.current = { from: De, to: xe }, X.current?.($.current, T.current);
|
|
3544
3557
|
}
|
|
3545
|
-
const
|
|
3546
|
-
if (ee >=
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3558
|
+
const U = Nt(x.width, x.height, _, q), I = $.current;
|
|
3559
|
+
if (ee >= U.plotLeft && ee <= U.plotRight) {
|
|
3560
|
+
const fe = I.to - I.from + 1, ce = U.plotWidth / fe, B = Math.round(I.from + (ee - U.plotLeft) / ce - 0.5), le = T.current, ye = Math.max(0, Math.min(le.length - 1, B)), te = le[ye] ?? null, ae = Ll(E, U, le, I.from, I.to);
|
|
3561
|
+
k({ barIndex: ye, bar: te, priceAtCursor: ae });
|
|
3549
3562
|
} else
|
|
3550
|
-
|
|
3551
|
-
|
|
3563
|
+
k(null);
|
|
3564
|
+
J();
|
|
3552
3565
|
},
|
|
3553
|
-
[_,
|
|
3554
|
-
),
|
|
3555
|
-
|
|
3556
|
-
}, []),
|
|
3557
|
-
|
|
3558
|
-
}, [
|
|
3559
|
-
(
|
|
3560
|
-
|
|
3561
|
-
const x =
|
|
3566
|
+
[_, q, J, k]
|
|
3567
|
+
), de = pe((g) => {
|
|
3568
|
+
g.currentTarget.releasePointerCapture(g.pointerId), ne.current = null;
|
|
3569
|
+
}, []), ge = pe(() => {
|
|
3570
|
+
ie.current = null, ne.current = null, k(null), J();
|
|
3571
|
+
}, [J, k]), be = pe(
|
|
3572
|
+
(g) => {
|
|
3573
|
+
g.preventDefault();
|
|
3574
|
+
const x = g.currentTarget.getBoundingClientRect(), ee = g.clientX - x.left, E = Nt(x.width, x.height, _, q), U = $.current, I = T.current;
|
|
3562
3575
|
if (I.length === 0) return;
|
|
3563
|
-
const
|
|
3564
|
-
|
|
3565
|
-
Math.min(I.length,
|
|
3566
|
-
), le =
|
|
3567
|
-
let
|
|
3568
|
-
|
|
3576
|
+
const fe = U.to - U.from + 1, ce = g.deltaY > 0 ? 1 + Ot : 1 / (1 + Ot), B = Math.max(
|
|
3577
|
+
E.plotWidth / cl,
|
|
3578
|
+
Math.min(I.length, E.plotWidth / il, fe * ce)
|
|
3579
|
+
), le = U.from + (ee - E.plotLeft) / (E.plotWidth / fe), ye = (le - U.from) / fe;
|
|
3580
|
+
let te = le - ye * B, ae = te + B - 1;
|
|
3581
|
+
te < 0 && (te = 0, ae = B - 1), ae > I.length - 1 && (ae = I.length - 1, te = ae - B + 1), $.current = { from: te, to: ae }, X.current?.($.current, I), J();
|
|
3569
3582
|
},
|
|
3570
|
-
[_,
|
|
3571
|
-
), Ce =
|
|
3572
|
-
(
|
|
3573
|
-
const x = $.current, ee = x.to - x.from + 1,
|
|
3574
|
-
if (
|
|
3575
|
-
let
|
|
3576
|
-
if (
|
|
3577
|
-
else if (
|
|
3583
|
+
[_, q, J]
|
|
3584
|
+
), Ce = pe(
|
|
3585
|
+
(g) => {
|
|
3586
|
+
const x = $.current, ee = x.to - x.from + 1, E = T.current;
|
|
3587
|
+
if (E.length === 0) return;
|
|
3588
|
+
let U = 0;
|
|
3589
|
+
if (g.key === "ArrowLeft") U = -Math.max(1, Math.floor(ee * 0.1));
|
|
3590
|
+
else if (g.key === "ArrowRight") U = Math.max(1, Math.floor(ee * 0.1));
|
|
3578
3591
|
else return;
|
|
3579
|
-
|
|
3580
|
-
let I = x.from +
|
|
3581
|
-
I < 0 && (I = 0,
|
|
3592
|
+
g.preventDefault();
|
|
3593
|
+
let I = x.from + U, fe = x.to + U;
|
|
3594
|
+
I < 0 && (I = 0, fe = ee - 1), fe > E.length - 1 && (fe = E.length - 1, I = fe - ee + 1), $.current = { from: I, to: fe }, X.current?.($.current, E), J();
|
|
3582
3595
|
},
|
|
3583
|
-
[
|
|
3584
|
-
), Se =
|
|
3585
|
-
if (
|
|
3586
|
-
const
|
|
3587
|
-
if (
|
|
3588
|
-
|
|
3589
|
-
const x =
|
|
3590
|
-
e.getBars({ symbol: t, resolution: n, from:
|
|
3596
|
+
[J]
|
|
3597
|
+
), Se = pe(() => {
|
|
3598
|
+
if (V.current) return;
|
|
3599
|
+
const g = T.current;
|
|
3600
|
+
if (g.length === 0) return;
|
|
3601
|
+
V.current = !0;
|
|
3602
|
+
const x = Xt(n), ee = g[0].time, E = ee - x * l, U = ee - x;
|
|
3603
|
+
e.getBars({ symbol: t, resolution: n, from: E, to: U, countBack: l }).then((I) => {
|
|
3591
3604
|
if (I.length === 0) {
|
|
3592
|
-
|
|
3605
|
+
V.current = !1;
|
|
3593
3606
|
return;
|
|
3594
3607
|
}
|
|
3595
|
-
const
|
|
3596
|
-
|
|
3608
|
+
const ce = [...I].sort((le, ye) => le.time - ye.time).filter((le) => le.time < ee), B = $.current;
|
|
3609
|
+
T.current = [...ce, ...g], $.current = { from: B.from + ce.length, to: B.to + ce.length }, V.current = !1, J();
|
|
3597
3610
|
}).catch(() => {
|
|
3598
|
-
|
|
3611
|
+
V.current = !1;
|
|
3599
3612
|
});
|
|
3600
|
-
}, [e, t, n, l,
|
|
3613
|
+
}, [e, t, n, l, J]);
|
|
3601
3614
|
return /* @__PURE__ */ z(
|
|
3602
3615
|
"div",
|
|
3603
3616
|
{
|
|
3604
|
-
ref:
|
|
3605
|
-
className: m(
|
|
3606
|
-
style: { ...
|
|
3617
|
+
ref: D,
|
|
3618
|
+
className: m(M.root, Q),
|
|
3619
|
+
style: { ...W, height: a, position: "relative" },
|
|
3607
3620
|
tabIndex: 0,
|
|
3608
3621
|
role: "figure",
|
|
3609
3622
|
"aria-label": `${t} ${n} chart`,
|
|
@@ -3612,20 +3625,20 @@ function Vl({
|
|
|
3612
3625
|
/* @__PURE__ */ s(
|
|
3613
3626
|
"canvas",
|
|
3614
3627
|
{
|
|
3615
|
-
ref:
|
|
3616
|
-
className:
|
|
3617
|
-
onPointerDown:
|
|
3618
|
-
onPointerMove:
|
|
3619
|
-
onPointerUp:
|
|
3620
|
-
onPointerLeave:
|
|
3628
|
+
ref: Z,
|
|
3629
|
+
className: M.svg,
|
|
3630
|
+
onPointerDown: G,
|
|
3631
|
+
onPointerMove: O,
|
|
3632
|
+
onPointerUp: de,
|
|
3633
|
+
onPointerLeave: ge,
|
|
3621
3634
|
onWheel: be,
|
|
3622
|
-
style: { cursor:
|
|
3635
|
+
style: { cursor: ne.current ? "grabbing" : "crosshair", touchAction: "none" }
|
|
3623
3636
|
}
|
|
3624
3637
|
),
|
|
3625
3638
|
/* @__PURE__ */ z(
|
|
3626
3639
|
"div",
|
|
3627
3640
|
{
|
|
3628
|
-
className:
|
|
3641
|
+
className: M.tradingHeader,
|
|
3629
3642
|
style: {
|
|
3630
3643
|
position: "absolute",
|
|
3631
3644
|
top: ol,
|
|
@@ -3641,25 +3654,25 @@ function Vl({
|
|
|
3641
3654
|
/* @__PURE__ */ z("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
|
|
3642
3655
|
/* @__PURE__ */ s("strong", { children: t }),
|
|
3643
3656
|
/* @__PURE__ */ s("span", { style: { color: "var(--crk-color-text-muted)" }, children: n }),
|
|
3644
|
-
|
|
3657
|
+
se?.bar && /* @__PURE__ */ z("span", { style: { color: "var(--crk-color-text-muted)", whiteSpace: "nowrap" }, children: [
|
|
3645
3658
|
"O ",
|
|
3646
|
-
|
|
3659
|
+
se.bar.open.toFixed(i),
|
|
3647
3660
|
" · H ",
|
|
3648
|
-
|
|
3661
|
+
se.bar.high.toFixed(i),
|
|
3649
3662
|
" · L",
|
|
3650
3663
|
" ",
|
|
3651
|
-
|
|
3664
|
+
se.bar.low.toFixed(i),
|
|
3652
3665
|
" · C ",
|
|
3653
|
-
|
|
3666
|
+
se.bar.close.toFixed(i)
|
|
3654
3667
|
] })
|
|
3655
3668
|
] }),
|
|
3656
|
-
|
|
3669
|
+
b && /* @__PURE__ */ s("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ s(
|
|
3657
3670
|
qt,
|
|
3658
3671
|
{
|
|
3659
3672
|
position: "bottom",
|
|
3660
3673
|
asChild: !0,
|
|
3661
3674
|
trigger: /* @__PURE__ */ s(
|
|
3662
|
-
|
|
3675
|
+
Ut,
|
|
3663
3676
|
{
|
|
3664
3677
|
variant: "ghost",
|
|
3665
3678
|
size: "sm",
|
|
@@ -3671,8 +3684,8 @@ function Vl({
|
|
|
3671
3684
|
content: /* @__PURE__ */ s(
|
|
3672
3685
|
dl,
|
|
3673
3686
|
{
|
|
3674
|
-
timezone:
|
|
3675
|
-
onTimezoneChange:
|
|
3687
|
+
timezone: N,
|
|
3688
|
+
onTimezoneChange: y
|
|
3676
3689
|
}
|
|
3677
3690
|
)
|
|
3678
3691
|
}
|
|
@@ -3745,9 +3758,9 @@ function Nt(e, t, n, r) {
|
|
|
3745
3758
|
const c = Math.max(0, e - Ct), i = rl, l = Math.max(i, t - At), a = Math.max(0, c - 0), h = Math.max(0, l - i);
|
|
3746
3759
|
let u = h, d = i;
|
|
3747
3760
|
const f = { top: i, bottom: l, height: h };
|
|
3748
|
-
let
|
|
3749
|
-
const
|
|
3750
|
-
return u = h * (1 -
|
|
3761
|
+
let p = null, L = null;
|
|
3762
|
+
const b = n ? Ht.rsi : 0, R = r ? Ht.volume : 0;
|
|
3763
|
+
return u = h * (1 - b - R), f.top = d, f.height = u, f.bottom = f.top + u, d = f.bottom, n && (p = { top: d, height: h * b, bottom: d + h * b }, d = p.bottom), r && (L = { top: d, height: h * R, bottom: d + h * R }), { width: e, height: t, plotLeft: 0, plotRight: c, plotTop: i, plotBottom: l, plotWidth: a, plotHeight: h, main: f, rsi: p, volume: L };
|
|
3751
3764
|
}
|
|
3752
3765
|
function hl(e, t) {
|
|
3753
3766
|
if (t === 0) return { from: 0, to: 0 };
|
|
@@ -3782,11 +3795,11 @@ function cn(e, t, n, r, o) {
|
|
|
3782
3795
|
d.low < c && (c = d.low), d.high > i && (i = d.high);
|
|
3783
3796
|
for (const d of n) {
|
|
3784
3797
|
const f = d.kind === "line" ? [d.values] : [d.upper, d.lower];
|
|
3785
|
-
for (const
|
|
3786
|
-
const L = Math.max(0, Math.floor(r)),
|
|
3787
|
-
for (let
|
|
3788
|
-
const
|
|
3789
|
-
|
|
3798
|
+
for (const p of f) {
|
|
3799
|
+
const L = Math.max(0, Math.floor(r)), b = Math.min(p.length - 1, Math.ceil(o));
|
|
3800
|
+
for (let R = L; R <= b; R++) {
|
|
3801
|
+
const w = p[R];
|
|
3802
|
+
w != null && (w < c && (c = w), w > i && (i = w));
|
|
3790
3803
|
}
|
|
3791
3804
|
}
|
|
3792
3805
|
}
|
|
@@ -3804,7 +3817,7 @@ function fl(e, t, n, r) {
|
|
|
3804
3817
|
const l = qe(0, o || 1, 3), a = Math.max(l[l.length - 1], o);
|
|
3805
3818
|
return { paneTop: e.top, paneBottom: e.bottom, paneHeight: e.height, priceMin: 0, priceMax: a, ticks: l };
|
|
3806
3819
|
}
|
|
3807
|
-
function
|
|
3820
|
+
function $e(e, t) {
|
|
3808
3821
|
const n = (e - t.priceMin) / (t.priceMax - t.priceMin || 1);
|
|
3809
3822
|
return t.paneBottom - n * t.paneHeight;
|
|
3810
3823
|
}
|
|
@@ -3844,7 +3857,7 @@ function gl(e, t, n, r) {
|
|
|
3844
3857
|
function Lt(e, t, n, r, o, c = !1) {
|
|
3845
3858
|
e.strokeStyle = o.grid, e.lineWidth = 1, e.beginPath();
|
|
3846
3859
|
for (const i of r.ticks) {
|
|
3847
|
-
const l = Math.round(
|
|
3860
|
+
const l = Math.round($e(i, r)) + 0.5;
|
|
3848
3861
|
e.moveTo(t, l), e.lineTo(n, l);
|
|
3849
3862
|
}
|
|
3850
3863
|
e.stroke();
|
|
@@ -3852,35 +3865,35 @@ function Lt(e, t, n, r, o, c = !1) {
|
|
|
3852
3865
|
function yl(e, t, n, r, o) {
|
|
3853
3866
|
e.fillStyle = o.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle";
|
|
3854
3867
|
for (const c of n.ticks) {
|
|
3855
|
-
const i =
|
|
3868
|
+
const i = $e(c, n);
|
|
3856
3869
|
e.fillText(c.toFixed(r), t.plotRight + 6, i);
|
|
3857
3870
|
}
|
|
3858
3871
|
}
|
|
3859
3872
|
function vl(e, t, n, r, o, c, i, l) {
|
|
3860
3873
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3861
3874
|
for (let d = a; d <= h; d++) {
|
|
3862
|
-
const f = t[d],
|
|
3863
|
-
e.strokeStyle =
|
|
3864
|
-
const
|
|
3865
|
-
e.moveTo(
|
|
3866
|
-
const
|
|
3867
|
-
e.fillRect(Math.round(
|
|
3875
|
+
const f = t[d], p = o(d), L = $e(f.open, i), b = $e(f.close, i), R = $e(f.high, i), w = $e(f.low, i), W = f.close >= f.open ? l.up : l.down;
|
|
3876
|
+
e.strokeStyle = W, e.fillStyle = W, e.beginPath();
|
|
3877
|
+
const D = Math.round(p) + 0.5;
|
|
3878
|
+
e.moveTo(D, R), e.lineTo(D, w), e.stroke();
|
|
3879
|
+
const Z = Math.min(L, b), T = Math.max(1, Math.abs(b - L));
|
|
3880
|
+
e.fillRect(Math.round(p - u / 2), Math.round(Z), Math.round(u), Math.round(T));
|
|
3868
3881
|
}
|
|
3869
3882
|
}
|
|
3870
3883
|
function bl(e, t, n, r, o, c, i, l) {
|
|
3871
3884
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(2, Math.min(c * 0.4, 8));
|
|
3872
3885
|
e.lineWidth = Math.max(1, Math.min(2, c * 0.18)), e.lineCap = "butt";
|
|
3873
3886
|
for (let d = a; d <= h; d++) {
|
|
3874
|
-
const f = t[d],
|
|
3875
|
-
e.strokeStyle =
|
|
3887
|
+
const f = t[d], p = Math.round(o(d)) + 0.5, L = $e(f.high, i), b = $e(f.low, i), R = $e(f.open, i), w = $e(f.close, i), Q = f.close >= f.open;
|
|
3888
|
+
e.strokeStyle = Q ? l.up : l.down, e.beginPath(), e.moveTo(p, L), e.lineTo(p, b), e.moveTo(p - u, R), e.lineTo(p, R), e.moveTo(p, w), e.lineTo(p + u, w), e.stroke();
|
|
3876
3889
|
}
|
|
3877
3890
|
}
|
|
3878
3891
|
function xl(e, t, n, r, o, c, i, l) {
|
|
3879
3892
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r));
|
|
3880
3893
|
if (!(h <= a)) {
|
|
3881
|
-
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a),
|
|
3894
|
+
e.strokeStyle = i, e.lineWidth = 1.5, e.beginPath(), e.moveTo(o(a), $e(t[a].close, c));
|
|
3882
3895
|
for (let u = a + 1; u <= h; u++)
|
|
3883
|
-
e.lineTo(o(u),
|
|
3896
|
+
e.lineTo(o(u), $e(t[u].close, c));
|
|
3884
3897
|
e.stroke(), l && (e.globalAlpha = 0.18, e.fillStyle = i, e.lineTo(o(h), c.paneBottom), e.lineTo(o(a), c.paneBottom), e.closePath(), e.fill(), e.globalAlpha = 1);
|
|
3885
3898
|
}
|
|
3886
3899
|
}
|
|
@@ -3895,12 +3908,12 @@ function kl(e, t, n, r, o, c, i, l) {
|
|
|
3895
3908
|
for (let d = a; d <= h; d++) {
|
|
3896
3909
|
const f = t.upper[d];
|
|
3897
3910
|
if (f == null) continue;
|
|
3898
|
-
const
|
|
3899
|
-
u ? e.lineTo(
|
|
3911
|
+
const p = i(d), L = $e(f, l);
|
|
3912
|
+
u ? e.lineTo(p, L) : (e.moveTo(p, L), u = !0);
|
|
3900
3913
|
}
|
|
3901
3914
|
for (let d = h; d >= a; d--) {
|
|
3902
3915
|
const f = t.lower[d];
|
|
3903
|
-
f != null && e.lineTo(i(d),
|
|
3916
|
+
f != null && e.lineTo(i(d), $e(f, l));
|
|
3904
3917
|
}
|
|
3905
3918
|
e.closePath(), e.fill(), e.globalAlpha = 1, Qe(e, t.upper, o, c, i, l, t.color), Qe(e, t.lower, o, c, i, l, t.color), Qe(e, t.middle, o, c, i, l, t.color);
|
|
3906
3919
|
}
|
|
@@ -3914,30 +3927,30 @@ function Qe(e, t, n, r, o, c, i) {
|
|
|
3914
3927
|
l = !1;
|
|
3915
3928
|
continue;
|
|
3916
3929
|
}
|
|
3917
|
-
const f = o(u),
|
|
3918
|
-
l ? e.lineTo(f,
|
|
3930
|
+
const f = o(u), p = $e(d, c);
|
|
3931
|
+
l ? e.lineTo(f, p) : (e.moveTo(f, p), l = !0);
|
|
3919
3932
|
}
|
|
3920
3933
|
e.stroke();
|
|
3921
3934
|
}
|
|
3922
3935
|
function Ml(e, t, n, r, o, c, i, l) {
|
|
3923
3936
|
const a = Math.max(0, Math.floor(n)), h = Math.min(t.length - 1, Math.ceil(r)), u = Math.max(1, c * 0.7);
|
|
3924
3937
|
for (let d = a; d <= h; d++) {
|
|
3925
|
-
const f = t[d],
|
|
3926
|
-
if (
|
|
3938
|
+
const f = t[d], p = f.volume ?? 0;
|
|
3939
|
+
if (p === 0) continue;
|
|
3927
3940
|
const L = f.close >= f.open;
|
|
3928
3941
|
e.fillStyle = L ? l.up : l.down, e.globalAlpha = 0.55;
|
|
3929
|
-
const
|
|
3930
|
-
e.fillRect(Math.round(o(d) - u / 2), Math.round(
|
|
3942
|
+
const b = $e(p, i), R = i.paneBottom - b;
|
|
3943
|
+
e.fillRect(Math.round(o(d) - u / 2), Math.round(b), Math.round(u), Math.round(R));
|
|
3931
3944
|
}
|
|
3932
3945
|
e.globalAlpha = 1;
|
|
3933
3946
|
}
|
|
3934
3947
|
function wl(e, t, n, r, o, c) {
|
|
3935
3948
|
e.strokeStyle = c.grid, e.setLineDash([3, 3]), e.beginPath();
|
|
3936
3949
|
for (const i of [r, o]) {
|
|
3937
|
-
const l = Math.round(
|
|
3950
|
+
const l = Math.round($e(i, n)) + 0.5;
|
|
3938
3951
|
e.moveTo(t.plotLeft, l), e.lineTo(t.plotRight, l);
|
|
3939
3952
|
}
|
|
3940
|
-
e.stroke(), e.setLineDash([]), e.fillStyle = c.axis, e.font = "10px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(String(r), t.plotRight + 6,
|
|
3953
|
+
e.stroke(), e.setLineDash([]), e.fillStyle = c.axis, e.font = "10px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(String(r), t.plotRight + 6, $e(r, n)), e.fillText(String(o), t.plotRight + 6, $e(o, n));
|
|
3941
3954
|
}
|
|
3942
3955
|
function Ft(e, t, n, r, o) {
|
|
3943
3956
|
e.fillStyle = o.textMuted, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "top", e.fillText(r, t.plotLeft + 6, n.top + 4);
|
|
@@ -3946,26 +3959,26 @@ function $l(e, t, n, r, o, c, i) {
|
|
|
3946
3959
|
const l = o - r + 1, a = t.plotWidth / l, h = Math.max(1, Math.round(80 / a));
|
|
3947
3960
|
e.fillStyle = i.axis, e.font = "11px system-ui, sans-serif", e.textAlign = "center", e.textBaseline = "middle";
|
|
3948
3961
|
const u = Math.max(0, Math.floor(r)), d = Math.min(n.length - 1, Math.ceil(o)), f = t.plotBottom + At / 2;
|
|
3949
|
-
for (let
|
|
3950
|
-
const L = n[
|
|
3951
|
-
e.fillText(
|
|
3962
|
+
for (let p = u; p <= d; p += h) {
|
|
3963
|
+
const L = n[p], b = t.plotLeft + (p - r + 0.5) * a;
|
|
3964
|
+
e.fillText(Rl(L.time, c), b, f);
|
|
3952
3965
|
}
|
|
3953
3966
|
}
|
|
3954
3967
|
function Nl(e, t, n, r, o, c, i, l, a, h, u) {
|
|
3955
3968
|
if (n.x < t.plotLeft || n.x > t.plotRight) return;
|
|
3956
|
-
const d = c - o + 1, f = t.plotWidth / d,
|
|
3957
|
-
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(
|
|
3958
|
-
const
|
|
3959
|
-
e.fillStyle = u.text, e.fillRect(t.plotRight, n.y - 9, Ct, 18), e.fillStyle = u.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(
|
|
3969
|
+
const d = c - o + 1, f = t.plotWidth / d, p = o + (n.x - t.plotLeft) / f - 0.5, L = Math.round(p), b = Math.max(0, Math.min(r.length - 1, L)), R = i(b);
|
|
3970
|
+
if (e.save(), e.strokeStyle = u.textMuted, e.setLineDash([3, 3]), e.lineWidth = 1, e.beginPath(), e.moveTo(R + 0.5, t.plotTop), e.lineTo(R + 0.5, t.plotBottom), e.moveTo(t.plotLeft, n.y + 0.5), e.lineTo(t.plotRight, n.y + 0.5), e.stroke(), e.setLineDash([]), n.y >= a.paneTop && n.y <= a.paneBottom) {
|
|
3971
|
+
const w = a.priceMax - (n.y - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3972
|
+
e.fillStyle = u.text, e.fillRect(t.plotRight, n.y - 9, Ct, 18), e.fillStyle = u.bg, e.font = "11px system-ui, sans-serif", e.textAlign = "left", e.textBaseline = "middle", e.fillText(w.toFixed(l), t.plotRight + 6, n.y);
|
|
3960
3973
|
}
|
|
3961
|
-
if (r[
|
|
3962
|
-
const
|
|
3974
|
+
if (r[b]) {
|
|
3975
|
+
const w = sn(r[b].time, h);
|
|
3963
3976
|
e.font = "11px system-ui, sans-serif", e.textBaseline = "middle";
|
|
3964
|
-
const
|
|
3977
|
+
const D = e.measureText(w).width + 8 * 2, Z = At, T = Math.max(
|
|
3965
3978
|
t.plotLeft,
|
|
3966
|
-
Math.min(t.plotRight -
|
|
3979
|
+
Math.min(t.plotRight - D, R - D / 2)
|
|
3967
3980
|
), $ = t.plotBottom;
|
|
3968
|
-
e.fillStyle = u.text, e.fillRect(
|
|
3981
|
+
e.fillStyle = u.text, e.fillRect(T, $, D, Z), e.fillStyle = u.bg, e.textAlign = "center", e.fillText(w, T + D / 2, $ + Z / 2);
|
|
3969
3982
|
}
|
|
3970
3983
|
e.restore();
|
|
3971
3984
|
}
|
|
@@ -3973,14 +3986,14 @@ function Ll(e, t, n, r, o, c, i) {
|
|
|
3973
3986
|
const l = n.slice(Math.max(0, Math.floor(r)), Math.min(n.length, Math.ceil(o) + 1)), a = cn(t.main, l, [], r, o);
|
|
3974
3987
|
return e < a.paneTop || e > a.paneBottom ? null : a.priceMax - (e - a.paneTop) / a.paneHeight * (a.priceMax - a.priceMin);
|
|
3975
3988
|
}
|
|
3976
|
-
function
|
|
3989
|
+
function Rl(e, t) {
|
|
3977
3990
|
const n = new Date(e * 1e3);
|
|
3978
3991
|
return t === "D" || t === "W" || t === "M" ? `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())}` : `${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}`;
|
|
3979
3992
|
}
|
|
3980
3993
|
function sn(e, t) {
|
|
3981
3994
|
const n = new Date(e * 1e3);
|
|
3982
3995
|
if (t === "local")
|
|
3983
|
-
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${
|
|
3996
|
+
return `${n.getFullYear()}-${Te(n.getMonth() + 1)}-${Te(n.getDate())} ${Te(n.getHours())}:${Te(n.getMinutes())}:${Te(n.getSeconds())} ${Sl(n)}`;
|
|
3984
3997
|
if (t === "utc")
|
|
3985
3998
|
return `${n.getUTCFullYear()}-${Te(n.getUTCMonth() + 1)}-${Te(n.getUTCDate())} ${Te(n.getUTCHours())}:${Te(n.getUTCMinutes())}:${Te(n.getUTCSeconds())} UTC`;
|
|
3986
3999
|
try {
|
|
@@ -4001,14 +4014,14 @@ function sn(e, t) {
|
|
|
4001
4014
|
return sn(e, "utc");
|
|
4002
4015
|
}
|
|
4003
4016
|
}
|
|
4004
|
-
function
|
|
4017
|
+
function Sl(e) {
|
|
4005
4018
|
const t = -e.getTimezoneOffset(), n = t >= 0 ? "+" : "-", r = Math.abs(t);
|
|
4006
4019
|
return `${n}${Te(Math.floor(r / 60))}:${Te(r % 60)}`;
|
|
4007
4020
|
}
|
|
4008
4021
|
function Te(e) {
|
|
4009
4022
|
return e < 10 ? `0${e}` : String(e);
|
|
4010
4023
|
}
|
|
4011
|
-
function
|
|
4024
|
+
function Xt(e) {
|
|
4012
4025
|
if (e === "D") return 86400;
|
|
4013
4026
|
if (e === "W") return 86400 * 7;
|
|
4014
4027
|
if (e === "M") return 86400 * 30;
|
|
@@ -4035,7 +4048,7 @@ function Tl(e, t) {
|
|
|
4035
4048
|
}
|
|
4036
4049
|
return n;
|
|
4037
4050
|
}
|
|
4038
|
-
const Cl =
|
|
4051
|
+
const Cl = Ne(
|
|
4039
4052
|
({
|
|
4040
4053
|
data: e,
|
|
4041
4054
|
width: t = 80,
|
|
@@ -4049,16 +4062,16 @@ const Cl = $e(
|
|
|
4049
4062
|
className: h,
|
|
4050
4063
|
style: u
|
|
4051
4064
|
}, d) => {
|
|
4052
|
-
const { line: f, area:
|
|
4065
|
+
const { line: f, area: p, last: L } = ke(() => {
|
|
4053
4066
|
if (e.length === 0) return { line: "", area: "", last: null };
|
|
4054
|
-
const
|
|
4055
|
-
return { line: $, area:
|
|
4067
|
+
const b = o, R = Math.max(1, t - b * 2), w = Math.max(1, n - b * 2), [Q, W] = bt(e), D = Je([0, Math.max(1, e.length - 1)], [b, b + R]), Z = Je([Q, W], [b + w, b]), T = e.map((ne, V) => ({ x: D(V), y: Z(ne) })), $ = Tl(T, c), ie = i ? `${$} L ${T[T.length - 1].x} ${b + w} L ${T[0].x} ${b + w} Z` : "";
|
|
4068
|
+
return { line: $, area: ie, last: T[T.length - 1] };
|
|
4056
4069
|
}, [e, t, n, o, c, i]);
|
|
4057
4070
|
return /* @__PURE__ */ z(
|
|
4058
4071
|
"svg",
|
|
4059
4072
|
{
|
|
4060
4073
|
ref: d,
|
|
4061
|
-
className: m(
|
|
4074
|
+
className: m(M.sparkline, h),
|
|
4062
4075
|
style: u,
|
|
4063
4076
|
width: t,
|
|
4064
4077
|
height: n,
|
|
@@ -4066,7 +4079,7 @@ const Cl = $e(
|
|
|
4066
4079
|
role: "img",
|
|
4067
4080
|
"aria-label": a,
|
|
4068
4081
|
children: [
|
|
4069
|
-
i &&
|
|
4082
|
+
i && p && /* @__PURE__ */ s("path", { d: p, fill: r, opacity: 0.18 }),
|
|
4070
4083
|
f && /* @__PURE__ */ s(
|
|
4071
4084
|
"path",
|
|
4072
4085
|
{
|
|
@@ -4087,9 +4100,9 @@ const Cl = $e(
|
|
|
4087
4100
|
Cl.displayName = "Sparkline";
|
|
4088
4101
|
export {
|
|
4089
4102
|
Fl as AreaChart,
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4103
|
+
Xl as BarChart,
|
|
4104
|
+
Ut as Button,
|
|
4105
|
+
Xi as Checkbox,
|
|
4093
4106
|
Vt as Dropdown,
|
|
4094
4107
|
uo as DropdownItem,
|
|
4095
4108
|
Pl as Form,
|
|
@@ -4097,15 +4110,15 @@ export {
|
|
|
4097
4110
|
Hl as FormRow,
|
|
4098
4111
|
ri as Input,
|
|
4099
4112
|
Ol as LineChart,
|
|
4100
|
-
|
|
4113
|
+
Xn as Link,
|
|
4101
4114
|
br as List,
|
|
4102
4115
|
xr as ListItem,
|
|
4103
4116
|
yt as Modal,
|
|
4104
|
-
|
|
4117
|
+
zl as PieChart,
|
|
4105
4118
|
qt as Popover,
|
|
4106
|
-
|
|
4119
|
+
jl as RadarChart,
|
|
4107
4120
|
Vi as Radio,
|
|
4108
|
-
|
|
4121
|
+
Ui as RadioGroup,
|
|
4109
4122
|
Pi as Select,
|
|
4110
4123
|
Cl as Sparkline,
|
|
4111
4124
|
El as Table,
|
|
@@ -4118,11 +4131,11 @@ export {
|
|
|
4118
4131
|
on as periodToSeconds,
|
|
4119
4132
|
tl as rsi,
|
|
4120
4133
|
Qc as sma,
|
|
4121
|
-
|
|
4122
|
-
|
|
4134
|
+
Ul as suggestPeriodForResolution,
|
|
4135
|
+
Yl as suggestResolutionForPeriod,
|
|
4123
4136
|
xo as useClickOutside,
|
|
4124
4137
|
Mo as useFocusTrap,
|
|
4125
|
-
|
|
4126
|
-
|
|
4138
|
+
St as useKeyboard,
|
|
4139
|
+
Yr as useTableSort,
|
|
4127
4140
|
_l as volumeSeries
|
|
4128
4141
|
};
|