fictoan-react 2.0.0-alpha.2 → 2.0.0-alpha.4
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.
|
@@ -0,0 +1,3986 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client;";
|
|
3
|
+
import { jsx as n, jsxs as I, Fragment as ve } from "react/jsx-runtime";
|
|
4
|
+
import y, { useCallback as W, useEffect as q, useRef as J, useState as j, useMemo as fe, createElement as yt, createRef as bt, useImperativeHandle as Ce, useContext as Ie, createContext as Ye } from "react";
|
|
5
|
+
import { createRoot as wt } from "react-dom/client";
|
|
6
|
+
const gt = (e) => e.filter((t) => !!t).join(" "), P = y.forwardRef(
|
|
7
|
+
({
|
|
8
|
+
as: e = "div",
|
|
9
|
+
role: t,
|
|
10
|
+
ariaLabel: a,
|
|
11
|
+
tabIndex: r,
|
|
12
|
+
onKeyDown: l,
|
|
13
|
+
...o
|
|
14
|
+
}, s) => {
|
|
15
|
+
const {
|
|
16
|
+
classNames: i = [],
|
|
17
|
+
bgColor: c,
|
|
18
|
+
bgColour: f,
|
|
19
|
+
bgOpacity: u,
|
|
20
|
+
borderColor: m,
|
|
21
|
+
borderColour: v,
|
|
22
|
+
borderOpacity: k,
|
|
23
|
+
className: g,
|
|
24
|
+
columns: A,
|
|
25
|
+
fillColor: p,
|
|
26
|
+
fillColour: N,
|
|
27
|
+
gap: w,
|
|
28
|
+
hideOnDesktop: O,
|
|
29
|
+
hideOnMobile: z,
|
|
30
|
+
hideOnTabletLandscape: b,
|
|
31
|
+
hideOnTabletPortrait: D,
|
|
32
|
+
horizontalMargin: x,
|
|
33
|
+
horizontalPadding: L,
|
|
34
|
+
horizontallyCenterThis: M,
|
|
35
|
+
horizontallyCentreThis: E,
|
|
36
|
+
isFullHeight: S,
|
|
37
|
+
isFullWidth: G,
|
|
38
|
+
layoutAsFlexbox: R,
|
|
39
|
+
layoutAsGrid: F,
|
|
40
|
+
stackVertically: H,
|
|
41
|
+
stackHorizontally: $,
|
|
42
|
+
marginLeft: d,
|
|
43
|
+
marginBottom: h,
|
|
44
|
+
margin: V,
|
|
45
|
+
marginRight: T,
|
|
46
|
+
marginTop: K,
|
|
47
|
+
opacity: Q,
|
|
48
|
+
paddingBottom: te,
|
|
49
|
+
paddingLeft: B,
|
|
50
|
+
padding: X,
|
|
51
|
+
paddingRight: C,
|
|
52
|
+
paddingTop: Z,
|
|
53
|
+
pushItemsToEnds: Se,
|
|
54
|
+
shadow: we,
|
|
55
|
+
shape: ge,
|
|
56
|
+
showOnlyOnDesktop: Ne,
|
|
57
|
+
showOnlyOnMobile: $e,
|
|
58
|
+
showOnlyOnTabletLandscape: ke,
|
|
59
|
+
showOnlyOnTabletPortrait: U,
|
|
60
|
+
size: ce,
|
|
61
|
+
strokeColor: pe,
|
|
62
|
+
strokeColour: oe,
|
|
63
|
+
textColor: xe,
|
|
64
|
+
textColour: ze,
|
|
65
|
+
verticalMargin: Pe,
|
|
66
|
+
verticalPadding: Te,
|
|
67
|
+
verticallyCenterItems: pt,
|
|
68
|
+
verticallyCentreItems: mt,
|
|
69
|
+
weight: He,
|
|
70
|
+
style: ht,
|
|
71
|
+
...vt
|
|
72
|
+
} = o, { className: Ra, classNames: Ma, ...Ea } = o, _e = {
|
|
73
|
+
...ht,
|
|
74
|
+
...u && { "--bg-opacity": Number(u) / 100 },
|
|
75
|
+
...k && { "--border-opacity": Number(k) / 100 }
|
|
76
|
+
};
|
|
77
|
+
return /* @__PURE__ */ n(
|
|
78
|
+
e,
|
|
79
|
+
{
|
|
80
|
+
ref: s,
|
|
81
|
+
role: t,
|
|
82
|
+
"aria-label": a,
|
|
83
|
+
tabIndex: r,
|
|
84
|
+
onKeyDown: l,
|
|
85
|
+
...vt,
|
|
86
|
+
style: Object.keys(_e).length > 0 ? _e : void 0,
|
|
87
|
+
className: gt(
|
|
88
|
+
[
|
|
89
|
+
g,
|
|
90
|
+
c && `bg-${c}`,
|
|
91
|
+
f && `bg-${f}`,
|
|
92
|
+
m && `border-${m}`,
|
|
93
|
+
v && `border-${v}`,
|
|
94
|
+
p && `fill-${p}`,
|
|
95
|
+
N && `fill-${N}`,
|
|
96
|
+
O && "hide-on-desktop",
|
|
97
|
+
z && "hide-on-mobile",
|
|
98
|
+
b && "hide-on-tablet-landscape",
|
|
99
|
+
D && "hide-on-tablet-portrait",
|
|
100
|
+
x && `margin-right-${x} margin-left-${x}`,
|
|
101
|
+
L && `padding-right-${L} padding-left-${L}`,
|
|
102
|
+
M && "horizontally-centre-this",
|
|
103
|
+
E && "horizontally-centre-this",
|
|
104
|
+
S && "full-height",
|
|
105
|
+
G && "full-width",
|
|
106
|
+
R && "layout-flexbox",
|
|
107
|
+
F && "layout-grid",
|
|
108
|
+
H && "stack-vertically",
|
|
109
|
+
$ && "stack-horizontally",
|
|
110
|
+
w && `gap-${w}`,
|
|
111
|
+
d && `margin-left-${d}`,
|
|
112
|
+
h && `margin-bottom-${h}`,
|
|
113
|
+
V && `margin-all-${V}`,
|
|
114
|
+
T && `margin-right-${T}`,
|
|
115
|
+
K && `margin-top-${K}`,
|
|
116
|
+
Q && `opacity-${Q}`,
|
|
117
|
+
te && `padding-bottom-${te}`,
|
|
118
|
+
B && `padding-left-${B}`,
|
|
119
|
+
X && `padding-all-${X}`,
|
|
120
|
+
C && `padding-right-${C}`,
|
|
121
|
+
Z && `padding-top-${Z}`,
|
|
122
|
+
Se && "push-to-ends",
|
|
123
|
+
we && `shadow-${we}`,
|
|
124
|
+
ge && `shape-${ge}`,
|
|
125
|
+
Ne && "show-only-on-desktop",
|
|
126
|
+
$e && "show-only-on-mobile",
|
|
127
|
+
ke && "show-only-on-tablet-landscape",
|
|
128
|
+
U && "show-only-on-tablet-portrait",
|
|
129
|
+
ce && `size-${ce}`,
|
|
130
|
+
pe && `stroke-${pe}`,
|
|
131
|
+
oe && `stroke-${oe}`,
|
|
132
|
+
xe && `text-${xe}`,
|
|
133
|
+
ze && `text-${ze}`,
|
|
134
|
+
Pe && `margin-top-${Pe} margin-bottom-${Pe}`,
|
|
135
|
+
Te && `padding-top-${Te} padding-bottom-${Te}`,
|
|
136
|
+
pt && "vertically-centre-items",
|
|
137
|
+
mt && "vertically-centre-items",
|
|
138
|
+
He && `weight-${He}`
|
|
139
|
+
].concat(i)
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
P.displayName = "Element";
|
|
146
|
+
const se = (e, t) => y.forwardRef(
|
|
147
|
+
(a, r) => {
|
|
148
|
+
const l = { ...t, ...a };
|
|
149
|
+
if (e === "a" && "external" in l) {
|
|
150
|
+
const { external: o } = l;
|
|
151
|
+
o && (l.target = "_blank", l.rel = "noopener noreferrer");
|
|
152
|
+
}
|
|
153
|
+
return /* @__PURE__ */ n(P, { as: e, ref: r, ...l });
|
|
154
|
+
}
|
|
155
|
+
), La = se("article"), Sa = se("aside"), Pa = se("body"), _ = se("div"), Ta = se("footer"), Oa = se("header"), Ba = se("main"), Nt = se("nav"), Fa = se("section"), Va = se("span"), za = se("a", {
|
|
156
|
+
rel: "noopener noreferrer"
|
|
157
|
+
// Default props for Hyperlink
|
|
158
|
+
}), $t = {
|
|
159
|
+
cross: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M18 6L6 18M6 6l12 12" }) }),
|
|
160
|
+
tick: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M5 12l5 5L20 7" }) }),
|
|
161
|
+
plus: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M12 5v14M5 12h14" }) }),
|
|
162
|
+
minus: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M5 12h14" }) })
|
|
163
|
+
}, Ae = y.forwardRef(
|
|
164
|
+
({
|
|
165
|
+
children: e,
|
|
166
|
+
size: t = "medium",
|
|
167
|
+
shape: a,
|
|
168
|
+
actionIcon: r,
|
|
169
|
+
onActionClick: l,
|
|
170
|
+
actionAriaLabel: o,
|
|
171
|
+
...s
|
|
172
|
+
}, i) => {
|
|
173
|
+
let c = [];
|
|
174
|
+
t && c.push(`size-${t}`), a && c.push(`shape-${a}`);
|
|
175
|
+
const f = (m) => {
|
|
176
|
+
m.stopPropagation(), l == null || l(m);
|
|
177
|
+
}, u = !!r;
|
|
178
|
+
return /* @__PURE__ */ I(
|
|
179
|
+
P,
|
|
180
|
+
{
|
|
181
|
+
"data-badge": !0,
|
|
182
|
+
"data-has-action": u || void 0,
|
|
183
|
+
ref: i,
|
|
184
|
+
classNames: c,
|
|
185
|
+
role: "status",
|
|
186
|
+
"aria-label": typeof e == "string" ? e : void 0,
|
|
187
|
+
...s,
|
|
188
|
+
children: [
|
|
189
|
+
e,
|
|
190
|
+
u && /* @__PURE__ */ n(
|
|
191
|
+
"button",
|
|
192
|
+
{
|
|
193
|
+
type: "button",
|
|
194
|
+
className: "badge-action-button",
|
|
195
|
+
onClick: f,
|
|
196
|
+
"aria-label": o,
|
|
197
|
+
children: $t[r]
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
Ae.displayName = "Badge";
|
|
206
|
+
const Oe = (e, t) => {
|
|
207
|
+
const a = W(t, [t]);
|
|
208
|
+
q(() => {
|
|
209
|
+
const r = (l) => {
|
|
210
|
+
!e.current || typeof a != "function" || e.current.contains(l.target) || a(l);
|
|
211
|
+
};
|
|
212
|
+
return document.addEventListener("mousedown", r), document.addEventListener("touchstart", r), () => {
|
|
213
|
+
document.removeEventListener("mousedown", r), document.removeEventListener("touchstart", r);
|
|
214
|
+
};
|
|
215
|
+
}, [e, a]);
|
|
216
|
+
}, kt = y.forwardRef(
|
|
217
|
+
({
|
|
218
|
+
id: e,
|
|
219
|
+
children: t,
|
|
220
|
+
isOpen: a = !1,
|
|
221
|
+
onClose: r,
|
|
222
|
+
position: l = "right",
|
|
223
|
+
size: o = "medium",
|
|
224
|
+
padding: s = "micro",
|
|
225
|
+
bgColor: i,
|
|
226
|
+
bgColour: c,
|
|
227
|
+
isDismissible: f = !0,
|
|
228
|
+
showOverlay: u = !0,
|
|
229
|
+
blurOverlay: m = !1,
|
|
230
|
+
closeOnClickOutside: v = !0,
|
|
231
|
+
zIndex: k,
|
|
232
|
+
label: g,
|
|
233
|
+
description: A,
|
|
234
|
+
classNames: p = [],
|
|
235
|
+
...N
|
|
236
|
+
}, w) => {
|
|
237
|
+
const O = `${e}`, z = A ? `${O}-description` : void 0, b = J(null), D = w || b, x = [
|
|
238
|
+
"drawer",
|
|
239
|
+
l,
|
|
240
|
+
o,
|
|
241
|
+
...a ? ["open"] : [],
|
|
242
|
+
...u ? ["with-overlay"] : [],
|
|
243
|
+
...m ? ["blur-overlay"] : [],
|
|
244
|
+
...p
|
|
245
|
+
];
|
|
246
|
+
return q(() => {
|
|
247
|
+
const M = D.current, E = document.querySelector(`[data-drawer-overlay-for="${O}"]`);
|
|
248
|
+
return a ? (M == null || M.classList.add("open"), M == null || M.classList.remove("closing"), M == null || M.focus(), E && E.classList.add("visible"), document.body.style.overflow = "hidden") : M != null && M.classList.contains("open") && (M.classList.add("closing"), M.classList.remove("open"), E && E.classList.remove("visible"), document.body.style.overflow = ""), () => {
|
|
249
|
+
document.body.style.overflow = "";
|
|
250
|
+
};
|
|
251
|
+
}, [a, O, D]), q(() => {
|
|
252
|
+
const M = (E) => {
|
|
253
|
+
E.key === "Escape" && f && a && r && r();
|
|
254
|
+
};
|
|
255
|
+
return document.addEventListener("keydown", M), () => document.removeEventListener("keydown", M);
|
|
256
|
+
}, [f, a, r]), Oe(D, () => {
|
|
257
|
+
v && f && a && r && r();
|
|
258
|
+
}), /* @__PURE__ */ I(ve, { children: [
|
|
259
|
+
u && /* @__PURE__ */ n(
|
|
260
|
+
_,
|
|
261
|
+
{
|
|
262
|
+
className: `drawer-overlay ${m ? "blur" : ""} ${a ? "visible" : ""}`,
|
|
263
|
+
"data-drawer-overlay-for": e,
|
|
264
|
+
"aria-hidden": "true",
|
|
265
|
+
onClick: v && f && r ? r : void 0,
|
|
266
|
+
style: { zIndex: k ?? 9999 }
|
|
267
|
+
}
|
|
268
|
+
),
|
|
269
|
+
/* @__PURE__ */ I(
|
|
270
|
+
P,
|
|
271
|
+
{
|
|
272
|
+
as: "div",
|
|
273
|
+
id: O,
|
|
274
|
+
"data-drawer": !0,
|
|
275
|
+
ref: D,
|
|
276
|
+
classNames: x,
|
|
277
|
+
onAnimationEnd: (M) => {
|
|
278
|
+
(M.animationName.includes("slide-out") || M.animationName.includes("fade-out")) && M.currentTarget.classList.remove("closing");
|
|
279
|
+
},
|
|
280
|
+
role: "dialog",
|
|
281
|
+
"aria-modal": "true",
|
|
282
|
+
"aria-label": g || "Drawer",
|
|
283
|
+
"aria-describedby": z,
|
|
284
|
+
tabIndex: -1,
|
|
285
|
+
style: { zIndex: k ?? 1e4 },
|
|
286
|
+
...N,
|
|
287
|
+
children: [
|
|
288
|
+
f && r && /* @__PURE__ */ n(
|
|
289
|
+
"button",
|
|
290
|
+
{
|
|
291
|
+
className: "drawer-dismiss-button",
|
|
292
|
+
onClick: r,
|
|
293
|
+
"aria-label": "Close drawer",
|
|
294
|
+
tabIndex: 0,
|
|
295
|
+
children: "×"
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
/* @__PURE__ */ I(
|
|
299
|
+
_,
|
|
300
|
+
{
|
|
301
|
+
className: "drawer-content",
|
|
302
|
+
padding: s,
|
|
303
|
+
bgColor: i,
|
|
304
|
+
bgColour: c,
|
|
305
|
+
children: [
|
|
306
|
+
A && /* @__PURE__ */ n("div", { id: z, className: "sr-only", children: A }),
|
|
307
|
+
/* @__PURE__ */ n("div", { role: "document", children: t })
|
|
308
|
+
]
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
] });
|
|
315
|
+
}
|
|
316
|
+
);
|
|
317
|
+
kt.displayName = "Drawer";
|
|
318
|
+
const Be = y.forwardRef(
|
|
319
|
+
({ size: e = "medium", shape: t, kind: a, isLoading: r, label: l, ...o }, s) => {
|
|
320
|
+
let i = [];
|
|
321
|
+
return a && i.push(a), e && i.push(`size-${e}`), t && i.push(`shape-${t}`), r && i.push("is-loading"), /* @__PURE__ */ n(
|
|
322
|
+
P,
|
|
323
|
+
{
|
|
324
|
+
as: "button",
|
|
325
|
+
"data-button": !0,
|
|
326
|
+
ref: s,
|
|
327
|
+
classNames: i,
|
|
328
|
+
"aria-label": l,
|
|
329
|
+
"aria-disabled": o.disabled || r,
|
|
330
|
+
"aria-busy": r,
|
|
331
|
+
...o
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
Be.displayName = "Button";
|
|
337
|
+
const xt = y.forwardRef(
|
|
338
|
+
({ isJoint: e = !0, spacing: t, equaliseWidth: a, children: r, ...l }, o) => {
|
|
339
|
+
let s = [];
|
|
340
|
+
return e && s.push("is-joint"), t && !e && s.push(`spacing-${t}`), a && s.push("equal-width"), /* @__PURE__ */ n(
|
|
341
|
+
P,
|
|
342
|
+
{
|
|
343
|
+
as: "div",
|
|
344
|
+
"data-button-group": !0,
|
|
345
|
+
ref: o,
|
|
346
|
+
role: "group",
|
|
347
|
+
classNames: s,
|
|
348
|
+
...l,
|
|
349
|
+
children: r
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
xt.displayName = "ButtonGroup";
|
|
355
|
+
const Ge = y.forwardRef(
|
|
356
|
+
({ children: e, current: t, ...a }, r) => /* @__PURE__ */ n(
|
|
357
|
+
P,
|
|
358
|
+
{
|
|
359
|
+
as: "li",
|
|
360
|
+
"data-breadcrumb-item": !0,
|
|
361
|
+
ref: r,
|
|
362
|
+
...a,
|
|
363
|
+
"aria-current": t ? "page" : void 0,
|
|
364
|
+
className: t ? "current" : void 0,
|
|
365
|
+
role: "listitem",
|
|
366
|
+
children: /* @__PURE__ */ n("span", { className: "breadcrumb-content", children: e })
|
|
367
|
+
}
|
|
368
|
+
)
|
|
369
|
+
), Rt = ({ separator: e }) => /* @__PURE__ */ n(
|
|
370
|
+
Y,
|
|
371
|
+
{
|
|
372
|
+
className: "breadcrumb-separator",
|
|
373
|
+
"aria-hidden": "true",
|
|
374
|
+
role: "presentation",
|
|
375
|
+
margin: "none",
|
|
376
|
+
children: e
|
|
377
|
+
}
|
|
378
|
+
), Mt = y.forwardRef(
|
|
379
|
+
({ children: e, separator: t = "/", spacing: a = "micro", ...r }, l) => {
|
|
380
|
+
let o = [];
|
|
381
|
+
a && o.push(`spacing-${a}`);
|
|
382
|
+
const s = y.Children.toArray(e).filter(Boolean), i = s.reduce((c, f, u) => {
|
|
383
|
+
if (!y.isValidElement(f)) return c;
|
|
384
|
+
const m = u === s.length - 1;
|
|
385
|
+
let v;
|
|
386
|
+
return f.type === Ge ? v = y.cloneElement(f, {
|
|
387
|
+
...f.props,
|
|
388
|
+
current: m
|
|
389
|
+
}) : v = /* @__PURE__ */ n(Ge, { current: m, children: f }, `item-${u}`), c.push(v), m || c.push(
|
|
390
|
+
/* @__PURE__ */ n(Rt, { separator: t }, `sep-${u}`)
|
|
391
|
+
), c;
|
|
392
|
+
}, []);
|
|
393
|
+
return /* @__PURE__ */ n("nav", { "aria-label": "Breadcrumb", ref: l, ...r, children: /* @__PURE__ */ n(
|
|
394
|
+
P,
|
|
395
|
+
{
|
|
396
|
+
as: "ul",
|
|
397
|
+
"data-breadcrumbs-wrapper": !0,
|
|
398
|
+
role: "list",
|
|
399
|
+
classNames: o,
|
|
400
|
+
children: i
|
|
401
|
+
}
|
|
402
|
+
) });
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
Mt.displayName = "Breadcrumbs";
|
|
406
|
+
const Je = y.forwardRef(
|
|
407
|
+
({ kind: e, children: t, title: a, ...r }, l) => /* @__PURE__ */ n(
|
|
408
|
+
P,
|
|
409
|
+
{
|
|
410
|
+
as: "div",
|
|
411
|
+
"data-callout": !0,
|
|
412
|
+
ref: l,
|
|
413
|
+
className: e,
|
|
414
|
+
role: {
|
|
415
|
+
info: "status",
|
|
416
|
+
success: "status",
|
|
417
|
+
warning: "alert",
|
|
418
|
+
error: "alert"
|
|
419
|
+
}[e],
|
|
420
|
+
"aria-live": e === "error" || e === "warning" ? "assertive" : "polite",
|
|
421
|
+
"aria-label": a,
|
|
422
|
+
...r,
|
|
423
|
+
children: t
|
|
424
|
+
}
|
|
425
|
+
)
|
|
426
|
+
);
|
|
427
|
+
Je.displayName = "Callout";
|
|
428
|
+
const Ze = y.forwardRef(({ shape: e, heading: t, children: a, ...r }, l) => {
|
|
429
|
+
let o = [];
|
|
430
|
+
return e && o.push(`shape-${e}`), /* @__PURE__ */ n(
|
|
431
|
+
P,
|
|
432
|
+
{
|
|
433
|
+
as: "div",
|
|
434
|
+
"data-card": !0,
|
|
435
|
+
ref: l,
|
|
436
|
+
classNames: o,
|
|
437
|
+
role: "region",
|
|
438
|
+
"aria-label": t,
|
|
439
|
+
tabIndex: 0,
|
|
440
|
+
...r,
|
|
441
|
+
children: a
|
|
442
|
+
}
|
|
443
|
+
);
|
|
444
|
+
});
|
|
445
|
+
Ze.displayName = "Card";
|
|
446
|
+
const Et = y.forwardRef(({
|
|
447
|
+
children: e,
|
|
448
|
+
source: t,
|
|
449
|
+
language: a = "json",
|
|
450
|
+
showCopyButton: r,
|
|
451
|
+
showLineNumbers: l,
|
|
452
|
+
description: o,
|
|
453
|
+
withSyntaxHighlighting: s = !1,
|
|
454
|
+
makeEditable: i = !1,
|
|
455
|
+
onChange: c,
|
|
456
|
+
shadow: f,
|
|
457
|
+
...u
|
|
458
|
+
}, m) => {
|
|
459
|
+
const [v, k] = j(!1), [g, A] = j(null), [p, N] = j(s), [w, O] = j(null), z = J(null);
|
|
460
|
+
let b = typeof e == "string" ? e : y.Children.toArray(e).join("");
|
|
461
|
+
e || (b = typeof t == "object" ? JSON.stringify(t, null, 2) : t ?? ""), q(() => {
|
|
462
|
+
if (!s) return;
|
|
463
|
+
(async () => {
|
|
464
|
+
var F;
|
|
465
|
+
N(!0);
|
|
466
|
+
try {
|
|
467
|
+
const $ = (await import("prismjs")).default;
|
|
468
|
+
if (typeof window < "u" && !window.Prism && (window.Prism = $), a !== "plain" && !$.languages[a])
|
|
469
|
+
try {
|
|
470
|
+
await import(`prismjs/components/prism-${a}`);
|
|
471
|
+
} catch {
|
|
472
|
+
console.warn(`Language "${a}" not available, falling back to plain text`);
|
|
473
|
+
}
|
|
474
|
+
A($);
|
|
475
|
+
} catch (H) {
|
|
476
|
+
(H == null ? void 0 : H.code) === "ERR_MODULE_NOT_FOUND" || (F = H == null ? void 0 : H.message) != null && F.includes("Cannot find module") ? console.warn(
|
|
477
|
+
"PrismJS is not installed. To enable syntax highlighting, run: npm install prismjs"
|
|
478
|
+
) : console.warn(`Failed to load syntax highlighting for ${a}:`, H);
|
|
479
|
+
} finally {
|
|
480
|
+
N(!1);
|
|
481
|
+
}
|
|
482
|
+
})();
|
|
483
|
+
}, [s, a]);
|
|
484
|
+
const D = W(() => {
|
|
485
|
+
var h;
|
|
486
|
+
const R = window.getSelection();
|
|
487
|
+
if (!R || R.rangeCount === 0) return null;
|
|
488
|
+
const F = R.getRangeAt(0), H = F.startContainer;
|
|
489
|
+
let d = F.startOffset;
|
|
490
|
+
if (H && H !== w && w) {
|
|
491
|
+
const V = document.createTreeWalker(
|
|
492
|
+
w,
|
|
493
|
+
NodeFilter.SHOW_TEXT,
|
|
494
|
+
null
|
|
495
|
+
);
|
|
496
|
+
let T;
|
|
497
|
+
for (; (T = V.nextNode()) && T !== H; )
|
|
498
|
+
d += ((h = T.textContent) == null ? void 0 : h.length) || 0;
|
|
499
|
+
}
|
|
500
|
+
return d;
|
|
501
|
+
}, [w]), x = W((R) => {
|
|
502
|
+
var F;
|
|
503
|
+
if (!(!w || !s || !g))
|
|
504
|
+
try {
|
|
505
|
+
const H = i ? D() : null, $ = g.highlight(
|
|
506
|
+
R,
|
|
507
|
+
g.languages[a] || g.languages.plain,
|
|
508
|
+
a
|
|
509
|
+
);
|
|
510
|
+
if (w.innerHTML = $, i && H !== null) {
|
|
511
|
+
const d = window.getSelection(), h = document.createRange(), V = document.createTreeWalker(
|
|
512
|
+
w,
|
|
513
|
+
NodeFilter.SHOW_TEXT,
|
|
514
|
+
null
|
|
515
|
+
);
|
|
516
|
+
let T = 0, K;
|
|
517
|
+
for (; K = V.nextNode(); ) {
|
|
518
|
+
const Q = ((F = K.textContent) == null ? void 0 : F.length) || 0;
|
|
519
|
+
if (T + Q >= H) {
|
|
520
|
+
h.setStart(K, H - T), h.setEnd(K, H - T), d == null || d.removeAllRanges(), d == null || d.addRange(h);
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
T += Q;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
} catch (H) {
|
|
527
|
+
console.warn("Error highlighting code:", H), w && (w.textContent = R);
|
|
528
|
+
}
|
|
529
|
+
}, [a, s, i, g, D, w]), L = W((R) => {
|
|
530
|
+
if (!w) return;
|
|
531
|
+
const F = w.textContent || "";
|
|
532
|
+
c == null || c(F), requestAnimationFrame(() => {
|
|
533
|
+
x(F);
|
|
534
|
+
});
|
|
535
|
+
}, [x, c, w]);
|
|
536
|
+
q(() => {
|
|
537
|
+
const R = w;
|
|
538
|
+
if (!(!R || !i))
|
|
539
|
+
return R.addEventListener("input", L), () => {
|
|
540
|
+
R.removeEventListener("input", L);
|
|
541
|
+
};
|
|
542
|
+
}, [i, L, w]), q(() => {
|
|
543
|
+
!w || !g || x(b);
|
|
544
|
+
}, [x, b, g, w]);
|
|
545
|
+
const M = async () => {
|
|
546
|
+
try {
|
|
547
|
+
const R = w ? w.textContent || "" : b;
|
|
548
|
+
await navigator.clipboard.writeText(R), k(!0), setTimeout(() => k(!1), 3e3);
|
|
549
|
+
} catch (R) {
|
|
550
|
+
console.error("Could not copy text: ", R);
|
|
551
|
+
}
|
|
552
|
+
}, E = async (R) => {
|
|
553
|
+
(R.key === "Enter" || R.key === " ") && R.target === z.current && (R.preventDefault(), await M());
|
|
554
|
+
};
|
|
555
|
+
let S = [];
|
|
556
|
+
l && S.push("show-line-numbers");
|
|
557
|
+
const G = b.split(/\r\n|\r|\n/gm);
|
|
558
|
+
return /* @__PURE__ */ I(
|
|
559
|
+
P,
|
|
560
|
+
{
|
|
561
|
+
"data-code-block": !0,
|
|
562
|
+
as: "div",
|
|
563
|
+
classNames: S,
|
|
564
|
+
role: "region",
|
|
565
|
+
"aria-label": o || `Code block in ${a}`,
|
|
566
|
+
...u,
|
|
567
|
+
children: [
|
|
568
|
+
r ? v ? /* @__PURE__ */ n(
|
|
569
|
+
Ae,
|
|
570
|
+
{
|
|
571
|
+
className: "code-block-copied-badge",
|
|
572
|
+
size: "tiny",
|
|
573
|
+
shape: "rounded",
|
|
574
|
+
"aria-live": "polite",
|
|
575
|
+
children: "Copied!"
|
|
576
|
+
}
|
|
577
|
+
) : /* @__PURE__ */ n(
|
|
578
|
+
Be,
|
|
579
|
+
{
|
|
580
|
+
type: "button",
|
|
581
|
+
className: "code-block-copy-button",
|
|
582
|
+
size: "tiny",
|
|
583
|
+
shape: "rounded",
|
|
584
|
+
onClick: M,
|
|
585
|
+
onKeyDown: E,
|
|
586
|
+
"aria-label": "Copy code to clipboard",
|
|
587
|
+
children: "Copy"
|
|
588
|
+
}
|
|
589
|
+
) : null,
|
|
590
|
+
/* @__PURE__ */ I(
|
|
591
|
+
"pre",
|
|
592
|
+
{
|
|
593
|
+
ref: z,
|
|
594
|
+
className: `language-${a}${f ? ` shadow-${f}` : ""}`,
|
|
595
|
+
tabIndex: 0,
|
|
596
|
+
"aria-label": `Code in ${a}`,
|
|
597
|
+
children: [
|
|
598
|
+
l && Array.from(Array(G.length).keys()).map((R) => /* @__PURE__ */ n(
|
|
599
|
+
"span",
|
|
600
|
+
{
|
|
601
|
+
className: "line-numbers",
|
|
602
|
+
"aria-hidden": "true",
|
|
603
|
+
children: R + 1
|
|
604
|
+
},
|
|
605
|
+
R
|
|
606
|
+
)),
|
|
607
|
+
/* @__PURE__ */ n(
|
|
608
|
+
"code",
|
|
609
|
+
{
|
|
610
|
+
ref: O,
|
|
611
|
+
contentEditable: i,
|
|
612
|
+
suppressContentEditableWarning: !0,
|
|
613
|
+
spellCheck: "false",
|
|
614
|
+
className: `language-${a} ${p ? "is-loading" : ""}`,
|
|
615
|
+
children: b
|
|
616
|
+
}
|
|
617
|
+
)
|
|
618
|
+
]
|
|
619
|
+
}
|
|
620
|
+
)
|
|
621
|
+
]
|
|
622
|
+
}
|
|
623
|
+
);
|
|
624
|
+
});
|
|
625
|
+
Et.displayName = "CodeBlock";
|
|
626
|
+
const Qe = y.forwardRef(
|
|
627
|
+
({ kind: e, height: t, label: a, ...r }, l) => {
|
|
628
|
+
let o = [];
|
|
629
|
+
return e && o.push(e), /* @__PURE__ */ n(
|
|
630
|
+
P,
|
|
631
|
+
{
|
|
632
|
+
as: "hr",
|
|
633
|
+
"data-hrule": !0,
|
|
634
|
+
ref: l,
|
|
635
|
+
classNames: o,
|
|
636
|
+
role: "separator",
|
|
637
|
+
"aria-orientation": "horizontal",
|
|
638
|
+
"aria-label": a,
|
|
639
|
+
...r,
|
|
640
|
+
style: { height: t }
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
Qe.displayName = "Divider";
|
|
646
|
+
const ye = y.forwardRef(
|
|
647
|
+
({
|
|
648
|
+
label: e,
|
|
649
|
+
hideLabel: t,
|
|
650
|
+
htmlFor: a,
|
|
651
|
+
...r
|
|
652
|
+
}, l) => {
|
|
653
|
+
let o = [];
|
|
654
|
+
return t && o.push("visually-hidden"), /* @__PURE__ */ n(
|
|
655
|
+
P,
|
|
656
|
+
{
|
|
657
|
+
as: "label",
|
|
658
|
+
ref: l,
|
|
659
|
+
htmlFor: a,
|
|
660
|
+
classNames: o,
|
|
661
|
+
...r,
|
|
662
|
+
children: e
|
|
663
|
+
}
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
);
|
|
667
|
+
ye.displayName = "InputLabel";
|
|
668
|
+
const Y = y.forwardRef(
|
|
669
|
+
({ weight: e, size: t, fontStyle: a = "sans-serif", align: r, isSubtext: l, ...o }, s) => {
|
|
670
|
+
let i = [];
|
|
671
|
+
return e && i.push(`weight-${e}`), t && i.push(`text-${t}`), a && i.push(`font-${a}`), l && i.push("sub-text"), r && i.push(`text-${r}`), /* @__PURE__ */ n(P, { as: "p", ref: s, classNames: i, ...o });
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
Y.displayName = "Text";
|
|
675
|
+
const Dt = ({ state: e }) => e === "valid" ? /* @__PURE__ */ n(
|
|
676
|
+
"svg",
|
|
677
|
+
{
|
|
678
|
+
"data-validation-icon": "valid",
|
|
679
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
680
|
+
viewBox: "0 0 24 24",
|
|
681
|
+
width: "20",
|
|
682
|
+
height: "20",
|
|
683
|
+
children: /* @__PURE__ */ n(
|
|
684
|
+
"polyline",
|
|
685
|
+
{
|
|
686
|
+
points: "3.5 12.5 8.5 17.5 20.5 5.5",
|
|
687
|
+
fill: "none",
|
|
688
|
+
stroke: "#0ec05c",
|
|
689
|
+
strokeMiterlimit: "10",
|
|
690
|
+
strokeWidth: "2"
|
|
691
|
+
}
|
|
692
|
+
)
|
|
693
|
+
}
|
|
694
|
+
) : /* @__PURE__ */ I(
|
|
695
|
+
"svg",
|
|
696
|
+
{
|
|
697
|
+
"data-validation-icon": "invalid",
|
|
698
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
699
|
+
viewBox: "0 0 24 24",
|
|
700
|
+
width: "20",
|
|
701
|
+
height: "20",
|
|
702
|
+
children: [
|
|
703
|
+
/* @__PURE__ */ n(
|
|
704
|
+
"line",
|
|
705
|
+
{
|
|
706
|
+
x1: "6.5",
|
|
707
|
+
y1: "17.5",
|
|
708
|
+
x2: "18.5",
|
|
709
|
+
y2: "5.5",
|
|
710
|
+
fill: "none",
|
|
711
|
+
stroke: "#ef4343",
|
|
712
|
+
strokeMiterlimit: "10",
|
|
713
|
+
strokeWidth: "2"
|
|
714
|
+
}
|
|
715
|
+
),
|
|
716
|
+
/* @__PURE__ */ n(
|
|
717
|
+
"line",
|
|
718
|
+
{
|
|
719
|
+
x1: "6.5",
|
|
720
|
+
y1: "5.5",
|
|
721
|
+
x2: "18.5",
|
|
722
|
+
y2: "17.5",
|
|
723
|
+
fill: "none",
|
|
724
|
+
stroke: "#ef4343",
|
|
725
|
+
strokeMiterlimit: "10",
|
|
726
|
+
strokeWidth: "2"
|
|
727
|
+
}
|
|
728
|
+
)
|
|
729
|
+
]
|
|
730
|
+
}
|
|
731
|
+
), ee = y.forwardRef(
|
|
732
|
+
({
|
|
733
|
+
label: e,
|
|
734
|
+
customLabel: t,
|
|
735
|
+
htmlFor: a,
|
|
736
|
+
helpText: r,
|
|
737
|
+
errorText: l,
|
|
738
|
+
validationState: o,
|
|
739
|
+
required: s,
|
|
740
|
+
size: i,
|
|
741
|
+
children: c,
|
|
742
|
+
...f
|
|
743
|
+
}, u) => {
|
|
744
|
+
const m = e || t, v = r || l;
|
|
745
|
+
return /* @__PURE__ */ I(
|
|
746
|
+
P,
|
|
747
|
+
{
|
|
748
|
+
as: "div",
|
|
749
|
+
"data-form-item": !0,
|
|
750
|
+
ref: u,
|
|
751
|
+
role: "group",
|
|
752
|
+
required: s,
|
|
753
|
+
className: i ? `size-${i}` : void 0,
|
|
754
|
+
...f,
|
|
755
|
+
children: [
|
|
756
|
+
m && /* @__PURE__ */ I(_, { "data-label-wrapper": !0, "data-has-validation": o ? "true" : void 0, children: [
|
|
757
|
+
t || e && /* @__PURE__ */ n(ye, { label: e, htmlFor: a }),
|
|
758
|
+
o && /* @__PURE__ */ n(Dt, { state: o })
|
|
759
|
+
] }),
|
|
760
|
+
/* @__PURE__ */ n(_, { "data-input-wrapper": !0, children: c }),
|
|
761
|
+
v && /* @__PURE__ */ I(_, { className: "info-section vertically-center-items", children: [
|
|
762
|
+
r && /* @__PURE__ */ n(Y, { className: "help-text", children: r }),
|
|
763
|
+
l && /* @__PURE__ */ n(Y, { className: "error-text", children: l })
|
|
764
|
+
] })
|
|
765
|
+
]
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
);
|
|
770
|
+
ee.displayName = "FormItem";
|
|
771
|
+
const Fe = y.forwardRef(
|
|
772
|
+
({
|
|
773
|
+
id: e,
|
|
774
|
+
name: t,
|
|
775
|
+
label: a,
|
|
776
|
+
hideLabel: r,
|
|
777
|
+
helpText: l,
|
|
778
|
+
errorText: o,
|
|
779
|
+
onChange: s,
|
|
780
|
+
checked: i,
|
|
781
|
+
defaultChecked: c,
|
|
782
|
+
disabled: f,
|
|
783
|
+
required: u,
|
|
784
|
+
size: m = "medium",
|
|
785
|
+
...v
|
|
786
|
+
}, k) => {
|
|
787
|
+
const g = fe(() => t || e, [t, e]);
|
|
788
|
+
return /* @__PURE__ */ I(
|
|
789
|
+
ee,
|
|
790
|
+
{
|
|
791
|
+
label: a,
|
|
792
|
+
htmlFor: e,
|
|
793
|
+
helpText: l,
|
|
794
|
+
errorText: o,
|
|
795
|
+
required: u,
|
|
796
|
+
size: m,
|
|
797
|
+
children: [
|
|
798
|
+
/* @__PURE__ */ n(
|
|
799
|
+
P,
|
|
800
|
+
{
|
|
801
|
+
as: "input",
|
|
802
|
+
type: "checkbox",
|
|
803
|
+
ref: k,
|
|
804
|
+
id: e,
|
|
805
|
+
name: g,
|
|
806
|
+
checked: i,
|
|
807
|
+
defaultChecked: c,
|
|
808
|
+
disabled: f,
|
|
809
|
+
required: u,
|
|
810
|
+
onChange: (p) => {
|
|
811
|
+
s == null || s(p.target.checked);
|
|
812
|
+
},
|
|
813
|
+
...v
|
|
814
|
+
}
|
|
815
|
+
),
|
|
816
|
+
/* @__PURE__ */ n(
|
|
817
|
+
P,
|
|
818
|
+
{
|
|
819
|
+
as: "div",
|
|
820
|
+
"data-checkbox": !0,
|
|
821
|
+
className: `size-${m}`
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
]
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
);
|
|
829
|
+
Fe.displayName = "Checkbox";
|
|
830
|
+
const Ve = y.forwardRef(
|
|
831
|
+
({
|
|
832
|
+
id: e,
|
|
833
|
+
name: t,
|
|
834
|
+
label: a,
|
|
835
|
+
hideLabel: r,
|
|
836
|
+
helpText: l,
|
|
837
|
+
errorText: o,
|
|
838
|
+
onChange: s,
|
|
839
|
+
checked: i,
|
|
840
|
+
defaultChecked: c,
|
|
841
|
+
disabled: f,
|
|
842
|
+
required: u,
|
|
843
|
+
size: m = "medium",
|
|
844
|
+
...v
|
|
845
|
+
}, k) => {
|
|
846
|
+
const g = fe(() => t || e, [t, e]);
|
|
847
|
+
return /* @__PURE__ */ I(
|
|
848
|
+
ee,
|
|
849
|
+
{
|
|
850
|
+
label: a,
|
|
851
|
+
htmlFor: e,
|
|
852
|
+
helpText: l,
|
|
853
|
+
errorText: o,
|
|
854
|
+
required: u,
|
|
855
|
+
size: m,
|
|
856
|
+
children: [
|
|
857
|
+
/* @__PURE__ */ n(
|
|
858
|
+
P,
|
|
859
|
+
{
|
|
860
|
+
as: "input",
|
|
861
|
+
type: "checkbox",
|
|
862
|
+
ref: k,
|
|
863
|
+
id: e,
|
|
864
|
+
name: g,
|
|
865
|
+
checked: i,
|
|
866
|
+
defaultChecked: c,
|
|
867
|
+
disabled: f,
|
|
868
|
+
required: u,
|
|
869
|
+
onChange: (p) => {
|
|
870
|
+
s == null || s(p.target.checked);
|
|
871
|
+
},
|
|
872
|
+
...v
|
|
873
|
+
}
|
|
874
|
+
),
|
|
875
|
+
/* @__PURE__ */ n(
|
|
876
|
+
P,
|
|
877
|
+
{
|
|
878
|
+
as: "div",
|
|
879
|
+
"data-switch": !0,
|
|
880
|
+
className: `size-${m}`
|
|
881
|
+
}
|
|
882
|
+
)
|
|
883
|
+
]
|
|
884
|
+
}
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
);
|
|
888
|
+
Ve.displayName = "Switch";
|
|
889
|
+
const It = y.forwardRef(
|
|
890
|
+
({
|
|
891
|
+
id: e,
|
|
892
|
+
name: t,
|
|
893
|
+
label: a,
|
|
894
|
+
helpText: r,
|
|
895
|
+
errorText: l,
|
|
896
|
+
options: o,
|
|
897
|
+
value: s,
|
|
898
|
+
defaultValue: i,
|
|
899
|
+
onChange: c,
|
|
900
|
+
align: f,
|
|
901
|
+
equaliseWidth: u,
|
|
902
|
+
equalizeWidth: m,
|
|
903
|
+
required: v,
|
|
904
|
+
disabled: k,
|
|
905
|
+
size: g,
|
|
906
|
+
...A
|
|
907
|
+
}, p) => {
|
|
908
|
+
const N = fe(() => t || e, [t, e]), [w, O] = y.useState(
|
|
909
|
+
s || i || []
|
|
910
|
+
);
|
|
911
|
+
y.useEffect(() => {
|
|
912
|
+
s !== void 0 && O(s);
|
|
913
|
+
}, [s]);
|
|
914
|
+
const z = (D, x) => {
|
|
915
|
+
let L;
|
|
916
|
+
x ? L = [...w, D] : L = w.filter((M) => M !== D), s === void 0 && O(L), c == null || c(L);
|
|
917
|
+
};
|
|
918
|
+
let b = [];
|
|
919
|
+
return f && b.push(`align-${f}`), (u || m) && b.push("equalise-width"), /* @__PURE__ */ n(
|
|
920
|
+
ee,
|
|
921
|
+
{
|
|
922
|
+
label: a,
|
|
923
|
+
htmlFor: e,
|
|
924
|
+
helpText: r,
|
|
925
|
+
errorText: l,
|
|
926
|
+
required: v,
|
|
927
|
+
children: /* @__PURE__ */ n(
|
|
928
|
+
P,
|
|
929
|
+
{
|
|
930
|
+
as: "div",
|
|
931
|
+
"data-checkbox-group": !0,
|
|
932
|
+
ref: p,
|
|
933
|
+
classNames: b,
|
|
934
|
+
role: "group",
|
|
935
|
+
"aria-label": a,
|
|
936
|
+
...A,
|
|
937
|
+
children: o.map((D, x) => {
|
|
938
|
+
const { id: L, value: M, label: E, ...S } = D, G = L || `${e}-option-${x}`, R = w.includes(M);
|
|
939
|
+
return /* @__PURE__ */ n(
|
|
940
|
+
Fe,
|
|
941
|
+
{
|
|
942
|
+
id: G,
|
|
943
|
+
name: N,
|
|
944
|
+
label: E,
|
|
945
|
+
checked: R,
|
|
946
|
+
disabled: k || D.disabled,
|
|
947
|
+
size: g,
|
|
948
|
+
onChange: (F) => z(M, F),
|
|
949
|
+
...S
|
|
950
|
+
},
|
|
951
|
+
G
|
|
952
|
+
);
|
|
953
|
+
})
|
|
954
|
+
}
|
|
955
|
+
)
|
|
956
|
+
}
|
|
957
|
+
);
|
|
958
|
+
}
|
|
959
|
+
);
|
|
960
|
+
It.displayName = "CheckboxGroup";
|
|
961
|
+
const At = y.forwardRef(
|
|
962
|
+
({
|
|
963
|
+
id: e,
|
|
964
|
+
name: t,
|
|
965
|
+
label: a,
|
|
966
|
+
helpText: r,
|
|
967
|
+
errorText: l,
|
|
968
|
+
options: o,
|
|
969
|
+
value: s,
|
|
970
|
+
defaultValue: i,
|
|
971
|
+
onChange: c,
|
|
972
|
+
align: f,
|
|
973
|
+
equaliseWidth: u,
|
|
974
|
+
equalizeWidth: m,
|
|
975
|
+
required: v,
|
|
976
|
+
disabled: k,
|
|
977
|
+
size: g,
|
|
978
|
+
...A
|
|
979
|
+
}, p) => {
|
|
980
|
+
const N = fe(() => t || e, [t, e]), [w, O] = y.useState(
|
|
981
|
+
s || i || []
|
|
982
|
+
);
|
|
983
|
+
y.useEffect(() => {
|
|
984
|
+
s !== void 0 && O(s);
|
|
985
|
+
}, [s]);
|
|
986
|
+
const z = (D, x) => {
|
|
987
|
+
let L;
|
|
988
|
+
x ? L = [...w, D] : L = w.filter((M) => M !== D), s === void 0 && O(L), c == null || c(L);
|
|
989
|
+
};
|
|
990
|
+
let b = [];
|
|
991
|
+
return f && b.push(`align-${f}`), (u || m) && b.push("equalise-width"), /* @__PURE__ */ n(
|
|
992
|
+
ee,
|
|
993
|
+
{
|
|
994
|
+
label: a,
|
|
995
|
+
htmlFor: e,
|
|
996
|
+
helpText: r,
|
|
997
|
+
errorText: l,
|
|
998
|
+
required: v,
|
|
999
|
+
children: /* @__PURE__ */ n(
|
|
1000
|
+
P,
|
|
1001
|
+
{
|
|
1002
|
+
as: "div",
|
|
1003
|
+
"data-switch-group": !0,
|
|
1004
|
+
ref: p,
|
|
1005
|
+
classNames: b,
|
|
1006
|
+
role: "group",
|
|
1007
|
+
"aria-label": a,
|
|
1008
|
+
...A,
|
|
1009
|
+
children: o.map((D, x) => {
|
|
1010
|
+
const { id: L, value: M, label: E, ...S } = D, G = L || `${e}-option-${x}`, R = w.includes(M);
|
|
1011
|
+
return /* @__PURE__ */ n(
|
|
1012
|
+
Ve,
|
|
1013
|
+
{
|
|
1014
|
+
id: G,
|
|
1015
|
+
name: N,
|
|
1016
|
+
label: E,
|
|
1017
|
+
checked: R,
|
|
1018
|
+
disabled: k || D.disabled,
|
|
1019
|
+
size: g,
|
|
1020
|
+
onChange: (F) => z(M, F),
|
|
1021
|
+
...S
|
|
1022
|
+
},
|
|
1023
|
+
G
|
|
1024
|
+
);
|
|
1025
|
+
})
|
|
1026
|
+
}
|
|
1027
|
+
)
|
|
1028
|
+
}
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1031
|
+
);
|
|
1032
|
+
At.displayName = "SwitchGroup";
|
|
1033
|
+
const et = y.forwardRef(
|
|
1034
|
+
({
|
|
1035
|
+
"aria-label": e,
|
|
1036
|
+
"aria-invalid": t,
|
|
1037
|
+
label: a,
|
|
1038
|
+
helpText: r,
|
|
1039
|
+
errorText: l,
|
|
1040
|
+
required: o,
|
|
1041
|
+
accept: s,
|
|
1042
|
+
allowMultipleFiles: i = !1,
|
|
1043
|
+
capture: c,
|
|
1044
|
+
height: f = "120px",
|
|
1045
|
+
onChange: u,
|
|
1046
|
+
className: m = "",
|
|
1047
|
+
instructionMainText: v = "Drag and drop or click to upload",
|
|
1048
|
+
instructionSubText: k = "You can add multiple files",
|
|
1049
|
+
invalid: g,
|
|
1050
|
+
id: A,
|
|
1051
|
+
name: p,
|
|
1052
|
+
badgeBgColour: N,
|
|
1053
|
+
badgeTextColour: w,
|
|
1054
|
+
...O
|
|
1055
|
+
}, z) => {
|
|
1056
|
+
const [b, D] = j([]), [x, L] = j(!1), M = J(null), E = (d) => {
|
|
1057
|
+
d.preventDefault(), d.stopPropagation(), L(!0);
|
|
1058
|
+
}, S = (d) => {
|
|
1059
|
+
d.preventDefault(), d.stopPropagation(), L(!1);
|
|
1060
|
+
}, G = (d) => {
|
|
1061
|
+
d.preventDefault(), d.stopPropagation(), L(!1);
|
|
1062
|
+
const h = Array.from(d.dataTransfer.files);
|
|
1063
|
+
R(h);
|
|
1064
|
+
}, R = (d) => {
|
|
1065
|
+
if (i)
|
|
1066
|
+
D((h) => [...h, ...d]), u == null || u([...b, ...d]);
|
|
1067
|
+
else {
|
|
1068
|
+
const h = d[0];
|
|
1069
|
+
D([h]), u == null || u([h]);
|
|
1070
|
+
}
|
|
1071
|
+
}, F = (d) => {
|
|
1072
|
+
if (d.target.files) {
|
|
1073
|
+
const h = Array.from(d.target.files);
|
|
1074
|
+
R(h);
|
|
1075
|
+
}
|
|
1076
|
+
}, H = (d) => {
|
|
1077
|
+
const h = b.filter((V, T) => T !== d);
|
|
1078
|
+
D(h), u == null || u(h);
|
|
1079
|
+
}, $ = () => {
|
|
1080
|
+
var d;
|
|
1081
|
+
(d = M.current) == null || d.click();
|
|
1082
|
+
};
|
|
1083
|
+
return /* @__PURE__ */ n(
|
|
1084
|
+
ee,
|
|
1085
|
+
{
|
|
1086
|
+
label: a,
|
|
1087
|
+
htmlFor: A,
|
|
1088
|
+
helpText: r,
|
|
1089
|
+
errorText: l,
|
|
1090
|
+
required: o,
|
|
1091
|
+
children: /* @__PURE__ */ I(
|
|
1092
|
+
_,
|
|
1093
|
+
{
|
|
1094
|
+
"data-file-upload-area": !0,
|
|
1095
|
+
ref: z,
|
|
1096
|
+
className: [
|
|
1097
|
+
"file-upload-wrapper",
|
|
1098
|
+
x ? "dragging" : "",
|
|
1099
|
+
m
|
|
1100
|
+
].filter(Boolean).join(" "),
|
|
1101
|
+
"aria-label": e || a,
|
|
1102
|
+
"aria-invalid": t || g || void 0,
|
|
1103
|
+
"aria-required": o,
|
|
1104
|
+
children: [
|
|
1105
|
+
/* @__PURE__ */ I(
|
|
1106
|
+
_,
|
|
1107
|
+
{
|
|
1108
|
+
className: "file-upload-area",
|
|
1109
|
+
onDragOver: E,
|
|
1110
|
+
onDragLeave: S,
|
|
1111
|
+
onDrop: G,
|
|
1112
|
+
onClick: $,
|
|
1113
|
+
style: { height: f },
|
|
1114
|
+
children: [
|
|
1115
|
+
/* @__PURE__ */ n(
|
|
1116
|
+
"input",
|
|
1117
|
+
{
|
|
1118
|
+
ref: M,
|
|
1119
|
+
type: "file",
|
|
1120
|
+
id: A,
|
|
1121
|
+
name: p,
|
|
1122
|
+
onChange: F,
|
|
1123
|
+
multiple: i,
|
|
1124
|
+
accept: s,
|
|
1125
|
+
capture: c,
|
|
1126
|
+
className: "file-input"
|
|
1127
|
+
}
|
|
1128
|
+
),
|
|
1129
|
+
v && /* @__PURE__ */ I(_, { className: "file-upload-content", children: [
|
|
1130
|
+
/* @__PURE__ */ n(Y, { children: v }),
|
|
1131
|
+
k && /* @__PURE__ */ n(Y, { isSubtext: !0, children: k })
|
|
1132
|
+
] })
|
|
1133
|
+
]
|
|
1134
|
+
}
|
|
1135
|
+
),
|
|
1136
|
+
b.length > 0 && /* @__PURE__ */ n(_, { className: "uploaded-files", children: b.map((d, h) => /* @__PURE__ */ n(
|
|
1137
|
+
Ae,
|
|
1138
|
+
{
|
|
1139
|
+
size: "small",
|
|
1140
|
+
shape: "rounded",
|
|
1141
|
+
actionIcon: "cross",
|
|
1142
|
+
onActionClick: () => H(h),
|
|
1143
|
+
actionAriaLabel: `Remove ${d.name}`,
|
|
1144
|
+
bgColour: N,
|
|
1145
|
+
textColour: w,
|
|
1146
|
+
children: d.name
|
|
1147
|
+
},
|
|
1148
|
+
`${d.name}-${h}`
|
|
1149
|
+
)) })
|
|
1150
|
+
]
|
|
1151
|
+
}
|
|
1152
|
+
)
|
|
1153
|
+
}
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
);
|
|
1157
|
+
et.displayName = "FileUpload";
|
|
1158
|
+
const be = y.forwardRef(
|
|
1159
|
+
({
|
|
1160
|
+
// FormItem props
|
|
1161
|
+
label: e,
|
|
1162
|
+
hideLabel: t,
|
|
1163
|
+
helpText: a,
|
|
1164
|
+
errorText: r,
|
|
1165
|
+
size: l,
|
|
1166
|
+
required: o,
|
|
1167
|
+
// Side elements
|
|
1168
|
+
innerIconLeft: s,
|
|
1169
|
+
innerIconRight: i,
|
|
1170
|
+
innerTextLeft: c,
|
|
1171
|
+
innerTextRight: f,
|
|
1172
|
+
// Validation
|
|
1173
|
+
validateThis: u,
|
|
1174
|
+
valid: m,
|
|
1175
|
+
invalid: v,
|
|
1176
|
+
validationState: k,
|
|
1177
|
+
// Handlers
|
|
1178
|
+
onChange: g,
|
|
1179
|
+
onBlur: A,
|
|
1180
|
+
onFocus: p,
|
|
1181
|
+
// Aria
|
|
1182
|
+
"aria-label": N,
|
|
1183
|
+
"aria-invalid": w,
|
|
1184
|
+
// Input props
|
|
1185
|
+
id: O,
|
|
1186
|
+
name: z,
|
|
1187
|
+
value: b,
|
|
1188
|
+
defaultValue: D,
|
|
1189
|
+
type: x = "text",
|
|
1190
|
+
placeholder: L,
|
|
1191
|
+
autoComplete: M,
|
|
1192
|
+
maxLength: E,
|
|
1193
|
+
minLength: S,
|
|
1194
|
+
pattern: G,
|
|
1195
|
+
readOnly: R,
|
|
1196
|
+
disabled: F,
|
|
1197
|
+
className: H,
|
|
1198
|
+
...$
|
|
1199
|
+
}, d) => {
|
|
1200
|
+
const h = J(null), V = J(null), T = J(null), [K, Q] = j(!1), [te, B] = j(null), X = k ?? (u ? te : null), C = y.useCallback(
|
|
1201
|
+
(U) => {
|
|
1202
|
+
T.current = U, typeof d == "function" ? d(U) : d && (d.current = U);
|
|
1203
|
+
},
|
|
1204
|
+
[d]
|
|
1205
|
+
), Z = () => {
|
|
1206
|
+
const U = T.current;
|
|
1207
|
+
if (!U || U.value === "") {
|
|
1208
|
+
B(null);
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
B(U.validity.valid ? "valid" : "invalid");
|
|
1212
|
+
}, Se = (U) => {
|
|
1213
|
+
g == null || g(U.target.value), K && u && Z();
|
|
1214
|
+
}, we = (U) => {
|
|
1215
|
+
Q(!0), u && Z(), A == null || A(U);
|
|
1216
|
+
}, ge = (U) => {
|
|
1217
|
+
p == null || p(U);
|
|
1218
|
+
};
|
|
1219
|
+
q(() => {
|
|
1220
|
+
const U = (ce, pe) => {
|
|
1221
|
+
if (!ce) return;
|
|
1222
|
+
const oe = ce.closest("[data-form-item]");
|
|
1223
|
+
oe == null || oe.style.setProperty(
|
|
1224
|
+
`--side-element-${pe}-width`,
|
|
1225
|
+
`${ce.getBoundingClientRect().width}px`
|
|
1226
|
+
);
|
|
1227
|
+
};
|
|
1228
|
+
(c || s) && U(h.current, "left"), (f || i) && U(V.current, "right");
|
|
1229
|
+
}, [c, f, s, i]);
|
|
1230
|
+
const Ne = (U, ce, pe) => {
|
|
1231
|
+
if (!U) return null;
|
|
1232
|
+
const oe = typeof U == "string", xe = !oe && y.isValidElement(U) && (U.props.onClick || U.props.onKeyDown || U.type === "button" || U.type === "a");
|
|
1233
|
+
return /* @__PURE__ */ n(
|
|
1234
|
+
_,
|
|
1235
|
+
{
|
|
1236
|
+
ref: pe,
|
|
1237
|
+
"data-input-side-element": !0,
|
|
1238
|
+
className: `${ce} ${oe ? "is-text" : "is-icon"} ${xe ? "is-interactive" : ""}`,
|
|
1239
|
+
"aria-hidden": "true",
|
|
1240
|
+
children: U
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
}, $e = !!(s || c), ke = !!(i || f);
|
|
1244
|
+
return /* @__PURE__ */ I(
|
|
1245
|
+
ee,
|
|
1246
|
+
{
|
|
1247
|
+
label: e,
|
|
1248
|
+
htmlFor: O,
|
|
1249
|
+
helpText: a,
|
|
1250
|
+
errorText: r,
|
|
1251
|
+
validationState: X,
|
|
1252
|
+
required: o,
|
|
1253
|
+
size: l,
|
|
1254
|
+
children: [
|
|
1255
|
+
/* @__PURE__ */ n(
|
|
1256
|
+
P,
|
|
1257
|
+
{
|
|
1258
|
+
as: "input",
|
|
1259
|
+
ref: C,
|
|
1260
|
+
"data-input-field": !0,
|
|
1261
|
+
id: O,
|
|
1262
|
+
name: z,
|
|
1263
|
+
type: x,
|
|
1264
|
+
value: b,
|
|
1265
|
+
defaultValue: D,
|
|
1266
|
+
placeholder: L || " ",
|
|
1267
|
+
autoComplete: M,
|
|
1268
|
+
maxLength: E,
|
|
1269
|
+
minLength: S,
|
|
1270
|
+
pattern: G,
|
|
1271
|
+
readOnly: R,
|
|
1272
|
+
disabled: F,
|
|
1273
|
+
required: o,
|
|
1274
|
+
className: [
|
|
1275
|
+
H,
|
|
1276
|
+
$e && "with-left-element",
|
|
1277
|
+
ke && "with-right-element"
|
|
1278
|
+
].filter(Boolean).join(" "),
|
|
1279
|
+
"aria-label": N || e,
|
|
1280
|
+
"aria-invalid": w || v,
|
|
1281
|
+
"aria-required": o,
|
|
1282
|
+
onChange: Se,
|
|
1283
|
+
onBlur: we,
|
|
1284
|
+
onFocus: ge,
|
|
1285
|
+
...$
|
|
1286
|
+
}
|
|
1287
|
+
),
|
|
1288
|
+
($e || ke) && /* @__PURE__ */ I(_, { "data-input-helper": !0, "aria-hidden": "true", children: [
|
|
1289
|
+
Ne(s || c, "left", h),
|
|
1290
|
+
Ne(i || f, "right", V)
|
|
1291
|
+
] })
|
|
1292
|
+
]
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1295
|
+
}
|
|
1296
|
+
);
|
|
1297
|
+
be.displayName = "InputField";
|
|
1298
|
+
const tt = y.forwardRef(
|
|
1299
|
+
({
|
|
1300
|
+
desktopSpan: e,
|
|
1301
|
+
mobileSpan: t,
|
|
1302
|
+
tabletLandscapeSpan: a,
|
|
1303
|
+
tabletPortraitSpan: r,
|
|
1304
|
+
isHorizontal: l,
|
|
1305
|
+
role: o,
|
|
1306
|
+
...s
|
|
1307
|
+
}, i) => {
|
|
1308
|
+
let c = [];
|
|
1309
|
+
return e || a || r || t ? (e && c.push(`${e}`), a && c.push(`${a}-on-tablet-landscape`), r && c.push(`${r}-on-tablet-portrait`), t && c.push(`${t}-on-mobile`)) : c.push("whole"), l && c.push("horizontal"), /* @__PURE__ */ n(
|
|
1310
|
+
P,
|
|
1311
|
+
{
|
|
1312
|
+
as: "div",
|
|
1313
|
+
"data-portion": !0,
|
|
1314
|
+
ref: i,
|
|
1315
|
+
classNames: c,
|
|
1316
|
+
role: o,
|
|
1317
|
+
...s
|
|
1318
|
+
}
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
);
|
|
1322
|
+
tt.displayName = "Portion";
|
|
1323
|
+
const at = y.forwardRef(
|
|
1324
|
+
({
|
|
1325
|
+
id: e,
|
|
1326
|
+
name: t,
|
|
1327
|
+
value: a,
|
|
1328
|
+
label: r,
|
|
1329
|
+
helpText: l,
|
|
1330
|
+
errorText: o,
|
|
1331
|
+
onChange: s,
|
|
1332
|
+
checked: i,
|
|
1333
|
+
disabled: c,
|
|
1334
|
+
required: f,
|
|
1335
|
+
...u
|
|
1336
|
+
}, m) => {
|
|
1337
|
+
const v = fe(() => t || e, [t, e]);
|
|
1338
|
+
return /* @__PURE__ */ n(
|
|
1339
|
+
P,
|
|
1340
|
+
{
|
|
1341
|
+
as: "div",
|
|
1342
|
+
"data-radio-button": !0,
|
|
1343
|
+
ref: m,
|
|
1344
|
+
role: "radio",
|
|
1345
|
+
"aria-checked": i,
|
|
1346
|
+
"aria-disabled": c,
|
|
1347
|
+
children: /* @__PURE__ */ n(
|
|
1348
|
+
ee,
|
|
1349
|
+
{
|
|
1350
|
+
label: r,
|
|
1351
|
+
htmlFor: e,
|
|
1352
|
+
helpText: l,
|
|
1353
|
+
errorText: o,
|
|
1354
|
+
required: f,
|
|
1355
|
+
children: /* @__PURE__ */ n(
|
|
1356
|
+
P,
|
|
1357
|
+
{
|
|
1358
|
+
as: "input",
|
|
1359
|
+
type: "radio",
|
|
1360
|
+
id: e,
|
|
1361
|
+
name: v,
|
|
1362
|
+
value: a,
|
|
1363
|
+
checked: i,
|
|
1364
|
+
disabled: c,
|
|
1365
|
+
required: f,
|
|
1366
|
+
onChange: (g) => {
|
|
1367
|
+
g.target.checked && s && s(a);
|
|
1368
|
+
},
|
|
1369
|
+
...u
|
|
1370
|
+
}
|
|
1371
|
+
)
|
|
1372
|
+
}
|
|
1373
|
+
)
|
|
1374
|
+
}
|
|
1375
|
+
);
|
|
1376
|
+
}
|
|
1377
|
+
);
|
|
1378
|
+
at.displayName = "RadioButton";
|
|
1379
|
+
const rt = y.forwardRef(
|
|
1380
|
+
({
|
|
1381
|
+
id: e,
|
|
1382
|
+
name: t,
|
|
1383
|
+
label: a,
|
|
1384
|
+
helpText: r,
|
|
1385
|
+
errorText: l,
|
|
1386
|
+
options: o,
|
|
1387
|
+
value: s,
|
|
1388
|
+
defaultValue: i,
|
|
1389
|
+
onChange: c,
|
|
1390
|
+
align: f,
|
|
1391
|
+
equaliseWidth: u,
|
|
1392
|
+
equalizeWidth: m,
|
|
1393
|
+
required: v,
|
|
1394
|
+
disabled: k,
|
|
1395
|
+
...g
|
|
1396
|
+
}, A) => {
|
|
1397
|
+
const p = fe(() => t || e, [t, e]), N = (O) => {
|
|
1398
|
+
c == null || c(O.target.value);
|
|
1399
|
+
};
|
|
1400
|
+
let w = [];
|
|
1401
|
+
return f && w.push(`align-${f}`), (u || m) && w.push("equalise-width"), /* @__PURE__ */ n(
|
|
1402
|
+
ee,
|
|
1403
|
+
{
|
|
1404
|
+
label: a,
|
|
1405
|
+
htmlFor: e,
|
|
1406
|
+
helpText: r,
|
|
1407
|
+
errorText: l,
|
|
1408
|
+
required: v,
|
|
1409
|
+
children: /* @__PURE__ */ n(
|
|
1410
|
+
P,
|
|
1411
|
+
{
|
|
1412
|
+
as: "div",
|
|
1413
|
+
"data-radio-group": !0,
|
|
1414
|
+
ref: A,
|
|
1415
|
+
classNames: w,
|
|
1416
|
+
role: "radiogroup",
|
|
1417
|
+
"aria-label": a,
|
|
1418
|
+
...g,
|
|
1419
|
+
children: o.map((O, z) => {
|
|
1420
|
+
const { id: b, value: D, label: x, ...L } = O, M = b || `${e}-option-${z}`, E = s ? s === D : i === D;
|
|
1421
|
+
return /* @__PURE__ */ I(
|
|
1422
|
+
_,
|
|
1423
|
+
{
|
|
1424
|
+
"data-radio-button": !0,
|
|
1425
|
+
role: "radio",
|
|
1426
|
+
"aria-checked": E,
|
|
1427
|
+
children: [
|
|
1428
|
+
/* @__PURE__ */ n(
|
|
1429
|
+
"input",
|
|
1430
|
+
{
|
|
1431
|
+
type: "radio",
|
|
1432
|
+
id: M,
|
|
1433
|
+
name: p,
|
|
1434
|
+
value: D,
|
|
1435
|
+
checked: E,
|
|
1436
|
+
disabled: k,
|
|
1437
|
+
onChange: N,
|
|
1438
|
+
...L
|
|
1439
|
+
}
|
|
1440
|
+
),
|
|
1441
|
+
/* @__PURE__ */ n("label", { htmlFor: M, children: x })
|
|
1442
|
+
]
|
|
1443
|
+
},
|
|
1444
|
+
M
|
|
1445
|
+
);
|
|
1446
|
+
})
|
|
1447
|
+
}
|
|
1448
|
+
)
|
|
1449
|
+
}
|
|
1450
|
+
);
|
|
1451
|
+
}
|
|
1452
|
+
);
|
|
1453
|
+
rt.displayName = "RadioGroup";
|
|
1454
|
+
const st = y.forwardRef(
|
|
1455
|
+
({
|
|
1456
|
+
layout: e = "grid",
|
|
1457
|
+
gutters: t = "medium",
|
|
1458
|
+
retainLayoutOnTabletLandscape: a,
|
|
1459
|
+
retainLayoutOnTabletPortrait: r,
|
|
1460
|
+
retainLayoutOnMobile: l,
|
|
1461
|
+
retainLayoutAlways: o,
|
|
1462
|
+
allowUltraWide: s,
|
|
1463
|
+
groupLabel: i,
|
|
1464
|
+
...c
|
|
1465
|
+
}, f) => {
|
|
1466
|
+
let u = [];
|
|
1467
|
+
return e && u.push(`layout-${e}`), t && u.push(t === "none" ? "no-gutters" : `${t}-gutters`), a && u.push("retain-layout-on-tablet-landscape"), r && u.push("retain-layout-on-tablet-portrait"), l && u.push("retain-layout-on-mobile"), o && u.push(
|
|
1468
|
+
"retain-layout-on-tablet-landscape retain-layout-on-tablet-portrait retain-layout-on-mobile"
|
|
1469
|
+
), s && u.push("allow-ultra-wide"), /* @__PURE__ */ n(
|
|
1470
|
+
P,
|
|
1471
|
+
{
|
|
1472
|
+
as: "div",
|
|
1473
|
+
"data-row": !0,
|
|
1474
|
+
ref: f,
|
|
1475
|
+
classNames: [u.join(" ")],
|
|
1476
|
+
marginBottom: "tiny",
|
|
1477
|
+
role: "grid",
|
|
1478
|
+
"aria-label": i,
|
|
1479
|
+
...c
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
}
|
|
1483
|
+
);
|
|
1484
|
+
st.displayName = "Row";
|
|
1485
|
+
const nt = y.forwardRef(
|
|
1486
|
+
({
|
|
1487
|
+
// FormItem props
|
|
1488
|
+
label: e,
|
|
1489
|
+
helpText: t,
|
|
1490
|
+
errorText: a,
|
|
1491
|
+
required: r,
|
|
1492
|
+
// Select props
|
|
1493
|
+
id: l,
|
|
1494
|
+
name: o,
|
|
1495
|
+
options: s,
|
|
1496
|
+
onChange: i,
|
|
1497
|
+
disabled: c,
|
|
1498
|
+
className: f,
|
|
1499
|
+
...u
|
|
1500
|
+
}, m) => {
|
|
1501
|
+
const v = fe(() => o || l, [o, l]), k = (p) => /* @__PURE__ */ n(
|
|
1502
|
+
P,
|
|
1503
|
+
{
|
|
1504
|
+
as: "option",
|
|
1505
|
+
value: p.value,
|
|
1506
|
+
disabled: p.disabled,
|
|
1507
|
+
children: p.label
|
|
1508
|
+
},
|
|
1509
|
+
p.value
|
|
1510
|
+
), g = (p) => /* @__PURE__ */ n(
|
|
1511
|
+
P,
|
|
1512
|
+
{
|
|
1513
|
+
as: "optgroup",
|
|
1514
|
+
label: p.label,
|
|
1515
|
+
children: p.options.map(k)
|
|
1516
|
+
},
|
|
1517
|
+
p.label
|
|
1518
|
+
);
|
|
1519
|
+
return /* @__PURE__ */ n(
|
|
1520
|
+
ee,
|
|
1521
|
+
{
|
|
1522
|
+
label: e,
|
|
1523
|
+
htmlFor: l,
|
|
1524
|
+
helpText: t,
|
|
1525
|
+
errorText: a,
|
|
1526
|
+
required: r,
|
|
1527
|
+
children: /* @__PURE__ */ n(_, { "data-select": !0, className: f, disabled: c, children: /* @__PURE__ */ n(
|
|
1528
|
+
P,
|
|
1529
|
+
{
|
|
1530
|
+
as: "select",
|
|
1531
|
+
ref: m,
|
|
1532
|
+
id: l,
|
|
1533
|
+
name: v,
|
|
1534
|
+
disabled: c,
|
|
1535
|
+
required: r,
|
|
1536
|
+
onChange: (p) => {
|
|
1537
|
+
i == null || i(p.target.value);
|
|
1538
|
+
},
|
|
1539
|
+
...u,
|
|
1540
|
+
children: s.map(
|
|
1541
|
+
(p) => "options" in p ? g(p) : k(p)
|
|
1542
|
+
)
|
|
1543
|
+
}
|
|
1544
|
+
) })
|
|
1545
|
+
}
|
|
1546
|
+
);
|
|
1547
|
+
}
|
|
1548
|
+
);
|
|
1549
|
+
nt.displayName = "Select";
|
|
1550
|
+
const We = (e, t) => e > t ? "exceeded" : e >= t * 0.9 ? "warning" : "normal", Re = (e, t, a) => Math.abs(e) === 1 ? t : a, ot = y.forwardRef(
|
|
1551
|
+
({
|
|
1552
|
+
// FormItem props
|
|
1553
|
+
label: e,
|
|
1554
|
+
hideLabel: t,
|
|
1555
|
+
helpText: a,
|
|
1556
|
+
errorText: r,
|
|
1557
|
+
size: l,
|
|
1558
|
+
required: o,
|
|
1559
|
+
// TextArea-specific
|
|
1560
|
+
onChange: s,
|
|
1561
|
+
value: i = "",
|
|
1562
|
+
characterLimit: c,
|
|
1563
|
+
wordLimit: f,
|
|
1564
|
+
// Input props
|
|
1565
|
+
id: u,
|
|
1566
|
+
name: m,
|
|
1567
|
+
rows: v,
|
|
1568
|
+
cols: k,
|
|
1569
|
+
minLength: g,
|
|
1570
|
+
maxLength: A,
|
|
1571
|
+
placeholder: p,
|
|
1572
|
+
readOnly: N,
|
|
1573
|
+
disabled: w,
|
|
1574
|
+
autoComplete: O,
|
|
1575
|
+
// Validation (unused but destructured to not pass to DOM)
|
|
1576
|
+
validateThis: z,
|
|
1577
|
+
valid: b,
|
|
1578
|
+
invalid: D,
|
|
1579
|
+
...x
|
|
1580
|
+
}, L) => {
|
|
1581
|
+
const M = J(null), E = (R) => {
|
|
1582
|
+
s == null || s(R.target.value);
|
|
1583
|
+
}, S = () => {
|
|
1584
|
+
const R = [];
|
|
1585
|
+
if (c) {
|
|
1586
|
+
const F = i.length, H = We(F, c), $ = Math.max(0, F - c), d = c - F;
|
|
1587
|
+
R.push(
|
|
1588
|
+
/* @__PURE__ */ n("span", { className: `limit-${H}`, children: $ > 0 ? `${$} ${Re($, "char", "chars")} over limit` : `${d} ${Re(d, "char", "chars")} left` }, "char-limit")
|
|
1589
|
+
);
|
|
1590
|
+
}
|
|
1591
|
+
if (f) {
|
|
1592
|
+
const F = i.trim().split(/\s+/).filter(Boolean).length, H = We(F, f), $ = Math.max(0, F - f), d = f - F;
|
|
1593
|
+
R.push(
|
|
1594
|
+
/* @__PURE__ */ n("span", { className: `limit-${H}`, children: $ > 0 ? `${$} ${Re($, "word", "words")} over limit` : `${d} ${Re(d, "word", "words")} left` }, "word-limit")
|
|
1595
|
+
);
|
|
1596
|
+
}
|
|
1597
|
+
if (!(!R.length && !a))
|
|
1598
|
+
return /* @__PURE__ */ I(ve, { children: [
|
|
1599
|
+
a,
|
|
1600
|
+
a && R.length > 0 && /* @__PURE__ */ n("span", { className: "separator", children: " • " }),
|
|
1601
|
+
R.map((F, H) => /* @__PURE__ */ I(y.Fragment, { children: [
|
|
1602
|
+
H > 0 && /* @__PURE__ */ n("span", { className: "separator", children: " • " }),
|
|
1603
|
+
F
|
|
1604
|
+
] }, H))
|
|
1605
|
+
] });
|
|
1606
|
+
}, G = (R) => {
|
|
1607
|
+
M.current = R, typeof L == "function" ? L(R) : L && (L.current = R);
|
|
1608
|
+
};
|
|
1609
|
+
return /* @__PURE__ */ n(
|
|
1610
|
+
ee,
|
|
1611
|
+
{
|
|
1612
|
+
label: e,
|
|
1613
|
+
htmlFor: u,
|
|
1614
|
+
helpText: S(),
|
|
1615
|
+
errorText: r,
|
|
1616
|
+
required: o,
|
|
1617
|
+
size: l,
|
|
1618
|
+
children: /* @__PURE__ */ n(
|
|
1619
|
+
P,
|
|
1620
|
+
{
|
|
1621
|
+
as: "textarea",
|
|
1622
|
+
ref: G,
|
|
1623
|
+
"data-textarea": !0,
|
|
1624
|
+
id: u,
|
|
1625
|
+
name: m,
|
|
1626
|
+
value: i,
|
|
1627
|
+
rows: v,
|
|
1628
|
+
cols: k,
|
|
1629
|
+
minLength: g,
|
|
1630
|
+
maxLength: A,
|
|
1631
|
+
placeholder: p,
|
|
1632
|
+
readOnly: N,
|
|
1633
|
+
disabled: w,
|
|
1634
|
+
required: o,
|
|
1635
|
+
autoComplete: O,
|
|
1636
|
+
onChange: E,
|
|
1637
|
+
...x
|
|
1638
|
+
}
|
|
1639
|
+
)
|
|
1640
|
+
}
|
|
1641
|
+
);
|
|
1642
|
+
}
|
|
1643
|
+
);
|
|
1644
|
+
ot.displayName = "TextArea";
|
|
1645
|
+
const Lt = {
|
|
1646
|
+
Checkbox: Fe,
|
|
1647
|
+
Switch: Ve,
|
|
1648
|
+
InputField: be,
|
|
1649
|
+
FileUpload: et,
|
|
1650
|
+
InputLabel: ye,
|
|
1651
|
+
RadioButton: at,
|
|
1652
|
+
RadioGroup: rt,
|
|
1653
|
+
Select: nt,
|
|
1654
|
+
TextArea: ot,
|
|
1655
|
+
Empty: "div"
|
|
1656
|
+
}, St = (e, t) => {
|
|
1657
|
+
const { as: a, name: r, ...l } = e, o = (i) => {
|
|
1658
|
+
t(r, i);
|
|
1659
|
+
}, s = Lt[a] || be;
|
|
1660
|
+
return /* @__PURE__ */ n(
|
|
1661
|
+
P,
|
|
1662
|
+
{
|
|
1663
|
+
as: s,
|
|
1664
|
+
...l,
|
|
1665
|
+
name: r,
|
|
1666
|
+
isFullWidth: !0,
|
|
1667
|
+
onChange: o
|
|
1668
|
+
}
|
|
1669
|
+
);
|
|
1670
|
+
}, Pt = (e, t, a) => {
|
|
1671
|
+
const r = e.map((l, o) => {
|
|
1672
|
+
const {
|
|
1673
|
+
desktopSpan: s,
|
|
1674
|
+
tabletLandscapeSpan: i,
|
|
1675
|
+
tabletPortraitSpan: c,
|
|
1676
|
+
mobileSpan: f,
|
|
1677
|
+
isHorizontal: u,
|
|
1678
|
+
...m
|
|
1679
|
+
} = l;
|
|
1680
|
+
return /* @__PURE__ */ yt(tt, { ...{
|
|
1681
|
+
desktopSpan: s,
|
|
1682
|
+
tabletLandscapeSpan: i,
|
|
1683
|
+
tabletPortraitSpan: c,
|
|
1684
|
+
mobileSpan: f,
|
|
1685
|
+
isHorizontal: u
|
|
1686
|
+
}, key: `${l.name}-${o}` }, St(m, t));
|
|
1687
|
+
});
|
|
1688
|
+
return /* @__PURE__ */ n(st, { gutters: a, children: r });
|
|
1689
|
+
}, Tt = y.forwardRef(
|
|
1690
|
+
({ spacing: e = "small", fields: t, onFieldsChange: a, children: r, errorText: l, ...o }, s) => {
|
|
1691
|
+
let i = [];
|
|
1692
|
+
e && i.push(`spacing-${e}`);
|
|
1693
|
+
const c = (u, m) => {
|
|
1694
|
+
a && a({
|
|
1695
|
+
[u]: m
|
|
1696
|
+
});
|
|
1697
|
+
}, f = t != null && t.length ? Pt(t, c, e) : r;
|
|
1698
|
+
return /* @__PURE__ */ I(
|
|
1699
|
+
P,
|
|
1700
|
+
{
|
|
1701
|
+
as: "form",
|
|
1702
|
+
"data-form": !0,
|
|
1703
|
+
ref: s,
|
|
1704
|
+
classNames: i,
|
|
1705
|
+
...o,
|
|
1706
|
+
children: [
|
|
1707
|
+
f,
|
|
1708
|
+
l && /* @__PURE__ */ n(Je, { kind: "error", children: l })
|
|
1709
|
+
]
|
|
1710
|
+
}
|
|
1711
|
+
);
|
|
1712
|
+
}
|
|
1713
|
+
);
|
|
1714
|
+
Tt.displayName = "Form";
|
|
1715
|
+
const Ot = y.forwardRef(
|
|
1716
|
+
({
|
|
1717
|
+
isJoint: e,
|
|
1718
|
+
equalWidthForChildren: t,
|
|
1719
|
+
retainLayout: a,
|
|
1720
|
+
children: r,
|
|
1721
|
+
legend: l,
|
|
1722
|
+
id: o,
|
|
1723
|
+
...s
|
|
1724
|
+
}, i) => {
|
|
1725
|
+
const c = o || `form-group-${Math.random().toString(36).substring(2, 9)}`;
|
|
1726
|
+
let f = [];
|
|
1727
|
+
return e && f.push("is-joint"), t && f.push("equal-width-for-children"), a && f.push("retain-layout"), /* @__PURE__ */ n(
|
|
1728
|
+
P,
|
|
1729
|
+
{
|
|
1730
|
+
as: "div",
|
|
1731
|
+
"data-form-item-group": !0,
|
|
1732
|
+
ref: i,
|
|
1733
|
+
id: c,
|
|
1734
|
+
role: "group",
|
|
1735
|
+
"aria-label": l,
|
|
1736
|
+
classNames: f,
|
|
1737
|
+
...s,
|
|
1738
|
+
children: r
|
|
1739
|
+
}
|
|
1740
|
+
);
|
|
1741
|
+
}
|
|
1742
|
+
);
|
|
1743
|
+
Ot.displayName = "FormItemGroup";
|
|
1744
|
+
const Bt = (e, t) => {
|
|
1745
|
+
const a = [], r = e.length, l = t.length;
|
|
1746
|
+
if (r === 0) return l;
|
|
1747
|
+
if (l === 0) return r;
|
|
1748
|
+
for (let o = 0; o <= l; o++)
|
|
1749
|
+
a[o] = [o];
|
|
1750
|
+
for (let o = 0; o <= r; o++)
|
|
1751
|
+
a[0][o] = o;
|
|
1752
|
+
for (let o = 1; o <= l; o++)
|
|
1753
|
+
for (let s = 1; s <= r; s++)
|
|
1754
|
+
t[o - 1] === e[s - 1] ? a[o][s] = a[o - 1][s - 1] : a[o][s] = Math.min(
|
|
1755
|
+
a[o - 1][s] + 1,
|
|
1756
|
+
// Deletion
|
|
1757
|
+
a[o][s - 1] + 1,
|
|
1758
|
+
// Insertion
|
|
1759
|
+
a[o - 1][s - 1] + 1
|
|
1760
|
+
// Substitution
|
|
1761
|
+
);
|
|
1762
|
+
return a[l][r];
|
|
1763
|
+
}, Ft = (e, t) => {
|
|
1764
|
+
let a = 0, r = 0;
|
|
1765
|
+
for (; a < e.length && r < t.length; )
|
|
1766
|
+
e[a] === t[r] && a++, r++;
|
|
1767
|
+
return a === e.length;
|
|
1768
|
+
}, Vt = (e) => e.split(/[\s\-_]+/).map((t) => t.slice(0, 2)).join("").toLowerCase(), zt = (e, t) => {
|
|
1769
|
+
if (!t) return e;
|
|
1770
|
+
const a = t.toLowerCase().trim(), r = Math.floor(a.length / 2);
|
|
1771
|
+
return e.map((o) => {
|
|
1772
|
+
const s = o.label.toLowerCase(), i = Bt(a, s), c = s.split(/[\s\-_]+/), f = a.split(/[\s\-_]+/), u = s.includes(a) || f.every(
|
|
1773
|
+
(k) => c.some((g) => g.startsWith(k))
|
|
1774
|
+
), m = Vt(s), v = Ft(a, m);
|
|
1775
|
+
return {
|
|
1776
|
+
option: o,
|
|
1777
|
+
distance: i,
|
|
1778
|
+
isPartialMatch: u,
|
|
1779
|
+
isAcronymMatch: v
|
|
1780
|
+
};
|
|
1781
|
+
}).filter(
|
|
1782
|
+
({ distance: o, isPartialMatch: s, isAcronymMatch: i }) => s || i || o <= r
|
|
1783
|
+
).sort((o, s) => o.isPartialMatch && !s.isPartialMatch ? -1 : !o.isPartialMatch && s.isPartialMatch ? 1 : o.isAcronymMatch && !s.isAcronymMatch ? -1 : !o.isAcronymMatch && s.isAcronymMatch ? 1 : o.distance - s.distance).map(({ option: o }) => o);
|
|
1784
|
+
}, Ht = y.forwardRef(
|
|
1785
|
+
({
|
|
1786
|
+
options: e = [],
|
|
1787
|
+
label: t,
|
|
1788
|
+
helpText: a,
|
|
1789
|
+
errorText: r,
|
|
1790
|
+
placeholder: l = "Select an option",
|
|
1791
|
+
id: o,
|
|
1792
|
+
defaultValue: s,
|
|
1793
|
+
onChange: i,
|
|
1794
|
+
disabled: c,
|
|
1795
|
+
selectionLimit: f,
|
|
1796
|
+
allowMultiSelect: u = !1,
|
|
1797
|
+
allowCustomEntries: m = !1,
|
|
1798
|
+
isLoading: v,
|
|
1799
|
+
value: k,
|
|
1800
|
+
isFullWidth: g,
|
|
1801
|
+
className: A,
|
|
1802
|
+
required: p,
|
|
1803
|
+
...N
|
|
1804
|
+
}, w) => {
|
|
1805
|
+
const [O, z] = j(!1), [b, D] = j(""), [x, L] = j(-1), [M, E] = j(null), [S, G] = j([]);
|
|
1806
|
+
q(() => {
|
|
1807
|
+
s && i && i(s);
|
|
1808
|
+
}, []);
|
|
1809
|
+
const R = y.useMemo(() => [...e], [e]), F = J(), H = J(null), $ = o || `listbox-${Math.random().toString(36).substring(2, 9)}`, d = zt(R, b), h = (B) => {
|
|
1810
|
+
if (B.disabled) return;
|
|
1811
|
+
let X;
|
|
1812
|
+
if (u) {
|
|
1813
|
+
if (S.some((Z) => Z.value === B.value))
|
|
1814
|
+
X = S.filter((Z) => Z.value !== B.value);
|
|
1815
|
+
else {
|
|
1816
|
+
if (f && S.length >= f)
|
|
1817
|
+
return;
|
|
1818
|
+
X = [...S, B];
|
|
1819
|
+
}
|
|
1820
|
+
G(X), i == null || i(X.map((Z) => Z.value));
|
|
1821
|
+
} else
|
|
1822
|
+
X = [B], E(B), G(X), i == null || i(B.value), z(!1);
|
|
1823
|
+
D(""), L(-1);
|
|
1824
|
+
}, V = (B) => {
|
|
1825
|
+
D(B);
|
|
1826
|
+
}, T = () => {
|
|
1827
|
+
if (!b.trim() || !m) return;
|
|
1828
|
+
const B = b.trim(), X = {
|
|
1829
|
+
value: B,
|
|
1830
|
+
label: B
|
|
1831
|
+
};
|
|
1832
|
+
R.some((C) => C.value === B) || h(X);
|
|
1833
|
+
}, K = (B) => {
|
|
1834
|
+
if (u) {
|
|
1835
|
+
const X = S.filter((C) => C.value !== B);
|
|
1836
|
+
G(X), i == null || i(X.map((C) => C.value));
|
|
1837
|
+
} else
|
|
1838
|
+
E(null), G([]), i == null || i("");
|
|
1839
|
+
}, Q = () => {
|
|
1840
|
+
E(null), G([]), i == null || i(u ? [] : "");
|
|
1841
|
+
}, te = (B) => {
|
|
1842
|
+
switch (B.key) {
|
|
1843
|
+
case "ArrowDown":
|
|
1844
|
+
B.preventDefault(), O ? L(
|
|
1845
|
+
(X) => X < d.length - 1 ? X + 1 : X
|
|
1846
|
+
) : (z(!0), L(0));
|
|
1847
|
+
break;
|
|
1848
|
+
case "ArrowUp":
|
|
1849
|
+
B.preventDefault(), L((X) => X > 0 ? X - 1 : X);
|
|
1850
|
+
break;
|
|
1851
|
+
case "Enter":
|
|
1852
|
+
if (B.preventDefault(), m && b.trim()) {
|
|
1853
|
+
const X = d.find(
|
|
1854
|
+
(C) => C.label.toLowerCase() === b.trim().toLowerCase()
|
|
1855
|
+
);
|
|
1856
|
+
X ? h(X) : T();
|
|
1857
|
+
} else x >= 0 && d[x] && h(d[x]);
|
|
1858
|
+
break;
|
|
1859
|
+
case "Escape":
|
|
1860
|
+
B.preventDefault(), z(!1), L(-1);
|
|
1861
|
+
break;
|
|
1862
|
+
case " ":
|
|
1863
|
+
O || (B.preventDefault(), z(!0), L(0));
|
|
1864
|
+
break;
|
|
1865
|
+
case "Home":
|
|
1866
|
+
O && (B.preventDefault(), L(0));
|
|
1867
|
+
break;
|
|
1868
|
+
case "End":
|
|
1869
|
+
O && (B.preventDefault(), L(d.length - 1));
|
|
1870
|
+
break;
|
|
1871
|
+
}
|
|
1872
|
+
};
|
|
1873
|
+
return Oe(F, () => {
|
|
1874
|
+
z(!1), L(-1);
|
|
1875
|
+
}), q(() => {
|
|
1876
|
+
O && H.current && H.current.focus();
|
|
1877
|
+
}, [O]), q(() => {
|
|
1878
|
+
if (x >= 0) {
|
|
1879
|
+
const B = document.querySelector(`[data-index="${x}"]`);
|
|
1880
|
+
B == null || B.scrollIntoView({ block: "nearest" });
|
|
1881
|
+
}
|
|
1882
|
+
}, [x]), /* @__PURE__ */ n(
|
|
1883
|
+
ee,
|
|
1884
|
+
{
|
|
1885
|
+
label: t,
|
|
1886
|
+
htmlFor: o,
|
|
1887
|
+
helpText: a,
|
|
1888
|
+
errorText: r,
|
|
1889
|
+
required: p,
|
|
1890
|
+
children: /* @__PURE__ */ I(
|
|
1891
|
+
P,
|
|
1892
|
+
{
|
|
1893
|
+
as: "div",
|
|
1894
|
+
"data-list-box": !0,
|
|
1895
|
+
classNames: ["list-box-wrapper", c ? "disabled" : "", A || ""],
|
|
1896
|
+
ref: F,
|
|
1897
|
+
...N,
|
|
1898
|
+
children: [
|
|
1899
|
+
/* @__PURE__ */ I(
|
|
1900
|
+
_,
|
|
1901
|
+
{
|
|
1902
|
+
className: "list-box-input-wrapper",
|
|
1903
|
+
onClick: () => !c && z(!O),
|
|
1904
|
+
role: "combobox",
|
|
1905
|
+
"aria-haspopup": "listbox",
|
|
1906
|
+
"aria-expanded": O,
|
|
1907
|
+
"aria-controls": `${$}-listbox`,
|
|
1908
|
+
"aria-owns": `${$}-listbox`,
|
|
1909
|
+
tabIndex: c ? -1 : 0,
|
|
1910
|
+
children: [
|
|
1911
|
+
u ? /* @__PURE__ */ I(ve, { children: [
|
|
1912
|
+
S.length > 0 ? /* @__PURE__ */ I(_, { className: "options-wrapper", children: [
|
|
1913
|
+
/* @__PURE__ */ n(_, { className: "options-list", children: S.map((B) => /* @__PURE__ */ n(
|
|
1914
|
+
Ae,
|
|
1915
|
+
{
|
|
1916
|
+
actionIcon: "cross",
|
|
1917
|
+
onActionClick: () => K(B.value),
|
|
1918
|
+
actionAriaLabel: `Remove ${B.label}`,
|
|
1919
|
+
size: "small",
|
|
1920
|
+
shape: "rounded",
|
|
1921
|
+
children: /* @__PURE__ */ n(Y, { children: B.label })
|
|
1922
|
+
},
|
|
1923
|
+
B.value
|
|
1924
|
+
)) }),
|
|
1925
|
+
f && S.length >= f && /* @__PURE__ */ I(Y, { className: "options-limit-warning", textColour: "red", size: "small", children: [
|
|
1926
|
+
"You can choose only ",
|
|
1927
|
+
f,
|
|
1928
|
+
" option",
|
|
1929
|
+
f === 1 ? "" : "s"
|
|
1930
|
+
] })
|
|
1931
|
+
] }) : /* @__PURE__ */ n("span", { className: "placeholder", children: l }),
|
|
1932
|
+
S.length > 0 && /* @__PURE__ */ n(
|
|
1933
|
+
_,
|
|
1934
|
+
{
|
|
1935
|
+
className: "icon-wrapper clear-all",
|
|
1936
|
+
title: "Clear all options",
|
|
1937
|
+
onClick: () => Q(),
|
|
1938
|
+
children: /* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", children: [
|
|
1939
|
+
/* @__PURE__ */ n("line", { x1: "5", y1: "5", x2: "19", y2: "19" }),
|
|
1940
|
+
/* @__PURE__ */ n("line", { x1: "5", y1: "19", x2: "19", y2: "5" })
|
|
1941
|
+
] })
|
|
1942
|
+
}
|
|
1943
|
+
)
|
|
1944
|
+
] }) : S[0] ? /* @__PURE__ */ n(Y, { className: "selected-option", children: S[0].label }) : /* @__PURE__ */ n("span", { className: "placeholder", children: l }),
|
|
1945
|
+
/* @__PURE__ */ n(_, { className: "icon-wrapper chevrons", children: /* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
1946
|
+
/* @__PURE__ */ n("polyline", { points: "6 9 12 4 18 9" }),
|
|
1947
|
+
/* @__PURE__ */ n("polyline", { points: "6 15 12 20 18 15" })
|
|
1948
|
+
] }) })
|
|
1949
|
+
]
|
|
1950
|
+
}
|
|
1951
|
+
),
|
|
1952
|
+
O && !c && /* @__PURE__ */ I(_, { className: "list-box-dropdown", children: [
|
|
1953
|
+
/* @__PURE__ */ I(_, { className: "list-box-search-wrapper", children: [
|
|
1954
|
+
/* @__PURE__ */ n(
|
|
1955
|
+
be,
|
|
1956
|
+
{
|
|
1957
|
+
type: "text",
|
|
1958
|
+
ref: H,
|
|
1959
|
+
className: "list-box-search",
|
|
1960
|
+
placeholder: m ? "Type to search or add new" : "Search",
|
|
1961
|
+
value: b,
|
|
1962
|
+
onChange: V,
|
|
1963
|
+
onKeyDown: te,
|
|
1964
|
+
"aria-controls": `${$}-listbox`,
|
|
1965
|
+
"aria-label": "Search options"
|
|
1966
|
+
}
|
|
1967
|
+
),
|
|
1968
|
+
m && b.trim() && !S.some((B) => B.label.toLowerCase() === b.trim().toLowerCase()) && /* @__PURE__ */ n(
|
|
1969
|
+
"kbd",
|
|
1970
|
+
{
|
|
1971
|
+
className: "list-box-enter-key",
|
|
1972
|
+
"aria-label": "Press Enter to add custom option",
|
|
1973
|
+
children: "↵"
|
|
1974
|
+
}
|
|
1975
|
+
)
|
|
1976
|
+
] }),
|
|
1977
|
+
/* @__PURE__ */ n(
|
|
1978
|
+
P,
|
|
1979
|
+
{
|
|
1980
|
+
as: "ul",
|
|
1981
|
+
id: `${$}-listbox`,
|
|
1982
|
+
className: "list-box-options",
|
|
1983
|
+
role: "listbox",
|
|
1984
|
+
"aria-multiselectable": u,
|
|
1985
|
+
"aria-busy": v,
|
|
1986
|
+
tabIndex: -1,
|
|
1987
|
+
children: d.length > 0 ? d.map((B, X) => /* @__PURE__ */ n(
|
|
1988
|
+
"li",
|
|
1989
|
+
{
|
|
1990
|
+
id: `${$}-option-${B.value}`,
|
|
1991
|
+
className: `list-box-option ${B.disabled ? "disabled" : ""} ${x === X ? "active" : ""}`,
|
|
1992
|
+
role: "option",
|
|
1993
|
+
"aria-selected": S.some((C) => C.value === B.value),
|
|
1994
|
+
"aria-disabled": B.disabled,
|
|
1995
|
+
onClick: () => h(B),
|
|
1996
|
+
"data-index": X,
|
|
1997
|
+
tabIndex: -1,
|
|
1998
|
+
children: B.customLabel || B.label
|
|
1999
|
+
},
|
|
2000
|
+
B.value
|
|
2001
|
+
)) : /* @__PURE__ */ n(
|
|
2002
|
+
"li",
|
|
2003
|
+
{
|
|
2004
|
+
className: "list-box-option disabled",
|
|
2005
|
+
role: "alert",
|
|
2006
|
+
"aria-live": "polite",
|
|
2007
|
+
children: m ? "Type and press Enter to add new option" : "No matches found"
|
|
2008
|
+
}
|
|
2009
|
+
)
|
|
2010
|
+
}
|
|
2011
|
+
)
|
|
2012
|
+
] })
|
|
2013
|
+
]
|
|
2014
|
+
}
|
|
2015
|
+
)
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
);
|
|
2020
|
+
Ht.displayName = "ListBox";
|
|
2021
|
+
function Ke(e, t) {
|
|
2022
|
+
return (t === "alphanumeric" ? /^[a-zA-Z0-9]+$/i : /^[0-9]+$/).test(e);
|
|
2023
|
+
}
|
|
2024
|
+
const _t = y.forwardRef(
|
|
2025
|
+
({
|
|
2026
|
+
numberOfFields: e,
|
|
2027
|
+
onChange: t,
|
|
2028
|
+
type: a = "number",
|
|
2029
|
+
mask: r = !1,
|
|
2030
|
+
isOTP: l = !1,
|
|
2031
|
+
autoFocus: o = !1,
|
|
2032
|
+
pasteFromClipboard: s = "enabled",
|
|
2033
|
+
focusFirstInputOnReset: i = !0,
|
|
2034
|
+
isFullWidth: c,
|
|
2035
|
+
ariaLabel: f,
|
|
2036
|
+
...u
|
|
2037
|
+
}, m) => {
|
|
2038
|
+
const v = J(null), [k, g] = j([]), [A, p] = j([]), [N, w] = j(!0), [O, z] = j(-1), b = u.id || `pin-input-${Math.random().toString(36).substring(2, 9)}`, D = f || "Enter verification code", x = W(
|
|
2039
|
+
($) => {
|
|
2040
|
+
var h;
|
|
2041
|
+
const d = k[$];
|
|
2042
|
+
(h = d == null ? void 0 : d.current) == null || h.focus();
|
|
2043
|
+
},
|
|
2044
|
+
[k]
|
|
2045
|
+
), L = W(
|
|
2046
|
+
($) => {
|
|
2047
|
+
if (!N) return;
|
|
2048
|
+
const d = $ + 1 < e ? $ + 1 : null;
|
|
2049
|
+
d && x(d);
|
|
2050
|
+
},
|
|
2051
|
+
[x, e, N]
|
|
2052
|
+
), M = W(() => {
|
|
2053
|
+
p(Array(e).fill("")), t == null || t(""), i && (x(0), z(0));
|
|
2054
|
+
}, [e, t, x, i]), E = W(
|
|
2055
|
+
($, d) => {
|
|
2056
|
+
const h = [...A];
|
|
2057
|
+
h[d] = $, p(h), t == null || t(h.join("")), $ !== "" && h.length === e && h.every((T) => T != null && T !== "") && d === e - 1 || (w(!0), L(d));
|
|
2058
|
+
},
|
|
2059
|
+
[L, e, t, A]
|
|
2060
|
+
), S = W(($, d) => {
|
|
2061
|
+
var T;
|
|
2062
|
+
const h = typeof $ == "string" ? $ : $.target.value, V = A[d];
|
|
2063
|
+
if (h === "") {
|
|
2064
|
+
E("", d);
|
|
2065
|
+
return;
|
|
2066
|
+
}
|
|
2067
|
+
if (h.length > 1 && d < e - 1) {
|
|
2068
|
+
if (Ke(h, a)) {
|
|
2069
|
+
let K = [];
|
|
2070
|
+
const Q = h.split("");
|
|
2071
|
+
V === "" ? K = Q.filter((X, C) => d + C < e) : ((T = k[d].current) == null ? void 0 : T.selectionEnd) === h.length ? K = Q.filter((C, Z) => Z > 0 && d + Z - 1 < e) : K = Q.filter((C, Z) => Z < h.length - 1 && d + Z < e);
|
|
2072
|
+
const te = A.map(
|
|
2073
|
+
(X, C) => C >= d && C < d + K.length ? K[C - d] : X
|
|
2074
|
+
);
|
|
2075
|
+
p(te), t == null || t(te.join(""));
|
|
2076
|
+
const B = Math.min(d + K.length, e - 1);
|
|
2077
|
+
x(B);
|
|
2078
|
+
}
|
|
2079
|
+
} else {
|
|
2080
|
+
let K = h;
|
|
2081
|
+
(V == null ? void 0 : V.length) > 0 && (K = h.charAt(h.length - 1)), Ke(K, a) && E(K, d);
|
|
2082
|
+
}
|
|
2083
|
+
}, [e, t, E, a, A, x, k]), G = W(($, d) => {
|
|
2084
|
+
var h;
|
|
2085
|
+
if ($.key === "Backspace")
|
|
2086
|
+
if ($.target.value === "") {
|
|
2087
|
+
if (d > 0) {
|
|
2088
|
+
const V = d - 1;
|
|
2089
|
+
E("", V), x(V), w(!0);
|
|
2090
|
+
}
|
|
2091
|
+
} else
|
|
2092
|
+
w(!1);
|
|
2093
|
+
else $.key === "Escape" ? ((h = k[d].current) == null || h.blur(), H()) : $.key === "ArrowRight" ? d < e - 1 && x(d + 1) : $.key === "ArrowLeft" && d > 0 && x(d - 1);
|
|
2094
|
+
}, [x, E, k, e]), R = W(($, d) => {
|
|
2095
|
+
z(d);
|
|
2096
|
+
}, []), F = W(($) => {
|
|
2097
|
+
const d = $.target;
|
|
2098
|
+
setTimeout(() => {
|
|
2099
|
+
d.setSelectionRange(d.value.length, d.value.length);
|
|
2100
|
+
}, 0);
|
|
2101
|
+
}, []), H = W(() => {
|
|
2102
|
+
z(-1);
|
|
2103
|
+
}, []);
|
|
2104
|
+
return q(() => {
|
|
2105
|
+
g(($) => Array(e).fill(0).map((h, V) => {
|
|
2106
|
+
var K;
|
|
2107
|
+
const T = $[V] || bt();
|
|
2108
|
+
return o && V === 0 && ((K = T.current) == null || K.focus()), T;
|
|
2109
|
+
}));
|
|
2110
|
+
}, [e, o]), Ce(
|
|
2111
|
+
m,
|
|
2112
|
+
() => ({
|
|
2113
|
+
...v.current,
|
|
2114
|
+
reset: M
|
|
2115
|
+
}),
|
|
2116
|
+
[M]
|
|
2117
|
+
), /* @__PURE__ */ n(
|
|
2118
|
+
_,
|
|
2119
|
+
{
|
|
2120
|
+
"data-pin-input-field": !0,
|
|
2121
|
+
ref: v,
|
|
2122
|
+
classNames: c ? ["full-width"] : [],
|
|
2123
|
+
role: "group",
|
|
2124
|
+
"aria-label": D,
|
|
2125
|
+
"aria-required": u.required,
|
|
2126
|
+
...u,
|
|
2127
|
+
children: Array.from({ length: e }, ($, d) => /* @__PURE__ */ n(
|
|
2128
|
+
be,
|
|
2129
|
+
{
|
|
2130
|
+
id: `${b}-${d}`,
|
|
2131
|
+
ref: k[d],
|
|
2132
|
+
type: r ? "password" : a === "number" ? "tel" : "text",
|
|
2133
|
+
inputMode: a === "number" ? "numeric" : "text",
|
|
2134
|
+
onChange: (h) => S(h, d),
|
|
2135
|
+
onKeyDown: (h) => G(h, d),
|
|
2136
|
+
onFocus: (h) => R(h, d),
|
|
2137
|
+
onSelect: F,
|
|
2138
|
+
onBlur: H,
|
|
2139
|
+
placeholder: O !== d ? "⦁" : void 0,
|
|
2140
|
+
autoComplete: l ? "one-time-code" : "off",
|
|
2141
|
+
value: A[d] || "",
|
|
2142
|
+
autoFocus: o && d === 0,
|
|
2143
|
+
onCopy: (h) => s === "disabled" && h.preventDefault(),
|
|
2144
|
+
onPaste: (h) => s === "disabled" && h.preventDefault(),
|
|
2145
|
+
"aria-label": `Digit ${d + 1} of ${e}`,
|
|
2146
|
+
"aria-required": u.required
|
|
2147
|
+
},
|
|
2148
|
+
d
|
|
2149
|
+
))
|
|
2150
|
+
}
|
|
2151
|
+
);
|
|
2152
|
+
}
|
|
2153
|
+
);
|
|
2154
|
+
_t.displayName = "PinInputField";
|
|
2155
|
+
const Gt = y.forwardRef(
|
|
2156
|
+
({
|
|
2157
|
+
id: e,
|
|
2158
|
+
name: t,
|
|
2159
|
+
label: a,
|
|
2160
|
+
helpText: r,
|
|
2161
|
+
errorText: l,
|
|
2162
|
+
options: o,
|
|
2163
|
+
defaultValue: s,
|
|
2164
|
+
value: i,
|
|
2165
|
+
required: c,
|
|
2166
|
+
onChange: f,
|
|
2167
|
+
size: u = "medium",
|
|
2168
|
+
bgColour: m,
|
|
2169
|
+
disabled: v,
|
|
2170
|
+
...k
|
|
2171
|
+
}, g) => {
|
|
2172
|
+
const A = fe(() => t || e, [t, e]), p = J(null), [N, w] = j({
|
|
2173
|
+
width: 0,
|
|
2174
|
+
transform: "translateX(0)"
|
|
2175
|
+
}), [O, z] = j(!1), [b, D] = j(0), [x, L] = j(0), M = J([]), E = W(() => {
|
|
2176
|
+
if (!p.current) return;
|
|
2177
|
+
const $ = p.current, d = $.closest("[data-input-wrapper]");
|
|
2178
|
+
if ($ && d) {
|
|
2179
|
+
const h = $.scrollWidth, V = d.clientWidth, T = h > V;
|
|
2180
|
+
z(T), L(T ? h - V : 0);
|
|
2181
|
+
}
|
|
2182
|
+
}, []);
|
|
2183
|
+
q(() => {
|
|
2184
|
+
const $ = p.current;
|
|
2185
|
+
if (!$) return;
|
|
2186
|
+
E();
|
|
2187
|
+
const d = new ResizeObserver(() => {
|
|
2188
|
+
E();
|
|
2189
|
+
});
|
|
2190
|
+
return d.observe($), $.closest("[data-input-wrapper]") && d.observe($.closest("[data-input-wrapper]")), () => d.disconnect();
|
|
2191
|
+
}, [E]), q(() => {
|
|
2192
|
+
const $ = o.findIndex((d) => d.value === i);
|
|
2193
|
+
if ($ >= 0) {
|
|
2194
|
+
const d = () => {
|
|
2195
|
+
const h = M.current[$];
|
|
2196
|
+
if (h) {
|
|
2197
|
+
const V = h.offsetWidth;
|
|
2198
|
+
let T = "translateX(0)";
|
|
2199
|
+
$ > 0 && (T = `translateX(${M.current.slice(0, $).reduce((Q, te) => Q + ((te == null ? void 0 : te.offsetWidth) || 0), 0)}px)`), w({ width: V, transform: T });
|
|
2200
|
+
}
|
|
2201
|
+
};
|
|
2202
|
+
if (document.fonts && document.fonts.ready)
|
|
2203
|
+
document.fonts.ready.then(() => {
|
|
2204
|
+
requestAnimationFrame(() => {
|
|
2205
|
+
requestAnimationFrame(d);
|
|
2206
|
+
});
|
|
2207
|
+
});
|
|
2208
|
+
else {
|
|
2209
|
+
const h = setTimeout(d, 100);
|
|
2210
|
+
return () => clearTimeout(h);
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
}, [i, o]);
|
|
2214
|
+
const S = ($) => {
|
|
2215
|
+
f == null || f($.target.value);
|
|
2216
|
+
}, G = W(($) => {
|
|
2217
|
+
const d = p.current;
|
|
2218
|
+
if (!d) return;
|
|
2219
|
+
const V = d.clientWidth * 0.8;
|
|
2220
|
+
let T = $ === "right" ? Math.min(b + V, x) : Math.max(b - V, 0);
|
|
2221
|
+
D(T), requestAnimationFrame(() => {
|
|
2222
|
+
d.style.transform = `translateX(-${T}px)`;
|
|
2223
|
+
});
|
|
2224
|
+
}, [b, x]), R = b > 0, F = b < x, H = [];
|
|
2225
|
+
return u && H.push(`size-${u}`), /* @__PURE__ */ n(
|
|
2226
|
+
ee,
|
|
2227
|
+
{
|
|
2228
|
+
label: a,
|
|
2229
|
+
htmlFor: e,
|
|
2230
|
+
helpText: r,
|
|
2231
|
+
errorText: l,
|
|
2232
|
+
required: c,
|
|
2233
|
+
children: /* @__PURE__ */ I(
|
|
2234
|
+
P,
|
|
2235
|
+
{
|
|
2236
|
+
as: "div",
|
|
2237
|
+
"data-radio-tab-group": !0,
|
|
2238
|
+
ref: g,
|
|
2239
|
+
classNames: H,
|
|
2240
|
+
name: A,
|
|
2241
|
+
...k,
|
|
2242
|
+
children: [
|
|
2243
|
+
O && R && /* @__PURE__ */ n(
|
|
2244
|
+
_,
|
|
2245
|
+
{
|
|
2246
|
+
className: "scroll-button left",
|
|
2247
|
+
onClick: () => G("left"),
|
|
2248
|
+
children: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ n("polyline", { points: "15 18 9 12 15 6" }) })
|
|
2249
|
+
}
|
|
2250
|
+
),
|
|
2251
|
+
/* @__PURE__ */ I(_, { className: "rtg-options-container", children: [
|
|
2252
|
+
/* @__PURE__ */ I(
|
|
2253
|
+
_,
|
|
2254
|
+
{
|
|
2255
|
+
className: "rtg-options-wrapper",
|
|
2256
|
+
ref: p,
|
|
2257
|
+
children: [
|
|
2258
|
+
/* @__PURE__ */ n(
|
|
2259
|
+
_,
|
|
2260
|
+
{
|
|
2261
|
+
className: "indicator",
|
|
2262
|
+
style: {
|
|
2263
|
+
width: `${N.width}px`,
|
|
2264
|
+
transform: N.transform
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
),
|
|
2268
|
+
o.map(($, d) => {
|
|
2269
|
+
const { id: h, ...V } = $, T = h || `${e}-option-${d}`;
|
|
2270
|
+
return /* @__PURE__ */ I(y.Fragment, { children: [
|
|
2271
|
+
/* @__PURE__ */ n(
|
|
2272
|
+
"input",
|
|
2273
|
+
{
|
|
2274
|
+
type: "radio",
|
|
2275
|
+
...V,
|
|
2276
|
+
id: T,
|
|
2277
|
+
name: A,
|
|
2278
|
+
checked: i === $.value,
|
|
2279
|
+
disabled: v || $.disabled,
|
|
2280
|
+
onChange: S
|
|
2281
|
+
}
|
|
2282
|
+
),
|
|
2283
|
+
/* @__PURE__ */ n(
|
|
2284
|
+
"label",
|
|
2285
|
+
{
|
|
2286
|
+
ref: (K) => M.current[d] = K,
|
|
2287
|
+
htmlFor: T,
|
|
2288
|
+
children: $.label
|
|
2289
|
+
}
|
|
2290
|
+
)
|
|
2291
|
+
] }, T);
|
|
2292
|
+
})
|
|
2293
|
+
]
|
|
2294
|
+
}
|
|
2295
|
+
),
|
|
2296
|
+
O && F && /* @__PURE__ */ n(
|
|
2297
|
+
_,
|
|
2298
|
+
{
|
|
2299
|
+
className: "scroll-button right",
|
|
2300
|
+
onClick: () => G("right"),
|
|
2301
|
+
children: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ n("polyline", { points: "9 6 15 12 9 18" }) })
|
|
2302
|
+
}
|
|
2303
|
+
)
|
|
2304
|
+
] })
|
|
2305
|
+
]
|
|
2306
|
+
}
|
|
2307
|
+
)
|
|
2308
|
+
}
|
|
2309
|
+
);
|
|
2310
|
+
}
|
|
2311
|
+
);
|
|
2312
|
+
Gt.displayName = "RadioTabGroup";
|
|
2313
|
+
function Wt(e) {
|
|
2314
|
+
return Array.isArray(e.value);
|
|
2315
|
+
}
|
|
2316
|
+
const Kt = y.forwardRef(
|
|
2317
|
+
(e, t) => Wt(e) ? /* @__PURE__ */ n(lt, { ...e, forwardedRef: t }) : /* @__PURE__ */ n(it, { ...e, forwardedRef: t })
|
|
2318
|
+
);
|
|
2319
|
+
Kt.displayName = "Range";
|
|
2320
|
+
const it = ({
|
|
2321
|
+
label: e,
|
|
2322
|
+
helpText: t,
|
|
2323
|
+
errorText: a,
|
|
2324
|
+
value: r = 0,
|
|
2325
|
+
suffix: l,
|
|
2326
|
+
onChange: o,
|
|
2327
|
+
min: s = 0,
|
|
2328
|
+
max: i = 100,
|
|
2329
|
+
step: c = 1,
|
|
2330
|
+
id: f,
|
|
2331
|
+
disabled: u,
|
|
2332
|
+
...m
|
|
2333
|
+
}) => {
|
|
2334
|
+
const v = J(null), k = J(null), [g, A] = j(!1), [p, N] = j(!1), w = Math.max(s, Math.min(i, r)), O = W((E) => i <= s ? 0 : (Math.max(s, Math.min(i, E)) - s) / (i - s) * 100, [s, i]), z = W((E) => {
|
|
2335
|
+
if (!k.current) return s;
|
|
2336
|
+
const S = k.current.getBoundingClientRect(), G = Math.max(0, Math.min(1, (E - S.left) / S.width)), R = s + G * (i - s), F = Math.round(R / c) * c;
|
|
2337
|
+
return Math.max(s, Math.min(i, F));
|
|
2338
|
+
}, [s, i, c]), b = W((E) => {
|
|
2339
|
+
const S = z(E);
|
|
2340
|
+
o == null || o(S);
|
|
2341
|
+
}, [z, o]), D = W((E) => {
|
|
2342
|
+
u || (E.preventDefault(), A(!0), N(!0), b(E.clientX));
|
|
2343
|
+
}, [u, b]);
|
|
2344
|
+
q(() => {
|
|
2345
|
+
if (!g) return;
|
|
2346
|
+
const E = (G) => {
|
|
2347
|
+
b(G.clientX);
|
|
2348
|
+
}, S = () => {
|
|
2349
|
+
A(!1);
|
|
2350
|
+
};
|
|
2351
|
+
return document.addEventListener("mousemove", E), document.addEventListener("mouseup", S), () => {
|
|
2352
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", S);
|
|
2353
|
+
};
|
|
2354
|
+
}, [g, b]);
|
|
2355
|
+
const x = W((E) => {
|
|
2356
|
+
u || (A(!0), N(!0), b(E.touches[0].clientX));
|
|
2357
|
+
}, [u, b]);
|
|
2358
|
+
q(() => {
|
|
2359
|
+
if (!g) return;
|
|
2360
|
+
const E = (G) => {
|
|
2361
|
+
G.preventDefault(), b(G.touches[0].clientX);
|
|
2362
|
+
}, S = () => {
|
|
2363
|
+
A(!1);
|
|
2364
|
+
};
|
|
2365
|
+
return document.addEventListener("touchmove", E, { passive: !1 }), document.addEventListener("touchend", S), () => {
|
|
2366
|
+
document.removeEventListener("touchmove", E), document.removeEventListener("touchend", S);
|
|
2367
|
+
};
|
|
2368
|
+
}, [g, b]);
|
|
2369
|
+
const L = W((E) => {
|
|
2370
|
+
if (u) return;
|
|
2371
|
+
let S = w;
|
|
2372
|
+
switch (E.key) {
|
|
2373
|
+
case "ArrowRight":
|
|
2374
|
+
case "ArrowUp":
|
|
2375
|
+
E.preventDefault(), S = Math.min(w + c, i);
|
|
2376
|
+
break;
|
|
2377
|
+
case "ArrowLeft":
|
|
2378
|
+
case "ArrowDown":
|
|
2379
|
+
E.preventDefault(), S = Math.max(w - c, s);
|
|
2380
|
+
break;
|
|
2381
|
+
case "Home":
|
|
2382
|
+
E.preventDefault(), S = s;
|
|
2383
|
+
break;
|
|
2384
|
+
case "End":
|
|
2385
|
+
E.preventDefault(), S = i;
|
|
2386
|
+
break;
|
|
2387
|
+
case "PageUp":
|
|
2388
|
+
E.preventDefault(), S = Math.min(w + c * 10, i);
|
|
2389
|
+
break;
|
|
2390
|
+
case "PageDown":
|
|
2391
|
+
E.preventDefault(), S = Math.max(w - c * 10, s);
|
|
2392
|
+
break;
|
|
2393
|
+
default:
|
|
2394
|
+
return;
|
|
2395
|
+
}
|
|
2396
|
+
o == null || o(S);
|
|
2397
|
+
}, [u, w, s, i, c, o]), M = O(w);
|
|
2398
|
+
return /* @__PURE__ */ n(
|
|
2399
|
+
ee,
|
|
2400
|
+
{
|
|
2401
|
+
customLabel: e && /* @__PURE__ */ I(_, { "data-range-meta": !0, children: [
|
|
2402
|
+
/* @__PURE__ */ n(
|
|
2403
|
+
ye,
|
|
2404
|
+
{
|
|
2405
|
+
className: "range-label",
|
|
2406
|
+
label: e,
|
|
2407
|
+
htmlFor: f
|
|
2408
|
+
}
|
|
2409
|
+
),
|
|
2410
|
+
/* @__PURE__ */ I(Y, { className: "range-value", children: [
|
|
2411
|
+
w,
|
|
2412
|
+
l && l
|
|
2413
|
+
] })
|
|
2414
|
+
] }),
|
|
2415
|
+
helpText: t,
|
|
2416
|
+
errorText: a,
|
|
2417
|
+
children: /* @__PURE__ */ I(
|
|
2418
|
+
_,
|
|
2419
|
+
{
|
|
2420
|
+
ref: k,
|
|
2421
|
+
"data-range-single": !0,
|
|
2422
|
+
className: u ? "disabled" : "",
|
|
2423
|
+
role: "group",
|
|
2424
|
+
"aria-labelledby": e ? `${f}-label` : void 0,
|
|
2425
|
+
children: [
|
|
2426
|
+
/* @__PURE__ */ n(_, { className: "range-track", "aria-hidden": "true" }),
|
|
2427
|
+
/* @__PURE__ */ n(
|
|
2428
|
+
_,
|
|
2429
|
+
{
|
|
2430
|
+
className: "range-track-fill",
|
|
2431
|
+
style: {
|
|
2432
|
+
left: "0%",
|
|
2433
|
+
right: `${100 - M}%`
|
|
2434
|
+
},
|
|
2435
|
+
"aria-hidden": "true"
|
|
2436
|
+
}
|
|
2437
|
+
),
|
|
2438
|
+
/* @__PURE__ */ n(
|
|
2439
|
+
"button",
|
|
2440
|
+
{
|
|
2441
|
+
ref: v,
|
|
2442
|
+
id: f,
|
|
2443
|
+
type: "button",
|
|
2444
|
+
className: "range-thumb",
|
|
2445
|
+
style: { left: `${M}%` },
|
|
2446
|
+
disabled: u,
|
|
2447
|
+
onMouseDown: D,
|
|
2448
|
+
onTouchStart: x,
|
|
2449
|
+
onKeyDown: L,
|
|
2450
|
+
onFocus: () => N(!0),
|
|
2451
|
+
onBlur: () => N(!1),
|
|
2452
|
+
"data-active": p || g,
|
|
2453
|
+
role: "slider",
|
|
2454
|
+
"aria-valuemin": s,
|
|
2455
|
+
"aria-valuemax": i,
|
|
2456
|
+
"aria-valuenow": w,
|
|
2457
|
+
"aria-valuetext": `${w}${l ? ` ${l}` : ""}`,
|
|
2458
|
+
"aria-orientation": "horizontal"
|
|
2459
|
+
}
|
|
2460
|
+
)
|
|
2461
|
+
]
|
|
2462
|
+
}
|
|
2463
|
+
)
|
|
2464
|
+
}
|
|
2465
|
+
);
|
|
2466
|
+
};
|
|
2467
|
+
it.displayName = "SingleThumbRange";
|
|
2468
|
+
const lt = ({
|
|
2469
|
+
label: e,
|
|
2470
|
+
helpText: t,
|
|
2471
|
+
errorText: a,
|
|
2472
|
+
value: r = [0, 100],
|
|
2473
|
+
suffix: l,
|
|
2474
|
+
onChange: o,
|
|
2475
|
+
min: s = 0,
|
|
2476
|
+
max: i = 100,
|
|
2477
|
+
step: c = 1,
|
|
2478
|
+
minLabel: f = "Minimum value",
|
|
2479
|
+
maxLabel: u = "Maximum value",
|
|
2480
|
+
id: m,
|
|
2481
|
+
disabled: v,
|
|
2482
|
+
...k
|
|
2483
|
+
}) => {
|
|
2484
|
+
const [g, A] = r, p = Math.max(s, Math.min(i, g)), N = Math.max(s, Math.min(i, A)), w = J(null), O = J(null), z = J(null), [b, D] = j(null), [x, L] = j(null), M = W((d) => i <= s ? 0 : (Math.max(s, Math.min(i, d)) - s) / (i - s) * 100, [s, i]), E = W((d) => {
|
|
2485
|
+
if (!z.current) return s;
|
|
2486
|
+
const h = z.current.getBoundingClientRect(), V = Math.max(0, Math.min(1, (d - h.left) / h.width)), T = s + V * (i - s), K = Math.round(T / c) * c;
|
|
2487
|
+
return Math.max(s, Math.min(i, K));
|
|
2488
|
+
}, [s, i, c]), S = W((d, h) => {
|
|
2489
|
+
const V = E(d);
|
|
2490
|
+
if (h === "min") {
|
|
2491
|
+
const T = Math.min(V, N - c);
|
|
2492
|
+
o == null || o([T, N]);
|
|
2493
|
+
} else {
|
|
2494
|
+
const T = Math.max(V, p + c);
|
|
2495
|
+
o == null || o([p, T]);
|
|
2496
|
+
}
|
|
2497
|
+
}, [E, p, N, c, o]), G = W((d) => (h) => {
|
|
2498
|
+
v || (h.preventDefault(), D(d), L(d), S(h.clientX, d));
|
|
2499
|
+
}, [v, S]);
|
|
2500
|
+
q(() => {
|
|
2501
|
+
if (!b) return;
|
|
2502
|
+
const d = (V) => {
|
|
2503
|
+
S(V.clientX, b);
|
|
2504
|
+
}, h = () => {
|
|
2505
|
+
D(null);
|
|
2506
|
+
};
|
|
2507
|
+
return document.addEventListener("mousemove", d), document.addEventListener("mouseup", h), () => {
|
|
2508
|
+
document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", h);
|
|
2509
|
+
};
|
|
2510
|
+
}, [b, S]);
|
|
2511
|
+
const R = W((d) => (h) => {
|
|
2512
|
+
v || (D(d), L(d), S(h.touches[0].clientX, d));
|
|
2513
|
+
}, [v, S]);
|
|
2514
|
+
q(() => {
|
|
2515
|
+
if (!b) return;
|
|
2516
|
+
const d = (V) => {
|
|
2517
|
+
V.preventDefault(), S(V.touches[0].clientX, b);
|
|
2518
|
+
}, h = () => {
|
|
2519
|
+
D(null);
|
|
2520
|
+
};
|
|
2521
|
+
return document.addEventListener("touchmove", d, { passive: !1 }), document.addEventListener("touchend", h), () => {
|
|
2522
|
+
document.removeEventListener("touchmove", d), document.removeEventListener("touchend", h);
|
|
2523
|
+
};
|
|
2524
|
+
}, [b, S]);
|
|
2525
|
+
const F = W((d) => (h) => {
|
|
2526
|
+
if (v) return;
|
|
2527
|
+
const V = d === "min" ? p : N;
|
|
2528
|
+
let T = V;
|
|
2529
|
+
switch (h.key) {
|
|
2530
|
+
case "ArrowRight":
|
|
2531
|
+
case "ArrowUp":
|
|
2532
|
+
h.preventDefault(), T = Math.min(V + c, i);
|
|
2533
|
+
break;
|
|
2534
|
+
case "ArrowLeft":
|
|
2535
|
+
case "ArrowDown":
|
|
2536
|
+
h.preventDefault(), T = Math.max(V - c, s);
|
|
2537
|
+
break;
|
|
2538
|
+
case "Home":
|
|
2539
|
+
h.preventDefault(), T = d === "min" ? s : p + c;
|
|
2540
|
+
break;
|
|
2541
|
+
case "End":
|
|
2542
|
+
h.preventDefault(), T = d === "max" ? i : N - c;
|
|
2543
|
+
break;
|
|
2544
|
+
case "PageUp":
|
|
2545
|
+
h.preventDefault(), T = Math.min(V + c * 10, i);
|
|
2546
|
+
break;
|
|
2547
|
+
case "PageDown":
|
|
2548
|
+
h.preventDefault(), T = Math.max(V - c * 10, s);
|
|
2549
|
+
break;
|
|
2550
|
+
default:
|
|
2551
|
+
return;
|
|
2552
|
+
}
|
|
2553
|
+
if (d === "min") {
|
|
2554
|
+
const K = Math.min(T, N - c);
|
|
2555
|
+
o == null || o([K, N]);
|
|
2556
|
+
} else {
|
|
2557
|
+
const K = Math.max(T, p + c);
|
|
2558
|
+
o == null || o([p, K]);
|
|
2559
|
+
}
|
|
2560
|
+
}, [v, p, N, s, i, c, o]), H = M(p), $ = M(N);
|
|
2561
|
+
return /* @__PURE__ */ n(
|
|
2562
|
+
ee,
|
|
2563
|
+
{
|
|
2564
|
+
customLabel: e && /* @__PURE__ */ I(_, { "data-range-meta": !0, children: [
|
|
2565
|
+
/* @__PURE__ */ n(
|
|
2566
|
+
ye,
|
|
2567
|
+
{
|
|
2568
|
+
className: "range-label",
|
|
2569
|
+
label: e,
|
|
2570
|
+
htmlFor: m
|
|
2571
|
+
}
|
|
2572
|
+
),
|
|
2573
|
+
/* @__PURE__ */ I(Y, { className: "range-value", children: [
|
|
2574
|
+
p,
|
|
2575
|
+
"–",
|
|
2576
|
+
N,
|
|
2577
|
+
l && l
|
|
2578
|
+
] })
|
|
2579
|
+
] }),
|
|
2580
|
+
helpText: t,
|
|
2581
|
+
errorText: a,
|
|
2582
|
+
children: /* @__PURE__ */ I(
|
|
2583
|
+
_,
|
|
2584
|
+
{
|
|
2585
|
+
ref: z,
|
|
2586
|
+
"data-range-dual": !0,
|
|
2587
|
+
className: v ? "disabled" : "",
|
|
2588
|
+
role: "group",
|
|
2589
|
+
"aria-labelledby": e ? `${m}-label` : void 0,
|
|
2590
|
+
children: [
|
|
2591
|
+
/* @__PURE__ */ n(_, { className: "range-track", "aria-hidden": "true" }),
|
|
2592
|
+
/* @__PURE__ */ n(
|
|
2593
|
+
_,
|
|
2594
|
+
{
|
|
2595
|
+
className: "range-track-fill",
|
|
2596
|
+
style: {
|
|
2597
|
+
left: `${H}%`,
|
|
2598
|
+
right: `${100 - $}%`
|
|
2599
|
+
},
|
|
2600
|
+
"aria-hidden": "true"
|
|
2601
|
+
}
|
|
2602
|
+
),
|
|
2603
|
+
/* @__PURE__ */ n(
|
|
2604
|
+
"button",
|
|
2605
|
+
{
|
|
2606
|
+
ref: w,
|
|
2607
|
+
id: `${m}-min`,
|
|
2608
|
+
type: "button",
|
|
2609
|
+
className: "range-thumb range-thumb-min",
|
|
2610
|
+
style: { left: `${H}%` },
|
|
2611
|
+
disabled: v,
|
|
2612
|
+
onMouseDown: G("min"),
|
|
2613
|
+
onTouchStart: R("min"),
|
|
2614
|
+
onKeyDown: F("min"),
|
|
2615
|
+
onFocus: () => L("min"),
|
|
2616
|
+
onBlur: () => L(null),
|
|
2617
|
+
"data-active": x === "min" || b === "min",
|
|
2618
|
+
role: "slider",
|
|
2619
|
+
"aria-label": f,
|
|
2620
|
+
"aria-valuemin": s,
|
|
2621
|
+
"aria-valuemax": N - c,
|
|
2622
|
+
"aria-valuenow": p,
|
|
2623
|
+
"aria-valuetext": `${p}${l ? ` ${l}` : ""}`,
|
|
2624
|
+
"aria-orientation": "horizontal"
|
|
2625
|
+
}
|
|
2626
|
+
),
|
|
2627
|
+
/* @__PURE__ */ n(
|
|
2628
|
+
"button",
|
|
2629
|
+
{
|
|
2630
|
+
ref: O,
|
|
2631
|
+
id: `${m}-max`,
|
|
2632
|
+
type: "button",
|
|
2633
|
+
className: "range-thumb range-thumb-max",
|
|
2634
|
+
style: { left: `${$}%` },
|
|
2635
|
+
disabled: v,
|
|
2636
|
+
onMouseDown: G("max"),
|
|
2637
|
+
onTouchStart: R("max"),
|
|
2638
|
+
onKeyDown: F("max"),
|
|
2639
|
+
onFocus: () => L("max"),
|
|
2640
|
+
onBlur: () => L(null),
|
|
2641
|
+
"data-active": x === "max" || b === "max",
|
|
2642
|
+
role: "slider",
|
|
2643
|
+
"aria-label": u,
|
|
2644
|
+
"aria-valuemin": p + c,
|
|
2645
|
+
"aria-valuemax": i,
|
|
2646
|
+
"aria-valuenow": N,
|
|
2647
|
+
"aria-valuetext": `${N}${l ? ` ${l}` : ""}`,
|
|
2648
|
+
"aria-orientation": "horizontal"
|
|
2649
|
+
}
|
|
2650
|
+
)
|
|
2651
|
+
]
|
|
2652
|
+
}
|
|
2653
|
+
)
|
|
2654
|
+
}
|
|
2655
|
+
);
|
|
2656
|
+
};
|
|
2657
|
+
lt.displayName = "DualThumbRange";
|
|
2658
|
+
const Xt = y.forwardRef(
|
|
2659
|
+
({
|
|
2660
|
+
label: e,
|
|
2661
|
+
value: t,
|
|
2662
|
+
height: a,
|
|
2663
|
+
suffix: r,
|
|
2664
|
+
showOptimumMarker: l,
|
|
2665
|
+
ariaLabel: o,
|
|
2666
|
+
description: s,
|
|
2667
|
+
min: i,
|
|
2668
|
+
max: c,
|
|
2669
|
+
low: f,
|
|
2670
|
+
high: u,
|
|
2671
|
+
optimum: m,
|
|
2672
|
+
...v
|
|
2673
|
+
}, k) => {
|
|
2674
|
+
const g = m ? (m - i) / (c - i) * 100 : 0, A = () => {
|
|
2675
|
+
const p = (t - i) / (c - i) * 100;
|
|
2676
|
+
let N;
|
|
2677
|
+
return t <= f ? N = "Low" : t >= u ? N = "High" : N = "Normal", `Current value is ${t}${r || ""} (${p.toFixed(1)}%). Status: ${N}`;
|
|
2678
|
+
};
|
|
2679
|
+
return /* @__PURE__ */ I(
|
|
2680
|
+
"div",
|
|
2681
|
+
{
|
|
2682
|
+
role: "region",
|
|
2683
|
+
"aria-label": o || "Meter indicator",
|
|
2684
|
+
children: [
|
|
2685
|
+
e && /* @__PURE__ */ I(
|
|
2686
|
+
P,
|
|
2687
|
+
{
|
|
2688
|
+
as: "div",
|
|
2689
|
+
"data-meter-meta": !0,
|
|
2690
|
+
id: `meter-label-${e.toLowerCase().replace(/\s+/g, "-")}`,
|
|
2691
|
+
children: [
|
|
2692
|
+
/* @__PURE__ */ n(Y, { children: e }),
|
|
2693
|
+
/* @__PURE__ */ I(Y, { children: [
|
|
2694
|
+
t,
|
|
2695
|
+
r && r
|
|
2696
|
+
] })
|
|
2697
|
+
]
|
|
2698
|
+
}
|
|
2699
|
+
),
|
|
2700
|
+
/* @__PURE__ */ I(
|
|
2701
|
+
"div",
|
|
2702
|
+
{
|
|
2703
|
+
className: "meter-wrapper",
|
|
2704
|
+
role: "presentation",
|
|
2705
|
+
children: [
|
|
2706
|
+
/* @__PURE__ */ n(
|
|
2707
|
+
P,
|
|
2708
|
+
{
|
|
2709
|
+
as: "meter",
|
|
2710
|
+
"data-meter": !0,
|
|
2711
|
+
ref: k,
|
|
2712
|
+
value: t,
|
|
2713
|
+
min: i,
|
|
2714
|
+
max: c,
|
|
2715
|
+
low: f,
|
|
2716
|
+
high: u,
|
|
2717
|
+
optimum: m,
|
|
2718
|
+
...v,
|
|
2719
|
+
style: { height: a },
|
|
2720
|
+
"aria-label": e || o || "Progress meter",
|
|
2721
|
+
"aria-valuemin": i,
|
|
2722
|
+
"aria-valuemax": c,
|
|
2723
|
+
"aria-valuenow": t,
|
|
2724
|
+
"aria-valuetext": A(),
|
|
2725
|
+
"aria-describedby": s ? `meter-description-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}` : void 0
|
|
2726
|
+
}
|
|
2727
|
+
),
|
|
2728
|
+
l && m && /* @__PURE__ */ n(
|
|
2729
|
+
"div",
|
|
2730
|
+
{
|
|
2731
|
+
className: "optimum-marker",
|
|
2732
|
+
style: { left: `calc(${g}% - var(--meter-border-width))` },
|
|
2733
|
+
title: `Optimum: ${m}`,
|
|
2734
|
+
role: "presentation",
|
|
2735
|
+
"aria-hidden": "true"
|
|
2736
|
+
}
|
|
2737
|
+
)
|
|
2738
|
+
]
|
|
2739
|
+
}
|
|
2740
|
+
),
|
|
2741
|
+
s && /* @__PURE__ */ n(
|
|
2742
|
+
"div",
|
|
2743
|
+
{
|
|
2744
|
+
id: `meter-description-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`,
|
|
2745
|
+
className: "sr-only",
|
|
2746
|
+
children: s
|
|
2747
|
+
}
|
|
2748
|
+
)
|
|
2749
|
+
]
|
|
2750
|
+
}
|
|
2751
|
+
);
|
|
2752
|
+
}
|
|
2753
|
+
);
|
|
2754
|
+
Xt.displayName = "Meter";
|
|
2755
|
+
const jt = y.forwardRef(
|
|
2756
|
+
({
|
|
2757
|
+
id: e,
|
|
2758
|
+
children: t,
|
|
2759
|
+
classNames: a = [],
|
|
2760
|
+
isOpen: r = !1,
|
|
2761
|
+
onClose: l,
|
|
2762
|
+
isDismissible: o = !0,
|
|
2763
|
+
showBackdrop: s,
|
|
2764
|
+
blurBackdrop: i,
|
|
2765
|
+
label: c,
|
|
2766
|
+
description: f,
|
|
2767
|
+
...u
|
|
2768
|
+
}, m) => {
|
|
2769
|
+
const v = `${e}`, k = f ? `${v}-description` : void 0;
|
|
2770
|
+
return s && a.push("show-backdrop"), i && a.push("blur-backdrop"), q(() => {
|
|
2771
|
+
const g = document.querySelector(`#${v}[data-modal]`);
|
|
2772
|
+
if (!(!g || !(g instanceof HTMLElement)))
|
|
2773
|
+
if (r) {
|
|
2774
|
+
g.showPopover();
|
|
2775
|
+
const A = g.querySelectorAll(
|
|
2776
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
2777
|
+
);
|
|
2778
|
+
A.length && A[0].focus();
|
|
2779
|
+
} else
|
|
2780
|
+
g.matches(":popover-open") && g.hidePopover();
|
|
2781
|
+
}, [r, v]), q(() => {
|
|
2782
|
+
const g = (A) => {
|
|
2783
|
+
A.key === "Escape" && o && r && l && l();
|
|
2784
|
+
};
|
|
2785
|
+
return document.addEventListener("keydown", g), () => document.removeEventListener("keydown", g);
|
|
2786
|
+
}, [o, r, l]), /* @__PURE__ */ I(
|
|
2787
|
+
P,
|
|
2788
|
+
{
|
|
2789
|
+
as: "dialog",
|
|
2790
|
+
id: v,
|
|
2791
|
+
"data-modal": !0,
|
|
2792
|
+
popover: o ? "auto" : "manual",
|
|
2793
|
+
ref: m,
|
|
2794
|
+
classNames: a,
|
|
2795
|
+
role: "dialog",
|
|
2796
|
+
"aria-modal": "true",
|
|
2797
|
+
"aria-label": c || "Modal dialog",
|
|
2798
|
+
"aria-describedby": k,
|
|
2799
|
+
...u,
|
|
2800
|
+
children: [
|
|
2801
|
+
o && l && /* @__PURE__ */ n(
|
|
2802
|
+
Y,
|
|
2803
|
+
{
|
|
2804
|
+
className: "dismiss-button",
|
|
2805
|
+
onClick: l,
|
|
2806
|
+
"aria-label": "Close modal",
|
|
2807
|
+
tabIndex: 0,
|
|
2808
|
+
children: "×"
|
|
2809
|
+
}
|
|
2810
|
+
),
|
|
2811
|
+
f && /* @__PURE__ */ n("div", { id: k, className: "sr-only", children: f }),
|
|
2812
|
+
/* @__PURE__ */ n("div", { role: "document", children: t })
|
|
2813
|
+
]
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
}
|
|
2817
|
+
);
|
|
2818
|
+
jt.displayName = "Modal";
|
|
2819
|
+
const Ut = y.forwardRef(
|
|
2820
|
+
({
|
|
2821
|
+
position: e = "right",
|
|
2822
|
+
anchor: t = "top",
|
|
2823
|
+
order: a = "new-on-top",
|
|
2824
|
+
children: r,
|
|
2825
|
+
label: l,
|
|
2826
|
+
...o
|
|
2827
|
+
}, s) => {
|
|
2828
|
+
let i = [];
|
|
2829
|
+
return e && i.push(e), t && i.push(t), a && i.push(a), y.Children.count(r) === 0 ? null : /* @__PURE__ */ n(
|
|
2830
|
+
P,
|
|
2831
|
+
{
|
|
2832
|
+
as: "section",
|
|
2833
|
+
"data-notifications-wrapper": !0,
|
|
2834
|
+
ref: s,
|
|
2835
|
+
classNames: i,
|
|
2836
|
+
"aria-label": l || "Notifications",
|
|
2837
|
+
"aria-relevant": "additions removals",
|
|
2838
|
+
role: "log",
|
|
2839
|
+
...o,
|
|
2840
|
+
children: r
|
|
2841
|
+
}
|
|
2842
|
+
);
|
|
2843
|
+
}
|
|
2844
|
+
);
|
|
2845
|
+
Ut.displayName = "NotificationsWrapper";
|
|
2846
|
+
const qt = y.forwardRef(
|
|
2847
|
+
({
|
|
2848
|
+
showWhen: e,
|
|
2849
|
+
closeWhen: t,
|
|
2850
|
+
kind: a = "info",
|
|
2851
|
+
children: r,
|
|
2852
|
+
isDismissible: l,
|
|
2853
|
+
secondsToShowFor: o,
|
|
2854
|
+
title: s,
|
|
2855
|
+
description: i,
|
|
2856
|
+
...c
|
|
2857
|
+
}, f) => {
|
|
2858
|
+
let u = [];
|
|
2859
|
+
const [m, v] = j(e);
|
|
2860
|
+
q(() => {
|
|
2861
|
+
e && v(!0);
|
|
2862
|
+
const N = e ? setTimeout(() => {
|
|
2863
|
+
t();
|
|
2864
|
+
}, (o ?? 8) * 1e3) : void 0;
|
|
2865
|
+
return () => {
|
|
2866
|
+
N && clearTimeout(N);
|
|
2867
|
+
};
|
|
2868
|
+
}, [e, o, t]), a && u.push(a), l && u.push("dismissible");
|
|
2869
|
+
const k = (N) => {
|
|
2870
|
+
N.preventDefault(), t();
|
|
2871
|
+
}, g = (N) => {
|
|
2872
|
+
(N.key === "Enter" || N.key === " ") && (N.preventDefault(), t());
|
|
2873
|
+
}, A = () => {
|
|
2874
|
+
e || v(!1);
|
|
2875
|
+
}, p = {
|
|
2876
|
+
info: "status",
|
|
2877
|
+
warning: "alert",
|
|
2878
|
+
error: "alert",
|
|
2879
|
+
success: "status"
|
|
2880
|
+
};
|
|
2881
|
+
return m && /* @__PURE__ */ I(
|
|
2882
|
+
P,
|
|
2883
|
+
{
|
|
2884
|
+
as: "div",
|
|
2885
|
+
"data-notification-item": !0,
|
|
2886
|
+
ref: f,
|
|
2887
|
+
classNames: [...u, e ? "" : "dismissed"],
|
|
2888
|
+
onTransitionEnd: A,
|
|
2889
|
+
role: p[a],
|
|
2890
|
+
"aria-live": a === "error" || a === "warning" ? "assertive" : "polite",
|
|
2891
|
+
"aria-atomic": "true",
|
|
2892
|
+
"aria-label": s,
|
|
2893
|
+
...c,
|
|
2894
|
+
children: [
|
|
2895
|
+
/* @__PURE__ */ I("div", { id: `notification-content-${c.id}`, children: [
|
|
2896
|
+
r,
|
|
2897
|
+
i && /* @__PURE__ */ n("span", { className: "sr-only", children: i })
|
|
2898
|
+
] }),
|
|
2899
|
+
l && /* @__PURE__ */ n(
|
|
2900
|
+
_,
|
|
2901
|
+
{
|
|
2902
|
+
className: "dismiss-button",
|
|
2903
|
+
onClick: k,
|
|
2904
|
+
onKeyDown: g,
|
|
2905
|
+
"aria-label": "Dismiss notification",
|
|
2906
|
+
tabIndex: 0,
|
|
2907
|
+
children: /* @__PURE__ */ n("span", { className: "sr-only", children: "Close notification" })
|
|
2908
|
+
}
|
|
2909
|
+
)
|
|
2910
|
+
]
|
|
2911
|
+
}
|
|
2912
|
+
);
|
|
2913
|
+
}
|
|
2914
|
+
);
|
|
2915
|
+
qt.displayName = "NotificationItem";
|
|
2916
|
+
const ct = y.forwardRef(
|
|
2917
|
+
({
|
|
2918
|
+
size: e = "medium",
|
|
2919
|
+
loadingText: t = "Loading...",
|
|
2920
|
+
...a
|
|
2921
|
+
}, r) => {
|
|
2922
|
+
let l = [];
|
|
2923
|
+
return e && l.push(`size-${e}`), /* @__PURE__ */ n(
|
|
2924
|
+
P,
|
|
2925
|
+
{
|
|
2926
|
+
as: "div",
|
|
2927
|
+
"data-spinner": !0,
|
|
2928
|
+
ref: r,
|
|
2929
|
+
classNames: l,
|
|
2930
|
+
role: "status",
|
|
2931
|
+
"aria-busy": "true",
|
|
2932
|
+
"aria-live": "polite",
|
|
2933
|
+
"aria-label": t,
|
|
2934
|
+
...a
|
|
2935
|
+
}
|
|
2936
|
+
);
|
|
2937
|
+
}
|
|
2938
|
+
);
|
|
2939
|
+
ct.displayName = "Spinner";
|
|
2940
|
+
const Xe = (e, t) => {
|
|
2941
|
+
const a = t - e + 1;
|
|
2942
|
+
return Array.from({ length: a }, (r, l) => e + l);
|
|
2943
|
+
}, Ct = ({
|
|
2944
|
+
totalItems: e,
|
|
2945
|
+
currentPage: t,
|
|
2946
|
+
itemsToShowEachSide: a
|
|
2947
|
+
}) => {
|
|
2948
|
+
const r = e;
|
|
2949
|
+
return {
|
|
2950
|
+
items: (() => {
|
|
2951
|
+
const o = a * 2 + 1;
|
|
2952
|
+
let s = [];
|
|
2953
|
+
if (r <= o)
|
|
2954
|
+
s = Xe(1, r);
|
|
2955
|
+
else {
|
|
2956
|
+
const i = Math.min(t - 1, a), c = Math.min(r - t, a);
|
|
2957
|
+
s.push(1), t - a > 2 && s.push("...");
|
|
2958
|
+
const f = Math.max(2, t - i), u = Math.min(r - 1, t + c);
|
|
2959
|
+
s.push(...Xe(f, u)), r - t > a + 1 && s.push("..."), u < r && s.push(r);
|
|
2960
|
+
}
|
|
2961
|
+
return s;
|
|
2962
|
+
})(),
|
|
2963
|
+
totalPages: r,
|
|
2964
|
+
rangeStart: t,
|
|
2965
|
+
rangeEnd: t,
|
|
2966
|
+
hasPrevPage: t > 1,
|
|
2967
|
+
hasNextPage: t < r
|
|
2968
|
+
};
|
|
2969
|
+
}, Yt = ({
|
|
2970
|
+
type: e,
|
|
2971
|
+
page: t,
|
|
2972
|
+
selected: a,
|
|
2973
|
+
disabled: r,
|
|
2974
|
+
onClick: l,
|
|
2975
|
+
key: o,
|
|
2976
|
+
...s
|
|
2977
|
+
}) => {
|
|
2978
|
+
if (e === "ellipsis")
|
|
2979
|
+
return /* @__PURE__ */ n(Y, { className: "pagination-ellipsis", children: "..." });
|
|
2980
|
+
const i = {
|
|
2981
|
+
type: "button",
|
|
2982
|
+
className: `pagination-item ${a ? "selected" : ""} ${r ? "disabled" : ""}`,
|
|
2983
|
+
onClick: l,
|
|
2984
|
+
disabled: r,
|
|
2985
|
+
...s
|
|
2986
|
+
};
|
|
2987
|
+
let c;
|
|
2988
|
+
switch (e) {
|
|
2989
|
+
case "first":
|
|
2990
|
+
c = c = /* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", children: [
|
|
2991
|
+
/* @__PURE__ */ n("line", { x1: "5", y1: "18", x2: "5", y2: "6" }),
|
|
2992
|
+
/* @__PURE__ */ n("polyline", { points: "14 18 9 12 14 6" }),
|
|
2993
|
+
/* @__PURE__ */ n("line", { x1: "10", y1: "12", x2: "19", y2: "12" })
|
|
2994
|
+
] });
|
|
2995
|
+
break;
|
|
2996
|
+
case "previous":
|
|
2997
|
+
c = /* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", children: [
|
|
2998
|
+
/* @__PURE__ */ n("polyline", { points: "12 18 7 12 12 6" }),
|
|
2999
|
+
/* @__PURE__ */ n("line", { x1: "8", y1: "12", x2: "17", y2: "12" })
|
|
3000
|
+
] });
|
|
3001
|
+
break;
|
|
3002
|
+
case "next":
|
|
3003
|
+
c = c = /* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", children: [
|
|
3004
|
+
/* @__PURE__ */ n("polyline", { points: "12 6 17 12 12 18" }),
|
|
3005
|
+
/* @__PURE__ */ n("line", { x1: "16", y1: "12", x2: "7", y2: "12" })
|
|
3006
|
+
] });
|
|
3007
|
+
break;
|
|
3008
|
+
case "last":
|
|
3009
|
+
c = c = /* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", children: [
|
|
3010
|
+
/* @__PURE__ */ n("polyline", { points: "10 6 15 12 10 18" }),
|
|
3011
|
+
/* @__PURE__ */ n("line", { x1: "19", y1: "6", x2: "19", y2: "18" }),
|
|
3012
|
+
/* @__PURE__ */ n("line", { x1: "14", y1: "12", x2: "5", y2: "12" })
|
|
3013
|
+
] });
|
|
3014
|
+
break;
|
|
3015
|
+
default:
|
|
3016
|
+
c = t;
|
|
3017
|
+
}
|
|
3018
|
+
return /* @__PURE__ */ n(
|
|
3019
|
+
Be,
|
|
3020
|
+
{
|
|
3021
|
+
kind: "custom",
|
|
3022
|
+
...i,
|
|
3023
|
+
children: c
|
|
3024
|
+
}
|
|
3025
|
+
);
|
|
3026
|
+
}, Jt = y.forwardRef(
|
|
3027
|
+
({
|
|
3028
|
+
totalItems: e,
|
|
3029
|
+
currentPage: t,
|
|
3030
|
+
onPageChange: a,
|
|
3031
|
+
itemsToShowEachSide: r = 1,
|
|
3032
|
+
kind: l = "plain",
|
|
3033
|
+
showGoToFirstItemButton: o = !0,
|
|
3034
|
+
showGoToLastItemButton: s = !0,
|
|
3035
|
+
showPreviousButton: i = !0,
|
|
3036
|
+
showNextButton: c = !0,
|
|
3037
|
+
showGoToInput: f = !1,
|
|
3038
|
+
disabled: u = !1,
|
|
3039
|
+
hideDisabledButtons: m = !1,
|
|
3040
|
+
renderItem: v = Yt,
|
|
3041
|
+
isLoading: k = !1,
|
|
3042
|
+
loadingText: g,
|
|
3043
|
+
emptyText: A,
|
|
3044
|
+
itemDisplayText: p = "page",
|
|
3045
|
+
...N
|
|
3046
|
+
}, w) => {
|
|
3047
|
+
const {
|
|
3048
|
+
items: O,
|
|
3049
|
+
totalPages: z,
|
|
3050
|
+
rangeStart: b,
|
|
3051
|
+
hasPrevPage: D,
|
|
3052
|
+
hasNextPage: x
|
|
3053
|
+
} = Ct({
|
|
3054
|
+
totalItems: e,
|
|
3055
|
+
currentPage: t,
|
|
3056
|
+
itemsToShowEachSide: r
|
|
3057
|
+
}), [L, M] = y.useState(""), E = (R) => {
|
|
3058
|
+
M(R.target.value);
|
|
3059
|
+
}, S = (R) => {
|
|
3060
|
+
if (R.key === "Enter") {
|
|
3061
|
+
const F = parseInt(L);
|
|
3062
|
+
!isNaN(F) && F >= 1 && F <= z && (a(F), M(""));
|
|
3063
|
+
}
|
|
3064
|
+
};
|
|
3065
|
+
if (e === 0)
|
|
3066
|
+
return /* @__PURE__ */ n(Y, { className: "pagination-empty", children: A || "No items to display" });
|
|
3067
|
+
let G = ["pagination"];
|
|
3068
|
+
return l && G.push(l), u && G.push("disabled"), k && G.push("loading"), /* @__PURE__ */ I(
|
|
3069
|
+
P,
|
|
3070
|
+
{
|
|
3071
|
+
as: "nav",
|
|
3072
|
+
"data-pagination": !0,
|
|
3073
|
+
ref: w,
|
|
3074
|
+
classNames: G,
|
|
3075
|
+
role: "navigation",
|
|
3076
|
+
"aria-label": "pagination",
|
|
3077
|
+
...N,
|
|
3078
|
+
children: [
|
|
3079
|
+
/* @__PURE__ */ I(_, { className: "pagination-controls", children: [
|
|
3080
|
+
o && (!m || D) && v({
|
|
3081
|
+
type: "first",
|
|
3082
|
+
disabled: !D || u,
|
|
3083
|
+
selected: !1,
|
|
3084
|
+
onClick: () => a(1)
|
|
3085
|
+
}),
|
|
3086
|
+
i && (!m || D) && v({
|
|
3087
|
+
type: "previous",
|
|
3088
|
+
disabled: !D || u,
|
|
3089
|
+
selected: !1,
|
|
3090
|
+
onClick: () => a(t - 1)
|
|
3091
|
+
}),
|
|
3092
|
+
O.map((R, F) => {
|
|
3093
|
+
const H = R === "..." ? {
|
|
3094
|
+
key: `ellipsis-${F}`,
|
|
3095
|
+
type: "ellipsis",
|
|
3096
|
+
selected: !1,
|
|
3097
|
+
disabled: !0
|
|
3098
|
+
} : {
|
|
3099
|
+
key: R.toString(),
|
|
3100
|
+
type: "page",
|
|
3101
|
+
page: R,
|
|
3102
|
+
selected: R === t,
|
|
3103
|
+
disabled: u,
|
|
3104
|
+
"aria-current": R === t ? "page" : void 0,
|
|
3105
|
+
onClick: () => a(R)
|
|
3106
|
+
};
|
|
3107
|
+
return v(H);
|
|
3108
|
+
}),
|
|
3109
|
+
c && (!m || x) && v({
|
|
3110
|
+
type: "next",
|
|
3111
|
+
disabled: !x || u,
|
|
3112
|
+
selected: !1,
|
|
3113
|
+
onClick: () => a(t + 1)
|
|
3114
|
+
}),
|
|
3115
|
+
s && (!m || x) && v({
|
|
3116
|
+
type: "last",
|
|
3117
|
+
disabled: !x || u,
|
|
3118
|
+
selected: !1,
|
|
3119
|
+
onClick: () => a(z)
|
|
3120
|
+
}),
|
|
3121
|
+
k && /* @__PURE__ */ I(_, { className: "pagination-loading", children: [
|
|
3122
|
+
/* @__PURE__ */ n(ct, {}),
|
|
3123
|
+
g && /* @__PURE__ */ n(Y, { size: "small", children: g })
|
|
3124
|
+
] })
|
|
3125
|
+
] }),
|
|
3126
|
+
/* @__PURE__ */ I(_, { className: "pagination-info", children: [
|
|
3127
|
+
/* @__PURE__ */ I(Y, { size: "small", children: [
|
|
3128
|
+
"Showing ",
|
|
3129
|
+
p,
|
|
3130
|
+
" ",
|
|
3131
|
+
b,
|
|
3132
|
+
" of ",
|
|
3133
|
+
e
|
|
3134
|
+
] }),
|
|
3135
|
+
f && /* @__PURE__ */ n(_, { className: "pagination-go-to", children: /* @__PURE__ */ n(
|
|
3136
|
+
"input",
|
|
3137
|
+
{
|
|
3138
|
+
type: "number",
|
|
3139
|
+
min: 1,
|
|
3140
|
+
max: z,
|
|
3141
|
+
value: L,
|
|
3142
|
+
onChange: E,
|
|
3143
|
+
onKeyDown: S,
|
|
3144
|
+
placeholder: `Go to ${p}`,
|
|
3145
|
+
"aria-label": `Go to ${p}`,
|
|
3146
|
+
disabled: u
|
|
3147
|
+
}
|
|
3148
|
+
) })
|
|
3149
|
+
] })
|
|
3150
|
+
]
|
|
3151
|
+
}
|
|
3152
|
+
);
|
|
3153
|
+
}
|
|
3154
|
+
);
|
|
3155
|
+
Jt.displayName = "Pagination";
|
|
3156
|
+
const Zt = y.forwardRef(
|
|
3157
|
+
({
|
|
3158
|
+
label: e,
|
|
3159
|
+
value: t,
|
|
3160
|
+
height: a,
|
|
3161
|
+
max: r = 100,
|
|
3162
|
+
shape: l,
|
|
3163
|
+
bgColor: o,
|
|
3164
|
+
bgColour: s,
|
|
3165
|
+
fillColor: i,
|
|
3166
|
+
fillColour: c,
|
|
3167
|
+
...f
|
|
3168
|
+
}, u) => {
|
|
3169
|
+
const m = Math.max(0, Math.min(r, Number(t) || 0)), v = `${m}${f.suffix || ""}`, k = s || o, g = c || i, A = {
|
|
3170
|
+
height: a,
|
|
3171
|
+
...k && { "--progress-bar-bg": `var(--${k})` },
|
|
3172
|
+
...g && { "--progress-bar-fill": `var(--${g})` }
|
|
3173
|
+
};
|
|
3174
|
+
return /* @__PURE__ */ I(ve, { children: [
|
|
3175
|
+
e && /* @__PURE__ */ I(
|
|
3176
|
+
P,
|
|
3177
|
+
{
|
|
3178
|
+
as: "div",
|
|
3179
|
+
"data-progress-bar-meta": !0,
|
|
3180
|
+
"aria-hidden": "true",
|
|
3181
|
+
children: [
|
|
3182
|
+
/* @__PURE__ */ n(Y, { children: e }),
|
|
3183
|
+
/* @__PURE__ */ n(Y, { children: v })
|
|
3184
|
+
]
|
|
3185
|
+
}
|
|
3186
|
+
),
|
|
3187
|
+
/* @__PURE__ */ n(
|
|
3188
|
+
P,
|
|
3189
|
+
{
|
|
3190
|
+
as: "progress",
|
|
3191
|
+
"data-progress-bar": !0,
|
|
3192
|
+
ref: u,
|
|
3193
|
+
value: m,
|
|
3194
|
+
max: r,
|
|
3195
|
+
"aria-label": e,
|
|
3196
|
+
"aria-valuemin": 0,
|
|
3197
|
+
"aria-valuemax": r,
|
|
3198
|
+
"aria-valuenow": m,
|
|
3199
|
+
"aria-valuetext": `${e ? `${e}: ` : ""}${v}`,
|
|
3200
|
+
shape: l,
|
|
3201
|
+
...f,
|
|
3202
|
+
style: A
|
|
3203
|
+
}
|
|
3204
|
+
)
|
|
3205
|
+
] });
|
|
3206
|
+
}
|
|
3207
|
+
);
|
|
3208
|
+
Zt.displayName = "ProgressBar";
|
|
3209
|
+
const Le = Ye({
|
|
3210
|
+
isSelected: () => !1,
|
|
3211
|
+
toggleSelection: () => {
|
|
3212
|
+
},
|
|
3213
|
+
showTickIcon: !1,
|
|
3214
|
+
tickPosition: "top-right",
|
|
3215
|
+
selectAllOptions: () => {
|
|
3216
|
+
},
|
|
3217
|
+
clearAllOptions: () => {
|
|
3218
|
+
},
|
|
3219
|
+
setSelectedOptions: () => {
|
|
3220
|
+
},
|
|
3221
|
+
setSelectedIds: () => {
|
|
3222
|
+
},
|
|
3223
|
+
registerOption: () => {
|
|
3224
|
+
},
|
|
3225
|
+
unregisterOption: () => {
|
|
3226
|
+
}
|
|
3227
|
+
}), Qt = y.forwardRef(
|
|
3228
|
+
({
|
|
3229
|
+
children: e,
|
|
3230
|
+
allowMultipleSelections: t = !1,
|
|
3231
|
+
showTickIcon: a,
|
|
3232
|
+
onSelectionChange: r,
|
|
3233
|
+
tickPosition: l = "top-right",
|
|
3234
|
+
selectionLimit: o,
|
|
3235
|
+
defaultSelectedIds: s,
|
|
3236
|
+
...i
|
|
3237
|
+
}, c) => {
|
|
3238
|
+
const [f, u] = j(
|
|
3239
|
+
s ? new Set(s) : /* @__PURE__ */ new Set()
|
|
3240
|
+
), m = J(/* @__PURE__ */ new Map());
|
|
3241
|
+
q(() => {
|
|
3242
|
+
s && s.size > 0 && (u(new Set(s)), r == null || r(new Set(s)));
|
|
3243
|
+
}, [s, r]);
|
|
3244
|
+
const v = W((b, D) => {
|
|
3245
|
+
m.current.set(b, D);
|
|
3246
|
+
}, []), k = W((b) => {
|
|
3247
|
+
m.current.delete(b);
|
|
3248
|
+
}, []), g = W((b) => {
|
|
3249
|
+
u((D) => {
|
|
3250
|
+
const x = new Set(D);
|
|
3251
|
+
if (t)
|
|
3252
|
+
if (x.has(b))
|
|
3253
|
+
x.delete(b);
|
|
3254
|
+
else {
|
|
3255
|
+
if (o && x.size >= o)
|
|
3256
|
+
return D;
|
|
3257
|
+
x.add(b);
|
|
3258
|
+
}
|
|
3259
|
+
else
|
|
3260
|
+
x.has(b) && D.size === 1 ? x.clear() : (x.clear(), x.add(b));
|
|
3261
|
+
return r == null || r(x), x;
|
|
3262
|
+
});
|
|
3263
|
+
}, [t, r, o]), A = W(() => {
|
|
3264
|
+
t && u((b) => {
|
|
3265
|
+
const D = new Set(b), x = Array.from(m.current.entries()).filter(([M, E]) => !E).map(([M]) => M);
|
|
3266
|
+
return (o ? x.slice(0, o) : x).forEach((M) => D.add(M)), r == null || r(D), D;
|
|
3267
|
+
});
|
|
3268
|
+
}, [t, o, r]), p = W(() => {
|
|
3269
|
+
u(/* @__PURE__ */ new Set()), r == null || r(/* @__PURE__ */ new Set());
|
|
3270
|
+
}, [r]), N = W((b) => {
|
|
3271
|
+
b && (console.log("Setting selected options:", b), u(() => {
|
|
3272
|
+
const D = new Set(b);
|
|
3273
|
+
return r == null || r(D), D;
|
|
3274
|
+
}));
|
|
3275
|
+
}, [r]), w = W((b) => {
|
|
3276
|
+
b && (console.log("Setting selected ids:", Array.from(b)), u(() => {
|
|
3277
|
+
const D = new Set(b);
|
|
3278
|
+
return r == null || r(D), D;
|
|
3279
|
+
}));
|
|
3280
|
+
}, [r]), O = W((b) => f.has(b), [f]);
|
|
3281
|
+
y.useImperativeHandle(c, () => ({
|
|
3282
|
+
selectAllOptions: A,
|
|
3283
|
+
clearAllOptions: p,
|
|
3284
|
+
setSelectedOptions: N,
|
|
3285
|
+
setSelectedIds: w
|
|
3286
|
+
}), [A, p, N, w]);
|
|
3287
|
+
const z = {
|
|
3288
|
+
isSelected: O,
|
|
3289
|
+
toggleSelection: g,
|
|
3290
|
+
showTickIcon: a,
|
|
3291
|
+
tickPosition: l,
|
|
3292
|
+
selectAllOptions: A,
|
|
3293
|
+
clearAllOptions: p,
|
|
3294
|
+
setSelectedOptions: N,
|
|
3295
|
+
setSelectedIds: w,
|
|
3296
|
+
registerOption: v,
|
|
3297
|
+
unregisterOption: k
|
|
3298
|
+
};
|
|
3299
|
+
return /* @__PURE__ */ n(Le.Provider, { value: z, children: /* @__PURE__ */ n(_, { "data-option-cards-group": !0, className: `tick-${l}`, children: e }) });
|
|
3300
|
+
}
|
|
3301
|
+
);
|
|
3302
|
+
Qt.displayName = "OptionCardsGroup";
|
|
3303
|
+
const Ha = (e) => {
|
|
3304
|
+
const t = Ie(Le);
|
|
3305
|
+
return {
|
|
3306
|
+
isSelected: t.isSelected(e),
|
|
3307
|
+
toggleSelection: () => t.toggleSelection(e),
|
|
3308
|
+
showTickIcon: t.showTickIcon
|
|
3309
|
+
};
|
|
3310
|
+
}, _a = () => {
|
|
3311
|
+
const {
|
|
3312
|
+
selectAllOptions: e,
|
|
3313
|
+
clearAllOptions: t,
|
|
3314
|
+
setSelectedOptions: a,
|
|
3315
|
+
setSelectedIds: r
|
|
3316
|
+
} = Ie(Le);
|
|
3317
|
+
return {
|
|
3318
|
+
selectAllOptions: e,
|
|
3319
|
+
clearAllOptions: t,
|
|
3320
|
+
setSelectedOptions: a,
|
|
3321
|
+
setSelectedIds: r
|
|
3322
|
+
};
|
|
3323
|
+
}, Ga = ({ id: e, children: t, disabled: a = !1, ...r }) => {
|
|
3324
|
+
const { isSelected: l, toggleSelection: o, showTickIcon: s, registerOption: i, unregisterOption: c } = Ie(Le), [f, u] = j(!1), [m, v] = j(!0);
|
|
3325
|
+
y.useEffect(() => (i(e, a), () => c(e)), [e, a, i, c]);
|
|
3326
|
+
let k = [];
|
|
3327
|
+
l(e) && k.push("selected"), a && k.push("disabled"), f && k.push("show-deselect");
|
|
3328
|
+
const g = () => {
|
|
3329
|
+
l(e) && !m && u(!0);
|
|
3330
|
+
}, A = () => {
|
|
3331
|
+
u(!1), v(!1);
|
|
3332
|
+
}, p = (w) => {
|
|
3333
|
+
var O;
|
|
3334
|
+
a || (v(!0), u(!1), o(e), (O = r.onClick) == null || O.call(r, w));
|
|
3335
|
+
}, N = (w) => {
|
|
3336
|
+
(w.key === "Enter" || w.key === " ") && !a && (w.preventDefault(), v(!0), u(!1), o(e));
|
|
3337
|
+
};
|
|
3338
|
+
return /* @__PURE__ */ I(
|
|
3339
|
+
P,
|
|
3340
|
+
{
|
|
3341
|
+
as: Ze,
|
|
3342
|
+
"data-option-card": !0,
|
|
3343
|
+
role: "button",
|
|
3344
|
+
tabIndex: a ? -1 : 0,
|
|
3345
|
+
"aria-disabled": a,
|
|
3346
|
+
"aria-selected": l(e),
|
|
3347
|
+
classNames: k,
|
|
3348
|
+
onClick: p,
|
|
3349
|
+
onKeyDown: N,
|
|
3350
|
+
onMouseEnter: g,
|
|
3351
|
+
onMouseLeave: A,
|
|
3352
|
+
...r,
|
|
3353
|
+
children: [
|
|
3354
|
+
s && /* @__PURE__ */ I(ve, { children: [
|
|
3355
|
+
/* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", className: "tick-icon", children: [
|
|
3356
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "11" }),
|
|
3357
|
+
/* @__PURE__ */ n("path", { d: "M8 13 L11 15 L16 9" })
|
|
3358
|
+
] }),
|
|
3359
|
+
/* @__PURE__ */ I("svg", { viewBox: "0 0 24 24", className: "deselect-icon", children: [
|
|
3360
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "11" }),
|
|
3361
|
+
/* @__PURE__ */ n("path", { d: "M8 8 L16 16 M16 8 L8 16" })
|
|
3362
|
+
] })
|
|
3363
|
+
] }),
|
|
3364
|
+
t
|
|
3365
|
+
]
|
|
3366
|
+
}
|
|
3367
|
+
);
|
|
3368
|
+
}, ea = y.forwardRef(
|
|
3369
|
+
({
|
|
3370
|
+
collapsed: e,
|
|
3371
|
+
closeOnClickOutside: t,
|
|
3372
|
+
showMobileSidebar: a,
|
|
3373
|
+
...r
|
|
3374
|
+
}, l) => {
|
|
3375
|
+
const o = J(null);
|
|
3376
|
+
Ce(l, () => o.current), Oe(o, () => {
|
|
3377
|
+
typeof t == "function" && t();
|
|
3378
|
+
});
|
|
3379
|
+
let s = [];
|
|
3380
|
+
return e && s.push("collapsed"), a && s.push("show-sidebar"), /* @__PURE__ */ n(
|
|
3381
|
+
P,
|
|
3382
|
+
{
|
|
3383
|
+
as: "aside",
|
|
3384
|
+
"data-sidebar-wrapper": !0,
|
|
3385
|
+
ref: o,
|
|
3386
|
+
classNames: s,
|
|
3387
|
+
...r
|
|
3388
|
+
}
|
|
3389
|
+
);
|
|
3390
|
+
}
|
|
3391
|
+
);
|
|
3392
|
+
ea.displayName = "SidebarWrapper";
|
|
3393
|
+
const ta = y.forwardRef(
|
|
3394
|
+
({ label: e, ...t }, a) => /* @__PURE__ */ n(
|
|
3395
|
+
P,
|
|
3396
|
+
{
|
|
3397
|
+
as: "main",
|
|
3398
|
+
"data-content-wrapper": !0,
|
|
3399
|
+
ref: a,
|
|
3400
|
+
role: "main",
|
|
3401
|
+
"aria-label": e || "Main content",
|
|
3402
|
+
...t
|
|
3403
|
+
}
|
|
3404
|
+
)
|
|
3405
|
+
);
|
|
3406
|
+
ta.displayName = "ContentWrapper";
|
|
3407
|
+
const aa = y.forwardRef(
|
|
3408
|
+
({ isSticky: e, ...t }, a) => {
|
|
3409
|
+
let r = [];
|
|
3410
|
+
return e && r.push("is-sticky"), /* @__PURE__ */ n(
|
|
3411
|
+
P,
|
|
3412
|
+
{
|
|
3413
|
+
as: "header",
|
|
3414
|
+
"data-sidebar-header": !0,
|
|
3415
|
+
ref: a,
|
|
3416
|
+
classNames: r,
|
|
3417
|
+
...t
|
|
3418
|
+
}
|
|
3419
|
+
);
|
|
3420
|
+
}
|
|
3421
|
+
);
|
|
3422
|
+
aa.displayName = "SidebarHeader";
|
|
3423
|
+
const ra = y.forwardRef(
|
|
3424
|
+
({ hasAlert: e, hasEmptyIcon: t, hasNoIcon: a, children: r, ...l }, o) => {
|
|
3425
|
+
let s = [];
|
|
3426
|
+
return e && s.push("has-alert"), t ? s.push("has-empty-icon") : a && s.push("has-no-icon"), /* @__PURE__ */ I(
|
|
3427
|
+
P,
|
|
3428
|
+
{
|
|
3429
|
+
as: "div",
|
|
3430
|
+
"data-sidebar-item": !0,
|
|
3431
|
+
ref: o,
|
|
3432
|
+
classNames: s,
|
|
3433
|
+
...l,
|
|
3434
|
+
children: [
|
|
3435
|
+
t && /* @__PURE__ */ n(_, { className: "empty-icon-wrapper" }),
|
|
3436
|
+
r
|
|
3437
|
+
]
|
|
3438
|
+
}
|
|
3439
|
+
);
|
|
3440
|
+
}
|
|
3441
|
+
);
|
|
3442
|
+
ra.displayName = "SidebarItem";
|
|
3443
|
+
const sa = y.forwardRef(
|
|
3444
|
+
({ isSticky: e, ...t }, a) => {
|
|
3445
|
+
let r = [];
|
|
3446
|
+
return e && r.push("is-sticky"), /* @__PURE__ */ n(
|
|
3447
|
+
P,
|
|
3448
|
+
{
|
|
3449
|
+
as: "footer",
|
|
3450
|
+
"data-sidebar-footer": !0,
|
|
3451
|
+
ref: a,
|
|
3452
|
+
classNames: r,
|
|
3453
|
+
...t
|
|
3454
|
+
}
|
|
3455
|
+
);
|
|
3456
|
+
}
|
|
3457
|
+
);
|
|
3458
|
+
sa.displayName = "SidebarFooter";
|
|
3459
|
+
const dt = Ye({
|
|
3460
|
+
effect: "wave",
|
|
3461
|
+
animate: !0
|
|
3462
|
+
}), na = y.forwardRef(({
|
|
3463
|
+
variant: e = "line",
|
|
3464
|
+
width: t,
|
|
3465
|
+
height: a,
|
|
3466
|
+
shape: r,
|
|
3467
|
+
effect: l,
|
|
3468
|
+
loadingLabel: o,
|
|
3469
|
+
...s
|
|
3470
|
+
}, i) => {
|
|
3471
|
+
const c = Ie(dt), f = l || c.effect, u = o || c.loadingLabel || "Loading...";
|
|
3472
|
+
let m = [];
|
|
3473
|
+
e && m.push(`variant-${e}`), r && m.push(`shape-${r}`), f && m.push(`effect-${f}`);
|
|
3474
|
+
const v = t || "100%", k = e === "circle" ? (typeof t == "number" ? `${t}px` : t) || a || "100%" : a, g = {
|
|
3475
|
+
width: v,
|
|
3476
|
+
height: k,
|
|
3477
|
+
aspectRatio: e === "circle" ? "1 / 1" : "auto",
|
|
3478
|
+
...s.style
|
|
3479
|
+
};
|
|
3480
|
+
return /* @__PURE__ */ n(
|
|
3481
|
+
P,
|
|
3482
|
+
{
|
|
3483
|
+
as: "div",
|
|
3484
|
+
"data-skeleton": !0,
|
|
3485
|
+
ref: i,
|
|
3486
|
+
classNames: m,
|
|
3487
|
+
style: g,
|
|
3488
|
+
role: "progressbar",
|
|
3489
|
+
"aria-busy": "true",
|
|
3490
|
+
"aria-valuemin": 0,
|
|
3491
|
+
"aria-valuemax": 100,
|
|
3492
|
+
"aria-valuetext": u,
|
|
3493
|
+
"aria-label": u,
|
|
3494
|
+
...s
|
|
3495
|
+
}
|
|
3496
|
+
);
|
|
3497
|
+
});
|
|
3498
|
+
na.displayName = "Skeleton";
|
|
3499
|
+
const oa = y.forwardRef(({
|
|
3500
|
+
effect: e = "wave",
|
|
3501
|
+
spacing: t = "small",
|
|
3502
|
+
animate: a = !0,
|
|
3503
|
+
repeat: r = 1,
|
|
3504
|
+
direction: l = "vertical",
|
|
3505
|
+
children: o,
|
|
3506
|
+
classNames: s = [],
|
|
3507
|
+
loadingLabel: i = "Loading content...",
|
|
3508
|
+
...c
|
|
3509
|
+
}, f) => {
|
|
3510
|
+
const u = [
|
|
3511
|
+
`direction-${l}`,
|
|
3512
|
+
e && `effect-${e}`,
|
|
3513
|
+
...s
|
|
3514
|
+
];
|
|
3515
|
+
return t && u.push(`spacing-${t}`), /* @__PURE__ */ n(dt.Provider, { value: { effect: e, animate: a, loadingLabel: i }, children: /* @__PURE__ */ n(
|
|
3516
|
+
P,
|
|
3517
|
+
{
|
|
3518
|
+
as: "div",
|
|
3519
|
+
ref: f,
|
|
3520
|
+
"data-skeleton-group": !0,
|
|
3521
|
+
classNames: u,
|
|
3522
|
+
role: "alert",
|
|
3523
|
+
"aria-busy": "true",
|
|
3524
|
+
"aria-label": i,
|
|
3525
|
+
...c,
|
|
3526
|
+
children: Array(r).fill(o).map((m, v) => y.cloneElement(m, {
|
|
3527
|
+
key: v
|
|
3528
|
+
}))
|
|
3529
|
+
}
|
|
3530
|
+
) });
|
|
3531
|
+
});
|
|
3532
|
+
oa.displayName = "SkeletonGroup";
|
|
3533
|
+
const ia = y.forwardRef(
|
|
3534
|
+
({
|
|
3535
|
+
bordersFor: e,
|
|
3536
|
+
isStriped: t,
|
|
3537
|
+
highlightRowOnHover: a,
|
|
3538
|
+
isFullWidth: r,
|
|
3539
|
+
alignText: l,
|
|
3540
|
+
caption: o,
|
|
3541
|
+
summary: s,
|
|
3542
|
+
hasColSpan: i,
|
|
3543
|
+
children: c,
|
|
3544
|
+
...f
|
|
3545
|
+
}, u) => {
|
|
3546
|
+
let m = [];
|
|
3547
|
+
e && m.push(`bordered-${e}`), t && m.push("striped"), a && m.push("hoverable"), r && m.push("full-width"), l && m.push(`align-text-${l}`);
|
|
3548
|
+
const v = y.Children.count(c);
|
|
3549
|
+
return /* @__PURE__ */ I(
|
|
3550
|
+
P,
|
|
3551
|
+
{
|
|
3552
|
+
as: "table",
|
|
3553
|
+
classNames: m,
|
|
3554
|
+
ref: u,
|
|
3555
|
+
role: "table",
|
|
3556
|
+
"aria-rowcount": v || void 0,
|
|
3557
|
+
"aria-colcount": i ? void 0 : (() => {
|
|
3558
|
+
if (!c || !y.isValidElement(c)) return;
|
|
3559
|
+
const g = y.Children.toArray(c)[0];
|
|
3560
|
+
if (y.isValidElement(g) && g.props.children)
|
|
3561
|
+
return y.Children.count(g.props.children);
|
|
3562
|
+
})(),
|
|
3563
|
+
summary: s,
|
|
3564
|
+
...f,
|
|
3565
|
+
children: [
|
|
3566
|
+
o && /* @__PURE__ */ n("caption", { children: o }),
|
|
3567
|
+
c
|
|
3568
|
+
]
|
|
3569
|
+
}
|
|
3570
|
+
);
|
|
3571
|
+
}
|
|
3572
|
+
);
|
|
3573
|
+
ia.displayName = "Table";
|
|
3574
|
+
const la = y.forwardRef(
|
|
3575
|
+
({ tabs: e, additionalNavContentWrapper: t, defaultActiveTab: a, align: r = "left", isFullWidth: l, ...o }, s) => {
|
|
3576
|
+
const i = e.findIndex((p) => p.key === a), c = i > -1 ? i : 0, [f, u] = y.useState(
|
|
3577
|
+
e.length > 0 ? e[c] : void 0
|
|
3578
|
+
), [m, v] = y.useState(!1), k = J([]), g = W((p) => {
|
|
3579
|
+
(f == null ? void 0 : f.key) !== p.key && (v(!0), setTimeout(() => {
|
|
3580
|
+
u(p), v(!1);
|
|
3581
|
+
}, 150));
|
|
3582
|
+
}, [f == null ? void 0 : f.key]);
|
|
3583
|
+
q(() => {
|
|
3584
|
+
e.length > 0 ? e.find((N) => N.key === (f == null ? void 0 : f.key)) || u(e[c]) : u(void 0);
|
|
3585
|
+
}, [e, c, f == null ? void 0 : f.key]);
|
|
3586
|
+
const A = W((p, N) => {
|
|
3587
|
+
var z;
|
|
3588
|
+
let w = N;
|
|
3589
|
+
if (p.key === "ArrowRight")
|
|
3590
|
+
w = (N + 1) % e.length;
|
|
3591
|
+
else if (p.key === "ArrowLeft")
|
|
3592
|
+
w = (N - 1 + e.length) % e.length;
|
|
3593
|
+
else if (p.key === "Home")
|
|
3594
|
+
w = 0;
|
|
3595
|
+
else if (p.key === "End")
|
|
3596
|
+
w = e.length - 1;
|
|
3597
|
+
else
|
|
3598
|
+
return;
|
|
3599
|
+
p.preventDefault();
|
|
3600
|
+
const O = e[w];
|
|
3601
|
+
O && (g(O), (z = k.current[w]) == null || z.focus());
|
|
3602
|
+
}, [e, g]);
|
|
3603
|
+
return f ? /* @__PURE__ */ I(
|
|
3604
|
+
P,
|
|
3605
|
+
{
|
|
3606
|
+
as: "div",
|
|
3607
|
+
"data-tabs": !0,
|
|
3608
|
+
ref: s,
|
|
3609
|
+
"data-align": r,
|
|
3610
|
+
"data-full-width": l,
|
|
3611
|
+
...o,
|
|
3612
|
+
children: [
|
|
3613
|
+
/* @__PURE__ */ n(Nt, { "data-tabs-nav": !0, role: "tablist", "aria-label": "Tab Navigation", children: /* @__PURE__ */ I("ul", { className: "tab-labels-list", children: [
|
|
3614
|
+
e.map((p, N) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
|
|
3615
|
+
P,
|
|
3616
|
+
{
|
|
3617
|
+
as: "button",
|
|
3618
|
+
ref: (w) => k.current[N] = w,
|
|
3619
|
+
id: `tab-${p.key}`,
|
|
3620
|
+
role: "tab",
|
|
3621
|
+
"aria-selected": f.key === p.key,
|
|
3622
|
+
"aria-controls": `tab-panel-${p.key}`,
|
|
3623
|
+
tabIndex: f.key === p.key ? 0 : -1,
|
|
3624
|
+
"data-tab-label": !0,
|
|
3625
|
+
"data-active": f.key === p.key,
|
|
3626
|
+
"data-alert": p.hasAlert,
|
|
3627
|
+
onClick: () => g(p),
|
|
3628
|
+
onKeyDown: (w) => A(w, N),
|
|
3629
|
+
className: `tab-button ${f.key === p.key ? "is-active" : ""}`,
|
|
3630
|
+
marginBottom: "nano",
|
|
3631
|
+
children: /* @__PURE__ */ n(
|
|
3632
|
+
Y,
|
|
3633
|
+
{
|
|
3634
|
+
className: `tab-label ${f.key === p.key ? "is-active" : ""} ${p.hasAlert ? "has-alert" : ""}`,
|
|
3635
|
+
children: p.label
|
|
3636
|
+
}
|
|
3637
|
+
)
|
|
3638
|
+
}
|
|
3639
|
+
) }, p.key)),
|
|
3640
|
+
t
|
|
3641
|
+
] }) }),
|
|
3642
|
+
/* @__PURE__ */ n(Qe, { kind: "tertiary", marginTop: "none", marginBottom: "micro" }),
|
|
3643
|
+
/* @__PURE__ */ n(
|
|
3644
|
+
_,
|
|
3645
|
+
{
|
|
3646
|
+
id: `tab-panel-${f.key}`,
|
|
3647
|
+
role: "tabpanel",
|
|
3648
|
+
"aria-labelledby": `tab-${f.key}`,
|
|
3649
|
+
tabIndex: 0,
|
|
3650
|
+
"data-tab-content": !0,
|
|
3651
|
+
"data-exiting": m,
|
|
3652
|
+
children: f.content
|
|
3653
|
+
},
|
|
3654
|
+
f.key
|
|
3655
|
+
)
|
|
3656
|
+
]
|
|
3657
|
+
}
|
|
3658
|
+
) : null;
|
|
3659
|
+
}
|
|
3660
|
+
);
|
|
3661
|
+
la.displayName = "Tabs";
|
|
3662
|
+
const Me = () => {
|
|
3663
|
+
if (typeof window < "u") {
|
|
3664
|
+
const e = window.location.hostname, t = window.location.port;
|
|
3665
|
+
let a = e.replace(/\./g, "-");
|
|
3666
|
+
return t && (a += `-${t}`), `${a}-theme`;
|
|
3667
|
+
}
|
|
3668
|
+
return "fictoan-theme";
|
|
3669
|
+
}, ca = ["", (e) => {
|
|
3670
|
+
}], ut = y.createContext(void 0), Wa = () => {
|
|
3671
|
+
const e = y.useContext(ut);
|
|
3672
|
+
return e === void 0 ? ca : e;
|
|
3673
|
+
}, je = (e, t) => {
|
|
3674
|
+
let a;
|
|
3675
|
+
try {
|
|
3676
|
+
a = localStorage.getItem(e) || void 0;
|
|
3677
|
+
} catch {
|
|
3678
|
+
}
|
|
3679
|
+
return a || t;
|
|
3680
|
+
}, da = y.forwardRef(
|
|
3681
|
+
({ currentTheme: e, themeList: t, children: a, ...r }, l) => {
|
|
3682
|
+
const [o, s] = j(!1), [i, c] = j(() => je(Me()) || e), f = W(
|
|
3683
|
+
(u) => {
|
|
3684
|
+
const m = typeof u == "function" ? u(i) : u;
|
|
3685
|
+
if (!t.includes(m)) {
|
|
3686
|
+
const v = t[0];
|
|
3687
|
+
c(v), document.documentElement.className = "", document.documentElement.classList.add(v);
|
|
3688
|
+
try {
|
|
3689
|
+
localStorage.setItem(Me(), v);
|
|
3690
|
+
} catch {
|
|
3691
|
+
}
|
|
3692
|
+
return;
|
|
3693
|
+
}
|
|
3694
|
+
c(m), document.documentElement.className = "", document.documentElement.classList.add(m), o || s(!0);
|
|
3695
|
+
try {
|
|
3696
|
+
localStorage.setItem(Me(), m);
|
|
3697
|
+
} catch {
|
|
3698
|
+
}
|
|
3699
|
+
},
|
|
3700
|
+
[i, t]
|
|
3701
|
+
);
|
|
3702
|
+
return q(() => {
|
|
3703
|
+
const u = je(Me());
|
|
3704
|
+
f(u || e);
|
|
3705
|
+
}, [e, f]), /* @__PURE__ */ n(ut.Provider, { value: [i, f], children: /* @__PURE__ */ n(P, { as: "div", "data-theme-provider": !0, ref: l, ...r, children: o && a }) });
|
|
3706
|
+
}
|
|
3707
|
+
);
|
|
3708
|
+
da.displayName = "ThemeProvider";
|
|
3709
|
+
const ua = y.forwardRef(
|
|
3710
|
+
({ position: e, ...t }, a) => {
|
|
3711
|
+
let r = [];
|
|
3712
|
+
return e && r.push(e), /* @__PURE__ */ n(
|
|
3713
|
+
P,
|
|
3714
|
+
{
|
|
3715
|
+
as: "div",
|
|
3716
|
+
"data-toasts-wrapper": !0,
|
|
3717
|
+
ref: a,
|
|
3718
|
+
classNames: r,
|
|
3719
|
+
...t
|
|
3720
|
+
}
|
|
3721
|
+
);
|
|
3722
|
+
}
|
|
3723
|
+
);
|
|
3724
|
+
ua.displayName = "ToastsWrapper";
|
|
3725
|
+
const fa = y.forwardRef(
|
|
3726
|
+
({ showWhen: e, children: t, secondsToShowFor: a, closeWhen: r, ...l }, o) => {
|
|
3727
|
+
let s = [];
|
|
3728
|
+
const [i, c] = j(e ?? !1);
|
|
3729
|
+
q(() => {
|
|
3730
|
+
e && c(!0);
|
|
3731
|
+
const u = e ? setTimeout(() => {
|
|
3732
|
+
r == null || r();
|
|
3733
|
+
}, (a ?? 4) * 1e3) : void 0;
|
|
3734
|
+
return () => {
|
|
3735
|
+
u && clearTimeout(u);
|
|
3736
|
+
};
|
|
3737
|
+
}, [e, a, r]);
|
|
3738
|
+
const f = () => {
|
|
3739
|
+
e || c(!1);
|
|
3740
|
+
};
|
|
3741
|
+
return i && /* @__PURE__ */ n(
|
|
3742
|
+
P,
|
|
3743
|
+
{
|
|
3744
|
+
as: "div",
|
|
3745
|
+
"data-toast-item": !0,
|
|
3746
|
+
role: "status",
|
|
3747
|
+
"aria-live": "polite",
|
|
3748
|
+
"aria-atomic": "true",
|
|
3749
|
+
classNames: [...s, e ? "visible" : ""],
|
|
3750
|
+
onTransitionEnd: f,
|
|
3751
|
+
shadow: "soft",
|
|
3752
|
+
...l,
|
|
3753
|
+
children: t
|
|
3754
|
+
}
|
|
3755
|
+
);
|
|
3756
|
+
}
|
|
3757
|
+
);
|
|
3758
|
+
fa.displayName = "ToastItem";
|
|
3759
|
+
const ie = 8, ae = 16;
|
|
3760
|
+
let ne = null, de = null, Ue = !1, re = null, ue = null;
|
|
3761
|
+
const le = /* @__PURE__ */ new Map(), pa = (e, t, a) => {
|
|
3762
|
+
const r = e.getBoundingClientRect(), l = t.getBoundingClientRect(), o = window.innerHeight, s = window.innerWidth;
|
|
3763
|
+
let i, c;
|
|
3764
|
+
switch (a) {
|
|
3765
|
+
case "top":
|
|
3766
|
+
i = l.top - r.height - ie, c = l.left + (l.width - r.width) / 2, i < ae && (i = l.bottom + ie);
|
|
3767
|
+
break;
|
|
3768
|
+
case "bottom":
|
|
3769
|
+
i = l.bottom + ie, c = l.left + (l.width - r.width) / 2, i + r.height > o - ae && (i = l.top - r.height - ie);
|
|
3770
|
+
break;
|
|
3771
|
+
case "left":
|
|
3772
|
+
i = l.top + (l.height - r.height) / 2, c = l.left - r.width - ie, c < ae && (c = l.right + ie);
|
|
3773
|
+
break;
|
|
3774
|
+
case "right":
|
|
3775
|
+
i = l.top + (l.height - r.height) / 2, c = l.right + ie, c + r.width > s - ae && (c = l.left - r.width - ie);
|
|
3776
|
+
break;
|
|
3777
|
+
default:
|
|
3778
|
+
i = l.top - r.height - ie, c = l.left + (l.width - r.width) / 2;
|
|
3779
|
+
}
|
|
3780
|
+
return c < ae ? c = ae : c + r.width > s - ae && (c = s - r.width - ae), i < ae ? i = ae : i + r.height > o - ae && (i = o - r.height - ae), { top: i, left: c };
|
|
3781
|
+
}, Ee = ({ content: e, isVisible: t, position: a }) => /* @__PURE__ */ n(
|
|
3782
|
+
"div",
|
|
3783
|
+
{
|
|
3784
|
+
"data-tooltip": !0,
|
|
3785
|
+
className: t ? "visible" : "",
|
|
3786
|
+
role: "tooltip",
|
|
3787
|
+
style: {
|
|
3788
|
+
position: "fixed",
|
|
3789
|
+
zIndex: 1e3,
|
|
3790
|
+
top: `${a.top}px`,
|
|
3791
|
+
left: `${a.left}px`
|
|
3792
|
+
},
|
|
3793
|
+
children: e
|
|
3794
|
+
}
|
|
3795
|
+
), he = (e, t) => {
|
|
3796
|
+
if (!(!de || !ne)) {
|
|
3797
|
+
if (!e || !t) {
|
|
3798
|
+
de.render(
|
|
3799
|
+
/* @__PURE__ */ n(Ee, { content: null, isVisible: !1, position: { top: -9999, left: -9999 } })
|
|
3800
|
+
);
|
|
3801
|
+
return;
|
|
3802
|
+
}
|
|
3803
|
+
de.render(
|
|
3804
|
+
/* @__PURE__ */ n(Ee, { content: e.content, isVisible: !1, position: { top: -9999, left: -9999 } })
|
|
3805
|
+
), requestAnimationFrame(() => {
|
|
3806
|
+
if (!ne || !t) return;
|
|
3807
|
+
const a = ne.firstElementChild;
|
|
3808
|
+
if (!a) return;
|
|
3809
|
+
const { top: r, left: l } = pa(a, t, e.position);
|
|
3810
|
+
de == null || de.render(
|
|
3811
|
+
/* @__PURE__ */ n(Ee, { content: e.content, isVisible: !0, position: { top: r, left: l } })
|
|
3812
|
+
);
|
|
3813
|
+
});
|
|
3814
|
+
}
|
|
3815
|
+
}, qe = () => {
|
|
3816
|
+
if (!re || !ue) return;
|
|
3817
|
+
const e = le.get(re);
|
|
3818
|
+
e && he(e, ue);
|
|
3819
|
+
}, ft = (e, t) => {
|
|
3820
|
+
const a = le.get(e);
|
|
3821
|
+
a && (re = e, ue = t, he(a, t));
|
|
3822
|
+
}, De = (e) => {
|
|
3823
|
+
e && re !== e || (re = null, ue = null, he(null, null));
|
|
3824
|
+
}, ma = (e) => {
|
|
3825
|
+
const t = e.target.closest("[id]");
|
|
3826
|
+
if (!(t != null && t.id)) return;
|
|
3827
|
+
const a = le.get(t.id);
|
|
3828
|
+
(a == null ? void 0 : a.showOn) === "hover" && ft(t.id, t);
|
|
3829
|
+
}, ha = (e) => {
|
|
3830
|
+
const t = e.target.closest("[id]");
|
|
3831
|
+
if (!(t != null && t.id)) return;
|
|
3832
|
+
const a = le.get(t.id);
|
|
3833
|
+
(a == null ? void 0 : a.showOn) === "hover" && De(t.id);
|
|
3834
|
+
}, va = (e) => {
|
|
3835
|
+
if (ne != null && ne.contains(e.target))
|
|
3836
|
+
return;
|
|
3837
|
+
const t = e.target.closest("[id]");
|
|
3838
|
+
if (t != null && t.id) {
|
|
3839
|
+
const a = le.get(t.id);
|
|
3840
|
+
if ((a == null ? void 0 : a.showOn) === "click") {
|
|
3841
|
+
re === t.id ? De() : ft(t.id, t);
|
|
3842
|
+
return;
|
|
3843
|
+
}
|
|
3844
|
+
}
|
|
3845
|
+
if (re) {
|
|
3846
|
+
const a = le.get(re);
|
|
3847
|
+
(a == null ? void 0 : a.showOn) === "click" && De();
|
|
3848
|
+
}
|
|
3849
|
+
}, ya = () => {
|
|
3850
|
+
Ue || typeof document > "u" || (ne = document.createElement("div"), ne.id = "fictoan-tooltip-singleton", document.body.appendChild(ne), de = wt(ne), de.render(
|
|
3851
|
+
/* @__PURE__ */ n(Ee, { content: null, isVisible: !1, position: { top: -9999, left: -9999 } })
|
|
3852
|
+
), document.addEventListener("mouseover", ma), document.addEventListener("mouseout", ha), document.addEventListener("click", va), window.addEventListener("scroll", qe, !0), window.addEventListener("resize", qe), Ue = !0);
|
|
3853
|
+
}, Ka = ({
|
|
3854
|
+
children: e,
|
|
3855
|
+
isTooltipFor: t,
|
|
3856
|
+
showOn: a = "hover",
|
|
3857
|
+
position: r = "top"
|
|
3858
|
+
}) => {
|
|
3859
|
+
const l = J({ content: e, position: r, showOn: a });
|
|
3860
|
+
return l.current = { content: e, position: r, showOn: a }, q(() => (ya(), le.set(t, l.current), re === t && ue && he(l.current, ue), () => {
|
|
3861
|
+
le.delete(t), re === t && De();
|
|
3862
|
+
}), [t]), q(() => {
|
|
3863
|
+
le.set(t, l.current), re === t && ue && he(l.current, ue);
|
|
3864
|
+
}, [e, r, a, t]), null;
|
|
3865
|
+
}, me = y.forwardRef(
|
|
3866
|
+
({ fontStyle: e = "sans-serif", weight: t, align: a, ...r }, l) => {
|
|
3867
|
+
let o = [];
|
|
3868
|
+
return t && o.push(`weight-${t}`), e && o.push(`font-${e}`), a && o.push(`text-${a}`), /* @__PURE__ */ n(P, { ref: l, classNames: o, ...r });
|
|
3869
|
+
}
|
|
3870
|
+
), ba = y.forwardRef((e, t) => /* @__PURE__ */ n(me, { as: "h1", ref: t, ...e }));
|
|
3871
|
+
ba.displayName = "Heading1";
|
|
3872
|
+
const wa = y.forwardRef((e, t) => /* @__PURE__ */ n(me, { as: "h2", ref: t, ...e }));
|
|
3873
|
+
wa.displayName = "Heading2";
|
|
3874
|
+
const ga = y.forwardRef((e, t) => /* @__PURE__ */ n(me, { as: "h3", ref: t, ...e }));
|
|
3875
|
+
ga.displayName = "Heading3";
|
|
3876
|
+
const Na = y.forwardRef((e, t) => /* @__PURE__ */ n(me, { as: "h4", ref: t, ...e }));
|
|
3877
|
+
Na.displayName = "Heading4";
|
|
3878
|
+
const $a = y.forwardRef((e, t) => /* @__PURE__ */ n(me, { as: "h5", ref: t, ...e }));
|
|
3879
|
+
$a.displayName = "Heading5";
|
|
3880
|
+
const ka = y.forwardRef((e, t) => /* @__PURE__ */ n(me, { as: "h6", ref: t, ...e }));
|
|
3881
|
+
ka.displayName = "Heading6";
|
|
3882
|
+
const xa = y.forwardRef(
|
|
3883
|
+
({ summary: e, children: t, isOpen: a = !1, ...r }, l) => /* @__PURE__ */ I(
|
|
3884
|
+
P,
|
|
3885
|
+
{
|
|
3886
|
+
as: "details",
|
|
3887
|
+
"data-expandable-content": !0,
|
|
3888
|
+
ref: l,
|
|
3889
|
+
...r,
|
|
3890
|
+
open: a,
|
|
3891
|
+
role: "region",
|
|
3892
|
+
"aria-labelledby": "accordion-summary",
|
|
3893
|
+
children: [
|
|
3894
|
+
/* @__PURE__ */ n(
|
|
3895
|
+
"summary",
|
|
3896
|
+
{
|
|
3897
|
+
role: "button",
|
|
3898
|
+
tabIndex: 0,
|
|
3899
|
+
"aria-controls": "accordion-content",
|
|
3900
|
+
"aria-expanded": a,
|
|
3901
|
+
children: typeof e == "string" ? /* @__PURE__ */ n(Y, { margin: "none", children: e }) : e
|
|
3902
|
+
}
|
|
3903
|
+
),
|
|
3904
|
+
t
|
|
3905
|
+
]
|
|
3906
|
+
}
|
|
3907
|
+
)
|
|
3908
|
+
);
|
|
3909
|
+
xa.displayName = "Accordion";
|
|
3910
|
+
export {
|
|
3911
|
+
ta as $,
|
|
3912
|
+
xa as A,
|
|
3913
|
+
Ae as B,
|
|
3914
|
+
Je as C,
|
|
3915
|
+
kt as D,
|
|
3916
|
+
P as E,
|
|
3917
|
+
Ta as F,
|
|
3918
|
+
jt as G,
|
|
3919
|
+
Oa as H,
|
|
3920
|
+
be as I,
|
|
3921
|
+
Ut as J,
|
|
3922
|
+
qt as K,
|
|
3923
|
+
Ht as L,
|
|
3924
|
+
Ba as M,
|
|
3925
|
+
Nt as N,
|
|
3926
|
+
Jt as O,
|
|
3927
|
+
_t as P,
|
|
3928
|
+
tt as Q,
|
|
3929
|
+
at as R,
|
|
3930
|
+
Fa as S,
|
|
3931
|
+
ot as T,
|
|
3932
|
+
Zt as U,
|
|
3933
|
+
st as V,
|
|
3934
|
+
Ga as W,
|
|
3935
|
+
Qt as X,
|
|
3936
|
+
Ha as Y,
|
|
3937
|
+
_a as Z,
|
|
3938
|
+
ea as _,
|
|
3939
|
+
Be as a,
|
|
3940
|
+
aa as a0,
|
|
3941
|
+
ra as a1,
|
|
3942
|
+
sa as a2,
|
|
3943
|
+
na as a3,
|
|
3944
|
+
oa as a4,
|
|
3945
|
+
ct as a5,
|
|
3946
|
+
ia as a6,
|
|
3947
|
+
la as a7,
|
|
3948
|
+
da as a8,
|
|
3949
|
+
Wa as a9,
|
|
3950
|
+
ua as aa,
|
|
3951
|
+
fa as ab,
|
|
3952
|
+
Ka as ac,
|
|
3953
|
+
ba as ad,
|
|
3954
|
+
wa as ae,
|
|
3955
|
+
ga as af,
|
|
3956
|
+
Na as ag,
|
|
3957
|
+
$a as ah,
|
|
3958
|
+
ka as ai,
|
|
3959
|
+
Y as aj,
|
|
3960
|
+
xt as b,
|
|
3961
|
+
Mt as c,
|
|
3962
|
+
Ze as d,
|
|
3963
|
+
Et as e,
|
|
3964
|
+
Qe as f,
|
|
3965
|
+
_ as g,
|
|
3966
|
+
La as h,
|
|
3967
|
+
Sa as i,
|
|
3968
|
+
Pa as j,
|
|
3969
|
+
Va as k,
|
|
3970
|
+
za as l,
|
|
3971
|
+
Fe as m,
|
|
3972
|
+
It as n,
|
|
3973
|
+
et as o,
|
|
3974
|
+
Tt as p,
|
|
3975
|
+
ee as q,
|
|
3976
|
+
Ot as r,
|
|
3977
|
+
ye as s,
|
|
3978
|
+
rt as t,
|
|
3979
|
+
Gt as u,
|
|
3980
|
+
Kt as v,
|
|
3981
|
+
nt as w,
|
|
3982
|
+
Ve as x,
|
|
3983
|
+
At as y,
|
|
3984
|
+
Xt as z
|
|
3985
|
+
};
|
|
3986
|
+
//# sourceMappingURL=Accordion-DxiPqnRy.js.map
|