teodor-new-chat-ui 2.0.7 → 2.0.8

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 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 Mt, createSlot as Pt, createSlottable as td } from "@radix-ui/react-slot";
5
+ import { Slot as kt, 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
- }, kd = Be("HTMLFormElement"), Md = (e) => e.toLowerCase().replace(
127
+ }, Md = Be("HTMLFormElement"), kd = (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: kd,
230
+ isHTMLForm: Md,
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: Md,
237
+ toCamelCase: kd,
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: k = "same-origin",
1243
- fetchOptions: M
1242
+ withCredentials: M = "same-origin",
1243
+ fetchOptions: k
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(k) || (k = k ? "include" : "omit");
1266
+ S.isString(M) || (M = M ? "include" : "omit");
1267
1267
  const L = s && "credentials" in n.prototype, G = {
1268
- ...M,
1268
+ ...k,
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 ? k : void 0
1274
+ credentials: L ? M : void 0
1275
1275
  };
1276
1276
  W = s && new n(h, G);
1277
- let T = await (s ? j(W, M) : j(h, G));
1277
+ let T = await (s ? j(W, k) : 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(), ka = (e) => {
1316
+ }, _f = /* @__PURE__ */ new Map(), Ma = (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
- ka();
1328
+ Ma();
1329
1329
  const Kr = {
1330
1330
  http: Kd,
1331
1331
  xhr: Cf,
1332
1332
  fetch: {
1333
- get: ka
1333
+ get: Ma
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, Ma = {
1345
+ const vs = (e) => `- ${e}`, If = (e) => S.isFunction(e) || e === null || e === !1, ka = {
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), Ma.getAdapter(e.adapter || cn.adapter, e)(e).then(function(r) {
1384
+ ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ka.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 kf = class La {
1571
+ let Mf = 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 kf = class La {
1641
1641
  };
1642
1642
  }
1643
1643
  };
1644
- function Mf(e) {
1644
+ function kf(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 = kf;
1729
+ he.CancelToken = Mf;
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 = Mf;
1738
+ he.spread = kf;
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 = Ma.getAdapter;
1743
+ he.getAdapter = ka.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 k, M, j, K;
1955
+ var M, k, 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__, _ = ((k = window.localStorage) == null ? void 0 : k.getItem("authToken")) || null;
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
- const $ = (M = window.localStorage) == null ? void 0 : M.getItem("chat-settings");
1984
+ const $ = (k = window.localStorage) == null ? void 0 : k.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, M(o).catch(() => {
2279
+ o && D.current !== o && (D.current = o, k(o).catch(() => {
2280
2280
  }));
2281
2281
  }, [o]);
2282
- const k = rt(null), M = Se(
2282
+ const M = rt(null), k = Se(
2283
2283
  async (_, O, X) => {
2284
2284
  var $;
2285
- if (k.current !== _) {
2286
- k.current = _;
2285
+ if (M.current !== _) {
2286
+ M.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
- k.current = null;
2291
+ M.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 M(C);
2303
- }, [C, M]), B = rt(!1);
2302
+ await k(C);
2303
+ }, [C, k]), 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 M(O.threadId), O.threadId;
2315
- }, [s, R, M]), L = Se(async (_) => {
2314
+ return await R(), await k(O.threadId), O.threadId;
2315
+ }, [s, R, k]), 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: M,
2421
+ loadThread: k,
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 ? Mt : "button",
2464
+ r ? kt : "button",
2465
2465
  {
2466
2466
  className: A(Yf({ variant: t, size: n, className: e })),
2467
2467
  ref: s,
@@ -2851,24 +2851,7 @@ 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 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
- sd,
2856
- {
2857
- remarkPlugins: [ad],
2858
- components: {
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
- ul: ({ children: n }) => /* @__PURE__ */ c("ul", { className: "list-disc pl-5 mb-3 space-y-1 marker:text-muted-foreground", children: n }),
2861
- ol: ({ children: n }) => /* @__PURE__ */ c("ol", { className: "list-decimal pl-5 mb-3 space-y-1 marker:text-muted-foreground", children: n }),
2862
- li: ({ children: n }) => /* @__PURE__ */ c("li", { className: "leading-snug", children: n }),
2863
- blockquote: ({ children: n }) => /* @__PURE__ */ c("blockquote", { className: "border-l-4 border-border pl-3 italic text-muted-foreground my-3", children: n }),
2864
- table: ({ children: n }) => /* @__PURE__ */ c("div", { className: "overflow-x-auto border rounded mb-4", children: /* @__PURE__ */ c("table", { className: "w-full border-collapse text-xs", children: n }) }),
2865
- th: ({ children: n }) => /* @__PURE__ */ c("th", { className: "border-b bg-muted/40 px-2 py-1 text-left font-medium text-[11px] uppercase tracking-wide", children: n }),
2866
- td: ({ children: n }) => /* @__PURE__ */ c("td", { className: "border-b px-2 py-1 align-top", children: n }),
2867
- code: ({ className: n, children: r, ...o }) => !/language-(\w+)/.exec(n || "") && !(n != null && n.includes("language-")) ? /* @__PURE__ */ c("code", { className: "text-[12px] font-medium", ...o, children: r }) : /* @__PURE__ */ c("pre", { className: "bg-background/50 p-2 rounded border overflow-x-auto text-xs leading-relaxed", children: /* @__PURE__ */ c("code", { className: n, ...o, children: r }) })
2868
- },
2869
- children: e
2870
- }
2871
- ) });
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(sd, { remarkPlugins: [ad], children: e }) });
2872
2855
  }
2873
2856
  function hp({
2874
2857
  message: e,
@@ -2896,12 +2879,12 @@ function hp({
2896
2879
  onRegenerate: I,
2897
2880
  onEditFromCheckpoint: R,
2898
2881
  onCancelEdit: D,
2899
- onCopy: k
2882
+ onCopy: M
2900
2883
  }) {
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 () => {
2884
+ const [k, 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
2885
  try {
2903
2886
  const Y = _ ? Ht(e.content) : O;
2904
- await navigator.clipboard.writeText(Y), j(!0), setTimeout(() => j(!1), 2e3), k == null || k(Y);
2887
+ await navigator.clipboard.writeText(Y), j(!0), setTimeout(() => j(!1), 2e3), M == null || M(Y);
2905
2888
  } catch (Y) {
2906
2889
  console.error("Failed to copy:", Y);
2907
2890
  }
@@ -3095,7 +3078,7 @@ function hp({
3095
3078
  size: "sm",
3096
3079
  onClick: se,
3097
3080
  className: A("h-6 w-6 p-0 hover:bg-background/50", T && "h-5 w-5"),
3098
- children: /* @__PURE__ */ c(ts, { className: A(M ? "text-success" : "", T ? "h-3 w-3" : "h-4 w-4") })
3081
+ children: /* @__PURE__ */ c(ts, { className: A(k ? "text-success" : "", T ? "h-3 w-3" : "h-4 w-4") })
3099
3082
  }
3100
3083
  ),
3101
3084
  P === "user" && C && /* @__PURE__ */ c(
@@ -3187,7 +3170,7 @@ function hp({
3187
3170
  size: "sm",
3188
3171
  onClick: se,
3189
3172
  className: A("h-6 w-6 p-0 hover:bg-background/50", T && "h-5 w-5"),
3190
- children: /* @__PURE__ */ c(ts, { className: A(M ? "text-success" : "", T ? "h-3 w-3" : "h-4 w-4") })
3173
+ children: /* @__PURE__ */ c(ts, { className: A(k ? "text-success" : "", T ? "h-3 w-3" : "h-4 w-4") })
3191
3174
  }
3192
3175
  ),
3193
3176
  P === "user" && C && /* @__PURE__ */ c(
@@ -3458,11 +3441,11 @@ var _p = "DismissableLayer", Xr = "dismissableLayer.update", Ip = "dismissableLa
3458
3441
  onDismiss: i,
3459
3442
  ...u
3460
3443
  } = 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, k = [...f.branches].some((M) => M.contains(D));
3462
- !E || k || (o == null || o(R), a == null || a(R), R.defaultPrevented || i == null || i());
3444
+ const D = R.target, M = [...f.branches].some((k) => k.contains(D));
3445
+ !E || M || (o == null || o(R), a == null || a(R), R.defaultPrevented || i == null || i());
3463
3446
  }, g), I = Lp((R) => {
3464
3447
  const D = R.target;
3465
- [...f.branches].some((M) => M.contains(D)) || (s == null || s(R), a == null || a(R), R.defaultPrevented || i == null || i());
3448
+ [...f.branches].some((k) => k.contains(D)) || (s == null || s(R), a == null || a(R), R.defaultPrevented || i == null || i());
3466
3449
  }, g);
3467
3450
  return Pp((R) => {
3468
3451
  y === f.layers.size - 1 && (r == null || r(R), !R.defaultPrevented && i && (R.preventDefault(), i()));
@@ -3496,7 +3479,7 @@ var _p = "DismissableLayer", Xr = "dismissableLayer.update", Ip = "dismissableLa
3496
3479
  }
3497
3480
  );
3498
3481
  ln.displayName = _p;
3499
- var kp = "DismissableLayerBranch", Mp = l.forwardRef((e, t) => {
3482
+ var Mp = "DismissableLayerBranch", kp = l.forwardRef((e, t) => {
3500
3483
  const n = l.useContext(qa), r = l.useRef(null), o = te(t, r);
3501
3484
  return l.useEffect(() => {
3502
3485
  const s = r.current;
@@ -3506,7 +3489,7 @@ var kp = "DismissableLayerBranch", Mp = l.forwardRef((e, t) => {
3506
3489
  };
3507
3490
  }, [n.branches]), /* @__PURE__ */ c(J.div, { ...e, ref: o });
3508
3491
  });
3509
- Mp.displayName = kp;
3492
+ kp.displayName = Mp;
3510
3493
  function Dp(e, t = globalThis == null ? void 0 : globalThis.document) {
3511
3494
  const n = we(e), r = l.useRef(!1), o = l.useRef(() => {
3512
3495
  });
@@ -3563,16 +3546,16 @@ var Pr = 0;
3563
3546
  function Co() {
3564
3547
  l.useEffect(() => {
3565
3548
  const e = document.querySelectorAll("[data-radix-focus-guard]");
3566
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? ks()), document.body.insertAdjacentElement("beforeend", e[1] ?? ks()), Pr++, () => {
3549
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Ms()), document.body.insertAdjacentElement("beforeend", e[1] ?? Ms()), Pr++, () => {
3567
3550
  Pr === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Pr--;
3568
3551
  };
3569
3552
  }, []);
3570
3553
  }
3571
- function ks() {
3554
+ function Ms() {
3572
3555
  const e = document.createElement("span");
3573
3556
  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
3557
  }
3575
- var _r = "focusScope.autoFocusOnMount", Ir = "focusScope.autoFocusOnUnmount", Ms = { bubbles: !1, cancelable: !0 }, Fp = "FocusScope", nr = l.forwardRef((e, t) => {
3558
+ var _r = "focusScope.autoFocusOnMount", Ir = "focusScope.autoFocusOnUnmount", ks = { bubbles: !1, cancelable: !0 }, Fp = "FocusScope", nr = l.forwardRef((e, t) => {
3576
3559
  const {
3577
3560
  loop: n = !1,
3578
3561
  trapped: r = !1,
@@ -3614,12 +3597,12 @@ var _r = "focusScope.autoFocusOnMount", Ir = "focusScope.autoFocusOnUnmount", Ms
3614
3597
  Ls.add(v);
3615
3598
  const h = document.activeElement;
3616
3599
  if (!i.contains(h)) {
3617
- const w = new CustomEvent(_r, Ms);
3600
+ const w = new CustomEvent(_r, ks);
3618
3601
  i.addEventListener(_r, f), i.dispatchEvent(w), w.defaultPrevented || ($p(Wp(Ya(i)), { select: !0 }), document.activeElement === h && et(i));
3619
3602
  }
3620
3603
  return () => {
3621
3604
  i.removeEventListener(_r, f), setTimeout(() => {
3622
- const w = new CustomEvent(Ir, Ms);
3605
+ const w = new CustomEvent(Ir, ks);
3623
3606
  i.addEventListener(Ir, d), i.dispatchEvent(w), w.defaultPrevented || et(h ?? document.body, { select: !0 }), i.removeEventListener(Ir, d), Ls.remove(v);
3624
3607
  }, 0);
3625
3608
  };
@@ -3985,7 +3968,7 @@ const nh = (e) => ({
3985
3968
  }, 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
3969
  let R = I ? I[x] : 0;
3987
3970
  (!R || !await (a.isElement == null ? void 0 : a.isElement(I))) && (R = i.floating[x] || s.floating[m]);
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;
3971
+ const D = E / 2 - C / 2, M = R / 2 - h[m] / 2 - 1, k = st(p[w], M), j = st(p[y], M), K = k, 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 ? k : j) - h[m] / 2 < 0, G = L ? B < K ? B - K : B - W : 0;
3989
3972
  return {
3990
3973
  [v]: g[v] + G,
3991
3974
  data: {
@@ -4024,36 +4007,36 @@ const nh = (e) => ({
4024
4007
  return {};
4025
4008
  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
4009
  !g && I && C.push(...Qp(i, h, m, E));
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) {
4010
+ const R = [i, ...C], D = await Jt(t, b), M = [];
4011
+ let k = ((r = s.flip) == null ? void 0 : r.overflows) || [];
4012
+ if (d && M.push(D[w]), p) {
4030
4013
  const B = qp(o, a, E);
4031
- k.push(D[B[0]], D[B[1]]);
4014
+ M.push(D[B[0]], D[B[1]]);
4032
4015
  }
4033
- if (M = [...M, {
4016
+ if (k = [...k, {
4034
4017
  placement: o,
4035
- overflows: k
4036
- }], !k.every((B) => B <= 0)) {
4018
+ overflows: M
4019
+ }], !M.every((B) => B <= 0)) {
4037
4020
  var j, K;
4038
4021
  const B = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, q = R[B];
4039
4022
  if (q && (!(p === "alignment" ? y !== je(q) : !1) || // We leave the current main axis only if every placement on that axis
4040
4023
  // overflows the main axis.
4041
- M.every((T) => je(T.placement) === y ? T.overflows[0] > 0 : !0)))
4024
+ k.every((T) => je(T.placement) === y ? T.overflows[0] > 0 : !0)))
4042
4025
  return {
4043
4026
  data: {
4044
4027
  index: B,
4045
- overflows: M
4028
+ overflows: k
4046
4029
  },
4047
4030
  reset: {
4048
4031
  placement: q
4049
4032
  }
4050
4033
  };
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;
4034
+ let L = (K = k.filter((G) => G.overflows[0] <= 0).sort((G, T) => G.overflows[1] - T.overflows[1])[0]) == null ? void 0 : K.placement;
4052
4035
  if (!L)
4053
4036
  switch (v) {
4054
4037
  case "bestFit": {
4055
4038
  var W;
4056
- const G = (W = M.filter((T) => {
4039
+ const G = (W = k.filter((T) => {
4057
4040
  if (I) {
4058
4041
  const P = je(T.placement);
4059
4042
  return P === y || // Create a bias to the `y` side axis due to horizontal
@@ -4304,16 +4287,16 @@ const ah = function(e) {
4304
4287
  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
4288
  let R = E, D = C;
4306
4289
  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 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));
4290
+ const k = Pe(d.left, 0), j = Pe(d.right, 0), K = Pe(d.top, 0), W = Pe(d.bottom, 0);
4291
+ v ? D = m - 2 * (k !== 0 || j !== 0 ? k + j : Pe(d.left, d.right)) : R = h - 2 * (K !== 0 || W !== 0 ? K + W : Pe(d.top, d.bottom));
4309
4292
  }
4310
4293
  await u({
4311
4294
  ...t,
4312
4295
  availableWidth: D,
4313
4296
  availableHeight: R
4314
4297
  });
4315
- const k = await a.getDimensions(i.floating);
4316
- return m !== k.width || h !== k.height ? {
4298
+ const M = await a.getDimensions(i.floating);
4299
+ return m !== M.width || h !== M.height ? {
4317
4300
  reset: {
4318
4301
  rects: !0
4319
4302
  }
@@ -4711,7 +4694,7 @@ const Ih = async function(e) {
4711
4694
  function Oh(e) {
4712
4695
  return $e(e).direction === "rtl";
4713
4696
  }
4714
- const kh = {
4697
+ const Mh = {
4715
4698
  convertOffsetParentRelativeRectToViewportRelativeRect: xh,
4716
4699
  getDocumentElement: Xe,
4717
4700
  getClippingRect: Ah,
@@ -4726,7 +4709,7 @@ const kh = {
4726
4709
  function ai(e, t) {
4727
4710
  return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
4728
4711
  }
4729
- function Mh(e, t) {
4712
+ function kh(e, t) {
4730
4713
  let n = null, r;
4731
4714
  const o = Xe(e);
4732
4715
  function s() {
@@ -4786,7 +4769,7 @@ function Dh(e, t, n, r) {
4786
4769
  passive: !0
4787
4770
  }), s && w.addEventListener("resize", n);
4788
4771
  });
4789
- const p = f && i ? Mh(f, n) : null;
4772
+ const p = f && i ? kh(f, n) : null;
4790
4773
  let g = -1, v = null;
4791
4774
  a && (v = new ResizeObserver((w) => {
4792
4775
  let [y] = w;
@@ -4810,7 +4793,7 @@ function Dh(e, t, n, r) {
4810
4793
  }
4811
4794
  const Lh = ah, Fh = ih, $h = rh, Bh = lh, Uh = oh, Gs = nh, zh = ch, Hh = (e, t, n) => {
4812
4795
  const r = /* @__PURE__ */ new Map(), o = {
4813
- platform: kh,
4796
+ platform: Mh,
4814
4797
  ...n
4815
4798
  }, s = {
4816
4799
  ...o.platform,
@@ -4860,7 +4843,7 @@ function qs(e, t) {
4860
4843
  const n = ii(e);
4861
4844
  return Math.round(t * n) / n;
4862
4845
  }
4863
- function kr(e) {
4846
+ function Mr(e) {
4864
4847
  const t = l.useRef(e);
4865
4848
  return Nn(() => {
4866
4849
  t.current = e;
@@ -4893,7 +4876,7 @@ function jh(e) {
4893
4876
  T !== I.current && (I.current = T, h(T));
4894
4877
  }, []), x = l.useCallback((T) => {
4895
4878
  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), k = u != null, M = kr(u), j = kr(o), K = kr(f), W = l.useCallback(() => {
4879
+ }, []), E = s || m, C = a || b, I = l.useRef(null), R = l.useRef(null), D = l.useRef(d), M = u != null, k = Mr(u), j = Mr(o), K = Mr(f), W = l.useCallback(() => {
4897
4880
  if (!I.current || !R.current)
4898
4881
  return;
4899
4882
  const T = {
@@ -4926,11 +4909,11 @@ function jh(e) {
4926
4909
  B.current = !1;
4927
4910
  }), []), Nn(() => {
4928
4911
  if (E && (I.current = E), C && (R.current = C), E && C) {
4929
- if (M.current)
4930
- return M.current(E, C, W);
4912
+ if (k.current)
4913
+ return k.current(E, C, W);
4931
4914
  W();
4932
4915
  }
4933
- }, [E, C, W, M, k]);
4916
+ }, [E, C, W, k, M]);
4934
4917
  const q = l.useMemo(() => ({
4935
4918
  reference: I,
4936
4919
  floating: R,
@@ -5083,15 +5066,15 @@ var Io = "PopperContent", [rm, om] = ui(Io), mi = l.forwardRef(
5083
5066
  updatePositionStrategy: v = "optimized",
5084
5067
  onPlaced: m,
5085
5068
  ...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, 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,
5069
+ } = 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, M = r + (s !== "center" ? "-" + s : ""), k = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, j = Array.isArray(f) ? f : [f], K = j.length > 0, W = {
5070
+ padding: k,
5088
5071
  boundary: j.filter(am),
5089
5072
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5090
5073
  altBoundary: K
5091
5074
  }, { refs: B, floatingStyles: q, placement: L, isPositioned: G, middlewareData: T } = jh({
5092
5075
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
5093
5076
  strategy: "fixed",
5094
- placement: k,
5077
+ placement: M,
5095
5078
  whileElementsMounted: (...de) => Dh(...de, {
5096
5079
  animationFrame: v === "always"
5097
5080
  }),
@@ -5248,7 +5231,7 @@ function vi(e) {
5248
5231
  const [t, n = "center"] = e.split("-");
5249
5232
  return [t, n];
5250
5233
  }
5251
- var Oo = fi, ko = hi, Mo = mi, Do = bi, cm = "Portal", ir = l.forwardRef((e, t) => {
5234
+ var Oo = fi, Mo = hi, ko = mi, Do = bi, cm = "Portal", ir = l.forwardRef((e, t) => {
5252
5235
  var i;
5253
5236
  const { container: n, ...r } = e, [o, s] = l.useState(!1);
5254
5237
  be(() => s(!0), []);
@@ -5256,7 +5239,7 @@ var Oo = fi, ko = hi, Mo = mi, Do = bi, cm = "Portal", ir = l.forwardRef((e, t)
5256
5239
  return a ? od.createPortal(/* @__PURE__ */ c(J.div, { ...r, ref: t }), a) : null;
5257
5240
  });
5258
5241
  ir.displayName = cm;
5259
- var Mr = "rovingFocusGroup.onEntryFocus", lm = { bubbles: !1, cancelable: !0 }, dn = "RovingFocusGroup", [Qr, wi, um] = So(dn), [dm, yi] = Ue(
5242
+ var kr = "rovingFocusGroup.onEntryFocus", lm = { bubbles: !1, cancelable: !0 }, dn = "RovingFocusGroup", [Qr, wi, um] = So(dn), [dm, yi] = Ue(
5260
5243
  dn,
5261
5244
  [um]
5262
5245
  ), [fm, pm] = dm(dn), xi = l.forwardRef(
@@ -5284,7 +5267,7 @@ var hm = l.forwardRef((e, t) => {
5284
5267
  return l.useEffect(() => {
5285
5268
  const D = g.current;
5286
5269
  if (D)
5287
- return D.addEventListener(Mr, x), () => D.removeEventListener(Mr, x);
5270
+ return D.addEventListener(kr, x), () => D.removeEventListener(kr, x);
5288
5271
  }, [x]), /* @__PURE__ */ c(
5289
5272
  fm,
5290
5273
  {
@@ -5318,10 +5301,10 @@ var hm = l.forwardRef((e, t) => {
5318
5301
  C.current = !0;
5319
5302
  }),
5320
5303
  onFocus: U(e.onFocus, (D) => {
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) {
5304
+ const M = !C.current;
5305
+ if (D.target === D.currentTarget && M && !w) {
5306
+ const k = new CustomEvent(kr, lm);
5307
+ if (D.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
5325
5308
  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
5309
  Boolean
5327
5310
  ).map((L) => L.ref.current);
@@ -5608,7 +5591,7 @@ var Ti = function(e) {
5608
5591
  return l.createElement(r, Ve({}, n));
5609
5592
  };
5610
5593
  Ti.isSideCarExport = !0;
5611
- function km(e, t) {
5594
+ function Mm(e, t) {
5612
5595
  return e.useMedium(t), Ti;
5613
5596
  }
5614
5597
  var Ai = Om(), Fr = function() {
@@ -5634,7 +5617,7 @@ cr.classNames = {
5634
5617
  fullWidth: An,
5635
5618
  zeroRight: Tn
5636
5619
  };
5637
- var Mm = function() {
5620
+ var km = function() {
5638
5621
  if (typeof __webpack_nonce__ < "u")
5639
5622
  return __webpack_nonce__;
5640
5623
  };
@@ -5643,7 +5626,7 @@ function Dm() {
5643
5626
  return null;
5644
5627
  var e = document.createElement("style");
5645
5628
  e.type = "text/css";
5646
- var t = Mm();
5629
+ var t = km();
5647
5630
  return t && e.setAttribute("nonce", t), e;
5648
5631
  }
5649
5632
  function Lm(e, t) {
@@ -5878,8 +5861,8 @@ function rg(e) {
5878
5861
  return !1;
5879
5862
  if (!r.current && "changedTouches" in h && (x || E) && (r.current = C), !C)
5880
5863
  return !0;
5881
- var k = r.current || C;
5882
- return Qm(k, b, h, k === "h" ? x : E);
5864
+ var M = r.current || C;
5865
+ return Qm(M, b, h, M === "h" ? x : E);
5883
5866
  }, []), u = l.useCallback(function(h) {
5884
5867
  var b = h;
5885
5868
  if (!(!Et.length || Et[Et.length - 1] !== s)) {
@@ -5935,18 +5918,18 @@ function og(e) {
5935
5918
  e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
5936
5919
  return t;
5937
5920
  }
5938
- const sg = km(Ai, rg);
5921
+ const sg = Mm(Ai, rg);
5939
5922
  var lr = l.forwardRef(function(e, t) {
5940
5923
  return l.createElement(cr, Ve({}, e, { ref: t, sideCar: sg }));
5941
5924
  });
5942
5925
  lr.classNames = cr.classNames;
5943
- var to = ["Enter", " "], ag = ["ArrowDown", "PageUp", "Home"], ki = ["ArrowUp", "PageDown", "End"], ig = [...ag, ...ki], cg = {
5926
+ var to = ["Enter", " "], ag = ["ArrowDown", "PageUp", "Home"], Mi = ["ArrowUp", "PageDown", "End"], ig = [...ag, ...Mi], cg = {
5944
5927
  ltr: [...to, "ArrowRight"],
5945
5928
  rtl: [...to, "ArrowLeft"]
5946
5929
  }, lg = {
5947
5930
  ltr: ["ArrowLeft"],
5948
5931
  rtl: ["ArrowRight"]
5949
- }, fn = "Menu", [Qt, ug, dg] = So(fn), [vt, Mi] = Ue(fn, [
5932
+ }, fn = "Menu", [Qt, ug, dg] = So(fn), [vt, ki] = Ue(fn, [
5950
5933
  dg,
5951
5934
  Bt,
5952
5935
  yi
@@ -5985,7 +5968,7 @@ Li.displayName = fn;
5985
5968
  var hg = "MenuAnchor", Fo = l.forwardRef(
5986
5969
  (e, t) => {
5987
5970
  const { __scopeMenu: n, ...r } = e, o = ur(n);
5988
- return /* @__PURE__ */ c(ko, { ...o, ...r, ref: t });
5971
+ return /* @__PURE__ */ c(Mo, { ...o, ...r, ref: t });
5989
5972
  }
5990
5973
  );
5991
5974
  Fo.displayName = hg;
@@ -6054,23 +6037,23 @@ var Oe = "MenuContent", [gg, Bo] = vt(Oe), Bi = l.forwardRef(
6054
6037
  onDismiss: v,
6055
6038
  disableOutsideScroll: m,
6056
6039
  ...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), 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) => {
6040
+ } = 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), M = l.useRef(0), k = 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
6041
  var V, re;
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;
6042
+ const _ = k.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
6043
  (function ie(oe) {
6061
- M.current = oe, window.clearTimeout(k.current), oe !== "" && (k.current = window.setTimeout(() => ie(""), 1e3));
6044
+ k.current = oe, window.clearTimeout(M.current), oe !== "" && (M.current = window.setTimeout(() => ie(""), 1e3));
6062
6045
  })(_), se && setTimeout(() => se.focus());
6063
6046
  };
6064
- l.useEffect(() => () => window.clearTimeout(k.current), []), Co();
6047
+ l.useEffect(() => () => window.clearTimeout(M.current), []), Co();
6065
6048
  const T = l.useCallback((P) => {
6066
6049
  var O, X;
6067
- return W.current === ((O = K.current) == null ? void 0 : O.side) && kg(P, (X = K.current) == null ? void 0 : X.area);
6050
+ return W.current === ((O = K.current) == null ? void 0 : O.side) && Mg(P, (X = K.current) == null ? void 0 : X.area);
6068
6051
  }, []);
6069
6052
  return /* @__PURE__ */ c(
6070
6053
  gg,
6071
6054
  {
6072
6055
  scope: n,
6073
- searchRef: M,
6056
+ searchRef: k,
6074
6057
  onItemEnter: l.useCallback(
6075
6058
  (P) => {
6076
6059
  T(P) && P.preventDefault();
@@ -6129,7 +6112,7 @@ var Oe = "MenuContent", [gg, Bo] = vt(Oe), Bi = l.forwardRef(
6129
6112
  }),
6130
6113
  preventScrollOnEntryFocus: !0,
6131
6114
  children: /* @__PURE__ */ c(
6132
- Mo,
6115
+ ko,
6133
6116
  {
6134
6117
  role: "menu",
6135
6118
  "aria-orientation": "vertical",
@@ -6147,10 +6130,10 @@ var Oe = "MenuContent", [gg, Bo] = vt(Oe), Bi = l.forwardRef(
6147
6130
  if (P.target !== z || !ig.includes(P.key)) return;
6148
6131
  P.preventDefault();
6149
6132
  const se = E().filter((V) => !V.disabled).map((V) => V.ref.current);
6150
- ki.includes(P.key) && se.reverse(), Pg(se);
6133
+ Mi.includes(P.key) && se.reverse(), Pg(se);
6151
6134
  }),
6152
6135
  onBlur: U(e.onBlur, (P) => {
6153
- P.currentTarget.contains(P.target) || (window.clearTimeout(k.current), M.current = "");
6136
+ P.currentTarget.contains(P.target) || (window.clearTimeout(M.current), k.current = "");
6154
6137
  }),
6155
6138
  onPointerMove: U(
6156
6139
  e.onPointerMove,
@@ -6503,7 +6486,7 @@ function Og(e, t) {
6503
6486
  }
6504
6487
  return o;
6505
6488
  }
6506
- function kg(e, t) {
6489
+ function Mg(e, t) {
6507
6490
  if (!t) return !1;
6508
6491
  const n = { x: e.clientX, y: e.clientY };
6509
6492
  return Og(n, t);
@@ -6511,10 +6494,10 @@ function kg(e, t) {
6511
6494
  function en(e) {
6512
6495
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
6513
6496
  }
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(
6497
+ var kg = 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
6498
  fr,
6516
- [Mi]
6517
- ), Ce = Mi(), [Yg, nc] = Xg(fr), rc = (e) => {
6499
+ [ki]
6500
+ ), Ce = ki(), [Yg, nc] = Xg(fr), rc = (e) => {
6518
6501
  const {
6519
6502
  __scopeDropdownMenu: t,
6520
6503
  children: n,
@@ -6540,7 +6523,7 @@ var Mg = Li, Dg = Fo, Lg = $i, Fg = Bi, $g = zo, Bg = Ui, Ug = dr, zg = Hi, Hg =
6540
6523
  onOpenChange: p,
6541
6524
  onOpenToggle: l.useCallback(() => p((g) => !g), [p]),
6542
6525
  modal: i,
6543
- children: /* @__PURE__ */ c(Mg, { ...u, open: d, onOpenChange: p, dir: r, modal: i, children: n })
6526
+ children: /* @__PURE__ */ c(kg, { ...u, open: d, onOpenChange: p, dir: r, modal: i, children: n })
6544
6527
  }
6545
6528
  );
6546
6529
  };
@@ -6822,7 +6805,7 @@ function Pn({
6822
6805
  listCheckpoints: y,
6823
6806
  navigateToCheckpoint: x,
6824
6807
  returnToLatest: E
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");
6808
+ } = za(), [C, I] = ce(""), [R, D] = ce(null), [M, k] = 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
6809
  ve(() => {
6827
6810
  const F = () => {
6828
6811
  const Q = window.innerWidth;
@@ -6887,7 +6870,7 @@ function Pn({
6887
6870
  last_message_preview: xe.preview ?? void 0,
6888
6871
  ts: new Date(xe.createdAt).getTime(),
6889
6872
  isCurrent: xe.checkpointId === G
6890
- })).sort((xe, Mu) => (xe.ts || 0) - (Mu.ts || 0));
6873
+ })).sort((xe, ku) => (xe.ts || 0) - (ku.ts || 0));
6891
6874
  }, V = (F) => {
6892
6875
  if (F === void 0)
6893
6876
  return { canGoBack: !1, canGoForward: !1, currentIndex: 0, totalBranches: 0 };
@@ -6901,24 +6884,24 @@ function Pn({
6901
6884
  if (!F && j.length === 0) return;
6902
6885
  const Q = z(F);
6903
6886
  if (Q) {
6904
- M(Q);
6887
+ k(Q);
6905
6888
  return;
6906
6889
  }
6907
6890
  try {
6908
6891
  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(""), M(null), K([]), delete window.__editingCheckpointId, D(null), _.current && (_.current.style.height = "auto");
6892
+ await h(F, { checkpointId: ne, payloadExtras: R ? { edit: !0, originalMessageId: R } : void 0, attachments: j }), u == null || u(F), I(""), k(null), K([]), delete window.__editingCheckpointId, D(null), _.current && (_.current.style.height = "auto");
6910
6893
  } catch (ne) {
6911
6894
  const ue = (ne == null ? void 0 : ne.message) || "Failed to send message";
6912
- M(ue), f == null || f(ue);
6895
+ k(ue), f == null || f(ue);
6913
6896
  }
6914
6897
  }, ie = (F, Q) => {
6915
- a && (D(F), I(Q), M(null), setTimeout(() => {
6898
+ a && (D(F), I(Q), k(null), setTimeout(() => {
6916
6899
  _.current && (_.current.focus(), _.current.style.height = "auto", _.current.style.height = _.current.scrollHeight + "px");
6917
6900
  }, 0));
6918
6901
  }, oe = async (F, Q) => {
6919
6902
  const ne = p.find((Re) => Re.id === F);
6920
6903
  if (!ne) {
6921
- M("Message not found");
6904
+ k("Message not found");
6922
6905
  return;
6923
6906
  }
6924
6907
  const ue = le(ne);
@@ -6927,7 +6910,7 @@ function Pn({
6927
6910
  return (Re = _.current) == null ? void 0 : Re.focus();
6928
6911
  }, 0);
6929
6912
  }, H = () => {
6930
- D(null), I(""), M(null), delete window.__editingCheckpointId, _.current && (_.current.style.height = "auto");
6913
+ D(null), I(""), k(null), delete window.__editingCheckpointId, _.current && (_.current.style.height = "auto");
6931
6914
  }, Z = (F) => {
6932
6915
  F.key === "Enter" && !F.shiftKey ? (F.preventDefault(), re()) : F.key === "Escape" && R && (F.preventDefault(), H());
6933
6916
  }, de = (F) => {
@@ -7059,7 +7042,7 @@ function Pn({
7059
7042
  )
7060
7043
  ] }, Q)) })
7061
7044
  ] }),
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 }),
7045
+ 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 }),
7063
7046
  /* @__PURE__ */ N("div", { className: "flex items-end gap-2", children: [
7064
7047
  s && /* @__PURE__ */ N(mb, { children: [
7065
7048
  /* @__PURE__ */ c(gb, { asChild: !0, children: /* @__PURE__ */ c(
@@ -7088,11 +7071,11 @@ function Pn({
7088
7071
  ref: _,
7089
7072
  value: C,
7090
7073
  onChange: (F) => {
7091
- I(F.target.value), M(null), _.current && (_.current.style.height = "auto", _.current.style.height = `${_.current.scrollHeight}px`);
7074
+ I(F.target.value), k(null), _.current && (_.current.style.height = "auto", _.current.style.height = `${_.current.scrollHeight}px`);
7092
7075
  },
7093
7076
  onKeyDown: Z,
7094
7077
  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" : ""} ${k ? "border-red-400" : ""} ${i.textarea || ""}`,
7078
+ className: `resize-none min-h-[44px] max-h-[20rem] w-full ${R ? "border-blue-400 bg-blue-50" : ""} ${M ? "border-red-400" : ""} ${i.textarea || ""}`,
7096
7079
  disabled: !1,
7097
7080
  maxLength: Rt,
7098
7081
  rows: 1
@@ -7151,7 +7134,7 @@ function no(e, [t, n]) {
7151
7134
  function Cb(e, t) {
7152
7135
  return l.useReducer((n, r) => t[n][r] ?? n, e);
7153
7136
  }
7154
- var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, ke] = Ac(Vo), Pc = l.forwardRef(
7137
+ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, Me] = Ac(Vo), Pc = l.forwardRef(
7155
7138
  (e, t) => {
7156
7139
  const {
7157
7140
  __scopeScrollArea: n,
@@ -7159,13 +7142,13 @@ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, ke] = Ac(Vo), Pc = l.forwardRef(
7159
7142
  dir: o,
7160
7143
  scrollHideDelay: s = 600,
7161
7144
  ...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), k = te(t, (j) => u(j)), M = tr(o);
7145
+ } = 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), M = te(t, (j) => u(j)), k = tr(o);
7163
7146
  return /* @__PURE__ */ c(
7164
7147
  Eb,
7165
7148
  {
7166
7149
  scope: n,
7167
7150
  type: r,
7168
- dir: M,
7151
+ dir: k,
7169
7152
  scrollHideDelay: s,
7170
7153
  scrollArea: i,
7171
7154
  viewport: f,
@@ -7185,9 +7168,9 @@ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, ke] = Ac(Vo), Pc = l.forwardRef(
7185
7168
  children: /* @__PURE__ */ c(
7186
7169
  J.div,
7187
7170
  {
7188
- dir: M,
7171
+ dir: k,
7189
7172
  ...a,
7190
- ref: k,
7173
+ ref: M,
7191
7174
  style: {
7192
7175
  position: "relative",
7193
7176
  // Pass corner sizes as CSS vars to reduce re-renders of context consumers
@@ -7204,7 +7187,7 @@ var Vo = "ScrollArea", [Ac, yy] = Ue(Vo), [Eb, ke] = Ac(Vo), Pc = l.forwardRef(
7204
7187
  Pc.displayName = Vo;
7205
7188
  var _c = "ScrollAreaViewport", Ic = l.forwardRef(
7206
7189
  (e, t) => {
7207
- const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a = ke(_c, n), i = l.useRef(null), u = te(t, i, a.onViewportChange);
7190
+ const { __scopeScrollArea: n, children: r, nonce: o, ...s } = e, a = Me(_c, n), i = l.useRef(null), u = te(t, i, a.onViewportChange);
7208
7191
  return /* @__PURE__ */ N(De, { children: [
7209
7192
  /* @__PURE__ */ c(
7210
7193
  "style",
@@ -7246,7 +7229,7 @@ var _c = "ScrollAreaViewport", Ic = l.forwardRef(
7246
7229
  Ic.displayName = _c;
7247
7230
  var Ye = "ScrollAreaScrollbar", jo = l.forwardRef(
7248
7231
  (e, t) => {
7249
- const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
7232
+ const { forceMount: n, ...r } = e, o = Me(Ye, e.__scopeScrollArea), { onScrollbarXEnabledChange: s, onScrollbarYEnabledChange: a } = o, i = e.orientation === "horizontal";
7250
7233
  return l.useEffect(() => (i ? s(!0) : a(!0), () => {
7251
7234
  i ? s(!1) : a(!1);
7252
7235
  }), [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 +7237,7 @@ var Ye = "ScrollAreaScrollbar", jo = l.forwardRef(
7254
7237
  );
7255
7238
  jo.displayName = Ye;
7256
7239
  var Rb = l.forwardRef((e, t) => {
7257
- const { forceMount: n, ...r } = e, o = ke(Ye, e.__scopeScrollArea), [s, a] = l.useState(!1);
7240
+ const { forceMount: n, ...r } = e, o = Me(Ye, e.__scopeScrollArea), [s, a] = l.useState(!1);
7258
7241
  return l.useEffect(() => {
7259
7242
  const i = o.scrollArea;
7260
7243
  let u = 0;
@@ -7277,7 +7260,7 @@ var Rb = l.forwardRef((e, t) => {
7277
7260
  }
7278
7261
  ) });
7279
7262
  }), Nb = l.forwardRef((e, t) => {
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", {
7263
+ const { forceMount: n, ...r } = e, o = Me(Ye, e.__scopeScrollArea), s = e.orientation === "horizontal", a = hr(() => u("SCROLL_END"), 100), [i, u] = Cb("hidden", {
7281
7264
  hidden: {
7282
7265
  SCROLL: "scrolling"
7283
7266
  },
@@ -7321,7 +7304,7 @@ var Rb = l.forwardRef((e, t) => {
7321
7304
  }
7322
7305
  ) });
7323
7306
  }), Oc = l.forwardRef((e, t) => {
7324
- const n = ke(Ye, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, a] = l.useState(!1), i = e.orientation === "horizontal", u = hr(() => {
7307
+ const n = Me(Ye, e.__scopeScrollArea), { forceMount: r, ...o } = e, [s, a] = l.useState(!1), i = e.orientation === "horizontal", u = hr(() => {
7325
7308
  if (n.viewport) {
7326
7309
  const f = n.viewport.offsetWidth < n.viewport.scrollWidth, d = n.viewport.offsetHeight < n.viewport.scrollHeight;
7327
7310
  a(i ? f : d);
@@ -7336,7 +7319,7 @@ var Rb = l.forwardRef((e, t) => {
7336
7319
  }
7337
7320
  ) });
7338
7321
  }), Ko = l.forwardRef((e, t) => {
7339
- const { orientation: n = "vertical", ...r } = e, o = ke(Ye, e.__scopeScrollArea), s = l.useRef(null), a = l.useRef(0), [i, u] = l.useState({
7322
+ const { orientation: n = "vertical", ...r } = e, o = Me(Ye, e.__scopeScrollArea), s = l.useRef(null), a = l.useRef(0), [i, u] = l.useState({
7340
7323
  content: 0,
7341
7324
  viewport: 0,
7342
7325
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
@@ -7390,11 +7373,11 @@ var Rb = l.forwardRef((e, t) => {
7390
7373
  }
7391
7374
  ) : null;
7392
7375
  }), Tb = l.forwardRef((e, t) => {
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);
7376
+ const { sizes: n, onSizesChange: r, ...o } = e, s = Me(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarXChange);
7394
7377
  return l.useEffect(() => {
7395
7378
  u.current && i(getComputedStyle(u.current));
7396
7379
  }, [u]), /* @__PURE__ */ c(
7397
- Mc,
7380
+ kc,
7398
7381
  {
7399
7382
  "data-orientation": "horizontal",
7400
7383
  ...o,
@@ -7429,11 +7412,11 @@ var Rb = l.forwardRef((e, t) => {
7429
7412
  }
7430
7413
  );
7431
7414
  }), Ab = l.forwardRef((e, t) => {
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);
7415
+ const { sizes: n, onSizesChange: r, ...o } = e, s = Me(Ye, e.__scopeScrollArea), [a, i] = l.useState(), u = l.useRef(null), f = te(t, u, s.onScrollbarYChange);
7433
7416
  return l.useEffect(() => {
7434
7417
  u.current && i(getComputedStyle(u.current));
7435
7418
  }, [u]), /* @__PURE__ */ c(
7436
- Mc,
7419
+ kc,
7437
7420
  {
7438
7421
  "data-orientation": "vertical",
7439
7422
  ...o,
@@ -7468,7 +7451,7 @@ var Rb = l.forwardRef((e, t) => {
7468
7451
  }
7469
7452
  }
7470
7453
  );
7471
- }), [Pb, kc] = Ac(Ye), Mc = l.forwardRef((e, t) => {
7454
+ }), [Pb, Mc] = Ac(Ye), kc = l.forwardRef((e, t) => {
7472
7455
  const {
7473
7456
  __scopeScrollArea: n,
7474
7457
  sizes: r,
@@ -7481,19 +7464,19 @@ var Rb = l.forwardRef((e, t) => {
7481
7464
  onWheelScroll: d,
7482
7465
  onResize: p,
7483
7466
  ...g
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) {
7467
+ } = e, v = Me(Ye, n), [m, h] = l.useState(null), b = te(t, (M) => h(M)), 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);
7468
+ function D(M) {
7486
7469
  if (w.current) {
7487
- const M = k.clientX - w.current.left, j = k.clientY - w.current.top;
7488
- f({ x: M, y: j });
7470
+ const k = M.clientX - w.current.left, j = M.clientY - w.current.top;
7471
+ f({ x: k, y: j });
7489
7472
  }
7490
7473
  }
7491
7474
  return l.useEffect(() => {
7492
- const k = (M) => {
7493
- const j = M.target;
7494
- (m == null ? void 0 : m.contains(j)) && C(M, E);
7475
+ const M = (k) => {
7476
+ const j = k.target;
7477
+ (m == null ? void 0 : m.contains(j)) && C(k, E);
7495
7478
  };
7496
- return document.addEventListener("wheel", k, { passive: !1 }), () => document.removeEventListener("wheel", k, { passive: !1 });
7479
+ return document.addEventListener("wheel", M, { passive: !1 }), () => document.removeEventListener("wheel", M, { passive: !1 });
7497
7480
  }, [x, m, E, C]), l.useEffect(I, [r, I]), Ot(m, R), Ot(v.content, R), /* @__PURE__ */ c(
7498
7481
  Pb,
7499
7482
  {
@@ -7510,13 +7493,13 @@ var Rb = l.forwardRef((e, t) => {
7510
7493
  ...g,
7511
7494
  ref: b,
7512
7495
  style: { position: "absolute", ...g.style },
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));
7496
+ onPointerDown: U(e.onPointerDown, (M) => {
7497
+ 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"), D(M));
7515
7498
  }),
7516
7499
  onPointerMove: U(e.onPointerMove, D),
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;
7500
+ onPointerUp: U(e.onPointerUp, (M) => {
7501
+ const k = M.target;
7502
+ k.hasPointerCapture(M.pointerId) && k.releasePointerCapture(M.pointerId), document.body.style.webkitUserSelect = y.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
7520
7503
  })
7521
7504
  }
7522
7505
  )
@@ -7524,12 +7507,12 @@ var Rb = l.forwardRef((e, t) => {
7524
7507
  );
7525
7508
  }), Vn = "ScrollAreaThumb", Dc = l.forwardRef(
7526
7509
  (e, t) => {
7527
- const { forceMount: n, ...r } = e, o = kc(Vn, e.__scopeScrollArea);
7510
+ const { forceMount: n, ...r } = e, o = Mc(Vn, e.__scopeScrollArea);
7528
7511
  return /* @__PURE__ */ c(Ae, { present: n || o.hasThumb, children: /* @__PURE__ */ c(_b, { ref: t, ...r }) });
7529
7512
  }
7530
7513
  ), _b = l.forwardRef(
7531
7514
  (e, t) => {
7532
- const { __scopeScrollArea: n, style: r, ...o } = e, s = ke(Vn, n), a = kc(Vn, n), { onThumbPositionChange: i } = a, u = te(
7515
+ const { __scopeScrollArea: n, style: r, ...o } = e, s = Me(Vn, n), a = Mc(Vn, n), { onThumbPositionChange: i } = a, u = te(
7533
7516
  t,
7534
7517
  (p) => a.onThumbChange(p)
7535
7518
  ), f = l.useRef(void 0), d = hr(() => {
@@ -7540,7 +7523,7 @@ var Rb = l.forwardRef((e, t) => {
7540
7523
  if (p) {
7541
7524
  const g = () => {
7542
7525
  if (d(), !f.current) {
7543
- const v = kb(p, i);
7526
+ const v = Mb(p, i);
7544
7527
  f.current = v, i();
7545
7528
  }
7546
7529
  };
@@ -7569,13 +7552,13 @@ var Rb = l.forwardRef((e, t) => {
7569
7552
  Dc.displayName = Vn;
7570
7553
  var Go = "ScrollAreaCorner", Lc = l.forwardRef(
7571
7554
  (e, t) => {
7572
- const n = ke(Go, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
7555
+ const n = Me(Go, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
7573
7556
  return n.type !== "scroll" && r ? /* @__PURE__ */ c(Ib, { ...e, ref: t }) : null;
7574
7557
  }
7575
7558
  );
7576
7559
  Lc.displayName = Go;
7577
7560
  var Ib = l.forwardRef((e, t) => {
7578
- const { __scopeScrollArea: n, ...r } = e, o = ke(Go, n), [s, a] = l.useState(0), [i, u] = l.useState(0), f = !!(s && i);
7561
+ const { __scopeScrollArea: n, ...r } = e, o = Me(Go, n), [s, a] = l.useState(0), [i, u] = l.useState(0), f = !!(s && i);
7579
7562
  return Ot(o.scrollbarX, () => {
7580
7563
  var p;
7581
7564
  const d = ((p = o.scrollbarX) == null ? void 0 : p.offsetHeight) || 0;
@@ -7630,7 +7613,7 @@ function $c(e, t) {
7630
7613
  function Bc(e, t) {
7631
7614
  return e > 0 && e < t;
7632
7615
  }
7633
- var kb = (e, t = () => {
7616
+ var Mb = (e, t = () => {
7634
7617
  }) => {
7635
7618
  let n = { left: e.scrollLeft, top: e.scrollTop }, r = 0;
7636
7619
  return function o() {
@@ -7658,7 +7641,7 @@ function Ot(e, t) {
7658
7641
  }
7659
7642
  }, [e, n]);
7660
7643
  }
7661
- var Uc = Pc, Mb = Ic, Db = Lc;
7644
+ var Uc = Pc, kb = Ic, Db = Lc;
7662
7645
  const zc = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ N(
7663
7646
  Uc,
7664
7647
  {
@@ -7666,7 +7649,7 @@ const zc = l.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
7666
7649
  className: A("relative overflow-hidden", e),
7667
7650
  ...n,
7668
7651
  children: [
7669
- /* @__PURE__ */ c(Mb, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
7652
+ /* @__PURE__ */ c(kb, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
7670
7653
  /* @__PURE__ */ c(Hc, {}),
7671
7654
  /* @__PURE__ */ c(Db, {})
7672
7655
  ]
@@ -7710,7 +7693,7 @@ function ro({
7710
7693
  createThread: h,
7711
7694
  deleteThread: b,
7712
7695
  renameThread: w
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);
7696
+ } = za(), [y, x] = ce(g ?? []), [E, C] = ce(!1), [I, R] = ce(null), [D, M] = ce(null), [k, j] = ce(""), [K, W] = ce(!1);
7714
7697
  ve(() => {
7715
7698
  x(g ?? []);
7716
7699
  }, [g]);
@@ -7738,16 +7721,16 @@ function ro({
7738
7721
  console.error("Failed to delete thread:", le);
7739
7722
  }
7740
7723
  }, G = ($, z) => {
7741
- z.stopPropagation(), k($.threadId), j($.title || `Thread ${$.threadId.slice(0, 8)}`);
7724
+ z.stopPropagation(), M($.threadId), j($.title || `Thread ${$.threadId.slice(0, 8)}`);
7742
7725
  }, T = async ($) => {
7743
- if (M.trim())
7726
+ if (k.trim())
7744
7727
  try {
7745
- await w($, M.trim()), k(null), j("");
7728
+ await w($, k.trim()), M(null), j("");
7746
7729
  } catch (z) {
7747
7730
  console.error("Failed to update title:", z);
7748
7731
  }
7749
7732
  }, P = () => {
7750
- k(null), j("");
7733
+ M(null), j("");
7751
7734
  }, _ = ($, z) => {
7752
7735
  $.key === "Enter" ? T(z) : $.key === "Escape" && P();
7753
7736
  }, O = ($) => {
@@ -7775,7 +7758,7 @@ function ro({
7775
7758
  children: [
7776
7759
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
7777
7760
  /* @__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: M, onChange: (z) => j(z.target.value), onKeyDown: (z) => _(z, $.threadId), className: "h-6 text-sm", autoFocus: !0 }),
7761
+ /* @__PURE__ */ c(tn, { value: k, onChange: (z) => j(z.target.value), onKeyDown: (z) => _(z, $.threadId), className: "h-6 text-sm", autoFocus: !0 }),
7779
7762
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => T($.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(ho, { size: 12 }) }),
7780
7763
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: P, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Kt, { size: 12 }) })
7781
7764
  ] }) : /* @__PURE__ */ N(De, { children: [
@@ -8362,7 +8345,7 @@ Sl.displayName = nn;
8362
8345
  var so = "TooltipTrigger", Cl = l.forwardRef(
8363
8346
  (e, t) => {
8364
8347
  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(ko, { asChild: !0, ...a, children: /* @__PURE__ */ c(
8348
+ return l.useEffect(() => () => document.removeEventListener("pointerup", p), [p]), /* @__PURE__ */ c(Mo, { asChild: !0, ...a, children: /* @__PURE__ */ c(
8366
8349
  J.button,
8367
8350
  {
8368
8351
  "aria-describedby": o.open ? o.contentId : void 0,
@@ -8390,13 +8373,13 @@ var so = "TooltipTrigger", Cl = l.forwardRef(
8390
8373
  Cl.displayName = so;
8391
8374
  var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
8392
8375
  forceMount: void 0
8393
- }), kt = "TooltipContent", El = l.forwardRef(
8376
+ }), Mt = "TooltipContent", El = l.forwardRef(
8394
8377
  (e, t) => {
8395
- const n = hv(kt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = vr(kt, e.__scopeTooltip);
8378
+ const n = hv(Mt, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = vr(Mt, e.__scopeTooltip);
8396
8379
  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
8380
  }
8398
8381
  ), mv = l.forwardRef((e, t) => {
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(() => {
8382
+ const n = vr(Mt, e.__scopeTooltip), r = Qo(Mt, 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
8383
  i(null), p(!1);
8401
8384
  }, [p]), v = l.useCallback(
8402
8385
  (m, h) => {
@@ -8430,7 +8413,7 @@ var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
8430
8413
  onEscapeKeyDown: s,
8431
8414
  onPointerDownOutside: a,
8432
8415
  ...i
8433
- } = e, u = vr(kt, n), f = br(n), { onClose: d } = u;
8416
+ } = e, u = vr(Mt, n), f = br(n), { onClose: d } = u;
8434
8417
  return l.useEffect(() => (document.addEventListener(oo, d), () => document.removeEventListener(oo, d)), [d]), l.useEffect(() => {
8435
8418
  if (u.trigger) {
8436
8419
  const p = (g) => {
@@ -8449,7 +8432,7 @@ var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
8449
8432
  onFocusOutside: (p) => p.preventDefault(),
8450
8433
  onDismiss: d,
8451
8434
  children: /* @__PURE__ */ N(
8452
- Mo,
8435
+ ko,
8453
8436
  {
8454
8437
  "data-state": u.stateAttribute,
8455
8438
  ...f,
@@ -8473,7 +8456,7 @@ var pv = "TooltipPortal", [Ay, hv] = gr(pv, {
8473
8456
  );
8474
8457
  }
8475
8458
  );
8476
- El.displayName = kt;
8459
+ El.displayName = Mt;
8477
8460
  var Nl = "TooltipArrow", wv = l.forwardRef(
8478
8461
  (e, t) => {
8479
8462
  const { __scopeTooltip: n, ...r } = e, o = br(n);
@@ -8590,7 +8573,7 @@ const Pv = Nv, _v = Tv, Iv = Av, Al = l.forwardRef(({ className: e, sideOffset:
8590
8573
  }
8591
8574
  ));
8592
8575
  Al.displayName = Tl.displayName;
8593
- const Ov = "sidebar:state", kv = 60 * 60 * 24 * 7, Mv = "16rem", Dv = "18rem", Lv = "3rem", Fv = "b", Pl = l.createContext(null);
8576
+ const Ov = "sidebar:state", Mv = 60 * 60 * 24 * 7, kv = "16rem", Dv = "18rem", Lv = "3rem", Fv = "b", Pl = l.createContext(null);
8594
8577
  function wr() {
8595
8578
  const e = l.useContext(Pl);
8596
8579
  if (!e)
@@ -8610,7 +8593,7 @@ const _l = l.forwardRef(
8610
8593
  const u = Hb(), [f, d] = l.useState(!1), [p, g] = l.useState(e), v = t ?? p, m = l.useCallback(
8611
8594
  (y) => {
8612
8595
  const x = typeof y == "function" ? y(v) : y;
8613
- n ? n(x) : g(x), document.cookie = `${Ov}=${x}; path=/; max-age=${kv}`;
8596
+ n ? n(x) : g(x), document.cookie = `${Ov}=${x}; path=/; max-age=${Mv}`;
8614
8597
  },
8615
8598
  [n, v]
8616
8599
  ), h = l.useCallback(() => u ? d((y) => !y) : m((y) => !y), [u, m, d]);
@@ -8636,7 +8619,7 @@ const _l = l.forwardRef(
8636
8619
  "div",
8637
8620
  {
8638
8621
  style: {
8639
- "--sidebar-width": Mv,
8622
+ "--sidebar-width": kv,
8640
8623
  "--sidebar-width-icon": Lv,
8641
8624
  ...o
8642
8625
  },
@@ -8780,7 +8763,7 @@ const $v = l.forwardRef(({ className: e, ...t }, n) => {
8780
8763
  );
8781
8764
  });
8782
8765
  $v.displayName = "SidebarRail";
8783
- const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8766
+ const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8784
8767
  "main",
8785
8768
  {
8786
8769
  ref: n,
@@ -8792,7 +8775,7 @@ const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8792
8775
  ...t
8793
8776
  }
8794
8777
  ));
8795
- kl.displayName = "SidebarInset";
8778
+ Ml.displayName = "SidebarInset";
8796
8779
  const Bv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8797
8780
  tn,
8798
8781
  {
@@ -8806,7 +8789,7 @@ const Bv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8806
8789
  }
8807
8790
  ));
8808
8791
  Bv.displayName = "SidebarInput";
8809
- const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8792
+ const kl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8810
8793
  "div",
8811
8794
  {
8812
8795
  ref: n,
@@ -8815,7 +8798,7 @@ const Ml = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8815
8798
  ...t
8816
8799
  }
8817
8800
  ));
8818
- Ml.displayName = "SidebarHeader";
8801
+ kl.displayName = "SidebarHeader";
8819
8802
  const Uv = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8820
8803
  "div",
8821
8804
  {
@@ -8860,7 +8843,7 @@ const Ll = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
8860
8843
  ));
8861
8844
  Ll.displayName = "SidebarGroup";
8862
8845
  const Fl = l.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PURE__ */ c(
8863
- t ? Mt : "div",
8846
+ t ? kt : "div",
8864
8847
  {
8865
8848
  ref: r,
8866
8849
  "data-sidebar": "group-label",
@@ -8874,7 +8857,7 @@ const Fl = l.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PU
8874
8857
  ));
8875
8858
  Fl.displayName = "SidebarGroupLabel";
8876
8859
  const Hv = l.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PURE__ */ c(
8877
- t ? Mt : "button",
8860
+ t ? kt : "button",
8878
8861
  {
8879
8862
  ref: r,
8880
8863
  "data-sidebar": "group-action",
@@ -8948,7 +8931,7 @@ const Wv = rn(
8948
8931
  className: s,
8949
8932
  ...a
8950
8933
  }, i) => {
8951
- const u = e ? Mt : "button", { isMobile: f, state: d } = wr(), p = /* @__PURE__ */ c(
8934
+ const u = e ? kt : "button", { isMobile: f, state: d } = wr(), p = /* @__PURE__ */ c(
8952
8935
  u,
8953
8936
  {
8954
8937
  ref: i,
@@ -8977,7 +8960,7 @@ const Wv = rn(
8977
8960
  );
8978
8961
  zl.displayName = "SidebarMenuButton";
8979
8962
  const Vv = l.forwardRef(({ className: e, asChild: t = !1, showOnHover: n = !1, ...r }, o) => /* @__PURE__ */ c(
8980
- t ? Mt : "button",
8963
+ t ? kt : "button",
8981
8964
  {
8982
8965
  ref: o,
8983
8966
  "data-sidebar": "menu-action",
@@ -9063,7 +9046,7 @@ Gv.displayName = "SidebarMenuSub";
9063
9046
  const qv = l.forwardRef(({ ...e }, t) => /* @__PURE__ */ c("li", { ref: t, ...e }));
9064
9047
  qv.displayName = "SidebarMenuSubItem";
9065
9048
  const Xv = l.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, className: r, ...o }, s) => /* @__PURE__ */ c(
9066
- e ? Mt : "a",
9049
+ e ? kt : "a",
9067
9050
  {
9068
9051
  ref: s,
9069
9052
  "data-sidebar": "menu-sub-button",
@@ -9092,7 +9075,7 @@ function Py({
9092
9075
  }) {
9093
9076
  return /* @__PURE__ */ c(Rn, { ...a, children: /* @__PURE__ */ N(_l, { className: `w-full ${r}`, children: [
9094
9077
  /* @__PURE__ */ N(Il, { className: `border-r ${o}`, children: [
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 }) }) }) }) }),
9078
+ /* @__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 }) }) }) }) }),
9096
9079
  /* @__PURE__ */ c(Dl, { children: n && /* @__PURE__ */ N(Ll, { children: [
9097
9080
  /* @__PURE__ */ c(Fl, { children: "Conversations" }),
9098
9081
  /* @__PURE__ */ c($l, { children: /* @__PURE__ */ c("div", { className: "px-2 py-1", children: /* @__PURE__ */ c(
@@ -9106,7 +9089,7 @@ function Py({
9106
9089
  ) }) })
9107
9090
  ] }) })
9108
9091
  ] }),
9109
- /* @__PURE__ */ N(kl, { children: [
9092
+ /* @__PURE__ */ N(Ml, { children: [
9110
9093
  /* @__PURE__ */ N("header", { className: "h-14 border-b bg-background/60 backdrop-blur flex items-center gap-2 px-4", children: [
9111
9094
  /* @__PURE__ */ c(Ol, {}),
9112
9095
  /* @__PURE__ */ c("div", { className: "flex-1" }),
@@ -9305,7 +9288,7 @@ var rw = [" ", "Enter", "ArrowUp", "ArrowDown"], ow = [" ", "Enter"], gt = "Sele
9305
9288
  defaultProp: o ?? !1,
9306
9289
  onChange: s,
9307
9290
  caller: gt
9308
- }), [k, M] = ot({
9291
+ }), [M, k] = ot({
9309
9292
  prop: a,
9310
9293
  defaultProp: i,
9311
9294
  onChange: u,
@@ -9323,8 +9306,8 @@ var rw = [" ", "Enter", "ArrowUp", "ArrowDown"], ow = [" ", "Enter"], gt = "Sele
9323
9306
  valueNodeHasChildren: E,
9324
9307
  onValueNodeHasChildrenChange: C,
9325
9308
  contentId: Le(),
9326
- value: k,
9327
- onValueChange: M,
9309
+ value: M,
9310
+ onValueChange: k,
9328
9311
  open: R,
9329
9312
  onOpenChange: D,
9330
9313
  dir: I,
@@ -9355,12 +9338,12 @@ var rw = [" ", "Enter", "ArrowUp", "ArrowDown"], ow = [" ", "Enter"], gt = "Sele
9355
9338
  tabIndex: -1,
9356
9339
  name: d,
9357
9340
  autoComplete: p,
9358
- value: k,
9359
- onChange: (L) => M(L.target.value),
9341
+ value: M,
9342
+ onChange: (L) => k(L.target.value),
9360
9343
  disabled: g,
9361
9344
  form: m,
9362
9345
  children: [
9363
- k === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
9346
+ M === void 0 ? /* @__PURE__ */ c("option", { value: "" }) : null,
9364
9347
  Array.from(W)
9365
9348
  ]
9366
9349
  },
@@ -9382,7 +9365,7 @@ var Zl = "SelectTrigger", Ql = l.forwardRef(
9382
9365
  y: Math.round(h.pageY)
9383
9366
  });
9384
9367
  };
9385
- return /* @__PURE__ */ c(ko, { asChild: !0, ...s, children: /* @__PURE__ */ c(
9368
+ return /* @__PURE__ */ c(Mo, { asChild: !0, ...s, children: /* @__PURE__ */ c(
9386
9369
  J.button,
9387
9370
  {
9388
9371
  type: "button",
@@ -9457,7 +9440,7 @@ var bt = "SelectContent", ou = l.forwardRef(
9457
9440
  }
9458
9441
  );
9459
9442
  ou.displayName = bt;
9460
- var Me = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent.RemoveScroll"), au = l.forwardRef(
9443
+ var ke = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent.RemoveScroll"), au = l.forwardRef(
9461
9444
  (e, t) => {
9462
9445
  const {
9463
9446
  __scopeSelect: n,
@@ -9479,7 +9462,7 @@ var Me = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent
9479
9462
  avoidCollisions: b,
9480
9463
  //
9481
9464
  ...w
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(
9465
+ } = e, y = it(bt, n), [x, E] = l.useState(null), [C, I] = l.useState(null), R = te(t, (V) => E(V)), [D, M] = l.useState(null), [k, j] = l.useState(
9483
9466
  null
9484
9467
  ), K = Sr(n), [W, B] = l.useState(!1), q = l.useRef(!1);
9485
9468
  l.useEffect(() => {
@@ -9528,7 +9511,7 @@ var Me = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent
9528
9511
  }), X = l.useCallback(
9529
9512
  (V, re, ie) => {
9530
9513
  const oe = !q.current && !ie;
9531
- (y.value !== void 0 && y.value === re || oe) && (k(V), oe && (q.current = !0));
9514
+ (y.value !== void 0 && y.value === re || oe) && (M(V), oe && (q.current = !0));
9532
9515
  },
9533
9516
  [y.value]
9534
9517
  ), $ = l.useCallback(() => x == null ? void 0 : x.focus(), [x]), z = l.useCallback(
@@ -9561,7 +9544,7 @@ var Me = 10, [su, ct] = Ut(bt), dw = "SelectContentImpl", fw = Pt("SelectContent
9561
9544
  onItemLeave: $,
9562
9545
  itemTextRefCallback: z,
9563
9546
  focusSelectedItem: G,
9564
- selectedItemText: M,
9547
+ selectedItemText: k,
9565
9548
  position: r,
9566
9549
  isPositioned: W,
9567
9550
  searchRef: _,
@@ -9631,26 +9614,26 @@ au.displayName = dw;
9631
9614
  var pw = "SelectItemAlignedPosition", iu = l.forwardRef((e, t) => {
9632
9615
  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
9616
  if (s.trigger && s.valueNode && i && f && h && b && w) {
9634
- const R = s.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), k = s.valueNode.getBoundingClientRect(), M = w.getBoundingClientRect();
9617
+ const R = s.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), M = s.valueNode.getBoundingClientRect(), k = w.getBoundingClientRect();
9635
9618
  if (s.dir !== "rtl") {
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,
9619
+ const H = k.left - D.left, Z = M.left - H, de = R.left - Z, pe = R.width + de, Y = Math.max(pe, D.width), ge = window.innerWidth - ke, ae = no(Z, [
9620
+ ke,
9638
9621
  // Prevents the content from going off the starting edge of the
9639
9622
  // viewport. It may still go off the ending edge, but this can be
9640
9623
  // controlled by the user since they may want to manage overflow in a
9641
9624
  // specific way.
9642
9625
  // https://github.com/radix-ui/primitives/issues/2049
9643
- Math.max(Me, ge - Y)
9626
+ Math.max(ke, ge - Y)
9644
9627
  ]);
9645
9628
  i.style.minWidth = pe + "px", i.style.left = ae + "px";
9646
9629
  } else {
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)
9630
+ const H = D.right - k.right, Z = window.innerWidth - M.right - H, de = window.innerWidth - R.right - Z, pe = R.width + de, Y = Math.max(pe, D.width), ge = window.innerWidth - ke, ae = no(Z, [
9631
+ ke,
9632
+ Math.max(ke, ge - Y)
9650
9633
  ]);
9651
9634
  i.style.minWidth = pe + "px", i.style.right = ae + "px";
9652
9635
  }
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;
9636
+ const j = g(), K = window.innerHeight - ke * 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 - ke, le = K - z, se = b.offsetHeight / 2, V = b.offsetTop + se, re = q + L + V, ie = P - re;
9654
9637
  if (re <= z) {
9655
9638
  const H = j.length > 0 && b === j[j.length - 1].ref.current;
9656
9639
  i.style.bottom = "0px";
@@ -9670,7 +9653,7 @@ var pw = "SelectItemAlignedPosition", iu = l.forwardRef((e, t) => {
9670
9653
  ) + ie;
9671
9654
  i.style.height = de + "px", h.scrollTop = re - z + h.offsetTop;
9672
9655
  }
9673
- i.style.margin = `${Me}px 0`, i.style.minHeight = _ + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
9656
+ i.style.margin = `${ke}px 0`, i.style.minHeight = _ + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
9674
9657
  }
9675
9658
  }, [
9676
9659
  g,
@@ -9737,11 +9720,11 @@ var hw = "SelectPopperPosition", ao = l.forwardRef((e, t) => {
9737
9720
  const {
9738
9721
  __scopeSelect: n,
9739
9722
  align: r = "start",
9740
- collisionPadding: o = Me,
9723
+ collisionPadding: o = ke,
9741
9724
  ...s
9742
9725
  } = e, a = Cr(n);
9743
9726
  return /* @__PURE__ */ c(
9744
- Mo,
9727
+ ko,
9745
9728
  {
9746
9729
  ...a,
9747
9730
  ...s,
@@ -9800,7 +9783,7 @@ var [mw, es] = Ut(bt, {}), io = "SelectViewport", cu = l.forwardRef(
9800
9783
  if (g != null && g.current && p) {
9801
9784
  const v = Math.abs(u.current - d.scrollTop);
9802
9785
  if (v > 0) {
9803
- const m = window.innerHeight - Me * 2, h = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(h, b);
9786
+ const m = window.innerHeight - ke * 2, h = parseFloat(p.style.minHeight), b = parseFloat(p.style.height), w = Math.max(h, b);
9804
9787
  if (w < m) {
9805
9788
  const y = w + v, x = Math.min(m, y), E = y - x;
9806
9789
  p.style.height = x + "px", p.style.bottom === "0px" && (d.scrollTop = E > 0 ? E : 0, p.style.justifyContent = "flex-end");
@@ -10115,7 +10098,7 @@ const Ou = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10115
10098
  }
10116
10099
  ));
10117
10100
  Ou.displayName = Pu.displayName;
10118
- const ku = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10101
+ const Mu = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10119
10102
  _u,
10120
10103
  {
10121
10104
  ref: n,
@@ -10127,7 +10110,7 @@ const ku = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10127
10110
  children: /* @__PURE__ */ c(Nt, { className: "h-4 w-4" })
10128
10111
  }
10129
10112
  ));
10130
- ku.displayName = _u.displayName;
10113
+ Mu.displayName = _u.displayName;
10131
10114
  const po = l.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c(Tw, { children: /* @__PURE__ */ N(
10132
10115
  Nu,
10133
10116
  {
@@ -10151,7 +10134,7 @@ const po = l.forwardRef(({ className: e, children: t, position: n = "popper", ..
10151
10134
  children: t
10152
10135
  }
10153
10136
  ),
10154
- /* @__PURE__ */ c(ku, {})
10137
+ /* @__PURE__ */ c(Mu, {})
10155
10138
  ]
10156
10139
  }
10157
10140
  ) }));
@@ -10223,7 +10206,7 @@ const On = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10223
10206
  }
10224
10207
  ));
10225
10208
  On.displayName = "CardTitle";
10226
- const kw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10209
+ const Mw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10227
10210
  "p",
10228
10211
  {
10229
10212
  ref: n,
@@ -10231,10 +10214,10 @@ const kw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10231
10214
  ...t
10232
10215
  }
10233
10216
  ));
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(
10217
+ Mw.displayName = "CardDescription";
10218
+ const Mn = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c("div", { ref: n, className: A("p-6 pt-0", e), ...t }));
10219
+ Mn.displayName = "CardContent";
10220
+ const kw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10238
10221
  "div",
10239
10222
  {
10240
10223
  ref: n,
@@ -10242,7 +10225,7 @@ const Mw = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10242
10225
  ...t
10243
10226
  }
10244
10227
  ));
10245
- Mw.displayName = "CardFooter";
10228
+ kw.displayName = "CardFooter";
10246
10229
  const Dw = 1, Lw = 1e6;
10247
10230
  let Ur = 0;
10248
10231
  function Fw() {
@@ -10295,10 +10278,10 @@ const zr = /* @__PURE__ */ new Map(), ia = (e) => {
10295
10278
  toasts: e.toasts.filter((n) => n.id !== t.toastId)
10296
10279
  };
10297
10280
  }
10298
- }, Mn = [];
10281
+ }, kn = [];
10299
10282
  let Dn = { toasts: [] };
10300
10283
  function Yt(e) {
10301
- Dn = $w(Dn, e), Mn.forEach((t) => {
10284
+ Dn = $w(Dn, e), kn.forEach((t) => {
10302
10285
  t(Dn);
10303
10286
  });
10304
10287
  }
@@ -10325,9 +10308,9 @@ function Bw({ ...e }) {
10325
10308
  }
10326
10309
  function Uw() {
10327
10310
  const [e, t] = l.useState(Dn);
10328
- return l.useEffect(() => (Mn.push(t), () => {
10329
- const n = Mn.indexOf(t);
10330
- n > -1 && Mn.splice(n, 1);
10311
+ return l.useEffect(() => (kn.push(t), () => {
10312
+ const n = kn.indexOf(t);
10313
+ n > -1 && kn.splice(n, 1);
10331
10314
  }), [e]), {
10332
10315
  ...e,
10333
10316
  toast: Bw,
@@ -10405,7 +10388,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
10405
10388
  /* @__PURE__ */ c(Xu, { className: "h-5 w-5" }),
10406
10389
  "API Configuration"
10407
10390
  ] }) }),
10408
- /* @__PURE__ */ N(kn, { className: "space-y-4", children: [
10391
+ /* @__PURE__ */ N(Mn, { className: "space-y-4", children: [
10409
10392
  /* @__PURE__ */ N("div", { className: "space-y-2", children: [
10410
10393
  /* @__PURE__ */ c(Ie, { htmlFor: "api-url", children: "API Base URL" }),
10411
10394
  /* @__PURE__ */ N("div", { className: "flex gap-2", children: [
@@ -10472,7 +10455,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
10472
10455
  /* @__PURE__ */ c(Zu, { className: "h-5 w-5" }),
10473
10456
  "Interface Settings"
10474
10457
  ] }) }),
10475
- /* @__PURE__ */ N(kn, { className: "space-y-4", children: [
10458
+ /* @__PURE__ */ N(Mn, { className: "space-y-4", children: [
10476
10459
  /* @__PURE__ */ N("div", { className: "space-y-2", children: [
10477
10460
  /* @__PURE__ */ c(Ie, { htmlFor: "layout", children: "Layout Style" }),
10478
10461
  /* @__PURE__ */ N(
@@ -10567,7 +10550,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
10567
10550
  /* @__PURE__ */ c(Qu, { className: "h-5 w-5" }),
10568
10551
  "Behavior Settings"
10569
10552
  ] }) }),
10570
- /* @__PURE__ */ N(kn, { className: "space-y-4", children: [
10553
+ /* @__PURE__ */ N(Mn, { className: "space-y-4", children: [
10571
10554
  /* @__PURE__ */ N("div", { className: "flex items-center justify-between", children: [
10572
10555
  /* @__PURE__ */ N("div", { children: [
10573
10556
  /* @__PURE__ */ c(Ie, { htmlFor: "auto-save", children: "Auto-save Conversations" }),
@@ -10638,7 +10621,7 @@ function Oy({ settings: e, onSettingsChange: t, className: n = "" }) {
10638
10621
  ] })
10639
10622
  ] });
10640
10623
  }
10641
- function ky({
10624
+ function My({
10642
10625
  layout: e = "sidebar",
10643
10626
  layoutSize: t = "desktop",
10644
10627
  showThreads: n = !0,
@@ -10727,7 +10710,7 @@ export {
10727
10710
  pt as apiClient,
10728
10711
  Ey as applySettings,
10729
10712
  pt as chatApiClient,
10730
- ky as default,
10713
+ My as default,
10731
10714
  $f as del,
10732
10715
  xt as get,
10733
10716
  Ba as getChatToken,