teodor-new-chat-ui 2.0.5 → 2.0.7
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 +226 -226
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as c, jsxs as N, Fragment as De } from "react/jsx-runtime";
|
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import Qe, { useState as ce, useRef as rt, useCallback as Se, useEffect as ve, useReducer as Du, useMemo as nt, createContext as ca, useContext as la, useLayoutEffect as Lu } from "react";
|
|
4
4
|
import { ChevronUp as Wt, ChevronDown as Nt, Copy as ts, Edit as ns, RotateCcw as Hr, GitBranch as ua, ChevronLeft as Fu, ChevronRight as da, Bot as rs, Wrench as $u, User as Bu, Image as Uu, Check as ho, Circle as zu, X as Kt, Edit3 as fa, Paperclip as os, Plus as pa, Square as Hu, Send as Wu, MessageSquare as Vu, Calendar as ju, Trash2 as Ku, PanelLeft as Gu, Settings as qu, Server as Xu, EyeOff as Yu, Eye as Ju, Layout as Zu, MessageCircle as Qu, Save as ed } from "lucide-react";
|
|
5
|
-
import { Slot as
|
|
5
|
+
import { Slot as Mt, createSlot as Pt, createSlottable as td } from "@radix-ui/react-slot";
|
|
6
6
|
import { cva as rn } from "class-variance-authority";
|
|
7
7
|
import { clsx as nd } from "clsx";
|
|
8
8
|
import { twMerge as rd } from "tailwind-merge";
|
|
@@ -124,7 +124,7 @@ const Ed = (e, t, n, { allOwnKeys: r } = {}) => (an(t, (o, s) => {
|
|
|
124
124
|
for (; (n = e.exec(t)) !== null; )
|
|
125
125
|
r.push(n);
|
|
126
126
|
return r;
|
|
127
|
-
},
|
|
127
|
+
}, kd = Be("HTMLFormElement"), Md = (e) => e.toLowerCase().replace(
|
|
128
128
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
129
129
|
function(n, r, o) {
|
|
130
130
|
return r.toUpperCase() + o;
|
|
@@ -227,14 +227,14 @@ const zd = (e) => {
|
|
|
227
227
|
toArray: Pd,
|
|
228
228
|
forEachEntry: Id,
|
|
229
229
|
matchAll: Od,
|
|
230
|
-
isHTMLForm:
|
|
230
|
+
isHTMLForm: kd,
|
|
231
231
|
hasOwnProperty: ss,
|
|
232
232
|
hasOwnProp: ss,
|
|
233
233
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
234
234
|
reduceDescriptors: ya,
|
|
235
235
|
freezeMethods: Ld,
|
|
236
236
|
toObjectSet: Fd,
|
|
237
|
-
toCamelCase:
|
|
237
|
+
toCamelCase: Md,
|
|
238
238
|
noop: $d,
|
|
239
239
|
toFiniteNumber: Bd,
|
|
240
240
|
findKey: va,
|
|
@@ -1239,8 +1239,8 @@ const Oa = (e) => {
|
|
|
1239
1239
|
onUploadProgress: I,
|
|
1240
1240
|
responseType: R,
|
|
1241
1241
|
headers: D,
|
|
1242
|
-
withCredentials:
|
|
1243
|
-
fetchOptions:
|
|
1242
|
+
withCredentials: k = "same-origin",
|
|
1243
|
+
fetchOptions: M
|
|
1244
1244
|
} = Oa(m), j = t || fetch;
|
|
1245
1245
|
R = R ? (R + "").toLowerCase() : "text";
|
|
1246
1246
|
let K = Ef([y, x && x.toAbortSignal()], E), W = null;
|
|
@@ -1263,18 +1263,18 @@ const Oa = (e) => {
|
|
|
1263
1263
|
w = ps(O.body, hs, $, z);
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
S.isString(
|
|
1266
|
+
S.isString(k) || (k = k ? "include" : "omit");
|
|
1267
1267
|
const L = s && "credentials" in n.prototype, G = {
|
|
1268
|
-
...
|
|
1268
|
+
...M,
|
|
1269
1269
|
signal: K,
|
|
1270
1270
|
method: b.toUpperCase(),
|
|
1271
1271
|
headers: D.normalize().toJSON(),
|
|
1272
1272
|
body: w,
|
|
1273
1273
|
duplex: "half",
|
|
1274
|
-
credentials: L ?
|
|
1274
|
+
credentials: L ? k : void 0
|
|
1275
1275
|
};
|
|
1276
1276
|
W = s && new n(h, G);
|
|
1277
|
-
let T = await (s ? j(W,
|
|
1277
|
+
let T = await (s ? j(W, M) : j(h, G));
|
|
1278
1278
|
const P = d && (R === "stream" || R === "response");
|
|
1279
1279
|
if (d && (C || P && B)) {
|
|
1280
1280
|
const O = {};
|
|
@@ -1313,7 +1313,7 @@ const Oa = (e) => {
|
|
|
1313
1313
|
) : ee.from(L, L && L.code, m, W);
|
|
1314
1314
|
}
|
|
1315
1315
|
};
|
|
1316
|
-
}, _f = /* @__PURE__ */ new Map(),
|
|
1316
|
+
}, _f = /* @__PURE__ */ new Map(), ka = (e) => {
|
|
1317
1317
|
let t = e ? e.env : {};
|
|
1318
1318
|
const { fetch: n, Request: r, Response: o } = t, s = [
|
|
1319
1319
|
r,
|
|
@@ -1325,12 +1325,12 @@ const Oa = (e) => {
|
|
|
1325
1325
|
u = s[i], f = d.get(u), f === void 0 && d.set(u, f = i ? /* @__PURE__ */ new Map() : Pf(t)), d = f;
|
|
1326
1326
|
return f;
|
|
1327
1327
|
};
|
|
1328
|
-
|
|
1328
|
+
ka();
|
|
1329
1329
|
const Kr = {
|
|
1330
1330
|
http: Kd,
|
|
1331
1331
|
xhr: Cf,
|
|
1332
1332
|
fetch: {
|
|
1333
|
-
get:
|
|
1333
|
+
get: ka
|
|
1334
1334
|
}
|
|
1335
1335
|
};
|
|
1336
1336
|
S.forEach(Kr, (e, t) => {
|
|
@@ -1342,7 +1342,7 @@ S.forEach(Kr, (e, t) => {
|
|
|
1342
1342
|
Object.defineProperty(e, "adapterName", { value: t });
|
|
1343
1343
|
}
|
|
1344
1344
|
});
|
|
1345
|
-
const vs = (e) => `- ${e}`, If = (e) => S.isFunction(e) || e === null || e === !1,
|
|
1345
|
+
const vs = (e) => `- ${e}`, If = (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;
|
|
@@ -1381,7 +1381,7 @@ function ws(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,
|
|
@@ -1568,7 +1568,7 @@ S.forEach(["post", "put", "patch"], function(t) {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
dt.prototype[t] = n(), dt.prototype[t + "Form"] = n(!0);
|
|
1570
1570
|
});
|
|
1571
|
-
let
|
|
1571
|
+
let kf = class La {
|
|
1572
1572
|
constructor(t) {
|
|
1573
1573
|
if (typeof t != "function")
|
|
1574
1574
|
throw new TypeError("executor must be a function.");
|
|
@@ -1641,7 +1641,7 @@ let Mf = class La {
|
|
|
1641
1641
|
};
|
|
1642
1642
|
}
|
|
1643
1643
|
};
|
|
1644
|
-
function
|
|
1644
|
+
function Mf(e) {
|
|
1645
1645
|
return function(n) {
|
|
1646
1646
|
return e.apply(null, n);
|
|
1647
1647
|
};
|
|
@@ -1726,7 +1726,7 @@ function Fa(e) {
|
|
|
1726
1726
|
const he = Fa(cn);
|
|
1727
1727
|
he.Axios = dt;
|
|
1728
1728
|
he.CanceledError = Lt;
|
|
1729
|
-
he.CancelToken =
|
|
1729
|
+
he.CancelToken = kf;
|
|
1730
1730
|
he.isCancel = Pa;
|
|
1731
1731
|
he.VERSION = Da;
|
|
1732
1732
|
he.toFormData = Zn;
|
|
@@ -1735,12 +1735,12 @@ he.Cancel = he.CanceledError;
|
|
|
1735
1735
|
he.all = function(t) {
|
|
1736
1736
|
return Promise.all(t);
|
|
1737
1737
|
};
|
|
1738
|
-
he.spread =
|
|
1738
|
+
he.spread = Mf;
|
|
1739
1739
|
he.isAxiosError = Df;
|
|
1740
1740
|
he.mergeConfig = ft;
|
|
1741
1741
|
he.AxiosHeaders = Te;
|
|
1742
1742
|
he.formToJSON = (e) => Aa(S.isHTMLForm(e) ? new FormData(e) : e);
|
|
1743
|
-
he.getAdapter =
|
|
1743
|
+
he.getAdapter = Ma.getAdapter;
|
|
1744
1744
|
he.HttpStatusCode = Gr;
|
|
1745
1745
|
he.default = he;
|
|
1746
1746
|
const {
|
|
@@ -1952,7 +1952,7 @@ function Uf(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 k, M, j, K;
|
|
1956
1956
|
const R = (() => {
|
|
1957
1957
|
var W;
|
|
1958
1958
|
try {
|
|
@@ -1978,10 +1978,10 @@ function Uf(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__, _ = ((k = window.localStorage) == null ? void 0 : k.getItem("authToken")) || null;
|
|
1982
1982
|
let O = null;
|
|
1983
1983
|
try {
|
|
1984
|
-
const $ = (
|
|
1984
|
+
const $ = (M = window.localStorage) == null ? void 0 : M.getItem("chat-settings");
|
|
1985
1985
|
$ && (O = ((j = JSON.parse($)) == null ? void 0 : j.apiKey) || null);
|
|
1986
1986
|
} catch {
|
|
1987
1987
|
}
|
|
@@ -2276,19 +2276,19 @@ function Rn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2276
2276
|
}, [C, r]);
|
|
2277
2277
|
const D = rt(null);
|
|
2278
2278
|
ve(() => {
|
|
2279
|
-
o && D.current !== o && (D.current = o,
|
|
2279
|
+
o && D.current !== o && (D.current = o, M(o).catch(() => {
|
|
2280
2280
|
}));
|
|
2281
2281
|
}, [o]);
|
|
2282
|
-
const
|
|
2282
|
+
const k = rt(null), M = Se(
|
|
2283
2283
|
async (_, O, X) => {
|
|
2284
2284
|
var $;
|
|
2285
|
-
if (
|
|
2286
|
-
|
|
2285
|
+
if (k.current !== _) {
|
|
2286
|
+
k.current = _;
|
|
2287
2287
|
try {
|
|
2288
2288
|
const z = O ?? (($ = (await s.listCheckpoints(_)).checkpoints.slice().sort((se, V) => new Date(V.createdAt).getTime() - new Date(se.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
|
+
k.current = null;
|
|
2292
2292
|
}
|
|
2293
2293
|
}
|
|
2294
2294
|
},
|
|
@@ -2299,8 +2299,8 @@ function Rn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2299
2299
|
h(O.messages);
|
|
2300
2300
|
}, [s, C, h]), W = Se(async () => {
|
|
2301
2301
|
if (!C) throw new Error("No active thread");
|
|
2302
|
-
await
|
|
2303
|
-
}, [C,
|
|
2302
|
+
await M(C);
|
|
2303
|
+
}, [C, M]), B = rt(!1);
|
|
2304
2304
|
ve(() => {
|
|
2305
2305
|
const _ = B.current;
|
|
2306
2306
|
if (B.current = a, _ && !a && C) {
|
|
@@ -2311,8 +2311,8 @@ function Rn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2311
2311
|
}, [a, C, m.lastCheckpointId, s, h]);
|
|
2312
2312
|
const q = Se(async (_) => {
|
|
2313
2313
|
const O = await s.createThread(_);
|
|
2314
|
-
return await R(), await
|
|
2315
|
-
}, [s, R,
|
|
2314
|
+
return await R(), await M(O.threadId), O.threadId;
|
|
2315
|
+
}, [s, R, M]), L = Se(async (_) => {
|
|
2316
2316
|
await s.deleteThread(_), await R(), C === _ && (I(null), y([]));
|
|
2317
2317
|
}, [s, R, C, y]), G = Se(async (_, O) => {
|
|
2318
2318
|
await s.updateThread(_, O), await R();
|
|
@@ -2418,7 +2418,7 @@ function Rn({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
|
|
|
2418
2418
|
createThread: q,
|
|
2419
2419
|
deleteThread: L,
|
|
2420
2420
|
renameThread: G,
|
|
2421
|
-
loadThread:
|
|
2421
|
+
loadThread: M,
|
|
2422
2422
|
listCheckpoints: j,
|
|
2423
2423
|
navigateToCheckpoint: K,
|
|
2424
2424
|
returnToLatest: W,
|
|
@@ -2461,7 +2461,7 @@ const Yf = rn(
|
|
|
2461
2461
|
}
|
|
2462
2462
|
), fe = l.forwardRef(
|
|
2463
2463
|
({ className: e, variant: t, size: n, asChild: r = !1, ...o }, s) => /* @__PURE__ */ c(
|
|
2464
|
-
r ?
|
|
2464
|
+
r ? Mt : "button",
|
|
2465
2465
|
{
|
|
2466
2466
|
className: A(Yf({ variant: t, size: n, className: e })),
|
|
2467
2467
|
ref: s,
|
|
@@ -2851,12 +2851,12 @@ function xo(e) {
|
|
|
2851
2851
|
var pp = ja;
|
|
2852
2852
|
const Ts = pp, As = Ga;
|
|
2853
2853
|
function gn({ content: e, className: t = "" }) {
|
|
2854
|
-
return /* @__PURE__ */ c("div", { className: `prose prose-sm max-w-none dark:prose-invert prose-pre:rounded prose-pre:border prose-pre:bg-background/50 prose-code:bg-background/50 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-table:my-4 prose-th:px-2 prose-td:px-2 leading-relaxed ${t}`, children: /* @__PURE__ */ c(
|
|
2854
|
+
return /* @__PURE__ */ c("div", { className: `prose prose-sm max-w-none break-words break-all dark:prose-invert prose-pre:rounded prose-pre:border prose-pre:bg-background/50 prose-code:bg-background/50 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-table:my-4 prose-th:px-2 prose-td:px-2 leading-relaxed ${t}`, children: /* @__PURE__ */ c(
|
|
2855
2855
|
sd,
|
|
2856
2856
|
{
|
|
2857
2857
|
remarkPlugins: [ad],
|
|
2858
2858
|
components: {
|
|
2859
|
-
p: ({ children: n }) => /* @__PURE__ */ c("p", { className: "mt-0 mb-3 last:mb-0 whitespace-pre-wrap", children: n }),
|
|
2859
|
+
p: ({ children: n }) => /* @__PURE__ */ c("p", { className: "mt-0 mb-3 last:mb-0 whitespace-pre-wrap break-words break-all", children: n }),
|
|
2860
2860
|
ul: ({ children: n }) => /* @__PURE__ */ c("ul", { className: "list-disc pl-5 mb-3 space-y-1 marker:text-muted-foreground", children: n }),
|
|
2861
2861
|
ol: ({ children: n }) => /* @__PURE__ */ c("ol", { className: "list-decimal pl-5 mb-3 space-y-1 marker:text-muted-foreground", children: n }),
|
|
2862
2862
|
li: ({ children: n }) => /* @__PURE__ */ c("li", { className: "leading-snug", children: n }),
|
|
@@ -2896,12 +2896,12 @@ function hp({
|
|
|
2896
2896
|
onRegenerate: I,
|
|
2897
2897
|
onEditFromCheckpoint: R,
|
|
2898
2898
|
onCancelEdit: D,
|
|
2899
|
-
onCopy:
|
|
2899
|
+
onCopy: k
|
|
2900
2900
|
}) {
|
|
2901
|
-
const [
|
|
2901
|
+
const [M, j] = ce(!1), [K, W] = ce(!1), [B, q] = ce(!1), [L, G] = ce(!1), T = u === "phone" || u === "half-screen", P = e.role, _ = P === "tool", O = nt(() => mp(e.content), [e.content]), X = nt(() => xp(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 = Ep(O, n ? r : 0), se = async () => {
|
|
2902
2902
|
try {
|
|
2903
2903
|
const Y = _ ? Ht(e.content) : O;
|
|
2904
|
-
await navigator.clipboard.writeText(Y), j(!0), setTimeout(() => j(!1), 2e3),
|
|
2904
|
+
await navigator.clipboard.writeText(Y), j(!0), setTimeout(() => j(!1), 2e3), k == null || k(Y);
|
|
2905
2905
|
} catch (Y) {
|
|
2906
2906
|
console.error("Failed to copy:", Y);
|
|
2907
2907
|
}
|
|
@@ -3095,7 +3095,7 @@ function hp({
|
|
|
3095
3095
|
size: "sm",
|
|
3096
3096
|
onClick: se,
|
|
3097
3097
|
className: A("h-6 w-6 p-0 hover:bg-background/50", T && "h-5 w-5"),
|
|
3098
|
-
children: /* @__PURE__ */ c(ts, { className: A(
|
|
3098
|
+
children: /* @__PURE__ */ c(ts, { className: A(M ? "text-success" : "", T ? "h-3 w-3" : "h-4 w-4") })
|
|
3099
3099
|
}
|
|
3100
3100
|
),
|
|
3101
3101
|
P === "user" && C && /* @__PURE__ */ c(
|
|
@@ -3187,7 +3187,7 @@ function hp({
|
|
|
3187
3187
|
size: "sm",
|
|
3188
3188
|
onClick: se,
|
|
3189
3189
|
className: A("h-6 w-6 p-0 hover:bg-background/50", T && "h-5 w-5"),
|
|
3190
|
-
children: /* @__PURE__ */ c(ts, { className: A(
|
|
3190
|
+
children: /* @__PURE__ */ c(ts, { className: A(M ? "text-success" : "", T ? "h-3 w-3" : "h-4 w-4") })
|
|
3191
3191
|
}
|
|
3192
3192
|
),
|
|
3193
3193
|
P === "user" && C && /* @__PURE__ */ c(
|
|
@@ -3458,11 +3458,11 @@ var _p = "DismissableLayer", Xr = "dismissableLayer.update", Ip = "dismissableLa
|
|
|
3458
3458
|
onDismiss: i,
|
|
3459
3459
|
...u
|
|
3460
3460
|
} = 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 = te(t, (R) => p(R)), 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 = Dp((R) => {
|
|
3461
|
-
const D = R.target,
|
|
3462
|
-
!E ||
|
|
3461
|
+
const D = R.target, k = [...f.branches].some((M) => M.contains(D));
|
|
3462
|
+
!E || k || (o == null || o(R), a == null || a(R), R.defaultPrevented || i == null || i());
|
|
3463
3463
|
}, g), I = Lp((R) => {
|
|
3464
3464
|
const D = R.target;
|
|
3465
|
-
[...f.branches].some((
|
|
3465
|
+
[...f.branches].some((M) => M.contains(D)) || (s == null || s(R), a == null || a(R), R.defaultPrevented || i == null || i());
|
|
3466
3466
|
}, g);
|
|
3467
3467
|
return Pp((R) => {
|
|
3468
3468
|
y === f.layers.size - 1 && (r == null || r(R), !R.defaultPrevented && i && (R.preventDefault(), i()));
|
|
@@ -3496,7 +3496,7 @@ var _p = "DismissableLayer", Xr = "dismissableLayer.update", Ip = "dismissableLa
|
|
|
3496
3496
|
}
|
|
3497
3497
|
);
|
|
3498
3498
|
ln.displayName = _p;
|
|
3499
|
-
var
|
|
3499
|
+
var kp = "DismissableLayerBranch", Mp = l.forwardRef((e, t) => {
|
|
3500
3500
|
const n = l.useContext(qa), r = l.useRef(null), o = te(t, r);
|
|
3501
3501
|
return l.useEffect(() => {
|
|
3502
3502
|
const s = r.current;
|
|
@@ -3506,7 +3506,7 @@ var Mp = "DismissableLayerBranch", kp = l.forwardRef((e, t) => {
|
|
|
3506
3506
|
};
|
|
3507
3507
|
}, [n.branches]), /* @__PURE__ */ c(J.div, { ...e, ref: o });
|
|
3508
3508
|
});
|
|
3509
|
-
|
|
3509
|
+
Mp.displayName = kp;
|
|
3510
3510
|
function Dp(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
3511
3511
|
const n = we(e), r = l.useRef(!1), o = l.useRef(() => {
|
|
3512
3512
|
});
|
|
@@ -3563,16 +3563,16 @@ var Pr = 0;
|
|
|
3563
3563
|
function Co() {
|
|
3564
3564
|
l.useEffect(() => {
|
|
3565
3565
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3566
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ??
|
|
3566
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? ks()), document.body.insertAdjacentElement("beforeend", e[1] ?? ks()), Pr++, () => {
|
|
3567
3567
|
Pr === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Pr--;
|
|
3568
3568
|
};
|
|
3569
3569
|
}, []);
|
|
3570
3570
|
}
|
|
3571
|
-
function
|
|
3571
|
+
function ks() {
|
|
3572
3572
|
const e = document.createElement("span");
|
|
3573
3573
|
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;
|
|
3574
3574
|
}
|
|
3575
|
-
var _r = "focusScope.autoFocusOnMount", Ir = "focusScope.autoFocusOnUnmount",
|
|
3575
|
+
var _r = "focusScope.autoFocusOnMount", Ir = "focusScope.autoFocusOnUnmount", Ms = { bubbles: !1, cancelable: !0 }, Fp = "FocusScope", nr = l.forwardRef((e, t) => {
|
|
3576
3576
|
const {
|
|
3577
3577
|
loop: n = !1,
|
|
3578
3578
|
trapped: r = !1,
|
|
@@ -3614,12 +3614,12 @@ var _r = "focusScope.autoFocusOnMount", Ir = "focusScope.autoFocusOnUnmount", ks
|
|
|
3614
3614
|
Ls.add(v);
|
|
3615
3615
|
const h = document.activeElement;
|
|
3616
3616
|
if (!i.contains(h)) {
|
|
3617
|
-
const w = new CustomEvent(_r,
|
|
3617
|
+
const w = new CustomEvent(_r, Ms);
|
|
3618
3618
|
i.addEventListener(_r, f), i.dispatchEvent(w), w.defaultPrevented || ($p(Wp(Ya(i)), { select: !0 }), document.activeElement === h && et(i));
|
|
3619
3619
|
}
|
|
3620
3620
|
return () => {
|
|
3621
3621
|
i.removeEventListener(_r, f), setTimeout(() => {
|
|
3622
|
-
const w = new CustomEvent(Ir,
|
|
3622
|
+
const w = new CustomEvent(Ir, Ms);
|
|
3623
3623
|
i.addEventListener(Ir, d), i.dispatchEvent(w), w.defaultPrevented || et(h ?? document.body, { select: !0 }), i.removeEventListener(Ir, d), Ls.remove(v);
|
|
3624
3624
|
}, 0);
|
|
3625
3625
|
};
|
|
@@ -3985,7 +3985,7 @@ const nh = (e) => ({
|
|
|
3985
3985
|
}, v = No(o), m = Ro(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));
|
|
3986
3986
|
let R = I ? I[x] : 0;
|
|
3987
3987
|
(!R || !await (a.isElement == null ? void 0 : a.isElement(I))) && (R = i.floating[x] || s.floating[m]);
|
|
3988
|
-
const D = E / 2 - C / 2,
|
|
3988
|
+
const D = E / 2 - C / 2, k = R / 2 - h[m] / 2 - 1, M = st(p[w], k), j = st(p[y], k), K = M, W = R - h[m] - j, B = R / 2 - h[m] / 2 + D, q = Yr(K, B, W), L = !u.arrow && Ft(o) != null && B !== q && s.reference[m] / 2 - (B < K ? M : j) - h[m] / 2 < 0, G = L ? B < K ? B - K : B - W : 0;
|
|
3989
3989
|
return {
|
|
3990
3990
|
[v]: g[v] + G,
|
|
3991
3991
|
data: {
|
|
@@ -4024,36 +4024,36 @@ const nh = (e) => ({
|
|
|
4024
4024
|
return {};
|
|
4025
4025
|
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)] : Xp(i)), I = m !== "none";
|
|
4026
4026
|
!g && I && C.push(...Qp(i, h, m, E));
|
|
4027
|
-
const R = [i, ...C], D = await Jt(t, b),
|
|
4028
|
-
let
|
|
4029
|
-
if (d &&
|
|
4027
|
+
const R = [i, ...C], D = await Jt(t, b), k = [];
|
|
4028
|
+
let M = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
4029
|
+
if (d && k.push(D[w]), p) {
|
|
4030
4030
|
const B = qp(o, a, E);
|
|
4031
|
-
|
|
4031
|
+
k.push(D[B[0]], D[B[1]]);
|
|
4032
4032
|
}
|
|
4033
|
-
if (
|
|
4033
|
+
if (M = [...M, {
|
|
4034
4034
|
placement: o,
|
|
4035
|
-
overflows:
|
|
4036
|
-
}], !
|
|
4035
|
+
overflows: k
|
|
4036
|
+
}], !k.every((B) => B <= 0)) {
|
|
4037
4037
|
var j, K;
|
|
4038
4038
|
const B = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, q = R[B];
|
|
4039
4039
|
if (q && (!(p === "alignment" ? y !== je(q) : !1) || // We leave the current main axis only if every placement on that axis
|
|
4040
4040
|
// overflows the main axis.
|
|
4041
|
-
|
|
4041
|
+
M.every((T) => je(T.placement) === y ? T.overflows[0] > 0 : !0)))
|
|
4042
4042
|
return {
|
|
4043
4043
|
data: {
|
|
4044
4044
|
index: B,
|
|
4045
|
-
overflows:
|
|
4045
|
+
overflows: M
|
|
4046
4046
|
},
|
|
4047
4047
|
reset: {
|
|
4048
4048
|
placement: q
|
|
4049
4049
|
}
|
|
4050
4050
|
};
|
|
4051
|
-
let L = (K =
|
|
4051
|
+
let L = (K = M.filter((G) => G.overflows[0] <= 0).sort((G, T) => G.overflows[1] - T.overflows[1])[0]) == null ? void 0 : K.placement;
|
|
4052
4052
|
if (!L)
|
|
4053
4053
|
switch (v) {
|
|
4054
4054
|
case "bestFit": {
|
|
4055
4055
|
var W;
|
|
4056
|
-
const G = (W =
|
|
4056
|
+
const G = (W = M.filter((T) => {
|
|
4057
4057
|
if (I) {
|
|
4058
4058
|
const P = je(T.placement);
|
|
4059
4059
|
return P === y || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -4304,16 +4304,16 @@ const ah = function(e) {
|
|
|
4304
4304
|
const y = h - d.top - d.bottom, x = m - d.left - d.right, E = st(h - d[b], y), C = st(m - d[w], x), I = !t.middlewareData.shift;
|
|
4305
4305
|
let R = E, D = C;
|
|
4306
4306
|
if ((n = t.middlewareData.shift) != null && n.enabled.x && (D = x), (r = t.middlewareData.shift) != null && r.enabled.y && (R = y), I && !g) {
|
|
4307
|
-
const
|
|
4308
|
-
v ? D = m - 2 * (
|
|
4307
|
+
const M = Pe(d.left, 0), j = Pe(d.right, 0), K = Pe(d.top, 0), W = Pe(d.bottom, 0);
|
|
4308
|
+
v ? D = m - 2 * (M !== 0 || j !== 0 ? M + j : Pe(d.left, d.right)) : R = h - 2 * (K !== 0 || W !== 0 ? K + W : Pe(d.top, d.bottom));
|
|
4309
4309
|
}
|
|
4310
4310
|
await u({
|
|
4311
4311
|
...t,
|
|
4312
4312
|
availableWidth: D,
|
|
4313
4313
|
availableHeight: R
|
|
4314
4314
|
});
|
|
4315
|
-
const
|
|
4316
|
-
return m !==
|
|
4315
|
+
const k = await a.getDimensions(i.floating);
|
|
4316
|
+
return m !== k.width || h !== k.height ? {
|
|
4317
4317
|
reset: {
|
|
4318
4318
|
rects: !0
|
|
4319
4319
|
}
|
|
@@ -4711,7 +4711,7 @@ const Ih = async function(e) {
|
|
|
4711
4711
|
function Oh(e) {
|
|
4712
4712
|
return $e(e).direction === "rtl";
|
|
4713
4713
|
}
|
|
4714
|
-
const
|
|
4714
|
+
const kh = {
|
|
4715
4715
|
convertOffsetParentRelativeRectToViewportRelativeRect: xh,
|
|
4716
4716
|
getDocumentElement: Xe,
|
|
4717
4717
|
getClippingRect: Ah,
|
|
@@ -4726,7 +4726,7 @@ const Mh = {
|
|
|
4726
4726
|
function ai(e, t) {
|
|
4727
4727
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
4728
4728
|
}
|
|
4729
|
-
function
|
|
4729
|
+
function Mh(e, t) {
|
|
4730
4730
|
let n = null, r;
|
|
4731
4731
|
const o = Xe(e);
|
|
4732
4732
|
function s() {
|
|
@@ -4786,7 +4786,7 @@ function Dh(e, t, n, r) {
|
|
|
4786
4786
|
passive: !0
|
|
4787
4787
|
}), s && w.addEventListener("resize", n);
|
|
4788
4788
|
});
|
|
4789
|
-
const p = f && i ?
|
|
4789
|
+
const p = f && i ? Mh(f, n) : null;
|
|
4790
4790
|
let g = -1, v = null;
|
|
4791
4791
|
a && (v = new ResizeObserver((w) => {
|
|
4792
4792
|
let [y] = w;
|
|
@@ -4810,7 +4810,7 @@ function Dh(e, t, n, r) {
|
|
|
4810
4810
|
}
|
|
4811
4811
|
const Lh = ah, Fh = ih, $h = rh, Bh = lh, Uh = oh, Gs = nh, zh = ch, Hh = (e, t, n) => {
|
|
4812
4812
|
const r = /* @__PURE__ */ new Map(), o = {
|
|
4813
|
-
platform:
|
|
4813
|
+
platform: kh,
|
|
4814
4814
|
...n
|
|
4815
4815
|
}, s = {
|
|
4816
4816
|
...o.platform,
|
|
@@ -4860,7 +4860,7 @@ function qs(e, t) {
|
|
|
4860
4860
|
const n = ii(e);
|
|
4861
4861
|
return Math.round(t * n) / n;
|
|
4862
4862
|
}
|
|
4863
|
-
function
|
|
4863
|
+
function kr(e) {
|
|
4864
4864
|
const t = l.useRef(e);
|
|
4865
4865
|
return Nn(() => {
|
|
4866
4866
|
t.current = e;
|
|
@@ -4893,7 +4893,7 @@ function jh(e) {
|
|
|
4893
4893
|
T !== I.current && (I.current = T, h(T));
|
|
4894
4894
|
}, []), x = l.useCallback((T) => {
|
|
4895
4895
|
T !== R.current && (R.current = T, w(T));
|
|
4896
|
-
}, []), E = s || m, C = a || b, I = l.useRef(null), R = l.useRef(null), D = l.useRef(d),
|
|
4896
|
+
}, []), E = s || m, C = a || b, I = l.useRef(null), R = l.useRef(null), D = l.useRef(d), k = u != null, M = kr(u), j = kr(o), K = kr(f), W = l.useCallback(() => {
|
|
4897
4897
|
if (!I.current || !R.current)
|
|
4898
4898
|
return;
|
|
4899
4899
|
const T = {
|
|
@@ -4926,11 +4926,11 @@ function jh(e) {
|
|
|
4926
4926
|
B.current = !1;
|
|
4927
4927
|
}), []), Nn(() => {
|
|
4928
4928
|
if (E && (I.current = E), C && (R.current = C), E && C) {
|
|
4929
|
-
if (
|
|
4930
|
-
return
|
|
4929
|
+
if (M.current)
|
|
4930
|
+
return M.current(E, C, W);
|
|
4931
4931
|
W();
|
|
4932
4932
|
}
|
|
4933
|
-
}, [E, C, W,
|
|
4933
|
+
}, [E, C, W, M, k]);
|
|
4934
4934
|
const q = l.useMemo(() => ({
|
|
4935
4935
|
reference: I,
|
|
4936
4936
|
floating: R,
|
|
@@ -5083,15 +5083,15 @@ var Io = "PopperContent", [rm, om] = ui(Io), mi = l.forwardRef(
|
|
|
5083
5083
|
updatePositionStrategy: v = "optimized",
|
|
5084
5084
|
onPlaced: m,
|
|
5085
5085
|
...h
|
|
5086
|
-
} = e, b = di(Io, n), [w, y] = l.useState(null), x = te(t, (de) => y(de)), [E, C] = l.useState(null), I = li(E), R = (I == null ? void 0 : I.width) ?? 0, D = (I == null ? void 0 : I.height) ?? 0,
|
|
5087
|
-
padding:
|
|
5086
|
+
} = e, b = di(Io, n), [w, y] = l.useState(null), x = te(t, (de) => y(de)), [E, C] = l.useState(null), I = li(E), R = (I == null ? void 0 : I.width) ?? 0, D = (I == null ? void 0 : I.height) ?? 0, k = r + (s !== "center" ? "-" + s : ""), M = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(f) ? f : [f], K = j.length > 0, W = {
|
|
5087
|
+
padding: M,
|
|
5088
5088
|
boundary: j.filter(am),
|
|
5089
5089
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
5090
5090
|
altBoundary: K
|
|
5091
5091
|
}, { refs: B, floatingStyles: q, placement: L, isPositioned: G, middlewareData: T } = jh({
|
|
5092
5092
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
5093
5093
|
strategy: "fixed",
|
|
5094
|
-
placement:
|
|
5094
|
+
placement: k,
|
|
5095
5095
|
whileElementsMounted: (...de) => Dh(...de, {
|
|
5096
5096
|
animationFrame: v === "always"
|
|
5097
5097
|
}),
|
|
@@ -5248,7 +5248,7 @@ function vi(e) {
|
|
|
5248
5248
|
const [t, n = "center"] = e.split("-");
|
|
5249
5249
|
return [t, n];
|
|
5250
5250
|
}
|
|
5251
|
-
var Oo = fi,
|
|
5251
|
+
var Oo = fi, ko = hi, Mo = mi, Do = bi, cm = "Portal", ir = l.forwardRef((e, t) => {
|
|
5252
5252
|
var i;
|
|
5253
5253
|
const { container: n, ...r } = e, [o, s] = l.useState(!1);
|
|
5254
5254
|
be(() => s(!0), []);
|
|
@@ -5256,7 +5256,7 @@ var Oo = fi, Mo = hi, ko = mi, Do = bi, cm = "Portal", ir = l.forwardRef((e, t)
|
|
|
5256
5256
|
return a ? od.createPortal(/* @__PURE__ */ c(J.div, { ...r, ref: t }), a) : null;
|
|
5257
5257
|
});
|
|
5258
5258
|
ir.displayName = cm;
|
|
5259
|
-
var
|
|
5259
|
+
var Mr = "rovingFocusGroup.onEntryFocus", lm = { bubbles: !1, cancelable: !0 }, dn = "RovingFocusGroup", [Qr, wi, um] = So(dn), [dm, yi] = Ue(
|
|
5260
5260
|
dn,
|
|
5261
5261
|
[um]
|
|
5262
5262
|
), [fm, pm] = dm(dn), xi = l.forwardRef(
|
|
@@ -5284,7 +5284,7 @@ var hm = l.forwardRef((e, t) => {
|
|
|
5284
5284
|
return l.useEffect(() => {
|
|
5285
5285
|
const D = g.current;
|
|
5286
5286
|
if (D)
|
|
5287
|
-
return D.addEventListener(
|
|
5287
|
+
return D.addEventListener(Mr, x), () => D.removeEventListener(Mr, x);
|
|
5288
5288
|
}, [x]), /* @__PURE__ */ c(
|
|
5289
5289
|
fm,
|
|
5290
5290
|
{
|
|
@@ -5318,10 +5318,10 @@ var hm = l.forwardRef((e, t) => {
|
|
|
5318
5318
|
C.current = !0;
|
|
5319
5319
|
}),
|
|
5320
5320
|
onFocus: U(e.onFocus, (D) => {
|
|
5321
|
-
const
|
|
5322
|
-
if (D.target === D.currentTarget &&
|
|
5323
|
-
const
|
|
5324
|
-
if (D.currentTarget.dispatchEvent(
|
|
5321
|
+
const k = !C.current;
|
|
5322
|
+
if (D.target === D.currentTarget && k && !w) {
|
|
5323
|
+
const M = new CustomEvent(Mr, lm);
|
|
5324
|
+
if (D.currentTarget.dispatchEvent(M), !M.defaultPrevented) {
|
|
5325
5325
|
const j = E().filter((L) => L.focusable), K = j.find((L) => L.active), W = j.find((L) => L.id === h), q = [K, W, ...j].filter(
|
|
5326
5326
|
Boolean
|
|
5327
5327
|
).map((L) => L.ref.current);
|
|
@@ -5608,7 +5608,7 @@ var Ti = function(e) {
|
|
|
5608
5608
|
return l.createElement(r, Ve({}, n));
|
|
5609
5609
|
};
|
|
5610
5610
|
Ti.isSideCarExport = !0;
|
|
5611
|
-
function
|
|
5611
|
+
function km(e, t) {
|
|
5612
5612
|
return e.useMedium(t), Ti;
|
|
5613
5613
|
}
|
|
5614
5614
|
var Ai = Om(), Fr = function() {
|
|
@@ -5634,7 +5634,7 @@ cr.classNames = {
|
|
|
5634
5634
|
fullWidth: An,
|
|
5635
5635
|
zeroRight: Tn
|
|
5636
5636
|
};
|
|
5637
|
-
var
|
|
5637
|
+
var Mm = function() {
|
|
5638
5638
|
if (typeof __webpack_nonce__ < "u")
|
|
5639
5639
|
return __webpack_nonce__;
|
|
5640
5640
|
};
|
|
@@ -5643,7 +5643,7 @@ function Dm() {
|
|
|
5643
5643
|
return null;
|
|
5644
5644
|
var e = document.createElement("style");
|
|
5645
5645
|
e.type = "text/css";
|
|
5646
|
-
var t =
|
|
5646
|
+
var t = Mm();
|
|
5647
5647
|
return t && e.setAttribute("nonce", t), e;
|
|
5648
5648
|
}
|
|
5649
5649
|
function Lm(e, t) {
|
|
@@ -5878,8 +5878,8 @@ function rg(e) {
|
|
|
5878
5878
|
return !1;
|
|
5879
5879
|
if (!r.current && "changedTouches" in h && (x || E) && (r.current = C), !C)
|
|
5880
5880
|
return !0;
|
|
5881
|
-
var
|
|
5882
|
-
return Qm(
|
|
5881
|
+
var k = r.current || C;
|
|
5882
|
+
return Qm(k, b, h, k === "h" ? x : E);
|
|
5883
5883
|
}, []), u = l.useCallback(function(h) {
|
|
5884
5884
|
var b = h;
|
|
5885
5885
|
if (!(!Et.length || Et[Et.length - 1] !== s)) {
|
|
@@ -5935,18 +5935,18 @@ function og(e) {
|
|
|
5935
5935
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
5936
5936
|
return t;
|
|
5937
5937
|
}
|
|
5938
|
-
const sg =
|
|
5938
|
+
const sg = km(Ai, rg);
|
|
5939
5939
|
var lr = l.forwardRef(function(e, t) {
|
|
5940
5940
|
return l.createElement(cr, Ve({}, e, { ref: t, sideCar: sg }));
|
|
5941
5941
|
});
|
|
5942
5942
|
lr.classNames = cr.classNames;
|
|
5943
|
-
var to = ["Enter", " "], ag = ["ArrowDown", "PageUp", "Home"],
|
|
5943
|
+
var to = ["Enter", " "], ag = ["ArrowDown", "PageUp", "Home"], ki = ["ArrowUp", "PageDown", "End"], ig = [...ag, ...ki], cg = {
|
|
5944
5944
|
ltr: [...to, "ArrowRight"],
|
|
5945
5945
|
rtl: [...to, "ArrowLeft"]
|
|
5946
5946
|
}, lg = {
|
|
5947
5947
|
ltr: ["ArrowLeft"],
|
|
5948
5948
|
rtl: ["ArrowRight"]
|
|
5949
|
-
}, fn = "Menu", [Qt, ug, dg] = So(fn), [vt,
|
|
5949
|
+
}, fn = "Menu", [Qt, ug, dg] = So(fn), [vt, Mi] = Ue(fn, [
|
|
5950
5950
|
dg,
|
|
5951
5951
|
Bt,
|
|
5952
5952
|
yi
|
|
@@ -5985,7 +5985,7 @@ Li.displayName = fn;
|
|
|
5985
5985
|
var hg = "MenuAnchor", Fo = l.forwardRef(
|
|
5986
5986
|
(e, t) => {
|
|
5987
5987
|
const { __scopeMenu: n, ...r } = e, o = ur(n);
|
|
5988
|
-
return /* @__PURE__ */ c(
|
|
5988
|
+
return /* @__PURE__ */ c(ko, { ...o, ...r, ref: t });
|
|
5989
5989
|
}
|
|
5990
5990
|
);
|
|
5991
5991
|
Fo.displayName = hg;
|
|
@@ -6054,23 +6054,23 @@ var Oe = "MenuContent", [gg, Bo] = vt(Oe), Bi = l.forwardRef(
|
|
|
6054
6054
|
onDismiss: v,
|
|
6055
6055
|
disableOutsideScroll: m,
|
|
6056
6056
|
...h
|
|
6057
|
-
} = e, b = wt(Oe, n), w = pn(Oe, n), y = ur(n), x = Di(n), E = ug(n), [C, I] = l.useState(null), R = l.useRef(null), D = te(t, R, b.onContentChange),
|
|
6057
|
+
} = e, b = wt(Oe, n), w = pn(Oe, n), y = ur(n), x = Di(n), E = ug(n), [C, I] = l.useState(null), R = l.useRef(null), D = te(t, R, b.onContentChange), k = l.useRef(0), M = l.useRef(""), j = l.useRef(0), K = l.useRef(null), W = l.useRef("right"), B = l.useRef(0), q = m ? lr : l.Fragment, L = m ? { as: wg, allowPinchZoom: !0 } : void 0, G = (P) => {
|
|
6058
6058
|
var V, re;
|
|
6059
|
-
const _ =
|
|
6059
|
+
const _ = M.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 = Ig(z, _, $), se = (re = O.find((ie) => ie.textValue === le)) == null ? void 0 : re.ref.current;
|
|
6060
6060
|
(function ie(oe) {
|
|
6061
|
-
|
|
6061
|
+
M.current = oe, window.clearTimeout(k.current), oe !== "" && (k.current = window.setTimeout(() => ie(""), 1e3));
|
|
6062
6062
|
})(_), se && setTimeout(() => se.focus());
|
|
6063
6063
|
};
|
|
6064
|
-
l.useEffect(() => () => window.clearTimeout(
|
|
6064
|
+
l.useEffect(() => () => window.clearTimeout(k.current), []), Co();
|
|
6065
6065
|
const T = l.useCallback((P) => {
|
|
6066
6066
|
var O, X;
|
|
6067
|
-
return W.current === ((O = K.current) == null ? void 0 : O.side) &&
|
|
6067
|
+
return W.current === ((O = K.current) == null ? void 0 : O.side) && kg(P, (X = K.current) == null ? void 0 : X.area);
|
|
6068
6068
|
}, []);
|
|
6069
6069
|
return /* @__PURE__ */ c(
|
|
6070
6070
|
gg,
|
|
6071
6071
|
{
|
|
6072
6072
|
scope: n,
|
|
6073
|
-
searchRef:
|
|
6073
|
+
searchRef: M,
|
|
6074
6074
|
onItemEnter: l.useCallback(
|
|
6075
6075
|
(P) => {
|
|
6076
6076
|
T(P) && P.preventDefault();
|
|
@@ -6129,7 +6129,7 @@ var Oe = "MenuContent", [gg, Bo] = vt(Oe), Bi = l.forwardRef(
|
|
|
6129
6129
|
}),
|
|
6130
6130
|
preventScrollOnEntryFocus: !0,
|
|
6131
6131
|
children: /* @__PURE__ */ c(
|
|
6132
|
-
|
|
6132
|
+
Mo,
|
|
6133
6133
|
{
|
|
6134
6134
|
role: "menu",
|
|
6135
6135
|
"aria-orientation": "vertical",
|
|
@@ -6147,10 +6147,10 @@ var Oe = "MenuContent", [gg, Bo] = vt(Oe), Bi = l.forwardRef(
|
|
|
6147
6147
|
if (P.target !== z || !ig.includes(P.key)) return;
|
|
6148
6148
|
P.preventDefault();
|
|
6149
6149
|
const se = E().filter((V) => !V.disabled).map((V) => V.ref.current);
|
|
6150
|
-
|
|
6150
|
+
ki.includes(P.key) && se.reverse(), Pg(se);
|
|
6151
6151
|
}),
|
|
6152
6152
|
onBlur: U(e.onBlur, (P) => {
|
|
6153
|
-
P.currentTarget.contains(P.target) || (window.clearTimeout(
|
|
6153
|
+
P.currentTarget.contains(P.target) || (window.clearTimeout(k.current), M.current = "");
|
|
6154
6154
|
}),
|
|
6155
6155
|
onPointerMove: U(
|
|
6156
6156
|
e.onPointerMove,
|
|
@@ -6503,7 +6503,7 @@ function Og(e, t) {
|
|
|
6503
6503
|
}
|
|
6504
6504
|
return o;
|
|
6505
6505
|
}
|
|
6506
|
-
function
|
|
6506
|
+
function kg(e, t) {
|
|
6507
6507
|
if (!t) return !1;
|
|
6508
6508
|
const n = { x: e.clientX, y: e.clientY };
|
|
6509
6509
|
return Og(n, t);
|
|
@@ -6511,10 +6511,10 @@ function Mg(e, t) {
|
|
|
6511
6511
|
function en(e) {
|
|
6512
6512
|
return (t) => t.pointerType === "mouse" ? e(t) : void 0;
|
|
6513
6513
|
}
|
|
6514
|
-
var
|
|
6514
|
+
var Mg = Li, Dg = Fo, Lg = $i, Fg = Bi, $g = zo, Bg = Ui, Ug = dr, zg = Hi, Hg = Vi, Wg = Ki, Vg = qi, jg = Xi, Kg = Yi, Gg = Zi, qg = ec, fr = "DropdownMenu", [Xg, wy] = Ue(
|
|
6515
6515
|
fr,
|
|
6516
|
-
[
|
|
6517
|
-
), Ce =
|
|
6516
|
+
[Mi]
|
|
6517
|
+
), Ce = Mi(), [Yg, nc] = Xg(fr), rc = (e) => {
|
|
6518
6518
|
const {
|
|
6519
6519
|
__scopeDropdownMenu: t,
|
|
6520
6520
|
children: n,
|
|
@@ -6540,7 +6540,7 @@ var kg = Li, Dg = Fo, Lg = $i, Fg = Bi, $g = zo, Bg = Ui, Ug = dr, zg = Hi, Hg =
|
|
|
6540
6540
|
onOpenChange: p,
|
|
6541
6541
|
onOpenToggle: l.useCallback(() => p((g) => !g), [p]),
|
|
6542
6542
|
modal: i,
|
|
6543
|
-
children: /* @__PURE__ */ c(
|
|
6543
|
+
children: /* @__PURE__ */ c(Mg, { ...u, open: d, onOpenChange: p, dir: r, modal: i, children: n })
|
|
6544
6544
|
}
|
|
6545
6545
|
);
|
|
6546
6546
|
};
|
|
@@ -6822,7 +6822,7 @@ function Pn({
|
|
|
6822
6822
|
listCheckpoints: y,
|
|
6823
6823
|
navigateToCheckpoint: x,
|
|
6824
6824
|
returnToLatest: E
|
|
6825
|
-
} = za(), [C, I] = ce(""), [R, D] = ce(null), [
|
|
6825
|
+
} = za(), [C, I] = ce(""), [R, D] = ce(null), [k, M] = ce(null), [j, K] = ce([]), [W, B] = ce(!1), [q, L] = ce([]), [G, T] = ce(null), P = rt(null), _ = rt(null), O = rt(null), [X, $] = ce("desktop");
|
|
6826
6826
|
ve(() => {
|
|
6827
6827
|
const F = () => {
|
|
6828
6828
|
const Q = window.innerWidth;
|
|
@@ -6887,7 +6887,7 @@ function Pn({
|
|
|
6887
6887
|
last_message_preview: xe.preview ?? void 0,
|
|
6888
6888
|
ts: new Date(xe.createdAt).getTime(),
|
|
6889
6889
|
isCurrent: xe.checkpointId === G
|
|
6890
|
-
})).sort((xe,
|
|
6890
|
+
})).sort((xe, Mu) => (xe.ts || 0) - (Mu.ts || 0));
|
|
6891
6891
|
}, V = (F) => {
|
|
6892
6892
|
if (F === void 0)
|
|
6893
6893
|
return { canGoBack: !1, canGoForward: !1, currentIndex: 0, totalBranches: 0 };
|
|
@@ -6901,24 +6901,24 @@ function Pn({
|
|
|
6901
6901
|
if (!F && j.length === 0) return;
|
|
6902
6902
|
const Q = z(F);
|
|
6903
6903
|
if (Q) {
|
|
6904
|
-
|
|
6904
|
+
M(Q);
|
|
6905
6905
|
return;
|
|
6906
6906
|
}
|
|
6907
6907
|
try {
|
|
6908
6908
|
const ne = window.__editingCheckpointId || G || void 0;
|
|
6909
|
-
await h(F, { checkpointId: ne, payloadExtras: R ? { edit: !0, originalMessageId: R } : void 0, attachments: j }), u == null || u(F), I(""),
|
|
6909
|
+
await h(F, { checkpointId: ne, payloadExtras: R ? { edit: !0, originalMessageId: R } : void 0, attachments: j }), u == null || u(F), I(""), M(null), K([]), delete window.__editingCheckpointId, D(null), _.current && (_.current.style.height = "auto");
|
|
6910
6910
|
} catch (ne) {
|
|
6911
6911
|
const ue = (ne == null ? void 0 : ne.message) || "Failed to send message";
|
|
6912
|
-
|
|
6912
|
+
M(ue), f == null || f(ue);
|
|
6913
6913
|
}
|
|
6914
6914
|
}, ie = (F, Q) => {
|
|
6915
|
-
a && (D(F), I(Q),
|
|
6915
|
+
a && (D(F), I(Q), M(null), setTimeout(() => {
|
|
6916
6916
|
_.current && (_.current.focus(), _.current.style.height = "auto", _.current.style.height = _.current.scrollHeight + "px");
|
|
6917
6917
|
}, 0));
|
|
6918
6918
|
}, oe = async (F, Q) => {
|
|
6919
6919
|
const ne = p.find((Re) => Re.id === F);
|
|
6920
6920
|
if (!ne) {
|
|
6921
|
-
|
|
6921
|
+
M("Message not found");
|
|
6922
6922
|
return;
|
|
6923
6923
|
}
|
|
6924
6924
|
const ue = le(ne);
|
|
@@ -6927,7 +6927,7 @@ function Pn({
|
|
|
6927
6927
|
return (Re = _.current) == null ? void 0 : Re.focus();
|
|
6928
6928
|
}, 0);
|
|
6929
6929
|
}, H = () => {
|
|
6930
|
-
D(null), I(""),
|
|
6930
|
+
D(null), I(""), M(null), delete window.__editingCheckpointId, _.current && (_.current.style.height = "auto");
|
|
6931
6931
|
}, Z = (F) => {
|
|
6932
6932
|
F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), re()) : F.key === "Escape" && R && (F.preventDefault(), H());
|
|
6933
6933
|
}, de = (F) => {
|
|
@@ -7059,7 +7059,7 @@ function Pn({
|
|
|
7059
7059
|
)
|
|
7060
7060
|
] }, Q)) })
|
|
7061
7061
|
] }),
|
|
7062
|
-
|
|
7062
|
+
k && /* @__PURE__ */ c("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: k }),
|
|
7063
7063
|
/* @__PURE__ */ N("div", { className: "flex items-end gap-2", children: [
|
|
7064
7064
|
s && /* @__PURE__ */ N(mb, { children: [
|
|
7065
7065
|
/* @__PURE__ */ c(gb, { asChild: !0, children: /* @__PURE__ */ c(
|
|
@@ -7088,11 +7088,11 @@ function Pn({
|
|
|
7088
7088
|
ref: _,
|
|
7089
7089
|
value: C,
|
|
7090
7090
|
onChange: (F) => {
|
|
7091
|
-
I(F.target.value),
|
|
7091
|
+
I(F.target.value), M(null), _.current && (_.current.style.height = "auto", _.current.style.height = `${_.current.scrollHeight}px`);
|
|
7092
7092
|
},
|
|
7093
7093
|
onKeyDown: Z,
|
|
7094
7094
|
placeholder: R ? "Edit your message..." : t,
|
|
7095
|
-
className: `resize-none min-h-[44px] max-h-[20rem] w-full ${R ? "border-blue-400 bg-blue-50" : ""} ${
|
|
7095
|
+
className: `resize-none min-h-[44px] max-h-[20rem] w-full ${R ? "border-blue-400 bg-blue-50" : ""} ${k ? "border-red-400" : ""} ${i.textarea || ""}`,
|
|
7096
7096
|
disabled: !1,
|
|
7097
7097
|
maxLength: Rt,
|
|
7098
7098
|
rows: 1
|
|
@@ -7151,7 +7151,7 @@ function no(e, [t, n]) {
|
|
|
7151
7151
|
function Cb(e, t) {
|
|
7152
7152
|
return l.useReducer((n, r) => t[n][r] ?? n, e);
|
|
7153
7153
|
}
|
|
7154
|
-
var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb,
|
|
7154
|
+
var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, ke] = Ac(Vo), Pc = l.forwardRef(
|
|
7155
7155
|
(e, t) => {
|
|
7156
7156
|
const {
|
|
7157
7157
|
__scopeScrollArea: n,
|
|
@@ -7159,13 +7159,13 @@ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, Me] = Ac(Vo), Pc = l.forwardRef(
|
|
|
7159
7159
|
dir: o,
|
|
7160
7160
|
scrollHideDelay: s = 600,
|
|
7161
7161
|
...a
|
|
7162
|
-
} = 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), [R, D] = l.useState(!1),
|
|
7162
|
+
} = 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), [R, D] = l.useState(!1), k = te(t, (j) => u(j)), M = tr(o);
|
|
7163
7163
|
return /* @__PURE__ */ c(
|
|
7164
7164
|
Eb,
|
|
7165
7165
|
{
|
|
7166
7166
|
scope: n,
|
|
7167
7167
|
type: r,
|
|
7168
|
-
dir:
|
|
7168
|
+
dir: M,
|
|
7169
7169
|
scrollHideDelay: s,
|
|
7170
7170
|
scrollArea: i,
|
|
7171
7171
|
viewport: f,
|
|
@@ -7185,9 +7185,9 @@ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, Me] = Ac(Vo), Pc = l.forwardRef(
|
|
|
7185
7185
|
children: /* @__PURE__ */ c(
|
|
7186
7186
|
J.div,
|
|
7187
7187
|
{
|
|
7188
|
-
dir:
|
|
7188
|
+
dir: M,
|
|
7189
7189
|
...a,
|
|
7190
|
-
ref:
|
|
7190
|
+
ref: k,
|
|
7191
7191
|
style: {
|
|
7192
7192
|
position: "relative",
|
|
7193
7193
|
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
|
|
@@ -7204,7 +7204,7 @@ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, Me] = Ac(Vo), Pc = l.forwardRef(
|
|
|
7204
7204
|
Pc.displayName = Vo;
|
|
7205
7205
|
var _c = "ScrollAreaViewport", Ic = l.forwardRef(
|
|
7206
7206
|
(e, t) => {
|
|
7207
|
-
const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a =
|
|
7207
|
+
const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a = ke(_c, n), i = l.useRef(null), u = te(t, i, a.onViewportChange);
|
|
7208
7208
|
return /* @__PURE__ */ N(De, { children: [
|
|
7209
7209
|
/* @__PURE__ */ c(
|
|
7210
7210
|
"style",
|
|
@@ -7246,7 +7246,7 @@ var _c = "ScrollAreaViewport", Ic = l.forwardRef(
|
|
|
7246
7246
|
Ic.displayName = _c;
|
|
7247
7247
|
var Ye = "ScrollAreaScrollbar", jo = l.forwardRef(
|
|
7248
7248
|
(e, t) => {
|
|
7249
|
-
const { forceMount: n, ...r } = e, o =
|
|
7249
|
+
const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
|
|
7250
7250
|
return l.useEffect(() => (i ? s(!0) : a(!0), () => {
|
|
7251
7251
|
i ? s(!1) : a(!1);
|
|
7252
7252
|
}), [i, s, a]), o.type === "hover" ? /* @__PURE__ */ c(Rb, { ...r, ref: t, forceMount: n }) : o.type === "scroll" ? /* @__PURE__ */ c(Nb, { ...r, ref: t, forceMount: n }) : o.type === "auto" ? /* @__PURE__ */ c(Oc, { ...r, ref: t, forceMount: n }) : o.type === "always" ? /* @__PURE__ */ c(Ko, { ...r, ref: t }) : null;
|
|
@@ -7254,7 +7254,7 @@ var Ye = "ScrollAreaScrollbar", jo = l.forwardRef(
|
|
|
7254
7254
|
);
|
|
7255
7255
|
jo.displayName = Ye;
|
|
7256
7256
|
var Rb = l.forwardRef((e, t) => {
|
|
7257
|
-
const { forceMount: n, ...r } = e, o =
|
|
7257
|
+
const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), [s, a] = l.useState(!1);
|
|
7258
7258
|
return l.useEffect(() => {
|
|
7259
7259
|
const i = o.scrollArea;
|
|
7260
7260
|
let u = 0;
|
|
@@ -7277,7 +7277,7 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7277
7277
|
}
|
|
7278
7278
|
) });
|
|
7279
7279
|
}), Nb = l.forwardRef((e, t) => {
|
|
7280
|
-
const { forceMount: n, ...r } = e, o =
|
|
7280
|
+
const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), s = e.orientation === "horizontal", a = hr(() => u("SCROLL_END"), 100), [i, u] = Cb("hidden", {
|
|
7281
7281
|
hidden: {
|
|
7282
7282
|
SCROLL: "scrolling"
|
|
7283
7283
|
},
|
|
@@ -7321,7 +7321,7 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7321
7321
|
}
|
|
7322
7322
|
) });
|
|
7323
7323
|
}), Oc = l.forwardRef((e, t) => {
|
|
7324
|
-
const n =
|
|
7324
|
+
const n = ke(Ye, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, a] = l.useState(!1), i = e.orientation === "horizontal", u = hr(() => {
|
|
7325
7325
|
if (n.viewport) {
|
|
7326
7326
|
const f = n.viewport.offsetWidth < n.viewport.scrollWidth, d = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
7327
7327
|
a(i ? f : d);
|
|
@@ -7336,7 +7336,7 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7336
7336
|
}
|
|
7337
7337
|
) });
|
|
7338
7338
|
}), Ko = l.forwardRef((e, t) => {
|
|
7339
|
-
const { orientation: n = "vertical", ...r } = e, o =
|
|
7339
|
+
const { orientation: n = "vertical", ...r } = e, o = ke(Ye, e.__scopeScrollArea), s = l.useRef(null), a = l.useRef(0), [i, u] = l.useState({
|
|
7340
7340
|
content: 0,
|
|
7341
7341
|
viewport: 0,
|
|
7342
7342
|
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
|
|
@@ -7390,11 +7390,11 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7390
7390
|
}
|
|
7391
7391
|
) : null;
|
|
7392
7392
|
}), Tb = l.forwardRef((e, t) => {
|
|
7393
|
-
const { sizes: n, onSizesChange: r, ...o } = e, s =
|
|
7393
|
+
const { sizes: n, onSizesChange: r, ...o } = e, s = ke(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarXChange);
|
|
7394
7394
|
return l.useEffect(() => {
|
|
7395
7395
|
u.current && i(getComputedStyle(u.current));
|
|
7396
7396
|
}, [u]), /* @__PURE__ */ c(
|
|
7397
|
-
|
|
7397
|
+
Mc,
|
|
7398
7398
|
{
|
|
7399
7399
|
"data-orientation": "horizontal",
|
|
7400
7400
|
...o,
|
|
@@ -7429,11 +7429,11 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7429
7429
|
}
|
|
7430
7430
|
);
|
|
7431
7431
|
}), Ab = l.forwardRef((e, t) => {
|
|
7432
|
-
const { sizes: n, onSizesChange: r, ...o } = e, s =
|
|
7432
|
+
const { sizes: n, onSizesChange: r, ...o } = e, s = ke(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarYChange);
|
|
7433
7433
|
return l.useEffect(() => {
|
|
7434
7434
|
u.current && i(getComputedStyle(u.current));
|
|
7435
7435
|
}, [u]), /* @__PURE__ */ c(
|
|
7436
|
-
|
|
7436
|
+
Mc,
|
|
7437
7437
|
{
|
|
7438
7438
|
"data-orientation": "vertical",
|
|
7439
7439
|
...o,
|
|
@@ -7468,7 +7468,7 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7468
7468
|
}
|
|
7469
7469
|
}
|
|
7470
7470
|
);
|
|
7471
|
-
}), [Pb,
|
|
7471
|
+
}), [Pb, kc] = Ac(Ye), Mc = l.forwardRef((e, t) => {
|
|
7472
7472
|
const {
|
|
7473
7473
|
__scopeScrollArea: n,
|
|
7474
7474
|
sizes: r,
|
|
@@ -7481,19 +7481,19 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7481
7481
|
onWheelScroll: d,
|
|
7482
7482
|
onResize: p,
|
|
7483
7483
|
...g
|
|
7484
|
-
} = e, v =
|
|
7485
|
-
function D(
|
|
7484
|
+
} = e, v = ke(Ye, n), [m, h] = l.useState(null), b = te(t, (k) => h(k)), w = l.useRef(null), y = l.useRef(""), x = v.viewport, E = r.content - r.viewport, C = we(d), I = we(u), R = hr(p, 10);
|
|
7485
|
+
function D(k) {
|
|
7486
7486
|
if (w.current) {
|
|
7487
|
-
const
|
|
7488
|
-
f({ x:
|
|
7487
|
+
const M = k.clientX - w.current.left, j = k.clientY - w.current.top;
|
|
7488
|
+
f({ x: M, y: j });
|
|
7489
7489
|
}
|
|
7490
7490
|
}
|
|
7491
7491
|
return l.useEffect(() => {
|
|
7492
|
-
const
|
|
7493
|
-
const j =
|
|
7494
|
-
(m == null ? void 0 : m.contains(j)) && C(
|
|
7492
|
+
const k = (M) => {
|
|
7493
|
+
const j = M.target;
|
|
7494
|
+
(m == null ? void 0 : m.contains(j)) && C(M, E);
|
|
7495
7495
|
};
|
|
7496
|
-
return document.addEventListener("wheel",
|
|
7496
|
+
return document.addEventListener("wheel", k, { passive: !1 }), () => document.removeEventListener("wheel", k, { passive: !1 });
|
|
7497
7497
|
}, [x, m, E, C]), l.useEffect(I, [r, I]), Ot(m, R), Ot(v.content, R), /* @__PURE__ */ c(
|
|
7498
7498
|
Pb,
|
|
7499
7499
|
{
|
|
@@ -7510,13 +7510,13 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7510
7510
|
...g,
|
|
7511
7511
|
ref: b,
|
|
7512
7512
|
style: { position: "absolute", ...g.style },
|
|
7513
|
-
onPointerDown: U(e.onPointerDown, (
|
|
7514
|
-
|
|
7513
|
+
onPointerDown: U(e.onPointerDown, (k) => {
|
|
7514
|
+
k.button === 0 && (k.target.setPointerCapture(k.pointerId), w.current = m.getBoundingClientRect(), y.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), D(k));
|
|
7515
7515
|
}),
|
|
7516
7516
|
onPointerMove: U(e.onPointerMove, D),
|
|
7517
|
-
onPointerUp: U(e.onPointerUp, (
|
|
7518
|
-
const
|
|
7519
|
-
|
|
7517
|
+
onPointerUp: U(e.onPointerUp, (k) => {
|
|
7518
|
+
const M = k.target;
|
|
7519
|
+
M.hasPointerCapture(k.pointerId) && M.releasePointerCapture(k.pointerId), document.body.style.webkitUserSelect = y.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
|
|
7520
7520
|
})
|
|
7521
7521
|
}
|
|
7522
7522
|
)
|
|
@@ -7524,12 +7524,12 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7524
7524
|
);
|
|
7525
7525
|
}), Vn = "ScrollAreaThumb", Dc = l.forwardRef(
|
|
7526
7526
|
(e, t) => {
|
|
7527
|
-
const { forceMount: n, ...r } = e, o =
|
|
7527
|
+
const { forceMount: n, ...r } = e, o = kc(Vn, e.__scopeScrollArea);
|
|
7528
7528
|
return /* @__PURE__ */ c(Ae, { present: n || o.hasThumb, children: /* @__PURE__ */ c(_b, { ref: t, ...r }) });
|
|
7529
7529
|
}
|
|
7530
7530
|
), _b = l.forwardRef(
|
|
7531
7531
|
(e, t) => {
|
|
7532
|
-
const { __scopeScrollArea: n, style: r, ...o } = e, s =
|
|
7532
|
+
const { __scopeScrollArea: n, style: r, ...o } = e, s = ke(Vn, n), a = kc(Vn, n), { onThumbPositionChange: i } = a, u = te(
|
|
7533
7533
|
t,
|
|
7534
7534
|
(p) => a.onThumbChange(p)
|
|
7535
7535
|
), f = l.useRef(void 0), d = hr(() => {
|
|
@@ -7540,7 +7540,7 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7540
7540
|
if (p) {
|
|
7541
7541
|
const g = () => {
|
|
7542
7542
|
if (d(), !f.current) {
|
|
7543
|
-
const v =
|
|
7543
|
+
const v = kb(p, i);
|
|
7544
7544
|
f.current = v, i();
|
|
7545
7545
|
}
|
|
7546
7546
|
};
|
|
@@ -7569,13 +7569,13 @@ var Rb = l.forwardRef((e, t) => {
|
|
|
7569
7569
|
Dc.displayName = Vn;
|
|
7570
7570
|
var Go = "ScrollAreaCorner", Lc = l.forwardRef(
|
|
7571
7571
|
(e, t) => {
|
|
7572
|
-
const n =
|
|
7572
|
+
const n = ke(Go, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
7573
7573
|
return n.type !== "scroll" && r ? /* @__PURE__ */ c(Ib, { ...e, ref: t }) : null;
|
|
7574
7574
|
}
|
|
7575
7575
|
);
|
|
7576
7576
|
Lc.displayName = Go;
|
|
7577
7577
|
var Ib = l.forwardRef((e, t) => {
|
|
7578
|
-
const { __scopeScrollArea: n, ...r } = e, o =
|
|
7578
|
+
const { __scopeScrollArea: n, ...r } = e, o = ke(Go, n), [s, a] = l.useState(0), [i, u] = l.useState(0), f = !!(s && i);
|
|
7579
7579
|
return Ot(o.scrollbarX, () => {
|
|
7580
7580
|
var p;
|
|
7581
7581
|
const d = ((p = o.scrollbarX) == null ? void 0 : p.offsetHeight) || 0;
|
|
@@ -7630,7 +7630,7 @@ function $c(e, t) {
|
|
|
7630
7630
|
function Bc(e, t) {
|
|
7631
7631
|
return e > 0 && e < t;
|
|
7632
7632
|
}
|
|
7633
|
-
var
|
|
7633
|
+
var kb = (e, t = () => {
|
|
7634
7634
|
}) => {
|
|
7635
7635
|
let n = { left: e.scrollLeft, top: e.scrollTop }, r = 0;
|
|
7636
7636
|
return function o() {
|
|
@@ -7658,7 +7658,7 @@ function Ot(e, t) {
|
|
|
7658
7658
|
}
|
|
7659
7659
|
}, [e, n]);
|
|
7660
7660
|
}
|
|
7661
|
-
var Uc = Pc,
|
|
7661
|
+
var Uc = Pc, Mb = Ic, Db = Lc;
|
|
7662
7662
|
const zc = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ N(
|
|
7663
7663
|
Uc,
|
|
7664
7664
|
{
|
|
@@ -7666,7 +7666,7 @@ const zc = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
|
|
|
7666
7666
|
className: A("relative overflow-hidden", e),
|
|
7667
7667
|
...n,
|
|
7668
7668
|
children: [
|
|
7669
|
-
/* @__PURE__ */ c(
|
|
7669
|
+
/* @__PURE__ */ c(Mb, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
|
|
7670
7670
|
/* @__PURE__ */ c(Hc, {}),
|
|
7671
7671
|
/* @__PURE__ */ c(Db, {})
|
|
7672
7672
|
]
|
|
@@ -7710,7 +7710,7 @@ function ro({
|
|
|
7710
7710
|
createThread: h,
|
|
7711
7711
|
deleteThread: b,
|
|
7712
7712
|
renameThread: w
|
|
7713
|
-
} = za(), [y, x] = ce(g ?? []), [E, C] = ce(!1), [I, R] = ce(null), [D,
|
|
7713
|
+
} = za(), [y, x] = ce(g ?? []), [E, C] = ce(!1), [I, R] = ce(null), [D, k] = ce(null), [M, j] = ce(""), [K, W] = ce(!1);
|
|
7714
7714
|
ve(() => {
|
|
7715
7715
|
x(g ?? []);
|
|
7716
7716
|
}, [g]);
|
|
@@ -7738,16 +7738,16 @@ function ro({
|
|
|
7738
7738
|
console.error("Failed to delete thread:", le);
|
|
7739
7739
|
}
|
|
7740
7740
|
}, G = ($, z) => {
|
|
7741
|
-
z.stopPropagation(),
|
|
7741
|
+
z.stopPropagation(), k($.threadId), j($.title || `Thread ${$.threadId.slice(0, 8)}`);
|
|
7742
7742
|
}, T = async ($) => {
|
|
7743
|
-
if (
|
|
7743
|
+
if (M.trim())
|
|
7744
7744
|
try {
|
|
7745
|
-
await w($,
|
|
7745
|
+
await w($, M.trim()), k(null), j("");
|
|
7746
7746
|
} catch (z) {
|
|
7747
7747
|
console.error("Failed to update title:", z);
|
|
7748
7748
|
}
|
|
7749
7749
|
}, P = () => {
|
|
7750
|
-
|
|
7750
|
+
k(null), j("");
|
|
7751
7751
|
}, _ = ($, z) => {
|
|
7752
7752
|
$.key === "Enter" ? T(z) : $.key === "Escape" && P();
|
|
7753
7753
|
}, O = ($) => {
|
|
@@ -7775,7 +7775,7 @@ function ro({
|
|
|
7775
7775
|
children: [
|
|
7776
7776
|
/* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
|
|
7777
7777
|
/* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: D === $.threadId ? /* @__PURE__ */ N("div", { className: "flex items-center gap-2", onClick: (z) => z.stopPropagation(), children: [
|
|
7778
|
-
/* @__PURE__ */ c(tn, { value:
|
|
7778
|
+
/* @__PURE__ */ c(tn, { value: M, onChange: (z) => j(z.target.value), onKeyDown: (z) => _(z, $.threadId), className: "h-6 text-sm", autoFocus: !0 }),
|
|
7779
7779
|
/* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => T($.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(ho, { size: 12 }) }),
|
|
7780
7780
|
/* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: P, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Kt, { size: 12 }) })
|
|
7781
7781
|
] }) : /* @__PURE__ */ N(De, { children: [
|
|
@@ -8362,7 +8362,7 @@ Sl.displayName = nn;
|
|
|
8362
8362
|
var so = "TooltipTrigger", Cl = l.forwardRef(
|
|
8363
8363
|
(e, t) => {
|
|
8364
8364
|
const { __scopeTooltip: n, ...r } = e, o = vr(so, n), s = Qo(so, n), a = br(n), i = l.useRef(null), u = te(t, i, o.onTriggerChange), f = l.useRef(!1), d = l.useRef(!1), p = l.useCallback(() => f.current = !1, []);
|
|
8365
|
-
return l.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(
|
|
8365
|
+
return l.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(ko, { asChild: !0, ...a, children: /* @__PURE__ */ c(
|
|
8366
8366
|
J.button,
|
|
8367
8367
|
{
|
|
8368
8368
|
"aria-describedby": o.open ? o.contentId : void 0,
|
|
@@ -8390,13 +8390,13 @@ var so = "TooltipTrigger", Cl = l.forwardRef(
|
|
|
8390
8390
|
Cl.displayName = so;
|
|
8391
8391
|
var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
|
|
8392
8392
|
forceMount: void 0
|
|
8393
|
-
}),
|
|
8393
|
+
}), kt = "TooltipContent", El = l.forwardRef(
|
|
8394
8394
|
(e, t) => {
|
|
8395
|
-
const n = hv(
|
|
8395
|
+
const n = hv(kt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = vr(kt, e.__scopeTooltip);
|
|
8396
8396
|
return /* @__PURE__ */ c(Ae, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Rl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(mv, { side: o, ...s, ref: t }) });
|
|
8397
8397
|
}
|
|
8398
8398
|
), mv = l.forwardRef((e, t) => {
|
|
8399
|
-
const n = vr(
|
|
8399
|
+
const n = vr(kt, e.__scopeTooltip), r = Qo(kt, e.__scopeTooltip), o = l.useRef(null), s = te(t, o), [a, i] = l.useState(null), { trigger: u, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, g = l.useCallback(() => {
|
|
8400
8400
|
i(null), p(!1);
|
|
8401
8401
|
}, [p]), v = l.useCallback(
|
|
8402
8402
|
(m, h) => {
|
|
@@ -8430,7 +8430,7 @@ var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
|
|
|
8430
8430
|
onEscapeKeyDown: s,
|
|
8431
8431
|
onPointerDownOutside: a,
|
|
8432
8432
|
...i
|
|
8433
|
-
} = e, u = vr(
|
|
8433
|
+
} = e, u = vr(kt, n), f = br(n), { onClose: d } = u;
|
|
8434
8434
|
return l.useEffect(() => (document.addEventListener(oo, d), () => document.removeEventListener(oo, d)), [d]), l.useEffect(() => {
|
|
8435
8435
|
if (u.trigger) {
|
|
8436
8436
|
const p = (g) => {
|
|
@@ -8449,7 +8449,7 @@ var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
|
|
|
8449
8449
|
onFocusOutside: (p) => p.preventDefault(),
|
|
8450
8450
|
onDismiss: d,
|
|
8451
8451
|
children: /* @__PURE__ */ N(
|
|
8452
|
-
|
|
8452
|
+
Mo,
|
|
8453
8453
|
{
|
|
8454
8454
|
"data-state": u.stateAttribute,
|
|
8455
8455
|
...f,
|
|
@@ -8473,7 +8473,7 @@ var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
|
|
|
8473
8473
|
);
|
|
8474
8474
|
}
|
|
8475
8475
|
);
|
|
8476
|
-
El.displayName =
|
|
8476
|
+
El.displayName = kt;
|
|
8477
8477
|
var Nl = "TooltipArrow", wv = l.forwardRef(
|
|
8478
8478
|
(e, t) => {
|
|
8479
8479
|
const { __scopeTooltip: n, ...r } = e, o = br(n);
|
|
@@ -8590,7 +8590,7 @@ const Pv = Nv, _v = Tv, Iv = Av, Al = l.forwardRef(({ className: e, sideOffset:
|
|
|
8590
8590
|
}
|
|
8591
8591
|
));
|
|
8592
8592
|
Al.displayName = Tl.displayName;
|
|
8593
|
-
const Ov = "sidebar:state",
|
|
8593
|
+
const Ov = "sidebar:state", kv = 60 * 60 * 24 * 7, Mv = "16rem", Dv = "18rem", Lv = "3rem", Fv = "b", Pl = l.createContext(null);
|
|
8594
8594
|
function wr() {
|
|
8595
8595
|
const e = l.useContext(Pl);
|
|
8596
8596
|
if (!e)
|
|
@@ -8610,7 +8610,7 @@ const _l = l.forwardRef(
|
|
|
8610
8610
|
const u = Hb(), [f, d] = l.useState(!1), [p, g] = l.useState(e), v = t ?? p, m = l.useCallback(
|
|
8611
8611
|
(y) => {
|
|
8612
8612
|
const x = typeof y == "function" ? y(v) : y;
|
|
8613
|
-
n ? n(x) : g(x), document.cookie = `${Ov}=${x}; path=/; max-age=${
|
|
8613
|
+
n ? n(x) : g(x), document.cookie = `${Ov}=${x}; path=/; max-age=${kv}`;
|
|
8614
8614
|
},
|
|
8615
8615
|
[n, v]
|
|
8616
8616
|
), h = l.useCallback(() => u ? d((y) => !y) : m((y) => !y), [u, m, d]);
|
|
@@ -8636,7 +8636,7 @@ const _l = l.forwardRef(
|
|
|
8636
8636
|
"div",
|
|
8637
8637
|
{
|
|
8638
8638
|
style: {
|
|
8639
|
-
"--sidebar-width":
|
|
8639
|
+
"--sidebar-width": Mv,
|
|
8640
8640
|
"--sidebar-width-icon": Lv,
|
|
8641
8641
|
...o
|
|
8642
8642
|
},
|
|
@@ -8780,7 +8780,7 @@ const $v = l.forwardRef(({ className: e, ...t }, n) => {
|
|
|
8780
8780
|
);
|
|
8781
8781
|
});
|
|
8782
8782
|
$v.displayName = "SidebarRail";
|
|
8783
|
-
const
|
|
8783
|
+
const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8784
8784
|
"main",
|
|
8785
8785
|
{
|
|
8786
8786
|
ref: n,
|
|
@@ -8792,7 +8792,7 @@ const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8792
8792
|
...t
|
|
8793
8793
|
}
|
|
8794
8794
|
));
|
|
8795
|
-
|
|
8795
|
+
kl.displayName = "SidebarInset";
|
|
8796
8796
|
const Bv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8797
8797
|
tn,
|
|
8798
8798
|
{
|
|
@@ -8806,7 +8806,7 @@ const Bv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8806
8806
|
}
|
|
8807
8807
|
));
|
|
8808
8808
|
Bv.displayName = "SidebarInput";
|
|
8809
|
-
const
|
|
8809
|
+
const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8810
8810
|
"div",
|
|
8811
8811
|
{
|
|
8812
8812
|
ref: n,
|
|
@@ -8815,7 +8815,7 @@ const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8815
8815
|
...t
|
|
8816
8816
|
}
|
|
8817
8817
|
));
|
|
8818
|
-
|
|
8818
|
+
Ml.displayName = "SidebarHeader";
|
|
8819
8819
|
const Uv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
8820
8820
|
"div",
|
|
8821
8821
|
{
|
|
@@ -8860,7 +8860,7 @@ const Ll = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
8860
8860
|
));
|
|
8861
8861
|
Ll.displayName = "SidebarGroup";
|
|
8862
8862
|
const Fl = l.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PURE__ */ c(
|
|
8863
|
-
t ?
|
|
8863
|
+
t ? Mt : "div",
|
|
8864
8864
|
{
|
|
8865
8865
|
ref: r,
|
|
8866
8866
|
"data-sidebar": "group-label",
|
|
@@ -8874,7 +8874,7 @@ const Fl = l.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PU
|
|
|
8874
8874
|
));
|
|
8875
8875
|
Fl.displayName = "SidebarGroupLabel";
|
|
8876
8876
|
const Hv = l.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PURE__ */ c(
|
|
8877
|
-
t ?
|
|
8877
|
+
t ? Mt : "button",
|
|
8878
8878
|
{
|
|
8879
8879
|
ref: r,
|
|
8880
8880
|
"data-sidebar": "group-action",
|
|
@@ -8948,7 +8948,7 @@ const Wv = rn(
|
|
|
8948
8948
|
className: s,
|
|
8949
8949
|
...a
|
|
8950
8950
|
}, i) => {
|
|
8951
|
-
const u = e ?
|
|
8951
|
+
const u = e ? Mt : "button", { isMobile: f, state: d } = wr(), p = /* @__PURE__ */ c(
|
|
8952
8952
|
u,
|
|
8953
8953
|
{
|
|
8954
8954
|
ref: i,
|
|
@@ -8977,7 +8977,7 @@ const Wv = rn(
|
|
|
8977
8977
|
);
|
|
8978
8978
|
zl.displayName = "SidebarMenuButton";
|
|
8979
8979
|
const Vv = l.forwardRef(({ className: e, asChild: t = !1, showOnHover: n = !1, ...r }, o) => /* @__PURE__ */ c(
|
|
8980
|
-
t ?
|
|
8980
|
+
t ? Mt : "button",
|
|
8981
8981
|
{
|
|
8982
8982
|
ref: o,
|
|
8983
8983
|
"data-sidebar": "menu-action",
|
|
@@ -9063,7 +9063,7 @@ Gv.displayName = "SidebarMenuSub";
|
|
|
9063
9063
|
const qv = l.forwardRef(({ ...e }, t) => /* @__PURE__ */ c("li", { ref: t, ...e }));
|
|
9064
9064
|
qv.displayName = "SidebarMenuSubItem";
|
|
9065
9065
|
const Xv = l.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, className: r, ...o }, s) => /* @__PURE__ */ c(
|
|
9066
|
-
e ?
|
|
9066
|
+
e ? Mt : "a",
|
|
9067
9067
|
{
|
|
9068
9068
|
ref: s,
|
|
9069
9069
|
"data-sidebar": "menu-sub-button",
|
|
@@ -9092,7 +9092,7 @@ function Py({
|
|
|
9092
9092
|
}) {
|
|
9093
9093
|
return /* @__PURE__ */ c(Rn, { ...a, children: /* @__PURE__ */ N(_l, { className: `w-full ${r}`, children: [
|
|
9094
9094
|
/* @__PURE__ */ N(Il, { className: `border-r ${o}`, children: [
|
|
9095
|
-
/* @__PURE__ */ c(
|
|
9095
|
+
/* @__PURE__ */ c(Ml, { children: /* @__PURE__ */ c(Bl, { children: /* @__PURE__ */ c(Ul, { children: /* @__PURE__ */ c(zl, { size: "lg", children: /* @__PURE__ */ c("span", { className: "font-semibold", children: t }) }) }) }) }),
|
|
9096
9096
|
/* @__PURE__ */ c(Dl, { children: n && /* @__PURE__ */ N(Ll, { children: [
|
|
9097
9097
|
/* @__PURE__ */ c(Fl, { children: "Conversations" }),
|
|
9098
9098
|
/* @__PURE__ */ c($l, { children: /* @__PURE__ */ c("div", { className: "px-2 py-1", children: /* @__PURE__ */ c(
|
|
@@ -9106,7 +9106,7 @@ function Py({
|
|
|
9106
9106
|
) }) })
|
|
9107
9107
|
] }) })
|
|
9108
9108
|
] }),
|
|
9109
|
-
/* @__PURE__ */ N(
|
|
9109
|
+
/* @__PURE__ */ N(kl, { children: [
|
|
9110
9110
|
/* @__PURE__ */ N("header", { className: "h-14 border-b bg-background/60 backdrop-blur flex items-center gap-2 px-4", children: [
|
|
9111
9111
|
/* @__PURE__ */ c(Ol, {}),
|
|
9112
9112
|
/* @__PURE__ */ c("div", { className: "flex-1" }),
|
|
@@ -9305,7 +9305,7 @@ var rw = [" ", "Enter", "ArrowUp", "ArrowDown"], ow = [" ", "Enter"], gt = "Sele
|
|
|
9305
9305
|
defaultProp: o ?? !1,
|
|
9306
9306
|
onChange: s,
|
|
9307
9307
|
caller: gt
|
|
9308
|
-
}), [
|
|
9308
|
+
}), [k, M] = ot({
|
|
9309
9309
|
prop: a,
|
|
9310
9310
|
defaultProp: i,
|
|
9311
9311
|
onChange: u,
|
|
@@ -9323,8 +9323,8 @@ var rw = [" ", "Enter", "ArrowUp", "ArrowDown"], ow = [" ", "Enter"], gt = "Sele
|
|
|
9323
9323
|
valueNodeHasChildren: E,
|
|
9324
9324
|
onValueNodeHasChildrenChange: C,
|
|
9325
9325
|
contentId: Le(),
|
|
9326
|
-
value:
|
|
9327
|
-
onValueChange:
|
|
9326
|
+
value: k,
|
|
9327
|
+
onValueChange: M,
|
|
9328
9328
|
open: R,
|
|
9329
9329
|
onOpenChange: D,
|
|
9330
9330
|
dir: I,
|
|
@@ -9355,12 +9355,12 @@ var rw = [" ", "Enter", "ArrowUp", "ArrowDown"], ow = [" ", "Enter"], gt = "Sele
|
|
|
9355
9355
|
tabIndex: -1,
|
|
9356
9356
|
name: d,
|
|
9357
9357
|
autoComplete: p,
|
|
9358
|
-
value:
|
|
9359
|
-
onChange: (L) =>
|
|
9358
|
+
value: k,
|
|
9359
|
+
onChange: (L) => M(L.target.value),
|
|
9360
9360
|
disabled: g,
|
|
9361
9361
|
form: m,
|
|
9362
9362
|
children: [
|
|
9363
|
-
|
|
9363
|
+
k === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
|
|
9364
9364
|
Array.from(W)
|
|
9365
9365
|
]
|
|
9366
9366
|
},
|
|
@@ -9382,7 +9382,7 @@ var Zl = "SelectTrigger", Ql = l.forwardRef(
|
|
|
9382
9382
|
y: Math.round(h.pageY)
|
|
9383
9383
|
});
|
|
9384
9384
|
};
|
|
9385
|
-
return /* @__PURE__ */ c(
|
|
9385
|
+
return /* @__PURE__ */ c(ko, { asChild: !0, ...s, children: /* @__PURE__ */ c(
|
|
9386
9386
|
J.button,
|
|
9387
9387
|
{
|
|
9388
9388
|
type: "button",
|
|
@@ -9457,7 +9457,7 @@ var bt = "SelectContent", ou = l.forwardRef(
|
|
|
9457
9457
|
}
|
|
9458
9458
|
);
|
|
9459
9459
|
ou.displayName = bt;
|
|
9460
|
-
var
|
|
9460
|
+
var Me = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent.RemoveScroll"), au = l.forwardRef(
|
|
9461
9461
|
(e, t) => {
|
|
9462
9462
|
const {
|
|
9463
9463
|
__scopeSelect: n,
|
|
@@ -9479,7 +9479,7 @@ var ke = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent
|
|
|
9479
9479
|
avoidCollisions: b,
|
|
9480
9480
|
//
|
|
9481
9481
|
...w
|
|
9482
|
-
} = e, y = it(bt, n), [x, E] = l.useState(null), [C, I] = l.useState(null), R = te(t, (V) => E(V)), [D,
|
|
9482
|
+
} = e, y = it(bt, n), [x, E] = l.useState(null), [C, I] = l.useState(null), R = te(t, (V) => E(V)), [D, k] = l.useState(null), [M, j] = l.useState(
|
|
9483
9483
|
null
|
|
9484
9484
|
), K = Sr(n), [W, B] = l.useState(!1), q = l.useRef(!1);
|
|
9485
9485
|
l.useEffect(() => {
|
|
@@ -9528,7 +9528,7 @@ var ke = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent
|
|
|
9528
9528
|
}), X = l.useCallback(
|
|
9529
9529
|
(V, re, ie) => {
|
|
9530
9530
|
const oe = !q.current && !ie;
|
|
9531
|
-
(y.value !== void 0 && y.value === re || oe) && (
|
|
9531
|
+
(y.value !== void 0 && y.value === re || oe) && (k(V), oe && (q.current = !0));
|
|
9532
9532
|
},
|
|
9533
9533
|
[y.value]
|
|
9534
9534
|
), $ = l.useCallback(() => x == null ? void 0 : x.focus(), [x]), z = l.useCallback(
|
|
@@ -9561,7 +9561,7 @@ var ke = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent
|
|
|
9561
9561
|
onItemLeave: $,
|
|
9562
9562
|
itemTextRefCallback: z,
|
|
9563
9563
|
focusSelectedItem: G,
|
|
9564
|
-
selectedItemText:
|
|
9564
|
+
selectedItemText: M,
|
|
9565
9565
|
position: r,
|
|
9566
9566
|
isPositioned: W,
|
|
9567
9567
|
searchRef: _,
|
|
@@ -9631,26 +9631,26 @@ au.displayName = dw;
|
|
|
9631
9631
|
var pw = "SelectItemAlignedPosition", iu = l.forwardRef((e, t) => {
|
|
9632
9632
|
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 = te(t, (R) => d(R)), g = Sr(n), v = l.useRef(!1), m = l.useRef(!0), { viewport: h, selectedItem: b, selectedItemText: w, focusSelectedItem: y } = a, x = l.useCallback(() => {
|
|
9633
9633
|
if (s.trigger && s.valueNode && i && f && h && b && w) {
|
|
9634
|
-
const R = s.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(),
|
|
9634
|
+
const R = s.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), k = s.valueNode.getBoundingClientRect(), M = w.getBoundingClientRect();
|
|
9635
9635
|
if (s.dir !== "rtl") {
|
|
9636
|
-
const H =
|
|
9637
|
-
|
|
9636
|
+
const H = M.left - D.left, Z = k.left - H, de = R.left - Z, pe = R.width + de, Y = Math.max(pe, D.width), ge = window.innerWidth - Me, ae = no(Z, [
|
|
9637
|
+
Me,
|
|
9638
9638
|
// Prevents the content from going off the starting edge of the
|
|
9639
9639
|
// viewport. It may still go off the ending edge, but this can be
|
|
9640
9640
|
// controlled by the user since they may want to manage overflow in a
|
|
9641
9641
|
// specific way.
|
|
9642
9642
|
// https://github.com/radix-ui/primitives/issues/2049
|
|
9643
|
-
Math.max(
|
|
9643
|
+
Math.max(Me, ge - Y)
|
|
9644
9644
|
]);
|
|
9645
9645
|
i.style.minWidth = pe + "px", i.style.left = ae + "px";
|
|
9646
9646
|
} else {
|
|
9647
|
-
const H = D.right -
|
|
9648
|
-
|
|
9649
|
-
Math.max(
|
|
9647
|
+
const H = D.right - M.right, Z = window.innerWidth - k.right - H, de = window.innerWidth - R.right - Z, pe = R.width + de, Y = Math.max(pe, D.width), ge = window.innerWidth - Me, ae = no(Z, [
|
|
9648
|
+
Me,
|
|
9649
|
+
Math.max(Me, ge - Y)
|
|
9650
9650
|
]);
|
|
9651
9651
|
i.style.minWidth = pe + "px", i.style.right = ae + "px";
|
|
9652
9652
|
}
|
|
9653
|
-
const j = g(), K = window.innerHeight -
|
|
9653
|
+
const j = g(), K = window.innerHeight - Me * 2, W = h.scrollHeight, B = window.getComputedStyle(f), q = parseInt(B.borderTopWidth, 10), L = parseInt(B.paddingTop, 10), G = parseInt(B.borderBottomWidth, 10), T = parseInt(B.paddingBottom, 10), P = q + L + W + T + G, _ = Math.min(b.offsetHeight * 5, P), O = window.getComputedStyle(h), X = parseInt(O.paddingTop, 10), $ = parseInt(O.paddingBottom, 10), z = R.top + R.height / 2 - Me, le = K - z, se = b.offsetHeight / 2, V = b.offsetTop + se, re = q + L + V, ie = P - re;
|
|
9654
9654
|
if (re <= z) {
|
|
9655
9655
|
const H = j.length > 0 && b === j[j.length - 1].ref.current;
|
|
9656
9656
|
i.style.bottom = "0px";
|
|
@@ -9670,7 +9670,7 @@ var pw = "SelectItemAlignedPosition", iu = l.forwardRef((e, t) => {
|
|
|
9670
9670
|
) + ie;
|
|
9671
9671
|
i.style.height = de + "px", h.scrollTop = re - z + h.offsetTop;
|
|
9672
9672
|
}
|
|
9673
|
-
i.style.margin = `${
|
|
9673
|
+
i.style.margin = `${Me}px 0`, i.style.minHeight = _ + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
|
|
9674
9674
|
}
|
|
9675
9675
|
}, [
|
|
9676
9676
|
g,
|
|
@@ -9737,11 +9737,11 @@ var hw = "SelectPopperPosition", ao = l.forwardRef((e, t) => {
|
|
|
9737
9737
|
const {
|
|
9738
9738
|
__scopeSelect: n,
|
|
9739
9739
|
align: r = "start",
|
|
9740
|
-
collisionPadding: o =
|
|
9740
|
+
collisionPadding: o = Me,
|
|
9741
9741
|
...s
|
|
9742
9742
|
} = e, a = Cr(n);
|
|
9743
9743
|
return /* @__PURE__ */ c(
|
|
9744
|
-
|
|
9744
|
+
Mo,
|
|
9745
9745
|
{
|
|
9746
9746
|
...a,
|
|
9747
9747
|
...s,
|
|
@@ -9800,7 +9800,7 @@ var [mw, es] = Ut(bt, {}), io = "SelectViewport", cu = l.forwardRef(
|
|
|
9800
9800
|
if (g != null && g.current && p) {
|
|
9801
9801
|
const v = Math.abs(u.current - d.scrollTop);
|
|
9802
9802
|
if (v > 0) {
|
|
9803
|
-
const m = window.innerHeight -
|
|
9803
|
+
const m = window.innerHeight - Me * 2, h = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(h, b);
|
|
9804
9804
|
if (w < m) {
|
|
9805
9805
|
const y = w + v, x = Math.min(m, y), E = y - x;
|
|
9806
9806
|
p.style.height = x + "px", p.style.bottom === "0px" && (d.scrollTop = E > 0 ? E : 0, p.style.justifyContent = "flex-end");
|
|
@@ -10115,7 +10115,7 @@ const Ou = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10115
10115
|
}
|
|
10116
10116
|
));
|
|
10117
10117
|
Ou.displayName = Pu.displayName;
|
|
10118
|
-
const
|
|
10118
|
+
const ku = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
10119
10119
|
_u,
|
|
10120
10120
|
{
|
|
10121
10121
|
ref: n,
|
|
@@ -10127,7 +10127,7 @@ const Mu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10127
10127
|
children: /* @__PURE__ */ c(Nt, { className: "h-4 w-4" })
|
|
10128
10128
|
}
|
|
10129
10129
|
));
|
|
10130
|
-
|
|
10130
|
+
ku.displayName = _u.displayName;
|
|
10131
10131
|
const po = l.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c(Tw, { children: /* @__PURE__ */ N(
|
|
10132
10132
|
Nu,
|
|
10133
10133
|
{
|
|
@@ -10151,7 +10151,7 @@ const po = l.forwardRef(({ className: e, children: t, position: n = "popper", ..
|
|
|
10151
10151
|
children: t
|
|
10152
10152
|
}
|
|
10153
10153
|
),
|
|
10154
|
-
/* @__PURE__ */ c(
|
|
10154
|
+
/* @__PURE__ */ c(ku, {})
|
|
10155
10155
|
]
|
|
10156
10156
|
}
|
|
10157
10157
|
) }));
|
|
@@ -10223,7 +10223,7 @@ const On = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10223
10223
|
}
|
|
10224
10224
|
));
|
|
10225
10225
|
On.displayName = "CardTitle";
|
|
10226
|
-
const
|
|
10226
|
+
const kw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
10227
10227
|
"p",
|
|
10228
10228
|
{
|
|
10229
10229
|
ref: n,
|
|
@@ -10231,10 +10231,10 @@ const Mw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10231
10231
|
...t
|
|
10232
10232
|
}
|
|
10233
10233
|
));
|
|
10234
|
-
|
|
10235
|
-
const
|
|
10236
|
-
|
|
10237
|
-
const
|
|
10234
|
+
kw.displayName = "CardDescription";
|
|
10235
|
+
const kn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
|
|
10236
|
+
kn.displayName = "CardContent";
|
|
10237
|
+
const Mw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
10238
10238
|
"div",
|
|
10239
10239
|
{
|
|
10240
10240
|
ref: n,
|
|
@@ -10242,7 +10242,7 @@ const kw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
|
|
|
10242
10242
|
...t
|
|
10243
10243
|
}
|
|
10244
10244
|
));
|
|
10245
|
-
|
|
10245
|
+
Mw.displayName = "CardFooter";
|
|
10246
10246
|
const Dw = 1, Lw = 1e6;
|
|
10247
10247
|
let Ur = 0;
|
|
10248
10248
|
function Fw() {
|
|
@@ -10295,10 +10295,10 @@ const zr = /* @__PURE__ */ new Map(), ia = (e) => {
|
|
|
10295
10295
|
toasts: e.toasts.filter((n) => n.id !== t.toastId)
|
|
10296
10296
|
};
|
|
10297
10297
|
}
|
|
10298
|
-
},
|
|
10298
|
+
}, Mn = [];
|
|
10299
10299
|
let Dn = { toasts: [] };
|
|
10300
10300
|
function Yt(e) {
|
|
10301
|
-
Dn = $w(Dn, e),
|
|
10301
|
+
Dn = $w(Dn, e), Mn.forEach((t) => {
|
|
10302
10302
|
t(Dn);
|
|
10303
10303
|
});
|
|
10304
10304
|
}
|
|
@@ -10325,9 +10325,9 @@ function Bw({ ...e }) {
|
|
|
10325
10325
|
}
|
|
10326
10326
|
function Uw() {
|
|
10327
10327
|
const [e, t] = l.useState(Dn);
|
|
10328
|
-
return l.useEffect(() => (
|
|
10329
|
-
const n =
|
|
10330
|
-
n > -1 &&
|
|
10328
|
+
return l.useEffect(() => (Mn.push(t), () => {
|
|
10329
|
+
const n = Mn.indexOf(t);
|
|
10330
|
+
n > -1 && Mn.splice(n, 1);
|
|
10331
10331
|
}), [e]), {
|
|
10332
10332
|
...e,
|
|
10333
10333
|
toast: Bw,
|
|
@@ -10405,7 +10405,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10405
10405
|
/* @__PURE__ */ c(Xu, { className: "h-5 w-5" }),
|
|
10406
10406
|
"API Configuration"
|
|
10407
10407
|
] }) }),
|
|
10408
|
-
/* @__PURE__ */ N(
|
|
10408
|
+
/* @__PURE__ */ N(kn, { className: "space-y-4", children: [
|
|
10409
10409
|
/* @__PURE__ */ N("div", { className: "space-y-2", children: [
|
|
10410
10410
|
/* @__PURE__ */ c(Ie, { htmlFor: "api-url", children: "API Base URL" }),
|
|
10411
10411
|
/* @__PURE__ */ N("div", { className: "flex gap-2", children: [
|
|
@@ -10472,7 +10472,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10472
10472
|
/* @__PURE__ */ c(Zu, { className: "h-5 w-5" }),
|
|
10473
10473
|
"Interface Settings"
|
|
10474
10474
|
] }) }),
|
|
10475
|
-
/* @__PURE__ */ N(
|
|
10475
|
+
/* @__PURE__ */ N(kn, { className: "space-y-4", children: [
|
|
10476
10476
|
/* @__PURE__ */ N("div", { className: "space-y-2", children: [
|
|
10477
10477
|
/* @__PURE__ */ c(Ie, { htmlFor: "layout", children: "Layout Style" }),
|
|
10478
10478
|
/* @__PURE__ */ N(
|
|
@@ -10567,7 +10567,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10567
10567
|
/* @__PURE__ */ c(Qu, { className: "h-5 w-5" }),
|
|
10568
10568
|
"Behavior Settings"
|
|
10569
10569
|
] }) }),
|
|
10570
|
-
/* @__PURE__ */ N(
|
|
10570
|
+
/* @__PURE__ */ N(kn, { className: "space-y-4", children: [
|
|
10571
10571
|
/* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
|
|
10572
10572
|
/* @__PURE__ */ N("div", { children: [
|
|
10573
10573
|
/* @__PURE__ */ c(Ie, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
|
|
@@ -10638,7 +10638,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
|
|
|
10638
10638
|
] })
|
|
10639
10639
|
] });
|
|
10640
10640
|
}
|
|
10641
|
-
function
|
|
10641
|
+
function ky({
|
|
10642
10642
|
layout: e = "sidebar",
|
|
10643
10643
|
layoutSize: t = "desktop",
|
|
10644
10644
|
showThreads: n = !0,
|
|
@@ -10727,7 +10727,7 @@ export {
|
|
|
10727
10727
|
pt as apiClient,
|
|
10728
10728
|
Ey as applySettings,
|
|
10729
10729
|
pt as chatApiClient,
|
|
10730
|
-
|
|
10730
|
+
ky as default,
|
|
10731
10731
|
$f as del,
|
|
10732
10732
|
xt as get,
|
|
10733
10733
|
Ba as getChatToken,
|