@maks1mio/pulsesync-uikit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +839 -0
- package/dist/pulsesync-ui.cjs +2 -0
- package/dist/pulsesync-ui.cjs.map +1 -0
- package/dist/pulsesync-ui.js +2740 -0
- package/dist/pulsesync-ui.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,2740 @@
|
|
|
1
|
+
import { jsx as t, jsxs as m, Fragment as Ue } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as Ee, createContext as Oe, useState as x, useRef as M, useCallback as S, useEffect as O, useId as Ke, Children as rt, isValidElement as it, cloneElement as at, useMemo as Je, useLayoutEffect as He, forwardRef as ct } from "react";
|
|
3
|
+
import { AnimatePresence as Xe, motion as Te } from "framer-motion";
|
|
4
|
+
import { createPortal as Re } from "react-dom";
|
|
5
|
+
import './index.css';const Qe = Oe({});
|
|
6
|
+
function ec({
|
|
7
|
+
children: e,
|
|
8
|
+
LinkComponent: s,
|
|
9
|
+
usePathname: n
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ t(Qe.Provider, { value: { LinkComponent: s, usePathname: n }, children: e });
|
|
12
|
+
}
|
|
13
|
+
function Ye() {
|
|
14
|
+
return Ee(Qe);
|
|
15
|
+
}
|
|
16
|
+
const lt = "_button_89h6d_2", dt = "_disabled_89h6d_20", ut = "_primary_89h6d_25", _t = "_secondary_89h6d_36", pt = "_ghost_89h6d_46", mt = "_outline_89h6d_56", ht = "_control_89h6d_66", ft = "_sm_89h6d_84", vt = "_icon_89h6d_96", gt = "_md_89h6d_101", bt = "_lg_89h6d_118", wt = "_fullWidth_89h6d_136", yt = "_loading_89h6d_140", kt = "_label_89h6d_163", xt = "_spinner_89h6d_168", Nt = "_ps-spin_89h6d_1", fe = {
|
|
17
|
+
button: lt,
|
|
18
|
+
disabled: dt,
|
|
19
|
+
primary: ut,
|
|
20
|
+
secondary: _t,
|
|
21
|
+
ghost: pt,
|
|
22
|
+
outline: mt,
|
|
23
|
+
control: ht,
|
|
24
|
+
sm: ft,
|
|
25
|
+
icon: vt,
|
|
26
|
+
md: gt,
|
|
27
|
+
lg: bt,
|
|
28
|
+
fullWidth: wt,
|
|
29
|
+
loading: yt,
|
|
30
|
+
label: kt,
|
|
31
|
+
spinner: xt,
|
|
32
|
+
psSpin: Nt
|
|
33
|
+
};
|
|
34
|
+
function et(e) {
|
|
35
|
+
var s, n, o = "";
|
|
36
|
+
if (typeof e == "string" || typeof e == "number") o += e;
|
|
37
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
38
|
+
var i = e.length;
|
|
39
|
+
for (s = 0; s < i; s++) e[s] && (n = et(e[s])) && (o && (o += " "), o += n);
|
|
40
|
+
} else for (n in e) e[n] && (o && (o += " "), o += n);
|
|
41
|
+
return o;
|
|
42
|
+
}
|
|
43
|
+
function w() {
|
|
44
|
+
for (var e, s, n = 0, o = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (s = et(e)) && (o && (o += " "), o += s);
|
|
45
|
+
return o;
|
|
46
|
+
}
|
|
47
|
+
function Ze(e) {
|
|
48
|
+
const { LinkComponent: s } = Ye(), {
|
|
49
|
+
variant: n = "primary",
|
|
50
|
+
size: o = "md",
|
|
51
|
+
icon: i,
|
|
52
|
+
iconPosition: c = "left",
|
|
53
|
+
fullWidth: r = !1,
|
|
54
|
+
loading: d = !1,
|
|
55
|
+
disabled: a,
|
|
56
|
+
className: u,
|
|
57
|
+
children: f,
|
|
58
|
+
...p
|
|
59
|
+
} = e, v = w(
|
|
60
|
+
fe.button,
|
|
61
|
+
fe[n],
|
|
62
|
+
fe[o],
|
|
63
|
+
r && fe.fullWidth,
|
|
64
|
+
d && fe.loading,
|
|
65
|
+
a && fe.disabled,
|
|
66
|
+
u
|
|
67
|
+
), l = d ? /* @__PURE__ */ t("span", { className: fe.spinner }) : /* @__PURE__ */ m(Ue, { children: [
|
|
68
|
+
i && c === "left" && /* @__PURE__ */ t("span", { className: fe.icon, children: i }),
|
|
69
|
+
f && /* @__PURE__ */ t("span", { className: fe.label, children: f }),
|
|
70
|
+
i && c === "right" && /* @__PURE__ */ t("span", { className: fe.icon, children: i })
|
|
71
|
+
] });
|
|
72
|
+
if ("href" in e && e.href) {
|
|
73
|
+
const { href: y, target: k, rel: C, ...L } = p;
|
|
74
|
+
return y.startsWith("http") || y.startsWith("//") ? /* @__PURE__ */ t(
|
|
75
|
+
"a",
|
|
76
|
+
{
|
|
77
|
+
href: y,
|
|
78
|
+
target: k || "_blank",
|
|
79
|
+
rel: C || "noopener noreferrer",
|
|
80
|
+
className: v,
|
|
81
|
+
"aria-disabled": a,
|
|
82
|
+
...L,
|
|
83
|
+
children: l
|
|
84
|
+
}
|
|
85
|
+
) : s ? /* @__PURE__ */ t(s, { href: y, className: v, "aria-disabled": a, ...L, children: l }) : /* @__PURE__ */ t("a", { href: y, className: v, "aria-disabled": a, ...L, children: l });
|
|
86
|
+
}
|
|
87
|
+
return /* @__PURE__ */ t("button", { className: v, disabled: a || d, ...p, children: l });
|
|
88
|
+
}
|
|
89
|
+
const Ct = "_wrapper_6xesh_2", Lt = "_tooltip_6xesh_7", $t = "_visible_6xesh_28", Rt = "_arrow_6xesh_34", Bt = "_top_6xesh_44", It = "_bottom_6xesh_60", Et = "_left_6xesh_76", jt = "_right_6xesh_92", Dt = "_followCursor_6xesh_109", St = "_cursorTop_6xesh_120", Tt = "_cursorBottom_6xesh_128", Mt = "_cursorLeft_6xesh_136", zt = "_cursorRight_6xesh_144", xe = {
|
|
90
|
+
wrapper: Ct,
|
|
91
|
+
tooltip: Lt,
|
|
92
|
+
visible: $t,
|
|
93
|
+
arrow: Rt,
|
|
94
|
+
top: Bt,
|
|
95
|
+
bottom: It,
|
|
96
|
+
left: Et,
|
|
97
|
+
right: jt,
|
|
98
|
+
followCursor: Dt,
|
|
99
|
+
cursorTop: St,
|
|
100
|
+
cursorBottom: Tt,
|
|
101
|
+
cursorLeft: Mt,
|
|
102
|
+
cursorRight: zt
|
|
103
|
+
};
|
|
104
|
+
function Le({
|
|
105
|
+
content: e,
|
|
106
|
+
children: s,
|
|
107
|
+
position: n = "top",
|
|
108
|
+
delay: o = 0,
|
|
109
|
+
className: i,
|
|
110
|
+
tooltipClassName: c,
|
|
111
|
+
disabled: r = !1,
|
|
112
|
+
followCursor: d = !1,
|
|
113
|
+
cursorOffset: a = 16
|
|
114
|
+
}) {
|
|
115
|
+
const [u, f] = x(!1), [p, v] = x({ x: 0, y: 0 }), [l, _] = x("bottom"), [y, k] = x({ x: 50, y: 50 }), C = M(null), L = M(null), $ = M(null), N = S(
|
|
116
|
+
(h, I) => {
|
|
117
|
+
if (!$.current) return;
|
|
118
|
+
const E = $.current.getBoundingClientRect(), P = 12, H = window.innerWidth, K = window.innerHeight;
|
|
119
|
+
let b = h, W = I, X = "bottom", re = 50, j = 50;
|
|
120
|
+
const g = I, R = K - I, Z = h, V = H - h;
|
|
121
|
+
n === "top" || n === "bottom" ? (R >= E.height + a + P ? (X = "bottom", W = I + a) : g >= E.height + a + P ? (X = "top", W = I - a - E.height) : (X = R > g ? "bottom" : "top", W = X === "bottom" ? I + a : I - a - E.height), b = h - E.width / 2, b < P && (b = P), b + E.width > H - P && (b = H - P - E.width), re = (h - b) / E.width * 100, re = Math.max(10, Math.min(90, re))) : (V >= E.width + a + P ? (X = "right", b = h + a) : Z >= E.width + a + P ? (X = "left", b = h - a - E.width) : (X = V > Z ? "right" : "left", b = X === "right" ? h + a : h - a - E.width), W = I - E.height / 2, W < P && (W = P), W + E.height > K - P && (W = K - P - E.height), j = (I - W) / E.height * 100, j = Math.max(10, Math.min(90, j))), b = Math.max(P, Math.min(b, H - E.width - P)), W = Math.max(P, Math.min(W, K - E.height - P)), v({ x: b, y: W }), _(X), k({ x: re, y: j });
|
|
122
|
+
},
|
|
123
|
+
[n, a]
|
|
124
|
+
), F = S(
|
|
125
|
+
(h) => {
|
|
126
|
+
d && u && requestAnimationFrame(() => N(h.clientX, h.clientY));
|
|
127
|
+
},
|
|
128
|
+
[d, u, N]
|
|
129
|
+
), q = (h) => {
|
|
130
|
+
if (r) return;
|
|
131
|
+
const I = () => {
|
|
132
|
+
f(!0), d && h && requestAnimationFrame(() => N(h.clientX, h.clientY));
|
|
133
|
+
};
|
|
134
|
+
o > 0 ? C.current = setTimeout(I, o) : I();
|
|
135
|
+
}, A = () => {
|
|
136
|
+
C.current && (clearTimeout(C.current), C.current = null), f(!1);
|
|
137
|
+
};
|
|
138
|
+
O(() => {
|
|
139
|
+
if (d && u)
|
|
140
|
+
return window.addEventListener("mousemove", F), () => window.removeEventListener("mousemove", F);
|
|
141
|
+
}, [d, u, F]), O(() => () => {
|
|
142
|
+
C.current && clearTimeout(C.current);
|
|
143
|
+
}, []);
|
|
144
|
+
const U = d ? {
|
|
145
|
+
position: "fixed",
|
|
146
|
+
left: `${p.x}px`,
|
|
147
|
+
top: `${p.y}px`,
|
|
148
|
+
transform: "none",
|
|
149
|
+
"--arrow-x": `${y.x}%`,
|
|
150
|
+
"--arrow-y": `${y.y}%`
|
|
151
|
+
} : {};
|
|
152
|
+
return /* @__PURE__ */ m(
|
|
153
|
+
"div",
|
|
154
|
+
{
|
|
155
|
+
ref: L,
|
|
156
|
+
className: w(xe.wrapper, i),
|
|
157
|
+
onMouseEnter: (h) => q(h),
|
|
158
|
+
onMouseLeave: A,
|
|
159
|
+
onFocus: () => q(),
|
|
160
|
+
onBlur: A,
|
|
161
|
+
children: [
|
|
162
|
+
s,
|
|
163
|
+
/* @__PURE__ */ m(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: $,
|
|
167
|
+
className: w(
|
|
168
|
+
xe.tooltip,
|
|
169
|
+
!d && xe[n],
|
|
170
|
+
d && xe.followCursor,
|
|
171
|
+
d && xe[`cursor${l.charAt(0).toUpperCase() + l.slice(1)}`],
|
|
172
|
+
u && xe.visible,
|
|
173
|
+
c
|
|
174
|
+
),
|
|
175
|
+
style: U,
|
|
176
|
+
role: "tooltip",
|
|
177
|
+
children: [
|
|
178
|
+
e,
|
|
179
|
+
/* @__PURE__ */ t("span", { className: xe.arrow })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
const Pt = "_overlay_1qjmo_1", At = "_modal_1qjmo_12", Wt = "_title_1qjmo_21", Ft = "_text_1qjmo_28", qt = "_actions_1qjmo_35", Ut = "_dangerButton_1qjmo_42", $e = {
|
|
188
|
+
overlay: Pt,
|
|
189
|
+
modal: At,
|
|
190
|
+
title: Wt,
|
|
191
|
+
text: Ft,
|
|
192
|
+
actions: qt,
|
|
193
|
+
dangerButton: Ut
|
|
194
|
+
};
|
|
195
|
+
function Ot({
|
|
196
|
+
isOpen: e,
|
|
197
|
+
title: s,
|
|
198
|
+
message: n,
|
|
199
|
+
confirmText: o = "OK",
|
|
200
|
+
cancelText: i = "Cancel",
|
|
201
|
+
tone: c = "default",
|
|
202
|
+
hideCancel: r = !1,
|
|
203
|
+
onConfirm: d,
|
|
204
|
+
onCancel: a
|
|
205
|
+
}) {
|
|
206
|
+
return O(() => {
|
|
207
|
+
if (!e) return;
|
|
208
|
+
const u = (f) => {
|
|
209
|
+
f.key === "Escape" && a();
|
|
210
|
+
};
|
|
211
|
+
return window.addEventListener("keydown", u), () => window.removeEventListener("keydown", u);
|
|
212
|
+
}, [e, a]), /* @__PURE__ */ t(Xe, { children: e && /* @__PURE__ */ t(
|
|
213
|
+
Te.div,
|
|
214
|
+
{
|
|
215
|
+
className: $e.overlay,
|
|
216
|
+
onClick: a,
|
|
217
|
+
initial: { opacity: 0 },
|
|
218
|
+
animate: { opacity: 1 },
|
|
219
|
+
exit: { opacity: 0 },
|
|
220
|
+
transition: { duration: 0.18 },
|
|
221
|
+
children: /* @__PURE__ */ m(
|
|
222
|
+
Te.div,
|
|
223
|
+
{
|
|
224
|
+
className: $e.modal,
|
|
225
|
+
onClick: (u) => u.stopPropagation(),
|
|
226
|
+
initial: { opacity: 0, y: 12, scale: 0.98 },
|
|
227
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
228
|
+
exit: { opacity: 0, y: 12, scale: 0.98 },
|
|
229
|
+
transition: { duration: 0.2, ease: "easeOut" },
|
|
230
|
+
role: "dialog",
|
|
231
|
+
"aria-modal": "true",
|
|
232
|
+
children: [
|
|
233
|
+
s && /* @__PURE__ */ t("h3", { className: $e.title, children: s }),
|
|
234
|
+
/* @__PURE__ */ t("p", { className: $e.text, children: n }),
|
|
235
|
+
/* @__PURE__ */ m("div", { className: $e.actions, children: [
|
|
236
|
+
/* @__PURE__ */ t(
|
|
237
|
+
Ze,
|
|
238
|
+
{
|
|
239
|
+
variant: "primary",
|
|
240
|
+
size: "sm",
|
|
241
|
+
className: c === "danger" ? $e.dangerButton : void 0,
|
|
242
|
+
onClick: d,
|
|
243
|
+
type: "button",
|
|
244
|
+
children: o
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
!r && /* @__PURE__ */ t(Ze, { variant: "secondary", size: "sm", onClick: a, type: "button", children: i })
|
|
248
|
+
] })
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
) });
|
|
254
|
+
}
|
|
255
|
+
function tc() {
|
|
256
|
+
const [e, s] = x(null), n = S((r) => {
|
|
257
|
+
s((d) => (d && d.resolve(r), null));
|
|
258
|
+
}, []), o = S((r) => new Promise((d) => {
|
|
259
|
+
s((a) => (a && a.resolve(!1), {
|
|
260
|
+
resolve: d,
|
|
261
|
+
title: r.title,
|
|
262
|
+
message: r.message,
|
|
263
|
+
confirmText: r.confirmText ?? "OK",
|
|
264
|
+
cancelText: r.cancelText ?? "Cancel",
|
|
265
|
+
tone: r.tone ?? "default",
|
|
266
|
+
hideCancel: r.hideCancel ?? !1
|
|
267
|
+
}));
|
|
268
|
+
}), []), i = S(
|
|
269
|
+
(r) => o({ ...r, hideCancel: !0 }).then(() => {
|
|
270
|
+
}),
|
|
271
|
+
[o]
|
|
272
|
+
), c = /* @__PURE__ */ t(
|
|
273
|
+
Ot,
|
|
274
|
+
{
|
|
275
|
+
isOpen: !!e,
|
|
276
|
+
title: e == null ? void 0 : e.title,
|
|
277
|
+
message: (e == null ? void 0 : e.message) ?? "",
|
|
278
|
+
confirmText: e == null ? void 0 : e.confirmText,
|
|
279
|
+
cancelText: e == null ? void 0 : e.cancelText,
|
|
280
|
+
tone: e == null ? void 0 : e.tone,
|
|
281
|
+
hideCancel: e == null ? void 0 : e.hideCancel,
|
|
282
|
+
onCancel: () => n(!1),
|
|
283
|
+
onConfirm: () => n(!0)
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
return { alert: i, confirm: o, modal: c };
|
|
287
|
+
}
|
|
288
|
+
const Ht = "_overlay_13ign_1", Kt = "_modal_13ign_12", Zt = "_title_13ign_21", Vt = "_text_13ign_28", Gt = "_input_13ign_35", Jt = "_actions_13ign_54", Xt = "_cancelButton_13ign_61", Qt = "_confirmButton_13ign_77", Yt = "_dangerButton_13ign_94", be = {
|
|
289
|
+
overlay: Ht,
|
|
290
|
+
modal: Kt,
|
|
291
|
+
title: Zt,
|
|
292
|
+
text: Vt,
|
|
293
|
+
input: Gt,
|
|
294
|
+
actions: Jt,
|
|
295
|
+
cancelButton: Xt,
|
|
296
|
+
confirmButton: Qt,
|
|
297
|
+
dangerButton: Yt
|
|
298
|
+
};
|
|
299
|
+
function en({
|
|
300
|
+
isOpen: e,
|
|
301
|
+
title: s,
|
|
302
|
+
message: n,
|
|
303
|
+
placeholder: o,
|
|
304
|
+
defaultValue: i = "",
|
|
305
|
+
confirmText: c = "OK",
|
|
306
|
+
cancelText: r = "Cancel",
|
|
307
|
+
tone: d = "default",
|
|
308
|
+
onConfirm: a,
|
|
309
|
+
onCancel: u
|
|
310
|
+
}) {
|
|
311
|
+
const [f, p] = x(i), v = M(null);
|
|
312
|
+
O(() => {
|
|
313
|
+
if (!e) return;
|
|
314
|
+
p(i);
|
|
315
|
+
const _ = (y) => {
|
|
316
|
+
y.key === "Escape" && u();
|
|
317
|
+
};
|
|
318
|
+
return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
|
|
319
|
+
}, [i, e, u]), O(() => {
|
|
320
|
+
if (!e) return;
|
|
321
|
+
const _ = window.setTimeout(() => {
|
|
322
|
+
var y;
|
|
323
|
+
return (y = v.current) == null ? void 0 : y.focus();
|
|
324
|
+
}, 0);
|
|
325
|
+
return () => window.clearTimeout(_);
|
|
326
|
+
}, [e]);
|
|
327
|
+
const l = S(() => {
|
|
328
|
+
a(f);
|
|
329
|
+
}, [a, f]);
|
|
330
|
+
return /* @__PURE__ */ t(Xe, { children: e && /* @__PURE__ */ t(
|
|
331
|
+
Te.div,
|
|
332
|
+
{
|
|
333
|
+
className: be.overlay,
|
|
334
|
+
onClick: u,
|
|
335
|
+
initial: { opacity: 0 },
|
|
336
|
+
animate: { opacity: 1 },
|
|
337
|
+
exit: { opacity: 0 },
|
|
338
|
+
transition: { duration: 0.18 },
|
|
339
|
+
children: /* @__PURE__ */ m(
|
|
340
|
+
Te.div,
|
|
341
|
+
{
|
|
342
|
+
className: be.modal,
|
|
343
|
+
onClick: (_) => _.stopPropagation(),
|
|
344
|
+
initial: { opacity: 0, y: 12, scale: 0.98 },
|
|
345
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
346
|
+
exit: { opacity: 0, y: 12, scale: 0.98 },
|
|
347
|
+
transition: { duration: 0.2, ease: "easeOut" },
|
|
348
|
+
role: "dialog",
|
|
349
|
+
"aria-modal": "true",
|
|
350
|
+
children: [
|
|
351
|
+
s && /* @__PURE__ */ t("h3", { className: be.title, children: s }),
|
|
352
|
+
n && /* @__PURE__ */ t("p", { className: be.text, children: n }),
|
|
353
|
+
/* @__PURE__ */ t(
|
|
354
|
+
"input",
|
|
355
|
+
{
|
|
356
|
+
ref: v,
|
|
357
|
+
className: be.input,
|
|
358
|
+
value: f,
|
|
359
|
+
placeholder: o,
|
|
360
|
+
onChange: (_) => p(_.target.value),
|
|
361
|
+
onKeyDown: (_) => {
|
|
362
|
+
_.key === "Enter" && (_.preventDefault(), l());
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
),
|
|
366
|
+
/* @__PURE__ */ m("div", { className: be.actions, children: [
|
|
367
|
+
/* @__PURE__ */ t("button", { className: be.cancelButton, onClick: u, type: "button", children: r }),
|
|
368
|
+
/* @__PURE__ */ t(
|
|
369
|
+
"button",
|
|
370
|
+
{
|
|
371
|
+
className: `${be.confirmButton} ${d === "danger" ? be.dangerButton : ""}`,
|
|
372
|
+
onClick: l,
|
|
373
|
+
type: "button",
|
|
374
|
+
children: c
|
|
375
|
+
}
|
|
376
|
+
)
|
|
377
|
+
] })
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
}
|
|
382
|
+
) });
|
|
383
|
+
}
|
|
384
|
+
function nc() {
|
|
385
|
+
const [e, s] = x(null), n = S((c) => {
|
|
386
|
+
s((r) => (r && r.resolve(c), null));
|
|
387
|
+
}, []), o = S((c) => new Promise((r) => {
|
|
388
|
+
s((d) => (d && d.resolve(null), {
|
|
389
|
+
resolve: r,
|
|
390
|
+
title: c.title,
|
|
391
|
+
message: c.message,
|
|
392
|
+
placeholder: c.placeholder,
|
|
393
|
+
defaultValue: c.defaultValue ?? "",
|
|
394
|
+
confirmText: c.confirmText ?? "OK",
|
|
395
|
+
cancelText: c.cancelText ?? "Cancel",
|
|
396
|
+
tone: c.tone ?? "default"
|
|
397
|
+
}));
|
|
398
|
+
}), []), i = /* @__PURE__ */ t(
|
|
399
|
+
en,
|
|
400
|
+
{
|
|
401
|
+
isOpen: !!e,
|
|
402
|
+
title: e == null ? void 0 : e.title,
|
|
403
|
+
message: e == null ? void 0 : e.message,
|
|
404
|
+
placeholder: e == null ? void 0 : e.placeholder,
|
|
405
|
+
defaultValue: e == null ? void 0 : e.defaultValue,
|
|
406
|
+
confirmText: e == null ? void 0 : e.confirmText,
|
|
407
|
+
cancelText: e == null ? void 0 : e.cancelText,
|
|
408
|
+
tone: e == null ? void 0 : e.tone,
|
|
409
|
+
onCancel: () => n(null),
|
|
410
|
+
onConfirm: (c) => n(c)
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
return { prompt: o, modal: i };
|
|
414
|
+
}
|
|
415
|
+
const tn = "_wrapper_1785o_1", nn = "_resetBtn_1785o_8", on = "_trigger_1785o_24", sn = "_label_1785o_39", rn = "_chevron_1785o_47", an = "_open_1785o_67", cn = "_menu_1785o_71", ln = "_menuClosing_1785o_85", dn = "_option_1785o_109", un = "_optionGroup_1785o_136", ve = {
|
|
416
|
+
wrapper: tn,
|
|
417
|
+
resetBtn: nn,
|
|
418
|
+
trigger: on,
|
|
419
|
+
label: sn,
|
|
420
|
+
chevron: rn,
|
|
421
|
+
open: an,
|
|
422
|
+
menu: cn,
|
|
423
|
+
menuClosing: ln,
|
|
424
|
+
option: dn,
|
|
425
|
+
optionGroup: un
|
|
426
|
+
};
|
|
427
|
+
function oc({
|
|
428
|
+
options: e,
|
|
429
|
+
value: s = null,
|
|
430
|
+
onChange: n,
|
|
431
|
+
defaultValue: o,
|
|
432
|
+
resetText: i = "Reset",
|
|
433
|
+
placeholder: c,
|
|
434
|
+
disabled: r = !1,
|
|
435
|
+
className: d,
|
|
436
|
+
menuClassName: a,
|
|
437
|
+
optionClassName: u,
|
|
438
|
+
wrapperClassName: f,
|
|
439
|
+
showChevron: p = !0,
|
|
440
|
+
ariaLabel: v,
|
|
441
|
+
onTriggerMouseDown: l
|
|
442
|
+
}) {
|
|
443
|
+
const [_, y] = x(!1), [k, C] = x(!1), [L, $] = x(!1), [N, F] = x({}), q = M(null), A = M(null), U = M(null), h = Ke(), I = Ke();
|
|
444
|
+
O(() => {
|
|
445
|
+
C(!0);
|
|
446
|
+
}, []);
|
|
447
|
+
const E = s == null ? null : String(s), P = E !== null ? e.find((T) => String(T.value) === E) : void 0, H = (P == null ? void 0 : P.label) ?? c ?? "", K = S(() => {
|
|
448
|
+
var te;
|
|
449
|
+
const T = (te = A.current) == null ? void 0 : te.getBoundingClientRect();
|
|
450
|
+
T && F({
|
|
451
|
+
top: T.bottom + 6,
|
|
452
|
+
left: T.left,
|
|
453
|
+
minWidth: T.width
|
|
454
|
+
});
|
|
455
|
+
}, []), b = S(() => {
|
|
456
|
+
_ && $(!0);
|
|
457
|
+
}, [_]), W = S(() => {
|
|
458
|
+
L && ($(!1), y(!1));
|
|
459
|
+
}, [L]);
|
|
460
|
+
O(() => {
|
|
461
|
+
if (!_) return;
|
|
462
|
+
K();
|
|
463
|
+
const T = (B) => {
|
|
464
|
+
var G, Q;
|
|
465
|
+
const z = B.target;
|
|
466
|
+
(G = q.current) != null && G.contains(z) || (Q = U.current) != null && Q.contains(z) || b();
|
|
467
|
+
}, te = (B) => {
|
|
468
|
+
var z;
|
|
469
|
+
B.key === "Escape" && (B.preventDefault(), b(), (z = A.current) == null || z.focus());
|
|
470
|
+
}, we = () => K(), ce = () => K();
|
|
471
|
+
return document.addEventListener("mousedown", T), document.addEventListener("keydown", te), window.addEventListener("resize", ce), window.addEventListener("scroll", we, !0), () => {
|
|
472
|
+
document.removeEventListener("mousedown", T), document.removeEventListener("keydown", te), window.removeEventListener("resize", ce), window.removeEventListener("scroll", we, !0);
|
|
473
|
+
};
|
|
474
|
+
}, [b, _, K]), O(() => {
|
|
475
|
+
r && _ && b();
|
|
476
|
+
}, [b, r, _]), O(() => {
|
|
477
|
+
var ce, B;
|
|
478
|
+
if (!_) return;
|
|
479
|
+
const te = Array.from(
|
|
480
|
+
((ce = U.current) == null ? void 0 : ce.querySelectorAll("[data-option-picker-option]")) ?? []
|
|
481
|
+
).filter((z) => !z.disabled);
|
|
482
|
+
(B = te.find((z) => z.dataset.value === E) ?? te[0]) == null || B.focus();
|
|
483
|
+
}, [_, E, e]);
|
|
484
|
+
const X = () => {
|
|
485
|
+
r || (_ ? b() : y(!0));
|
|
486
|
+
}, re = (T) => {
|
|
487
|
+
r || (T.key === "ArrowDown" || T.key === "Enter" || T.key === " ") && (T.preventDefault(), y(!0));
|
|
488
|
+
}, j = (T) => {
|
|
489
|
+
var te;
|
|
490
|
+
T.disabled || T.kind === "group" || (n == null || n(String(T.value)), b(), (te = A.current) == null || te.focus());
|
|
491
|
+
}, g = o !== void 0 && String(s) !== String(o), R = (T) => {
|
|
492
|
+
T.stopPropagation(), o !== void 0 && (n == null || n(String(o)));
|
|
493
|
+
}, Z = [ve.trigger, d].filter(Boolean).join(" "), V = [ve.wrapper, _ ? ve.open : "", f].filter(Boolean).join(" "), _e = [ve.menu, L ? ve.menuClosing : "", a].filter(Boolean).join(" "), me = _ || L ? /* @__PURE__ */ t(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
ref: U,
|
|
497
|
+
className: _e,
|
|
498
|
+
style: N,
|
|
499
|
+
role: "listbox",
|
|
500
|
+
id: h,
|
|
501
|
+
"aria-labelledby": I,
|
|
502
|
+
"data-option-picker": !0,
|
|
503
|
+
onAnimationEnd: W,
|
|
504
|
+
children: e.map((T) => {
|
|
505
|
+
const te = E !== null && String(T.value) === E, we = T.disabled || T.kind === "group", ce = [
|
|
506
|
+
ve.option,
|
|
507
|
+
T.kind === "group" ? ve.optionGroup : "",
|
|
508
|
+
u
|
|
509
|
+
].filter(Boolean).join(" ");
|
|
510
|
+
return /* @__PURE__ */ t(
|
|
511
|
+
"button",
|
|
512
|
+
{
|
|
513
|
+
type: "button",
|
|
514
|
+
className: ce,
|
|
515
|
+
onClick: () => j(T),
|
|
516
|
+
disabled: we,
|
|
517
|
+
"aria-selected": te,
|
|
518
|
+
"aria-disabled": we,
|
|
519
|
+
"data-value": String(T.value),
|
|
520
|
+
"data-option-picker-option": !0,
|
|
521
|
+
children: T.label
|
|
522
|
+
},
|
|
523
|
+
`${T.value}`
|
|
524
|
+
);
|
|
525
|
+
})
|
|
526
|
+
}
|
|
527
|
+
) : null;
|
|
528
|
+
return /* @__PURE__ */ m("div", { ref: q, className: V, "data-option-picker": !0, children: [
|
|
529
|
+
/* @__PURE__ */ m(
|
|
530
|
+
"button",
|
|
531
|
+
{
|
|
532
|
+
ref: A,
|
|
533
|
+
type: "button",
|
|
534
|
+
className: Z,
|
|
535
|
+
onClick: X,
|
|
536
|
+
onKeyDown: re,
|
|
537
|
+
onMouseDown: l,
|
|
538
|
+
disabled: r,
|
|
539
|
+
"aria-haspopup": "listbox",
|
|
540
|
+
"aria-expanded": _,
|
|
541
|
+
"aria-controls": h,
|
|
542
|
+
"aria-label": v,
|
|
543
|
+
id: I,
|
|
544
|
+
"data-option-picker": !0,
|
|
545
|
+
children: [
|
|
546
|
+
/* @__PURE__ */ t("span", { className: ve.label, children: H }),
|
|
547
|
+
p && /* @__PURE__ */ t("span", { className: ve.chevron, "aria-hidden": "true", children: /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", focusable: "false", "aria-hidden": "true", children: /* @__PURE__ */ t("path", { d: "M6 9l6 6 6-6" }) }) })
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
),
|
|
551
|
+
g && /* @__PURE__ */ t("button", { type: "button", className: ve.resetBtn, onClick: R, children: i }),
|
|
552
|
+
k && me ? Re(me, document.body) : null
|
|
553
|
+
] });
|
|
554
|
+
}
|
|
555
|
+
const _n = "_navLink_d355b_1", pn = "_active_d355b_28", mn = "_icon_d355b_35", hn = "_label_d355b_42", je = {
|
|
556
|
+
navLink: _n,
|
|
557
|
+
active: pn,
|
|
558
|
+
icon: mn,
|
|
559
|
+
label: hn
|
|
560
|
+
};
|
|
561
|
+
function sc({
|
|
562
|
+
href: e,
|
|
563
|
+
children: s,
|
|
564
|
+
exact: n = !1,
|
|
565
|
+
icon: o,
|
|
566
|
+
active: i,
|
|
567
|
+
className: c,
|
|
568
|
+
...r
|
|
569
|
+
}) {
|
|
570
|
+
const { LinkComponent: d, usePathname: a } = Ye();
|
|
571
|
+
let u = i;
|
|
572
|
+
if (u === void 0 && a)
|
|
573
|
+
try {
|
|
574
|
+
const v = a();
|
|
575
|
+
u = n ? v === e : v === e || v.startsWith(e + "/");
|
|
576
|
+
} catch {
|
|
577
|
+
u = !1;
|
|
578
|
+
}
|
|
579
|
+
const f = w(je.navLink, u && je.active, c), p = /* @__PURE__ */ m(Ue, { children: [
|
|
580
|
+
o && /* @__PURE__ */ t("span", { className: je.icon, children: o }),
|
|
581
|
+
/* @__PURE__ */ t("span", { className: je.label, children: s })
|
|
582
|
+
] });
|
|
583
|
+
return d ? /* @__PURE__ */ t(d, { href: e, className: f, ...r, children: p }) : /* @__PURE__ */ t("a", { href: e, className: f, ...r, children: p });
|
|
584
|
+
}
|
|
585
|
+
const fn = "_avatar_1rkbu_2", vn = "_rounded_1rkbu_13", gn = "_circle_1rkbu_17", bn = "_square_1rkbu_21", wn = "_xs_1rkbu_26", yn = "_sm_1rkbu_35", kn = "_md_1rkbu_44", xn = "_lg_1rkbu_53", Nn = "_xl_1rkbu_62", Cn = "_imageWrap_1rkbu_72", Ln = "_image_1rkbu_72", $n = "_fallback_1rkbu_87", Rn = "_status_1rkbu_104", Bn = "_statusOnline_1rkbu_154", In = "_statusOffline_1rkbu_159", En = "_statusBusy_1rkbu_163", jn = "_statusAway_1rkbu_168", Dn = "_group_1rkbu_174", Sn = "_overflowTrigger_1rkbu_205", Tn = "_overflowPopover_1rkbu_211", Mn = "_overflowItem_1rkbu_238", zn = "_overflowItemName_1rkbu_250", se = {
|
|
586
|
+
avatar: fn,
|
|
587
|
+
rounded: vn,
|
|
588
|
+
circle: gn,
|
|
589
|
+
square: bn,
|
|
590
|
+
xs: wn,
|
|
591
|
+
sm: yn,
|
|
592
|
+
md: kn,
|
|
593
|
+
lg: xn,
|
|
594
|
+
xl: Nn,
|
|
595
|
+
imageWrap: Cn,
|
|
596
|
+
image: Ln,
|
|
597
|
+
fallback: $n,
|
|
598
|
+
status: Rn,
|
|
599
|
+
statusOnline: Bn,
|
|
600
|
+
statusOffline: In,
|
|
601
|
+
statusBusy: En,
|
|
602
|
+
statusAway: jn,
|
|
603
|
+
group: Dn,
|
|
604
|
+
overflowTrigger: Sn,
|
|
605
|
+
overflowPopover: Tn,
|
|
606
|
+
overflowItem: Mn,
|
|
607
|
+
overflowItemName: zn
|
|
608
|
+
};
|
|
609
|
+
function Pn(e) {
|
|
610
|
+
return e ? e.split(/\s+/).slice(0, 2).map((s) => s[0]).join("").toUpperCase() : "?";
|
|
611
|
+
}
|
|
612
|
+
const An = {
|
|
613
|
+
online: se.statusOnline,
|
|
614
|
+
offline: se.statusOffline,
|
|
615
|
+
busy: se.statusBusy,
|
|
616
|
+
away: se.statusAway
|
|
617
|
+
};
|
|
618
|
+
function qe({
|
|
619
|
+
src: e,
|
|
620
|
+
alt: s,
|
|
621
|
+
size: n = "md",
|
|
622
|
+
shape: o = "rounded",
|
|
623
|
+
status: i,
|
|
624
|
+
fallback: c,
|
|
625
|
+
className: r,
|
|
626
|
+
onClick: d,
|
|
627
|
+
...a
|
|
628
|
+
}) {
|
|
629
|
+
const [u, f] = x(!1), p = e && !u;
|
|
630
|
+
return /* @__PURE__ */ m(
|
|
631
|
+
"div",
|
|
632
|
+
{
|
|
633
|
+
className: w(se.avatar, se[n], se[o], r),
|
|
634
|
+
onClick: d,
|
|
635
|
+
role: d ? "button" : void 0,
|
|
636
|
+
tabIndex: d ? 0 : void 0,
|
|
637
|
+
style: d ? { cursor: "pointer" } : void 0,
|
|
638
|
+
children: [
|
|
639
|
+
p ? /* @__PURE__ */ t("div", { className: se.imageWrap, children: /* @__PURE__ */ t(
|
|
640
|
+
"img",
|
|
641
|
+
{
|
|
642
|
+
src: e,
|
|
643
|
+
alt: s || "",
|
|
644
|
+
className: se.image,
|
|
645
|
+
onError: () => f(!0),
|
|
646
|
+
draggable: !1,
|
|
647
|
+
...a
|
|
648
|
+
}
|
|
649
|
+
) }) : /* @__PURE__ */ t("span", { className: se.fallback, children: c || Pn(s) }),
|
|
650
|
+
i && /* @__PURE__ */ t("span", { className: w(se.status, An[i]), "aria-label": i })
|
|
651
|
+
]
|
|
652
|
+
}
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
function Wn(e) {
|
|
656
|
+
const s = e.props;
|
|
657
|
+
return {
|
|
658
|
+
src: s.src,
|
|
659
|
+
alt: s.alt || "?",
|
|
660
|
+
size: s.size,
|
|
661
|
+
shape: s.shape
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
function rc({ children: e, className: s, max: n }) {
|
|
665
|
+
const o = rt.toArray(e).filter(it), i = n ? o.slice(0, n) : o, c = n && o.length > n ? o.slice(n) : [];
|
|
666
|
+
return /* @__PURE__ */ m("div", { className: w(se.group, s), children: [
|
|
667
|
+
i,
|
|
668
|
+
c.length > 0 && /* @__PURE__ */ m("div", { className: se.overflowTrigger, children: [
|
|
669
|
+
/* @__PURE__ */ t(qe, { fallback: `+${c.length}`, size: "md", shape: "circle" }),
|
|
670
|
+
/* @__PURE__ */ t("div", { className: se.overflowPopover, children: c.map((r, d) => {
|
|
671
|
+
const a = Wn(r);
|
|
672
|
+
return /* @__PURE__ */ m("div", { className: se.overflowItem, children: [
|
|
673
|
+
at(r, {
|
|
674
|
+
size: "xs",
|
|
675
|
+
shape: a.shape || "circle",
|
|
676
|
+
status: void 0
|
|
677
|
+
}),
|
|
678
|
+
/* @__PURE__ */ t("span", { className: se.overflowItemName, children: a.alt })
|
|
679
|
+
] }, d);
|
|
680
|
+
}) })
|
|
681
|
+
] })
|
|
682
|
+
] });
|
|
683
|
+
}
|
|
684
|
+
const Fn = "_container_itjlj_3", qn = "_toast_itjlj_17", Un = "_toastVisible_itjlj_32", On = "_toastExiting_itjlj_37", Hn = "_iconContainer_itjlj_44", Kn = "_textContainer_itjlj_59", Zn = "_title_itjlj_69", Vn = "_message_itjlj_75", Gn = "_dismissButton_itjlj_83", Jn = "_progressBar_itjlj_106", ge = {
|
|
685
|
+
container: Fn,
|
|
686
|
+
toast: qn,
|
|
687
|
+
toastVisible: Un,
|
|
688
|
+
toastExiting: On,
|
|
689
|
+
iconContainer: Hn,
|
|
690
|
+
textContainer: Kn,
|
|
691
|
+
title: Zn,
|
|
692
|
+
message: Vn,
|
|
693
|
+
dismissButton: Gn,
|
|
694
|
+
progressBar: Jn
|
|
695
|
+
}, tt = {
|
|
696
|
+
success: "#87FF77",
|
|
697
|
+
error: "#FF7777",
|
|
698
|
+
warning: "#FFEF77",
|
|
699
|
+
info: "#77FFC9"
|
|
700
|
+
}, Xn = {
|
|
701
|
+
success: "Success",
|
|
702
|
+
error: "Error",
|
|
703
|
+
warning: "Warning",
|
|
704
|
+
info: "Info"
|
|
705
|
+
};
|
|
706
|
+
function Qn({ type: e }) {
|
|
707
|
+
const s = tt[e];
|
|
708
|
+
switch (e) {
|
|
709
|
+
case "success":
|
|
710
|
+
return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ t(
|
|
711
|
+
"path",
|
|
712
|
+
{
|
|
713
|
+
d: "M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM9.29 16.29L5.7 12.7C5.31 12.31 5.31 11.68 5.7 11.29C6.09 10.9 6.72 10.9 7.11 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.7 16.29C10.32 16.68 9.68 16.68 9.29 16.29Z",
|
|
714
|
+
fill: s
|
|
715
|
+
}
|
|
716
|
+
) });
|
|
717
|
+
case "error":
|
|
718
|
+
return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ t(
|
|
719
|
+
"path",
|
|
720
|
+
{
|
|
721
|
+
d: "M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 13C11.45 13 11 12.55 11 12V8C11 7.45 11.45 7 12 7C12.55 7 13 7.45 13 8V12C13 12.55 12.55 13 12 13ZM13 17H11V15H13V17Z",
|
|
722
|
+
fill: s
|
|
723
|
+
}
|
|
724
|
+
) });
|
|
725
|
+
case "warning":
|
|
726
|
+
return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ t(
|
|
727
|
+
"path",
|
|
728
|
+
{
|
|
729
|
+
d: "M4.47 21H19.53C21.07 21 22.03 19.33 21.26 18L13.73 4.99C12.96 3.66 11.04 3.66 10.27 4.99L2.74 18C1.97 19.33 2.93 21 4.47 21ZM12 14C11.45 14 11 13.55 11 13V11C11 10.45 11.45 10 12 10C12.55 10 13 10.45 13 11V13C13 13.55 12.55 14 12 14ZM13 18H11V16H13V18Z",
|
|
730
|
+
fill: s
|
|
731
|
+
}
|
|
732
|
+
) });
|
|
733
|
+
case "info":
|
|
734
|
+
return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ t(
|
|
735
|
+
"path",
|
|
736
|
+
{
|
|
737
|
+
d: "M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 17C11.45 17 11 16.55 11 16V12C11 11.45 11.45 11 12 11C12.55 11 13 11.45 13 12V16C13 16.55 12.55 17 12 17ZM13 9H11V7H13V9Z",
|
|
738
|
+
fill: s
|
|
739
|
+
}
|
|
740
|
+
) });
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
function Yn() {
|
|
744
|
+
return /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ t("path", { d: "M18 6L6 18M6 6l12 12" }) });
|
|
745
|
+
}
|
|
746
|
+
function eo({
|
|
747
|
+
toast: e,
|
|
748
|
+
onDismiss: s
|
|
749
|
+
}) {
|
|
750
|
+
const n = e.duration ?? 5e3, [o, i] = x(100), c = M(Date.now());
|
|
751
|
+
O(() => {
|
|
752
|
+
if (n === 1 / 0) return;
|
|
753
|
+
c.current = Date.now();
|
|
754
|
+
const d = setInterval(() => {
|
|
755
|
+
const a = Date.now() - c.current, u = Math.max(0, 100 - a / n * 100);
|
|
756
|
+
i(u), u <= 0 && clearInterval(d);
|
|
757
|
+
}, 50);
|
|
758
|
+
return () => clearInterval(d);
|
|
759
|
+
}, [n]);
|
|
760
|
+
const r = [
|
|
761
|
+
ge.toast,
|
|
762
|
+
e.state === "entering" || e.state === "visible" ? ge.toastVisible : "",
|
|
763
|
+
e.state === "exiting" ? ge.toastExiting : ""
|
|
764
|
+
].filter(Boolean).join(" ");
|
|
765
|
+
return /* @__PURE__ */ m(
|
|
766
|
+
"div",
|
|
767
|
+
{
|
|
768
|
+
className: r,
|
|
769
|
+
style: { "--toast-color": tt[e.type] },
|
|
770
|
+
children: [
|
|
771
|
+
/* @__PURE__ */ t("div", { className: ge.iconContainer, children: /* @__PURE__ */ t(Qn, { type: e.type }) }),
|
|
772
|
+
/* @__PURE__ */ m("div", { className: ge.textContainer, children: [
|
|
773
|
+
/* @__PURE__ */ t("div", { className: ge.title, children: e.title || Xn[e.type] }),
|
|
774
|
+
/* @__PURE__ */ t("div", { className: ge.message, children: e.message })
|
|
775
|
+
] }),
|
|
776
|
+
/* @__PURE__ */ t("button", { className: ge.dismissButton, onClick: () => s(e.id), children: /* @__PURE__ */ t(Yn, {}) }),
|
|
777
|
+
n !== 1 / 0 && /* @__PURE__ */ t(
|
|
778
|
+
"div",
|
|
779
|
+
{
|
|
780
|
+
className: ge.progressBar,
|
|
781
|
+
style: { width: `${o}%`, transitionDuration: "50ms" }
|
|
782
|
+
}
|
|
783
|
+
)
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
const nt = Oe(null);
|
|
789
|
+
let to = 0;
|
|
790
|
+
function no() {
|
|
791
|
+
return `ps-toast-${++to}`;
|
|
792
|
+
}
|
|
793
|
+
function ic({ children: e }) {
|
|
794
|
+
const [s, n] = x([]), [o, i] = x(!1);
|
|
795
|
+
O(() => {
|
|
796
|
+
i(!0);
|
|
797
|
+
}, []);
|
|
798
|
+
const c = S((a) => {
|
|
799
|
+
n(
|
|
800
|
+
(u) => u.map((f) => f.id === a ? { ...f, state: "exiting" } : f)
|
|
801
|
+
), setTimeout(() => {
|
|
802
|
+
n((u) => u.filter((f) => f.id !== a));
|
|
803
|
+
}, 500);
|
|
804
|
+
}, []), r = S(
|
|
805
|
+
({ type: a, title: u, message: f, duration: p }) => {
|
|
806
|
+
const v = no(), l = p ?? 5e3, _ = {
|
|
807
|
+
id: v,
|
|
808
|
+
type: a,
|
|
809
|
+
title: u,
|
|
810
|
+
message: f,
|
|
811
|
+
duration: l,
|
|
812
|
+
state: "entering",
|
|
813
|
+
createdAt: Date.now()
|
|
814
|
+
};
|
|
815
|
+
return n((y) => [...y, _]), requestAnimationFrame(() => {
|
|
816
|
+
n(
|
|
817
|
+
(y) => y.map((k) => k.id === v ? { ...k, state: "visible" } : k)
|
|
818
|
+
);
|
|
819
|
+
}), l !== 1 / 0 && setTimeout(() => c(v), l), v;
|
|
820
|
+
},
|
|
821
|
+
[c]
|
|
822
|
+
), d = {
|
|
823
|
+
add: r,
|
|
824
|
+
dismiss: c,
|
|
825
|
+
success: (a, u) => r({ type: "success", message: a, title: u }),
|
|
826
|
+
error: (a, u) => r({ type: "error", message: a, title: u }),
|
|
827
|
+
warning: (a, u) => r({ type: "warning", message: a, title: u }),
|
|
828
|
+
info: (a, u) => r({ type: "info", message: a, title: u })
|
|
829
|
+
};
|
|
830
|
+
return /* @__PURE__ */ m(nt.Provider, { value: d, children: [
|
|
831
|
+
e,
|
|
832
|
+
o ? Re(
|
|
833
|
+
/* @__PURE__ */ t("div", { className: ge.container, children: s.map((a) => /* @__PURE__ */ t(eo, { toast: a, onDismiss: c }, a.id)) }),
|
|
834
|
+
document.body
|
|
835
|
+
) : null
|
|
836
|
+
] });
|
|
837
|
+
}
|
|
838
|
+
function ac() {
|
|
839
|
+
const e = Ee(nt);
|
|
840
|
+
if (!e)
|
|
841
|
+
throw new Error("useToast must be used within <ToastProvider>");
|
|
842
|
+
return e;
|
|
843
|
+
}
|
|
844
|
+
const oo = "_pagination_1oqir_1", so = "_pageItem_1oqir_8", ro = "_active_1oqir_25", io = "_nav_1oqir_41", ao = "_ellipsis_1oqir_45", ye = {
|
|
845
|
+
pagination: oo,
|
|
846
|
+
pageItem: so,
|
|
847
|
+
active: ro,
|
|
848
|
+
nav: io,
|
|
849
|
+
ellipsis: ao
|
|
850
|
+
};
|
|
851
|
+
function co() {
|
|
852
|
+
return /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "15 18 9 12 15 6" }) });
|
|
853
|
+
}
|
|
854
|
+
function lo() {
|
|
855
|
+
return /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "9 6 15 12 9 18" }) });
|
|
856
|
+
}
|
|
857
|
+
function uo(e, s, n) {
|
|
858
|
+
if (s <= n)
|
|
859
|
+
return Array.from({ length: s }, (d, a) => a + 1);
|
|
860
|
+
const o = [], i = Math.floor((n - 3) / 2);
|
|
861
|
+
o.push(1);
|
|
862
|
+
const c = Math.max(2, e - i), r = Math.min(s - 1, e + i);
|
|
863
|
+
c > 2 && o.push("...");
|
|
864
|
+
for (let d = c; d <= r; d++)
|
|
865
|
+
o.push(d);
|
|
866
|
+
return r < s - 1 && o.push("..."), s > 1 && o.push(s), o;
|
|
867
|
+
}
|
|
868
|
+
function cc({
|
|
869
|
+
totalItems: e,
|
|
870
|
+
itemsPerPage: s,
|
|
871
|
+
currentPage: n,
|
|
872
|
+
onPageChange: o,
|
|
873
|
+
maxButtons: i = 7,
|
|
874
|
+
className: c
|
|
875
|
+
}) {
|
|
876
|
+
const r = Math.ceil(e / s), d = Je(
|
|
877
|
+
() => uo(n, r, i),
|
|
878
|
+
[n, r, i]
|
|
879
|
+
);
|
|
880
|
+
return r <= 1 ? null : /* @__PURE__ */ m("nav", { className: w(ye.pagination, c), "aria-label": "Pagination", children: [
|
|
881
|
+
/* @__PURE__ */ t(
|
|
882
|
+
"button",
|
|
883
|
+
{
|
|
884
|
+
className: w(ye.pageItem, ye.nav),
|
|
885
|
+
onClick: () => o(n - 1),
|
|
886
|
+
disabled: n <= 1,
|
|
887
|
+
"aria-label": "Previous page",
|
|
888
|
+
children: /* @__PURE__ */ t(co, {})
|
|
889
|
+
}
|
|
890
|
+
),
|
|
891
|
+
d.map((a, u) => a === "..." ? /* @__PURE__ */ t("span", { className: ye.ellipsis, children: "…" }, `ellipsis-${u}`) : /* @__PURE__ */ t(
|
|
892
|
+
"button",
|
|
893
|
+
{
|
|
894
|
+
className: w(ye.pageItem, n === a && ye.active),
|
|
895
|
+
onClick: () => o(a),
|
|
896
|
+
"aria-current": n === a ? "page" : void 0,
|
|
897
|
+
children: a
|
|
898
|
+
},
|
|
899
|
+
a
|
|
900
|
+
)),
|
|
901
|
+
/* @__PURE__ */ t(
|
|
902
|
+
"button",
|
|
903
|
+
{
|
|
904
|
+
className: w(ye.pageItem, ye.nav),
|
|
905
|
+
onClick: () => o(n + 1),
|
|
906
|
+
disabled: n >= r,
|
|
907
|
+
"aria-label": "Next page",
|
|
908
|
+
children: /* @__PURE__ */ t(lo, {})
|
|
909
|
+
}
|
|
910
|
+
)
|
|
911
|
+
] });
|
|
912
|
+
}
|
|
913
|
+
const _o = "_container_1np4j_1", po = "_topSection_1np4j_26", mo = "_userAvatar_1np4j_39", ho = "_userInfo_1np4j_47", fo = "_badges_1np4j_57", vo = "_badge_1np4j_57", go = "_badgeIcon_1np4j_73", bo = "_badgeDot_1np4j_82", wo = "_nickname_1np4j_88", yo = "_bottomSection_1np4j_100", ko = "_statusText_1np4j_109", xo = "_statusIcon_1np4j_120", de = {
|
|
914
|
+
container: _o,
|
|
915
|
+
topSection: po,
|
|
916
|
+
userAvatar: mo,
|
|
917
|
+
userInfo: ho,
|
|
918
|
+
badges: fo,
|
|
919
|
+
badge: vo,
|
|
920
|
+
badgeIcon: go,
|
|
921
|
+
badgeDot: bo,
|
|
922
|
+
nickname: wo,
|
|
923
|
+
bottomSection: yo,
|
|
924
|
+
statusText: ko,
|
|
925
|
+
statusIcon: xo
|
|
926
|
+
};
|
|
927
|
+
function No({ user: e, statusText: s, statusColor: n, className: o }) {
|
|
928
|
+
const i = e.bannerUrl ? `linear-gradient(0deg, #2C303F 0%, rgba(55,60,80,0.3) 100%), url(${e.bannerUrl})` : "linear-gradient(0deg, #2C303F 0%, rgba(55,60,80,0.3) 100%)", r = (e.currentTrack ? e.currentTrack.artists ? `${e.currentTrack.title} — ${e.currentTrack.artists}` : e.currentTrack.title : null) || s || (e.status === "online" ? "Online" : "Offline"), a = { "--ps-user-status-color": n || (e.status === "online" ? "#66E3FF" : "#434B61") };
|
|
929
|
+
return /* @__PURE__ */ m("div", { className: w(de.container, o), style: a, "aria-hidden": !0, children: [
|
|
930
|
+
/* @__PURE__ */ m(
|
|
931
|
+
"div",
|
|
932
|
+
{
|
|
933
|
+
className: de.topSection,
|
|
934
|
+
style: { background: i },
|
|
935
|
+
children: [
|
|
936
|
+
/* @__PURE__ */ t(
|
|
937
|
+
"img",
|
|
938
|
+
{
|
|
939
|
+
src: e.avatarUrl,
|
|
940
|
+
alt: e.username,
|
|
941
|
+
className: de.userAvatar,
|
|
942
|
+
draggable: !1
|
|
943
|
+
}
|
|
944
|
+
),
|
|
945
|
+
/* @__PURE__ */ m("div", { className: de.userInfo, children: [
|
|
946
|
+
e.badges && e.badges.length > 0 && /* @__PURE__ */ t("div", { className: de.badges, children: e.badges.map((u) => /* @__PURE__ */ t("div", { className: de.badge, title: u.name, children: typeof u.icon == "string" ? /* @__PURE__ */ t("img", { src: u.icon, alt: u.name, className: de.badgeIcon, draggable: !1 }) : u.icon ? /* @__PURE__ */ t("span", { className: de.badgeIcon, children: u.icon }) : /* @__PURE__ */ t(
|
|
947
|
+
"span",
|
|
948
|
+
{
|
|
949
|
+
className: de.badgeDot,
|
|
950
|
+
style: { background: u.color || "var(--ps-text-muted)" }
|
|
951
|
+
}
|
|
952
|
+
) }, u.key)) }),
|
|
953
|
+
/* @__PURE__ */ t("div", { className: de.nickname, children: e.nickname || e.username })
|
|
954
|
+
] })
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
),
|
|
958
|
+
/* @__PURE__ */ m("div", { className: de.bottomSection, children: [
|
|
959
|
+
/* @__PURE__ */ t("div", { className: de.statusText, children: r }),
|
|
960
|
+
/* @__PURE__ */ t("div", { className: de.statusIcon, "aria-hidden": !0, children: "●" })
|
|
961
|
+
] })
|
|
962
|
+
] });
|
|
963
|
+
}
|
|
964
|
+
const Co = "_root_xyr14_1", Lo = "_trigger_xyr14_6", $o = "_dot_xyr14_24", Ro = "_username_xyr14_31", Bo = "_popover_xyr14_36", Io = "_fallbackContent_xyr14_60", Ne = {
|
|
965
|
+
root: Co,
|
|
966
|
+
trigger: Lo,
|
|
967
|
+
dot: $o,
|
|
968
|
+
username: Ro,
|
|
969
|
+
popover: Bo,
|
|
970
|
+
fallbackContent: Io
|
|
971
|
+
};
|
|
972
|
+
function lc({
|
|
973
|
+
username: e,
|
|
974
|
+
dotColor: s = "#94a3b8",
|
|
975
|
+
user: n,
|
|
976
|
+
onFetchUser: o,
|
|
977
|
+
statusText: i,
|
|
978
|
+
statusColor: c,
|
|
979
|
+
loadingContent: r,
|
|
980
|
+
notFoundContent: d,
|
|
981
|
+
className: a
|
|
982
|
+
}) {
|
|
983
|
+
const [u, f] = x(!1), [p, v] = x(null), [l, _] = x(!1), [y, k] = x(!1), C = M(null), L = M(null), $ = n ?? p, N = S(() => {
|
|
984
|
+
L.current && (clearTimeout(L.current), L.current = null), C.current = window.setTimeout(async () => {
|
|
985
|
+
if (f(!0), n === void 0 && o && !y) {
|
|
986
|
+
_(!0);
|
|
987
|
+
try {
|
|
988
|
+
const q = await o(e);
|
|
989
|
+
v(q);
|
|
990
|
+
} catch {
|
|
991
|
+
v(null);
|
|
992
|
+
} finally {
|
|
993
|
+
_(!1), k(!0);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}, 150);
|
|
997
|
+
}, [n, o, y, e]), F = S(() => {
|
|
998
|
+
C.current && (clearTimeout(C.current), C.current = null), L.current = window.setTimeout(() => f(!1), 200);
|
|
999
|
+
}, []);
|
|
1000
|
+
return /* @__PURE__ */ m(
|
|
1001
|
+
"span",
|
|
1002
|
+
{
|
|
1003
|
+
className: w(Ne.root, a),
|
|
1004
|
+
onMouseEnter: N,
|
|
1005
|
+
onMouseLeave: F,
|
|
1006
|
+
children: [
|
|
1007
|
+
/* @__PURE__ */ m("span", { className: Ne.trigger, role: "button", tabIndex: 0, children: [
|
|
1008
|
+
/* @__PURE__ */ t("span", { className: Ne.dot, style: { background: s }, "aria-hidden": !0 }),
|
|
1009
|
+
/* @__PURE__ */ t("span", { className: Ne.username, children: e })
|
|
1010
|
+
] }),
|
|
1011
|
+
u && /* @__PURE__ */ m("div", { className: Ne.popover, children: [
|
|
1012
|
+
l && !$ && /* @__PURE__ */ t("div", { className: Ne.fallbackContent, children: r || "Loading..." }),
|
|
1013
|
+
!l && !$ && y && /* @__PURE__ */ t("div", { className: Ne.fallbackContent, children: d || "User not found" }),
|
|
1014
|
+
$ && /* @__PURE__ */ t(
|
|
1015
|
+
No,
|
|
1016
|
+
{
|
|
1017
|
+
user: $,
|
|
1018
|
+
statusText: i,
|
|
1019
|
+
statusColor: c
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
] })
|
|
1023
|
+
]
|
|
1024
|
+
}
|
|
1025
|
+
);
|
|
1026
|
+
}
|
|
1027
|
+
const Eo = "_tabs_1tgyr_1", jo = "_tabList_1tgyr_6", Do = "_tabIndicator_1tgyr_16", So = "_tab_1tgyr_1", To = "_tabActive_1tgyr_46", Mo = "_tabDisabled_1tgyr_50", zo = "_tabPanel_1tgyr_55", Ce = {
|
|
1028
|
+
tabs: Eo,
|
|
1029
|
+
tabList: jo,
|
|
1030
|
+
tabIndicator: Do,
|
|
1031
|
+
tab: So,
|
|
1032
|
+
tabActive: To,
|
|
1033
|
+
tabDisabled: Mo,
|
|
1034
|
+
tabPanel: zo
|
|
1035
|
+
}, Me = Oe(null);
|
|
1036
|
+
function dc({ value: e, onChange: s, children: n, className: o }) {
|
|
1037
|
+
return /* @__PURE__ */ t(Me.Provider, { value: { value: e, onChange: s }, children: /* @__PURE__ */ t("div", { className: w(Ce.tabs, o), children: n }) });
|
|
1038
|
+
}
|
|
1039
|
+
function uc({ children: e, className: s }) {
|
|
1040
|
+
const n = Ee(Me), o = M(null), [i, c] = x({ left: 0, width: 0 });
|
|
1041
|
+
return He(() => {
|
|
1042
|
+
const r = o.current, d = n == null ? void 0 : n.value;
|
|
1043
|
+
if (!r || !d) return;
|
|
1044
|
+
const a = r.querySelector(`[data-tab-value="${d}"]`);
|
|
1045
|
+
if (!a) return;
|
|
1046
|
+
const u = r.getBoundingClientRect(), f = a.getBoundingClientRect();
|
|
1047
|
+
c({
|
|
1048
|
+
left: f.left - u.left,
|
|
1049
|
+
width: f.width
|
|
1050
|
+
});
|
|
1051
|
+
}, [n == null ? void 0 : n.value, e]), /* @__PURE__ */ m("div", { ref: o, className: w(Ce.tabList, s), role: "tablist", children: [
|
|
1052
|
+
/* @__PURE__ */ t(
|
|
1053
|
+
"div",
|
|
1054
|
+
{
|
|
1055
|
+
className: Ce.tabIndicator,
|
|
1056
|
+
style: {
|
|
1057
|
+
transform: `translateX(${i.left}px)`,
|
|
1058
|
+
width: Math.max(i.width, 0),
|
|
1059
|
+
opacity: i.width > 0 ? 1 : 0
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
),
|
|
1063
|
+
e
|
|
1064
|
+
] });
|
|
1065
|
+
}
|
|
1066
|
+
function _c({ value: e, children: s, disabled: n, className: o }) {
|
|
1067
|
+
const i = Ee(Me), c = (i == null ? void 0 : i.value) === e, r = S(() => {
|
|
1068
|
+
!n && i && i.onChange(e);
|
|
1069
|
+
}, [i, e, n]);
|
|
1070
|
+
return /* @__PURE__ */ t(
|
|
1071
|
+
"button",
|
|
1072
|
+
{
|
|
1073
|
+
role: "tab",
|
|
1074
|
+
"aria-selected": c,
|
|
1075
|
+
tabIndex: c ? 0 : -1,
|
|
1076
|
+
"data-tab-value": e,
|
|
1077
|
+
className: w(Ce.tab, c && Ce.tabActive, n && Ce.tabDisabled, o),
|
|
1078
|
+
onClick: r,
|
|
1079
|
+
disabled: n,
|
|
1080
|
+
children: s
|
|
1081
|
+
}
|
|
1082
|
+
);
|
|
1083
|
+
}
|
|
1084
|
+
function pc({ value: e, children: s, className: n }) {
|
|
1085
|
+
const o = Ee(Me);
|
|
1086
|
+
return (o == null ? void 0 : o.value) !== e ? null : /* @__PURE__ */ t("div", { role: "tabpanel", className: w(Ce.tabPanel, n), children: s });
|
|
1087
|
+
}
|
|
1088
|
+
const Po = "_wrapper_1n2ha_2", Ao = "_labelRow_1n2ha_9", Wo = "_label_1n2ha_9", Fo = "_resetBtn_1n2ha_24", qo = "_input_1n2ha_44", Uo = "_size-sm_1n2ha_68", Oo = "_size-md_1n2ha_73", Ho = "_size-lg_1n2ha_78", Ko = "_hasError_1n2ha_84", Zo = "_inputContainer_1n2ha_92", Vo = "_hasIcons_1n2ha_97", Go = "_iconLeft_1n2ha_119", Jo = "_iconRight_1n2ha_132", Xo = "_hint_1n2ha_146", Qo = "_hintError_1n2ha_151", ie = {
|
|
1089
|
+
wrapper: Po,
|
|
1090
|
+
labelRow: Ao,
|
|
1091
|
+
label: Wo,
|
|
1092
|
+
resetBtn: Fo,
|
|
1093
|
+
input: qo,
|
|
1094
|
+
sizeSm: Uo,
|
|
1095
|
+
sizeMd: Oo,
|
|
1096
|
+
sizeLg: Ho,
|
|
1097
|
+
hasError: Ko,
|
|
1098
|
+
inputContainer: Zo,
|
|
1099
|
+
hasIcons: Vo,
|
|
1100
|
+
iconLeft: Go,
|
|
1101
|
+
iconRight: Jo,
|
|
1102
|
+
hint: Xo,
|
|
1103
|
+
hintError: Qo
|
|
1104
|
+
}, Yo = ct(
|
|
1105
|
+
({ label: e, hint: s, error: n, size: o = "md", leftIcon: i, rightIcon: c, resetValue: r, onResetValue: d, resetText: a = "Reset", wrapperClassName: u, className: f, disabled: p, value: v, defaultValue: l, ..._ }, y) => {
|
|
1106
|
+
const k = !!(i || c), C = v !== void 0 ? String(v) : void 0, L = r !== void 0 && C !== void 0 && C !== r;
|
|
1107
|
+
return /* @__PURE__ */ m("div", { className: w(ie.wrapper, ie[`size-${o}`], n && ie.hasError, u), children: [
|
|
1108
|
+
(e || L) && /* @__PURE__ */ m("div", { className: ie.labelRow, children: [
|
|
1109
|
+
e && /* @__PURE__ */ t("label", { className: ie.label, children: e }),
|
|
1110
|
+
L && /* @__PURE__ */ t("button", { type: "button", className: ie.resetBtn, onClick: ($) => {
|
|
1111
|
+
$.stopPropagation(), d == null || d(r);
|
|
1112
|
+
}, children: a })
|
|
1113
|
+
] }),
|
|
1114
|
+
k ? /* @__PURE__ */ m("div", { className: w(ie.inputContainer, ie.hasIcons, n && ie.hasError), children: [
|
|
1115
|
+
i && /* @__PURE__ */ t("span", { className: ie.iconLeft, children: i }),
|
|
1116
|
+
/* @__PURE__ */ t("input", { ref: y, className: w(ie.input, f), disabled: p, value: v, defaultValue: l, ..._ }),
|
|
1117
|
+
c && /* @__PURE__ */ t("span", { className: ie.iconRight, children: c })
|
|
1118
|
+
] }) : /* @__PURE__ */ t("input", { ref: y, className: w(ie.input, f), disabled: p, value: v, defaultValue: l, ..._ }),
|
|
1119
|
+
(n || s) && /* @__PURE__ */ t("span", { className: w(ie.hint, n && ie.hintError), children: n || s })
|
|
1120
|
+
] });
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1123
|
+
Yo.displayName = "Input";
|
|
1124
|
+
const es = "_badge_1vdax_1", ts = "_uppercase_1vdax_11", ns = "_size-sm_1vdax_16", os = "_size-md_1vdax_21", ss = "_variant-success_1vdax_27", rs = "_variant-danger_1vdax_32", is = "_variant-warning_1vdax_37", as = "_variant-info_1vdax_42", cs = "_variant-neutral_1vdax_47", ls = "_icon_1vdax_53", Be = {
|
|
1125
|
+
badge: es,
|
|
1126
|
+
uppercase: ts,
|
|
1127
|
+
sizeSm: ns,
|
|
1128
|
+
sizeMd: os,
|
|
1129
|
+
variantSuccess: ss,
|
|
1130
|
+
variantDanger: rs,
|
|
1131
|
+
variantWarning: is,
|
|
1132
|
+
variantInfo: as,
|
|
1133
|
+
variantNeutral: cs,
|
|
1134
|
+
icon: ls
|
|
1135
|
+
};
|
|
1136
|
+
function mc({
|
|
1137
|
+
children: e,
|
|
1138
|
+
variant: s = "neutral",
|
|
1139
|
+
size: n = "md",
|
|
1140
|
+
icon: o,
|
|
1141
|
+
uppercase: i = !0,
|
|
1142
|
+
className: c
|
|
1143
|
+
}) {
|
|
1144
|
+
return /* @__PURE__ */ m(
|
|
1145
|
+
"span",
|
|
1146
|
+
{
|
|
1147
|
+
className: w(
|
|
1148
|
+
Be.badge,
|
|
1149
|
+
Be[`variant-${s}`],
|
|
1150
|
+
Be[`size-${n}`],
|
|
1151
|
+
i && Be.uppercase,
|
|
1152
|
+
c
|
|
1153
|
+
),
|
|
1154
|
+
children: [
|
|
1155
|
+
o && /* @__PURE__ */ t("span", { className: Be.icon, children: o }),
|
|
1156
|
+
e
|
|
1157
|
+
]
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
const ds = "_skeleton_sk2cr_1", us = "_animated_sk2cr_7", _s = "_group_sk2cr_21", Ie = {
|
|
1162
|
+
skeleton: ds,
|
|
1163
|
+
animated: us,
|
|
1164
|
+
group: _s
|
|
1165
|
+
};
|
|
1166
|
+
function hc({
|
|
1167
|
+
width: e,
|
|
1168
|
+
height: s,
|
|
1169
|
+
variant: n = "text",
|
|
1170
|
+
borderRadius: o,
|
|
1171
|
+
count: i = 1,
|
|
1172
|
+
gap: c = 8,
|
|
1173
|
+
static: r,
|
|
1174
|
+
className: d
|
|
1175
|
+
}) {
|
|
1176
|
+
const a = () => {
|
|
1177
|
+
if (o !== void 0) return typeof o == "number" ? `${o}px` : o;
|
|
1178
|
+
switch (n) {
|
|
1179
|
+
case "circular":
|
|
1180
|
+
return "50%";
|
|
1181
|
+
case "rounded":
|
|
1182
|
+
return "12px";
|
|
1183
|
+
case "rectangular":
|
|
1184
|
+
return "0";
|
|
1185
|
+
case "text":
|
|
1186
|
+
default:
|
|
1187
|
+
return "8px";
|
|
1188
|
+
}
|
|
1189
|
+
}, u = {
|
|
1190
|
+
width: typeof e == "number" ? `${e}px` : e,
|
|
1191
|
+
height: typeof s == "number" ? `${s}px` : s || (n === "text" ? "16px" : void 0),
|
|
1192
|
+
borderRadius: a()
|
|
1193
|
+
};
|
|
1194
|
+
return n === "circular" && e && !s && (u.height = u.width), i > 1 ? /* @__PURE__ */ t("div", { className: Ie.group, style: { gap: c }, children: Array.from({ length: i }, (f, p) => /* @__PURE__ */ t(
|
|
1195
|
+
"div",
|
|
1196
|
+
{
|
|
1197
|
+
className: w(Ie.skeleton, !r && Ie.animated, d),
|
|
1198
|
+
style: {
|
|
1199
|
+
...u,
|
|
1200
|
+
width: p === i - 1 ? "75%" : u.width
|
|
1201
|
+
}
|
|
1202
|
+
},
|
|
1203
|
+
p
|
|
1204
|
+
)) }) : /* @__PURE__ */ t("div", { className: w(Ie.skeleton, !r && Ie.animated, d), style: u });
|
|
1205
|
+
}
|
|
1206
|
+
const ps = "_wrapper_jnagf_6", ms = "_disabled_jnagf_13", hs = "_labelRow_jnagf_19", fs = "_label_jnagf_19", vs = "_resetBtn_jnagf_36", gs = "_descDot_jnagf_52", bs = "_bar_jnagf_70", ws = "_barActive_jnagf_91", ys = "_fill_jnagf_96", ks = "_edge_jnagf_114", xs = "_edgeActive_jnagf_130", Ns = "_content_jnagf_136", Cs = "_minLabel_jnagf_148", Ls = "_maxLabel_jnagf_149", $s = "_valueCenter_jnagf_161", Rs = "_valueBtn_jnagf_169", Bs = "_unit_jnagf_186", Is = "_valueInput_jnagf_193", ne = {
|
|
1207
|
+
wrapper: ps,
|
|
1208
|
+
disabled: ms,
|
|
1209
|
+
labelRow: hs,
|
|
1210
|
+
label: fs,
|
|
1211
|
+
resetBtn: vs,
|
|
1212
|
+
descDot: gs,
|
|
1213
|
+
bar: bs,
|
|
1214
|
+
barActive: ws,
|
|
1215
|
+
fill: ys,
|
|
1216
|
+
edge: ks,
|
|
1217
|
+
edgeActive: xs,
|
|
1218
|
+
content: Ns,
|
|
1219
|
+
minLabel: Cs,
|
|
1220
|
+
maxLabel: Ls,
|
|
1221
|
+
valueCenter: $s,
|
|
1222
|
+
valueBtn: Rs,
|
|
1223
|
+
unit: Bs,
|
|
1224
|
+
valueInput: Is
|
|
1225
|
+
}, De = (e, s, n) => Math.min(n, Math.max(s, e)), Es = (e, s, n) => Math.round((e - n) / s) * s + n;
|
|
1226
|
+
function fc({
|
|
1227
|
+
min: e,
|
|
1228
|
+
max: s,
|
|
1229
|
+
step: n = 1,
|
|
1230
|
+
value: o,
|
|
1231
|
+
onChange: i,
|
|
1232
|
+
defaultValue: c,
|
|
1233
|
+
label: r,
|
|
1234
|
+
description: d,
|
|
1235
|
+
unit: a,
|
|
1236
|
+
showValue: u = !0,
|
|
1237
|
+
editable: f = !0,
|
|
1238
|
+
disabled: p = !1,
|
|
1239
|
+
resetText: v = "Reset",
|
|
1240
|
+
className: l
|
|
1241
|
+
}) {
|
|
1242
|
+
const _ = M(null), [y, k] = x(!1), [C, L] = x(!1), [$, N] = x(""), F = Math.max(1e-5, s - e), q = De(o, e, s), A = (q - e) / F * 100, U = c !== void 0 && o !== c, h = S((b) => {
|
|
1243
|
+
i == null || i(De(Es(b, n, e), e, s));
|
|
1244
|
+
}, [i, n, e, s]), I = (b) => {
|
|
1245
|
+
b.stopPropagation(), c !== void 0 && (i == null || i(c));
|
|
1246
|
+
};
|
|
1247
|
+
O(() => {
|
|
1248
|
+
if (!y) return;
|
|
1249
|
+
const b = (X) => {
|
|
1250
|
+
if (!_.current) return;
|
|
1251
|
+
const re = _.current.getBoundingClientRect(), j = De((X.clientX - re.left) / re.width, 0, 1);
|
|
1252
|
+
h(e + j * F);
|
|
1253
|
+
}, W = () => k(!1);
|
|
1254
|
+
return window.addEventListener("mousemove", b), window.addEventListener("mouseup", W), () => {
|
|
1255
|
+
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", W);
|
|
1256
|
+
};
|
|
1257
|
+
}, [y, e, F, h]);
|
|
1258
|
+
const E = (b) => {
|
|
1259
|
+
if (p || C || (b.stopPropagation(), k(!0), !_.current)) return;
|
|
1260
|
+
const W = _.current.getBoundingClientRect(), X = De((b.clientX - W.left) / W.width, 0, 1);
|
|
1261
|
+
h(e + X * F);
|
|
1262
|
+
}, P = (b) => {
|
|
1263
|
+
if (p) return;
|
|
1264
|
+
const W = b.shiftKey ? 10 : 1;
|
|
1265
|
+
(b.key === "ArrowLeft" || b.key === "ArrowDown") && (b.preventDefault(), h(q - n * W)), (b.key === "ArrowRight" || b.key === "ArrowUp") && (b.preventDefault(), h(q + n * W)), b.key === "Home" && (b.preventDefault(), h(e)), b.key === "End" && (b.preventDefault(), h(s));
|
|
1266
|
+
}, H = (b) => {
|
|
1267
|
+
b.stopPropagation(), !(!f || p) && (N(String(q)), L(!0));
|
|
1268
|
+
}, K = (b) => {
|
|
1269
|
+
if (b) {
|
|
1270
|
+
const W = Number($.replace(",", "."));
|
|
1271
|
+
Number.isFinite(W) && h(W);
|
|
1272
|
+
}
|
|
1273
|
+
L(!1);
|
|
1274
|
+
};
|
|
1275
|
+
return /* @__PURE__ */ m("div", { className: w(ne.wrapper, p && ne.disabled, l), children: [
|
|
1276
|
+
(r || U) && /* @__PURE__ */ m("div", { className: ne.labelRow, children: [
|
|
1277
|
+
r && /* @__PURE__ */ m("div", { className: ne.label, children: [
|
|
1278
|
+
r,
|
|
1279
|
+
d && /* @__PURE__ */ t(Le, { content: d, position: "right", children: /* @__PURE__ */ t("span", { className: ne.descDot, children: "?" }) })
|
|
1280
|
+
] }),
|
|
1281
|
+
U && /* @__PURE__ */ t("button", { type: "button", className: ne.resetBtn, onClick: I, children: v })
|
|
1282
|
+
] }),
|
|
1283
|
+
/* @__PURE__ */ m(
|
|
1284
|
+
"div",
|
|
1285
|
+
{
|
|
1286
|
+
ref: _,
|
|
1287
|
+
className: w(ne.bar, y && ne.barActive),
|
|
1288
|
+
role: "slider",
|
|
1289
|
+
"aria-valuemin": e,
|
|
1290
|
+
"aria-valuemax": s,
|
|
1291
|
+
"aria-valuenow": q,
|
|
1292
|
+
"aria-label": r,
|
|
1293
|
+
tabIndex: p ? -1 : 0,
|
|
1294
|
+
onKeyDown: P,
|
|
1295
|
+
onMouseDown: E,
|
|
1296
|
+
children: [
|
|
1297
|
+
/* @__PURE__ */ t("div", { className: ne.fill, style: { width: `${A}%` } }),
|
|
1298
|
+
/* @__PURE__ */ t("div", { className: w(ne.edge, y && ne.edgeActive), style: { left: `${A}%` } }),
|
|
1299
|
+
/* @__PURE__ */ m("div", { className: ne.content, children: [
|
|
1300
|
+
/* @__PURE__ */ m("span", { className: ne.minLabel, children: [
|
|
1301
|
+
e,
|
|
1302
|
+
a
|
|
1303
|
+
] }),
|
|
1304
|
+
/* @__PURE__ */ m("span", { className: ne.maxLabel, children: [
|
|
1305
|
+
s,
|
|
1306
|
+
a
|
|
1307
|
+
] }),
|
|
1308
|
+
u && /* @__PURE__ */ t("div", { className: ne.valueCenter, children: C ? /* @__PURE__ */ t(
|
|
1309
|
+
"input",
|
|
1310
|
+
{
|
|
1311
|
+
className: ne.valueInput,
|
|
1312
|
+
autoFocus: !0,
|
|
1313
|
+
value: $,
|
|
1314
|
+
onClick: (b) => b.stopPropagation(),
|
|
1315
|
+
onMouseDown: (b) => b.stopPropagation(),
|
|
1316
|
+
onChange: (b) => N(b.target.value),
|
|
1317
|
+
onBlur: () => K(!0),
|
|
1318
|
+
onKeyDown: (b) => {
|
|
1319
|
+
b.stopPropagation(), b.key === "Enter" && K(!0), b.key === "Escape" && K(!1);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
) : /* @__PURE__ */ m("button", { type: "button", className: ne.valueBtn, onMouseDown: (b) => b.stopPropagation(), onClick: H, children: [
|
|
1323
|
+
q,
|
|
1324
|
+
/* @__PURE__ */ t("span", { className: ne.unit, children: a })
|
|
1325
|
+
] }) })
|
|
1326
|
+
] })
|
|
1327
|
+
]
|
|
1328
|
+
}
|
|
1329
|
+
)
|
|
1330
|
+
] });
|
|
1331
|
+
}
|
|
1332
|
+
const js = "_container_1h6u9_3", Ds = "_disabled_1h6u9_21", Ss = "_labelRow_1h6u9_26", Ts = "_label_1h6u9_26", Ms = "_descDot_1h6u9_43", zs = "_resetBtn_1h6u9_58", Ps = "_valueLine_1h6u9_74", As = "_value_1h6u9_74", Ws = "_valueInactive_1h6u9_88", Fs = "_indicator_1h6u9_92", qs = "_indicatorActive_1h6u9_99", Us = "_error_1h6u9_104", Os = "_errorText_1h6u9_108", ue = {
|
|
1333
|
+
container: js,
|
|
1334
|
+
disabled: Ds,
|
|
1335
|
+
labelRow: Ss,
|
|
1336
|
+
label: Ts,
|
|
1337
|
+
descDot: Ms,
|
|
1338
|
+
resetBtn: zs,
|
|
1339
|
+
valueLine: Ps,
|
|
1340
|
+
value: As,
|
|
1341
|
+
valueInactive: Ws,
|
|
1342
|
+
indicator: Fs,
|
|
1343
|
+
indicatorActive: qs,
|
|
1344
|
+
error: Us,
|
|
1345
|
+
errorText: Os
|
|
1346
|
+
};
|
|
1347
|
+
function Hs() {
|
|
1348
|
+
return /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "20 6 9 17 4 12" }) });
|
|
1349
|
+
}
|
|
1350
|
+
function Ks() {
|
|
1351
|
+
return /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
1352
|
+
}
|
|
1353
|
+
function vc({
|
|
1354
|
+
checked: e,
|
|
1355
|
+
onChange: s,
|
|
1356
|
+
defaultChecked: n,
|
|
1357
|
+
label: o,
|
|
1358
|
+
description: i,
|
|
1359
|
+
enabledText: c = "Включено",
|
|
1360
|
+
disabledText: r = "Выключено",
|
|
1361
|
+
disabled: d,
|
|
1362
|
+
error: a,
|
|
1363
|
+
resetText: u = "Reset",
|
|
1364
|
+
className: f
|
|
1365
|
+
}) {
|
|
1366
|
+
const p = S(() => {
|
|
1367
|
+
d || s(!e);
|
|
1368
|
+
}, [e, d, s]), v = n !== void 0 && e !== n, l = S((_) => {
|
|
1369
|
+
_.stopPropagation(), n !== void 0 && s(n);
|
|
1370
|
+
}, [n, s]);
|
|
1371
|
+
return /* @__PURE__ */ m(
|
|
1372
|
+
"div",
|
|
1373
|
+
{
|
|
1374
|
+
className: w(ue.container, d && ue.disabled, a && ue.error, f),
|
|
1375
|
+
onClick: p,
|
|
1376
|
+
role: "switch",
|
|
1377
|
+
"aria-checked": e,
|
|
1378
|
+
tabIndex: 0,
|
|
1379
|
+
onKeyDown: (_) => {
|
|
1380
|
+
(_.key === " " || _.key === "Enter") && (_.preventDefault(), p());
|
|
1381
|
+
},
|
|
1382
|
+
children: [
|
|
1383
|
+
(o || v) && /* @__PURE__ */ m("div", { className: ue.labelRow, children: [
|
|
1384
|
+
o && /* @__PURE__ */ m("div", { className: ue.label, children: [
|
|
1385
|
+
o,
|
|
1386
|
+
i && /* @__PURE__ */ t(Le, { content: i, position: "right", children: /* @__PURE__ */ t("span", { className: ue.descDot, children: "?" }) })
|
|
1387
|
+
] }),
|
|
1388
|
+
v && /* @__PURE__ */ t("button", { type: "button", className: ue.resetBtn, onClick: l, children: u })
|
|
1389
|
+
] }),
|
|
1390
|
+
/* @__PURE__ */ m("div", { className: ue.valueLine, children: [
|
|
1391
|
+
/* @__PURE__ */ t("span", { className: w(ue.value, !e && ue.valueInactive), children: e ? c : r }),
|
|
1392
|
+
/* @__PURE__ */ t("span", { className: w(ue.indicator, e && ue.indicatorActive), children: e ? /* @__PURE__ */ t(Hs, {}) : /* @__PURE__ */ t(Ks, {}) })
|
|
1393
|
+
] }),
|
|
1394
|
+
a && /* @__PURE__ */ t("div", { className: ue.errorText, children: a })
|
|
1395
|
+
]
|
|
1396
|
+
}
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
const Zs = "_container_1ylo8_2", Vs = "_open_1ylo8_20", Gs = "_disabled_1ylo8_24", Js = "_labelRow_1ylo8_29", Xs = "_label_1ylo8_29", Qs = "_resetBtn_1ylo8_46", Ys = "_descDot_1ylo8_62", er = "_valueLine_1ylo8_77", tr = "_value_1ylo8_77", nr = "_placeholder_1ylo8_91", or = "_arrow_1ylo8_95", sr = "_arrowOpen_1ylo8_101", rr = "_panel_1ylo8_107", ir = "_panelClosing_1ylo8_119", ar = "_list_1ylo8_144", cr = "_option_1ylo8_151", lr = "_hover_1ylo8_169", dr = "_optionLabel_1ylo8_173", ur = "_check_1ylo8_179", _r = "_active_1ylo8_185", pr = "_error_1ylo8_190", mr = "_errorText_1ylo8_194", J = {
|
|
1400
|
+
container: Zs,
|
|
1401
|
+
open: Vs,
|
|
1402
|
+
disabled: Gs,
|
|
1403
|
+
labelRow: Js,
|
|
1404
|
+
label: Xs,
|
|
1405
|
+
resetBtn: Qs,
|
|
1406
|
+
descDot: Ys,
|
|
1407
|
+
valueLine: er,
|
|
1408
|
+
value: tr,
|
|
1409
|
+
placeholder: nr,
|
|
1410
|
+
arrow: or,
|
|
1411
|
+
arrowOpen: sr,
|
|
1412
|
+
panel: rr,
|
|
1413
|
+
panelClosing: ir,
|
|
1414
|
+
list: ar,
|
|
1415
|
+
option: cr,
|
|
1416
|
+
hover: lr,
|
|
1417
|
+
optionLabel: dr,
|
|
1418
|
+
check: ur,
|
|
1419
|
+
active: _r,
|
|
1420
|
+
error: pr,
|
|
1421
|
+
errorText: mr
|
|
1422
|
+
};
|
|
1423
|
+
function hr() {
|
|
1424
|
+
return /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "6 9 12 15 18 9" }) });
|
|
1425
|
+
}
|
|
1426
|
+
function fr() {
|
|
1427
|
+
return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "20 6 9 17 4 12" }) });
|
|
1428
|
+
}
|
|
1429
|
+
function gc({
|
|
1430
|
+
label: e,
|
|
1431
|
+
description: s,
|
|
1432
|
+
value: n,
|
|
1433
|
+
options: o,
|
|
1434
|
+
onChange: i,
|
|
1435
|
+
disabled: c = !1,
|
|
1436
|
+
placeholder: r = "Select…",
|
|
1437
|
+
error: d,
|
|
1438
|
+
defaultValue: a,
|
|
1439
|
+
resetText: u = "Reset",
|
|
1440
|
+
className: f
|
|
1441
|
+
}) {
|
|
1442
|
+
const [p, v] = x(!1), [l, _] = x(!1), [y, k] = x(!1), [C, L] = x({}), [$, N] = x(-1), F = M(null), q = M(null), A = M(null);
|
|
1443
|
+
O(() => k(!0), []);
|
|
1444
|
+
const U = p || l, h = Je(
|
|
1445
|
+
() => o.findIndex((j) => String(j.value) === String(n)),
|
|
1446
|
+
[o, n]
|
|
1447
|
+
), I = h >= 0 ? o[h] : null, E = S(() => {
|
|
1448
|
+
p && _(!0);
|
|
1449
|
+
}, [p]), P = S(() => {
|
|
1450
|
+
l && (_(!1), v(!1));
|
|
1451
|
+
}, [l]), H = S(() => {
|
|
1452
|
+
const j = F.current;
|
|
1453
|
+
if (!j) return;
|
|
1454
|
+
const g = j.getBoundingClientRect();
|
|
1455
|
+
L({
|
|
1456
|
+
position: "fixed",
|
|
1457
|
+
top: g.bottom + 6,
|
|
1458
|
+
left: g.left,
|
|
1459
|
+
minWidth: g.width,
|
|
1460
|
+
zIndex: 10050
|
|
1461
|
+
});
|
|
1462
|
+
}, []);
|
|
1463
|
+
O(() => {
|
|
1464
|
+
if (p)
|
|
1465
|
+
return H(), window.addEventListener("scroll", H, !0), window.addEventListener("resize", H), () => {
|
|
1466
|
+
window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", H);
|
|
1467
|
+
};
|
|
1468
|
+
}, [p, H]), O(() => {
|
|
1469
|
+
const j = (g) => {
|
|
1470
|
+
var Z, V;
|
|
1471
|
+
const R = g.target;
|
|
1472
|
+
(Z = F.current) != null && Z.contains(R) || (V = q.current) != null && V.contains(R) || E();
|
|
1473
|
+
};
|
|
1474
|
+
return document.addEventListener("mousedown", j), () => document.removeEventListener("mousedown", j);
|
|
1475
|
+
}, [E]);
|
|
1476
|
+
const K = (j) => {
|
|
1477
|
+
const g = o[j];
|
|
1478
|
+
g && (i == null || i(g.value), E());
|
|
1479
|
+
}, b = () => {
|
|
1480
|
+
c || (p ? E() : (N(h >= 0 ? h : 0), v(!0)));
|
|
1481
|
+
}, W = a !== void 0 && String(n) !== String(a), X = (j) => {
|
|
1482
|
+
j.stopPropagation(), a !== void 0 && (i == null || i(a));
|
|
1483
|
+
}, re = (j) => {
|
|
1484
|
+
if (!p && (j.key === "ArrowDown" || j.key === "Enter" || j.key === " ")) {
|
|
1485
|
+
j.preventDefault(), b();
|
|
1486
|
+
return;
|
|
1487
|
+
}
|
|
1488
|
+
if (p) {
|
|
1489
|
+
if (j.key === "Escape") {
|
|
1490
|
+
j.preventDefault(), E();
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
if (j.key === "ArrowDown") {
|
|
1494
|
+
j.preventDefault(), N((g) => Math.min(o.length - 1, g < 0 ? 0 : g + 1));
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
if (j.key === "ArrowUp") {
|
|
1498
|
+
j.preventDefault(), N((g) => Math.max(0, g < 0 ? 0 : g - 1));
|
|
1499
|
+
return;
|
|
1500
|
+
}
|
|
1501
|
+
j.key === "Enter" && (j.preventDefault(), K($ >= 0 ? $ : h >= 0 ? h : 0));
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
return /* @__PURE__ */ m(
|
|
1505
|
+
"div",
|
|
1506
|
+
{
|
|
1507
|
+
ref: F,
|
|
1508
|
+
className: w(J.container, p && J.open, c && J.disabled, d && J.error, f),
|
|
1509
|
+
role: "button",
|
|
1510
|
+
"aria-expanded": p,
|
|
1511
|
+
tabIndex: 0,
|
|
1512
|
+
onKeyDown: re,
|
|
1513
|
+
onClick: (j) => {
|
|
1514
|
+
var g;
|
|
1515
|
+
(g = A.current) != null && g.contains(j.target) || b();
|
|
1516
|
+
},
|
|
1517
|
+
children: [
|
|
1518
|
+
(e || W) && /* @__PURE__ */ m("div", { className: J.labelRow, children: [
|
|
1519
|
+
e && /* @__PURE__ */ m("div", { className: J.label, children: [
|
|
1520
|
+
e,
|
|
1521
|
+
s && /* @__PURE__ */ t(Le, { content: s, position: "right", children: /* @__PURE__ */ t("span", { className: J.descDot, children: "?" }) })
|
|
1522
|
+
] }),
|
|
1523
|
+
W && /* @__PURE__ */ t("button", { type: "button", className: J.resetBtn, onClick: X, children: u })
|
|
1524
|
+
] }),
|
|
1525
|
+
/* @__PURE__ */ m("div", { className: J.valueLine, children: [
|
|
1526
|
+
/* @__PURE__ */ t("span", { className: w(J.value, !I && J.placeholder), children: I ? I.label : r }),
|
|
1527
|
+
/* @__PURE__ */ t("span", { className: w(J.arrow, p && J.arrowOpen), children: /* @__PURE__ */ t(hr, {}) })
|
|
1528
|
+
] }),
|
|
1529
|
+
y && U && Re(
|
|
1530
|
+
/* @__PURE__ */ t(
|
|
1531
|
+
"div",
|
|
1532
|
+
{
|
|
1533
|
+
ref: q,
|
|
1534
|
+
className: w(J.panel, l && J.panelClosing),
|
|
1535
|
+
style: C,
|
|
1536
|
+
onClick: (j) => j.stopPropagation(),
|
|
1537
|
+
onAnimationEnd: P,
|
|
1538
|
+
children: /* @__PURE__ */ t("div", { ref: A, className: J.list, role: "listbox", children: o.map((j, g) => {
|
|
1539
|
+
const R = String(j.value) === String(n);
|
|
1540
|
+
return /* @__PURE__ */ m(
|
|
1541
|
+
"button",
|
|
1542
|
+
{
|
|
1543
|
+
type: "button",
|
|
1544
|
+
className: w(J.option, R && J.active, $ === g && J.hover),
|
|
1545
|
+
role: "option",
|
|
1546
|
+
"aria-selected": R,
|
|
1547
|
+
onMouseEnter: () => N(g),
|
|
1548
|
+
onClick: () => K(g),
|
|
1549
|
+
children: [
|
|
1550
|
+
/* @__PURE__ */ t("span", { className: J.optionLabel, children: j.label }),
|
|
1551
|
+
R && /* @__PURE__ */ t("span", { className: J.check, children: /* @__PURE__ */ t(fr, {}) })
|
|
1552
|
+
]
|
|
1553
|
+
},
|
|
1554
|
+
String(j.value)
|
|
1555
|
+
);
|
|
1556
|
+
}) })
|
|
1557
|
+
}
|
|
1558
|
+
),
|
|
1559
|
+
document.body
|
|
1560
|
+
),
|
|
1561
|
+
d && /* @__PURE__ */ t("div", { className: J.errorText, children: d })
|
|
1562
|
+
]
|
|
1563
|
+
}
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1566
|
+
const vr = "_wrapper_15zjr_2", gr = "_labelRow_15zjr_9", br = "_label_15zjr_9", wr = "_resetBtn_15zjr_27", yr = "_descDot_15zjr_43", kr = "_field_15zjr_59", xr = "_hasError_15zjr_75", Nr = "_disabled_15zjr_82", Cr = "_editorWrap_15zjr_87", Lr = "_placeholder_15zjr_94", $r = "_editor_15zjr_87", Rr = "_cmdBtn_15zjr_127", Br = "_cmdBtnActive_15zjr_143", Ir = "_cmdPanel_15zjr_149", Er = "_cmdPanelClosing_15zjr_161", jr = "_cmdItem_15zjr_187", Dr = "_cmdKey_15zjr_208", Sr = "_cmdSep_15zjr_213", Tr = "_cmdLabel_15zjr_217", Mr = "_hint_15zjr_222", zr = "_error_15zjr_227", Y = {
|
|
1567
|
+
wrapper: vr,
|
|
1568
|
+
labelRow: gr,
|
|
1569
|
+
label: br,
|
|
1570
|
+
resetBtn: wr,
|
|
1571
|
+
descDot: yr,
|
|
1572
|
+
field: kr,
|
|
1573
|
+
hasError: xr,
|
|
1574
|
+
disabled: Nr,
|
|
1575
|
+
editorWrap: Cr,
|
|
1576
|
+
placeholder: Lr,
|
|
1577
|
+
editor: $r,
|
|
1578
|
+
cmdBtn: Rr,
|
|
1579
|
+
cmdBtnActive: Br,
|
|
1580
|
+
cmdPanel: Ir,
|
|
1581
|
+
cmdPanelClosing: Er,
|
|
1582
|
+
cmdItem: jr,
|
|
1583
|
+
cmdKey: Dr,
|
|
1584
|
+
cmdSep: Sr,
|
|
1585
|
+
cmdLabel: Tr,
|
|
1586
|
+
hint: Mr,
|
|
1587
|
+
error: zr
|
|
1588
|
+
};
|
|
1589
|
+
function Pr(e) {
|
|
1590
|
+
const s = [], n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, {
|
|
1591
|
+
acceptNode: (i) => i.textContent && i.textContent.length >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
|
|
1592
|
+
});
|
|
1593
|
+
let o = n.nextNode();
|
|
1594
|
+
for (; o; )
|
|
1595
|
+
s.push(o), o = n.nextNode();
|
|
1596
|
+
return s;
|
|
1597
|
+
}
|
|
1598
|
+
function Ar(e, s, n) {
|
|
1599
|
+
var l;
|
|
1600
|
+
const o = Pr(e), i = o.reduce((_, y) => {
|
|
1601
|
+
var k;
|
|
1602
|
+
return _ + (((k = y.textContent) == null ? void 0 : k.length) ?? 0);
|
|
1603
|
+
}, 0), c = Math.max(0, Math.min(s, i)), r = Math.max(0, Math.min(n, i));
|
|
1604
|
+
let d = e, a = 0, u = e, f = 0, p = 0;
|
|
1605
|
+
for (const _ of o) {
|
|
1606
|
+
const y = ((l = _.textContent) == null ? void 0 : l.length) ?? 0, k = p + y;
|
|
1607
|
+
c >= p && c <= k && (d = _, a = c - p), r >= p && r <= k && (u = _, f = r - p), p = k;
|
|
1608
|
+
}
|
|
1609
|
+
const v = document.createRange();
|
|
1610
|
+
try {
|
|
1611
|
+
o.length === 0 ? (v.selectNodeContents(e), v.collapse(!1)) : (v.setStart(d, a), v.setEnd(u, f));
|
|
1612
|
+
const _ = window.getSelection();
|
|
1613
|
+
_ == null || _.removeAllRanges(), _ == null || _.addRange(v);
|
|
1614
|
+
} catch {
|
|
1615
|
+
v.selectNodeContents(e), v.collapse(!1);
|
|
1616
|
+
const _ = window.getSelection();
|
|
1617
|
+
_ == null || _.removeAllRanges(), _ == null || _.addRange(v);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
function Wr() {
|
|
1621
|
+
return /* @__PURE__ */ m("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1622
|
+
/* @__PURE__ */ t("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", ry: "2" }),
|
|
1623
|
+
/* @__PURE__ */ t("line", { x1: "6", y1: "8", x2: "6", y2: "8" }),
|
|
1624
|
+
/* @__PURE__ */ t("line", { x1: "10", y1: "8", x2: "10", y2: "8" }),
|
|
1625
|
+
/* @__PURE__ */ t("line", { x1: "14", y1: "8", x2: "14", y2: "8" }),
|
|
1626
|
+
/* @__PURE__ */ t("line", { x1: "18", y1: "8", x2: "18", y2: "8" }),
|
|
1627
|
+
/* @__PURE__ */ t("line", { x1: "6", y1: "12", x2: "6", y2: "12" }),
|
|
1628
|
+
/* @__PURE__ */ t("line", { x1: "10", y1: "12", x2: "10", y2: "12" }),
|
|
1629
|
+
/* @__PURE__ */ t("line", { x1: "14", y1: "12", x2: "14", y2: "12" }),
|
|
1630
|
+
/* @__PURE__ */ t("line", { x1: "18", y1: "12", x2: "18", y2: "12" }),
|
|
1631
|
+
/* @__PURE__ */ t("line", { x1: "8", y1: "16", x2: "16", y2: "16" })
|
|
1632
|
+
] });
|
|
1633
|
+
}
|
|
1634
|
+
function bc({
|
|
1635
|
+
name: e,
|
|
1636
|
+
label: s,
|
|
1637
|
+
description: n,
|
|
1638
|
+
placeholder: o,
|
|
1639
|
+
value: i,
|
|
1640
|
+
onChange: c,
|
|
1641
|
+
onBlur: r,
|
|
1642
|
+
showCommandsButton: d = !1,
|
|
1643
|
+
commands: a = [],
|
|
1644
|
+
commandsButtonContent: u,
|
|
1645
|
+
hint: f,
|
|
1646
|
+
error: p,
|
|
1647
|
+
touched: v,
|
|
1648
|
+
defaultValue: l,
|
|
1649
|
+
resetText: _ = "Reset",
|
|
1650
|
+
disabled: y,
|
|
1651
|
+
className: k,
|
|
1652
|
+
ariaLabel: C
|
|
1653
|
+
}) {
|
|
1654
|
+
const [L, $] = x(!1), [N, F] = x(!1), [q, A] = x(!1), U = M(null), h = M(null), I = M(null), E = M(null), P = M(null), H = M(i), K = M(null), [b, W] = x(!1), [X, re] = x({});
|
|
1655
|
+
O(() => W(!0), []);
|
|
1656
|
+
const j = N || q, g = v && p, R = l !== void 0 && i !== l, Z = S((B) => {
|
|
1657
|
+
P.current && (P.current.style.display = B ? "none" : "");
|
|
1658
|
+
}, []), V = S(() => {
|
|
1659
|
+
N && A(!0);
|
|
1660
|
+
}, [N]), _e = S(() => {
|
|
1661
|
+
q && (A(!1), F(!1));
|
|
1662
|
+
}, [q]), pe = S(() => {
|
|
1663
|
+
const B = U.current, z = window.getSelection();
|
|
1664
|
+
if (!B || !z || z.rangeCount === 0) return;
|
|
1665
|
+
const G = z.getRangeAt(0), Q = G.cloneRange();
|
|
1666
|
+
Q.selectNodeContents(B), Q.setEnd(G.startContainer, G.startOffset);
|
|
1667
|
+
const he = Q.toString().length;
|
|
1668
|
+
K.current = { start: he, end: he + G.toString().length };
|
|
1669
|
+
}, []), me = S(() => {
|
|
1670
|
+
const B = U.current;
|
|
1671
|
+
if (!B) return;
|
|
1672
|
+
const z = document.createRange(), G = window.getSelection();
|
|
1673
|
+
z.selectNodeContents(B), z.collapse(!1), G == null || G.removeAllRanges(), G == null || G.addRange(z);
|
|
1674
|
+
}, []);
|
|
1675
|
+
He(() => {
|
|
1676
|
+
const B = U.current;
|
|
1677
|
+
if (!B) return;
|
|
1678
|
+
(B.textContent || "").replace(/\u200B/g, "") !== i && (i ? B.textContent = i : B.innerHTML = "<br>"), H.current = i, Z(i), document.activeElement === B && (K.current ? Ar(B, K.current.start, K.current.end) : me());
|
|
1679
|
+
}, [i, me, Z]);
|
|
1680
|
+
const T = () => {
|
|
1681
|
+
var G;
|
|
1682
|
+
const B = U.current;
|
|
1683
|
+
if (!B) return;
|
|
1684
|
+
const z = ((G = B.textContent) == null ? void 0 : G.replace(/\u200B/g, "")) || "";
|
|
1685
|
+
Z(z), z === "" && B.innerHTML !== "<br>" && (B.innerHTML = "<br>"), z !== H.current && (pe(), H.current = z, c == null || c(z));
|
|
1686
|
+
}, te = (B) => {
|
|
1687
|
+
U.current && (U.current.focus(), U.current.contains(B.target) || me());
|
|
1688
|
+
}, we = (B) => {
|
|
1689
|
+
const z = U.current;
|
|
1690
|
+
if (!z) return;
|
|
1691
|
+
(z.textContent || "").replace(/\u200B/g, "") || (z.textContent = ""), z.focus();
|
|
1692
|
+
const Q = window.getSelection();
|
|
1693
|
+
if (!Q || Q.rangeCount === 0) {
|
|
1694
|
+
const Pe = document.createRange();
|
|
1695
|
+
Pe.selectNodeContents(z), Pe.collapse(!1), Q == null || Q.removeAllRanges(), Q == null || Q.addRange(Pe);
|
|
1696
|
+
}
|
|
1697
|
+
const he = Q.getRangeAt(0);
|
|
1698
|
+
he.deleteContents();
|
|
1699
|
+
const ze = document.createTextNode(B);
|
|
1700
|
+
he.insertNode(ze), he.setStartAfter(ze), he.setEndAfter(ze), Q.removeAllRanges(), Q.addRange(he), T(), pe(), V();
|
|
1701
|
+
}, ce = S(() => {
|
|
1702
|
+
const B = I.current;
|
|
1703
|
+
if (!B) return;
|
|
1704
|
+
const z = B.getBoundingClientRect();
|
|
1705
|
+
re({
|
|
1706
|
+
position: "fixed",
|
|
1707
|
+
top: z.bottom + 6,
|
|
1708
|
+
left: z.left,
|
|
1709
|
+
width: z.width,
|
|
1710
|
+
zIndex: 10050
|
|
1711
|
+
});
|
|
1712
|
+
}, []);
|
|
1713
|
+
return O(() => {
|
|
1714
|
+
if (N)
|
|
1715
|
+
return ce(), window.addEventListener("scroll", ce, !0), window.addEventListener("resize", ce), () => {
|
|
1716
|
+
window.removeEventListener("scroll", ce, !0), window.removeEventListener("resize", ce);
|
|
1717
|
+
};
|
|
1718
|
+
}, [N, ce]), O(() => {
|
|
1719
|
+
const B = (z) => {
|
|
1720
|
+
var Q, he;
|
|
1721
|
+
const G = z.target;
|
|
1722
|
+
(Q = h.current) != null && Q.contains(G) || (he = E.current) != null && he.contains(G) || V();
|
|
1723
|
+
};
|
|
1724
|
+
return document.addEventListener("mousedown", B), () => document.removeEventListener("mousedown", B);
|
|
1725
|
+
}, []), /* @__PURE__ */ m(
|
|
1726
|
+
"div",
|
|
1727
|
+
{
|
|
1728
|
+
ref: h,
|
|
1729
|
+
className: w(Y.wrapper, g && Y.hasError, y && Y.disabled, k),
|
|
1730
|
+
children: [
|
|
1731
|
+
(s || R) && /* @__PURE__ */ m("div", { className: Y.labelRow, children: [
|
|
1732
|
+
s && /* @__PURE__ */ m("div", { className: Y.label, children: [
|
|
1733
|
+
s,
|
|
1734
|
+
n && /* @__PURE__ */ t(Le, { content: n, position: "right", children: /* @__PURE__ */ t("span", { className: Y.descDot, children: "?" }) })
|
|
1735
|
+
] }),
|
|
1736
|
+
R && /* @__PURE__ */ t("button", { type: "button", className: Y.resetBtn, onClick: () => c == null ? void 0 : c(l), children: _ })
|
|
1737
|
+
] }),
|
|
1738
|
+
/* @__PURE__ */ m("div", { ref: I, className: Y.field, onClick: te, style: { position: "relative" }, children: [
|
|
1739
|
+
/* @__PURE__ */ m("div", { className: Y.editorWrap, children: [
|
|
1740
|
+
o && /* @__PURE__ */ t(
|
|
1741
|
+
"span",
|
|
1742
|
+
{
|
|
1743
|
+
ref: P,
|
|
1744
|
+
className: Y.placeholder,
|
|
1745
|
+
style: i ? { display: "none" } : void 0,
|
|
1746
|
+
children: o
|
|
1747
|
+
}
|
|
1748
|
+
),
|
|
1749
|
+
/* @__PURE__ */ t(
|
|
1750
|
+
"div",
|
|
1751
|
+
{
|
|
1752
|
+
ref: U,
|
|
1753
|
+
id: e,
|
|
1754
|
+
role: "textbox",
|
|
1755
|
+
contentEditable: !y,
|
|
1756
|
+
suppressContentEditableWarning: !0,
|
|
1757
|
+
className: Y.editor,
|
|
1758
|
+
spellCheck: "true",
|
|
1759
|
+
"aria-label": C,
|
|
1760
|
+
"aria-multiline": "true",
|
|
1761
|
+
"aria-invalid": !!g,
|
|
1762
|
+
"aria-errormessage": g ? `${e}-error` : void 0,
|
|
1763
|
+
onInput: T,
|
|
1764
|
+
onFocus: () => {
|
|
1765
|
+
$(!0), pe();
|
|
1766
|
+
},
|
|
1767
|
+
onKeyUp: pe,
|
|
1768
|
+
onMouseUp: pe,
|
|
1769
|
+
onBlur: (B) => {
|
|
1770
|
+
$(!1), r == null || r(B);
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
)
|
|
1774
|
+
] }),
|
|
1775
|
+
d && a.length > 0 && /* @__PURE__ */ t(
|
|
1776
|
+
"button",
|
|
1777
|
+
{
|
|
1778
|
+
type: "button",
|
|
1779
|
+
className: w(Y.cmdBtn, N && Y.cmdBtnActive),
|
|
1780
|
+
onClick: (B) => {
|
|
1781
|
+
B.stopPropagation(), N ? V() : F(!0);
|
|
1782
|
+
},
|
|
1783
|
+
children: u ?? /* @__PURE__ */ t(Wr, {})
|
|
1784
|
+
}
|
|
1785
|
+
),
|
|
1786
|
+
b && j && a.length > 0 && Re(
|
|
1787
|
+
/* @__PURE__ */ t(
|
|
1788
|
+
"div",
|
|
1789
|
+
{
|
|
1790
|
+
ref: E,
|
|
1791
|
+
className: w(Y.cmdPanel, q && Y.cmdPanelClosing),
|
|
1792
|
+
style: X,
|
|
1793
|
+
onAnimationEnd: _e,
|
|
1794
|
+
children: a.map((B) => /* @__PURE__ */ m(
|
|
1795
|
+
"button",
|
|
1796
|
+
{
|
|
1797
|
+
type: "button",
|
|
1798
|
+
className: Y.cmdItem,
|
|
1799
|
+
onClick: () => we(B.key),
|
|
1800
|
+
children: [
|
|
1801
|
+
/* @__PURE__ */ t("span", { className: Y.cmdKey, children: B.key }),
|
|
1802
|
+
/* @__PURE__ */ t("span", { className: Y.cmdSep, children: "—" }),
|
|
1803
|
+
/* @__PURE__ */ t("span", { className: Y.cmdLabel, children: B.label })
|
|
1804
|
+
]
|
|
1805
|
+
},
|
|
1806
|
+
B.key
|
|
1807
|
+
))
|
|
1808
|
+
}
|
|
1809
|
+
),
|
|
1810
|
+
document.body
|
|
1811
|
+
)
|
|
1812
|
+
] }),
|
|
1813
|
+
g && /* @__PURE__ */ t("div", { id: `${e}-error`, className: Y.error, children: p }),
|
|
1814
|
+
!g && f && /* @__PURE__ */ t("div", { className: Y.hint, children: f })
|
|
1815
|
+
]
|
|
1816
|
+
}
|
|
1817
|
+
);
|
|
1818
|
+
}
|
|
1819
|
+
const Fr = "_wrapper_1wzk6_2", qr = "_trigger_1wzk6_7", Ur = "_menu_1wzk6_12", Or = "_menuRight_1wzk6_27", Hr = "_menuDrill_1wzk6_34", Kr = "_menuClosing_1wzk6_38", Zr = "_item_1wzk6_64", Vr = "_itemActive_1wzk6_83", Gr = "_itemReverse_1wzk6_98", Jr = "_itemDisabled_1wzk6_104", Xr = "_itemIcon_1wzk6_110", Qr = "_itemLabel_1wzk6_124", Yr = "_itemChevron_1wzk6_132", ei = "_itemChevronLeft_1wzk6_144", ti = "_itemChevronOpen_1wzk6_148", ni = "_toggle_1wzk6_158", oi = "_toggleDot_1wzk6_170", si = "_toggleChecked_1wzk6_178", ri = "_radio_1wzk6_187", ii = "_radioDot_1wzk6_199", ai = "_radioChecked_1wzk6_207", ci = "_divider_1wzk6_216", li = "_submenu_1wzk6_225", di = "_submenuClosing_1wzk6_250", ui = "_submenuLeft_1wzk6_256", _i = "_submenuClosingLeft_1wzk6_268", pi = "_drillChevron_1wzk6_316", mi = "_drillContent_1wzk6_336", hi = "_drillSlideIn_1wzk6_340", fi = "_drillSlideOut_1wzk6_344", vi = "_drillBack_1wzk6_369", gi = "_drillBackIcon_1wzk6_389", bi = "_drillBackLabel_1wzk6_399", D = {
|
|
1820
|
+
wrapper: Fr,
|
|
1821
|
+
trigger: qr,
|
|
1822
|
+
menu: Ur,
|
|
1823
|
+
menuRight: Or,
|
|
1824
|
+
menuDrill: Hr,
|
|
1825
|
+
menuClosing: Kr,
|
|
1826
|
+
item: Zr,
|
|
1827
|
+
itemActive: Vr,
|
|
1828
|
+
itemReverse: Gr,
|
|
1829
|
+
itemDisabled: Jr,
|
|
1830
|
+
itemIcon: Xr,
|
|
1831
|
+
itemLabel: Qr,
|
|
1832
|
+
itemChevron: Yr,
|
|
1833
|
+
itemChevronLeft: ei,
|
|
1834
|
+
itemChevronOpen: ti,
|
|
1835
|
+
toggle: ni,
|
|
1836
|
+
toggleDot: oi,
|
|
1837
|
+
toggleChecked: si,
|
|
1838
|
+
radio: ri,
|
|
1839
|
+
radioDot: ii,
|
|
1840
|
+
radioChecked: ai,
|
|
1841
|
+
divider: ci,
|
|
1842
|
+
submenu: li,
|
|
1843
|
+
submenuClosing: di,
|
|
1844
|
+
submenuLeft: ui,
|
|
1845
|
+
submenuClosingLeft: _i,
|
|
1846
|
+
drillChevron: pi,
|
|
1847
|
+
drillContent: mi,
|
|
1848
|
+
drillSlideIn: hi,
|
|
1849
|
+
drillSlideOut: fi,
|
|
1850
|
+
drillBack: vi,
|
|
1851
|
+
drillBackIcon: gi,
|
|
1852
|
+
drillBackLabel: bi
|
|
1853
|
+
};
|
|
1854
|
+
function wi() {
|
|
1855
|
+
return /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "9 18 15 12 9 6" }) });
|
|
1856
|
+
}
|
|
1857
|
+
function yi() {
|
|
1858
|
+
return /* @__PURE__ */ t("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "15 18 9 12 15 6" }) });
|
|
1859
|
+
}
|
|
1860
|
+
function ki() {
|
|
1861
|
+
return /* @__PURE__ */ m("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1862
|
+
/* @__PURE__ */ t("path", { d: "M5 12h14" }),
|
|
1863
|
+
/* @__PURE__ */ t("path", { d: "M12 5l7 7-7 7" })
|
|
1864
|
+
] });
|
|
1865
|
+
}
|
|
1866
|
+
function xi() {
|
|
1867
|
+
return /* @__PURE__ */ m("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1868
|
+
/* @__PURE__ */ t("path", { d: "M19 12H5" }),
|
|
1869
|
+
/* @__PURE__ */ t("path", { d: "M12 19l-7-7 7-7" })
|
|
1870
|
+
] });
|
|
1871
|
+
}
|
|
1872
|
+
function ot({
|
|
1873
|
+
item: e,
|
|
1874
|
+
onClose: s,
|
|
1875
|
+
openDirection: n,
|
|
1876
|
+
closeOnSelect: o
|
|
1877
|
+
}) {
|
|
1878
|
+
const [i, c] = x(!1), [r, d] = x(!1), a = M(null), u = M(null), f = M(null), p = e.children && e.children.length > 0, v = i || r, l = n === "left", _ = () => {
|
|
1879
|
+
a.current && clearTimeout(a.current), d(!1), c(!0);
|
|
1880
|
+
}, y = () => {
|
|
1881
|
+
a.current && clearTimeout(a.current), i && d(!0);
|
|
1882
|
+
}, k = () => {
|
|
1883
|
+
r && (d(!1), c(!1));
|
|
1884
|
+
}, C = () => {
|
|
1885
|
+
p && _();
|
|
1886
|
+
}, L = (A) => {
|
|
1887
|
+
if (!p) return;
|
|
1888
|
+
const U = A.relatedTarget;
|
|
1889
|
+
U && f.current && f.current.contains(U) || (a.current = setTimeout(y, 80));
|
|
1890
|
+
}, $ = (A) => {
|
|
1891
|
+
const U = A.relatedTarget;
|
|
1892
|
+
if (U && u.current && u.current.contains(U)) {
|
|
1893
|
+
a.current && clearTimeout(a.current);
|
|
1894
|
+
return;
|
|
1895
|
+
}
|
|
1896
|
+
a.current = setTimeout(y, 80);
|
|
1897
|
+
}, N = () => {
|
|
1898
|
+
if (!e.disabled) {
|
|
1899
|
+
if ((e.toggle || e.radio) && e.onClick) {
|
|
1900
|
+
e.onClick();
|
|
1901
|
+
return;
|
|
1902
|
+
}
|
|
1903
|
+
!p && e.onClick && (e.onClick(), o && s());
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
O(() => () => {
|
|
1907
|
+
a.current && clearTimeout(a.current);
|
|
1908
|
+
}, []);
|
|
1909
|
+
const F = (e.toggle || e.radio) && /* @__PURE__ */ t("span", { className: w(
|
|
1910
|
+
e.radio ? D.radio : D.toggle,
|
|
1911
|
+
e.checked && (e.radio ? D.radioChecked : D.toggleChecked)
|
|
1912
|
+
), children: /* @__PURE__ */ t("span", { className: e.radio ? D.radioDot : D.toggleDot }) }), q = p && /* @__PURE__ */ t("span", { className: w(
|
|
1913
|
+
D.itemChevron,
|
|
1914
|
+
l && D.itemChevronLeft,
|
|
1915
|
+
i && !r && D.itemChevronOpen
|
|
1916
|
+
), children: l ? /* @__PURE__ */ t(yi, {}) : /* @__PURE__ */ t(wi, {}) });
|
|
1917
|
+
return /* @__PURE__ */ m(Ue, { children: [
|
|
1918
|
+
/* @__PURE__ */ m(
|
|
1919
|
+
"div",
|
|
1920
|
+
{
|
|
1921
|
+
ref: u,
|
|
1922
|
+
className: w(
|
|
1923
|
+
D.item,
|
|
1924
|
+
e.disabled && D.itemDisabled,
|
|
1925
|
+
i && !r && D.itemActive,
|
|
1926
|
+
l && D.itemReverse
|
|
1927
|
+
),
|
|
1928
|
+
onClick: N,
|
|
1929
|
+
onMouseEnter: C,
|
|
1930
|
+
onMouseLeave: L,
|
|
1931
|
+
children: [
|
|
1932
|
+
l && q,
|
|
1933
|
+
e.icon && /* @__PURE__ */ t("span", { className: D.itemIcon, children: e.icon }),
|
|
1934
|
+
/* @__PURE__ */ t("span", { className: D.itemLabel, children: e.label }),
|
|
1935
|
+
F,
|
|
1936
|
+
!l && q,
|
|
1937
|
+
v && p && /* @__PURE__ */ t(
|
|
1938
|
+
"div",
|
|
1939
|
+
{
|
|
1940
|
+
ref: f,
|
|
1941
|
+
className: w(
|
|
1942
|
+
D.submenu,
|
|
1943
|
+
l && D.submenuLeft,
|
|
1944
|
+
r && (l ? D.submenuClosingLeft : D.submenuClosing)
|
|
1945
|
+
),
|
|
1946
|
+
onAnimationEnd: k,
|
|
1947
|
+
onMouseEnter: _,
|
|
1948
|
+
onMouseLeave: $,
|
|
1949
|
+
children: e.children.map((A) => /* @__PURE__ */ t(ot, { item: A, onClose: s, openDirection: n, closeOnSelect: o }, A.key))
|
|
1950
|
+
}
|
|
1951
|
+
)
|
|
1952
|
+
]
|
|
1953
|
+
}
|
|
1954
|
+
),
|
|
1955
|
+
e.divider && /* @__PURE__ */ t("div", { className: D.divider })
|
|
1956
|
+
] });
|
|
1957
|
+
}
|
|
1958
|
+
function Ni({
|
|
1959
|
+
items: e,
|
|
1960
|
+
onClose: s,
|
|
1961
|
+
closeOnSelect: n
|
|
1962
|
+
}) {
|
|
1963
|
+
const [o, i] = x([]), [c, r] = x(null), d = o.length > 0 ? o[o.length - 1].items : e, a = o.length > 0 ? o[o.length - 1].title : null, u = (l) => {
|
|
1964
|
+
!l.children || l.children.length === 0 || (r("in"), i((_) => [..._, { title: String(l.label), items: l.children }]));
|
|
1965
|
+
}, f = () => {
|
|
1966
|
+
o.length !== 0 && (r("out"), i((l) => l.slice(0, -1)));
|
|
1967
|
+
}, p = (l) => {
|
|
1968
|
+
if (!l.disabled) {
|
|
1969
|
+
if ((l.toggle || l.radio) && l.onClick) {
|
|
1970
|
+
l.onClick();
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
if (l.children && l.children.length > 0) {
|
|
1974
|
+
u(l);
|
|
1975
|
+
return;
|
|
1976
|
+
}
|
|
1977
|
+
l.onClick && (l.onClick(), n && s());
|
|
1978
|
+
}
|
|
1979
|
+
}, v = () => {
|
|
1980
|
+
r(null);
|
|
1981
|
+
};
|
|
1982
|
+
return /* @__PURE__ */ m(
|
|
1983
|
+
"div",
|
|
1984
|
+
{
|
|
1985
|
+
className: w(
|
|
1986
|
+
D.drillContent,
|
|
1987
|
+
c === "in" && D.drillSlideIn,
|
|
1988
|
+
c === "out" && D.drillSlideOut
|
|
1989
|
+
),
|
|
1990
|
+
onAnimationEnd: v,
|
|
1991
|
+
children: [
|
|
1992
|
+
a && /* @__PURE__ */ m("div", { className: D.drillBack, onClick: f, children: [
|
|
1993
|
+
/* @__PURE__ */ t("span", { className: D.drillBackIcon, children: /* @__PURE__ */ t(xi, {}) }),
|
|
1994
|
+
/* @__PURE__ */ t("span", { className: D.drillBackLabel, children: a })
|
|
1995
|
+
] }),
|
|
1996
|
+
d.map((l) => /* @__PURE__ */ m("div", { children: [
|
|
1997
|
+
/* @__PURE__ */ m(
|
|
1998
|
+
"div",
|
|
1999
|
+
{
|
|
2000
|
+
className: w(
|
|
2001
|
+
D.item,
|
|
2002
|
+
l.disabled && D.itemDisabled
|
|
2003
|
+
),
|
|
2004
|
+
onClick: () => p(l),
|
|
2005
|
+
children: [
|
|
2006
|
+
l.icon && /* @__PURE__ */ t("span", { className: D.itemIcon, children: l.icon }),
|
|
2007
|
+
/* @__PURE__ */ t("span", { className: D.itemLabel, children: l.label }),
|
|
2008
|
+
(l.toggle || l.radio) && /* @__PURE__ */ t("span", { className: w(
|
|
2009
|
+
l.radio ? D.radio : D.toggle,
|
|
2010
|
+
l.checked && (l.radio ? D.radioChecked : D.toggleChecked)
|
|
2011
|
+
), children: /* @__PURE__ */ t("span", { className: l.radio ? D.radioDot : D.toggleDot }) }),
|
|
2012
|
+
l.children && l.children.length > 0 && /* @__PURE__ */ t("span", { className: D.drillChevron, children: /* @__PURE__ */ t(ki, {}) })
|
|
2013
|
+
]
|
|
2014
|
+
}
|
|
2015
|
+
),
|
|
2016
|
+
l.divider && /* @__PURE__ */ t("div", { className: D.divider })
|
|
2017
|
+
] }, l.key))
|
|
2018
|
+
]
|
|
2019
|
+
}
|
|
2020
|
+
);
|
|
2021
|
+
}
|
|
2022
|
+
function wc({
|
|
2023
|
+
items: e,
|
|
2024
|
+
children: s,
|
|
2025
|
+
className: n,
|
|
2026
|
+
menuClassName: o,
|
|
2027
|
+
align: i = "left",
|
|
2028
|
+
mode: c = "hover",
|
|
2029
|
+
closeOnSelect: r = !0
|
|
2030
|
+
}) {
|
|
2031
|
+
const [d, a] = x(!1), [u, f] = x(!1), p = M(null), v = d || u, l = S(() => {
|
|
2032
|
+
d && f(!0);
|
|
2033
|
+
}, [d]), _ = S(() => {
|
|
2034
|
+
u && (f(!1), a(!1));
|
|
2035
|
+
}, [u]);
|
|
2036
|
+
O(() => {
|
|
2037
|
+
const C = (L) => {
|
|
2038
|
+
p.current && !p.current.contains(L.target) && l();
|
|
2039
|
+
};
|
|
2040
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
2041
|
+
}, [l]), O(() => {
|
|
2042
|
+
if (!d) return;
|
|
2043
|
+
const C = (L) => {
|
|
2044
|
+
L.key === "Escape" && l();
|
|
2045
|
+
};
|
|
2046
|
+
return document.addEventListener("keydown", C), () => document.removeEventListener("keydown", C);
|
|
2047
|
+
}, [d, l]);
|
|
2048
|
+
const y = () => {
|
|
2049
|
+
d ? l() : a(!0);
|
|
2050
|
+
}, k = i === "right" ? "left" : "right";
|
|
2051
|
+
return /* @__PURE__ */ m("div", { ref: p, className: w(D.wrapper, n), children: [
|
|
2052
|
+
/* @__PURE__ */ t("div", { className: D.trigger, onClick: y, children: s }),
|
|
2053
|
+
v && /* @__PURE__ */ t(
|
|
2054
|
+
"div",
|
|
2055
|
+
{
|
|
2056
|
+
className: w(
|
|
2057
|
+
D.menu,
|
|
2058
|
+
u && D.menuClosing,
|
|
2059
|
+
i === "right" && D.menuRight,
|
|
2060
|
+
c === "drill" && D.menuDrill,
|
|
2061
|
+
o
|
|
2062
|
+
),
|
|
2063
|
+
onAnimationEnd: _,
|
|
2064
|
+
children: c === "drill" ? /* @__PURE__ */ t(Ni, { items: e, onClose: l, closeOnSelect: r }) : e.map((C) => /* @__PURE__ */ t(ot, { item: C, onClose: l, openDirection: k, closeOnSelect: r }, C.key))
|
|
2065
|
+
}
|
|
2066
|
+
)
|
|
2067
|
+
] });
|
|
2068
|
+
}
|
|
2069
|
+
const Ci = "_wrapper_16sej_2", Li = "_disabled_16sej_14", $i = "_labelRow_16sej_19", Ri = "_label_16sej_19", Bi = "_resetBtn_16sej_36", Ii = "_descDot_16sej_52", Ei = "_trigger_16sej_68", ji = "_swatch_16sej_78", Di = "_hexLabel_16sej_86", Si = "_panel_16sej_94", Ti = "_sv_16sej_118", Mi = "_svKnob_16sej_129", zi = "_hueSlider_16sej_142", Pi = "_alphaRow_16sej_176", Ai = "_alphaChecker_16sej_180", Wi = "_alphaSlider_16sej_189", Fi = "_inputs_16sej_225", qi = "_hexInput_16sej_230", Ui = "_opacityBox_16sej_247", Oi = "_opacityInput_16sej_253", Hi = "_opacitySuffix_16sej_270", ee = {
|
|
2070
|
+
wrapper: Ci,
|
|
2071
|
+
disabled: Li,
|
|
2072
|
+
labelRow: $i,
|
|
2073
|
+
label: Ri,
|
|
2074
|
+
resetBtn: Bi,
|
|
2075
|
+
descDot: Ii,
|
|
2076
|
+
trigger: Ei,
|
|
2077
|
+
swatch: ji,
|
|
2078
|
+
hexLabel: Di,
|
|
2079
|
+
panel: Si,
|
|
2080
|
+
sv: Ti,
|
|
2081
|
+
svKnob: Mi,
|
|
2082
|
+
hueSlider: zi,
|
|
2083
|
+
alphaRow: Pi,
|
|
2084
|
+
alphaChecker: Ai,
|
|
2085
|
+
alphaSlider: Wi,
|
|
2086
|
+
inputs: Fi,
|
|
2087
|
+
hexInput: qi,
|
|
2088
|
+
opacityBox: Ui,
|
|
2089
|
+
opacityInput: Oi,
|
|
2090
|
+
opacitySuffix: Hi
|
|
2091
|
+
}, Se = (e, s, n) => Math.min(n, Math.max(s, e)), Ae = (e) => {
|
|
2092
|
+
const s = /^#?([0-9a-f]{6})([0-9a-f]{2})?$/i.exec((e || "").trim());
|
|
2093
|
+
if (!s) return { r: 255, g: 255, b: 255, a: 1 };
|
|
2094
|
+
const n = parseInt(s[1], 16);
|
|
2095
|
+
return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255, a: s[2] ? parseInt(s[2], 16) / 255 : 1 };
|
|
2096
|
+
}, Ki = (e, s, n, o = 1, i = !0) => {
|
|
2097
|
+
const c = (r) => r.toString(16).padStart(2, "0").toUpperCase();
|
|
2098
|
+
return `#${c(e)}${c(s)}${c(n)}${i ? c(Math.round(Se(o, 0, 1) * 255)) : ""}`;
|
|
2099
|
+
}, We = (e, s, n) => {
|
|
2100
|
+
e /= 255, s /= 255, n /= 255;
|
|
2101
|
+
const o = Math.max(e, s, n), i = Math.min(e, s, n), c = o - i;
|
|
2102
|
+
let r = 0;
|
|
2103
|
+
return c && (o === e ? r = (s - n) / c % 6 : o === s ? r = (n - e) / c + 2 : r = (e - s) / c + 4, r *= 60, r < 0 && (r += 360)), { h: r, s: o === 0 ? 0 : c / o, v: o };
|
|
2104
|
+
}, st = (e, s, n) => {
|
|
2105
|
+
const o = n * s, i = o * (1 - Math.abs(e / 60 % 2 - 1)), c = n - o;
|
|
2106
|
+
let r = 0, d = 0, a = 0;
|
|
2107
|
+
return e < 60 ? (r = o, d = i) : e < 120 ? (r = i, d = o) : e < 180 ? (d = o, a = i) : e < 240 ? (d = i, a = o) : e < 300 ? (r = i, a = o) : (r = o, a = i), { r: Math.round((r + c) * 255), g: Math.round((d + c) * 255), b: Math.round((a + c) * 255) };
|
|
2108
|
+
}, Fe = (e, s = !0) => {
|
|
2109
|
+
const { r: n, g: o, b: i } = st(e.h, e.s, e.v);
|
|
2110
|
+
return Ki(n, o, i, e.a, s);
|
|
2111
|
+
}, Ve = (e) => (e || "").trim().toUpperCase().replace(/^(?!#)/, "#");
|
|
2112
|
+
function yc({
|
|
2113
|
+
value: e,
|
|
2114
|
+
onChange: s,
|
|
2115
|
+
defaultValue: n,
|
|
2116
|
+
label: o,
|
|
2117
|
+
description: i,
|
|
2118
|
+
withAlpha: c = !0,
|
|
2119
|
+
disabled: r = !1,
|
|
2120
|
+
resetText: d = "Reset",
|
|
2121
|
+
className: a
|
|
2122
|
+
}) {
|
|
2123
|
+
const [u, f] = x(!1), [p, v] = x(!1), [l, _] = x({}), y = M(null), k = M(null), C = M(null), L = M(null), $ = M(!1);
|
|
2124
|
+
O(() => v(!0), []);
|
|
2125
|
+
const [N, F] = x(() => {
|
|
2126
|
+
const { r: g, g: R, b: Z, a: V } = Ae(e), { h: _e, s: pe, v: me } = We(g, R, Z);
|
|
2127
|
+
return { h: _e, s: pe, v: me, a: V };
|
|
2128
|
+
}), [q, A] = x(e || "#FFFFFF"), U = n !== void 0 && Ve(e) !== Ve(n);
|
|
2129
|
+
O(() => {
|
|
2130
|
+
const g = (e || "#FFFFFF").trim().toUpperCase(), R = Fe(N, c).toUpperCase();
|
|
2131
|
+
if (g !== R) {
|
|
2132
|
+
const { r: Z, g: V, b: _e, a: pe } = Ae(e), { h: me, s: T, v: te } = We(Z, V, _e);
|
|
2133
|
+
F({ h: me, s: T, v: te, a: pe }), A(g);
|
|
2134
|
+
}
|
|
2135
|
+
}, [e, c]);
|
|
2136
|
+
const h = S(() => {
|
|
2137
|
+
const g = k.current;
|
|
2138
|
+
if (!g) return;
|
|
2139
|
+
const R = g.getBoundingClientRect();
|
|
2140
|
+
_({
|
|
2141
|
+
position: "fixed",
|
|
2142
|
+
top: R.bottom + 8,
|
|
2143
|
+
left: R.left,
|
|
2144
|
+
zIndex: 10050
|
|
2145
|
+
});
|
|
2146
|
+
}, []);
|
|
2147
|
+
O(() => {
|
|
2148
|
+
if (u)
|
|
2149
|
+
return h(), window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
|
|
2150
|
+
window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
2151
|
+
};
|
|
2152
|
+
}, [u, h]), O(() => {
|
|
2153
|
+
const g = (R) => {
|
|
2154
|
+
var V, _e;
|
|
2155
|
+
const Z = R.target;
|
|
2156
|
+
(V = y.current) != null && V.contains(Z) || (_e = C.current) != null && _e.contains(Z) || f(!1);
|
|
2157
|
+
};
|
|
2158
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
2159
|
+
}, []);
|
|
2160
|
+
const I = S((g) => {
|
|
2161
|
+
const R = Fe(g, c);
|
|
2162
|
+
F(g), A(R.toUpperCase()), s == null || s(R);
|
|
2163
|
+
}, [s, c]), E = (g) => {
|
|
2164
|
+
if (!L.current) return;
|
|
2165
|
+
const R = L.current.getBoundingClientRect(), Z = Se((g.clientX - R.left) / R.width, 0, 1), V = 1 - Se((g.clientY - R.top) / R.height, 0, 1);
|
|
2166
|
+
I({ ...N, s: Z, v: V });
|
|
2167
|
+
}, { r: P, g: H, b: K } = st(N.h, N.s, N.v), b = `rgba(${P},${H},${K},${N.a})`, W = Fe(N, c).toUpperCase(), X = () => {
|
|
2168
|
+
const g = /^#?([0-9a-f]{3,8})$/i.exec(q.trim());
|
|
2169
|
+
if (g) {
|
|
2170
|
+
let R = g[1];
|
|
2171
|
+
if (R.length === 3 && (R = R[0] + R[0] + R[1] + R[1] + R[2] + R[2]), R.length === 6 || R.length === 8) {
|
|
2172
|
+
const { r: Z, g: V, b: _e, a: pe } = Ae("#" + R), { h: me, s: T, v: te } = We(Z, V, _e);
|
|
2173
|
+
I({ h: me, s: T, v: te, a: c ? pe : 1 });
|
|
2174
|
+
return;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
A(W);
|
|
2178
|
+
}, re = (g) => {
|
|
2179
|
+
g.stopPropagation(), n && (s == null || s(n));
|
|
2180
|
+
}, j = () => {
|
|
2181
|
+
r || u || f(!0);
|
|
2182
|
+
};
|
|
2183
|
+
return /* @__PURE__ */ m("div", { ref: y, className: w(ee.wrapper, r && ee.disabled, a), onClick: j, children: [
|
|
2184
|
+
(o || U) && /* @__PURE__ */ m("div", { className: ee.labelRow, children: [
|
|
2185
|
+
o && /* @__PURE__ */ m("div", { className: ee.label, children: [
|
|
2186
|
+
o,
|
|
2187
|
+
i && /* @__PURE__ */ t(Le, { content: i, position: "right", children: /* @__PURE__ */ t("span", { className: ee.descDot, children: "?" }) })
|
|
2188
|
+
] }),
|
|
2189
|
+
U && /* @__PURE__ */ t("button", { type: "button", className: ee.resetBtn, onClick: re, children: d })
|
|
2190
|
+
] }),
|
|
2191
|
+
/* @__PURE__ */ m("button", { ref: k, type: "button", className: ee.trigger, onClick: (g) => {
|
|
2192
|
+
g.stopPropagation(), f((R) => !R);
|
|
2193
|
+
}, children: [
|
|
2194
|
+
/* @__PURE__ */ t("span", { className: ee.swatch, style: { background: b } }),
|
|
2195
|
+
/* @__PURE__ */ t("span", { className: ee.hexLabel, children: W })
|
|
2196
|
+
] }),
|
|
2197
|
+
p && u && Re(
|
|
2198
|
+
/* @__PURE__ */ m("div", { ref: C, className: ee.panel, style: l, onClick: (g) => g.stopPropagation(), children: [
|
|
2199
|
+
/* @__PURE__ */ t(
|
|
2200
|
+
"div",
|
|
2201
|
+
{
|
|
2202
|
+
ref: L,
|
|
2203
|
+
className: ee.sv,
|
|
2204
|
+
style: { backgroundColor: `hsl(${N.h} 100% 50%)` },
|
|
2205
|
+
onMouseDown: (g) => {
|
|
2206
|
+
$.current = !0, E(g);
|
|
2207
|
+
},
|
|
2208
|
+
onMouseMove: (g) => {
|
|
2209
|
+
$.current && E(g);
|
|
2210
|
+
},
|
|
2211
|
+
onMouseUp: () => {
|
|
2212
|
+
$.current = !1;
|
|
2213
|
+
},
|
|
2214
|
+
onMouseLeave: () => {
|
|
2215
|
+
$.current = !1;
|
|
2216
|
+
},
|
|
2217
|
+
children: /* @__PURE__ */ t("div", { className: ee.svKnob, style: { left: `${N.s * 100}%`, top: `${(1 - N.v) * 100}%` } })
|
|
2218
|
+
}
|
|
2219
|
+
),
|
|
2220
|
+
/* @__PURE__ */ t(
|
|
2221
|
+
"input",
|
|
2222
|
+
{
|
|
2223
|
+
type: "range",
|
|
2224
|
+
min: 0,
|
|
2225
|
+
max: 360,
|
|
2226
|
+
value: Math.round(N.h),
|
|
2227
|
+
className: ee.hueSlider,
|
|
2228
|
+
onChange: (g) => I({ ...N, h: Number(g.target.value) })
|
|
2229
|
+
}
|
|
2230
|
+
),
|
|
2231
|
+
c && /* @__PURE__ */ m("div", { className: ee.alphaRow, children: [
|
|
2232
|
+
/* @__PURE__ */ t("div", { className: ee.alphaChecker }),
|
|
2233
|
+
/* @__PURE__ */ t(
|
|
2234
|
+
"input",
|
|
2235
|
+
{
|
|
2236
|
+
type: "range",
|
|
2237
|
+
min: 0,
|
|
2238
|
+
max: 100,
|
|
2239
|
+
value: Math.round(N.a * 100),
|
|
2240
|
+
className: ee.alphaSlider,
|
|
2241
|
+
style: { background: `linear-gradient(90deg, rgba(${P},${H},${K},0), rgba(${P},${H},${K},1))` },
|
|
2242
|
+
onChange: (g) => I({ ...N, a: Number(g.target.value) / 100 })
|
|
2243
|
+
}
|
|
2244
|
+
)
|
|
2245
|
+
] }),
|
|
2246
|
+
/* @__PURE__ */ m("div", { className: ee.inputs, children: [
|
|
2247
|
+
/* @__PURE__ */ t(
|
|
2248
|
+
"input",
|
|
2249
|
+
{
|
|
2250
|
+
className: ee.hexInput,
|
|
2251
|
+
value: q,
|
|
2252
|
+
onChange: (g) => A(g.target.value),
|
|
2253
|
+
onBlur: X,
|
|
2254
|
+
onKeyDown: (g) => {
|
|
2255
|
+
g.key === "Enter" && g.currentTarget.blur();
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
),
|
|
2259
|
+
c && /* @__PURE__ */ m("div", { className: ee.opacityBox, children: [
|
|
2260
|
+
/* @__PURE__ */ t(
|
|
2261
|
+
"input",
|
|
2262
|
+
{
|
|
2263
|
+
className: ee.opacityInput,
|
|
2264
|
+
value: Math.round(N.a * 100),
|
|
2265
|
+
onChange: (g) => {
|
|
2266
|
+
const R = Se(parseInt(g.target.value || "0", 10), 0, 100);
|
|
2267
|
+
I({ ...N, a: R / 100 });
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
),
|
|
2271
|
+
/* @__PURE__ */ t("span", { className: ee.opacitySuffix, children: "%" })
|
|
2272
|
+
] })
|
|
2273
|
+
] })
|
|
2274
|
+
] }),
|
|
2275
|
+
document.body
|
|
2276
|
+
)
|
|
2277
|
+
] });
|
|
2278
|
+
}
|
|
2279
|
+
const Zi = "_wrapper_1bima_2", Vi = "_disabled_1bima_15", Gi = "_previewWrap_1bima_21", Ji = "_previewImg_1bima_30", Xi = "_previewLoaded_1bima_39", Qi = "_labelRow_1bima_45", Yi = "_label_1bima_45", ea = "_resetBtn_1bima_63", ta = "_descDot_1bima_79", na = "_field_1bima_95", oa = "_textInput_1bima_110", sa = "_clearBtn_1bima_126", ra = "_pickBtn_1bima_127", ia = "_hidden_1bima_150", le = {
|
|
2280
|
+
wrapper: Zi,
|
|
2281
|
+
disabled: Vi,
|
|
2282
|
+
previewWrap: Gi,
|
|
2283
|
+
previewImg: Ji,
|
|
2284
|
+
previewLoaded: Xi,
|
|
2285
|
+
labelRow: Qi,
|
|
2286
|
+
label: Yi,
|
|
2287
|
+
resetBtn: ea,
|
|
2288
|
+
descDot: ta,
|
|
2289
|
+
field: na,
|
|
2290
|
+
textInput: oa,
|
|
2291
|
+
clearBtn: sa,
|
|
2292
|
+
pickBtn: ra,
|
|
2293
|
+
hidden: ia
|
|
2294
|
+
}, Ge = /\.(png|jpe?g|gif|webp|bmp|svg|avif)$/i;
|
|
2295
|
+
function aa() {
|
|
2296
|
+
return /* @__PURE__ */ t("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }) });
|
|
2297
|
+
}
|
|
2298
|
+
function ca() {
|
|
2299
|
+
return /* @__PURE__ */ m("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2300
|
+
/* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2301
|
+
/* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2302
|
+
] });
|
|
2303
|
+
}
|
|
2304
|
+
function kc({
|
|
2305
|
+
label: e,
|
|
2306
|
+
description: s,
|
|
2307
|
+
value: n = "",
|
|
2308
|
+
onChange: o,
|
|
2309
|
+
accept: i = "",
|
|
2310
|
+
placeholder: c = "Select a file…",
|
|
2311
|
+
showPreview: r = !0,
|
|
2312
|
+
previewUrl: d,
|
|
2313
|
+
defaultValue: a,
|
|
2314
|
+
resetText: u = "Reset",
|
|
2315
|
+
disabled: f = !1,
|
|
2316
|
+
className: p
|
|
2317
|
+
}) {
|
|
2318
|
+
const v = M(null), [l, _] = x(null), [y, k] = x(!1), C = Ge.test(n), L = r && (l || d) && C;
|
|
2319
|
+
O(() => () => {
|
|
2320
|
+
l && URL.revokeObjectURL(l);
|
|
2321
|
+
}, [l]);
|
|
2322
|
+
const $ = S((h) => {
|
|
2323
|
+
var E;
|
|
2324
|
+
const I = (E = h.target.files) == null ? void 0 : E[0];
|
|
2325
|
+
I && (Ge.test(I.name) ? (l && URL.revokeObjectURL(l), _(URL.createObjectURL(I)), k(!1)) : (l && URL.revokeObjectURL(l), _(null)), o == null || o(I.name, I), h.target.value = "");
|
|
2326
|
+
}, [o, l]), N = S(() => {
|
|
2327
|
+
l && URL.revokeObjectURL(l), _(null), k(!1), o == null || o("", null);
|
|
2328
|
+
}, [o, l]), F = () => {
|
|
2329
|
+
var h;
|
|
2330
|
+
return (h = v.current) == null ? void 0 : h.click();
|
|
2331
|
+
}, q = l || d || null, A = a !== void 0 && n !== a, U = (h) => {
|
|
2332
|
+
h.stopPropagation(), l && URL.revokeObjectURL(l), _(null), k(!1), o == null || o(a ?? "", null);
|
|
2333
|
+
};
|
|
2334
|
+
return /* @__PURE__ */ m("div", { className: w(le.wrapper, f && le.disabled, p), onClick: F, style: { cursor: f ? "default" : "pointer" }, children: [
|
|
2335
|
+
L && q && /* @__PURE__ */ t("div", { className: w(le.previewWrap, y && le.previewLoaded), onClick: F, children: /* @__PURE__ */ t(
|
|
2336
|
+
"img",
|
|
2337
|
+
{
|
|
2338
|
+
className: le.previewImg,
|
|
2339
|
+
src: q,
|
|
2340
|
+
alt: "",
|
|
2341
|
+
onLoad: () => k(!0),
|
|
2342
|
+
onError: () => k(!1)
|
|
2343
|
+
}
|
|
2344
|
+
) }),
|
|
2345
|
+
(e || A) && /* @__PURE__ */ m("div", { className: le.labelRow, children: [
|
|
2346
|
+
e && /* @__PURE__ */ m("div", { className: le.label, children: [
|
|
2347
|
+
e,
|
|
2348
|
+
s && /* @__PURE__ */ t(Le, { content: s, position: "right", children: /* @__PURE__ */ t("span", { className: le.descDot, children: "?" }) })
|
|
2349
|
+
] }),
|
|
2350
|
+
A && /* @__PURE__ */ t("button", { type: "button", className: le.resetBtn, onClick: U, children: u })
|
|
2351
|
+
] }),
|
|
2352
|
+
/* @__PURE__ */ m("div", { className: le.field, onClick: (h) => h.stopPropagation(), children: [
|
|
2353
|
+
/* @__PURE__ */ t(
|
|
2354
|
+
"input",
|
|
2355
|
+
{
|
|
2356
|
+
className: le.textInput,
|
|
2357
|
+
value: n,
|
|
2358
|
+
placeholder: c,
|
|
2359
|
+
readOnly: !0,
|
|
2360
|
+
onClick: F
|
|
2361
|
+
}
|
|
2362
|
+
),
|
|
2363
|
+
n && /* @__PURE__ */ t("button", { type: "button", className: le.clearBtn, onClick: (h) => {
|
|
2364
|
+
h.stopPropagation(), N();
|
|
2365
|
+
}, title: "Clear", children: /* @__PURE__ */ t(ca, {}) }),
|
|
2366
|
+
/* @__PURE__ */ t("button", { type: "button", className: le.pickBtn, onClick: (h) => {
|
|
2367
|
+
h.stopPropagation(), F();
|
|
2368
|
+
}, title: "Browse", children: /* @__PURE__ */ t(aa, {}) })
|
|
2369
|
+
] }),
|
|
2370
|
+
/* @__PURE__ */ t("input", { ref: v, type: "file", accept: i, onChange: $, className: le.hidden, tabIndex: -1 })
|
|
2371
|
+
] });
|
|
2372
|
+
}
|
|
2373
|
+
const la = "_wrapper_14mkh_2", da = "_section_14mkh_9", ua = "_sectionDisabled_14mkh_13", _a = "_header_14mkh_19", pa = "_sectionOpen_14mkh_37", ma = "_badge_14mkh_41", ha = "_title_14mkh_62", fa = "_chevron_14mkh_70", va = "_chevronOpen_14mkh_78", ga = "_bodyContent_14mkh_84", ba = "_divider_14mkh_89", wa = "_body_14mkh_84", ya = "_bodyOpening_14mkh_103", ka = "_bodyInner_14mkh_103", xa = "_bodyClosing_14mkh_107", ae = {
|
|
2374
|
+
wrapper: la,
|
|
2375
|
+
section: da,
|
|
2376
|
+
sectionDisabled: ua,
|
|
2377
|
+
header: _a,
|
|
2378
|
+
sectionOpen: pa,
|
|
2379
|
+
badge: ma,
|
|
2380
|
+
title: ha,
|
|
2381
|
+
chevron: fa,
|
|
2382
|
+
chevronOpen: va,
|
|
2383
|
+
bodyContent: ga,
|
|
2384
|
+
divider: ba,
|
|
2385
|
+
body: wa,
|
|
2386
|
+
bodyOpening: ya,
|
|
2387
|
+
bodyInner: ka,
|
|
2388
|
+
bodyClosing: xa
|
|
2389
|
+
};
|
|
2390
|
+
function Na() {
|
|
2391
|
+
return /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polyline", { points: "6 9 12 15 18 9" }) });
|
|
2392
|
+
}
|
|
2393
|
+
function Ca({
|
|
2394
|
+
item: e,
|
|
2395
|
+
index: s,
|
|
2396
|
+
isOpen: n,
|
|
2397
|
+
onToggle: o,
|
|
2398
|
+
numbered: i,
|
|
2399
|
+
sectionClassName: c,
|
|
2400
|
+
headerClassName: r,
|
|
2401
|
+
bodyClassName: d,
|
|
2402
|
+
showDivider: a
|
|
2403
|
+
}) {
|
|
2404
|
+
const u = M(null), f = M(null), [p, v] = x("idle"), [l, _] = x(n ? "auto" : 0), y = M(n);
|
|
2405
|
+
He(() => {
|
|
2406
|
+
const C = y.current;
|
|
2407
|
+
if (y.current = n, C === n) return;
|
|
2408
|
+
const L = f.current;
|
|
2409
|
+
if (!L) return;
|
|
2410
|
+
const $ = L.scrollHeight;
|
|
2411
|
+
n ? (_(0), v("opening"), requestAnimationFrame(() => {
|
|
2412
|
+
requestAnimationFrame(() => {
|
|
2413
|
+
_($);
|
|
2414
|
+
});
|
|
2415
|
+
})) : (_($), v("closing"), requestAnimationFrame(() => {
|
|
2416
|
+
requestAnimationFrame(() => {
|
|
2417
|
+
_(0);
|
|
2418
|
+
});
|
|
2419
|
+
}));
|
|
2420
|
+
}, [n]);
|
|
2421
|
+
const k = () => {
|
|
2422
|
+
p === "opening" ? (_("auto"), v("idle")) : p === "closing" && v("idle");
|
|
2423
|
+
};
|
|
2424
|
+
return /* @__PURE__ */ m("div", { className: w(
|
|
2425
|
+
ae.section,
|
|
2426
|
+
n && ae.sectionOpen,
|
|
2427
|
+
e.disabled && ae.sectionDisabled,
|
|
2428
|
+
c,
|
|
2429
|
+
e.className
|
|
2430
|
+
), children: [
|
|
2431
|
+
/* @__PURE__ */ m(
|
|
2432
|
+
"button",
|
|
2433
|
+
{
|
|
2434
|
+
type: "button",
|
|
2435
|
+
className: w(ae.header, r),
|
|
2436
|
+
onClick: () => {
|
|
2437
|
+
e.disabled || o();
|
|
2438
|
+
},
|
|
2439
|
+
"aria-expanded": n,
|
|
2440
|
+
children: [
|
|
2441
|
+
i && /* @__PURE__ */ t("span", { className: ae.badge, children: s + 1 }),
|
|
2442
|
+
/* @__PURE__ */ t("span", { className: ae.title, children: e.title }),
|
|
2443
|
+
/* @__PURE__ */ t("span", { className: w(ae.chevron, n && ae.chevronOpen), children: /* @__PURE__ */ t(Na, {}) })
|
|
2444
|
+
]
|
|
2445
|
+
}
|
|
2446
|
+
),
|
|
2447
|
+
/* @__PURE__ */ t(
|
|
2448
|
+
"div",
|
|
2449
|
+
{
|
|
2450
|
+
ref: u,
|
|
2451
|
+
className: w(ae.body, p === "opening" && ae.bodyOpening, p === "closing" && ae.bodyClosing),
|
|
2452
|
+
style: { height: l },
|
|
2453
|
+
onTransitionEnd: k,
|
|
2454
|
+
children: /* @__PURE__ */ m("div", { ref: f, className: ae.bodyContent, children: [
|
|
2455
|
+
a && /* @__PURE__ */ t("div", { className: ae.divider }),
|
|
2456
|
+
/* @__PURE__ */ t("div", { className: w(ae.bodyInner, d, e.contentClassName), children: e.content })
|
|
2457
|
+
] })
|
|
2458
|
+
}
|
|
2459
|
+
)
|
|
2460
|
+
] });
|
|
2461
|
+
}
|
|
2462
|
+
function xc({
|
|
2463
|
+
items: e,
|
|
2464
|
+
multiple: s = !1,
|
|
2465
|
+
defaultOpen: n = [],
|
|
2466
|
+
openKeys: o,
|
|
2467
|
+
onOpenKeysChange: i,
|
|
2468
|
+
numbered: c = !0,
|
|
2469
|
+
className: r,
|
|
2470
|
+
sectionClassName: d,
|
|
2471
|
+
headerClassName: a,
|
|
2472
|
+
bodyClassName: u,
|
|
2473
|
+
showDivider: f = !0
|
|
2474
|
+
}) {
|
|
2475
|
+
const [p, v] = x(new Set(n)), l = o !== void 0, _ = l ? new Set(o) : p, y = S((k) => {
|
|
2476
|
+
const C = (L) => {
|
|
2477
|
+
const $ = new Set(L);
|
|
2478
|
+
return $.has(k) ? $.delete(k) : (s || $.clear(), $.add(k)), $;
|
|
2479
|
+
};
|
|
2480
|
+
if (l) {
|
|
2481
|
+
const L = C(new Set(o));
|
|
2482
|
+
i == null || i(Array.from(L));
|
|
2483
|
+
} else
|
|
2484
|
+
v((L) => {
|
|
2485
|
+
const $ = C(L);
|
|
2486
|
+
return i == null || i(Array.from($)), $;
|
|
2487
|
+
});
|
|
2488
|
+
}, [s, l, o, i]);
|
|
2489
|
+
return /* @__PURE__ */ t("div", { className: w(ae.wrapper, r), children: e.map((k, C) => /* @__PURE__ */ t(
|
|
2490
|
+
Ca,
|
|
2491
|
+
{
|
|
2492
|
+
item: k,
|
|
2493
|
+
index: C,
|
|
2494
|
+
isOpen: _.has(k.key),
|
|
2495
|
+
onToggle: () => y(k.key),
|
|
2496
|
+
numbered: c,
|
|
2497
|
+
sectionClassName: d,
|
|
2498
|
+
headerClassName: a,
|
|
2499
|
+
bodyClassName: u,
|
|
2500
|
+
showDivider: f
|
|
2501
|
+
},
|
|
2502
|
+
k.key
|
|
2503
|
+
)) });
|
|
2504
|
+
}
|
|
2505
|
+
const La = "_wrapper_1xxwq_3", $a = "_trigger_1xxwq_8", Ra = "_panel_1xxwq_12", Ba = "_panelRight_1xxwq_24", Ia = "_panelClosing_1xxwq_28", Ea = "_content_1xxwq_53", ja = "_banner_1xxwq_59", Da = "_userInfo_1xxwq_66", Sa = "_avatarWrap_1xxwq_76", Ta = "_userDetails_1xxwq_84", Ma = "_username_1xxwq_91", za = "_nickname_1xxwq_98", Pa = "_menu_1xxwq_111", Aa = "_item_1xxwq_117", Wa = "_itemDisabled_1xxwq_138", Fa = "_itemIcon_1xxwq_143", qa = "_itemLabel_1xxwq_151", oe = {
|
|
2506
|
+
wrapper: La,
|
|
2507
|
+
trigger: $a,
|
|
2508
|
+
panel: Ra,
|
|
2509
|
+
panelRight: Ba,
|
|
2510
|
+
panelClosing: Ia,
|
|
2511
|
+
content: Ea,
|
|
2512
|
+
banner: ja,
|
|
2513
|
+
userInfo: Da,
|
|
2514
|
+
avatarWrap: Sa,
|
|
2515
|
+
userDetails: Ta,
|
|
2516
|
+
username: Ma,
|
|
2517
|
+
nickname: za,
|
|
2518
|
+
menu: Pa,
|
|
2519
|
+
item: Aa,
|
|
2520
|
+
itemDisabled: Wa,
|
|
2521
|
+
itemIcon: Fa,
|
|
2522
|
+
itemLabel: qa
|
|
2523
|
+
};
|
|
2524
|
+
function Nc({
|
|
2525
|
+
avatarSrc: e,
|
|
2526
|
+
avatarAlt: s,
|
|
2527
|
+
username: n,
|
|
2528
|
+
nickname: o,
|
|
2529
|
+
bannerSrc: i,
|
|
2530
|
+
status: c,
|
|
2531
|
+
items: r,
|
|
2532
|
+
children: d,
|
|
2533
|
+
className: a,
|
|
2534
|
+
align: u = "right"
|
|
2535
|
+
}) {
|
|
2536
|
+
const [f, p] = x(!1), [v, l] = x(!1), [_, y] = x(!1), [k, C] = x({}), L = M(null), $ = M(null);
|
|
2537
|
+
O(() => y(!0), []);
|
|
2538
|
+
const N = S(() => {
|
|
2539
|
+
const h = L.current;
|
|
2540
|
+
if (!h) return;
|
|
2541
|
+
const I = h.getBoundingClientRect();
|
|
2542
|
+
C({
|
|
2543
|
+
position: "fixed",
|
|
2544
|
+
top: I.bottom + 6,
|
|
2545
|
+
left: u === "right" ? void 0 : I.left,
|
|
2546
|
+
right: u === "right" ? window.innerWidth - I.right : void 0,
|
|
2547
|
+
minWidth: 280,
|
|
2548
|
+
zIndex: 10050
|
|
2549
|
+
});
|
|
2550
|
+
}, [u]);
|
|
2551
|
+
O(() => {
|
|
2552
|
+
if (f)
|
|
2553
|
+
return N(), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
2554
|
+
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
2555
|
+
};
|
|
2556
|
+
}, [f, N]);
|
|
2557
|
+
const F = S(() => {
|
|
2558
|
+
!f && !v || v || l(!0);
|
|
2559
|
+
}, [f, v]);
|
|
2560
|
+
O(() => {
|
|
2561
|
+
const h = (I) => {
|
|
2562
|
+
var P, H;
|
|
2563
|
+
const E = I.target;
|
|
2564
|
+
(P = L.current) != null && P.contains(E) || (H = $.current) != null && H.contains(E) || F();
|
|
2565
|
+
};
|
|
2566
|
+
return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
2567
|
+
}, [F]);
|
|
2568
|
+
const q = S(() => {
|
|
2569
|
+
v && (l(!1), p(!1));
|
|
2570
|
+
}, [v]), A = () => {
|
|
2571
|
+
f ? F() : p(!0);
|
|
2572
|
+
}, U = f || v;
|
|
2573
|
+
return /* @__PURE__ */ m("div", { ref: L, className: w(oe.wrapper, a), children: [
|
|
2574
|
+
/* @__PURE__ */ t("div", { className: oe.trigger, onClick: A, role: "button", tabIndex: 0, onKeyDown: (h) => h.key === "Enter" && A(), children: d ?? /* @__PURE__ */ t(
|
|
2575
|
+
qe,
|
|
2576
|
+
{
|
|
2577
|
+
src: e,
|
|
2578
|
+
alt: s || "",
|
|
2579
|
+
size: "sm",
|
|
2580
|
+
shape: "rounded",
|
|
2581
|
+
status: c
|
|
2582
|
+
}
|
|
2583
|
+
) }),
|
|
2584
|
+
_ && U && Re(
|
|
2585
|
+
/* @__PURE__ */ m(
|
|
2586
|
+
"div",
|
|
2587
|
+
{
|
|
2588
|
+
ref: $,
|
|
2589
|
+
className: w(oe.panel, u === "right" && oe.panelRight, v && oe.panelClosing),
|
|
2590
|
+
style: k,
|
|
2591
|
+
onAnimationEnd: q,
|
|
2592
|
+
children: [
|
|
2593
|
+
/* @__PURE__ */ m("div", { className: oe.content, children: [
|
|
2594
|
+
i && /* @__PURE__ */ t(
|
|
2595
|
+
"div",
|
|
2596
|
+
{
|
|
2597
|
+
className: oe.banner,
|
|
2598
|
+
style: { backgroundImage: `linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.8) 100%), url(${i})` }
|
|
2599
|
+
}
|
|
2600
|
+
),
|
|
2601
|
+
/* @__PURE__ */ m("div", { className: oe.userInfo, children: [
|
|
2602
|
+
/* @__PURE__ */ t("div", { className: oe.avatarWrap, children: /* @__PURE__ */ t(
|
|
2603
|
+
qe,
|
|
2604
|
+
{
|
|
2605
|
+
src: e,
|
|
2606
|
+
alt: s || "",
|
|
2607
|
+
size: "lg",
|
|
2608
|
+
shape: "rounded",
|
|
2609
|
+
status: c
|
|
2610
|
+
}
|
|
2611
|
+
) }),
|
|
2612
|
+
/* @__PURE__ */ m("div", { className: oe.userDetails, children: [
|
|
2613
|
+
/* @__PURE__ */ t("div", { className: oe.username, children: n }),
|
|
2614
|
+
o != null && /* @__PURE__ */ t("div", { className: oe.nickname, children: o })
|
|
2615
|
+
] })
|
|
2616
|
+
] })
|
|
2617
|
+
] }),
|
|
2618
|
+
/* @__PURE__ */ t("div", { className: oe.menu, children: r.map((h) => /* @__PURE__ */ m(
|
|
2619
|
+
"button",
|
|
2620
|
+
{
|
|
2621
|
+
type: "button",
|
|
2622
|
+
className: w(oe.item, h.disabled && oe.itemDisabled),
|
|
2623
|
+
disabled: h.disabled,
|
|
2624
|
+
onClick: () => {
|
|
2625
|
+
var I;
|
|
2626
|
+
h.disabled || ((I = h.onClick) == null || I.call(h), p(!1));
|
|
2627
|
+
},
|
|
2628
|
+
children: [
|
|
2629
|
+
h.icon && /* @__PURE__ */ t("span", { className: oe.itemIcon, children: h.icon }),
|
|
2630
|
+
/* @__PURE__ */ t("span", { className: oe.itemLabel, children: h.label })
|
|
2631
|
+
]
|
|
2632
|
+
},
|
|
2633
|
+
h.key
|
|
2634
|
+
)) })
|
|
2635
|
+
]
|
|
2636
|
+
}
|
|
2637
|
+
),
|
|
2638
|
+
document.body
|
|
2639
|
+
)
|
|
2640
|
+
] });
|
|
2641
|
+
}
|
|
2642
|
+
const Ua = "_bar_ctl9k_3", Oa = "_items_ctl9k_11", Ha = "_item_ctl9k_11", Ka = "_iconWrap_ctl9k_37", Za = "_itemActive_ctl9k_47", Va = "_itemDisabled_ctl9k_56", Ga = "_slot_ctl9k_62", ke = {
|
|
2643
|
+
bar: Ua,
|
|
2644
|
+
items: Oa,
|
|
2645
|
+
item: Ha,
|
|
2646
|
+
iconWrap: Ka,
|
|
2647
|
+
itemActive: Za,
|
|
2648
|
+
itemDisabled: Va,
|
|
2649
|
+
slot: Ga
|
|
2650
|
+
};
|
|
2651
|
+
function Cc({
|
|
2652
|
+
items: e,
|
|
2653
|
+
defaultActiveColor: s,
|
|
2654
|
+
tooltipPosition: n = "right",
|
|
2655
|
+
topContent: o,
|
|
2656
|
+
bottomContent: i,
|
|
2657
|
+
className: c
|
|
2658
|
+
}) {
|
|
2659
|
+
return /* @__PURE__ */ m(
|
|
2660
|
+
"nav",
|
|
2661
|
+
{
|
|
2662
|
+
className: w(ke.bar, c),
|
|
2663
|
+
role: "navigation",
|
|
2664
|
+
style: s ? { "--ps-nav-active": s } : void 0,
|
|
2665
|
+
children: [
|
|
2666
|
+
o && /* @__PURE__ */ t("div", { className: ke.slot, children: o }),
|
|
2667
|
+
/* @__PURE__ */ t("div", { className: ke.items, children: e.map((r) => {
|
|
2668
|
+
const d = /* @__PURE__ */ t("span", { className: ke.iconWrap, children: r.icon }), a = r.disabled ? r.disabledTooltip ?? r.tooltip : r.tooltip, u = (v) => a ? /* @__PURE__ */ t(Le, { content: a, position: n, children: v }) : v, f = w(
|
|
2669
|
+
ke.item,
|
|
2670
|
+
r.active && ke.itemActive,
|
|
2671
|
+
r.disabled && ke.itemDisabled
|
|
2672
|
+
), p = r.active && r.activeColor ? { backgroundColor: r.activeColor } : void 0;
|
|
2673
|
+
return r.href && !r.disabled ? /* @__PURE__ */ t(
|
|
2674
|
+
"a",
|
|
2675
|
+
{
|
|
2676
|
+
href: r.href,
|
|
2677
|
+
className: f,
|
|
2678
|
+
style: p,
|
|
2679
|
+
"aria-label": r.tooltip,
|
|
2680
|
+
"aria-current": r.active ? "page" : void 0,
|
|
2681
|
+
children: u(d)
|
|
2682
|
+
},
|
|
2683
|
+
r.key
|
|
2684
|
+
) : /* @__PURE__ */ t(
|
|
2685
|
+
"button",
|
|
2686
|
+
{
|
|
2687
|
+
type: "button",
|
|
2688
|
+
className: f,
|
|
2689
|
+
style: p,
|
|
2690
|
+
onClick: r.onClick,
|
|
2691
|
+
disabled: r.disabled,
|
|
2692
|
+
"aria-label": r.tooltip,
|
|
2693
|
+
"aria-current": r.active ? "page" : void 0,
|
|
2694
|
+
children: u(d)
|
|
2695
|
+
},
|
|
2696
|
+
r.key
|
|
2697
|
+
);
|
|
2698
|
+
}) }),
|
|
2699
|
+
i && /* @__PURE__ */ t("div", { className: ke.slot, children: i })
|
|
2700
|
+
]
|
|
2701
|
+
}
|
|
2702
|
+
);
|
|
2703
|
+
}
|
|
2704
|
+
export {
|
|
2705
|
+
xc as Accordion,
|
|
2706
|
+
qe as Avatar,
|
|
2707
|
+
rc as AvatarGroup,
|
|
2708
|
+
mc as Badge,
|
|
2709
|
+
Ze as Button,
|
|
2710
|
+
yc as ColorPicker,
|
|
2711
|
+
Ot as ConfirmModal,
|
|
2712
|
+
wc as DropdownMenu,
|
|
2713
|
+
kc as FilePicker,
|
|
2714
|
+
Yo as Input,
|
|
2715
|
+
sc as NavLink,
|
|
2716
|
+
Cc as NavigationBar,
|
|
2717
|
+
oc as OptionPicker,
|
|
2718
|
+
cc as Pagination,
|
|
2719
|
+
en as PromptModal,
|
|
2720
|
+
ec as PulseSyncUIProvider,
|
|
2721
|
+
gc as Select,
|
|
2722
|
+
hc as Skeleton,
|
|
2723
|
+
fc as Slider,
|
|
2724
|
+
_c as Tab,
|
|
2725
|
+
uc as TabList,
|
|
2726
|
+
pc as TabPanel,
|
|
2727
|
+
dc as Tabs,
|
|
2728
|
+
bc as TextInput,
|
|
2729
|
+
ic as ToastProvider,
|
|
2730
|
+
vc as Toggle,
|
|
2731
|
+
Le as Tooltip,
|
|
2732
|
+
No as UserCard,
|
|
2733
|
+
lc as UserMention,
|
|
2734
|
+
Nc as UserMenu,
|
|
2735
|
+
tc as useConfirmModal,
|
|
2736
|
+
nc as usePromptModal,
|
|
2737
|
+
Ye as usePulseSyncUI,
|
|
2738
|
+
ac as useToast
|
|
2739
|
+
};
|
|
2740
|
+
//# sourceMappingURL=pulsesync-ui.js.map
|