teodor-new-chat-ui 3.0.8 → 3.0.9

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
@@ -18,11 +18,11 @@ function Ma(e, t) {
18
18
  const { toString: Pd } = Object.prototype, { getPrototypeOf: Uo } = Object, { iterator: fr, toStringTag: Da } = Symbol, pr = /* @__PURE__ */ ((e) => (t) => {
19
19
  const n = Pd.call(t);
20
20
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
21
- })(/* @__PURE__ */ Object.create(null)), Ve = (e) => (e = e.toLowerCase(), (t) => pr(t) === e), hr = (e) => (t) => typeof t === e, { isArray: Wt } = Array, $t = hr("undefined");
21
+ })(/* @__PURE__ */ Object.create(null)), je = (e) => (e = e.toLowerCase(), (t) => pr(t) === e), hr = (e) => (t) => typeof t === e, { isArray: Wt } = Array, $t = hr("undefined");
22
22
  function pn(e) {
23
23
  return e !== null && !$t(e) && e.constructor !== null && !$t(e.constructor) && Pe(e.constructor.isBuffer) && e.constructor.isBuffer(e);
24
24
  }
25
- const La = Ve("ArrayBuffer");
25
+ const La = je("ArrayBuffer");
26
26
  function Id(e) {
27
27
  let t;
28
28
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && La(e.buffer), t;
@@ -40,11 +40,11 @@ const _d = hr("string"), Pe = hr("function"), Fa = hr("number"), hn = (e) => e !
40
40
  } catch {
41
41
  return !1;
42
42
  }
43
- }, Md = Ve("Date"), Dd = Ve("File"), Ld = Ve("Blob"), Fd = Ve("FileList"), $d = (e) => hn(e) && Pe(e.pipe), Bd = (e) => {
43
+ }, Md = je("Date"), Dd = je("File"), Ld = je("Blob"), Fd = je("FileList"), $d = (e) => hn(e) && Pe(e.pipe), Bd = (e) => {
44
44
  let t;
45
45
  return e && (typeof FormData == "function" && e instanceof FormData || Pe(e.append) && ((t = pr(e)) === "formdata" || // detect form-data instance
46
46
  t === "object" && Pe(e.toString) && e.toString() === "[object FormData]"));
47
- }, Ud = Ve("URLSearchParams"), [Hd, zd, Wd, Vd] = ["ReadableStream", "Request", "Response", "Headers"].map(Ve), jd = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
47
+ }, Ud = je("URLSearchParams"), [Hd, zd, Wd, jd] = ["ReadableStream", "Request", "Response", "Headers"].map(je), Vd = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
48
48
  function mn(e, t, { allOwnKeys: n = !1 } = {}) {
49
49
  if (e === null || typeof e > "u")
50
50
  return;
@@ -124,12 +124,12 @@ const Kd = (e, t, n, { allOwnKeys: r } = {}) => (mn(t, (o, s) => {
124
124
  for (; (n = e.exec(t)) !== null; )
125
125
  r.push(n);
126
126
  return r;
127
- }, tf = Ve("HTMLFormElement"), nf = (e) => e.toLowerCase().replace(
127
+ }, tf = je("HTMLFormElement"), nf = (e) => e.toLowerCase().replace(
128
128
  /[-_\s]([a-z\d])(\w*)/g,
129
129
  function(n, r, o) {
130
130
  return r.toUpperCase() + o;
131
131
  }
132
- ), _s = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rf = Ve("RegExp"), Ua = (e, t) => {
132
+ ), _s = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), rf = je("RegExp"), Ua = (e, t) => {
133
133
  const n = Object.getOwnPropertyDescriptors(e), r = {};
134
134
  mn(n, (o, s) => {
135
135
  let a;
@@ -181,7 +181,7 @@ const uf = (e) => {
181
181
  return r;
182
182
  };
183
183
  return n(e, 0);
184
- }, df = Ve("AsyncFunction"), ff = (e) => e && (hn(e) || Pe(e)) && Pe(e.then) && Pe(e.catch), Ha = ((e, t) => e ? setImmediate : t ? ((n, r) => (bt.addEventListener("message", ({ source: o, data: s }) => {
184
+ }, df = je("AsyncFunction"), ff = (e) => e && (hn(e) || Pe(e)) && Pe(e.then) && Pe(e.catch), Ha = ((e, t) => e ? setImmediate : t ? ((n, r) => (bt.addEventListener("message", ({ source: o, data: s }) => {
185
185
  o === bt && s === n && r.length && r.shift()();
186
186
  }, !1), (o) => {
187
187
  r.push(o), bt.postMessage(n, "*");
@@ -203,7 +203,7 @@ const uf = (e) => {
203
203
  isReadableStream: Hd,
204
204
  isRequest: zd,
205
205
  isResponse: Wd,
206
- isHeaders: Vd,
206
+ isHeaders: jd,
207
207
  isUndefined: $t,
208
208
  isDate: Md,
209
209
  isFile: Dd,
@@ -217,12 +217,12 @@ const uf = (e) => {
217
217
  forEach: mn,
218
218
  merge: ho,
219
219
  extend: Kd,
220
- trim: jd,
220
+ trim: Vd,
221
221
  stripBOM: Gd,
222
222
  inherits: qd,
223
223
  toFlatObject: Xd,
224
224
  kindOf: pr,
225
- kindOfTest: Ve,
225
+ kindOfTest: je,
226
226
  endsWith: Yd,
227
227
  toArray: Jd,
228
228
  forEachEntry: Qd,
@@ -304,12 +304,12 @@ const mf = null;
304
304
  function mo(e) {
305
305
  return S.isPlainObject(e) || S.isArray(e);
306
306
  }
307
- function Va(e) {
307
+ function ja(e) {
308
308
  return S.endsWith(e, "[]") ? e.slice(0, -2) : e;
309
309
  }
310
310
  function Os(e, t, n) {
311
311
  return e ? e.concat(t).map(function(o, s) {
312
- return o = Va(o), !n && s ? "[" + o + "]" : o;
312
+ return o = ja(o), !n && s ? "[" + o + "]" : o;
313
313
  }).join(n ? "." : "") : t;
314
314
  }
315
315
  function gf(e) {
@@ -347,7 +347,7 @@ function mr(e, t, n) {
347
347
  if (S.endsWith(h, "{}"))
348
348
  h = r ? h : h.slice(0, -2), g = JSON.stringify(g);
349
349
  else if (S.isArray(g) && gf(g) || (S.isFileList(g) || S.endsWith(h, "[]")) && (w = S.toArray(g)))
350
- return h = Va(h), w.forEach(function(y, C) {
350
+ return h = ja(h), w.forEach(function(y, C) {
351
351
  !(S.isUndefined(y) || y === null) && t.append(
352
352
  // eslint-disable-next-line no-nested-ternary
353
353
  a === !0 ? Os([h], C, s) : a === null ? h : h + "[]",
@@ -398,11 +398,11 @@ function ks(e) {
398
398
  function Ho(e, t) {
399
399
  this._pairs = [], e && mr(e, this, t);
400
400
  }
401
- const ja = Ho.prototype;
402
- ja.append = function(t, n) {
401
+ const Va = Ho.prototype;
402
+ Va.append = function(t, n) {
403
403
  this._pairs.push([t, n]);
404
404
  };
405
- ja.toString = function(t) {
405
+ Va.toString = function(t) {
406
406
  const n = t ? function(r) {
407
407
  return t.call(this, r, ks);
408
408
  } : ks;
@@ -660,7 +660,7 @@ function kf(e) {
660
660
  return t;
661
661
  }
662
662
  const Mf = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
663
- function jr(e, t, n, r, o) {
663
+ function Vr(e, t, n, r, o) {
664
664
  if (S.isFunction(r))
665
665
  return r.call(this, t, n);
666
666
  if (o && (t = n), !!S.isString(t)) {
@@ -734,7 +734,7 @@ let Ie = class {
734
734
  has(t, n) {
735
735
  if (t = Jt(t), t) {
736
736
  const r = S.findKey(this, t);
737
- return !!(r && this[r] !== void 0 && (!n || jr(this, this[r], r, n)));
737
+ return !!(r && this[r] !== void 0 && (!n || Vr(this, this[r], r, n)));
738
738
  }
739
739
  return !1;
740
740
  }
@@ -744,7 +744,7 @@ let Ie = class {
744
744
  function s(a) {
745
745
  if (a = Jt(a), a) {
746
746
  const i = S.findKey(r, a);
747
- i && (!n || jr(r, r[i], i, n)) && (delete r[i], o = !0);
747
+ i && (!n || Vr(r, r[i], i, n)) && (delete r[i], o = !0);
748
748
  }
749
749
  }
750
750
  return S.isArray(t) ? t.forEach(s) : s(t), o;
@@ -754,7 +754,7 @@ let Ie = class {
754
754
  let r = n.length, o = !1;
755
755
  for (; r--; ) {
756
756
  const s = n[r];
757
- (!t || jr(this, this[s], s, t, !0)) && (delete this[s], o = !0);
757
+ (!t || Vr(this, this[s], s, t, !0)) && (delete this[s], o = !0);
758
758
  }
759
759
  return o;
760
760
  }
@@ -831,10 +831,10 @@ function Kr(e, t) {
831
831
  function Xa(e) {
832
832
  return !!(e && e.__CANCEL__);
833
833
  }
834
- function Vt(e, t, n) {
834
+ function jt(e, t, n) {
835
835
  ne.call(this, e ?? "canceled", ne.ERR_CANCELED, t, n), this.name = "CanceledError";
836
836
  }
837
- S.inherits(Vt, ne, {
837
+ S.inherits(jt, ne, {
838
838
  __CANCEL__: !0
839
839
  });
840
840
  function Ya(e, t, n) {
@@ -1031,7 +1031,7 @@ const Za = (e) => {
1031
1031
  l && a.set(o, l);
1032
1032
  }
1033
1033
  return t;
1034
- }, Vf = typeof XMLHttpRequest < "u", jf = Vf && function(e) {
1034
+ }, jf = typeof XMLHttpRequest < "u", Vf = jf && function(e) {
1035
1035
  return new Promise(function(n, r) {
1036
1036
  const o = Za(e);
1037
1037
  let s = o.data;
@@ -1080,7 +1080,7 @@ const Za = (e) => {
1080
1080
  }, s === void 0 && a.setContentType(null), "setRequestHeader" in b && S.forEach(a.toJSON(), function(C, R) {
1081
1081
  b.setRequestHeader(R, C);
1082
1082
  }), S.isUndefined(o.withCredentials) || (b.withCredentials = !!o.withCredentials), i && i !== "json" && (b.responseType = o.responseType), f && ([m, g] = Zn(f, !0), b.addEventListener("progress", m)), l && b.upload && ([p, v] = Zn(l), b.upload.addEventListener("progress", p), b.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (y) => {
1083
- b && (r(!y || y.type ? new Vt(null, e, b) : y), b.abort(), b = null);
1083
+ b && (r(!y || y.type ? new jt(null, e, b) : y), b.abort(), b = null);
1084
1084
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1085
1085
  const x = Ff(o.url);
1086
1086
  if (x && Se.protocols.indexOf(x) === -1) {
@@ -1097,7 +1097,7 @@ const Za = (e) => {
1097
1097
  if (!o) {
1098
1098
  o = !0, i();
1099
1099
  const d = f instanceof Error ? f : this.reason;
1100
- r.abort(d instanceof ne ? d : new Vt(d instanceof Error ? d.message : d));
1100
+ r.abort(d instanceof ne ? d : new jt(d instanceof Error ? d.message : d));
1101
1101
  }
1102
1102
  };
1103
1103
  let a = t && setTimeout(() => {
@@ -1256,11 +1256,11 @@ const Za = (e) => {
1256
1256
  duplex: "half"
1257
1257
  }), se;
1258
1258
  if (S.isFormData(w) && (se = q.headers.get("content-type")) && k.setContentType(se), q.body) {
1259
- const [F, V] = Ls(
1259
+ const [F, j] = Ls(
1260
1260
  H,
1261
1261
  Zn(Fs(_))
1262
1262
  );
1263
- w = Bs(q.body, Us, F, V);
1263
+ w = Bs(q.body, Us, F, j);
1264
1264
  }
1265
1265
  }
1266
1266
  S.isString(L) || (L = L ? "include" : "omit");
@@ -1281,13 +1281,13 @@ const Za = (e) => {
1281
1281
  ["status", "statusText", "headers"].forEach((ce) => {
1282
1282
  q[ce] = D[ce];
1283
1283
  });
1284
- const se = S.toFiniteNumber(D.headers.get("content-length")), [F, V] = R && Ls(
1284
+ const se = S.toFiniteNumber(D.headers.get("content-length")), [F, j] = R && Ls(
1285
1285
  se,
1286
1286
  Zn(Fs(R), !0)
1287
1287
  ) || [];
1288
1288
  D = new r(
1289
1289
  Bs(D.body, Us, F, () => {
1290
- V && V(), M && M();
1290
+ j && j(), M && M();
1291
1291
  }),
1292
1292
  q
1293
1293
  );
@@ -1328,7 +1328,7 @@ const Za = (e) => {
1328
1328
  Qa();
1329
1329
  const bo = {
1330
1330
  http: mf,
1331
- xhr: jf,
1331
+ xhr: Vf,
1332
1332
  fetch: {
1333
1333
  get: Qa
1334
1334
  }
@@ -1342,7 +1342,7 @@ S.forEach(bo, (e, t) => {
1342
1342
  Object.defineProperty(e, "adapterName", { value: t });
1343
1343
  }
1344
1344
  });
1345
- const Vs = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !1, ei = {
1345
+ const js = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !1, ei = {
1346
1346
  getAdapter: (e, t) => {
1347
1347
  e = S.isArray(e) ? e : [e];
1348
1348
  const { length: n } = e;
@@ -1362,8 +1362,8 @@ const Vs = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !
1362
1362
  ([l, f]) => `adapter ${l} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
1363
1363
  );
1364
1364
  let i = n ? a.length > 1 ? `since :
1365
- ` + a.map(Vs).join(`
1366
- `) : " " + Vs(a[0]) : "as no adapter specified";
1365
+ ` + a.map(js).join(`
1366
+ `) : " " + js(a[0]) : "as no adapter specified";
1367
1367
  throw new ne(
1368
1368
  "There is no suitable adapter to dispatch the request " + i,
1369
1369
  "ERR_NOT_SUPPORT"
@@ -1375,9 +1375,9 @@ const Vs = (e) => `- ${e}`, Qf = (e) => S.isFunction(e) || e === null || e === !
1375
1375
  };
1376
1376
  function Gr(e) {
1377
1377
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
1378
- throw new Vt(null, e);
1378
+ throw new jt(null, e);
1379
1379
  }
1380
- function js(e) {
1380
+ function Vs(e) {
1381
1381
  return Gr(e), e.headers = Ie.from(e.headers), e.data = Kr.call(
1382
1382
  e,
1383
1383
  e.transformRequest
@@ -1513,7 +1513,7 @@ let vt = class {
1513
1513
  });
1514
1514
  let d, p = 0, m;
1515
1515
  if (!l) {
1516
- const g = [js.bind(this), void 0];
1516
+ const g = [Vs.bind(this), void 0];
1517
1517
  for (g.unshift(...i), g.push(...f), m = g.length, d = Promise.resolve(n); p < m; )
1518
1518
  d = d.then(g[p++], g[p++]);
1519
1519
  return d;
@@ -1530,7 +1530,7 @@ let vt = class {
1530
1530
  }
1531
1531
  }
1532
1532
  try {
1533
- d = js.call(this, v);
1533
+ d = Vs.call(this, v);
1534
1534
  } catch (g) {
1535
1535
  return Promise.reject(g);
1536
1536
  }
@@ -1592,7 +1592,7 @@ let tp = class ni {
1592
1592
  r.unsubscribe(s);
1593
1593
  }, a;
1594
1594
  }, t(function(s, a, i) {
1595
- r.reason || (r.reason = new Vt(s, a, i), n(r.reason));
1595
+ r.reason || (r.reason = new jt(s, a, i), n(r.reason));
1596
1596
  });
1597
1597
  }
1598
1598
  /**
@@ -1725,7 +1725,7 @@ function ri(e) {
1725
1725
  }
1726
1726
  const be = ri(gn);
1727
1727
  be.Axios = vt;
1728
- be.CanceledError = Vt;
1728
+ be.CanceledError = jt;
1729
1729
  be.CancelToken = tp;
1730
1730
  be.isCancel = Xa;
1731
1731
  be.VERSION = ti;
@@ -1972,8 +1972,8 @@ function lp(e = {}) {
1972
1972
  const Q = window.__AUTH_TOKEN__, q = ((L = window.localStorage) == null ? void 0 : L.getItem("authToken")) || null;
1973
1973
  let se = null;
1974
1974
  try {
1975
- const V = (I = window.localStorage) == null ? void 0 : I.getItem("chat-settings");
1976
- V && (se = (($ = JSON.parse(V)) == null ? void 0 : $.apiKey) || null);
1975
+ const j = (I = window.localStorage) == null ? void 0 : I.getItem("chat-settings");
1976
+ j && (se = (($ = JSON.parse(j)) == null ? void 0 : $.apiKey) || null);
1977
1977
  } catch {
1978
1978
  }
1979
1979
  const F = Q || q || se || null;
@@ -2021,14 +2021,14 @@ function lp(e = {}) {
2021
2021
  D = D.slice(q + 2);
2022
2022
  const F = dp(se);
2023
2023
  if (!F) continue;
2024
- let V;
2024
+ let j;
2025
2025
  try {
2026
- V = JSON.parse(F);
2026
+ j = JSON.parse(F);
2027
2027
  } catch {
2028
2028
  N && console.debug("[use-chat] skip malformed SSE data:", F == null ? void 0 : F.slice(0, 200));
2029
2029
  continue;
2030
2030
  }
2031
- const ce = up(V) ? V.data : V;
2031
+ const ce = up(j) ? j.data : j;
2032
2032
  if (N && console.debug("[use-chat] event:", ce == null ? void 0 : ce.type, ce), C == null || C(ce), ce.type === "token")
2033
2033
  e.autoAppendAssistant !== !1 && p((pe) => pe + ce.content);
2034
2034
  else if (ce.type === "message_delta") {
@@ -2296,10 +2296,10 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2296
2296
  }, [T, r]);
2297
2297
  const se = Te(null);
2298
2298
  ge(() => {
2299
- o && se.current !== o && (se.current = o, V(o).catch(() => {
2299
+ o && se.current !== o && (se.current = o, j(o).catch(() => {
2300
2300
  }));
2301
2301
  }, [o]);
2302
- const F = Te(null), V = ve(
2302
+ const F = Te(null), j = ve(
2303
2303
  async (Z, Y, he) => {
2304
2304
  if (F.current !== Z) {
2305
2305
  F.current = Z;
@@ -2329,8 +2329,8 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2329
2329
  O(Y, "replace");
2330
2330
  }, [l, T, O, N]), z = ve(async () => {
2331
2331
  if (!T) throw new Error("No active thread");
2332
- await V(T);
2333
- }, [T, V]), W = Te(!1);
2332
+ await j(T);
2333
+ }, [T, j]), W = Te(!1);
2334
2334
  ge(() => {
2335
2335
  const Z = W.current;
2336
2336
  if (W.current = f, Z && !f && T) {
@@ -2354,8 +2354,8 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2354
2354
  }, [f, T, w.lastCheckpointId, l, O, q]);
2355
2355
  const ae = ve(async (Z) => {
2356
2356
  const Y = await l.createThread(Z);
2357
- return await q(), await V(Y.threadId), Y.threadId;
2358
- }, [l, q, V]), j = ve(async (Z) => {
2357
+ return await q(), await j(Y.threadId), Y.threadId;
2358
+ }, [l, q, j]), V = ve(async (Z) => {
2359
2359
  await l.deleteThread(Z), await q(), T === Z && (Q(null), _([]), L(!1), B(null), H(void 0));
2360
2360
  }, [l, q, T, _]), X = ve(async (Z, Y) => {
2361
2361
  await l.updateThread(Z, Y), await q();
@@ -2374,8 +2374,8 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2374
2374
  try {
2375
2375
  const tt = Be.result;
2376
2376
  let Nn = "";
2377
- const Rn = new Uint8Array(tt), Vr = Rn.byteLength;
2378
- for (let P = 0; P < Vr; P++) Nn += String.fromCharCode(Rn[P]);
2377
+ const Rn = new Uint8Array(tt), jr = Rn.byteLength;
2378
+ for (let P = 0; P < jr; P++) Nn += String.fromCharCode(Rn[P]);
2379
2379
  xe(btoa(Nn));
2380
2380
  } catch (tt) {
2381
2381
  Ne(tt);
@@ -2499,9 +2499,9 @@ function Un({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2499
2499
  returnToLatest: z,
2500
2500
  refreshThreads: q,
2501
2501
  createThread: ae,
2502
- deleteThread: j,
2502
+ deleteThread: V,
2503
2503
  renameThread: X,
2504
- loadThread: V,
2504
+ loadThread: j,
2505
2505
  send: te,
2506
2506
  stop: m
2507
2507
  };
@@ -2603,7 +2603,7 @@ function xp(e, t) {
2603
2603
  }
2604
2604
  return [r, o];
2605
2605
  }
2606
- function je(e, t = []) {
2606
+ function Ve(e, t = []) {
2607
2607
  let n = [];
2608
2608
  function r(s, a) {
2609
2609
  const i = u.createContext(a), l = n.length;
@@ -2828,7 +2828,7 @@ function He(e) {
2828
2828
  n((r) => r ?? String(_p++));
2829
2829
  }, [e]), t ? `radix-${t}` : "";
2830
2830
  }
2831
- var br = "Collapsible", [Op, Hy] = je(br), [kp, Vo] = Op(br), ui = u.forwardRef(
2831
+ var br = "Collapsible", [Op, Hy] = Ve(br), [kp, jo] = Op(br), ui = u.forwardRef(
2832
2832
  (e, t) => {
2833
2833
  const {
2834
2834
  __scopeCollapsible: n,
@@ -2867,7 +2867,7 @@ var br = "Collapsible", [Op, Hy] = je(br), [kp, Vo] = Op(br), ui = u.forwardRef(
2867
2867
  ui.displayName = br;
2868
2868
  var di = "CollapsibleTrigger", fi = u.forwardRef(
2869
2869
  (e, t) => {
2870
- const { __scopeCollapsible: n, ...r } = e, o = Vo(di, n);
2870
+ const { __scopeCollapsible: n, ...r } = e, o = jo(di, n);
2871
2871
  return /* @__PURE__ */ c(
2872
2872
  ee.button,
2873
2873
  {
@@ -2885,15 +2885,15 @@ var di = "CollapsibleTrigger", fi = u.forwardRef(
2885
2885
  }
2886
2886
  );
2887
2887
  fi.displayName = di;
2888
- var jo = "CollapsibleContent", Mp = u.forwardRef(
2888
+ var Vo = "CollapsibleContent", Mp = u.forwardRef(
2889
2889
  (e, t) => {
2890
- const { forceMount: n, ...r } = e, o = Vo(jo, e.__scopeCollapsible);
2890
+ const { forceMount: n, ...r } = e, o = jo(Vo, e.__scopeCollapsible);
2891
2891
  return /* @__PURE__ */ c(_e, { present: n || o.open, children: ({ present: s }) => /* @__PURE__ */ c(Dp, { ...r, ref: t, present: s }) });
2892
2892
  }
2893
2893
  );
2894
- Mp.displayName = jo;
2894
+ Mp.displayName = Vo;
2895
2895
  var Dp = u.forwardRef((e, t) => {
2896
- const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = Vo(jo, n), [i, l] = u.useState(r), f = u.useRef(null), d = ie(t, f), p = u.useRef(0), m = p.current, v = u.useRef(0), g = v.current, h = a.open || i, b = u.useRef(h), w = u.useRef(void 0);
2896
+ const { __scopeCollapsible: n, present: r, children: o, ...s } = e, a = jo(Vo, n), [i, l] = u.useState(r), f = u.useRef(null), d = ie(t, f), p = u.useRef(0), m = p.current, v = u.useRef(0), g = v.current, h = a.open || i, b = u.useRef(h), w = u.useRef(void 0);
2897
2897
  return u.useEffect(() => {
2898
2898
  const x = requestAnimationFrame(() => b.current = !1);
2899
2899
  return () => cancelAnimationFrame(x);
@@ -3044,7 +3044,7 @@ function $p({
3044
3044
  default:
3045
3045
  return "text-foreground";
3046
3046
  }
3047
- }, [$]), M = gt(() => Bp(e.content), [e.content]), H = gt(() => Vp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = Kp(M, n ? r : 0), T = async () => {
3047
+ }, [$]), M = gt(() => Bp(e.content), [e.content]), H = gt(() => jp(e.content), [e.content]), O = gt(() => e.content.filter((W) => W.type === "image_url"), [e.content]), G = gt(() => e.content.filter((W) => W.type === "file"), [e.content]), D = Kp(M, n ? r : 0), T = async () => {
3048
3048
  try {
3049
3049
  const W = K ? Pt(e.content) : M;
3050
3050
  await navigator.clipboard.writeText(W), y(!0), setTimeout(() => y(!1), 2e3), w == null || w(W);
@@ -3079,7 +3079,7 @@ function $p({
3079
3079
  default:
3080
3080
  return W;
3081
3081
  }
3082
- }, V = () => {
3082
+ }, j = () => {
3083
3083
  const W = A(
3084
3084
  "rounded-lg px-4 py-3 relative transition-all duration-200 min-w-0 max-w-full break-words",
3085
3085
  I && "px-3 py-2 text-sm"
@@ -3115,40 +3115,40 @@ function $p({
3115
3115
  }
3116
3116
  }, pe = () => {
3117
3117
  if (e.model === "reflection") {
3118
- const j = M.trim(), X = Zr(j);
3118
+ const V = M.trim(), X = Zr(V);
3119
3119
  if (X && typeof X == "object")
3120
3120
  return /* @__PURE__ */ c(Gp, { data: X });
3121
3121
  }
3122
3122
  if (K && H.name === "get_issues") {
3123
- const j = e.content.find((me) => me.type === "tool_result"), X = (j == null ? void 0 : j.output) ?? Pt(e.content), te = hi(X);
3123
+ const V = e.content.find((me) => me.type === "tool_result"), X = (V == null ? void 0 : V.output) ?? Pt(e.content), te = hi(X);
3124
3124
  if (te) return /* @__PURE__ */ c(qp, { issues: te });
3125
3125
  }
3126
3126
  if (K && !_) {
3127
- const j = Pt(e.content).slice(0, 80).replace(/\s+/g, " ");
3127
+ const V = Pt(e.content).slice(0, 80).replace(/\s+/g, " ");
3128
3128
  return /* @__PURE__ */ c("div", { className: A("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", I && "text-[10px]"), children: /* @__PURE__ */ E("span", { className: "truncate max-w-full text-current", children: [
3129
- j,
3130
- j.length >= 80 ? "…" : ""
3129
+ V,
3130
+ V.length >= 80 ? "…" : ""
3131
3131
  ] }) });
3132
3132
  }
3133
3133
  if (K && f) {
3134
- const j = Pt(e.content), X = j.length > d;
3134
+ const V = Pt(e.content), X = V.length > d;
3135
3135
  return /* @__PURE__ */ c(Js, { open: C, onOpenChange: R, children: /* @__PURE__ */ E("div", { className: "font-mono text-sm text-current", children: [
3136
- /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X && !C ? j.substring(0, d) + "..." : j }),
3136
+ /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X && !C ? V.substring(0, d) + "..." : V }),
3137
3137
  X && /* @__PURE__ */ c(Zs, { asChild: !0, children: /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: C ? /* @__PURE__ */ E(Ae, { children: [
3138
3138
  /* @__PURE__ */ c(Zt, { className: "h-3 w-3 mr-1" }),
3139
3139
  "Show less"
3140
3140
  ] }) : /* @__PURE__ */ E(Ae, { children: [
3141
3141
  /* @__PURE__ */ c(Mt, { className: "h-3 w-3 mr-1" }),
3142
3142
  "Show more (",
3143
- j.length - d,
3143
+ V.length - d,
3144
3144
  " chars)"
3145
3145
  ] }) }) })
3146
3146
  ] }) });
3147
3147
  }
3148
3148
  if (K && _ && !f) {
3149
- const j = Xp(e.content);
3150
- if (j && Up(j))
3151
- return /* @__PURE__ */ c(_n, { content: j.trim() });
3149
+ const V = Xp(e.content);
3150
+ if (V && Up(V))
3151
+ return /* @__PURE__ */ c(_n, { content: V.trim() });
3152
3152
  const X = Pt(e.content);
3153
3153
  return /* @__PURE__ */ c("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c("pre", { className: A("whitespace-pre-wrap break-words text-current", I && "text-xs"), children: X }) });
3154
3154
  }
@@ -3156,13 +3156,13 @@ function $p({
3156
3156
  return /* @__PURE__ */ E("div", { children: [
3157
3157
  n ? /* @__PURE__ */ E("div", { className: "relative", children: [
3158
3158
  (() => {
3159
- const j = Zr(D);
3160
- return j !== null ? /* @__PURE__ */ c(Qs, { data: j }) : /* @__PURE__ */ c(_n, { content: zp(Hp(D)) });
3159
+ const V = Zr(D);
3160
+ return V !== null ? /* @__PURE__ */ c(Qs, { data: V }) : /* @__PURE__ */ c(_n, { content: zp(Hp(D)) });
3161
3161
  })(),
3162
3162
  /* @__PURE__ */ c(Fp, { className: A(B, I ? "text-xs" : "text-sm") })
3163
3163
  ] }) : (() => {
3164
- const j = Zr(M.trim());
3165
- if (j !== null) return /* @__PURE__ */ c(Qs, { data: j });
3164
+ const V = Zr(M.trim());
3165
+ if (V !== null) return /* @__PURE__ */ c(Qs, { data: V });
3166
3166
  if ($ === "user" && p) {
3167
3167
  const X = M.trim();
3168
3168
  if (X.length > m)
@@ -3192,15 +3192,15 @@ function $p({
3192
3192
  }
3193
3193
  return /* @__PURE__ */ c(_n, { content: M.trim() });
3194
3194
  })(),
3195
- W && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: O.map((j, X) => /* @__PURE__ */ E("div", { className: "relative border rounded overflow-hidden", children: [
3196
- /* @__PURE__ */ c("img", { src: j.url, alt: j.alt ?? "image", className: "w-full h-auto" }),
3195
+ W && /* @__PURE__ */ c("div", { className: "mt-2 grid grid-cols-2 gap-2", children: O.map((V, X) => /* @__PURE__ */ E("div", { className: "relative border rounded overflow-hidden", children: [
3196
+ /* @__PURE__ */ c("img", { src: V.url, alt: V.alt ?? "image", className: "w-full h-auto" }),
3197
3197
  /* @__PURE__ */ E("div", { className: "absolute top-1 right-1 bg-background/70 rounded px-1 py-0.5 text-[10px] flex items-center gap-1", children: [
3198
3198
  /* @__PURE__ */ c(od, { className: "h-3 w-3" }),
3199
3199
  /* @__PURE__ */ c("span", { children: "image" })
3200
3200
  ] })
3201
3201
  ] }, X)) }),
3202
- ae && /* @__PURE__ */ c("div", { className: "mt-2 flex flex-wrap gap-2", children: G.map((j, X) => {
3203
- const te = j, me = te.name || "file";
3202
+ ae && /* @__PURE__ */ c("div", { className: "mt-2 flex flex-wrap gap-2", children: G.map((V, X) => {
3203
+ const te = V, me = te.name || "file";
3204
3204
  return /* @__PURE__ */ E(
3205
3205
  "a",
3206
3206
  {
@@ -3224,8 +3224,8 @@ function $p({
3224
3224
  );
3225
3225
  }) })
3226
3226
  ] });
3227
- }, z = gt(() => jp(e), [e]);
3228
- return /* @__PURE__ */ c("div", { className: A(F(), v.container), children: /* @__PURE__ */ E("div", { className: A(V(), v.content), children: [
3227
+ }, z = gt(() => Vp(e), [e]);
3228
+ return /* @__PURE__ */ c("div", { className: A(F(), v.container), children: /* @__PURE__ */ E("div", { className: A(j(), v.content), children: [
3229
3229
  (a || i || K) && /* @__PURE__ */ E(
3230
3230
  "div",
3231
3231
  {
@@ -3467,9 +3467,11 @@ function er(e) {
3467
3467
  if (typeof e == "string")
3468
3468
  return e.length > 2e3 ? e.slice(0, 2e3) + "... [truncated]" : e;
3469
3469
  if (e && typeof e == "object") {
3470
- if (Array.isArray(e)) return e.map(er);
3471
- if (pi(e))
3472
- return;
3470
+ if (Array.isArray(e)) {
3471
+ const n = e.map(er).filter((r) => r !== void 0);
3472
+ return n.length ? n : void 0;
3473
+ }
3474
+ if (pi(e)) return;
3473
3475
  const t = {};
3474
3476
  for (const n of Object.keys(e)) {
3475
3477
  const r = e[n];
@@ -3480,7 +3482,7 @@ function er(e) {
3480
3482
  o !== void 0 && (t[n] = o);
3481
3483
  }
3482
3484
  }
3483
- return t;
3485
+ return Object.keys(t).length ? t : void 0;
3484
3486
  }
3485
3487
  return e;
3486
3488
  }
@@ -3489,19 +3491,19 @@ function nn(e) {
3489
3491
  if (pi(e)) return "";
3490
3492
  try {
3491
3493
  const t = er(e);
3492
- return JSON.stringify(t, null, 2) ?? "";
3494
+ return t === void 0 ? "" : typeof t == "string" ? t : JSON.stringify(t, null, 2);
3493
3495
  } catch {
3494
3496
  return "";
3495
3497
  }
3496
3498
  }
3497
- function Vp(e) {
3499
+ function jp(e) {
3498
3500
  const t = e.find((r) => r.type === "tool_call"), n = e.find((r) => r.type === "tool_result");
3499
3501
  return {
3500
3502
  name: t == null ? void 0 : t.name,
3501
3503
  toolCallId: (n == null ? void 0 : n.toolCallId) ?? (t == null ? void 0 : t.id)
3502
3504
  };
3503
3505
  }
3504
- function jp(e) {
3506
+ function Vp(e) {
3505
3507
  return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
3506
3508
  }
3507
3509
  function Kp(e, t) {
@@ -3645,7 +3647,7 @@ function Zp(e) {
3645
3647
  return typeof e == "string" ? t = e : typeof e == "object" && e !== null ? t = JSON.stringify(e) : t = String(e), Jp(t), Yp(t);
3646
3648
  }
3647
3649
  function Go(e) {
3648
- const t = e + "CollectionProvider", [n, r] = je(t), [o, s] = n(
3650
+ const t = e + "CollectionProvider", [n, r] = Ve(t), [o, s] = n(
3649
3651
  t,
3650
3652
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
3651
3653
  ), a = (h) => {
@@ -3986,7 +3988,7 @@ function rt(e, t) {
3986
3988
  function ot(e) {
3987
3989
  return e.split("-")[0];
3988
3990
  }
3989
- function jt(e) {
3991
+ function Vt(e) {
3990
3992
  return e.split("-")[1];
3991
3993
  }
3992
3994
  function Xo(e) {
@@ -4004,7 +4006,7 @@ function Jo(e) {
4004
4006
  }
4005
4007
  function wh(e, t, n) {
4006
4008
  n === void 0 && (n = !1);
4007
- const r = jt(e), o = Jo(e), s = Yo(o);
4009
+ const r = Vt(e), o = Jo(e), s = Yo(o);
4008
4010
  let a = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
4009
4011
  return t.reference[s] > t.floating[s] && (a = nr(a)), [a, nr(a)];
4010
4012
  }
@@ -4029,7 +4031,7 @@ function Ch(e, t, n) {
4029
4031
  }
4030
4032
  }
4031
4033
  function Eh(e, t, n, r) {
4032
- const o = jt(e);
4034
+ const o = Vt(e);
4033
4035
  let s = Ch(ot(e), n === "start", r);
4034
4036
  return o && (s = s.map((a) => a + "-" + o), t && (s = s.concat(s.map(So)))), s;
4035
4037
  }
@@ -4109,7 +4111,7 @@ function la(e, t, n) {
4109
4111
  y: r.y
4110
4112
  };
4111
4113
  }
4112
- switch (jt(t)) {
4114
+ switch (Vt(t)) {
4113
4115
  case "start":
4114
4116
  v[a] -= m * (n && f ? -1 : 1);
4115
4117
  break;
@@ -4249,7 +4251,7 @@ const Th = (e) => ({
4249
4251
  }, v = Jo(o), g = Yo(v), h = await a.getDimensions(f), b = v === "y", w = b ? "top" : "left", x = b ? "bottom" : "right", y = b ? "clientHeight" : "clientWidth", C = s.reference[g] + s.reference[v] - m[v] - s.floating[g], R = m[v] - s.reference[v], _ = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(f));
4250
4252
  let N = _ ? _[y] : 0;
4251
4253
  (!N || !await (a.isElement == null ? void 0 : a.isElement(_))) && (N = i.floating[y] || s.floating[g]);
4252
- const k = C / 2 - R / 2, L = N / 2 - h[g] / 2 - 1, I = dt(p[w], L), $ = dt(p[x], L), K = I, B = N - h[g] - $, M = N / 2 - h[g] / 2 + k, H = xo(K, M, B), O = !l.arrow && jt(o) != null && M !== H && s.reference[g] / 2 - (M < K ? I : $) - h[g] / 2 < 0, G = O ? M < K ? M - K : M - B : 0;
4254
+ const k = C / 2 - R / 2, L = N / 2 - h[g] / 2 - 1, I = dt(p[w], L), $ = dt(p[x], L), K = I, B = N - h[g] - $, M = N / 2 - h[g] / 2 + k, H = xo(K, M, B), O = !l.arrow && Vt(o) != null && M !== H && s.reference[g] / 2 - (M < K ? I : $) - h[g] / 2 < 0, G = O ? M < K ? M - K : M - B : 0;
4253
4255
  return {
4254
4256
  [v]: m[v] + G,
4255
4257
  data: {
@@ -4402,7 +4404,7 @@ async function Ih(e, t) {
4402
4404
  placement: n,
4403
4405
  platform: r,
4404
4406
  elements: o
4405
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = ot(n), i = jt(n), l = Ye(n) === "y", f = wi.has(a) ? -1 : 1, d = s && l ? -1 : 1, p = rt(t, e);
4407
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), a = ot(n), i = Vt(n), l = Ye(n) === "y", f = wi.has(a) ? -1 : 1, d = s && l ? -1 : 1, p = rt(t, e);
4406
4408
  let {
4407
4409
  mainAxis: m,
4408
4410
  crossAxis: v,
@@ -4559,7 +4561,7 @@ const _h = function(e) {
4559
4561
  apply: l = () => {
4560
4562
  },
4561
4563
  ...f
4562
- } = rt(e, t), d = await sn(t, f), p = ot(o), m = jt(o), v = Ye(o) === "y", {
4564
+ } = rt(e, t), d = await sn(t, f), p = ot(o), m = Vt(o), v = Ye(o) === "y", {
4563
4565
  width: g,
4564
4566
  height: h
4565
4567
  } = s.floating;
@@ -4727,15 +4729,15 @@ function Dt(e) {
4727
4729
  y: i
4728
4730
  };
4729
4731
  }
4730
- const Vh = /* @__PURE__ */ Je(0);
4732
+ const jh = /* @__PURE__ */ Je(0);
4731
4733
  function Ci(e) {
4732
4734
  const t = Me(e);
4733
- return !Qo() || !t.visualViewport ? Vh : {
4735
+ return !Qo() || !t.visualViewport ? jh : {
4734
4736
  x: t.visualViewport.offsetLeft,
4735
4737
  y: t.visualViewport.offsetTop
4736
4738
  };
4737
4739
  }
4738
- function jh(e, t, n) {
4740
+ function Vh(e, t, n) {
4739
4741
  return t === void 0 && (t = !1), !n || t && n !== Me(e) ? !1 : t;
4740
4742
  }
4741
4743
  function xt(e, t, n, r) {
@@ -4743,7 +4745,7 @@ function xt(e, t, n, r) {
4743
4745
  const o = e.getBoundingClientRect(), s = es(e);
4744
4746
  let a = Je(1);
4745
4747
  t && (r ? ze(r) && (a = Dt(r)) : a = Dt(e));
4746
- const i = jh(s, n, r) ? Ci(s) : Je(0);
4748
+ const i = Vh(s, n, r) ? Ci(s) : Je(0);
4747
4749
  let l = (o.left + i.x) / a.x, f = (o.top + i.y) / a.y, d = o.width / a.x, p = o.height / a.y;
4748
4750
  if (s) {
4749
4751
  const m = Me(s), v = r && ze(r) ? Me(r) : r;
@@ -5314,7 +5316,7 @@ function Ii(e) {
5314
5316
  n(void 0);
5315
5317
  }, [e]), t;
5316
5318
  }
5317
- var ts = "Popper", [_i, Gt] = je(ts), [Tm, Oi] = _i(ts), ki = (e) => {
5319
+ var ts = "Popper", [_i, Gt] = Ve(ts), [Tm, Oi] = _i(ts), ki = (e) => {
5318
5320
  const { __scopePopper: t, children: n } = e, [r, o] = u.useState(null);
5319
5321
  return /* @__PURE__ */ c(Tm, { scope: t, anchor: r, onAnchorChange: o, children: n });
5320
5322
  };
@@ -5331,7 +5333,7 @@ var Mi = "PopperAnchor", Di = u.forwardRef(
5331
5333
  Di.displayName = Mi;
5332
5334
  var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
5333
5335
  (e, t) => {
5334
- var z, W, ae, j, X, te;
5336
+ var z, W, ae, V, X, te;
5335
5337
  const {
5336
5338
  __scopePopper: n,
5337
5339
  side: r = "bottom",
@@ -5386,7 +5388,7 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
5386
5388
  we(() => {
5387
5389
  G && (q == null || q());
5388
5390
  }, [G, q]);
5389
- const se = (z = D.arrow) == null ? void 0 : z.x, F = (W = D.arrow) == null ? void 0 : W.y, V = ((ae = D.arrow) == null ? void 0 : ae.centerOffset) !== 0, [ce, pe] = u.useState();
5391
+ const se = (z = D.arrow) == null ? void 0 : z.x, F = (W = D.arrow) == null ? void 0 : W.y, j = ((ae = D.arrow) == null ? void 0 : ae.centerOffset) !== 0, [ce, pe] = u.useState();
5390
5392
  return we(() => {
5391
5393
  w && pe(window.getComputedStyle(w).zIndex);
5392
5394
  }, [w]), /* @__PURE__ */ c(
@@ -5401,7 +5403,7 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
5401
5403
  minWidth: "max-content",
5402
5404
  zIndex: ce,
5403
5405
  "--radix-popper-transform-origin": [
5404
- (j = D.transformOrigin) == null ? void 0 : j.x,
5406
+ (V = D.transformOrigin) == null ? void 0 : V.x,
5405
5407
  (X = D.transformOrigin) == null ? void 0 : X.y
5406
5408
  ].join(" "),
5407
5409
  // hide the content if using the hide middleware and should be hidden
@@ -5421,7 +5423,7 @@ var ns = "PopperContent", [Am, Pm] = _i(ns), Li = u.forwardRef(
5421
5423
  onArrowChange: R,
5422
5424
  arrowX: se,
5423
5425
  arrowY: F,
5424
- shouldHideArrow: V,
5426
+ shouldHideArrow: j,
5425
5427
  children: /* @__PURE__ */ c(
5426
5428
  ee.div,
5427
5429
  {
@@ -5520,7 +5522,7 @@ var rs = ki, os = Di, ss = Li, as = $i, km = "Portal", Er = u.forwardRef((e, t)
5520
5522
  return a ? Rd.createPortal(/* @__PURE__ */ c(ee.div, { ...r, ref: t }), a) : null;
5521
5523
  });
5522
5524
  Er.displayName = km;
5523
- var oo = "rovingFocusGroup.onEntryFocus", Mm = { bubbles: !1, cancelable: !0 }, wn = "RovingFocusGroup", [Eo, Ui, Dm] = Go(wn), [Lm, Hi] = je(
5525
+ var oo = "rovingFocusGroup.onEntryFocus", Mm = { bubbles: !1, cancelable: !0 }, wn = "RovingFocusGroup", [Eo, Ui, Dm] = Go(wn), [Lm, Hi] = Ve(
5524
5526
  wn,
5525
5527
  [Dm]
5526
5528
  ), [Fm, $m] = Lm(wn), zi = u.forwardRef(
@@ -5589,7 +5591,7 @@ var Bm = u.forwardRef((e, t) => {
5589
5591
  const $ = C().filter((O) => O.focusable), K = $.find((O) => O.active), B = $.find((O) => O.id === h), H = [K, B, ...$].filter(
5590
5592
  Boolean
5591
5593
  ).map((O) => O.ref.current);
5592
- ji(H, d);
5594
+ Vi(H, d);
5593
5595
  }
5594
5596
  }
5595
5597
  R.current = !1;
@@ -5599,7 +5601,7 @@ var Bm = u.forwardRef((e, t) => {
5599
5601
  )
5600
5602
  }
5601
5603
  );
5602
- }), Wi = "RovingFocusGroupItem", Vi = u.forwardRef(
5604
+ }), Wi = "RovingFocusGroupItem", ji = u.forwardRef(
5603
5605
  (e, t) => {
5604
5606
  const {
5605
5607
  __scopeRovingFocusGroup: n,
@@ -5647,7 +5649,7 @@ var Bm = u.forwardRef((e, t) => {
5647
5649
  const C = y.indexOf(b.currentTarget);
5648
5650
  y = d.loop ? Wm(y, C + 1) : y.slice(C + 1);
5649
5651
  }
5650
- setTimeout(() => ji(y));
5652
+ setTimeout(() => Vi(y));
5651
5653
  }
5652
5654
  }),
5653
5655
  children: typeof a == "function" ? a({ isCurrentTabStop: p, hasTabStop: h != null }) : a
@@ -5657,7 +5659,7 @@ var Bm = u.forwardRef((e, t) => {
5657
5659
  );
5658
5660
  }
5659
5661
  );
5660
- Vi.displayName = Wi;
5662
+ ji.displayName = Wi;
5661
5663
  var Um = {
5662
5664
  ArrowLeft: "prev",
5663
5665
  ArrowUp: "prev",
@@ -5676,7 +5678,7 @@ function zm(e, t, n) {
5676
5678
  if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
5677
5679
  return Um[r];
5678
5680
  }
5679
- function ji(e, t = !1) {
5681
+ function Vi(e, t = !1) {
5680
5682
  const n = document.activeElement;
5681
5683
  for (const r of e)
5682
5684
  if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
@@ -5684,7 +5686,7 @@ function ji(e, t = !1) {
5684
5686
  function Wm(e, t) {
5685
5687
  return e.map((n, r) => e[(t + r) % e.length]);
5686
5688
  }
5687
- var Vm = zi, jm = Vi, Km = function(e) {
5689
+ var jm = zi, Vm = ji, Km = function(e) {
5688
5690
  if (typeof document > "u")
5689
5691
  return null;
5690
5692
  var t = Array.isArray(e) ? e[0] : e;
@@ -5754,7 +5756,7 @@ function Xm(e, t, n) {
5754
5756
  (s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
5755
5757
  return e.concat(s || Array.prototype.slice.call(t));
5756
5758
  }
5757
- var Wn = "right-scroll-bar-position", Vn = "width-before-scroll-bar", Ym = "with-scroll-bars-hidden", Jm = "--removed-body-scroll-bar-size";
5759
+ var Wn = "right-scroll-bar-position", jn = "width-before-scroll-bar", Ym = "with-scroll-bars-hidden", Jm = "--removed-body-scroll-bar-size";
5758
5760
  function ao(e, t) {
5759
5761
  return typeof e == "function" ? e(t) : e && (e.current = t), e;
5760
5762
  }
@@ -5895,7 +5897,7 @@ Nr.defaultProps = {
5895
5897
  inert: !1
5896
5898
  };
5897
5899
  Nr.classNames = {
5898
- fullWidth: Vn,
5900
+ fullWidth: jn,
5899
5901
  zeroRight: Wn
5900
5902
  };
5901
5903
  var sg = function() {
@@ -5990,7 +5992,7 @@ var lg = function() {
5990
5992
  right: `).concat(i, "px ").concat(r, `;
5991
5993
  }
5992
5994
 
5993
- .`).concat(Vn, ` {
5995
+ .`).concat(jn, ` {
5994
5996
  margin-right: `).concat(i, "px ").concat(r, `;
5995
5997
  }
5996
5998
 
@@ -5998,7 +6000,7 @@ var lg = function() {
5998
6000
  right: 0 `).concat(r, `;
5999
6001
  }
6000
6002
 
6001
- .`).concat(Vn, " .").concat(Vn, ` {
6003
+ .`).concat(jn, " .").concat(jn, ` {
6002
6004
  margin-right: 0 `).concat(r, `;
6003
6005
  }
6004
6006
 
@@ -6210,7 +6212,7 @@ var Ro = ["Enter", " "], _g = ["ArrowDown", "PageUp", "Home"], ec = ["ArrowUp",
6210
6212
  }, Mg = {
6211
6213
  ltr: ["ArrowLeft"],
6212
6214
  rtl: ["ArrowRight"]
6213
- }, yn = "Menu", [cn, Dg, Lg] = Go(yn), [Nt, tc] = je(yn, [
6215
+ }, yn = "Menu", [cn, Dg, Lg] = Go(yn), [Nt, tc] = Ve(yn, [
6214
6216
  Lg,
6215
6217
  Gt,
6216
6218
  Hi
@@ -6301,7 +6303,7 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
6301
6303
  onDismiss: () => n.onOpenChange(!1)
6302
6304
  }
6303
6305
  );
6304
- }), Vg = Ft("MenuContent.ScrollLock"), ds = u.forwardRef(
6306
+ }), jg = Ft("MenuContent.ScrollLock"), ds = u.forwardRef(
6305
6307
  (e, t) => {
6306
6308
  const {
6307
6309
  __scopeMenu: n,
@@ -6318,11 +6320,11 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
6318
6320
  onDismiss: v,
6319
6321
  disableOutsideScroll: g,
6320
6322
  ...h
6321
- } = e, b = Rt(Fe, n), w = xn(Fe, n), x = Tr(n), y = nc(n), C = Dg(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), I = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Rr : u.Fragment, O = g ? { as: Vg, allowPinchZoom: !0 } : void 0, G = (T) => {
6323
+ } = e, b = Rt(Fe, n), w = xn(Fe, n), x = Tr(n), y = nc(n), C = Dg(n), [R, _] = u.useState(null), N = u.useRef(null), k = ie(t, N, b.onContentChange), L = u.useRef(0), I = u.useRef(""), $ = u.useRef(0), K = u.useRef(null), B = u.useRef("right"), M = u.useRef(0), H = g ? Rr : u.Fragment, O = g ? { as: jg, allowPinchZoom: !0 } : void 0, G = (T) => {
6322
6324
  var z, W;
6323
- const Q = I.current + T, q = C().filter((ae) => !ae.disabled), se = document.activeElement, F = (z = q.find((ae) => ae.ref.current === se)) == null ? void 0 : z.textValue, V = q.map((ae) => ae.textValue), ce = nb(V, Q, F), pe = (W = q.find((ae) => ae.textValue === ce)) == null ? void 0 : W.ref.current;
6324
- (function ae(j) {
6325
- I.current = j, window.clearTimeout(L.current), j !== "" && (L.current = window.setTimeout(() => ae(""), 1e3));
6325
+ const Q = I.current + T, q = C().filter((ae) => !ae.disabled), se = document.activeElement, F = (z = q.find((ae) => ae.ref.current === se)) == null ? void 0 : z.textValue, j = q.map((ae) => ae.textValue), ce = nb(j, Q, F), pe = (W = q.find((ae) => ae.textValue === ce)) == null ? void 0 : W.ref.current;
6326
+ (function ae(V) {
6327
+ I.current = V, window.clearTimeout(L.current), V !== "" && (L.current = window.setTimeout(() => ae(""), 1e3));
6326
6328
  })(Q), pe && setTimeout(() => pe.focus());
6327
6329
  };
6328
6330
  u.useEffect(() => () => window.clearTimeout(L.current), []), qo();
@@ -6379,7 +6381,7 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
6379
6381
  onInteractOutside: m,
6380
6382
  onDismiss: v,
6381
6383
  children: /* @__PURE__ */ c(
6382
- Vm,
6384
+ jm,
6383
6385
  {
6384
6386
  asChild: !0,
6385
6387
  ...y,
@@ -6407,8 +6409,8 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
6407
6409
  onKeyDown: U(h.onKeyDown, (T) => {
6408
6410
  const q = T.target.closest("[data-radix-menu-content]") === T.currentTarget, se = T.ctrlKey || T.altKey || T.metaKey, F = T.key.length === 1;
6409
6411
  q && (T.key === "Tab" && T.preventDefault(), !se && F && G(T.key));
6410
- const V = N.current;
6411
- if (T.target !== V || !Og.includes(T.key)) return;
6412
+ const j = N.current;
6413
+ if (T.target !== j || !Og.includes(T.key)) return;
6412
6414
  T.preventDefault();
6413
6415
  const pe = C().filter((z) => !z.disabled).map((z) => z.ref.current);
6414
6416
  ec.includes(T.key) && pe.reverse(), eb(pe);
@@ -6439,13 +6441,13 @@ var Fe = "MenuContent", [Hg, us] = Nt(Fe), ac = u.forwardRef(
6439
6441
  }
6440
6442
  );
6441
6443
  ac.displayName = Fe;
6442
- var jg = "MenuGroup", fs = u.forwardRef(
6444
+ var Vg = "MenuGroup", fs = u.forwardRef(
6443
6445
  (e, t) => {
6444
6446
  const { __scopeMenu: n, ...r } = e;
6445
6447
  return /* @__PURE__ */ c(ee.div, { role: "group", ...r, ref: t });
6446
6448
  }
6447
6449
  );
6448
- fs.displayName = jg;
6450
+ fs.displayName = Vg;
6449
6451
  var Kg = "MenuLabel", ic = u.forwardRef(
6450
6452
  (e, t) => {
6451
6453
  const { __scopeMenu: n, ...r } = e;
@@ -6498,7 +6500,7 @@ var cc = u.forwardRef(
6498
6500
  scope: n,
6499
6501
  disabled: r,
6500
6502
  textValue: o ?? m,
6501
- children: /* @__PURE__ */ c(jm, { asChild: !0, ...i, focusable: !r, children: /* @__PURE__ */ c(
6503
+ children: /* @__PURE__ */ c(Vm, { asChild: !0, ...i, focusable: !r, children: /* @__PURE__ */ c(
6502
6504
  ee.div,
6503
6505
  {
6504
6506
  role: "menuitem",
@@ -6775,7 +6777,7 @@ function ob(e, t) {
6775
6777
  function ln(e) {
6776
6778
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
6777
6779
  }
6778
- var sb = rc, ab = cs, ib = sc, cb = ac, lb = fs, ub = ic, db = Ar, fb = lc, pb = dc, hb = pc, mb = mc, gb = gc, bb = bc, vb = wc, wb = xc, Pr = "DropdownMenu", [yb, Wy] = je(
6780
+ var sb = rc, ab = cs, ib = sc, cb = ac, lb = fs, ub = ic, db = Ar, fb = lc, pb = dc, hb = pc, mb = mc, gb = gc, bb = bc, vb = wc, wb = xc, Pr = "DropdownMenu", [yb, Wy] = Ve(
6779
6781
  Pr,
6780
6782
  [tc]
6781
6783
  ), Ee = tc(), [xb, Cc] = yb(Pr), Ec = (e) => {
@@ -6951,9 +6953,9 @@ var Lb = "DropdownMenuSubContent", Fc = u.forwardRef((e, t) => {
6951
6953
  );
6952
6954
  });
6953
6955
  Fc.displayName = Lb;
6954
- var Fb = Ec, $b = Rc, Bb = Tc, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = kc, Wc = Mc, Vc = Dc, jc = Lc, Kc = Fc;
6956
+ var Fb = Ec, $b = Rc, Bb = Tc, $c = Pc, Bc = Ic, Uc = _c, Hc = Oc, zc = kc, Wc = Mc, jc = Dc, Vc = Lc, Kc = Fc;
6955
6957
  const Ub = Fb, Hb = $b, zb = u.forwardRef(({ className: e, inset: t, children: n, ...r }, o) => /* @__PURE__ */ E(
6956
- jc,
6958
+ Vc,
6957
6959
  {
6958
6960
  ref: o,
6959
6961
  className: A(
@@ -6968,7 +6970,7 @@ const Ub = Fb, Hb = $b, zb = u.forwardRef(({ className: e, inset: t, children: n
6968
6970
  ]
6969
6971
  }
6970
6972
  ));
6971
- zb.displayName = jc.displayName;
6973
+ zb.displayName = Vc.displayName;
6972
6974
  const Wb = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
6973
6975
  Kc,
6974
6976
  {
@@ -7007,7 +7009,7 @@ const To = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
7007
7009
  }
7008
7010
  ));
7009
7011
  To.displayName = Uc.displayName;
7010
- const Vb = u.forwardRef(({ className: e, children: t, checked: n, ...r }, o) => /* @__PURE__ */ E(
7012
+ const jb = u.forwardRef(({ className: e, children: t, checked: n, ...r }, o) => /* @__PURE__ */ E(
7011
7013
  Hc,
7012
7014
  {
7013
7015
  ref: o,
@@ -7023,8 +7025,8 @@ const Vb = u.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
7023
7025
  ]
7024
7026
  }
7025
7027
  ));
7026
- Vb.displayName = Hc.displayName;
7027
- const jb = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
7028
+ jb.displayName = Hc.displayName;
7029
+ const Vb = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
7028
7030
  zc,
7029
7031
  {
7030
7032
  ref: r,
@@ -7039,7 +7041,7 @@ const jb = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
7039
7041
  ]
7040
7042
  }
7041
7043
  ));
7042
- jb.displayName = zc.displayName;
7044
+ Vb.displayName = zc.displayName;
7043
7045
  const Kb = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */ c(
7044
7046
  Bc,
7045
7047
  {
@@ -7054,15 +7056,15 @@ const Kb = u.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
7054
7056
  ));
7055
7057
  Kb.displayName = Bc.displayName;
7056
7058
  const Gb = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
7057
- Vc,
7059
+ jc,
7058
7060
  {
7059
7061
  ref: n,
7060
7062
  className: A("-mx-1 my-1 h-px bg-muted", e),
7061
7063
  ...t
7062
7064
  }
7063
7065
  ));
7064
- Gb.displayName = Vc.displayName;
7065
- function jn({
7066
+ Gb.displayName = jc.displayName;
7067
+ function Vn({
7066
7068
  className: e = "",
7067
7069
  placeholder: t = "Type your message...",
7068
7070
  autoFocus: n = !0,
@@ -7099,7 +7101,7 @@ function jn({
7099
7101
  } catch (P) {
7100
7102
  console.log("ChatInterface debug - localStorage not available", P);
7101
7103
  }
7102
- const [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, se] = re(null), [F, V] = re(null), [ce, pe] = re(!1), [z, W] = re(null), [ae, j] = re([]), [X, te] = re(null), me = Te(null), de = Te(null), Z = Te(null), Y = Te(null), he = Te(null), Oe = Te(!1), Ce = Te(!0), Xt = Te(0), st = Te(null), [Tt, Hr] = re("desktop");
7104
+ const [$, K] = re(""), [B, M] = re(null), [H, O] = re(null), [G, D] = re([]), [T, Q] = re(!1), [q, se] = re(null), [F, j] = re(null), [ce, pe] = re(!1), [z, W] = re(null), [ae, V] = re([]), [X, te] = re(null), me = Te(null), de = Te(null), Z = Te(null), Y = Te(null), he = Te(null), Oe = Te(!1), Ce = Te(!0), Xt = Te(0), st = Te(null), [Tt, Hr] = re("desktop");
7103
7105
  ge(() => {
7104
7106
  const P = () => {
7105
7107
  const J = window.innerWidth;
@@ -7109,7 +7111,7 @@ function jn({
7109
7111
  }, []), ge(() => {
7110
7112
  let P = !1;
7111
7113
  if (!m) {
7112
- j([]), te(null), st.current = null;
7114
+ V([]), te(null), st.current = null;
7113
7115
  return;
7114
7116
  }
7115
7117
  const J = {
@@ -7120,12 +7122,12 @@ function jn({
7120
7122
  return st.current = J, C(m).then((ue) => {
7121
7123
  if (console.log("ChatInterface debug - listCheckpoints response:", ue), P) return;
7122
7124
  const De = ((ue == null ? void 0 : ue.checkpoints) ?? []).slice().sort((at, Tn) => new Date(Tn.createdAt).getTime() - new Date(at.createdAt).getTime());
7123
- console.log("ChatInterface debug - computed checkpoints:", De), j(De), te((at) => {
7125
+ console.log("ChatInterface debug - computed checkpoints:", De), V(De), te((at) => {
7124
7126
  var Tn;
7125
7127
  return at ?? ((Tn = De[0]) == null ? void 0 : Tn.checkpointId) ?? null;
7126
7128
  });
7127
7129
  }).catch(() => {
7128
- P || (j([]), st.current = null);
7130
+ P || (V([]), st.current = null);
7129
7131
  }), () => {
7130
7132
  P = !0;
7131
7133
  };
@@ -7232,10 +7234,10 @@ function jn({
7232
7234
  }, xe = (P) => D((J) => J.filter((le, ue) => P !== ue)), Ne = async (P) => {
7233
7235
  const J = (P.target.files || [])[0];
7234
7236
  if (J) {
7235
- se(null), V(null), Q(!0);
7237
+ se(null), j(null), Q(!0);
7236
7238
  try {
7237
7239
  const le = await I.uploadExcel(J), ue = le.sheets.map((at) => `${at.sheetName} -> ${at.tableName}`).join(", "), De = ue ? `Uploaded ${J.name} (${le.sheets.length} sheet${le.sheets.length === 1 ? "" : "s"}: ${ue})` : `Uploaded ${J.name}`;
7238
- V(De), d == null || d({ file: J, response: le });
7240
+ j(De), d == null || d({ file: J, response: le });
7239
7241
  } catch (le) {
7240
7242
  const ue = le instanceof Error ? le.message : "Failed to upload Excel file";
7241
7243
  console.error("Excel upload failed", le), se(ue), p == null || p(ue);
@@ -7255,7 +7257,7 @@ function jn({
7255
7257
  }
7256
7258
  await R(P), te(P);
7257
7259
  }
7258
- }, Nn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${l.container || ""}`, Rn = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-y-auto overflow-x-auto overscroll-contain break-words break-anywhere p-4 space-y-4 bg-transparent ${l.messagesArea || ""}`, Vr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${l.inputArea || ""}`;
7260
+ }, Nn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${l.container || ""}`, Rn = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-y-auto overflow-x-auto overscroll-contain break-words break-anywhere p-4 space-y-4 bg-transparent ${l.messagesArea || ""}`, jr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${l.inputArea || ""}`;
7259
7261
  return /* @__PURE__ */ E("div", { className: Nn, children: [
7260
7262
  !!b && !ce && /* @__PURE__ */ E("div", { className: "flex-shrink-0 bg-red-50 border border-red-200 text-red-800 px-4 py-2 text-sm flex items-center justify-between", children: [
7261
7263
  /* @__PURE__ */ c("span", { children: b }),
@@ -7329,7 +7331,7 @@ function jn({
7329
7331
  ]
7330
7332
  }
7331
7333
  ),
7332
- /* @__PURE__ */ E("div", { className: Vr, children: [
7334
+ /* @__PURE__ */ E("div", { className: jr, children: [
7333
7335
  B && /* @__PURE__ */ c("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
7334
7336
  /* @__PURE__ */ E("div", { className: "flex items-center gap-2", children: [
7335
7337
  /* @__PURE__ */ c(ka, { size: 16, className: "text-blue-600" }),
@@ -7501,7 +7503,7 @@ function Ao(e, [t, n]) {
7501
7503
  function qb(e, t) {
7502
7504
  return u.useReducer((n, r) => t[n][r] ?? n, e);
7503
7505
  }
7504
- var ms = "ScrollArea", [qc, Vy] = je(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
7506
+ var ms = "ScrollArea", [qc, jy] = Ve(ms), [Xb, $e] = qc(ms), Xc = u.forwardRef(
7505
7507
  (e, t) => {
7506
7508
  const {
7507
7509
  __scopeScrollArea: n,
@@ -8067,8 +8069,8 @@ function Po({
8067
8069
  const M = async (F) => {
8068
8070
  try {
8069
8071
  await p(F), i == null || i(F), l == null || l(F);
8070
- } catch (V) {
8071
- console.error("Failed to select thread:", V);
8072
+ } catch (j) {
8073
+ console.error("Failed to select thread:", j);
8072
8074
  }
8073
8075
  }, H = async () => {
8074
8076
  try {
@@ -8080,31 +8082,31 @@ function Po({
8080
8082
  } finally {
8081
8083
  B(!1);
8082
8084
  }
8083
- }, O = async (F, V) => {
8084
- if (V.stopPropagation(), !!confirm("Delete this thread?"))
8085
+ }, O = async (F, j) => {
8086
+ if (j.stopPropagation(), !!confirm("Delete this thread?"))
8085
8087
  try {
8086
8088
  await b(F), d == null || d(F);
8087
8089
  } catch (ce) {
8088
8090
  console.error("Failed to delete thread:", ce);
8089
8091
  }
8090
- }, G = (F, V) => {
8091
- V.stopPropagation(), L(F.threadId), $(F.title || `Thread ${F.threadId.slice(0, 8)}`);
8092
+ }, G = (F, j) => {
8093
+ j.stopPropagation(), L(F.threadId), $(F.title || `Thread ${F.threadId.slice(0, 8)}`);
8092
8094
  }, D = async (F) => {
8093
8095
  if (I.trim())
8094
8096
  try {
8095
8097
  await w(F, I.trim()), L(null), $("");
8096
- } catch (V) {
8097
- console.error("Failed to update title:", V);
8098
+ } catch (j) {
8099
+ console.error("Failed to update title:", j);
8098
8100
  }
8099
8101
  }, T = () => {
8100
8102
  L(null), $("");
8101
- }, Q = (F, V) => {
8102
- F.key === "Enter" ? D(V) : F.key === "Escape" && T();
8103
+ }, Q = (F, j) => {
8104
+ F.key === "Enter" ? D(j) : F.key === "Escape" && T();
8103
8105
  }, q = (F) => {
8104
8106
  if (!F) return "";
8105
8107
  try {
8106
- const V = new Date(F), pe = (/* @__PURE__ */ new Date()).getTime() - V.getTime(), z = Math.floor(pe / (1e3 * 60 * 60 * 24));
8107
- return z === 0 ? V.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : z === 1 ? "Yesterday" : z < 7 ? `${z} days ago` : V.toLocaleDateString();
8108
+ const j = new Date(F), pe = (/* @__PURE__ */ new Date()).getTime() - j.getTime(), z = Math.floor(pe / (1e3 * 60 * 60 * 24));
8109
+ return z === 0 ? j.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : z === 1 ? "Yesterday" : z < 7 ? `${z} days ago` : j.toLocaleDateString();
8108
8110
  } catch {
8109
8111
  return "";
8110
8112
  }
@@ -8130,15 +8132,15 @@ function Po({
8130
8132
  children: /* @__PURE__ */ c("div", { className: "p-2 space-y-1 pb-4", children: C ? /* @__PURE__ */ c("div", { className: "text-center py-8 text-slate-400", children: "Loading…" }) : x.length === 0 ? /* @__PURE__ */ E("div", { className: "text-center py-8 text-slate-400", children: [
8131
8133
  /* @__PURE__ */ c(fd, { className: "w-8 h-8 mx-auto mb-2 opacity-40 text-slate-500" }),
8132
8134
  /* @__PURE__ */ c("p", { className: "text-sm text-slate-500", children: "No conversations yet" })
8133
- ] }) : x.slice().sort((F, V) => new Date(V.updatedAt || V.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ E(
8135
+ ] }) : x.slice().sort((F, j) => new Date(j.updatedAt || j.createdAt || "").getTime() - new Date(F.updatedAt || F.createdAt || "").getTime()).map((F) => /* @__PURE__ */ E(
8134
8136
  "div",
8135
8137
  {
8136
8138
  onClick: () => M(F.threadId),
8137
8139
  className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(a ?? g) === F.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
8138
8140
  children: [
8139
8141
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between", children: [
8140
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: k === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (V) => V.stopPropagation(), children: [
8141
- /* @__PURE__ */ c(un, { value: I, onChange: (V) => $(V.target.value), onKeyDown: (V) => Q(V, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
8142
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: k === F.threadId ? /* @__PURE__ */ E("div", { className: "flex items-center gap-2", onClick: (j) => j.stopPropagation(), children: [
8143
+ /* @__PURE__ */ c(un, { value: I, onChange: (j) => $(j.target.value), onKeyDown: (j) => Q(j, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
8142
8144
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: () => D(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(Bo, { size: 12 }) }),
8143
8145
  /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: T, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c(tn, { size: 12 }) })
8144
8146
  ] }) : /* @__PURE__ */ E(Ae, { children: [
@@ -8149,13 +8151,13 @@ function Po({
8149
8151
  ] })
8150
8152
  ] }) }),
8151
8153
  /* @__PURE__ */ E("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
8152
- r && k !== F.threadId && /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: (V) => G(F, V), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(ka, { size: 12 }) }),
8154
+ r && k !== F.threadId && /* @__PURE__ */ c(fe, { variant: "ghost", size: "sm", onClick: (j) => G(F, j), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c(ka, { size: 12 }) }),
8153
8155
  n && /* @__PURE__ */ c(
8154
8156
  fe,
8155
8157
  {
8156
8158
  variant: "ghost",
8157
8159
  size: "sm",
8158
- onClick: (V) => O(F.threadId, V),
8160
+ onClick: (j) => O(F.threadId, j),
8159
8161
  className: "h-6 w-6 p-0 text-red-400 hover:text-red-300 hover:bg-red-900/20",
8160
8162
  title: "Delete thread",
8161
8163
  children: /* @__PURE__ */ c(hd, { size: 12 })
@@ -8173,7 +8175,7 @@ function Po({
8173
8175
  ] });
8174
8176
  }
8175
8177
  const ll = _a(null);
8176
- function jy({ children: e, basePath: t = "/chat" }) {
8178
+ function Vy({ children: e, basePath: t = "/chat" }) {
8177
8179
  const n = gt(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
8178
8180
  basePath: n,
8179
8181
  buildThreadPath: (o) => `${n}/${o}`,
@@ -8297,7 +8299,7 @@ const ws = u.forwardRef(
8297
8299
  )
8298
8300
  );
8299
8301
  ws.displayName = fl.displayName;
8300
- var Or = "Dialog", [pl, Xy] = je(Or), [bv, Ke] = pl(Or), hl = (e) => {
8302
+ var Or = "Dialog", [pl, Xy] = Ve(Or), [bv, Ke] = pl(Or), hl = (e) => {
8301
8303
  const {
8302
8304
  __scopeDialog: t,
8303
8305
  children: n,
@@ -8636,7 +8638,7 @@ var $l = Object.freeze({
8636
8638
  )
8637
8639
  );
8638
8640
  Bl.displayName = kv;
8639
- var Mv = Bl, [kr, Jy] = je("Tooltip", [
8641
+ var Mv = Bl, [kr, Jy] = Ve("Tooltip", [
8640
8642
  Gt
8641
8643
  ]), Mr = Gt(), Ul = "TooltipProvider", Dv = 700, Io = "tooltip.open", [Lv, Es] = kr(Ul), Hl = (e) => {
8642
8644
  const {
@@ -8755,17 +8757,17 @@ var _o = "TooltipTrigger", Wl = u.forwardRef(
8755
8757
  Wl.displayName = _o;
8756
8758
  var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
8757
8759
  forceMount: void 0
8758
- }), Ht = "TooltipContent", Vl = u.forwardRef(
8760
+ }), Ht = "TooltipContent", jl = u.forwardRef(
8759
8761
  (e, t) => {
8760
8762
  const n = Bv(Ht, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...s } = e, a = Dr(Ht, e.__scopeTooltip);
8761
- return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(jl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(Uv, { side: o, ...s, ref: t }) });
8763
+ return /* @__PURE__ */ c(_e, { present: r || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ c(Vl, { side: o, ...s, ref: t }) : /* @__PURE__ */ c(Uv, { side: o, ...s, ref: t }) });
8762
8764
  }
8763
8765
  ), Uv = u.forwardRef((e, t) => {
8764
8766
  const n = Dr(Ht, e.__scopeTooltip), r = Es(Ht, e.__scopeTooltip), o = u.useRef(null), s = ie(t, o), [a, i] = u.useState(null), { trigger: l, onClose: f } = n, d = o.current, { onPointerInTransitChange: p } = r, m = u.useCallback(() => {
8765
8767
  i(null), p(!1);
8766
8768
  }, [p]), v = u.useCallback(
8767
8769
  (g, h) => {
8768
- const b = g.currentTarget, w = { x: g.clientX, y: g.clientY }, x = jv(w, b.getBoundingClientRect()), y = Kv(w, x), C = Gv(h.getBoundingClientRect()), R = Xv([...y, ...C]);
8770
+ const b = g.currentTarget, w = { x: g.clientX, y: g.clientY }, x = Vv(w, b.getBoundingClientRect()), y = Kv(w, x), C = Gv(h.getBoundingClientRect()), R = Xv([...y, ...C]);
8769
8771
  i(R), p(!0);
8770
8772
  },
8771
8773
  [p]
@@ -8785,8 +8787,8 @@ var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
8785
8787
  };
8786
8788
  return document.addEventListener("pointermove", g), () => document.removeEventListener("pointermove", g);
8787
8789
  }
8788
- }, [l, d, a, f, m]), /* @__PURE__ */ c(jl, { ...e, ref: s });
8789
- }), [Hv, zv] = kr(dn, { isInside: !1 }), Wv = Cd("TooltipContent"), jl = u.forwardRef(
8790
+ }, [l, d, a, f, m]), /* @__PURE__ */ c(Vl, { ...e, ref: s });
8791
+ }), [Hv, zv] = kr(dn, { isInside: !1 }), Wv = Cd("TooltipContent"), Vl = u.forwardRef(
8790
8792
  (e, t) => {
8791
8793
  const {
8792
8794
  __scopeTooltip: n,
@@ -8838,8 +8840,8 @@ var $v = "TooltipPortal", [Zy, Bv] = kr($v, {
8838
8840
  );
8839
8841
  }
8840
8842
  );
8841
- Vl.displayName = Ht;
8842
- var Kl = "TooltipArrow", Vv = u.forwardRef(
8843
+ jl.displayName = Ht;
8844
+ var Kl = "TooltipArrow", jv = u.forwardRef(
8843
8845
  (e, t) => {
8844
8846
  const { __scopeTooltip: n, ...r } = e, o = Mr(n);
8845
8847
  return zv(
@@ -8848,8 +8850,8 @@ var Kl = "TooltipArrow", Vv = u.forwardRef(
8848
8850
  ).isInside ? null : /* @__PURE__ */ c(as, { ...o, ...r, ref: t });
8849
8851
  }
8850
8852
  );
8851
- Vv.displayName = Kl;
8852
- function jv(e, t) {
8853
+ jv.displayName = Kl;
8854
+ function Vv(e, t) {
8853
8855
  const n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), s = Math.abs(t.left - e.x);
8854
8856
  switch (Math.min(n, r, o, s)) {
8855
8857
  case s:
@@ -8941,7 +8943,7 @@ function Yv(e) {
8941
8943
  }
8942
8944
  return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
8943
8945
  }
8944
- var Jv = Hl, Zv = zl, Qv = Wl, Gl = Vl;
8946
+ var Jv = Hl, Zv = zl, Qv = Wl, Gl = jl;
8945
8947
  const ew = Jv, tw = Zv, nw = Qv, ql = u.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ c(
8946
8948
  Gl,
8947
8949
  {
@@ -9477,7 +9479,7 @@ function Qy({
9477
9479
  /* @__PURE__ */ c("div", { className: "flex-1" }),
9478
9480
  e
9479
9481
  ] }),
9480
- /* @__PURE__ */ c("main", { className: `flex-1 min-h-0 overflow-hidden ${s}`, children: /* @__PURE__ */ c(jn, {}) })
9482
+ /* @__PURE__ */ c("main", { className: `flex-1 min-h-0 overflow-hidden ${s}`, children: /* @__PURE__ */ c(Vn, {}) })
9481
9483
  ] })
9482
9484
  ] }) });
9483
9485
  }
@@ -9509,7 +9511,7 @@ function uu(e) {
9509
9511
  const t = u.useRef({ value: e, previous: e });
9510
9512
  return u.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
9511
9513
  }
9512
- var Fr = "Switch", [Cw, ex] = je(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
9514
+ var Fr = "Switch", [Cw, ex] = Ve(Fr), [Ew, Nw] = Cw(Fr), du = u.forwardRef(
9513
9515
  (e, t) => {
9514
9516
  const {
9515
9517
  __scopeSwitch: n,
@@ -9646,7 +9648,7 @@ const ct = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
9646
9648
  }
9647
9649
  ));
9648
9650
  ct.displayName = gu.displayName;
9649
- var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Select", [$r, Br, Iw] = Go(Ct), [qt, tx] = je(Ct, [
9651
+ var Aw = [" ", "Enter", "ArrowUp", "ArrowDown"], Pw = [" ", "Enter"], Ct = "Select", [$r, Br, Iw] = Go(Ct), [qt, tx] = Ve(Ct, [
9650
9652
  Iw,
9651
9653
  Gt
9652
9654
  ]), Ur = Gt(), [_w, pt] = qt(Ct), [Ow, kw] = qt(Ct), bu = (e) => {
@@ -9739,7 +9741,7 @@ bu.displayName = Ct;
9739
9741
  var vu = "SelectTrigger", wu = u.forwardRef(
9740
9742
  (e, t) => {
9741
9743
  const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ur(n), a = pt(vu, n), i = a.disabled || r, l = ie(t, a.onTriggerChange), f = Br(n), d = u.useRef("touch"), [p, m, v] = Wu((h) => {
9742
- const b = f().filter((y) => !y.disabled), w = b.find((y) => y.value === a.value), x = Vu(b, h, w);
9744
+ const b = f().filter((y) => !y.disabled), w = b.find((y) => y.value === a.value), x = ju(b, h, w);
9743
9745
  x !== void 0 && a.onValueChange(x.value);
9744
9746
  }), g = (h) => {
9745
9747
  i || (a.onOpenChange(!0), v()), h && (a.triggerPointerDownPosRef.current = {
@@ -9852,9 +9854,9 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
9852
9854
  }, [y]), qo();
9853
9855
  const O = u.useCallback(
9854
9856
  (z) => {
9855
- const [W, ...ae] = K().map((te) => te.ref.current), [j] = ae.slice(-1), X = document.activeElement;
9857
+ const [W, ...ae] = K().map((te) => te.ref.current), [V] = ae.slice(-1), X = document.activeElement;
9856
9858
  for (const te of z)
9857
- if (te === X || (te == null || te.scrollIntoView({ block: "nearest" }), te === W && R && (R.scrollTop = 0), te === j && R && (R.scrollTop = R.scrollHeight), te == null || te.focus(), document.activeElement !== X)) return;
9859
+ if (te === X || (te == null || te.scrollIntoView({ block: "nearest" }), te === W && R && (R.scrollTop = 0), te === V && R && (R.scrollTop = R.scrollHeight), te == null || te.focus(), document.activeElement !== X)) return;
9858
9860
  },
9859
9861
  [K, R]
9860
9862
  ), G = u.useCallback(
@@ -9868,14 +9870,14 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
9868
9870
  u.useEffect(() => {
9869
9871
  if (y) {
9870
9872
  let z = { x: 0, y: 0 };
9871
- const W = (j) => {
9873
+ const W = (V) => {
9872
9874
  var X, te;
9873
9875
  z = {
9874
- x: Math.abs(Math.round(j.pageX) - (((X = T.current) == null ? void 0 : X.x) ?? 0)),
9875
- y: Math.abs(Math.round(j.pageY) - (((te = T.current) == null ? void 0 : te.y) ?? 0))
9876
+ x: Math.abs(Math.round(V.pageX) - (((X = T.current) == null ? void 0 : X.x) ?? 0)),
9877
+ y: Math.abs(Math.round(V.pageY) - (((te = T.current) == null ? void 0 : te.y) ?? 0))
9876
9878
  };
9877
- }, ae = (j) => {
9878
- z.x <= 10 && z.y <= 10 ? j.preventDefault() : y.contains(j.target) || D(!1), document.removeEventListener("pointermove", W), T.current = null;
9879
+ }, ae = (V) => {
9880
+ z.x <= 10 && z.y <= 10 ? V.preventDefault() : y.contains(V.target) || D(!1), document.removeEventListener("pointermove", W), T.current = null;
9879
9881
  };
9880
9882
  return T.current !== null && (document.addEventListener("pointermove", W), document.addEventListener("pointerup", ae, { capture: !0, once: !0 })), () => {
9881
9883
  document.removeEventListener("pointermove", W), document.removeEventListener("pointerup", ae, { capture: !0 });
@@ -9888,18 +9890,18 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
9888
9890
  };
9889
9891
  }, [D]);
9890
9892
  const [Q, q] = Wu((z) => {
9891
- const W = K().filter((X) => !X.disabled), ae = W.find((X) => X.ref.current === document.activeElement), j = Vu(W, z, ae);
9892
- j && setTimeout(() => j.ref.current.focus());
9893
+ const W = K().filter((X) => !X.disabled), ae = W.find((X) => X.ref.current === document.activeElement), V = ju(W, z, ae);
9894
+ V && setTimeout(() => V.ref.current.focus());
9893
9895
  }), se = u.useCallback(
9894
9896
  (z, W, ae) => {
9895
- const j = !H.current && !ae;
9896
- (x.value !== void 0 && x.value === W || j) && (L(z), j && (H.current = !0));
9897
+ const V = !H.current && !ae;
9898
+ (x.value !== void 0 && x.value === W || V) && (L(z), V && (H.current = !0));
9897
9899
  },
9898
9900
  [x.value]
9899
- ), F = u.useCallback(() => y == null ? void 0 : y.focus(), [y]), V = u.useCallback(
9901
+ ), F = u.useCallback(() => y == null ? void 0 : y.focus(), [y]), j = u.useCallback(
9900
9902
  (z, W, ae) => {
9901
- const j = !H.current && !ae;
9902
- (x.value !== void 0 && x.value === W || j) && $(z);
9903
+ const V = !H.current && !ae;
9904
+ (x.value !== void 0 && x.value === W || V) && $(z);
9903
9905
  },
9904
9906
  [x.value]
9905
9907
  ), ce = r === "popper" ? Oo : Tu, pe = ce === Oo ? {
@@ -9924,7 +9926,7 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
9924
9926
  itemRefCallback: se,
9925
9927
  selectedItem: k,
9926
9928
  onItemLeave: F,
9927
- itemTextRefCallback: V,
9929
+ itemTextRefCallback: j,
9928
9930
  focusSelectedItem: G,
9929
9931
  selectedItemText: I,
9930
9932
  position: r,
@@ -9974,12 +9976,12 @@ var Ue = 10, [Nu, ht] = qt(Et), Lw = "SelectContentImpl", Fw = Ft("SelectContent
9974
9976
  onKeyDown: U(w.onKeyDown, (z) => {
9975
9977
  const W = z.ctrlKey || z.altKey || z.metaKey;
9976
9978
  if (z.key === "Tab" && z.preventDefault(), !W && z.key.length === 1 && q(z.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(z.key)) {
9977
- let j = K().filter((X) => !X.disabled).map((X) => X.ref.current);
9978
- if (["ArrowUp", "End"].includes(z.key) && (j = j.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(z.key)) {
9979
- const X = z.target, te = j.indexOf(X);
9980
- j = j.slice(te + 1);
9979
+ let V = K().filter((X) => !X.disabled).map((X) => X.ref.current);
9980
+ if (["ArrowUp", "End"].includes(z.key) && (V = V.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(z.key)) {
9981
+ const X = z.target, te = V.indexOf(X);
9982
+ V = V.slice(te + 1);
9981
9983
  }
9982
- setTimeout(() => O(j)), z.preventDefault();
9984
+ setTimeout(() => O(V)), z.preventDefault();
9983
9985
  }
9984
9986
  })
9985
9987
  }
@@ -10015,8 +10017,8 @@ var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
10015
10017
  ]);
10016
10018
  i.style.minWidth = de + "px", i.style.right = he + "px";
10017
10019
  }
10018
- const $ = m(), K = window.innerHeight - Ue * 2, B = h.scrollHeight, M = window.getComputedStyle(f), H = parseInt(M.borderTopWidth, 10), O = parseInt(M.paddingTop, 10), G = parseInt(M.borderBottomWidth, 10), D = parseInt(M.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(h), se = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), V = N.top + N.height / 2 - Ue, ce = K - V, pe = b.offsetHeight / 2, z = b.offsetTop + pe, W = H + O + z, ae = T - W;
10019
- if (W <= V) {
10020
+ const $ = m(), K = window.innerHeight - Ue * 2, B = h.scrollHeight, M = window.getComputedStyle(f), H = parseInt(M.borderTopWidth, 10), O = parseInt(M.paddingTop, 10), G = parseInt(M.borderBottomWidth, 10), D = parseInt(M.paddingBottom, 10), T = H + O + B + D + G, Q = Math.min(b.offsetHeight * 5, T), q = window.getComputedStyle(h), se = parseInt(q.paddingTop, 10), F = parseInt(q.paddingBottom, 10), j = N.top + N.height / 2 - Ue, ce = K - j, pe = b.offsetHeight / 2, z = b.offsetTop + pe, W = H + O + z, ae = T - W;
10021
+ if (W <= j) {
10020
10022
  const X = $.length > 0 && b === $[$.length - 1].ref.current;
10021
10023
  i.style.bottom = "0px";
10022
10024
  const te = f.clientHeight - h.offsetTop - h.offsetHeight, me = Math.max(
@@ -10029,11 +10031,11 @@ var $w = "SelectItemAlignedPosition", Tu = u.forwardRef((e, t) => {
10029
10031
  const X = $.length > 0 && b === $[0].ref.current;
10030
10032
  i.style.top = "0px";
10031
10033
  const me = Math.max(
10032
- V,
10034
+ j,
10033
10035
  H + h.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
10034
10036
  (X ? se : 0) + pe
10035
10037
  ) + ae;
10036
- i.style.height = me + "px", h.scrollTop = W - V + h.offsetTop;
10038
+ i.style.height = me + "px", h.scrollTop = W - j + h.offsetTop;
10037
10039
  }
10038
10040
  i.style.margin = `${Ue}px 0`, i.style.minHeight = Q + "px", i.style.maxHeight = K + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
10039
10041
  }
@@ -10194,7 +10196,7 @@ var Iu = "SelectLabel", _u = u.forwardRef(
10194
10196
  }
10195
10197
  );
10196
10198
  _u.displayName = Iu;
10197
- var ur = "SelectItem", [Vw, Ou] = qt(ur), ku = u.forwardRef(
10199
+ var ur = "SelectItem", [jw, Ou] = qt(ur), ku = u.forwardRef(
10198
10200
  (e, t) => {
10199
10201
  const {
10200
10202
  __scopeSelect: n,
@@ -10216,7 +10218,7 @@ var ur = "SelectItem", [Vw, Ou] = qt(ur), ku = u.forwardRef(
10216
10218
  "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
10217
10219
  );
10218
10220
  return /* @__PURE__ */ c(
10219
- Vw,
10221
+ jw,
10220
10222
  {
10221
10223
  scope: n,
10222
10224
  value: r,
@@ -10381,13 +10383,13 @@ var Bu = u.forwardRef((e, t) => {
10381
10383
  })
10382
10384
  }
10383
10385
  );
10384
- }), jw = "SelectSeparator", Uu = u.forwardRef(
10386
+ }), Vw = "SelectSeparator", Uu = u.forwardRef(
10385
10387
  (e, t) => {
10386
10388
  const { __scopeSelect: n, ...r } = e;
10387
10389
  return /* @__PURE__ */ c(ee.div, { "aria-hidden": !0, ...r, ref: t });
10388
10390
  }
10389
10391
  );
10390
- Uu.displayName = jw;
10392
+ Uu.displayName = Vw;
10391
10393
  var Lo = "SelectArrow", Kw = u.forwardRef(
10392
10394
  (e, t) => {
10393
10395
  const { __scopeSelect: n, ...r } = e, o = Ur(n), s = pt(Lo, n), a = ht(Lo, n);
@@ -10438,7 +10440,7 @@ function Wu(e) {
10438
10440
  }, []);
10439
10441
  return u.useEffect(() => () => window.clearTimeout(r.current), []), [n, o, s];
10440
10442
  }
10441
- function Vu(e, t, n) {
10443
+ function ju(e, t, n) {
10442
10444
  const o = t.length > 1 && Array.from(t).every((f) => f === t[0]) ? t[0] : t, s = n ? e.indexOf(n) : -1;
10443
10445
  let a = qw(e, Math.max(s, 0));
10444
10446
  o.length === 1 && (a = a.filter((f) => f !== n));
@@ -10450,9 +10452,9 @@ function Vu(e, t, n) {
10450
10452
  function qw(e, t) {
10451
10453
  return e.map((n, r) => e[(t + r) % e.length]);
10452
10454
  }
10453
- var Xw = bu, ju = wu, Yw = xu, Jw = Su, Zw = Cu, Ku = Eu, Qw = Au, Gu = _u, qu = ku, ey = Mu, ty = Lu, Xu = Fu, Yu = $u, Ju = Uu;
10455
+ var Xw = bu, Vu = wu, Yw = xu, Jw = Su, Zw = Cu, Ku = Eu, Qw = Au, Gu = _u, qu = ku, ey = Mu, ty = Lu, Xu = Fu, Yu = $u, Ju = Uu;
10454
10456
  const Aa = Xw, Pa = Yw, Fo = u.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ E(
10455
- ju,
10457
+ Vu,
10456
10458
  {
10457
10459
  ref: r,
10458
10460
  className: A(
@@ -10466,7 +10468,7 @@ const Aa = Xw, Pa = Yw, Fo = u.forwardRef(({ className: e, children: t, ...n },
10466
10468
  ]
10467
10469
  }
10468
10470
  ));
10469
- Fo.displayName = ju.displayName;
10471
+ Fo.displayName = Vu.displayName;
10470
10472
  const Zu = u.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c(
10471
10473
  Xu,
10472
10474
  {
@@ -11037,7 +11039,7 @@ function rx({
11037
11039
  {
11038
11040
  className: `${a(t)} flex flex-col overflow-hidden ${r} ${o.container || ""}`,
11039
11041
  style: i(t),
11040
- children: /* @__PURE__ */ c(jn, { className: "flex-1", onError: s.onError, enableFileUpload: !0 })
11042
+ children: /* @__PURE__ */ c(Vn, { className: "flex-1", onError: s.onError, enableFileUpload: !0 })
11041
11043
  }
11042
11044
  ) }) : e === "tabs" ? /* @__PURE__ */ c(Un, { ...s, onThreadChange: l, children: /* @__PURE__ */ c(
11043
11045
  "div",
@@ -11054,7 +11056,7 @@ function rx({
11054
11056
  className: "h-full"
11055
11057
  }
11056
11058
  ) }),
11057
- /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(jn, { onError: s.onError, enableFileUpload: !0 }) })
11059
+ /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(Vn, { onError: s.onError, enableFileUpload: !0 }) })
11058
11060
  ] })
11059
11061
  }
11060
11062
  ) }) : /* @__PURE__ */ c(Un, { ...s, onThreadChange: l, children: /* @__PURE__ */ E(
@@ -11072,7 +11074,7 @@ function rx({
11072
11074
  className: "h-full"
11073
11075
  }
11074
11076
  ) }),
11075
- /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(jn, { onError: s.onError, enableFileUpload: !0 }) })
11077
+ /* @__PURE__ */ c("div", { className: `flex-1 min-w-0 overflow-hidden ${o.chatArea || ""}`, children: /* @__PURE__ */ c(Vn, { onError: s.onError, enableFileUpload: !0 }) })
11076
11078
  ]
11077
11079
  }
11078
11080
  ) });
@@ -11081,10 +11083,10 @@ export {
11081
11083
  cp as Api,
11082
11084
  cp as ApiClient,
11083
11085
  cp as ChatApi,
11084
- jn as ChatInterface,
11086
+ Vn as ChatInterface,
11085
11087
  Qy as ChatMainLayout,
11086
11088
  Un as ChatProvider,
11087
- jy as ChatRoutingProvider,
11089
+ Vy as ChatRoutingProvider,
11088
11090
  nx as ChatSettings,
11089
11091
  _n as MarkdownContent,
11090
11092
  $p as MessageComponent,