@agentatom/design-system 1.4.97 → 1.4.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/appearance.json +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +1075 -1067
- package/dist/tokens.css +2 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import X, { useMemo as
|
|
2
|
-
import { Check as Pe, X as te, ChevronDown as ye, Minus as
|
|
1
|
+
import X, { useMemo as _t, useContext as le, createContext as Le, useState as L, useRef as S, useEffect as P, useLayoutEffect as dt, useId as jt, useCallback as ne, forwardRef as ut } from "react";
|
|
2
|
+
import { Check as Pe, X as te, ChevronDown as ye, Minus as Nt, Plus as wt, XCircle as Me, AlertTriangle as Fe, CheckCircle as ze, Info as We, ChevronUp as gt, ChevronsUpDown as yt, ChevronLeft as kt, ChevronRight as Et, Copy as Tt, Brain as $t, Loader as Rt, Paperclip as Ge, Square as St, ArrowUp as At, Zap as Bt, Cpu as Ke, FileText as It, ThumbsUp as Dt, ThumbsDown as Lt } from "lucide-react";
|
|
3
3
|
import re from "react-dom";
|
|
4
4
|
const q = {
|
|
5
5
|
1: 16,
|
|
@@ -19,23 +19,23 @@ var Ie = { exports: {} }, we = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var Xe;
|
|
22
|
-
function
|
|
22
|
+
function Pt() {
|
|
23
23
|
if (Xe) return we;
|
|
24
24
|
Xe = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
26
|
-
function n(r,
|
|
26
|
+
function n(r, o, a) {
|
|
27
27
|
var i = null;
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
for (var l in
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return
|
|
28
|
+
if (a !== void 0 && (i = "" + a), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
29
|
+
a = {};
|
|
30
|
+
for (var l in o)
|
|
31
|
+
l !== "key" && (a[l] = o[l]);
|
|
32
|
+
} else a = o;
|
|
33
|
+
return o = a.ref, {
|
|
34
34
|
$$typeof: t,
|
|
35
35
|
type: r,
|
|
36
36
|
key: i,
|
|
37
|
-
ref:
|
|
38
|
-
props:
|
|
37
|
+
ref: o !== void 0 ? o : null,
|
|
38
|
+
props: a
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
return we.Fragment = s, we.jsx = n, we.jsxs = n, we;
|
|
@@ -51,23 +51,23 @@ var ge = {};
|
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
53
|
var Je;
|
|
54
|
-
function
|
|
54
|
+
function Mt() {
|
|
55
55
|
return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function t(m) {
|
|
57
57
|
if (m == null) return null;
|
|
58
58
|
if (typeof m == "function")
|
|
59
|
-
return m.$$typeof ===
|
|
59
|
+
return m.$$typeof === k ? null : m.displayName || m.name || null;
|
|
60
60
|
if (typeof m == "string") return m;
|
|
61
61
|
switch (m) {
|
|
62
|
-
case y:
|
|
63
|
-
return "Fragment";
|
|
64
62
|
case T:
|
|
63
|
+
return "Fragment";
|
|
64
|
+
case g:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case j:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case N:
|
|
69
69
|
return "Suspense";
|
|
70
|
-
case
|
|
70
|
+
case B:
|
|
71
71
|
return "SuspenseList";
|
|
72
72
|
case O:
|
|
73
73
|
return "Activity";
|
|
@@ -76,16 +76,16 @@ function Pt() {
|
|
|
76
76
|
switch (typeof m.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), m.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case w:
|
|
80
80
|
return "Portal";
|
|
81
81
|
case x:
|
|
82
82
|
return m.displayName || "Context";
|
|
83
|
-
case
|
|
83
|
+
case $:
|
|
84
84
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case
|
|
85
|
+
case y:
|
|
86
86
|
var b = m.render;
|
|
87
87
|
return m = m.displayName, m || (m = b.displayName || b.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
88
|
-
case
|
|
88
|
+
case D:
|
|
89
89
|
return b = m.displayName || null, b !== null ? b : t(m.type) || "Memo";
|
|
90
90
|
case W:
|
|
91
91
|
b = m._payload, m = m._init;
|
|
@@ -108,8 +108,8 @@ function Pt() {
|
|
|
108
108
|
}
|
|
109
109
|
if (b) {
|
|
110
110
|
b = console;
|
|
111
|
-
var
|
|
112
|
-
return
|
|
111
|
+
var I = b.error, U = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
112
|
+
return I.call(
|
|
113
113
|
b,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
115
|
U
|
|
@@ -117,7 +117,7 @@ function Pt() {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function r(m) {
|
|
120
|
-
if (m ===
|
|
120
|
+
if (m === T) return "<>";
|
|
121
121
|
if (typeof m == "object" && m !== null && m.$$typeof === W)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
@@ -127,11 +127,11 @@ function Pt() {
|
|
|
127
127
|
return "<...>";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function o() {
|
|
131
131
|
var m = C.A;
|
|
132
132
|
return m === null ? null : m.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function a() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(m) {
|
|
@@ -142,30 +142,30 @@ function Pt() {
|
|
|
142
142
|
return m.key !== void 0;
|
|
143
143
|
}
|
|
144
144
|
function l(m, b) {
|
|
145
|
-
function
|
|
146
|
-
|
|
145
|
+
function I() {
|
|
146
|
+
R || (R = !0, console.error(
|
|
147
147
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
148
148
|
b
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
get:
|
|
151
|
+
I.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
152
|
+
get: I,
|
|
153
153
|
configurable: !0
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
function c() {
|
|
157
157
|
var m = t(this.type);
|
|
158
|
-
return
|
|
158
|
+
return A[m] || (A[m] = !0, console.error(
|
|
159
159
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
160
160
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
161
161
|
}
|
|
162
|
-
function u(m, b,
|
|
163
|
-
var G =
|
|
162
|
+
function u(m, b, I, U, se, oe) {
|
|
163
|
+
var G = I.ref;
|
|
164
164
|
return m = {
|
|
165
165
|
$$typeof: _,
|
|
166
166
|
type: m,
|
|
167
167
|
key: b,
|
|
168
|
-
props:
|
|
168
|
+
props: I,
|
|
169
169
|
_owner: U
|
|
170
170
|
}, (G !== void 0 ? G : null) !== null ? Object.defineProperty(m, "ref", {
|
|
171
171
|
enumerable: !1,
|
|
@@ -189,10 +189,10 @@ function Pt() {
|
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
191
191
|
writable: !0,
|
|
192
|
-
value:
|
|
192
|
+
value: oe
|
|
193
193
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
194
194
|
}
|
|
195
|
-
function d(m, b,
|
|
195
|
+
function d(m, b, I, U, se, oe) {
|
|
196
196
|
var G = b.children;
|
|
197
197
|
if (G !== void 0)
|
|
198
198
|
if (U)
|
|
@@ -223,21 +223,21 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
G
|
|
224
224
|
), Y[G + U] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (G = null,
|
|
227
|
-
|
|
226
|
+
if (G = null, I !== void 0 && (n(I), G = "" + I), i(b) && (n(b.key), G = "" + b.key), "key" in b) {
|
|
227
|
+
I = {};
|
|
228
228
|
for (var fe in b)
|
|
229
|
-
fe !== "key" && (
|
|
230
|
-
} else
|
|
229
|
+
fe !== "key" && (I[fe] = b[fe]);
|
|
230
|
+
} else I = b;
|
|
231
231
|
return G && l(
|
|
232
|
-
|
|
232
|
+
I,
|
|
233
233
|
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
234
234
|
), u(
|
|
235
235
|
m,
|
|
236
236
|
G,
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
I,
|
|
238
|
+
o(),
|
|
239
239
|
se,
|
|
240
|
-
|
|
240
|
+
oe
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(m) {
|
|
@@ -246,7 +246,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
246
|
function h(m) {
|
|
247
247
|
return typeof m == "object" && m !== null && m.$$typeof === _;
|
|
248
248
|
}
|
|
249
|
-
var f = X, _ = Symbol.for("react.transitional.element"),
|
|
249
|
+
var f = X, _ = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), x = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), C = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, V = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
f = {
|
|
@@ -254,34 +254,34 @@ React keys must be passed directly to JSX without using spread:
|
|
|
254
254
|
return m();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var
|
|
257
|
+
var R, A = {}, F = f.react_stack_bottom_frame.bind(
|
|
258
258
|
f,
|
|
259
|
-
|
|
260
|
-
)(), H = v(r(
|
|
261
|
-
ge.Fragment =
|
|
259
|
+
a
|
|
260
|
+
)(), H = v(r(a)), Y = {};
|
|
261
|
+
ge.Fragment = T, ge.jsx = function(m, b, I) {
|
|
262
262
|
var U = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return d(
|
|
264
264
|
m,
|
|
265
265
|
b,
|
|
266
|
-
|
|
266
|
+
I,
|
|
267
267
|
!1,
|
|
268
|
-
U ? Error("react-stack-top-frame") :
|
|
268
|
+
U ? Error("react-stack-top-frame") : F,
|
|
269
269
|
U ? v(r(m)) : H
|
|
270
270
|
);
|
|
271
|
-
}, ge.jsxs = function(m, b,
|
|
271
|
+
}, ge.jsxs = function(m, b, I) {
|
|
272
272
|
var U = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return d(
|
|
274
274
|
m,
|
|
275
275
|
b,
|
|
276
|
-
|
|
276
|
+
I,
|
|
277
277
|
!0,
|
|
278
|
-
U ? Error("react-stack-top-frame") :
|
|
278
|
+
U ? Error("react-stack-top-frame") : F,
|
|
279
279
|
U ? v(r(m)) : H
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), ge;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ? Ie.exports =
|
|
284
|
+
process.env.NODE_ENV === "production" ? Ie.exports = Pt() : Ie.exports = Mt();
|
|
285
285
|
var e = Ie.exports;
|
|
286
286
|
const $e = {
|
|
287
287
|
// Close / dismiss
|
|
@@ -334,22 +334,22 @@ const $e = {
|
|
|
334
334
|
// Browser tabs
|
|
335
335
|
closeTab: "Close {label}"
|
|
336
336
|
};
|
|
337
|
-
function
|
|
337
|
+
function ft(t, s = {}) {
|
|
338
338
|
return typeof t == "function" ? t(s) : typeof t != "string" ? "" : t.replace(
|
|
339
339
|
/\{(\w+)\}/g,
|
|
340
340
|
(n, r) => s[r] !== void 0 && s[r] !== null ? String(s[r]) : ""
|
|
341
341
|
);
|
|
342
342
|
}
|
|
343
|
-
const Oe =
|
|
343
|
+
const Oe = Le({
|
|
344
344
|
strings: $e,
|
|
345
|
-
t: (t, s) =>
|
|
345
|
+
t: (t, s) => ft($e[t] ?? t, s)
|
|
346
346
|
});
|
|
347
|
-
function
|
|
348
|
-
const n =
|
|
347
|
+
function Rs({ strings: t, children: s }) {
|
|
348
|
+
const n = _t(() => {
|
|
349
349
|
const r = { ...$e, ...t };
|
|
350
350
|
return {
|
|
351
351
|
strings: r,
|
|
352
|
-
t: (
|
|
352
|
+
t: (o, a) => ft(r[o] ?? $e[o] ?? o, a)
|
|
353
353
|
};
|
|
354
354
|
}, [t]);
|
|
355
355
|
return /* @__PURE__ */ e.jsx(Oe.Provider, { value: n, children: s });
|
|
@@ -360,15 +360,15 @@ function be() {
|
|
|
360
360
|
function K() {
|
|
361
361
|
return le(Oe).strings;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
const
|
|
363
|
+
function Ft({ size: t = "m", color: s = "default", className: n = "", "aria-label": r, ...o }) {
|
|
364
|
+
const a = K();
|
|
365
365
|
return /* @__PURE__ */ e.jsx(
|
|
366
366
|
"span",
|
|
367
367
|
{
|
|
368
368
|
className: ["ds-spinner", `ds-spinner--${t}`, `ds-spinner--${s}`, n].filter(Boolean).join(" "),
|
|
369
369
|
role: "status",
|
|
370
|
-
"aria-label": r ??
|
|
371
|
-
...
|
|
370
|
+
"aria-label": r ?? a.loading,
|
|
371
|
+
...o
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
374
|
}
|
|
@@ -378,8 +378,8 @@ function de({
|
|
|
378
378
|
variant: s = "primary",
|
|
379
379
|
size: n = "m",
|
|
380
380
|
fullWidth: r = !1,
|
|
381
|
-
icon:
|
|
382
|
-
disabled:
|
|
381
|
+
icon: o,
|
|
382
|
+
disabled: a = !1,
|
|
383
383
|
state: i = "idle",
|
|
384
384
|
/**
|
|
385
385
|
* Toggle-on / latched look (filters, view switch, toolbar).
|
|
@@ -395,22 +395,22 @@ function de({
|
|
|
395
395
|
"aria-label": h,
|
|
396
396
|
"aria-pressed": f,
|
|
397
397
|
className: _ = "",
|
|
398
|
-
...
|
|
398
|
+
...w
|
|
399
399
|
}) {
|
|
400
|
-
const
|
|
400
|
+
const T = o && !t, j = i === "loading", g = i === "success", $ = i === "error", x = j || g || $, y = !!(l || c), N = n === "xs" ? "s" : "m", B = s === "danger" ? "on-accent" : "default", D = zt[n] ?? 16, W = j ? /* @__PURE__ */ e.jsx(Ft, { size: N, color: B }) : g ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Pe, { size: D, strokeWidth: 2.5 }) }) : $ ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(te, { size: D, strokeWidth: 2.5 }) }) : null, O = [
|
|
401
401
|
"ds-button",
|
|
402
402
|
`ds-button--${s}`,
|
|
403
403
|
`ds-button--${n}`,
|
|
404
404
|
r && "ds-button--full",
|
|
405
|
-
|
|
405
|
+
T && "ds-button--icon-only",
|
|
406
406
|
_
|
|
407
|
-
].filter(Boolean).join(" "),
|
|
408
|
-
x ? W :
|
|
407
|
+
].filter(Boolean).join(" "), k = i !== "idle" ? i : void 0, C = f !== void 0 ? f : y ? !0 : void 0, M = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
408
|
+
x ? W : o && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: o }),
|
|
409
409
|
t
|
|
410
410
|
] });
|
|
411
411
|
if (p) {
|
|
412
412
|
const V = (v) => {
|
|
413
|
-
if (
|
|
413
|
+
if (a || j) {
|
|
414
414
|
v.preventDefault();
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
@@ -420,15 +420,15 @@ function de({
|
|
|
420
420
|
"a",
|
|
421
421
|
{
|
|
422
422
|
className: O,
|
|
423
|
-
href:
|
|
423
|
+
href: a || j ? void 0 : p,
|
|
424
424
|
onClick: V,
|
|
425
425
|
"aria-label": h,
|
|
426
|
-
"aria-disabled":
|
|
427
|
-
"aria-busy":
|
|
426
|
+
"aria-disabled": a || j ? "true" : void 0,
|
|
427
|
+
"aria-busy": j ? "true" : void 0,
|
|
428
428
|
"aria-pressed": C,
|
|
429
|
-
"data-state":
|
|
430
|
-
"data-active":
|
|
431
|
-
...
|
|
429
|
+
"data-state": k,
|
|
430
|
+
"data-active": y ? "true" : void 0,
|
|
431
|
+
...w,
|
|
432
432
|
children: M
|
|
433
433
|
}
|
|
434
434
|
);
|
|
@@ -438,25 +438,25 @@ function de({
|
|
|
438
438
|
{
|
|
439
439
|
type: d,
|
|
440
440
|
className: O,
|
|
441
|
-
disabled:
|
|
442
|
-
onClick:
|
|
441
|
+
disabled: a,
|
|
442
|
+
onClick: j ? void 0 : u,
|
|
443
443
|
"aria-label": h,
|
|
444
|
-
"aria-busy":
|
|
444
|
+
"aria-busy": j ? "true" : void 0,
|
|
445
445
|
"aria-pressed": C,
|
|
446
|
-
"data-state":
|
|
447
|
-
"data-active":
|
|
448
|
-
...
|
|
446
|
+
"data-state": k,
|
|
447
|
+
"data-active": y ? "true" : void 0,
|
|
448
|
+
...w,
|
|
449
449
|
children: M
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Ss({
|
|
454
454
|
label: t,
|
|
455
455
|
error: s,
|
|
456
456
|
hint: n,
|
|
457
457
|
fullWidth: r = !0,
|
|
458
|
-
icon:
|
|
459
|
-
iconRight:
|
|
458
|
+
icon: o,
|
|
459
|
+
iconRight: a,
|
|
460
460
|
onIconRightClick: i,
|
|
461
461
|
size: l = "m",
|
|
462
462
|
disabled: c,
|
|
@@ -464,23 +464,23 @@ function $s({
|
|
|
464
464
|
iconRightLabel: d,
|
|
465
465
|
...p
|
|
466
466
|
}) {
|
|
467
|
-
const h = K(), f = u || `input-${X.useId()}`, _ = n ? `${f}-hint` : void 0,
|
|
467
|
+
const h = K(), f = u || `input-${X.useId()}`, _ = n ? `${f}-hint` : void 0, w = s ? `${f}-error` : void 0, T = w || _;
|
|
468
468
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${r ? "ds-input-wrapper--full" : ""} ${c ? "ds-input-wrapper--disabled" : ""} ${s ? "ds-input-wrapper--error" : ""}`, children: [
|
|
469
469
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: f, children: t }),
|
|
470
470
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
471
|
-
|
|
471
|
+
o && /* @__PURE__ */ e.jsx("span", { className: `ds-input-icon ds-input-icon--${l}`, "aria-hidden": "true", children: o }),
|
|
472
472
|
/* @__PURE__ */ e.jsx(
|
|
473
473
|
"input",
|
|
474
474
|
{
|
|
475
475
|
id: f,
|
|
476
|
-
className: `ds-input ds-input--${l} ${
|
|
476
|
+
className: `ds-input ds-input--${l} ${o ? "ds-input--with-icon" : ""} ${a ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
|
|
477
477
|
disabled: c,
|
|
478
478
|
"aria-invalid": s ? "true" : "false",
|
|
479
|
-
"aria-describedby":
|
|
479
|
+
"aria-describedby": T,
|
|
480
480
|
...p
|
|
481
481
|
}
|
|
482
482
|
),
|
|
483
|
-
|
|
483
|
+
a && /* @__PURE__ */ e.jsx(
|
|
484
484
|
"button",
|
|
485
485
|
{
|
|
486
486
|
type: "button",
|
|
@@ -488,35 +488,35 @@ function $s({
|
|
|
488
488
|
onClick: i,
|
|
489
489
|
tabIndex: -1,
|
|
490
490
|
"aria-label": d ?? h.toggleVisibility,
|
|
491
|
-
children:
|
|
491
|
+
children: a
|
|
492
492
|
}
|
|
493
493
|
)
|
|
494
494
|
] }),
|
|
495
495
|
n && !s && /* @__PURE__ */ e.jsx("span", { id: _, className: "ds-input-hint", children: n }),
|
|
496
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id:
|
|
496
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id: w, className: "ds-input-error", role: "alert", children: s }) }) })
|
|
497
497
|
] });
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function As({
|
|
500
500
|
label: t,
|
|
501
501
|
error: s,
|
|
502
502
|
hint: n,
|
|
503
503
|
fullWidth: r = !0,
|
|
504
|
-
size:
|
|
505
|
-
disabled:
|
|
504
|
+
size: o = "m",
|
|
505
|
+
disabled: a,
|
|
506
506
|
id: i,
|
|
507
507
|
resize: l = !0,
|
|
508
508
|
rows: c = 3,
|
|
509
509
|
...u
|
|
510
510
|
}) {
|
|
511
511
|
const d = i || `textarea-${X.useId()}`, p = n ? `${d}-hint` : void 0, h = s ? `${d}-error` : void 0, f = h || p;
|
|
512
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${r ? "ds-textarea-wrapper--full" : ""} ${
|
|
512
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${r ? "ds-textarea-wrapper--full" : ""} ${a ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
513
513
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: d, children: t }),
|
|
514
514
|
/* @__PURE__ */ e.jsx(
|
|
515
515
|
"textarea",
|
|
516
516
|
{
|
|
517
517
|
id: d,
|
|
518
|
-
className: `ds-textarea ds-textarea--${
|
|
519
|
-
disabled:
|
|
518
|
+
className: `ds-textarea ds-textarea--${o} ${s ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
519
|
+
disabled: a,
|
|
520
520
|
"aria-invalid": s ? "true" : "false",
|
|
521
521
|
"aria-describedby": f,
|
|
522
522
|
rows: c,
|
|
@@ -527,71 +527,71 @@ function Rs({
|
|
|
527
527
|
s && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: s })
|
|
528
528
|
] });
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function Bs({
|
|
531
531
|
label: t,
|
|
532
532
|
value: s,
|
|
533
533
|
onChange: n,
|
|
534
534
|
options: r = [],
|
|
535
|
-
placeholder:
|
|
536
|
-
error:
|
|
535
|
+
placeholder: o,
|
|
536
|
+
error: a,
|
|
537
537
|
fullWidth: i = !0,
|
|
538
538
|
size: l = "m",
|
|
539
539
|
disabled: c = !1,
|
|
540
540
|
id: u,
|
|
541
541
|
...d
|
|
542
542
|
}) {
|
|
543
|
-
const p = K(), h =
|
|
544
|
-
|
|
545
|
-
var
|
|
546
|
-
_(!1),
|
|
543
|
+
const p = K(), h = o ?? p.selectOption, [f, _] = L(!1), [w, T] = L(!1), [j, g] = L({}), [$, x] = L("down"), [y, N] = L(-1), B = S(null), D = S(null), W = S(null), O = S(null), k = u || `select-${X.useId()}`, C = `${k}-label`, M = a ? `${k}-error` : void 0, V = 150, v = (b = !1) => {
|
|
544
|
+
w || (T(!0), N(-1), O.current = setTimeout(() => {
|
|
545
|
+
var I;
|
|
546
|
+
_(!1), T(!1), b && ((I = W.current) == null || I.focus());
|
|
547
547
|
}, V));
|
|
548
|
-
},
|
|
549
|
-
clearTimeout(O.current),
|
|
550
|
-
const
|
|
551
|
-
|
|
548
|
+
}, R = (b) => {
|
|
549
|
+
clearTimeout(O.current), T(!1);
|
|
550
|
+
const I = b !== void 0 ? b : Math.max(r.findIndex((U) => U.value === s), 0);
|
|
551
|
+
N(I), _(!0);
|
|
552
552
|
};
|
|
553
553
|
P(() => () => clearTimeout(O.current), []);
|
|
554
|
-
const
|
|
554
|
+
const A = () => {
|
|
555
555
|
var Q;
|
|
556
|
-
const b = (Q =
|
|
556
|
+
const b = (Q = B.current) == null ? void 0 : Q.getBoundingClientRect();
|
|
557
557
|
if (!b) return;
|
|
558
|
-
const
|
|
559
|
-
x(G ? "up" : "down"),
|
|
560
|
-
G ? { bottom:
|
|
558
|
+
const I = window.innerHeight, U = I - b.bottom, se = b.top, G = U < 300 && se > U;
|
|
559
|
+
x(G ? "up" : "down"), g(
|
|
560
|
+
G ? { bottom: I - b.top + 4, left: b.left, width: b.width } : { top: b.bottom + 4, left: b.left, width: b.width }
|
|
561
561
|
);
|
|
562
562
|
};
|
|
563
563
|
P(() => {
|
|
564
564
|
if (f)
|
|
565
|
-
return
|
|
566
|
-
window.removeEventListener("scroll",
|
|
565
|
+
return A(), window.addEventListener("scroll", A, !0), window.addEventListener("resize", A), () => {
|
|
566
|
+
window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A);
|
|
567
567
|
};
|
|
568
568
|
}, [f]), P(() => {
|
|
569
|
-
const b = (
|
|
570
|
-
|
|
569
|
+
const b = (I) => {
|
|
570
|
+
B.current && !B.current.contains(I.target) && D.current && !D.current.contains(I.target) && v();
|
|
571
571
|
};
|
|
572
572
|
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
573
|
-
}, [
|
|
574
|
-
var
|
|
575
|
-
if (!f ||
|
|
576
|
-
(
|
|
577
|
-
}, [
|
|
578
|
-
const
|
|
573
|
+
}, [w]), P(() => {
|
|
574
|
+
var I;
|
|
575
|
+
if (!f || y < 0 || !D.current) return;
|
|
576
|
+
(I = D.current.querySelectorAll(".ds-select-option")[y]) == null || I.scrollIntoView({ block: "nearest" });
|
|
577
|
+
}, [y, f]);
|
|
578
|
+
const F = (b) => {
|
|
579
579
|
switch (b.key) {
|
|
580
580
|
case "ArrowDown":
|
|
581
|
-
b.preventDefault(), f ?
|
|
581
|
+
b.preventDefault(), f ? N((I) => Math.min(I + 1, r.length - 1)) : R();
|
|
582
582
|
break;
|
|
583
583
|
case "ArrowUp":
|
|
584
|
-
b.preventDefault(), f ?
|
|
584
|
+
b.preventDefault(), f ? N((I) => Math.max(I - 1, 0)) : R(r.length - 1);
|
|
585
585
|
break;
|
|
586
586
|
case "Home":
|
|
587
|
-
f && (b.preventDefault(),
|
|
587
|
+
f && (b.preventDefault(), N(0));
|
|
588
588
|
break;
|
|
589
589
|
case "End":
|
|
590
|
-
f && (b.preventDefault(),
|
|
590
|
+
f && (b.preventDefault(), N(r.length - 1));
|
|
591
591
|
break;
|
|
592
592
|
case "Enter":
|
|
593
593
|
case " ":
|
|
594
|
-
b.preventDefault(), f ?
|
|
594
|
+
b.preventDefault(), f ? y >= 0 && (n == null || n(r[y].value), v(!0)) : R();
|
|
595
595
|
break;
|
|
596
596
|
case "Escape":
|
|
597
597
|
f && (b.preventDefault(), v(!0));
|
|
@@ -603,7 +603,7 @@ function Ss({
|
|
|
603
603
|
}, H = r.find((b) => b.value === s), Y = l === "xs" ? q[1] : l === "small" ? q[2] : q[3], m = f && /* @__PURE__ */ e.jsx(
|
|
604
604
|
"div",
|
|
605
605
|
{
|
|
606
|
-
ref:
|
|
606
|
+
ref: D,
|
|
607
607
|
"data-ds-portal": "",
|
|
608
608
|
role: "listbox",
|
|
609
609
|
"aria-labelledby": t ? C : void 0,
|
|
@@ -611,14 +611,14 @@ function Ss({
|
|
|
611
611
|
className: [
|
|
612
612
|
"ds-select-dropdown ds-scrollable",
|
|
613
613
|
`ds-select-dropdown--${l}`,
|
|
614
|
-
`ds-select-dropdown--${
|
|
615
|
-
|
|
614
|
+
`ds-select-dropdown--${$}`,
|
|
615
|
+
w && "ds-select-dropdown--closing"
|
|
616
616
|
].filter(Boolean).join(" "),
|
|
617
|
-
style:
|
|
618
|
-
children: r.map((b,
|
|
617
|
+
style: j,
|
|
618
|
+
children: r.map((b, I) => /* @__PURE__ */ e.jsx(
|
|
619
619
|
"button",
|
|
620
620
|
{
|
|
621
|
-
id: `${
|
|
621
|
+
id: `${k}-opt-${I}`,
|
|
622
622
|
type: "button",
|
|
623
623
|
role: "option",
|
|
624
624
|
tabIndex: -1,
|
|
@@ -627,7 +627,7 @@ function Ss({
|
|
|
627
627
|
"ds-select-option",
|
|
628
628
|
`ds-select-option--${l}`,
|
|
629
629
|
s === b.value && "ds-select-option--selected",
|
|
630
|
-
|
|
630
|
+
I === y && "ds-select-option--active"
|
|
631
631
|
].filter(Boolean).join(" "),
|
|
632
632
|
onClick: () => {
|
|
633
633
|
n == null || n(b.value), v(!0);
|
|
@@ -640,24 +640,24 @@ function Ss({
|
|
|
640
640
|
);
|
|
641
641
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${c ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
642
642
|
t && /* @__PURE__ */ e.jsx("label", { id: C, className: "ds-select-label", children: t }),
|
|
643
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref:
|
|
643
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: B, children: /* @__PURE__ */ e.jsxs(
|
|
644
644
|
"button",
|
|
645
645
|
{
|
|
646
646
|
ref: W,
|
|
647
647
|
type: "button",
|
|
648
|
-
id:
|
|
648
|
+
id: k,
|
|
649
649
|
role: "combobox",
|
|
650
650
|
"aria-haspopup": "listbox",
|
|
651
651
|
"aria-expanded": f,
|
|
652
|
-
"aria-activedescendant": f &&
|
|
652
|
+
"aria-activedescendant": f && y >= 0 ? `${k}-opt-${y}` : void 0,
|
|
653
653
|
"aria-labelledby": t ? C : void 0,
|
|
654
|
-
"aria-invalid":
|
|
654
|
+
"aria-invalid": a ? "true" : "false",
|
|
655
655
|
"aria-describedby": M,
|
|
656
|
-
className: `ds-select-trigger ds-select-trigger--${l} ${
|
|
656
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${a ? "ds-select-trigger--error" : ""}`,
|
|
657
657
|
onClick: () => {
|
|
658
|
-
c || (f ? v() :
|
|
658
|
+
c || (f ? v() : R());
|
|
659
659
|
},
|
|
660
|
-
onKeyDown:
|
|
660
|
+
onKeyDown: F,
|
|
661
661
|
disabled: c,
|
|
662
662
|
...d,
|
|
663
663
|
children: [
|
|
@@ -667,24 +667,24 @@ function Ss({
|
|
|
667
667
|
{
|
|
668
668
|
size: Y,
|
|
669
669
|
strokeWidth: 1.5,
|
|
670
|
-
className: `ds-select-icon ${f &&
|
|
670
|
+
className: `ds-select-icon ${f && $ === "down" ? "ds-select-icon--open" : ""} ${f && $ === "up" ? "ds-select-icon--up" : ""}`,
|
|
671
671
|
"aria-hidden": "true"
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
674
|
]
|
|
675
675
|
}
|
|
676
676
|
) }),
|
|
677
|
-
|
|
677
|
+
a && /* @__PURE__ */ e.jsx("span", { id: M, className: "ds-select-error", role: "alert", children: a }),
|
|
678
678
|
typeof document < "u" && re.createPortal(m, document.body)
|
|
679
679
|
] });
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function Is({
|
|
682
682
|
label: t,
|
|
683
683
|
value: s = 0,
|
|
684
684
|
onChange: n,
|
|
685
685
|
min: r = 0,
|
|
686
|
-
max:
|
|
687
|
-
step:
|
|
686
|
+
max: o = 100,
|
|
687
|
+
step: a = 1,
|
|
688
688
|
size: i = "m",
|
|
689
689
|
disabled: l = !1,
|
|
690
690
|
hint: c,
|
|
@@ -695,45 +695,45 @@ function As({
|
|
|
695
695
|
}) {
|
|
696
696
|
const f = K(), _ = () => {
|
|
697
697
|
if (l) return;
|
|
698
|
-
const x = Math.min(Number(s) +
|
|
698
|
+
const x = Math.min(Number(s) + a, o);
|
|
699
699
|
n == null || n(x);
|
|
700
|
-
},
|
|
700
|
+
}, w = () => {
|
|
701
701
|
if (l) return;
|
|
702
|
-
const x = Math.max(Number(s) -
|
|
702
|
+
const x = Math.max(Number(s) - a, r);
|
|
703
703
|
n == null || n(x);
|
|
704
|
-
},
|
|
704
|
+
}, T = (x) => {
|
|
705
705
|
if (l) return;
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
706
|
+
const y = x.target.value;
|
|
707
|
+
if (y === "") {
|
|
708
708
|
n == null || n(r);
|
|
709
709
|
return;
|
|
710
710
|
}
|
|
711
|
-
const
|
|
712
|
-
if (!isNaN(
|
|
713
|
-
const
|
|
714
|
-
n == null || n(
|
|
711
|
+
const N = Number(y);
|
|
712
|
+
if (!isNaN(N)) {
|
|
713
|
+
const B = Math.min(Math.max(N, r), o);
|
|
714
|
+
n == null || n(B);
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, j = [
|
|
717
717
|
"ds-stepper-wrapper",
|
|
718
718
|
l && "ds-stepper-wrapper--disabled",
|
|
719
719
|
u && "ds-stepper-wrapper--error"
|
|
720
|
-
].filter(Boolean).join(" "),
|
|
720
|
+
].filter(Boolean).join(" "), g = [
|
|
721
721
|
"ds-stepper",
|
|
722
722
|
`ds-stepper--${i}`,
|
|
723
723
|
l && "ds-stepper--disabled"
|
|
724
|
-
].filter(Boolean).join(" "),
|
|
725
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
724
|
+
].filter(Boolean).join(" "), $ = i === "xs" ? q[1] : i === "small" ? q[2] : q[3];
|
|
725
|
+
return /* @__PURE__ */ e.jsxs("div", { className: j, children: [
|
|
726
726
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
727
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
727
|
+
/* @__PURE__ */ e.jsxs("div", { className: g, children: [
|
|
728
728
|
/* @__PURE__ */ e.jsx(
|
|
729
729
|
"button",
|
|
730
730
|
{
|
|
731
731
|
type: "button",
|
|
732
732
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
733
|
-
onClick:
|
|
733
|
+
onClick: w,
|
|
734
734
|
disabled: l || s <= r,
|
|
735
735
|
"aria-label": d ?? f.decrease,
|
|
736
|
-
children: /* @__PURE__ */ e.jsx(
|
|
736
|
+
children: /* @__PURE__ */ e.jsx(Nt, { size: $, strokeWidth: 1.5 })
|
|
737
737
|
}
|
|
738
738
|
),
|
|
739
739
|
/* @__PURE__ */ e.jsx(
|
|
@@ -742,10 +742,10 @@ function As({
|
|
|
742
742
|
type: "number",
|
|
743
743
|
className: "ds-stepper-input",
|
|
744
744
|
value: s,
|
|
745
|
-
onChange:
|
|
745
|
+
onChange: T,
|
|
746
746
|
min: r,
|
|
747
|
-
max:
|
|
748
|
-
step:
|
|
747
|
+
max: o,
|
|
748
|
+
step: a,
|
|
749
749
|
disabled: l,
|
|
750
750
|
...h
|
|
751
751
|
}
|
|
@@ -756,9 +756,9 @@ function As({
|
|
|
756
756
|
type: "button",
|
|
757
757
|
className: "ds-stepper-button ds-stepper-button--plus",
|
|
758
758
|
onClick: _,
|
|
759
|
-
disabled: l || s >=
|
|
759
|
+
disabled: l || s >= o,
|
|
760
760
|
"aria-label": p ?? f.increase,
|
|
761
|
-
children: /* @__PURE__ */ e.jsx(
|
|
761
|
+
children: /* @__PURE__ */ e.jsx(wt, { size: $, strokeWidth: 1.5 })
|
|
762
762
|
}
|
|
763
763
|
)
|
|
764
764
|
] }),
|
|
@@ -766,37 +766,37 @@ function As({
|
|
|
766
766
|
u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: u })
|
|
767
767
|
] });
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function Ds({
|
|
770
770
|
children: t,
|
|
771
771
|
padding: s = "m",
|
|
772
772
|
variant: n = "default",
|
|
773
773
|
hover: r = !1,
|
|
774
774
|
// deprecated, use variant="interactive"
|
|
775
|
-
onClick:
|
|
776
|
-
href:
|
|
775
|
+
onClick: o,
|
|
776
|
+
href: a,
|
|
777
777
|
disabled: i = !1,
|
|
778
778
|
className: l = "",
|
|
779
779
|
...c
|
|
780
780
|
}) {
|
|
781
|
-
const d = (r ? "interactive" : n) === "interactive" ||
|
|
781
|
+
const d = (r ? "interactive" : n) === "interactive" || o || a, p = [
|
|
782
782
|
"ds-card",
|
|
783
783
|
`ds-card--${s}`,
|
|
784
784
|
d && "ds-card--interactive",
|
|
785
785
|
l
|
|
786
786
|
].filter(Boolean).join(" ");
|
|
787
|
-
if (
|
|
788
|
-
const _ = (
|
|
787
|
+
if (a) {
|
|
788
|
+
const _ = (w) => {
|
|
789
789
|
if (i) {
|
|
790
|
-
|
|
790
|
+
w.preventDefault();
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
|
-
|
|
793
|
+
w.metaKey || w.ctrlKey || w.button === 1 || (w.preventDefault(), o == null || o(w));
|
|
794
794
|
};
|
|
795
795
|
return /* @__PURE__ */ e.jsx(
|
|
796
796
|
"a",
|
|
797
797
|
{
|
|
798
798
|
className: p,
|
|
799
|
-
href: i ? void 0 :
|
|
799
|
+
href: i ? void 0 : a,
|
|
800
800
|
onClick: _,
|
|
801
801
|
"aria-disabled": i ? "true" : void 0,
|
|
802
802
|
...c,
|
|
@@ -804,41 +804,41 @@ function Bs({
|
|
|
804
804
|
}
|
|
805
805
|
);
|
|
806
806
|
}
|
|
807
|
-
const h = d &&
|
|
807
|
+
const h = d && o ? "button" : "div", f = d && o ? {
|
|
808
808
|
type: "button",
|
|
809
|
-
onClick:
|
|
809
|
+
onClick: o,
|
|
810
810
|
disabled: i
|
|
811
811
|
} : {};
|
|
812
812
|
return /* @__PURE__ */ e.jsx(
|
|
813
813
|
h,
|
|
814
814
|
{
|
|
815
815
|
className: p,
|
|
816
|
-
role: d && !
|
|
816
|
+
role: d && !o ? "article" : void 0,
|
|
817
817
|
...f,
|
|
818
818
|
...c,
|
|
819
819
|
children: t
|
|
820
820
|
}
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Ls({ children: t, ...s }) {
|
|
824
824
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...s, children: t });
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Ps({ children: t, ...s }) {
|
|
827
827
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...s, children: t });
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Ms({ children: t, ...s }) {
|
|
830
830
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...s, children: t });
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Fs({ children: t, ...s }) {
|
|
833
833
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...s, children: t });
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function zs({ children: t, secondary: s = !1, ...n }) {
|
|
836
836
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${s ? "ds-p1--secondary" : ""}`, ...n, children: t });
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function Wt({ children: t, secondary: s = !1, ...n }) {
|
|
839
839
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${s ? "ds-p2--secondary" : ""}`, ...n, children: t });
|
|
840
840
|
}
|
|
841
|
-
function
|
|
841
|
+
function mt({ children: t, secondary: s = !1, ...n }) {
|
|
842
842
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${s ? "ds-p3--secondary" : ""}`, ...n, children: t });
|
|
843
843
|
}
|
|
844
844
|
function he({
|
|
@@ -846,48 +846,48 @@ function he({
|
|
|
846
846
|
variant: s = "default",
|
|
847
847
|
size: n = "m",
|
|
848
848
|
role: r,
|
|
849
|
-
...
|
|
849
|
+
...o
|
|
850
850
|
}) {
|
|
851
|
-
const
|
|
851
|
+
const a = [
|
|
852
852
|
"ds-badge",
|
|
853
853
|
`ds-badge--${s}`,
|
|
854
854
|
`ds-badge--${n}`
|
|
855
855
|
].filter(Boolean).join(" "), i = r || (["info", "success", "warning", "error"].includes(s) ? "status" : void 0);
|
|
856
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
856
|
+
return /* @__PURE__ */ e.jsx("span", { className: a, role: i, ...o, children: t });
|
|
857
857
|
}
|
|
858
|
-
const
|
|
858
|
+
const Ot = {
|
|
859
859
|
info: We,
|
|
860
|
-
success:
|
|
861
|
-
warning:
|
|
860
|
+
success: ze,
|
|
861
|
+
warning: Fe,
|
|
862
862
|
error: Me
|
|
863
|
-
},
|
|
863
|
+
}, Ws = X.forwardRef(function({
|
|
864
864
|
children: s,
|
|
865
865
|
variant: n = "info",
|
|
866
866
|
title: r,
|
|
867
|
-
onClose:
|
|
868
|
-
role:
|
|
867
|
+
onClose: o,
|
|
868
|
+
role: a,
|
|
869
869
|
closeLabel: i,
|
|
870
870
|
...l
|
|
871
871
|
}, c) {
|
|
872
|
-
const u = K(), d =
|
|
872
|
+
const u = K(), d = Ot[n], p = a || (n === "error" ? "alert" : "status");
|
|
873
873
|
return /* @__PURE__ */ e.jsxs("div", { ref: c, className: `ds-alert ds-alert--${n} ${r ? "" : "ds-alert--no-title"}`, role: p, ...l, children: [
|
|
874
874
|
d && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(d, { size: q[3], strokeWidth: 1.5 }) }),
|
|
875
875
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
876
876
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: r }),
|
|
877
877
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
878
878
|
] }),
|
|
879
|
-
|
|
879
|
+
o && /* @__PURE__ */ e.jsx(
|
|
880
880
|
"button",
|
|
881
881
|
{
|
|
882
882
|
type: "button",
|
|
883
883
|
className: "ds-alert__close",
|
|
884
|
-
onClick:
|
|
884
|
+
onClick: o,
|
|
885
885
|
"aria-label": i ?? u.closeAlert,
|
|
886
886
|
children: /* @__PURE__ */ e.jsx(te, { size: q[3], strokeWidth: 1.5 })
|
|
887
887
|
}
|
|
888
888
|
)
|
|
889
889
|
] });
|
|
890
|
-
}),
|
|
890
|
+
}), Ct = "data-ds-portal";
|
|
891
891
|
function Ce(t) {
|
|
892
892
|
var n;
|
|
893
893
|
const s = ((n = t.composedPath) == null ? void 0 : n.call(t)[0]) ?? t.target;
|
|
@@ -895,38 +895,38 @@ function Ce(t) {
|
|
|
895
895
|
}
|
|
896
896
|
function Ue(t, s) {
|
|
897
897
|
var r;
|
|
898
|
-
const n = (r = t == null ? void 0 : t.closest) == null ? void 0 : r.call(t, `[${
|
|
898
|
+
const n = (r = t == null ? void 0 : t.closest) == null ? void 0 : r.call(t, `[${Ct}]`);
|
|
899
899
|
return !!(n && n !== s);
|
|
900
900
|
}
|
|
901
|
-
const
|
|
902
|
-
function
|
|
901
|
+
const Ut = 200;
|
|
902
|
+
function Os({
|
|
903
903
|
children: t,
|
|
904
904
|
title: s,
|
|
905
905
|
onClose: n,
|
|
906
906
|
size: r = "m",
|
|
907
|
-
scrollable:
|
|
908
|
-
subHeader:
|
|
907
|
+
scrollable: o = !1,
|
|
908
|
+
subHeader: a,
|
|
909
909
|
closeLabel: i,
|
|
910
910
|
...l
|
|
911
911
|
}) {
|
|
912
|
-
const c = K(), u =
|
|
912
|
+
const c = K(), u = S(null), d = S(null), p = X.useId(), [h, f] = L(!1), _ = S(null), w = () => {
|
|
913
913
|
!n || h || (f(!0), _.current = setTimeout(() => {
|
|
914
914
|
f(!1), n();
|
|
915
|
-
},
|
|
915
|
+
}, Ut));
|
|
916
916
|
};
|
|
917
917
|
P(() => () => clearTimeout(_.current), []), P(() => {
|
|
918
|
-
const x = (
|
|
919
|
-
|
|
920
|
-
},
|
|
921
|
-
var
|
|
922
|
-
const
|
|
923
|
-
|
|
918
|
+
const x = (N) => {
|
|
919
|
+
N.key === "Escape" && w();
|
|
920
|
+
}, y = (N) => {
|
|
921
|
+
var D;
|
|
922
|
+
const B = Ce(N);
|
|
923
|
+
B && ((D = d.current) != null && D.contains(B) || Ue(B, u.current) || w());
|
|
924
924
|
};
|
|
925
|
-
return document.addEventListener("keydown", x), document.addEventListener("mousedown",
|
|
926
|
-
document.removeEventListener("keydown", x), document.removeEventListener("mousedown",
|
|
925
|
+
return document.addEventListener("keydown", x), document.addEventListener("mousedown", y), () => {
|
|
926
|
+
document.removeEventListener("keydown", x), document.removeEventListener("mousedown", y);
|
|
927
927
|
};
|
|
928
928
|
}, [n, h]);
|
|
929
|
-
const
|
|
929
|
+
const T = X.Children.toArray(t), j = T.find((x) => (x == null ? void 0 : x.type) === xe), g = T.filter((x) => (x == null ? void 0 : x.type) !== xe), $ = /* @__PURE__ */ e.jsx(
|
|
930
930
|
"div",
|
|
931
931
|
{
|
|
932
932
|
className: ["ds-modal-overlay", h && "ds-modal-overlay--closing"].filter(Boolean).join(" "),
|
|
@@ -936,7 +936,7 @@ function Fs({
|
|
|
936
936
|
children: /* @__PURE__ */ e.jsxs(
|
|
937
937
|
"div",
|
|
938
938
|
{
|
|
939
|
-
className: [`ds-modal ds-modal--${r}`,
|
|
939
|
+
className: [`ds-modal ds-modal--${r}`, o && "ds-modal--scrollable"].filter(Boolean).join(" "),
|
|
940
940
|
"data-surface": "2",
|
|
941
941
|
ref: d,
|
|
942
942
|
role: "dialog",
|
|
@@ -950,57 +950,57 @@ function Fs({
|
|
|
950
950
|
variant: "ghost",
|
|
951
951
|
size: "small",
|
|
952
952
|
icon: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 }),
|
|
953
|
-
onClick:
|
|
953
|
+
onClick: w,
|
|
954
954
|
"aria-label": i ?? c.closeModal
|
|
955
955
|
}
|
|
956
956
|
),
|
|
957
|
-
(s ||
|
|
957
|
+
(s || a) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
958
958
|
s && /* @__PURE__ */ e.jsx("h3", { id: p, className: "ds-modal__title", children: s }),
|
|
959
|
-
|
|
959
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: a })
|
|
960
960
|
] }),
|
|
961
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children:
|
|
962
|
-
|
|
961
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: g }),
|
|
962
|
+
j
|
|
963
963
|
]
|
|
964
964
|
}
|
|
965
965
|
)
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
|
-
return typeof document > "u" ?
|
|
968
|
+
return typeof document > "u" ? $ : re.createPortal($, document.body);
|
|
969
969
|
}
|
|
970
970
|
function xe({ children: t }) {
|
|
971
971
|
return !t || X.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
|
|
972
972
|
}
|
|
973
|
-
const
|
|
974
|
-
function
|
|
973
|
+
const Ht = 320;
|
|
974
|
+
function Cs({
|
|
975
975
|
children: t,
|
|
976
976
|
title: s,
|
|
977
977
|
onClose: n,
|
|
978
978
|
subHeader: r,
|
|
979
|
-
closeLabel:
|
|
980
|
-
...
|
|
979
|
+
closeLabel: o,
|
|
980
|
+
...a
|
|
981
981
|
}) {
|
|
982
|
-
const i = K(), l =
|
|
982
|
+
const i = K(), l = S(null), c = S(null), u = X.useId(), [d, p] = L(!1), h = S(null), f = () => {
|
|
983
983
|
!n || d || (p(!0), h.current = setTimeout(() => {
|
|
984
984
|
p(!1), n();
|
|
985
|
-
},
|
|
985
|
+
}, Ht));
|
|
986
986
|
};
|
|
987
987
|
P(() => () => clearTimeout(h.current), []), P(() => {
|
|
988
|
-
const
|
|
988
|
+
const g = (x) => {
|
|
989
989
|
x.key === "Escape" && f();
|
|
990
|
-
},
|
|
991
|
-
var
|
|
992
|
-
const
|
|
993
|
-
|
|
990
|
+
}, $ = (x) => {
|
|
991
|
+
var N;
|
|
992
|
+
const y = Ce(x);
|
|
993
|
+
y && ((N = c.current) != null && N.contains(y) || Ue(y, l.current) || f());
|
|
994
994
|
};
|
|
995
|
-
return document.addEventListener("keydown",
|
|
996
|
-
document.removeEventListener("keydown",
|
|
995
|
+
return document.addEventListener("keydown", g), document.addEventListener("mousedown", $), () => {
|
|
996
|
+
document.removeEventListener("keydown", g), document.removeEventListener("mousedown", $);
|
|
997
997
|
};
|
|
998
998
|
}, [n, d]);
|
|
999
|
-
const _ = X.Children.toArray(t),
|
|
999
|
+
const _ = X.Children.toArray(t), w = _.find((g) => (g == null ? void 0 : g.type) === xe), T = _.filter((g) => (g == null ? void 0 : g.type) !== xe), j = /* @__PURE__ */ e.jsx(
|
|
1000
1000
|
"div",
|
|
1001
1001
|
{
|
|
1002
1002
|
className: ["ds-bottom-sheet-overlay", d && "ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),
|
|
1003
|
-
...
|
|
1003
|
+
...a,
|
|
1004
1004
|
ref: l,
|
|
1005
1005
|
"data-ds-portal": "",
|
|
1006
1006
|
children: /* @__PURE__ */ e.jsxs(
|
|
@@ -1022,41 +1022,41 @@ function Ws({
|
|
|
1022
1022
|
size: "small",
|
|
1023
1023
|
icon: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 }),
|
|
1024
1024
|
onClick: f,
|
|
1025
|
-
"aria-label":
|
|
1025
|
+
"aria-label": o ?? i.close
|
|
1026
1026
|
}
|
|
1027
1027
|
),
|
|
1028
1028
|
(s || r) && /* @__PURE__ */ e.jsxs("div", { className: "ds-bottom-sheet__header", children: [
|
|
1029
1029
|
s && /* @__PURE__ */ e.jsx("h3", { id: u, className: "ds-bottom-sheet__title", children: s }),
|
|
1030
1030
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__subheader", children: r })
|
|
1031
1031
|
] }),
|
|
1032
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children:
|
|
1033
|
-
|
|
1032
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: T }),
|
|
1033
|
+
w
|
|
1034
1034
|
]
|
|
1035
1035
|
}
|
|
1036
1036
|
)
|
|
1037
1037
|
}
|
|
1038
1038
|
);
|
|
1039
|
-
return typeof document > "u" ?
|
|
1039
|
+
return typeof document > "u" ? j : re.createPortal(j, document.body);
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Vt({
|
|
1042
1042
|
children: t,
|
|
1043
1043
|
title: s,
|
|
1044
1044
|
defaultExpanded: n = !1,
|
|
1045
1045
|
expanded: r,
|
|
1046
|
-
onToggle:
|
|
1047
|
-
padding:
|
|
1046
|
+
onToggle: o,
|
|
1047
|
+
padding: a = "s",
|
|
1048
1048
|
className: i = "",
|
|
1049
1049
|
...l
|
|
1050
1050
|
}) {
|
|
1051
|
-
const c = K(), u = s ?? c.code, [d, p] =
|
|
1052
|
-
h ?
|
|
1053
|
-
},
|
|
1051
|
+
const c = K(), u = s ?? c.code, [d, p] = L(n), h = r !== void 0, f = h ? r : d, _ = () => {
|
|
1052
|
+
h ? o == null || o(!r) : p((T) => !T);
|
|
1053
|
+
}, w = [
|
|
1054
1054
|
"ds-code-accordion",
|
|
1055
|
-
`ds-code-accordion--${
|
|
1055
|
+
`ds-code-accordion--${a}`,
|
|
1056
1056
|
f && "ds-code-accordion--expanded",
|
|
1057
1057
|
i
|
|
1058
1058
|
].filter(Boolean).join(" ");
|
|
1059
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
1059
|
+
return /* @__PURE__ */ e.jsxs("div", { className: w, ...l, children: [
|
|
1060
1060
|
/* @__PURE__ */ e.jsxs(
|
|
1061
1061
|
"button",
|
|
1062
1062
|
{
|
|
@@ -1080,12 +1080,12 @@ function Ht({
|
|
|
1080
1080
|
/* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__inner", children: /* @__PURE__ */ e.jsx("pre", { className: "ds-code-accordion__pre ds-scrollable", children: /* @__PURE__ */ e.jsx("code", { children: t }) }) }) })
|
|
1081
1081
|
] });
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Us({ children: t, block: s = !1, collapsible: n = !1, title: r, defaultExpanded: o = !1, ...a }) {
|
|
1084
1084
|
const i = K(), l = r ?? i.code;
|
|
1085
|
-
return s ? n ? /* @__PURE__ */ e.jsx(
|
|
1085
|
+
return s ? n ? /* @__PURE__ */ e.jsx(Vt, { title: l, defaultExpanded: o, ...a, children: t }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...a, children: /* @__PURE__ */ e.jsx("code", { children: t }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...a, children: t });
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1088
|
-
const l = r === "_blank" ?
|
|
1087
|
+
function Hs({ href: t, children: s, onClick: n, target: r, rel: o, ...a }) {
|
|
1088
|
+
const l = r === "_blank" ? o ? `${o} noopener noreferrer` : "noopener noreferrer" : o;
|
|
1089
1089
|
return /* @__PURE__ */ e.jsx(
|
|
1090
1090
|
"a",
|
|
1091
1091
|
{
|
|
@@ -1094,19 +1094,19 @@ function Cs({ href: t, children: s, onClick: n, target: r, rel: a, ...o }) {
|
|
|
1094
1094
|
onClick: n,
|
|
1095
1095
|
target: r,
|
|
1096
1096
|
rel: l,
|
|
1097
|
-
...
|
|
1097
|
+
...a,
|
|
1098
1098
|
children: s
|
|
1099
1099
|
}
|
|
1100
1100
|
);
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...r, children: X.Children.map(t, (
|
|
1102
|
+
function Vs({ children: t, size: s = "m", variant: n = "ghost", ...r }) {
|
|
1103
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...r, children: X.Children.map(t, (o) => X.isValidElement(o) ? X.cloneElement(o, { size: s, variant: n }) : o) });
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Ys({ children: t, selected: s = !1, onClick: n, size: r = "m", variant: o = "ghost", disabled: a = !1, icon: i, href: l, ...c }) {
|
|
1106
1106
|
const u = i && !t, d = [
|
|
1107
1107
|
"ds-tab",
|
|
1108
1108
|
`ds-tab--${r}`,
|
|
1109
|
-
`ds-tab--${
|
|
1109
|
+
`ds-tab--${o}`,
|
|
1110
1110
|
s && "ds-tab--selected",
|
|
1111
1111
|
u && "ds-tab--icon-only"
|
|
1112
1112
|
].filter(Boolean).join(" "), p = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -1115,7 +1115,7 @@ function Hs({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
|
|
|
1115
1115
|
] });
|
|
1116
1116
|
if (l) {
|
|
1117
1117
|
const h = (f) => {
|
|
1118
|
-
if (
|
|
1118
|
+
if (a) {
|
|
1119
1119
|
f.preventDefault();
|
|
1120
1120
|
return;
|
|
1121
1121
|
}
|
|
@@ -1126,9 +1126,9 @@ function Hs({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
|
|
|
1126
1126
|
{
|
|
1127
1127
|
role: "tab",
|
|
1128
1128
|
"aria-current": s ? "page" : void 0,
|
|
1129
|
-
"aria-disabled":
|
|
1129
|
+
"aria-disabled": a ? "true" : void 0,
|
|
1130
1130
|
className: d,
|
|
1131
|
-
href:
|
|
1131
|
+
href: a ? void 0 : l,
|
|
1132
1132
|
onClick: h,
|
|
1133
1133
|
...c,
|
|
1134
1134
|
children: p
|
|
@@ -1142,23 +1142,23 @@ function Hs({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
|
|
|
1142
1142
|
"aria-selected": s,
|
|
1143
1143
|
className: d,
|
|
1144
1144
|
onClick: n,
|
|
1145
|
-
disabled:
|
|
1145
|
+
disabled: a,
|
|
1146
1146
|
...c,
|
|
1147
1147
|
children: p
|
|
1148
1148
|
}
|
|
1149
1149
|
);
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function qs({ children: t, className: s = "", ...n }) {
|
|
1152
1152
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-browser-pane", s].filter(Boolean).join(" "), ...n, children: t });
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Gs({ tabs: t, active: s, onChange: n, onClose: r, className: o = "", ...a }) {
|
|
1155
1155
|
const { t: i } = be();
|
|
1156
1156
|
return /* @__PURE__ */ e.jsx(
|
|
1157
1157
|
"div",
|
|
1158
1158
|
{
|
|
1159
|
-
className: ["ds-browser-tabs",
|
|
1159
|
+
className: ["ds-browser-tabs", o].filter(Boolean).join(" "),
|
|
1160
1160
|
role: "tablist",
|
|
1161
|
-
...
|
|
1161
|
+
...a,
|
|
1162
1162
|
children: t.map((l) => {
|
|
1163
1163
|
const c = l.id === s, u = !!l.closable;
|
|
1164
1164
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -1205,23 +1205,23 @@ function Ys({ tabs: t, active: s, onChange: n, onClose: r, className: a = "", ..
|
|
|
1205
1205
|
}
|
|
1206
1206
|
);
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function Ks({ children: t, className: s = "", ...n }) {
|
|
1209
1209
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-list", s].filter(Boolean).join(" "), role: "list", ...n, children: t });
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function Xs({
|
|
1212
1212
|
icon: t,
|
|
1213
1213
|
title: s,
|
|
1214
1214
|
subtitle: n,
|
|
1215
1215
|
meta: r,
|
|
1216
|
-
onClick:
|
|
1217
|
-
className:
|
|
1216
|
+
onClick: o,
|
|
1217
|
+
className: a = "",
|
|
1218
1218
|
...i
|
|
1219
1219
|
}) {
|
|
1220
1220
|
const l = r == null ? [] : Array.isArray(r) ? r : [r], c = [
|
|
1221
1221
|
"ds-list-row",
|
|
1222
1222
|
!t && "ds-list-row--no-icon",
|
|
1223
|
-
|
|
1224
|
-
|
|
1223
|
+
o && "ds-list-row--interactive",
|
|
1224
|
+
a
|
|
1225
1225
|
].filter(Boolean).join(" "), u = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1226
1226
|
t ? /* @__PURE__ */ e.jsx("span", { className: "ds-list-row__icon", "aria-hidden": !0, children: t }) : null,
|
|
1227
1227
|
/* @__PURE__ */ e.jsxs("span", { className: "ds-list-row__name", children: [
|
|
@@ -1230,40 +1230,40 @@ function Gs({
|
|
|
1230
1230
|
] }),
|
|
1231
1231
|
l.map((d, p) => /* @__PURE__ */ e.jsx("span", { className: "ds-list-row__meta", children: d }, p))
|
|
1232
1232
|
] });
|
|
1233
|
-
return
|
|
1233
|
+
return o ? /* @__PURE__ */ e.jsx("button", { type: "button", role: "listitem", className: c, onClick: o, ...i, children: u }) : /* @__PURE__ */ e.jsx("div", { role: "listitem", className: c, ...i, children: u });
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const
|
|
1237
|
-
if (!
|
|
1238
|
-
const f =
|
|
1235
|
+
function Js({ options: t, value: s, onChange: n, size: r = "m", disabled: o = !1 }) {
|
|
1236
|
+
const a = S(null), i = S(null), [l, c] = L(!1), u = S(!1), d = S(null), p = S(null), h = () => {
|
|
1237
|
+
if (!a.current) return;
|
|
1238
|
+
const f = a.current.querySelector(`[data-value="${s}"]`);
|
|
1239
1239
|
if (!f) return;
|
|
1240
|
-
const _ =
|
|
1241
|
-
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left =
|
|
1242
|
-
if (!i.current || !
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
1245
|
-
const
|
|
1246
|
-
i.current.style.transition = "none", i.current.style.left = x.left -
|
|
1240
|
+
const _ = a.current.getBoundingClientRect(), w = f.getBoundingClientRect(), T = w.left - _.left, j = w.width;
|
|
1241
|
+
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = T + "px", i.current.style.width = j + "px", u.current = !1) : (c(!0), requestAnimationFrame(() => {
|
|
1242
|
+
if (!i.current || !a.current) return;
|
|
1243
|
+
const g = a.current.querySelector(`[data-value="${s}"]`);
|
|
1244
|
+
if (!g) return;
|
|
1245
|
+
const $ = a.current.getBoundingClientRect(), x = g.getBoundingClientRect();
|
|
1246
|
+
i.current.style.transition = "none", i.current.style.left = x.left - $.left + "px", i.current.style.width = x.width + "px";
|
|
1247
1247
|
}));
|
|
1248
1248
|
};
|
|
1249
|
-
return p.current = h,
|
|
1249
|
+
return p.current = h, dt(() => {
|
|
1250
1250
|
const f = d.current !== s;
|
|
1251
1251
|
d.current = s, u.current = l && f, h();
|
|
1252
1252
|
}), P(() => {
|
|
1253
|
-
if (!
|
|
1253
|
+
if (!a.current) return;
|
|
1254
1254
|
const f = new ResizeObserver(() => {
|
|
1255
1255
|
u.current = !1, p.current();
|
|
1256
1256
|
});
|
|
1257
|
-
return f.observe(
|
|
1257
|
+
return f.observe(a.current), () => f.disconnect();
|
|
1258
1258
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
1259
1259
|
"div",
|
|
1260
1260
|
{
|
|
1261
1261
|
className: [
|
|
1262
1262
|
"ds-seg",
|
|
1263
1263
|
`ds-seg--${r}`,
|
|
1264
|
-
|
|
1264
|
+
o && "ds-seg--disabled"
|
|
1265
1265
|
].filter(Boolean).join(" "),
|
|
1266
|
-
ref:
|
|
1266
|
+
ref: a,
|
|
1267
1267
|
role: "group",
|
|
1268
1268
|
children: [
|
|
1269
1269
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -1280,9 +1280,9 @@ function Ks({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1
|
|
|
1280
1280
|
type: "button",
|
|
1281
1281
|
"data-value": f.value,
|
|
1282
1282
|
className: ["ds-seg__btn", s === f.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1283
|
-
onClick: () => !
|
|
1283
|
+
onClick: () => !o && n(f.value),
|
|
1284
1284
|
"aria-pressed": s === f.value,
|
|
1285
|
-
disabled:
|
|
1285
|
+
disabled: o,
|
|
1286
1286
|
children: [
|
|
1287
1287
|
f.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-seg__btn-icon", "aria-hidden": "true", children: f.icon }),
|
|
1288
1288
|
f.label
|
|
@@ -1299,15 +1299,15 @@ function He({
|
|
|
1299
1299
|
title: s,
|
|
1300
1300
|
defaultExpanded: n = !1,
|
|
1301
1301
|
expanded: r,
|
|
1302
|
-
onToggle:
|
|
1303
|
-
padding:
|
|
1302
|
+
onToggle: o,
|
|
1303
|
+
padding: a = "m",
|
|
1304
1304
|
...i
|
|
1305
1305
|
}) {
|
|
1306
|
-
const [l, c] =
|
|
1307
|
-
u ?
|
|
1306
|
+
const [l, c] = L(n), u = r !== void 0, d = u ? r : l, p = () => {
|
|
1307
|
+
u ? o == null || o(!r) : c((f) => !f);
|
|
1308
1308
|
}, h = [
|
|
1309
1309
|
"ds-accordion",
|
|
1310
|
-
`ds-accordion--${
|
|
1310
|
+
`ds-accordion--${a}`,
|
|
1311
1311
|
d && "ds-accordion--expanded"
|
|
1312
1312
|
].filter(Boolean).join(" ");
|
|
1313
1313
|
return /* @__PURE__ */ e.jsxs("div", { className: h, ...i, children: [
|
|
@@ -1335,64 +1335,77 @@ function He({
|
|
|
1335
1335
|
] });
|
|
1336
1336
|
}
|
|
1337
1337
|
const ce = 8, pe = 8;
|
|
1338
|
-
function
|
|
1338
|
+
function Yt(t, s, n) {
|
|
1339
1339
|
const r = window.innerWidth;
|
|
1340
|
-
let
|
|
1340
|
+
let o, a;
|
|
1341
1341
|
switch (t) {
|
|
1342
1342
|
case "top":
|
|
1343
|
-
|
|
1343
|
+
o = s.top - n.height - ce, a = s.left + s.width / 2 - n.width / 2;
|
|
1344
1344
|
break;
|
|
1345
1345
|
case "bottom":
|
|
1346
|
-
|
|
1346
|
+
o = s.bottom + ce, a = s.left + s.width / 2 - n.width / 2;
|
|
1347
1347
|
break;
|
|
1348
1348
|
case "left":
|
|
1349
|
-
|
|
1349
|
+
o = s.top + s.height / 2 - n.height / 2, a = s.left - n.width - ce;
|
|
1350
1350
|
break;
|
|
1351
1351
|
case "right":
|
|
1352
|
-
|
|
1352
|
+
o = s.top + s.height / 2 - n.height / 2, a = s.right + ce;
|
|
1353
1353
|
break;
|
|
1354
1354
|
default:
|
|
1355
|
-
|
|
1355
|
+
o = s.bottom + ce, a = s.left;
|
|
1356
1356
|
}
|
|
1357
|
-
const i = Math.max(pe, Math.min(r - n.width - pe,
|
|
1358
|
-
return { top:
|
|
1357
|
+
const i = Math.max(pe, Math.min(r - n.width - pe, a)), l = a - i;
|
|
1358
|
+
return { top: o, left: i, arrowOffset: l };
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1361
|
-
const r = window.innerWidth,
|
|
1360
|
+
function qt(t, s, n) {
|
|
1361
|
+
const r = window.innerWidth, o = window.innerHeight;
|
|
1362
1362
|
if (t.top >= s + ce + pe) return "top";
|
|
1363
|
-
if (
|
|
1363
|
+
if (o - t.bottom >= s + ce + pe) return "bottom";
|
|
1364
1364
|
if (r - t.right >= n + ce + pe) return "right";
|
|
1365
1365
|
if (t.left >= n + ce + pe) return "left";
|
|
1366
|
-
const
|
|
1367
|
-
return
|
|
1366
|
+
const a = Math.max(t.top, o - t.bottom, t.left, r - t.right);
|
|
1367
|
+
return a === t.top ? "top" : a === o - t.bottom ? "bottom" : a === r - t.right ? "right" : "left";
|
|
1368
|
+
}
|
|
1369
|
+
function Ze() {
|
|
1370
|
+
return window.matchMedia("(hover: hover) and (pointer: fine)").matches;
|
|
1371
|
+
}
|
|
1372
|
+
function Gt(t) {
|
|
1373
|
+
return t ? t.matches(":focus-visible") || !!t.querySelector(":focus-visible") : !1;
|
|
1368
1374
|
}
|
|
1369
1375
|
function Ve({ children: t, content: s, position: n, ...r }) {
|
|
1370
|
-
const [
|
|
1376
|
+
const [o, a] = L(!1), [i, l] = L({ visibility: "hidden" }), [c, u] = L(n || "top"), d = S(null), p = S(null), h = () => {
|
|
1371
1377
|
if (!d.current || !p.current) return;
|
|
1372
|
-
const
|
|
1373
|
-
u(
|
|
1378
|
+
const g = d.current.getBoundingClientRect(), $ = p.current.getBoundingClientRect(), x = n || qt(g, $.height, $.width), { top: y, left: N, arrowOffset: B } = Yt(x, g, $);
|
|
1379
|
+
u(x), l({
|
|
1374
1380
|
position: "fixed",
|
|
1375
|
-
top:
|
|
1376
|
-
left:
|
|
1381
|
+
top: y,
|
|
1382
|
+
left: N,
|
|
1377
1383
|
visibility: "visible",
|
|
1378
|
-
"--arrow-offset": `${
|
|
1384
|
+
"--arrow-offset": `${B}px`
|
|
1379
1385
|
});
|
|
1380
1386
|
};
|
|
1381
|
-
|
|
1382
|
-
if (!
|
|
1387
|
+
P(() => {
|
|
1388
|
+
if (!o) return;
|
|
1383
1389
|
l({ position: "fixed", visibility: "hidden" });
|
|
1384
|
-
const
|
|
1385
|
-
return window.addEventListener("scroll",
|
|
1386
|
-
cancelAnimationFrame(
|
|
1390
|
+
const g = requestAnimationFrame(h);
|
|
1391
|
+
return window.addEventListener("scroll", h, !0), window.addEventListener("resize", h), () => {
|
|
1392
|
+
cancelAnimationFrame(g), window.removeEventListener("scroll", h, !0), window.removeEventListener("resize", h);
|
|
1387
1393
|
};
|
|
1388
|
-
}, [
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1394
|
+
}, [o, n]);
|
|
1395
|
+
const f = () => {
|
|
1396
|
+
Ze() && a(!0);
|
|
1397
|
+
}, _ = () => {
|
|
1398
|
+
Gt(d.current) || a(!1);
|
|
1399
|
+
}, w = (g) => {
|
|
1400
|
+
const $ = g.target;
|
|
1401
|
+
$ instanceof Element && $.matches(":focus-visible") && a(!0);
|
|
1402
|
+
}, T = (g) => {
|
|
1403
|
+
var x, y;
|
|
1404
|
+
const $ = g.relatedTarget;
|
|
1405
|
+
$ instanceof Node && ((x = d.current) != null && x.contains($)) || Ze() && ((y = d.current) != null && y.matches(":hover")) || a(!1);
|
|
1406
|
+
};
|
|
1407
|
+
if (!s) return t;
|
|
1408
|
+
const j = o && /* @__PURE__ */ e.jsx(
|
|
1396
1409
|
"div",
|
|
1397
1410
|
{
|
|
1398
1411
|
ref: p,
|
|
@@ -1408,94 +1421,89 @@ function Ve({ children: t, content: s, position: n, ...r }) {
|
|
|
1408
1421
|
{
|
|
1409
1422
|
ref: d,
|
|
1410
1423
|
className: "ds-tooltip-wrapper",
|
|
1411
|
-
onMouseEnter:
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
h.current || o(!1);
|
|
1416
|
-
},
|
|
1417
|
-
onTouchStart: () => {
|
|
1418
|
-
h.current = !0, o((j) => !j);
|
|
1419
|
-
},
|
|
1424
|
+
onMouseEnter: f,
|
|
1425
|
+
onMouseLeave: _,
|
|
1426
|
+
onFocus: w,
|
|
1427
|
+
onBlur: T,
|
|
1420
1428
|
...r,
|
|
1421
1429
|
children: [
|
|
1422
1430
|
t,
|
|
1423
|
-
typeof document < "u" && re.createPortal(
|
|
1431
|
+
typeof document < "u" && re.createPortal(j, document.body)
|
|
1424
1432
|
]
|
|
1425
1433
|
}
|
|
1426
1434
|
);
|
|
1427
1435
|
}
|
|
1428
|
-
const
|
|
1429
|
-
function
|
|
1436
|
+
const Qe = 8, Ee = 8, Kt = 140;
|
|
1437
|
+
function et(t) {
|
|
1430
1438
|
const s = String(t ?? "").replace(/^@/, "").trim();
|
|
1431
1439
|
return s ? `@${s}` : "";
|
|
1432
1440
|
}
|
|
1433
|
-
function
|
|
1441
|
+
function Zs({
|
|
1434
1442
|
label: t,
|
|
1435
1443
|
children: s,
|
|
1436
1444
|
mode: n = "click",
|
|
1437
1445
|
avatar: r,
|
|
1438
|
-
name:
|
|
1439
|
-
handle:
|
|
1446
|
+
name: o,
|
|
1447
|
+
handle: a,
|
|
1440
1448
|
description: i,
|
|
1441
1449
|
actions: l,
|
|
1442
1450
|
className: c = "",
|
|
1443
1451
|
popoverClassName: u = "",
|
|
1444
1452
|
...d
|
|
1445
1453
|
}) {
|
|
1446
|
-
const p =
|
|
1454
|
+
const p = jt(), h = S(null), f = S(null), _ = S(null), [w, T] = L(!1), [j, g] = L(null), $ = s != null, x = o || t || "", y = et(t || o), N = et(a), B = ne(() => {
|
|
1447
1455
|
_.current != null && (window.clearTimeout(_.current), _.current = null);
|
|
1448
|
-
}, []),
|
|
1449
|
-
|
|
1450
|
-
}, [
|
|
1451
|
-
|
|
1452
|
-
}, [
|
|
1456
|
+
}, []), D = ne(() => {
|
|
1457
|
+
B(), T(!0);
|
|
1458
|
+
}, [B]), W = ne(() => {
|
|
1459
|
+
B(), _.current = window.setTimeout(() => T(!1), Kt);
|
|
1460
|
+
}, [B]), O = ne(() => {
|
|
1453
1461
|
const M = h.current, V = f.current;
|
|
1454
1462
|
if (!M) return;
|
|
1455
|
-
const v = M.getBoundingClientRect(),
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
const H = Math.max(Ee, Math.min(v.left, window.innerWidth -
|
|
1459
|
-
|
|
1463
|
+
const v = M.getBoundingClientRect(), R = (V == null ? void 0 : V.offsetHeight) ?? 160, A = (V == null ? void 0 : V.offsetWidth) ?? 260;
|
|
1464
|
+
let F = v.bottom + Qe;
|
|
1465
|
+
F + R > window.innerHeight - Ee && (F = Math.max(Ee, v.top - R - Qe));
|
|
1466
|
+
const H = Math.max(Ee, Math.min(v.left, window.innerWidth - A - Ee));
|
|
1467
|
+
g({ top: F, left: H });
|
|
1460
1468
|
}, []);
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
}, [
|
|
1464
|
-
if (!
|
|
1465
|
-
const M = () => O(), V = (
|
|
1466
|
-
|
|
1467
|
-
}, v = (
|
|
1468
|
-
var
|
|
1469
|
+
dt(() => {
|
|
1470
|
+
w && O();
|
|
1471
|
+
}, [w, O]), P(() => {
|
|
1472
|
+
if (!w) return;
|
|
1473
|
+
const M = () => O(), V = (R) => {
|
|
1474
|
+
R.key === "Escape" && T(!1);
|
|
1475
|
+
}, v = (R) => {
|
|
1476
|
+
var F, H;
|
|
1469
1477
|
if (n === "hover") return;
|
|
1470
|
-
const
|
|
1471
|
-
(
|
|
1478
|
+
const A = R.target;
|
|
1479
|
+
(F = f.current) != null && F.contains(A) || (H = h.current) != null && H.contains(A) || T(!1);
|
|
1472
1480
|
};
|
|
1473
1481
|
return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), document.addEventListener("keydown", V), document.addEventListener("mousedown", v), () => {
|
|
1474
1482
|
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M), document.removeEventListener("keydown", V), document.removeEventListener("mousedown", v);
|
|
1475
1483
|
};
|
|
1476
|
-
}, [
|
|
1477
|
-
const
|
|
1484
|
+
}, [w, O, n]), P(() => () => B(), [B]);
|
|
1485
|
+
const k = n === "hover" ? { onMouseEnter: D, onMouseLeave: W } : {}, C = w ? re.createPortal(
|
|
1478
1486
|
/* @__PURE__ */ e.jsxs(
|
|
1479
1487
|
"div",
|
|
1480
1488
|
{
|
|
1481
1489
|
ref: f,
|
|
1482
1490
|
id: p,
|
|
1483
1491
|
role: "dialog",
|
|
1484
|
-
"aria-label": x ||
|
|
1492
|
+
"aria-label": x || y || "Mention",
|
|
1485
1493
|
"data-ds-portal": "",
|
|
1486
1494
|
className: ["ds-mention__popover", u].filter(Boolean).join(" "),
|
|
1487
|
-
style:
|
|
1488
|
-
...
|
|
1495
|
+
style: j ? { top: j.top, left: j.left } : { top: -9999, left: -9999, visibility: "hidden" },
|
|
1496
|
+
...k,
|
|
1489
1497
|
children: [
|
|
1490
|
-
(r || x ||
|
|
1498
|
+
(r || x || N) && /* @__PURE__ */ e.jsxs("div", { className: "ds-mention__head", children: [
|
|
1491
1499
|
r,
|
|
1492
|
-
(x ||
|
|
1500
|
+
(x || N) && /* @__PURE__ */ e.jsxs("div", { className: "ds-mention__meta", children: [
|
|
1493
1501
|
x ? /* @__PURE__ */ e.jsx("span", { className: "ds-mention__name", children: x }) : null,
|
|
1494
|
-
|
|
1502
|
+
N ? /* @__PURE__ */ e.jsx("span", { className: "ds-mention__handle", children: N }) : null
|
|
1495
1503
|
] })
|
|
1496
1504
|
] }),
|
|
1497
1505
|
i ? /* @__PURE__ */ e.jsx("p", { className: "ds-mention__desc", children: i }) : null,
|
|
1498
|
-
l ? /* @__PURE__ */ e.jsx("div", { className: "ds-mention__actions", onClick: () =>
|
|
1506
|
+
l ? /* @__PURE__ */ e.jsx("div", { className: "ds-mention__actions", onClick: () => T(!1), children: l }) : null
|
|
1499
1507
|
]
|
|
1500
1508
|
}
|
|
1501
1509
|
),
|
|
@@ -1510,40 +1518,40 @@ function Xs({
|
|
|
1510
1518
|
type: "button",
|
|
1511
1519
|
className: [
|
|
1512
1520
|
"ds-mention",
|
|
1513
|
-
|
|
1521
|
+
$ && "ds-mention--custom",
|
|
1514
1522
|
c
|
|
1515
1523
|
].filter(Boolean).join(" "),
|
|
1516
|
-
"aria-expanded":
|
|
1524
|
+
"aria-expanded": w,
|
|
1517
1525
|
"aria-haspopup": "dialog",
|
|
1518
|
-
"aria-label":
|
|
1519
|
-
"aria-controls":
|
|
1526
|
+
"aria-label": $ && (y || x) || void 0,
|
|
1527
|
+
"aria-controls": w ? p : void 0,
|
|
1520
1528
|
onClick: (M) => {
|
|
1521
1529
|
var V;
|
|
1522
1530
|
if ((V = d.onClick) == null || V.call(d, M), !M.defaultPrevented) {
|
|
1523
1531
|
if (M.preventDefault(), M.stopPropagation(), n === "hover") {
|
|
1524
|
-
|
|
1532
|
+
D();
|
|
1525
1533
|
return;
|
|
1526
1534
|
}
|
|
1527
|
-
|
|
1535
|
+
T((v) => !v);
|
|
1528
1536
|
}
|
|
1529
1537
|
},
|
|
1530
|
-
...
|
|
1531
|
-
children:
|
|
1538
|
+
...k,
|
|
1539
|
+
children: $ ? s : y
|
|
1532
1540
|
}
|
|
1533
1541
|
),
|
|
1534
1542
|
typeof document < "u" ? C : null
|
|
1535
1543
|
] });
|
|
1536
1544
|
}
|
|
1537
|
-
function
|
|
1545
|
+
function Qs({
|
|
1538
1546
|
checked: t = !1,
|
|
1539
1547
|
onChange: s,
|
|
1540
1548
|
size: n = "m",
|
|
1541
1549
|
disabled: r = !1,
|
|
1542
|
-
label:
|
|
1543
|
-
id:
|
|
1550
|
+
label: o,
|
|
1551
|
+
id: a,
|
|
1544
1552
|
...i
|
|
1545
1553
|
}) {
|
|
1546
|
-
const l =
|
|
1554
|
+
const l = a || `toggle-${X.useId()}`, c = [
|
|
1547
1555
|
"ds-toggle",
|
|
1548
1556
|
`ds-toggle--${n}`,
|
|
1549
1557
|
r && "ds-toggle--disabled"
|
|
@@ -1562,19 +1570,19 @@ function Js({
|
|
|
1562
1570
|
}
|
|
1563
1571
|
),
|
|
1564
1572
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toggle__track", children: /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__thumb" }) }),
|
|
1565
|
-
|
|
1573
|
+
o && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: o })
|
|
1566
1574
|
] });
|
|
1567
1575
|
}
|
|
1568
|
-
function
|
|
1576
|
+
function en({
|
|
1569
1577
|
checked: t = !1,
|
|
1570
1578
|
onChange: s,
|
|
1571
1579
|
size: n = "m",
|
|
1572
1580
|
disabled: r = !1,
|
|
1573
|
-
label:
|
|
1574
|
-
id:
|
|
1581
|
+
label: o,
|
|
1582
|
+
id: a,
|
|
1575
1583
|
...i
|
|
1576
1584
|
}) {
|
|
1577
|
-
const l =
|
|
1585
|
+
const l = a || `checkbox-${X.useId()}`, c = [
|
|
1578
1586
|
"ds-checkbox",
|
|
1579
1587
|
`ds-checkbox--${n}`,
|
|
1580
1588
|
r && "ds-checkbox--disabled"
|
|
@@ -1600,16 +1608,16 @@ function Zs({
|
|
|
1600
1608
|
className: "ds-checkbox__icon"
|
|
1601
1609
|
}
|
|
1602
1610
|
) }),
|
|
1603
|
-
|
|
1611
|
+
o && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: o })
|
|
1604
1612
|
] });
|
|
1605
1613
|
}
|
|
1606
|
-
function
|
|
1614
|
+
function tn({
|
|
1607
1615
|
checked: t = !1,
|
|
1608
1616
|
onChange: s,
|
|
1609
1617
|
size: n = "m",
|
|
1610
1618
|
disabled: r = !1,
|
|
1611
|
-
label:
|
|
1612
|
-
name:
|
|
1619
|
+
label: o,
|
|
1620
|
+
name: a,
|
|
1613
1621
|
value: i,
|
|
1614
1622
|
id: l,
|
|
1615
1623
|
...c
|
|
@@ -1629,34 +1637,34 @@ function Qs({
|
|
|
1629
1637
|
checked: t,
|
|
1630
1638
|
onChange: (p) => s == null ? void 0 : s(p.target.checked),
|
|
1631
1639
|
disabled: r,
|
|
1632
|
-
name:
|
|
1640
|
+
name: a,
|
|
1633
1641
|
value: i,
|
|
1634
1642
|
...c
|
|
1635
1643
|
}
|
|
1636
1644
|
),
|
|
1637
1645
|
/* @__PURE__ */ e.jsx("span", { className: "ds-radio__circle", children: /* @__PURE__ */ e.jsx("span", { className: "ds-radio__dot" }) }),
|
|
1638
|
-
|
|
1646
|
+
o && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: o })
|
|
1639
1647
|
] });
|
|
1640
1648
|
}
|
|
1641
|
-
function
|
|
1649
|
+
function Xt({ width: t, height: s, shape: n = "rect", aspectRatio: r, className: o = "", style: a = {}, ...i }) {
|
|
1642
1650
|
return /* @__PURE__ */ e.jsx(
|
|
1643
1651
|
"span",
|
|
1644
1652
|
{
|
|
1645
|
-
className: ["ds-skeleton", `ds-skeleton--${n}`,
|
|
1646
|
-
style: { width: t, height: s, aspectRatio: r, ...
|
|
1653
|
+
className: ["ds-skeleton", `ds-skeleton--${n}`, o].filter(Boolean).join(" "),
|
|
1654
|
+
style: { width: t, height: s, aspectRatio: r, ...a },
|
|
1647
1655
|
"aria-hidden": "true",
|
|
1648
1656
|
...i
|
|
1649
1657
|
}
|
|
1650
1658
|
);
|
|
1651
1659
|
}
|
|
1652
|
-
function
|
|
1660
|
+
function Jt({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "", style: o = {}, ...a }) {
|
|
1653
1661
|
return /* @__PURE__ */ e.jsx(
|
|
1654
1662
|
"span",
|
|
1655
1663
|
{
|
|
1656
1664
|
className: ["ds-skeleton-text", r].filter(Boolean).join(" "),
|
|
1657
|
-
style: { gap: n, ...
|
|
1665
|
+
style: { gap: n, ...o },
|
|
1658
1666
|
"aria-hidden": "true",
|
|
1659
|
-
...
|
|
1667
|
+
...a,
|
|
1660
1668
|
children: Array.from({ length: t }, (i, l) => /* @__PURE__ */ e.jsx(
|
|
1661
1669
|
"span",
|
|
1662
1670
|
{
|
|
@@ -1668,44 +1676,44 @@ function Kt({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "",
|
|
|
1668
1676
|
}
|
|
1669
1677
|
);
|
|
1670
1678
|
}
|
|
1671
|
-
|
|
1672
|
-
function
|
|
1679
|
+
Xt.Text = Jt;
|
|
1680
|
+
function Zt(t) {
|
|
1673
1681
|
let s = 2166136261;
|
|
1674
1682
|
for (let n = 0; n < t.length; n++)
|
|
1675
1683
|
s ^= t.charCodeAt(n), s = Math.imul(s, 16777619) >>> 0;
|
|
1676
1684
|
return s % 360;
|
|
1677
1685
|
}
|
|
1678
|
-
function
|
|
1686
|
+
function Qt(t) {
|
|
1679
1687
|
if (!t) return "";
|
|
1680
1688
|
const s = t.trim().split(/\s+/);
|
|
1681
1689
|
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
|
|
1682
1690
|
}
|
|
1683
|
-
function
|
|
1684
|
-
const l =
|
|
1691
|
+
function sn({ seed: t, icon: s, src: n, size: r = 32, className: o = "", style: a = {}, ...i }) {
|
|
1692
|
+
const l = Zt(t ?? ""), [c, u] = L(!1), d = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: Qt(t) });
|
|
1685
1693
|
return /* @__PURE__ */ e.jsx(
|
|
1686
1694
|
"div",
|
|
1687
1695
|
{
|
|
1688
|
-
className: ["ds-avatar",
|
|
1689
|
-
style: { width: r, height: r, "--ds-avatar-h": l, ...
|
|
1696
|
+
className: ["ds-avatar", o].filter(Boolean).join(" "),
|
|
1697
|
+
style: { width: r, height: r, "--ds-avatar-h": l, ...a },
|
|
1690
1698
|
"aria-hidden": "true",
|
|
1691
1699
|
...i,
|
|
1692
1700
|
children: n && !c ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => u(!0) }) : d
|
|
1693
1701
|
}
|
|
1694
1702
|
);
|
|
1695
1703
|
}
|
|
1696
|
-
function
|
|
1704
|
+
function nn({
|
|
1697
1705
|
children: t,
|
|
1698
1706
|
size: s = "compact",
|
|
1699
1707
|
stickyTop: n,
|
|
1700
1708
|
maxHeight: r,
|
|
1701
|
-
className:
|
|
1702
|
-
style:
|
|
1709
|
+
className: o = "",
|
|
1710
|
+
style: a = {},
|
|
1703
1711
|
...i
|
|
1704
1712
|
}) {
|
|
1705
1713
|
const l = {
|
|
1706
1714
|
...r ? { maxHeight: r } : {},
|
|
1707
1715
|
...n !== void 0 ? { "--ds-table-sticky-top": typeof n == "number" ? `${n}px` : n } : {},
|
|
1708
|
-
...
|
|
1716
|
+
...a
|
|
1709
1717
|
};
|
|
1710
1718
|
return /* @__PURE__ */ e.jsx(
|
|
1711
1719
|
"div",
|
|
@@ -1715,7 +1723,7 @@ function tn({
|
|
|
1715
1723
|
children: /* @__PURE__ */ e.jsx(
|
|
1716
1724
|
"table",
|
|
1717
1725
|
{
|
|
1718
|
-
className: ["ds-table", `ds-table--${s}`,
|
|
1726
|
+
className: ["ds-table", `ds-table--${s}`, o].filter(Boolean).join(" "),
|
|
1719
1727
|
...i,
|
|
1720
1728
|
children: t
|
|
1721
1729
|
}
|
|
@@ -1723,13 +1731,13 @@ function tn({
|
|
|
1723
1731
|
}
|
|
1724
1732
|
);
|
|
1725
1733
|
}
|
|
1726
|
-
function
|
|
1734
|
+
function rn({ children: t, ...s }) {
|
|
1727
1735
|
return /* @__PURE__ */ e.jsx("thead", { ...s, children: t });
|
|
1728
1736
|
}
|
|
1729
|
-
function
|
|
1737
|
+
function on({ children: t, ...s }) {
|
|
1730
1738
|
return /* @__PURE__ */ e.jsx("tbody", { ...s, children: t });
|
|
1731
1739
|
}
|
|
1732
|
-
function
|
|
1740
|
+
function an({ children: t, interactive: s, selected: n, subheader: r, exiting: o, updated: a, className: i = "", onClick: l, ...c }) {
|
|
1733
1741
|
return /* @__PURE__ */ e.jsx(
|
|
1734
1742
|
"tr",
|
|
1735
1743
|
{
|
|
@@ -1738,8 +1746,8 @@ function rn({ children: t, interactive: s, selected: n, subheader: r, exiting: a
|
|
|
1738
1746
|
s || l ? "ds-table-row--interactive" : "",
|
|
1739
1747
|
n ? "ds-table-row--selected" : "",
|
|
1740
1748
|
r ? "ds-table-row--subheader" : "",
|
|
1741
|
-
|
|
1742
|
-
|
|
1749
|
+
o ? "ds-table-row--exiting" : "",
|
|
1750
|
+
a ? "ds-table-row--updated" : "",
|
|
1743
1751
|
i
|
|
1744
1752
|
].filter(Boolean).join(" "),
|
|
1745
1753
|
onClick: l,
|
|
@@ -1748,11 +1756,11 @@ function rn({ children: t, interactive: s, selected: n, subheader: r, exiting: a
|
|
|
1748
1756
|
}
|
|
1749
1757
|
);
|
|
1750
1758
|
}
|
|
1751
|
-
function
|
|
1759
|
+
function ln({ children: t, colSpan: s = 999, ...n }) {
|
|
1752
1760
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: s, children: t }) });
|
|
1753
1761
|
}
|
|
1754
|
-
function
|
|
1755
|
-
const c = !!r || n !== void 0, u = n === "asc" ?
|
|
1762
|
+
function cn({ children: t, align: s = "left", sortDir: n, onSort: r, width: o, className: a = "", style: i = {}, ...l }) {
|
|
1763
|
+
const c = !!r || n !== void 0, u = n === "asc" ? gt : n === "desc" ? ye : yt;
|
|
1756
1764
|
return /* @__PURE__ */ e.jsx(
|
|
1757
1765
|
"th",
|
|
1758
1766
|
{
|
|
@@ -1761,10 +1769,10 @@ function on({ children: t, align: s = "left", sortDir: n, onSort: r, width: a, c
|
|
|
1761
1769
|
c ? "ds-th--sortable" : "",
|
|
1762
1770
|
n ? "ds-th--sorted" : "",
|
|
1763
1771
|
s !== "left" ? `ds-table-cell--${s}` : "",
|
|
1764
|
-
|
|
1772
|
+
a
|
|
1765
1773
|
].filter(Boolean).join(" "),
|
|
1766
1774
|
onClick: r,
|
|
1767
|
-
style: { width:
|
|
1775
|
+
style: { width: o, ...i },
|
|
1768
1776
|
...l,
|
|
1769
1777
|
children: c ? /* @__PURE__ */ e.jsxs("span", { className: "ds-th__inner", children: [
|
|
1770
1778
|
t,
|
|
@@ -1773,7 +1781,7 @@ function on({ children: t, align: s = "left", sortDir: n, onSort: r, width: a, c
|
|
|
1773
1781
|
}
|
|
1774
1782
|
);
|
|
1775
1783
|
}
|
|
1776
|
-
function
|
|
1784
|
+
function dn({ children: t, align: s = "left", secondary: n, muted: r, truncate: o, nowrap: a, className: i = "", ...l }) {
|
|
1777
1785
|
return /* @__PURE__ */ e.jsx(
|
|
1778
1786
|
"td",
|
|
1779
1787
|
{
|
|
@@ -1782,8 +1790,8 @@ function ln({ children: t, align: s = "left", secondary: n, muted: r, truncate:
|
|
|
1782
1790
|
s !== "left" ? `ds-table-cell--${s}` : "",
|
|
1783
1791
|
n ? "ds-table-cell--secondary" : "",
|
|
1784
1792
|
r ? "ds-table-cell--muted" : "",
|
|
1785
|
-
|
|
1786
|
-
|
|
1793
|
+
o ? "ds-table-cell--truncate" : "",
|
|
1794
|
+
a ? "ds-table-cell--nowrap" : "",
|
|
1787
1795
|
i
|
|
1788
1796
|
].filter(Boolean).join(" "),
|
|
1789
1797
|
...l,
|
|
@@ -1791,19 +1799,19 @@ function ln({ children: t, align: s = "left", secondary: n, muted: r, truncate:
|
|
|
1791
1799
|
}
|
|
1792
1800
|
);
|
|
1793
1801
|
}
|
|
1794
|
-
function
|
|
1802
|
+
function un({
|
|
1795
1803
|
icon: t,
|
|
1796
1804
|
title: s,
|
|
1797
1805
|
description: n,
|
|
1798
1806
|
action: r,
|
|
1799
|
-
size:
|
|
1800
|
-
className:
|
|
1807
|
+
size: o = "m",
|
|
1808
|
+
className: a = "",
|
|
1801
1809
|
...i
|
|
1802
1810
|
}) {
|
|
1803
1811
|
return /* @__PURE__ */ e.jsxs(
|
|
1804
1812
|
"div",
|
|
1805
1813
|
{
|
|
1806
|
-
className: ["ds-empty-state", `ds-empty-state--${
|
|
1814
|
+
className: ["ds-empty-state", `ds-empty-state--${o}`, a].filter(Boolean).join(" "),
|
|
1807
1815
|
...i,
|
|
1808
1816
|
children: [
|
|
1809
1817
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: t }),
|
|
@@ -1814,26 +1822,26 @@ function cn({
|
|
|
1814
1822
|
}
|
|
1815
1823
|
);
|
|
1816
1824
|
}
|
|
1817
|
-
function
|
|
1825
|
+
function fn({
|
|
1818
1826
|
label: t,
|
|
1819
1827
|
hint: s,
|
|
1820
1828
|
error: n,
|
|
1821
1829
|
required: r = !1,
|
|
1822
|
-
disabled:
|
|
1823
|
-
htmlFor:
|
|
1830
|
+
disabled: o = !1,
|
|
1831
|
+
htmlFor: a,
|
|
1824
1832
|
children: i,
|
|
1825
1833
|
className: l = "",
|
|
1826
1834
|
style: c,
|
|
1827
1835
|
...u
|
|
1828
1836
|
}) {
|
|
1829
|
-
const d = X.useId(), p =
|
|
1837
|
+
const d = X.useId(), p = a ?? d, h = `${p}-hint`, f = `${p}-error`;
|
|
1830
1838
|
return /* @__PURE__ */ e.jsxs(
|
|
1831
1839
|
"div",
|
|
1832
1840
|
{
|
|
1833
1841
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1834
1842
|
"data-state": n ? "error" : void 0,
|
|
1835
1843
|
"data-required": r ? "" : void 0,
|
|
1836
|
-
"data-disabled":
|
|
1844
|
+
"data-disabled": o ? "" : void 0,
|
|
1837
1845
|
style: c,
|
|
1838
1846
|
...u,
|
|
1839
1847
|
children: [
|
|
@@ -1845,7 +1853,7 @@ function dn({
|
|
|
1845
1853
|
}
|
|
1846
1854
|
);
|
|
1847
1855
|
}
|
|
1848
|
-
function
|
|
1856
|
+
function mn({ label: t, value: s, delta: n, size: r = "m", inline: o = !1, className: a = "", style: i, ...l }) {
|
|
1849
1857
|
const c = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1850
1858
|
return /* @__PURE__ */ e.jsxs(
|
|
1851
1859
|
"div",
|
|
@@ -1853,8 +1861,8 @@ function un({ label: t, value: s, delta: n, size: r = "m", inline: a = !1, class
|
|
|
1853
1861
|
className: [
|
|
1854
1862
|
"ds-stat",
|
|
1855
1863
|
`ds-stat--${r}`,
|
|
1856
|
-
|
|
1857
|
-
|
|
1864
|
+
o && "ds-stat--inline",
|
|
1865
|
+
a
|
|
1858
1866
|
].filter(Boolean).join(" "),
|
|
1859
1867
|
style: i,
|
|
1860
1868
|
...l,
|
|
@@ -1866,13 +1874,13 @@ function un({ label: t, value: s, delta: n, size: r = "m", inline: a = !1, class
|
|
|
1866
1874
|
}
|
|
1867
1875
|
);
|
|
1868
1876
|
}
|
|
1869
|
-
function
|
|
1877
|
+
function pn({
|
|
1870
1878
|
children: t,
|
|
1871
1879
|
separator: s = "/",
|
|
1872
1880
|
"aria-label": n,
|
|
1873
1881
|
className: r = "",
|
|
1874
|
-
style:
|
|
1875
|
-
...
|
|
1882
|
+
style: o,
|
|
1883
|
+
...a
|
|
1876
1884
|
}) {
|
|
1877
1885
|
const i = K(), l = X.Children.toArray(t).filter(Boolean);
|
|
1878
1886
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -1880,8 +1888,8 @@ function fn({
|
|
|
1880
1888
|
{
|
|
1881
1889
|
className: `ds-breadcrumb${r ? ` ${r}` : ""}`,
|
|
1882
1890
|
"aria-label": n ?? i.breadcrumb,
|
|
1883
|
-
style:
|
|
1884
|
-
...
|
|
1891
|
+
style: o,
|
|
1892
|
+
...a,
|
|
1885
1893
|
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: l.map((c, u) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1886
1894
|
c,
|
|
1887
1895
|
u < l.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: s })
|
|
@@ -1889,24 +1897,24 @@ function fn({
|
|
|
1889
1897
|
}
|
|
1890
1898
|
);
|
|
1891
1899
|
}
|
|
1892
|
-
function
|
|
1900
|
+
function hn({
|
|
1893
1901
|
page: t,
|
|
1894
1902
|
total: s,
|
|
1895
1903
|
onChange: n,
|
|
1896
1904
|
siblings: r = 1,
|
|
1897
|
-
"aria-label":
|
|
1898
|
-
previousLabel:
|
|
1905
|
+
"aria-label": o,
|
|
1906
|
+
previousLabel: a,
|
|
1899
1907
|
nextLabel: i,
|
|
1900
1908
|
className: l = "",
|
|
1901
1909
|
style: c,
|
|
1902
1910
|
...u
|
|
1903
1911
|
}) {
|
|
1904
|
-
const d = K(), { t: p } = be(), h =
|
|
1912
|
+
const d = K(), { t: p } = be(), h = es(t, s, r);
|
|
1905
1913
|
return /* @__PURE__ */ e.jsxs(
|
|
1906
1914
|
"nav",
|
|
1907
1915
|
{
|
|
1908
1916
|
className: `ds-pagination${l ? ` ${l}` : ""}`,
|
|
1909
|
-
"aria-label":
|
|
1917
|
+
"aria-label": o ?? d.pagination,
|
|
1910
1918
|
style: c,
|
|
1911
1919
|
...u,
|
|
1912
1920
|
children: [
|
|
@@ -1916,8 +1924,8 @@ function mn({
|
|
|
1916
1924
|
className: "ds-pagination-arrow",
|
|
1917
1925
|
onClick: () => n == null ? void 0 : n(t - 1),
|
|
1918
1926
|
disabled: t <= 1,
|
|
1919
|
-
"aria-label":
|
|
1920
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1927
|
+
"aria-label": a ?? d.previousPage,
|
|
1928
|
+
children: /* @__PURE__ */ e.jsx(kt, { size: 16 })
|
|
1921
1929
|
}
|
|
1922
1930
|
),
|
|
1923
1931
|
h.map(
|
|
@@ -1940,56 +1948,56 @@ function mn({
|
|
|
1940
1948
|
onClick: () => n == null ? void 0 : n(t + 1),
|
|
1941
1949
|
disabled: t >= s,
|
|
1942
1950
|
"aria-label": i ?? d.nextPage,
|
|
1943
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1951
|
+
children: /* @__PURE__ */ e.jsx(Et, { size: 16 })
|
|
1944
1952
|
}
|
|
1945
1953
|
)
|
|
1946
1954
|
]
|
|
1947
1955
|
}
|
|
1948
1956
|
);
|
|
1949
1957
|
}
|
|
1950
|
-
function
|
|
1958
|
+
function es(t, s, n) {
|
|
1951
1959
|
if (s <= 7) return Array.from({ length: s }, (i, l) => l + 1);
|
|
1952
|
-
const r = Math.max(2, t - n),
|
|
1953
|
-
r > 2 &&
|
|
1954
|
-
for (let i = r; i <=
|
|
1955
|
-
return
|
|
1960
|
+
const r = Math.max(2, t - n), o = Math.min(s - 1, t + n), a = [1];
|
|
1961
|
+
r > 2 && a.push("…");
|
|
1962
|
+
for (let i = r; i <= o; i++) a.push(i);
|
|
1963
|
+
return o < s - 1 && a.push("…"), a.push(s), a;
|
|
1956
1964
|
}
|
|
1957
|
-
const
|
|
1958
|
-
function
|
|
1965
|
+
const ts = 300;
|
|
1966
|
+
function xn({
|
|
1959
1967
|
children: t,
|
|
1960
1968
|
title: s,
|
|
1961
1969
|
onClose: n,
|
|
1962
1970
|
subHeader: r,
|
|
1963
|
-
side:
|
|
1964
|
-
size:
|
|
1971
|
+
side: o = "right",
|
|
1972
|
+
size: a = "wide",
|
|
1965
1973
|
offsetLeft: i = 0,
|
|
1966
1974
|
offsetRight: l = 0,
|
|
1967
1975
|
keepOpenRef: c,
|
|
1968
1976
|
closeLabel: u,
|
|
1969
1977
|
...d
|
|
1970
1978
|
}) {
|
|
1971
|
-
const p = K(), h =
|
|
1972
|
-
!n || _ || (
|
|
1973
|
-
|
|
1974
|
-
},
|
|
1979
|
+
const p = K(), h = S(null), f = X.useId(), [_, w] = L(!1), T = S(null), j = () => {
|
|
1980
|
+
!n || _ || (w(!0), T.current = setTimeout(() => {
|
|
1981
|
+
w(!1), n();
|
|
1982
|
+
}, ts));
|
|
1975
1983
|
};
|
|
1976
|
-
P(() => () => clearTimeout(
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1979
|
-
},
|
|
1980
|
-
var O,
|
|
1981
|
-
const W = Ce(
|
|
1982
|
-
W && ((O = c == null ? void 0 : c.current) != null && O.contains(W) || (
|
|
1984
|
+
P(() => () => clearTimeout(T.current), []), P(() => {
|
|
1985
|
+
const N = (D) => {
|
|
1986
|
+
D.key === "Escape" && j();
|
|
1987
|
+
}, B = (D) => {
|
|
1988
|
+
var O, k;
|
|
1989
|
+
const W = Ce(D);
|
|
1990
|
+
W && ((O = c == null ? void 0 : c.current) != null && O.contains(W) || (k = h.current) != null && k.contains(W) || Ue(W, null) || j());
|
|
1983
1991
|
};
|
|
1984
|
-
return document.addEventListener("keydown",
|
|
1985
|
-
document.removeEventListener("keydown",
|
|
1992
|
+
return document.addEventListener("keydown", N), document.addEventListener("mousedown", B), () => {
|
|
1993
|
+
document.removeEventListener("keydown", N), document.removeEventListener("mousedown", B);
|
|
1986
1994
|
};
|
|
1987
1995
|
}, [n, _, c]);
|
|
1988
|
-
const
|
|
1996
|
+
const g = X.Children.toArray(t), $ = g.find((N) => (N == null ? void 0 : N.type) === tt || (N == null ? void 0 : N.type) === xe), x = g.filter((N) => (N == null ? void 0 : N.type) !== tt && (N == null ? void 0 : N.type) !== xe), y = /* @__PURE__ */ e.jsx(
|
|
1989
1997
|
"div",
|
|
1990
1998
|
{
|
|
1991
1999
|
className: ["ds-side-page-overlay", _ && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
|
|
1992
|
-
"data-side":
|
|
2000
|
+
"data-side": o,
|
|
1993
2001
|
style: { "--ds-side-page-offset-left": `${i}px`, "--ds-side-page-offset-right": `${l}px` },
|
|
1994
2002
|
...d,
|
|
1995
2003
|
children: /* @__PURE__ */ e.jsxs(
|
|
@@ -1998,8 +2006,8 @@ function pn({
|
|
|
1998
2006
|
ref: h,
|
|
1999
2007
|
className: ["ds-side-page", _ && "ds-side-page--closing"].filter(Boolean).join(" "),
|
|
2000
2008
|
"data-surface": "2",
|
|
2001
|
-
"data-side":
|
|
2002
|
-
"data-size":
|
|
2009
|
+
"data-side": o,
|
|
2010
|
+
"data-size": a,
|
|
2003
2011
|
role: "dialog",
|
|
2004
2012
|
"aria-modal": "true",
|
|
2005
2013
|
"aria-labelledby": s ? f : void 0,
|
|
@@ -2011,7 +2019,7 @@ function pn({
|
|
|
2011
2019
|
variant: "ghost",
|
|
2012
2020
|
size: "small",
|
|
2013
2021
|
icon: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 }),
|
|
2014
|
-
onClick:
|
|
2022
|
+
onClick: j,
|
|
2015
2023
|
"aria-label": u ?? p.close
|
|
2016
2024
|
}
|
|
2017
2025
|
),
|
|
@@ -2020,23 +2028,23 @@ function pn({
|
|
|
2020
2028
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
|
|
2021
2029
|
] }),
|
|
2022
2030
|
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: x }),
|
|
2023
|
-
|
|
2031
|
+
$
|
|
2024
2032
|
]
|
|
2025
2033
|
}
|
|
2026
2034
|
)
|
|
2027
2035
|
}
|
|
2028
2036
|
);
|
|
2029
|
-
return typeof document > "u" ?
|
|
2037
|
+
return typeof document > "u" ? y : re.createPortal(y, document.body);
|
|
2030
2038
|
}
|
|
2031
|
-
function
|
|
2039
|
+
function tt({ children: t }) {
|
|
2032
2040
|
return !t || X.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
2033
2041
|
}
|
|
2034
|
-
const _e =
|
|
2042
|
+
const _e = Le({ collapsed: !1, side: "left" }), Re = Le(!1), vn = ut(function({
|
|
2035
2043
|
children: s,
|
|
2036
2044
|
collapsed: n = !1,
|
|
2037
2045
|
side: r = "left",
|
|
2038
|
-
onExpand:
|
|
2039
|
-
onCollapse:
|
|
2046
|
+
onExpand: o,
|
|
2047
|
+
onCollapse: a,
|
|
2040
2048
|
className: i = "",
|
|
2041
2049
|
...l
|
|
2042
2050
|
}, c) {
|
|
@@ -2047,33 +2055,33 @@ const _e = De({ collapsed: !1, side: "left" }), Re = De(!1), hn = dt(function({
|
|
|
2047
2055
|
i
|
|
2048
2056
|
].filter(Boolean).join(" "), d = ne((p) => {
|
|
2049
2057
|
if (!p.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')) {
|
|
2050
|
-
if (n &&
|
|
2051
|
-
|
|
2058
|
+
if (n && o) {
|
|
2059
|
+
o();
|
|
2052
2060
|
return;
|
|
2053
2061
|
}
|
|
2054
|
-
!n &&
|
|
2062
|
+
!n && a && a();
|
|
2055
2063
|
}
|
|
2056
|
-
}, [n,
|
|
2064
|
+
}, [n, o, a]);
|
|
2057
2065
|
return /* @__PURE__ */ e.jsx(_e.Provider, { value: { collapsed: n, side: r }, children: /* @__PURE__ */ e.jsx(
|
|
2058
2066
|
"nav",
|
|
2059
2067
|
{
|
|
2060
2068
|
ref: c,
|
|
2061
2069
|
className: u,
|
|
2062
2070
|
onClick: d,
|
|
2063
|
-
"data-expandable": n &&
|
|
2064
|
-
"data-collapsible": !n &&
|
|
2071
|
+
"data-expandable": n && o ? "" : void 0,
|
|
2072
|
+
"data-collapsible": !n && a ? "" : void 0,
|
|
2065
2073
|
...l,
|
|
2066
2074
|
children: s
|
|
2067
2075
|
}
|
|
2068
2076
|
) });
|
|
2069
2077
|
});
|
|
2070
|
-
function
|
|
2078
|
+
function bn({
|
|
2071
2079
|
icon: t,
|
|
2072
2080
|
label: s,
|
|
2073
2081
|
selected: n = !1,
|
|
2074
2082
|
disabled: r = !1,
|
|
2075
|
-
href:
|
|
2076
|
-
onClick:
|
|
2083
|
+
href: o,
|
|
2084
|
+
onClick: a,
|
|
2077
2085
|
count: i,
|
|
2078
2086
|
updated: l = !1,
|
|
2079
2087
|
open: c = !1,
|
|
@@ -2081,12 +2089,12 @@ function xn({
|
|
|
2081
2089
|
className: d = "",
|
|
2082
2090
|
...p
|
|
2083
2091
|
}) {
|
|
2084
|
-
const { collapsed: h, side: f } = le(_e), _ = le(Re),
|
|
2092
|
+
const { collapsed: h, side: f } = le(_e), _ = le(Re), j = {
|
|
2085
2093
|
className: [
|
|
2086
2094
|
"ds-nav-rail__item",
|
|
2087
2095
|
d
|
|
2088
2096
|
].filter(Boolean).join(" "),
|
|
2089
|
-
onClick: r ? void 0 :
|
|
2097
|
+
onClick: r ? void 0 : a,
|
|
2090
2098
|
"aria-current": n ? "page" : void 0,
|
|
2091
2099
|
"aria-disabled": r ? "true" : void 0,
|
|
2092
2100
|
"aria-label": h ? s : void 0,
|
|
@@ -2098,10 +2106,10 @@ function xn({
|
|
|
2098
2106
|
"data-onboarding": u || void 0
|
|
2099
2107
|
},
|
|
2100
2108
|
...p
|
|
2101
|
-
},
|
|
2109
|
+
}, g = i != null, $ = f === "left" ? "right" : "left", x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2102
2110
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
2103
2111
|
!h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
|
|
2104
|
-
!h &&
|
|
2112
|
+
!h && g && /* @__PURE__ */ e.jsx(
|
|
2105
2113
|
"span",
|
|
2106
2114
|
{
|
|
2107
2115
|
className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "),
|
|
@@ -2109,28 +2117,28 @@ function xn({
|
|
|
2109
2117
|
children: i
|
|
2110
2118
|
}
|
|
2111
2119
|
),
|
|
2112
|
-
!h && l && (!
|
|
2113
|
-
h &&
|
|
2114
|
-
h && l && (!
|
|
2115
|
-
] }),
|
|
2116
|
-
return h && !_ ? /* @__PURE__ */ e.jsx(Ve, { content: s, position:
|
|
2120
|
+
!h && l && (!g || i === 0) && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot ds-nav-rail__dot--inline", "aria-hidden": "true" }),
|
|
2121
|
+
h && g && i !== 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__count-collapsed", "data-updated": l || void 0, children: i > 99 ? "99+" : i }),
|
|
2122
|
+
h && l && (!g || i === 0) && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
2123
|
+
] }), y = o ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : o, ...j, children: x }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...j, children: x });
|
|
2124
|
+
return h && !_ ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: $, children: y }) : y;
|
|
2117
2125
|
}
|
|
2118
|
-
function
|
|
2126
|
+
function _n({ children: t, className: s = "", ...n }) {
|
|
2119
2127
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__body", "ds-scrollable", s].filter(Boolean).join(" "), ...n, children: t });
|
|
2120
2128
|
}
|
|
2121
|
-
function
|
|
2129
|
+
function jn({ children: t, className: s = "", ...n }) {
|
|
2122
2130
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__header", s].filter(Boolean).join(" "), ...n, children: t });
|
|
2123
2131
|
}
|
|
2124
|
-
function
|
|
2132
|
+
function Nn({ children: t, className: s = "", ...n }) {
|
|
2125
2133
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__footer", s].filter(Boolean).join(" "), ...n, children: t });
|
|
2126
2134
|
}
|
|
2127
|
-
function
|
|
2135
|
+
function wn({ className: t = "", ...s }) {
|
|
2128
2136
|
return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
|
|
2129
2137
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const { collapsed:
|
|
2132
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...
|
|
2133
|
-
!
|
|
2138
|
+
function gn({ children: t, label: s, defaultOpen: n = !0, className: r = "", ...o }) {
|
|
2139
|
+
const { collapsed: a } = le(_e), i = K(), l = s ?? i.recents, [c, u] = L(n);
|
|
2140
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...o, children: [
|
|
2141
|
+
!a && /* @__PURE__ */ e.jsxs(
|
|
2134
2142
|
"button",
|
|
2135
2143
|
{
|
|
2136
2144
|
type: "button",
|
|
@@ -2143,20 +2151,20 @@ function Nn({ children: t, label: s, defaultOpen: n = !0, className: r = "", ...
|
|
|
2143
2151
|
]
|
|
2144
2152
|
}
|
|
2145
2153
|
),
|
|
2146
|
-
(c ||
|
|
2154
|
+
(c || a) && /* @__PURE__ */ e.jsx("div", { className: "ds-nav-rail__recents-body", children: t })
|
|
2147
2155
|
] });
|
|
2148
2156
|
}
|
|
2149
|
-
const
|
|
2157
|
+
const yn = ut(function({
|
|
2150
2158
|
as: s = "button",
|
|
2151
2159
|
avatar: n,
|
|
2152
2160
|
label: r,
|
|
2153
|
-
className:
|
|
2154
|
-
...
|
|
2161
|
+
className: o = "",
|
|
2162
|
+
...a
|
|
2155
2163
|
}, i) {
|
|
2156
2164
|
const { collapsed: l, side: c } = le(_e), u = le(Re), d = c === "left" ? "right" : "left", p = [
|
|
2157
2165
|
"ds-nav-rail__item",
|
|
2158
2166
|
"ds-nav-rail__agent",
|
|
2159
|
-
|
|
2167
|
+
o
|
|
2160
2168
|
].filter(Boolean).join(" "), h = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2161
2169
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: n }),
|
|
2162
2170
|
!l && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: r })
|
|
@@ -2167,20 +2175,20 @@ const wn = dt(function({
|
|
|
2167
2175
|
className: p,
|
|
2168
2176
|
"aria-label": l ? r : void 0,
|
|
2169
2177
|
...s === "button" ? { type: "button" } : {},
|
|
2170
|
-
...
|
|
2178
|
+
...a,
|
|
2171
2179
|
children: h
|
|
2172
2180
|
}
|
|
2173
2181
|
);
|
|
2174
2182
|
return l && !u ? /* @__PURE__ */ e.jsx(Ve, { content: r, position: d, children: f }) : f;
|
|
2175
2183
|
});
|
|
2176
|
-
function
|
|
2184
|
+
function kn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: o, onClick: a, className: i = "", ...l }) {
|
|
2177
2185
|
const { collapsed: c, side: u } = le(_e), d = le(Re), f = {
|
|
2178
2186
|
className: [
|
|
2179
2187
|
"ds-nav-rail__item",
|
|
2180
2188
|
"ds-nav-rail__agent",
|
|
2181
2189
|
i
|
|
2182
2190
|
].filter(Boolean).join(" "),
|
|
2183
|
-
onClick: r ? void 0 :
|
|
2191
|
+
onClick: r ? void 0 : a,
|
|
2184
2192
|
"aria-current": n ? "page" : void 0,
|
|
2185
2193
|
"aria-disabled": r ? "true" : void 0,
|
|
2186
2194
|
tabIndex: r ? -1 : void 0,
|
|
@@ -2192,38 +2200,38 @@ function gn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a,
|
|
|
2192
2200
|
}, _ = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2193
2201
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
2194
2202
|
!c && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
2195
|
-
] }),
|
|
2196
|
-
return c && !d ? /* @__PURE__ */ e.jsx(Ve, { content: s, position:
|
|
2203
|
+
] }), w = u === "left" ? "right" : "left", T = o ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : o, ...f, children: _ }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...f, children: _ });
|
|
2204
|
+
return c && !d ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: w, children: T }) : T;
|
|
2197
2205
|
}
|
|
2198
|
-
const
|
|
2199
|
-
function
|
|
2206
|
+
const st = 240, nt = 6, rt = 8;
|
|
2207
|
+
function En({
|
|
2200
2208
|
trigger: t,
|
|
2201
2209
|
title: s,
|
|
2202
2210
|
children: n,
|
|
2203
2211
|
open: r,
|
|
2204
|
-
onOpenChange:
|
|
2205
|
-
defaultOpen:
|
|
2212
|
+
onOpenChange: o,
|
|
2213
|
+
defaultOpen: a = !1,
|
|
2206
2214
|
closeLabel: i
|
|
2207
2215
|
}) {
|
|
2208
|
-
const l = K(), { side: c } = le(_e), [u, d] =
|
|
2209
|
-
p ?
|
|
2210
|
-
}, [p,
|
|
2211
|
-
p ?
|
|
2212
|
-
}, [p,
|
|
2216
|
+
const l = K(), { side: c } = le(_e), [u, d] = L(a), p = r !== void 0, h = p ? r : u, [f, _] = L(!1), w = S(null), T = S(null), [j, g] = L({}), $ = ne(() => {
|
|
2217
|
+
p ? o == null || o(!0) : d(!0);
|
|
2218
|
+
}, [p, o]), x = ne(() => {
|
|
2219
|
+
p ? o == null || o(!1) : d(!1);
|
|
2220
|
+
}, [p, o]), y = ne(() => h ? x() : $(), [h, $, x]), N = ne(() => {
|
|
2213
2221
|
var M;
|
|
2214
|
-
const
|
|
2215
|
-
if (!
|
|
2216
|
-
const W =
|
|
2217
|
-
|
|
2222
|
+
const D = w.current;
|
|
2223
|
+
if (!D) return;
|
|
2224
|
+
const W = D.getBoundingClientRect(), O = window.innerHeight, k = ((M = T.current) == null ? void 0 : M.offsetHeight) ?? 300, C = Math.max(rt, Math.min(O - k - rt, W.top));
|
|
2225
|
+
g(c === "right" ? {
|
|
2218
2226
|
position: "fixed",
|
|
2219
2227
|
top: C,
|
|
2220
|
-
right: window.innerWidth - W.left +
|
|
2221
|
-
width:
|
|
2228
|
+
right: window.innerWidth - W.left + nt,
|
|
2229
|
+
width: st
|
|
2222
2230
|
} : {
|
|
2223
2231
|
position: "fixed",
|
|
2224
2232
|
top: C,
|
|
2225
|
-
left: W.right +
|
|
2226
|
-
width:
|
|
2233
|
+
left: W.right + nt,
|
|
2234
|
+
width: st
|
|
2227
2235
|
});
|
|
2228
2236
|
}, [c]);
|
|
2229
2237
|
P(() => {
|
|
@@ -2231,31 +2239,31 @@ function yn({
|
|
|
2231
2239
|
_(!1);
|
|
2232
2240
|
return;
|
|
2233
2241
|
}
|
|
2234
|
-
return
|
|
2235
|
-
window.removeEventListener("scroll",
|
|
2242
|
+
return N(), requestAnimationFrame(() => _(!0)), window.addEventListener("scroll", N, !0), window.addEventListener("resize", N), () => {
|
|
2243
|
+
window.removeEventListener("scroll", N, !0), window.removeEventListener("resize", N);
|
|
2236
2244
|
};
|
|
2237
|
-
}, [h,
|
|
2245
|
+
}, [h, N]), P(() => {
|
|
2238
2246
|
if (!h) return;
|
|
2239
|
-
const
|
|
2240
|
-
var
|
|
2241
|
-
!((
|
|
2247
|
+
const D = (O) => {
|
|
2248
|
+
var k, C;
|
|
2249
|
+
!((k = T.current) != null && k.contains(O.target)) && !((C = w.current) != null && C.contains(O.target)) && x();
|
|
2242
2250
|
}, W = (O) => {
|
|
2243
2251
|
O.key === "Escape" && x();
|
|
2244
2252
|
};
|
|
2245
|
-
return document.addEventListener("mousedown",
|
|
2246
|
-
document.removeEventListener("mousedown",
|
|
2253
|
+
return document.addEventListener("mousedown", D), document.addEventListener("keydown", W), () => {
|
|
2254
|
+
document.removeEventListener("mousedown", D), document.removeEventListener("keydown", W);
|
|
2247
2255
|
};
|
|
2248
2256
|
}, [h, x]);
|
|
2249
|
-
const
|
|
2257
|
+
const B = h && /* @__PURE__ */ e.jsxs(
|
|
2250
2258
|
"div",
|
|
2251
2259
|
{
|
|
2252
|
-
ref:
|
|
2260
|
+
ref: T,
|
|
2253
2261
|
className: [
|
|
2254
2262
|
"ds-nav-rail-flyout",
|
|
2255
2263
|
`ds-nav-rail-flyout--${c}`,
|
|
2256
2264
|
f && "ds-nav-rail-flyout--visible"
|
|
2257
2265
|
].filter(Boolean).join(" "),
|
|
2258
|
-
style:
|
|
2266
|
+
style: j,
|
|
2259
2267
|
"data-ds-portal": "",
|
|
2260
2268
|
role: "dialog",
|
|
2261
2269
|
"aria-modal": "false",
|
|
@@ -2278,27 +2286,27 @@ function yn({
|
|
|
2278
2286
|
}
|
|
2279
2287
|
);
|
|
2280
2288
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2281
|
-
/* @__PURE__ */ e.jsx(Re.Provider, { value: h, children: /* @__PURE__ */ e.jsx("div", { ref:
|
|
2282
|
-
typeof document < "u" && re.createPortal(
|
|
2289
|
+
/* @__PURE__ */ e.jsx(Re.Provider, { value: h, children: /* @__PURE__ */ e.jsx("div", { ref: w, onClick: y, style: { display: "flex", flexDirection: "column", width: "100%" }, children: t }) }),
|
|
2290
|
+
typeof document < "u" && re.createPortal(B, document.body)
|
|
2283
2291
|
] });
|
|
2284
2292
|
}
|
|
2285
|
-
const
|
|
2293
|
+
const ss = {
|
|
2286
2294
|
info: We,
|
|
2287
|
-
success:
|
|
2288
|
-
warning:
|
|
2295
|
+
success: ze,
|
|
2296
|
+
warning: Fe,
|
|
2289
2297
|
error: Me
|
|
2290
2298
|
};
|
|
2291
|
-
function
|
|
2299
|
+
function Tn({
|
|
2292
2300
|
children: t,
|
|
2293
2301
|
variant: s = "info",
|
|
2294
2302
|
action: n,
|
|
2295
2303
|
onAction: r,
|
|
2296
|
-
onDismiss:
|
|
2297
|
-
role:
|
|
2304
|
+
onDismiss: o,
|
|
2305
|
+
role: a,
|
|
2298
2306
|
dismissLabel: i,
|
|
2299
2307
|
...l
|
|
2300
2308
|
}) {
|
|
2301
|
-
const c = K(), u =
|
|
2309
|
+
const c = K(), u = ss[s], d = a || (s === "error" ? "alert" : "status");
|
|
2302
2310
|
return /* @__PURE__ */ e.jsxs(
|
|
2303
2311
|
"div",
|
|
2304
2312
|
{
|
|
@@ -2317,12 +2325,12 @@ function kn({
|
|
|
2317
2325
|
children: n
|
|
2318
2326
|
}
|
|
2319
2327
|
),
|
|
2320
|
-
|
|
2328
|
+
o && /* @__PURE__ */ e.jsx(
|
|
2321
2329
|
"button",
|
|
2322
2330
|
{
|
|
2323
2331
|
type: "button",
|
|
2324
2332
|
className: "ds-banner-dismiss",
|
|
2325
|
-
onClick:
|
|
2333
|
+
onClick: o,
|
|
2326
2334
|
"aria-label": i ?? c.dismiss,
|
|
2327
2335
|
children: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 })
|
|
2328
2336
|
}
|
|
@@ -2331,127 +2339,127 @@ function kn({
|
|
|
2331
2339
|
}
|
|
2332
2340
|
);
|
|
2333
2341
|
}
|
|
2334
|
-
function
|
|
2342
|
+
function $n({
|
|
2335
2343
|
trigger: t,
|
|
2336
2344
|
items: s = [],
|
|
2337
2345
|
open: n,
|
|
2338
2346
|
onOpenChange: r,
|
|
2339
|
-
align:
|
|
2340
|
-
fullWidth:
|
|
2347
|
+
align: o = "left",
|
|
2348
|
+
fullWidth: a = !1,
|
|
2341
2349
|
className: i = "",
|
|
2342
2350
|
style: l,
|
|
2343
2351
|
...c
|
|
2344
2352
|
}) {
|
|
2345
|
-
const [u, d] =
|
|
2353
|
+
const [u, d] = L(!1), [p, h] = L(!1), f = n !== void 0, _ = f ? n : u, w = S(null), T = S(null), j = S(null), g = S(null), [$, x] = L({}), y = S(null), N = 150, B = () => {
|
|
2346
2354
|
if (f)
|
|
2347
2355
|
r == null || r(!1);
|
|
2348
2356
|
else {
|
|
2349
2357
|
if (p) return;
|
|
2350
|
-
h(!0),
|
|
2358
|
+
h(!0), y.current = setTimeout(() => {
|
|
2351
2359
|
d(!1), h(!1);
|
|
2352
|
-
},
|
|
2360
|
+
}, N);
|
|
2353
2361
|
}
|
|
2354
|
-
},
|
|
2362
|
+
}, D = () => {
|
|
2355
2363
|
const v = !_;
|
|
2356
|
-
f ? r == null || r(v) : v ? (clearTimeout(
|
|
2364
|
+
f ? r == null || r(v) : v ? (clearTimeout(y.current), h(!1), d(!0)) : B();
|
|
2357
2365
|
}, W = () => {
|
|
2358
|
-
_ || (f ? r == null || r(!0) : (clearTimeout(
|
|
2366
|
+
_ || (f ? r == null || r(!0) : (clearTimeout(y.current), h(!1), d(!0)));
|
|
2359
2367
|
};
|
|
2360
|
-
P(() => () => clearTimeout(
|
|
2368
|
+
P(() => () => clearTimeout(y.current), []), P(() => {
|
|
2361
2369
|
if (!_) return;
|
|
2362
|
-
const v = 300,
|
|
2370
|
+
const v = 300, R = () => {
|
|
2363
2371
|
var Y;
|
|
2364
|
-
const
|
|
2365
|
-
if (!
|
|
2366
|
-
const
|
|
2372
|
+
const A = (Y = w.current) == null ? void 0 : Y.getBoundingClientRect();
|
|
2373
|
+
if (!A) return;
|
|
2374
|
+
const F = window.innerHeight - A.bottom, H = F < v + 8 && A.top > F;
|
|
2367
2375
|
x(
|
|
2368
|
-
|
|
2376
|
+
o === "right" ? H ? { bottom: window.innerHeight - A.top + 4, top: "auto", right: window.innerWidth - A.right } : { top: A.bottom + 4, bottom: "auto", right: window.innerWidth - A.right } : H ? { bottom: window.innerHeight - A.top + 4, top: "auto", left: A.left } : { top: A.bottom + 4, bottom: "auto", left: A.left }
|
|
2369
2377
|
);
|
|
2370
2378
|
};
|
|
2371
|
-
return
|
|
2372
|
-
window.removeEventListener("scroll",
|
|
2379
|
+
return R(), window.addEventListener("scroll", R, !0), window.addEventListener("resize", R), () => {
|
|
2380
|
+
window.removeEventListener("scroll", R, !0), window.removeEventListener("resize", R);
|
|
2373
2381
|
};
|
|
2374
|
-
}, [_,
|
|
2382
|
+
}, [_, o]);
|
|
2375
2383
|
const O = () => {
|
|
2376
|
-
var
|
|
2377
|
-
const v = (
|
|
2384
|
+
var R;
|
|
2385
|
+
const v = (R = j.current) == null ? void 0 : R.querySelector(
|
|
2378
2386
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
2379
2387
|
);
|
|
2380
2388
|
v == null || v.focus();
|
|
2381
2389
|
};
|
|
2382
2390
|
P(() => {
|
|
2383
2391
|
if (!_) return;
|
|
2384
|
-
const v = (
|
|
2385
|
-
var
|
|
2386
|
-
!((
|
|
2387
|
-
},
|
|
2388
|
-
|
|
2392
|
+
const v = (A) => {
|
|
2393
|
+
var F, H;
|
|
2394
|
+
!((F = w.current) != null && F.contains(A.target)) && !((H = T.current) != null && H.contains(A.target)) && B();
|
|
2395
|
+
}, R = (A) => {
|
|
2396
|
+
A.key === "Escape" && (B(), O());
|
|
2389
2397
|
};
|
|
2390
|
-
return document.addEventListener("mousedown", v), document.addEventListener("keydown",
|
|
2391
|
-
document.removeEventListener("mousedown", v), document.removeEventListener("keydown",
|
|
2398
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", R), () => {
|
|
2399
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", R);
|
|
2392
2400
|
};
|
|
2393
2401
|
}, [_]), P(() => {
|
|
2394
|
-
if (!_ || !
|
|
2395
|
-
const v =
|
|
2396
|
-
|
|
2402
|
+
if (!_ || !g.current || !T.current) return;
|
|
2403
|
+
const v = k(), R = g.current === "last" ? v[v.length - 1] : v[0];
|
|
2404
|
+
R == null || R.focus(), g.current = null;
|
|
2397
2405
|
}, [_]);
|
|
2398
|
-
const
|
|
2406
|
+
const k = () => T.current ? [...T.current.querySelectorAll(
|
|
2399
2407
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
2400
2408
|
)] : [], C = (v) => {
|
|
2401
|
-
var
|
|
2409
|
+
var R, A;
|
|
2402
2410
|
if (v.key === "ArrowDown")
|
|
2403
|
-
v.preventDefault(), _ ? (
|
|
2411
|
+
v.preventDefault(), _ ? (R = k()[0]) == null || R.focus() : (g.current = "first", W());
|
|
2404
2412
|
else if (v.key === "ArrowUp")
|
|
2405
2413
|
if (v.preventDefault(), !_)
|
|
2406
|
-
|
|
2414
|
+
g.current = "last", W();
|
|
2407
2415
|
else {
|
|
2408
|
-
const
|
|
2409
|
-
(
|
|
2416
|
+
const F = k();
|
|
2417
|
+
(A = F[F.length - 1]) == null || A.focus();
|
|
2410
2418
|
}
|
|
2411
2419
|
}, M = (v) => {
|
|
2412
|
-
var
|
|
2413
|
-
const
|
|
2420
|
+
var F, H, Y, m;
|
|
2421
|
+
const R = k(), A = R.findIndex((b) => b === document.activeElement);
|
|
2414
2422
|
switch (v.key) {
|
|
2415
2423
|
case "ArrowDown":
|
|
2416
|
-
v.preventDefault(), (
|
|
2424
|
+
v.preventDefault(), (F = R[Math.min(A + 1, R.length - 1)]) == null || F.focus();
|
|
2417
2425
|
break;
|
|
2418
2426
|
case "ArrowUp":
|
|
2419
|
-
v.preventDefault(),
|
|
2427
|
+
v.preventDefault(), A <= 0 ? O() : (H = R[A - 1]) == null || H.focus();
|
|
2420
2428
|
break;
|
|
2421
2429
|
case "Home":
|
|
2422
|
-
v.preventDefault(), (Y =
|
|
2430
|
+
v.preventDefault(), (Y = R[0]) == null || Y.focus();
|
|
2423
2431
|
break;
|
|
2424
2432
|
case "End":
|
|
2425
|
-
v.preventDefault(), (m =
|
|
2433
|
+
v.preventDefault(), (m = R[R.length - 1]) == null || m.focus();
|
|
2426
2434
|
break;
|
|
2427
2435
|
case "Tab":
|
|
2428
|
-
|
|
2436
|
+
B();
|
|
2429
2437
|
break;
|
|
2430
2438
|
}
|
|
2431
2439
|
}, V = _ && /* @__PURE__ */ e.jsx(
|
|
2432
2440
|
"div",
|
|
2433
2441
|
{
|
|
2434
|
-
ref:
|
|
2442
|
+
ref: T,
|
|
2435
2443
|
role: "menu",
|
|
2436
2444
|
"data-ds-portal": "",
|
|
2437
2445
|
className: [
|
|
2438
2446
|
"ds-dropdown__menu",
|
|
2439
|
-
`ds-dropdown__menu--${
|
|
2447
|
+
`ds-dropdown__menu--${o}`,
|
|
2440
2448
|
p && "ds-dropdown__menu--closing"
|
|
2441
2449
|
].filter(Boolean).join(" "),
|
|
2442
|
-
style:
|
|
2450
|
+
style: $,
|
|
2443
2451
|
onKeyDown: M,
|
|
2444
|
-
children: s.map((v,
|
|
2452
|
+
children: s.map((v, R) => {
|
|
2445
2453
|
if (v.separator)
|
|
2446
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" },
|
|
2454
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, R);
|
|
2447
2455
|
if (v.type === "section")
|
|
2448
2456
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
2449
2457
|
v.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: v.label }),
|
|
2450
2458
|
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: v.content })
|
|
2451
|
-
] },
|
|
2452
|
-
const
|
|
2459
|
+
] }, R);
|
|
2460
|
+
const A = !!v.href, F = A ? "a" : "button", H = A ? { href: v.disabled ? void 0 : v.href, "aria-disabled": v.disabled ? "true" : void 0 } : { type: "button", disabled: v.disabled };
|
|
2453
2461
|
return /* @__PURE__ */ e.jsxs(
|
|
2454
|
-
|
|
2462
|
+
F,
|
|
2455
2463
|
{
|
|
2456
2464
|
role: "menuitem",
|
|
2457
2465
|
className: [
|
|
@@ -2461,7 +2469,7 @@ function En({
|
|
|
2461
2469
|
...H,
|
|
2462
2470
|
onClick: () => {
|
|
2463
2471
|
var Y;
|
|
2464
|
-
(Y = v.onClick) == null || Y.call(v),
|
|
2472
|
+
(Y = v.onClick) == null || Y.call(v), B();
|
|
2465
2473
|
},
|
|
2466
2474
|
children: [
|
|
2467
2475
|
v.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: v.icon }),
|
|
@@ -2469,7 +2477,7 @@ function En({
|
|
|
2469
2477
|
v.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: v.shortcut })
|
|
2470
2478
|
]
|
|
2471
2479
|
},
|
|
2472
|
-
|
|
2480
|
+
R
|
|
2473
2481
|
);
|
|
2474
2482
|
})
|
|
2475
2483
|
}
|
|
@@ -2477,17 +2485,17 @@ function En({
|
|
|
2477
2485
|
return /* @__PURE__ */ e.jsxs(
|
|
2478
2486
|
"div",
|
|
2479
2487
|
{
|
|
2480
|
-
ref:
|
|
2481
|
-
className: ["ds-dropdown",
|
|
2488
|
+
ref: w,
|
|
2489
|
+
className: ["ds-dropdown", a && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
|
|
2482
2490
|
style: l,
|
|
2483
2491
|
...c,
|
|
2484
2492
|
children: [
|
|
2485
2493
|
/* @__PURE__ */ e.jsx(
|
|
2486
2494
|
"div",
|
|
2487
2495
|
{
|
|
2488
|
-
ref:
|
|
2496
|
+
ref: j,
|
|
2489
2497
|
className: "ds-dropdown__trigger",
|
|
2490
|
-
onClick:
|
|
2498
|
+
onClick: D,
|
|
2491
2499
|
onKeyDown: C,
|
|
2492
2500
|
children: t
|
|
2493
2501
|
}
|
|
@@ -2497,22 +2505,22 @@ function En({
|
|
|
2497
2505
|
}
|
|
2498
2506
|
);
|
|
2499
2507
|
}
|
|
2500
|
-
function
|
|
2508
|
+
function Rn({
|
|
2501
2509
|
value: t = 0,
|
|
2502
2510
|
size: s = "m",
|
|
2503
2511
|
variant: n = "default",
|
|
2504
2512
|
showValue: r = !1,
|
|
2505
|
-
min:
|
|
2506
|
-
animate:
|
|
2513
|
+
min: o = 2,
|
|
2514
|
+
animate: a = !0
|
|
2507
2515
|
}) {
|
|
2508
|
-
const i = Math.min(100, Math.max(0, t)), l = Math.max(
|
|
2516
|
+
const i = Math.min(100, Math.max(0, t)), l = Math.max(o, i), c = n === "auto" ? i >= 70 ? "success" : i >= 50 ? "warning" : "danger" : n;
|
|
2509
2517
|
return /* @__PURE__ */ e.jsxs(
|
|
2510
2518
|
"div",
|
|
2511
2519
|
{
|
|
2512
2520
|
className: [
|
|
2513
2521
|
"ds-progress",
|
|
2514
2522
|
`ds-progress--${s}`,
|
|
2515
|
-
!
|
|
2523
|
+
!a && "ds-progress--instant"
|
|
2516
2524
|
].filter(Boolean).join(" "),
|
|
2517
2525
|
role: "progressbar",
|
|
2518
2526
|
"aria-valuenow": i,
|
|
@@ -2534,84 +2542,84 @@ function Tn({
|
|
|
2534
2542
|
}
|
|
2535
2543
|
);
|
|
2536
2544
|
}
|
|
2537
|
-
const
|
|
2538
|
-
function
|
|
2539
|
-
const [n, r] =
|
|
2545
|
+
const ns = (t) => 1 - Math.pow(1 - t, 3), rs = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2546
|
+
function os(t, { duration: s = 600 } = {}) {
|
|
2547
|
+
const [n, r] = L(t), o = S(t), a = S(null);
|
|
2540
2548
|
return P(() => {
|
|
2541
|
-
if (
|
|
2542
|
-
r(t),
|
|
2549
|
+
if (rs()) {
|
|
2550
|
+
r(t), o.current = t;
|
|
2543
2551
|
return;
|
|
2544
2552
|
}
|
|
2545
|
-
const i =
|
|
2553
|
+
const i = o.current, l = t - i;
|
|
2546
2554
|
if (l === 0) return;
|
|
2547
2555
|
let c = null;
|
|
2548
2556
|
const u = (d) => {
|
|
2549
2557
|
c || (c = d);
|
|
2550
2558
|
const p = Math.min((d - c) / s, 1);
|
|
2551
|
-
r(i + l *
|
|
2559
|
+
r(i + l * ns(p)), p < 1 ? a.current = requestAnimationFrame(u) : o.current = t;
|
|
2552
2560
|
};
|
|
2553
|
-
return
|
|
2561
|
+
return a.current = requestAnimationFrame(u), () => cancelAnimationFrame(a.current);
|
|
2554
2562
|
}, [t, s]), n;
|
|
2555
2563
|
}
|
|
2556
|
-
function
|
|
2564
|
+
function Sn({
|
|
2557
2565
|
value: t,
|
|
2558
2566
|
duration: s = 600,
|
|
2559
2567
|
decimals: n = 0,
|
|
2560
2568
|
prefix: r = "",
|
|
2561
|
-
suffix:
|
|
2569
|
+
suffix: o = ""
|
|
2562
2570
|
}) {
|
|
2563
|
-
const i =
|
|
2564
|
-
return `${r}${i}${
|
|
2571
|
+
const i = os(t, { duration: s }).toFixed(n);
|
|
2572
|
+
return `${r}${i}${o}`;
|
|
2565
2573
|
}
|
|
2566
|
-
function
|
|
2567
|
-
const r =
|
|
2574
|
+
function as({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2575
|
+
const r = S(null), [o, a] = L(!1);
|
|
2568
2576
|
return P(() => {
|
|
2569
2577
|
const i = r.current;
|
|
2570
2578
|
if (!i) return;
|
|
2571
2579
|
const l = new IntersectionObserver(
|
|
2572
2580
|
([c]) => {
|
|
2573
|
-
c.isIntersecting ? (
|
|
2581
|
+
c.isIntersecting ? (a(!0), n && l.disconnect()) : n || a(!1);
|
|
2574
2582
|
},
|
|
2575
2583
|
{ threshold: t, rootMargin: s }
|
|
2576
2584
|
);
|
|
2577
2585
|
return l.observe(i), () => l.disconnect();
|
|
2578
|
-
}, [t, s, n]), { ref: r, inView:
|
|
2586
|
+
}, [t, s, n]), { ref: r, inView: o };
|
|
2579
2587
|
}
|
|
2580
|
-
function
|
|
2588
|
+
function An({
|
|
2581
2589
|
children: t,
|
|
2582
2590
|
as: s = "div",
|
|
2583
2591
|
once: n = !1,
|
|
2584
2592
|
threshold: r = 0.1,
|
|
2585
|
-
rootMargin:
|
|
2586
|
-
onEnter:
|
|
2593
|
+
rootMargin: o = "0px",
|
|
2594
|
+
onEnter: a,
|
|
2587
2595
|
onLeave: i,
|
|
2588
2596
|
...l
|
|
2589
2597
|
}) {
|
|
2590
|
-
const { ref: c, inView: u } =
|
|
2598
|
+
const { ref: c, inView: u } = as({ threshold: r, rootMargin: o, once: n }), d = S(!1);
|
|
2591
2599
|
return P(() => {
|
|
2592
|
-
u && !d.current && (
|
|
2600
|
+
u && !d.current && (a == null || a()), !u && d.current && (i == null || i()), d.current = u;
|
|
2593
2601
|
}, [u]), /* @__PURE__ */ e.jsx(s, { ref: c, ...l, children: typeof t == "function" ? t(u) : t });
|
|
2594
2602
|
}
|
|
2595
|
-
const
|
|
2603
|
+
const ot = {
|
|
2596
2604
|
default: We,
|
|
2597
|
-
success:
|
|
2598
|
-
warning:
|
|
2605
|
+
success: ze,
|
|
2606
|
+
warning: Fe,
|
|
2599
2607
|
error: Me
|
|
2600
2608
|
};
|
|
2601
2609
|
let ve = [];
|
|
2602
|
-
const
|
|
2603
|
-
function
|
|
2604
|
-
|
|
2610
|
+
const De = /* @__PURE__ */ new Set();
|
|
2611
|
+
function pt() {
|
|
2612
|
+
De.forEach((t) => t([...ve]));
|
|
2605
2613
|
}
|
|
2606
|
-
function
|
|
2607
|
-
ve = [...ve, t],
|
|
2614
|
+
function is(t) {
|
|
2615
|
+
ve = [...ve, t], pt();
|
|
2608
2616
|
}
|
|
2609
|
-
function
|
|
2610
|
-
ve = ve.filter((s) => s.id !== t),
|
|
2617
|
+
function ls(t) {
|
|
2618
|
+
ve = ve.filter((s) => s.id !== t), pt();
|
|
2611
2619
|
}
|
|
2612
|
-
function
|
|
2620
|
+
function Bn() {
|
|
2613
2621
|
const t = (s, n = {}) => {
|
|
2614
|
-
|
|
2622
|
+
is({
|
|
2615
2623
|
id: `${Date.now()}-${Math.random()}`,
|
|
2616
2624
|
message: s,
|
|
2617
2625
|
type: "default",
|
|
@@ -2621,15 +2629,15 @@ function Sn() {
|
|
|
2621
2629
|
};
|
|
2622
2630
|
return t.success = (s, n) => t(s, { ...n, type: "success" }), t.error = (s, n) => t(s, { ...n, type: "error" }), t.warning = (s, n) => t(s, { ...n, type: "warning" }), { toast: t };
|
|
2623
2631
|
}
|
|
2624
|
-
function
|
|
2625
|
-
const n = K(), [r,
|
|
2626
|
-
P(() => (requestAnimationFrame(() =>
|
|
2627
|
-
clearTimeout(
|
|
2632
|
+
function cs({ data: t, onDismiss: s }) {
|
|
2633
|
+
const n = K(), [r, o] = L(!1), a = S(null), i = S(null);
|
|
2634
|
+
P(() => (requestAnimationFrame(() => o(!0)), t.duration > 0 && (a.current = setTimeout(() => l(), t.duration)), () => {
|
|
2635
|
+
clearTimeout(a.current), clearTimeout(i.current);
|
|
2628
2636
|
}), []);
|
|
2629
2637
|
function l() {
|
|
2630
|
-
|
|
2638
|
+
o(!1), i.current = setTimeout(() => s(t.id), 250);
|
|
2631
2639
|
}
|
|
2632
|
-
const c =
|
|
2640
|
+
const c = ot[t.type] ?? ot.default;
|
|
2633
2641
|
return /* @__PURE__ */ e.jsxs(
|
|
2634
2642
|
"div",
|
|
2635
2643
|
{
|
|
@@ -2656,25 +2664,25 @@ function is({ data: t, onDismiss: s }) {
|
|
|
2656
2664
|
}
|
|
2657
2665
|
);
|
|
2658
2666
|
}
|
|
2659
|
-
function
|
|
2660
|
-
const [s, n] =
|
|
2661
|
-
return P(() => (
|
|
2662
|
-
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(
|
|
2667
|
+
function In({ position: t = "bottom-right" }) {
|
|
2668
|
+
const [s, n] = L(() => [...ve]);
|
|
2669
|
+
return P(() => (De.add(n), () => De.delete(n)), []), !s.length || typeof document > "u" ? null : re.createPortal(
|
|
2670
|
+
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(cs, { data: r, onDismiss: ls }, r.id)) }),
|
|
2663
2671
|
document.body
|
|
2664
2672
|
);
|
|
2665
2673
|
}
|
|
2666
|
-
const
|
|
2674
|
+
const ds = {
|
|
2667
2675
|
running: /* @__PURE__ */ e.jsx(he, { size: "xs", variant: "info", children: "Running..." }),
|
|
2668
2676
|
success: /* @__PURE__ */ e.jsx(he, { size: "xs", variant: "success", children: "Done" }),
|
|
2669
2677
|
error: /* @__PURE__ */ e.jsx(he, { size: "xs", variant: "error", children: "Error" })
|
|
2670
2678
|
};
|
|
2671
|
-
function
|
|
2679
|
+
function Dn({
|
|
2672
2680
|
label: t,
|
|
2673
2681
|
status: s = "idle",
|
|
2674
2682
|
icon: n,
|
|
2675
2683
|
badge: r,
|
|
2676
|
-
defaultExpanded:
|
|
2677
|
-
expanded:
|
|
2684
|
+
defaultExpanded: o = !1,
|
|
2685
|
+
expanded: a,
|
|
2678
2686
|
onToggle: i,
|
|
2679
2687
|
children: l,
|
|
2680
2688
|
className: c = "",
|
|
@@ -2683,7 +2691,7 @@ function Bn({
|
|
|
2683
2691
|
const d = s === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2684
2692
|
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2685
2693
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: t }),
|
|
2686
|
-
|
|
2694
|
+
ds[s],
|
|
2687
2695
|
r
|
|
2688
2696
|
] });
|
|
2689
2697
|
return l ? /* @__PURE__ */ e.jsx(
|
|
@@ -2696,8 +2704,8 @@ function Bn({
|
|
|
2696
2704
|
{
|
|
2697
2705
|
title: p,
|
|
2698
2706
|
padding: "s",
|
|
2699
|
-
defaultExpanded:
|
|
2700
|
-
expanded: d ? !1 :
|
|
2707
|
+
defaultExpanded: o,
|
|
2708
|
+
expanded: d ? !1 : a,
|
|
2701
2709
|
onToggle: d ? void 0 : i,
|
|
2702
2710
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2703
2711
|
}
|
|
@@ -2712,14 +2720,14 @@ function Bn({
|
|
|
2712
2720
|
}
|
|
2713
2721
|
);
|
|
2714
2722
|
}
|
|
2715
|
-
function
|
|
2723
|
+
function us({
|
|
2716
2724
|
text: t,
|
|
2717
2725
|
size: s = "xs",
|
|
2718
2726
|
timeout: n = 800,
|
|
2719
2727
|
"aria-label": r,
|
|
2720
|
-
...
|
|
2728
|
+
...o
|
|
2721
2729
|
}) {
|
|
2722
|
-
const
|
|
2730
|
+
const a = K(), [i, l] = L(!1), c = S(null), u = (d) => {
|
|
2723
2731
|
d.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
|
|
2724
2732
|
l(!0), clearTimeout(c.current), c.current = setTimeout(() => l(!1), n);
|
|
2725
2733
|
});
|
|
@@ -2730,49 +2738,49 @@ function cs({
|
|
|
2730
2738
|
variant: "ghost",
|
|
2731
2739
|
size: s,
|
|
2732
2740
|
state: i ? "success" : "idle",
|
|
2733
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2734
|
-
"aria-label": r ??
|
|
2741
|
+
icon: /* @__PURE__ */ e.jsx(Tt, { size: q[1], strokeWidth: 1.5 }),
|
|
2742
|
+
"aria-label": r ?? a.copyToClipboard,
|
|
2735
2743
|
onClick: u,
|
|
2736
|
-
...
|
|
2744
|
+
...o
|
|
2737
2745
|
}
|
|
2738
2746
|
);
|
|
2739
2747
|
}
|
|
2740
|
-
function
|
|
2741
|
-
const [r,
|
|
2748
|
+
function Ln({ content: t, streaming: s = !1, ...n }) {
|
|
2749
|
+
const [r, o] = L(s);
|
|
2742
2750
|
return P(() => {
|
|
2743
|
-
|
|
2751
|
+
o(!!s);
|
|
2744
2752
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2745
2753
|
He,
|
|
2746
2754
|
{
|
|
2747
2755
|
expanded: r,
|
|
2748
|
-
onToggle:
|
|
2756
|
+
onToggle: o,
|
|
2749
2757
|
padding: "s",
|
|
2750
2758
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2751
|
-
/* @__PURE__ */ e.jsx(
|
|
2752
|
-
/* @__PURE__ */ e.jsx(
|
|
2759
|
+
/* @__PURE__ */ e.jsx($t, { size: q[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2760
|
+
/* @__PURE__ */ e.jsx(Wt, { secondary: !0, children: "Thinking" })
|
|
2753
2761
|
] }),
|
|
2754
2762
|
...n,
|
|
2755
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2763
|
+
children: /* @__PURE__ */ e.jsxs(mt, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2756
2764
|
t,
|
|
2757
2765
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
2758
2766
|
] })
|
|
2759
2767
|
}
|
|
2760
2768
|
);
|
|
2761
2769
|
}
|
|
2762
|
-
function
|
|
2770
|
+
function Pn({
|
|
2763
2771
|
count: t,
|
|
2764
2772
|
current: s = 0,
|
|
2765
2773
|
done: n = [],
|
|
2766
2774
|
onChange: r,
|
|
2767
|
-
showCounter:
|
|
2768
|
-
className:
|
|
2775
|
+
showCounter: o = !0,
|
|
2776
|
+
className: a = "",
|
|
2769
2777
|
"aria-label": i,
|
|
2770
2778
|
...l
|
|
2771
2779
|
}) {
|
|
2772
2780
|
const c = K(), { t: u } = be();
|
|
2773
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2781
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", a].filter(Boolean).join(" "), ...l, children: [
|
|
2774
2782
|
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i ?? c.steps, children: Array.from({ length: t }, (d, p) => {
|
|
2775
|
-
const h = p === s, f = n.includes(p) && !h, _ = r && (p <= s || n.includes(p)),
|
|
2783
|
+
const h = p === s, f = n.includes(p) && !h, _ = r && (p <= s || n.includes(p)), w = [
|
|
2776
2784
|
"ds-step-indicator__dot",
|
|
2777
2785
|
h && "ds-step-indicator__dot--active",
|
|
2778
2786
|
f && "ds-step-indicator__dot--done"
|
|
@@ -2781,7 +2789,7 @@ function Ln({
|
|
|
2781
2789
|
"button",
|
|
2782
2790
|
{
|
|
2783
2791
|
type: "button",
|
|
2784
|
-
className:
|
|
2792
|
+
className: w,
|
|
2785
2793
|
role: "tab",
|
|
2786
2794
|
"aria-selected": h,
|
|
2787
2795
|
"aria-label": u("stepN", { n: p + 1 }),
|
|
@@ -2792,81 +2800,81 @@ function Ln({
|
|
|
2792
2800
|
p
|
|
2793
2801
|
);
|
|
2794
2802
|
}) }),
|
|
2795
|
-
|
|
2803
|
+
o && /* @__PURE__ */ e.jsxs(mt, { secondary: !0, className: "ds-step-indicator__counter", children: [
|
|
2796
2804
|
s + 1,
|
|
2797
2805
|
" / ",
|
|
2798
2806
|
t
|
|
2799
2807
|
] })
|
|
2800
2808
|
] });
|
|
2801
2809
|
}
|
|
2802
|
-
function
|
|
2810
|
+
function Mn({
|
|
2803
2811
|
content: t,
|
|
2804
2812
|
isStreaming: s = !1,
|
|
2805
2813
|
cursor: n = "line",
|
|
2806
2814
|
onChunk: r,
|
|
2807
|
-
className:
|
|
2808
|
-
...
|
|
2815
|
+
className: o = "",
|
|
2816
|
+
...a
|
|
2809
2817
|
}) {
|
|
2810
|
-
const i =
|
|
2818
|
+
const i = S(t);
|
|
2811
2819
|
return P(() => {
|
|
2812
2820
|
t !== i.current && (r == null || r(t), i.current = t);
|
|
2813
|
-
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text",
|
|
2821
|
+
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", o].filter(Boolean).join(" "), ...a, children: [
|
|
2814
2822
|
t,
|
|
2815
2823
|
s && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2816
2824
|
] });
|
|
2817
2825
|
}
|
|
2818
|
-
function
|
|
2826
|
+
function Fn({
|
|
2819
2827
|
role: t = "assistant",
|
|
2820
2828
|
header: s,
|
|
2821
2829
|
footer: n,
|
|
2822
2830
|
attachments: r,
|
|
2823
|
-
isStreaming:
|
|
2824
|
-
children:
|
|
2831
|
+
isStreaming: o = !1,
|
|
2832
|
+
children: a,
|
|
2825
2833
|
className: i = "",
|
|
2826
2834
|
...l
|
|
2827
2835
|
}) {
|
|
2828
2836
|
const c = [
|
|
2829
2837
|
"ds-chat-message",
|
|
2830
2838
|
`ds-chat-message--${t}`,
|
|
2831
|
-
|
|
2839
|
+
o && "ds-chat-message--streaming",
|
|
2832
2840
|
i
|
|
2833
2841
|
].filter(Boolean).join(" ");
|
|
2834
|
-
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className: c, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children:
|
|
2842
|
+
return t === "system" ? /* @__PURE__ */ e.jsx("div", { className: c, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: a }) }) : t === "user" ? /* @__PURE__ */ e.jsxs("div", { className: c, ...l, children: [
|
|
2835
2843
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: r }),
|
|
2836
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2844
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: a }),
|
|
2837
2845
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2838
2846
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: c, ...l, children: [
|
|
2839
2847
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: s }),
|
|
2840
2848
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: r }),
|
|
2841
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2849
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: a }),
|
|
2842
2850
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2843
2851
|
] });
|
|
2844
2852
|
}
|
|
2845
|
-
function
|
|
2846
|
-
const r =
|
|
2853
|
+
function zn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2854
|
+
const r = S(!1), o = S(0);
|
|
2847
2855
|
P(() => {
|
|
2848
|
-
const
|
|
2849
|
-
if (!
|
|
2856
|
+
const a = s == null ? void 0 : s.current;
|
|
2857
|
+
if (!a) return;
|
|
2850
2858
|
const i = () => {
|
|
2851
|
-
const l =
|
|
2852
|
-
!l &&
|
|
2859
|
+
const l = a.scrollHeight - a.scrollTop - a.clientHeight < 64;
|
|
2860
|
+
!l && a.scrollTop < o.current && (r.current = !0), l && (r.current = !1), o.current = a.scrollTop;
|
|
2853
2861
|
};
|
|
2854
|
-
return
|
|
2862
|
+
return a.addEventListener("scroll", i, { passive: !0 }), () => a.removeEventListener("scroll", i);
|
|
2855
2863
|
}, [s]), P(() => {
|
|
2856
|
-
const
|
|
2857
|
-
|
|
2864
|
+
const a = s == null ? void 0 : s.current;
|
|
2865
|
+
a && (n && r.current || (a.scrollTop = a.scrollHeight));
|
|
2858
2866
|
}, t);
|
|
2859
2867
|
}
|
|
2860
|
-
function
|
|
2868
|
+
function fs({
|
|
2861
2869
|
prompts: t,
|
|
2862
2870
|
enabled: s,
|
|
2863
2871
|
typingSpeed: n = 38,
|
|
2864
2872
|
erasingSpeed: r = 18,
|
|
2865
|
-
holdTime:
|
|
2866
|
-
betweenTime:
|
|
2873
|
+
holdTime: o = 2200,
|
|
2874
|
+
betweenTime: a = 380,
|
|
2867
2875
|
manualPauseMs: i = 5e3
|
|
2868
2876
|
}) {
|
|
2869
|
-
const [l, c] =
|
|
2877
|
+
const [l, c] = L(0), [u, d] = L(""), p = S("typing"), h = S(0), f = S(0), _ = S(null), w = S(0);
|
|
2870
2878
|
P(() => {
|
|
2871
2879
|
f.current = l;
|
|
2872
2880
|
}, [l]), P(() => {
|
|
@@ -2875,33 +2883,33 @@ function ds({
|
|
|
2875
2883
|
return;
|
|
2876
2884
|
}
|
|
2877
2885
|
const x = () => {
|
|
2878
|
-
const
|
|
2879
|
-
if (
|
|
2880
|
-
_.current = setTimeout(x,
|
|
2886
|
+
const y = Date.now();
|
|
2887
|
+
if (w.current > y) {
|
|
2888
|
+
_.current = setTimeout(x, w.current - y);
|
|
2881
2889
|
return;
|
|
2882
2890
|
}
|
|
2883
|
-
const
|
|
2884
|
-
p.current === "typing" ? (h.current += 1, d(
|
|
2891
|
+
const N = t[f.current % t.length] ?? "";
|
|
2892
|
+
p.current === "typing" ? (h.current += 1, d(N.slice(0, h.current)), h.current >= N.length ? (p.current = "holding", _.current = setTimeout(x, o)) : _.current = setTimeout(x, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", _.current = setTimeout(x, r)) : (h.current = Math.max(0, h.current - 1), d(N.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", f.current = (f.current + 1) % t.length, c(f.current), _.current = setTimeout(x, a)) : _.current = setTimeout(x, r));
|
|
2885
2893
|
};
|
|
2886
2894
|
return _.current = setTimeout(x, 260), () => {
|
|
2887
2895
|
_.current && clearTimeout(_.current);
|
|
2888
2896
|
};
|
|
2889
|
-
}, [s, t, n, r,
|
|
2890
|
-
const
|
|
2897
|
+
}, [s, t, n, r, o, a]);
|
|
2898
|
+
const T = (x) => {
|
|
2891
2899
|
if (t.length === 0) return;
|
|
2892
|
-
const
|
|
2893
|
-
f.current =
|
|
2894
|
-
},
|
|
2895
|
-
return { displayed: u, currentPrompt:
|
|
2900
|
+
const y = (x % t.length + t.length) % t.length, N = t[y];
|
|
2901
|
+
f.current = y, h.current = N.length, p.current = "holding", w.current = Date.now() + i, c(y), d(N);
|
|
2902
|
+
}, j = () => T(f.current + 1), g = () => T(f.current - 1), $ = t[l % t.length] ?? "";
|
|
2903
|
+
return { displayed: u, currentPrompt: $, index: l, next: j, prev: g };
|
|
2896
2904
|
}
|
|
2897
|
-
let
|
|
2898
|
-
function
|
|
2905
|
+
let ms = 0;
|
|
2906
|
+
function Wn({
|
|
2899
2907
|
value: t = "",
|
|
2900
2908
|
onChange: s,
|
|
2901
2909
|
onSubmit: n,
|
|
2902
2910
|
onStop: r,
|
|
2903
|
-
onKeyDown:
|
|
2904
|
-
loading:
|
|
2911
|
+
onKeyDown: o,
|
|
2912
|
+
loading: a = !1,
|
|
2905
2913
|
disabled: i = !1,
|
|
2906
2914
|
placeholder: l,
|
|
2907
2915
|
animatedPlaceholders: c,
|
|
@@ -2911,82 +2919,82 @@ function zn({
|
|
|
2911
2919
|
onAttachImages: h,
|
|
2912
2920
|
onRemoveAttachment: f,
|
|
2913
2921
|
onRemoveImage: _,
|
|
2914
|
-
acceptImage:
|
|
2915
|
-
acceptFile:
|
|
2916
|
-
maxImages:
|
|
2917
|
-
maxImageSize:
|
|
2918
|
-
leftSlot:
|
|
2922
|
+
acceptImage: w,
|
|
2923
|
+
acceptFile: T,
|
|
2924
|
+
maxImages: j,
|
|
2925
|
+
maxImageSize: g,
|
|
2926
|
+
leftSlot: $,
|
|
2919
2927
|
rightSlot: x,
|
|
2920
|
-
className:
|
|
2921
|
-
...
|
|
2928
|
+
className: y = "",
|
|
2929
|
+
...N
|
|
2922
2930
|
}) {
|
|
2923
|
-
const
|
|
2924
|
-
const
|
|
2925
|
-
v((Z) => [...Z, { id:
|
|
2931
|
+
const B = K(), { t: D } = be(), W = S(null), O = S(null), k = S(0), [C, M] = L(!1), [V, v] = L([]), R = S(/* @__PURE__ */ new Set()), A = l ?? B.promptPlaceholder, F = (E) => {
|
|
2932
|
+
const z = ++ms;
|
|
2933
|
+
v((Z) => [...Z, { id: z, msg: E }]);
|
|
2926
2934
|
const J = setTimeout(() => {
|
|
2927
|
-
|
|
2935
|
+
R.current.delete(J), v((Z) => Z.filter((ee) => ee.id !== z));
|
|
2928
2936
|
}, 6e3);
|
|
2929
|
-
|
|
2937
|
+
R.current.add(J);
|
|
2930
2938
|
};
|
|
2931
2939
|
P(() => {
|
|
2932
|
-
const E =
|
|
2940
|
+
const E = R.current;
|
|
2933
2941
|
return () => E.forEach(clearTimeout);
|
|
2934
2942
|
}, []);
|
|
2935
|
-
const H = (E) => v((
|
|
2936
|
-
const
|
|
2937
|
-
let
|
|
2943
|
+
const H = (E) => v((z) => z.filter((J) => J.id !== E)), Y = (E) => E.type.startsWith("image/"), m = () => !0, b = w ?? Y, I = T ?? m, U = (E) => {
|
|
2944
|
+
const z = [], J = [], Z = [], ee = [];
|
|
2945
|
+
let ae = 0, me = j != null ? j - ((d == null ? void 0 : d.length) ?? 0) : 1 / 0;
|
|
2938
2946
|
for (const ie of E)
|
|
2939
|
-
b(ie) ?
|
|
2940
|
-
return { imageFiles:
|
|
2947
|
+
b(ie) ? g && ie.size > g ? Z.push(ie.name) : me > 0 ? (z.push(ie), me--) : ae++ : I(ie) ? J.push(ie) : ee.push(ie.name);
|
|
2948
|
+
return { imageFiles: z, docFiles: J, tooLarge: Z, skipped: ee, limitExceeded: ae };
|
|
2941
2949
|
}, se = (E) => {
|
|
2942
|
-
const
|
|
2943
|
-
|
|
2944
|
-
},
|
|
2945
|
-
const { imageFiles:
|
|
2946
|
-
Z.length && se(Z), ee.length &&
|
|
2947
|
-
const me = J.concat(h ? [] :
|
|
2950
|
+
const z = g ? D("fileTooLargeMaxHint", { maxMb: g / 1024 / 1024 }) : "";
|
|
2951
|
+
F(D("fileTooLarge", { maxHint: z, names: E.join(", ") }));
|
|
2952
|
+
}, oe = (E) => {
|
|
2953
|
+
const { imageFiles: z, docFiles: J, tooLarge: Z, skipped: ee, limitExceeded: ae } = U(E);
|
|
2954
|
+
Z.length && se(Z), ee.length && F(D("filesSkipped", { names: ee.join(", ") })), ae && F(D("maxImages", { n: j })), h && z.length && h(z);
|
|
2955
|
+
const me = J.concat(h ? [] : z);
|
|
2948
2956
|
p && me.length && p(me);
|
|
2949
2957
|
};
|
|
2950
2958
|
P(() => {
|
|
2951
2959
|
const E = O.current;
|
|
2952
2960
|
E && (E.style.height = "auto", E.style.height = `${Math.min(E.scrollHeight, 200)}px`);
|
|
2953
2961
|
}, [t]), P(() => {
|
|
2954
|
-
const E = (
|
|
2955
|
-
var Z, ee,
|
|
2956
|
-
if (
|
|
2957
|
-
const J = (Z =
|
|
2958
|
-
J === "INPUT" || J === "TEXTAREA" || J === "SELECT" || (ee =
|
|
2962
|
+
const E = (z) => {
|
|
2963
|
+
var Z, ee, ae;
|
|
2964
|
+
if (a || i) return;
|
|
2965
|
+
const J = (Z = z.target) == null ? void 0 : Z.tagName;
|
|
2966
|
+
J === "INPUT" || J === "TEXTAREA" || J === "SELECT" || (ee = z.target) != null && ee.isContentEditable || z.ctrlKey || z.metaKey || z.altKey || z.key.length !== 1 && z.key !== "Backspace" && z.key !== "Delete" || (ae = O.current) == null || ae.focus();
|
|
2959
2967
|
};
|
|
2960
2968
|
return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
|
|
2961
|
-
}, [
|
|
2969
|
+
}, [a, i]);
|
|
2962
2970
|
const G = (E) => {
|
|
2963
|
-
E.preventDefault(),
|
|
2971
|
+
E.preventDefault(), k.current++, E.dataTransfer.types.includes("Files") && M(!0);
|
|
2964
2972
|
}, Q = (E) => {
|
|
2965
|
-
E.preventDefault(),
|
|
2973
|
+
E.preventDefault(), k.current--, k.current === 0 && M(!1);
|
|
2966
2974
|
}, fe = (E) => E.preventDefault(), je = (E) => {
|
|
2967
|
-
E.preventDefault(),
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2975
|
+
E.preventDefault(), k.current = 0, M(!1);
|
|
2976
|
+
const z = Array.from(E.dataTransfer.files);
|
|
2977
|
+
z.length && oe(z);
|
|
2970
2978
|
}, Se = (E) => {
|
|
2971
|
-
const
|
|
2972
|
-
W.current && (W.current.value = ""),
|
|
2973
|
-
},
|
|
2979
|
+
const z = Array.from(E.target.files || []);
|
|
2980
|
+
W.current && (W.current.value = ""), z.length && oe(z);
|
|
2981
|
+
}, ht = (E) => {
|
|
2974
2982
|
var ie;
|
|
2975
2983
|
if (!h) return;
|
|
2976
|
-
const
|
|
2977
|
-
if (!
|
|
2984
|
+
const z = (ie = E.clipboardData) == null ? void 0 : ie.items;
|
|
2985
|
+
if (!z) return;
|
|
2978
2986
|
const J = [];
|
|
2979
|
-
for (const
|
|
2980
|
-
const qe =
|
|
2987
|
+
for (const bt of z) {
|
|
2988
|
+
const qe = bt.getAsFile();
|
|
2981
2989
|
qe && J.push(qe);
|
|
2982
2990
|
}
|
|
2983
2991
|
if (J.length === 0) return;
|
|
2984
|
-
const { imageFiles: Z, tooLarge: ee, skipped:
|
|
2985
|
-
ee.length && se(ee),
|
|
2986
|
-
}, Ne = !
|
|
2992
|
+
const { imageFiles: Z, tooLarge: ee, skipped: ae, limitExceeded: me } = U(J);
|
|
2993
|
+
ee.length && se(ee), ae.length && F(D("filesSkipped", { names: ae.join(", ") })), me && F(D("maxImages", { n: j })), Z.length && (E.preventDefault(), h(Z));
|
|
2994
|
+
}, Ne = !a && !i && !!(c != null && c.length) && t.length === 0, ke = fs({
|
|
2987
2995
|
prompts: c ?? [],
|
|
2988
2996
|
enabled: Ne
|
|
2989
|
-
}),
|
|
2997
|
+
}), xt = (E) => {
|
|
2990
2998
|
if (Ne) {
|
|
2991
2999
|
if (E.key === "ArrowDown" || E.key === "ArrowRight") {
|
|
2992
3000
|
E.preventDefault(), ke.next();
|
|
@@ -3001,9 +3009,9 @@ function zn({
|
|
|
3001
3009
|
return;
|
|
3002
3010
|
}
|
|
3003
3011
|
}
|
|
3004
|
-
|
|
3005
|
-
},
|
|
3006
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input",
|
|
3012
|
+
o == null || o(E);
|
|
3013
|
+
}, vt = (t.trim() || (d == null ? void 0 : d.length) > 0 || (u == null ? void 0 : u.length) > 0) && !i, Ye = p || h;
|
|
3014
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", y].filter(Boolean).join(" "), ...N, children: [
|
|
3007
3015
|
Ye && /* @__PURE__ */ e.jsx(
|
|
3008
3016
|
"input",
|
|
3009
3017
|
{
|
|
@@ -3024,17 +3032,17 @@ function zn({
|
|
|
3024
3032
|
onDragOver: fe,
|
|
3025
3033
|
onDrop: je,
|
|
3026
3034
|
children: [
|
|
3027
|
-
C && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children:
|
|
3035
|
+
C && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: B.dropFilesHere }),
|
|
3028
3036
|
/* @__PURE__ */ e.jsx(
|
|
3029
3037
|
"textarea",
|
|
3030
3038
|
{
|
|
3031
3039
|
ref: O,
|
|
3032
3040
|
value: t,
|
|
3033
3041
|
onChange: (E) => s == null ? void 0 : s(E.target.value),
|
|
3034
|
-
onKeyDown:
|
|
3035
|
-
onPaste:
|
|
3036
|
-
placeholder: Ne ? "" :
|
|
3037
|
-
disabled:
|
|
3042
|
+
onKeyDown: xt,
|
|
3043
|
+
onPaste: ht,
|
|
3044
|
+
placeholder: Ne ? "" : A,
|
|
3045
|
+
disabled: a || i,
|
|
3038
3046
|
rows: 1,
|
|
3039
3047
|
className: ["ds-prompt-input__textarea", Ne && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
3040
3048
|
}
|
|
@@ -3043,19 +3051,19 @@ function zn({
|
|
|
3043
3051
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ke.displayed }),
|
|
3044
3052
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
3045
3053
|
] }),
|
|
3046
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: d.map((E,
|
|
3054
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: d.map((E, z) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
3047
3055
|
/* @__PURE__ */ e.jsx("img", { src: E.preview, alt: "" }),
|
|
3048
3056
|
/* @__PURE__ */ e.jsx(
|
|
3049
3057
|
"button",
|
|
3050
3058
|
{
|
|
3051
3059
|
className: "ds-prompt-input__image-remove",
|
|
3052
|
-
onClick: () => _ == null ? void 0 : _(
|
|
3053
|
-
"aria-label":
|
|
3060
|
+
onClick: () => _ == null ? void 0 : _(z),
|
|
3061
|
+
"aria-label": B.removeImage,
|
|
3054
3062
|
type: "button",
|
|
3055
3063
|
children: /* @__PURE__ */ e.jsx(te, { size: 12, strokeWidth: 2 })
|
|
3056
3064
|
}
|
|
3057
3065
|
)
|
|
3058
|
-
] },
|
|
3066
|
+
] }, z)) }),
|
|
3059
3067
|
V.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: V.map((E) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
3060
3068
|
/* @__PURE__ */ e.jsx("span", { children: E.msg }),
|
|
3061
3069
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3064,25 +3072,25 @@ function zn({
|
|
|
3064
3072
|
type: "button",
|
|
3065
3073
|
className: "ds-prompt-input__warning-close",
|
|
3066
3074
|
onClick: () => H(E.id),
|
|
3067
|
-
"aria-label":
|
|
3075
|
+
"aria-label": B.dismiss,
|
|
3068
3076
|
children: /* @__PURE__ */ e.jsx(te, { size: q[1], strokeWidth: 1.5 })
|
|
3069
3077
|
}
|
|
3070
3078
|
)
|
|
3071
3079
|
] }, E.id)) }),
|
|
3072
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((E,
|
|
3073
|
-
E.uploading ? /* @__PURE__ */ e.jsx(
|
|
3080
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((E, z) => /* @__PURE__ */ e.jsx(he, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
3081
|
+
E.uploading ? /* @__PURE__ */ e.jsx(Rt, { size: q[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Ge, { size: q[1], strokeWidth: 1.5 }),
|
|
3074
3082
|
E.filename,
|
|
3075
|
-
E.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children:
|
|
3083
|
+
E.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: B.uploading }) : /* @__PURE__ */ e.jsx(
|
|
3076
3084
|
"button",
|
|
3077
3085
|
{
|
|
3078
3086
|
type: "button",
|
|
3079
3087
|
className: "ds-prompt-input__remove-btn",
|
|
3080
|
-
onClick: () => f == null ? void 0 : f(
|
|
3081
|
-
"aria-label":
|
|
3088
|
+
onClick: () => f == null ? void 0 : f(z),
|
|
3089
|
+
"aria-label": B.removeAttachment,
|
|
3082
3090
|
children: /* @__PURE__ */ e.jsx(te, { size: q[1], strokeWidth: 1.5 })
|
|
3083
3091
|
}
|
|
3084
3092
|
)
|
|
3085
|
-
] }) },
|
|
3093
|
+
] }) }, z)) }),
|
|
3086
3094
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
3087
3095
|
Ye && /* @__PURE__ */ e.jsx(
|
|
3088
3096
|
de,
|
|
@@ -3090,34 +3098,34 @@ function zn({
|
|
|
3090
3098
|
variant: "ghost",
|
|
3091
3099
|
size: "xs",
|
|
3092
3100
|
icon: /* @__PURE__ */ e.jsx(Ge, { size: q[2], strokeWidth: 1.5 }),
|
|
3093
|
-
"aria-label":
|
|
3101
|
+
"aria-label": B.attachFiles,
|
|
3094
3102
|
onClick: () => {
|
|
3095
3103
|
var E;
|
|
3096
3104
|
return (E = W.current) == null ? void 0 : E.click();
|
|
3097
3105
|
}
|
|
3098
3106
|
}
|
|
3099
3107
|
),
|
|
3100
|
-
|
|
3108
|
+
$,
|
|
3101
3109
|
x,
|
|
3102
3110
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
3103
|
-
|
|
3111
|
+
a ? /* @__PURE__ */ e.jsx(
|
|
3104
3112
|
de,
|
|
3105
3113
|
{
|
|
3106
3114
|
variant: "primary",
|
|
3107
3115
|
size: "xs",
|
|
3108
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
3116
|
+
icon: /* @__PURE__ */ e.jsx(St, { size: q[2], strokeWidth: 1.5 }),
|
|
3109
3117
|
onClick: r,
|
|
3110
|
-
"aria-label":
|
|
3118
|
+
"aria-label": B.stop
|
|
3111
3119
|
}
|
|
3112
3120
|
) : /* @__PURE__ */ e.jsx(
|
|
3113
3121
|
de,
|
|
3114
3122
|
{
|
|
3115
3123
|
variant: "primary",
|
|
3116
3124
|
size: "xs",
|
|
3117
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
3125
|
+
icon: /* @__PURE__ */ e.jsx(At, { size: q[2], strokeWidth: 1.5 }),
|
|
3118
3126
|
onClick: n,
|
|
3119
|
-
disabled: !
|
|
3120
|
-
"aria-label":
|
|
3127
|
+
disabled: !vt,
|
|
3128
|
+
"aria-label": B.send
|
|
3121
3129
|
}
|
|
3122
3130
|
)
|
|
3123
3131
|
] })
|
|
@@ -3126,37 +3134,37 @@ function zn({
|
|
|
3126
3134
|
)
|
|
3127
3135
|
] });
|
|
3128
3136
|
}
|
|
3129
|
-
const at = { fast: 0, standard: 1, premium: 2 },
|
|
3130
|
-
function
|
|
3137
|
+
const at = { fast: 0, standard: 1, premium: 2 }, it = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
3138
|
+
function On({
|
|
3131
3139
|
models: t = [],
|
|
3132
3140
|
value: s,
|
|
3133
3141
|
onChange: n,
|
|
3134
3142
|
size: r = "xs",
|
|
3135
|
-
minTier:
|
|
3136
|
-
showAutoOption:
|
|
3143
|
+
minTier: o,
|
|
3144
|
+
showAutoOption: a = !1,
|
|
3137
3145
|
groupByTier: i = !0,
|
|
3138
3146
|
className: l = "",
|
|
3139
3147
|
...c
|
|
3140
3148
|
}) {
|
|
3141
|
-
const [u, d] =
|
|
3149
|
+
const [u, d] = L(!1), p = S(null), h = S(null), f = S(null), [_, w] = L({}), T = r === "s" ? "s" : "xs", j = t.filter((k) => !o || k.name === "auto" ? !0 : (at[k.tier] ?? 1) >= (at[o] ?? 1)), g = j.find((k) => k.name === "auto"), $ = j.filter((k) => k.name !== "auto"), x = t.find((k) => k.name === s), N = new Set($.map((k) => k.tier).filter(Boolean)).size > 1;
|
|
3142
3150
|
P(() => {
|
|
3143
3151
|
if (!u) return;
|
|
3144
|
-
const
|
|
3145
|
-
var
|
|
3146
|
-
const v = (
|
|
3152
|
+
const k = 320, C = () => {
|
|
3153
|
+
var F;
|
|
3154
|
+
const v = (F = h.current) == null ? void 0 : F.getBoundingClientRect();
|
|
3147
3155
|
if (!v) return;
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3156
|
+
const R = window.innerHeight - v.bottom, A = R < k + 8 && v.top > R;
|
|
3157
|
+
w({
|
|
3150
3158
|
position: "fixed",
|
|
3151
3159
|
zIndex: "var(--z-dropdown, 500)",
|
|
3152
3160
|
left: v.left,
|
|
3153
|
-
...
|
|
3161
|
+
...A ? { bottom: window.innerHeight - v.top + 4, top: "auto" } : { top: v.bottom + 4, bottom: "auto" }
|
|
3154
3162
|
});
|
|
3155
3163
|
};
|
|
3156
3164
|
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
3157
3165
|
const M = (v) => {
|
|
3158
|
-
var
|
|
3159
|
-
!((
|
|
3166
|
+
var R, A;
|
|
3167
|
+
!((R = p.current) != null && R.contains(v.target)) && !((A = f.current) != null && A.contains(v.target)) && d(!1);
|
|
3160
3168
|
}, V = (v) => {
|
|
3161
3169
|
v.key === "Escape" && d(!1);
|
|
3162
3170
|
};
|
|
@@ -3164,32 +3172,32 @@ function Fn({
|
|
|
3164
3172
|
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", M), document.removeEventListener("keydown", V);
|
|
3165
3173
|
};
|
|
3166
3174
|
}, [u]);
|
|
3167
|
-
const
|
|
3168
|
-
n == null || n(
|
|
3169
|
-
},
|
|
3175
|
+
const B = (k) => {
|
|
3176
|
+
n == null || n(k), d(!1);
|
|
3177
|
+
}, D = (k) => /* @__PURE__ */ e.jsxs(
|
|
3170
3178
|
"button",
|
|
3171
3179
|
{
|
|
3172
3180
|
type: "button",
|
|
3173
3181
|
className: [
|
|
3174
3182
|
"ds-model-picker__item",
|
|
3175
|
-
|
|
3183
|
+
k.name === s && "ds-model-picker__item--active"
|
|
3176
3184
|
].filter(Boolean).join(" "),
|
|
3177
|
-
onClick: () =>
|
|
3185
|
+
onClick: () => B(k.name),
|
|
3178
3186
|
children: [
|
|
3179
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children:
|
|
3180
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
3181
|
-
|
|
3187
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: k.icon || /* @__PURE__ */ e.jsx(Ke, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3188
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: k.displayName || k.name }),
|
|
3189
|
+
N && k.tier && /* @__PURE__ */ e.jsx(he, { size: "xs", variant: it[k.tier] || "default", children: k.tier })
|
|
3182
3190
|
]
|
|
3183
3191
|
},
|
|
3184
|
-
|
|
3185
|
-
), W = () => !i || !
|
|
3186
|
-
const C =
|
|
3192
|
+
k.name
|
|
3193
|
+
), W = () => !i || !N ? $.map(D) : ["fast", "standard", "premium"].flatMap((k) => {
|
|
3194
|
+
const C = $.filter((M) => M.tier === k);
|
|
3187
3195
|
return C.length ? [
|
|
3188
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
3189
|
-
...C.map(
|
|
3196
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": k, children: k.charAt(0).toUpperCase() + k.slice(1) }, `lbl-${k}`),
|
|
3197
|
+
...C.map(D)
|
|
3190
3198
|
] : [];
|
|
3191
|
-
}), O = u && /* @__PURE__ */ e.jsxs("div", { ref: f, className: `ds-model-picker__menu ds-model-picker__menu--${
|
|
3192
|
-
|
|
3199
|
+
}), O = u && /* @__PURE__ */ e.jsxs("div", { ref: f, className: `ds-model-picker__menu ds-model-picker__menu--${T} ds-scrollable`, "data-ds-portal": "", style: _, children: [
|
|
3200
|
+
a && g && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3193
3201
|
/* @__PURE__ */ e.jsxs(
|
|
3194
3202
|
"button",
|
|
3195
3203
|
{
|
|
@@ -3199,14 +3207,14 @@ function Fn({
|
|
|
3199
3207
|
"ds-model-picker__item--auto",
|
|
3200
3208
|
s === "auto" && "ds-model-picker__item--active"
|
|
3201
3209
|
].filter(Boolean).join(" "),
|
|
3202
|
-
onClick: () =>
|
|
3210
|
+
onClick: () => B("auto"),
|
|
3203
3211
|
children: [
|
|
3204
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: /* @__PURE__ */ e.jsx(
|
|
3212
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: /* @__PURE__ */ e.jsx(Bt, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3205
3213
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
3206
3214
|
]
|
|
3207
3215
|
}
|
|
3208
3216
|
),
|
|
3209
|
-
|
|
3217
|
+
$.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
3210
3218
|
] }),
|
|
3211
3219
|
W()
|
|
3212
3220
|
] });
|
|
@@ -3222,14 +3230,14 @@ function Fn({
|
|
|
3222
3230
|
{
|
|
3223
3231
|
ref: h,
|
|
3224
3232
|
type: "button",
|
|
3225
|
-
className: `ds-model-picker__trigger ds-model-picker__trigger--${
|
|
3226
|
-
onClick: () => d((
|
|
3233
|
+
className: `ds-model-picker__trigger ds-model-picker__trigger--${T}`,
|
|
3234
|
+
onClick: () => d((k) => !k),
|
|
3227
3235
|
"aria-haspopup": "listbox",
|
|
3228
3236
|
"aria-expanded": u,
|
|
3229
3237
|
children: [
|
|
3230
3238
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__icon", children: (x == null ? void 0 : x.icon) || /* @__PURE__ */ e.jsx(Ke, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3231
3239
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (x == null ? void 0 : x.displayName) || (x == null ? void 0 : x.name) || s }),
|
|
3232
|
-
|
|
3240
|
+
N && (x == null ? void 0 : x.tier) && /* @__PURE__ */ e.jsx(he, { size: "xs", variant: it[x.tier] || "default", children: x.tier })
|
|
3233
3241
|
]
|
|
3234
3242
|
}
|
|
3235
3243
|
),
|
|
@@ -3238,91 +3246,91 @@ function Fn({
|
|
|
3238
3246
|
}
|
|
3239
3247
|
);
|
|
3240
3248
|
}
|
|
3241
|
-
const
|
|
3249
|
+
const ps = ({ filename: t, pagesLabel: s }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
3242
3250
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: t }),
|
|
3243
3251
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: s })
|
|
3244
3252
|
] });
|
|
3245
|
-
function
|
|
3253
|
+
function hs(t) {
|
|
3246
3254
|
const s = /* @__PURE__ */ new Map();
|
|
3247
3255
|
for (const n of t)
|
|
3248
3256
|
s.has(n.filename) || s.set(n.filename, { filename: n.filename, url: n.url, items: [] }), s.get(n.filename).items.push(n);
|
|
3249
3257
|
return [...s.values()];
|
|
3250
3258
|
}
|
|
3251
|
-
function
|
|
3259
|
+
function Cn({
|
|
3252
3260
|
sources: t = [],
|
|
3253
3261
|
layout: s = "list",
|
|
3254
3262
|
title: n,
|
|
3255
3263
|
maxVisible: r = 5,
|
|
3256
|
-
onSourceClick:
|
|
3264
|
+
onSourceClick: o
|
|
3257
3265
|
}) {
|
|
3258
|
-
const
|
|
3259
|
-
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className:
|
|
3260
|
-
h.map((
|
|
3261
|
-
const
|
|
3266
|
+
const a = K(), { t: i } = be(), l = n ?? a.sources, [c, u] = L(!1), d = hs(t), p = d.length > r, h = c ? d : d.slice(0, r), f = t.some((j) => j.snippet), _ = (j) => j != null && j.length ? i("pageAbbrev", { pages: j.join(", ") }) : null, w = i("moreSources", { n: d.length - r }), T = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
3267
|
+
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: T, children: [
|
|
3268
|
+
h.map((j) => {
|
|
3269
|
+
const g = j.items.map((y) => y.page).filter(Boolean), $ = _(g), x = !!o;
|
|
3262
3270
|
return /* @__PURE__ */ e.jsxs(
|
|
3263
3271
|
"div",
|
|
3264
3272
|
{
|
|
3265
3273
|
className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
3266
|
-
onClick: x ? () =>
|
|
3274
|
+
onClick: x ? () => o(j.items[0]) : void 0,
|
|
3267
3275
|
children: [
|
|
3268
|
-
/* @__PURE__ */ e.jsx(
|
|
3269
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children:
|
|
3270
|
-
|
|
3276
|
+
/* @__PURE__ */ e.jsx(It, { size: q[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
3277
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: j.filename }),
|
|
3278
|
+
$ && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: $ })
|
|
3271
3279
|
]
|
|
3272
3280
|
},
|
|
3273
|
-
|
|
3281
|
+
j.filename
|
|
3274
3282
|
);
|
|
3275
3283
|
}),
|
|
3276
|
-
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children:
|
|
3277
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
3284
|
+
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children: w })
|
|
3285
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: T, children: [
|
|
3278
3286
|
l && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: l }),
|
|
3279
|
-
h.map((
|
|
3280
|
-
const
|
|
3287
|
+
h.map((j) => {
|
|
3288
|
+
const g = j.items.map((y) => y.page).filter(Boolean), $ = _(g), x = !!o;
|
|
3281
3289
|
return f ? /* @__PURE__ */ e.jsx(
|
|
3282
3290
|
He,
|
|
3283
3291
|
{
|
|
3284
|
-
title: /* @__PURE__ */ e.jsx(
|
|
3292
|
+
title: /* @__PURE__ */ e.jsx(ps, { filename: j.filename, pagesLabel: $ }),
|
|
3285
3293
|
padding: "s",
|
|
3286
|
-
children:
|
|
3294
|
+
children: j.items.map((y, N) => /* @__PURE__ */ e.jsx(
|
|
3287
3295
|
"div",
|
|
3288
3296
|
{
|
|
3289
3297
|
className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
3290
|
-
onClick: x ? () =>
|
|
3291
|
-
children:
|
|
3298
|
+
onClick: x ? () => o(y) : void 0,
|
|
3299
|
+
children: y.snippet ?? i("pageAbbrev", { pages: y.page })
|
|
3292
3300
|
},
|
|
3293
|
-
|
|
3301
|
+
N
|
|
3294
3302
|
))
|
|
3295
3303
|
},
|
|
3296
|
-
|
|
3304
|
+
j.filename
|
|
3297
3305
|
) : /* @__PURE__ */ e.jsxs(
|
|
3298
3306
|
"div",
|
|
3299
3307
|
{
|
|
3300
3308
|
className: `ds-sources-panel__row${x ? " ds-sources-panel__row--clickable" : ""}`,
|
|
3301
|
-
onClick: x ? () =>
|
|
3309
|
+
onClick: x ? () => o(j.items[0]) : void 0,
|
|
3302
3310
|
children: [
|
|
3303
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children:
|
|
3304
|
-
|
|
3311
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: j.filename }),
|
|
3312
|
+
$ && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: $ })
|
|
3305
3313
|
]
|
|
3306
3314
|
},
|
|
3307
|
-
|
|
3315
|
+
j.filename
|
|
3308
3316
|
);
|
|
3309
3317
|
}),
|
|
3310
|
-
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children:
|
|
3318
|
+
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children: w })
|
|
3311
3319
|
] });
|
|
3312
3320
|
}
|
|
3313
|
-
function
|
|
3321
|
+
function lt(t) {
|
|
3314
3322
|
return t >= 1e6 ? (t / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : t >= 1e3 ? (t / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(t);
|
|
3315
3323
|
}
|
|
3316
|
-
function
|
|
3324
|
+
function Un({
|
|
3317
3325
|
used: t,
|
|
3318
3326
|
limit: s,
|
|
3319
3327
|
size: n = "s",
|
|
3320
3328
|
showCount: r = !0,
|
|
3321
|
-
showPercent:
|
|
3322
|
-
warningThreshold:
|
|
3329
|
+
showPercent: o = !1,
|
|
3330
|
+
warningThreshold: a = 0.8,
|
|
3323
3331
|
errorThreshold: i = 1
|
|
3324
3332
|
}) {
|
|
3325
|
-
const l = s > 0 ? t / s : 0, c = Math.min(l * 100, 100), u = l >= i ? "error" : l >=
|
|
3333
|
+
const l = s > 0 ? t / s : 0, c = Math.min(l * 100, 100), u = l >= i ? "error" : l >= a ? "warning" : "normal";
|
|
3326
3334
|
return /* @__PURE__ */ e.jsxs(
|
|
3327
3335
|
"div",
|
|
3328
3336
|
{
|
|
@@ -3338,13 +3346,13 @@ function On({
|
|
|
3338
3346
|
style: { width: `${c}%` }
|
|
3339
3347
|
}
|
|
3340
3348
|
) }),
|
|
3341
|
-
(r ||
|
|
3349
|
+
(r || o) && /* @__PURE__ */ e.jsxs("div", { className: `ds-token-counter__label ds-token-counter__label--${u}`, children: [
|
|
3342
3350
|
r && /* @__PURE__ */ e.jsxs("span", { children: [
|
|
3343
|
-
|
|
3351
|
+
lt(t),
|
|
3344
3352
|
" / ",
|
|
3345
|
-
|
|
3353
|
+
lt(s)
|
|
3346
3354
|
] }),
|
|
3347
|
-
|
|
3355
|
+
o && /* @__PURE__ */ e.jsxs("span", { style: { marginLeft: "auto" }, children: [
|
|
3348
3356
|
Math.round(l * 100),
|
|
3349
3357
|
"%"
|
|
3350
3358
|
] })
|
|
@@ -3353,58 +3361,58 @@ function On({
|
|
|
3353
3361
|
}
|
|
3354
3362
|
);
|
|
3355
3363
|
}
|
|
3356
|
-
const
|
|
3357
|
-
function
|
|
3364
|
+
const ct = 5;
|
|
3365
|
+
function xs(t) {
|
|
3358
3366
|
return t < 0.34 ? "low" : t < 0.67 ? "medium" : "high";
|
|
3359
3367
|
}
|
|
3360
|
-
function
|
|
3368
|
+
function Hn({
|
|
3361
3369
|
value: t = 0,
|
|
3362
3370
|
size: s = "xs",
|
|
3363
3371
|
showLabel: n = "none",
|
|
3364
3372
|
layout: r = "inline"
|
|
3365
3373
|
}) {
|
|
3366
|
-
const
|
|
3374
|
+
const o = Math.max(0, Math.min(1, t)), a = Math.round(o * ct), i = xs(o);
|
|
3367
3375
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
3368
3376
|
"ds-confidence-bar",
|
|
3369
3377
|
`ds-confidence-bar--${s}`,
|
|
3370
3378
|
`ds-confidence-bar--${i}`,
|
|
3371
3379
|
r === "block" && "ds-confidence-bar--block"
|
|
3372
3380
|
].filter(Boolean).join(" "), children: [
|
|
3373
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length:
|
|
3381
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: ct }, (l, c) => /* @__PURE__ */ e.jsx(
|
|
3374
3382
|
"div",
|
|
3375
3383
|
{
|
|
3376
|
-
className: `ds-confidence-bar__seg${c <
|
|
3384
|
+
className: `ds-confidence-bar__seg${c < a ? " ds-confidence-bar__seg--filled" : ""}`
|
|
3377
3385
|
},
|
|
3378
3386
|
c
|
|
3379
3387
|
)) }),
|
|
3380
3388
|
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
3381
3389
|
] });
|
|
3382
3390
|
}
|
|
3383
|
-
const
|
|
3391
|
+
const vs = { add: "+", remove: "-", context: " " };
|
|
3384
3392
|
function Ae({ line: t, lineNumbers: s }) {
|
|
3385
3393
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${t.type}`, children: [
|
|
3386
3394
|
s && t.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: t.lineNo }),
|
|
3387
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children:
|
|
3395
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: vs[t.type] }),
|
|
3388
3396
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: t.text })
|
|
3389
3397
|
] });
|
|
3390
3398
|
}
|
|
3391
|
-
function
|
|
3399
|
+
function Vn({
|
|
3392
3400
|
lines: t = [],
|
|
3393
3401
|
layout: s = "inline",
|
|
3394
3402
|
wordWrap: n = !1,
|
|
3395
3403
|
lineNumbers: r = !0,
|
|
3396
|
-
maxHeight:
|
|
3397
|
-
title:
|
|
3404
|
+
maxHeight: o,
|
|
3405
|
+
title: a
|
|
3398
3406
|
}) {
|
|
3399
3407
|
const i = [
|
|
3400
3408
|
"ds-diff-view",
|
|
3401
3409
|
`ds-diff-view--${s}`,
|
|
3402
3410
|
n && "ds-diff-view--wrap"
|
|
3403
|
-
].filter(Boolean).join(" "), l =
|
|
3411
|
+
].filter(Boolean).join(" "), l = o ? { maxHeight: o, overflowY: "auto" } : void 0;
|
|
3404
3412
|
if (s === "split") {
|
|
3405
3413
|
const c = t.filter((d) => d.type === "remove" || d.type === "context"), u = t.filter((d) => d.type === "add" || d.type === "context");
|
|
3406
3414
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3407
|
-
|
|
3415
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: a }),
|
|
3408
3416
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: [
|
|
3409
3417
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: c.map((d, p) => /* @__PURE__ */ e.jsx(Ae, { line: d, lineNumbers: r }, p)) }),
|
|
3410
3418
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col ds-scrollable", children: u.map((d, p) => /* @__PURE__ */ e.jsx(Ae, { line: d, lineNumbers: r }, p)) })
|
|
@@ -3412,17 +3420,17 @@ function Un({
|
|
|
3412
3420
|
] });
|
|
3413
3421
|
}
|
|
3414
3422
|
return /* @__PURE__ */ e.jsxs("div", { className: i, children: [
|
|
3415
|
-
|
|
3423
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: a }),
|
|
3416
3424
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((c, u) => /* @__PURE__ */ e.jsx(Ae, { line: c, lineNumbers: r }, u)) })
|
|
3417
3425
|
] });
|
|
3418
3426
|
}
|
|
3419
|
-
function
|
|
3427
|
+
function bs({
|
|
3420
3428
|
value: t = "idle",
|
|
3421
3429
|
onLike: s,
|
|
3422
3430
|
onDislike: n,
|
|
3423
3431
|
className: r = "",
|
|
3424
|
-
likeLabel:
|
|
3425
|
-
dislikeLabel:
|
|
3432
|
+
likeLabel: o,
|
|
3433
|
+
dislikeLabel: a,
|
|
3426
3434
|
...i
|
|
3427
3435
|
}) {
|
|
3428
3436
|
const l = K(), c = t !== "idle";
|
|
@@ -3445,10 +3453,10 @@ function xs({
|
|
|
3445
3453
|
].filter(Boolean).join(" "),
|
|
3446
3454
|
onClick: s,
|
|
3447
3455
|
disabled: c,
|
|
3448
|
-
"aria-label":
|
|
3456
|
+
"aria-label": o ?? l.like,
|
|
3449
3457
|
"aria-pressed": t === "liked",
|
|
3450
3458
|
children: /* @__PURE__ */ e.jsx(
|
|
3451
|
-
|
|
3459
|
+
Dt,
|
|
3452
3460
|
{
|
|
3453
3461
|
size: q[1],
|
|
3454
3462
|
strokeWidth: 1.5,
|
|
@@ -3466,7 +3474,7 @@ function xs({
|
|
|
3466
3474
|
].filter(Boolean).join(" "),
|
|
3467
3475
|
onClick: n,
|
|
3468
3476
|
disabled: c,
|
|
3469
|
-
"aria-label":
|
|
3477
|
+
"aria-label": a ?? l.dislike,
|
|
3470
3478
|
"aria-pressed": t === "disliked",
|
|
3471
3479
|
children: /* @__PURE__ */ e.jsx(
|
|
3472
3480
|
Lt,
|
|
@@ -3482,26 +3490,26 @@ function xs({
|
|
|
3482
3490
|
}
|
|
3483
3491
|
);
|
|
3484
3492
|
}
|
|
3485
|
-
function
|
|
3493
|
+
function _s(t) {
|
|
3486
3494
|
const s = t instanceof Date ? t : new Date(t);
|
|
3487
3495
|
if (isNaN(s)) return null;
|
|
3488
|
-
const n = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }),
|
|
3489
|
-
if (s >=
|
|
3490
|
-
if (s >=
|
|
3496
|
+
const n = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), o = new Date(n.getFullYear(), n.getMonth(), n.getDate()), a = new Date(o - 864e5);
|
|
3497
|
+
if (s >= o) return r;
|
|
3498
|
+
if (s >= a) return `Yesterday ${r}`;
|
|
3491
3499
|
const i = s.getDate(), l = s.toLocaleString([], { month: "short" });
|
|
3492
3500
|
return `${i} ${l} ${r}`;
|
|
3493
3501
|
}
|
|
3494
|
-
function
|
|
3502
|
+
function Yn({
|
|
3495
3503
|
role: t = "assistant",
|
|
3496
3504
|
text: s,
|
|
3497
3505
|
timestamp: n,
|
|
3498
3506
|
feedbackValue: r = "idle",
|
|
3499
|
-
onLike:
|
|
3500
|
-
onDislike:
|
|
3507
|
+
onLike: o,
|
|
3508
|
+
onDislike: a,
|
|
3501
3509
|
className: i = "",
|
|
3502
3510
|
...l
|
|
3503
3511
|
}) {
|
|
3504
|
-
const c = t === "assistant" && (
|
|
3512
|
+
const c = t === "assistant" && (o || a), u = !!s, d = n ? _s(n) : null;
|
|
3505
3513
|
return !c && !u && !d ? null : /* @__PURE__ */ e.jsxs(
|
|
3506
3514
|
"div",
|
|
3507
3515
|
{
|
|
@@ -3509,21 +3517,21 @@ function Hn({
|
|
|
3509
3517
|
...l,
|
|
3510
3518
|
children: [
|
|
3511
3519
|
t === "user" && d && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: d }),
|
|
3512
|
-
c && /* @__PURE__ */ e.jsx(
|
|
3513
|
-
u && /* @__PURE__ */ e.jsx(
|
|
3520
|
+
c && /* @__PURE__ */ e.jsx(bs, { className: "ds-message-action", value: r, onLike: o, onDislike: a }),
|
|
3521
|
+
u && /* @__PURE__ */ e.jsx(us, { className: "ds-message-action", text: s }),
|
|
3514
3522
|
t === "assistant" && d && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: d })
|
|
3515
3523
|
]
|
|
3516
3524
|
}
|
|
3517
3525
|
);
|
|
3518
3526
|
}
|
|
3519
|
-
function
|
|
3527
|
+
function qn({ label: t, className: s = "", ...n }) {
|
|
3520
3528
|
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", s].filter(Boolean).join(" "), ...n, children: [
|
|
3521
3529
|
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
3522
3530
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: t })
|
|
3523
3531
|
] });
|
|
3524
3532
|
}
|
|
3525
|
-
function
|
|
3526
|
-
const
|
|
3533
|
+
function Gn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...o }) {
|
|
3534
|
+
const a = t === "dark", i = s ?? a, l = a ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", c = a ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
3527
3535
|
return /* @__PURE__ */ e.jsx(
|
|
3528
3536
|
"div",
|
|
3529
3537
|
{
|
|
@@ -3538,7 +3546,7 @@ function Yn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
|
3538
3546
|
},
|
|
3539
3547
|
...r
|
|
3540
3548
|
},
|
|
3541
|
-
...
|
|
3549
|
+
...o,
|
|
3542
3550
|
children: /* @__PURE__ */ e.jsx(
|
|
3543
3551
|
"div",
|
|
3544
3552
|
{
|
|
@@ -3563,57 +3571,57 @@ function Yn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
|
3563
3571
|
}
|
|
3564
3572
|
);
|
|
3565
3573
|
}
|
|
3566
|
-
function
|
|
3567
|
-
const
|
|
3574
|
+
function Kn({ children: t, axis: s = "y", style: n, className: r = "", ...o }) {
|
|
3575
|
+
const a = s === "x" ? { overflowX: "auto", overflowY: "hidden" } : s === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
3568
3576
|
return /* @__PURE__ */ e.jsx(
|
|
3569
3577
|
"div",
|
|
3570
3578
|
{
|
|
3571
3579
|
className: `ds-scrollable ${r}`,
|
|
3572
|
-
style: { ...
|
|
3573
|
-
...
|
|
3580
|
+
style: { ...a, ...n },
|
|
3581
|
+
...o,
|
|
3574
3582
|
children: t
|
|
3575
3583
|
}
|
|
3576
3584
|
);
|
|
3577
3585
|
}
|
|
3578
|
-
const Be = 280,
|
|
3579
|
-
function
|
|
3586
|
+
const Be = 280, js = 22, Ns = 14, ue = 8, Te = 6, ws = 200;
|
|
3587
|
+
function gs(t) {
|
|
3580
3588
|
return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
|
|
3581
3589
|
}
|
|
3582
|
-
function
|
|
3583
|
-
const
|
|
3584
|
-
if (
|
|
3590
|
+
function ys(t, s, n, r) {
|
|
3591
|
+
const o = window.innerWidth, a = window.innerHeight;
|
|
3592
|
+
if (a - t.bottom >= s + r + ue) return "bottom";
|
|
3585
3593
|
if (t.top >= s + r + ue) return "top";
|
|
3586
|
-
if (
|
|
3594
|
+
if (o - t.right >= n + r + ue) return "right";
|
|
3587
3595
|
if (t.left >= n + r + ue) return "left";
|
|
3588
|
-
const i = Math.max(t.top,
|
|
3589
|
-
return i ===
|
|
3596
|
+
const i = Math.max(t.top, a - t.bottom, o - t.right, t.left);
|
|
3597
|
+
return i === a - t.bottom ? "bottom" : i === t.top ? "top" : i === o - t.right ? "right" : "left";
|
|
3590
3598
|
}
|
|
3591
|
-
function
|
|
3592
|
-
const
|
|
3599
|
+
function ks(t, s, n, r, o) {
|
|
3600
|
+
const a = window.innerWidth, i = window.innerHeight;
|
|
3593
3601
|
let l, c;
|
|
3594
3602
|
switch (t) {
|
|
3595
3603
|
case "top":
|
|
3596
|
-
l = s.top - n -
|
|
3604
|
+
l = s.top - n - o, c = s.left + s.width / 2 - r / 2;
|
|
3597
3605
|
break;
|
|
3598
3606
|
case "bottom":
|
|
3599
|
-
l = s.bottom +
|
|
3607
|
+
l = s.bottom + o, c = s.left + s.width / 2 - r / 2;
|
|
3600
3608
|
break;
|
|
3601
3609
|
case "left":
|
|
3602
|
-
l = s.top + s.height / 2 - n / 2, c = s.left - r -
|
|
3610
|
+
l = s.top + s.height / 2 - n / 2, c = s.left - r - o;
|
|
3603
3611
|
break;
|
|
3604
3612
|
default:
|
|
3605
|
-
l = s.top + s.height / 2 - n / 2, c = s.right +
|
|
3613
|
+
l = s.top + s.height / 2 - n / 2, c = s.right + o;
|
|
3606
3614
|
}
|
|
3607
|
-
const u = Math.max(ue, Math.min(
|
|
3615
|
+
const u = Math.max(ue, Math.min(a - r - ue, c)), d = Math.max(ue, Math.min(i - n - ue, l));
|
|
3608
3616
|
return { top: d, left: u, arrowOffset: c - u, arrowOffsetY: l - d };
|
|
3609
3617
|
}
|
|
3610
|
-
function
|
|
3618
|
+
function Xn({
|
|
3611
3619
|
steps: t,
|
|
3612
3620
|
currentStep: s,
|
|
3613
3621
|
onNext: n,
|
|
3614
3622
|
onBack: r,
|
|
3615
|
-
onSkip:
|
|
3616
|
-
onFinish:
|
|
3623
|
+
onSkip: o,
|
|
3624
|
+
onFinish: a,
|
|
3617
3625
|
overlay: i = !0,
|
|
3618
3626
|
ring: l = !0,
|
|
3619
3627
|
labelNext: c,
|
|
@@ -3623,15 +3631,15 @@ function Gn({
|
|
|
3623
3631
|
statePrimary: h = "idle",
|
|
3624
3632
|
stateBack: f = "idle"
|
|
3625
3633
|
}) {
|
|
3626
|
-
const _ = K(), { t:
|
|
3627
|
-
|
|
3628
|
-
const [
|
|
3629
|
-
const Y =
|
|
3634
|
+
const _ = K(), { t: w } = be(), T = c ?? _.next, j = u ?? _.back, g = d ?? _.skipTour, $ = p ?? _.done, x = S(null), y = S(t), N = S(s), B = S(l);
|
|
3635
|
+
y.current = t, N.current = s, B.current = l;
|
|
3636
|
+
const [D, W] = L(!1), [O, k] = L({ position: "fixed", visibility: "hidden", width: Be }), [C, M] = L("bottom"), [V, v] = L(null), R = S(!1), A = t[s], F = s === t.length - 1, H = ne(() => {
|
|
3637
|
+
const Y = y.current[N.current];
|
|
3630
3638
|
if (!Y || !x.current) return;
|
|
3631
|
-
const m =
|
|
3639
|
+
const m = gs(Y.target);
|
|
3632
3640
|
if (!m) return;
|
|
3633
|
-
const b = m.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, se = Be,
|
|
3634
|
-
M(G),
|
|
3641
|
+
const b = m.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, se = Be, oe = B.current ? js : Ns, G = Y.position || ys(b, U, se, oe), { top: Q, left: fe, arrowOffset: je, arrowOffsetY: Se } = ks(G, b, U, se, oe);
|
|
3642
|
+
M(G), k({
|
|
3635
3643
|
position: "fixed",
|
|
3636
3644
|
top: Q,
|
|
3637
3645
|
left: fe,
|
|
@@ -3649,40 +3657,40 @@ function Gn({
|
|
|
3649
3657
|
return P(() => {
|
|
3650
3658
|
window.addEventListener("scroll", H, !0), window.addEventListener("resize", H);
|
|
3651
3659
|
const Y = requestAnimationFrame(() => {
|
|
3652
|
-
H(), W(!0),
|
|
3660
|
+
H(), W(!0), R.current = !0;
|
|
3653
3661
|
});
|
|
3654
3662
|
return () => {
|
|
3655
3663
|
cancelAnimationFrame(Y), window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", H);
|
|
3656
3664
|
};
|
|
3657
3665
|
}, []), P(() => {
|
|
3658
|
-
if (
|
|
3666
|
+
if (!R.current) return;
|
|
3659
3667
|
W(!1);
|
|
3660
3668
|
const Y = setTimeout(() => {
|
|
3661
|
-
|
|
3669
|
+
k((m) => ({ ...m, visibility: "hidden" })), requestAnimationFrame(() => {
|
|
3662
3670
|
H(), W(!0);
|
|
3663
3671
|
});
|
|
3664
|
-
},
|
|
3672
|
+
}, ws + 20);
|
|
3665
3673
|
return () => clearTimeout(Y);
|
|
3666
3674
|
}, [s]), P(() => {
|
|
3667
|
-
|
|
3668
|
-
}, [
|
|
3675
|
+
D && x.current && x.current.focus({ preventScroll: !0 });
|
|
3676
|
+
}, [D]), P(() => {
|
|
3669
3677
|
const Y = (m) => {
|
|
3670
|
-
m.key === "Escape" &&
|
|
3678
|
+
m.key === "Escape" && o();
|
|
3671
3679
|
};
|
|
3672
3680
|
return document.addEventListener("keydown", Y), () => document.removeEventListener("keydown", Y);
|
|
3673
|
-
}, [
|
|
3674
|
-
if (!
|
|
3681
|
+
}, [o]), P(() => {
|
|
3682
|
+
if (!D) return;
|
|
3675
3683
|
const Y = (m) => {
|
|
3676
3684
|
if (m.key !== "Tab" || !x.current) return;
|
|
3677
3685
|
const b = Array.from(
|
|
3678
3686
|
x.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
|
|
3679
3687
|
);
|
|
3680
3688
|
if (!b.length) return;
|
|
3681
|
-
const
|
|
3682
|
-
m.shiftKey && document.activeElement ===
|
|
3689
|
+
const I = b[0], U = b[b.length - 1];
|
|
3690
|
+
m.shiftKey && document.activeElement === I ? (m.preventDefault(), U.focus()) : !m.shiftKey && document.activeElement === U && (m.preventDefault(), I.focus());
|
|
3683
3691
|
};
|
|
3684
3692
|
return document.addEventListener("keydown", Y), () => document.removeEventListener("keydown", Y);
|
|
3685
|
-
}, [
|
|
3693
|
+
}, [D]), !A || typeof document > "u" ? null : re.createPortal(
|
|
3686
3694
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3687
3695
|
V && /* @__PURE__ */ e.jsx(
|
|
3688
3696
|
"div",
|
|
@@ -3691,7 +3699,7 @@ function Gn({
|
|
|
3691
3699
|
"ds-coachmark__spotlight",
|
|
3692
3700
|
i && "ds-coachmark__spotlight--overlay",
|
|
3693
3701
|
!l && "ds-coachmark__spotlight--no-ring",
|
|
3694
|
-
|
|
3702
|
+
D && "ds-coachmark__spotlight--visible"
|
|
3695
3703
|
].filter(Boolean).join(" "),
|
|
3696
3704
|
style: V,
|
|
3697
3705
|
"aria-hidden": "true"
|
|
@@ -3705,11 +3713,11 @@ function Gn({
|
|
|
3705
3713
|
role: "dialog",
|
|
3706
3714
|
"aria-modal": "false",
|
|
3707
3715
|
"aria-live": "polite",
|
|
3708
|
-
"aria-label":
|
|
3716
|
+
"aria-label": A.title ?? w("stepOf", { current: s + 1, total: t.length }),
|
|
3709
3717
|
className: [
|
|
3710
3718
|
"ds-coachmark__bubble",
|
|
3711
3719
|
`ds-coachmark__bubble--${C}`,
|
|
3712
|
-
|
|
3720
|
+
D && "ds-coachmark__bubble--visible"
|
|
3713
3721
|
].filter(Boolean).join(" "),
|
|
3714
3722
|
style: O,
|
|
3715
3723
|
tabIndex: -1,
|
|
@@ -3719,13 +3727,13 @@ function Gn({
|
|
|
3719
3727
|
{
|
|
3720
3728
|
type: "button",
|
|
3721
3729
|
className: "ds-coachmark__close",
|
|
3722
|
-
onClick:
|
|
3723
|
-
"aria-label":
|
|
3730
|
+
onClick: o,
|
|
3731
|
+
"aria-label": g,
|
|
3724
3732
|
children: /* @__PURE__ */ e.jsx(te, { size: 16, strokeWidth: 2 })
|
|
3725
3733
|
}
|
|
3726
3734
|
),
|
|
3727
|
-
|
|
3728
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children:
|
|
3735
|
+
A.title && /* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__title", children: A.title }),
|
|
3736
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children: A.content }),
|
|
3729
3737
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer", children: [
|
|
3730
3738
|
t.length > 1 && /* @__PURE__ */ e.jsxs("span", { className: "ds-coachmark__counter", children: [
|
|
3731
3739
|
s + 1,
|
|
@@ -3733,8 +3741,8 @@ function Gn({
|
|
|
3733
3741
|
t.length
|
|
3734
3742
|
] }),
|
|
3735
3743
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
|
|
3736
|
-
s > 0 && /* @__PURE__ */ e.jsx(de, { variant: "secondary", size: "s", state: f, onClick: r, children:
|
|
3737
|
-
/* @__PURE__ */ e.jsx(de, { variant: "primary", size: "s", state: h, onClick:
|
|
3744
|
+
s > 0 && /* @__PURE__ */ e.jsx(de, { variant: "secondary", size: "s", state: f, onClick: r, children: j }),
|
|
3745
|
+
/* @__PURE__ */ e.jsx(de, { variant: "primary", size: "s", state: h, onClick: F ? a : n, children: F ? $ : T })
|
|
3738
3746
|
] })
|
|
3739
3747
|
] })
|
|
3740
3748
|
]
|
|
@@ -3744,24 +3752,24 @@ function Gn({
|
|
|
3744
3752
|
document.body
|
|
3745
3753
|
);
|
|
3746
3754
|
}
|
|
3747
|
-
function
|
|
3748
|
-
const { storageKey: n } = s, [r,
|
|
3755
|
+
function Jn(t, s = {}) {
|
|
3756
|
+
const { storageKey: n } = s, [r, o] = L(0), [a, i] = L(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = ne(() => {
|
|
3749
3757
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3750
3758
|
}, [n]);
|
|
3751
3759
|
return {
|
|
3752
3760
|
currentStep: r,
|
|
3753
|
-
isActive:
|
|
3761
|
+
isActive: a,
|
|
3754
3762
|
start: () => {
|
|
3755
|
-
l() || (
|
|
3763
|
+
l() || (o(0), i(!0));
|
|
3756
3764
|
},
|
|
3757
|
-
next: () =>
|
|
3758
|
-
back: () =>
|
|
3765
|
+
next: () => o((u) => Math.min(u + 1, t.length - 1)),
|
|
3766
|
+
back: () => o((u) => Math.max(u - 1, 0)),
|
|
3759
3767
|
skip: c,
|
|
3760
3768
|
finish: c
|
|
3761
3769
|
};
|
|
3762
3770
|
}
|
|
3763
|
-
function
|
|
3764
|
-
const t =
|
|
3771
|
+
function Zn() {
|
|
3772
|
+
const t = S(null), s = ne(() => {
|
|
3765
3773
|
const n = t.current;
|
|
3766
3774
|
if (!n) return;
|
|
3767
3775
|
n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
|
|
@@ -3774,102 +3782,102 @@ function Xn() {
|
|
|
3774
3782
|
}
|
|
3775
3783
|
export {
|
|
3776
3784
|
He as Accordion,
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3785
|
+
Ws as Alert,
|
|
3786
|
+
Sn as AnimatedNumber,
|
|
3787
|
+
sn as Avatar,
|
|
3780
3788
|
he as Badge,
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3789
|
+
Tn as Banner,
|
|
3790
|
+
Cs as BottomSheet,
|
|
3791
|
+
pn as Breadcrumb,
|
|
3792
|
+
qs as BrowserPane,
|
|
3793
|
+
Gs as BrowserTabs,
|
|
3786
3794
|
de as Button,
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3795
|
+
Ds as Card,
|
|
3796
|
+
Fn as ChatMessage,
|
|
3797
|
+
en as Checkbox,
|
|
3798
|
+
Xn as Coachmark,
|
|
3799
|
+
Us as Code,
|
|
3800
|
+
Vt as CodeAccordion,
|
|
3801
|
+
Hn as ConfidenceBar,
|
|
3802
|
+
us as CopyButton,
|
|
3803
|
+
Vn as DiffView,
|
|
3804
|
+
$n as Dropdown,
|
|
3805
|
+
un as EmptyState,
|
|
3806
|
+
Gn as EngineerGrid,
|
|
3807
|
+
fn as FormField,
|
|
3808
|
+
Ls as H1,
|
|
3809
|
+
Ps as H2,
|
|
3810
|
+
Ms as H3,
|
|
3811
|
+
Fs as H4,
|
|
3812
|
+
An as InView,
|
|
3813
|
+
Ss as Input,
|
|
3814
|
+
Hs as Link,
|
|
3815
|
+
Ks as List,
|
|
3816
|
+
Xs as ListRow,
|
|
3817
|
+
Rs as LocaleProvider,
|
|
3818
|
+
Zs as Mention,
|
|
3819
|
+
bs as MessageFeedback,
|
|
3820
|
+
Yn as MessageFooter,
|
|
3821
|
+
Os as Modal,
|
|
3814
3822
|
xe as ModalFooter,
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3823
|
+
On as ModelPicker,
|
|
3824
|
+
vn as NavRail,
|
|
3825
|
+
kn as NavRailAgent,
|
|
3826
|
+
_n as NavRailBody,
|
|
3827
|
+
yn as NavRailCustomItem,
|
|
3828
|
+
wn as NavRailDivider,
|
|
3829
|
+
En as NavRailFlyout,
|
|
3830
|
+
Nn as NavRailFooter,
|
|
3831
|
+
jn as NavRailHeader,
|
|
3832
|
+
bn as NavRailItem,
|
|
3833
|
+
gn as NavRailRecents,
|
|
3834
|
+
zs as P1,
|
|
3835
|
+
Wt as P2,
|
|
3836
|
+
mt as P3,
|
|
3837
|
+
hn as Pagination,
|
|
3838
|
+
Rn as ProgressBar,
|
|
3839
|
+
Wn as PromptInput,
|
|
3840
|
+
tn as Radio,
|
|
3841
|
+
Ln as ReasoningBlock,
|
|
3842
|
+
Kn as Scrollable,
|
|
3843
|
+
Js as SegmentedControl,
|
|
3844
|
+
Bs as Select,
|
|
3845
|
+
xn as SidePage,
|
|
3846
|
+
tt as SidePageFooter,
|
|
3847
|
+
Xt as Skeleton,
|
|
3848
|
+
Cn as SourcesPanel,
|
|
3849
|
+
Ft as Spinner,
|
|
3850
|
+
mn as Stat,
|
|
3851
|
+
Pn as StepIndicator,
|
|
3852
|
+
Is as Stepper,
|
|
3853
|
+
Mn as StreamingText,
|
|
3854
|
+
Ys as Tab,
|
|
3855
|
+
nn as Table,
|
|
3856
|
+
on as TableBody,
|
|
3857
|
+
rn as TableHead,
|
|
3858
|
+
an as TableRow,
|
|
3859
|
+
ln as TableSubheaderRow,
|
|
3860
|
+
Vs as Tabs,
|
|
3861
|
+
dn as Td,
|
|
3862
|
+
As as Textarea,
|
|
3863
|
+
cn as Th,
|
|
3864
|
+
qn as ThinkingDot,
|
|
3865
|
+
In as ToastContainer,
|
|
3866
|
+
Qs as Toggle,
|
|
3867
|
+
Un as TokenCounter,
|
|
3868
|
+
Dn as ToolCallBubble,
|
|
3869
|
+
Dn as ToolCallCard,
|
|
3862
3870
|
Ve as Tooltip,
|
|
3863
3871
|
$e as defaultStrings,
|
|
3864
|
-
|
|
3872
|
+
ft as formatString,
|
|
3865
3873
|
q as iconSizes,
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3874
|
+
os as useAnimatedNumber,
|
|
3875
|
+
fs as useAnimatedPlaceholder,
|
|
3876
|
+
Jn as useCoachmark,
|
|
3877
|
+
as as useInView,
|
|
3870
3878
|
be as useLocale,
|
|
3871
|
-
|
|
3872
|
-
|
|
3879
|
+
Zn as useShake,
|
|
3880
|
+
zn as useStreamScroll,
|
|
3873
3881
|
K as useStrings,
|
|
3874
|
-
|
|
3882
|
+
Bn as useToast
|
|
3875
3883
|
};
|