@softistx/material 3.249.0 → 3.250.1
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/CHANGELOG.md +16 -0
- package/README.md +2 -2
- package/dist/capture-toolbar.css +1 -1
- package/dist/{components-BbAylWQW.js → components-DUvKQIBi.js} +3 -1
- package/dist/components.js +1 -1
- package/dist/embed-chunks/{dist-C-lAK_LC.js → dist-BVPJSDov.js} +1 -1
- package/dist/embed-chunks/{emoji-picker-BWDQFdQu.js → emoji-picker-CrIXB9pF.js} +22 -22
- package/dist/embed-chunks/{mention-list-CdUr0h3X.js → mention-list-9hwOYNND.js} +1 -1
- package/dist/embed-chunks/{nxgt-theme-provider-DdDsiEPj.js → nxgt-theme-provider-Cjl7Eb8v.js} +703 -592
- package/dist/embed-chunks/switch-control-BrwJRN_V.js +207 -0
- package/dist/embed-chunks/{tabs-root-MF9lEHbq.js → tabs-root-BvPc1aaV.js} +5 -5
- package/dist/embed-chunks/{useLatest-RGIW0nya.js → useLatest-CbcU5ozz.js} +322 -322
- package/dist/embed.css +2 -2
- package/dist/embed.js +1266 -740
- package/dist/image-editor.css +1 -1
- package/dist/image-editor.js +902 -1017
- package/dist/lib/components/ui/layout/account-frame/account-frame.d.ts +2 -2
- package/dist/lib/embed/index.d.ts +4 -1
- package/dist/main.js +1 -1
- package/dist/material.css +1 -1
- package/docs/components/navigation-and-layout.md +2 -2
- package/docs/guides/embed.md +44 -0
- package/docs/roadmap.md +1 -0
- package/lib/components/ui/layout/app-shell/app-header.css +7 -0
- package/package.json +1 -1
- package/dist/embed-chunks/bubble-input-yXAeW84_.js +0 -29
- package/dist/embed-chunks/switch-control-B95ZWvna.js +0 -181
package/dist/embed.js
CHANGED
|
@@ -1,34 +1,112 @@
|
|
|
1
1
|
import { a as e, b as t, c as n, d as r, f as i, i as a, l as o, m as s, n as c, p as l, s as u, u as d } from "./embed-chunks/use-shape-morph-D1MOoQ4T.js";
|
|
2
|
-
import { C as f, U as p, V as m,
|
|
3
|
-
import { C, S as
|
|
4
|
-
import { a as
|
|
5
|
-
import { c as
|
|
2
|
+
import { C as f, U as p, V as m, a as h, b as g, d as _, n as v, o as y, p as b, r as x, t as S, u as C, x as w } from "./embed-chunks/useLatest-CbcU5ozz.js";
|
|
3
|
+
import { A as T, B as E, C as D, D as O, E as ee, F as te, I as ne, L as re, M as ie, N as ae, P as oe, R as se, S as ce, T as le, _ as ue, b as de, c as fe, d as pe, f as me, g as he, h as ge, i as _e, j as ve, m as ye, n as be, p as xe, r as Se, s as Ce, t as we, v as Te, w as Ee, x as De, y as Oe, z as ke } from "./embed-chunks/nxgt-theme-provider-Cjl7Eb8v.js";
|
|
4
|
+
import { a as Ae, i as je, n as Me, o as Ne, r as Pe, s as k, t as Fe } from "./embed-chunks/avatar-CSDtFCum.js";
|
|
5
|
+
import { c as Ie, d as Le, f as Re, g as ze, h as Be, i as Ve, l as He, m as Ue, n as We, o as Ge, r as Ke, s as qe, t as Je, u as Ye } from "./embed-chunks/tabs-root-BvPc1aaV.js";
|
|
6
|
+
import { n as Xe } from "./embed-chunks/switch-control-BrwJRN_V.js";
|
|
6
7
|
import { n as A } from "./embed-chunks/is-production-Cx8oURag.js";
|
|
7
|
-
import { a as
|
|
8
|
-
import { t as He } from "./embed-chunks/bubble-input-yXAeW84_.js";
|
|
8
|
+
import { a as Ze, i as Qe, l as $e, n as et, o as tt, r as nt, s as rt, t as it } from "./embed-chunks/state-scenes-BxFf1hTb.js";
|
|
9
9
|
import * as j from "react";
|
|
10
|
-
import M, { Children as
|
|
10
|
+
import M, { Children as at, Suspense as ot, cloneElement as st, createContext as ct, isValidElement as N, lazy as lt, useCallback as ut, useContext as dt, useEffect as P, useId as F, useInsertionEffect as ft, useMemo as pt, useReducer as mt, useRef as I, useState as L, useSyncExternalStore as ht } from "react";
|
|
11
11
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
12
|
-
import { claimCspNonce as
|
|
13
|
-
import { AlertCircle as
|
|
14
|
-
import { STATE_ACCENT as
|
|
15
|
-
import { describedBy as
|
|
16
|
-
import { fileKind as
|
|
17
|
-
import { formatFileSize as
|
|
18
|
-
import { blockedReason as
|
|
19
|
-
import { createAsyncSearch as
|
|
20
|
-
import { dayBucket as
|
|
21
|
-
//#region ../../node_modules/@radix-ui/react-
|
|
22
|
-
var
|
|
12
|
+
import { claimCspNonce as gt, getCspNonce as _t } from "@softistx/material-core/csp-nonce";
|
|
13
|
+
import { AlertCircle as vt, ArrowDown as yt, ArrowUp as bt, Check as xt, CheckCheck as St, CircleAlert as Ct, CircleCheck as wt, Clock3 as Tt, Construction as Et, Copy as Dt, Ellipsis as Ot, File as kt, FileBraces as At, FileImage as jt, FileMusic as Mt, FileQuestion as Nt, FileSpreadsheet as Pt, FileText as Ft, FileVideoCamera as It, Info as Lt, Mail as Rt, MessageSquare as zt, PackageOpen as Bt, Paperclip as Vt, Reply as Ht, Search as Ut, Send as Wt, ShieldAlert as Gt, SmilePlus as Kt, Sparkles as qt, Square as Jt, Trash2 as Yt, TriangleAlert as Xt, WifiOff as Zt, X as V } from "lucide-react";
|
|
14
|
+
import { STATE_ACCENT as Qt, STATE_ICON as $t, stateCopy as en } from "@softistx/material-core/states";
|
|
15
|
+
import { describedBy as tn } from "@softistx/material-core/described-by";
|
|
16
|
+
import { fileKind as nn } from "@softistx/material-core/file-preview";
|
|
17
|
+
import { formatFileSize as rn } from "@softistx/material-core/format-file-size";
|
|
18
|
+
import { blockedReason as an, entryIndex as on, nextChoice as sn, rovingIndex as cn } from "@softistx/material-core/choice-group";
|
|
19
|
+
import { createAsyncSearch as ln } from "@softistx/material-core/async-search";
|
|
20
|
+
import { dayBucket as un, daysAgo as dn, isValidTimeZone as fn, localIsoDay as pn, toDate as mn } from "@softistx/material-core/day-math";
|
|
21
|
+
//#region ../../node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
|
|
22
|
+
var hn = Object.defineProperty, H = (e, t) => hn(e, "name", {
|
|
23
23
|
value: t,
|
|
24
24
|
configurable: !0
|
|
25
|
-
}),
|
|
26
|
-
|
|
25
|
+
}), [gn, _n] = l("AlertDialog", [E]), U = E(), vn = /* @__PURE__ */ H((e) => {
|
|
26
|
+
let { __scopeAlertDialog: t, ...n } = e;
|
|
27
|
+
return /* @__PURE__ */ z(ie, {
|
|
28
|
+
...U(t),
|
|
29
|
+
...n,
|
|
30
|
+
modal: !0
|
|
31
|
+
});
|
|
32
|
+
}, "AlertDialog");
|
|
33
|
+
j.forwardRef(/* @__PURE__ */ H(function(e, t) {
|
|
34
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
35
|
+
return /* @__PURE__ */ z(ke, {
|
|
36
|
+
...U(n),
|
|
37
|
+
...r,
|
|
38
|
+
ref: t
|
|
39
|
+
});
|
|
40
|
+
}, "AlertDialogTrigger"));
|
|
41
|
+
var yn = /* @__PURE__ */ H((e) => {
|
|
42
|
+
let { __scopeAlertDialog: t, ...n } = e;
|
|
43
|
+
return /* @__PURE__ */ z(re, {
|
|
44
|
+
...U(t),
|
|
45
|
+
...n
|
|
46
|
+
});
|
|
47
|
+
}, "AlertDialogPortal"), bn = j.forwardRef(/* @__PURE__ */ H(function(e, t) {
|
|
48
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
49
|
+
return /* @__PURE__ */ z(ne, {
|
|
50
|
+
...U(n),
|
|
51
|
+
...r,
|
|
52
|
+
ref: t
|
|
53
|
+
});
|
|
54
|
+
}, "AlertDialogOverlay")), [xn, Sn] = gn("AlertDialogContent"), Cn = j.forwardRef(/* @__PURE__ */ H(function(e, n) {
|
|
55
|
+
let { __scopeAlertDialog: r, children: a, ...o } = e, s = U(r), c = t(n, j.useRef(null)), l = j.useRef(null);
|
|
56
|
+
return /* @__PURE__ */ z(xn, {
|
|
57
|
+
scope: r,
|
|
58
|
+
cancelRef: l,
|
|
59
|
+
children: /* @__PURE__ */ z(oe, {
|
|
60
|
+
role: "alertdialog",
|
|
61
|
+
...s,
|
|
62
|
+
...o,
|
|
63
|
+
ref: c,
|
|
64
|
+
onOpenAutoFocus: i(o.onOpenAutoFocus, (e) => {
|
|
65
|
+
e.preventDefault(), l.current?.focus({ preventScroll: !0 });
|
|
66
|
+
}),
|
|
67
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
68
|
+
onInteractOutside: (e) => e.preventDefault(),
|
|
69
|
+
children: a
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}, "AlertDialogContent")), wn = j.forwardRef(/* @__PURE__ */ H(function(e, t) {
|
|
73
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
74
|
+
return /* @__PURE__ */ z(se, {
|
|
75
|
+
...U(n),
|
|
76
|
+
...r,
|
|
77
|
+
ref: t
|
|
78
|
+
});
|
|
79
|
+
}, "AlertDialogTitle")), Tn = j.forwardRef(/* @__PURE__ */ H(function(e, t) {
|
|
80
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
81
|
+
return /* @__PURE__ */ z(te, {
|
|
82
|
+
...U(n),
|
|
83
|
+
...r,
|
|
84
|
+
ref: t
|
|
85
|
+
});
|
|
86
|
+
}, "AlertDialogDescription")), En = j.forwardRef(/* @__PURE__ */ H(function(e, t) {
|
|
87
|
+
let { __scopeAlertDialog: n, ...r } = e;
|
|
88
|
+
return /* @__PURE__ */ z(ae, {
|
|
89
|
+
...U(n),
|
|
90
|
+
...r,
|
|
91
|
+
ref: t
|
|
92
|
+
});
|
|
93
|
+
}, "AlertDialogAction")), Dn = "AlertDialogCancel", On = j.forwardRef(/* @__PURE__ */ H(function(e, n) {
|
|
94
|
+
let { __scopeAlertDialog: r, ...i } = e, { cancelRef: a } = Sn(Dn, r), o = U(r), s = t(n, a);
|
|
95
|
+
return /* @__PURE__ */ z(ae, {
|
|
96
|
+
...o,
|
|
97
|
+
...i,
|
|
98
|
+
ref: s
|
|
99
|
+
});
|
|
100
|
+
}, "AlertDialogCancel")), kn = vn, An = yn, jn = bn, Mn = Cn, Nn = En, Pn = On, Fn = wn, In = Tn, Ln = Object.defineProperty, W = (e, t) => Ln(e, "name", {
|
|
101
|
+
value: t,
|
|
102
|
+
configurable: !0
|
|
103
|
+
}), Rn = "Checkbox", [zn, Bn] = l(Rn), [Vn, Hn] = zn(Rn);
|
|
104
|
+
function Un(e) {
|
|
27
105
|
let { __scopeCheckbox: t, checked: n, children: r, defaultChecked: i, disabled: a, form: o, name: s, onCheckedChange: c, required: l, value: u = "on", internal_do_not_use_render: f } = e, [p, m] = d({
|
|
28
106
|
prop: n,
|
|
29
107
|
defaultProp: i ?? !1,
|
|
30
108
|
onChange: c,
|
|
31
|
-
caller:
|
|
109
|
+
caller: Rn
|
|
32
110
|
}), [h, g] = j.useState(null), [_, v] = j.useState(null), y = j.useRef(!1), [b, x] = j.useReducer((e) => e + 1, 0), S = !h || !!o || !!h.closest("form"), C = {
|
|
33
111
|
checked: p,
|
|
34
112
|
disabled: a,
|
|
@@ -42,32 +120,32 @@ function an(e) {
|
|
|
42
120
|
userInteractionCount: b,
|
|
43
121
|
onUserInteraction: x,
|
|
44
122
|
required: l,
|
|
45
|
-
defaultChecked: !
|
|
123
|
+
defaultChecked: !G(i) && i,
|
|
46
124
|
isFormControl: S,
|
|
47
125
|
bubbleInput: _,
|
|
48
126
|
setBubbleInput: v
|
|
49
127
|
};
|
|
50
|
-
return /* @__PURE__ */ z(
|
|
128
|
+
return /* @__PURE__ */ z(Vn, {
|
|
51
129
|
scope: t,
|
|
52
130
|
...C,
|
|
53
|
-
children:
|
|
131
|
+
children: Jn(f) ? f(C) : r
|
|
54
132
|
});
|
|
55
133
|
}
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
let { control: c, value: l, disabled: u, checked: d, required: f, setControl: p, setChecked: m, hasConsumerStoppedPropagationRef: h, onUserInteraction: g, isFormControl: _, bubbleInput: v } =
|
|
134
|
+
W(Un, "CheckboxProvider");
|
|
135
|
+
var Wn = "CheckboxTrigger", Gn = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ W(function({ __scopeCheckbox: e, onKeyDown: n, onClick: r, ...a }, o) {
|
|
136
|
+
let { control: c, value: l, disabled: u, checked: d, required: f, setControl: p, setChecked: m, hasConsumerStoppedPropagationRef: h, onUserInteraction: g, isFormControl: _, bubbleInput: v } = Hn(Wn, e), y = t(o, p), b = j.useRef(d);
|
|
59
137
|
return j.useEffect(() => {
|
|
60
138
|
let e = c?.form;
|
|
61
139
|
if (e) {
|
|
62
|
-
let t = /* @__PURE__ */
|
|
140
|
+
let t = /* @__PURE__ */ W(() => m(b.current), "reset");
|
|
63
141
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
64
142
|
}
|
|
65
143
|
}, [c, m]), /* @__PURE__ */ z(s.button, {
|
|
66
144
|
type: "button",
|
|
67
145
|
role: "checkbox",
|
|
68
|
-
"aria-checked":
|
|
146
|
+
"aria-checked": G(d) ? "mixed" : d,
|
|
69
147
|
"aria-required": f,
|
|
70
|
-
"data-state":
|
|
148
|
+
"data-state": Yn(d),
|
|
71
149
|
"data-disabled": u ? "" : void 0,
|
|
72
150
|
disabled: u,
|
|
73
151
|
value: l,
|
|
@@ -77,11 +155,11 @@ var on = "CheckboxTrigger", sn = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ H(
|
|
|
77
155
|
e.key === "Enter" && e.preventDefault();
|
|
78
156
|
}),
|
|
79
157
|
onClick: i(r, (e) => {
|
|
80
|
-
g(), m((e) =>
|
|
158
|
+
g(), m((e) => G(e) ? !0 : !e), v && _ && (h.current = e.isPropagationStopped(), h.current || e.stopPropagation());
|
|
81
159
|
})
|
|
82
160
|
});
|
|
83
|
-
}, "CheckboxTrigger")),
|
|
84
|
-
let { control: c, hasConsumerStoppedPropagationRef: l, userInteractionCount: u, checked: d, defaultChecked: f, required: p, disabled: m, name: h, value: g, form: _, bubbleInput: v, setBubbleInput: y } =
|
|
161
|
+
}, "CheckboxTrigger")), Kn = "CheckboxBubbleInput", qn = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ W(function({ __scopeCheckbox: e, onClick: r, ...a }, o) {
|
|
162
|
+
let { control: c, hasConsumerStoppedPropagationRef: l, userInteractionCount: u, checked: d, defaultChecked: f, required: p, disabled: m, name: h, value: g, form: _, bubbleInput: v, setBubbleInput: y } = Hn(Kn, e), b = t(o, y), x = n(c), S = j.useRef(!1), C = j.useRef(d), w = j.useRef(u);
|
|
85
163
|
j.useEffect(() => {
|
|
86
164
|
let e = v;
|
|
87
165
|
if (!e) return;
|
|
@@ -93,7 +171,7 @@ var on = "CheckboxTrigger", sn = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ H(
|
|
|
93
171
|
if (i && n) {
|
|
94
172
|
S.current = !r;
|
|
95
173
|
let t = new Event("click", { bubbles: a });
|
|
96
|
-
e.indeterminate =
|
|
174
|
+
e.indeterminate = G(d), n.call(e, !G(d) && d), e.dispatchEvent(t), S.current = !1;
|
|
97
175
|
}
|
|
98
176
|
}, [
|
|
99
177
|
v,
|
|
@@ -101,7 +179,7 @@ var on = "CheckboxTrigger", sn = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ H(
|
|
|
101
179
|
l,
|
|
102
180
|
u
|
|
103
181
|
]);
|
|
104
|
-
let T = j.useRef(!
|
|
182
|
+
let T = j.useRef(!G(d) && d);
|
|
105
183
|
return /* @__PURE__ */ z(s.input, {
|
|
106
184
|
type: "checkbox",
|
|
107
185
|
"aria-hidden": !0,
|
|
@@ -128,31 +206,31 @@ var on = "CheckboxTrigger", sn = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ H(
|
|
|
128
206
|
}
|
|
129
207
|
});
|
|
130
208
|
}, "CheckboxBubbleInput"));
|
|
131
|
-
function
|
|
209
|
+
function Jn(e) {
|
|
132
210
|
return typeof e == "function";
|
|
133
211
|
}
|
|
134
|
-
|
|
135
|
-
function
|
|
212
|
+
W(Jn, "isFunction");
|
|
213
|
+
function G(e) {
|
|
136
214
|
return e === "indeterminate";
|
|
137
215
|
}
|
|
138
|
-
|
|
139
|
-
function
|
|
140
|
-
return
|
|
216
|
+
W(G, "isIndeterminate");
|
|
217
|
+
function Yn(e) {
|
|
218
|
+
return G(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
141
219
|
}
|
|
142
|
-
|
|
220
|
+
W(Yn, "getState");
|
|
143
221
|
//#endregion
|
|
144
222
|
//#region ../../node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
145
|
-
var
|
|
223
|
+
var Xn = Object.defineProperty, K = (e, t) => Xn(e, "name", {
|
|
146
224
|
value: t,
|
|
147
225
|
configurable: !0
|
|
148
226
|
});
|
|
149
|
-
function
|
|
227
|
+
function Zn(e, t) {
|
|
150
228
|
return j.useReducer((e, n) => t[e][n] ?? e, e);
|
|
151
229
|
}
|
|
152
|
-
|
|
153
|
-
var
|
|
230
|
+
K(Zn, "useStateMachine");
|
|
231
|
+
var Qn = "ScrollArea", [$n, er] = l(Qn), [tr, q] = $n(Qn), nr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, n) {
|
|
154
232
|
let { __scopeScrollArea: r, type: i = "hover", dir: a, scrollHideDelay: o = 600, ...c } = e, [l, u] = j.useState(null), [d, f] = j.useState(null), [p, h] = j.useState(null), [g, _] = j.useState(null), [v, y] = j.useState(null), [b, x] = j.useState(0), [S, C] = j.useState(0), [w, T] = j.useState(!1), [E, D] = j.useState(!1), O = t(n, u), ee = m(a);
|
|
155
|
-
return /* @__PURE__ */ z(
|
|
233
|
+
return /* @__PURE__ */ z(tr, {
|
|
156
234
|
scope: r,
|
|
157
235
|
type: i,
|
|
158
236
|
dir: ee,
|
|
@@ -184,9 +262,9 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
184
262
|
}
|
|
185
263
|
})
|
|
186
264
|
});
|
|
187
|
-
}, "ScrollArea")),
|
|
188
|
-
let { __scopeScrollArea: r, children: i, nonce: a, ...o } = e, c =
|
|
189
|
-
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(
|
|
265
|
+
}, "ScrollArea")), rr = "ScrollAreaViewport", ir = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, n) {
|
|
266
|
+
let { __scopeScrollArea: r, children: i, nonce: a, ...o } = e, c = q(rr, r), l = t(n, j.useRef(null), c.onViewportChange);
|
|
267
|
+
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(ar, { nonce: a }), /* @__PURE__ */ z(s.div, {
|
|
190
268
|
"data-radix-scroll-area-viewport": "",
|
|
191
269
|
...o,
|
|
192
270
|
ref: l,
|
|
@@ -204,44 +282,44 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
204
282
|
children: i
|
|
205
283
|
})
|
|
206
284
|
})] });
|
|
207
|
-
}, "ScrollAreaViewport")),
|
|
285
|
+
}, "ScrollAreaViewport")), ar = /* @__PURE__ */ j.memo(/* @__PURE__ */ K(function({ nonce: e }) {
|
|
208
286
|
return /* @__PURE__ */ z("style", {
|
|
209
287
|
dangerouslySetInnerHTML: { __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}" },
|
|
210
288
|
nonce: e
|
|
211
289
|
});
|
|
212
|
-
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce),
|
|
213
|
-
let { forceMount: n, ...r } = e, i =
|
|
290
|
+
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce), J = "ScrollAreaScrollbar", or = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
291
|
+
let { forceMount: n, ...r } = e, i = q(J, e.__scopeScrollArea), { onScrollbarXEnabledChange: a, onScrollbarYEnabledChange: o } = i, s = e.orientation === "horizontal";
|
|
214
292
|
return j.useEffect(() => (s ? a(!0) : o(!0), () => {
|
|
215
293
|
s ? a(!1) : o(!1);
|
|
216
294
|
}), [
|
|
217
295
|
s,
|
|
218
296
|
a,
|
|
219
297
|
o
|
|
220
|
-
]), i.type === "hover" ? /* @__PURE__ */ z(
|
|
298
|
+
]), i.type === "hover" ? /* @__PURE__ */ z(sr, {
|
|
221
299
|
...r,
|
|
222
300
|
ref: t,
|
|
223
301
|
forceMount: n
|
|
224
|
-
}) : i.type === "scroll" ? /* @__PURE__ */ z(
|
|
302
|
+
}) : i.type === "scroll" ? /* @__PURE__ */ z(cr, {
|
|
225
303
|
...r,
|
|
226
304
|
ref: t,
|
|
227
305
|
forceMount: n
|
|
228
|
-
}) : i.type === "auto" ? /* @__PURE__ */ z(
|
|
306
|
+
}) : i.type === "auto" ? /* @__PURE__ */ z(lr, {
|
|
229
307
|
...r,
|
|
230
308
|
ref: t,
|
|
231
309
|
forceMount: n
|
|
232
|
-
}) : i.type === "always" ? /* @__PURE__ */ z(
|
|
310
|
+
}) : i.type === "always" ? /* @__PURE__ */ z(ur, {
|
|
233
311
|
...r,
|
|
234
312
|
ref: t,
|
|
235
313
|
"data-state": "visible"
|
|
236
314
|
}) : null;
|
|
237
|
-
}, "ScrollAreaScrollbar")),
|
|
238
|
-
let { forceMount: n, ...r } = e, i =
|
|
315
|
+
}, "ScrollAreaScrollbar")), sr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
316
|
+
let { forceMount: n, ...r } = e, i = q(J, e.__scopeScrollArea), [a, o] = j.useState(!1);
|
|
239
317
|
return j.useEffect(() => {
|
|
240
318
|
let e = i.scrollArea, t = 0;
|
|
241
319
|
if (e) {
|
|
242
|
-
let n = /* @__PURE__ */
|
|
320
|
+
let n = /* @__PURE__ */ K(() => {
|
|
243
321
|
window.clearTimeout(t), o(!0);
|
|
244
|
-
}, "handlePointerEnter"), r = /* @__PURE__ */
|
|
322
|
+
}, "handlePointerEnter"), r = /* @__PURE__ */ K(() => {
|
|
245
323
|
t = window.setTimeout(() => o(!1), i.scrollHideDelay);
|
|
246
324
|
}, "handlePointerLeave");
|
|
247
325
|
return e.addEventListener("pointerenter", n), e.addEventListener("pointerleave", r), () => {
|
|
@@ -250,14 +328,14 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
250
328
|
}
|
|
251
329
|
}, [i.scrollArea, i.scrollHideDelay]), /* @__PURE__ */ z(p, {
|
|
252
330
|
present: n || a,
|
|
253
|
-
children: /* @__PURE__ */ z(
|
|
331
|
+
children: /* @__PURE__ */ z(lr, {
|
|
254
332
|
"data-state": a ? "visible" : "hidden",
|
|
255
333
|
...r,
|
|
256
334
|
ref: t
|
|
257
335
|
})
|
|
258
336
|
});
|
|
259
|
-
}, "ScrollAreaScrollbarHover")),
|
|
260
|
-
let { forceMount: n, ...r } = e, a =
|
|
337
|
+
}, "ScrollAreaScrollbarHover")), cr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
338
|
+
let { forceMount: n, ...r } = e, a = q(J, e.__scopeScrollArea), o = e.orientation === "horizontal", s = Or(() => l("SCROLL_END"), 100), [c, l] = Zn("hidden", {
|
|
261
339
|
hidden: { SCROLL: "scrolling" },
|
|
262
340
|
scrolling: {
|
|
263
341
|
SCROLL_END: "idle",
|
|
@@ -285,7 +363,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
285
363
|
]), j.useEffect(() => {
|
|
286
364
|
let e = a.viewport, t = o ? "scrollLeft" : "scrollTop";
|
|
287
365
|
if (e) {
|
|
288
|
-
let n = e[t], r = /* @__PURE__ */
|
|
366
|
+
let n = e[t], r = /* @__PURE__ */ K(() => {
|
|
289
367
|
let r = e[t];
|
|
290
368
|
n !== r && (l("SCROLL"), s()), n = r;
|
|
291
369
|
}, "handleScroll");
|
|
@@ -298,7 +376,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
298
376
|
s
|
|
299
377
|
]), /* @__PURE__ */ z(p, {
|
|
300
378
|
present: n || c !== "hidden",
|
|
301
|
-
children: /* @__PURE__ */ z(
|
|
379
|
+
children: /* @__PURE__ */ z(ur, {
|
|
302
380
|
"data-state": c === "hidden" ? "hidden" : "visible",
|
|
303
381
|
...r,
|
|
304
382
|
ref: t,
|
|
@@ -306,23 +384,23 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
306
384
|
onPointerLeave: i(e.onPointerLeave, () => l("POINTER_LEAVE"))
|
|
307
385
|
})
|
|
308
386
|
});
|
|
309
|
-
}, "ScrollAreaScrollbarScroll")),
|
|
310
|
-
let n =
|
|
387
|
+
}, "ScrollAreaScrollbarScroll")), lr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
388
|
+
let n = q(J, e.__scopeScrollArea), { forceMount: r, ...i } = e, [a, o] = j.useState(!1), s = e.orientation === "horizontal", c = Or(() => {
|
|
311
389
|
if (n.viewport) {
|
|
312
390
|
let e = n.viewport.offsetWidth < n.viewport.scrollWidth, t = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
313
391
|
o(s ? e : t);
|
|
314
392
|
}
|
|
315
393
|
}, 10);
|
|
316
|
-
return
|
|
394
|
+
return Z(n.viewport, c), Z(n.content, c), /* @__PURE__ */ z(p, {
|
|
317
395
|
present: r || a,
|
|
318
|
-
children: /* @__PURE__ */ z(
|
|
396
|
+
children: /* @__PURE__ */ z(ur, {
|
|
319
397
|
"data-state": a ? "visible" : "hidden",
|
|
320
398
|
...i,
|
|
321
399
|
ref: t
|
|
322
400
|
})
|
|
323
401
|
});
|
|
324
|
-
}, "ScrollAreaScrollbarAuto")),
|
|
325
|
-
let { orientation: n = "vertical", ...r } = e, i =
|
|
402
|
+
}, "ScrollAreaScrollbarAuto")), ur = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
403
|
+
let { orientation: n = "vertical", ...r } = e, i = q(J, e.__scopeScrollArea), a = j.useRef(null), o = j.useRef(0), [s, c] = j.useState({
|
|
326
404
|
content: 0,
|
|
327
405
|
viewport: 0,
|
|
328
406
|
scrollbar: {
|
|
@@ -330,24 +408,24 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
330
408
|
paddingStart: 0,
|
|
331
409
|
paddingEnd: 0
|
|
332
410
|
}
|
|
333
|
-
}), l =
|
|
411
|
+
}), l = Sr(s.viewport, s.content), u = {
|
|
334
412
|
...r,
|
|
335
413
|
sizes: s,
|
|
336
414
|
onSizesChange: c,
|
|
337
415
|
hasThumb: l > 0 && l < 1,
|
|
338
|
-
onThumbChange: /* @__PURE__ */
|
|
339
|
-
onThumbPointerUp: /* @__PURE__ */
|
|
340
|
-
onThumbPointerDown: /* @__PURE__ */
|
|
416
|
+
onThumbChange: /* @__PURE__ */ K((e) => a.current = e, "onThumbChange"),
|
|
417
|
+
onThumbPointerUp: /* @__PURE__ */ K(() => o.current = 0, "onThumbPointerUp"),
|
|
418
|
+
onThumbPointerDown: /* @__PURE__ */ K((e) => o.current = e, "onThumbPointerDown")
|
|
341
419
|
};
|
|
342
420
|
function d(e, t) {
|
|
343
|
-
return
|
|
421
|
+
return Cr(e, o.current, s, t);
|
|
344
422
|
}
|
|
345
|
-
return
|
|
423
|
+
return K(d, "getScrollPosition"), n === "horizontal" ? /* @__PURE__ */ z(dr, {
|
|
346
424
|
...u,
|
|
347
425
|
ref: t,
|
|
348
426
|
onThumbPositionChange: () => {
|
|
349
427
|
if (i.viewport && a.current) {
|
|
350
|
-
let e = i.viewport.scrollLeft, t =
|
|
428
|
+
let e = i.viewport.scrollLeft, t = wr(e, s, i.dir);
|
|
351
429
|
a.current.style.transform = `translate3d(${t}px, 0, 0)`;
|
|
352
430
|
}
|
|
353
431
|
},
|
|
@@ -357,12 +435,12 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
357
435
|
onDragScroll: (e) => {
|
|
358
436
|
i.viewport && (i.viewport.scrollLeft = d(e, i.dir));
|
|
359
437
|
}
|
|
360
|
-
}) : n === "vertical" ? /* @__PURE__ */ z(
|
|
438
|
+
}) : n === "vertical" ? /* @__PURE__ */ z(fr, {
|
|
361
439
|
...u,
|
|
362
440
|
ref: t,
|
|
363
441
|
onThumbPositionChange: () => {
|
|
364
442
|
if (i.viewport && a.current) {
|
|
365
|
-
let e = i.viewport.scrollTop, t =
|
|
443
|
+
let e = i.viewport.scrollTop, t = wr(e, s);
|
|
366
444
|
a.current.style.transform = `translate3d(0, ${t}px, 0)`;
|
|
367
445
|
}
|
|
368
446
|
},
|
|
@@ -373,11 +451,11 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
373
451
|
i.viewport && (i.viewport.scrollTop = d(e));
|
|
374
452
|
}
|
|
375
453
|
}) : null;
|
|
376
|
-
}, "ScrollAreaScrollbarVisible")),
|
|
377
|
-
let { sizes: r, onSizesChange: i, ...a } = e, o =
|
|
454
|
+
}, "ScrollAreaScrollbarVisible")), dr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, n) {
|
|
455
|
+
let { sizes: r, onSizesChange: i, ...a } = e, o = q(J, e.__scopeScrollArea), [s, c] = j.useState(), l = j.useRef(null), u = t(n, l, o.onScrollbarXChange);
|
|
378
456
|
return j.useEffect(() => {
|
|
379
457
|
l.current && c(getComputedStyle(l.current));
|
|
380
|
-
}, [l]), /* @__PURE__ */ z(
|
|
458
|
+
}, [l]), /* @__PURE__ */ z(hr, {
|
|
381
459
|
"data-orientation": "horizontal",
|
|
382
460
|
...a,
|
|
383
461
|
ref: u,
|
|
@@ -386,7 +464,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
386
464
|
bottom: 0,
|
|
387
465
|
left: o.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
388
466
|
right: o.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
389
|
-
"--radix-scroll-area-thumb-width":
|
|
467
|
+
"--radix-scroll-area-thumb-width": X(r) + "px",
|
|
390
468
|
...e.style
|
|
391
469
|
},
|
|
392
470
|
onThumbPointerDown: (t) => e.onThumbPointerDown(t.x),
|
|
@@ -394,7 +472,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
394
472
|
onWheelScroll: (t, n) => {
|
|
395
473
|
if (o.viewport) {
|
|
396
474
|
let r = o.viewport.scrollLeft + t.deltaX;
|
|
397
|
-
e.onWheelScroll(r),
|
|
475
|
+
e.onWheelScroll(r), Er(r, n) && t.preventDefault();
|
|
398
476
|
}
|
|
399
477
|
},
|
|
400
478
|
onResize: () => {
|
|
@@ -403,17 +481,17 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
403
481
|
viewport: o.viewport.offsetWidth,
|
|
404
482
|
scrollbar: {
|
|
405
483
|
size: l.current.clientWidth,
|
|
406
|
-
paddingStart:
|
|
407
|
-
paddingEnd:
|
|
484
|
+
paddingStart: Y(s.paddingLeft),
|
|
485
|
+
paddingEnd: Y(s.paddingRight)
|
|
408
486
|
}
|
|
409
487
|
});
|
|
410
488
|
}
|
|
411
489
|
});
|
|
412
|
-
}, "ScrollAreaScrollbarX")),
|
|
413
|
-
let { sizes: r, onSizesChange: i, ...a } = e, o =
|
|
490
|
+
}, "ScrollAreaScrollbarX")), fr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, n) {
|
|
491
|
+
let { sizes: r, onSizesChange: i, ...a } = e, o = q(J, e.__scopeScrollArea), [s, c] = j.useState(), l = j.useRef(null), u = t(n, l, o.onScrollbarYChange);
|
|
414
492
|
return j.useEffect(() => {
|
|
415
493
|
l.current && c(getComputedStyle(l.current));
|
|
416
|
-
}, [l]), /* @__PURE__ */ z(
|
|
494
|
+
}, [l]), /* @__PURE__ */ z(hr, {
|
|
417
495
|
"data-orientation": "vertical",
|
|
418
496
|
...a,
|
|
419
497
|
ref: u,
|
|
@@ -423,7 +501,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
423
501
|
right: o.dir === "ltr" ? 0 : void 0,
|
|
424
502
|
left: o.dir === "rtl" ? 0 : void 0,
|
|
425
503
|
bottom: "var(--radix-scroll-area-corner-height)",
|
|
426
|
-
"--radix-scroll-area-thumb-height":
|
|
504
|
+
"--radix-scroll-area-thumb-height": X(r) + "px",
|
|
427
505
|
...e.style
|
|
428
506
|
},
|
|
429
507
|
onThumbPointerDown: (t) => e.onThumbPointerDown(t.y),
|
|
@@ -431,7 +509,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
431
509
|
onWheelScroll: (t, n) => {
|
|
432
510
|
if (o.viewport) {
|
|
433
511
|
let r = o.viewport.scrollTop + t.deltaY;
|
|
434
|
-
e.onWheelScroll(r),
|
|
512
|
+
e.onWheelScroll(r), Er(r, n) && t.preventDefault();
|
|
435
513
|
}
|
|
436
514
|
},
|
|
437
515
|
onResize: () => {
|
|
@@ -440,14 +518,14 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
440
518
|
viewport: o.viewport.offsetHeight,
|
|
441
519
|
scrollbar: {
|
|
442
520
|
size: l.current.clientHeight,
|
|
443
|
-
paddingStart:
|
|
444
|
-
paddingEnd:
|
|
521
|
+
paddingStart: Y(s.paddingTop),
|
|
522
|
+
paddingEnd: Y(s.paddingBottom)
|
|
445
523
|
}
|
|
446
524
|
});
|
|
447
525
|
}
|
|
448
526
|
});
|
|
449
|
-
}, "ScrollAreaScrollbarY")), [
|
|
450
|
-
let { __scopeScrollArea: r, sizes: a, hasThumb: c, onThumbChange: l, onThumbPointerUp: u, onThumbPointerDown: d, onThumbPositionChange: f, onDragScroll: p, onWheelScroll: m, onResize: h, ...g } = e, _ =
|
|
527
|
+
}, "ScrollAreaScrollbarY")), [pr, mr] = $n(J), hr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, n) {
|
|
528
|
+
let { __scopeScrollArea: r, sizes: a, hasThumb: c, onThumbChange: l, onThumbPointerUp: u, onThumbPointerDown: d, onThumbPositionChange: f, onDragScroll: p, onWheelScroll: m, onResize: h, ...g } = e, _ = q(J, r), [v, y] = j.useState(null), b = t(n, y), x = j.useRef(null), S = j.useRef(""), C = _.viewport, w = a.content - a.viewport, T = o(m), E = o(f), D = Or(h, 10);
|
|
451
529
|
function O(e) {
|
|
452
530
|
if (x.current) {
|
|
453
531
|
let t = e.clientX - x.current.left, n = e.clientY - x.current.top;
|
|
@@ -457,8 +535,8 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
457
535
|
});
|
|
458
536
|
}
|
|
459
537
|
}
|
|
460
|
-
return
|
|
461
|
-
let e = /* @__PURE__ */
|
|
538
|
+
return K(O, "handleDragScroll"), j.useEffect(() => {
|
|
539
|
+
let e = /* @__PURE__ */ K((e) => {
|
|
462
540
|
let t = e.target;
|
|
463
541
|
v?.contains(t) && T(e, w);
|
|
464
542
|
}, "handleWheel");
|
|
@@ -468,7 +546,7 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
468
546
|
v,
|
|
469
547
|
w,
|
|
470
548
|
T
|
|
471
|
-
]), j.useEffect(E, [a, E]),
|
|
549
|
+
]), j.useEffect(E, [a, E]), Z(v, D), Z(_.content, D), /* @__PURE__ */ z(pr, {
|
|
472
550
|
scope: r,
|
|
473
551
|
scrollbar: v,
|
|
474
552
|
hasThumb: c,
|
|
@@ -493,25 +571,25 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
493
571
|
})
|
|
494
572
|
})
|
|
495
573
|
});
|
|
496
|
-
}, "ScrollAreaScrollbarImpl")),
|
|
497
|
-
let { forceMount: n, ...r } = e, i =
|
|
574
|
+
}, "ScrollAreaScrollbarImpl")), gr = "ScrollAreaThumb", _r = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
575
|
+
let { forceMount: n, ...r } = e, i = mr(gr, e.__scopeScrollArea);
|
|
498
576
|
return /* @__PURE__ */ z(p, {
|
|
499
577
|
present: n || i.hasThumb,
|
|
500
|
-
children: /* @__PURE__ */ z(
|
|
578
|
+
children: /* @__PURE__ */ z(vr, {
|
|
501
579
|
ref: t,
|
|
502
580
|
...r
|
|
503
581
|
})
|
|
504
582
|
});
|
|
505
|
-
}, "ScrollAreaThumb")),
|
|
506
|
-
let { __scopeScrollArea: r, style: a, ...o } = e, c =
|
|
583
|
+
}, "ScrollAreaThumb")), vr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, n) {
|
|
584
|
+
let { __scopeScrollArea: r, style: a, ...o } = e, c = q(gr, r), l = mr(gr, r), { onThumbPositionChange: u } = l, d = t(n, l.onThumbChange), f = j.useRef(void 0), p = Or(() => {
|
|
507
585
|
f.current &&= (f.current(), void 0);
|
|
508
586
|
}, 100);
|
|
509
587
|
return j.useEffect(() => {
|
|
510
588
|
let e = c.viewport;
|
|
511
589
|
if (e) {
|
|
512
|
-
let t = /* @__PURE__ */
|
|
590
|
+
let t = /* @__PURE__ */ K(() => {
|
|
513
591
|
if (p(), !f.current) {
|
|
514
|
-
let t =
|
|
592
|
+
let t = Dr(e, u);
|
|
515
593
|
f.current = t, u();
|
|
516
594
|
}
|
|
517
595
|
}, "handleScroll");
|
|
@@ -539,18 +617,18 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
539
617
|
}),
|
|
540
618
|
onPointerUp: i(e.onPointerUp, l.onThumbPointerUp)
|
|
541
619
|
});
|
|
542
|
-
}, "ScrollAreaThumbImpl")),
|
|
543
|
-
let n =
|
|
544
|
-
return n.type !== "scroll" && r ? /* @__PURE__ */ z(
|
|
620
|
+
}, "ScrollAreaThumbImpl")), yr = "ScrollAreaCorner", br = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
621
|
+
let n = q(yr, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
622
|
+
return n.type !== "scroll" && r ? /* @__PURE__ */ z(xr, {
|
|
545
623
|
...e,
|
|
546
624
|
ref: t
|
|
547
625
|
}) : null;
|
|
548
|
-
}, "ScrollAreaCorner")),
|
|
549
|
-
let { __scopeScrollArea: n, ...r } = e, i =
|
|
550
|
-
return
|
|
626
|
+
}, "ScrollAreaCorner")), xr = /* @__PURE__ */ j.forwardRef(/* @__PURE__ */ K(function(e, t) {
|
|
627
|
+
let { __scopeScrollArea: n, ...r } = e, i = q(yr, n), [a, o] = j.useState(0), [c, l] = j.useState(0), u = !!(a && c), { onCornerWidthChange: d, onCornerHeightChange: f } = i;
|
|
628
|
+
return Z(i.scrollbarX, () => {
|
|
551
629
|
let e = i.scrollbarX?.offsetHeight || 0;
|
|
552
630
|
i.onCornerHeightChange(e), l(e);
|
|
553
|
-
}),
|
|
631
|
+
}), Z(i.scrollbarY, () => {
|
|
554
632
|
let e = i.scrollbarY?.offsetWidth || 0;
|
|
555
633
|
i.onCornerWidthChange(e), o(e);
|
|
556
634
|
}), j.useEffect(() => () => {
|
|
@@ -569,48 +647,48 @@ var mn = "ScrollArea", [hn, gn] = l(mn), [_n, G] = hn(mn), vn = /* @__PURE__ */
|
|
|
569
647
|
}
|
|
570
648
|
}) : null;
|
|
571
649
|
}, "ScrollAreaCornerImpl"));
|
|
572
|
-
function
|
|
650
|
+
function Y(e) {
|
|
573
651
|
return e ? parseInt(e, 10) : 0;
|
|
574
652
|
}
|
|
575
|
-
|
|
576
|
-
function
|
|
653
|
+
K(Y, "toInt");
|
|
654
|
+
function Sr(e, t) {
|
|
577
655
|
let n = e / t;
|
|
578
656
|
return isNaN(n) ? 0 : n;
|
|
579
657
|
}
|
|
580
|
-
|
|
581
|
-
function
|
|
582
|
-
let t =
|
|
658
|
+
K(Sr, "getThumbRatio");
|
|
659
|
+
function X(e) {
|
|
660
|
+
let t = Sr(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
583
661
|
return Math.max(r, 18);
|
|
584
662
|
}
|
|
585
|
-
|
|
586
|
-
function
|
|
587
|
-
let i =
|
|
588
|
-
return
|
|
663
|
+
K(X, "getThumbSize");
|
|
664
|
+
function Cr(e, t, n, r = "ltr") {
|
|
665
|
+
let i = X(n), a = i / 2, o = t || a, s = i - o, c = n.scrollbar.paddingStart + o, l = n.scrollbar.size - n.scrollbar.paddingEnd - s, u = n.content - n.viewport, d = r === "ltr" ? [0, u] : [u * -1, 0];
|
|
666
|
+
return Tr([c, l], d)(e);
|
|
589
667
|
}
|
|
590
|
-
|
|
591
|
-
function
|
|
592
|
-
let r =
|
|
593
|
-
return
|
|
668
|
+
K(Cr, "getScrollPositionFromPointer");
|
|
669
|
+
function wr(e, t, n = "ltr") {
|
|
670
|
+
let r = X(t), i = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, a = t.scrollbar.size - i, o = t.content - t.viewport, s = a - r, c = ve(e, n === "ltr" ? [0, o] : [o * -1, 0]);
|
|
671
|
+
return Tr([0, o], [0, s])(c);
|
|
594
672
|
}
|
|
595
|
-
|
|
596
|
-
function
|
|
673
|
+
K(wr, "getThumbOffsetFromScroll");
|
|
674
|
+
function Tr(e, t) {
|
|
597
675
|
return (n) => {
|
|
598
676
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
599
677
|
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
600
678
|
return t[0] + r * (n - e[0]);
|
|
601
679
|
};
|
|
602
680
|
}
|
|
603
|
-
|
|
604
|
-
function
|
|
681
|
+
K(Tr, "linearScale");
|
|
682
|
+
function Er(e, t) {
|
|
605
683
|
return e > 0 && e < t;
|
|
606
684
|
}
|
|
607
|
-
|
|
608
|
-
var
|
|
685
|
+
K(Er, "isScrollingWithinScrollbarBounds");
|
|
686
|
+
var Dr = /* @__PURE__ */ K((e, t = () => {}) => {
|
|
609
687
|
let n = {
|
|
610
688
|
left: e.scrollLeft,
|
|
611
689
|
top: e.scrollTop
|
|
612
690
|
}, r = 0;
|
|
613
|
-
return (/* @__PURE__ */
|
|
691
|
+
return (/* @__PURE__ */ K((function i() {
|
|
614
692
|
let a = {
|
|
615
693
|
left: e.scrollLeft,
|
|
616
694
|
top: e.scrollTop
|
|
@@ -618,14 +696,14 @@ var Un = /* @__PURE__ */ W((e, t = () => {}) => {
|
|
|
618
696
|
(o || s) && t(), n = a, r = window.requestAnimationFrame(i);
|
|
619
697
|
}), "loop"))(), () => window.cancelAnimationFrame(r);
|
|
620
698
|
}, "addUnlinkedScrollListener");
|
|
621
|
-
function
|
|
699
|
+
function Or(e, t) {
|
|
622
700
|
let n = o(e), r = j.useRef(0);
|
|
623
701
|
return j.useEffect(() => () => window.clearTimeout(r.current), []), j.useCallback(() => {
|
|
624
702
|
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
625
703
|
}, [n, t]);
|
|
626
704
|
}
|
|
627
|
-
|
|
628
|
-
function
|
|
705
|
+
K(Or, "useDebounceCallback");
|
|
706
|
+
function Z(e, t) {
|
|
629
707
|
let n = o(t);
|
|
630
708
|
r(() => {
|
|
631
709
|
let t = 0;
|
|
@@ -639,11 +717,11 @@ function X(e, t) {
|
|
|
639
717
|
}
|
|
640
718
|
}, [e, n]);
|
|
641
719
|
}
|
|
642
|
-
|
|
643
|
-
var
|
|
720
|
+
K(Z, "useResizeObserver");
|
|
721
|
+
var kr = nr, Ar = ir, jr = br;
|
|
644
722
|
//#endregion
|
|
645
723
|
//#region lib/components/ui/feedback/notification-row/partials/notification-row-dot.tsx
|
|
646
|
-
function
|
|
724
|
+
function Mr({ unread: e }) {
|
|
647
725
|
let { t } = a();
|
|
648
726
|
return e ? /* @__PURE__ */ z("span", {
|
|
649
727
|
"data-slot": "notification-row-dot",
|
|
@@ -660,7 +738,7 @@ function qn({ unread: e }) {
|
|
|
660
738
|
}
|
|
661
739
|
//#endregion
|
|
662
740
|
//#region lib/components/ui/collections/list-row/list-row.tsx
|
|
663
|
-
function
|
|
741
|
+
function Nr({ title: e, meta: t, badge: n, unread: r = !1, selected: i, className: a, ...o }) {
|
|
664
742
|
return /* @__PURE__ */ B("div", {
|
|
665
743
|
"data-slot": "list-row",
|
|
666
744
|
"data-unread": r || void 0,
|
|
@@ -668,7 +746,7 @@ function Jn({ title: e, meta: t, badge: n, unread: r = !1, selected: i, classNam
|
|
|
668
746
|
className: A("flex min-h-14 w-full min-w-0 items-center gap-3 rounded-(--nxgt-item-radius) border border-transparent bg-card px-3 py-2 text-left text-sm", "transition-colors duration-150 hover:bg-muted", i && "border-primary/35 bg-primary/10", a),
|
|
669
747
|
...o,
|
|
670
748
|
children: [
|
|
671
|
-
/* @__PURE__ */ z(
|
|
749
|
+
/* @__PURE__ */ z(Mr, { unread: r }),
|
|
672
750
|
/* @__PURE__ */ B("span", {
|
|
673
751
|
className: "flex min-w-0 flex-1 flex-col",
|
|
674
752
|
children: [/* @__PURE__ */ z("span", {
|
|
@@ -689,15 +767,15 @@ function Jn({ title: e, meta: t, badge: n, unread: r = !1, selected: i, classNam
|
|
|
689
767
|
}
|
|
690
768
|
//#endregion
|
|
691
769
|
//#region lib/components/ui/feedback/alert/alert-tone-icon.tsx
|
|
692
|
-
var
|
|
693
|
-
primary: /* @__PURE__ */ z(
|
|
694
|
-
secondary: /* @__PURE__ */ z(
|
|
695
|
-
foreground: /* @__PURE__ */ z(
|
|
696
|
-
info: /* @__PURE__ */ z(
|
|
697
|
-
success: /* @__PURE__ */ z(
|
|
698
|
-
warning: /* @__PURE__ */ z(
|
|
699
|
-
error: /* @__PURE__ */ z(
|
|
700
|
-
},
|
|
770
|
+
var Pr = {
|
|
771
|
+
primary: /* @__PURE__ */ z(Lt, {}),
|
|
772
|
+
secondary: /* @__PURE__ */ z(Lt, {}),
|
|
773
|
+
foreground: /* @__PURE__ */ z(Lt, {}),
|
|
774
|
+
info: /* @__PURE__ */ z(Lt, {}),
|
|
775
|
+
success: /* @__PURE__ */ z(wt, {}),
|
|
776
|
+
warning: /* @__PURE__ */ z(Xt, {}),
|
|
777
|
+
error: /* @__PURE__ */ z(Ct, {})
|
|
778
|
+
}, Fr = u(`transition-all rounded border border-card-edge ${ee} p-4 gap-2 text-card-foreground [&_[data-slot=alert-icon]_svg]:mt-1 [&_[data-slot=alert-icon]_svg:not([class*='size-'])]:size-4`, {
|
|
701
779
|
variants: { variant: {
|
|
702
780
|
primary: "before:bg-primary-indicator bg-[color-mix(in_oklab,var(--color-primary)_8%,var(--color-card))] dark:bg-[color-mix(in_oklab,var(--color-primary)_14%,var(--color-card))] [&_[data-slot=alert-icon]_svg]:text-primary-text shadow-primary/50",
|
|
703
781
|
secondary: "before:bg-secondary bg-[color-mix(in_oklab,var(--color-secondary)_8%,var(--color-card))] dark:bg-[color-mix(in_oklab,var(--color-secondary)_14%,var(--color-card))] [&_[data-slot=alert-icon]_svg]:text-secondary shadow-secondary/50",
|
|
@@ -708,14 +786,14 @@ var Yn = {
|
|
|
708
786
|
foreground: "before:bg-foreground bg-muted [&_[data-slot=alert-icon]_svg]:text-foreground shadow-foreground/50"
|
|
709
787
|
} },
|
|
710
788
|
defaultVariants: { variant: "primary" }
|
|
711
|
-
}),
|
|
789
|
+
}), Ir = "flex min-w-0 flex-1 flex-col gap-1 break-words whitespace-normal";
|
|
712
790
|
//#endregion
|
|
713
791
|
//#region lib/components/ui/feedback/alert/alert.tsx
|
|
714
|
-
function
|
|
715
|
-
let l = r === void 0 ?
|
|
792
|
+
function Lr({ description: e, actions: t, children: n, icon: r, title: i, className: a, variant: o, ...s }) {
|
|
793
|
+
let l = r === void 0 ? Pr[o ?? "primary"] : r;
|
|
716
794
|
return /* @__PURE__ */ B("div", {
|
|
717
795
|
"data-slot": "alert",
|
|
718
|
-
className: A("flex",
|
|
796
|
+
className: A("flex", Fr({
|
|
719
797
|
variant: o,
|
|
720
798
|
className: a
|
|
721
799
|
})),
|
|
@@ -725,7 +803,7 @@ function Qn({ description: e, actions: t, children: n, icon: r, title: i, classN
|
|
|
725
803
|
className: "shrink-0",
|
|
726
804
|
children: l
|
|
727
805
|
}), /* @__PURE__ */ B("div", {
|
|
728
|
-
className:
|
|
806
|
+
className: Ir,
|
|
729
807
|
children: [
|
|
730
808
|
k(i) && /* @__PURE__ */ z(c, {
|
|
731
809
|
"data-slot": "alert-title",
|
|
@@ -753,8 +831,460 @@ function Qn({ description: e, actions: t, children: n, icon: r, title: i, classN
|
|
|
753
831
|
});
|
|
754
832
|
}
|
|
755
833
|
//#endregion
|
|
834
|
+
//#region lib/hooks/use-latched.ts
|
|
835
|
+
function Rr(e, t) {
|
|
836
|
+
let n = I(t);
|
|
837
|
+
return e && (n.current = t), e ? t : n.current;
|
|
838
|
+
}
|
|
839
|
+
//#endregion
|
|
840
|
+
//#region lib/components/ui/feedback/alert-dialog/alert-dialog-actions.tsx
|
|
841
|
+
function zr({ className: e, ...t }) {
|
|
842
|
+
return /* @__PURE__ */ z(Nn, {
|
|
843
|
+
className: A(T({
|
|
844
|
+
variant: t.variant,
|
|
845
|
+
color: t.color
|
|
846
|
+
}), e),
|
|
847
|
+
...t
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
function Br({ className: e, ...t }) {
|
|
851
|
+
return /* @__PURE__ */ z(Pn, {
|
|
852
|
+
"data-slot": "button",
|
|
853
|
+
"data-color": t.color,
|
|
854
|
+
"data-variant": t.variant ?? "tonal",
|
|
855
|
+
className: A(T({
|
|
856
|
+
variant: t.variant ?? "tonal",
|
|
857
|
+
color: t.color
|
|
858
|
+
}), e),
|
|
859
|
+
...t
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
//#endregion
|
|
863
|
+
//#region lib/components/ui/feedback/alert-dialog/alert-dialog.tsx
|
|
864
|
+
function Vr({ ...e }) {
|
|
865
|
+
return /* @__PURE__ */ z(kn, {
|
|
866
|
+
"data-slot": "alert-dialog",
|
|
867
|
+
...e
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
function Hr({ container: e, ...t }) {
|
|
871
|
+
return /* @__PURE__ */ z(An, {
|
|
872
|
+
"data-slot": "alert-dialog-portal",
|
|
873
|
+
container: f(e),
|
|
874
|
+
...t
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
function Ur({ className: e, ...t }) {
|
|
878
|
+
return /* @__PURE__ */ z(jn, {
|
|
879
|
+
"data-slot": "alert-dialog-overlay",
|
|
880
|
+
className: A("nxgt-scrim fixed inset-0 z-50", e),
|
|
881
|
+
...t
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
function Wr({ className: e, onOpenAutoFocus: t, onCloseAutoFocus: n, onEscapeKeyDown: r, ref: i, ...a }) {
|
|
885
|
+
let o = Ee({
|
|
886
|
+
onOpenAutoFocus: t,
|
|
887
|
+
onCloseAutoFocus: n
|
|
888
|
+
}, { focusFallback: !0 }), s = le({
|
|
889
|
+
ref: i,
|
|
890
|
+
onEscapeKeyDown: r,
|
|
891
|
+
...a
|
|
892
|
+
}, !0);
|
|
893
|
+
return /* @__PURE__ */ z(_, { children: /* @__PURE__ */ z(C, {
|
|
894
|
+
value: !0,
|
|
895
|
+
children: /* @__PURE__ */ B(Hr, { children: [/* @__PURE__ */ z(Ur, { ref: s.overlayRef }), /* @__PURE__ */ z(Mn, {
|
|
896
|
+
ref: s.ref,
|
|
897
|
+
"data-slot": "alert-dialog-content",
|
|
898
|
+
className: A("nxgt-dialog @container/dialog fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 p-6 sm:max-w-lg max-h-[calc(100dvh-2rem)] supports-[not(height:100dvh)]:max-h-[calc(100vh-2rem)] overflow-y-auto", e),
|
|
899
|
+
onOpenAutoFocus: o.onOpenAutoFocus,
|
|
900
|
+
onCloseAutoFocus: o.onCloseAutoFocus,
|
|
901
|
+
onEscapeKeyDown: s.onEscapeKeyDown,
|
|
902
|
+
...a,
|
|
903
|
+
onFocusOutside: s.outside.onFocusOutside
|
|
904
|
+
})] })
|
|
905
|
+
}) });
|
|
906
|
+
}
|
|
907
|
+
function Gr({ className: e, ...t }) {
|
|
908
|
+
return /* @__PURE__ */ z("div", {
|
|
909
|
+
"data-slot": "alert-dialog-header",
|
|
910
|
+
className: A("flex flex-col gap-2 text-left", e),
|
|
911
|
+
...t
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
function Kr({ className: e, ...t }) {
|
|
915
|
+
return /* @__PURE__ */ z("div", {
|
|
916
|
+
"data-slot": "alert-dialog-footer",
|
|
917
|
+
className: A("flex flex-row flex-wrap justify-end gap-2 pt-2 @max-sm/dialog:*:min-h-11 @max-sm/dialog:*:flex-1", e),
|
|
918
|
+
...t
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
function qr({ className: e, ...t }) {
|
|
922
|
+
return /* @__PURE__ */ z(Fn, {
|
|
923
|
+
"data-slot": "alert-dialog-title",
|
|
924
|
+
className: A("text-2xl/8 font-medium tracking-tight text-foreground", e),
|
|
925
|
+
...t
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
function Jr({ className: e, ...t }) {
|
|
929
|
+
return /* @__PURE__ */ z(In, {
|
|
930
|
+
"data-slot": "alert-dialog-description",
|
|
931
|
+
className: A("text-muted-foreground text-sm/6", e),
|
|
932
|
+
...t
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
//#endregion
|
|
936
|
+
//#region lib/components/ui/feedback/confirm-dialog/action-refusal.ts
|
|
937
|
+
var Yr = class extends Error {
|
|
938
|
+
action;
|
|
939
|
+
details;
|
|
940
|
+
constructor(e, t) {
|
|
941
|
+
super(e), this.name = "ActionRefusal", this.action = t.action, this.details = t.details;
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
function Xr(e) {
|
|
945
|
+
return e instanceof Yr || e instanceof Error && e.name === "ActionRefusal" && typeof e.action?.label == "string";
|
|
946
|
+
}
|
|
947
|
+
//#endregion
|
|
948
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-refusal.tsx
|
|
949
|
+
var Zr = "font-medium text-inherit underline underline-offset-2";
|
|
950
|
+
function Qr({ action: e, close: t }) {
|
|
951
|
+
return e.href && !e.onAction ? /* @__PURE__ */ z("a", {
|
|
952
|
+
className: Zr,
|
|
953
|
+
href: e.href,
|
|
954
|
+
onClick: t,
|
|
955
|
+
children: e.label
|
|
956
|
+
}) : /* @__PURE__ */ z("button", {
|
|
957
|
+
type: "button",
|
|
958
|
+
className: Zr,
|
|
959
|
+
onClick: () => {
|
|
960
|
+
e.onAction?.(), t();
|
|
961
|
+
},
|
|
962
|
+
children: e.label
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
function $r({ message: e, cause: t, close: n }) {
|
|
966
|
+
return Xr(t) ? /* @__PURE__ */ B("div", {
|
|
967
|
+
className: "flex flex-col gap-1",
|
|
968
|
+
children: [
|
|
969
|
+
/* @__PURE__ */ z("span", { children: e }),
|
|
970
|
+
t.details != null && /* @__PURE__ */ z("span", {
|
|
971
|
+
className: "text-muted-foreground",
|
|
972
|
+
children: t.details
|
|
973
|
+
}),
|
|
974
|
+
/* @__PURE__ */ z("span", { children: /* @__PURE__ */ z(Qr, {
|
|
975
|
+
action: t.action,
|
|
976
|
+
close: n
|
|
977
|
+
}) })
|
|
978
|
+
]
|
|
979
|
+
}) : /* @__PURE__ */ z(R, { children: e });
|
|
980
|
+
}
|
|
981
|
+
//#endregion
|
|
982
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-alert.tsx
|
|
983
|
+
function ei({ message: e, cause: t, close: n, refusal: r }) {
|
|
984
|
+
return /* @__PURE__ */ z("div", {
|
|
985
|
+
role: "alert",
|
|
986
|
+
className: "text-sm text-error-text",
|
|
987
|
+
children: r ? r({
|
|
988
|
+
message: e,
|
|
989
|
+
cause: t,
|
|
990
|
+
close: n
|
|
991
|
+
}) : /* @__PURE__ */ z($r, {
|
|
992
|
+
message: e,
|
|
993
|
+
cause: t,
|
|
994
|
+
close: n
|
|
995
|
+
})
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-description.tsx
|
|
1000
|
+
function ti({ children: e, details: t }) {
|
|
1001
|
+
return typeof e == "string" && t == null ? /* @__PURE__ */ z(Jr, { children: e }) : /* @__PURE__ */ z(Jr, {
|
|
1002
|
+
asChild: !0,
|
|
1003
|
+
children: /* @__PURE__ */ z("div", {
|
|
1004
|
+
className: "space-y-2",
|
|
1005
|
+
children: t == null ? e : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", { children: e }), /* @__PURE__ */ z("div", { children: t })] })
|
|
1006
|
+
})
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
//#endregion
|
|
1010
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.ts
|
|
1011
|
+
function ni({ busy: e, confirmDisabled: t, lockOnRefusal: n, error: r, cause: i }) {
|
|
1012
|
+
let a = !!r && (typeof n == "function" ? n(i) : !!n);
|
|
1013
|
+
return e || !!t || a;
|
|
1014
|
+
}
|
|
1015
|
+
function ri(e, t, n = "exact") {
|
|
1016
|
+
if (t === "") return !0;
|
|
1017
|
+
if (n === "exact") return e === t;
|
|
1018
|
+
let r = e.trim(), i = t.trim();
|
|
1019
|
+
return n === "trim" ? r === i : r.toLowerCase() === i.toLowerCase();
|
|
1020
|
+
}
|
|
1021
|
+
function ii(e) {
|
|
1022
|
+
return e.tone ?? (e.variant === "destructive" ? "danger" : "default");
|
|
1023
|
+
}
|
|
1024
|
+
var ai = {
|
|
1025
|
+
default: "primary",
|
|
1026
|
+
warning: "warning",
|
|
1027
|
+
danger: "error"
|
|
1028
|
+
}, oi = D;
|
|
1029
|
+
function si({ className: e, type: t = "text", ...n }) {
|
|
1030
|
+
return /* @__PURE__ */ z("input", {
|
|
1031
|
+
type: t,
|
|
1032
|
+
"data-slot": "input",
|
|
1033
|
+
className: A(oi, e),
|
|
1034
|
+
"data-pw": n.name ?? "input",
|
|
1035
|
+
...n,
|
|
1036
|
+
placeholder: Ye(n.placeholder, t)
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
//#endregion
|
|
1040
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-phrase.tsx
|
|
1041
|
+
function ci({ phrase: e, value: t, onValueChange: n, onEnter: r, disabled: i, inputRef: o }) {
|
|
1042
|
+
let { t: s } = a(), c = F(), l = `${c}-phrase`;
|
|
1043
|
+
return /* @__PURE__ */ B("div", {
|
|
1044
|
+
className: "grid gap-2",
|
|
1045
|
+
"data-slot": "confirm-phrase",
|
|
1046
|
+
children: [
|
|
1047
|
+
/* @__PURE__ */ z(h, {
|
|
1048
|
+
htmlFor: c,
|
|
1049
|
+
children: s("material.confirm-dialog.type-phrase-label", "Type the phrase below to confirm")
|
|
1050
|
+
}),
|
|
1051
|
+
/* @__PURE__ */ z("code", {
|
|
1052
|
+
id: l,
|
|
1053
|
+
"data-slot": "confirm-phrase-value",
|
|
1054
|
+
className: "block rounded bg-muted px-2 py-1 font-mono text-sm break-all select-all",
|
|
1055
|
+
children: e
|
|
1056
|
+
}),
|
|
1057
|
+
/* @__PURE__ */ z(si, {
|
|
1058
|
+
id: c,
|
|
1059
|
+
"aria-describedby": l,
|
|
1060
|
+
ref: o,
|
|
1061
|
+
value: t,
|
|
1062
|
+
disabled: i,
|
|
1063
|
+
autoComplete: "off",
|
|
1064
|
+
autoCapitalize: "off",
|
|
1065
|
+
autoCorrect: "off",
|
|
1066
|
+
spellCheck: !1,
|
|
1067
|
+
onChange: (e) => n(e.target.value),
|
|
1068
|
+
onKeyDown: (e) => {
|
|
1069
|
+
e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), r());
|
|
1070
|
+
}
|
|
1071
|
+
})
|
|
1072
|
+
]
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function li(e, t, n) {
|
|
1076
|
+
let r = I(null), [i, a] = L("");
|
|
1077
|
+
return P(() => {
|
|
1078
|
+
e || a("");
|
|
1079
|
+
}, [e]), {
|
|
1080
|
+
ref: r,
|
|
1081
|
+
typed: i,
|
|
1082
|
+
setTyped: a,
|
|
1083
|
+
missing: !!t && !ri(i, t ?? "", n)
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1087
|
+
//#region lib/components/ui/primitives/textarea/textarea.tsx
|
|
1088
|
+
function ui({ className: e, ...t }) {
|
|
1089
|
+
return /* @__PURE__ */ z("textarea", {
|
|
1090
|
+
"data-slot": "textarea",
|
|
1091
|
+
"data-pw": t.name ?? "textarea",
|
|
1092
|
+
className: A(y, "placeholder:text-muted-foreground flex resize-none outline-none", "field-sizing-content min-h-16 w-full min-w-[min(280px,100%)] px-3 py-2 text-base md:text-sm", e),
|
|
1093
|
+
...t,
|
|
1094
|
+
placeholder: t.placeholder || " "
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-reason.tsx
|
|
1099
|
+
function di({ reason: e, state: t, disabled: n }) {
|
|
1100
|
+
let { typed: r, setTyped: i, ref: o } = t, { t: s } = a(), c = F(), l = `${c}-note`, { maxLength: u } = e, d = !!e.helperText || u != null;
|
|
1101
|
+
return /* @__PURE__ */ B("div", {
|
|
1102
|
+
className: "grid gap-2",
|
|
1103
|
+
"data-slot": "confirm-reason",
|
|
1104
|
+
children: [
|
|
1105
|
+
/* @__PURE__ */ z(h, {
|
|
1106
|
+
htmlFor: c,
|
|
1107
|
+
withAsterisk: !0,
|
|
1108
|
+
children: e.label ?? s("material.confirm-dialog.reason", "Reason")
|
|
1109
|
+
}),
|
|
1110
|
+
/* @__PURE__ */ z(ui, {
|
|
1111
|
+
id: c,
|
|
1112
|
+
ref: o,
|
|
1113
|
+
value: r,
|
|
1114
|
+
required: !0,
|
|
1115
|
+
"aria-required": "true",
|
|
1116
|
+
rows: e.rows ?? 3,
|
|
1117
|
+
maxLength: u,
|
|
1118
|
+
placeholder: e.placeholder,
|
|
1119
|
+
disabled: n,
|
|
1120
|
+
"aria-describedby": d ? l : void 0,
|
|
1121
|
+
onChange: (e) => i(e.target.value)
|
|
1122
|
+
}),
|
|
1123
|
+
d && /* @__PURE__ */ B("p", {
|
|
1124
|
+
id: l,
|
|
1125
|
+
className: "text-muted-foreground flex justify-between gap-3 text-xs",
|
|
1126
|
+
children: [/* @__PURE__ */ z("span", { children: e.helperText }), u != null && /* @__PURE__ */ z("span", {
|
|
1127
|
+
className: "ms-auto shrink-0 whitespace-nowrap tabular-nums",
|
|
1128
|
+
children: s("material.confirm-dialog.reason-count", "{count} / {max}", {
|
|
1129
|
+
count: r.length,
|
|
1130
|
+
max: u
|
|
1131
|
+
})
|
|
1132
|
+
})]
|
|
1133
|
+
})
|
|
1134
|
+
]
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
function fi(e, t) {
|
|
1138
|
+
let n = I(null), [r, i] = L("");
|
|
1139
|
+
P(() => {
|
|
1140
|
+
e || i("");
|
|
1141
|
+
}, [e]);
|
|
1142
|
+
let a = r.trim();
|
|
1143
|
+
return {
|
|
1144
|
+
ref: n,
|
|
1145
|
+
typed: r,
|
|
1146
|
+
setTyped: i,
|
|
1147
|
+
value: a,
|
|
1148
|
+
missing: t && a === ""
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
//#endregion
|
|
1152
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-fields.tsx
|
|
1153
|
+
function pi({ phrase: e, typedPhrase: t, reason: n, typedReason: r, disabled: i, onEnter: a }) {
|
|
1154
|
+
return /* @__PURE__ */ B(R, { children: [e && /* @__PURE__ */ z(ci, {
|
|
1155
|
+
phrase: e,
|
|
1156
|
+
value: t.typed,
|
|
1157
|
+
onValueChange: t.setTyped,
|
|
1158
|
+
onEnter: a,
|
|
1159
|
+
disabled: i,
|
|
1160
|
+
inputRef: t.ref
|
|
1161
|
+
}), n && /* @__PURE__ */ z(di, {
|
|
1162
|
+
reason: n,
|
|
1163
|
+
state: r,
|
|
1164
|
+
disabled: i
|
|
1165
|
+
})] });
|
|
1166
|
+
}
|
|
1167
|
+
//#endregion
|
|
1168
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-footer.tsx
|
|
1169
|
+
function mi({ tone: e, busy: t, disabled: n, cancelLabel: r, confirmLabel: i, cancelVariant: o, onConfirm: s }) {
|
|
1170
|
+
let { t: c } = a();
|
|
1171
|
+
return /* @__PURE__ */ B(Kr, { children: [/* @__PURE__ */ z(Br, {
|
|
1172
|
+
disabled: t,
|
|
1173
|
+
variant: o,
|
|
1174
|
+
children: r ?? c("material.confirm-dialog.cancel", "Cancel")
|
|
1175
|
+
}), /* @__PURE__ */ z(zr, {
|
|
1176
|
+
onClick: s,
|
|
1177
|
+
color: ai[e],
|
|
1178
|
+
"data-tone": e,
|
|
1179
|
+
disabled: n,
|
|
1180
|
+
children: t ? c("material.confirm-dialog.processing", "Processing...") : i ?? c("material.confirm-dialog.confirm", "Confirm")
|
|
1181
|
+
})] });
|
|
1182
|
+
}
|
|
1183
|
+
//#endregion
|
|
1184
|
+
//#region lib/components/ui/feedback/confirm-dialog/use-confirm-action.ts
|
|
1185
|
+
function hi({ open: e, onOpenChange: t, onConfirm: n, reason: r = "" }) {
|
|
1186
|
+
let { t: i } = a(), [o, s] = L(!1), [c, l] = L(null), [u, d] = L(null);
|
|
1187
|
+
return P(() => {
|
|
1188
|
+
e || (l(null), d(null));
|
|
1189
|
+
}, [e]), {
|
|
1190
|
+
pending: o,
|
|
1191
|
+
error: c,
|
|
1192
|
+
cause: u,
|
|
1193
|
+
handleOpenChange: (e) => {
|
|
1194
|
+
e && (l(null), d(null)), t(e);
|
|
1195
|
+
},
|
|
1196
|
+
handleConfirm: async (e) => {
|
|
1197
|
+
e.preventDefault(), l(null), d(null), s(!0);
|
|
1198
|
+
try {
|
|
1199
|
+
await n(r), t(!1);
|
|
1200
|
+
} catch (e) {
|
|
1201
|
+
d(e), l(e instanceof Error && e.message ? e.message : i("material.confirm-dialog.failed", "The action failed."));
|
|
1202
|
+
} finally {
|
|
1203
|
+
s(!1);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
function gi(e) {
|
|
1209
|
+
let t = I(null);
|
|
1210
|
+
return P(() => {
|
|
1211
|
+
let n = t.current;
|
|
1212
|
+
if (!e || !n) return;
|
|
1213
|
+
let r = document.activeElement;
|
|
1214
|
+
(r === document.body || n.contains(r)) && n.focus();
|
|
1215
|
+
}, [e]), t;
|
|
1216
|
+
}
|
|
1217
|
+
function _i(e, t) {
|
|
1218
|
+
t && (e.preventDefault(), t.focus());
|
|
1219
|
+
}
|
|
1220
|
+
//#endregion
|
|
1221
|
+
//#region lib/components/ui/feedback/confirm-dialog/confirm-dialog.tsx
|
|
1222
|
+
function vi(e) {
|
|
1223
|
+
let { open: t, onOpenChange: n, onConfirm: r, loading: i = !1 } = e, a = Rr(t, {
|
|
1224
|
+
title: e.title,
|
|
1225
|
+
description: e.description,
|
|
1226
|
+
details: e.details,
|
|
1227
|
+
confirmLabel: e.confirmLabel,
|
|
1228
|
+
cancelLabel: e.cancelLabel,
|
|
1229
|
+
tone: ii(e),
|
|
1230
|
+
confirmPhrase: e.confirmPhrase,
|
|
1231
|
+
reason: e.reason
|
|
1232
|
+
}), o = fi(t, !!a.reason), { pending: s, error: c, cause: l, handleOpenChange: u, handleConfirm: d } = hi({
|
|
1233
|
+
open: t,
|
|
1234
|
+
onOpenChange: n,
|
|
1235
|
+
onConfirm: r,
|
|
1236
|
+
reason: o.value
|
|
1237
|
+
}), f = i || s, p = gi(s), m = li(t, a.confirmPhrase, e.confirmPhraseMatch ?? "exact"), h = ni({
|
|
1238
|
+
busy: f,
|
|
1239
|
+
confirmDisabled: e.confirmDisabled || m.missing || o.missing,
|
|
1240
|
+
lockOnRefusal: e.lockOnRefusal,
|
|
1241
|
+
error: c,
|
|
1242
|
+
cause: l
|
|
1243
|
+
});
|
|
1244
|
+
return /* @__PURE__ */ z(Vr, {
|
|
1245
|
+
open: t,
|
|
1246
|
+
onOpenChange: u,
|
|
1247
|
+
children: /* @__PURE__ */ B(Wr, {
|
|
1248
|
+
ref: p,
|
|
1249
|
+
onOpenAutoFocus: (e) => _i(e, m.ref.current ?? o.ref.current),
|
|
1250
|
+
onCloseAutoFocus: e.onCloseAutoFocus,
|
|
1251
|
+
children: [
|
|
1252
|
+
/* @__PURE__ */ B(Gr, { children: [/* @__PURE__ */ z(qr, { children: a.title }), /* @__PURE__ */ z(ti, {
|
|
1253
|
+
details: a.details,
|
|
1254
|
+
children: a.description
|
|
1255
|
+
})] }),
|
|
1256
|
+
/* @__PURE__ */ z(pi, {
|
|
1257
|
+
phrase: a.confirmPhrase,
|
|
1258
|
+
typedPhrase: m,
|
|
1259
|
+
reason: a.reason,
|
|
1260
|
+
typedReason: o,
|
|
1261
|
+
disabled: f,
|
|
1262
|
+
onEnter: () => {
|
|
1263
|
+
h || d({ preventDefault() {} });
|
|
1264
|
+
}
|
|
1265
|
+
}),
|
|
1266
|
+
c && /* @__PURE__ */ z(ei, {
|
|
1267
|
+
message: c,
|
|
1268
|
+
cause: l,
|
|
1269
|
+
close: () => n(!1),
|
|
1270
|
+
refusal: e.refusal
|
|
1271
|
+
}),
|
|
1272
|
+
/* @__PURE__ */ z(mi, {
|
|
1273
|
+
tone: a.tone,
|
|
1274
|
+
busy: f,
|
|
1275
|
+
disabled: h,
|
|
1276
|
+
cancelLabel: a.cancelLabel,
|
|
1277
|
+
confirmLabel: a.confirmLabel,
|
|
1278
|
+
cancelVariant: e.cancelVariant,
|
|
1279
|
+
onConfirm: d
|
|
1280
|
+
})
|
|
1281
|
+
]
|
|
1282
|
+
})
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
//#endregion
|
|
756
1286
|
//#region lib/hooks/use-focus-on-mount.ts
|
|
757
|
-
function
|
|
1287
|
+
function yi(e = !0) {
|
|
758
1288
|
let t = I(null);
|
|
759
1289
|
return P(() => {
|
|
760
1290
|
e && t.current?.focus();
|
|
@@ -762,7 +1292,7 @@ function $n(e = !0) {
|
|
|
762
1292
|
}
|
|
763
1293
|
//#endregion
|
|
764
1294
|
//#region lib/components/ui/feedback/state-frame/state-frame-text.tsx
|
|
765
|
-
function
|
|
1295
|
+
function bi({ title: e, description: t, headingLevel: n, titleRef: r, inline: i, compact: a }) {
|
|
766
1296
|
return e == null && t == null ? null : /* @__PURE__ */ B("div", {
|
|
767
1297
|
className: A("flex flex-col", i ? "min-w-0 flex-1 gap-0.5" : "max-w-sm gap-2"),
|
|
768
1298
|
children: [e != null && /* @__PURE__ */ z(c, {
|
|
@@ -781,22 +1311,22 @@ function er({ title: e, description: t, headingLevel: n, titleRef: r, inline: i,
|
|
|
781
1311
|
}
|
|
782
1312
|
//#endregion
|
|
783
1313
|
//#region lib/components/ui/feedback/state-frame/state-icon.tsx
|
|
784
|
-
var
|
|
785
|
-
"package-open":
|
|
786
|
-
search:
|
|
787
|
-
"file-question":
|
|
788
|
-
"shield-alert":
|
|
789
|
-
"alert-circle":
|
|
790
|
-
"wifi-off":
|
|
791
|
-
construction:
|
|
1314
|
+
var xi = {
|
|
1315
|
+
"package-open": Bt,
|
|
1316
|
+
search: Ut,
|
|
1317
|
+
"file-question": Nt,
|
|
1318
|
+
"shield-alert": Gt,
|
|
1319
|
+
"alert-circle": vt,
|
|
1320
|
+
"wifi-off": Zt,
|
|
1321
|
+
construction: Et
|
|
792
1322
|
};
|
|
793
|
-
function
|
|
794
|
-
let t =
|
|
1323
|
+
function Si({ kind: e }) {
|
|
1324
|
+
let t = xi[$t[e]];
|
|
795
1325
|
return /* @__PURE__ */ z(t, { "aria-hidden": "true" });
|
|
796
1326
|
}
|
|
797
1327
|
//#endregion
|
|
798
1328
|
//#region lib/components/ui/feedback/state-frame/state-scene-illustration.tsx
|
|
799
|
-
function
|
|
1329
|
+
function Ci({ scene: e, size: t, loading: n }) {
|
|
800
1330
|
return /* @__PURE__ */ z("div", {
|
|
801
1331
|
"data-slot": "illustration",
|
|
802
1332
|
"data-scene": e,
|
|
@@ -804,27 +1334,27 @@ function rr({ scene: e, size: t, loading: n }) {
|
|
|
804
1334
|
"data-fallback": n ? void 0 : "",
|
|
805
1335
|
"data-loading": n ? "" : void 0,
|
|
806
1336
|
"aria-hidden": "true",
|
|
807
|
-
children: /* @__PURE__ */ z(
|
|
808
|
-
kind:
|
|
1337
|
+
children: /* @__PURE__ */ z(Ze, {
|
|
1338
|
+
kind: it[e] ?? "empty",
|
|
809
1339
|
className: "h-full w-full"
|
|
810
1340
|
})
|
|
811
1341
|
});
|
|
812
1342
|
}
|
|
813
|
-
var
|
|
1343
|
+
var wi = Qe("illustration", async () => {
|
|
814
1344
|
let { Illustration: e } = await import("./embed-chunks/illustration-ByW4pxRC.js");
|
|
815
1345
|
return ({ scene: t, size: n }) => /* @__PURE__ */ z(e, {
|
|
816
1346
|
scene: t,
|
|
817
1347
|
size: n
|
|
818
1348
|
});
|
|
819
|
-
},
|
|
820
|
-
function
|
|
821
|
-
return /* @__PURE__ */ z(
|
|
822
|
-
fallback: /* @__PURE__ */ z(
|
|
1349
|
+
}, Ci);
|
|
1350
|
+
function Ti({ scene: e, size: t }) {
|
|
1351
|
+
return /* @__PURE__ */ z(ot, {
|
|
1352
|
+
fallback: /* @__PURE__ */ z(Ci, {
|
|
823
1353
|
scene: e,
|
|
824
1354
|
size: t,
|
|
825
1355
|
loading: !0
|
|
826
1356
|
}),
|
|
827
|
-
children: /* @__PURE__ */ z(
|
|
1357
|
+
children: /* @__PURE__ */ z(wi, {
|
|
828
1358
|
scene: e,
|
|
829
1359
|
size: t
|
|
830
1360
|
})
|
|
@@ -832,16 +1362,16 @@ function ar({ scene: e, size: t }) {
|
|
|
832
1362
|
}
|
|
833
1363
|
//#endregion
|
|
834
1364
|
//#region lib/components/ui/feedback/state-frame/use-state-media.tsx
|
|
835
|
-
function
|
|
836
|
-
let i = t === "inline", a = t === "compact" || i, o = A("flex shrink-0 items-center justify-center rounded",
|
|
837
|
-
return d = n === !1 ? null : u ? /* @__PURE__ */ z(
|
|
1365
|
+
function Ei({ kind: e, size: t, illustration: n, icon: r }) {
|
|
1366
|
+
let i = t === "inline", a = t === "compact" || i, o = A("flex shrink-0 items-center justify-center rounded", tt[Qt[e]], i ? "size-8 rounded-full [&_svg]:size-4" : a ? "size-10 [&_svg]:size-5" : "size-16 [&_svg]:size-7"), s = $e(), c = n === !0 || nt(n, s?.sets) ? nt(n, s?.sets) ? n : et[e] : null, l = n == null && r == null && t === "default" ? rt(s, et[e]) : void 0, u = i ? null : c ?? (l ? et[e] : null), d = null;
|
|
1367
|
+
return d = n === !1 ? null : u ? /* @__PURE__ */ z(Ti, {
|
|
838
1368
|
scene: u,
|
|
839
1369
|
size: a ? "sm" : "md"
|
|
840
|
-
}) : n != null && n !== !0 && !
|
|
1370
|
+
}) : n != null && n !== !0 && !nt(n, s?.sets) ? n : r == null ? a ? /* @__PURE__ */ z("div", {
|
|
841
1371
|
"data-slot": "state-icon-well",
|
|
842
1372
|
className: o,
|
|
843
|
-
children: /* @__PURE__ */ z(
|
|
844
|
-
}) : /* @__PURE__ */ z(
|
|
1373
|
+
children: /* @__PURE__ */ z(Si, { kind: e })
|
|
1374
|
+
}) : /* @__PURE__ */ z(Ze, { kind: e }) : /* @__PURE__ */ z("div", {
|
|
845
1375
|
"data-slot": "state-icon-well",
|
|
846
1376
|
className: o,
|
|
847
1377
|
children: r
|
|
@@ -849,8 +1379,8 @@ function or({ kind: e, size: t, illustration: n, icon: r }) {
|
|
|
849
1379
|
}
|
|
850
1380
|
//#endregion
|
|
851
1381
|
//#region lib/components/ui/feedback/state-frame/state-frame.tsx
|
|
852
|
-
function
|
|
853
|
-
let f = t === "inline", p = t === "compact" || f, m =
|
|
1382
|
+
function Di({ kind: e, size: t = "default", illustration: n, icon: r, title: i, headingLevel: a, focusTitle: o = !1, description: s, actions: c, className: l, children: u, ...d }) {
|
|
1383
|
+
let f = t === "inline", p = t === "compact" || f, m = yi(o), h = Ei({
|
|
854
1384
|
kind: e,
|
|
855
1385
|
size: t,
|
|
856
1386
|
illustration: n,
|
|
@@ -863,7 +1393,7 @@ function sr({ kind: e, size: t = "default", illustration: n, icon: r, title: i,
|
|
|
863
1393
|
...d,
|
|
864
1394
|
children: [
|
|
865
1395
|
h,
|
|
866
|
-
/* @__PURE__ */ z(
|
|
1396
|
+
/* @__PURE__ */ z(bi, {
|
|
867
1397
|
title: i,
|
|
868
1398
|
description: s,
|
|
869
1399
|
headingLevel: a,
|
|
@@ -881,9 +1411,9 @@ function sr({ kind: e, size: t = "default", illustration: n, icon: r, title: i,
|
|
|
881
1411
|
}
|
|
882
1412
|
//#endregion
|
|
883
1413
|
//#region lib/components/ui/feedback/empty-state/empty-state.tsx
|
|
884
|
-
function
|
|
885
|
-
let l =
|
|
886
|
-
return /* @__PURE__ */ z(
|
|
1414
|
+
function Oi({ kind: e = "empty", size: t = "default", illustration: n, icon: r, title: i, description: o, action: s, ...c }) {
|
|
1415
|
+
let l = en(e, "empty-state"), { t: u } = a(), d = o ?? (i == null ? u(l.descriptionKey, l.description) : void 0);
|
|
1416
|
+
return /* @__PURE__ */ z(Di, {
|
|
887
1417
|
"data-slot": "empty-state",
|
|
888
1418
|
"data-variant": e,
|
|
889
1419
|
kind: e,
|
|
@@ -898,7 +1428,7 @@ function cr({ kind: e = "empty", size: t = "default", illustration: n, icon: r,
|
|
|
898
1428
|
}
|
|
899
1429
|
//#endregion
|
|
900
1430
|
//#region lib/components/ui/feedback/skeleton/skeleton-text.tsx
|
|
901
|
-
function
|
|
1431
|
+
function ki({ lines: e = 3, labelled: t = !0, className: n, ...r }) {
|
|
902
1432
|
let { t: i } = a(), o = Math.max(1, e);
|
|
903
1433
|
return /* @__PURE__ */ B("div", {
|
|
904
1434
|
"data-slot": "skeleton-text",
|
|
@@ -909,29 +1439,16 @@ function lr({ lines: e = 3, labelled: t = !0, className: n, ...r }) {
|
|
|
909
1439
|
children: [t && /* @__PURE__ */ z("span", {
|
|
910
1440
|
className: "sr-only",
|
|
911
1441
|
children: i("material.skeleton.loading", "Loading")
|
|
912
|
-
}), Array.from({ length: o }, (e, t) => /* @__PURE__ */ z(
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
//#endregion
|
|
916
|
-
//#region lib/components/ui/primitives/input/input.tsx
|
|
917
|
-
var ur = D;
|
|
918
|
-
function dr({ className: e, type: t = "text", ...n }) {
|
|
919
|
-
return /* @__PURE__ */ z("input", {
|
|
920
|
-
type: t,
|
|
921
|
-
"data-slot": "input",
|
|
922
|
-
className: A(ur, e),
|
|
923
|
-
"data-pw": n.name ?? "input",
|
|
924
|
-
...n,
|
|
925
|
-
placeholder: Ne(n.placeholder, t)
|
|
1442
|
+
}), Array.from({ length: o }, (e, t) => /* @__PURE__ */ z(Ne, { className: A("h-3 w-full", t === o - 1 && o > 1 && "w-3/4") }, t))]
|
|
926
1443
|
});
|
|
927
1444
|
}
|
|
928
1445
|
//#endregion
|
|
929
1446
|
//#region lib/components/ui/fields/text-field/text-field-label.tsx
|
|
930
|
-
function
|
|
1447
|
+
function Ai({ children: e, action: t, required: n, htmlFor: r }) {
|
|
931
1448
|
return t ? /* @__PURE__ */ B("div", {
|
|
932
1449
|
"data-slot": "field-label-row",
|
|
933
1450
|
className: "flex items-baseline justify-between gap-2",
|
|
934
|
-
children: [/* @__PURE__ */ z(
|
|
1451
|
+
children: [/* @__PURE__ */ z(h, {
|
|
935
1452
|
withAsterisk: n,
|
|
936
1453
|
htmlFor: r,
|
|
937
1454
|
className: "min-w-0",
|
|
@@ -941,7 +1458,7 @@ function fr({ children: e, action: t, required: n, htmlFor: r }) {
|
|
|
941
1458
|
className: "shrink-0",
|
|
942
1459
|
children: t
|
|
943
1460
|
})]
|
|
944
|
-
}) : /* @__PURE__ */ z(
|
|
1461
|
+
}) : /* @__PURE__ */ z(h, {
|
|
945
1462
|
withAsterisk: n,
|
|
946
1463
|
htmlFor: r,
|
|
947
1464
|
children: e
|
|
@@ -949,42 +1466,42 @@ function fr({ children: e, action: t, required: n, htmlFor: r }) {
|
|
|
949
1466
|
}
|
|
950
1467
|
//#endregion
|
|
951
1468
|
//#region lib/lib/compose-refs.ts
|
|
952
|
-
function
|
|
1469
|
+
function ji(...e) {
|
|
953
1470
|
return (t) => {
|
|
954
1471
|
for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
|
|
955
1472
|
};
|
|
956
1473
|
}
|
|
957
1474
|
//#endregion
|
|
958
1475
|
//#region lib/components/ui/fields/text-field/text-field-units.tsx
|
|
959
|
-
function
|
|
1476
|
+
function Mi(e, t, n) {
|
|
960
1477
|
return e === "password" && t ? "•".repeat(t.length) : t || n || " ";
|
|
961
1478
|
}
|
|
962
|
-
var
|
|
963
|
-
function
|
|
964
|
-
e.defaultPrevented || e.target.closest(
|
|
1479
|
+
var Ni = "button, a, input, select, textarea, label, [role=button], [role=menuitem]";
|
|
1480
|
+
function Pi(e, t) {
|
|
1481
|
+
e.defaultPrevented || e.target.closest(Ni) || t?.focus();
|
|
965
1482
|
}
|
|
966
|
-
function
|
|
967
|
-
return t ? /* @__PURE__ */ z(
|
|
1483
|
+
function Fi({ align: e, node: t }) {
|
|
1484
|
+
return t ? /* @__PURE__ */ z(Ie, {
|
|
968
1485
|
align: e,
|
|
969
1486
|
"data-slot": e === "inline-start" ? "text-field-leading" : "text-field-trailing",
|
|
970
1487
|
className: A("flex-none py-1 text-base md:text-sm font-normal whitespace-nowrap tabular-nums", N(t) && "[&>*]:size-8 pointer-coarse:[&>*]:size-11"),
|
|
971
1488
|
children: t
|
|
972
1489
|
}) : null;
|
|
973
1490
|
}
|
|
974
|
-
function
|
|
975
|
-
let i = r.value !== void 0, [a, o] = L(null), s = I(null), c =
|
|
1491
|
+
function Ii({ leading: e, trailing: t, ref: n, ...r }) {
|
|
1492
|
+
let i = r.value !== void 0, [a, o] = L(null), s = I(null), c = pt(() => ji(s, n), [n]);
|
|
976
1493
|
P(() => {
|
|
977
1494
|
let e = s.current?.form;
|
|
978
1495
|
if (!e || i) return;
|
|
979
1496
|
let t = () => o(null);
|
|
980
1497
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
981
1498
|
}, [i]);
|
|
982
|
-
let l = i ? String(r.value ?? "") : a ?? String(r.defaultValue ?? ""), u =
|
|
983
|
-
return /* @__PURE__ */ B(
|
|
1499
|
+
let l = i ? String(r.value ?? "") : a ?? String(r.defaultValue ?? ""), u = Mi(r.type, l, r.placeholder);
|
|
1500
|
+
return /* @__PURE__ */ B(qe, {
|
|
984
1501
|
className: "gap-1",
|
|
985
|
-
onClick: (e) =>
|
|
1502
|
+
onClick: (e) => Pi(e, s.current),
|
|
986
1503
|
children: [
|
|
987
|
-
/* @__PURE__ */ z(
|
|
1504
|
+
/* @__PURE__ */ z(Fi, {
|
|
988
1505
|
align: "inline-start",
|
|
989
1506
|
node: e
|
|
990
1507
|
}),
|
|
@@ -992,7 +1509,7 @@ function vr({ leading: e, trailing: t, ref: n, ...r }) {
|
|
|
992
1509
|
"data-slot": "text-field-value",
|
|
993
1510
|
"data-value": u,
|
|
994
1511
|
className: A("inline-grid h-full max-w-full min-w-4 items-center text-base md:text-sm", "after:invisible after:col-start-1 after:row-start-1 after:whitespace-pre after:content-[attr(data-value)]", t ? "flex-none shrink" : "flex-1", e ? "pointer-coarse:min-w-11" : "ps-3 pointer-coarse:min-w-14", !t && "pe-3"),
|
|
995
|
-
children: /* @__PURE__ */ z(
|
|
1512
|
+
children: /* @__PURE__ */ z(He, {
|
|
996
1513
|
...r,
|
|
997
1514
|
ref: c,
|
|
998
1515
|
className: "col-start-1 row-start-1 w-0 min-w-full px-0 md:pb-1.5 [font:inherit] [font-variant-numeric:inherit] [letter-spacing:inherit]",
|
|
@@ -1001,7 +1518,7 @@ function vr({ leading: e, trailing: t, ref: n, ...r }) {
|
|
|
1001
1518
|
}
|
|
1002
1519
|
})
|
|
1003
1520
|
}),
|
|
1004
|
-
/* @__PURE__ */ z(
|
|
1521
|
+
/* @__PURE__ */ z(Fi, {
|
|
1005
1522
|
align: "inline-end",
|
|
1006
1523
|
node: t
|
|
1007
1524
|
})
|
|
@@ -1010,13 +1527,13 @@ function vr({ leading: e, trailing: t, ref: n, ...r }) {
|
|
|
1010
1527
|
}
|
|
1011
1528
|
//#endregion
|
|
1012
1529
|
//#region lib/components/ui/fields/text-field/text-field.tsx
|
|
1013
|
-
function
|
|
1014
|
-
let c =
|
|
1530
|
+
function Li({ error: e, helperText: t, label: n, labelAction: r, className: i, leading: a, trailing: o, ...s }) {
|
|
1531
|
+
let c = ce(), l = F(), u = F(), d = tn(s["aria-describedby"], !!t && u), f = !!a && !N(a), p = !!o && !N(o), m = {
|
|
1015
1532
|
"aria-invalid": e,
|
|
1016
1533
|
...s,
|
|
1017
1534
|
id: s.id ?? l,
|
|
1018
1535
|
"aria-describedby": d
|
|
1019
|
-
}, h = f || p ? /* @__PURE__ */ z(
|
|
1536
|
+
}, h = f || p ? /* @__PURE__ */ z(Ii, {
|
|
1020
1537
|
...m,
|
|
1021
1538
|
leading: a,
|
|
1022
1539
|
trailing: o
|
|
@@ -1027,7 +1544,7 @@ function yr({ error: e, helperText: t, label: n, labelAction: r, className: i, l
|
|
|
1027
1544
|
}),
|
|
1028
1545
|
children: [
|
|
1029
1546
|
a,
|
|
1030
|
-
/* @__PURE__ */ z(
|
|
1547
|
+
/* @__PURE__ */ z(si, { ...m }),
|
|
1031
1548
|
o
|
|
1032
1549
|
]
|
|
1033
1550
|
});
|
|
@@ -1035,14 +1552,14 @@ function yr({ error: e, helperText: t, label: n, labelAction: r, className: i, l
|
|
|
1035
1552
|
ref: c,
|
|
1036
1553
|
"data-slot": "text-field",
|
|
1037
1554
|
className: A("grid w-full content-start gap-1.5", i),
|
|
1038
|
-
children: [/* @__PURE__ */ z(
|
|
1555
|
+
children: [/* @__PURE__ */ z(Ai, {
|
|
1039
1556
|
required: s.required,
|
|
1040
1557
|
htmlFor: s.id ?? l,
|
|
1041
1558
|
action: r,
|
|
1042
1559
|
children: n
|
|
1043
1560
|
}), /* @__PURE__ */ B("div", {
|
|
1044
1561
|
className: "flex flex-col gap-0.5",
|
|
1045
|
-
children: [h, t ? /* @__PURE__ */ z(
|
|
1562
|
+
children: [h, t ? /* @__PURE__ */ z(v, {
|
|
1046
1563
|
id: u,
|
|
1047
1564
|
error: e,
|
|
1048
1565
|
children: t
|
|
@@ -1052,20 +1569,20 @@ function yr({ error: e, helperText: t, label: n, labelAction: r, className: i, l
|
|
|
1052
1569
|
}
|
|
1053
1570
|
//#endregion
|
|
1054
1571
|
//#region lib/components/ui/fields/email-field/is-email.ts
|
|
1055
|
-
var
|
|
1056
|
-
function
|
|
1572
|
+
var Ri = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1573
|
+
function zi(e) {
|
|
1057
1574
|
let t = e.trim();
|
|
1058
|
-
return !t || t.length > 254 ? !1 :
|
|
1575
|
+
return !t || t.length > 254 ? !1 : Ri.test(t);
|
|
1059
1576
|
}
|
|
1060
1577
|
//#endregion
|
|
1061
1578
|
//#region lib/components/ui/fields/email-field/email-field.tsx
|
|
1062
|
-
function
|
|
1063
|
-
let { t: u } = a(), d = e !== void 0, [f, p] = L(t == null ? "" : String(t)), [m, h] = L(!1), g = String((d ? e : f) ?? ""), _ =
|
|
1579
|
+
function Bi({ value: e, defaultValue: t, onChange: n, onBlur: r, error: i, helperText: o, autoComplete: s = "email", disabled: c, ...l }) {
|
|
1580
|
+
let { t: u } = a(), d = e !== void 0, [f, p] = L(t == null ? "" : String(t)), [m, h] = L(!1), g = String((d ? e : f) ?? ""), _ = zi(g), v = g.trim() !== "" && !_, y = !!i || m && v, b = m && v && !i ? u("material.email-field.invalid", "Enter a valid email") : o, S = u("material.email-field.mailto", "Send email"), C = (e) => {
|
|
1064
1581
|
d || p(e.target.value), n?.(e);
|
|
1065
1582
|
}, w = (e) => {
|
|
1066
1583
|
h(!0), r?.(e);
|
|
1067
1584
|
};
|
|
1068
|
-
return /* @__PURE__ */ z(
|
|
1585
|
+
return /* @__PURE__ */ z(Li, {
|
|
1069
1586
|
...l,
|
|
1070
1587
|
type: "email",
|
|
1071
1588
|
inputMode: "email",
|
|
@@ -1080,7 +1597,7 @@ function Sr({ value: e, defaultValue: t, onChange: n, onBlur: r, error: i, helpe
|
|
|
1080
1597
|
onBlur: w,
|
|
1081
1598
|
leading: /* @__PURE__ */ z("span", {
|
|
1082
1599
|
className: "flex size-8 items-center justify-center",
|
|
1083
|
-
children: /* @__PURE__ */ z(
|
|
1600
|
+
children: /* @__PURE__ */ z(Rt, {
|
|
1084
1601
|
className: "size-4",
|
|
1085
1602
|
"aria-hidden": !0
|
|
1086
1603
|
})
|
|
@@ -1094,77 +1611,77 @@ function Sr({ value: e, defaultValue: t, onChange: n, onBlur: r, error: i, helpe
|
|
|
1094
1611
|
onClick: () => {
|
|
1095
1612
|
window.location.assign(`mailto:${g.trim()}`);
|
|
1096
1613
|
},
|
|
1097
|
-
children: /* @__PURE__ */ z(
|
|
1614
|
+
children: /* @__PURE__ */ z(Wt, {})
|
|
1098
1615
|
}) : void 0
|
|
1099
1616
|
});
|
|
1100
1617
|
}
|
|
1101
1618
|
//#endregion
|
|
1102
1619
|
//#region ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
1103
|
-
var
|
|
1620
|
+
var Vi = (e) => e.type === "checkbox", Hi = (e) => e.type === "file", Ui = (e) => e instanceof Date, Wi = (e) => e == null, Gi = (e) => typeof e == "object", Q = (e) => !Wi(e) && !Array.isArray(e) && Gi(e) && !Ui(e), Ki = (e) => Q(e) && e.target ? Vi(e.target) ? e.target.checked : Hi(e.target) ? e.target.files : e.target.value : e, qi = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), Ji = (e) => {
|
|
1104
1621
|
let t = e.constructor && e.constructor.prototype;
|
|
1105
1622
|
return Q(t) && t.hasOwnProperty("isPrototypeOf");
|
|
1106
|
-
},
|
|
1107
|
-
function
|
|
1623
|
+
}, Yi = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
1624
|
+
function Xi(e) {
|
|
1108
1625
|
if (e instanceof Date) return new Date(e);
|
|
1109
1626
|
let t = typeof FileList < "u" && e instanceof FileList;
|
|
1110
|
-
if (
|
|
1627
|
+
if (Yi && (e instanceof Blob || t)) return e;
|
|
1111
1628
|
let n = Array.isArray(e);
|
|
1112
|
-
if (!n && !(Q(e) &&
|
|
1629
|
+
if (!n && !(Q(e) && Ji(e))) return e;
|
|
1113
1630
|
let r = n ? [] : Object.create(Object.getPrototypeOf(e));
|
|
1114
|
-
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] =
|
|
1631
|
+
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = Xi(e[t]));
|
|
1115
1632
|
return r;
|
|
1116
1633
|
}
|
|
1117
|
-
var
|
|
1634
|
+
var Zi = {
|
|
1118
1635
|
BLUR: "blur",
|
|
1119
1636
|
FOCUS_OUT: "focusout",
|
|
1120
1637
|
CHANGE: "change",
|
|
1121
1638
|
SUBMIT: "submit",
|
|
1122
1639
|
TRIGGER: "trigger",
|
|
1123
1640
|
VALID: "valid"
|
|
1124
|
-
},
|
|
1641
|
+
}, Qi = {
|
|
1125
1642
|
onBlur: "onBlur",
|
|
1126
1643
|
onChange: "onChange",
|
|
1127
1644
|
onSubmit: "onSubmit",
|
|
1128
1645
|
onTouched: "onTouched",
|
|
1129
1646
|
all: "all"
|
|
1130
|
-
},
|
|
1647
|
+
}, $i = [
|
|
1131
1648
|
"__proto__",
|
|
1132
1649
|
"constructor",
|
|
1133
1650
|
"prototype"
|
|
1134
|
-
],
|
|
1651
|
+
], ea = /^\w*$/, ta = (e) => ea.test(e), na = (e) => e === void 0, ra = /[.[\]'"]/, ia = (e) => e.split(ra).filter(Boolean), $ = (e, t, n) => {
|
|
1135
1652
|
if (!t || !Q(e)) return n;
|
|
1136
|
-
let r =
|
|
1137
|
-
if (r.some((e) =>
|
|
1138
|
-
let i = r.reduce((e, t) =>
|
|
1139
|
-
return
|
|
1140
|
-
},
|
|
1141
|
-
let r = -1, i =
|
|
1653
|
+
let r = ta(t) ? [t] : ia(t);
|
|
1654
|
+
if (r.some((e) => $i.includes(e))) return n;
|
|
1655
|
+
let i = r.reduce((e, t) => Wi(e) ? void 0 : e[t], e);
|
|
1656
|
+
return na(i) || i === e ? na(e[t]) ? n : e[t] : i;
|
|
1657
|
+
}, aa = (e) => typeof e == "boolean", oa = (e) => typeof e == "function", sa = (e, t, n) => {
|
|
1658
|
+
let r = -1, i = ta(t) ? [t] : ia(t), a = i.length, o = a - 1;
|
|
1142
1659
|
for (; ++r < a;) {
|
|
1143
1660
|
let t = i[r], a = n;
|
|
1144
1661
|
if (r !== o) {
|
|
1145
1662
|
let n = e[t];
|
|
1146
1663
|
a = Q(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
1147
1664
|
}
|
|
1148
|
-
if (
|
|
1665
|
+
if ($i.includes(t)) return;
|
|
1149
1666
|
e[t] = a, e = e[t];
|
|
1150
1667
|
}
|
|
1151
|
-
},
|
|
1152
|
-
|
|
1153
|
-
var
|
|
1668
|
+
}, ca = M.createContext(null);
|
|
1669
|
+
ca.displayName = "HookFormControlContext";
|
|
1670
|
+
var la = () => M.useContext(ca), ua = (e, t, n, r = !0) => {
|
|
1154
1671
|
let i = {};
|
|
1155
1672
|
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
1156
1673
|
let i = a;
|
|
1157
|
-
return t._proxyFormState[i] !==
|
|
1674
|
+
return t._proxyFormState[i] !== Qi.all && (t._proxyFormState[i] = !r || Qi.all), n && (n[i] = !0), e[i];
|
|
1158
1675
|
} });
|
|
1159
1676
|
return i;
|
|
1160
|
-
},
|
|
1161
|
-
function
|
|
1677
|
+
}, da = Yi ? M.useLayoutEffect : M.useEffect, fa = (e) => Wi(e) || !Gi(e), pa = (e, t) => t.length === 0 && !Array.isArray(e) && !Ji(e);
|
|
1678
|
+
function ma(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
1162
1679
|
if (e === t) return !0;
|
|
1163
|
-
if (
|
|
1164
|
-
if (
|
|
1680
|
+
if (fa(e) || fa(t)) return Object.is(e, t);
|
|
1681
|
+
if (Ui(e) && Ui(t)) return Object.is(e.getTime(), t.getTime());
|
|
1165
1682
|
let r = Object.keys(e), i = Object.keys(t);
|
|
1166
1683
|
if (r.length !== i.length) return !1;
|
|
1167
|
-
if (
|
|
1684
|
+
if (pa(e, r) || pa(t, i)) return Object.is(e, t);
|
|
1168
1685
|
if (!r.length && Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1169
1686
|
let a = n.get(e);
|
|
1170
1687
|
if (a && a.has(t)) return !0;
|
|
@@ -1178,28 +1695,28 @@ function Yr(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
|
1178
1695
|
if (!(i in t)) return !1;
|
|
1179
1696
|
if (i !== "ref") {
|
|
1180
1697
|
let e = t[i];
|
|
1181
|
-
if (
|
|
1698
|
+
if (Ui(r) && Ui(e) || (Q(r) || Array.isArray(r)) && (Q(e) || Array.isArray(e)) ? !ma(r, e, n) : !Object.is(r, e)) return !1;
|
|
1182
1699
|
}
|
|
1183
1700
|
}
|
|
1184
1701
|
return !0;
|
|
1185
1702
|
}
|
|
1186
|
-
function
|
|
1703
|
+
function ha() {
|
|
1187
1704
|
let e = M.useRef(!1), t = M.useRef(void 0);
|
|
1188
1705
|
return {
|
|
1189
1706
|
resyncIfNeeded: M.useCallback((n, r, i) => {
|
|
1190
1707
|
if (n && e.current) {
|
|
1191
1708
|
let e = r();
|
|
1192
|
-
|
|
1709
|
+
ma(t.current, e) || i(e);
|
|
1193
1710
|
}
|
|
1194
1711
|
e.current = !0;
|
|
1195
1712
|
}, []),
|
|
1196
1713
|
snapshot: M.useCallback((e, n) => {
|
|
1197
|
-
e && (t.current =
|
|
1714
|
+
e && (t.current = Xi(n()));
|
|
1198
1715
|
}, [])
|
|
1199
1716
|
};
|
|
1200
1717
|
}
|
|
1201
|
-
function
|
|
1202
|
-
let t =
|
|
1718
|
+
function ga(e) {
|
|
1719
|
+
let t = la(), { control: n = t, disabled: r, name: i, exact: a } = e || {}, [o, s] = M.useState(() => ({
|
|
1203
1720
|
...n._formState,
|
|
1204
1721
|
defaultValues: n._defaultValues
|
|
1205
1722
|
})), c = M.useRef({
|
|
@@ -1211,8 +1728,8 @@ function Zr(e) {
|
|
|
1211
1728
|
isValidating: !1,
|
|
1212
1729
|
isValid: !1,
|
|
1213
1730
|
errors: !1
|
|
1214
|
-
}), { resyncIfNeeded: l, snapshot: u } =
|
|
1215
|
-
return
|
|
1731
|
+
}), { resyncIfNeeded: l, snapshot: u } = ha();
|
|
1732
|
+
return da(() => {
|
|
1216
1733
|
let e = () => ({
|
|
1217
1734
|
...n._formState,
|
|
1218
1735
|
defaultValues: n._defaultValues
|
|
@@ -1241,17 +1758,17 @@ function Zr(e) {
|
|
|
1241
1758
|
u
|
|
1242
1759
|
]), M.useEffect(() => {
|
|
1243
1760
|
c.current.isValid && n._setValid(!0);
|
|
1244
|
-
}, [n]), M.useMemo(() =>
|
|
1761
|
+
}, [n]), M.useMemo(() => ua(o, n, c.current, !1), [o, n]);
|
|
1245
1762
|
}
|
|
1246
|
-
var
|
|
1247
|
-
function
|
|
1248
|
-
let t =
|
|
1763
|
+
var _a = (e) => typeof e == "string", va = (e, t, n, r, i) => _a(e) ? (r && t.watch.add(e), $(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), $(n, e))) : (r && (t.watchAll = !0), n);
|
|
1764
|
+
function ya(e) {
|
|
1765
|
+
let t = la(), { control: n = t, name: r, defaultValue: i, disabled: a, exact: o, compute: s } = e || {}, c = M.useRef(i), l = M.useRef(s), u = M.useRef(void 0), d = M.useRef(n), f = M.useRef(r);
|
|
1249
1766
|
l.current = s;
|
|
1250
1767
|
let [p, m] = M.useState(() => {
|
|
1251
1768
|
let e = n._getWatch(r, c.current);
|
|
1252
1769
|
return l.current ? l.current(e) : e;
|
|
1253
1770
|
}), h = M.useCallback((e) => {
|
|
1254
|
-
let t =
|
|
1771
|
+
let t = va(r, n._names, e || n._formValues, !1, c.current);
|
|
1255
1772
|
return l.current ? l.current(t) : t;
|
|
1256
1773
|
}, [
|
|
1257
1774
|
n._formValues,
|
|
@@ -1259,10 +1776,10 @@ function ei(e) {
|
|
|
1259
1776
|
r
|
|
1260
1777
|
]), g = M.useCallback((e) => {
|
|
1261
1778
|
if (!a) {
|
|
1262
|
-
let t =
|
|
1779
|
+
let t = va(r, n._names, e || n._formValues, !1, c.current);
|
|
1263
1780
|
if (l.current) {
|
|
1264
1781
|
let e = l.current(t);
|
|
1265
|
-
|
|
1782
|
+
ma(e, u.current) || (m(e), u.current = e);
|
|
1266
1783
|
} else m(t);
|
|
1267
1784
|
}
|
|
1268
1785
|
}, [
|
|
@@ -1270,11 +1787,11 @@ function ei(e) {
|
|
|
1270
1787
|
n._names,
|
|
1271
1788
|
a,
|
|
1272
1789
|
r
|
|
1273
|
-
]), { resyncIfNeeded: _, snapshot: v } =
|
|
1790
|
+
]), { resyncIfNeeded: _, snapshot: v } = ha(), y = M.useRef(g);
|
|
1274
1791
|
y.current = g;
|
|
1275
1792
|
let b = M.useRef(h);
|
|
1276
|
-
b.current = h,
|
|
1277
|
-
d.current !== n || !
|
|
1793
|
+
b.current = h, da(() => {
|
|
1794
|
+
d.current !== n || !ma(f.current, r) ? (d.current = n, f.current = r, y.current()) : _(!a, () => b.current(), (e) => {
|
|
1278
1795
|
m(e), u.current = e;
|
|
1279
1796
|
});
|
|
1280
1797
|
let e = n._subscribe({
|
|
@@ -1298,7 +1815,7 @@ function ei(e) {
|
|
|
1298
1815
|
]), M.useEffect(() => n._removeUnmounted());
|
|
1299
1816
|
let x = d.current !== n, S = f.current, C = M.useMemo(() => {
|
|
1300
1817
|
if (a) return null;
|
|
1301
|
-
let e = !x && !
|
|
1818
|
+
let e = !x && !ma(S, r);
|
|
1302
1819
|
return x || e ? h() : null;
|
|
1303
1820
|
}, [
|
|
1304
1821
|
a,
|
|
@@ -1309,8 +1826,8 @@ function ei(e) {
|
|
|
1309
1826
|
]);
|
|
1310
1827
|
return C === null ? p : C;
|
|
1311
1828
|
}
|
|
1312
|
-
function
|
|
1313
|
-
let t =
|
|
1829
|
+
function ba(e) {
|
|
1830
|
+
let t = la(), { name: n, disabled: r, control: i = t, shouldUnregister: a, defaultValue: o, exact: s = !0 } = e, c = qi(i._names.array, n), l = ya({
|
|
1314
1831
|
control: i,
|
|
1315
1832
|
name: n,
|
|
1316
1833
|
defaultValue: M.useMemo(() => $(i._formValues, n, $(i._defaultValues, n, o)), [
|
|
@@ -1319,14 +1836,14 @@ function ti(e) {
|
|
|
1319
1836
|
o
|
|
1320
1837
|
]),
|
|
1321
1838
|
exact: s
|
|
1322
|
-
}), u =
|
|
1839
|
+
}), u = ga({
|
|
1323
1840
|
control: i,
|
|
1324
1841
|
name: n,
|
|
1325
1842
|
exact: s
|
|
1326
1843
|
}), d = M.useRef(e), f = M.useRef(null), p = M.useRef(i.register(n, {
|
|
1327
1844
|
...e.rules,
|
|
1328
1845
|
value: l,
|
|
1329
|
-
...
|
|
1846
|
+
...aa(e.disabled) ? { disabled: e.disabled } : {}
|
|
1330
1847
|
}));
|
|
1331
1848
|
d.current = e;
|
|
1332
1849
|
let m = M.useMemo(() => Object.defineProperties({}, {
|
|
@@ -1351,36 +1868,36 @@ function ti(e) {
|
|
|
1351
1868
|
get: () => $(u.errors, n)
|
|
1352
1869
|
}
|
|
1353
1870
|
}), [u, n]), h = M.useCallback((e) => {
|
|
1354
|
-
let t =
|
|
1871
|
+
let t = Ki(e);
|
|
1355
1872
|
return $(i._fields, n) || (p.current = i.register(n, {
|
|
1356
1873
|
...d.current.rules,
|
|
1357
1874
|
value: t
|
|
1358
1875
|
})), p.current.onChange({
|
|
1359
1876
|
target: {
|
|
1360
|
-
value:
|
|
1877
|
+
value: Ki(e),
|
|
1361
1878
|
name: n
|
|
1362
1879
|
},
|
|
1363
|
-
type:
|
|
1880
|
+
type: Zi.CHANGE
|
|
1364
1881
|
});
|
|
1365
1882
|
}, [n, i]), g = M.useCallback(() => p.current.onBlur({
|
|
1366
1883
|
target: {
|
|
1367
1884
|
value: $(i._formValues, n),
|
|
1368
1885
|
name: n
|
|
1369
1886
|
},
|
|
1370
|
-
type:
|
|
1887
|
+
type: Zi.BLUR
|
|
1371
1888
|
}), [n, i._formValues]), _ = M.useCallback((e) => {
|
|
1372
1889
|
e && (f.current = {
|
|
1373
|
-
focus: () =>
|
|
1374
|
-
select: () =>
|
|
1375
|
-
setCustomValidity: (t) =>
|
|
1376
|
-
reportValidity: () =>
|
|
1890
|
+
focus: () => oa(e.focus) && e.focus(),
|
|
1891
|
+
select: () => oa(e.select) && e.select(),
|
|
1892
|
+
setCustomValidity: (t) => oa(e.setCustomValidity) && e.setCustomValidity(t),
|
|
1893
|
+
reportValidity: () => oa(e.reportValidity) && e.reportValidity()
|
|
1377
1894
|
});
|
|
1378
1895
|
let t = $(i._fields, n);
|
|
1379
1896
|
t && t._f && e && (t._f.ref = f.current);
|
|
1380
1897
|
}, [i._fields, n]), v = M.useMemo(() => ({
|
|
1381
1898
|
name: n,
|
|
1382
1899
|
value: l,
|
|
1383
|
-
...
|
|
1900
|
+
...aa(r) || u.disabled ? { disabled: u.disabled || r } : {},
|
|
1384
1901
|
onChange: h,
|
|
1385
1902
|
onBlur: g,
|
|
1386
1903
|
ref: _
|
|
@@ -1397,15 +1914,15 @@ function ti(e) {
|
|
|
1397
1914
|
let e = i._options.shouldUnregister || a;
|
|
1398
1915
|
p.current = i.register(n, {
|
|
1399
1916
|
...d.current.rules,
|
|
1400
|
-
...
|
|
1917
|
+
...aa(d.current.disabled) ? { disabled: d.current.disabled } : {}
|
|
1401
1918
|
});
|
|
1402
1919
|
let t = (e, t) => {
|
|
1403
1920
|
let n = $(i._fields, e);
|
|
1404
1921
|
n && n._f && (n._f.mount = t);
|
|
1405
1922
|
};
|
|
1406
1923
|
if (t(n, !0), e) {
|
|
1407
|
-
let e =
|
|
1408
|
-
|
|
1924
|
+
let e = Xi($(a ? i._defaultValues : i._options.values || i._defaultValues, n, $(i._options.defaultValues, n, d.current.defaultValue)));
|
|
1925
|
+
sa(i._defaultValues, n, e), na($(i._formValues, n)) && sa(i._formValues, n, e);
|
|
1409
1926
|
}
|
|
1410
1927
|
if (!c && i.register(n), f.current) {
|
|
1411
1928
|
let e = $(i._fields, n);
|
|
@@ -1438,15 +1955,15 @@ function ti(e) {
|
|
|
1438
1955
|
m
|
|
1439
1956
|
]);
|
|
1440
1957
|
}
|
|
1441
|
-
var
|
|
1442
|
-
|
|
1958
|
+
var xa = (e) => e.render(ba(e)), Sa = M.createContext(null);
|
|
1959
|
+
Sa.displayName = "HookFormContext", Qi.onSubmit, Qi.onChange;
|
|
1443
1960
|
//#endregion
|
|
1444
1961
|
//#region lib/components/ui/fields/email-field/email-form-field.tsx
|
|
1445
|
-
function
|
|
1446
|
-
return /* @__PURE__ */ z(
|
|
1962
|
+
function Ca({ control: e, name: t, ...n }) {
|
|
1963
|
+
return /* @__PURE__ */ z(xa, {
|
|
1447
1964
|
control: e,
|
|
1448
1965
|
name: t,
|
|
1449
|
-
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ z(
|
|
1966
|
+
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ z(Bi, {
|
|
1450
1967
|
...n,
|
|
1451
1968
|
ref: e.ref,
|
|
1452
1969
|
name: e.name,
|
|
@@ -1460,18 +1977,38 @@ function ii({ control: e, name: t, ...n }) {
|
|
|
1460
1977
|
});
|
|
1461
1978
|
}
|
|
1462
1979
|
//#endregion
|
|
1980
|
+
//#region lib/components/ui/fields/switch/switch-form-field.tsx
|
|
1981
|
+
function wa({ control: e, name: t, ...n }) {
|
|
1982
|
+
return /* @__PURE__ */ z(xa, {
|
|
1983
|
+
control: e,
|
|
1984
|
+
name: t,
|
|
1985
|
+
render: ({ field: e, fieldState: r }) => /* @__PURE__ */ z(de, {
|
|
1986
|
+
...n,
|
|
1987
|
+
ref: e.ref,
|
|
1988
|
+
name: t,
|
|
1989
|
+
"aria-invalid": r.invalid,
|
|
1990
|
+
checked: !!e.value,
|
|
1991
|
+
disabled: n.disabled || e.disabled,
|
|
1992
|
+
onBlur: e.onBlur,
|
|
1993
|
+
onCheckedChange: e.onChange,
|
|
1994
|
+
error: r.invalid,
|
|
1995
|
+
helperText: r.error?.message ?? n.helperText
|
|
1996
|
+
})
|
|
1997
|
+
});
|
|
1998
|
+
}
|
|
1999
|
+
//#endregion
|
|
1463
2000
|
//#region lib/components/ui/fields/text-field/text-form-field.tsx
|
|
1464
|
-
function
|
|
2001
|
+
function Ta({ control: e, name: t, ...n }) {
|
|
1465
2002
|
let r = (e) => (t) => {
|
|
1466
2003
|
if (n.type === "number") {
|
|
1467
2004
|
let n = parseFloat(t.target.value ?? "");
|
|
1468
2005
|
e.onChange(Number.isNaN(n) ? null : n);
|
|
1469
2006
|
} else e.onChange(t);
|
|
1470
2007
|
};
|
|
1471
|
-
return /* @__PURE__ */ z(
|
|
2008
|
+
return /* @__PURE__ */ z(xa, {
|
|
1472
2009
|
control: e,
|
|
1473
2010
|
name: t,
|
|
1474
|
-
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ z(
|
|
2011
|
+
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ z(Li, {
|
|
1475
2012
|
...n,
|
|
1476
2013
|
ref: e.ref,
|
|
1477
2014
|
"aria-invalid": t.invalid,
|
|
@@ -1486,25 +2023,14 @@ function ai({ control: e, name: t, ...n }) {
|
|
|
1486
2023
|
});
|
|
1487
2024
|
}
|
|
1488
2025
|
//#endregion
|
|
1489
|
-
//#region lib/components/ui/primitives/textarea/textarea.tsx
|
|
1490
|
-
function oi({ className: e, ...t }) {
|
|
1491
|
-
return /* @__PURE__ */ z("textarea", {
|
|
1492
|
-
"data-slot": "textarea",
|
|
1493
|
-
"data-pw": t.name ?? "textarea",
|
|
1494
|
-
className: A(g, "placeholder:text-muted-foreground flex resize-none outline-none", "field-sizing-content min-h-16 w-full min-w-[min(280px,100%)] px-3 py-2 text-base md:text-sm", e),
|
|
1495
|
-
...t,
|
|
1496
|
-
placeholder: t.placeholder || " "
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
//#endregion
|
|
1500
2026
|
//#region lib/components/ui/fields/textarea-field/textarea-footer.tsx
|
|
1501
|
-
function
|
|
2027
|
+
function Ea({ helperText: e, helperId: t, countId: n, error: r, countVisible: i, length: o, maxLength: s, overLimit: c }) {
|
|
1502
2028
|
let { t: l } = a();
|
|
1503
2029
|
if (!e && !i) return null;
|
|
1504
2030
|
let u = s != null && o >= s * .9;
|
|
1505
2031
|
return /* @__PURE__ */ B("div", {
|
|
1506
2032
|
className: A("flex items-start gap-2", e ? "justify-between" : "justify-end"),
|
|
1507
|
-
children: [e && /* @__PURE__ */ z(
|
|
2033
|
+
children: [e && /* @__PURE__ */ z(v, {
|
|
1508
2034
|
id: t,
|
|
1509
2035
|
error: r,
|
|
1510
2036
|
className: "min-w-0 flex-1 basis-0",
|
|
@@ -1518,16 +2044,16 @@ function si({ helperText: e, helperId: t, countId: n, error: r, countVisible: i,
|
|
|
1518
2044
|
children: [s == null ? String(o) : l("material.textarea-field.count", `${o}/${s}`, {
|
|
1519
2045
|
count: o,
|
|
1520
2046
|
max: s
|
|
1521
|
-
}), c && s != null && /* @__PURE__ */ z(
|
|
2047
|
+
}), c && s != null && /* @__PURE__ */ z(Da, { excess: o - s })]
|
|
1522
2048
|
})]
|
|
1523
2049
|
});
|
|
1524
2050
|
}
|
|
1525
|
-
function
|
|
2051
|
+
function Da({ excess: e }) {
|
|
1526
2052
|
let { t } = a();
|
|
1527
2053
|
return /* @__PURE__ */ B("span", {
|
|
1528
2054
|
"data-slot": "textarea-excess",
|
|
1529
2055
|
className: "inline-flex items-center gap-1",
|
|
1530
|
-
children: [/* @__PURE__ */ z(
|
|
2056
|
+
children: [/* @__PURE__ */ z(Ct, {
|
|
1531
2057
|
"aria-hidden": "true",
|
|
1532
2058
|
className: "size-3.5"
|
|
1533
2059
|
}), t("material.textarea-field.excess", `${e} over`, { count: e })]
|
|
@@ -1535,7 +2061,7 @@ function ci({ excess: e }) {
|
|
|
1535
2061
|
}
|
|
1536
2062
|
//#endregion
|
|
1537
2063
|
//#region lib/components/ui/fields/textarea-field/textarea-rows.ts
|
|
1538
|
-
var
|
|
2064
|
+
var Oa = {
|
|
1539
2065
|
1: "min-h-[calc(1lh+1rem)]",
|
|
1540
2066
|
2: "min-h-[calc(2lh+1rem)]",
|
|
1541
2067
|
3: "min-h-[calc(3lh+1rem)]",
|
|
@@ -1544,7 +2070,7 @@ var li = {
|
|
|
1544
2070
|
6: "min-h-[calc(6lh+1rem)]",
|
|
1545
2071
|
8: "min-h-[calc(8lh+1rem)]",
|
|
1546
2072
|
10: "min-h-[calc(10lh+1rem)]"
|
|
1547
|
-
},
|
|
2073
|
+
}, ka = {
|
|
1548
2074
|
1: "max-h-[calc(1lh+1rem)]",
|
|
1549
2075
|
2: "max-h-[calc(2lh+1rem)]",
|
|
1550
2076
|
3: "max-h-[calc(3lh+1rem)]",
|
|
@@ -1556,16 +2082,16 @@ var li = {
|
|
|
1556
2082
|
12: "max-h-[calc(12lh+1rem)]",
|
|
1557
2083
|
16: "max-h-[calc(16lh+1rem)]"
|
|
1558
2084
|
};
|
|
1559
|
-
function
|
|
2085
|
+
function Aa(e, t) {
|
|
1560
2086
|
let n = Object.keys(e).map(Number);
|
|
1561
2087
|
return e[n.filter((e) => e <= t).pop() ?? n[0] ?? 1];
|
|
1562
2088
|
}
|
|
1563
|
-
function
|
|
1564
|
-
return [e != null &&
|
|
2089
|
+
function ja(e, t) {
|
|
2090
|
+
return [e != null && Aa(Oa, e), t != null && Aa(ka, t)];
|
|
1565
2091
|
}
|
|
1566
|
-
function
|
|
2092
|
+
function Ma(e, t) {
|
|
1567
2093
|
let n = I({});
|
|
1568
|
-
return
|
|
2094
|
+
return ut((r) => {
|
|
1569
2095
|
if (!r) return;
|
|
1570
2096
|
let i = n.current;
|
|
1571
2097
|
e == null ? i.min != null && (r.style.minHeight = "") : r.style.minHeight = `calc(${e}lh + 1rem)`, t == null ? i.max != null && (r.style.maxHeight = "") : r.style.maxHeight = `calc(${t}lh + 1rem)`, n.current = {
|
|
@@ -1574,13 +2100,13 @@ function pi(e, t) {
|
|
|
1574
2100
|
};
|
|
1575
2101
|
}, [e, t]);
|
|
1576
2102
|
}
|
|
1577
|
-
function
|
|
1578
|
-
let r =
|
|
1579
|
-
return
|
|
2103
|
+
function Na(e, t, n) {
|
|
2104
|
+
let r = Ma(t, n);
|
|
2105
|
+
return pt(() => ji(e, r), [e, r]);
|
|
1580
2106
|
}
|
|
1581
2107
|
//#endregion
|
|
1582
2108
|
//#region lib/components/ui/fields/textarea-field/textarea-field.tsx
|
|
1583
|
-
function
|
|
2109
|
+
function Pa(e, t, n) {
|
|
1584
2110
|
let r = e !== void 0, [i, a] = L(t == null ? "" : String(t));
|
|
1585
2111
|
return {
|
|
1586
2112
|
text: String((r ? e : i) ?? ""),
|
|
@@ -1589,34 +2115,34 @@ function hi(e, t, n) {
|
|
|
1589
2115
|
}
|
|
1590
2116
|
};
|
|
1591
2117
|
}
|
|
1592
|
-
function
|
|
1593
|
-
let
|
|
2118
|
+
function Fa({ error: e, helperText: t, label: n, className: r, placeholder: i, minRows: a, maxRows: o, showCount: s, monospace: c, maxLength: l, limit: u, count: d, value: f, defaultValue: p, onChange: m, ...g }) {
|
|
2119
|
+
let _ = ce(), v = F(), y = F(), b = F(), x = tn(g["aria-describedby"], !!t && y), { text: S, handleChange: C } = Pa(f, p, m), w = Na(g.ref, a, o), T = u ?? l, E = d ? d(S) : S.length, D = s ?? T != null, O = T != null && E > T;
|
|
1594
2120
|
return /* @__PURE__ */ B("div", {
|
|
1595
|
-
ref:
|
|
2121
|
+
ref: _,
|
|
1596
2122
|
"data-slot": "textarea-field",
|
|
1597
2123
|
className: A("grid w-full content-start gap-1.5", r),
|
|
1598
2124
|
children: [
|
|
1599
|
-
n && /* @__PURE__ */ z(
|
|
1600
|
-
withAsterisk:
|
|
1601
|
-
htmlFor:
|
|
2125
|
+
n && /* @__PURE__ */ z(h, {
|
|
2126
|
+
withAsterisk: g.required,
|
|
2127
|
+
htmlFor: g.id ?? v,
|
|
1602
2128
|
children: n
|
|
1603
2129
|
}),
|
|
1604
|
-
/* @__PURE__ */ z(
|
|
1605
|
-
...
|
|
2130
|
+
/* @__PURE__ */ z(ui, {
|
|
2131
|
+
...g,
|
|
1606
2132
|
ref: w,
|
|
1607
2133
|
placeholder: i,
|
|
1608
|
-
id:
|
|
2134
|
+
id: g.id ?? v,
|
|
1609
2135
|
maxLength: l,
|
|
1610
2136
|
value: f,
|
|
1611
2137
|
defaultValue: p,
|
|
1612
2138
|
onChange: C,
|
|
1613
2139
|
"aria-invalid": e || O || void 0,
|
|
1614
|
-
"aria-describedby":
|
|
1615
|
-
className: A(a != null && "min-h-0", o != null && "overflow-y-auto",
|
|
2140
|
+
"aria-describedby": tn(x, D && b),
|
|
2141
|
+
className: A(a != null && "min-h-0", o != null && "overflow-y-auto", ja(a, o), c && "font-mono")
|
|
1616
2142
|
}),
|
|
1617
|
-
/* @__PURE__ */ z(
|
|
2143
|
+
/* @__PURE__ */ z(Ea, {
|
|
1618
2144
|
helperText: t,
|
|
1619
|
-
helperId:
|
|
2145
|
+
helperId: y,
|
|
1620
2146
|
countId: b,
|
|
1621
2147
|
error: e,
|
|
1622
2148
|
countVisible: D,
|
|
@@ -1629,11 +2155,11 @@ function gi({ error: e, helperText: t, label: n, className: r, placeholder: i, m
|
|
|
1629
2155
|
}
|
|
1630
2156
|
//#endregion
|
|
1631
2157
|
//#region lib/components/ui/fields/textarea-field/textarea-form-field.tsx
|
|
1632
|
-
function
|
|
1633
|
-
return /* @__PURE__ */ z(
|
|
2158
|
+
function Ia({ control: e, name: t, ...n }) {
|
|
2159
|
+
return /* @__PURE__ */ z(xa, {
|
|
1634
2160
|
control: e,
|
|
1635
2161
|
name: t,
|
|
1636
|
-
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ z(
|
|
2162
|
+
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ z(Fa, {
|
|
1637
2163
|
...n,
|
|
1638
2164
|
ref: e.ref,
|
|
1639
2165
|
"aria-invalid": t.invalid,
|
|
@@ -1649,12 +2175,12 @@ function _i({ control: e, name: t, ...n }) {
|
|
|
1649
2175
|
}
|
|
1650
2176
|
//#endregion
|
|
1651
2177
|
//#region lib/files-drop/drop-messages.ts
|
|
1652
|
-
function
|
|
2178
|
+
function La() {
|
|
1653
2179
|
let { t: e } = a();
|
|
1654
|
-
return
|
|
2180
|
+
return ut((t) => {
|
|
1655
2181
|
switch (t.code) {
|
|
1656
2182
|
case "type": return e("material.upload.invalid-type", "File type not accepted");
|
|
1657
|
-
case "size": return e("material.upload.too-large", "File exceeds maximum size of {size}", { size:
|
|
2183
|
+
case "size": return e("material.upload.too-large", "File exceeds maximum size of {size}", { size: rn(t.maxSize) });
|
|
1658
2184
|
case "count": return e("material.upload.max-files", "{count, plural, one {Maximum of # file reached} other {Maximum of # files reached}}", { count: t.maxFiles });
|
|
1659
2185
|
default: return e("material.drop-overlay.empty", "File is empty");
|
|
1660
2186
|
}
|
|
@@ -1662,7 +2188,7 @@ function vi() {
|
|
|
1662
2188
|
}
|
|
1663
2189
|
//#endregion
|
|
1664
2190
|
//#region lib/components/ui/media/attachment-list/use-canvas-thumbnail.ts
|
|
1665
|
-
function
|
|
2191
|
+
function Ra(e, t, n) {
|
|
1666
2192
|
let [r, i] = L(!1);
|
|
1667
2193
|
return P(() => {
|
|
1668
2194
|
if (i(!1), !t?.type.startsWith("image/") || typeof createImageBitmap != "function") return;
|
|
@@ -1683,19 +2209,19 @@ function yi(e, t, n) {
|
|
|
1683
2209
|
}
|
|
1684
2210
|
//#endregion
|
|
1685
2211
|
//#region lib/components/ui/media/attachment-list/attachment-list.tsx
|
|
1686
|
-
var
|
|
1687
|
-
image:
|
|
1688
|
-
pdf:
|
|
1689
|
-
video:
|
|
1690
|
-
audio:
|
|
1691
|
-
text:
|
|
1692
|
-
json:
|
|
1693
|
-
csv:
|
|
1694
|
-
markdown:
|
|
1695
|
-
other:
|
|
2212
|
+
var za = {
|
|
2213
|
+
image: jt,
|
|
2214
|
+
pdf: Ft,
|
|
2215
|
+
video: It,
|
|
2216
|
+
audio: Mt,
|
|
2217
|
+
text: Ft,
|
|
2218
|
+
json: At,
|
|
2219
|
+
csv: Pt,
|
|
2220
|
+
markdown: Ft,
|
|
2221
|
+
other: kt
|
|
1696
2222
|
};
|
|
1697
|
-
function
|
|
1698
|
-
let n = I(null), r =
|
|
2223
|
+
function Ba({ item: e, size: t }) {
|
|
2224
|
+
let n = I(null), r = Ra(n, e.file instanceof Blob ? e.file : void 0, t * 2), i = za[nn({
|
|
1699
2225
|
type: e.file.type,
|
|
1700
2226
|
name: e.file.name
|
|
1701
2227
|
})];
|
|
@@ -1716,14 +2242,14 @@ function xi({ item: e, size: t }) {
|
|
|
1716
2242
|
})]
|
|
1717
2243
|
});
|
|
1718
2244
|
}
|
|
1719
|
-
function
|
|
1720
|
-
let { t: r } = a(), i =
|
|
2245
|
+
function Va({ item: e, size: t, onRemove: n }) {
|
|
2246
|
+
let { t: r } = a(), i = La(), o = e.refusal !== void 0, s = typeof e.refusal == "string" ? e.refusal : e.refusal && i(e.refusal), c = e.progress !== void 0 && !o;
|
|
1721
2247
|
return /* @__PURE__ */ B("li", {
|
|
1722
2248
|
"data-slot": "attachment",
|
|
1723
2249
|
"data-refused": o ? "" : void 0,
|
|
1724
2250
|
className: A("flex min-w-0 items-center gap-3 rounded-lg border bg-card p-2 text-card-foreground", o ? "border-error" : "border-border"),
|
|
1725
2251
|
children: [
|
|
1726
|
-
/* @__PURE__ */ z(
|
|
2252
|
+
/* @__PURE__ */ z(Ba, {
|
|
1727
2253
|
item: e,
|
|
1728
2254
|
size: t
|
|
1729
2255
|
}),
|
|
@@ -1736,7 +2262,7 @@ function Si({ item: e, size: t, onRemove: n }) {
|
|
|
1736
2262
|
}),
|
|
1737
2263
|
typeof e.file.size == "number" && Number.isFinite(e.file.size) ? /* @__PURE__ */ z("span", {
|
|
1738
2264
|
className: "text-body-sm text-muted-foreground",
|
|
1739
|
-
children:
|
|
2265
|
+
children: rn(e.file.size)
|
|
1740
2266
|
}) : null,
|
|
1741
2267
|
c ? /* @__PURE__ */ z("progress", {
|
|
1742
2268
|
max: 100,
|
|
@@ -1747,7 +2273,7 @@ function Si({ item: e, size: t, onRemove: n }) {
|
|
|
1747
2273
|
s ? /* @__PURE__ */ B("span", {
|
|
1748
2274
|
role: "alert",
|
|
1749
2275
|
className: "flex items-center gap-1 text-body-sm text-error-text",
|
|
1750
|
-
children: [/* @__PURE__ */ z(
|
|
2276
|
+
children: [/* @__PURE__ */ z(Ct, {
|
|
1751
2277
|
"aria-hidden": !0,
|
|
1752
2278
|
className: "size-3.5 shrink-0"
|
|
1753
2279
|
}), s]
|
|
@@ -1765,24 +2291,24 @@ function Si({ item: e, size: t, onRemove: n }) {
|
|
|
1765
2291
|
]
|
|
1766
2292
|
}, e.id);
|
|
1767
2293
|
}
|
|
1768
|
-
function
|
|
2294
|
+
function Ha({ items: e, onRemove: t, thumbnailSize: n = 40, className: r, ...i }) {
|
|
1769
2295
|
let { t: o } = a();
|
|
1770
2296
|
return /* @__PURE__ */ z("ul", {
|
|
1771
2297
|
"data-slot": "attachment-list",
|
|
1772
2298
|
"aria-label": o("material.attachments.label", "Attachments"),
|
|
1773
2299
|
className: A("m-0 flex list-none flex-col gap-2 p-0", r),
|
|
1774
2300
|
...i,
|
|
1775
|
-
children: e.map((e) => /* @__PURE__ */ z(
|
|
2301
|
+
children: e.map((e) => /* @__PURE__ */ z(Va, {
|
|
1776
2302
|
item: e,
|
|
1777
2303
|
size: n,
|
|
1778
2304
|
onRemove: t
|
|
1779
2305
|
}, e.id))
|
|
1780
2306
|
});
|
|
1781
2307
|
}
|
|
1782
|
-
|
|
2308
|
+
Ha.displayName = "AttachmentList";
|
|
1783
2309
|
//#endregion
|
|
1784
2310
|
//#region lib/components/ui/overlays/dialog/dialog-aside.tsx
|
|
1785
|
-
function
|
|
2311
|
+
function Ua({ className: e, ...t }) {
|
|
1786
2312
|
return /* @__PURE__ */ z("aside", {
|
|
1787
2313
|
"data-slot": "dialog-aside",
|
|
1788
2314
|
className: A("min-h-0 overflow-y-auto overscroll-contain rounded-2xl bg-muted p-4", e),
|
|
@@ -1791,13 +2317,13 @@ function wi({ className: e, ...t }) {
|
|
|
1791
2317
|
}
|
|
1792
2318
|
//#endregion
|
|
1793
2319
|
//#region lib/components/ui/overlays/dialog/dialog-body-overflow.ts
|
|
1794
|
-
function
|
|
2320
|
+
function Wa(e) {
|
|
1795
2321
|
let t = e.scrollHeight > e.clientHeight + 1;
|
|
1796
2322
|
e.toggleAttribute("data-overflow-start", t && e.scrollTop > 0), e.toggleAttribute("data-overflow-end", t && e.scrollTop + e.clientHeight < e.scrollHeight - 1);
|
|
1797
2323
|
}
|
|
1798
|
-
function
|
|
1799
|
-
if (
|
|
1800
|
-
let t = () =>
|
|
2324
|
+
function Ga(e) {
|
|
2325
|
+
if (Wa(e), typeof ResizeObserver > "u") return () => void 0;
|
|
2326
|
+
let t = () => Wa(e), n = new ResizeObserver(t), r = () => {
|
|
1801
2327
|
n.disconnect(), n.observe(e);
|
|
1802
2328
|
for (let t of Array.from(e.children)) n.observe(t);
|
|
1803
2329
|
t();
|
|
@@ -1810,13 +2336,13 @@ function Ei(e) {
|
|
|
1810
2336
|
}
|
|
1811
2337
|
//#endregion
|
|
1812
2338
|
//#region lib/components/ui/overlays/dialog/dialog-body.tsx
|
|
1813
|
-
function
|
|
1814
|
-
let a = I(null), o =
|
|
1815
|
-
a.current &&
|
|
2339
|
+
function Ka({ className: e, children: t, onScroll: n, ref: r, ...i }) {
|
|
2340
|
+
let a = I(null), o = ut(() => {
|
|
2341
|
+
a.current && Wa(a.current);
|
|
1816
2342
|
}, []);
|
|
1817
2343
|
return P(() => {
|
|
1818
2344
|
let e = a.current;
|
|
1819
|
-
return e ?
|
|
2345
|
+
return e ? Ga(e) : void 0;
|
|
1820
2346
|
}, []), /* @__PURE__ */ z("div", {
|
|
1821
2347
|
ref: (e) => {
|
|
1822
2348
|
a.current = e, typeof r == "function" ? r(e) : r && (r.current = e);
|
|
@@ -1833,18 +2359,18 @@ function Di({ className: e, children: t, onScroll: n, ref: r, ...i }) {
|
|
|
1833
2359
|
}
|
|
1834
2360
|
//#endregion
|
|
1835
2361
|
//#region lib/hooks/use-csp-nonce.ts
|
|
1836
|
-
var
|
|
1837
|
-
function
|
|
1838
|
-
return
|
|
2362
|
+
var qa = ct(void 0), Ja = ct(0);
|
|
2363
|
+
function Ya() {
|
|
2364
|
+
return dt(qa);
|
|
1839
2365
|
}
|
|
1840
2366
|
//#endregion
|
|
1841
2367
|
//#region lib/components/ui/primitives/nonce-provider/nonce-provider.tsx
|
|
1842
|
-
var
|
|
1843
|
-
function
|
|
1844
|
-
let n =
|
|
1845
|
-
return
|
|
2368
|
+
var Xa = () => () => {}, Za = () => void 0;
|
|
2369
|
+
function Qa({ nonce: e, children: t }) {
|
|
2370
|
+
let n = dt(qa), r = ht(Xa, _t, Za), i = e || n || r || void 0, a = dt(Ja);
|
|
2371
|
+
return ft(() => gt(i, a), [i, a]), /* @__PURE__ */ z(qa.Provider, {
|
|
1846
2372
|
value: i,
|
|
1847
|
-
children: /* @__PURE__ */ z(
|
|
2373
|
+
children: /* @__PURE__ */ z(Ja.Provider, {
|
|
1848
2374
|
value: a + 1,
|
|
1849
2375
|
children: t
|
|
1850
2376
|
})
|
|
@@ -1852,12 +2378,12 @@ function Ni({ nonce: e, children: t }) {
|
|
|
1852
2378
|
}
|
|
1853
2379
|
//#endregion
|
|
1854
2380
|
//#region lib/components/ui/primitives/tabs/partials/tabs-trigger-icon-node.tsx
|
|
1855
|
-
function
|
|
2381
|
+
function $a({ icon: e }) {
|
|
1856
2382
|
return /* @__PURE__ */ z("span", {
|
|
1857
2383
|
"data-slot": "tabs-trigger-icon",
|
|
1858
2384
|
"aria-hidden": "true",
|
|
1859
|
-
className:
|
|
1860
|
-
children: /* @__PURE__ */ z(
|
|
2385
|
+
className: Ge,
|
|
2386
|
+
children: /* @__PURE__ */ z(g.Provider, {
|
|
1861
2387
|
value: !0,
|
|
1862
2388
|
children: e
|
|
1863
2389
|
})
|
|
@@ -1865,44 +2391,44 @@ function Pi({ icon: e }) {
|
|
|
1865
2391
|
}
|
|
1866
2392
|
//#endregion
|
|
1867
2393
|
//#region lib/components/ui/primitives/tabs/tabs-embed.tsx
|
|
1868
|
-
function
|
|
1869
|
-
return /* @__PURE__ */ z(
|
|
1870
|
-
IconPart:
|
|
2394
|
+
function eo(e) {
|
|
2395
|
+
return /* @__PURE__ */ z(Ve, {
|
|
2396
|
+
IconPart: $a,
|
|
1871
2397
|
...e
|
|
1872
2398
|
});
|
|
1873
2399
|
}
|
|
1874
2400
|
//#endregion
|
|
1875
2401
|
//#region lib/components/ui/selection/checkbox/checkbox.tsx
|
|
1876
|
-
function
|
|
2402
|
+
function to({ label: e, helperText: t, className: n, ...r }) {
|
|
1877
2403
|
let i = F(), a = F(), o = r["aria-invalid"] === !0 || r["aria-invalid"] === "true", s = [r["aria-describedby"], t ? a : void 0].filter(Boolean).join(" ") || void 0;
|
|
1878
2404
|
return e || t ? /* @__PURE__ */ B("div", {
|
|
1879
2405
|
"data-slot": "checkbox-field",
|
|
1880
2406
|
className: A("flex gap-1.5 w-full min-w-[min(280px,100%)] pointer-coarse:py-3", n),
|
|
1881
|
-
children: [/* @__PURE__ */ z(
|
|
2407
|
+
children: [/* @__PURE__ */ z(no, {
|
|
1882
2408
|
...r,
|
|
1883
2409
|
"aria-describedby": s,
|
|
1884
2410
|
id: r.id ?? i
|
|
1885
2411
|
}), /* @__PURE__ */ B("div", {
|
|
1886
2412
|
className: "flex flex-col gap-0.5",
|
|
1887
|
-
children: [/* @__PURE__ */ z(
|
|
2413
|
+
children: [/* @__PURE__ */ z(h, {
|
|
1888
2414
|
htmlFor: r.id ?? i,
|
|
1889
2415
|
className: "mt-0 ps-0.5 pointer-coarse:min-w-11 pointer-coarse:py-3 pointer-coarse:-my-[15px] peer-data-readonly:cursor-default",
|
|
1890
2416
|
children: e
|
|
1891
|
-
}), t && /* @__PURE__ */ z(
|
|
2417
|
+
}), t && /* @__PURE__ */ z(v, {
|
|
1892
2418
|
id: a,
|
|
1893
2419
|
error: o,
|
|
1894
2420
|
children: t
|
|
1895
2421
|
})]
|
|
1896
2422
|
})]
|
|
1897
|
-
}) : /* @__PURE__ */ z(
|
|
2423
|
+
}) : /* @__PURE__ */ z(no, {
|
|
1898
2424
|
"data-slot": "checkbox-field",
|
|
1899
2425
|
className: n,
|
|
1900
2426
|
...r,
|
|
1901
2427
|
id: r.id ?? i
|
|
1902
2428
|
});
|
|
1903
2429
|
}
|
|
1904
|
-
function
|
|
1905
|
-
let d = /* @__PURE__ */ z(
|
|
2430
|
+
function no({ className: e, checked: t, defaultChecked: n, required: r, onCheckedChange: i, name: a, form: o, disabled: s, value: c, readOnly: l, ...u }) {
|
|
2431
|
+
let d = /* @__PURE__ */ z(Gn, {
|
|
1906
2432
|
"data-slot": "checkbox",
|
|
1907
2433
|
...a === void 0 ? {} : { name: a },
|
|
1908
2434
|
"aria-readonly": l || void 0,
|
|
@@ -1929,7 +2455,7 @@ function Li({ className: e, checked: t, defaultChecked: n, required: r, onChecke
|
|
|
1929
2455
|
})
|
|
1930
2456
|
})
|
|
1931
2457
|
});
|
|
1932
|
-
return /* @__PURE__ */ z(
|
|
2458
|
+
return /* @__PURE__ */ z(Un, {
|
|
1933
2459
|
checked: l ? t ?? n ?? !1 : t,
|
|
1934
2460
|
defaultChecked: l ? void 0 : n,
|
|
1935
2461
|
required: r,
|
|
@@ -1938,16 +2464,16 @@ function Li({ className: e, checked: t, defaultChecked: n, required: r, onChecke
|
|
|
1938
2464
|
form: o,
|
|
1939
2465
|
disabled: s,
|
|
1940
2466
|
value: c,
|
|
1941
|
-
...
|
|
2467
|
+
...Xe(d, /* @__PURE__ */ z(qn, {}))
|
|
1942
2468
|
});
|
|
1943
2469
|
}
|
|
1944
2470
|
//#endregion
|
|
1945
2471
|
//#region lib/components/ui/selection/checkbox/checkbox-form-field.tsx
|
|
1946
|
-
function
|
|
1947
|
-
return /* @__PURE__ */ z(
|
|
2472
|
+
function ro({ control: e, name: t, ...n }) {
|
|
2473
|
+
return /* @__PURE__ */ z(xa, {
|
|
1948
2474
|
control: e,
|
|
1949
2475
|
name: t,
|
|
1950
|
-
render: ({ field: e, fieldState: r }) => /* @__PURE__ */ z(
|
|
2476
|
+
render: ({ field: e, fieldState: r }) => /* @__PURE__ */ z(to, {
|
|
1951
2477
|
...n,
|
|
1952
2478
|
ref: e.ref,
|
|
1953
2479
|
name: t,
|
|
@@ -1964,14 +2490,14 @@ function Ri({ control: e, name: t, ...n }) {
|
|
|
1964
2490
|
}
|
|
1965
2491
|
//#endregion
|
|
1966
2492
|
//#region lib/components/ui/display/chip/partials/use-reveal-selected.ts
|
|
1967
|
-
var
|
|
1968
|
-
function
|
|
2493
|
+
var io = "[aria-checked=\"true\"], [aria-pressed=\"true\"], [data-selected]";
|
|
2494
|
+
function ao(e, t, n, r) {
|
|
1969
2495
|
let i = n ? 48 : 2, a = r ? 48 : 2;
|
|
1970
2496
|
return t.left - i < e.left ? t.left - i - e.left : t.right + a > e.right ? t.right + a - e.right : 0;
|
|
1971
2497
|
}
|
|
1972
|
-
function
|
|
2498
|
+
function oo(e, t, n) {
|
|
1973
2499
|
if (e.scrollWidth - e.clientWidth <= 1) return;
|
|
1974
|
-
let r = getComputedStyle(e).direction === "rtl", i = r ? t.nextElementSibling : t.previousElementSibling, a = r ? t.previousElementSibling : t.nextElementSibling, o =
|
|
2500
|
+
let r = getComputedStyle(e).direction === "rtl", i = r ? t.nextElementSibling : t.previousElementSibling, a = r ? t.previousElementSibling : t.nextElementSibling, o = ao(e.getBoundingClientRect(), t.getBoundingClientRect(), i !== null, a !== null);
|
|
1975
2501
|
if (o === 0) return;
|
|
1976
2502
|
let s = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1977
2503
|
e.scrollTo({
|
|
@@ -1979,20 +2505,20 @@ function Vi(e, t, n) {
|
|
|
1979
2505
|
behavior: n && !s ? "smooth" : "auto"
|
|
1980
2506
|
});
|
|
1981
2507
|
}
|
|
1982
|
-
function
|
|
2508
|
+
function so(e, t) {
|
|
1983
2509
|
P(() => {
|
|
1984
2510
|
let n = e.current;
|
|
1985
2511
|
if (!t || !n) return;
|
|
1986
2512
|
let r = () => {
|
|
1987
|
-
let e = n.querySelectorAll(
|
|
1988
|
-
t &&
|
|
2513
|
+
let e = n.querySelectorAll(io), t = e[e.length - 1];
|
|
2514
|
+
t && oo(n, t, !1);
|
|
1989
2515
|
};
|
|
1990
2516
|
r();
|
|
1991
2517
|
let i = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(r);
|
|
1992
2518
|
i?.observe(n);
|
|
1993
2519
|
let a = typeof MutationObserver > "u" ? void 0 : new MutationObserver((e) => {
|
|
1994
2520
|
let t = e.map((e) => e.target).filter((e) => e instanceof HTMLElement && e.matches("[aria-checked=\"true\"], [aria-pressed=\"true\"], [data-selected]")), r = t[t.length - 1];
|
|
1995
|
-
r &&
|
|
2521
|
+
r && oo(n, r, !0);
|
|
1996
2522
|
});
|
|
1997
2523
|
return a?.observe(n, {
|
|
1998
2524
|
subtree: !0,
|
|
@@ -2009,14 +2535,14 @@ function Hi(e, t) {
|
|
|
2009
2535
|
}
|
|
2010
2536
|
//#endregion
|
|
2011
2537
|
//#region lib/components/ui/display/chip/partials/use-chip-rail.ts
|
|
2012
|
-
var
|
|
2538
|
+
var co = [
|
|
2013
2539
|
"-mx-0.5 -my-1 min-w-0 flex-nowrap overflow-x-auto overscroll-x-contain px-0.5 py-1 scroll-px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&>*]:shrink-0",
|
|
2014
2540
|
"ltr:data-[fade=start]:[mask-image:linear-gradient(to_right,transparent,#000_2rem)]",
|
|
2015
2541
|
"ltr:data-[fade=end]:[mask-image:linear-gradient(to_left,transparent,#000_2rem)]",
|
|
2016
2542
|
"rtl:data-[fade=start]:[mask-image:linear-gradient(to_left,transparent,#000_2rem)]",
|
|
2017
2543
|
"rtl:data-[fade=end]:[mask-image:linear-gradient(to_right,transparent,#000_2rem)]",
|
|
2018
2544
|
"data-[fade=both]:[mask-image:linear-gradient(to_right,transparent,#000_2rem,#000_calc(100%-2rem),transparent)]"
|
|
2019
|
-
].join(" "),
|
|
2545
|
+
].join(" "), lo = [
|
|
2020
2546
|
"max-sm:-mx-0.5 max-sm:-my-1 max-sm:min-w-0 max-sm:flex-nowrap max-sm:overflow-x-auto max-sm:overscroll-x-contain max-sm:px-0.5 max-sm:py-1 max-sm:scroll-px-4 max-sm:snap-x max-sm:snap-proximity max-sm:[scrollbar-width:none] max-sm:[&::-webkit-scrollbar]:hidden max-sm:[&>*]:shrink-0 max-sm:[&>*]:snap-start",
|
|
2021
2547
|
"max-sm:ltr:data-[fade=start]:[mask-image:linear-gradient(to_right,transparent,#000_2rem)]",
|
|
2022
2548
|
"max-sm:ltr:data-[fade=end]:[mask-image:linear-gradient(to_left,transparent,#000_2rem)]",
|
|
@@ -2024,7 +2550,7 @@ var Ui = [
|
|
|
2024
2550
|
"max-sm:rtl:data-[fade=end]:[mask-image:linear-gradient(to_right,transparent,#000_2rem)]",
|
|
2025
2551
|
"max-sm:data-[fade=both]:[mask-image:linear-gradient(to_right,transparent,#000_2rem,#000_calc(100%-2rem),transparent)]"
|
|
2026
2552
|
].join(" ");
|
|
2027
|
-
function
|
|
2553
|
+
function uo(e, t = !1) {
|
|
2028
2554
|
let n = I(null), [r, i] = L();
|
|
2029
2555
|
return P(() => {
|
|
2030
2556
|
let t = n.current;
|
|
@@ -2045,13 +2571,13 @@ function Gi(e, t = !1) {
|
|
|
2045
2571
|
return o?.observe(t), () => {
|
|
2046
2572
|
t.removeEventListener("scroll", r), t.removeEventListener("wheel", a), o?.disconnect();
|
|
2047
2573
|
};
|
|
2048
|
-
}, [e]),
|
|
2574
|
+
}, [e]), so(n, e), e ? {
|
|
2049
2575
|
ref: n,
|
|
2050
2576
|
props: {
|
|
2051
2577
|
"data-overflow": t ? "scroll-phone" : "scroll",
|
|
2052
2578
|
"data-fade": r
|
|
2053
2579
|
},
|
|
2054
|
-
className: t ?
|
|
2580
|
+
className: t ? lo : co
|
|
2055
2581
|
} : {
|
|
2056
2582
|
ref: void 0,
|
|
2057
2583
|
props: void 0,
|
|
@@ -2060,7 +2586,7 @@ function Gi(e, t = !1) {
|
|
|
2060
2586
|
}
|
|
2061
2587
|
//#endregion
|
|
2062
2588
|
//#region lib/components/ui/primitives/label/field-group.tsx
|
|
2063
|
-
function
|
|
2589
|
+
function fo({ id: e }) {
|
|
2064
2590
|
let { t } = a();
|
|
2065
2591
|
return /* @__PURE__ */ z("span", {
|
|
2066
2592
|
id: e,
|
|
@@ -2068,7 +2594,7 @@ function Ki({ id: e }) {
|
|
|
2068
2594
|
children: t("material.zod.default", "This value is not valid.")
|
|
2069
2595
|
});
|
|
2070
2596
|
}
|
|
2071
|
-
function
|
|
2597
|
+
function po({ id: e }) {
|
|
2072
2598
|
let { t } = a();
|
|
2073
2599
|
return /* @__PURE__ */ z("span", {
|
|
2074
2600
|
id: e,
|
|
@@ -2076,7 +2602,7 @@ function qi({ id: e }) {
|
|
|
2076
2602
|
children: t("material.zod.required", "This field is required.")
|
|
2077
2603
|
});
|
|
2078
2604
|
}
|
|
2079
|
-
function
|
|
2605
|
+
function mo({ label: e, labelId: t, describedBy: n = [] }, r) {
|
|
2080
2606
|
let i = !!(r["aria-label"] || r["aria-labelledby"]);
|
|
2081
2607
|
return {
|
|
2082
2608
|
"aria-labelledby": r["aria-labelledby"] || (e && !i ? t : void 0),
|
|
@@ -2085,33 +2611,33 @@ function Ji({ label: e, labelId: t, describedBy: n = [] }, r) {
|
|
|
2085
2611
|
}
|
|
2086
2612
|
//#endregion
|
|
2087
2613
|
//#region lib/components/ui/selection/choice-group/choice-group-header.tsx
|
|
2088
|
-
var
|
|
2614
|
+
var ho = (e) => ({
|
|
2089
2615
|
labelId: `${e}-label`,
|
|
2090
2616
|
helperId: `${e}-helper`,
|
|
2091
2617
|
invalidId: `${e}-invalid`,
|
|
2092
2618
|
requiredId: `${e}-required`
|
|
2093
2619
|
});
|
|
2094
|
-
function
|
|
2620
|
+
function go({ ids: e, label: t, helperText: n, error: r, invalid: i, required: a, multiple: o, hideLabel: s }) {
|
|
2095
2621
|
return /* @__PURE__ */ B(R, { children: [
|
|
2096
|
-
t && /* @__PURE__ */ z(
|
|
2622
|
+
t && /* @__PURE__ */ z(h, {
|
|
2097
2623
|
id: e.labelId,
|
|
2098
2624
|
withAsterisk: a,
|
|
2099
2625
|
className: s ? "sr-only" : void 0,
|
|
2100
2626
|
children: t
|
|
2101
2627
|
}),
|
|
2102
|
-
o && a && /* @__PURE__ */ z(
|
|
2103
|
-
n && /* @__PURE__ */ z(
|
|
2628
|
+
o && a && /* @__PURE__ */ z(po, { id: e.requiredId }),
|
|
2629
|
+
n && /* @__PURE__ */ z(v, {
|
|
2104
2630
|
id: e.helperId,
|
|
2105
2631
|
error: r,
|
|
2106
2632
|
children: n
|
|
2107
2633
|
}),
|
|
2108
|
-
i && !n && /* @__PURE__ */ z(
|
|
2634
|
+
i && !n && /* @__PURE__ */ z(fo, { id: e.invalidId })
|
|
2109
2635
|
] });
|
|
2110
2636
|
}
|
|
2111
2637
|
//#endregion
|
|
2112
2638
|
//#region lib/components/ui/selection/choice-group/choice-group-root.tsx
|
|
2113
|
-
function
|
|
2114
|
-
let p =
|
|
2639
|
+
function _o({ group: e, name: t, slot: n, hideLabel: r, className: i, contentClassName: a, inlineReasons: o, reasonsBelow: s, contentRef: c, contentProps: l, children: u, ref: d, ...f }) {
|
|
2640
|
+
let p = ce(), { rootProps: m } = e;
|
|
2115
2641
|
return /* @__PURE__ */ B("div", {
|
|
2116
2642
|
"data-slot": n,
|
|
2117
2643
|
"data-pw": t ?? n,
|
|
@@ -2120,7 +2646,7 @@ function Zi({ group: e, name: t, slot: n, hideLabel: r, className: i, contentCla
|
|
|
2120
2646
|
...m,
|
|
2121
2647
|
ref: p,
|
|
2122
2648
|
children: [
|
|
2123
|
-
/* @__PURE__ */ z(
|
|
2649
|
+
/* @__PURE__ */ z(go, {
|
|
2124
2650
|
ids: e.ids,
|
|
2125
2651
|
label: e.label,
|
|
2126
2652
|
helperText: e.helperText,
|
|
@@ -2155,7 +2681,7 @@ function Zi({ group: e, name: t, slot: n, hideLabel: r, className: i, contentCla
|
|
|
2155
2681
|
}
|
|
2156
2682
|
//#endregion
|
|
2157
2683
|
//#region lib/components/ui/selection/choice-group/choice-selection.ts
|
|
2158
|
-
function
|
|
2684
|
+
function vo(e) {
|
|
2159
2685
|
return e.type === "multiple" ? {
|
|
2160
2686
|
type: "multiple",
|
|
2161
2687
|
value: e.value,
|
|
@@ -2169,12 +2695,12 @@ function Qi(e) {
|
|
|
2169
2695
|
}
|
|
2170
2696
|
//#endregion
|
|
2171
2697
|
//#region lib/components/ui/selection/choice-group/choice-group-props.ts
|
|
2172
|
-
function
|
|
2698
|
+
function yo({ groupId: e, ids: t, multiple: n, orientation: r, label: i, help: a, invalid: o, required: s, aria: c, onKeyDown: l }) {
|
|
2173
2699
|
return {
|
|
2174
2700
|
role: n ? "group" : "radiogroup",
|
|
2175
2701
|
id: e,
|
|
2176
2702
|
"aria-orientation": n ? void 0 : r,
|
|
2177
|
-
...
|
|
2703
|
+
...mo({
|
|
2178
2704
|
label: i,
|
|
2179
2705
|
labelId: t.labelId,
|
|
2180
2706
|
describedBy: [
|
|
@@ -2188,7 +2714,7 @@ function $i({ groupId: e, ids: t, multiple: n, orientation: r, label: i, help: a
|
|
|
2188
2714
|
onKeyDown: l
|
|
2189
2715
|
};
|
|
2190
2716
|
}
|
|
2191
|
-
function
|
|
2717
|
+
function bo({ multiple: e, checked: t, reason: n, isEntry: r, disabled: i, onClick: a, ref: o }) {
|
|
2192
2718
|
return {
|
|
2193
2719
|
role: e ? "checkbox" : "radio",
|
|
2194
2720
|
"aria-checked": t,
|
|
@@ -2203,12 +2729,12 @@ function ea({ multiple: e, checked: t, reason: n, isEntry: r, disabled: i, onCli
|
|
|
2203
2729
|
}
|
|
2204
2730
|
//#endregion
|
|
2205
2731
|
//#region lib/components/ui/primitives/direction/direction-of.ts
|
|
2206
|
-
function
|
|
2732
|
+
function xo(e) {
|
|
2207
2733
|
return e && getComputedStyle(e).direction === "rtl" ? "rtl" : "ltr";
|
|
2208
2734
|
}
|
|
2209
2735
|
//#endregion
|
|
2210
2736
|
//#region lib/components/ui/selection/choice-group/choice-key-target.ts
|
|
2211
|
-
var
|
|
2737
|
+
var So = /* @__PURE__ */ new Set([
|
|
2212
2738
|
"ArrowUp",
|
|
2213
2739
|
"ArrowDown",
|
|
2214
2740
|
"ArrowLeft",
|
|
@@ -2216,7 +2742,7 @@ var na = /* @__PURE__ */ new Set([
|
|
|
2216
2742
|
"Home",
|
|
2217
2743
|
"End"
|
|
2218
2744
|
]);
|
|
2219
|
-
function
|
|
2745
|
+
function Co(e, t, n) {
|
|
2220
2746
|
let r = n[t]?.getBoundingClientRect();
|
|
2221
2747
|
if (!r) return null;
|
|
2222
2748
|
let i = r.left + r.width / 2, a = r.top + r.height / 2, o = e === "ArrowDown", s = n.flatMap((e, n) => {
|
|
@@ -2233,37 +2759,37 @@ function ra(e, t, n) {
|
|
|
2233
2759
|
let c = Math.min(...s.map((e) => e.dy));
|
|
2234
2760
|
return s.filter((e) => e.dy - c < r.height / 2).sort((e, t) => e.dx - t.dx)[0].index;
|
|
2235
2761
|
}
|
|
2236
|
-
function
|
|
2762
|
+
function wo(e, t, n, r, i) {
|
|
2237
2763
|
if (e.altKey || e.ctrlKey || e.metaKey) return null;
|
|
2238
2764
|
if (e.key === "Enter") return e.preventDefault(), null;
|
|
2239
|
-
if (!
|
|
2765
|
+
if (!So.has(e.key) || r) return null;
|
|
2240
2766
|
let a = t.indexOf(e.target);
|
|
2241
2767
|
if (a === -1) return null;
|
|
2242
|
-
let o = e.key === "ArrowUp" || e.key === "ArrowDown", s = (i && o ?
|
|
2768
|
+
let o = e.key === "ArrowUp" || e.key === "ArrowDown", s = (i && o ? Co(e.key, a, t) : null) ?? cn(e.key, a, n.map(() => ({ enabled: !0 })), { rtl: xo(e.currentTarget) === "rtl" });
|
|
2243
2769
|
return e.preventDefault(), s === null ? null : (t[s]?.focus(), s);
|
|
2244
2770
|
}
|
|
2245
2771
|
//#endregion
|
|
2246
2772
|
//#region lib/components/ui/selection/choice-group/choice-press.ts
|
|
2247
|
-
function
|
|
2773
|
+
function To(e, t) {
|
|
2248
2774
|
let { options: n, selection: r, disabled: i, max: a } = e, o = n[t], s = r.type === "multiple" ? a : void 0;
|
|
2249
|
-
if (!o || i ||
|
|
2775
|
+
if (!o || i || an(o, r.value, s)) return;
|
|
2250
2776
|
if (r.type === "multiple") {
|
|
2251
|
-
let e =
|
|
2777
|
+
let e = sn("multiple", r.value, o.value, { max: a });
|
|
2252
2778
|
e !== "blocked" && r.onValueChange?.(e);
|
|
2253
2779
|
return;
|
|
2254
2780
|
}
|
|
2255
|
-
let c =
|
|
2781
|
+
let c = sn("single", r.value, o.value, { deselectable: r.deselectable });
|
|
2256
2782
|
c !== r.value && r.onValueChange?.(c);
|
|
2257
2783
|
}
|
|
2258
|
-
function
|
|
2259
|
-
let r =
|
|
2260
|
-
r !== null && e.selection.type !== "multiple" &&
|
|
2784
|
+
function Eo(e, t, n) {
|
|
2785
|
+
let r = wo(t, n, e.options, e.disabled, e.grid);
|
|
2786
|
+
r !== null && e.selection.type !== "multiple" && To(e, r);
|
|
2261
2787
|
}
|
|
2262
2788
|
//#endregion
|
|
2263
2789
|
//#region lib/components/ui/selection/choice-group/choice-texts.ts
|
|
2264
|
-
function
|
|
2790
|
+
function Do({ t: e, groupId: t, options: n, value: r, multiple: i, max: a, min: o, hasHelper: s }) {
|
|
2265
2791
|
let c = n.map((n, i) => {
|
|
2266
|
-
let o =
|
|
2792
|
+
let o = an(n, r, a), s;
|
|
2267
2793
|
return o === "max" ? s = e("material.choice-group.max-reached", "{max, plural, one {Up to # choice} other {Up to # choices}}", { max: a ?? 0 }) : n.disabled && (s = n.disabledReason), {
|
|
2268
2794
|
id: `${t}-reason-${i}`,
|
|
2269
2795
|
text: s,
|
|
@@ -2281,12 +2807,12 @@ function sa({ t: e, groupId: t, options: n, value: r, multiple: i, max: a, min:
|
|
|
2281
2807
|
}
|
|
2282
2808
|
//#endregion
|
|
2283
2809
|
//#region lib/components/ui/selection/choice-group/use-choice-item-refs.ts
|
|
2284
|
-
function
|
|
2810
|
+
function Oo(e, t) {
|
|
2285
2811
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
2286
2812
|
}
|
|
2287
|
-
function
|
|
2813
|
+
function ko({ ref: e, entry: t, count: n }) {
|
|
2288
2814
|
let r = I([]), i = I([]);
|
|
2289
|
-
return P(() => (r.current.length = n,
|
|
2815
|
+
return P(() => (r.current.length = n, Oo(e, r.current[t] ?? null), () => Oo(e, null)), [
|
|
2290
2816
|
t,
|
|
2291
2817
|
e,
|
|
2292
2818
|
n
|
|
@@ -2299,8 +2825,8 @@ function la({ ref: e, entry: t, count: n }) {
|
|
|
2299
2825
|
}
|
|
2300
2826
|
//#endregion
|
|
2301
2827
|
//#region lib/components/ui/selection/choice-group/use-choice-group.ts
|
|
2302
|
-
function
|
|
2303
|
-
let { options: t, selection: n, label: r, helperText: i, error: o, disabled: s, ref: c } = e, { t: l } = a(), u = F(), d = e.id ?? u, f =
|
|
2828
|
+
function Ao(e) {
|
|
2829
|
+
let { options: t, selection: n, label: r, helperText: i, error: o, disabled: s, ref: c } = e, { t: l } = a(), u = F(), d = e.id ?? u, f = ho(d), p = n.type === "multiple", m = n.value, h = p ? e.max : void 0, g = e.aria ?? {}, _ = Array.isArray(m) ? m : m === null ? [] : [m], v = !!(o || g["aria-invalid"] && g["aria-invalid"] !== "false"), y = Do({
|
|
2304
2830
|
t: l,
|
|
2305
2831
|
groupId: d,
|
|
2306
2832
|
options: t,
|
|
@@ -2309,13 +2835,13 @@ function ua(e) {
|
|
|
2309
2835
|
max: h,
|
|
2310
2836
|
min: e.min,
|
|
2311
2837
|
hasHelper: !!i
|
|
2312
|
-
}), b = i || y.hint, x = s ? -1 :
|
|
2838
|
+
}), b = i || y.hint, x = s ? -1 : on(t, m), S = {
|
|
2313
2839
|
options: t,
|
|
2314
2840
|
selection: n,
|
|
2315
2841
|
disabled: s,
|
|
2316
2842
|
max: e.max,
|
|
2317
2843
|
grid: e.grid
|
|
2318
|
-
}, C = t.length, { items: w, itemRef: T } =
|
|
2844
|
+
}, C = t.length, { items: w, itemRef: T } = ko({
|
|
2319
2845
|
ref: c,
|
|
2320
2846
|
entry: x,
|
|
2321
2847
|
count: C
|
|
@@ -2336,7 +2862,7 @@ function ua(e) {
|
|
|
2336
2862
|
text: e.text,
|
|
2337
2863
|
why: e.why
|
|
2338
2864
|
}] : []),
|
|
2339
|
-
rootProps:
|
|
2865
|
+
rootProps: yo({
|
|
2340
2866
|
groupId: d,
|
|
2341
2867
|
ids: f,
|
|
2342
2868
|
multiple: p,
|
|
@@ -2346,28 +2872,28 @@ function ua(e) {
|
|
|
2346
2872
|
invalid: v,
|
|
2347
2873
|
required: e.required,
|
|
2348
2874
|
aria: g,
|
|
2349
|
-
onKeyDown: (e) =>
|
|
2875
|
+
onKeyDown: (e) => Eo(S, e, w.current)
|
|
2350
2876
|
}),
|
|
2351
|
-
itemProps: (e, t) =>
|
|
2877
|
+
itemProps: (e, t) => bo({
|
|
2352
2878
|
multiple: p,
|
|
2353
2879
|
checked: _.includes(e.value),
|
|
2354
2880
|
reason: y.reasons[t],
|
|
2355
2881
|
isEntry: t === x,
|
|
2356
2882
|
disabled: s,
|
|
2357
|
-
onClick: () =>
|
|
2883
|
+
onClick: () => To(S, t),
|
|
2358
2884
|
ref: T(t)
|
|
2359
2885
|
})
|
|
2360
2886
|
};
|
|
2361
2887
|
}
|
|
2362
2888
|
//#endregion
|
|
2363
2889
|
//#region lib/components/ui/selection/choice-group/use-choice-group-field.ts
|
|
2364
|
-
function
|
|
2365
|
-
let r =
|
|
2890
|
+
function jo(e, t, n = {}) {
|
|
2891
|
+
let r = vo(e), { type: i, value: a, onValueChange: o, label: s, helperText: c, error: l, required: u, disabled: d, name: f, max: p, min: m, orientation: h, ref: g, ..._ } = e, { deselectable: v, ...y } = {
|
|
2366
2892
|
deselectable: void 0,
|
|
2367
2893
|
..._
|
|
2368
2894
|
};
|
|
2369
2895
|
return {
|
|
2370
|
-
group:
|
|
2896
|
+
group: Ao({
|
|
2371
2897
|
options: t,
|
|
2372
2898
|
selection: r,
|
|
2373
2899
|
grid: n.grid,
|
|
@@ -2390,7 +2916,7 @@ function da(e, t, n = {}) {
|
|
|
2390
2916
|
}
|
|
2391
2917
|
//#endregion
|
|
2392
2918
|
//#region lib/components/ui/selection/chip-group-field/chip-group-columns.ts
|
|
2393
|
-
var
|
|
2919
|
+
var Mo = [
|
|
2394
2920
|
"grid-cols-1",
|
|
2395
2921
|
"grid-cols-2",
|
|
2396
2922
|
"grid-cols-3",
|
|
@@ -2403,7 +2929,7 @@ var fa = [
|
|
|
2403
2929
|
"grid-cols-10",
|
|
2404
2930
|
"grid-cols-11",
|
|
2405
2931
|
"grid-cols-12"
|
|
2406
|
-
],
|
|
2932
|
+
], No = [
|
|
2407
2933
|
"sm:grid-cols-1",
|
|
2408
2934
|
"sm:grid-cols-2",
|
|
2409
2935
|
"sm:grid-cols-3",
|
|
@@ -2416,7 +2942,7 @@ var fa = [
|
|
|
2416
2942
|
"sm:grid-cols-10",
|
|
2417
2943
|
"sm:grid-cols-11",
|
|
2418
2944
|
"sm:grid-cols-12"
|
|
2419
|
-
],
|
|
2945
|
+
], Po = [
|
|
2420
2946
|
"md:grid-cols-1",
|
|
2421
2947
|
"md:grid-cols-2",
|
|
2422
2948
|
"md:grid-cols-3",
|
|
@@ -2429,7 +2955,7 @@ var fa = [
|
|
|
2429
2955
|
"md:grid-cols-10",
|
|
2430
2956
|
"md:grid-cols-11",
|
|
2431
2957
|
"md:grid-cols-12"
|
|
2432
|
-
],
|
|
2958
|
+
], Fo = [
|
|
2433
2959
|
"lg:grid-cols-1",
|
|
2434
2960
|
"lg:grid-cols-2",
|
|
2435
2961
|
"lg:grid-cols-3",
|
|
@@ -2442,26 +2968,26 @@ var fa = [
|
|
|
2442
2968
|
"lg:grid-cols-10",
|
|
2443
2969
|
"lg:grid-cols-11",
|
|
2444
2970
|
"lg:grid-cols-12"
|
|
2445
|
-
],
|
|
2446
|
-
function
|
|
2971
|
+
], Io = (e, t) => t === void 0 || !Number.isFinite(t) ? void 0 : e[Math.min(12, Math.max(1, Math.trunc(t))) - 1];
|
|
2972
|
+
function Lo(e) {
|
|
2447
2973
|
let t = typeof e == "number" ? { base: e } : e;
|
|
2448
2974
|
return [
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2975
|
+
Io(Mo, t.base ?? 1),
|
|
2976
|
+
Io(No, t.sm),
|
|
2977
|
+
Io(Po, t.md),
|
|
2978
|
+
Io(Fo, t.lg)
|
|
2453
2979
|
].filter(Boolean).join(" ");
|
|
2454
2980
|
}
|
|
2455
2981
|
//#endregion
|
|
2456
2982
|
//#region lib/components/ui/display/chip/chip.variants.ts
|
|
2457
|
-
function
|
|
2983
|
+
function Ro(e) {
|
|
2458
2984
|
return e === "tag" ? "tag" : e === "tonal" || e === "filled" || e === "ghost" ? "soft" : "hairline";
|
|
2459
2985
|
}
|
|
2460
|
-
function
|
|
2986
|
+
function zo(e) {
|
|
2461
2987
|
return !e || e === "default" ? "neutral" : e;
|
|
2462
2988
|
}
|
|
2463
|
-
function
|
|
2464
|
-
let i =
|
|
2989
|
+
function Bo({ variant: e, size: t, color: n, selected: r }) {
|
|
2990
|
+
let i = Ro(e), a = zo(n);
|
|
2465
2991
|
return {
|
|
2466
2992
|
look: i,
|
|
2467
2993
|
tone: a,
|
|
@@ -2478,22 +3004,22 @@ function ba({ variant: e, size: t, color: n, selected: r }) {
|
|
|
2478
3004
|
}
|
|
2479
3005
|
//#endregion
|
|
2480
3006
|
//#region lib/components/ui/display/chip/partials/chip-body.tsx
|
|
2481
|
-
function
|
|
2482
|
-
return N(e) ?
|
|
3007
|
+
function Vo(e) {
|
|
3008
|
+
return N(e) ? st(e, { className: A("size-(--chip-avatar)", e.props.className) }) : e;
|
|
2483
3009
|
}
|
|
2484
|
-
function
|
|
3010
|
+
function Ho({ avatar: e, leading: t, label: n, trailing: r, check: i, dot: a }) {
|
|
2485
3011
|
let o = null;
|
|
2486
3012
|
return e ? o = /* @__PURE__ */ z("span", {
|
|
2487
3013
|
"data-slot": "chip-avatar",
|
|
2488
3014
|
"aria-hidden": n ? "true" : void 0,
|
|
2489
|
-
children:
|
|
3015
|
+
children: Vo(e)
|
|
2490
3016
|
}) : t ? o = /* @__PURE__ */ z("span", {
|
|
2491
3017
|
"data-slot": "chip-lead",
|
|
2492
3018
|
children: t
|
|
2493
3019
|
}) : i ? o = /* @__PURE__ */ z("span", {
|
|
2494
3020
|
"data-slot": "chip-check",
|
|
2495
3021
|
"aria-hidden": "true",
|
|
2496
|
-
children: /* @__PURE__ */ z(
|
|
3022
|
+
children: /* @__PURE__ */ z(xt, { strokeWidth: 2.75 })
|
|
2497
3023
|
}) : a && (o = /* @__PURE__ */ z("span", {
|
|
2498
3024
|
"data-slot": "chip-dot",
|
|
2499
3025
|
"aria-hidden": "true"
|
|
@@ -2511,14 +3037,14 @@ function Sa({ avatar: e, leading: t, label: n, trailing: r, check: i, dot: a })
|
|
|
2511
3037
|
}
|
|
2512
3038
|
//#endregion
|
|
2513
3039
|
//#region lib/lib/react-node-text.ts
|
|
2514
|
-
function
|
|
2515
|
-
return e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(
|
|
3040
|
+
function Uo(e) {
|
|
3041
|
+
return e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(Uo).join("") : N(e) ? Uo(e.props.children) : "";
|
|
2516
3042
|
}
|
|
2517
3043
|
//#endregion
|
|
2518
3044
|
//#region lib/components/ui/display/chip/partials/chip-dismiss-button.tsx
|
|
2519
|
-
function
|
|
2520
|
-
let { t: i } = a(), o =
|
|
2521
|
-
return /* @__PURE__ */ z(
|
|
3045
|
+
function Wo({ label: e, dismissLabel: t, disabled: n, onDismiss: r }) {
|
|
3046
|
+
let { t: i } = a(), o = Uo(e).replace(/\s+/g, " ").trim(), s = i("material.chip.dismiss", "Remove");
|
|
3047
|
+
return /* @__PURE__ */ z(w, {
|
|
2522
3048
|
content: s,
|
|
2523
3049
|
children: /* @__PURE__ */ z("button", {
|
|
2524
3050
|
type: "button",
|
|
@@ -2537,14 +3063,14 @@ function wa({ label: e, dismissLabel: t, disabled: n, onDismiss: r }) {
|
|
|
2537
3063
|
}
|
|
2538
3064
|
//#endregion
|
|
2539
3065
|
//#region lib/components/ui/display/chip/partials/chip-dismissible.tsx
|
|
2540
|
-
function
|
|
3066
|
+
function Go({ shared: e, body: t, label: n, dismissLabel: r, onDismiss: i, disabled: a, tooltip: o, className: s, bodyProps: c, ref: l }) {
|
|
2541
3067
|
let u = c.onClick ? /* @__PURE__ */ z("button", {
|
|
2542
3068
|
type: "button",
|
|
2543
3069
|
disabled: a,
|
|
2544
3070
|
...c,
|
|
2545
3071
|
"data-slot": "chip-body",
|
|
2546
3072
|
ref: l,
|
|
2547
|
-
children: /* @__PURE__ */ z(
|
|
3073
|
+
children: /* @__PURE__ */ z(g, {
|
|
2548
3074
|
value: !0,
|
|
2549
3075
|
children: t
|
|
2550
3076
|
})
|
|
@@ -2560,10 +3086,10 @@ function Ta({ shared: e, body: t, label: n, dismissLabel: r, onDismiss: i, disab
|
|
|
2560
3086
|
"data-dismissible": "",
|
|
2561
3087
|
"data-disabled": a ? "" : void 0,
|
|
2562
3088
|
className: A("nxgt-chip", s),
|
|
2563
|
-
children: [o ? /* @__PURE__ */ z(
|
|
3089
|
+
children: [o ? /* @__PURE__ */ z(w, {
|
|
2564
3090
|
content: o,
|
|
2565
3091
|
children: u
|
|
2566
|
-
}) : u, /* @__PURE__ */ z(
|
|
3092
|
+
}) : u, /* @__PURE__ */ z(Wo, {
|
|
2567
3093
|
label: n,
|
|
2568
3094
|
dismissLabel: r,
|
|
2569
3095
|
disabled: a,
|
|
@@ -2573,7 +3099,7 @@ function Ta({ shared: e, body: t, label: n, dismissLabel: r, onDismiss: i, disab
|
|
|
2573
3099
|
}
|
|
2574
3100
|
//#endregion
|
|
2575
3101
|
//#region lib/components/ui/display/chip/partials/chip-plain.tsx
|
|
2576
|
-
function
|
|
3102
|
+
function Ko({ shared: e, body: t, disabled: n, tooltip: r, className: i, rootProps: a, ref: o }) {
|
|
2577
3103
|
let s = a.onClick ? /* @__PURE__ */ z("button", {
|
|
2578
3104
|
type: "button",
|
|
2579
3105
|
...e,
|
|
@@ -2581,7 +3107,7 @@ function Ea({ shared: e, body: t, disabled: n, tooltip: r, className: i, rootPro
|
|
|
2581
3107
|
...a,
|
|
2582
3108
|
ref: o,
|
|
2583
3109
|
className: A("nxgt-chip", i),
|
|
2584
|
-
children: /* @__PURE__ */ z(
|
|
3110
|
+
children: /* @__PURE__ */ z(g, {
|
|
2585
3111
|
value: !0,
|
|
2586
3112
|
children: t
|
|
2587
3113
|
})
|
|
@@ -2595,24 +3121,24 @@ function Ea({ shared: e, body: t, disabled: n, tooltip: r, className: i, rootPro
|
|
|
2595
3121
|
className: A("nxgt-chip", i),
|
|
2596
3122
|
children: t
|
|
2597
3123
|
});
|
|
2598
|
-
return r ? /* @__PURE__ */ z(
|
|
3124
|
+
return r ? /* @__PURE__ */ z(w, {
|
|
2599
3125
|
content: r,
|
|
2600
3126
|
children: s
|
|
2601
3127
|
}) : s;
|
|
2602
3128
|
}
|
|
2603
3129
|
//#endregion
|
|
2604
3130
|
//#region lib/components/ui/display/chip/chip.tsx
|
|
2605
|
-
function
|
|
3131
|
+
function qo(e) {
|
|
2606
3132
|
let { loading: t, lockOnClick: n, spinnerVariant: r, wrap: i, asChild: a, ...o } = e;
|
|
2607
3133
|
return o;
|
|
2608
3134
|
}
|
|
2609
|
-
function
|
|
2610
|
-
let h =
|
|
3135
|
+
function Jo({ label: e, leading: t, trailing: n, avatar: r, className: i, active: a, variant: o = "outlined", onDismiss: s, dismissLabel: c, size: l = "default", color: u, tooltip: d, ref: f, disabled: p, ...m }) {
|
|
3136
|
+
let h = qo(m), g = h["aria-pressed"] === !0 || h["aria-pressed"] === "true" || h["aria-checked"] === !0 || h["aria-checked"] === "true", _ = Bo({
|
|
2611
3137
|
variant: o,
|
|
2612
3138
|
size: l,
|
|
2613
3139
|
color: u,
|
|
2614
3140
|
selected: a || g
|
|
2615
|
-
}), v = _.attributes, y = /* @__PURE__ */ z(
|
|
3141
|
+
}), v = _.attributes, y = /* @__PURE__ */ z(Ho, {
|
|
2616
3142
|
avatar: r,
|
|
2617
3143
|
leading: t,
|
|
2618
3144
|
label: e,
|
|
@@ -2620,7 +3146,7 @@ function Oa({ label: e, leading: t, trailing: n, avatar: r, className: i, active
|
|
|
2620
3146
|
check: g,
|
|
2621
3147
|
dot: _.look === "tag" && _.tone !== "neutral"
|
|
2622
3148
|
});
|
|
2623
|
-
return s ? /* @__PURE__ */ z(
|
|
3149
|
+
return s ? /* @__PURE__ */ z(Go, {
|
|
2624
3150
|
shared: v,
|
|
2625
3151
|
body: y,
|
|
2626
3152
|
label: e,
|
|
@@ -2631,7 +3157,7 @@ function Oa({ label: e, leading: t, trailing: n, avatar: r, className: i, active
|
|
|
2631
3157
|
className: i,
|
|
2632
3158
|
bodyProps: h,
|
|
2633
3159
|
ref: f
|
|
2634
|
-
}) : /* @__PURE__ */ z(
|
|
3160
|
+
}) : /* @__PURE__ */ z(Ko, {
|
|
2635
3161
|
shared: v,
|
|
2636
3162
|
body: y,
|
|
2637
3163
|
disabled: p,
|
|
@@ -2643,7 +3169,7 @@ function Oa({ label: e, leading: t, trailing: n, avatar: r, className: i, active
|
|
|
2643
3169
|
}
|
|
2644
3170
|
//#endregion
|
|
2645
3171
|
//#region lib/components/ui/selection/option-count/option-count.tsx
|
|
2646
|
-
function
|
|
3172
|
+
function Yo({ count: e, inChip: t = !1 }) {
|
|
2647
3173
|
let { t: n } = a();
|
|
2648
3174
|
return e === void 0 ? null : /* @__PURE__ */ B(R, { children: [
|
|
2649
3175
|
" ",
|
|
@@ -2660,24 +3186,24 @@ function ka({ count: e, inChip: t = !1 }) {
|
|
|
2660
3186
|
}
|
|
2661
3187
|
//#endregion
|
|
2662
3188
|
//#region lib/components/ui/selection/chip-group-field/partials/chip-group-option.tsx
|
|
2663
|
-
function
|
|
3189
|
+
function Xo() {
|
|
2664
3190
|
return /* @__PURE__ */ z("svg", {
|
|
2665
3191
|
"aria-hidden": "true",
|
|
2666
3192
|
focusable: "false",
|
|
2667
3193
|
"data-room": ""
|
|
2668
3194
|
});
|
|
2669
3195
|
}
|
|
2670
|
-
function
|
|
3196
|
+
function Zo({ group: e, option: t, index: n, size: r, dataPw: i, name: a, columns: o, showReason: s }) {
|
|
2671
3197
|
let { ref: c, "aria-describedby": l, ...u } = e.itemProps(t, n), d = u["aria-checked"], f = e.reasons.find((e) => e.id === l)?.text, p = t.description ? `${e.groupId}-description-${n}` : void 0, m = s && f && e.reasons.find((e) => e.id === l)?.why === "disabled" ? f : void 0, h = [l, p].filter(Boolean).join(" ");
|
|
2672
|
-
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(
|
|
3198
|
+
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Jo, {
|
|
2673
3199
|
...u,
|
|
2674
3200
|
ref: c,
|
|
2675
3201
|
variant: "tonal",
|
|
2676
3202
|
size: r,
|
|
2677
3203
|
color: t.tone,
|
|
2678
3204
|
label: t.label,
|
|
2679
|
-
leading: d ? void 0 : t.icon ?? /* @__PURE__ */ z(
|
|
2680
|
-
trailing: /* @__PURE__ */ z(
|
|
3205
|
+
leading: d ? void 0 : t.icon ?? /* @__PURE__ */ z(Xo, {}),
|
|
3206
|
+
trailing: /* @__PURE__ */ z(Yo, {
|
|
2681
3207
|
count: t.count,
|
|
2682
3208
|
inChip: !0
|
|
2683
3209
|
}),
|
|
@@ -2695,7 +3221,7 @@ function ja({ group: e, option: t, index: n, size: r, dataPw: i, name: a, column
|
|
|
2695
3221
|
}
|
|
2696
3222
|
//#endregion
|
|
2697
3223
|
//#region lib/components/ui/selection/chip-group-field/partials/chip-group-reasons.tsx
|
|
2698
|
-
function
|
|
3224
|
+
function Qo({ reasons: e }) {
|
|
2699
3225
|
return e.length === 0 ? null : /* @__PURE__ */ z("div", {
|
|
2700
3226
|
"data-slot": "chip-group-reasons",
|
|
2701
3227
|
className: "grid gap-0.5 px-1 text-xs text-muted-foreground",
|
|
@@ -2718,7 +3244,7 @@ function Ma({ reasons: e }) {
|
|
|
2718
3244
|
}
|
|
2719
3245
|
//#endregion
|
|
2720
3246
|
//#region lib/components/ui/selection/chip-group-field/partials/chip-group-sections.tsx
|
|
2721
|
-
function
|
|
3247
|
+
function $o({ groupId: e, sections: t, gridClasses: n, renderChip: r }) {
|
|
2722
3248
|
let i = 0;
|
|
2723
3249
|
return t.map((t, a) => {
|
|
2724
3250
|
let o = i;
|
|
@@ -2743,8 +3269,8 @@ function Na({ groupId: e, sections: t, gridClasses: n, renderChip: r }) {
|
|
|
2743
3269
|
}
|
|
2744
3270
|
//#endregion
|
|
2745
3271
|
//#region lib/components/ui/selection/chip-group-field/chip-group-field.tsx
|
|
2746
|
-
function
|
|
2747
|
-
let { options: t, groups: n, size: r, columns: i, overflow: a = "wrap", showDisabledReason: o = !0, hideLabel: s, ...c } = e, l = n ? n.flatMap((e) => e.options) : t ?? [], { group: u, name: d, dom: f } =
|
|
3272
|
+
function es(e) {
|
|
3273
|
+
let { options: t, groups: n, size: r, columns: i, overflow: a = "wrap", showDisabledReason: o = !0, hideLabel: s, ...c } = e, l = n ? n.flatMap((e) => e.options) : t ?? [], { group: u, name: d, dom: f } = jo(c, l, { grid: i !== void 0 || n !== void 0 }), p = uo(a !== "wrap" && i === void 0 && !n, a === "scroll-phone"), m = i === void 0 ? void 0 : Lo(i), h = (e, t) => /* @__PURE__ */ z(Zo, {
|
|
2748
3274
|
group: u,
|
|
2749
3275
|
option: e,
|
|
2750
3276
|
index: t,
|
|
@@ -2760,18 +3286,18 @@ function Pa(e) {
|
|
|
2760
3286
|
label: e.label
|
|
2761
3287
|
}] : [];
|
|
2762
3288
|
}) : [];
|
|
2763
|
-
return /* @__PURE__ */ z(
|
|
3289
|
+
return /* @__PURE__ */ z(_o, {
|
|
2764
3290
|
...f,
|
|
2765
3291
|
group: u,
|
|
2766
3292
|
name: d,
|
|
2767
3293
|
slot: "chip-group-field",
|
|
2768
3294
|
hideLabel: s,
|
|
2769
3295
|
inlineReasons: o,
|
|
2770
|
-
reasonsBelow: /* @__PURE__ */ z(
|
|
3296
|
+
reasonsBelow: /* @__PURE__ */ z(Qo, { reasons: g }),
|
|
2771
3297
|
contentRef: p.ref,
|
|
2772
3298
|
contentProps: p.props,
|
|
2773
3299
|
contentClassName: A(p.className, n && "mt-1 flex-col flex-nowrap gap-4", !n && m && `grid ${m}`),
|
|
2774
|
-
children: n ? /* @__PURE__ */ z(
|
|
3300
|
+
children: n ? /* @__PURE__ */ z($o, {
|
|
2775
3301
|
groupId: u.groupId,
|
|
2776
3302
|
sections: n,
|
|
2777
3303
|
gridClasses: m,
|
|
@@ -2781,9 +3307,9 @@ function Pa(e) {
|
|
|
2781
3307
|
}
|
|
2782
3308
|
//#endregion
|
|
2783
3309
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-attachment-chip.tsx
|
|
2784
|
-
var
|
|
2785
|
-
function
|
|
2786
|
-
let { t: r } = a(), i = I(null), o =
|
|
3310
|
+
var ts = 36;
|
|
3311
|
+
function ns({ file: e, onRemove: t, className: n }) {
|
|
3312
|
+
let { t: r } = a(), i = I(null), o = Ra(i, e, ts * 2), s = r("material.chat.remove-attachment", "Remove attachment");
|
|
2787
3313
|
return /* @__PURE__ */ B("div", {
|
|
2788
3314
|
"data-slot": "chat-composer-attachment-chip",
|
|
2789
3315
|
className: A("group/chip inline-flex min-w-0 max-w-full animate-in items-center gap-2.5 rounded-(--nxgt-shape-corner-md) border border-border/70 bg-background py-1.5 ps-1.5 pe-1 text-xs shadow-xs fade-in zoom-in-95 duration-(--nxgt-motion-effects-default-duration) ease-(--nxgt-motion-emphasized-decelerate) motion-reduce:animate-none @md:max-w-64", n),
|
|
@@ -2795,7 +3321,7 @@ function Ia({ file: e, onRemove: t, className: n }) {
|
|
|
2795
3321
|
}),
|
|
2796
3322
|
!o && /* @__PURE__ */ z("span", {
|
|
2797
3323
|
className: "flex size-9 shrink-0 items-center justify-center rounded-(--nxgt-shape-corner-sm) bg-primary/10 text-primary-text",
|
|
2798
|
-
children: /* @__PURE__ */ z(
|
|
3324
|
+
children: /* @__PURE__ */ z(Ft, { className: "size-4" })
|
|
2799
3325
|
}),
|
|
2800
3326
|
/* @__PURE__ */ B("span", {
|
|
2801
3327
|
className: "flex min-w-0 flex-col",
|
|
@@ -2804,7 +3330,7 @@ function Ia({ file: e, onRemove: t, className: n }) {
|
|
|
2804
3330
|
children: e.name
|
|
2805
3331
|
}), /* @__PURE__ */ z("span", {
|
|
2806
3332
|
className: "text-[0.6875rem] text-muted-foreground tabular-nums",
|
|
2807
|
-
children:
|
|
3333
|
+
children: rn(e.size)
|
|
2808
3334
|
})]
|
|
2809
3335
|
}),
|
|
2810
3336
|
t && /* @__PURE__ */ z(x, {
|
|
@@ -2821,7 +3347,7 @@ function Ia({ file: e, onRemove: t, className: n }) {
|
|
|
2821
3347
|
}
|
|
2822
3348
|
//#endregion
|
|
2823
3349
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-attachments.tsx
|
|
2824
|
-
function
|
|
3350
|
+
function rs({ isDisabled: e, canAttachMore: t, accept: n, maxFiles: r, attachLabel: i, fileInputRef: a, onAttachmentsChange: o, handleFiles: s, actions: c }) {
|
|
2825
3351
|
return !o && !c ? null : /* @__PURE__ */ B("div", {
|
|
2826
3352
|
"data-slot": "chat-composer-tools",
|
|
2827
3353
|
className: "flex items-end gap-1 pb-0.5",
|
|
@@ -2843,15 +3369,15 @@ function La({ isDisabled: e, canAttachMore: t, accept: n, maxFiles: r, attachLab
|
|
|
2843
3369
|
disabled: e || !t,
|
|
2844
3370
|
onClick: () => a.current?.click(),
|
|
2845
3371
|
className: "shrink-0",
|
|
2846
|
-
children: /* @__PURE__ */ z(
|
|
3372
|
+
children: /* @__PURE__ */ z(Vt, {})
|
|
2847
3373
|
})] }), c]
|
|
2848
3374
|
});
|
|
2849
3375
|
}
|
|
2850
|
-
function
|
|
3376
|
+
function is({ attachments: e, isDisabled: t, onAttachmentsChange: n, className: r }) {
|
|
2851
3377
|
return e.length === 0 ? null : /* @__PURE__ */ z("div", {
|
|
2852
3378
|
"data-slot": "chat-composer-attachments",
|
|
2853
3379
|
className: A("flex flex-wrap gap-2", r),
|
|
2854
|
-
children: e.map((r, i) => /* @__PURE__ */ z(
|
|
3380
|
+
children: e.map((r, i) => /* @__PURE__ */ z(ns, {
|
|
2855
3381
|
file: r,
|
|
2856
3382
|
onRemove: t ? void 0 : () => n?.(e.filter((e, t) => t !== i))
|
|
2857
3383
|
}, `${r.name}-${r.size}-${i}`))
|
|
@@ -2859,7 +3385,7 @@ function Ra({ attachments: e, isDisabled: t, onAttachmentsChange: n, className:
|
|
|
2859
3385
|
}
|
|
2860
3386
|
//#endregion
|
|
2861
3387
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-disabled-reason.tsx
|
|
2862
|
-
function
|
|
3388
|
+
function as({ id: e, children: t }) {
|
|
2863
3389
|
return e ? /* @__PURE__ */ z("p", {
|
|
2864
3390
|
id: e,
|
|
2865
3391
|
"data-slot": "chat-composer-disabled-reason",
|
|
@@ -2869,7 +3395,7 @@ function za({ id: e, children: t }) {
|
|
|
2869
3395
|
}
|
|
2870
3396
|
//#endregion
|
|
2871
3397
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-send.tsx
|
|
2872
|
-
function
|
|
3398
|
+
function os({ sendLabel: e, stopLabel: t, isDisabled: n, isEmpty: r, onStop: i, shape: a = "round" }) {
|
|
2873
3399
|
if (i) return /* @__PURE__ */ z(x, {
|
|
2874
3400
|
"data-slot": "chat-composer-stop",
|
|
2875
3401
|
"data-send-shape": a === "squircle" ? a : void 0,
|
|
@@ -2879,7 +3405,7 @@ function Ba({ sendLabel: e, stopLabel: t, isDisabled: n, isEmpty: r, onStop: i,
|
|
|
2879
3405
|
"aria-label": t,
|
|
2880
3406
|
onClick: i,
|
|
2881
3407
|
className: "size-9 shrink-0 animate-in zoom-in-75 duration-(--nxgt-motion-effects-default-duration) ease-effects-default motion-reduce:animate-none",
|
|
2882
|
-
children: /* @__PURE__ */ z(
|
|
3408
|
+
children: /* @__PURE__ */ z(Jt, { className: "size-3.5 fill-current" })
|
|
2883
3409
|
});
|
|
2884
3410
|
let o = !n && !r;
|
|
2885
3411
|
return /* @__PURE__ */ z(x, {
|
|
@@ -2893,7 +3419,7 @@ function Ba({ sendLabel: e, stopLabel: t, isDisabled: n, isEmpty: r, onStop: i,
|
|
|
2893
3419
|
disabled: !o,
|
|
2894
3420
|
"aria-label": e,
|
|
2895
3421
|
className: A("size-9 shrink-0 [transition:scale_var(--nxgt-motion-spatial-fast-duration)_var(--nxgt-motion-spatial-fast),opacity_var(--nxgt-motion-effects-default-duration)_var(--nxgt-motion-effects-default),background-color_var(--nxgt-motion-effects-default-duration)_var(--nxgt-motion-effects-default)]", o ? "scale-100" : "scale-90 disabled:opacity-35"),
|
|
2896
|
-
children: /* @__PURE__ */ z(
|
|
3422
|
+
children: /* @__PURE__ */ z(bt, {
|
|
2897
3423
|
className: "size-4.5",
|
|
2898
3424
|
strokeWidth: 2.5
|
|
2899
3425
|
})
|
|
@@ -2901,8 +3427,8 @@ function Ba({ sendLabel: e, stopLabel: t, isDisabled: n, isEmpty: r, onStop: i,
|
|
|
2901
3427
|
}
|
|
2902
3428
|
//#endregion
|
|
2903
3429
|
//#region lib/components/ui/widgets/chat/partials/preloaded-lazy.tsx
|
|
2904
|
-
function
|
|
2905
|
-
let t, n, r = () => (n ??= e().then((e) => (t = e, { default: e })), n), i =
|
|
3430
|
+
function ss(e) {
|
|
3431
|
+
let t, n, r = () => (n ??= e().then((e) => (t = e, { default: e })), n), i = lt(r);
|
|
2906
3432
|
function a(e) {
|
|
2907
3433
|
return z(t || i, { ...e });
|
|
2908
3434
|
}
|
|
@@ -2910,12 +3436,12 @@ function Va(e) {
|
|
|
2910
3436
|
}
|
|
2911
3437
|
//#endregion
|
|
2912
3438
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-input.tsx
|
|
2913
|
-
var
|
|
2914
|
-
function
|
|
3439
|
+
var cs = ss(() => import("./embed-chunks/emoji-picker-CrIXB9pF.js").then((e) => e.EmojiPicker));
|
|
3440
|
+
function ls({ value: e, onValueChange: t, textareaRef: n, fileInputRef: r, onKeyDown: i, placeholder: a, messageLabel: o, sendLabel: s, stopLabel: c = "Stop", attachLabel: l, isDisabled: u, describedBy: d, isEmpty: f, canAttachMore: p, handleFiles: m, onAttachmentsChange: h, accept: g, maxFiles: _, maxLength: v, actions: y, emojis: b, onStop: x }) {
|
|
2915
3441
|
return /* @__PURE__ */ B("div", {
|
|
2916
3442
|
className: "flex items-end gap-1 p-1.5",
|
|
2917
3443
|
children: [
|
|
2918
|
-
/* @__PURE__ */ z(
|
|
3444
|
+
/* @__PURE__ */ z(rs, {
|
|
2919
3445
|
isDisabled: u,
|
|
2920
3446
|
canAttachMore: p,
|
|
2921
3447
|
accept: g,
|
|
@@ -2924,9 +3450,9 @@ function Ua({ value: e, onValueChange: t, textareaRef: n, fileInputRef: r, onKey
|
|
|
2924
3450
|
fileInputRef: r,
|
|
2925
3451
|
onAttachmentsChange: h,
|
|
2926
3452
|
handleFiles: m,
|
|
2927
|
-
actions: /* @__PURE__ */ B(R, { children: [b && b.length > 0 && /* @__PURE__ */ z(
|
|
3453
|
+
actions: /* @__PURE__ */ B(R, { children: [b && b.length > 0 && /* @__PURE__ */ z(ot, {
|
|
2928
3454
|
fallback: null,
|
|
2929
|
-
children: /* @__PURE__ */ z(
|
|
3455
|
+
children: /* @__PURE__ */ z(cs, {
|
|
2930
3456
|
emojis: b,
|
|
2931
3457
|
onSelect: (n) => {
|
|
2932
3458
|
n.emoji && t?.(`${e}${n.emoji}`);
|
|
@@ -2934,7 +3460,7 @@ function Ua({ value: e, onValueChange: t, textareaRef: n, fileInputRef: r, onKey
|
|
|
2934
3460
|
})
|
|
2935
3461
|
}), y] })
|
|
2936
3462
|
}),
|
|
2937
|
-
/* @__PURE__ */ z(
|
|
3463
|
+
/* @__PURE__ */ z(ui, {
|
|
2938
3464
|
ref: n,
|
|
2939
3465
|
value: e,
|
|
2940
3466
|
onChange: (e) => t?.(e.target.value),
|
|
@@ -2948,7 +3474,7 @@ function Ua({ value: e, onValueChange: t, textareaRef: n, fileInputRef: r, onKey
|
|
|
2948
3474
|
"aria-label": o,
|
|
2949
3475
|
"aria-describedby": d
|
|
2950
3476
|
}),
|
|
2951
|
-
/* @__PURE__ */ z(
|
|
3477
|
+
/* @__PURE__ */ z(os, {
|
|
2952
3478
|
sendLabel: s,
|
|
2953
3479
|
stopLabel: c,
|
|
2954
3480
|
isDisabled: u,
|
|
@@ -2960,8 +3486,8 @@ function Ua({ value: e, onValueChange: t, textareaRef: n, fileInputRef: r, onKey
|
|
|
2960
3486
|
}
|
|
2961
3487
|
//#endregion
|
|
2962
3488
|
//#region lib/components/ui/widgets/mentions/mention-search-view.ts
|
|
2963
|
-
function
|
|
2964
|
-
let r =
|
|
3489
|
+
function us(e, t, n) {
|
|
3490
|
+
let r = Pe(e ?? [], n);
|
|
2965
3491
|
return t ? t.status === "error" ? {
|
|
2966
3492
|
items: r,
|
|
2967
3493
|
loading: !1,
|
|
@@ -2982,16 +3508,16 @@ function Wa(e, t, n) {
|
|
|
2982
3508
|
}
|
|
2983
3509
|
//#endregion
|
|
2984
3510
|
//#region lib/components/ui/widgets/chat/partials/floating-mentions.tsx
|
|
2985
|
-
var
|
|
2986
|
-
function
|
|
3511
|
+
var ds = "max-h-(--radix-popover-content-available-height) overflow-y-auto shadow-md";
|
|
3512
|
+
function fs({ textareaRef: e, children: t }) {
|
|
2987
3513
|
let n = I(null);
|
|
2988
3514
|
n.current = e.current?.closest("[data-slot=\"chat-composer\"]") ?? e.current;
|
|
2989
3515
|
let r = f();
|
|
2990
|
-
return /* @__PURE__ */ B(
|
|
3516
|
+
return /* @__PURE__ */ B(ze, {
|
|
2991
3517
|
open: !0,
|
|
2992
|
-
children: [/* @__PURE__ */ z(
|
|
3518
|
+
children: [/* @__PURE__ */ z(Re, { virtualRef: n }), /* @__PURE__ */ z(Be, {
|
|
2993
3519
|
container: r,
|
|
2994
|
-
children: /* @__PURE__ */ z(
|
|
3520
|
+
children: /* @__PURE__ */ z(Ue, {
|
|
2995
3521
|
"data-slot": "mention-popover",
|
|
2996
3522
|
side: "top",
|
|
2997
3523
|
align: "start",
|
|
@@ -3008,7 +3534,7 @@ function Ka({ textareaRef: e, children: t }) {
|
|
|
3008
3534
|
}
|
|
3009
3535
|
//#endregion
|
|
3010
3536
|
//#region lib/components/ui/widgets/chat/use-chat-caret-move.ts
|
|
3011
|
-
var
|
|
3537
|
+
var ps = /* @__PURE__ */ new Set([
|
|
3012
3538
|
"ArrowLeft",
|
|
3013
3539
|
"ArrowRight",
|
|
3014
3540
|
"ArrowUp",
|
|
@@ -3018,13 +3544,13 @@ var qa = /* @__PURE__ */ new Set([
|
|
|
3018
3544
|
"PageUp",
|
|
3019
3545
|
"PageDown"
|
|
3020
3546
|
]);
|
|
3021
|
-
function
|
|
3022
|
-
let [, t] =
|
|
3547
|
+
function ms(e) {
|
|
3548
|
+
let [, t] = mt((e) => e + 1, 0);
|
|
3023
3549
|
P(() => {
|
|
3024
3550
|
let n = e.current;
|
|
3025
3551
|
if (!n) return;
|
|
3026
3552
|
let r = (e) => {
|
|
3027
|
-
!e.isComposing &&
|
|
3553
|
+
!e.isComposing && ps.has(e.key) && t();
|
|
3028
3554
|
}, i = n.ownerDocument, a = () => {
|
|
3029
3555
|
i.activeElement === n && t();
|
|
3030
3556
|
};
|
|
@@ -3035,13 +3561,13 @@ function Ja(e) {
|
|
|
3035
3561
|
}
|
|
3036
3562
|
//#endregion
|
|
3037
3563
|
//#region lib/components/ui/widgets/mentions/mention-keys.ts
|
|
3038
|
-
function
|
|
3564
|
+
function hs(e, t, n) {
|
|
3039
3565
|
if (e.isComposing || e.keyCode === 229 || e.altKey || e.ctrlKey || e.metaKey) return null;
|
|
3040
3566
|
if (e.key === "Escape") return e.shiftKey ? null : { type: "close" };
|
|
3041
3567
|
if (n === 0 || e.shiftKey) return null;
|
|
3042
3568
|
if (e.key === "Enter" || e.key === "Tab") return { type: "pick" };
|
|
3043
3569
|
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return null;
|
|
3044
|
-
let r = Array.from({ length: n }, () => ({ enabled: !0 })), i =
|
|
3570
|
+
let r = Array.from({ length: n }, () => ({ enabled: !0 })), i = cn(e.key, t, r, {});
|
|
3045
3571
|
return i === null ? null : {
|
|
3046
3572
|
type: "move",
|
|
3047
3573
|
index: i
|
|
@@ -3049,7 +3575,7 @@ function Ya(e, t, n) {
|
|
|
3049
3575
|
}
|
|
3050
3576
|
//#endregion
|
|
3051
3577
|
//#region lib/components/ui/widgets/chat/use-chat-mention-keys.ts
|
|
3052
|
-
function
|
|
3578
|
+
function gs({ textareaRef: e, open: t, listId: n, activeId: r, active: i, count: a, onAction: o }) {
|
|
3053
3579
|
let s = I({
|
|
3054
3580
|
active: i,
|
|
3055
3581
|
count: a,
|
|
@@ -3088,7 +3614,7 @@ function Xa({ textareaRef: e, open: t, listId: n, activeId: r, active: i, count:
|
|
|
3088
3614
|
let n = e.current;
|
|
3089
3615
|
if (!n || !t) return;
|
|
3090
3616
|
let r = (e) => {
|
|
3091
|
-
let t = s.current, n =
|
|
3617
|
+
let t = s.current, n = hs(e, t.active, t.count);
|
|
3092
3618
|
n && (e.preventDefault(), e.stopPropagation(), t.onAction(n));
|
|
3093
3619
|
};
|
|
3094
3620
|
return n.addEventListener("keydown", r), () => n.removeEventListener("keydown", r);
|
|
@@ -3096,13 +3622,13 @@ function Xa({ textareaRef: e, open: t, listId: n, activeId: r, active: i, count:
|
|
|
3096
3622
|
}
|
|
3097
3623
|
//#endregion
|
|
3098
3624
|
//#region lib/hooks/use-async-search.ts
|
|
3099
|
-
var
|
|
3625
|
+
var _s = {
|
|
3100
3626
|
status: "idle",
|
|
3101
3627
|
query: "",
|
|
3102
3628
|
results: []
|
|
3103
3629
|
};
|
|
3104
|
-
function
|
|
3105
|
-
let r =
|
|
3630
|
+
function vs(e, t, n) {
|
|
3631
|
+
let r = S(e), [i, a] = L(_s), [o] = L(() => ln({ search: (e, t) => r.current.onSearch?.(e, t) ?? Promise.resolve([]) }, (e) => {
|
|
3106
3632
|
a(e), e.status === "error" && r.current.onSearchError?.(e.error);
|
|
3107
3633
|
})), s = !!e.onSearch;
|
|
3108
3634
|
return P(() => {
|
|
@@ -3121,8 +3647,8 @@ function Qa(e, t, n) {
|
|
|
3121
3647
|
}
|
|
3122
3648
|
//#endregion
|
|
3123
3649
|
//#region lib/components/ui/widgets/chat/use-chat-mention-search.ts
|
|
3124
|
-
function
|
|
3125
|
-
return
|
|
3650
|
+
function ys(e, t) {
|
|
3651
|
+
return vs({
|
|
3126
3652
|
onSearch: e?.query,
|
|
3127
3653
|
onSearchError: e?.onError,
|
|
3128
3654
|
debounceMs: e?.debounceMs,
|
|
@@ -3131,32 +3657,32 @@ function $a(e, t) {
|
|
|
3131
3657
|
}
|
|
3132
3658
|
//#endregion
|
|
3133
3659
|
//#region lib/components/ui/widgets/chat/chat-composer-mentions.tsx
|
|
3134
|
-
var
|
|
3135
|
-
function
|
|
3660
|
+
var bs = ss(() => import("./embed-chunks/mention-list-9hwOYNND.js").then((e) => e.MentionList));
|
|
3661
|
+
function xs({ value: e, textareaRef: t, mentions: n, search: r, onValueChange: i }) {
|
|
3136
3662
|
let [a, o] = L(!0), [s, c] = L({
|
|
3137
3663
|
query: null,
|
|
3138
3664
|
index: 0
|
|
3139
3665
|
}), l = F();
|
|
3140
|
-
|
|
3141
|
-
let u = t.current?.selectionStart ?? e.length, d =
|
|
3666
|
+
ms(t);
|
|
3667
|
+
let u = t.current?.selectionStart ?? e.length, d = Ae(e, u), f = d !== null && a, p = ys(r, f ? d : null);
|
|
3142
3668
|
P(() => {
|
|
3143
3669
|
d === null && o(!0), c({
|
|
3144
3670
|
query: d,
|
|
3145
3671
|
index: 0
|
|
3146
3672
|
});
|
|
3147
3673
|
}, [d]);
|
|
3148
|
-
let m = s.query === d ? s.index : 0, h =
|
|
3674
|
+
let m = s.query === d ? s.index : 0, h = us(n, p, d ?? ""), g = h.items.length, _ = Math.min(m, Math.max(g - 1, 0)), v = (n) => {
|
|
3149
3675
|
o(!1);
|
|
3150
|
-
let r =
|
|
3676
|
+
let r = Me(e, u, n);
|
|
3151
3677
|
i?.(r.value), requestAnimationFrame(() => {
|
|
3152
3678
|
t.current?.setSelectionRange(r.caret, r.caret), t.current?.focus();
|
|
3153
3679
|
});
|
|
3154
3680
|
};
|
|
3155
|
-
if (
|
|
3681
|
+
if (gs({
|
|
3156
3682
|
textareaRef: t,
|
|
3157
3683
|
open: f,
|
|
3158
3684
|
listId: l,
|
|
3159
|
-
activeId: g > 0 ?
|
|
3685
|
+
activeId: g > 0 ? je(l, _) : null,
|
|
3160
3686
|
active: _,
|
|
3161
3687
|
count: g,
|
|
3162
3688
|
onAction: (e) => {
|
|
@@ -3166,26 +3692,26 @@ function to({ value: e, textareaRef: t, mentions: n, search: r, onValueChange: i
|
|
|
3166
3692
|
}) : e.type === "close" ? o(!1) : h.items[_] && v(h.items[_]);
|
|
3167
3693
|
}
|
|
3168
3694
|
}), !f) return null;
|
|
3169
|
-
let y = /* @__PURE__ */ z(
|
|
3695
|
+
let y = /* @__PURE__ */ z(ot, {
|
|
3170
3696
|
fallback: null,
|
|
3171
|
-
children: /* @__PURE__ */ z(
|
|
3697
|
+
children: /* @__PURE__ */ z(bs, {
|
|
3172
3698
|
id: l,
|
|
3173
3699
|
items: h.items,
|
|
3174
3700
|
selectedIndex: _,
|
|
3175
3701
|
loading: h.loading,
|
|
3176
3702
|
failed: h.failed,
|
|
3177
|
-
className: r ?
|
|
3703
|
+
className: r ? ds : void 0,
|
|
3178
3704
|
onSelect: v
|
|
3179
3705
|
})
|
|
3180
3706
|
});
|
|
3181
|
-
return r ? /* @__PURE__ */ z(
|
|
3707
|
+
return r ? /* @__PURE__ */ z(fs, {
|
|
3182
3708
|
textareaRef: t,
|
|
3183
3709
|
children: y
|
|
3184
3710
|
}) : y;
|
|
3185
3711
|
}
|
|
3186
3712
|
//#endregion
|
|
3187
3713
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-suggestions.tsx
|
|
3188
|
-
function
|
|
3714
|
+
function Ss({ suggestions: e, onSelect: t, disabled: n }) {
|
|
3189
3715
|
let { t: r } = a();
|
|
3190
3716
|
return e.length === 0 ? null : /* @__PURE__ */ z("div", {
|
|
3191
3717
|
"data-slot": "chat-composer-suggestions",
|
|
@@ -3197,7 +3723,7 @@ function no({ suggestions: e, onSelect: t, disabled: n }) {
|
|
|
3197
3723
|
disabled: n,
|
|
3198
3724
|
onClick: () => t(e),
|
|
3199
3725
|
className: A("inline-flex shrink-0 cursor-pointer snap-start items-center gap-1.5 whitespace-nowrap rounded-(--nxgt-shape-corner-full)", "border border-primary/30 bg-primary/5 px-3 py-1.5 font-medium text-primary-text text-xs", "outline-none transition-colors duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast hover:border-primary/60 hover:bg-primary/10", "focus-visible:ring-[3px] focus-visible:ring-ring/50 forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-[Highlight] disabled:cursor-not-allowed disabled:opacity-50", "animate-in fade-in slide-in-from-bottom-1 fill-mode-backwards duration-(--nxgt-motion-effects-slow-duration) ease-(--nxgt-motion-emphasized-decelerate) motion-reduce:animate-none", r === 1 && "delay-75", r === 2 && "delay-150", r > 2 && "delay-200"),
|
|
3200
|
-
children: [r === 0 && /* @__PURE__ */ z(
|
|
3726
|
+
children: [r === 0 && /* @__PURE__ */ z(qt, {
|
|
3201
3727
|
"aria-hidden": "true",
|
|
3202
3728
|
className: "size-3.5"
|
|
3203
3729
|
}), e]
|
|
@@ -3206,9 +3732,9 @@ function no({ suggestions: e, onSelect: t, disabled: n }) {
|
|
|
3206
3732
|
}
|
|
3207
3733
|
//#endregion
|
|
3208
3734
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-notices.tsx
|
|
3209
|
-
function
|
|
3735
|
+
function Cs({ composer: e, value: t = "", onValueChange: n, onSend: r, suggestions: i, onSuggestionSelect: a, mentions: o, mentionSearch: s }) {
|
|
3210
3736
|
return /* @__PURE__ */ B(R, { children: [
|
|
3211
|
-
i && i.length > 0 && /* @__PURE__ */ z(
|
|
3737
|
+
i && i.length > 0 && /* @__PURE__ */ z(Ss, {
|
|
3212
3738
|
suggestions: i,
|
|
3213
3739
|
disabled: e.isDisabled,
|
|
3214
3740
|
onSelect: a ?? ((e) => r?.(e, []))
|
|
@@ -3218,7 +3744,7 @@ function ro({ composer: e, value: t = "", onValueChange: n, onSend: r, suggestio
|
|
|
3218
3744
|
className: "px-1 text-error-text text-xs",
|
|
3219
3745
|
children: e.errorMessage
|
|
3220
3746
|
}),
|
|
3221
|
-
(o && o.length > 0 || s) && /* @__PURE__ */ z(
|
|
3747
|
+
(o && o.length > 0 || s) && /* @__PURE__ */ z(xs, {
|
|
3222
3748
|
value: t,
|
|
3223
3749
|
textareaRef: e.textareaRef,
|
|
3224
3750
|
mentions: o,
|
|
@@ -3229,8 +3755,8 @@ function ro({ composer: e, value: t = "", onValueChange: n, onSend: r, suggestio
|
|
|
3229
3755
|
}
|
|
3230
3756
|
//#endregion
|
|
3231
3757
|
//#region lib/components/ui/widgets/chat/chat-reply-quote.tsx
|
|
3232
|
-
function
|
|
3233
|
-
let { t: s } = a(), c = A(
|
|
3758
|
+
function ws({ author: e, content: t, onClick: n, tone: r = "default", className: i, ...o }) {
|
|
3759
|
+
let { t: s } = a(), c = A(ee, "flex w-full min-w-0 flex-col gap-0.5 rounded-(--nxgt-shape-corner-sm) ps-3 pe-2.5 py-1.5 text-start text-xs", r === "inverted" ? "before:bg-primary-foreground/70 bg-primary-foreground/15 text-primary-foreground" : "before:bg-primary-indicator bg-primary/8 text-foreground", n && "cursor-pointer outline-none transition-colors duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast hover:bg-primary/15 focus-visible:ring-[3px] focus-visible:ring-ring/50 forced-colors:focus-visible:outline-2 forced-colors:focus-visible:outline-solid forced-colors:focus-visible:outline-[Highlight]", i), l = /* @__PURE__ */ B(R, { children: [e != null && /* @__PURE__ */ z("span", {
|
|
3234
3760
|
className: A("truncate font-semibold", r === "inverted" ? "" : "text-primary-text"),
|
|
3235
3761
|
children: e
|
|
3236
3762
|
}), /* @__PURE__ */ z("span", {
|
|
@@ -3253,17 +3779,17 @@ function io({ author: e, content: t, onClick: n, tone: r = "default", className:
|
|
|
3253
3779
|
}
|
|
3254
3780
|
//#endregion
|
|
3255
3781
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-reply.tsx
|
|
3256
|
-
function
|
|
3782
|
+
function Ts({ replyTo: e, onCancel: t }) {
|
|
3257
3783
|
let { t: n } = a(), r = n("material.chat.composer.cancel-reply", "Cancel reply");
|
|
3258
3784
|
return /* @__PURE__ */ B("div", {
|
|
3259
3785
|
"data-slot": "chat-composer-reply",
|
|
3260
3786
|
className: "flex animate-in items-center gap-2 px-2 pt-2 fade-in slide-in-from-bottom-1 duration-(--nxgt-motion-effects-default-duration) ease-(--nxgt-motion-emphasized-decelerate) motion-reduce:animate-none",
|
|
3261
3787
|
children: [
|
|
3262
|
-
/* @__PURE__ */ z(
|
|
3788
|
+
/* @__PURE__ */ z(Ht, {
|
|
3263
3789
|
"aria-hidden": "true",
|
|
3264
3790
|
className: "size-4 shrink-0 text-primary-text"
|
|
3265
3791
|
}),
|
|
3266
|
-
/* @__PURE__ */ z(
|
|
3792
|
+
/* @__PURE__ */ z(ws, {
|
|
3267
3793
|
author: e.author == null ? void 0 : /* @__PURE__ */ B(R, { children: [
|
|
3268
3794
|
/* @__PURE__ */ z("span", {
|
|
3269
3795
|
className: "font-normal text-muted-foreground",
|
|
@@ -3290,10 +3816,10 @@ function ao({ replyTo: e, onCancel: t }) {
|
|
|
3290
3816
|
}
|
|
3291
3817
|
//#endregion
|
|
3292
3818
|
//#region lib/components/ui/widgets/chat/partials/chat-composer-surface.tsx
|
|
3293
|
-
function
|
|
3819
|
+
function Es({ composer: e, floating: t, disabledReason: n, ...r }) {
|
|
3294
3820
|
let { isDisabled: i, labels: a } = e, { value: o = "", attachments: s = [], isLoading: c = !1 } = r, l = F(), u = n ? l : void 0;
|
|
3295
3821
|
return /* @__PURE__ */ B(R, { children: [
|
|
3296
|
-
/* @__PURE__ */ z(
|
|
3822
|
+
/* @__PURE__ */ z(Cs, {
|
|
3297
3823
|
composer: e,
|
|
3298
3824
|
value: o,
|
|
3299
3825
|
onValueChange: r.onValueChange,
|
|
@@ -3307,17 +3833,17 @@ function oo({ composer: e, floating: t, disabledReason: n, ...r }) {
|
|
|
3307
3833
|
"data-slot": "chat-composer-surface",
|
|
3308
3834
|
className: A("flex flex-col rounded-(--nxgt-shape-corner-lg-plus) border border-border transition-[border-color,box-shadow] duration-(--nxgt-motion-effects-fast-duration) ease-effects-fast", "focus-within:border-primary/60 dark:focus-within:border-primary-indicator focus-within:ring-[3px] focus-within:ring-primary/15 forced-colors:focus-within:outline-2 forced-colors:focus-within:outline-solid forced-colors:focus-within:outline-[Highlight]", t ? "bg-background shadow-lg" : "bg-card-muted-40", i && "opacity-70"),
|
|
3309
3835
|
children: [
|
|
3310
|
-
r.replyTo && /* @__PURE__ */ z(
|
|
3836
|
+
r.replyTo && /* @__PURE__ */ z(Ts, {
|
|
3311
3837
|
replyTo: r.replyTo,
|
|
3312
3838
|
onCancel: r.onCancelReply
|
|
3313
3839
|
}),
|
|
3314
|
-
/* @__PURE__ */ z(
|
|
3840
|
+
/* @__PURE__ */ z(is, {
|
|
3315
3841
|
attachments: s,
|
|
3316
3842
|
isDisabled: i,
|
|
3317
3843
|
onAttachmentsChange: r.onAttachmentsChange,
|
|
3318
3844
|
className: "px-2.5 pt-2.5"
|
|
3319
3845
|
}),
|
|
3320
|
-
/* @__PURE__ */ z(
|
|
3846
|
+
/* @__PURE__ */ z(ls, {
|
|
3321
3847
|
value: o,
|
|
3322
3848
|
onValueChange: r.onValueChange,
|
|
3323
3849
|
textareaRef: e.textareaRef,
|
|
@@ -3343,20 +3869,20 @@ function oo({ composer: e, floating: t, disabledReason: n, ...r }) {
|
|
|
3343
3869
|
})
|
|
3344
3870
|
]
|
|
3345
3871
|
}),
|
|
3346
|
-
/* @__PURE__ */ z(
|
|
3872
|
+
/* @__PURE__ */ z(as, {
|
|
3347
3873
|
id: u,
|
|
3348
3874
|
children: n
|
|
3349
3875
|
}),
|
|
3350
|
-
r.maxLength != null && /* @__PURE__ */ z(
|
|
3876
|
+
r.maxLength != null && /* @__PURE__ */ z(Os, {
|
|
3351
3877
|
length: o.length,
|
|
3352
3878
|
maxLength: r.maxLength
|
|
3353
3879
|
})
|
|
3354
3880
|
] });
|
|
3355
3881
|
}
|
|
3356
|
-
function
|
|
3882
|
+
function Ds(e) {
|
|
3357
3883
|
return A("@container relative flex shrink-0 flex-col gap-2 px-3 pt-2 pb-3 @md:px-4", e ? "bg-transparent" : "border-border/70 border-t bg-background");
|
|
3358
3884
|
}
|
|
3359
|
-
function
|
|
3885
|
+
function Os({ length: e, maxLength: t }) {
|
|
3360
3886
|
return /* @__PURE__ */ B("span", {
|
|
3361
3887
|
className: A("-mt-1 self-end px-2 text-[0.6875rem] tabular-nums", e >= t ? "text-error-text" : "text-muted-foreground"),
|
|
3362
3888
|
children: [
|
|
@@ -3368,19 +3894,19 @@ function co({ length: e, maxLength: t }) {
|
|
|
3368
3894
|
}
|
|
3369
3895
|
//#endregion
|
|
3370
3896
|
//#region lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.ts
|
|
3371
|
-
function
|
|
3897
|
+
function ks(e, t) {
|
|
3372
3898
|
let n = t.split(",").map((e) => e.trim()).filter(Boolean);
|
|
3373
3899
|
return n.length === 0 || n.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t);
|
|
3374
3900
|
}
|
|
3375
|
-
function
|
|
3376
|
-
return t.accept && !
|
|
3901
|
+
function As(e, t) {
|
|
3902
|
+
return t.accept && !ks(e, t.accept) ? "accept" : t.maxSize !== void 0 && e.size > t.maxSize ? "max-size" : t.maxFiles !== void 0 && t.currentCount !== void 0 && t.currentCount >= t.maxFiles ? "max-files" : null;
|
|
3377
3903
|
}
|
|
3378
3904
|
//#endregion
|
|
3379
3905
|
//#region lib/components/ui/widgets/chat/use-chat-composer-attachments.ts
|
|
3380
|
-
function
|
|
3906
|
+
function js(e, t, n) {
|
|
3381
3907
|
let r = [...t], i = null;
|
|
3382
3908
|
for (let t of e) {
|
|
3383
|
-
let e =
|
|
3909
|
+
let e = As(t, {
|
|
3384
3910
|
accept: n.accept,
|
|
3385
3911
|
maxFiles: n.maxFiles,
|
|
3386
3912
|
currentCount: r.length
|
|
@@ -3396,11 +3922,11 @@ function fo(e, t, n) {
|
|
|
3396
3922
|
error: i
|
|
3397
3923
|
};
|
|
3398
3924
|
}
|
|
3399
|
-
function
|
|
3925
|
+
function Ms({ attachments: e, accept: t, maxFiles: n, disabled: r = !1, isLoading: i = !1, onAttachmentsChange: o }) {
|
|
3400
3926
|
let { t: s } = a(), [c, l] = L(null), u = r || i, d = n == null || e.length < n;
|
|
3401
3927
|
function f(r) {
|
|
3402
3928
|
if (!r.length || u) return;
|
|
3403
|
-
let { files: i, error: a } =
|
|
3929
|
+
let { files: i, error: a } = js(r, e, {
|
|
3404
3930
|
accept: t,
|
|
3405
3931
|
maxFiles: n
|
|
3406
3932
|
});
|
|
@@ -3416,17 +3942,17 @@ function po({ attachments: e, accept: t, maxFiles: n, disabled: r = !1, isLoadin
|
|
|
3416
3942
|
}
|
|
3417
3943
|
//#endregion
|
|
3418
3944
|
//#region lib/components/ui/widgets/chat/use-chat-composer.ts
|
|
3419
|
-
function
|
|
3945
|
+
function Ns(e, t) {
|
|
3420
3946
|
return e.key !== "Enter" || e.nativeEvent.isComposing ? !1 : t ? !e.shiftKey : e.ctrlKey || e.metaKey;
|
|
3421
3947
|
}
|
|
3422
|
-
function
|
|
3948
|
+
function Ps({ value: e, onSend: t, placeholder: n, disabled: r, isLoading: i, sendLabel: o, stopLabel: s, attachments: c, onAttachmentsChange: l, accept: u, maxFiles: d, attachmentLabel: f, sendOnEnter: p = !0 }) {
|
|
3423
3949
|
let { t: m } = a(), h = I(null), g = I(null), _ = {
|
|
3424
3950
|
attach: f ?? m("material.chat.attach", "Add attachment"),
|
|
3425
3951
|
placeholder: n ?? m("material.chat.placeholder", "Type a message…"),
|
|
3426
3952
|
send: o ?? m("material.chat.send", "Send"),
|
|
3427
3953
|
stop: s ?? m("material.chat.composer.stop", "Stop generating"),
|
|
3428
3954
|
message: m("material.chat.message", "Message")
|
|
3429
|
-
}, { errorMessage: v, canAttachMore: y, hasAttachments: b, handleFiles: x, isDisabled: S } =
|
|
3955
|
+
}, { errorMessage: v, canAttachMore: y, hasAttachments: b, handleFiles: x, isDisabled: S } = Ms({
|
|
3430
3956
|
attachments: c,
|
|
3431
3957
|
accept: u,
|
|
3432
3958
|
maxFiles: d,
|
|
@@ -3448,7 +3974,7 @@ function ho({ value: e, onSend: t, placeholder: n, disabled: r, isLoading: i, se
|
|
|
3448
3974
|
isDisabled: S,
|
|
3449
3975
|
isEmpty: C,
|
|
3450
3976
|
handleKeyDown(e) {
|
|
3451
|
-
|
|
3977
|
+
Ns(e, p) && (e.preventDefault(), w());
|
|
3452
3978
|
},
|
|
3453
3979
|
formProps: {
|
|
3454
3980
|
onSubmit(e) {
|
|
@@ -3465,8 +3991,8 @@ function ho({ value: e, onSend: t, placeholder: n, disabled: r, isLoading: i, se
|
|
|
3465
3991
|
}
|
|
3466
3992
|
//#endregion
|
|
3467
3993
|
//#region lib/components/ui/widgets/chat/chat-composer.tsx
|
|
3468
|
-
function
|
|
3469
|
-
let O =
|
|
3994
|
+
function Fs({ value: e = "", onValueChange: t, onSend: n, placeholder: r, disabled: i = !1, disabledReason: a, isLoading: o = !1, sendLabel: s, maxLength: c, attachments: l = [], onAttachmentsChange: u, accept: d, maxFiles: f, attachmentLabel: p, actions: m, emojis: h, mentions: g, mentionSearch: _, variant: v = "bar", suggestions: y, onSuggestionSelect: b, replyTo: x, onCancelReply: S, onStop: C, stopLabel: w, sendOnEnter: T = !0, className: E, ...D }) {
|
|
3995
|
+
let O = Ps({
|
|
3470
3996
|
value: e,
|
|
3471
3997
|
onSend: n,
|
|
3472
3998
|
placeholder: r,
|
|
@@ -3485,9 +4011,9 @@ function go({ value: e = "", onValueChange: t, onSend: n, placeholder: r, disabl
|
|
|
3485
4011
|
"data-slot": "chat-composer",
|
|
3486
4012
|
"data-variant": v,
|
|
3487
4013
|
...O.formProps,
|
|
3488
|
-
className: A(
|
|
4014
|
+
className: A(Ds(v === "floating"), E),
|
|
3489
4015
|
...D,
|
|
3490
|
-
children: /* @__PURE__ */ z(
|
|
4016
|
+
children: /* @__PURE__ */ z(Es, {
|
|
3491
4017
|
composer: O,
|
|
3492
4018
|
floating: v === "floating",
|
|
3493
4019
|
value: e,
|
|
@@ -3514,12 +4040,12 @@ function go({ value: e = "", onValueChange: t, onSend: n, placeholder: r, disabl
|
|
|
3514
4040
|
}
|
|
3515
4041
|
//#endregion
|
|
3516
4042
|
//#region lib/components/ui/widgets/chat/chat-layout-context.ts
|
|
3517
|
-
var
|
|
4043
|
+
var Is = ct({
|
|
3518
4044
|
layout: "bubbles",
|
|
3519
4045
|
density: "comfortable"
|
|
3520
4046
|
});
|
|
3521
|
-
function
|
|
3522
|
-
let t =
|
|
4047
|
+
function Ls(e) {
|
|
4048
|
+
let t = dt(Is);
|
|
3523
4049
|
return {
|
|
3524
4050
|
layout: e.layout ?? t.layout,
|
|
3525
4051
|
density: e.density ?? t.density
|
|
@@ -3527,7 +4053,7 @@ function vo(e) {
|
|
|
3527
4053
|
}
|
|
3528
4054
|
//#endregion
|
|
3529
4055
|
//#region lib/components/ui/widgets/chat/chat-message.variants.ts
|
|
3530
|
-
var
|
|
4056
|
+
var Rs = u("relative w-max max-w-full break-words [overflow-wrap:anywhere]", {
|
|
3531
4057
|
variants: {
|
|
3532
4058
|
variant: {
|
|
3533
4059
|
user: "ms-auto bg-primary text-primary-foreground shadow-sm",
|
|
@@ -3593,7 +4119,7 @@ var yo = u("relative w-max max-w-full break-words [overflow-wrap:anywhere]", {
|
|
|
3593
4119
|
layout: "bubbles",
|
|
3594
4120
|
density: "comfortable"
|
|
3595
4121
|
}
|
|
3596
|
-
}),
|
|
4122
|
+
}), zs = {
|
|
3597
4123
|
end: {
|
|
3598
4124
|
single: "rounded-ee-md",
|
|
3599
4125
|
first: "rounded-ee-md",
|
|
@@ -3607,10 +4133,10 @@ var yo = u("relative w-max max-w-full break-words [overflow-wrap:anywhere]", {
|
|
|
3607
4133
|
last: "rounded-ss-md rounded-es-md"
|
|
3608
4134
|
}
|
|
3609
4135
|
};
|
|
3610
|
-
function
|
|
3611
|
-
return t === "bubbles" ? e === "user" ?
|
|
4136
|
+
function Bs(e, t, n) {
|
|
4137
|
+
return t === "bubbles" ? e === "user" ? zs.end[n] : e === "assistant" ? zs.start[n] : "" : "";
|
|
3612
4138
|
}
|
|
3613
|
-
var
|
|
4139
|
+
var Vs = u("group/message flex w-full animate-in fade-in slide-in-from-bottom-2 duration-(--nxgt-motion-effects-slow-duration) ease-(--nxgt-motion-emphasized-decelerate) motion-reduce:animate-none", {
|
|
3614
4140
|
variants: {
|
|
3615
4141
|
variant: {
|
|
3616
4142
|
user: "",
|
|
@@ -3659,22 +4185,22 @@ var So = u("group/message flex w-full animate-in fade-in slide-in-from-bottom-2
|
|
|
3659
4185
|
density: "comfortable"
|
|
3660
4186
|
}
|
|
3661
4187
|
});
|
|
3662
|
-
function
|
|
4188
|
+
function Hs(e, t) {
|
|
3663
4189
|
return e !== "middle" && e !== "last" ? "" : t === "compact" ? "-mt-1.5" : "-mt-3";
|
|
3664
4190
|
}
|
|
3665
|
-
function
|
|
4191
|
+
function Us(e, t) {
|
|
3666
4192
|
return t === "flat" ? e === "compact" ? "size-7" : "size-9" : e === "compact" ? "size-6" : "size-8";
|
|
3667
4193
|
}
|
|
3668
4194
|
//#endregion
|
|
3669
4195
|
//#region lib/components/ui/widgets/chat/chat-copy-text.ts
|
|
3670
|
-
function
|
|
4196
|
+
function Ws(e, t) {
|
|
3671
4197
|
if (t) return t;
|
|
3672
4198
|
if (typeof e == "string") return e;
|
|
3673
4199
|
if (N(e) && typeof e.props.content == "string") return e.props.content;
|
|
3674
4200
|
}
|
|
3675
4201
|
//#endregion
|
|
3676
4202
|
//#region lib/components/ui/widgets/chat/chat-message.view.ts
|
|
3677
|
-
var
|
|
4203
|
+
var Gs = [
|
|
3678
4204
|
"variant",
|
|
3679
4205
|
"avatar",
|
|
3680
4206
|
"avatarFallback",
|
|
@@ -3701,10 +4227,10 @@ var Eo = [
|
|
|
3701
4227
|
"onReactionToggle",
|
|
3702
4228
|
"menuItems"
|
|
3703
4229
|
];
|
|
3704
|
-
function
|
|
4230
|
+
function Ks(e) {
|
|
3705
4231
|
let t = {}, n = {};
|
|
3706
4232
|
for (let [r, i] of Object.entries(e)) {
|
|
3707
|
-
let e =
|
|
4233
|
+
let e = Gs.includes(r);
|
|
3708
4234
|
(e ? t : n)[r] = i;
|
|
3709
4235
|
}
|
|
3710
4236
|
return {
|
|
@@ -3712,7 +4238,7 @@ function Do(e) {
|
|
|
3712
4238
|
dom: n
|
|
3713
4239
|
};
|
|
3714
4240
|
}
|
|
3715
|
-
function
|
|
4241
|
+
function qs(e, { layout: t, density: n }) {
|
|
3716
4242
|
let { variant: r = "assistant", groupPosition: i = "single", status: a = "sent", isLoading: o = !1, copyable: s = !0, edited: c = !1 } = e, l = t === "flat", u = r === "user", d = i === "single" || i === "first", f = i === "single" || i === "last", p = a === "failed", m = !l && (f || p) ? e.timestamp : void 0;
|
|
3717
4243
|
return {
|
|
3718
4244
|
variant: r,
|
|
@@ -3730,17 +4256,17 @@ function Oo(e, { layout: t, density: n }) {
|
|
|
3730
4256
|
edited: c,
|
|
3731
4257
|
alignEnd: u && !l,
|
|
3732
4258
|
hasAvatar: r === "assistant" || r === "tool" || l && u,
|
|
3733
|
-
copyText: s && !o && a !== "sending" ?
|
|
4259
|
+
copyText: s && !o && a !== "sending" ? Ws(e.children, e.copyText) : void 0,
|
|
3734
4260
|
hasMeta: !!m || p || c || u && a !== "sent"
|
|
3735
4261
|
};
|
|
3736
4262
|
}
|
|
3737
4263
|
//#endregion
|
|
3738
4264
|
//#region lib/components/ui/widgets/chat/partials/chat-message-aside.tsx
|
|
3739
|
-
function
|
|
4265
|
+
function Js({ showAvatar: e, avatar: t, avatarSrc: n, avatarFallback: r, size: i, hoverTime: a, className: o }) {
|
|
3740
4266
|
return /* @__PURE__ */ B("div", {
|
|
3741
4267
|
"data-slot": "chat-message-aside",
|
|
3742
4268
|
className: A("flex shrink-0 justify-center", i, o),
|
|
3743
|
-
children: [e && (t ?? /* @__PURE__ */ z(
|
|
4269
|
+
children: [e && (t ?? /* @__PURE__ */ z(Fe, {
|
|
3744
4270
|
src: n,
|
|
3745
4271
|
fallback: r ?? "?",
|
|
3746
4272
|
className: A(i, "text-xs")
|
|
@@ -3752,24 +4278,24 @@ function ko({ showAvatar: e, avatar: t, avatarSrc: n, avatarFallback: r, size: i
|
|
|
3752
4278
|
}
|
|
3753
4279
|
//#endregion
|
|
3754
4280
|
//#region lib/components/ui/widgets/chat/chat-message-meta.tsx
|
|
3755
|
-
function
|
|
4281
|
+
function Ys({ status: e }) {
|
|
3756
4282
|
let { t } = a();
|
|
3757
|
-
return e === "sending" ? /* @__PURE__ */ z(
|
|
4283
|
+
return e === "sending" ? /* @__PURE__ */ z(Tt, {
|
|
3758
4284
|
role: "img",
|
|
3759
4285
|
"aria-label": t("material.chat.status.sending", "Sending"),
|
|
3760
4286
|
className: "size-3"
|
|
3761
|
-
}) : e === "delivered" ? /* @__PURE__ */ z(
|
|
4287
|
+
}) : e === "delivered" ? /* @__PURE__ */ z(St, {
|
|
3762
4288
|
role: "img",
|
|
3763
4289
|
"aria-label": t("material.chat.status.delivered", "Delivered"),
|
|
3764
4290
|
className: "size-3.5"
|
|
3765
|
-
}) : e === "read" ? /* @__PURE__ */ z(
|
|
4291
|
+
}) : e === "read" ? /* @__PURE__ */ z(St, {
|
|
3766
4292
|
role: "img",
|
|
3767
4293
|
"aria-label": t("material.chat.status.read", "Read"),
|
|
3768
4294
|
className: "size-3.5 text-primary-text"
|
|
3769
4295
|
}) : null;
|
|
3770
4296
|
}
|
|
3771
|
-
function
|
|
3772
|
-
let { t: l } = a(), u = l("material.chat.send-failed", "Couldn't send"), d = l("material.chat.retry", "Retry"), f = o && !n && i !== "sent" ? /* @__PURE__ */ z(
|
|
4297
|
+
function Xs({ alignEnd: e, timestamp: t, failed: n, onRetry: r, status: i = "sent", showStatus: o = !1, edited: s = !1, className: c }) {
|
|
4298
|
+
let { t: l } = a(), u = l("material.chat.send-failed", "Couldn't send"), d = l("material.chat.retry", "Retry"), f = o && !n && i !== "sent" ? /* @__PURE__ */ z(Ys, { status: i }) : null;
|
|
3773
4299
|
return !k(t) && !n && !f && !s ? null : /* @__PURE__ */ B("div", {
|
|
3774
4300
|
"data-slot": "chat-message-meta",
|
|
3775
4301
|
className: A("flex items-center gap-1 px-1 text-[0.6875rem] text-muted-foreground leading-4 tabular-nums", e && "flex-row-reverse", c),
|
|
@@ -3798,36 +4324,36 @@ function jo({ alignEnd: e, timestamp: t, failed: n, onRetry: r, status: i = "sen
|
|
|
3798
4324
|
}
|
|
3799
4325
|
//#endregion
|
|
3800
4326
|
//#region lib/components/ui/widgets/chat/chat-reaction-group.tsx
|
|
3801
|
-
var
|
|
4327
|
+
var Zs = [
|
|
3802
4328
|
"👍",
|
|
3803
4329
|
"❤️",
|
|
3804
4330
|
"😂",
|
|
3805
4331
|
"🎉",
|
|
3806
4332
|
"👀"
|
|
3807
4333
|
];
|
|
3808
|
-
function
|
|
4334
|
+
function Qs({ reactions: e, onReactionToggle: t, onAddReaction: n, suggestions: r = Zs, addLabel: i, className: o, ...s }) {
|
|
3809
4335
|
let { t: c } = a(), l = i ?? c("material.chat.add-reaction", "Add reaction");
|
|
3810
4336
|
return /* @__PURE__ */ B("div", {
|
|
3811
4337
|
"data-slot": "chat-reaction-group",
|
|
3812
4338
|
className: A("flex flex-wrap items-center gap-1", o),
|
|
3813
4339
|
...s,
|
|
3814
|
-
children: [e.map((e) => /* @__PURE__ */ z(
|
|
4340
|
+
children: [e.map((e) => /* @__PURE__ */ z(Jo, {
|
|
3815
4341
|
label: `${e.emoji}${e.count ? ` ${e.count}` : ""}`,
|
|
3816
4342
|
active: e.active,
|
|
3817
4343
|
size: "sm",
|
|
3818
4344
|
onClick: () => t?.(e.emoji)
|
|
3819
|
-
}, e.emoji)), n && r.length > 0 && /* @__PURE__ */ B(
|
|
4345
|
+
}, e.emoji)), n && r.length > 0 && /* @__PURE__ */ B(Se, { children: [/* @__PURE__ */ z(Ce, {
|
|
3820
4346
|
asChild: !0,
|
|
3821
4347
|
children: /* @__PURE__ */ z(x, {
|
|
3822
4348
|
variant: "ghost",
|
|
3823
4349
|
color: "default",
|
|
3824
4350
|
"aria-label": l,
|
|
3825
4351
|
className: "size-7",
|
|
3826
|
-
children: /* @__PURE__ */ z(
|
|
4352
|
+
children: /* @__PURE__ */ z(Kt, { className: "size-4" })
|
|
3827
4353
|
})
|
|
3828
|
-
}), /* @__PURE__ */ z(
|
|
4354
|
+
}), /* @__PURE__ */ z(_e, {
|
|
3829
4355
|
align: "start",
|
|
3830
|
-
children: r.map((e) => /* @__PURE__ */ z(
|
|
4356
|
+
children: r.map((e) => /* @__PURE__ */ z(fe, {
|
|
3831
4357
|
onClick: () => n(e),
|
|
3832
4358
|
children: /* @__PURE__ */ z("span", {
|
|
3833
4359
|
className: "text-base",
|
|
@@ -3839,14 +4365,14 @@ function No({ reactions: e, onReactionToggle: t, onAddReaction: n, suggestions:
|
|
|
3839
4365
|
}
|
|
3840
4366
|
//#endregion
|
|
3841
4367
|
//#region lib/components/ui/actions/copy-button/copy-to-clipboard.ts
|
|
3842
|
-
async function
|
|
4368
|
+
async function $s(e) {
|
|
3843
4369
|
if (!navigator.clipboard?.writeText) throw Error("Clipboard is not available");
|
|
3844
4370
|
await navigator.clipboard.writeText(e);
|
|
3845
4371
|
}
|
|
3846
4372
|
//#endregion
|
|
3847
4373
|
//#region lib/components/ui/actions/copy-button/use-copy-status.ts
|
|
3848
|
-
var
|
|
3849
|
-
function
|
|
4374
|
+
var ec = 1500;
|
|
4375
|
+
function tc(e = ec) {
|
|
3850
4376
|
let [t, n] = L("idle"), r = I(void 0), i = I(!1);
|
|
3851
4377
|
P(() => (i.current = !1, () => {
|
|
3852
4378
|
i.current = !0, clearTimeout(r.current);
|
|
@@ -3855,7 +4381,7 @@ function Io(e = Fo) {
|
|
|
3855
4381
|
if (!t) return;
|
|
3856
4382
|
let a = "copied";
|
|
3857
4383
|
try {
|
|
3858
|
-
await
|
|
4384
|
+
await $s(t);
|
|
3859
4385
|
} catch {
|
|
3860
4386
|
a = "failed";
|
|
3861
4387
|
}
|
|
@@ -3868,8 +4394,8 @@ function Io(e = Fo) {
|
|
|
3868
4394
|
}
|
|
3869
4395
|
//#endregion
|
|
3870
4396
|
//#region lib/components/ui/actions/copy-button/copy-button.tsx
|
|
3871
|
-
function
|
|
3872
|
-
let { t: u } = a(), { status: d, copy: f } =
|
|
4397
|
+
function nc({ value: e, label: t, copiedLabel: n, failedLabel: r, icon: i, onCopyResult: o, variant: s = "ghost", color: c = "default", ...l }) {
|
|
4398
|
+
let { t: u } = a(), { status: d, copy: f } = tc(), p = t ?? u("material.copy.copy", "Copy"), m = n ?? u("material.copy.copied", "Copied"), h = r ?? u("material.copy.failed", "Copy failed"), g = d === "copied" ? m : d === "failed" ? h : "";
|
|
3873
4399
|
async function _() {
|
|
3874
4400
|
let t = await f(typeof e == "function" ? e() : e);
|
|
3875
4401
|
t && o?.(t);
|
|
@@ -3881,7 +4407,7 @@ function Lo({ value: e, label: t, copiedLabel: n, failedLabel: r, icon: i, onCop
|
|
|
3881
4407
|
"aria-label": p,
|
|
3882
4408
|
tooltip: g || p,
|
|
3883
4409
|
onClick: _,
|
|
3884
|
-
children: d === "copied" ? /* @__PURE__ */ z(
|
|
4410
|
+
children: d === "copied" ? /* @__PURE__ */ z(xt, {}) : d === "failed" ? /* @__PURE__ */ z(V, {}) : i ?? /* @__PURE__ */ z(Dt, {})
|
|
3885
4411
|
}), /* @__PURE__ */ z("span", {
|
|
3886
4412
|
role: "status",
|
|
3887
4413
|
"aria-live": "polite",
|
|
@@ -3892,51 +4418,51 @@ function Lo({ value: e, label: t, copiedLabel: n, failedLabel: r, icon: i, onCop
|
|
|
3892
4418
|
}
|
|
3893
4419
|
//#endregion
|
|
3894
4420
|
//#region lib/components/ui/widgets/chat/partials/chat-message-action-menus.tsx
|
|
3895
|
-
var
|
|
3896
|
-
function
|
|
4421
|
+
var rc = "size-7 [&_svg]:size-3.5";
|
|
4422
|
+
function ic({ side: e, emojis: t, onReact: n }) {
|
|
3897
4423
|
let { t: r } = a();
|
|
3898
|
-
return /* @__PURE__ */ B(
|
|
4424
|
+
return /* @__PURE__ */ B(Se, { children: [/* @__PURE__ */ z(Ce, {
|
|
3899
4425
|
asChild: !0,
|
|
3900
4426
|
children: /* @__PURE__ */ z(x, {
|
|
3901
4427
|
variant: "ghost",
|
|
3902
4428
|
color: "default",
|
|
3903
4429
|
"aria-label": r("material.chat.actions.react", "React"),
|
|
3904
|
-
className:
|
|
3905
|
-
children: /* @__PURE__ */ z(
|
|
4430
|
+
className: rc,
|
|
4431
|
+
children: /* @__PURE__ */ z(Kt, {})
|
|
3906
4432
|
})
|
|
3907
|
-
}), /* @__PURE__ */ z(
|
|
4433
|
+
}), /* @__PURE__ */ z(_e, {
|
|
3908
4434
|
align: e === "end" ? "end" : "start",
|
|
3909
4435
|
className: "flex min-w-0 gap-0.5 rounded-(--nxgt-shape-corner-full) p-1",
|
|
3910
|
-
children: t.map((e) => /* @__PURE__ */ z(
|
|
4436
|
+
children: t.map((e) => /* @__PURE__ */ z(fe, {
|
|
3911
4437
|
onClick: () => n(e),
|
|
3912
4438
|
className: "rounded-(--nxgt-shape-corner-full) px-1.5 text-lg",
|
|
3913
4439
|
children: e
|
|
3914
4440
|
}, e))
|
|
3915
4441
|
})] });
|
|
3916
4442
|
}
|
|
3917
|
-
function
|
|
4443
|
+
function ac({ side: e, onDelete: t, children: n }) {
|
|
3918
4444
|
let { t: r } = a();
|
|
3919
|
-
return /* @__PURE__ */ B(
|
|
4445
|
+
return /* @__PURE__ */ B(Se, { children: [/* @__PURE__ */ z(Ce, {
|
|
3920
4446
|
asChild: !0,
|
|
3921
4447
|
children: /* @__PURE__ */ z(x, {
|
|
3922
4448
|
variant: "ghost",
|
|
3923
4449
|
color: "default",
|
|
3924
4450
|
"aria-label": r("material.chat.actions.more", "More actions"),
|
|
3925
|
-
className:
|
|
3926
|
-
children: /* @__PURE__ */ z(
|
|
4451
|
+
className: rc,
|
|
4452
|
+
children: /* @__PURE__ */ z(Ot, {})
|
|
3927
4453
|
})
|
|
3928
|
-
}), /* @__PURE__ */ B(
|
|
4454
|
+
}), /* @__PURE__ */ B(_e, {
|
|
3929
4455
|
align: e === "end" ? "end" : "start",
|
|
3930
|
-
children: [n, t && /* @__PURE__ */ B(
|
|
4456
|
+
children: [n, t && /* @__PURE__ */ B(fe, {
|
|
3931
4457
|
variant: "error",
|
|
3932
4458
|
onClick: t,
|
|
3933
|
-
children: [/* @__PURE__ */ z(
|
|
4459
|
+
children: [/* @__PURE__ */ z(Yt, {}), r("material.chat.actions.delete", "Delete")]
|
|
3934
4460
|
})]
|
|
3935
4461
|
})] });
|
|
3936
4462
|
}
|
|
3937
4463
|
//#endregion
|
|
3938
4464
|
//#region lib/components/ui/widgets/chat/partials/chat-message-actions.tsx
|
|
3939
|
-
function
|
|
4465
|
+
function oc({ side: e, copyText: t, onReply: n, onDelete: r, onReact: i, reactionSuggestions: o, menuItems: s }) {
|
|
3940
4466
|
let { t: c } = a(), l = !!(r || s), u = !!(i && o.length > 0);
|
|
3941
4467
|
if (!t && !n && !l && !u) return null;
|
|
3942
4468
|
let d = c("material.chat.actions.reply", "Reply");
|
|
@@ -3946,7 +4472,7 @@ function Vo({ side: e, copyText: t, onReply: n, onDelete: r, onReact: i, reactio
|
|
|
3946
4472
|
"aria-label": c("material.chat.actions.label", "Message actions"),
|
|
3947
4473
|
className: A("absolute -top-4 z-10 flex items-center gap-0.5 rounded-(--nxgt-shape-corner-full) border border-border/70 bg-popover p-0.5 text-popover-foreground shadow-md", "pointer-events-none scale-95 opacity-0 [transition:opacity_var(--nxgt-motion-effects-fast-duration)_var(--nxgt-motion-effects-fast),scale_var(--nxgt-motion-spatial-fast-duration)_var(--nxgt-motion-spatial-fast)] motion-reduce:scale-none", "group-hover/message:pointer-events-auto group-hover/message:scale-100 group-hover/message:opacity-100", "group-focus-within/message:pointer-events-auto group-focus-within/message:scale-100 group-focus-within/message:opacity-100", "has-[[data-state=open]]:pointer-events-auto has-[[data-state=open]]:scale-100 has-[[data-state=open]]:opacity-100", e === "end" && "start-2 @lg:start-auto @lg:top-1 @lg:end-[calc(100%+0.5rem)]", e === "start" && "end-2 @lg:end-auto @lg:top-1 @lg:start-[calc(100%+0.5rem)]", e === "row" && "end-2"),
|
|
3948
4474
|
children: [
|
|
3949
|
-
u && i && /* @__PURE__ */ z(
|
|
4475
|
+
u && i && /* @__PURE__ */ z(ic, {
|
|
3950
4476
|
side: e,
|
|
3951
4477
|
emojis: o,
|
|
3952
4478
|
onReact: i
|
|
@@ -3958,14 +4484,14 @@ function Vo({ side: e, copyText: t, onReply: n, onDelete: r, onReact: i, reactio
|
|
|
3958
4484
|
"aria-label": d,
|
|
3959
4485
|
onClick: n,
|
|
3960
4486
|
className: "size-7 [&_svg]:size-3.5",
|
|
3961
|
-
children: /* @__PURE__ */ z(
|
|
4487
|
+
children: /* @__PURE__ */ z(Ht, {})
|
|
3962
4488
|
}),
|
|
3963
|
-
t && /* @__PURE__ */ z(
|
|
4489
|
+
t && /* @__PURE__ */ z(nc, {
|
|
3964
4490
|
value: t,
|
|
3965
4491
|
label: c("material.chat.copy", "Copy message"),
|
|
3966
4492
|
className: "size-7 [&_svg]:size-3.5"
|
|
3967
4493
|
}),
|
|
3968
|
-
l && /* @__PURE__ */ z(
|
|
4494
|
+
l && /* @__PURE__ */ z(ac, {
|
|
3969
4495
|
side: e,
|
|
3970
4496
|
onDelete: r,
|
|
3971
4497
|
children: s
|
|
@@ -3975,28 +4501,28 @@ function Vo({ side: e, copyText: t, onReply: n, onDelete: r, onReact: i, reactio
|
|
|
3975
4501
|
}
|
|
3976
4502
|
//#endregion
|
|
3977
4503
|
//#region lib/components/ui/widgets/chat/partials/chat-message-bubble.tsx
|
|
3978
|
-
function
|
|
3979
|
-
let u = A(
|
|
4504
|
+
function sc({ variant: e, layout: t, density: n, position: r, isLoading: i, isStreaming: a, status: o, replyTo: s, actions: c, children: l }) {
|
|
4505
|
+
let u = A(Rs({
|
|
3980
4506
|
variant: e,
|
|
3981
4507
|
layout: t,
|
|
3982
4508
|
density: n
|
|
3983
|
-
}),
|
|
4509
|
+
}), Bs(e, t, r));
|
|
3984
4510
|
if (i) return /* @__PURE__ */ z("div", {
|
|
3985
4511
|
className: A(u, "flex items-center gap-1"),
|
|
3986
|
-
children: /* @__PURE__ */ z(
|
|
4512
|
+
children: /* @__PURE__ */ z(Ne, { className: "h-3 w-24" })
|
|
3987
4513
|
});
|
|
3988
4514
|
let d = e === "user" && t === "bubbles";
|
|
3989
4515
|
return /* @__PURE__ */ B("div", {
|
|
3990
4516
|
"data-slot": "chat-message-bubble-wrap",
|
|
3991
4517
|
tabIndex: -1,
|
|
3992
4518
|
className: A("group/bubble relative max-w-full outline-none", t === "flat" && "w-full", o === "sending" && "opacity-70"),
|
|
3993
|
-
children: [/* @__PURE__ */ z(
|
|
4519
|
+
children: [/* @__PURE__ */ z(oc, {
|
|
3994
4520
|
side: t === "flat" ? "row" : e === "user" ? "end" : "start",
|
|
3995
4521
|
...c
|
|
3996
4522
|
}), /* @__PURE__ */ B("div", {
|
|
3997
4523
|
"data-slot": "chat-message-bubble",
|
|
3998
4524
|
className: A(u, o === "failed" && "ring-2 ring-error/70", s && t === "bubbles" && "flex flex-col gap-1.5"),
|
|
3999
|
-
children: [s && /* @__PURE__ */ z(
|
|
4525
|
+
children: [s && /* @__PURE__ */ z(ws, {
|
|
4000
4526
|
...s,
|
|
4001
4527
|
tone: d ? "inverted" : "default",
|
|
4002
4528
|
className: A(t === "bubbles" ? "-mx-1 mt-0.5 w-auto" : "max-w-md")
|
|
@@ -4012,7 +4538,7 @@ function Ho({ variant: e, layout: t, density: n, position: r, isLoading: i, isSt
|
|
|
4012
4538
|
}
|
|
4013
4539
|
//#endregion
|
|
4014
4540
|
//#region lib/components/ui/widgets/chat/partials/chat-message-heading.tsx
|
|
4015
|
-
function
|
|
4541
|
+
function cc({ author: e, timestamp: t }) {
|
|
4016
4542
|
return e == null && t == null ? null : /* @__PURE__ */ B("div", {
|
|
4017
4543
|
"data-slot": "chat-message-heading",
|
|
4018
4544
|
className: "flex min-w-0 items-baseline gap-2 px-1 text-xs",
|
|
@@ -4027,7 +4553,7 @@ function Uo({ author: e, timestamp: t }) {
|
|
|
4027
4553
|
}
|
|
4028
4554
|
//#endregion
|
|
4029
4555
|
//#region lib/components/ui/widgets/chat/partials/chat-message-body.tsx
|
|
4030
|
-
var
|
|
4556
|
+
var lc = [
|
|
4031
4557
|
"👍",
|
|
4032
4558
|
"❤️",
|
|
4033
4559
|
"😂",
|
|
@@ -4035,12 +4561,12 @@ var Wo = [
|
|
|
4035
4561
|
"😮",
|
|
4036
4562
|
"🙏"
|
|
4037
4563
|
];
|
|
4038
|
-
function
|
|
4564
|
+
function uc({ content: e, view: t }) {
|
|
4039
4565
|
let { variant: n, alignEnd: r, flat: i, lead: a, isUser: o } = t;
|
|
4040
4566
|
return /* @__PURE__ */ B("div", {
|
|
4041
4567
|
className: A("flex min-w-0 flex-col gap-1", i ? "flex-1" : "max-w-[85%] @md:max-w-[75%]", r && "items-end", n === "system" && "w-full max-w-full items-center"),
|
|
4042
4568
|
children: [
|
|
4043
|
-
/* @__PURE__ */ z(
|
|
4569
|
+
/* @__PURE__ */ z(cc, {
|
|
4044
4570
|
author: a && (!o || i) ? e.author : void 0,
|
|
4045
4571
|
timestamp: i && a ? e.timestamp : void 0
|
|
4046
4572
|
}),
|
|
@@ -4049,7 +4575,7 @@ function Go({ content: e, view: t }) {
|
|
|
4049
4575
|
className: "mb-0.5 self-start rounded-full bg-secondary px-2 py-0.5 text-[10px] font-medium text-secondary-foreground",
|
|
4050
4576
|
children: e.toolName
|
|
4051
4577
|
}),
|
|
4052
|
-
/* @__PURE__ */ z(
|
|
4578
|
+
/* @__PURE__ */ z(sc, {
|
|
4053
4579
|
variant: n,
|
|
4054
4580
|
layout: t.layout,
|
|
4055
4581
|
density: t.density,
|
|
@@ -4063,17 +4589,17 @@ function Go({ content: e, view: t }) {
|
|
|
4063
4589
|
onReply: e.onReply,
|
|
4064
4590
|
onDelete: e.onDelete,
|
|
4065
4591
|
onReact: e.onReact,
|
|
4066
|
-
reactionSuggestions: e.reactionSuggestions ??
|
|
4592
|
+
reactionSuggestions: e.reactionSuggestions ?? lc,
|
|
4067
4593
|
menuItems: e.menuItems
|
|
4068
4594
|
},
|
|
4069
4595
|
children: e.children
|
|
4070
4596
|
}),
|
|
4071
|
-
e.reactions && e.reactions.length > 0 && /* @__PURE__ */ z(
|
|
4597
|
+
e.reactions && e.reactions.length > 0 && /* @__PURE__ */ z(Qs, {
|
|
4072
4598
|
reactions: e.reactions,
|
|
4073
4599
|
onReactionToggle: e.onReactionToggle,
|
|
4074
4600
|
className: A("px-1", r && "justify-end")
|
|
4075
4601
|
}),
|
|
4076
|
-
/* @__PURE__ */ z(
|
|
4602
|
+
/* @__PURE__ */ z(Xs, {
|
|
4077
4603
|
alignEnd: r,
|
|
4078
4604
|
timestamp: t.metaTime,
|
|
4079
4605
|
failed: t.failed,
|
|
@@ -4092,8 +4618,8 @@ function Go({ content: e, view: t }) {
|
|
|
4092
4618
|
}
|
|
4093
4619
|
//#endregion
|
|
4094
4620
|
//#region lib/components/ui/widgets/chat/chat-message.tsx
|
|
4095
|
-
function
|
|
4096
|
-
let { content: a, dom: o } =
|
|
4621
|
+
function dc({ layout: e, density: t, className: n, text: r, ...i }) {
|
|
4622
|
+
let { content: a, dom: o } = Ks(r === void 0 ? i : {
|
|
4097
4623
|
...i,
|
|
4098
4624
|
copyText: i.copyText ?? r,
|
|
4099
4625
|
children: /* @__PURE__ */ z("span", {
|
|
@@ -4101,10 +4627,10 @@ function Ko({ layout: e, density: t, className: n, text: r, ...i }) {
|
|
|
4101
4627
|
className: "whitespace-pre-wrap [overflow-wrap:anywhere]",
|
|
4102
4628
|
children: r
|
|
4103
4629
|
})
|
|
4104
|
-
}), { layout: s, density: c } =
|
|
4630
|
+
}), { layout: s, density: c } = Ls({
|
|
4105
4631
|
layout: e,
|
|
4106
4632
|
density: t
|
|
4107
|
-
}), l =
|
|
4633
|
+
}), l = qs(a, {
|
|
4108
4634
|
layout: s,
|
|
4109
4635
|
density: c
|
|
4110
4636
|
}), { variant: u, groupPosition: d, flat: f, lead: p, tail: m } = l;
|
|
@@ -4113,21 +4639,21 @@ function Ko({ layout: e, density: t, className: n, text: r, ...i }) {
|
|
|
4113
4639
|
"data-variant": u,
|
|
4114
4640
|
"data-layout": s,
|
|
4115
4641
|
"data-group": d,
|
|
4116
|
-
className: A(
|
|
4642
|
+
className: A(Vs({
|
|
4117
4643
|
variant: u,
|
|
4118
4644
|
layout: s,
|
|
4119
4645
|
density: c
|
|
4120
|
-
}),
|
|
4646
|
+
}), Hs(d, c), n),
|
|
4121
4647
|
...o,
|
|
4122
|
-
children: [l.hasAvatar && /* @__PURE__ */ z(
|
|
4648
|
+
children: [l.hasAvatar && /* @__PURE__ */ z(Js, {
|
|
4123
4649
|
showAvatar: f ? p : m,
|
|
4124
4650
|
avatar: a.avatar,
|
|
4125
4651
|
avatarSrc: a.avatarSrc,
|
|
4126
4652
|
avatarFallback: a.avatarFallback,
|
|
4127
|
-
size:
|
|
4653
|
+
size: Us(c, s),
|
|
4128
4654
|
className: A(!f && l.hasMeta && "mb-5"),
|
|
4129
4655
|
hoverTime: f && !p ? a.timestamp : void 0
|
|
4130
|
-
}), /* @__PURE__ */ z(
|
|
4656
|
+
}), /* @__PURE__ */ z(uc, {
|
|
4131
4657
|
content: a,
|
|
4132
4658
|
view: l
|
|
4133
4659
|
})]
|
|
@@ -4135,32 +4661,32 @@ function Ko({ layout: e, density: t, className: n, text: r, ...i }) {
|
|
|
4135
4661
|
}
|
|
4136
4662
|
//#endregion
|
|
4137
4663
|
//#region lib/components/ui/primitives/scroll-area/scroll-area.tsx
|
|
4138
|
-
function
|
|
4139
|
-
let i =
|
|
4140
|
-
return /* @__PURE__ */ B(
|
|
4664
|
+
function fc({ className: e, children: t, viewportProps: n, ...r }) {
|
|
4665
|
+
let i = Ya();
|
|
4666
|
+
return /* @__PURE__ */ B(kr, {
|
|
4141
4667
|
"data-slot": "scroll-area",
|
|
4142
4668
|
className: A("relative", e),
|
|
4143
4669
|
...r,
|
|
4144
4670
|
children: [
|
|
4145
|
-
/* @__PURE__ */ z(
|
|
4671
|
+
/* @__PURE__ */ z(Ar, {
|
|
4146
4672
|
...n,
|
|
4147
4673
|
"data-slot": "scroll-area-viewport",
|
|
4148
4674
|
nonce: i,
|
|
4149
4675
|
className: A("focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", n?.className),
|
|
4150
4676
|
children: t
|
|
4151
4677
|
}),
|
|
4152
|
-
/* @__PURE__ */ z(
|
|
4153
|
-
/* @__PURE__ */ z(
|
|
4678
|
+
/* @__PURE__ */ z(pc, {}),
|
|
4679
|
+
/* @__PURE__ */ z(jr, {})
|
|
4154
4680
|
]
|
|
4155
4681
|
});
|
|
4156
4682
|
}
|
|
4157
|
-
function
|
|
4158
|
-
return /* @__PURE__ */ z(
|
|
4683
|
+
function pc({ className: e, orientation: t = "vertical", ...n }) {
|
|
4684
|
+
return /* @__PURE__ */ z(or, {
|
|
4159
4685
|
"data-slot": "scroll-area-scrollbar",
|
|
4160
4686
|
orientation: t,
|
|
4161
4687
|
className: A("flex touch-none p-px transition-colors select-none", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
|
|
4162
4688
|
...n,
|
|
4163
|
-
children: /* @__PURE__ */ z(
|
|
4689
|
+
children: /* @__PURE__ */ z(_r, {
|
|
4164
4690
|
"data-slot": "scroll-area-thumb",
|
|
4165
4691
|
className: "bg-border relative flex-1 rounded-full"
|
|
4166
4692
|
})
|
|
@@ -4168,22 +4694,22 @@ function Jo({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
4168
4694
|
}
|
|
4169
4695
|
//#endregion
|
|
4170
4696
|
//#region lib/components/ui/widgets/chat/partials/chat-empty-thread.tsx
|
|
4171
|
-
function
|
|
4697
|
+
function mc() {
|
|
4172
4698
|
let { t: e } = a();
|
|
4173
|
-
return /* @__PURE__ */ z(
|
|
4699
|
+
return /* @__PURE__ */ z(Oi, {
|
|
4174
4700
|
kind: "empty",
|
|
4175
4701
|
size: "compact",
|
|
4176
|
-
icon: /* @__PURE__ */ z(
|
|
4702
|
+
icon: /* @__PURE__ */ z(zt, {}),
|
|
4177
4703
|
title: e("material.chat.empty", "No messages yet"),
|
|
4178
4704
|
description: e("material.chat.empty-description", "Send a message to start the conversation.")
|
|
4179
4705
|
});
|
|
4180
4706
|
}
|
|
4181
4707
|
//#endregion
|
|
4182
4708
|
//#region lib/components/ui/actions/scroll-to-latest-button/scroll-to-latest-button.tsx
|
|
4183
|
-
function
|
|
4709
|
+
function hc({ visible: e = !0, count: t = 0, label: n, direction: r = "down", className: i, type: o = "button", ...s }) {
|
|
4184
4710
|
let { t: c } = a();
|
|
4185
4711
|
if (!e) return null;
|
|
4186
|
-
let l = n ?? c("material.scroll-to-latest.label", "Scroll to latest"), u = r === "up" ?
|
|
4712
|
+
let l = n ?? c("material.scroll-to-latest.label", "Scroll to latest"), u = r === "up" ? bt : yt, d = t > 0, f = c("material.scroll-to-latest.new", "{count, plural, one {# new message} other {# new messages}}", { count: t });
|
|
4187
4713
|
return /* @__PURE__ */ B("button", {
|
|
4188
4714
|
type: o,
|
|
4189
4715
|
"data-slot": "scroll-to-latest-button",
|
|
@@ -4206,11 +4732,11 @@ function Xo({ visible: e = !0, count: t = 0, label: n, direction: r = "down", cl
|
|
|
4206
4732
|
}
|
|
4207
4733
|
//#endregion
|
|
4208
4734
|
//#region lib/components/ui/widgets/chat/partials/chat-scroll-to-latest.tsx
|
|
4209
|
-
function
|
|
4735
|
+
function gc({ visible: e, count: t, label: n, onClick: r }) {
|
|
4210
4736
|
let { t: i } = a();
|
|
4211
4737
|
return /* @__PURE__ */ z("div", {
|
|
4212
4738
|
className: "pointer-events-none absolute inset-x-0 bottom-3 flex justify-center",
|
|
4213
|
-
children: /* @__PURE__ */ z(
|
|
4739
|
+
children: /* @__PURE__ */ z(hc, {
|
|
4214
4740
|
visible: e,
|
|
4215
4741
|
count: t,
|
|
4216
4742
|
label: n ?? i("material.chat.scroll-to-latest", "Scroll to latest"),
|
|
@@ -4221,7 +4747,7 @@ function Zo({ visible: e, count: t, label: n, onClick: r }) {
|
|
|
4221
4747
|
}
|
|
4222
4748
|
//#endregion
|
|
4223
4749
|
//#region lib/components/ui/feedback/typing-indicator/typing-indicator.tsx
|
|
4224
|
-
var
|
|
4750
|
+
var _c = u("nxgt-typing inline-flex w-max items-center text-muted-foreground", {
|
|
4225
4751
|
variants: {
|
|
4226
4752
|
variant: {
|
|
4227
4753
|
dots: "px-1 py-1",
|
|
@@ -4237,14 +4763,14 @@ var Qo = u("nxgt-typing inline-flex w-max items-center text-muted-foreground", {
|
|
|
4237
4763
|
size: "md"
|
|
4238
4764
|
}
|
|
4239
4765
|
});
|
|
4240
|
-
function
|
|
4766
|
+
function vc({ label: e, variant: t, size: n, className: r, ...i }) {
|
|
4241
4767
|
let { t: o } = a(), s = e ?? o("material.typing-indicator.label", "Typing");
|
|
4242
4768
|
return /* @__PURE__ */ z("div", {
|
|
4243
4769
|
"data-slot": "typing-indicator",
|
|
4244
4770
|
"data-variant": t ?? "dots",
|
|
4245
4771
|
role: "status",
|
|
4246
4772
|
"aria-label": s,
|
|
4247
|
-
className: A(
|
|
4773
|
+
className: A(_c({
|
|
4248
4774
|
variant: t,
|
|
4249
4775
|
size: n
|
|
4250
4776
|
}), r),
|
|
@@ -4261,9 +4787,9 @@ function $o({ label: e, variant: t, size: n, className: r, ...i }) {
|
|
|
4261
4787
|
}
|
|
4262
4788
|
//#endregion
|
|
4263
4789
|
//#region lib/components/ui/widgets/chat/chat-typing-indicator.tsx
|
|
4264
|
-
function
|
|
4790
|
+
function yc({ label: e, ...t }) {
|
|
4265
4791
|
let { t: n } = a();
|
|
4266
|
-
return /* @__PURE__ */ z(
|
|
4792
|
+
return /* @__PURE__ */ z(vc, {
|
|
4267
4793
|
"data-slot": "chat-typing-indicator",
|
|
4268
4794
|
label: e ?? n("material.chat.typing", "Typing"),
|
|
4269
4795
|
...t
|
|
@@ -4271,13 +4797,13 @@ function es({ label: e, ...t }) {
|
|
|
4271
4797
|
}
|
|
4272
4798
|
//#endregion
|
|
4273
4799
|
//#region lib/components/ui/widgets/chat/partials/chat-typing-row.tsx
|
|
4274
|
-
function
|
|
4800
|
+
function bc({ density: e, layout: t, avatar: n, label: r }) {
|
|
4275
4801
|
return /* @__PURE__ */ B("div", {
|
|
4276
4802
|
className: "flex animate-in items-end gap-2 fade-in slide-in-from-bottom-2 duration-(--nxgt-motion-effects-slow-duration) ease-(--nxgt-motion-emphasized-decelerate) motion-reduce:animate-none",
|
|
4277
4803
|
children: [/* @__PURE__ */ z("div", {
|
|
4278
|
-
className: A("shrink-0",
|
|
4804
|
+
className: A("shrink-0", Us(e, t)),
|
|
4279
4805
|
children: n
|
|
4280
|
-
}), /* @__PURE__ */ z(
|
|
4806
|
+
}), /* @__PURE__ */ z(yc, {
|
|
4281
4807
|
variant: "bubble",
|
|
4282
4808
|
label: r
|
|
4283
4809
|
})]
|
|
@@ -4285,32 +4811,32 @@ function ts({ density: e, layout: t, avatar: n, label: r }) {
|
|
|
4285
4811
|
}
|
|
4286
4812
|
//#endregion
|
|
4287
4813
|
//#region lib/components/ui/widgets/chat/chat-unseen.ts
|
|
4288
|
-
function
|
|
4814
|
+
function xc(e, t, n, r) {
|
|
4289
4815
|
if (r) return 0;
|
|
4290
4816
|
let i = n - t;
|
|
4291
4817
|
return i > 0 ? e + i : e;
|
|
4292
4818
|
}
|
|
4293
4819
|
//#endregion
|
|
4294
4820
|
//#region lib/components/ui/widgets/chat/use-chat-scroll.ts
|
|
4295
|
-
function
|
|
4821
|
+
function Sc(e) {
|
|
4296
4822
|
return e?.querySelector("[data-slot=\"scroll-area-viewport\"]");
|
|
4297
4823
|
}
|
|
4298
|
-
function
|
|
4824
|
+
function Cc(e) {
|
|
4299
4825
|
return e.scrollHeight - e.scrollTop - e.clientHeight;
|
|
4300
4826
|
}
|
|
4301
|
-
function
|
|
4302
|
-
let n = I(null), r = I(null), i = I(!0), a = I(e), [o, s] = L(!0), [c, l] = L(0), u =
|
|
4303
|
-
let t =
|
|
4827
|
+
function wc(e, t) {
|
|
4828
|
+
let n = I(null), r = I(null), i = I(!0), a = I(e), [o, s] = L(!0), [c, l] = L(0), u = ut((e = "auto") => {
|
|
4829
|
+
let t = Sc(n.current);
|
|
4304
4830
|
t && t.scrollTo({
|
|
4305
4831
|
top: t.scrollHeight,
|
|
4306
4832
|
behavior: e
|
|
4307
4833
|
});
|
|
4308
4834
|
}, []);
|
|
4309
4835
|
return P(() => {
|
|
4310
|
-
let e =
|
|
4836
|
+
let e = Sc(n.current);
|
|
4311
4837
|
if (!e) return;
|
|
4312
4838
|
let r = () => {
|
|
4313
|
-
let n =
|
|
4839
|
+
let n = Cc(e) <= t;
|
|
4314
4840
|
i.current = n, s(n), n && l(0);
|
|
4315
4841
|
};
|
|
4316
4842
|
return i.current && (e.scrollTop = e.scrollHeight), r(), e.addEventListener("scroll", r, { passive: !0 }), () => e.removeEventListener("scroll", r);
|
|
@@ -4323,7 +4849,7 @@ function as(e, t) {
|
|
|
4323
4849
|
return t.observe(e), () => t.disconnect();
|
|
4324
4850
|
}, [u]), P(() => {
|
|
4325
4851
|
let t = i.current;
|
|
4326
|
-
l((n) =>
|
|
4852
|
+
l((n) => xc(n, a.current, e, t)), a.current = e, t && u();
|
|
4327
4853
|
}, [e, u]), {
|
|
4328
4854
|
rootRef: n,
|
|
4329
4855
|
contentRef: r,
|
|
@@ -4336,17 +4862,17 @@ function as(e, t) {
|
|
|
4336
4862
|
}
|
|
4337
4863
|
//#endregion
|
|
4338
4864
|
//#region lib/components/ui/widgets/chat/chat-message-list.tsx
|
|
4339
|
-
function
|
|
4340
|
-
let { t: h } = a(), g = u ??
|
|
4865
|
+
function Tc({ isTyping: e = !1, typingLabel: t, typingAvatar: n, emptyState: r, scrollToBottomLabel: i, showScrollToBottom: o = !0, bottomThreshold: s = 96, layout: c = "bubbles", density: l = "comfortable", itemCount: u, children: d, className: f, viewportProps: p, ...m }) {
|
|
4866
|
+
let { t: h } = a(), g = u ?? at.count(d), _ = wc(g + +!!e, s), v = pt(() => ({
|
|
4341
4867
|
layout: c,
|
|
4342
4868
|
density: l
|
|
4343
4869
|
}), [c, l]);
|
|
4344
|
-
return /* @__PURE__ */ z(
|
|
4870
|
+
return /* @__PURE__ */ z(Is.Provider, {
|
|
4345
4871
|
value: v,
|
|
4346
4872
|
children: /* @__PURE__ */ B("div", {
|
|
4347
4873
|
ref: _.rootRef,
|
|
4348
4874
|
className: "relative h-full min-h-0 flex-1",
|
|
4349
|
-
children: [/* @__PURE__ */ z(
|
|
4875
|
+
children: [/* @__PURE__ */ z(fc, {
|
|
4350
4876
|
"data-slot": "chat-message-list",
|
|
4351
4877
|
"data-layout": c,
|
|
4352
4878
|
"data-density": l,
|
|
@@ -4362,14 +4888,14 @@ function os({ isTyping: e = !1, typingLabel: t, typingAvatar: n, emptyState: r,
|
|
|
4362
4888
|
role: "log",
|
|
4363
4889
|
"aria-label": h("material.chat.thread.log", "Messages"),
|
|
4364
4890
|
className: A("mx-auto flex w-full min-w-0 flex-col", l === "compact" ? "gap-2.5 p-3" : "gap-4 p-4 @lg:px-6"),
|
|
4365
|
-
children: [g === 0 ? r ?? /* @__PURE__ */ z(
|
|
4891
|
+
children: [g === 0 ? r ?? /* @__PURE__ */ z(mc, {}) : d, e && /* @__PURE__ */ z(bc, {
|
|
4366
4892
|
density: l,
|
|
4367
4893
|
layout: c,
|
|
4368
4894
|
avatar: n,
|
|
4369
4895
|
label: t
|
|
4370
4896
|
})]
|
|
4371
4897
|
})
|
|
4372
|
-
}), o && /* @__PURE__ */ z(
|
|
4898
|
+
}), o && /* @__PURE__ */ z(gc, {
|
|
4373
4899
|
visible: !_.atBottom,
|
|
4374
4900
|
count: _.unseen,
|
|
4375
4901
|
label: i,
|
|
@@ -4380,17 +4906,17 @@ function os({ isTyping: e = !1, typingLabel: t, typingAvatar: n, emptyState: r,
|
|
|
4380
4906
|
}
|
|
4381
4907
|
//#endregion
|
|
4382
4908
|
//#region lib/components/ui/display/day-separator/day-label.ts
|
|
4383
|
-
function
|
|
4384
|
-
let o = a &&
|
|
4909
|
+
function Ec(e, { now: t = /* @__PURE__ */ new Date(), locale: n, today: r, yesterday: i, timeZone: a }) {
|
|
4910
|
+
let o = a && fn(a) ? a : void 0, s = mn(e);
|
|
4385
4911
|
if (Number.isNaN(s.getTime())) return "";
|
|
4386
|
-
let c =
|
|
4912
|
+
let c = un(dn(s, t, o));
|
|
4387
4913
|
if (c === "today") return r;
|
|
4388
4914
|
if (c === "yesterday") return i;
|
|
4389
4915
|
if (c === "week") return new Intl.DateTimeFormat(n, {
|
|
4390
4916
|
weekday: "long",
|
|
4391
4917
|
timeZone: o
|
|
4392
4918
|
}).format(s);
|
|
4393
|
-
let l = (e) => Number(
|
|
4919
|
+
let l = (e) => Number(pn(e, o).slice(0, 4)), u = l(mn(t)) === l(s);
|
|
4394
4920
|
return new Intl.DateTimeFormat(n, {
|
|
4395
4921
|
weekday: u ? "short" : void 0,
|
|
4396
4922
|
day: "numeric",
|
|
@@ -4401,7 +4927,7 @@ function ss(e, { now: t = /* @__PURE__ */ new Date(), locale: n, today: r, yeste
|
|
|
4401
4927
|
}
|
|
4402
4928
|
//#endregion
|
|
4403
4929
|
//#region lib/components/ui/display/day-separator/day-separator.tsx
|
|
4404
|
-
var
|
|
4930
|
+
var Dc = u("flex w-full items-center gap-3 py-2 text-xs text-muted-foreground", {
|
|
4405
4931
|
variants: {
|
|
4406
4932
|
variant: {
|
|
4407
4933
|
pill: "",
|
|
@@ -4417,11 +4943,11 @@ var cs = u("flex w-full items-center gap-3 py-2 text-xs text-muted-foreground",
|
|
|
4417
4943
|
sticky: !1
|
|
4418
4944
|
}
|
|
4419
4945
|
});
|
|
4420
|
-
function
|
|
4946
|
+
function Oc({ date: e, label: t, now: n, locale: r, timeZone: i }) {
|
|
4421
4947
|
let { t: o, language: s } = a();
|
|
4422
4948
|
if (t != null) return /* @__PURE__ */ z(R, { children: t });
|
|
4423
4949
|
if (e == null) return null;
|
|
4424
|
-
let c =
|
|
4950
|
+
let c = Ec(e, {
|
|
4425
4951
|
now: n,
|
|
4426
4952
|
timeZone: i,
|
|
4427
4953
|
locale: r ?? s ?? "en",
|
|
@@ -4429,16 +4955,16 @@ function ls({ date: e, label: t, now: n, locale: r, timeZone: i }) {
|
|
|
4429
4955
|
yesterday: o("material.day-separator.yesterday", "Yesterday")
|
|
4430
4956
|
});
|
|
4431
4957
|
return /* @__PURE__ */ z("time", {
|
|
4432
|
-
dateTime:
|
|
4958
|
+
dateTime: pn(e, i),
|
|
4433
4959
|
children: c
|
|
4434
4960
|
});
|
|
4435
4961
|
}
|
|
4436
|
-
function
|
|
4962
|
+
function kc({ date: e, label: t, badge: n, now: r, timeZone: i, locale: a, variant: o, sticky: s, as: c = "div", className: l, ...u }) {
|
|
4437
4963
|
let d = (o ?? "pill") === "pill";
|
|
4438
4964
|
return /* @__PURE__ */ B(c, {
|
|
4439
4965
|
"data-slot": "day-separator",
|
|
4440
4966
|
"data-variant": o ?? "pill",
|
|
4441
|
-
className: A(
|
|
4967
|
+
className: A(Dc({
|
|
4442
4968
|
variant: o,
|
|
4443
4969
|
sticky: s
|
|
4444
4970
|
}), c !== "div" && "m-0 font-normal", l),
|
|
@@ -4450,7 +4976,7 @@ function us({ date: e, label: t, badge: n, now: r, timeZone: i, locale: a, varia
|
|
|
4450
4976
|
}),
|
|
4451
4977
|
/* @__PURE__ */ B("span", {
|
|
4452
4978
|
className: A("inline-flex shrink-0 items-center gap-1.5 font-medium", d && "rounded-(--nxgt-shape-corner-full) border border-border/60 bg-(--nxgt-sticky-surface,var(--ground,var(--background))) px-3 py-1 shadow-xs", !d && s && "rounded-(--nxgt-shape-corner-full) bg-(--nxgt-sticky-surface,var(--ground,var(--background))) px-2 py-0.5"),
|
|
4453
|
-
children: [/* @__PURE__ */ z(
|
|
4979
|
+
children: [/* @__PURE__ */ z(Oc, {
|
|
4454
4980
|
date: e,
|
|
4455
4981
|
label: t,
|
|
4456
4982
|
now: r,
|
|
@@ -4470,8 +4996,8 @@ function us({ date: e, label: t, badge: n, now: r, timeZone: i, locale: a, varia
|
|
|
4470
4996
|
}
|
|
4471
4997
|
//#endregion
|
|
4472
4998
|
//#region lib/components/ui/widgets/chat/chat-message-separator.tsx
|
|
4473
|
-
function
|
|
4474
|
-
return /* @__PURE__ */ z(
|
|
4999
|
+
function Ac({ sticky: e = !1, ...t }) {
|
|
5000
|
+
return /* @__PURE__ */ z(kc, {
|
|
4475
5001
|
"data-slot": "chat-message-separator",
|
|
4476
5002
|
sticky: e,
|
|
4477
5003
|
...t
|
|
@@ -4479,7 +5005,7 @@ function ds({ sticky: e = !1, ...t }) {
|
|
|
4479
5005
|
}
|
|
4480
5006
|
//#endregion
|
|
4481
5007
|
//#region lib/components/ui/widgets/chat/chat-thread.tsx
|
|
4482
|
-
function
|
|
5008
|
+
function jc({ header: e, footer: t, composerProps: n, messageListProps: r, layout: i, density: a, surface: o = "plain", children: s, className: c, ...l }) {
|
|
4483
5009
|
return /* @__PURE__ */ B("div", {
|
|
4484
5010
|
"data-slot": "chat-thread",
|
|
4485
5011
|
"data-surface": o,
|
|
@@ -4491,13 +5017,13 @@ function fs({ header: e, footer: t, composerProps: n, messageListProps: r, layou
|
|
|
4491
5017
|
className: "z-10 shrink-0 border-border/70 border-b bg-background",
|
|
4492
5018
|
children: e
|
|
4493
5019
|
}),
|
|
4494
|
-
/* @__PURE__ */ z(
|
|
5020
|
+
/* @__PURE__ */ z(Tc, {
|
|
4495
5021
|
layout: i,
|
|
4496
5022
|
density: a,
|
|
4497
5023
|
...r,
|
|
4498
5024
|
children: s
|
|
4499
5025
|
}),
|
|
4500
|
-
n && /* @__PURE__ */ z(
|
|
5026
|
+
n && /* @__PURE__ */ z(Fs, { ...n }),
|
|
4501
5027
|
t && /* @__PURE__ */ z("div", {
|
|
4502
5028
|
"data-slot": "chat-thread-footer",
|
|
4503
5029
|
className: "shrink-0",
|
|
@@ -4507,4 +5033,4 @@ function fs({ header: e, footer: t, composerProps: n, messageListProps: r, layou
|
|
|
4507
5033
|
});
|
|
4508
5034
|
}
|
|
4509
5035
|
//#endregion
|
|
4510
|
-
export {
|
|
5036
|
+
export { Lr as Alert, Ha as AttachmentList, Le as Badge, O as Button, Fs as ChatComposer, dc as ChatMessage, Tc as ChatMessageList, Ac as ChatMessageSeparator, jc as ChatThread, to as Checkbox, ro as CheckboxFormField, es as ChipGroupField, vi as ConfirmDialog, me as Dialog, Ua as DialogAside, Ka as DialogBody, xe as DialogClose, ye as DialogContent, he as DialogDescription, ue as DialogFooter, Te as DialogHeader, Oe as DialogTitle, ge as DialogTrigger, Bi as EmailField, Ca as EmailFormField, Oi as EmptyState, e as I18nProvider, si as Input, Nr as ListRow, Qa as NonceProvider, we as NxgtThemeProvider, pe as PortalContainerProvider, Ne as Skeleton, ki as SkeletonText, b as Spinner, De as SwitchField, wa as SwitchFormField, Je as Tabs, Ke as TabsContent, We as TabsList, eo as TabsTrigger, Li as TextField, Ta as TextFormField, ui as Textarea, Fa as TextareaField, Ia as TextareaFormField, be as adoptStyles };
|