teodor-new-chat-ui 2.0.24 → 2.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +259 -257
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -111,14 +111,14 @@ const Nd = (e, t, n, { allOwnKeys: r } = {}) => (an(t, (o, s) => {
|
|
|
111
111
|
for (; t-- > 0; )
|
|
112
112
|
n[t] = e[t];
|
|
113
113
|
return n;
|
|
114
|
-
}, Od = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && go(Uint8Array)),
|
|
114
|
+
}, Od = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && go(Uint8Array)), Md = (e, t) => {
|
|
115
115
|
const r = (e && e[Xn]).call(e);
|
|
116
116
|
let o;
|
|
117
117
|
for (; (o = r.next()) && !o.done; ) {
|
|
118
118
|
const s = o.value;
|
|
119
119
|
t.call(e, s[0], s[1]);
|
|
120
120
|
}
|
|
121
|
-
},
|
|
121
|
+
}, kd = (e, t) => {
|
|
122
122
|
let n;
|
|
123
123
|
const r = [];
|
|
124
124
|
for (; (n = e.exec(t)) !== null; )
|
|
@@ -225,8 +225,8 @@ const Wd = (e) => {
|
|
|
225
225
|
kindOfTest: Be,
|
|
226
226
|
endsWith: _d,
|
|
227
227
|
toArray: Id,
|
|
228
|
-
forEachEntry:
|
|
229
|
-
matchAll:
|
|
228
|
+
forEachEntry: Md,
|
|
229
|
+
matchAll: kd,
|
|
230
230
|
isHTMLForm: Dd,
|
|
231
231
|
hasOwnProperty: as,
|
|
232
232
|
hasOwnProp: as,
|
|
@@ -1239,7 +1239,7 @@ const Ia = (e) => {
|
|
|
1239
1239
|
onUploadProgress: I,
|
|
1240
1240
|
responseType: N,
|
|
1241
1241
|
headers: L,
|
|
1242
|
-
withCredentials:
|
|
1242
|
+
withCredentials: M = "same-origin",
|
|
1243
1243
|
fetchOptions: D
|
|
1244
1244
|
} = Ia(m), j = t || fetch;
|
|
1245
1245
|
N = N ? (N + "").toLowerCase() : "text";
|
|
@@ -1263,7 +1263,7 @@ const Ia = (e) => {
|
|
|
1263
1263
|
w = hs(O.body, ms, $, z);
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
S.isString(
|
|
1266
|
+
S.isString(M) || (M = M ? "include" : "omit");
|
|
1267
1267
|
const F = s && "credentials" in n.prototype, G = {
|
|
1268
1268
|
...D,
|
|
1269
1269
|
signal: K,
|
|
@@ -1271,7 +1271,7 @@ const Ia = (e) => {
|
|
|
1271
1271
|
headers: L.normalize().toJSON(),
|
|
1272
1272
|
body: w,
|
|
1273
1273
|
duplex: "half",
|
|
1274
|
-
credentials: F ?
|
|
1274
|
+
credentials: F ? M : void 0
|
|
1275
1275
|
};
|
|
1276
1276
|
W = s && new n(h, G);
|
|
1277
1277
|
let T = await (s ? j(W, D) : j(h, G));
|
|
@@ -1342,7 +1342,7 @@ S.forEach(Gr, (e, t) => {
|
|
|
1342
1342
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1343
1343
|
}
|
|
1344
1344
|
});
|
|
1345
|
-
const ws = (e) => `- ${e}`,
|
|
1345
|
+
const ws = (e) => `- ${e}`, Mf = (e) => S.isFunction(e) || e === null || e === !1, Ma = {
|
|
1346
1346
|
getAdapter: (e, t) => {
|
|
1347
1347
|
e = S.isArray(e) ? e : [e];
|
|
1348
1348
|
const { length: n } = e;
|
|
@@ -1351,7 +1351,7 @@ const ws = (e) => `- ${e}`, kf = (e) => S.isFunction(e) || e === null || e === !
|
|
|
1351
1351
|
for (let a = 0; a < n; a++) {
|
|
1352
1352
|
r = e[a];
|
|
1353
1353
|
let i;
|
|
1354
|
-
if (o = r, !
|
|
1354
|
+
if (o = r, !Mf(r) && (o = Gr[(i = String(r)).toLowerCase()], o === void 0))
|
|
1355
1355
|
throw new ee(`Unknown adapter '${i}'`);
|
|
1356
1356
|
if (o && (S.isFunction(o) || (o = o.get(t))))
|
|
1357
1357
|
break;
|
|
@@ -1381,7 +1381,7 @@ function ys(e) {
|
|
|
1381
1381
|
return Nr(e), e.headers = Te.from(e.headers), e.data = Rr.call(
|
|
1382
1382
|
e,
|
|
1383
1383
|
e.transformRequest
|
|
1384
|
-
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1),
|
|
1384
|
+
), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Ma.getAdapter(e.adapter || cn.adapter, e)(e).then(function(r) {
|
|
1385
1385
|
return Nr(e), r.data = Rr.call(
|
|
1386
1386
|
e,
|
|
1387
1387
|
e.transformResponse,
|
|
@@ -1395,7 +1395,7 @@ function ys(e) {
|
|
|
1395
1395
|
), r.response.headers = Te.from(r.response.headers))), Promise.reject(r);
|
|
1396
1396
|
});
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1398
|
+
const ka = "1.12.2", Qn = {};
|
|
1399
1399
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1400
1400
|
Qn[e] = function(r) {
|
|
1401
1401
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
@@ -1404,7 +1404,7 @@ const Ma = "1.12.2", Qn = {};
|
|
|
1404
1404
|
const xs = {};
|
|
1405
1405
|
Qn.transitional = function(t, n, r) {
|
|
1406
1406
|
function o(s, a) {
|
|
1407
|
-
return "[Axios v" +
|
|
1407
|
+
return "[Axios v" + ka + "] Transitional option '" + s + "'" + a + (r ? ". " + r : "");
|
|
1408
1408
|
}
|
|
1409
1409
|
return (s, a, i) => {
|
|
1410
1410
|
if (t === !1)
|
|
@@ -1423,7 +1423,7 @@ Qn.transitional = function(t, n, r) {
|
|
|
1423
1423
|
Qn.spelling = function(t) {
|
|
1424
1424
|
return (n, r) => (console.warn(`${r} is likely a misspelling of ${t}`), !0);
|
|
1425
1425
|
};
|
|
1426
|
-
function
|
|
1426
|
+
function kf(e, t, n) {
|
|
1427
1427
|
if (typeof e != "object")
|
|
1428
1428
|
throw new ee("options must be an object", ee.ERR_BAD_OPTION_VALUE);
|
|
1429
1429
|
const r = Object.keys(e);
|
|
@@ -1441,7 +1441,7 @@ function Mf(e, t, n) {
|
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
1443
|
const En = {
|
|
1444
|
-
assertOptions:
|
|
1444
|
+
assertOptions: kf,
|
|
1445
1445
|
validators: Qn
|
|
1446
1446
|
}, He = En.validators;
|
|
1447
1447
|
let dt = class {
|
|
@@ -1728,7 +1728,7 @@ me.Axios = dt;
|
|
|
1728
1728
|
me.CanceledError = Ft;
|
|
1729
1729
|
me.CancelToken = Df;
|
|
1730
1730
|
me.isCancel = Aa;
|
|
1731
|
-
me.VERSION =
|
|
1731
|
+
me.VERSION = ka;
|
|
1732
1732
|
me.toFormData = Zn;
|
|
1733
1733
|
me.AxiosError = ee;
|
|
1734
1734
|
me.Cancel = me.CanceledError;
|
|
@@ -1740,7 +1740,7 @@ me.isAxiosError = Ff;
|
|
|
1740
1740
|
me.mergeConfig = ft;
|
|
1741
1741
|
me.AxiosHeaders = Te;
|
|
1742
1742
|
me.formToJSON = (e) => Ta(S.isHTMLForm(e) ? new FormData(e) : e);
|
|
1743
|
-
me.getAdapter =
|
|
1743
|
+
me.getAdapter = Ma.getAdapter;
|
|
1744
1744
|
me.HttpStatusCode = qr;
|
|
1745
1745
|
me.default = me;
|
|
1746
1746
|
const {
|
|
@@ -1952,7 +1952,7 @@ function Hf(e = {}) {
|
|
|
1952
1952
|
m.current && (m.current.abort(), m.current = null), i(!0), f(null), e.autoAppendAssistant !== !1 && p("");
|
|
1953
1953
|
const I = new AbortController();
|
|
1954
1954
|
return m.current = I, (async () => {
|
|
1955
|
-
var
|
|
1955
|
+
var M, D, j, K;
|
|
1956
1956
|
const N = (() => {
|
|
1957
1957
|
var W;
|
|
1958
1958
|
try {
|
|
@@ -1978,7 +1978,7 @@ function Hf(e = {}) {
|
|
|
1978
1978
|
if (r)
|
|
1979
1979
|
W = { Authorization: `Bearer ${r}` };
|
|
1980
1980
|
else if (typeof window < "u") {
|
|
1981
|
-
const P = window.__AUTH_TOKEN__, _ = ((
|
|
1981
|
+
const P = window.__AUTH_TOKEN__, _ = ((M = window.localStorage) == null ? void 0 : M.getItem("authToken")) || null;
|
|
1982
1982
|
let O = null;
|
|
1983
1983
|
try {
|
|
1984
1984
|
const $ = (D = window.localStorage) == null ? void 0 : D.getItem("chat-settings");
|
|
@@ -2279,16 +2279,16 @@ function Rn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2279
2279
|
o && L.current !== o && (L.current = o, D(o).catch(() => {
|
|
2280
2280
|
}));
|
|
2281
2281
|
}, [o]);
|
|
2282
|
-
const
|
|
2282
|
+
const M = rt(null), D = Ce(
|
|
2283
2283
|
async (_, O, X) => {
|
|
2284
2284
|
var $;
|
|
2285
|
-
if (
|
|
2286
|
-
|
|
2285
|
+
if (M.current !== _) {
|
|
2286
|
+
M.current = _;
|
|
2287
2287
|
try {
|
|
2288
2288
|
const z = O ?? (($ = (await s.listCheckpoints(_)).checkpoints.slice().sort((ae, V) => new Date(V.createdAt).getTime() - new Date(ae.createdAt).getTime())[0]) == null ? void 0 : $.checkpointId), le = await s.getMessages({ threadId: _, checkpointId: z, checkpointNs: X });
|
|
2289
2289
|
I(_), h(le.messages);
|
|
2290
2290
|
} finally {
|
|
2291
|
-
|
|
2291
|
+
M.current = null;
|
|
2292
2292
|
}
|
|
2293
2293
|
}
|
|
2294
2294
|
},
|
|
@@ -2888,12 +2888,12 @@ function gp({
|
|
|
2888
2888
|
onRegenerate: I,
|
|
2889
2889
|
onEditFromCheckpoint: N,
|
|
2890
2890
|
onCancelEdit: L,
|
|
2891
|
-
onCopy:
|
|
2891
|
+
onCopy: M
|
|
2892
2892
|
}) {
|
|
2893
2893
|
const [D, j] = ce(!1), [K, W] = ce(!1), [B, q] = ce(!1), [F, G] = ce(!1), T = u === "phone" || u === "half-screen", P = e.role, _ = P === "tool", O = nt(() => bp(e.content), [e.content]), X = nt(() => Cp(e.content), [e.content]), $ = nt(() => e.content.filter((Y) => Y.type === "image_url"), [e.content]), z = nt(() => e.content.filter((Y) => Y.type === "file"), [e.content]), le = Np(O, n ? r : 0), ae = async () => {
|
|
2894
2894
|
try {
|
|
2895
2895
|
const Y = _ ? St(e.content) : O;
|
|
2896
|
-
await navigator.clipboard.writeText(Y), j(!0), setTimeout(() => j(!1), 2e3),
|
|
2896
|
+
await navigator.clipboard.writeText(Y), j(!0), setTimeout(() => j(!1), 2e3), M == null || M(Y);
|
|
2897
2897
|
} catch (Y) {
|
|
2898
2898
|
console.error("Failed to copy:", Y);
|
|
2899
2899
|
}
|
|
@@ -2934,24 +2934,18 @@ function gp({
|
|
|
2934
2934
|
case "user":
|
|
2935
2935
|
return A(
|
|
2936
2936
|
Y,
|
|
2937
|
-
// Ensure width constraints
|
|
2938
2937
|
"max-w-[95%]",
|
|
2939
2938
|
u === "phone" && "max-w-[98%]",
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
// Use Tailwind's `dark:` variants so the bubble adapts when the document root toggles the `dark` class.
|
|
2943
|
-
"bg-blue-50 text-gray-900 dark:bg-primary dark:text-primary-foreground",
|
|
2944
|
-
// Subtle blue border in light mode to separate from page background; remove in dark mode to keep the primary look.
|
|
2945
|
-
"border border-blue-100 dark:border-transparent"
|
|
2939
|
+
"bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
|
|
2940
|
+
"border border-transparent"
|
|
2946
2941
|
);
|
|
2947
2942
|
case "assistant":
|
|
2948
2943
|
return A(
|
|
2949
2944
|
Y,
|
|
2950
2945
|
"max-w-[95%]",
|
|
2951
2946
|
u === "phone" && "max-w-[98%]",
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
"bg-white text-gray-900 border border-gray-200 dark:bg-muted dark:text-muted-foreground dark:border-transparent"
|
|
2947
|
+
"bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
|
|
2948
|
+
"border border-border/60 dark:border-border/40"
|
|
2955
2949
|
);
|
|
2956
2950
|
case "tool":
|
|
2957
2951
|
return A(Y, "bg-secondary/50 text-secondary-foreground border border-dashed max-w-[95%]", u === "phone" && "max-w-[98%]");
|
|
@@ -2974,7 +2968,7 @@ function gp({
|
|
|
2974
2968
|
return /* @__PURE__ */ c(Tp, { data: he });
|
|
2975
2969
|
}
|
|
2976
2970
|
if (_ && X.name === "get_issues") {
|
|
2977
|
-
const te = e.content.find((
|
|
2971
|
+
const te = e.content.find((k) => k.type === "tool_result"), he = (te == null ? void 0 : te.output) ?? St(e.content), ve = Ga(he);
|
|
2978
2972
|
if (ve) return /* @__PURE__ */ c(Ap, { issues: ve });
|
|
2979
2973
|
}
|
|
2980
2974
|
if (_ && !B) {
|
|
@@ -3021,19 +3015,27 @@ function gp({
|
|
|
3021
3015
|
const he = O.trim();
|
|
3022
3016
|
if (he.length > g)
|
|
3023
3017
|
return /* @__PURE__ */ R(As, { open: F, onOpenChange: G, children: [
|
|
3024
|
-
/* @__PURE__ */ c("div", { className: A("text-sm text-
|
|
3018
|
+
/* @__PURE__ */ c("div", { className: A("text-sm text-[hsl(var(--chat-bubble-user-text))]", T && "text-xs"), children: F ? /* @__PURE__ */ c(gn, { content: he }) : /* @__PURE__ */ R("pre", { className: A("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", T && "text-xs"), children: [
|
|
3025
3019
|
he.substring(0, g),
|
|
3026
3020
|
"..."
|
|
3027
3021
|
] }) }),
|
|
3028
|
-
/* @__PURE__ */ c(Ps, { asChild: !0, children: /* @__PURE__ */ c(
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3022
|
+
/* @__PURE__ */ c(Ps, { asChild: !0, children: /* @__PURE__ */ c(
|
|
3023
|
+
fe,
|
|
3024
|
+
{
|
|
3025
|
+
variant: "ghost",
|
|
3026
|
+
size: "sm",
|
|
3027
|
+
className: "h-6 text-xs !text-[hsl(var(--chat-bubble-user-text))]",
|
|
3028
|
+
children: F ? /* @__PURE__ */ R(De, { children: [
|
|
3029
|
+
/* @__PURE__ */ c(Wt, { className: "h-3 w-3 mr-1" }),
|
|
3030
|
+
" Show less"
|
|
3031
|
+
] }) : /* @__PURE__ */ R(De, { children: [
|
|
3032
|
+
/* @__PURE__ */ c(Tt, { className: "h-3 w-3 mr-1" }),
|
|
3033
|
+
" Show more (",
|
|
3034
|
+
he.length - g,
|
|
3035
|
+
" chars)"
|
|
3036
|
+
] })
|
|
3037
|
+
}
|
|
3038
|
+
) })
|
|
3037
3039
|
] });
|
|
3038
3040
|
}
|
|
3039
3041
|
return /* @__PURE__ */ c(gn, { content: O.trim() });
|
|
@@ -3046,19 +3048,19 @@ function gp({
|
|
|
3046
3048
|
] })
|
|
3047
3049
|
] }, he)) }),
|
|
3048
3050
|
ge && /* @__PURE__ */ c("div", { className: "mt-2 flex flex-wrap gap-2", children: z.map((te, he) => {
|
|
3049
|
-
const ve = te,
|
|
3051
|
+
const ve = te, k = ve.name || "file";
|
|
3050
3052
|
return /* @__PURE__ */ R(
|
|
3051
3053
|
"a",
|
|
3052
3054
|
{
|
|
3053
3055
|
href: ve.url,
|
|
3054
|
-
download:
|
|
3056
|
+
download: k,
|
|
3055
3057
|
target: "_blank",
|
|
3056
3058
|
rel: "noreferrer",
|
|
3057
3059
|
className: "inline-flex items-center gap-2 bg-gray-100 border border-gray-200 rounded px-2 py-1 text-xs hover:bg-gray-200",
|
|
3058
|
-
title:
|
|
3060
|
+
title: k,
|
|
3059
3061
|
children: [
|
|
3060
3062
|
/* @__PURE__ */ c("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-gray-400" }),
|
|
3061
|
-
/* @__PURE__ */ c("span", { className: "truncate max-w-[180px]", children:
|
|
3063
|
+
/* @__PURE__ */ c("span", { className: "truncate max-w-[180px]", children: k })
|
|
3062
3064
|
]
|
|
3063
3065
|
},
|
|
3064
3066
|
he
|
|
@@ -3528,7 +3530,7 @@ function ye(e) {
|
|
|
3528
3530
|
return (r = t.current) == null ? void 0 : r.call(t, ...n);
|
|
3529
3531
|
}, []);
|
|
3530
3532
|
}
|
|
3531
|
-
function
|
|
3533
|
+
function Mp(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
3532
3534
|
const n = ye(e);
|
|
3533
3535
|
l.useEffect(() => {
|
|
3534
3536
|
const r = (o) => {
|
|
@@ -3537,7 +3539,7 @@ function kp(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
3537
3539
|
return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
|
|
3538
3540
|
}, [n, t]);
|
|
3539
3541
|
}
|
|
3540
|
-
var
|
|
3542
|
+
var kp = "DismissableLayer", Yr = "dismissableLayer.update", Dp = "dismissableLayer.pointerDownOutside", Lp = "dismissableLayer.focusOutside", Is, qa = l.createContext({
|
|
3541
3543
|
layers: /* @__PURE__ */ new Set(),
|
|
3542
3544
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3543
3545
|
branches: /* @__PURE__ */ new Set()
|
|
@@ -3552,13 +3554,13 @@ var Mp = "DismissableLayer", Yr = "dismissableLayer.update", Dp = "dismissableLa
|
|
|
3552
3554
|
onDismiss: i,
|
|
3553
3555
|
...u
|
|
3554
3556
|
} = e, f = l.useContext(qa), [d, p] = l.useState(null), g = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = l.useState({}), m = ne(t, (N) => p(N)), h = Array.from(f.layers), [b] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), w = h.indexOf(b), y = d ? h.indexOf(d) : -1, x = f.layersWithOutsidePointerEventsDisabled.size > 0, E = y >= w, C = Bp((N) => {
|
|
3555
|
-
const L = N.target,
|
|
3556
|
-
!E ||
|
|
3557
|
+
const L = N.target, M = [...f.branches].some((D) => D.contains(L));
|
|
3558
|
+
!E || M || (o == null || o(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
3557
3559
|
}, g), I = Up((N) => {
|
|
3558
3560
|
const L = N.target;
|
|
3559
3561
|
[...f.branches].some((D) => D.contains(L)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
3560
3562
|
}, g);
|
|
3561
|
-
return
|
|
3563
|
+
return Mp((N) => {
|
|
3562
3564
|
y === f.layers.size - 1 && (r == null || r(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
|
|
3563
3565
|
}, g), l.useEffect(() => {
|
|
3564
3566
|
if (d)
|
|
@@ -3589,7 +3591,7 @@ var Mp = "DismissableLayer", Yr = "dismissableLayer.update", Dp = "dismissableLa
|
|
|
3589
3591
|
);
|
|
3590
3592
|
}
|
|
3591
3593
|
);
|
|
3592
|
-
ln.displayName =
|
|
3594
|
+
ln.displayName = kp;
|
|
3593
3595
|
var Fp = "DismissableLayerBranch", $p = l.forwardRef((e, t) => {
|
|
3594
3596
|
const n = l.useContext(qa), r = l.useRef(null), o = ne(t, r);
|
|
3595
3597
|
return l.useEffect(() => {
|
|
@@ -3657,16 +3659,16 @@ var _r = 0;
|
|
|
3657
3659
|
function Eo() {
|
|
3658
3660
|
l.useEffect(() => {
|
|
3659
3661
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3660
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ??
|
|
3662
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? Ms()), document.body.insertAdjacentElement("beforeend", e[1] ?? Ms()), _r++, () => {
|
|
3661
3663
|
_r === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), _r--;
|
|
3662
3664
|
};
|
|
3663
3665
|
}, []);
|
|
3664
3666
|
}
|
|
3665
|
-
function
|
|
3667
|
+
function Ms() {
|
|
3666
3668
|
const e = document.createElement("span");
|
|
3667
3669
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
3668
3670
|
}
|
|
3669
|
-
var Ir = "focusScope.autoFocusOnMount", Or = "focusScope.autoFocusOnUnmount",
|
|
3671
|
+
var Ir = "focusScope.autoFocusOnMount", Or = "focusScope.autoFocusOnUnmount", ks = { bubbles: !1, cancelable: !0 }, zp = "FocusScope", nr = l.forwardRef((e, t) => {
|
|
3670
3672
|
const {
|
|
3671
3673
|
loop: n = !1,
|
|
3672
3674
|
trapped: r = !1,
|
|
@@ -3708,12 +3710,12 @@ var Ir = "focusScope.autoFocusOnMount", Or = "focusScope.autoFocusOnUnmount", Ms
|
|
|
3708
3710
|
Ls.add(v);
|
|
3709
3711
|
const h = document.activeElement;
|
|
3710
3712
|
if (!i.contains(h)) {
|
|
3711
|
-
const w = new CustomEvent(Ir,
|
|
3713
|
+
const w = new CustomEvent(Ir, ks);
|
|
3712
3714
|
i.addEventListener(Ir, f), i.dispatchEvent(w), w.defaultPrevented || (Hp(Gp(Ya(i)), { select: !0 }), document.activeElement === h && et(i));
|
|
3713
3715
|
}
|
|
3714
3716
|
return () => {
|
|
3715
3717
|
i.removeEventListener(Ir, f), setTimeout(() => {
|
|
3716
|
-
const w = new CustomEvent(Or,
|
|
3718
|
+
const w = new CustomEvent(Or, ks);
|
|
3717
3719
|
i.addEventListener(Or, d), i.dispatchEvent(w), w.defaultPrevented || et(h ?? document.body, { select: !0 }), i.removeEventListener(Or, d), Ls.remove(v);
|
|
3718
3720
|
}, 0);
|
|
3719
3721
|
};
|
|
@@ -4079,7 +4081,7 @@ const ah = (e) => ({
|
|
|
4079
4081
|
}, v = To(o), m = No(v), h = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", y = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", E = s.reference[m] + s.reference[v] - g[v] - s.floating[m], C = g[v] - s.reference[v], I = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
|
|
4080
4082
|
let N = I ? I[x] : 0;
|
|
4081
4083
|
(!N || !await (a.isElement == null ? void 0 : a.isElement(I))) && (N = i.floating[x] || s.floating[m]);
|
|
4082
|
-
const L = E / 2 - C / 2,
|
|
4084
|
+
const L = E / 2 - C / 2, M = N / 2 - h[m] / 2 - 1, D = st(p[w], M), j = st(p[y], M), K = D, W = N - h[m] - j, B = N / 2 - h[m] / 2 + L, q = Jr(K, B, W), F = !u.arrow && $t(o) != null && B !== q && s.reference[m] / 2 - (B < K ? D : j) - h[m] / 2 < 0, G = F ? B < K ? B - K : B - W : 0;
|
|
4083
4085
|
return {
|
|
4084
4086
|
[v]: g[v] + G,
|
|
4085
4087
|
data: {
|
|
@@ -4118,16 +4120,16 @@ const ah = (e) => ({
|
|
|
4118
4120
|
return {};
|
|
4119
4121
|
const w = Ze(o), y = je(i), x = Ze(i) === i, E = await (u.isRTL == null ? void 0 : u.isRTL(f.floating)), C = g || (x || !h ? [Bn(i)] : Qp(i)), I = m !== "none";
|
|
4120
4122
|
!g && I && C.push(...rh(i, h, m, E));
|
|
4121
|
-
const N = [i, ...C], L = await Jt(t, b),
|
|
4123
|
+
const N = [i, ...C], L = await Jt(t, b), M = [];
|
|
4122
4124
|
let D = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
4123
|
-
if (d &&
|
|
4125
|
+
if (d && M.push(L[w]), p) {
|
|
4124
4126
|
const B = Zp(o, a, E);
|
|
4125
|
-
|
|
4127
|
+
M.push(L[B[0]], L[B[1]]);
|
|
4126
4128
|
}
|
|
4127
4129
|
if (D = [...D, {
|
|
4128
4130
|
placement: o,
|
|
4129
|
-
overflows:
|
|
4130
|
-
}], !
|
|
4131
|
+
overflows: M
|
|
4132
|
+
}], !M.every((B) => B <= 0)) {
|
|
4131
4133
|
var j, K;
|
|
4132
4134
|
const B = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, q = N[B];
|
|
4133
4135
|
if (q && (!(p === "alignment" ? y !== je(q) : !1) || // We leave the current main axis only if every placement on that axis
|
|
@@ -4406,8 +4408,8 @@ const uh = function(e) {
|
|
|
4406
4408
|
availableWidth: L,
|
|
4407
4409
|
availableHeight: N
|
|
4408
4410
|
});
|
|
4409
|
-
const
|
|
4410
|
-
return m !==
|
|
4411
|
+
const M = await a.getDimensions(i.floating);
|
|
4412
|
+
return m !== M.width || h !== M.height ? {
|
|
4411
4413
|
reset: {
|
|
4412
4414
|
rects: !0
|
|
4413
4415
|
}
|
|
@@ -4727,7 +4729,7 @@ function Oh(e) {
|
|
|
4727
4729
|
y: u.top
|
|
4728
4730
|
};
|
|
4729
4731
|
}
|
|
4730
|
-
function
|
|
4732
|
+
function Mh(e) {
|
|
4731
4733
|
const {
|
|
4732
4734
|
width: t,
|
|
4733
4735
|
height: n
|
|
@@ -4737,7 +4739,7 @@ function kh(e) {
|
|
|
4737
4739
|
height: n
|
|
4738
4740
|
};
|
|
4739
4741
|
}
|
|
4740
|
-
function
|
|
4742
|
+
function kh(e, t, n) {
|
|
4741
4743
|
const r = qe(t), o = Xe(t), s = n === "fixed", a = ht(e, !0, s, t);
|
|
4742
4744
|
let i = {
|
|
4743
4745
|
scrollLeft: 0,
|
|
@@ -4761,7 +4763,7 @@ function Mh(e, t, n) {
|
|
|
4761
4763
|
height: a.height
|
|
4762
4764
|
};
|
|
4763
4765
|
}
|
|
4764
|
-
function
|
|
4766
|
+
function Mr(e) {
|
|
4765
4767
|
return $e(e).position === "static";
|
|
4766
4768
|
}
|
|
4767
4769
|
function Ks(e, t) {
|
|
@@ -4779,21 +4781,21 @@ function si(e, t) {
|
|
|
4779
4781
|
if (!qe(e)) {
|
|
4780
4782
|
let o = at(e);
|
|
4781
4783
|
for (; o && !Ot(o); ) {
|
|
4782
|
-
if (Fe(o) && !
|
|
4784
|
+
if (Fe(o) && !Mr(o))
|
|
4783
4785
|
return o;
|
|
4784
4786
|
o = at(o);
|
|
4785
4787
|
}
|
|
4786
4788
|
return n;
|
|
4787
4789
|
}
|
|
4788
4790
|
let r = Ks(e, t);
|
|
4789
|
-
for (; r && gh(r) &&
|
|
4791
|
+
for (; r && gh(r) && Mr(r); )
|
|
4790
4792
|
r = Ks(r, t);
|
|
4791
|
-
return r && Ot(r) &&
|
|
4793
|
+
return r && Ot(r) && Mr(r) && !Ao(r) ? n : r || xh(e) || n;
|
|
4792
4794
|
}
|
|
4793
4795
|
const Dh = async function(e) {
|
|
4794
4796
|
const t = this.getOffsetParent || si, n = this.getDimensions, r = await n(e.floating);
|
|
4795
4797
|
return {
|
|
4796
|
-
reference:
|
|
4798
|
+
reference: kh(e.reference, await t(e.floating), e.strategy),
|
|
4797
4799
|
floating: {
|
|
4798
4800
|
x: 0,
|
|
4799
4801
|
y: 0,
|
|
@@ -4812,7 +4814,7 @@ const Fh = {
|
|
|
4812
4814
|
getOffsetParent: si,
|
|
4813
4815
|
getElementRects: Dh,
|
|
4814
4816
|
getClientRects: Nh,
|
|
4815
|
-
getDimensions:
|
|
4817
|
+
getDimensions: Mh,
|
|
4816
4818
|
getScale: At,
|
|
4817
4819
|
isElement: Fe,
|
|
4818
4820
|
isRTL: Lh
|
|
@@ -4954,7 +4956,7 @@ function qs(e, t) {
|
|
|
4954
4956
|
const n = ii(e);
|
|
4955
4957
|
return Math.round(t * n) / n;
|
|
4956
4958
|
}
|
|
4957
|
-
function
|
|
4959
|
+
function kr(e) {
|
|
4958
4960
|
const t = l.useRef(e);
|
|
4959
4961
|
return Nn(() => {
|
|
4960
4962
|
t.current = e;
|
|
@@ -4987,7 +4989,7 @@ function Xh(e) {
|
|
|
4987
4989
|
T !== I.current && (I.current = T, h(T));
|
|
4988
4990
|
}, []), x = l.useCallback((T) => {
|
|
4989
4991
|
T !== N.current && (N.current = T, w(T));
|
|
4990
|
-
}, []), E = s || m, C = a || b, I = l.useRef(null), N = l.useRef(null), L = l.useRef(d),
|
|
4992
|
+
}, []), E = s || m, C = a || b, I = l.useRef(null), N = l.useRef(null), L = l.useRef(d), M = u != null, D = kr(u), j = kr(o), K = kr(f), W = l.useCallback(() => {
|
|
4991
4993
|
if (!I.current || !N.current)
|
|
4992
4994
|
return;
|
|
4993
4995
|
const T = {
|
|
@@ -5024,7 +5026,7 @@ function Xh(e) {
|
|
|
5024
5026
|
return D.current(E, C, W);
|
|
5025
5027
|
W();
|
|
5026
5028
|
}
|
|
5027
|
-
}, [E, C, W, D,
|
|
5029
|
+
}, [E, C, W, D, M]);
|
|
5028
5030
|
const q = l.useMemo(() => ({
|
|
5029
5031
|
reference: I,
|
|
5030
5032
|
floating: N,
|
|
@@ -5177,7 +5179,7 @@ var Oo = "PopperContent", [im, cm] = ui(Oo), mi = l.forwardRef(
|
|
|
5177
5179
|
updatePositionStrategy: v = "optimized",
|
|
5178
5180
|
onPlaced: m,
|
|
5179
5181
|
...h
|
|
5180
|
-
} = e, b = di(Oo, n), [w, y] = l.useState(null), x = ne(t, (de) => y(de)), [E, C] = l.useState(null), I = li(E), N = (I == null ? void 0 : I.width) ?? 0, L = (I == null ? void 0 : I.height) ?? 0,
|
|
5182
|
+
} = e, b = di(Oo, n), [w, y] = l.useState(null), x = ne(t, (de) => y(de)), [E, C] = l.useState(null), I = li(E), N = (I == null ? void 0 : I.width) ?? 0, L = (I == null ? void 0 : I.height) ?? 0, M = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(f) ? f : [f], K = j.length > 0, W = {
|
|
5181
5183
|
padding: D,
|
|
5182
5184
|
boundary: j.filter(um),
|
|
5183
5185
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
@@ -5185,7 +5187,7 @@ var Oo = "PopperContent", [im, cm] = ui(Oo), mi = l.forwardRef(
|
|
|
5185
5187
|
}, { refs: B, floatingStyles: q, placement: F, isPositioned: G, middlewareData: T } = Xh({
|
|
5186
5188
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
5187
5189
|
strategy: "fixed",
|
|
5188
|
-
placement:
|
|
5190
|
+
placement: M,
|
|
5189
5191
|
whileElementsMounted: (...de) => Bh(...de, {
|
|
5190
5192
|
animationFrame: v === "always"
|
|
5191
5193
|
}),
|
|
@@ -5342,7 +5344,7 @@ function vi(e) {
|
|
|
5342
5344
|
const [t, n = "center"] = e.split("-");
|
|
5343
5345
|
return [t, n];
|
|
5344
5346
|
}
|
|
5345
|
-
var
|
|
5347
|
+
var Mo = fi, ko = hi, Do = mi, Lo = bi, fm = "Portal", ir = l.forwardRef((e, t) => {
|
|
5346
5348
|
var i;
|
|
5347
5349
|
const { container: n, ...r } = e, [o, s] = l.useState(!1);
|
|
5348
5350
|
be(() => s(!0), []);
|
|
@@ -5412,8 +5414,8 @@ var vm = l.forwardRef((e, t) => {
|
|
|
5412
5414
|
C.current = !0;
|
|
5413
5415
|
}),
|
|
5414
5416
|
onFocus: U(e.onFocus, (L) => {
|
|
5415
|
-
const
|
|
5416
|
-
if (L.target === L.currentTarget &&
|
|
5417
|
+
const M = !C.current;
|
|
5418
|
+
if (L.target === L.currentTarget && M && !w) {
|
|
5417
5419
|
const D = new CustomEvent(Dr, pm);
|
|
5418
5420
|
if (L.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
|
|
5419
5421
|
const j = E().filter((F) => F.focusable), K = j.find((F) => F.active), W = j.find((F) => F.id === h), q = [K, W, ...j].filter(
|
|
@@ -5610,7 +5612,7 @@ function Im(e, t) {
|
|
|
5610
5612
|
return n.callback = t, n.facade;
|
|
5611
5613
|
}
|
|
5612
5614
|
var Om = typeof window < "u" ? l.useLayoutEffect : l.useEffect, Xs = /* @__PURE__ */ new WeakMap();
|
|
5613
|
-
function
|
|
5615
|
+
function Mm(e, t) {
|
|
5614
5616
|
var n = Im(null, function(r) {
|
|
5615
5617
|
return e.forEach(function(o) {
|
|
5616
5618
|
return Fr(o, r);
|
|
@@ -5629,11 +5631,11 @@ function km(e, t) {
|
|
|
5629
5631
|
Xs.set(n, e);
|
|
5630
5632
|
}, [e]), n;
|
|
5631
5633
|
}
|
|
5632
|
-
function
|
|
5634
|
+
function km(e) {
|
|
5633
5635
|
return e;
|
|
5634
5636
|
}
|
|
5635
5637
|
function Dm(e, t) {
|
|
5636
|
-
t === void 0 && (t =
|
|
5638
|
+
t === void 0 && (t = km);
|
|
5637
5639
|
var n = [], r = !1, o = {
|
|
5638
5640
|
read: function() {
|
|
5639
5641
|
if (r)
|
|
@@ -5711,7 +5713,7 @@ var Ai = Lm(), $r = function() {
|
|
|
5711
5713
|
onScrollCapture: $r,
|
|
5712
5714
|
onWheelCapture: $r,
|
|
5713
5715
|
onTouchMoveCapture: $r
|
|
5714
|
-
}), o = r[0], s = r[1], a = e.forwardProps, i = e.children, u = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards, g = e.sideCar, v = e.noRelative, m = e.noIsolation, h = e.inert, b = e.allowPinchZoom, w = e.as, y = w === void 0 ? "div" : w, x = e.gapMode, E = Ni(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = g, I =
|
|
5716
|
+
}), o = r[0], s = r[1], a = e.forwardProps, i = e.children, u = e.className, f = e.removeScrollBar, d = e.enabled, p = e.shards, g = e.sideCar, v = e.noRelative, m = e.noIsolation, h = e.inert, b = e.allowPinchZoom, w = e.as, y = w === void 0 ? "div" : w, x = e.gapMode, E = Ni(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = g, I = Mm([n, t]), N = Ve(Ve({}, E), o);
|
|
5715
5717
|
return l.createElement(
|
|
5716
5718
|
l.Fragment,
|
|
5717
5719
|
null,
|
|
@@ -5972,8 +5974,8 @@ function ig(e) {
|
|
|
5972
5974
|
return !1;
|
|
5973
5975
|
if (!r.current && "changedTouches" in h && (x || E) && (r.current = C), !C)
|
|
5974
5976
|
return !0;
|
|
5975
|
-
var
|
|
5976
|
-
return rg(
|
|
5977
|
+
var M = r.current || C;
|
|
5978
|
+
return rg(M, b, h, M === "h" ? x : E);
|
|
5977
5979
|
}, []), u = l.useCallback(function(h) {
|
|
5978
5980
|
var b = h;
|
|
5979
5981
|
if (!(!Rt.length || Rt[Rt.length - 1] !== s)) {
|
|
@@ -6034,13 +6036,13 @@ var lr = l.forwardRef(function(e, t) {
|
|
|
6034
6036
|
return l.createElement(cr, Ve({}, e, { ref: t, sideCar: lg }));
|
|
6035
6037
|
});
|
|
6036
6038
|
lr.classNames = cr.classNames;
|
|
6037
|
-
var no = ["Enter", " "], ug = ["ArrowDown", "PageUp", "Home"],
|
|
6039
|
+
var no = ["Enter", " "], ug = ["ArrowDown", "PageUp", "Home"], Mi = ["ArrowUp", "PageDown", "End"], dg = [...ug, ...Mi], fg = {
|
|
6038
6040
|
ltr: [...no, "ArrowRight"],
|
|
6039
6041
|
rtl: [...no, "ArrowLeft"]
|
|
6040
6042
|
}, pg = {
|
|
6041
6043
|
ltr: ["ArrowLeft"],
|
|
6042
6044
|
rtl: ["ArrowRight"]
|
|
6043
|
-
}, fn = "Menu", [Qt, hg, mg] = Co(fn), [vt,
|
|
6045
|
+
}, fn = "Menu", [Qt, hg, mg] = Co(fn), [vt, ki] = Ue(fn, [
|
|
6044
6046
|
mg,
|
|
6045
6047
|
Ut,
|
|
6046
6048
|
yi
|
|
@@ -6053,7 +6055,7 @@ var no = ["Enter", " "], ug = ["ArrowDown", "PageUp", "Home"], ki = ["ArrowUp",
|
|
|
6053
6055
|
return document.addEventListener("keydown", v, { capture: !0 }), () => {
|
|
6054
6056
|
document.removeEventListener("keydown", v, { capture: !0 }), document.removeEventListener("pointerdown", m, { capture: !0 }), document.removeEventListener("pointermove", m, { capture: !0 });
|
|
6055
6057
|
};
|
|
6056
|
-
}, []), /* @__PURE__ */ c(
|
|
6058
|
+
}, []), /* @__PURE__ */ c(Mo, { ...i, children: /* @__PURE__ */ c(
|
|
6057
6059
|
gg,
|
|
6058
6060
|
{
|
|
6059
6061
|
scope: t,
|
|
@@ -6079,7 +6081,7 @@ Li.displayName = fn;
|
|
|
6079
6081
|
var vg = "MenuAnchor", $o = l.forwardRef(
|
|
6080
6082
|
(e, t) => {
|
|
6081
6083
|
const { __scopeMenu: n, ...r } = e, o = ur(n);
|
|
6082
|
-
return /* @__PURE__ */ c(
|
|
6084
|
+
return /* @__PURE__ */ c(ko, { ...o, ...r, ref: t });
|
|
6083
6085
|
}
|
|
6084
6086
|
);
|
|
6085
6087
|
$o.displayName = vg;
|
|
@@ -6148,14 +6150,14 @@ var Oe = "MenuContent", [yg, Uo] = vt(Oe), Bi = l.forwardRef(
|
|
|
6148
6150
|
onDismiss: v,
|
|
6149
6151
|
disableOutsideScroll: m,
|
|
6150
6152
|
...h
|
|
6151
|
-
} = e, b = wt(Oe, n), w = pn(Oe, n), y = ur(n), x = Di(n), E = hg(n), [C, I] = l.useState(null), N = l.useRef(null), L = ne(t, N, b.onContentChange),
|
|
6153
|
+
} = e, b = wt(Oe, n), w = pn(Oe, n), y = ur(n), x = Di(n), E = hg(n), [C, I] = l.useState(null), N = l.useRef(null), L = ne(t, N, b.onContentChange), M = l.useRef(0), D = l.useRef(""), j = l.useRef(0), K = l.useRef(null), W = l.useRef("right"), B = l.useRef(0), q = m ? lr : l.Fragment, F = m ? { as: Cg, allowPinchZoom: !0 } : void 0, G = (P) => {
|
|
6152
6154
|
var V, oe;
|
|
6153
6155
|
const _ = D.current + P, O = E().filter((ie) => !ie.disabled), X = document.activeElement, $ = (V = O.find((ie) => ie.ref.current === X)) == null ? void 0 : V.textValue, z = O.map((ie) => ie.textValue), le = Dg(z, _, $), ae = (oe = O.find((ie) => ie.textValue === le)) == null ? void 0 : oe.ref.current;
|
|
6154
6156
|
(function ie(se) {
|
|
6155
|
-
D.current = se, window.clearTimeout(
|
|
6157
|
+
D.current = se, window.clearTimeout(M.current), se !== "" && (M.current = window.setTimeout(() => ie(""), 1e3));
|
|
6156
6158
|
})(_), ae && setTimeout(() => ae.focus());
|
|
6157
6159
|
};
|
|
6158
|
-
l.useEffect(() => () => window.clearTimeout(
|
|
6160
|
+
l.useEffect(() => () => window.clearTimeout(M.current), []), Eo();
|
|
6159
6161
|
const T = l.useCallback((P) => {
|
|
6160
6162
|
var O, X;
|
|
6161
6163
|
return W.current === ((O = K.current) == null ? void 0 : O.side) && Fg(P, (X = K.current) == null ? void 0 : X.area);
|
|
@@ -6241,10 +6243,10 @@ var Oe = "MenuContent", [yg, Uo] = vt(Oe), Bi = l.forwardRef(
|
|
|
6241
6243
|
if (P.target !== z || !dg.includes(P.key)) return;
|
|
6242
6244
|
P.preventDefault();
|
|
6243
6245
|
const ae = E().filter((V) => !V.disabled).map((V) => V.ref.current);
|
|
6244
|
-
|
|
6246
|
+
Mi.includes(P.key) && ae.reverse(), Mg(ae);
|
|
6245
6247
|
}),
|
|
6246
6248
|
onBlur: U(e.onBlur, (P) => {
|
|
6247
|
-
P.currentTarget.contains(P.target) || (window.clearTimeout(
|
|
6249
|
+
P.currentTarget.contains(P.target) || (window.clearTimeout(M.current), D.current = "");
|
|
6248
6250
|
}),
|
|
6249
6251
|
onPointerMove: U(
|
|
6250
6252
|
e.onPointerMove,
|
|
@@ -6571,17 +6573,17 @@ function Wn(e) {
|
|
|
6571
6573
|
function Vo(e) {
|
|
6572
6574
|
return Wn(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
6573
6575
|
}
|
|
6574
|
-
function
|
|
6576
|
+
function Mg(e) {
|
|
6575
6577
|
const t = document.activeElement;
|
|
6576
6578
|
for (const n of e)
|
|
6577
6579
|
if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
6578
6580
|
}
|
|
6579
|
-
function
|
|
6581
|
+
function kg(e, t) {
|
|
6580
6582
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
6581
6583
|
}
|
|
6582
6584
|
function Dg(e, t, n) {
|
|
6583
6585
|
const o = t.length > 1 && Array.from(t).every((f) => f === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
|
|
6584
|
-
let a =
|
|
6586
|
+
let a = kg(e, Math.max(s, 0));
|
|
6585
6587
|
o.length === 1 && (a = a.filter((f) => f !== n));
|
|
6586
6588
|
const u = a.find(
|
|
6587
6589
|
(f) => f.toLowerCase().startsWith(o.toLowerCase())
|
|
@@ -6607,8 +6609,8 @@ function en(e) {
|
|
|
6607
6609
|
}
|
|
6608
6610
|
var $g = Li, Bg = $o, Ug = $i, zg = Bi, Hg = Ho, Wg = Ui, Vg = dr, jg = Hi, Kg = Vi, Gg = Ki, qg = qi, Xg = Xi, Yg = Yi, Jg = Zi, Zg = ec, fr = "DropdownMenu", [Qg, Cy] = Ue(
|
|
6609
6611
|
fr,
|
|
6610
|
-
[
|
|
6611
|
-
), Ee =
|
|
6612
|
+
[ki]
|
|
6613
|
+
), Ee = ki(), [eb, nc] = Qg(fr), rc = (e) => {
|
|
6612
6614
|
const {
|
|
6613
6615
|
__scopeDropdownMenu: t,
|
|
6614
6616
|
children: n,
|
|
@@ -6916,30 +6918,30 @@ function Pn({
|
|
|
6916
6918
|
listCheckpoints: y,
|
|
6917
6919
|
navigateToCheckpoint: x,
|
|
6918
6920
|
returnToLatest: E
|
|
6919
|
-
} = Ua(), [C, I] = ce(""), [N, L] = ce(null), [
|
|
6921
|
+
} = Ua(), [C, I] = ce(""), [N, L] = ce(null), [M, D] = ce(null), [j, K] = ce([]), [W, B] = ce(!1), [q, F] = ce([]), [G, T] = ce(null), P = rt(null), _ = rt(null), O = rt(null), [X, $] = ce("desktop");
|
|
6920
6922
|
we(() => {
|
|
6921
|
-
const
|
|
6923
|
+
const k = () => {
|
|
6922
6924
|
const Q = window.innerWidth;
|
|
6923
6925
|
$(Q < 640 ? "phone" : Q < 1024 ? "tablet" : "desktop");
|
|
6924
6926
|
};
|
|
6925
|
-
return
|
|
6927
|
+
return k(), window.addEventListener("resize", k), () => window.removeEventListener("resize", k);
|
|
6926
6928
|
}, []), we(() => {
|
|
6927
|
-
var
|
|
6928
|
-
(
|
|
6929
|
+
var k;
|
|
6930
|
+
(k = P.current) == null || k.scrollIntoView({ behavior: "smooth" });
|
|
6929
6931
|
}, [p]), we(() => {
|
|
6930
|
-
var
|
|
6931
|
-
n && ((
|
|
6932
|
+
var k;
|
|
6933
|
+
n && ((k = _.current) == null || k.focus());
|
|
6932
6934
|
}, [n]), we(() => {
|
|
6933
6935
|
m && !W && (f == null || f(m));
|
|
6934
6936
|
}, [m, W, f]), we(() => {
|
|
6935
|
-
let
|
|
6937
|
+
let k = !0;
|
|
6936
6938
|
if (!d) {
|
|
6937
6939
|
F([]), T(null);
|
|
6938
6940
|
return;
|
|
6939
6941
|
}
|
|
6940
6942
|
return y(d).then((Q) => {
|
|
6941
6943
|
var Re;
|
|
6942
|
-
if (!
|
|
6944
|
+
if (!k) return;
|
|
6943
6945
|
const re = Q.checkpoints || [];
|
|
6944
6946
|
F(re);
|
|
6945
6947
|
const ue = ((Re = re.slice().sort(
|
|
@@ -6948,32 +6950,32 @@ function Pn({
|
|
|
6948
6950
|
T((yt) => yt ?? ue);
|
|
6949
6951
|
}).catch(() => {
|
|
6950
6952
|
}), () => {
|
|
6951
|
-
|
|
6953
|
+
k = !1;
|
|
6952
6954
|
};
|
|
6953
6955
|
}, [d, y]), we(() => {
|
|
6954
6956
|
w && T(w);
|
|
6955
6957
|
}, [w]);
|
|
6956
|
-
const z = (
|
|
6957
|
-
if (
|
|
6958
|
-
return `Message too long (${
|
|
6958
|
+
const z = (k) => {
|
|
6959
|
+
if (k.length > Nt)
|
|
6960
|
+
return `Message too long (${k.length}/${Nt} characters)`;
|
|
6959
6961
|
try {
|
|
6960
|
-
return Ip(
|
|
6962
|
+
return Ip(k), null;
|
|
6961
6963
|
} catch (Q) {
|
|
6962
6964
|
return (Q == null ? void 0 : Q.message) || "Invalid message";
|
|
6963
6965
|
}
|
|
6964
|
-
}, le = (
|
|
6965
|
-
const Q =
|
|
6966
|
+
}, le = (k) => {
|
|
6967
|
+
const Q = k.content || [], re = Q.filter((ue) => ue.type === "text").map((ue) => ue.text).join("");
|
|
6966
6968
|
if (re) return re;
|
|
6967
6969
|
try {
|
|
6968
6970
|
return JSON.stringify(Q, null, 2);
|
|
6969
6971
|
} catch {
|
|
6970
6972
|
return String(Q);
|
|
6971
6973
|
}
|
|
6972
|
-
}, ae = (
|
|
6974
|
+
}, ae = (k) => {
|
|
6973
6975
|
var yt;
|
|
6974
6976
|
if (!q.length)
|
|
6975
6977
|
return [];
|
|
6976
|
-
const re = (((yt = p[
|
|
6978
|
+
const re = (((yt = p[k]) == null ? void 0 : yt.role) ?? "user") === "user", ue = re ? k + 2 : k + 1;
|
|
6977
6979
|
return q.filter((Se) => (Se.messagesLen ?? -1) >= (re ? ue : 0)).filter((Se) => re ? (Se.messagesLen ?? 0) >= ue : (Se.messagesLen ?? 0) === ue).map((Se) => ({
|
|
6978
6980
|
checkpoint_id: Se.checkpointId,
|
|
6979
6981
|
checkpoint_ns: Se.checkpointNs,
|
|
@@ -6981,54 +6983,54 @@ function Pn({
|
|
|
6981
6983
|
last_message_preview: Se.preview ?? void 0,
|
|
6982
6984
|
ts: new Date(Se.createdAt).getTime(),
|
|
6983
6985
|
isCurrent: Se.checkpointId === G
|
|
6984
|
-
})).sort((Se,
|
|
6985
|
-
}, V = (
|
|
6986
|
-
if (
|
|
6986
|
+
})).sort((Se, ku) => (Se.ts || 0) - (ku.ts || 0));
|
|
6987
|
+
}, V = (k) => {
|
|
6988
|
+
if (k === void 0)
|
|
6987
6989
|
return { canGoBack: !1, canGoForward: !1, currentIndex: 0, totalBranches: 0 };
|
|
6988
|
-
const Q = ae(
|
|
6990
|
+
const Q = ae(k);
|
|
6989
6991
|
if (Q.length <= 1)
|
|
6990
6992
|
return { canGoBack: !1, canGoForward: !1, currentIndex: 0, totalBranches: Q.length };
|
|
6991
6993
|
const re = Math.max(0, Q.findIndex((ue) => ue.isCurrent));
|
|
6992
6994
|
return { canGoBack: re > 0, canGoForward: re < Q.length - 1, currentIndex: re, totalBranches: Q.length };
|
|
6993
6995
|
}, oe = async () => {
|
|
6994
|
-
const
|
|
6995
|
-
if (!
|
|
6996
|
-
const Q = z(
|
|
6996
|
+
const k = C.trim();
|
|
6997
|
+
if (!k && j.length === 0) return;
|
|
6998
|
+
const Q = z(k);
|
|
6997
6999
|
if (Q) {
|
|
6998
7000
|
D(Q);
|
|
6999
7001
|
return;
|
|
7000
7002
|
}
|
|
7001
7003
|
try {
|
|
7002
7004
|
const re = window.__editingCheckpointId || G || void 0;
|
|
7003
|
-
await h(
|
|
7005
|
+
await h(k, { checkpointId: re, payloadExtras: N ? { edit: !0, originalMessageId: N } : void 0, attachments: j }), u == null || u(k), I(""), D(null), K([]), delete window.__editingCheckpointId, L(null), _.current && (_.current.style.height = "auto");
|
|
7004
7006
|
} catch (re) {
|
|
7005
7007
|
const ue = (re == null ? void 0 : re.message) || "Failed to send message";
|
|
7006
7008
|
D(ue), f == null || f(ue);
|
|
7007
7009
|
}
|
|
7008
|
-
}, ie = (
|
|
7009
|
-
a && (L(
|
|
7010
|
+
}, ie = (k, Q) => {
|
|
7011
|
+
a && (L(k), I(Q), D(null), setTimeout(() => {
|
|
7010
7012
|
_.current && (_.current.focus(), _.current.style.height = "auto", _.current.style.height = _.current.scrollHeight + "px");
|
|
7011
7013
|
}, 0));
|
|
7012
|
-
}, se = async (
|
|
7013
|
-
const re = p.find((Re) => Re.id ===
|
|
7014
|
+
}, se = async (k, Q) => {
|
|
7015
|
+
const re = p.find((Re) => Re.id === k);
|
|
7014
7016
|
if (!re) {
|
|
7015
7017
|
D("Message not found");
|
|
7016
7018
|
return;
|
|
7017
7019
|
}
|
|
7018
7020
|
const ue = le(re);
|
|
7019
|
-
L(
|
|
7021
|
+
L(k), I(ue), window.__editingCheckpointId = Q, setTimeout(() => {
|
|
7020
7022
|
var Re;
|
|
7021
7023
|
return (Re = _.current) == null ? void 0 : Re.focus();
|
|
7022
7024
|
}, 0);
|
|
7023
7025
|
}, H = () => {
|
|
7024
7026
|
L(null), I(""), D(null), delete window.__editingCheckpointId, _.current && (_.current.style.height = "auto");
|
|
7025
|
-
}, Z = (
|
|
7026
|
-
|
|
7027
|
-
}, de = (
|
|
7028
|
-
const Q = Array.from(
|
|
7027
|
+
}, Z = (k) => {
|
|
7028
|
+
k.key === "Enter" && !k.shiftKey ? (k.preventDefault(), oe()) : k.key === "Escape" && N && (k.preventDefault(), H());
|
|
7029
|
+
}, de = (k) => {
|
|
7030
|
+
const Q = Array.from(k.target.files || []);
|
|
7029
7031
|
K((re) => [...re, ...Q]);
|
|
7030
|
-
}, pe = (
|
|
7031
|
-
d && (await x(
|
|
7032
|
+
}, pe = (k) => K((Q) => Q.filter((re, ue) => k !== ue)), Y = async (k) => {
|
|
7033
|
+
d && (await x(k), T(k));
|
|
7032
7034
|
}, ge = async () => {
|
|
7033
7035
|
await E(), T(null);
|
|
7034
7036
|
}, te = `flex flex-col h-full min-w-0 bg-transparent ${e} ${i.container || ""}`, he = `flex-1 min-h-0 min-w-0 overflow-y-auto p-4 space-y-4 bg-transparent ${i.messagesArea || ""}`, ve = `flex-shrink-0 border-t p-4 bg-transparent ${i.inputArea || ""}`;
|
|
@@ -7055,29 +7057,29 @@ function Pn({
|
|
|
7055
7057
|
{
|
|
7056
7058
|
className: "border rounded px-2 py-1 text-xs",
|
|
7057
7059
|
value: G ?? "",
|
|
7058
|
-
onChange: (
|
|
7059
|
-
const Q =
|
|
7060
|
+
onChange: (k) => {
|
|
7061
|
+
const Q = k.target.value || null;
|
|
7060
7062
|
Q ? Y(Q) : ge();
|
|
7061
7063
|
},
|
|
7062
7064
|
children: [
|
|
7063
7065
|
/* @__PURE__ */ c("option", { value: "", children: "Latest" }),
|
|
7064
|
-
q.slice().sort((
|
|
7065
|
-
new Date(
|
|
7066
|
-
|
|
7067
|
-
] },
|
|
7066
|
+
q.slice().sort((k, Q) => new Date(Q.createdAt).getTime() - new Date(k.createdAt).getTime()).map((k) => /* @__PURE__ */ R("option", { value: k.checkpointId, children: [
|
|
7067
|
+
new Date(k.createdAt).toLocaleString(),
|
|
7068
|
+
k.preview ? ` — ${k.preview.slice(0, 30)}` : ""
|
|
7069
|
+
] }, k.checkpointId))
|
|
7068
7070
|
]
|
|
7069
7071
|
}
|
|
7070
7072
|
)
|
|
7071
7073
|
] }),
|
|
7072
7074
|
/* @__PURE__ */ R("div", { className: he, style: r ? { maxHeight: r } : void 0, children: [
|
|
7073
|
-
p.length === 0 ? /* @__PURE__ */ c("div", { className: "flex items-center justify-center py-8 text-muted-foreground", children: "No messages yet. Start a conversation!" }) : p.map((
|
|
7075
|
+
p.length === 0 ? /* @__PURE__ */ c("div", { className: "flex items-center justify-center py-8 text-muted-foreground", children: "No messages yet. Start a conversation!" }) : p.map((k, Q) => /* @__PURE__ */ c(
|
|
7074
7076
|
gp,
|
|
7075
7077
|
{
|
|
7076
|
-
message:
|
|
7078
|
+
message: k,
|
|
7077
7079
|
messageIndex: Q,
|
|
7078
|
-
isStreamingMessage: g && v ===
|
|
7080
|
+
isStreamingMessage: g && v === k.id,
|
|
7079
7081
|
streamingDebounceMs: o,
|
|
7080
|
-
isEditing: N ===
|
|
7082
|
+
isEditing: N === k.id,
|
|
7081
7083
|
showActions: a,
|
|
7082
7084
|
showTimestamp: !1,
|
|
7083
7085
|
showAgentName: !0,
|
|
@@ -7105,7 +7107,7 @@ function Pn({
|
|
|
7105
7107
|
},
|
|
7106
7108
|
onCancelEdit: H
|
|
7107
7109
|
},
|
|
7108
|
-
|
|
7110
|
+
k.id || Q
|
|
7109
7111
|
)),
|
|
7110
7112
|
/* @__PURE__ */ c("div", { ref: P })
|
|
7111
7113
|
] }),
|
|
@@ -7133,13 +7135,13 @@ function Pn({
|
|
|
7133
7135
|
ref: O,
|
|
7134
7136
|
type: "file",
|
|
7135
7137
|
multiple: !0,
|
|
7136
|
-
onChange: (
|
|
7138
|
+
onChange: (k) => de(k),
|
|
7137
7139
|
className: "hidden"
|
|
7138
7140
|
}
|
|
7139
7141
|
),
|
|
7140
|
-
j.length > 0 && /* @__PURE__ */ c("div", { className: "mb-3 flex flex-wrap gap-2", children: j.map((
|
|
7142
|
+
j.length > 0 && /* @__PURE__ */ c("div", { className: "mb-3 flex flex-wrap gap-2", children: j.map((k, Q) => /* @__PURE__ */ R("div", { className: "flex items-center gap-2 bg-gray-100 rounded-lg px-3 py-2 text-sm", children: [
|
|
7141
7143
|
/* @__PURE__ */ c(ss, { size: 14 }),
|
|
7142
|
-
/* @__PURE__ */ c("span", { className: "truncate max-w-[150px]", children:
|
|
7144
|
+
/* @__PURE__ */ c("span", { className: "truncate max-w-[150px]", children: k.name }),
|
|
7143
7145
|
/* @__PURE__ */ c(
|
|
7144
7146
|
fe,
|
|
7145
7147
|
{
|
|
@@ -7147,13 +7149,13 @@ function Pn({
|
|
|
7147
7149
|
size: "sm",
|
|
7148
7150
|
onClick: () => pe(Q),
|
|
7149
7151
|
className: "h-4 w-4 p-0 text-gray-500 hover:text-red-500",
|
|
7150
|
-
"aria-label": `Remove ${
|
|
7152
|
+
"aria-label": `Remove ${k.name}`,
|
|
7151
7153
|
children: /* @__PURE__ */ c(Kt, { size: 12 })
|
|
7152
7154
|
}
|
|
7153
7155
|
)
|
|
7154
7156
|
] }, Q)) })
|
|
7155
7157
|
] }),
|
|
7156
|
-
|
|
7158
|
+
M && /* @__PURE__ */ c("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: M }),
|
|
7157
7159
|
/* @__PURE__ */ R("div", { className: "flex items-end gap-2", children: [
|
|
7158
7160
|
s && /* @__PURE__ */ R(wb, { children: [
|
|
7159
7161
|
/* @__PURE__ */ c(yb, { asChild: !0, children: /* @__PURE__ */ c(
|
|
@@ -7169,8 +7171,8 @@ function Pn({
|
|
|
7169
7171
|
}
|
|
7170
7172
|
) }),
|
|
7171
7173
|
/* @__PURE__ */ c(Nc, { align: "start", sideOffset: 6, className: "w-52", children: /* @__PURE__ */ R(Tc, { onClick: () => {
|
|
7172
|
-
var
|
|
7173
|
-
return (
|
|
7174
|
+
var k;
|
|
7175
|
+
return (k = O.current) == null ? void 0 : k.click();
|
|
7174
7176
|
}, className: "cursor-pointer", children: [
|
|
7175
7177
|
/* @__PURE__ */ c(ss, { className: "h-4 w-4 mr-2" }),
|
|
7176
7178
|
" Attach files or images"
|
|
@@ -7181,12 +7183,12 @@ function Pn({
|
|
|
7181
7183
|
{
|
|
7182
7184
|
ref: _,
|
|
7183
7185
|
value: C,
|
|
7184
|
-
onChange: (
|
|
7185
|
-
I(
|
|
7186
|
+
onChange: (k) => {
|
|
7187
|
+
I(k.target.value), D(null), _.current && (_.current.style.height = "auto", _.current.style.height = `${_.current.scrollHeight}px`);
|
|
7186
7188
|
},
|
|
7187
7189
|
onKeyDown: Z,
|
|
7188
7190
|
placeholder: N ? "Edit your message..." : t,
|
|
7189
|
-
className: `resize-none min-h-[44px] max-h-[20rem] w-full ${N ? "border-blue-400 bg-blue-50" : ""} ${
|
|
7191
|
+
className: `resize-none min-h-[44px] max-h-[20rem] w-full ${N ? "border-blue-400 bg-blue-50" : ""} ${M ? "border-red-400" : ""} ${i.textarea || ""}`,
|
|
7190
7192
|
disabled: !1,
|
|
7191
7193
|
maxLength: Nt,
|
|
7192
7194
|
rows: 1
|
|
@@ -7245,7 +7247,7 @@ function ro(e, [t, n]) {
|
|
|
7245
7247
|
function Tb(e, t) {
|
|
7246
7248
|
return l.useReducer((n, r) => t[n][r] ?? n, e);
|
|
7247
7249
|
}
|
|
7248
|
-
var jo = "ScrollArea", [Ac, Ey] = Ue(jo), [Ab,
|
|
7250
|
+
var jo = "ScrollArea", [Ac, Ey] = Ue(jo), [Ab, Me] = Ac(jo), Pc = l.forwardRef(
|
|
7249
7251
|
(e, t) => {
|
|
7250
7252
|
const {
|
|
7251
7253
|
__scopeScrollArea: n,
|
|
@@ -7253,7 +7255,7 @@ var jo = "ScrollArea", [Ac, Ey] = Ue(jo), [Ab, ke] = Ac(jo), Pc = l.forwardRef(
|
|
|
7253
7255
|
dir: o,
|
|
7254
7256
|
scrollHideDelay: s = 600,
|
|
7255
7257
|
...a
|
|
7256
|
-
} = e, [i, u] = l.useState(null), [f, d] = l.useState(null), [p, g] = l.useState(null), [v, m] = l.useState(null), [h, b] = l.useState(null), [w, y] = l.useState(0), [x, E] = l.useState(0), [C, I] = l.useState(!1), [N, L] = l.useState(!1),
|
|
7258
|
+
} = e, [i, u] = l.useState(null), [f, d] = l.useState(null), [p, g] = l.useState(null), [v, m] = l.useState(null), [h, b] = l.useState(null), [w, y] = l.useState(0), [x, E] = l.useState(0), [C, I] = l.useState(!1), [N, L] = l.useState(!1), M = ne(t, (j) => u(j)), D = tr(o);
|
|
7257
7259
|
return /* @__PURE__ */ c(
|
|
7258
7260
|
Ab,
|
|
7259
7261
|
{
|
|
@@ -7281,7 +7283,7 @@ var jo = "ScrollArea", [Ac, Ey] = Ue(jo), [Ab, ke] = Ac(jo), Pc = l.forwardRef(
|
|
|
7281
7283
|
{
|
|
7282
7284
|
dir: D,
|
|
7283
7285
|
...a,
|
|
7284
|
-
ref:
|
|
7286
|
+
ref: M,
|
|
7285
7287
|
style: {
|
|
7286
7288
|
position: "relative",
|
|
7287
7289
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
@@ -7298,7 +7300,7 @@ var jo = "ScrollArea", [Ac, Ey] = Ue(jo), [Ab, ke] = Ac(jo), Pc = l.forwardRef(
|
|
|
7298
7300
|
Pc.displayName = jo;
|
|
7299
7301
|
var _c = "ScrollAreaViewport", Ic = l.forwardRef(
|
|
7300
7302
|
(e, t) => {
|
|
7301
|
-
const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a =
|
|
7303
|
+
const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a = Me(_c, n), i = l.useRef(null), u = ne(t, i, a.onViewportChange);
|
|
7302
7304
|
return /* @__PURE__ */ R(De, { children: [
|
|
7303
7305
|
/* @__PURE__ */ c(
|
|
7304
7306
|
"style",
|
|
@@ -7340,7 +7342,7 @@ var _c = "ScrollAreaViewport", Ic = l.forwardRef(
|
|
|
7340
7342
|
Ic.displayName = _c;
|
|
7341
7343
|
var Ye = "ScrollAreaScrollbar", Ko = l.forwardRef(
|
|
7342
7344
|
(e, t) => {
|
|
7343
|
-
const { forceMount: n, ...r } = e, o =
|
|
7345
|
+
const { forceMount: n, ...r } = e, o = Me(Ye, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
|
|
7344
7346
|
return l.useEffect(() => (i ? s(!0) : a(!0), () => {
|
|
7345
7347
|
i ? s(!1) : a(!1);
|
|
7346
7348
|
}), [i, s, a]), o.type === "hover" ? /* @__PURE__ */ c(Pb, { ...r, ref: t, forceMount: n }) : o.type === "scroll" ? /* @__PURE__ */ c(_b, { ...r, ref: t, forceMount: n }) : o.type === "auto" ? /* @__PURE__ */ c(Oc, { ...r, ref: t, forceMount: n }) : o.type === "always" ? /* @__PURE__ */ c(Go, { ...r, ref: t }) : null;
|
|
@@ -7348,7 +7350,7 @@ var Ye = "ScrollAreaScrollbar", Ko = l.forwardRef(
|
|
|
7348
7350
|
);
|
|
7349
7351
|
Ko.displayName = Ye;
|
|
7350
7352
|
var Pb = l.forwardRef((e, t) => {
|
|
7351
|
-
const { forceMount: n, ...r } = e, o =
|
|
7353
|
+
const { forceMount: n, ...r } = e, o = Me(Ye, e.__scopeScrollArea), [s, a] = l.useState(!1);
|
|
7352
7354
|
return l.useEffect(() => {
|
|
7353
7355
|
const i = o.scrollArea;
|
|
7354
7356
|
let u = 0;
|
|
@@ -7371,7 +7373,7 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7371
7373
|
}
|
|
7372
7374
|
) });
|
|
7373
7375
|
}), _b = l.forwardRef((e, t) => {
|
|
7374
|
-
const { forceMount: n, ...r } = e, o =
|
|
7376
|
+
const { forceMount: n, ...r } = e, o = Me(Ye, e.__scopeScrollArea), s = e.orientation === "horizontal", a = hr(() => u("SCROLL_END"), 100), [i, u] = Tb("hidden", {
|
|
7375
7377
|
hidden: {
|
|
7376
7378
|
SCROLL: "scrolling"
|
|
7377
7379
|
},
|
|
@@ -7415,13 +7417,13 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7415
7417
|
}
|
|
7416
7418
|
) });
|
|
7417
7419
|
}), Oc = l.forwardRef((e, t) => {
|
|
7418
|
-
const n =
|
|
7420
|
+
const n = Me(Ye, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, a] = l.useState(!1), i = e.orientation === "horizontal", u = hr(() => {
|
|
7419
7421
|
if (n.viewport) {
|
|
7420
7422
|
const f = n.viewport.offsetWidth < n.viewport.scrollWidth, d = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
7421
7423
|
a(i ? f : d);
|
|
7422
7424
|
}
|
|
7423
7425
|
}, 10);
|
|
7424
|
-
return
|
|
7426
|
+
return Mt(n.viewport, u), Mt(n.content, u), /* @__PURE__ */ c(Ae, { present: r || s, children: /* @__PURE__ */ c(
|
|
7425
7427
|
Go,
|
|
7426
7428
|
{
|
|
7427
7429
|
"data-state": s ? "visible" : "hidden",
|
|
@@ -7430,7 +7432,7 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7430
7432
|
}
|
|
7431
7433
|
) });
|
|
7432
7434
|
}), Go = l.forwardRef((e, t) => {
|
|
7433
|
-
const { orientation: n = "vertical", ...r } = e, o =
|
|
7435
|
+
const { orientation: n = "vertical", ...r } = e, o = Me(Ye, e.__scopeScrollArea), s = l.useRef(null), a = l.useRef(0), [i, u] = l.useState({
|
|
7434
7436
|
content: 0,
|
|
7435
7437
|
viewport: 0,
|
|
7436
7438
|
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
@@ -7484,11 +7486,11 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7484
7486
|
}
|
|
7485
7487
|
) : null;
|
|
7486
7488
|
}), Ib = l.forwardRef((e, t) => {
|
|
7487
|
-
const { sizes: n, onSizesChange: r, ...o } = e, s =
|
|
7489
|
+
const { sizes: n, onSizesChange: r, ...o } = e, s = Me(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = ne(t, u, s.onScrollbarXChange);
|
|
7488
7490
|
return l.useEffect(() => {
|
|
7489
7491
|
u.current && i(getComputedStyle(u.current));
|
|
7490
7492
|
}, [u]), /* @__PURE__ */ c(
|
|
7491
|
-
|
|
7493
|
+
kc,
|
|
7492
7494
|
{
|
|
7493
7495
|
"data-orientation": "horizontal",
|
|
7494
7496
|
...o,
|
|
@@ -7523,11 +7525,11 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7523
7525
|
}
|
|
7524
7526
|
);
|
|
7525
7527
|
}), Ob = l.forwardRef((e, t) => {
|
|
7526
|
-
const { sizes: n, onSizesChange: r, ...o } = e, s =
|
|
7528
|
+
const { sizes: n, onSizesChange: r, ...o } = e, s = Me(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = ne(t, u, s.onScrollbarYChange);
|
|
7527
7529
|
return l.useEffect(() => {
|
|
7528
7530
|
u.current && i(getComputedStyle(u.current));
|
|
7529
7531
|
}, [u]), /* @__PURE__ */ c(
|
|
7530
|
-
|
|
7532
|
+
kc,
|
|
7531
7533
|
{
|
|
7532
7534
|
"data-orientation": "vertical",
|
|
7533
7535
|
...o,
|
|
@@ -7562,7 +7564,7 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7562
7564
|
}
|
|
7563
7565
|
}
|
|
7564
7566
|
);
|
|
7565
|
-
}), [
|
|
7567
|
+
}), [Mb, Mc] = Ac(Ye), kc = l.forwardRef((e, t) => {
|
|
7566
7568
|
const {
|
|
7567
7569
|
__scopeScrollArea: n,
|
|
7568
7570
|
sizes: r,
|
|
@@ -7575,21 +7577,21 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7575
7577
|
onWheelScroll: d,
|
|
7576
7578
|
onResize: p,
|
|
7577
7579
|
...g
|
|
7578
|
-
} = e, v =
|
|
7579
|
-
function L(
|
|
7580
|
+
} = e, v = Me(Ye, n), [m, h] = l.useState(null), b = ne(t, (M) => h(M)), w = l.useRef(null), y = l.useRef(""), x = v.viewport, E = r.content - r.viewport, C = ye(d), I = ye(u), N = hr(p, 10);
|
|
7581
|
+
function L(M) {
|
|
7580
7582
|
if (w.current) {
|
|
7581
|
-
const D =
|
|
7583
|
+
const D = M.clientX - w.current.left, j = M.clientY - w.current.top;
|
|
7582
7584
|
f({ x: D, y: j });
|
|
7583
7585
|
}
|
|
7584
7586
|
}
|
|
7585
7587
|
return l.useEffect(() => {
|
|
7586
|
-
const
|
|
7588
|
+
const M = (D) => {
|
|
7587
7589
|
const j = D.target;
|
|
7588
7590
|
(m == null ? void 0 : m.contains(j)) && C(D, E);
|
|
7589
7591
|
};
|
|
7590
|
-
return document.addEventListener("wheel",
|
|
7591
|
-
}, [x, m, E, C]), l.useEffect(I, [r, I]),
|
|
7592
|
-
|
|
7592
|
+
return document.addEventListener("wheel", M, { passive: !1 }), () => document.removeEventListener("wheel", M, { passive: !1 });
|
|
7593
|
+
}, [x, m, E, C]), l.useEffect(I, [r, I]), Mt(m, N), Mt(v.content, N), /* @__PURE__ */ c(
|
|
7594
|
+
Mb,
|
|
7593
7595
|
{
|
|
7594
7596
|
scope: n,
|
|
7595
7597
|
scrollbar: m,
|
|
@@ -7604,13 +7606,13 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7604
7606
|
...g,
|
|
7605
7607
|
ref: b,
|
|
7606
7608
|
style: { position: "absolute", ...g.style },
|
|
7607
|
-
onPointerDown: U(e.onPointerDown, (
|
|
7608
|
-
|
|
7609
|
+
onPointerDown: U(e.onPointerDown, (M) => {
|
|
7610
|
+
M.button === 0 && (M.target.setPointerCapture(M.pointerId), w.current = m.getBoundingClientRect(), y.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), L(M));
|
|
7609
7611
|
}),
|
|
7610
7612
|
onPointerMove: U(e.onPointerMove, L),
|
|
7611
|
-
onPointerUp: U(e.onPointerUp, (
|
|
7612
|
-
const D =
|
|
7613
|
-
D.hasPointerCapture(
|
|
7613
|
+
onPointerUp: U(e.onPointerUp, (M) => {
|
|
7614
|
+
const D = M.target;
|
|
7615
|
+
D.hasPointerCapture(M.pointerId) && D.releasePointerCapture(M.pointerId), document.body.style.webkitUserSelect = y.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
|
|
7614
7616
|
})
|
|
7615
7617
|
}
|
|
7616
7618
|
)
|
|
@@ -7618,12 +7620,12 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7618
7620
|
);
|
|
7619
7621
|
}), Vn = "ScrollAreaThumb", Dc = l.forwardRef(
|
|
7620
7622
|
(e, t) => {
|
|
7621
|
-
const { forceMount: n, ...r } = e, o =
|
|
7622
|
-
return /* @__PURE__ */ c(Ae, { present: n || o.hasThumb, children: /* @__PURE__ */ c(
|
|
7623
|
+
const { forceMount: n, ...r } = e, o = Mc(Vn, e.__scopeScrollArea);
|
|
7624
|
+
return /* @__PURE__ */ c(Ae, { present: n || o.hasThumb, children: /* @__PURE__ */ c(kb, { ref: t, ...r }) });
|
|
7623
7625
|
}
|
|
7624
|
-
),
|
|
7626
|
+
), kb = l.forwardRef(
|
|
7625
7627
|
(e, t) => {
|
|
7626
|
-
const { __scopeScrollArea: n, style: r, ...o } = e, s =
|
|
7628
|
+
const { __scopeScrollArea: n, style: r, ...o } = e, s = Me(Vn, n), a = Mc(Vn, n), { onThumbPositionChange: i } = a, u = ne(
|
|
7627
7629
|
t,
|
|
7628
7630
|
(p) => a.onThumbChange(p)
|
|
7629
7631
|
), f = l.useRef(void 0), d = hr(() => {
|
|
@@ -7663,18 +7665,18 @@ var Pb = l.forwardRef((e, t) => {
|
|
|
7663
7665
|
Dc.displayName = Vn;
|
|
7664
7666
|
var qo = "ScrollAreaCorner", Lc = l.forwardRef(
|
|
7665
7667
|
(e, t) => {
|
|
7666
|
-
const n =
|
|
7668
|
+
const n = Me(qo, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
7667
7669
|
return n.type !== "scroll" && r ? /* @__PURE__ */ c(Db, { ...e, ref: t }) : null;
|
|
7668
7670
|
}
|
|
7669
7671
|
);
|
|
7670
7672
|
Lc.displayName = qo;
|
|
7671
7673
|
var Db = l.forwardRef((e, t) => {
|
|
7672
|
-
const { __scopeScrollArea: n, ...r } = e, o =
|
|
7673
|
-
return
|
|
7674
|
+
const { __scopeScrollArea: n, ...r } = e, o = Me(qo, n), [s, a] = l.useState(0), [i, u] = l.useState(0), f = !!(s && i);
|
|
7675
|
+
return Mt(o.scrollbarX, () => {
|
|
7674
7676
|
var p;
|
|
7675
7677
|
const d = ((p = o.scrollbarX) == null ? void 0 : p.offsetHeight) || 0;
|
|
7676
7678
|
o.onCornerHeightChange(d), u(d);
|
|
7677
|
-
}),
|
|
7679
|
+
}), Mt(o.scrollbarY, () => {
|
|
7678
7680
|
var p;
|
|
7679
7681
|
const d = ((p = o.scrollbarY) == null ? void 0 : p.offsetWidth) || 0;
|
|
7680
7682
|
o.onCornerWidthChange(d), a(d);
|
|
@@ -7738,7 +7740,7 @@ function hr(e, t) {
|
|
|
7738
7740
|
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
7739
7741
|
}, [n, t]);
|
|
7740
7742
|
}
|
|
7741
|
-
function
|
|
7743
|
+
function Mt(e, t) {
|
|
7742
7744
|
const n = ye(t);
|
|
7743
7745
|
be(() => {
|
|
7744
7746
|
let r = 0;
|
|
@@ -7804,7 +7806,7 @@ function oo({
|
|
|
7804
7806
|
createThread: h,
|
|
7805
7807
|
deleteThread: b,
|
|
7806
7808
|
renameThread: w
|
|
7807
|
-
} = Ua(), [y, x] = ce(g ?? []), [E, C] = ce(!1), [I, N] = ce(null), [L,
|
|
7809
|
+
} = Ua(), [y, x] = ce(g ?? []), [E, C] = ce(!1), [I, N] = ce(null), [L, M] = ce(null), [D, j] = ce(""), [K, W] = ce(!1);
|
|
7808
7810
|
we(() => {
|
|
7809
7811
|
x(g ?? []);
|
|
7810
7812
|
}, [g]);
|
|
@@ -7832,16 +7834,16 @@ function oo({
|
|
|
7832
7834
|
console.error("Failed to delete thread:", le);
|
|
7833
7835
|
}
|
|
7834
7836
|
}, G = ($, z) => {
|
|
7835
|
-
z.stopPropagation(),
|
|
7837
|
+
z.stopPropagation(), M($.threadId), j($.title || `Thread ${$.threadId.slice(0, 8)}`);
|
|
7836
7838
|
}, T = async ($) => {
|
|
7837
7839
|
if (D.trim())
|
|
7838
7840
|
try {
|
|
7839
|
-
await w($, D.trim()),
|
|
7841
|
+
await w($, D.trim()), M(null), j("");
|
|
7840
7842
|
} catch (z) {
|
|
7841
7843
|
console.error("Failed to update title:", z);
|
|
7842
7844
|
}
|
|
7843
7845
|
}, P = () => {
|
|
7844
|
-
|
|
7846
|
+
M(null), j("");
|
|
7845
7847
|
}, _ = ($, z) => {
|
|
7846
7848
|
$.key === "Enter" ? T(z) : $.key === "Escape" && P();
|
|
7847
7849
|
}, O = ($) => {
|
|
@@ -8438,7 +8440,7 @@ var nn = "Tooltip", [gv, vr] = gr(nn), Sl = (e) => {
|
|
|
8438
8440
|
}, [h, y]);
|
|
8439
8441
|
return l.useEffect(() => () => {
|
|
8440
8442
|
v.current && (window.clearTimeout(v.current), v.current = 0);
|
|
8441
|
-
}, []), /* @__PURE__ */ c(
|
|
8443
|
+
}, []), /* @__PURE__ */ c(Mo, { ...f, children: /* @__PURE__ */ c(
|
|
8442
8444
|
gv,
|
|
8443
8445
|
{
|
|
8444
8446
|
scope: t,
|
|
@@ -8464,7 +8466,7 @@ Sl.displayName = nn;
|
|
|
8464
8466
|
var ao = "TooltipTrigger", Cl = l.forwardRef(
|
|
8465
8467
|
(e, t) => {
|
|
8466
8468
|
const { __scopeTooltip: n, ...r } = e, o = vr(ao, n), s = es(ao, n), a = br(n), i = l.useRef(null), u = ne(t, i, o.onTriggerChange), f = l.useRef(!1), d = l.useRef(!1), p = l.useCallback(() => f.current = !1, []);
|
|
8467
|
-
return l.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(
|
|
8469
|
+
return l.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(ko, { asChild: !0, ...a, children: /* @__PURE__ */ c(
|
|
8468
8470
|
J.button,
|
|
8469
8471
|
{
|
|
8470
8472
|
"aria-describedby": o.open ? o.contentId : void 0,
|
|
@@ -8492,13 +8494,13 @@ var ao = "TooltipTrigger", Cl = l.forwardRef(
|
|
|
8492
8494
|
Cl.displayName = ao;
|
|
8493
8495
|
var bv = "TooltipPortal", [Oy, vv] = gr(bv, {
|
|
8494
8496
|
forceMount: void 0
|
|
8495
|
-
}),
|
|
8497
|
+
}), kt = "TooltipContent", El = l.forwardRef(
|
|
8496
8498
|
(e, t) => {
|
|
8497
|
-
const n = vv(
|
|
8499
|
+
const n = vv(kt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = vr(kt, e.__scopeTooltip);
|
|
8498
8500
|
return /* @__PURE__ */ c(Ae, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Rl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(wv, { side: o, ...s, ref: t }) });
|
|
8499
8501
|
}
|
|
8500
8502
|
), wv = l.forwardRef((e, t) => {
|
|
8501
|
-
const n = vr(
|
|
8503
|
+
const n = vr(kt, e.__scopeTooltip), r = es(kt, e.__scopeTooltip), o = l.useRef(null), s = ne(t, o), [a, i] = l.useState(null), { trigger: u, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, g = l.useCallback(() => {
|
|
8502
8504
|
i(null), p(!1);
|
|
8503
8505
|
}, [p]), v = l.useCallback(
|
|
8504
8506
|
(m, h) => {
|
|
@@ -8532,7 +8534,7 @@ var bv = "TooltipPortal", [Oy, vv] = gr(bv, {
|
|
|
8532
8534
|
onEscapeKeyDown: s,
|
|
8533
8535
|
onPointerDownOutside: a,
|
|
8534
8536
|
...i
|
|
8535
|
-
} = e, u = vr(
|
|
8537
|
+
} = e, u = vr(kt, n), f = br(n), { onClose: d } = u;
|
|
8536
8538
|
return l.useEffect(() => (document.addEventListener(so, d), () => document.removeEventListener(so, d)), [d]), l.useEffect(() => {
|
|
8537
8539
|
if (u.trigger) {
|
|
8538
8540
|
const p = (g) => {
|
|
@@ -8575,7 +8577,7 @@ var bv = "TooltipPortal", [Oy, vv] = gr(bv, {
|
|
|
8575
8577
|
);
|
|
8576
8578
|
}
|
|
8577
8579
|
);
|
|
8578
|
-
El.displayName =
|
|
8580
|
+
El.displayName = kt;
|
|
8579
8581
|
var Nl = "TooltipArrow", Cv = l.forwardRef(
|
|
8580
8582
|
(e, t) => {
|
|
8581
8583
|
const { __scopeTooltip: n, ...r } = e, o = br(n);
|
|
@@ -8679,7 +8681,7 @@ function Pv(e) {
|
|
|
8679
8681
|
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
8680
8682
|
}
|
|
8681
8683
|
var _v = xl, Iv = Sl, Ov = Cl, Tl = El;
|
|
8682
|
-
const
|
|
8684
|
+
const Mv = _v, kv = Iv, Dv = Ov, Al = l.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ c(
|
|
8683
8685
|
Tl,
|
|
8684
8686
|
{
|
|
8685
8687
|
ref: r,
|
|
@@ -8734,7 +8736,7 @@ const _l = l.forwardRef(
|
|
|
8734
8736
|
}),
|
|
8735
8737
|
[b, v, m, u, f, d, h]
|
|
8736
8738
|
);
|
|
8737
|
-
return /* @__PURE__ */ c(Pl.Provider, { value: w, children: /* @__PURE__ */ c(
|
|
8739
|
+
return /* @__PURE__ */ c(Pl.Provider, { value: w, children: /* @__PURE__ */ c(Mv, { delayDuration: 0, children: /* @__PURE__ */ c(
|
|
8738
8740
|
"div",
|
|
8739
8741
|
{
|
|
8740
8742
|
style: {
|
|
@@ -8882,7 +8884,7 @@ const Hv = l.forwardRef(({ className: e, ...t }, n) => {
|
|
|
8882
8884
|
);
|
|
8883
8885
|
});
|
|
8884
8886
|
Hv.displayName = "SidebarRail";
|
|
8885
|
-
const
|
|
8887
|
+
const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8886
8888
|
"main",
|
|
8887
8889
|
{
|
|
8888
8890
|
ref: n,
|
|
@@ -8894,7 +8896,7 @@ const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8894
8896
|
...t
|
|
8895
8897
|
}
|
|
8896
8898
|
));
|
|
8897
|
-
|
|
8899
|
+
Ml.displayName = "SidebarInset";
|
|
8898
8900
|
const Wv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8899
8901
|
tn,
|
|
8900
8902
|
{
|
|
@@ -8908,7 +8910,7 @@ const Wv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8908
8910
|
}
|
|
8909
8911
|
));
|
|
8910
8912
|
Wv.displayName = "SidebarInput";
|
|
8911
|
-
const
|
|
8913
|
+
const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8912
8914
|
"div",
|
|
8913
8915
|
{
|
|
8914
8916
|
ref: n,
|
|
@@ -8917,7 +8919,7 @@ const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8917
8919
|
...t
|
|
8918
8920
|
}
|
|
8919
8921
|
));
|
|
8920
|
-
|
|
8922
|
+
kl.displayName = "SidebarHeader";
|
|
8921
8923
|
const Vv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8922
8924
|
"div",
|
|
8923
8925
|
{
|
|
@@ -9063,7 +9065,7 @@ const Gv = rn(
|
|
|
9063
9065
|
);
|
|
9064
9066
|
return o ? (typeof o == "string" && (o = {
|
|
9065
9067
|
children: o
|
|
9066
|
-
}), /* @__PURE__ */ R(
|
|
9068
|
+
}), /* @__PURE__ */ R(kv, { children: [
|
|
9067
9069
|
/* @__PURE__ */ c(Dv, { asChild: !0, children: p }),
|
|
9068
9070
|
/* @__PURE__ */ c(
|
|
9069
9071
|
Al,
|
|
@@ -9183,7 +9185,7 @@ const Qv = l.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, classNa
|
|
|
9183
9185
|
}
|
|
9184
9186
|
));
|
|
9185
9187
|
Qv.displayName = "SidebarMenuSubButton";
|
|
9186
|
-
function
|
|
9188
|
+
function My({
|
|
9187
9189
|
header: e,
|
|
9188
9190
|
sidebarTitle: t = "Threads",
|
|
9189
9191
|
showThreads: n = !0,
|
|
@@ -9194,7 +9196,7 @@ function ky({
|
|
|
9194
9196
|
}) {
|
|
9195
9197
|
return /* @__PURE__ */ c(Rn, { ...a, children: /* @__PURE__ */ R(_l, { className: `w-full ${r}`, children: [
|
|
9196
9198
|
/* @__PURE__ */ R(Il, { className: `border-r ${o}`, children: [
|
|
9197
|
-
/* @__PURE__ */ c(
|
|
9199
|
+
/* @__PURE__ */ c(kl, { children: /* @__PURE__ */ c(Bl, { children: /* @__PURE__ */ c(Ul, { children: /* @__PURE__ */ c(zl, { size: "lg", children: /* @__PURE__ */ c("span", { className: "font-semibold", children: t }) }) }) }) }),
|
|
9198
9200
|
/* @__PURE__ */ c(Dl, { children: n && /* @__PURE__ */ R(Ll, { children: [
|
|
9199
9201
|
/* @__PURE__ */ c(Fl, { children: "Conversations" }),
|
|
9200
9202
|
/* @__PURE__ */ c($l, { children: /* @__PURE__ */ c("div", { className: "px-2 py-1", children: /* @__PURE__ */ c(
|
|
@@ -9208,7 +9210,7 @@ function ky({
|
|
|
9208
9210
|
) }) })
|
|
9209
9211
|
] }) })
|
|
9210
9212
|
] }),
|
|
9211
|
-
/* @__PURE__ */ R(
|
|
9213
|
+
/* @__PURE__ */ R(Ml, { children: [
|
|
9212
9214
|
/* @__PURE__ */ R("header", { className: "h-14 border-b bg-background/60 backdrop-blur flex items-center gap-2 px-4", children: [
|
|
9213
9215
|
/* @__PURE__ */ c(Ol, {}),
|
|
9214
9216
|
/* @__PURE__ */ c("div", { className: "flex-1" }),
|
|
@@ -9246,7 +9248,7 @@ function Vl(e) {
|
|
|
9246
9248
|
const t = l.useRef({ value: e, previous: e });
|
|
9247
9249
|
return l.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
9248
9250
|
}
|
|
9249
|
-
var yr = "Switch", [nw,
|
|
9251
|
+
var yr = "Switch", [nw, ky] = Ue(yr), [rw, ow] = nw(yr), jl = l.forwardRef(
|
|
9250
9252
|
(e, t) => {
|
|
9251
9253
|
const {
|
|
9252
9254
|
__scopeSwitch: n,
|
|
@@ -9407,13 +9409,13 @@ var iw = [" ", "Enter", "ArrowUp", "ArrowDown"], cw = [" ", "Enter"], gt = "Sele
|
|
|
9407
9409
|
defaultProp: o ?? !1,
|
|
9408
9410
|
onChange: s,
|
|
9409
9411
|
caller: gt
|
|
9410
|
-
}), [
|
|
9412
|
+
}), [M, D] = ot({
|
|
9411
9413
|
prop: a,
|
|
9412
9414
|
defaultProp: i,
|
|
9413
9415
|
onChange: u,
|
|
9414
9416
|
caller: gt
|
|
9415
9417
|
}), j = l.useRef(null), K = b ? m || !!b.closest("form") : !0, [W, B] = l.useState(/* @__PURE__ */ new Set()), q = Array.from(W).map((F) => F.props.value).join(";");
|
|
9416
|
-
return /* @__PURE__ */ c(
|
|
9418
|
+
return /* @__PURE__ */ c(Mo, { ...h, children: /* @__PURE__ */ R(
|
|
9417
9419
|
uw,
|
|
9418
9420
|
{
|
|
9419
9421
|
required: v,
|
|
@@ -9425,7 +9427,7 @@ var iw = [" ", "Enter", "ArrowUp", "ArrowDown"], cw = [" ", "Enter"], gt = "Sele
|
|
|
9425
9427
|
valueNodeHasChildren: E,
|
|
9426
9428
|
onValueNodeHasChildrenChange: C,
|
|
9427
9429
|
contentId: Le(),
|
|
9428
|
-
value:
|
|
9430
|
+
value: M,
|
|
9429
9431
|
onValueChange: D,
|
|
9430
9432
|
open: N,
|
|
9431
9433
|
onOpenChange: L,
|
|
@@ -9457,12 +9459,12 @@ var iw = [" ", "Enter", "ArrowUp", "ArrowDown"], cw = [" ", "Enter"], gt = "Sele
|
|
|
9457
9459
|
tabIndex: -1,
|
|
9458
9460
|
name: d,
|
|
9459
9461
|
autoComplete: p,
|
|
9460
|
-
value:
|
|
9462
|
+
value: M,
|
|
9461
9463
|
onChange: (F) => D(F.target.value),
|
|
9462
9464
|
disabled: g,
|
|
9463
9465
|
form: m,
|
|
9464
9466
|
children: [
|
|
9465
|
-
|
|
9467
|
+
M === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
|
|
9466
9468
|
Array.from(W)
|
|
9467
9469
|
]
|
|
9468
9470
|
},
|
|
@@ -9484,7 +9486,7 @@ var Zl = "SelectTrigger", Ql = l.forwardRef(
|
|
|
9484
9486
|
y: Math.round(h.pageY)
|
|
9485
9487
|
});
|
|
9486
9488
|
};
|
|
9487
|
-
return /* @__PURE__ */ c(
|
|
9489
|
+
return /* @__PURE__ */ c(ko, { asChild: !0, ...s, children: /* @__PURE__ */ c(
|
|
9488
9490
|
J.button,
|
|
9489
9491
|
{
|
|
9490
9492
|
type: "button",
|
|
@@ -9559,7 +9561,7 @@ var bt = "SelectContent", ou = l.forwardRef(
|
|
|
9559
9561
|
}
|
|
9560
9562
|
);
|
|
9561
9563
|
ou.displayName = bt;
|
|
9562
|
-
var
|
|
9564
|
+
var ke = 10, [su, ct] = zt(bt), mw = "SelectContentImpl", gw = _t("SelectContent.RemoveScroll"), au = l.forwardRef(
|
|
9563
9565
|
(e, t) => {
|
|
9564
9566
|
const {
|
|
9565
9567
|
__scopeSelect: n,
|
|
@@ -9581,7 +9583,7 @@ var Me = 10, [su, ct] = zt(bt), mw = "SelectContentImpl", gw = _t("SelectContent
|
|
|
9581
9583
|
avoidCollisions: b,
|
|
9582
9584
|
//
|
|
9583
9585
|
...w
|
|
9584
|
-
} = e, y = it(bt, n), [x, E] = l.useState(null), [C, I] = l.useState(null), N = ne(t, (V) => E(V)), [L,
|
|
9586
|
+
} = e, y = it(bt, n), [x, E] = l.useState(null), [C, I] = l.useState(null), N = ne(t, (V) => E(V)), [L, M] = l.useState(null), [D, j] = l.useState(
|
|
9585
9587
|
null
|
|
9586
9588
|
), K = Sr(n), [W, B] = l.useState(!1), q = l.useRef(!1);
|
|
9587
9589
|
l.useEffect(() => {
|
|
@@ -9630,7 +9632,7 @@ var Me = 10, [su, ct] = zt(bt), mw = "SelectContentImpl", gw = _t("SelectContent
|
|
|
9630
9632
|
}), X = l.useCallback(
|
|
9631
9633
|
(V, oe, ie) => {
|
|
9632
9634
|
const se = !q.current && !ie;
|
|
9633
|
-
(y.value !== void 0 && y.value === oe || se) && (
|
|
9635
|
+
(y.value !== void 0 && y.value === oe || se) && (M(V), se && (q.current = !0));
|
|
9634
9636
|
},
|
|
9635
9637
|
[y.value]
|
|
9636
9638
|
), $ = l.useCallback(() => x == null ? void 0 : x.focus(), [x]), z = l.useCallback(
|
|
@@ -9733,26 +9735,26 @@ au.displayName = mw;
|
|
|
9733
9735
|
var bw = "SelectItemAlignedPosition", iu = l.forwardRef((e, t) => {
|
|
9734
9736
|
const { __scopeSelect: n, onPlaced: r, ...o } = e, s = it(bt, n), a = ct(bt, n), [i, u] = l.useState(null), [f, d] = l.useState(null), p = ne(t, (N) => d(N)), g = Sr(n), v = l.useRef(!1), m = l.useRef(!0), { viewport: h, selectedItem: b, selectedItemText: w, focusSelectedItem: y } = a, x = l.useCallback(() => {
|
|
9735
9737
|
if (s.trigger && s.valueNode && i && f && h && b && w) {
|
|
9736
|
-
const N = s.trigger.getBoundingClientRect(), L = f.getBoundingClientRect(),
|
|
9738
|
+
const N = s.trigger.getBoundingClientRect(), L = f.getBoundingClientRect(), M = s.valueNode.getBoundingClientRect(), D = w.getBoundingClientRect();
|
|
9737
9739
|
if (s.dir !== "rtl") {
|
|
9738
|
-
const H = D.left - L.left, Z =
|
|
9739
|
-
|
|
9740
|
+
const H = D.left - L.left, Z = M.left - H, de = N.left - Z, pe = N.width + de, Y = Math.max(pe, L.width), ge = window.innerWidth - ke, te = ro(Z, [
|
|
9741
|
+
ke,
|
|
9740
9742
|
// Prevents the content from going off the starting edge of the
|
|
9741
9743
|
// viewport. It may still go off the ending edge, but this can be
|
|
9742
9744
|
// controlled by the user since they may want to manage overflow in a
|
|
9743
9745
|
// specific way.
|
|
9744
9746
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
9745
|
-
Math.max(
|
|
9747
|
+
Math.max(ke, ge - Y)
|
|
9746
9748
|
]);
|
|
9747
9749
|
i.style.minWidth = pe + "px", i.style.left = te + "px";
|
|
9748
9750
|
} else {
|
|
9749
|
-
const H = L.right - D.right, Z = window.innerWidth -
|
|
9750
|
-
|
|
9751
|
-
Math.max(
|
|
9751
|
+
const H = L.right - D.right, Z = window.innerWidth - M.right - H, de = window.innerWidth - N.right - Z, pe = N.width + de, Y = Math.max(pe, L.width), ge = window.innerWidth - ke, te = ro(Z, [
|
|
9752
|
+
ke,
|
|
9753
|
+
Math.max(ke, ge - Y)
|
|
9752
9754
|
]);
|
|
9753
9755
|
i.style.minWidth = pe + "px", i.style.right = te + "px";
|
|
9754
9756
|
}
|
|
9755
|
-
const j = g(), K = window.innerHeight -
|
|
9757
|
+
const j = g(), K = window.innerHeight - ke * 2, W = h.scrollHeight, B = window.getComputedStyle(f), q = parseInt(B.borderTopWidth, 10), F = parseInt(B.paddingTop, 10), G = parseInt(B.borderBottomWidth, 10), T = parseInt(B.paddingBottom, 10), P = q + F + W + T + G, _ = Math.min(b.offsetHeight * 5, P), O = window.getComputedStyle(h), X = parseInt(O.paddingTop, 10), $ = parseInt(O.paddingBottom, 10), z = N.top + N.height / 2 - ke, le = K - z, ae = b.offsetHeight / 2, V = b.offsetTop + ae, oe = q + F + V, ie = P - oe;
|
|
9756
9758
|
if (oe <= z) {
|
|
9757
9759
|
const H = j.length > 0 && b === j[j.length - 1].ref.current;
|
|
9758
9760
|
i.style.bottom = "0px";
|
|
@@ -9772,7 +9774,7 @@ var bw = "SelectItemAlignedPosition", iu = l.forwardRef((e, t) => {
|
|
|
9772
9774
|
) + ie;
|
|
9773
9775
|
i.style.height = de + "px", h.scrollTop = oe - z + h.offsetTop;
|
|
9774
9776
|
}
|
|
9775
|
-
i.style.margin = `${
|
|
9777
|
+
i.style.margin = `${ke}px 0`, i.style.minHeight = _ + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
|
|
9776
9778
|
}
|
|
9777
9779
|
}, [
|
|
9778
9780
|
g,
|
|
@@ -9839,7 +9841,7 @@ var vw = "SelectPopperPosition", io = l.forwardRef((e, t) => {
|
|
|
9839
9841
|
const {
|
|
9840
9842
|
__scopeSelect: n,
|
|
9841
9843
|
align: r = "start",
|
|
9842
|
-
collisionPadding: o =
|
|
9844
|
+
collisionPadding: o = ke,
|
|
9843
9845
|
...s
|
|
9844
9846
|
} = e, a = Cr(n);
|
|
9845
9847
|
return /* @__PURE__ */ c(
|
|
@@ -9902,7 +9904,7 @@ var [ww, ts] = zt(bt, {}), co = "SelectViewport", cu = l.forwardRef(
|
|
|
9902
9904
|
if (g != null && g.current && p) {
|
|
9903
9905
|
const v = Math.abs(u.current - d.scrollTop);
|
|
9904
9906
|
if (v > 0) {
|
|
9905
|
-
const m = window.innerHeight -
|
|
9907
|
+
const m = window.innerHeight - ke * 2, h = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(h, b);
|
|
9906
9908
|
if (w < m) {
|
|
9907
9909
|
const y = w + v, x = Math.min(m, y), E = y - x;
|
|
9908
9910
|
p.style.height = x + "px", p.style.bottom === "0px" && (d.scrollTop = E > 0 ? E : 0, p.style.justifyContent = "flex-end");
|
|
@@ -10187,7 +10189,7 @@ function Eu(e, t, n) {
|
|
|
10187
10189
|
function Tw(e, t) {
|
|
10188
10190
|
return e.map((n, r) => e[(t + r) % e.length]);
|
|
10189
10191
|
}
|
|
10190
|
-
var Aw = Jl, Ru = Ql, Pw = tu, _w = nu, Iw = ru, Nu = ou, Ow = cu, Tu = du, Au = pu,
|
|
10192
|
+
var Aw = Jl, Ru = Ql, Pw = tu, _w = nu, Iw = ru, Nu = ou, Ow = cu, Tu = du, Au = pu, Mw = hu, kw = gu, Pu = bu, _u = vu, Iu = yu;
|
|
10191
10193
|
const sa = Aw, aa = Pw, po = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ R(
|
|
10192
10194
|
Ru,
|
|
10193
10195
|
{
|
|
@@ -10217,7 +10219,7 @@ const Ou = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10217
10219
|
}
|
|
10218
10220
|
));
|
|
10219
10221
|
Ou.displayName = Pu.displayName;
|
|
10220
|
-
const
|
|
10222
|
+
const Mu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
10221
10223
|
_u,
|
|
10222
10224
|
{
|
|
10223
10225
|
ref: n,
|
|
@@ -10229,7 +10231,7 @@ const ku = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10229
10231
|
children: /* @__PURE__ */ c(Tt, { className: "h-4 w-4" })
|
|
10230
10232
|
}
|
|
10231
10233
|
));
|
|
10232
|
-
|
|
10234
|
+
Mu.displayName = _u.displayName;
|
|
10233
10235
|
const ho = l.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c(Iw, { children: /* @__PURE__ */ R(
|
|
10234
10236
|
Nu,
|
|
10235
10237
|
{
|
|
@@ -10253,7 +10255,7 @@ const ho = l.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
10253
10255
|
children: t
|
|
10254
10256
|
}
|
|
10255
10257
|
),
|
|
10256
|
-
/* @__PURE__ */ c(
|
|
10258
|
+
/* @__PURE__ */ c(Mu, {})
|
|
10257
10259
|
]
|
|
10258
10260
|
}
|
|
10259
10261
|
) }));
|
|
@@ -10277,8 +10279,8 @@ const lt = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
10277
10279
|
),
|
|
10278
10280
|
...n,
|
|
10279
10281
|
children: [
|
|
10280
|
-
/* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(
|
|
10281
|
-
/* @__PURE__ */ c(
|
|
10282
|
+
/* @__PURE__ */ c("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ c(kw, { children: /* @__PURE__ */ c(mo, { className: "h-4 w-4" }) }) }),
|
|
10283
|
+
/* @__PURE__ */ c(Mw, { children: t })
|
|
10282
10284
|
]
|
|
10283
10285
|
}
|
|
10284
10286
|
));
|
|
@@ -10334,8 +10336,8 @@ const Fw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10334
10336
|
}
|
|
10335
10337
|
));
|
|
10336
10338
|
Fw.displayName = "CardDescription";
|
|
10337
|
-
const
|
|
10338
|
-
|
|
10339
|
+
const Mn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
|
|
10340
|
+
Mn.displayName = "CardContent";
|
|
10339
10341
|
const $w = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
10340
10342
|
"div",
|
|
10341
10343
|
{
|
|
@@ -10397,10 +10399,10 @@ const Hr = /* @__PURE__ */ new Map(), ia = (e) => {
|
|
|
10397
10399
|
toasts: e.toasts.filter((n) => n.id !== t.toastId)
|
|
10398
10400
|
};
|
|
10399
10401
|
}
|
|
10400
|
-
},
|
|
10402
|
+
}, kn = [];
|
|
10401
10403
|
let Dn = { toasts: [] };
|
|
10402
10404
|
function Yt(e) {
|
|
10403
|
-
Dn = Hw(Dn, e),
|
|
10405
|
+
Dn = Hw(Dn, e), kn.forEach((t) => {
|
|
10404
10406
|
t(Dn);
|
|
10405
10407
|
});
|
|
10406
10408
|
}
|
|
@@ -10427,9 +10429,9 @@ function Ww({ ...e }) {
|
|
|
10427
10429
|
}
|
|
10428
10430
|
function Vw() {
|
|
10429
10431
|
const [e, t] = l.useState(Dn);
|
|
10430
|
-
return l.useEffect(() => (
|
|
10431
|
-
const n =
|
|
10432
|
-
n > -1 &&
|
|
10432
|
+
return l.useEffect(() => (kn.push(t), () => {
|
|
10433
|
+
const n = kn.indexOf(t);
|
|
10434
|
+
n > -1 && kn.splice(n, 1);
|
|
10433
10435
|
}), [e]), {
|
|
10434
10436
|
...e,
|
|
10435
10437
|
toast: Ww,
|
|
@@ -10507,7 +10509,7 @@ function Ly({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10507
10509
|
/* @__PURE__ */ c(Ju, { className: "h-5 w-5" }),
|
|
10508
10510
|
"API Configuration"
|
|
10509
10511
|
] }) }),
|
|
10510
|
-
/* @__PURE__ */ R(
|
|
10512
|
+
/* @__PURE__ */ R(Mn, { className: "space-y-4", children: [
|
|
10511
10513
|
/* @__PURE__ */ R("div", { className: "space-y-2", children: [
|
|
10512
10514
|
/* @__PURE__ */ c(Ie, { htmlFor: "api-url", children: "API Base URL" }),
|
|
10513
10515
|
/* @__PURE__ */ R("div", { className: "flex gap-2", children: [
|
|
@@ -10574,7 +10576,7 @@ function Ly({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10574
10576
|
/* @__PURE__ */ c(ed, { className: "h-5 w-5" }),
|
|
10575
10577
|
"Interface Settings"
|
|
10576
10578
|
] }) }),
|
|
10577
|
-
/* @__PURE__ */ R(
|
|
10579
|
+
/* @__PURE__ */ R(Mn, { className: "space-y-4", children: [
|
|
10578
10580
|
/* @__PURE__ */ R("div", { className: "space-y-2", children: [
|
|
10579
10581
|
/* @__PURE__ */ c(Ie, { htmlFor: "layout", children: "Layout Style" }),
|
|
10580
10582
|
/* @__PURE__ */ R(
|
|
@@ -10669,7 +10671,7 @@ function Ly({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10669
10671
|
/* @__PURE__ */ c(td, { className: "h-5 w-5" }),
|
|
10670
10672
|
"Behavior Settings"
|
|
10671
10673
|
] }) }),
|
|
10672
|
-
/* @__PURE__ */ R(
|
|
10674
|
+
/* @__PURE__ */ R(Mn, { className: "space-y-4", children: [
|
|
10673
10675
|
/* @__PURE__ */ R("div", { className: "flex items-center justify-between", children: [
|
|
10674
10676
|
/* @__PURE__ */ R("div", { children: [
|
|
10675
10677
|
/* @__PURE__ */ c(Ie, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
|
|
@@ -10819,7 +10821,7 @@ export {
|
|
|
10819
10821
|
zf as ApiClient,
|
|
10820
10822
|
zf as ChatApi,
|
|
10821
10823
|
Pn as ChatInterface,
|
|
10822
|
-
|
|
10824
|
+
My as ChatMainLayout,
|
|
10823
10825
|
Rn as ChatProvider,
|
|
10824
10826
|
Ry as ChatRoutingProvider,
|
|
10825
10827
|
Ly as ChatSettings,
|