@donkit-ai/design-system 1.4.10 → 1.4.13
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/dist/index.cjs.js +3 -3
- package/dist/index.d.ts +9 -9
- package/dist/index.es.js +651 -664
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import K, { useState as
|
|
2
|
-
import { Check as Ne, X as
|
|
1
|
+
import K, { useState as D, useRef as E, useEffect as M, useLayoutEffect as Ve } from "react";
|
|
2
|
+
import { Check as Ne, X as re, ChevronDown as he, Minus as Ye, Plus as He, XCircle as we, AlertTriangle as ge, CheckCircle as ye, Info as ke, ChevronUp as qe, ChevronsUpDown as Ke, ChevronLeft as Xe, ChevronRight as Ge, Copy as Je, Brain as Ze, Loader as Qe, Paperclip as Re, Square as es, ArrowUp as ss, Zap as ts, Cpu as Se, FileText as ns, ThumbsUp as rs, ThumbsDown as as } from "lucide-react";
|
|
3
3
|
import pe from "react-dom";
|
|
4
4
|
const I = {
|
|
5
5
|
1: 16,
|
|
@@ -8,7 +8,7 @@ const I = {
|
|
|
8
8
|
4: 28,
|
|
9
9
|
5: 48
|
|
10
10
|
};
|
|
11
|
-
var
|
|
11
|
+
var je = { exports: {} }, ue = {};
|
|
12
12
|
/**
|
|
13
13
|
* @license React
|
|
14
14
|
* react-jsx-runtime.production.js
|
|
@@ -18,27 +18,27 @@ var _e = { exports: {} }, ue = {};
|
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
21
|
+
var De;
|
|
22
22
|
function is() {
|
|
23
|
-
if (
|
|
24
|
-
|
|
23
|
+
if (De) return ue;
|
|
24
|
+
De = 1;
|
|
25
25
|
var s = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
26
|
-
function
|
|
26
|
+
function n(i, a, r) {
|
|
27
27
|
var o = null;
|
|
28
|
-
if (
|
|
29
|
-
|
|
28
|
+
if (r !== void 0 && (o = "" + r), a.key !== void 0 && (o = "" + a.key), "key" in a) {
|
|
29
|
+
r = {};
|
|
30
30
|
for (var l in a)
|
|
31
|
-
l !== "key" && (
|
|
32
|
-
} else
|
|
33
|
-
return a =
|
|
31
|
+
l !== "key" && (r[l] = a[l]);
|
|
32
|
+
} else r = a;
|
|
33
|
+
return a = r.ref, {
|
|
34
34
|
$$typeof: s,
|
|
35
35
|
type: i,
|
|
36
36
|
key: o,
|
|
37
37
|
ref: a !== void 0 ? a : null,
|
|
38
|
-
props:
|
|
38
|
+
props: r
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
return ue.Fragment = t, ue.jsx =
|
|
41
|
+
return ue.Fragment = t, ue.jsx = n, ue.jsxs = n, ue;
|
|
42
42
|
}
|
|
43
43
|
var fe = {};
|
|
44
44
|
/**
|
|
@@ -50,9 +50,9 @@ var fe = {};
|
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
|
-
var
|
|
53
|
+
var Ae;
|
|
54
54
|
function os() {
|
|
55
|
-
return
|
|
55
|
+
return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function s(c) {
|
|
57
57
|
if (c == null) return null;
|
|
58
58
|
if (typeof c == "function")
|
|
@@ -65,7 +65,7 @@ function os() {
|
|
|
65
65
|
return "Profiler";
|
|
66
66
|
case R:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case A:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case Y:
|
|
71
71
|
return "SuspenseList";
|
|
@@ -76,7 +76,7 @@ function os() {
|
|
|
76
76
|
switch (typeof c.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
|
), c.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case b:
|
|
80
80
|
return "Portal";
|
|
81
81
|
case $:
|
|
82
82
|
return c.displayName || "Context";
|
|
@@ -99,7 +99,7 @@ function os() {
|
|
|
99
99
|
function t(c) {
|
|
100
100
|
return "" + c;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function n(c) {
|
|
103
103
|
try {
|
|
104
104
|
t(c);
|
|
105
105
|
var w = !1;
|
|
@@ -128,10 +128,10 @@ function os() {
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function a() {
|
|
131
|
-
var c =
|
|
131
|
+
var c = X.A;
|
|
132
132
|
return c === null ? null : c.getOwner();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function r() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function o(c) {
|
|
@@ -159,10 +159,10 @@ function os() {
|
|
|
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
|
)), c = this.props.ref, c !== void 0 ? c : null;
|
|
161
161
|
}
|
|
162
|
-
function d(c, w, z, F, te,
|
|
162
|
+
function d(c, w, z, F, te, ae) {
|
|
163
163
|
var W = z.ref;
|
|
164
164
|
return c = {
|
|
165
|
-
$$typeof:
|
|
165
|
+
$$typeof: _,
|
|
166
166
|
type: c,
|
|
167
167
|
key: w,
|
|
168
168
|
props: z,
|
|
@@ -189,10 +189,10 @@ function os() {
|
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
191
191
|
writable: !0,
|
|
192
|
-
value:
|
|
192
|
+
value: ae
|
|
193
193
|
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
194
194
|
}
|
|
195
|
-
function f(c, w, z, F, te,
|
|
195
|
+
function f(c, w, z, F, te, ae) {
|
|
196
196
|
var W = w.children;
|
|
197
197
|
if (W !== void 0)
|
|
198
198
|
if (F)
|
|
@@ -223,10 +223,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
223
|
W
|
|
224
224
|
), g[W + F] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (W = null, z !== void 0 && (
|
|
226
|
+
if (W = null, z !== void 0 && (n(z), W = "" + z), o(w) && (n(w.key), W = "" + w.key), "key" in w) {
|
|
227
227
|
z = {};
|
|
228
|
-
for (var
|
|
229
|
-
|
|
228
|
+
for (var ie in w)
|
|
229
|
+
ie !== "key" && (z[ie] = w[ie]);
|
|
230
230
|
} else z = w;
|
|
231
231
|
return W && l(
|
|
232
232
|
z,
|
|
@@ -237,16 +237,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
237
237
|
z,
|
|
238
238
|
a(),
|
|
239
239
|
te,
|
|
240
|
-
|
|
240
|
+
ae
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(c) {
|
|
244
244
|
h(c) ? c._store && (c._store.validated = 1) : typeof c == "object" && c !== null && c.$$typeof === P && (c._payload.status === "fulfilled" ? h(c._payload.value) && c._payload.value._store && (c._payload.value._store.validated = 1) : c._store && (c._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(c) {
|
|
247
|
-
return typeof c == "object" && c !== null && c.$$typeof ===
|
|
247
|
+
return typeof c == "object" && c !== null && c.$$typeof === _;
|
|
248
248
|
}
|
|
249
|
-
var u = K,
|
|
249
|
+
var u = K, _ = Symbol.for("react.transitional.element"), b = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), y = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), Y = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), X = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, x = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
u = {
|
|
@@ -256,38 +256,38 @@ React keys must be passed directly to JSX without using spread:
|
|
|
256
256
|
};
|
|
257
257
|
var k, L = {}, H = u.react_stack_bottom_frame.bind(
|
|
258
258
|
u,
|
|
259
|
-
|
|
260
|
-
)(),
|
|
259
|
+
r
|
|
260
|
+
)(), G = v(i(r)), g = {};
|
|
261
261
|
fe.Fragment = S, fe.jsx = function(c, w, z) {
|
|
262
|
-
var F = 1e4 >
|
|
262
|
+
var F = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return f(
|
|
264
264
|
c,
|
|
265
265
|
w,
|
|
266
266
|
z,
|
|
267
267
|
!1,
|
|
268
268
|
F ? Error("react-stack-top-frame") : H,
|
|
269
|
-
F ? v(i(c)) :
|
|
269
|
+
F ? v(i(c)) : G
|
|
270
270
|
);
|
|
271
271
|
}, fe.jsxs = function(c, w, z) {
|
|
272
|
-
var F = 1e4 >
|
|
272
|
+
var F = 1e4 > X.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return f(
|
|
274
274
|
c,
|
|
275
275
|
w,
|
|
276
276
|
z,
|
|
277
277
|
!0,
|
|
278
278
|
F ? Error("react-stack-top-frame") : H,
|
|
279
|
-
F ? v(i(c)) :
|
|
279
|
+
F ? v(i(c)) : G
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), fe;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ?
|
|
285
|
-
var e =
|
|
286
|
-
function ls({ size: s = "m", color: t = "default", className:
|
|
284
|
+
process.env.NODE_ENV === "production" ? je.exports = is() : je.exports = os();
|
|
285
|
+
var e = je.exports;
|
|
286
|
+
function ls({ size: s = "m", color: t = "default", className: n = "", ...i }) {
|
|
287
287
|
return /* @__PURE__ */ e.jsx(
|
|
288
288
|
"span",
|
|
289
289
|
{
|
|
290
|
-
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${t}`,
|
|
290
|
+
className: ["ds-spinner", `ds-spinner--${s}`, `ds-spinner--${t}`, n].filter(Boolean).join(" "),
|
|
291
291
|
role: "status",
|
|
292
292
|
"aria-label": "Loading",
|
|
293
293
|
...i
|
|
@@ -298,10 +298,10 @@ const cs = { xs: 12, s: 14, m: 16, l: 20 };
|
|
|
298
298
|
function me({
|
|
299
299
|
children: s,
|
|
300
300
|
variant: t = "primary",
|
|
301
|
-
size:
|
|
301
|
+
size: n = "m",
|
|
302
302
|
fullWidth: i = !1,
|
|
303
303
|
icon: a,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: r = !1,
|
|
305
305
|
state: o = "idle",
|
|
306
306
|
onClick: l,
|
|
307
307
|
type: m = "button",
|
|
@@ -310,20 +310,20 @@ function me({
|
|
|
310
310
|
className: p = "",
|
|
311
311
|
...h
|
|
312
312
|
}) {
|
|
313
|
-
const u = a && !s,
|
|
313
|
+
const u = a && !s, _ = o === "loading", b = o === "success", S = o === "error", R = _ || b || S, B = n === "xs" ? "s" : "m", y = cs[n] ?? 16, $ = _ ? /* @__PURE__ */ e.jsx(ls, { size: B }) : b ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Ne, { size: y, strokeWidth: 2.5 }) }) : S ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(re, { size: y, strokeWidth: 2.5 }) }) : null, O = [
|
|
314
314
|
"ds-button",
|
|
315
315
|
`ds-button--${t}`,
|
|
316
|
-
`ds-button--${
|
|
316
|
+
`ds-button--${n}`,
|
|
317
317
|
i && "ds-button--full",
|
|
318
318
|
u && "ds-button--icon-only",
|
|
319
319
|
p
|
|
320
|
-
].filter(Boolean).join(" "),
|
|
320
|
+
].filter(Boolean).join(" "), A = o !== "idle" ? o : void 0, Y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
321
321
|
R ? $ : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
322
322
|
s
|
|
323
323
|
] });
|
|
324
324
|
if (d) {
|
|
325
325
|
const q = (P) => {
|
|
326
|
-
if (
|
|
326
|
+
if (r || _) {
|
|
327
327
|
P.preventDefault();
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
@@ -333,12 +333,12 @@ function me({
|
|
|
333
333
|
"a",
|
|
334
334
|
{
|
|
335
335
|
className: O,
|
|
336
|
-
href:
|
|
336
|
+
href: r || _ ? void 0 : d,
|
|
337
337
|
onClick: q,
|
|
338
338
|
"aria-label": f,
|
|
339
|
-
"aria-disabled":
|
|
340
|
-
"aria-busy":
|
|
341
|
-
"data-state":
|
|
339
|
+
"aria-disabled": r || _ ? "true" : void 0,
|
|
340
|
+
"aria-busy": _ ? "true" : void 0,
|
|
341
|
+
"data-state": A,
|
|
342
342
|
...h,
|
|
343
343
|
children: Y
|
|
344
344
|
}
|
|
@@ -349,30 +349,30 @@ function me({
|
|
|
349
349
|
{
|
|
350
350
|
type: m,
|
|
351
351
|
className: O,
|
|
352
|
-
disabled:
|
|
353
|
-
onClick:
|
|
352
|
+
disabled: r,
|
|
353
|
+
onClick: _ ? void 0 : l,
|
|
354
354
|
"aria-label": f,
|
|
355
|
-
"aria-busy":
|
|
356
|
-
"data-state":
|
|
355
|
+
"aria-busy": _ ? "true" : void 0,
|
|
356
|
+
"data-state": A,
|
|
357
357
|
...h,
|
|
358
358
|
children: Y
|
|
359
359
|
}
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Us({
|
|
363
363
|
label: s,
|
|
364
364
|
error: t,
|
|
365
|
-
hint:
|
|
365
|
+
hint: n,
|
|
366
366
|
fullWidth: i = !0,
|
|
367
367
|
icon: a,
|
|
368
|
-
iconRight:
|
|
368
|
+
iconRight: r,
|
|
369
369
|
onIconRightClick: o,
|
|
370
370
|
size: l = "m",
|
|
371
371
|
disabled: m,
|
|
372
372
|
id: d,
|
|
373
373
|
...f
|
|
374
374
|
}) {
|
|
375
|
-
const p = d || `input-${K.useId()}`, h =
|
|
375
|
+
const p = d || `input-${K.useId()}`, h = n ? `${p}-hint` : void 0, u = t ? `${p}-error` : void 0, _ = u || h;
|
|
376
376
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${i ? "ds-input-wrapper--full" : ""} ${m ? "ds-input-wrapper--disabled" : ""} ${t ? "ds-input-wrapper--error" : ""}`, children: [
|
|
377
377
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: p, children: s }),
|
|
378
378
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -381,14 +381,14 @@ function Vs({
|
|
|
381
381
|
"input",
|
|
382
382
|
{
|
|
383
383
|
id: p,
|
|
384
|
-
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${
|
|
384
|
+
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${r ? "ds-input--with-icon-right" : ""} ${t ? "ds-input--error" : ""}`,
|
|
385
385
|
disabled: m,
|
|
386
386
|
"aria-invalid": t ? "true" : "false",
|
|
387
|
-
"aria-describedby":
|
|
387
|
+
"aria-describedby": _,
|
|
388
388
|
...f
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
|
|
391
|
+
r && /* @__PURE__ */ e.jsx(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
@@ -396,72 +396,72 @@ function Vs({
|
|
|
396
396
|
onClick: o,
|
|
397
397
|
tabIndex: -1,
|
|
398
398
|
"aria-label": "Toggle visibility",
|
|
399
|
-
children:
|
|
399
|
+
children: r
|
|
400
400
|
}
|
|
401
401
|
)
|
|
402
402
|
] }),
|
|
403
|
-
|
|
403
|
+
n && !t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-input-hint", children: n }),
|
|
404
404
|
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: t && /* @__PURE__ */ e.jsx("span", { id: u, className: "ds-input-error", role: "alert", children: t }) }) })
|
|
405
405
|
] });
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Vs({
|
|
408
408
|
label: s,
|
|
409
409
|
error: t,
|
|
410
|
-
hint:
|
|
410
|
+
hint: n,
|
|
411
411
|
fullWidth: i = !0,
|
|
412
412
|
size: a = "m",
|
|
413
|
-
disabled:
|
|
413
|
+
disabled: r,
|
|
414
414
|
id: o,
|
|
415
415
|
resize: l = !0,
|
|
416
416
|
rows: m = 3,
|
|
417
417
|
...d
|
|
418
418
|
}) {
|
|
419
|
-
const f = o || `textarea-${K.useId()}`, p =
|
|
420
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${
|
|
419
|
+
const f = o || `textarea-${K.useId()}`, p = n ? `${f}-hint` : void 0, h = t ? `${f}-error` : void 0, u = h || p;
|
|
420
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-textarea-wrapper ${i ? "ds-textarea-wrapper--full" : ""} ${r ? "ds-textarea-wrapper--disabled" : ""}`, children: [
|
|
421
421
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-textarea-label", htmlFor: f, children: s }),
|
|
422
422
|
/* @__PURE__ */ e.jsx(
|
|
423
423
|
"textarea",
|
|
424
424
|
{
|
|
425
425
|
id: f,
|
|
426
426
|
className: `ds-textarea ds-textarea--${a} ${t ? "ds-textarea--error" : ""} ${l ? "" : "ds-textarea--no-resize"}`,
|
|
427
|
-
disabled:
|
|
427
|
+
disabled: r,
|
|
428
428
|
"aria-invalid": t ? "true" : "false",
|
|
429
429
|
"aria-describedby": u,
|
|
430
430
|
rows: m,
|
|
431
431
|
...d
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
|
|
434
|
+
n && !t && /* @__PURE__ */ e.jsx("span", { id: p, className: "ds-textarea-hint", children: n }),
|
|
435
435
|
t && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: t })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function Ys({
|
|
439
439
|
label: s,
|
|
440
440
|
value: t,
|
|
441
|
-
onChange:
|
|
441
|
+
onChange: n,
|
|
442
442
|
options: i = [],
|
|
443
443
|
placeholder: a = "Select option",
|
|
444
|
-
error:
|
|
444
|
+
error: r,
|
|
445
445
|
fullWidth: o = !0,
|
|
446
446
|
size: l = "m",
|
|
447
447
|
disabled: m = !1,
|
|
448
448
|
id: d,
|
|
449
449
|
...f
|
|
450
450
|
}) {
|
|
451
|
-
const [p, h] =
|
|
452
|
-
u || (
|
|
451
|
+
const [p, h] = D(!1), [u, _] = D(!1), [b, S] = D({}), [R, B] = D("down"), [y, $] = D(-1), O = E(null), A = E(null), Y = E(null), q = E(null), P = d || `select-${K.useId()}`, N = `${P}-label`, C = r ? `${P}-error` : void 0, X = 150, U = (g = !1) => {
|
|
452
|
+
u || (_(!0), $(-1), q.current = setTimeout(() => {
|
|
453
453
|
var c;
|
|
454
|
-
h(!1),
|
|
455
|
-
},
|
|
454
|
+
h(!1), _(!1), g && ((c = Y.current) == null || c.focus());
|
|
455
|
+
}, X));
|
|
456
456
|
}, x = (g) => {
|
|
457
|
-
clearTimeout(q.current),
|
|
457
|
+
clearTimeout(q.current), _(!1);
|
|
458
458
|
const c = g !== void 0 ? g : Math.max(i.findIndex((w) => w.value === t), 0);
|
|
459
459
|
$(c), h(!0);
|
|
460
460
|
};
|
|
461
461
|
M(() => () => clearTimeout(q.current), []);
|
|
462
462
|
const v = () => {
|
|
463
|
-
var
|
|
464
|
-
const g = (
|
|
463
|
+
var ae;
|
|
464
|
+
const g = (ae = O.current) == null ? void 0 : ae.getBoundingClientRect();
|
|
465
465
|
if (!g) return;
|
|
466
466
|
const c = window.innerHeight, w = c - g.bottom, z = g.top, te = w < 300 && z > w;
|
|
467
467
|
B(te ? "up" : "down"), S(
|
|
@@ -475,13 +475,13 @@ function Hs({
|
|
|
475
475
|
};
|
|
476
476
|
}, [p]), M(() => {
|
|
477
477
|
const g = (c) => {
|
|
478
|
-
O.current && !O.current.contains(c.target) &&
|
|
478
|
+
O.current && !O.current.contains(c.target) && A.current && !A.current.contains(c.target) && U();
|
|
479
479
|
};
|
|
480
480
|
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
481
481
|
}, [u]), M(() => {
|
|
482
482
|
var c;
|
|
483
|
-
if (!p || y < 0 || !
|
|
484
|
-
(c =
|
|
483
|
+
if (!p || y < 0 || !A.current) return;
|
|
484
|
+
(c = A.current.querySelectorAll(".ds-select-option")[y]) == null || c.scrollIntoView({ block: "nearest" });
|
|
485
485
|
}, [y, p]);
|
|
486
486
|
const k = (g) => {
|
|
487
487
|
switch (g.key) {
|
|
@@ -499,7 +499,7 @@ function Hs({
|
|
|
499
499
|
break;
|
|
500
500
|
case "Enter":
|
|
501
501
|
case " ":
|
|
502
|
-
g.preventDefault(), p ? y >= 0 && (
|
|
502
|
+
g.preventDefault(), p ? y >= 0 && (n == null || n(i[y].value), U(!0)) : x();
|
|
503
503
|
break;
|
|
504
504
|
case "Escape":
|
|
505
505
|
p && (g.preventDefault(), U(!0));
|
|
@@ -508,10 +508,10 @@ function Hs({
|
|
|
508
508
|
p && U(!1);
|
|
509
509
|
break;
|
|
510
510
|
}
|
|
511
|
-
}, L = i.find((g) => g.value === t), H = l === "xs" ? I[1] : l === "small" ? I[2] : I[3],
|
|
511
|
+
}, L = i.find((g) => g.value === t), H = l === "xs" ? I[1] : l === "small" ? I[2] : I[3], G = p && /* @__PURE__ */ e.jsx(
|
|
512
512
|
"div",
|
|
513
513
|
{
|
|
514
|
-
ref:
|
|
514
|
+
ref: A,
|
|
515
515
|
role: "listbox",
|
|
516
516
|
"aria-labelledby": s ? N : void 0,
|
|
517
517
|
tabIndex: -1,
|
|
@@ -521,7 +521,7 @@ function Hs({
|
|
|
521
521
|
`ds-select-dropdown--${R}`,
|
|
522
522
|
u && "ds-select-dropdown--closing"
|
|
523
523
|
].filter(Boolean).join(" "),
|
|
524
|
-
style:
|
|
524
|
+
style: b,
|
|
525
525
|
children: i.map((g, c) => /* @__PURE__ */ e.jsx(
|
|
526
526
|
"button",
|
|
527
527
|
{
|
|
@@ -537,7 +537,7 @@ function Hs({
|
|
|
537
537
|
c === y && "ds-select-option--active"
|
|
538
538
|
].filter(Boolean).join(" "),
|
|
539
539
|
onClick: () => {
|
|
540
|
-
|
|
540
|
+
n == null || n(g.value), U(!0);
|
|
541
541
|
},
|
|
542
542
|
children: g.label
|
|
543
543
|
},
|
|
@@ -558,9 +558,9 @@ function Hs({
|
|
|
558
558
|
"aria-expanded": p,
|
|
559
559
|
"aria-activedescendant": p && y >= 0 ? `${P}-opt-${y}` : void 0,
|
|
560
560
|
"aria-labelledby": s ? N : void 0,
|
|
561
|
-
"aria-invalid":
|
|
561
|
+
"aria-invalid": r ? "true" : "false",
|
|
562
562
|
"aria-describedby": C,
|
|
563
|
-
className: `ds-select-trigger ds-select-trigger--${l} ${
|
|
563
|
+
className: `ds-select-trigger ds-select-trigger--${l} ${r ? "ds-select-trigger--error" : ""}`,
|
|
564
564
|
onClick: () => {
|
|
565
565
|
m || (p ? U() : x());
|
|
566
566
|
},
|
|
@@ -581,17 +581,17 @@ function Hs({
|
|
|
581
581
|
]
|
|
582
582
|
}
|
|
583
583
|
) }),
|
|
584
|
-
|
|
585
|
-
typeof document < "u" && pe.createPortal(
|
|
584
|
+
r && /* @__PURE__ */ e.jsx("span", { id: C, className: "ds-select-error", role: "alert", children: r }),
|
|
585
|
+
typeof document < "u" && pe.createPortal(G, document.body)
|
|
586
586
|
] });
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function Hs({
|
|
589
589
|
label: s,
|
|
590
590
|
value: t = 0,
|
|
591
|
-
onChange:
|
|
591
|
+
onChange: n,
|
|
592
592
|
min: i = 0,
|
|
593
593
|
max: a = 100,
|
|
594
|
-
step:
|
|
594
|
+
step: r = 1,
|
|
595
595
|
size: o = "m",
|
|
596
596
|
disabled: l = !1,
|
|
597
597
|
hint: m,
|
|
@@ -600,36 +600,36 @@ function qs({
|
|
|
600
600
|
}) {
|
|
601
601
|
const p = () => {
|
|
602
602
|
if (l) return;
|
|
603
|
-
const R = Math.min(Number(t) +
|
|
604
|
-
|
|
603
|
+
const R = Math.min(Number(t) + r, a);
|
|
604
|
+
n == null || n(R);
|
|
605
605
|
}, h = () => {
|
|
606
606
|
if (l) return;
|
|
607
|
-
const R = Math.max(Number(t) -
|
|
608
|
-
|
|
607
|
+
const R = Math.max(Number(t) - r, i);
|
|
608
|
+
n == null || n(R);
|
|
609
609
|
}, u = (R) => {
|
|
610
610
|
if (l) return;
|
|
611
611
|
const B = R.target.value;
|
|
612
612
|
if (B === "") {
|
|
613
|
-
|
|
613
|
+
n == null || n(i);
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
616
|
const y = Number(B);
|
|
617
617
|
if (!isNaN(y)) {
|
|
618
618
|
const $ = Math.min(Math.max(y, i), a);
|
|
619
|
-
|
|
619
|
+
n == null || n($);
|
|
620
620
|
}
|
|
621
|
-
},
|
|
621
|
+
}, _ = [
|
|
622
622
|
"ds-stepper-wrapper",
|
|
623
623
|
l && "ds-stepper-wrapper--disabled",
|
|
624
624
|
d && "ds-stepper-wrapper--error"
|
|
625
|
-
].filter(Boolean).join(" "),
|
|
625
|
+
].filter(Boolean).join(" "), b = [
|
|
626
626
|
"ds-stepper",
|
|
627
627
|
`ds-stepper--${o}`,
|
|
628
628
|
l && "ds-stepper--disabled"
|
|
629
629
|
].filter(Boolean).join(" "), S = o === "xs" ? I[1] : o === "small" ? I[2] : I[3];
|
|
630
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
630
|
+
return /* @__PURE__ */ e.jsxs("div", { className: _, children: [
|
|
631
631
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: s }),
|
|
632
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
632
|
+
/* @__PURE__ */ e.jsxs("div", { className: b, children: [
|
|
633
633
|
/* @__PURE__ */ e.jsx(
|
|
634
634
|
"button",
|
|
635
635
|
{
|
|
@@ -650,7 +650,7 @@ function qs({
|
|
|
650
650
|
onChange: u,
|
|
651
651
|
min: i,
|
|
652
652
|
max: a,
|
|
653
|
-
step:
|
|
653
|
+
step: r,
|
|
654
654
|
disabled: l,
|
|
655
655
|
...f
|
|
656
656
|
}
|
|
@@ -671,35 +671,35 @@ function qs({
|
|
|
671
671
|
d && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: d })
|
|
672
672
|
] });
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function qs({
|
|
675
675
|
children: s,
|
|
676
676
|
padding: t = "m",
|
|
677
|
-
variant:
|
|
677
|
+
variant: n = "info",
|
|
678
678
|
hover: i = !1,
|
|
679
679
|
// deprecated, use variant="interactive"
|
|
680
680
|
onClick: a,
|
|
681
|
-
href:
|
|
681
|
+
href: r,
|
|
682
682
|
disabled: o = !1,
|
|
683
683
|
...l
|
|
684
684
|
}) {
|
|
685
|
-
const d = (i ? "interactive" :
|
|
685
|
+
const d = (i ? "interactive" : n) === "interactive" || a || r, f = [
|
|
686
686
|
"ds-card",
|
|
687
687
|
`ds-card--${t}`,
|
|
688
688
|
d && "ds-card--interactive"
|
|
689
689
|
].filter(Boolean).join(" ");
|
|
690
|
-
if (
|
|
691
|
-
const u = (
|
|
690
|
+
if (r) {
|
|
691
|
+
const u = (_) => {
|
|
692
692
|
if (o) {
|
|
693
|
-
|
|
693
|
+
_.preventDefault();
|
|
694
694
|
return;
|
|
695
695
|
}
|
|
696
|
-
|
|
696
|
+
_.metaKey || _.ctrlKey || _.button === 1 || (_.preventDefault(), a == null || a(_));
|
|
697
697
|
};
|
|
698
698
|
return /* @__PURE__ */ e.jsx(
|
|
699
699
|
"a",
|
|
700
700
|
{
|
|
701
701
|
className: f,
|
|
702
|
-
href: o ? void 0 :
|
|
702
|
+
href: o ? void 0 : r,
|
|
703
703
|
onClick: u,
|
|
704
704
|
"aria-disabled": o ? "true" : void 0,
|
|
705
705
|
...l,
|
|
@@ -723,40 +723,40 @@ function Ks({
|
|
|
723
723
|
}
|
|
724
724
|
);
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function Ks({ children: s, ...t }) {
|
|
727
727
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...t, children: s });
|
|
728
728
|
}
|
|
729
729
|
function Xs({ children: s, ...t }) {
|
|
730
730
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...t, children: s });
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function Gs({ children: s, ...t }) {
|
|
733
733
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...t, children: s });
|
|
734
734
|
}
|
|
735
|
-
function
|
|
735
|
+
function Js({ children: s, ...t }) {
|
|
736
736
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...t, children: s });
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...
|
|
738
|
+
function Zs({ children: s, secondary: t = !1, ...n }) {
|
|
739
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${t ? "ds-p1--secondary" : ""}`, ...n, children: s });
|
|
740
740
|
}
|
|
741
|
-
function ds({ children: s, secondary: t = !1, ...
|
|
742
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...
|
|
741
|
+
function ds({ children: s, secondary: t = !1, ...n }) {
|
|
742
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${t ? "ds-p2--secondary" : ""}`, ...n, children: s });
|
|
743
743
|
}
|
|
744
|
-
function Fe({ children: s, secondary: t = !1, ...
|
|
745
|
-
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...
|
|
744
|
+
function Fe({ children: s, secondary: t = !1, ...n }) {
|
|
745
|
+
return /* @__PURE__ */ e.jsx("p", { className: `ds-p3 ${t ? "ds-p3--secondary" : ""}`, ...n, children: s });
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function ce({
|
|
748
748
|
children: s,
|
|
749
749
|
variant: t = "default",
|
|
750
|
-
size:
|
|
750
|
+
size: n = "m",
|
|
751
751
|
role: i,
|
|
752
752
|
...a
|
|
753
753
|
}) {
|
|
754
|
-
const
|
|
754
|
+
const r = [
|
|
755
755
|
"ds-badge",
|
|
756
756
|
`ds-badge--${t}`,
|
|
757
|
-
`ds-badge--${
|
|
757
|
+
`ds-badge--${n}`
|
|
758
758
|
].filter(Boolean).join(" "), o = i || (["info", "success", "warning", "error"].includes(t) ? "status" : void 0);
|
|
759
|
-
return /* @__PURE__ */ e.jsx("span", { className:
|
|
759
|
+
return /* @__PURE__ */ e.jsx("span", { className: r, role: o, ...a, children: s });
|
|
760
760
|
}
|
|
761
761
|
const us = {
|
|
762
762
|
info: ke,
|
|
@@ -764,19 +764,19 @@ const us = {
|
|
|
764
764
|
warning: ge,
|
|
765
765
|
error: we
|
|
766
766
|
};
|
|
767
|
-
function
|
|
767
|
+
function Qs({
|
|
768
768
|
children: s,
|
|
769
769
|
variant: t = "info",
|
|
770
|
-
title:
|
|
770
|
+
title: n,
|
|
771
771
|
onClose: i,
|
|
772
772
|
role: a,
|
|
773
|
-
...
|
|
773
|
+
...r
|
|
774
774
|
}) {
|
|
775
775
|
const o = us[t], l = a || (t === "error" ? "alert" : "status");
|
|
776
|
-
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${
|
|
776
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `ds-alert ds-alert--${t} ${n ? "" : "ds-alert--no-title"}`, role: l, ...r, children: [
|
|
777
777
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(o, { size: I[3], strokeWidth: 1.5 }) }),
|
|
778
778
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
779
|
-
|
|
779
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__title", children: n }),
|
|
780
780
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__message", children: s })
|
|
781
781
|
] }),
|
|
782
782
|
i && /* @__PURE__ */ e.jsx(
|
|
@@ -786,52 +786,52 @@ function et({
|
|
|
786
786
|
className: "ds-alert__close",
|
|
787
787
|
onClick: i,
|
|
788
788
|
"aria-label": "Close alert",
|
|
789
|
-
children: /* @__PURE__ */ e.jsx(
|
|
789
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[3], strokeWidth: 1.5 })
|
|
790
790
|
}
|
|
791
791
|
)
|
|
792
792
|
] });
|
|
793
793
|
}
|
|
794
794
|
const fs = 200;
|
|
795
|
-
function
|
|
795
|
+
function et({
|
|
796
796
|
children: s,
|
|
797
797
|
title: t,
|
|
798
|
-
onClose:
|
|
798
|
+
onClose: n,
|
|
799
799
|
size: i = "m",
|
|
800
800
|
...a
|
|
801
801
|
}) {
|
|
802
|
-
const
|
|
803
|
-
!
|
|
804
|
-
m(!1),
|
|
802
|
+
const r = E(null), o = K.useId(), [l, m] = D(!1), d = () => {
|
|
803
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
804
|
+
m(!1), n();
|
|
805
805
|
}, fs));
|
|
806
806
|
};
|
|
807
807
|
M(() => {
|
|
808
|
-
const u = (
|
|
809
|
-
|
|
810
|
-
},
|
|
811
|
-
|
|
808
|
+
const u = (b) => {
|
|
809
|
+
b.key === "Escape" && d();
|
|
810
|
+
}, _ = (b) => {
|
|
811
|
+
r.current && !r.current.contains(b.target) && d();
|
|
812
812
|
};
|
|
813
|
-
return document.addEventListener("keydown", u), document.addEventListener("mousedown",
|
|
814
|
-
document.removeEventListener("keydown", u), document.removeEventListener("mousedown",
|
|
813
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", _), () => {
|
|
814
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", _);
|
|
815
815
|
};
|
|
816
|
-
}, [
|
|
816
|
+
}, [n, l]);
|
|
817
817
|
const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Ie), h = f.filter((u) => (u == null ? void 0 : u.type) !== Ie);
|
|
818
818
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-modal-overlay", l && "ds-modal-overlay--closing"].filter(Boolean).join(" "), ...a, children: /* @__PURE__ */ e.jsxs(
|
|
819
819
|
"div",
|
|
820
820
|
{
|
|
821
821
|
className: `ds-modal ds-modal--${i}`,
|
|
822
|
-
ref:
|
|
822
|
+
ref: r,
|
|
823
823
|
role: "dialog",
|
|
824
824
|
"aria-modal": "true",
|
|
825
825
|
"aria-labelledby": t ? o : void 0,
|
|
826
826
|
children: [
|
|
827
|
-
(t ||
|
|
827
|
+
(t || n) && /* @__PURE__ */ e.jsxs("div", { className: "ds-modal__header", children: [
|
|
828
828
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-modal__title", children: t }),
|
|
829
|
-
|
|
829
|
+
n && /* @__PURE__ */ e.jsx(
|
|
830
830
|
me,
|
|
831
831
|
{
|
|
832
832
|
variant: "ghost",
|
|
833
833
|
size: "small",
|
|
834
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
834
|
+
icon: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 }),
|
|
835
835
|
onClick: d,
|
|
836
836
|
"aria-label": "Close modal"
|
|
837
837
|
}
|
|
@@ -849,18 +849,18 @@ function Ie({ children: s }) {
|
|
|
849
849
|
function ms({
|
|
850
850
|
children: s,
|
|
851
851
|
title: t = "Code",
|
|
852
|
-
defaultExpanded:
|
|
852
|
+
defaultExpanded: n = !1,
|
|
853
853
|
expanded: i,
|
|
854
854
|
onToggle: a,
|
|
855
|
-
padding:
|
|
855
|
+
padding: r = "s",
|
|
856
856
|
className: o = "",
|
|
857
857
|
...l
|
|
858
858
|
}) {
|
|
859
|
-
const [m, d] =
|
|
860
|
-
f ? a == null || a(!i) : d((
|
|
859
|
+
const [m, d] = D(n), f = i !== void 0, p = f ? i : m, h = () => {
|
|
860
|
+
f ? a == null || a(!i) : d((_) => !_);
|
|
861
861
|
}, u = [
|
|
862
862
|
"ds-code-accordion",
|
|
863
|
-
`ds-code-accordion--${
|
|
863
|
+
`ds-code-accordion--${r}`,
|
|
864
864
|
p && "ds-code-accordion--expanded",
|
|
865
865
|
o
|
|
866
866
|
].filter(Boolean).join(" ");
|
|
@@ -888,28 +888,28 @@ function ms({
|
|
|
888
888
|
/* @__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", children: /* @__PURE__ */ e.jsx("code", { children: s }) }) }) })
|
|
889
889
|
] });
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
return t ?
|
|
891
|
+
function st({ children: s, block: t = !1, collapsible: n = !1, title: i = "Code", defaultExpanded: a = !1, ...r }) {
|
|
892
|
+
return t ? n ? /* @__PURE__ */ e.jsx(ms, { title: i, defaultExpanded: a, ...r, children: s }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block", ...r, children: /* @__PURE__ */ e.jsx("code", { children: s }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...r, children: s });
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function tt({ href: s, children: t, onClick: n, target: i, rel: a, ...r }) {
|
|
895
895
|
const l = i === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
896
896
|
return /* @__PURE__ */ e.jsx(
|
|
897
897
|
"a",
|
|
898
898
|
{
|
|
899
899
|
href: s,
|
|
900
900
|
className: "ds-link",
|
|
901
|
-
onClick:
|
|
901
|
+
onClick: n,
|
|
902
902
|
target: i,
|
|
903
903
|
rel: l,
|
|
904
|
-
...
|
|
904
|
+
...r,
|
|
905
905
|
children: t
|
|
906
906
|
}
|
|
907
907
|
);
|
|
908
908
|
}
|
|
909
|
-
function nt({ children: s, size: t = "m", variant:
|
|
910
|
-
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant:
|
|
909
|
+
function nt({ children: s, size: t = "m", variant: n = "ghost", ...i }) {
|
|
910
|
+
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...i, children: K.Children.map(s, (a) => K.isValidElement(a) ? K.cloneElement(a, { size: t, variant: n }) : a) });
|
|
911
911
|
}
|
|
912
|
-
function
|
|
912
|
+
function rt({ children: s, selected: t = !1, onClick: n, size: i = "m", variant: a = "ghost", disabled: r = !1, icon: o, href: l, ...m }) {
|
|
913
913
|
const d = o && !s, f = [
|
|
914
914
|
"ds-tab",
|
|
915
915
|
`ds-tab--${i}`,
|
|
@@ -922,20 +922,20 @@ function at({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
922
922
|
] });
|
|
923
923
|
if (l) {
|
|
924
924
|
const h = (u) => {
|
|
925
|
-
if (
|
|
925
|
+
if (r) {
|
|
926
926
|
u.preventDefault();
|
|
927
927
|
return;
|
|
928
928
|
}
|
|
929
|
-
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(),
|
|
929
|
+
u.metaKey || u.ctrlKey || u.button === 1 || (u.preventDefault(), n == null || n(u));
|
|
930
930
|
};
|
|
931
931
|
return /* @__PURE__ */ e.jsx(
|
|
932
932
|
"a",
|
|
933
933
|
{
|
|
934
934
|
role: "tab",
|
|
935
935
|
"aria-current": t ? "page" : void 0,
|
|
936
|
-
"aria-disabled":
|
|
936
|
+
"aria-disabled": r ? "true" : void 0,
|
|
937
937
|
className: f,
|
|
938
|
-
href:
|
|
938
|
+
href: r ? void 0 : l,
|
|
939
939
|
onClick: h,
|
|
940
940
|
...m,
|
|
941
941
|
children: p
|
|
@@ -948,24 +948,24 @@ function at({ children: s, selected: t = !1, onClick: r, size: i = "m", variant:
|
|
|
948
948
|
role: "tab",
|
|
949
949
|
"aria-selected": t,
|
|
950
950
|
className: f,
|
|
951
|
-
onClick:
|
|
952
|
-
disabled:
|
|
951
|
+
onClick: n,
|
|
952
|
+
disabled: r,
|
|
953
953
|
...m,
|
|
954
954
|
children: p
|
|
955
955
|
}
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
if (!
|
|
961
|
-
const u =
|
|
958
|
+
function at({ options: s, value: t, onChange: n, size: i = "m", disabled: a = !1 }) {
|
|
959
|
+
const r = E(null), o = E(null), [l, m] = D(!1), d = E(!1), f = E(null), p = E(null), h = () => {
|
|
960
|
+
if (!r.current) return;
|
|
961
|
+
const u = r.current.querySelector(`[data-value="${t}"]`);
|
|
962
962
|
if (!u) return;
|
|
963
|
-
const
|
|
963
|
+
const _ = r.current.getBoundingClientRect(), b = u.getBoundingClientRect(), S = b.left - _.left, R = b.width;
|
|
964
964
|
o.current ? (o.current.style.transition = d.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", o.current.style.left = S + "px", o.current.style.width = R + "px", d.current = !1) : (m(!0), requestAnimationFrame(() => {
|
|
965
|
-
if (!o.current || !
|
|
966
|
-
const B =
|
|
965
|
+
if (!o.current || !r.current) return;
|
|
966
|
+
const B = r.current.querySelector(`[data-value="${t}"]`);
|
|
967
967
|
if (!B) return;
|
|
968
|
-
const y =
|
|
968
|
+
const y = r.current.getBoundingClientRect(), $ = B.getBoundingClientRect();
|
|
969
969
|
o.current.style.transition = "none", o.current.style.left = $.left - y.left + "px", o.current.style.width = $.width + "px";
|
|
970
970
|
}));
|
|
971
971
|
};
|
|
@@ -973,11 +973,11 @@ function it({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
973
973
|
const u = f.current !== t;
|
|
974
974
|
f.current = t, d.current = l && u, h();
|
|
975
975
|
}), M(() => {
|
|
976
|
-
if (!
|
|
976
|
+
if (!r.current) return;
|
|
977
977
|
const u = new ResizeObserver(() => {
|
|
978
978
|
d.current = !1, p.current();
|
|
979
979
|
});
|
|
980
|
-
return u.observe(
|
|
980
|
+
return u.observe(r.current), () => u.disconnect();
|
|
981
981
|
}, []), /* @__PURE__ */ e.jsxs(
|
|
982
982
|
"div",
|
|
983
983
|
{
|
|
@@ -986,7 +986,7 @@ function it({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
986
986
|
`ds-seg--${i}`,
|
|
987
987
|
a && "ds-seg--disabled"
|
|
988
988
|
].filter(Boolean).join(" "),
|
|
989
|
-
ref:
|
|
989
|
+
ref: r,
|
|
990
990
|
role: "group",
|
|
991
991
|
children: [
|
|
992
992
|
l && /* @__PURE__ */ e.jsx(
|
|
@@ -1003,7 +1003,7 @@ function it({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
1003
1003
|
type: "button",
|
|
1004
1004
|
"data-value": u.value,
|
|
1005
1005
|
className: ["ds-seg__btn", t === u.value && "ds-seg__btn--active"].filter(Boolean).join(" "),
|
|
1006
|
-
onClick: () => !a &&
|
|
1006
|
+
onClick: () => !a && n(u.value),
|
|
1007
1007
|
"aria-pressed": t === u.value,
|
|
1008
1008
|
disabled: a,
|
|
1009
1009
|
children: [
|
|
@@ -1020,17 +1020,17 @@ function it({ options: s, value: t, onChange: r, size: i = "m", disabled: a = !1
|
|
|
1020
1020
|
function Ee({
|
|
1021
1021
|
children: s,
|
|
1022
1022
|
title: t,
|
|
1023
|
-
defaultExpanded:
|
|
1023
|
+
defaultExpanded: n = !1,
|
|
1024
1024
|
expanded: i,
|
|
1025
1025
|
onToggle: a,
|
|
1026
|
-
padding:
|
|
1026
|
+
padding: r = "m",
|
|
1027
1027
|
...o
|
|
1028
1028
|
}) {
|
|
1029
|
-
const [l, m] =
|
|
1029
|
+
const [l, m] = D(n), d = i !== void 0, f = d ? i : l, p = () => {
|
|
1030
1030
|
d ? a == null || a(!i) : m((u) => !u);
|
|
1031
1031
|
}, h = [
|
|
1032
1032
|
"ds-accordion",
|
|
1033
|
-
`ds-accordion--${
|
|
1033
|
+
`ds-accordion--${r}`,
|
|
1034
1034
|
f && "ds-accordion--expanded"
|
|
1035
1035
|
].filter(Boolean).join(" ");
|
|
1036
1036
|
return /* @__PURE__ */ e.jsxs("div", { className: h, ...o, children: [
|
|
@@ -1057,42 +1057,42 @@ function Ee({
|
|
|
1057
1057
|
/* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-inner", children: /* @__PURE__ */ e.jsx("div", { className: "ds-accordion__content-body", children: s }) }) })
|
|
1058
1058
|
] });
|
|
1059
1059
|
}
|
|
1060
|
-
const
|
|
1061
|
-
function ps(s, t,
|
|
1060
|
+
const ne = 8, le = 8;
|
|
1061
|
+
function ps(s, t, n) {
|
|
1062
1062
|
const i = window.innerWidth;
|
|
1063
|
-
let a,
|
|
1063
|
+
let a, r;
|
|
1064
1064
|
switch (s) {
|
|
1065
1065
|
case "top":
|
|
1066
|
-
a = t.top -
|
|
1066
|
+
a = t.top - n.height - ne, r = t.left + t.width / 2 - n.width / 2;
|
|
1067
1067
|
break;
|
|
1068
1068
|
case "bottom":
|
|
1069
|
-
a = t.bottom +
|
|
1069
|
+
a = t.bottom + ne, r = t.left + t.width / 2 - n.width / 2;
|
|
1070
1070
|
break;
|
|
1071
1071
|
case "left":
|
|
1072
|
-
a = t.top + t.height / 2 -
|
|
1072
|
+
a = t.top + t.height / 2 - n.height / 2, r = t.left - n.width - ne;
|
|
1073
1073
|
break;
|
|
1074
1074
|
case "right":
|
|
1075
|
-
a = t.top + t.height / 2 -
|
|
1075
|
+
a = t.top + t.height / 2 - n.height / 2, r = t.right + ne;
|
|
1076
1076
|
break;
|
|
1077
1077
|
default:
|
|
1078
|
-
a = t.bottom +
|
|
1078
|
+
a = t.bottom + ne, r = t.left;
|
|
1079
1079
|
}
|
|
1080
|
-
const o = Math.max(
|
|
1080
|
+
const o = Math.max(le, Math.min(i - n.width - le, r)), l = r - o;
|
|
1081
1081
|
return { top: a, left: o, arrowOffset: l };
|
|
1082
1082
|
}
|
|
1083
|
-
function hs(s, t,
|
|
1083
|
+
function hs(s, t, n) {
|
|
1084
1084
|
const i = window.innerWidth, a = window.innerHeight;
|
|
1085
|
-
if (s.top >= t +
|
|
1086
|
-
if (a - s.bottom >= t +
|
|
1087
|
-
if (i - s.right >=
|
|
1088
|
-
if (s.left >=
|
|
1089
|
-
const
|
|
1090
|
-
return
|
|
1091
|
-
}
|
|
1092
|
-
function
|
|
1093
|
-
const [a,
|
|
1085
|
+
if (s.top >= t + ne + le) return "top";
|
|
1086
|
+
if (a - s.bottom >= t + ne + le) return "bottom";
|
|
1087
|
+
if (i - s.right >= n + ne + le) return "right";
|
|
1088
|
+
if (s.left >= n + ne + le) return "left";
|
|
1089
|
+
const r = Math.max(s.top, a - s.bottom, s.left, i - s.right);
|
|
1090
|
+
return r === s.top ? "top" : r === a - s.bottom ? "bottom" : r === i - s.right ? "right" : "left";
|
|
1091
|
+
}
|
|
1092
|
+
function it({ children: s, content: t, position: n, ...i }) {
|
|
1093
|
+
const [a, r] = D(!1), [o, l] = D({ visibility: "hidden" }), [m, d] = D(n || "top"), f = E(null), p = E(null), h = E(!1), u = () => {
|
|
1094
1094
|
if (!f.current || !p.current) return;
|
|
1095
|
-
const
|
|
1095
|
+
const b = f.current.getBoundingClientRect(), S = p.current.getBoundingClientRect(), R = n || hs(b, S.height, S.width), { top: B, left: y, arrowOffset: $ } = ps(R, b, S);
|
|
1096
1096
|
d(R), l({
|
|
1097
1097
|
position: "fixed",
|
|
1098
1098
|
top: B,
|
|
@@ -1104,18 +1104,18 @@ function ot({ children: s, content: t, position: r, ...i }) {
|
|
|
1104
1104
|
if (M(() => {
|
|
1105
1105
|
if (!a) return;
|
|
1106
1106
|
l({ position: "fixed", visibility: "hidden" });
|
|
1107
|
-
const
|
|
1107
|
+
const b = requestAnimationFrame(u);
|
|
1108
1108
|
return window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1109
|
-
cancelAnimationFrame(
|
|
1109
|
+
cancelAnimationFrame(b), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1110
1110
|
};
|
|
1111
|
-
}, [a,
|
|
1111
|
+
}, [a, n]), M(() => {
|
|
1112
1112
|
if (!a) return;
|
|
1113
|
-
const
|
|
1114
|
-
f.current && !f.current.contains(S.target) &&
|
|
1113
|
+
const b = (S) => {
|
|
1114
|
+
f.current && !f.current.contains(S.target) && r(!1);
|
|
1115
1115
|
};
|
|
1116
|
-
return document.addEventListener("touchstart",
|
|
1116
|
+
return document.addEventListener("touchstart", b), () => document.removeEventListener("touchstart", b);
|
|
1117
1117
|
}, [a]), !t) return s;
|
|
1118
|
-
const
|
|
1118
|
+
const _ = a && /* @__PURE__ */ e.jsx(
|
|
1119
1119
|
"div",
|
|
1120
1120
|
{
|
|
1121
1121
|
ref: p,
|
|
@@ -1131,34 +1131,34 @@ function ot({ children: s, content: t, position: r, ...i }) {
|
|
|
1131
1131
|
ref: f,
|
|
1132
1132
|
className: "ds-tooltip-wrapper",
|
|
1133
1133
|
onMouseEnter: () => {
|
|
1134
|
-
h.current ||
|
|
1134
|
+
h.current || r(!0);
|
|
1135
1135
|
},
|
|
1136
1136
|
onMouseLeave: () => {
|
|
1137
|
-
h.current ||
|
|
1137
|
+
h.current || r(!1);
|
|
1138
1138
|
},
|
|
1139
1139
|
onTouchStart: () => {
|
|
1140
|
-
h.current = !0,
|
|
1140
|
+
h.current = !0, r((b) => !b);
|
|
1141
1141
|
},
|
|
1142
1142
|
...i,
|
|
1143
1143
|
children: [
|
|
1144
1144
|
s,
|
|
1145
|
-
typeof document < "u" && pe.createPortal(
|
|
1145
|
+
typeof document < "u" && pe.createPortal(_, document.body)
|
|
1146
1146
|
]
|
|
1147
1147
|
}
|
|
1148
1148
|
);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1150
|
+
function ot({
|
|
1151
1151
|
checked: s = !1,
|
|
1152
1152
|
onChange: t,
|
|
1153
|
-
size:
|
|
1153
|
+
size: n = "m",
|
|
1154
1154
|
disabled: i = !1,
|
|
1155
1155
|
label: a,
|
|
1156
|
-
id:
|
|
1156
|
+
id: r,
|
|
1157
1157
|
...o
|
|
1158
1158
|
}) {
|
|
1159
|
-
const l =
|
|
1159
|
+
const l = r || `toggle-${K.useId()}`, m = [
|
|
1160
1160
|
"ds-toggle",
|
|
1161
|
-
`ds-toggle--${
|
|
1161
|
+
`ds-toggle--${n}`,
|
|
1162
1162
|
i && "ds-toggle--disabled"
|
|
1163
1163
|
].filter(Boolean).join(" ");
|
|
1164
1164
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
@@ -1178,20 +1178,20 @@ function lt({
|
|
|
1178
1178
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
|
|
1179
1179
|
] });
|
|
1180
1180
|
}
|
|
1181
|
-
function
|
|
1181
|
+
function lt({
|
|
1182
1182
|
checked: s = !1,
|
|
1183
1183
|
onChange: t,
|
|
1184
|
-
size:
|
|
1184
|
+
size: n = "m",
|
|
1185
1185
|
disabled: i = !1,
|
|
1186
1186
|
label: a,
|
|
1187
|
-
id:
|
|
1187
|
+
id: r,
|
|
1188
1188
|
...o
|
|
1189
1189
|
}) {
|
|
1190
|
-
const l =
|
|
1190
|
+
const l = r || `checkbox-${K.useId()}`, m = [
|
|
1191
1191
|
"ds-checkbox",
|
|
1192
|
-
`ds-checkbox--${
|
|
1192
|
+
`ds-checkbox--${n}`,
|
|
1193
1193
|
i && "ds-checkbox--disabled"
|
|
1194
|
-
].filter(Boolean).join(" "), d =
|
|
1194
|
+
].filter(Boolean).join(" "), d = n === "xs" ? 10 : n === "small" ? 14 : n === "large" ? 20 : 16;
|
|
1195
1195
|
return /* @__PURE__ */ e.jsxs("label", { className: m, htmlFor: l, children: [
|
|
1196
1196
|
/* @__PURE__ */ e.jsx(
|
|
1197
1197
|
"input",
|
|
@@ -1216,20 +1216,20 @@ function ct({
|
|
|
1216
1216
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
|
|
1217
1217
|
] });
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function ct({
|
|
1220
1220
|
checked: s = !1,
|
|
1221
1221
|
onChange: t,
|
|
1222
|
-
size:
|
|
1222
|
+
size: n = "m",
|
|
1223
1223
|
disabled: i = !1,
|
|
1224
1224
|
label: a,
|
|
1225
|
-
name:
|
|
1225
|
+
name: r,
|
|
1226
1226
|
value: o,
|
|
1227
1227
|
id: l,
|
|
1228
1228
|
...m
|
|
1229
1229
|
}) {
|
|
1230
1230
|
const d = l || `radio-${K.useId()}`, f = [
|
|
1231
1231
|
"ds-radio",
|
|
1232
|
-
`ds-radio--${
|
|
1232
|
+
`ds-radio--${n}`,
|
|
1233
1233
|
i && "ds-radio--disabled"
|
|
1234
1234
|
].filter(Boolean).join(" ");
|
|
1235
1235
|
return /* @__PURE__ */ e.jsxs("label", { className: f, htmlFor: d, children: [
|
|
@@ -1242,7 +1242,7 @@ function dt({
|
|
|
1242
1242
|
checked: s,
|
|
1243
1243
|
onChange: (p) => t == null ? void 0 : t(p.target.checked),
|
|
1244
1244
|
disabled: i,
|
|
1245
|
-
name:
|
|
1245
|
+
name: r,
|
|
1246
1246
|
value: o,
|
|
1247
1247
|
...m
|
|
1248
1248
|
}
|
|
@@ -1251,25 +1251,25 @@ function dt({
|
|
|
1251
1251
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1252
1252
|
] });
|
|
1253
1253
|
}
|
|
1254
|
-
function xs({ width: s, height: t, shape:
|
|
1254
|
+
function xs({ width: s, height: t, shape: n = "rect", aspectRatio: i, className: a = "", style: r = {}, ...o }) {
|
|
1255
1255
|
return /* @__PURE__ */ e.jsx(
|
|
1256
1256
|
"span",
|
|
1257
1257
|
{
|
|
1258
|
-
className: ["ds-skeleton", `ds-skeleton--${
|
|
1259
|
-
style: { width: s, height: t, aspectRatio: i, ...
|
|
1258
|
+
className: ["ds-skeleton", `ds-skeleton--${n}`, a].filter(Boolean).join(" "),
|
|
1259
|
+
style: { width: s, height: t, aspectRatio: i, ...r },
|
|
1260
1260
|
"aria-hidden": "true",
|
|
1261
1261
|
...o
|
|
1262
1262
|
}
|
|
1263
1263
|
);
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function _s({ lines: s = 1, lastLineWidth: t = "70%", gap: n, className: i = "", style: a = {}, ...r }) {
|
|
1266
1266
|
return /* @__PURE__ */ e.jsx(
|
|
1267
1267
|
"span",
|
|
1268
1268
|
{
|
|
1269
1269
|
className: ["ds-skeleton-text", i].filter(Boolean).join(" "),
|
|
1270
|
-
style: { gap:
|
|
1270
|
+
style: { gap: n, ...a },
|
|
1271
1271
|
"aria-hidden": "true",
|
|
1272
|
-
...
|
|
1272
|
+
...r,
|
|
1273
1273
|
children: Array.from({ length: s }, (o, l) => /* @__PURE__ */ e.jsx(
|
|
1274
1274
|
"span",
|
|
1275
1275
|
{
|
|
@@ -1281,44 +1281,44 @@ function bs({ lines: s = 1, lastLineWidth: t = "70%", gap: r, className: i = "",
|
|
|
1281
1281
|
}
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
|
-
xs.Text =
|
|
1285
|
-
function
|
|
1284
|
+
xs.Text = _s;
|
|
1285
|
+
function js(s) {
|
|
1286
1286
|
let t = 2166136261;
|
|
1287
|
-
for (let
|
|
1288
|
-
t ^= s.charCodeAt(
|
|
1287
|
+
for (let n = 0; n < s.length; n++)
|
|
1288
|
+
t ^= s.charCodeAt(n), t = Math.imul(t, 16777619) >>> 0;
|
|
1289
1289
|
return t % 360;
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1291
|
+
function bs(s) {
|
|
1292
1292
|
if (!s) return "";
|
|
1293
1293
|
const t = s.trim().split(/\s+/);
|
|
1294
1294
|
return t.length >= 2 ? (t[0][0] + t[1][0]).toUpperCase() : s[0].toUpperCase();
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1297
|
-
const l =
|
|
1296
|
+
function dt({ seed: s, icon: t, src: n, size: i = 32, className: a = "", style: r = {}, ...o }) {
|
|
1297
|
+
const l = js(s ?? ""), [m, d] = D(!1), f = t ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: bs(s) });
|
|
1298
1298
|
return /* @__PURE__ */ e.jsx(
|
|
1299
1299
|
"div",
|
|
1300
1300
|
{
|
|
1301
1301
|
className: ["ds-avatar", a].filter(Boolean).join(" "),
|
|
1302
|
-
style: { width: i, height: i, "--ds-avatar-h": l, ...
|
|
1302
|
+
style: { width: i, height: i, "--ds-avatar-h": l, ...r },
|
|
1303
1303
|
"aria-hidden": "true",
|
|
1304
1304
|
...o,
|
|
1305
|
-
children:
|
|
1305
|
+
children: n && !m ? /* @__PURE__ */ e.jsx("img", { src: n, alt: "", onError: () => d(!0) }) : f
|
|
1306
1306
|
}
|
|
1307
1307
|
);
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function ut({
|
|
1310
1310
|
children: s,
|
|
1311
1311
|
size: t = "compact",
|
|
1312
|
-
stickyTop:
|
|
1312
|
+
stickyTop: n,
|
|
1313
1313
|
maxHeight: i,
|
|
1314
1314
|
className: a = "",
|
|
1315
|
-
style:
|
|
1315
|
+
style: r = {},
|
|
1316
1316
|
...o
|
|
1317
1317
|
}) {
|
|
1318
1318
|
const l = {
|
|
1319
1319
|
...i ? { maxHeight: i } : {},
|
|
1320
|
-
...
|
|
1321
|
-
...
|
|
1320
|
+
...n !== void 0 ? { "--ds-table-sticky-top": typeof n == "number" ? `${n}px` : n } : {},
|
|
1321
|
+
...r
|
|
1322
1322
|
};
|
|
1323
1323
|
return /* @__PURE__ */ e.jsx(
|
|
1324
1324
|
"div",
|
|
@@ -1336,23 +1336,23 @@ function ft({
|
|
|
1336
1336
|
}
|
|
1337
1337
|
);
|
|
1338
1338
|
}
|
|
1339
|
-
function
|
|
1339
|
+
function ft({ children: s, ...t }) {
|
|
1340
1340
|
return /* @__PURE__ */ e.jsx("thead", { ...t, children: s });
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function mt({ children: s, ...t }) {
|
|
1343
1343
|
return /* @__PURE__ */ e.jsx("tbody", { ...t, children: s });
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function pt({ children: s, interactive: t, selected: n, subheader: i, exiting: a, updated: r, className: o = "", onClick: l, ...m }) {
|
|
1346
1346
|
return /* @__PURE__ */ e.jsx(
|
|
1347
1347
|
"tr",
|
|
1348
1348
|
{
|
|
1349
1349
|
className: [
|
|
1350
1350
|
"ds-table-row",
|
|
1351
1351
|
t || l ? "ds-table-row--interactive" : "",
|
|
1352
|
-
|
|
1352
|
+
n ? "ds-table-row--selected" : "",
|
|
1353
1353
|
i ? "ds-table-row--subheader" : "",
|
|
1354
1354
|
a ? "ds-table-row--exiting" : "",
|
|
1355
|
-
|
|
1355
|
+
r ? "ds-table-row--updated" : "",
|
|
1356
1356
|
o
|
|
1357
1357
|
].filter(Boolean).join(" "),
|
|
1358
1358
|
onClick: l,
|
|
@@ -1361,20 +1361,20 @@ function ht({ children: s, interactive: t, selected: r, subheader: i, exiting: a
|
|
|
1361
1361
|
}
|
|
1362
1362
|
);
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1365
|
-
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...
|
|
1364
|
+
function ht({ children: s, colSpan: t = 999, ...n }) {
|
|
1365
|
+
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: t, children: s }) });
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1368
|
-
const m = !!i ||
|
|
1367
|
+
function xt({ children: s, align: t = "left", sortDir: n, onSort: i, width: a, className: r = "", style: o = {}, ...l }) {
|
|
1368
|
+
const m = !!i || n !== void 0, d = n === "asc" ? qe : n === "desc" ? he : Ke;
|
|
1369
1369
|
return /* @__PURE__ */ e.jsx(
|
|
1370
1370
|
"th",
|
|
1371
1371
|
{
|
|
1372
1372
|
className: [
|
|
1373
1373
|
"ds-th",
|
|
1374
1374
|
m ? "ds-th--sortable" : "",
|
|
1375
|
-
|
|
1375
|
+
n ? "ds-th--sorted" : "",
|
|
1376
1376
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1377
|
-
|
|
1377
|
+
r
|
|
1378
1378
|
].filter(Boolean).join(" "),
|
|
1379
1379
|
onClick: i,
|
|
1380
1380
|
style: { width: a, ...o },
|
|
@@ -1386,17 +1386,17 @@ function bt({ children: s, align: t = "left", sortDir: r, onSort: i, width: a, c
|
|
|
1386
1386
|
}
|
|
1387
1387
|
);
|
|
1388
1388
|
}
|
|
1389
|
-
function _t({ children: s, align: t = "left", secondary:
|
|
1389
|
+
function _t({ children: s, align: t = "left", secondary: n, muted: i, truncate: a, nowrap: r, className: o = "", ...l }) {
|
|
1390
1390
|
return /* @__PURE__ */ e.jsx(
|
|
1391
1391
|
"td",
|
|
1392
1392
|
{
|
|
1393
1393
|
className: [
|
|
1394
1394
|
"ds-td",
|
|
1395
1395
|
t !== "left" ? `ds-table-cell--${t}` : "",
|
|
1396
|
-
|
|
1396
|
+
n ? "ds-table-cell--secondary" : "",
|
|
1397
1397
|
i ? "ds-table-cell--muted" : "",
|
|
1398
1398
|
a ? "ds-table-cell--truncate" : "",
|
|
1399
|
-
|
|
1399
|
+
r ? "ds-table-cell--nowrap" : "",
|
|
1400
1400
|
o
|
|
1401
1401
|
].filter(Boolean).join(" "),
|
|
1402
1402
|
...l,
|
|
@@ -1407,44 +1407,44 @@ function _t({ children: s, align: t = "left", secondary: r, muted: i, truncate:
|
|
|
1407
1407
|
function jt({
|
|
1408
1408
|
icon: s,
|
|
1409
1409
|
title: t,
|
|
1410
|
-
description:
|
|
1410
|
+
description: n,
|
|
1411
1411
|
action: i,
|
|
1412
1412
|
size: a = "m",
|
|
1413
|
-
className:
|
|
1413
|
+
className: r = "",
|
|
1414
1414
|
...o
|
|
1415
1415
|
}) {
|
|
1416
1416
|
return /* @__PURE__ */ e.jsxs(
|
|
1417
1417
|
"div",
|
|
1418
1418
|
{
|
|
1419
|
-
className: ["ds-empty-state", `ds-empty-state--${a}`,
|
|
1419
|
+
className: ["ds-empty-state", `ds-empty-state--${a}`, r].filter(Boolean).join(" "),
|
|
1420
1420
|
...o,
|
|
1421
1421
|
children: [
|
|
1422
1422
|
s && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__icon", children: s }),
|
|
1423
1423
|
/* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__title", children: t }),
|
|
1424
|
-
|
|
1424
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__description", children: n }),
|
|
1425
1425
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-empty-state__action", children: i })
|
|
1426
1426
|
]
|
|
1427
1427
|
}
|
|
1428
1428
|
);
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function bt({
|
|
1431
1431
|
label: s,
|
|
1432
1432
|
hint: t,
|
|
1433
|
-
error:
|
|
1433
|
+
error: n,
|
|
1434
1434
|
required: i = !1,
|
|
1435
1435
|
disabled: a = !1,
|
|
1436
|
-
htmlFor:
|
|
1436
|
+
htmlFor: r,
|
|
1437
1437
|
children: o,
|
|
1438
1438
|
className: l = "",
|
|
1439
1439
|
style: m,
|
|
1440
1440
|
...d
|
|
1441
1441
|
}) {
|
|
1442
|
-
const f = K.useId(), p =
|
|
1442
|
+
const f = K.useId(), p = r ?? f, h = `${p}-hint`, u = `${p}-error`;
|
|
1443
1443
|
return /* @__PURE__ */ e.jsxs(
|
|
1444
1444
|
"div",
|
|
1445
1445
|
{
|
|
1446
1446
|
className: `ds-field${l ? ` ${l}` : ""}`,
|
|
1447
|
-
"data-state":
|
|
1447
|
+
"data-state": n ? "error" : void 0,
|
|
1448
1448
|
"data-required": i ? "" : void 0,
|
|
1449
1449
|
"data-disabled": a ? "" : void 0,
|
|
1450
1450
|
style: m,
|
|
@@ -1452,14 +1452,14 @@ function vt({
|
|
|
1452
1452
|
children: [
|
|
1453
1453
|
s && /* @__PURE__ */ e.jsx("label", { className: "ds-field-label", htmlFor: p, children: s }),
|
|
1454
1454
|
/* @__PURE__ */ e.jsx("div", { className: "ds-field-control", children: o }),
|
|
1455
|
-
t && !
|
|
1456
|
-
|
|
1455
|
+
t && !n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-hint", id: h, children: t }),
|
|
1456
|
+
n && /* @__PURE__ */ e.jsx("p", { className: "ds-field-error", id: u, role: "alert", children: n })
|
|
1457
1457
|
]
|
|
1458
1458
|
}
|
|
1459
1459
|
);
|
|
1460
1460
|
}
|
|
1461
|
-
function
|
|
1462
|
-
const m =
|
|
1461
|
+
function vt({ label: s, value: t, delta: n, size: i = "m", inline: a = !1, className: r = "", style: o, ...l }) {
|
|
1462
|
+
const m = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1463
1463
|
return /* @__PURE__ */ e.jsxs(
|
|
1464
1464
|
"div",
|
|
1465
1465
|
{
|
|
@@ -1467,34 +1467,34 @@ function Nt({ label: s, value: t, delta: r, size: i = "m", inline: a = !1, class
|
|
|
1467
1467
|
"ds-stat",
|
|
1468
1468
|
`ds-stat--${i}`,
|
|
1469
1469
|
a && "ds-stat--inline",
|
|
1470
|
-
|
|
1470
|
+
r
|
|
1471
1471
|
].filter(Boolean).join(" "),
|
|
1472
1472
|
style: o,
|
|
1473
1473
|
...l,
|
|
1474
1474
|
children: [
|
|
1475
1475
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-label", children: s }),
|
|
1476
1476
|
t != null && /* @__PURE__ */ e.jsx("span", { className: "ds-stat-value", children: t }),
|
|
1477
|
-
|
|
1477
|
+
n != null && /* @__PURE__ */ e.jsx("span", { className: `ds-stat-delta ds-stat-delta--${m}`, children: n })
|
|
1478
1478
|
]
|
|
1479
1479
|
}
|
|
1480
1480
|
);
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1482
|
+
function Nt({
|
|
1483
1483
|
children: s,
|
|
1484
1484
|
separator: t = "/",
|
|
1485
|
-
"aria-label":
|
|
1485
|
+
"aria-label": n = "Breadcrumb",
|
|
1486
1486
|
className: i = "",
|
|
1487
1487
|
style: a,
|
|
1488
|
-
...
|
|
1488
|
+
...r
|
|
1489
1489
|
}) {
|
|
1490
1490
|
const o = K.Children.toArray(s).filter(Boolean);
|
|
1491
1491
|
return /* @__PURE__ */ e.jsx(
|
|
1492
1492
|
"nav",
|
|
1493
1493
|
{
|
|
1494
1494
|
className: `ds-breadcrumb${i ? ` ${i}` : ""}`,
|
|
1495
|
-
"aria-label":
|
|
1495
|
+
"aria-label": n,
|
|
1496
1496
|
style: a,
|
|
1497
|
-
...
|
|
1497
|
+
...r,
|
|
1498
1498
|
children: /* @__PURE__ */ e.jsx("ol", { className: "ds-breadcrumb-list", children: o.map((l, m) => /* @__PURE__ */ e.jsxs("li", { className: "ds-breadcrumb-item", children: [
|
|
1499
1499
|
l,
|
|
1500
1500
|
m < o.length - 1 && /* @__PURE__ */ e.jsx("span", { className: "ds-breadcrumb-sep", "aria-hidden": "true", children: t })
|
|
@@ -1502,13 +1502,13 @@ function wt({
|
|
|
1502
1502
|
}
|
|
1503
1503
|
);
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function wt({
|
|
1506
1506
|
page: s,
|
|
1507
1507
|
total: t,
|
|
1508
|
-
onChange:
|
|
1508
|
+
onChange: n,
|
|
1509
1509
|
siblings: i = 1,
|
|
1510
1510
|
"aria-label": a = "Pagination",
|
|
1511
|
-
className:
|
|
1511
|
+
className: r = "",
|
|
1512
1512
|
style: o,
|
|
1513
1513
|
...l
|
|
1514
1514
|
}) {
|
|
@@ -1516,7 +1516,7 @@ function gt({
|
|
|
1516
1516
|
return /* @__PURE__ */ e.jsxs(
|
|
1517
1517
|
"nav",
|
|
1518
1518
|
{
|
|
1519
|
-
className: `ds-pagination${
|
|
1519
|
+
className: `ds-pagination${r ? ` ${r}` : ""}`,
|
|
1520
1520
|
"aria-label": a,
|
|
1521
1521
|
style: o,
|
|
1522
1522
|
...l,
|
|
@@ -1525,10 +1525,10 @@ function gt({
|
|
|
1525
1525
|
"button",
|
|
1526
1526
|
{
|
|
1527
1527
|
className: "ds-pagination-arrow",
|
|
1528
|
-
onClick: () =>
|
|
1528
|
+
onClick: () => n == null ? void 0 : n(s - 1),
|
|
1529
1529
|
disabled: s <= 1,
|
|
1530
1530
|
"aria-label": "Previous page",
|
|
1531
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1531
|
+
children: /* @__PURE__ */ e.jsx(Xe, { size: 16 })
|
|
1532
1532
|
}
|
|
1533
1533
|
),
|
|
1534
1534
|
m.map(
|
|
@@ -1536,7 +1536,7 @@ function gt({
|
|
|
1536
1536
|
"button",
|
|
1537
1537
|
{
|
|
1538
1538
|
className: `ds-pagination-page${d === s ? " ds-pagination-page--current" : ""}`,
|
|
1539
|
-
onClick: () => d !== s && (
|
|
1539
|
+
onClick: () => d !== s && (n == null ? void 0 : n(d)),
|
|
1540
1540
|
"aria-current": d === s ? "page" : void 0,
|
|
1541
1541
|
"aria-label": `Page ${d}`,
|
|
1542
1542
|
children: d
|
|
@@ -1548,46 +1548,46 @@ function gt({
|
|
|
1548
1548
|
"button",
|
|
1549
1549
|
{
|
|
1550
1550
|
className: "ds-pagination-arrow",
|
|
1551
|
-
onClick: () =>
|
|
1551
|
+
onClick: () => n == null ? void 0 : n(s + 1),
|
|
1552
1552
|
disabled: s >= t,
|
|
1553
1553
|
"aria-label": "Next page",
|
|
1554
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1554
|
+
children: /* @__PURE__ */ e.jsx(Ge, { size: 16 })
|
|
1555
1555
|
}
|
|
1556
1556
|
)
|
|
1557
1557
|
]
|
|
1558
1558
|
}
|
|
1559
1559
|
);
|
|
1560
1560
|
}
|
|
1561
|
-
function vs(s, t,
|
|
1561
|
+
function vs(s, t, n) {
|
|
1562
1562
|
if (t <= 7) return Array.from({ length: t }, (o, l) => l + 1);
|
|
1563
|
-
const i = Math.max(2, s -
|
|
1564
|
-
i > 2 &&
|
|
1565
|
-
for (let o = i; o <= a; o++)
|
|
1566
|
-
return a < t - 1 &&
|
|
1563
|
+
const i = Math.max(2, s - n), a = Math.min(t - 1, s + n), r = [1];
|
|
1564
|
+
i > 2 && r.push("…");
|
|
1565
|
+
for (let o = i; o <= a; o++) r.push(o);
|
|
1566
|
+
return a < t - 1 && r.push("…"), r.push(t), r;
|
|
1567
1567
|
}
|
|
1568
1568
|
const Ns = 200;
|
|
1569
|
-
function
|
|
1569
|
+
function gt({
|
|
1570
1570
|
children: s,
|
|
1571
1571
|
title: t,
|
|
1572
|
-
onClose:
|
|
1572
|
+
onClose: n,
|
|
1573
1573
|
side: i = "right",
|
|
1574
1574
|
...a
|
|
1575
1575
|
}) {
|
|
1576
|
-
const
|
|
1577
|
-
!
|
|
1578
|
-
m(!1),
|
|
1576
|
+
const r = E(null), o = K.useId(), [l, m] = D(!1), d = () => {
|
|
1577
|
+
!n || l || (m(!0), setTimeout(() => {
|
|
1578
|
+
m(!1), n();
|
|
1579
1579
|
}, Ns));
|
|
1580
1580
|
};
|
|
1581
1581
|
M(() => {
|
|
1582
|
-
const u = (
|
|
1583
|
-
|
|
1584
|
-
},
|
|
1585
|
-
|
|
1582
|
+
const u = (b) => {
|
|
1583
|
+
b.key === "Escape" && d();
|
|
1584
|
+
}, _ = (b) => {
|
|
1585
|
+
r.current && !r.current.contains(b.target) && d();
|
|
1586
1586
|
};
|
|
1587
|
-
return document.addEventListener("keydown", u), document.addEventListener("mousedown",
|
|
1588
|
-
document.removeEventListener("keydown", u), document.removeEventListener("mousedown",
|
|
1587
|
+
return document.addEventListener("keydown", u), document.addEventListener("mousedown", _), () => {
|
|
1588
|
+
document.removeEventListener("keydown", u), document.removeEventListener("mousedown", _);
|
|
1589
1589
|
};
|
|
1590
|
-
}, [
|
|
1590
|
+
}, [n, l]);
|
|
1591
1591
|
const f = K.Children.toArray(s), p = f.find((u) => (u == null ? void 0 : u.type) === Be), h = f.filter((u) => (u == null ? void 0 : u.type) !== Be);
|
|
1592
1592
|
return /* @__PURE__ */ e.jsx(
|
|
1593
1593
|
"div",
|
|
@@ -1599,14 +1599,14 @@ function yt({
|
|
|
1599
1599
|
{
|
|
1600
1600
|
className: ["ds-drawer", l && "ds-drawer--closing"].filter(Boolean).join(" "),
|
|
1601
1601
|
"data-side": i,
|
|
1602
|
-
ref:
|
|
1602
|
+
ref: r,
|
|
1603
1603
|
role: "dialog",
|
|
1604
1604
|
"aria-modal": "true",
|
|
1605
1605
|
"aria-labelledby": t ? o : void 0,
|
|
1606
1606
|
children: [
|
|
1607
1607
|
/* @__PURE__ */ e.jsxs("header", { className: "ds-drawer-header", children: [
|
|
1608
1608
|
t && /* @__PURE__ */ e.jsx("h3", { id: o, className: "ds-drawer-title", children: t }),
|
|
1609
|
-
|
|
1609
|
+
n && /* @__PURE__ */ e.jsx("button", { className: "ds-drawer-close", onClick: d, "aria-label": "Close drawer", children: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 }) })
|
|
1610
1610
|
] }),
|
|
1611
1611
|
/* @__PURE__ */ e.jsx("div", { className: "ds-drawer-body", children: h }),
|
|
1612
1612
|
p
|
|
@@ -1625,16 +1625,16 @@ const ws = {
|
|
|
1625
1625
|
warning: ge,
|
|
1626
1626
|
error: we
|
|
1627
1627
|
};
|
|
1628
|
-
function
|
|
1628
|
+
function yt({
|
|
1629
1629
|
children: s,
|
|
1630
1630
|
variant: t = "info",
|
|
1631
|
-
action:
|
|
1631
|
+
action: n,
|
|
1632
1632
|
onAction: i,
|
|
1633
1633
|
onDismiss: a,
|
|
1634
|
-
role:
|
|
1634
|
+
role: r,
|
|
1635
1635
|
...o
|
|
1636
1636
|
}) {
|
|
1637
|
-
const l = ws[t], m =
|
|
1637
|
+
const l = ws[t], m = r || (t === "error" ? "alert" : "status");
|
|
1638
1638
|
return /* @__PURE__ */ e.jsxs(
|
|
1639
1639
|
"div",
|
|
1640
1640
|
{
|
|
@@ -1644,13 +1644,13 @@ function kt({
|
|
|
1644
1644
|
children: [
|
|
1645
1645
|
l && /* @__PURE__ */ e.jsx("span", { className: "ds-banner-icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(l, { size: I[2], strokeWidth: 1.5 }) }),
|
|
1646
1646
|
/* @__PURE__ */ e.jsx("span", { className: "ds-banner-text", children: s }),
|
|
1647
|
-
|
|
1647
|
+
n && /* @__PURE__ */ e.jsx(
|
|
1648
1648
|
"button",
|
|
1649
1649
|
{
|
|
1650
1650
|
type: "button",
|
|
1651
1651
|
className: "ds-banner-action",
|
|
1652
1652
|
onClick: i,
|
|
1653
|
-
children:
|
|
1653
|
+
children: n
|
|
1654
1654
|
}
|
|
1655
1655
|
),
|
|
1656
1656
|
a && /* @__PURE__ */ e.jsx(
|
|
@@ -1660,24 +1660,24 @@ function kt({
|
|
|
1660
1660
|
className: "ds-banner-dismiss",
|
|
1661
1661
|
onClick: a,
|
|
1662
1662
|
"aria-label": "Dismiss",
|
|
1663
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1663
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[2], strokeWidth: 1.5 })
|
|
1664
1664
|
}
|
|
1665
1665
|
)
|
|
1666
1666
|
]
|
|
1667
1667
|
}
|
|
1668
1668
|
);
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function kt({
|
|
1671
1671
|
trigger: s,
|
|
1672
1672
|
items: t = [],
|
|
1673
|
-
open:
|
|
1673
|
+
open: n,
|
|
1674
1674
|
onOpenChange: i,
|
|
1675
1675
|
align: a = "left",
|
|
1676
|
-
className:
|
|
1676
|
+
className: r = "",
|
|
1677
1677
|
style: o,
|
|
1678
1678
|
...l
|
|
1679
1679
|
}) {
|
|
1680
|
-
const [m, d] =
|
|
1680
|
+
const [m, d] = D(!1), [f, p] = D(!1), h = n !== void 0, u = h ? n : m, _ = E(null), b = E(null), S = E(null), R = E(null), [B, y] = D({}), $ = E(null), O = 150, A = () => {
|
|
1681
1681
|
if (h)
|
|
1682
1682
|
i == null || i(!1);
|
|
1683
1683
|
else {
|
|
@@ -1688,15 +1688,15 @@ function Et({
|
|
|
1688
1688
|
}
|
|
1689
1689
|
}, Y = () => {
|
|
1690
1690
|
const x = !u;
|
|
1691
|
-
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) :
|
|
1691
|
+
h ? i == null || i(x) : x ? (clearTimeout($.current), p(!1), d(!0)) : A();
|
|
1692
1692
|
}, q = () => {
|
|
1693
1693
|
u || (h ? i == null || i(!0) : (clearTimeout($.current), p(!1), d(!0)));
|
|
1694
1694
|
};
|
|
1695
1695
|
M(() => () => clearTimeout($.current), []), M(() => {
|
|
1696
1696
|
if (!u) return;
|
|
1697
1697
|
const x = 300, v = () => {
|
|
1698
|
-
var
|
|
1699
|
-
const k = (
|
|
1698
|
+
var G;
|
|
1699
|
+
const k = (G = _.current) == null ? void 0 : G.getBoundingClientRect();
|
|
1700
1700
|
if (!k) return;
|
|
1701
1701
|
const L = window.innerHeight - k.bottom, H = L < x + 8 && k.top > L;
|
|
1702
1702
|
y(
|
|
@@ -1718,19 +1718,19 @@ function Et({
|
|
|
1718
1718
|
if (!u) return;
|
|
1719
1719
|
const x = (k) => {
|
|
1720
1720
|
var L, H;
|
|
1721
|
-
!((L =
|
|
1721
|
+
!((L = _.current) != null && L.contains(k.target)) && !((H = b.current) != null && H.contains(k.target)) && A();
|
|
1722
1722
|
}, v = (k) => {
|
|
1723
|
-
k.key === "Escape" && (
|
|
1723
|
+
k.key === "Escape" && (A(), P());
|
|
1724
1724
|
};
|
|
1725
1725
|
return document.addEventListener("mousedown", x), document.addEventListener("keydown", v), () => {
|
|
1726
1726
|
document.removeEventListener("mousedown", x), document.removeEventListener("keydown", v);
|
|
1727
1727
|
};
|
|
1728
1728
|
}, [u]), M(() => {
|
|
1729
|
-
if (!u || !R.current || !
|
|
1729
|
+
if (!u || !R.current || !b.current) return;
|
|
1730
1730
|
const x = N(), v = R.current === "last" ? x[x.length - 1] : x[0];
|
|
1731
1731
|
v == null || v.focus(), R.current = null;
|
|
1732
1732
|
}, [u]);
|
|
1733
|
-
const N = () =>
|
|
1733
|
+
const N = () => b.current ? [...b.current.querySelectorAll(
|
|
1734
1734
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
1735
1735
|
)] : [], C = (x) => {
|
|
1736
1736
|
var v, k;
|
|
@@ -1743,8 +1743,8 @@ function Et({
|
|
|
1743
1743
|
const L = N();
|
|
1744
1744
|
(k = L[L.length - 1]) == null || k.focus();
|
|
1745
1745
|
}
|
|
1746
|
-
},
|
|
1747
|
-
var L, H,
|
|
1746
|
+
}, X = (x) => {
|
|
1747
|
+
var L, H, G, g;
|
|
1748
1748
|
const v = N(), k = v.findIndex((c) => c === document.activeElement);
|
|
1749
1749
|
switch (x.key) {
|
|
1750
1750
|
case "ArrowDown":
|
|
@@ -1754,19 +1754,19 @@ function Et({
|
|
|
1754
1754
|
x.preventDefault(), k <= 0 ? P() : (H = v[k - 1]) == null || H.focus();
|
|
1755
1755
|
break;
|
|
1756
1756
|
case "Home":
|
|
1757
|
-
x.preventDefault(), (
|
|
1757
|
+
x.preventDefault(), (G = v[0]) == null || G.focus();
|
|
1758
1758
|
break;
|
|
1759
1759
|
case "End":
|
|
1760
1760
|
x.preventDefault(), (g = v[v.length - 1]) == null || g.focus();
|
|
1761
1761
|
break;
|
|
1762
1762
|
case "Tab":
|
|
1763
|
-
|
|
1763
|
+
A();
|
|
1764
1764
|
break;
|
|
1765
1765
|
}
|
|
1766
1766
|
}, U = u && /* @__PURE__ */ e.jsx(
|
|
1767
1767
|
"div",
|
|
1768
1768
|
{
|
|
1769
|
-
ref:
|
|
1769
|
+
ref: b,
|
|
1770
1770
|
role: "menu",
|
|
1771
1771
|
className: [
|
|
1772
1772
|
"ds-dropdown__menu",
|
|
@@ -1774,7 +1774,7 @@ function Et({
|
|
|
1774
1774
|
f && "ds-dropdown__menu--closing"
|
|
1775
1775
|
].filter(Boolean).join(" "),
|
|
1776
1776
|
style: B,
|
|
1777
|
-
onKeyDown:
|
|
1777
|
+
onKeyDown: X,
|
|
1778
1778
|
children: t.map((x, v) => {
|
|
1779
1779
|
if (x.separator)
|
|
1780
1780
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, v);
|
|
@@ -1794,8 +1794,8 @@ function Et({
|
|
|
1794
1794
|
].filter(Boolean).join(" "),
|
|
1795
1795
|
...H,
|
|
1796
1796
|
onClick: () => {
|
|
1797
|
-
var
|
|
1798
|
-
(
|
|
1797
|
+
var G;
|
|
1798
|
+
(G = x.onClick) == null || G.call(x), A();
|
|
1799
1799
|
},
|
|
1800
1800
|
children: [
|
|
1801
1801
|
x.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: x.icon }),
|
|
@@ -1811,8 +1811,8 @@ function Et({
|
|
|
1811
1811
|
return /* @__PURE__ */ e.jsxs(
|
|
1812
1812
|
"div",
|
|
1813
1813
|
{
|
|
1814
|
-
ref:
|
|
1815
|
-
className: ["ds-dropdown",
|
|
1814
|
+
ref: _,
|
|
1815
|
+
className: ["ds-dropdown", r].filter(Boolean).join(" "),
|
|
1816
1816
|
style: o,
|
|
1817
1817
|
...l,
|
|
1818
1818
|
children: [
|
|
@@ -1831,22 +1831,22 @@ function Et({
|
|
|
1831
1831
|
}
|
|
1832
1832
|
);
|
|
1833
1833
|
}
|
|
1834
|
-
function
|
|
1834
|
+
function Et({
|
|
1835
1835
|
value: s = 0,
|
|
1836
1836
|
size: t = "m",
|
|
1837
|
-
variant:
|
|
1837
|
+
variant: n = "default",
|
|
1838
1838
|
showValue: i = !1,
|
|
1839
1839
|
min: a = 2,
|
|
1840
|
-
animate:
|
|
1840
|
+
animate: r = !0
|
|
1841
1841
|
}) {
|
|
1842
|
-
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m =
|
|
1842
|
+
const o = Math.min(100, Math.max(0, s)), l = Math.max(a, o), m = n === "auto" ? o >= 70 ? "success" : o >= 50 ? "warning" : "danger" : n;
|
|
1843
1843
|
return /* @__PURE__ */ e.jsxs(
|
|
1844
1844
|
"div",
|
|
1845
1845
|
{
|
|
1846
1846
|
className: [
|
|
1847
1847
|
"ds-progress",
|
|
1848
1848
|
`ds-progress--${t}`,
|
|
1849
|
-
!
|
|
1849
|
+
!r && "ds-progress--instant"
|
|
1850
1850
|
].filter(Boolean).join(" "),
|
|
1851
1851
|
role: "progressbar",
|
|
1852
1852
|
"aria-valuenow": o,
|
|
@@ -1870,7 +1870,7 @@ function $t({
|
|
|
1870
1870
|
}
|
|
1871
1871
|
const gs = (s) => 1 - Math.pow(1 - s, 3), ys = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1872
1872
|
function ks(s, { duration: t = 600 } = {}) {
|
|
1873
|
-
const [
|
|
1873
|
+
const [n, i] = D(s), a = E(s), r = E(null);
|
|
1874
1874
|
return M(() => {
|
|
1875
1875
|
if (ys()) {
|
|
1876
1876
|
i(s), a.current = s;
|
|
@@ -1882,48 +1882,48 @@ function ks(s, { duration: t = 600 } = {}) {
|
|
|
1882
1882
|
const d = (f) => {
|
|
1883
1883
|
m || (m = f);
|
|
1884
1884
|
const p = Math.min((f - m) / t, 1);
|
|
1885
|
-
i(o + l * gs(p)), p < 1 ?
|
|
1885
|
+
i(o + l * gs(p)), p < 1 ? r.current = requestAnimationFrame(d) : a.current = s;
|
|
1886
1886
|
};
|
|
1887
|
-
return
|
|
1888
|
-
}, [s, t]),
|
|
1887
|
+
return r.current = requestAnimationFrame(d), () => cancelAnimationFrame(r.current);
|
|
1888
|
+
}, [s, t]), n;
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1890
|
+
function $t({
|
|
1891
1891
|
value: s,
|
|
1892
1892
|
duration: t = 600,
|
|
1893
|
-
decimals:
|
|
1893
|
+
decimals: n = 0,
|
|
1894
1894
|
prefix: i = "",
|
|
1895
1895
|
suffix: a = ""
|
|
1896
1896
|
}) {
|
|
1897
|
-
const o = ks(s, { duration: t }).toFixed(
|
|
1897
|
+
const o = ks(s, { duration: t }).toFixed(n);
|
|
1898
1898
|
return `${i}${o}${a}`;
|
|
1899
1899
|
}
|
|
1900
|
-
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once:
|
|
1901
|
-
const i = E(null), [a,
|
|
1900
|
+
function Es({ threshold: s = 0.1, rootMargin: t = "0px", once: n = !1 } = {}) {
|
|
1901
|
+
const i = E(null), [a, r] = D(!1);
|
|
1902
1902
|
return M(() => {
|
|
1903
1903
|
const o = i.current;
|
|
1904
1904
|
if (!o) return;
|
|
1905
1905
|
const l = new IntersectionObserver(
|
|
1906
1906
|
([m]) => {
|
|
1907
|
-
m.isIntersecting ? (
|
|
1907
|
+
m.isIntersecting ? (r(!0), n && l.disconnect()) : n || r(!1);
|
|
1908
1908
|
},
|
|
1909
1909
|
{ threshold: s, rootMargin: t }
|
|
1910
1910
|
);
|
|
1911
1911
|
return l.observe(o), () => l.disconnect();
|
|
1912
|
-
}, [s, t,
|
|
1912
|
+
}, [s, t, n]), { ref: i, inView: a };
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1914
|
+
function Tt({
|
|
1915
1915
|
children: s,
|
|
1916
1916
|
as: t = "div",
|
|
1917
|
-
once:
|
|
1917
|
+
once: n = !1,
|
|
1918
1918
|
threshold: i = 0.1,
|
|
1919
1919
|
rootMargin: a = "0px",
|
|
1920
|
-
onEnter:
|
|
1920
|
+
onEnter: r,
|
|
1921
1921
|
onLeave: o,
|
|
1922
1922
|
...l
|
|
1923
1923
|
}) {
|
|
1924
|
-
const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once:
|
|
1924
|
+
const { ref: m, inView: d } = Es({ threshold: i, rootMargin: a, once: n }), f = E(!1);
|
|
1925
1925
|
return M(() => {
|
|
1926
|
-
d && !f.current && (
|
|
1926
|
+
d && !f.current && (r == null || r()), !d && f.current && (o == null || o()), f.current = d;
|
|
1927
1927
|
}, [d]), /* @__PURE__ */ e.jsx(t, { ref: m, ...l, children: typeof s == "function" ? s(d) : s });
|
|
1928
1928
|
}
|
|
1929
1929
|
const Me = {
|
|
@@ -1933,9 +1933,9 @@ const Me = {
|
|
|
1933
1933
|
error: we
|
|
1934
1934
|
};
|
|
1935
1935
|
let de = [];
|
|
1936
|
-
const
|
|
1936
|
+
const be = /* @__PURE__ */ new Set();
|
|
1937
1937
|
function We() {
|
|
1938
|
-
|
|
1938
|
+
be.forEach((s) => s([...de]));
|
|
1939
1939
|
}
|
|
1940
1940
|
function $s(s) {
|
|
1941
1941
|
de = [...de, s], We();
|
|
@@ -1943,22 +1943,22 @@ function $s(s) {
|
|
|
1943
1943
|
function Ts(s) {
|
|
1944
1944
|
de = de.filter((t) => t.id !== s), We();
|
|
1945
1945
|
}
|
|
1946
|
-
function
|
|
1947
|
-
const s = (t,
|
|
1946
|
+
function Rt() {
|
|
1947
|
+
const s = (t, n = {}) => {
|
|
1948
1948
|
$s({
|
|
1949
1949
|
id: `${Date.now()}-${Math.random()}`,
|
|
1950
1950
|
message: t,
|
|
1951
1951
|
type: "default",
|
|
1952
1952
|
duration: 4e3,
|
|
1953
|
-
...
|
|
1953
|
+
...n
|
|
1954
1954
|
});
|
|
1955
1955
|
};
|
|
1956
|
-
return s.success = (t,
|
|
1956
|
+
return s.success = (t, n) => s(t, { ...n, type: "success" }), s.error = (t, n) => s(t, { ...n, type: "error" }), s.warning = (t, n) => s(t, { ...n, type: "warning" }), { toast: s };
|
|
1957
1957
|
}
|
|
1958
1958
|
function Rs({ data: s, onDismiss: t }) {
|
|
1959
|
-
const [
|
|
1960
|
-
M(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() =>
|
|
1961
|
-
function
|
|
1959
|
+
const [n, i] = D(!1), a = E(null);
|
|
1960
|
+
M(() => (requestAnimationFrame(() => i(!0)), s.duration > 0 && (a.current = setTimeout(() => r(), s.duration)), () => clearTimeout(a.current)), []);
|
|
1961
|
+
function r() {
|
|
1962
1962
|
i(!1), setTimeout(() => t(s.id), 250);
|
|
1963
1963
|
}
|
|
1964
1964
|
const o = Me[s.type] ?? Me.default;
|
|
@@ -1968,7 +1968,7 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1968
1968
|
className: [
|
|
1969
1969
|
"ds-toast",
|
|
1970
1970
|
`ds-toast--${s.type}`,
|
|
1971
|
-
|
|
1971
|
+
n && "ds-toast--visible"
|
|
1972
1972
|
].filter(Boolean).join(" "),
|
|
1973
1973
|
role: s.type === "error" ? "alert" : "status",
|
|
1974
1974
|
"aria-live": "polite",
|
|
@@ -1979,74 +1979,81 @@ function Rs({ data: s, onDismiss: t }) {
|
|
|
1979
1979
|
"button",
|
|
1980
1980
|
{
|
|
1981
1981
|
className: "ds-toast__close",
|
|
1982
|
-
onClick:
|
|
1982
|
+
onClick: r,
|
|
1983
1983
|
"aria-label": "Закрыть",
|
|
1984
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1984
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[3], strokeWidth: 1.5 })
|
|
1985
1985
|
}
|
|
1986
1986
|
)
|
|
1987
1987
|
]
|
|
1988
1988
|
}
|
|
1989
1989
|
);
|
|
1990
1990
|
}
|
|
1991
|
-
function
|
|
1992
|
-
const [t,
|
|
1993
|
-
return M(() => (
|
|
1991
|
+
function St({ position: s = "bottom-right" }) {
|
|
1992
|
+
const [t, n] = D(() => [...de]);
|
|
1993
|
+
return M(() => (be.add(n), () => be.delete(n)), []), !t.length || typeof document > "u" ? null : pe.createPortal(
|
|
1994
1994
|
/* @__PURE__ */ e.jsx("div", { className: ["ds-toast-container", `ds-toast-container--${s}`].join(" "), children: t.map((i) => /* @__PURE__ */ e.jsx(Rs, { data: i, onDismiss: Ts }, i.id)) }),
|
|
1995
1995
|
document.body
|
|
1996
1996
|
);
|
|
1997
1997
|
}
|
|
1998
1998
|
const Ss = {
|
|
1999
|
-
running: /* @__PURE__ */ e.jsx(
|
|
2000
|
-
success: /* @__PURE__ */ e.jsx(
|
|
2001
|
-
error: /* @__PURE__ */ e.jsx(
|
|
1999
|
+
running: /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: "info", children: "Running..." }),
|
|
2000
|
+
success: /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: "success", children: "Done" }),
|
|
2001
|
+
error: /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: "error", children: "Error" })
|
|
2002
2002
|
};
|
|
2003
2003
|
function Dt({
|
|
2004
2004
|
label: s,
|
|
2005
2005
|
status: t = "idle",
|
|
2006
|
-
icon:
|
|
2006
|
+
icon: n,
|
|
2007
2007
|
badge: i,
|
|
2008
2008
|
defaultExpanded: a = !1,
|
|
2009
|
-
expanded:
|
|
2009
|
+
expanded: r,
|
|
2010
2010
|
onToggle: o,
|
|
2011
2011
|
children: l,
|
|
2012
2012
|
className: m = "",
|
|
2013
2013
|
...d
|
|
2014
2014
|
}) {
|
|
2015
|
-
const f = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2016
|
-
|
|
2015
|
+
const f = t === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2016
|
+
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2017
2017
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: s }),
|
|
2018
2018
|
Ss[t],
|
|
2019
2019
|
i
|
|
2020
2020
|
] });
|
|
2021
|
-
return /* @__PURE__ */ e.jsx(
|
|
2021
|
+
return l ? /* @__PURE__ */ e.jsx(
|
|
2022
2022
|
"div",
|
|
2023
2023
|
{
|
|
2024
|
-
className: ["ds-tool-card", m].filter(Boolean).join(" "),
|
|
2024
|
+
className: ["ds-tool-card", f && "ds-tool-card--running", m].filter(Boolean).join(" "),
|
|
2025
2025
|
...d,
|
|
2026
2026
|
children: /* @__PURE__ */ e.jsx(
|
|
2027
2027
|
Ee,
|
|
2028
2028
|
{
|
|
2029
|
-
title:
|
|
2029
|
+
title: p,
|
|
2030
2030
|
padding: "s",
|
|
2031
2031
|
defaultExpanded: a,
|
|
2032
|
-
expanded:
|
|
2033
|
-
onToggle: o,
|
|
2032
|
+
expanded: f ? !1 : r,
|
|
2033
|
+
onToggle: f ? void 0 : o,
|
|
2034
2034
|
children: /* @__PURE__ */ e.jsx("div", { className: "ds-tool-card__body", children: l })
|
|
2035
2035
|
}
|
|
2036
2036
|
)
|
|
2037
2037
|
}
|
|
2038
|
+
) : /* @__PURE__ */ e.jsx(
|
|
2039
|
+
"div",
|
|
2040
|
+
{
|
|
2041
|
+
className: ["ds-tool-card", "ds-tool-card--bubble", m].filter(Boolean).join(" "),
|
|
2042
|
+
...d,
|
|
2043
|
+
children: p
|
|
2044
|
+
}
|
|
2038
2045
|
);
|
|
2039
2046
|
}
|
|
2040
|
-
function
|
|
2047
|
+
function Ds({
|
|
2041
2048
|
text: s,
|
|
2042
2049
|
size: t = "xs",
|
|
2043
|
-
timeout:
|
|
2050
|
+
timeout: n = 800,
|
|
2044
2051
|
"aria-label": i = "Copy to clipboard",
|
|
2045
2052
|
...a
|
|
2046
2053
|
}) {
|
|
2047
|
-
const [
|
|
2054
|
+
const [r, o] = D(!1), l = (m) => {
|
|
2048
2055
|
m.currentTarget.blur(), navigator.clipboard.writeText(s).then(() => {
|
|
2049
|
-
o(!0), setTimeout(() => o(!1),
|
|
2056
|
+
o(!0), setTimeout(() => o(!1), n);
|
|
2050
2057
|
});
|
|
2051
2058
|
};
|
|
2052
2059
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -2054,7 +2061,7 @@ function As({
|
|
|
2054
2061
|
{
|
|
2055
2062
|
variant: "ghost",
|
|
2056
2063
|
size: t,
|
|
2057
|
-
state:
|
|
2064
|
+
state: r ? "success" : "idle",
|
|
2058
2065
|
icon: /* @__PURE__ */ e.jsx(Je, { size: I[1], strokeWidth: 1.5 }),
|
|
2059
2066
|
"aria-label": i,
|
|
2060
2067
|
onClick: l,
|
|
@@ -2062,8 +2069,8 @@ function As({
|
|
|
2062
2069
|
}
|
|
2063
2070
|
);
|
|
2064
2071
|
}
|
|
2065
|
-
function
|
|
2066
|
-
const [i, a] =
|
|
2072
|
+
function At({ content: s, streaming: t = !1, ...n }) {
|
|
2073
|
+
const [i, a] = D(t);
|
|
2067
2074
|
return M(() => {
|
|
2068
2075
|
a(!!t);
|
|
2069
2076
|
}, [t]), /* @__PURE__ */ e.jsx(
|
|
@@ -2076,7 +2083,7 @@ function It({ content: s, streaming: t = !1, ...r }) {
|
|
|
2076
2083
|
/* @__PURE__ */ e.jsx(Ze, { size: I[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2077
2084
|
/* @__PURE__ */ e.jsx(ds, { secondary: !0, children: "Thinking" })
|
|
2078
2085
|
] }),
|
|
2079
|
-
...
|
|
2086
|
+
...n,
|
|
2080
2087
|
children: /* @__PURE__ */ e.jsxs(Fe, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
2081
2088
|
s,
|
|
2082
2089
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-cursor ds-cursor--line" })
|
|
@@ -2084,19 +2091,19 @@ function It({ content: s, streaming: t = !1, ...r }) {
|
|
|
2084
2091
|
}
|
|
2085
2092
|
);
|
|
2086
2093
|
}
|
|
2087
|
-
function
|
|
2094
|
+
function It({
|
|
2088
2095
|
count: s,
|
|
2089
2096
|
current: t = 0,
|
|
2090
|
-
done:
|
|
2097
|
+
done: n = [],
|
|
2091
2098
|
onChange: i,
|
|
2092
2099
|
showCounter: a = !0,
|
|
2093
|
-
className:
|
|
2100
|
+
className: r = "",
|
|
2094
2101
|
"aria-label": o = "Steps",
|
|
2095
2102
|
...l
|
|
2096
2103
|
}) {
|
|
2097
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator",
|
|
2104
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", r].filter(Boolean).join(" "), ...l, children: [
|
|
2098
2105
|
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": o, children: Array.from({ length: s }, (m, d) => {
|
|
2099
|
-
const f = d === t, p =
|
|
2106
|
+
const f = d === t, p = n.includes(d) && !f, h = i && (d <= t || n.includes(d)), u = [
|
|
2100
2107
|
"ds-step-indicator__dot",
|
|
2101
2108
|
f && "ds-step-indicator__dot--active",
|
|
2102
2109
|
p && "ds-step-indicator__dot--done"
|
|
@@ -2123,29 +2130,29 @@ function Bt({
|
|
|
2123
2130
|
] })
|
|
2124
2131
|
] });
|
|
2125
2132
|
}
|
|
2126
|
-
function
|
|
2133
|
+
function Bt({
|
|
2127
2134
|
content: s,
|
|
2128
2135
|
isStreaming: t = !1,
|
|
2129
|
-
cursor:
|
|
2136
|
+
cursor: n = "line",
|
|
2130
2137
|
onChunk: i,
|
|
2131
2138
|
className: a = "",
|
|
2132
|
-
...
|
|
2139
|
+
...r
|
|
2133
2140
|
}) {
|
|
2134
2141
|
const o = E(s);
|
|
2135
2142
|
return M(() => {
|
|
2136
2143
|
s !== o.current && (i == null || i(s), o.current = s);
|
|
2137
|
-
}, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...
|
|
2144
|
+
}, [s, i]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...r, children: [
|
|
2138
2145
|
s,
|
|
2139
|
-
t &&
|
|
2146
|
+
t && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2140
2147
|
] });
|
|
2141
2148
|
}
|
|
2142
|
-
function
|
|
2149
|
+
function Mt({
|
|
2143
2150
|
role: s = "assistant",
|
|
2144
2151
|
header: t,
|
|
2145
|
-
footer:
|
|
2152
|
+
footer: n,
|
|
2146
2153
|
attachments: i,
|
|
2147
2154
|
isStreaming: a = !1,
|
|
2148
|
-
children:
|
|
2155
|
+
children: r,
|
|
2149
2156
|
className: o = "",
|
|
2150
2157
|
...l
|
|
2151
2158
|
}) {
|
|
@@ -2155,77 +2162,77 @@ function Pt({
|
|
|
2155
2162
|
a && "ds-chat-message--streaming",
|
|
2156
2163
|
o
|
|
2157
2164
|
].filter(Boolean).join(" ");
|
|
2158
|
-
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children:
|
|
2165
|
+
return s === "system" ? /* @__PURE__ */ e.jsx("div", { className: m, ...l, children: /* @__PURE__ */ e.jsx("span", { className: "ds-chat-message__system-label", children: r }) }) : s === "user" ? /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2159
2166
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2160
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children:
|
|
2161
|
-
|
|
2167
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__bubble", children: r }),
|
|
2168
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2162
2169
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: m, ...l, children: [
|
|
2163
2170
|
t && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__header", children: t }),
|
|
2164
2171
|
i && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__attachments", children: i }),
|
|
2165
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children:
|
|
2166
|
-
|
|
2172
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__body", children: r }),
|
|
2173
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2167
2174
|
] });
|
|
2168
2175
|
}
|
|
2169
|
-
function
|
|
2176
|
+
function Pt(s, { containerRef: t, smartPause: n = !0 } = {}) {
|
|
2170
2177
|
const i = E(!1), a = E(0);
|
|
2171
2178
|
M(() => {
|
|
2172
|
-
const
|
|
2173
|
-
if (!
|
|
2179
|
+
const r = t == null ? void 0 : t.current;
|
|
2180
|
+
if (!r) return;
|
|
2174
2181
|
const o = () => {
|
|
2175
|
-
const l =
|
|
2176
|
-
!l &&
|
|
2182
|
+
const l = r.scrollHeight - r.scrollTop - r.clientHeight < 64;
|
|
2183
|
+
!l && r.scrollTop < a.current && (i.current = !0), l && (i.current = !1), a.current = r.scrollTop;
|
|
2177
2184
|
};
|
|
2178
|
-
return
|
|
2185
|
+
return r.addEventListener("scroll", o, { passive: !0 }), () => r.removeEventListener("scroll", o);
|
|
2179
2186
|
}, [t]), M(() => {
|
|
2180
|
-
const
|
|
2181
|
-
|
|
2187
|
+
const r = t == null ? void 0 : t.current;
|
|
2188
|
+
r && (n && i.current || (r.scrollTop = r.scrollHeight));
|
|
2182
2189
|
}, s);
|
|
2183
2190
|
}
|
|
2184
|
-
function
|
|
2191
|
+
function As({
|
|
2185
2192
|
prompts: s,
|
|
2186
2193
|
enabled: t,
|
|
2187
|
-
typingSpeed:
|
|
2194
|
+
typingSpeed: n = 38,
|
|
2188
2195
|
erasingSpeed: i = 18,
|
|
2189
2196
|
holdTime: a = 2200,
|
|
2190
|
-
betweenTime:
|
|
2197
|
+
betweenTime: r = 380,
|
|
2191
2198
|
manualPauseMs: o = 5e3
|
|
2192
2199
|
}) {
|
|
2193
|
-
const [l, m] =
|
|
2200
|
+
const [l, m] = D(0), [d, f] = D(""), p = E("typing"), h = E(0), u = E(0), _ = E(null), b = E(0);
|
|
2194
2201
|
M(() => {
|
|
2195
2202
|
u.current = l;
|
|
2196
2203
|
}, [l]), M(() => {
|
|
2197
|
-
if (
|
|
2204
|
+
if (_.current && (clearTimeout(_.current), _.current = null), !t || s.length === 0) {
|
|
2198
2205
|
f(""), h.current = 0, p.current = "typing";
|
|
2199
2206
|
return;
|
|
2200
2207
|
}
|
|
2201
2208
|
const $ = () => {
|
|
2202
2209
|
const O = Date.now();
|
|
2203
|
-
if (
|
|
2204
|
-
|
|
2210
|
+
if (b.current > O) {
|
|
2211
|
+
_.current = setTimeout($, b.current - O);
|
|
2205
2212
|
return;
|
|
2206
2213
|
}
|
|
2207
|
-
const
|
|
2208
|
-
p.current === "typing" ? (h.current += 1, f(
|
|
2214
|
+
const A = s[u.current % s.length] ?? "";
|
|
2215
|
+
p.current === "typing" ? (h.current += 1, f(A.slice(0, h.current)), h.current >= A.length ? (p.current = "holding", _.current = setTimeout($, a)) : _.current = setTimeout($, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", _.current = setTimeout($, i)) : (h.current = Math.max(0, h.current - 1), f(A.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", u.current = (u.current + 1) % s.length, m(u.current), _.current = setTimeout($, r)) : _.current = setTimeout($, i));
|
|
2209
2216
|
};
|
|
2210
|
-
return
|
|
2211
|
-
|
|
2217
|
+
return _.current = setTimeout($, 260), () => {
|
|
2218
|
+
_.current && clearTimeout(_.current);
|
|
2212
2219
|
};
|
|
2213
|
-
}, [t, s,
|
|
2220
|
+
}, [t, s, n, i, a, r]);
|
|
2214
2221
|
const S = ($) => {
|
|
2215
2222
|
if (s.length === 0) return;
|
|
2216
|
-
const O = ($ % s.length + s.length) % s.length,
|
|
2217
|
-
u.current = O, h.current =
|
|
2223
|
+
const O = ($ % s.length + s.length) % s.length, A = s[O];
|
|
2224
|
+
u.current = O, h.current = A.length, p.current = "holding", b.current = Date.now() + o, m(O), f(A);
|
|
2218
2225
|
}, R = () => S(u.current + 1), B = () => S(u.current - 1), y = s[l % s.length] ?? "";
|
|
2219
2226
|
return { displayed: d, currentPrompt: y, index: l, next: R, prev: B };
|
|
2220
2227
|
}
|
|
2221
2228
|
let Is = 0;
|
|
2222
|
-
function
|
|
2229
|
+
function Lt({
|
|
2223
2230
|
value: s = "",
|
|
2224
2231
|
onChange: t,
|
|
2225
|
-
onSubmit:
|
|
2232
|
+
onSubmit: n,
|
|
2226
2233
|
onStop: i,
|
|
2227
2234
|
onKeyDown: a,
|
|
2228
|
-
loading:
|
|
2235
|
+
loading: r = !1,
|
|
2229
2236
|
disabled: o = !1,
|
|
2230
2237
|
placeholder: l = "Let's get things done...",
|
|
2231
2238
|
animatedPlaceholders: m,
|
|
@@ -2234,58 +2241,58 @@ function zt({
|
|
|
2234
2241
|
onAttachFiles: p,
|
|
2235
2242
|
onAttachImages: h,
|
|
2236
2243
|
onRemoveAttachment: u,
|
|
2237
|
-
onRemoveImage:
|
|
2238
|
-
acceptImage:
|
|
2244
|
+
onRemoveImage: _,
|
|
2245
|
+
acceptImage: b,
|
|
2239
2246
|
acceptFile: S,
|
|
2240
2247
|
maxImages: R,
|
|
2241
2248
|
maxImageSize: B,
|
|
2242
2249
|
leftSlot: y,
|
|
2243
2250
|
rightSlot: $,
|
|
2244
2251
|
className: O = "",
|
|
2245
|
-
...
|
|
2252
|
+
...A
|
|
2246
2253
|
}) {
|
|
2247
|
-
const Y = E(null), q = E(null), P = E(0), [N, C] =
|
|
2254
|
+
const Y = E(null), q = E(null), P = E(0), [N, C] = D(!1), [X, U] = D([]), x = (j) => {
|
|
2248
2255
|
const T = ++Is;
|
|
2249
|
-
U((V) => [...V, { id: T, msg:
|
|
2250
|
-
}, v = (
|
|
2256
|
+
U((V) => [...V, { id: T, msg: j }]), setTimeout(() => U((V) => V.filter((J) => J.id !== T)), 6e3);
|
|
2257
|
+
}, v = (j) => U((T) => T.filter((V) => V.id !== j)), k = (j) => j.type.startsWith("image/"), L = () => !0, H = b ?? k, G = S ?? L, g = (j) => {
|
|
2251
2258
|
const T = [], V = [], J = [], Z = [];
|
|
2252
|
-
let ee = 0,
|
|
2253
|
-
for (const se of
|
|
2254
|
-
H(se) ? B && se.size > B ? J.push(se.name) :
|
|
2259
|
+
let ee = 0, oe = R != null ? R - ((f == null ? void 0 : f.length) ?? 0) : 1 / 0;
|
|
2260
|
+
for (const se of j)
|
|
2261
|
+
H(se) ? B && se.size > B ? J.push(se.name) : oe > 0 ? (T.push(se), oe--) : ee++ : G(se) ? V.push(se) : Z.push(se.name);
|
|
2255
2262
|
return { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee };
|
|
2256
|
-
}, c = (
|
|
2257
|
-
const { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(
|
|
2263
|
+
}, c = (j) => {
|
|
2264
|
+
const { imageFiles: T, docFiles: V, tooLarge: J, skipped: Z, limitExceeded: ee } = g(j);
|
|
2258
2265
|
J.length && x(`File${J.length > 1 ? "s" : ""} too large${B ? ` (max ${B / 1024 / 1024}MB)` : ""}: ${J.join(", ")}`), Z.length && x(`Skipped unsupported file${Z.length > 1 ? "s" : ""}: ${Z.join(", ")}`), ee && x(`Max ${R} images per message`), h && T.length && h(T);
|
|
2259
|
-
const
|
|
2260
|
-
p &&
|
|
2266
|
+
const oe = V.concat(h ? [] : T);
|
|
2267
|
+
p && oe.length && p(oe);
|
|
2261
2268
|
};
|
|
2262
2269
|
M(() => {
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2270
|
+
const j = q.current;
|
|
2271
|
+
j && (j.style.height = "auto", j.style.height = `${Math.min(j.scrollHeight, 200)}px`);
|
|
2265
2272
|
}, [s]), M(() => {
|
|
2266
|
-
const
|
|
2273
|
+
const j = (T) => {
|
|
2267
2274
|
var J, Z, ee;
|
|
2268
|
-
if (
|
|
2275
|
+
if (r || o) return;
|
|
2269
2276
|
const V = (J = T.target) == null ? void 0 : J.tagName;
|
|
2270
2277
|
V === "INPUT" || V === "TEXTAREA" || V === "SELECT" || (Z = T.target) != null && Z.isContentEditable || T.ctrlKey || T.metaKey || T.altKey || T.key.length !== 1 && T.key !== "Backspace" && T.key !== "Delete" || (ee = q.current) == null || ee.focus();
|
|
2271
2278
|
};
|
|
2272
|
-
return document.addEventListener("keydown",
|
|
2273
|
-
}, [
|
|
2274
|
-
const w = (
|
|
2275
|
-
|
|
2276
|
-
}, z = (
|
|
2277
|
-
|
|
2278
|
-
}, F = (
|
|
2279
|
-
|
|
2280
|
-
const T = Array.from(
|
|
2279
|
+
return document.addEventListener("keydown", j), () => document.removeEventListener("keydown", j);
|
|
2280
|
+
}, [r, o]);
|
|
2281
|
+
const w = (j) => {
|
|
2282
|
+
j.preventDefault(), P.current++, j.dataTransfer.types.includes("Files") && C(!0);
|
|
2283
|
+
}, z = (j) => {
|
|
2284
|
+
j.preventDefault(), P.current--, P.current === 0 && C(!1);
|
|
2285
|
+
}, F = (j) => j.preventDefault(), te = (j) => {
|
|
2286
|
+
j.preventDefault(), P.current = 0, C(!1);
|
|
2287
|
+
const T = Array.from(j.dataTransfer.files);
|
|
2281
2288
|
T.length && c(T);
|
|
2282
|
-
},
|
|
2283
|
-
const T = Array.from(
|
|
2289
|
+
}, ae = (j) => {
|
|
2290
|
+
const T = Array.from(j.target.files || []);
|
|
2284
2291
|
Y.current && (Y.current.value = ""), T.length && c(T);
|
|
2285
|
-
}, W = (
|
|
2292
|
+
}, W = (j) => {
|
|
2286
2293
|
var se;
|
|
2287
2294
|
if (!h) return;
|
|
2288
|
-
const T = (se =
|
|
2295
|
+
const T = (se = j.clipboardData) == null ? void 0 : se.items;
|
|
2289
2296
|
if (!T) return;
|
|
2290
2297
|
const V = [];
|
|
2291
2298
|
for (const Ue of T) {
|
|
@@ -2293,29 +2300,29 @@ function zt({
|
|
|
2293
2300
|
Te && V.push(Te);
|
|
2294
2301
|
}
|
|
2295
2302
|
if (V.length === 0) return;
|
|
2296
|
-
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded:
|
|
2297
|
-
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`),
|
|
2298
|
-
}, Q = !
|
|
2303
|
+
const { imageFiles: J, tooLarge: Z, skipped: ee, limitExceeded: oe } = g(V);
|
|
2304
|
+
Z.length && x(`File${Z.length > 1 ? "s" : ""} too large: ${Z.join(", ")}`), ee.length && x(`Skipped unsupported file${ee.length > 1 ? "s" : ""}: ${ee.join(", ")}`), oe && x(`Max ${R} images per message`), J.length && (j.preventDefault(), h(J));
|
|
2305
|
+
}, Q = !r && !o && !!(m != null && m.length) && s.length === 0, ie = As({
|
|
2299
2306
|
prompts: m ?? [],
|
|
2300
2307
|
enabled: Q
|
|
2301
|
-
}), xe = (
|
|
2308
|
+
}), xe = (j) => {
|
|
2302
2309
|
if (Q) {
|
|
2303
|
-
if (
|
|
2304
|
-
|
|
2310
|
+
if (j.key === "ArrowDown" || j.key === "ArrowRight") {
|
|
2311
|
+
j.preventDefault(), ie.next();
|
|
2305
2312
|
return;
|
|
2306
2313
|
}
|
|
2307
|
-
if (
|
|
2308
|
-
|
|
2314
|
+
if (j.key === "ArrowUp" || j.key === "ArrowLeft") {
|
|
2315
|
+
j.preventDefault(), ie.prev();
|
|
2309
2316
|
return;
|
|
2310
2317
|
}
|
|
2311
|
-
if (
|
|
2312
|
-
|
|
2318
|
+
if (j.key === "Tab" && !j.shiftKey) {
|
|
2319
|
+
j.preventDefault(), t == null || t(ie.currentPrompt);
|
|
2313
2320
|
return;
|
|
2314
2321
|
}
|
|
2315
2322
|
}
|
|
2316
|
-
a == null || a(
|
|
2323
|
+
a == null || a(j);
|
|
2317
2324
|
}, Ce = (s.trim() || (f == null ? void 0 : f.length) > 0 || (d == null ? void 0 : d.length) > 0) && !o, $e = p || h;
|
|
2318
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...
|
|
2325
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", O].filter(Boolean).join(" "), ...A, children: [
|
|
2319
2326
|
$e && /* @__PURE__ */ e.jsx(
|
|
2320
2327
|
"input",
|
|
2321
2328
|
{
|
|
@@ -2324,7 +2331,7 @@ function zt({
|
|
|
2324
2331
|
multiple: !0,
|
|
2325
2332
|
accept: "*/*",
|
|
2326
2333
|
className: "ds-prompt-input__file-input",
|
|
2327
|
-
onChange:
|
|
2334
|
+
onChange: ae
|
|
2328
2335
|
}
|
|
2329
2336
|
),
|
|
2330
2337
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -2342,55 +2349,55 @@ function zt({
|
|
|
2342
2349
|
{
|
|
2343
2350
|
ref: q,
|
|
2344
2351
|
value: s,
|
|
2345
|
-
onChange: (
|
|
2352
|
+
onChange: (j) => t == null ? void 0 : t(j.target.value),
|
|
2346
2353
|
onKeyDown: xe,
|
|
2347
2354
|
onPaste: W,
|
|
2348
2355
|
placeholder: Q ? "" : l,
|
|
2349
|
-
disabled:
|
|
2356
|
+
disabled: r || o,
|
|
2350
2357
|
rows: 1,
|
|
2351
2358
|
className: ["ds-prompt-input__textarea", Q && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
2352
2359
|
}
|
|
2353
2360
|
),
|
|
2354
2361
|
Q && /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__anim", "aria-hidden": "true", children: [
|
|
2355
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children:
|
|
2362
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ie.displayed }),
|
|
2356
2363
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
2357
2364
|
] }),
|
|
2358
|
-
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((
|
|
2359
|
-
/* @__PURE__ */ e.jsx("img", { src:
|
|
2365
|
+
f && f.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: f.map((j, T) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
2366
|
+
/* @__PURE__ */ e.jsx("img", { src: j.preview, alt: "" }),
|
|
2360
2367
|
/* @__PURE__ */ e.jsx(
|
|
2361
2368
|
"button",
|
|
2362
2369
|
{
|
|
2363
2370
|
className: "ds-prompt-input__image-remove",
|
|
2364
|
-
onClick: () =>
|
|
2371
|
+
onClick: () => _ == null ? void 0 : _(T),
|
|
2365
2372
|
"aria-label": "Remove image",
|
|
2366
2373
|
type: "button",
|
|
2367
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2374
|
+
children: /* @__PURE__ */ e.jsx(re, { size: 12, strokeWidth: 2 })
|
|
2368
2375
|
}
|
|
2369
2376
|
)
|
|
2370
2377
|
] }, T)) }),
|
|
2371
|
-
|
|
2372
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2378
|
+
X.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: X.map((j) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
2379
|
+
/* @__PURE__ */ e.jsx("span", { children: j.msg }),
|
|
2373
2380
|
/* @__PURE__ */ e.jsx(
|
|
2374
2381
|
"button",
|
|
2375
2382
|
{
|
|
2376
2383
|
type: "button",
|
|
2377
2384
|
className: "ds-prompt-input__warning-close",
|
|
2378
|
-
onClick: () => v(
|
|
2385
|
+
onClick: () => v(j.id),
|
|
2379
2386
|
"aria-label": "Dismiss",
|
|
2380
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2387
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[1], strokeWidth: 1.5 })
|
|
2381
2388
|
}
|
|
2382
2389
|
)
|
|
2383
|
-
] },
|
|
2384
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2390
|
+
] }, j.id)) }),
|
|
2391
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: d.map((j, T) => /* @__PURE__ */ e.jsx(ce, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
2392
|
+
j.uploading ? /* @__PURE__ */ e.jsx(Qe, { size: I[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Re, { size: I[1], strokeWidth: 1.5 }),
|
|
2393
|
+
j.filename,
|
|
2394
|
+
j.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: "Uploading..." }) : /* @__PURE__ */ e.jsx(
|
|
2388
2395
|
"button",
|
|
2389
2396
|
{
|
|
2390
2397
|
type: "button",
|
|
2391
2398
|
className: "ds-prompt-input__remove-btn",
|
|
2392
2399
|
onClick: () => u == null ? void 0 : u(T),
|
|
2393
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2400
|
+
children: /* @__PURE__ */ e.jsx(re, { size: I[1], strokeWidth: 1.5 })
|
|
2394
2401
|
}
|
|
2395
2402
|
)
|
|
2396
2403
|
] }) }, T)) }),
|
|
@@ -2403,15 +2410,15 @@ function zt({
|
|
|
2403
2410
|
icon: /* @__PURE__ */ e.jsx(Re, { size: I[2], strokeWidth: 1.5 }),
|
|
2404
2411
|
"aria-label": "Attach files",
|
|
2405
2412
|
onClick: () => {
|
|
2406
|
-
var
|
|
2407
|
-
return (
|
|
2413
|
+
var j;
|
|
2414
|
+
return (j = Y.current) == null ? void 0 : j.click();
|
|
2408
2415
|
}
|
|
2409
2416
|
}
|
|
2410
2417
|
),
|
|
2411
2418
|
y,
|
|
2412
2419
|
$,
|
|
2413
2420
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
2414
|
-
|
|
2421
|
+
r ? /* @__PURE__ */ e.jsx(
|
|
2415
2422
|
me,
|
|
2416
2423
|
{
|
|
2417
2424
|
variant: "primary",
|
|
@@ -2426,7 +2433,7 @@ function zt({
|
|
|
2426
2433
|
variant: "primary",
|
|
2427
2434
|
size: "xs",
|
|
2428
2435
|
icon: /* @__PURE__ */ e.jsx(ss, { size: I[2], strokeWidth: 1.5 }),
|
|
2429
|
-
onClick:
|
|
2436
|
+
onClick: n,
|
|
2430
2437
|
disabled: !Ce,
|
|
2431
2438
|
"aria-label": "Send"
|
|
2432
2439
|
}
|
|
@@ -2438,18 +2445,18 @@ function zt({
|
|
|
2438
2445
|
] });
|
|
2439
2446
|
}
|
|
2440
2447
|
const Pe = { fast: 0, standard: 1, premium: 2 }, Le = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
2441
|
-
function
|
|
2448
|
+
function zt({
|
|
2442
2449
|
models: s = [],
|
|
2443
2450
|
value: t,
|
|
2444
|
-
onChange:
|
|
2451
|
+
onChange: n,
|
|
2445
2452
|
size: i = "xs",
|
|
2446
2453
|
minTier: a,
|
|
2447
|
-
showAutoOption:
|
|
2454
|
+
showAutoOption: r = !1,
|
|
2448
2455
|
groupByTier: o = !0,
|
|
2449
2456
|
className: l = "",
|
|
2450
2457
|
...m
|
|
2451
2458
|
}) {
|
|
2452
|
-
const [d, f] =
|
|
2459
|
+
const [d, f] = D(!1), p = E(null), h = E(null), u = E(null), [_, b] = D({}), S = s.filter((N) => !a || N.name === "auto" ? !0 : (Pe[N.tier] ?? 1) >= (Pe[a] ?? 1)), R = S.find((N) => N.name === "auto"), B = S.filter((N) => N.name !== "auto"), y = s.find((N) => N.name === t), O = new Set(B.map((N) => N.tier).filter(Boolean)).size > 1;
|
|
2453
2460
|
M(() => {
|
|
2454
2461
|
if (!d) return;
|
|
2455
2462
|
const N = 320, C = () => {
|
|
@@ -2457,7 +2464,7 @@ function Ot({
|
|
|
2457
2464
|
const x = (L = h.current) == null ? void 0 : L.getBoundingClientRect();
|
|
2458
2465
|
if (!x) return;
|
|
2459
2466
|
const v = window.innerHeight - x.bottom, k = v < N + 8 && x.top > v;
|
|
2460
|
-
|
|
2467
|
+
b({
|
|
2461
2468
|
position: "fixed",
|
|
2462
2469
|
zIndex: "var(--z-dropdown, 500)",
|
|
2463
2470
|
left: x.left,
|
|
@@ -2465,18 +2472,18 @@ function Ot({
|
|
|
2465
2472
|
});
|
|
2466
2473
|
};
|
|
2467
2474
|
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
2468
|
-
const
|
|
2475
|
+
const X = (x) => {
|
|
2469
2476
|
var v, k;
|
|
2470
2477
|
!((v = p.current) != null && v.contains(x.target)) && !((k = u.current) != null && k.contains(x.target)) && f(!1);
|
|
2471
2478
|
}, U = (x) => {
|
|
2472
2479
|
x.key === "Escape" && f(!1);
|
|
2473
2480
|
};
|
|
2474
|
-
return document.addEventListener("mousedown",
|
|
2475
|
-
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown",
|
|
2481
|
+
return document.addEventListener("mousedown", X), document.addEventListener("keydown", U), () => {
|
|
2482
|
+
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", X), document.removeEventListener("keydown", U);
|
|
2476
2483
|
};
|
|
2477
2484
|
}, [d]);
|
|
2478
|
-
const
|
|
2479
|
-
|
|
2485
|
+
const A = (N) => {
|
|
2486
|
+
n == null || n(N), f(!1);
|
|
2480
2487
|
}, Y = (N) => /* @__PURE__ */ e.jsxs(
|
|
2481
2488
|
"button",
|
|
2482
2489
|
{
|
|
@@ -2485,22 +2492,22 @@ function Ot({
|
|
|
2485
2492
|
"ds-model-picker__item",
|
|
2486
2493
|
N.name === t && "ds-model-picker__item--active"
|
|
2487
2494
|
].filter(Boolean).join(" "),
|
|
2488
|
-
onClick: () =>
|
|
2495
|
+
onClick: () => A(N.name),
|
|
2489
2496
|
children: [
|
|
2490
2497
|
N.icon ? /* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: N.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2491
2498
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: N.displayName || N.name }),
|
|
2492
|
-
O && N.tier && /* @__PURE__ */ e.jsx(
|
|
2499
|
+
O && N.tier && /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: Le[N.tier] || "default", children: N.tier })
|
|
2493
2500
|
]
|
|
2494
2501
|
},
|
|
2495
2502
|
N.name
|
|
2496
2503
|
), q = () => !o || !O ? B.map(Y) : ["fast", "standard", "premium"].flatMap((N) => {
|
|
2497
|
-
const C = B.filter((
|
|
2504
|
+
const C = B.filter((X) => X.tier === N);
|
|
2498
2505
|
return C.length ? [
|
|
2499
2506
|
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": N, children: N.charAt(0).toUpperCase() + N.slice(1) }, `lbl-${N}`),
|
|
2500
2507
|
...C.map(Y)
|
|
2501
2508
|
] : [];
|
|
2502
|
-
}), P = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu", style:
|
|
2503
|
-
|
|
2509
|
+
}), P = d && /* @__PURE__ */ e.jsxs("div", { ref: u, className: "ds-model-picker__menu", style: _, children: [
|
|
2510
|
+
r && R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2504
2511
|
/* @__PURE__ */ e.jsxs(
|
|
2505
2512
|
"button",
|
|
2506
2513
|
{
|
|
@@ -2510,7 +2517,7 @@ function Ot({
|
|
|
2510
2517
|
"ds-model-picker__item--auto",
|
|
2511
2518
|
t === "auto" && "ds-model-picker__item--active"
|
|
2512
2519
|
].filter(Boolean).join(" "),
|
|
2513
|
-
onClick: () =>
|
|
2520
|
+
onClick: () => A("auto"),
|
|
2514
2521
|
children: [
|
|
2515
2522
|
/* @__PURE__ */ e.jsx(ts, { size: 12, strokeWidth: 1.5, className: "ds-model-picker__item-icon" }),
|
|
2516
2523
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
@@ -2540,7 +2547,7 @@ function Ot({
|
|
|
2540
2547
|
children: [
|
|
2541
2548
|
y != null && y.icon ? /* @__PURE__ */ e.jsx("span", { children: y.icon }) : /* @__PURE__ */ e.jsx(Se, { size: 12, strokeWidth: 1.5 }),
|
|
2542
2549
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (y == null ? void 0 : y.displayName) || (y == null ? void 0 : y.name) || t }),
|
|
2543
|
-
O && (y == null ? void 0 : y.tier) && /* @__PURE__ */ e.jsx(
|
|
2550
|
+
O && (y == null ? void 0 : y.tier) && /* @__PURE__ */ e.jsx(ce, { size: "xs", variant: Le[y.tier] || "default", children: y.tier })
|
|
2544
2551
|
]
|
|
2545
2552
|
}
|
|
2546
2553
|
),
|
|
@@ -2558,28 +2565,28 @@ function ve(s) {
|
|
|
2558
2565
|
}
|
|
2559
2566
|
function Ms(s) {
|
|
2560
2567
|
const t = /* @__PURE__ */ new Map();
|
|
2561
|
-
for (const
|
|
2562
|
-
t.has(
|
|
2568
|
+
for (const n of s)
|
|
2569
|
+
t.has(n.filename) || t.set(n.filename, { filename: n.filename, url: n.url, items: [] }), t.get(n.filename).items.push(n);
|
|
2563
2570
|
return [...t.values()];
|
|
2564
2571
|
}
|
|
2565
|
-
function
|
|
2572
|
+
function Ot({
|
|
2566
2573
|
sources: s = [],
|
|
2567
2574
|
layout: t = "list",
|
|
2568
|
-
title:
|
|
2575
|
+
title: n = "Sources",
|
|
2569
2576
|
maxVisible: i = 5,
|
|
2570
2577
|
onSourceClick: a
|
|
2571
2578
|
}) {
|
|
2572
|
-
const [
|
|
2579
|
+
const [r, o] = D(!1), l = Ms(s), m = l.length > i, d = r ? l : l.slice(0, i), f = s.some((h) => h.snippet), p = ["ds-sources-panel", t === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
2573
2580
|
return t === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2574
2581
|
d.map((h) => {
|
|
2575
|
-
const u = h.items.map((
|
|
2582
|
+
const u = h.items.map((b) => b.page).filter(Boolean), _ = !!a;
|
|
2576
2583
|
return /* @__PURE__ */ e.jsxs(
|
|
2577
2584
|
"div",
|
|
2578
2585
|
{
|
|
2579
|
-
className: `ds-sources-panel__compact-row${
|
|
2580
|
-
onClick:
|
|
2586
|
+
className: `ds-sources-panel__compact-row${_ ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
2587
|
+
onClick: _ ? () => a(h.items[0]) : void 0,
|
|
2581
2588
|
children: [
|
|
2582
|
-
/* @__PURE__ */ e.jsx(
|
|
2589
|
+
/* @__PURE__ */ e.jsx(ns, { size: I[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
2583
2590
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2584
2591
|
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(u) })
|
|
2585
2592
|
]
|
|
@@ -2587,26 +2594,26 @@ function Ft({
|
|
|
2587
2594
|
h.filename
|
|
2588
2595
|
);
|
|
2589
2596
|
}),
|
|
2590
|
-
m && !
|
|
2597
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2591
2598
|
"+",
|
|
2592
2599
|
l.length - i,
|
|
2593
2600
|
" more sources"
|
|
2594
2601
|
] })
|
|
2595
2602
|
] }) : /* @__PURE__ */ e.jsxs("div", { className: p, children: [
|
|
2596
|
-
|
|
2603
|
+
n && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: n }),
|
|
2597
2604
|
d.map((h) => {
|
|
2598
|
-
const u = h.items.map((
|
|
2605
|
+
const u = h.items.map((b) => b.page).filter(Boolean), _ = !!a;
|
|
2599
2606
|
return f ? /* @__PURE__ */ e.jsx(
|
|
2600
2607
|
Ee,
|
|
2601
2608
|
{
|
|
2602
2609
|
title: /* @__PURE__ */ e.jsx(Bs, { filename: h.filename, pages: u }),
|
|
2603
2610
|
padding: "s",
|
|
2604
|
-
children: h.items.map((
|
|
2611
|
+
children: h.items.map((b, S) => /* @__PURE__ */ e.jsx(
|
|
2605
2612
|
"div",
|
|
2606
2613
|
{
|
|
2607
|
-
className: `ds-sources-panel__snippet${
|
|
2608
|
-
onClick:
|
|
2609
|
-
children:
|
|
2614
|
+
className: `ds-sources-panel__snippet${_ ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
2615
|
+
onClick: _ ? () => a(b) : void 0,
|
|
2616
|
+
children: b.snippet ?? `p. ${b.page}`
|
|
2610
2617
|
},
|
|
2611
2618
|
S
|
|
2612
2619
|
))
|
|
@@ -2615,8 +2622,8 @@ function Ft({
|
|
|
2615
2622
|
) : /* @__PURE__ */ e.jsxs(
|
|
2616
2623
|
"div",
|
|
2617
2624
|
{
|
|
2618
|
-
className: `ds-sources-panel__row${
|
|
2619
|
-
onClick:
|
|
2625
|
+
className: `ds-sources-panel__row${_ ? " ds-sources-panel__row--clickable" : ""}`,
|
|
2626
|
+
onClick: _ ? () => a(h.items[0]) : void 0,
|
|
2620
2627
|
children: [
|
|
2621
2628
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: h.filename }),
|
|
2622
2629
|
u.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: ve(u) })
|
|
@@ -2625,7 +2632,7 @@ function Ft({
|
|
|
2625
2632
|
h.filename
|
|
2626
2633
|
);
|
|
2627
2634
|
}),
|
|
2628
|
-
m && !
|
|
2635
|
+
m && !r && /* @__PURE__ */ e.jsxs("button", { className: "ds-sources-panel__more", onClick: () => o(!0), children: [
|
|
2629
2636
|
"+",
|
|
2630
2637
|
l.length - i,
|
|
2631
2638
|
" more sources"
|
|
@@ -2635,20 +2642,20 @@ function Ft({
|
|
|
2635
2642
|
function ze(s) {
|
|
2636
2643
|
return s >= 1e6 ? (s / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : s >= 1e3 ? (s / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(s);
|
|
2637
2644
|
}
|
|
2638
|
-
function
|
|
2645
|
+
function Ft({
|
|
2639
2646
|
used: s,
|
|
2640
2647
|
limit: t,
|
|
2641
|
-
size:
|
|
2648
|
+
size: n = "s",
|
|
2642
2649
|
showCount: i = !0,
|
|
2643
2650
|
showPercent: a = !1,
|
|
2644
|
-
warningThreshold:
|
|
2651
|
+
warningThreshold: r = 0.8,
|
|
2645
2652
|
errorThreshold: o = 1
|
|
2646
2653
|
}) {
|
|
2647
|
-
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >=
|
|
2654
|
+
const l = t > 0 ? s / t : 0, m = Math.min(l * 100, 100), d = l >= o ? "error" : l >= r ? "warning" : "normal";
|
|
2648
2655
|
return /* @__PURE__ */ e.jsxs(
|
|
2649
2656
|
"div",
|
|
2650
2657
|
{
|
|
2651
|
-
className: `ds-token-counter ds-token-counter--${
|
|
2658
|
+
className: `ds-token-counter ds-token-counter--${n}`,
|
|
2652
2659
|
role: "meter",
|
|
2653
2660
|
"aria-valuenow": s,
|
|
2654
2661
|
"aria-valuemax": t,
|
|
@@ -2680,13 +2687,13 @@ const Oe = 5;
|
|
|
2680
2687
|
function Ps(s) {
|
|
2681
2688
|
return s < 0.34 ? "low" : s < 0.67 ? "medium" : "high";
|
|
2682
2689
|
}
|
|
2683
|
-
function
|
|
2690
|
+
function Wt({
|
|
2684
2691
|
value: s = 0,
|
|
2685
2692
|
size: t = "xs",
|
|
2686
|
-
showLabel:
|
|
2693
|
+
showLabel: n = "none",
|
|
2687
2694
|
layout: i = "inline"
|
|
2688
2695
|
}) {
|
|
2689
|
-
const a = Math.max(0, Math.min(1, s)),
|
|
2696
|
+
const a = Math.max(0, Math.min(1, s)), r = Math.round(a * Oe), o = Ps(a);
|
|
2690
2697
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
2691
2698
|
"ds-confidence-bar",
|
|
2692
2699
|
`ds-confidence-bar--${t}`,
|
|
@@ -2696,95 +2703,68 @@ function Ct({
|
|
|
2696
2703
|
/* @__PURE__ */ e.jsx("div", { className: "ds-confidence-bar__segments", "aria-hidden": "true", children: Array.from({ length: Oe }, (l, m) => /* @__PURE__ */ e.jsx(
|
|
2697
2704
|
"div",
|
|
2698
2705
|
{
|
|
2699
|
-
className: `ds-confidence-bar__seg${m <
|
|
2706
|
+
className: `ds-confidence-bar__seg${m < r ? " ds-confidence-bar__seg--filled" : ""}`
|
|
2700
2707
|
},
|
|
2701
2708
|
m
|
|
2702
2709
|
)) }),
|
|
2703
|
-
|
|
2710
|
+
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: o })
|
|
2704
2711
|
] });
|
|
2705
2712
|
}
|
|
2706
2713
|
const Ls = { add: "+", remove: "-", context: " " };
|
|
2707
|
-
function
|
|
2714
|
+
function _e({ line: s, lineNumbers: t }) {
|
|
2708
2715
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${s.type}`, children: [
|
|
2709
2716
|
t && s.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: s.lineNo }),
|
|
2710
2717
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: Ls[s.type] }),
|
|
2711
2718
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: s.text })
|
|
2712
2719
|
] });
|
|
2713
2720
|
}
|
|
2714
|
-
function
|
|
2721
|
+
function Ct({
|
|
2715
2722
|
lines: s = [],
|
|
2716
2723
|
layout: t = "inline",
|
|
2717
|
-
wordWrap:
|
|
2724
|
+
wordWrap: n = !1,
|
|
2718
2725
|
lineNumbers: i = !0,
|
|
2719
2726
|
maxHeight: a,
|
|
2720
|
-
title:
|
|
2727
|
+
title: r
|
|
2721
2728
|
}) {
|
|
2722
2729
|
const o = [
|
|
2723
2730
|
"ds-diff-view",
|
|
2724
2731
|
`ds-diff-view--${t}`,
|
|
2725
|
-
|
|
2732
|
+
n && "ds-diff-view--wrap"
|
|
2726
2733
|
].filter(Boolean).join(" "), l = a ? { maxHeight: a, overflowY: "auto" } : void 0;
|
|
2727
2734
|
if (t === "split") {
|
|
2728
2735
|
const m = s.filter((f) => f.type === "remove" || f.type === "context"), d = s.filter((f) => f.type === "add" || f.type === "context");
|
|
2729
2736
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2730
|
-
|
|
2737
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2731
2738
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-diff-view__body", style: l, children: [
|
|
2732
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(
|
|
2733
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(
|
|
2739
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: m.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) }),
|
|
2740
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__split-col", children: d.map((f, p) => /* @__PURE__ */ e.jsx(_e, { line: f, lineNumbers: i }, p)) })
|
|
2734
2741
|
] })
|
|
2735
2742
|
] });
|
|
2736
2743
|
}
|
|
2737
2744
|
return /* @__PURE__ */ e.jsxs("div", { className: o, children: [
|
|
2738
|
-
|
|
2739
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(
|
|
2745
|
+
r && /* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__title", children: r }),
|
|
2746
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body", style: l, children: s.map((m, d) => /* @__PURE__ */ e.jsx(_e, { line: m, lineNumbers: i }, d)) })
|
|
2740
2747
|
] });
|
|
2741
2748
|
}
|
|
2742
|
-
|
|
2743
|
-
running: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "info", children: "Running…" }),
|
|
2744
|
-
success: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "success", children: "Done" }),
|
|
2745
|
-
error: /* @__PURE__ */ e.jsx(ae, { size: "xs", variant: "error", children: "Error" })
|
|
2746
|
-
};
|
|
2747
|
-
function Vt({
|
|
2748
|
-
label: s,
|
|
2749
|
-
status: t = "idle",
|
|
2750
|
-
icon: r,
|
|
2751
|
-
badge: i,
|
|
2752
|
-
className: a = "",
|
|
2753
|
-
...n
|
|
2754
|
-
}) {
|
|
2755
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2756
|
-
"div",
|
|
2757
|
-
{
|
|
2758
|
-
className: ["ds-tool-bubble", a].filter(Boolean).join(" "),
|
|
2759
|
-
...n,
|
|
2760
|
-
children: [
|
|
2761
|
-
r && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-bubble__icon", children: r }),
|
|
2762
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-bubble__label", children: s }),
|
|
2763
|
-
zs[t],
|
|
2764
|
-
i
|
|
2765
|
-
]
|
|
2766
|
-
}
|
|
2767
|
-
);
|
|
2768
|
-
}
|
|
2769
|
-
function Os({
|
|
2749
|
+
function zs({
|
|
2770
2750
|
value: s = "idle",
|
|
2771
2751
|
onLike: t,
|
|
2772
|
-
onDislike:
|
|
2752
|
+
onDislike: n,
|
|
2773
2753
|
className: i = "",
|
|
2774
2754
|
...a
|
|
2775
2755
|
}) {
|
|
2776
|
-
const
|
|
2756
|
+
const r = s !== "idle";
|
|
2777
2757
|
return /* @__PURE__ */ e.jsxs(
|
|
2778
2758
|
"div",
|
|
2779
2759
|
{
|
|
2780
2760
|
className: [
|
|
2781
2761
|
"ds-message-feedback",
|
|
2782
|
-
|
|
2762
|
+
r && "ds-message-feedback--voted",
|
|
2783
2763
|
i
|
|
2784
2764
|
].filter(Boolean).join(" "),
|
|
2785
2765
|
...a,
|
|
2786
2766
|
children: [
|
|
2787
|
-
(!
|
|
2767
|
+
(!r || s === "liked") && /* @__PURE__ */ e.jsx(
|
|
2788
2768
|
"button",
|
|
2789
2769
|
{
|
|
2790
2770
|
className: [
|
|
@@ -2792,11 +2772,11 @@ function Os({
|
|
|
2792
2772
|
s === "liked" && "ds-message-feedback__btn--liked"
|
|
2793
2773
|
].filter(Boolean).join(" "),
|
|
2794
2774
|
onClick: t,
|
|
2795
|
-
disabled:
|
|
2775
|
+
disabled: r,
|
|
2796
2776
|
"aria-label": "Like",
|
|
2797
2777
|
"aria-pressed": s === "liked",
|
|
2798
2778
|
children: /* @__PURE__ */ e.jsx(
|
|
2799
|
-
|
|
2779
|
+
rs,
|
|
2800
2780
|
{
|
|
2801
2781
|
size: I[1],
|
|
2802
2782
|
strokeWidth: 1.5,
|
|
@@ -2805,15 +2785,15 @@ function Os({
|
|
|
2805
2785
|
)
|
|
2806
2786
|
}
|
|
2807
2787
|
),
|
|
2808
|
-
(!
|
|
2788
|
+
(!r || s === "disliked") && /* @__PURE__ */ e.jsx(
|
|
2809
2789
|
"button",
|
|
2810
2790
|
{
|
|
2811
2791
|
className: [
|
|
2812
2792
|
"ds-message-feedback__btn",
|
|
2813
2793
|
s === "disliked" && "ds-message-feedback__btn--disliked"
|
|
2814
2794
|
].filter(Boolean).join(" "),
|
|
2815
|
-
onClick:
|
|
2816
|
-
disabled:
|
|
2795
|
+
onClick: n,
|
|
2796
|
+
disabled: r,
|
|
2817
2797
|
"aria-label": "Dislike",
|
|
2818
2798
|
"aria-pressed": s === "disliked",
|
|
2819
2799
|
children: /* @__PURE__ */ e.jsx(
|
|
@@ -2830,26 +2810,26 @@ function Os({
|
|
|
2830
2810
|
}
|
|
2831
2811
|
);
|
|
2832
2812
|
}
|
|
2833
|
-
function
|
|
2813
|
+
function Os(s) {
|
|
2834
2814
|
const t = s instanceof Date ? s : new Date(s);
|
|
2835
2815
|
if (isNaN(t)) return null;
|
|
2836
|
-
const
|
|
2816
|
+
const n = /* @__PURE__ */ new Date(), i = t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(n.getFullYear(), n.getMonth(), n.getDate()), r = new Date(a - 864e5);
|
|
2837
2817
|
if (t >= a) return i;
|
|
2838
|
-
if (t >=
|
|
2818
|
+
if (t >= r) return `Yesterday ${i}`;
|
|
2839
2819
|
const o = t.getDate(), l = t.toLocaleString([], { month: "short" });
|
|
2840
2820
|
return `${o} ${l} ${i}`;
|
|
2841
2821
|
}
|
|
2842
|
-
function
|
|
2822
|
+
function Ut({
|
|
2843
2823
|
role: s = "assistant",
|
|
2844
2824
|
text: t,
|
|
2845
|
-
timestamp:
|
|
2825
|
+
timestamp: n,
|
|
2846
2826
|
feedbackValue: i = "idle",
|
|
2847
2827
|
onLike: a,
|
|
2848
|
-
onDislike:
|
|
2828
|
+
onDislike: r,
|
|
2849
2829
|
className: o = "",
|
|
2850
2830
|
...l
|
|
2851
2831
|
}) {
|
|
2852
|
-
const m = s === "assistant" && (a ||
|
|
2832
|
+
const m = s === "assistant" && (a || r), d = !!t, f = n ? Os(n) : null;
|
|
2853
2833
|
return !m && !d && !f ? null : /* @__PURE__ */ e.jsxs(
|
|
2854
2834
|
"div",
|
|
2855
2835
|
{
|
|
@@ -2857,84 +2837,91 @@ function Yt({
|
|
|
2857
2837
|
...l,
|
|
2858
2838
|
children: [
|
|
2859
2839
|
s === "user" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f }),
|
|
2860
|
-
m && /* @__PURE__ */ e.jsx(
|
|
2861
|
-
d && /* @__PURE__ */ e.jsx(
|
|
2840
|
+
m && /* @__PURE__ */ e.jsx(zs, { className: "ds-message-action", value: i, onLike: a, onDislike: r }),
|
|
2841
|
+
d && /* @__PURE__ */ e.jsx(Ds, { className: "ds-message-action", text: t }),
|
|
2862
2842
|
s === "assistant" && f && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: f })
|
|
2863
2843
|
]
|
|
2864
2844
|
}
|
|
2865
2845
|
);
|
|
2866
2846
|
}
|
|
2847
|
+
function Vt({ label: s, className: t = "", ...n }) {
|
|
2848
|
+
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", t].filter(Boolean).join(" "), ...n, children: [
|
|
2849
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
2850
|
+
s && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: s })
|
|
2851
|
+
] });
|
|
2852
|
+
}
|
|
2867
2853
|
export {
|
|
2868
2854
|
Ee as Accordion,
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2855
|
+
Qs as Alert,
|
|
2856
|
+
$t as AnimatedNumber,
|
|
2857
|
+
dt as Avatar,
|
|
2858
|
+
ce as Badge,
|
|
2859
|
+
yt as Banner,
|
|
2860
|
+
Nt as Breadcrumb,
|
|
2875
2861
|
me as Button,
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2862
|
+
qs as Card,
|
|
2863
|
+
Mt as ChatMessage,
|
|
2864
|
+
lt as Checkbox,
|
|
2865
|
+
st as Code,
|
|
2880
2866
|
ms as CodeAccordion,
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2867
|
+
Wt as ConfidenceBar,
|
|
2868
|
+
Ds as CopyButton,
|
|
2869
|
+
Ct as DiffView,
|
|
2870
|
+
gt as Drawer,
|
|
2885
2871
|
Be as DrawerFooter,
|
|
2886
|
-
|
|
2872
|
+
kt as Dropdown,
|
|
2887
2873
|
jt as EmptyState,
|
|
2888
|
-
|
|
2889
|
-
|
|
2874
|
+
bt as FormField,
|
|
2875
|
+
Ks as H1,
|
|
2890
2876
|
Xs as H2,
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2877
|
+
Gs as H3,
|
|
2878
|
+
Js as H4,
|
|
2879
|
+
Tt as InView,
|
|
2880
|
+
Us as Input,
|
|
2881
|
+
tt as Link,
|
|
2882
|
+
zs as MessageFeedback,
|
|
2883
|
+
Ut as MessageFooter,
|
|
2884
|
+
et as Modal,
|
|
2899
2885
|
Ie as ModalFooter,
|
|
2900
|
-
|
|
2901
|
-
|
|
2886
|
+
zt as ModelPicker,
|
|
2887
|
+
Zs as P1,
|
|
2902
2888
|
ds as P2,
|
|
2903
2889
|
Fe as P3,
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2890
|
+
wt as Pagination,
|
|
2891
|
+
Et as ProgressBar,
|
|
2892
|
+
Lt as PromptInput,
|
|
2893
|
+
ct as Radio,
|
|
2894
|
+
At as ReasoningBlock,
|
|
2895
|
+
at as SegmentedControl,
|
|
2896
|
+
Ys as Select,
|
|
2911
2897
|
xs as Skeleton,
|
|
2912
|
-
|
|
2898
|
+
Ot as SourcesPanel,
|
|
2913
2899
|
ls as Spinner,
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2900
|
+
vt as Stat,
|
|
2901
|
+
It as StepIndicator,
|
|
2902
|
+
Hs as Stepper,
|
|
2903
|
+
Bt as StreamingText,
|
|
2904
|
+
rt as Tab,
|
|
2905
|
+
ut as Table,
|
|
2906
|
+
mt as TableBody,
|
|
2907
|
+
ft as TableHead,
|
|
2908
|
+
pt as TableRow,
|
|
2909
|
+
ht as TableSubheaderRow,
|
|
2924
2910
|
nt as Tabs,
|
|
2925
2911
|
_t as Td,
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2912
|
+
Vs as Textarea,
|
|
2913
|
+
xt as Th,
|
|
2914
|
+
Vt as ThinkingDot,
|
|
2915
|
+
St as ToastContainer,
|
|
2916
|
+
ot as Toggle,
|
|
2917
|
+
Ft as TokenCounter,
|
|
2918
|
+
Dt as ToolCallBubble,
|
|
2932
2919
|
Dt as ToolCallCard,
|
|
2933
|
-
|
|
2920
|
+
it as Tooltip,
|
|
2934
2921
|
I as iconSizes,
|
|
2935
2922
|
ks as useAnimatedNumber,
|
|
2936
|
-
|
|
2923
|
+
As as useAnimatedPlaceholder,
|
|
2937
2924
|
Es as useInView,
|
|
2938
|
-
|
|
2939
|
-
|
|
2925
|
+
Pt as useStreamScroll,
|
|
2926
|
+
Rt as useToast
|
|
2940
2927
|
};
|