teodor-new-chat-ui 4.3.83 → 4.3.84

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 @@ var Om = Object.defineProperty;
2
2
  var Mm = (e, t, n) => t in e ? Om(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Ol = (e, t, n) => Mm(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import * as g from "react";
5
- import U, { createContext as ko, useContext as js, useReducer as Dm, useRef as Le, useCallback as ke, useEffect as dt, useMemo as it, useState as ye, startTransition as Lo, createElement as Jo, useLayoutEffect as Lm } from "react";
5
+ import U, { createContext as ko, useContext as js, useReducer as Dm, useRef as Le, useCallback as Te, useEffect as dt, useMemo as it, useState as ye, startTransition as Lo, createElement as Jo, useLayoutEffect as Lm } from "react";
6
6
  import { Square as Fm, Send as $m, X as Or, ExternalLink as zm, Download as Bm, Image as Hm, FileText as Ml, Loader as _a, Bot as vi, Wrench as Um, User as Wm, Paperclip as qi, ChevronUp as ja, ChevronDown as Ps, Copy as Dl, Edit as Ll, RotateCcw as Gi, ChevronRight as Vm, Check as Pa, Circle as Km, Loader2 as Yi, Edit3 as Cu, Plus as qm, FileSpreadsheet as Gm, MessageSquarePlus as Ym, MessageSquare as Xm, Calendar as Jm, Trash2 as Zm, Settings as Qm, Server as eg, EyeOff as tg, Eye as ng, Layout as rg, MessageCircle as og, Save as sg } from "lucide-react";
7
7
  import { Slot as ig, createSlot as $r } from "@radix-ui/react-slot";
8
8
  import { cva as Os } from "class-variance-authority";
@@ -266,19 +266,19 @@ function ug() {
266
266
  } catch (kt) {
267
267
  if (kt && Ce && typeof kt.stack == "string") {
268
268
  for (var $ = kt.stack.split(`
269
- `), de = Ce.stack.split(`
270
- `), ue = $.length - 1, Te = de.length - 1; ue >= 1 && Te >= 0 && $[ue] !== de[Te]; )
271
- Te--;
272
- for (; ue >= 1 && Te >= 0; ue--, Te--)
273
- if ($[ue] !== de[Te]) {
274
- if (ue !== 1 || Te !== 1)
269
+ `), ue = Ce.stack.split(`
270
+ `), de = $.length - 1, Re = ue.length - 1; de >= 1 && Re >= 0 && $[de] !== ue[Re]; )
271
+ Re--;
272
+ for (; de >= 1 && Re >= 0; de--, Re--)
273
+ if ($[de] !== ue[Re]) {
274
+ if (de !== 1 || Re !== 1)
275
275
  do
276
- if (ue--, Te--, Te < 0 || $[ue] !== de[Te]) {
277
- var Je = `
278
- ` + $[ue].replace(" at new ", " at ");
279
- return R.displayName && Je.includes("<anonymous>") && (Je = Je.replace("<anonymous>", R.displayName)), typeof R == "function" && oe.set(R, Je), Je;
276
+ if (de--, Re--, Re < 0 || $[de] !== ue[Re]) {
277
+ var ot = `
278
+ ` + $[de].replace(" at new ", " at ");
279
+ return R.displayName && ot.includes("<anonymous>") && (ot = ot.replace("<anonymous>", R.displayName)), typeof R == "function" && oe.set(R, ot), ot;
280
280
  }
281
- while (ue >= 1 && Te >= 0);
281
+ while (de >= 1 && Re >= 0);
282
282
  break;
283
283
  }
284
284
  }
@@ -325,7 +325,7 @@ function ug() {
325
325
  return "";
326
326
  }
327
327
  var st = Object.prototype.hasOwnProperty, at = {}, gt = x.ReactDebugCurrentFrame;
328
- function rt(R) {
328
+ function nt(R) {
329
329
  if (R) {
330
330
  var H = R._owner, le = Ke(R.type, R._source, H ? H.type : null);
331
331
  gt.setExtraStackFrame(le);
@@ -340,14 +340,14 @@ function ug() {
340
340
  var $ = void 0;
341
341
  try {
342
342
  if (typeof R[Fe] != "function") {
343
- var de = Error((Ce || "React class") + ": " + le + " type `" + Fe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Fe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
- throw de.name = "Invariant Violation", de;
343
+ var ue = Error((Ce || "React class") + ": " + le + " type `" + Fe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Fe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ throw ue.name = "Invariant Violation", ue;
345
345
  }
346
346
  $ = R[Fe](H, Fe, Ce, le, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
- } catch (ue) {
348
- $ = ue;
347
+ } catch (de) {
348
+ $ = de;
349
349
  }
350
- $ && !($ instanceof Error) && (rt(Ge), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Ce || "React class", le, Fe, typeof $), rt(null)), $ instanceof Error && !($.message in at) && (at[$.message] = !0, rt(Ge), w("Failed %s type: %s", le, $.message), rt(null));
350
+ $ && !($ instanceof Error) && (nt(Ge), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Ce || "React class", le, Fe, typeof $), nt(null)), $ instanceof Error && !($.message in at) && (at[$.message] = !0, nt(Ge), w("Failed %s type: %s", le, $.message), nt(null));
351
351
  }
352
352
  }
353
353
  }
@@ -363,24 +363,24 @@ function ug() {
363
363
  }
364
364
  function ft(R) {
365
365
  try {
366
- return Qe(R), !1;
366
+ return Ze(R), !1;
367
367
  } catch {
368
368
  return !0;
369
369
  }
370
370
  }
371
- function Qe(R) {
371
+ function Ze(R) {
372
372
  return "" + R;
373
373
  }
374
374
  function ie(R) {
375
375
  if (ft(R))
376
- return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", vt(R)), Qe(R);
376
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", vt(R)), Ze(R);
377
377
  }
378
- var _e = x.ReactCurrentOwner, Re = {
378
+ var _e = x.ReactCurrentOwner, ke = {
379
379
  key: !0,
380
380
  ref: !0,
381
381
  __self: !0,
382
382
  __source: !0
383
- }, qe, ot;
383
+ }, qe, rt;
384
384
  function Pe(R) {
385
385
  if (st.call(R, "ref")) {
386
386
  var H = Object.getOwnPropertyDescriptor(R, "ref").get;
@@ -414,7 +414,7 @@ function ug() {
414
414
  function qt(R, H) {
415
415
  {
416
416
  var le = function() {
417
- ot || (ot = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", H));
417
+ rt || (rt = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", H));
418
418
  };
419
419
  le.isReactWarning = !0, Object.defineProperty(R, "ref", {
420
420
  get: le,
@@ -453,20 +453,20 @@ function ug() {
453
453
  };
454
454
  function qn(R, H, le, Ce, Ge) {
455
455
  {
456
- var ze, Fe = {}, $ = null, de = null;
457
- le !== void 0 && (ie(le), $ = "" + le), Xe(H) && (ie(H.key), $ = "" + H.key), Pe(H) && (de = H.ref, Et(H, Ge));
456
+ var ze, Fe = {}, $ = null, ue = null;
457
+ le !== void 0 && (ie(le), $ = "" + le), Xe(H) && (ie(H.key), $ = "" + H.key), Pe(H) && (ue = H.ref, Et(H, Ge));
458
458
  for (ze in H)
459
- st.call(H, ze) && !Re.hasOwnProperty(ze) && (Fe[ze] = H[ze]);
459
+ st.call(H, ze) && !ke.hasOwnProperty(ze) && (Fe[ze] = H[ze]);
460
460
  if (R && R.defaultProps) {
461
- var ue = R.defaultProps;
462
- for (ze in ue)
463
- Fe[ze] === void 0 && (Fe[ze] = ue[ze]);
461
+ var de = R.defaultProps;
462
+ for (ze in de)
463
+ Fe[ze] === void 0 && (Fe[ze] = de[ze]);
464
464
  }
465
- if ($ || de) {
466
- var Te = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- $ && Tt(Fe, Te), de && qt(Fe, Te);
465
+ if ($ || ue) {
466
+ var Re = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
+ $ && Tt(Fe, Re), ue && qt(Fe, Re);
468
468
  }
469
- return It(R, $, de, Ge, Ce, _e.current, Fe);
469
+ return It(R, $, ue, Ge, Ce, _e.current, Fe);
470
470
  }
471
471
  }
472
472
  var Gt = x.ReactCurrentOwner, dn = x.ReactDebugCurrentFrame;
@@ -586,26 +586,26 @@ Check the top-level render call using <` + le + ">.");
586
586
  if (!Fe) {
587
587
  var $ = "";
588
588
  (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && ($ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
589
- var de = xt();
590
- de ? $ += de : $ += fn();
591
- var ue;
592
- R === null ? ue = "null" : ut(R) ? ue = "array" : R !== void 0 && R.$$typeof === t ? (ue = "<" + (j(R.type) || "Unknown") + " />", $ = " Did you accidentally export a JSX literal instead of a component?") : ue = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ue, $);
589
+ var ue = xt();
590
+ ue ? $ += ue : $ += fn();
591
+ var de;
592
+ R === null ? de = "null" : ut(R) ? de = "array" : R !== void 0 && R.$$typeof === t ? (de = "<" + (j(R.type) || "Unknown") + " />", $ = " Did you accidentally export a JSX literal instead of a component?") : de = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", de, $);
593
593
  }
594
- var Te = qn(R, H, le, Ge, ze);
595
- if (Te == null)
596
- return Te;
594
+ var Re = qn(R, H, le, Ge, ze);
595
+ if (Re == null)
596
+ return Re;
597
597
  if (Fe) {
598
- var Je = H.children;
599
- if (Je !== void 0)
598
+ var ot = H.children;
599
+ if (ot !== void 0)
600
600
  if (Ce)
601
- if (ut(Je)) {
602
- for (var Dt = 0; Dt < Je.length; Dt++)
603
- Yt(Je[Dt], R);
604
- Object.freeze && Object.freeze(Je);
601
+ if (ut(ot)) {
602
+ for (var Dt = 0; Dt < ot.length; Dt++)
603
+ Yt(ot[Dt], R);
604
+ Object.freeze && Object.freeze(ot);
605
605
  } else
606
606
  w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
607
607
  else
608
- Yt(Je, R);
608
+ Yt(ot, R);
609
609
  }
610
610
  if (st.call(H, "key")) {
611
611
  var nn = j(R), kt = Object.keys(H).filter(function(I) {
@@ -621,7 +621,7 @@ React keys must be passed directly to JSX without using spread:
621
621
  <%s key={someKey} {...props} />`, Xr, nn, E, nn), pn[nn + Xr] = !0;
622
622
  }
623
623
  }
624
- return R === r ? kn(Te) : lr(Te), Te;
624
+ return R === r ? kn(Re) : lr(Re), Re;
625
625
  }
626
626
  }
627
627
  function cr(R, H, le) {
@@ -3015,13 +3015,13 @@ function dy(e, t) {
3015
3015
  }
3016
3016
  }
3017
3017
  function fy(e = []) {
3018
- const [t, n] = Dm(dy, { ...uy, messages: e }), r = Le([]), o = Le(null), s = Le(null), i = ke(() => {
3018
+ const [t, n] = Dm(dy, { ...uy, messages: e }), r = Le([]), o = Le(null), s = Le(null), i = Te(() => {
3019
3019
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
3020
3020
  const d = r.current;
3021
3021
  d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
3022
- }, []), a = ke(() => {
3022
+ }, []), a = Te(() => {
3023
3023
  typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i, 8));
3024
- }, [i]), l = ke((d) => {
3024
+ }, [i]), l = Te((d) => {
3025
3025
  r.current.push(d), a();
3026
3026
  }, [a]);
3027
3027
  dt(() => () => {
@@ -3303,14 +3303,14 @@ function yy(e) {
3303
3303
  return t[t.length - 1] || null;
3304
3304
  }
3305
3305
  function vy(e = {}) {
3306
- const t = it(() => Wn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ye(e.token ?? null), s = Le(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ye(!1), [c, d] = ye(null), [f, h] = ye(""), [p, m] = ye(null), [y, v] = ye(0), [x, w] = ye(!1), b = Le(null), T = Le(!0), C = Le(0), S = Le(null), k = ke((F) => {
3306
+ const t = it(() => Wn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = ye(e.token ?? null), s = Le(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = ye(!1), [c, d] = ye(null), [f, h] = ye(""), [p, m] = ye(null), [y, v] = ye(0), [x, w] = ye(!1), b = Le(null), T = Le(!0), C = Le(0), S = Le(null), k = Te((F) => {
3307
3307
  o(F);
3308
- }, []), A = ke(() => {
3308
+ }, []), A = Te(() => {
3309
3309
  h(""), m(null), d(null);
3310
- }, []), N = ke(() => {
3310
+ }, []), N = Te(() => {
3311
3311
  var F;
3312
3312
  console.debug("[use-chat] stop() invoked - aborting stream"), (F = b.current) == null || F.abort(), b.current = null, S.current = null, l(!1), w(!1), C.current = 0, v(0);
3313
- }, []), M = ke(
3313
+ }, []), M = Te(
3314
3314
  (F, q, j) => {
3315
3315
  b.current && (b.current.abort(), b.current = null), l(!0), d(null), e.autoAppendAssistant !== !1 && h("");
3316
3316
  const _ = new AbortController();
@@ -3344,8 +3344,8 @@ function vy(e = {}) {
3344
3344
  ie && (ft = ((K = JSON.parse(ie)) == null ? void 0 : K.apiKey) || null);
3345
3345
  } catch {
3346
3346
  }
3347
- const Qe = ut || vt || ft || null;
3348
- Qe && (we = { Authorization: `Bearer ${Qe}` });
3347
+ const Ze = ut || vt || ft || null;
3348
+ Ze && (we = { Authorization: `Bearer ${Ze}` });
3349
3349
  }
3350
3350
  } catch {
3351
3351
  }
@@ -3401,7 +3401,7 @@ function vy(e = {}) {
3401
3401
  typeof window < "u" && Ke == null && (Ke = requestAnimationFrame(st));
3402
3402
  };
3403
3403
  let gt = Date.now();
3404
- const rt = setInterval(() => {
3404
+ const nt = setInterval(() => {
3405
3405
  var We;
3406
3406
  if (Date.now() - gt > 6e4) {
3407
3407
  const ut = "Stream idle timeout";
@@ -3414,25 +3414,25 @@ function vy(e = {}) {
3414
3414
  ...S.current,
3415
3415
  threadId: vt
3416
3416
  }), (he = j == null ? void 0 : j.onOpen) == null || he.call(j, { threadId: vt, created: ft }); ; ) {
3417
- const { value: Qe, done: ie } = await oe.read();
3417
+ const { value: Ze, done: ie } = await oe.read();
3418
3418
  if (ie) break;
3419
- se += ge.decode(Qe, { stream: !0 }), se.length > Me && (se = "", console.warn("Stream buffer reset: exceeded 1MB"));
3419
+ se += ge.decode(Ze, { stream: !0 }), se.length > Me && (se = "", console.warn("Stream buffer reset: exceeded 1MB"));
3420
3420
  let _e;
3421
3421
  for (; (_e = se.indexOf(`
3422
3422
 
3423
3423
  `)) >= 0; ) {
3424
- const Re = se.slice(0, _e);
3424
+ const ke = se.slice(0, _e);
3425
3425
  se = se.slice(_e + 2);
3426
- const qe = by(Re);
3426
+ const qe = by(ke);
3427
3427
  if (!qe) continue;
3428
- let ot;
3428
+ let rt;
3429
3429
  try {
3430
- ot = JSON.parse(qe);
3430
+ rt = JSON.parse(qe);
3431
3431
  } catch {
3432
3432
  console.debug("[use-chat] malformed SSE:", qe.slice(0, 200));
3433
3433
  continue;
3434
3434
  }
3435
- const Pe = wy(ot) ? ot.data : ot;
3435
+ const Pe = wy(rt) ? rt.data : rt;
3436
3436
  gt = Date.now();
3437
3437
  const Xe = Pe.seq;
3438
3438
  if (Xe !== void 0) {
@@ -3480,7 +3480,7 @@ function vy(e = {}) {
3480
3480
  } finally {
3481
3481
  (B = oe.releaseLock) == null || B.call(oe);
3482
3482
  }
3483
- Ke !== null && typeof window < "u" && window.cancelAnimationFrame(Ke), clearInterval(rt), l(!1), w(!1), b.current = null, C.current = 0, v(0), S.current = null;
3483
+ Ke !== null && typeof window < "u" && window.cancelAnimationFrame(Ke), clearInterval(nt), l(!1), w(!1), b.current = null, C.current = 0, v(0), S.current = null;
3484
3484
  }
3485
3485
  } catch (we) {
3486
3486
  if (we.name !== "AbortError") {
@@ -3530,7 +3530,7 @@ function Sy({
3530
3530
  onUnhandledEvent: r,
3531
3531
  onSequenceGap: o
3532
3532
  }) {
3533
- const s = Le(null), i = ke(
3533
+ const s = Le(null), i = Te(
3534
3534
  (p) => {
3535
3535
  const m = p.seq ?? null;
3536
3536
  if (m !== null) {
@@ -3569,7 +3569,7 @@ function Sy({
3569
3569
  ), { stream: a, stop: l, isStreaming: c, error: d, setToken: f } = vy({
3570
3570
  baseUrl: e,
3571
3571
  token: null
3572
- }), h = ke(
3572
+ }), h = Te(
3573
3573
  (p, m) => {
3574
3574
  s.current = null, a(
3575
3575
  p,
@@ -3863,20 +3863,20 @@ function By({
3863
3863
  }, [c]), h = it(
3864
3864
  () => `threadPayload:${Iy}:${f}:`,
3865
3865
  [f]
3866
- ), p = ke(
3866
+ ), p = Te(
3867
3867
  (E) => jy(h, E),
3868
3868
  [h]
3869
- ), m = ke(
3869
+ ), m = Te(
3870
3870
  (E, I = 100) => {
3871
3871
  Py(h, E, I);
3872
3872
  },
3873
3873
  [h]
3874
- ), y = ke(
3874
+ ), y = Te(
3875
3875
  (E) => {
3876
3876
  Oy(h, E);
3877
3877
  },
3878
3878
  [h]
3879
- ), v = ke(() => {
3879
+ ), v = Te(() => {
3880
3880
  My(h);
3881
3881
  }, [h]), [x, w] = ye(
3882
3882
  () => {
@@ -3889,7 +3889,7 @@ function By({
3889
3889
  ki(f, (I = l.getAuthToken) == null ? void 0 : I.call(l))
3890
3890
  );
3891
3891
  return zo(E);
3892
- }), C = it(() => Ei(b), [b]), [S, k] = ye(t), [A, N] = ye(!1), [M, F] = ye(!1), [q, j] = ye(null), [_, D] = ye(null), [L, ne] = ye(null), [K, z] = ye([]), he = ke(() => {
3892
+ }), C = it(() => Ei(b), [b]), [S, k] = ye(t), [A, N] = ye(!1), [M, F] = ye(!1), [q, j] = ye(null), [_, D] = ye(null), [L, ne] = ye(null), [K, z] = ye([]), he = Te(() => {
3893
3893
  const E = Ri(x);
3894
3894
  Lo(() => {
3895
3895
  T(zo(E));
@@ -3901,12 +3901,12 @@ function By({
3901
3901
  prepend: st,
3902
3902
  pushUser: at,
3903
3903
  onEvent: gt,
3904
- reset: rt
3904
+ reset: nt
3905
3905
  } = fy(), Me = Le(S);
3906
3906
  dt(() => {
3907
3907
  Me.current = S;
3908
3908
  }, [S]);
3909
- const We = Le(!1), ut = Le([]), vt = Le(null), ft = Le(null), Qe = Le(/* @__PURE__ */ new Map()), ie = Le(S), _e = Le(!1), Re = Le(null), qe = Le(/* @__PURE__ */ new Map()), ot = Le(/* @__PURE__ */ new Map()), Pe = Le(/* @__PURE__ */ new Map()), Xe = Le(/* @__PURE__ */ new Map()), Et = ke(
3909
+ const We = Le(!1), ut = Le([]), vt = Le(null), ft = Le(null), Ze = Le(/* @__PURE__ */ new Map()), ie = Le(S), _e = Le(!1), ke = Le(null), qe = Le(/* @__PURE__ */ new Map()), rt = Le(/* @__PURE__ */ new Map()), Pe = Le(/* @__PURE__ */ new Map()), Xe = Le(/* @__PURE__ */ new Map()), Et = Te(
3910
3910
  (E) => {
3911
3911
  if (!E) {
3912
3912
  z([]);
@@ -3926,7 +3926,7 @@ function By({
3926
3926
  dt(() => {
3927
3927
  Et(S);
3928
3928
  }, [S, Et]);
3929
- const Tt = ke(() => {
3929
+ const Tt = Te(() => {
3930
3930
  var ee;
3931
3931
  const E = Xe.current;
3932
3932
  if (E.size <= hc) return;
@@ -3935,7 +3935,7 @@ function By({
3935
3935
  const Q = (ee = I[ae]) == null ? void 0 : ee[0];
3936
3936
  Q && E.delete(Q);
3937
3937
  }
3938
- }, []), qt = ke(
3938
+ }, []), qt = Te(
3939
3939
  (E, I, Y) => {
3940
3940
  if (!E) return;
3941
3941
  const ee = Y === "replace" ? [] : qe.current.get(E) ?? [], ae = Y === "replace" ? I : [...I, ...ee];
@@ -3946,44 +3946,44 @@ function By({
3946
3946
  const Q = /* @__PURE__ */ new Map();
3947
3947
  for (const He of ae) {
3948
3948
  if (!(He != null && He.checkpointId)) continue;
3949
- const De = `${He.checkpointId}::${He.checkpointNs ?? ""}`, et = on(He, { cloneMessages: !0 }), wt = Q.get(De);
3949
+ const De = `${He.checkpointId}::${He.checkpointNs ?? ""}`, Qe = on(He, { cloneMessages: !0 }), wt = Q.get(De);
3950
3950
  if (!wt) {
3951
- Q.set(De, et);
3951
+ Q.set(De, Qe);
3952
3952
  continue;
3953
3953
  }
3954
- const _t = mc(wt, et);
3954
+ const _t = mc(wt, Qe);
3955
3955
  Q.set(De, { ...wt, ..._t });
3956
3956
  }
3957
3957
  const Be = Array.from(Q.values()).sort((He, De) => {
3958
- const et = Number.isFinite(Date.parse(He.createdAt ?? "")) ? Date.parse(He.createdAt ?? "") : 0;
3959
- return (Number.isFinite(Date.parse(De.createdAt ?? "")) ? Date.parse(De.createdAt ?? "") : 0) - et;
3958
+ const Qe = Number.isFinite(Date.parse(He.createdAt ?? "")) ? Date.parse(He.createdAt ?? "") : 0;
3959
+ return (Number.isFinite(Date.parse(De.createdAt ?? "")) ? Date.parse(De.createdAt ?? "") : 0) - Qe;
3960
3960
  });
3961
3961
  qe.current.set(E, Be), E === Me.current && Et(E);
3962
3962
  },
3963
3963
  [Et]
3964
- ), It = ke(
3964
+ ), It = Te(
3965
3965
  (E, I, Y) => {
3966
3966
  if (!E) return;
3967
- const ee = ot.current.get(E), ae = Y === "replace" || !ee ? /* @__PURE__ */ new Map() : new Map(ee);
3967
+ const ee = rt.current.get(E), ae = Y === "replace" || !ee ? /* @__PURE__ */ new Map() : new Map(ee);
3968
3968
  if (I && typeof I == "object")
3969
3969
  for (const [Q, Be] of Object.entries(I)) {
3970
3970
  if (!(Be != null && Be.checkpointId)) continue;
3971
3971
  const He = Q || ro(Be.checkpointId, Be.checkpointNs ?? null);
3972
3972
  ae.set(He, on(Be, { cloneMessages: !0 }));
3973
3973
  }
3974
- ot.current.set(E, ae);
3974
+ rt.current.set(E, ae);
3975
3975
  },
3976
3976
  []
3977
- ), qn = ke(
3977
+ ), qn = Te(
3978
3978
  (E, I) => {
3979
3979
  const { threadId: Y, checkpointId: ee = null, checkpointNs: ae = null } = E, Q = pc(Y, ee, ae);
3980
3980
  if (I != null && I.force)
3981
3981
  Pe.current.delete(Q), Xe.current.delete(Q);
3982
3982
  else {
3983
3983
  if (I != null && I.preferCache) {
3984
- const et = Xe.current.get(Q);
3985
- if (et)
3986
- return Promise.resolve(et.payload);
3984
+ const Qe = Xe.current.get(Q);
3985
+ if (Qe)
3986
+ return Promise.resolve(Qe.payload);
3987
3987
  }
3988
3988
  const De = Pe.current.get(Q);
3989
3989
  if (De)
@@ -3999,7 +3999,7 @@ function By({
3999
3999
  return Pe.current.set(Q, He), He;
4000
4000
  },
4001
4001
  [l, Tt]
4002
- ), Gt = ke((E, I) => new Promise((Y, ee) => {
4002
+ ), Gt = Te((E, I) => new Promise((Y, ee) => {
4003
4003
  const ae = async () => {
4004
4004
  We.current = !0;
4005
4005
  try {
@@ -4023,7 +4023,7 @@ function By({
4023
4023
  const E = re.pendingInterrupt ?? Ry(re.messages);
4024
4024
  dc(L, E) || ne(E ?? null);
4025
4025
  }, [L, re.messages, re.pendingInterrupt]);
4026
- const Mt = ke(async () => {
4026
+ const Mt = Te(async () => {
4027
4027
  const E = dn.current > 0;
4028
4028
  E || N(!0);
4029
4029
  try {
@@ -4039,7 +4039,7 @@ function By({
4039
4039
  } finally {
4040
4040
  E || N(!1);
4041
4041
  }
4042
- }, [l, i]), Cn = Le(!1), fn = Le(null), xt = Le(null), hn = Le(""), Tn = ke(
4042
+ }, [l, i]), Cn = Le(!1), fn = Le(null), xt = Le(null), hn = Le(""), Tn = Te(
4043
4043
  (E, I) => {
4044
4044
  if (!xr()) return;
4045
4045
  xt.current !== null && (window.clearTimeout(xt.current), xt.current = null);
@@ -4072,9 +4072,9 @@ function By({
4072
4072
  }, ts);
4073
4073
  },
4074
4074
  [x]
4075
- ), ar = ke(() => {
4075
+ ), ar = Te(() => {
4076
4076
  Tn(C, { immediate: !0 });
4077
- }, [Tn, C]), Yt = ke(
4077
+ }, [Tn, C]), Yt = Te(
4078
4078
  (E, I, Y, ee) => {
4079
4079
  var Pl;
4080
4080
  const ae = Y ?? Me.current;
@@ -4087,7 +4087,7 @@ function By({
4087
4087
  threadId: ae,
4088
4088
  snapshot: on(E, { cloneMessages: !0 })
4089
4089
  };
4090
- Qe.current.set(ae, At), ie.current = ae;
4090
+ Ze.current.set(ae, At), ie.current = ae;
4091
4091
  }
4092
4092
  if (!Be)
4093
4093
  return;
@@ -4098,7 +4098,7 @@ function By({
4098
4098
  }), ne(Q.interrupt ?? null), xe(Q.nextCursor ?? null), ce(!!Q.nextCursor), O(Q.checkpointId ?? void 0), oe(Q.checkpointNs ?? void 0), se(Q.nextCursorNs ?? void 0);
4099
4099
  return;
4100
4100
  }
4101
- const De = Qe.current.get(ae), et = (De == null ? void 0 : De.snapshot) ?? null, wt = Array.isArray(et == null ? void 0 : et.messages) ? et.messages : [], _t = on(et), Rn = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], jt = /* @__PURE__ */ new Set(), Pt = [...Rn, ...wt].filter((At) => {
4101
+ const De = Ze.current.get(ae), Qe = (De == null ? void 0 : De.snapshot) ?? null, wt = Array.isArray(Qe == null ? void 0 : Qe.messages) ? Qe.messages : [], _t = on(Qe), Rn = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], jt = /* @__PURE__ */ new Set(), Pt = [...Rn, ...wt].filter((At) => {
4102
4102
  const yi = At == null ? void 0 : At.id;
4103
4103
  return yi ? jt.has(yi) ? !1 : (jt.add(yi), !0) : !0;
4104
4104
  }), Jr = mc(_t, Q), Zr = {
@@ -4116,7 +4116,7 @@ function By({
4116
4116
  interrupt: _t.interrupt ?? Q.interrupt ?? null,
4117
4117
  ...Jr
4118
4118
  };
4119
- if (Qe.current.set(ae, {
4119
+ if (Ze.current.set(ae, {
4120
4120
  threadId: ae,
4121
4121
  snapshot: on(Zr, { cloneMessages: !0 })
4122
4122
  }), !Be)
@@ -4136,7 +4136,7 @@ function By({
4136
4136
  );
4137
4137
  },
4138
4138
  [st, Ke, ne]
4139
- ), lr = ke(
4139
+ ), lr = Te(
4140
4140
  (E) => {
4141
4141
  if (E.threadId != null && E.threadId !== Me.current)
4142
4142
  return;
@@ -4148,24 +4148,24 @@ function By({
4148
4148
  }), ne(I.interrupt ?? null), xe(I.nextCursor ?? null), ce(!!I.nextCursor), O(I.checkpointId ?? void 0), oe(I.checkpointNs ?? void 0), se(I.nextCursorNs ?? void 0), ie.current = E.threadId, Et(E.threadId ?? Me.current ?? null);
4149
4149
  },
4150
4150
  [Ke, ne, Et]
4151
- ), kn = ke((E) => {
4151
+ ), kn = Te((E) => {
4152
4152
  if (!E) return;
4153
- Qe.current.delete(E), y(E), qe.current.delete(E), ot.current.delete(E), E === Me.current && z([]);
4153
+ Ze.current.delete(E), y(E), qe.current.delete(E), rt.current.delete(E), E === Me.current && z([]);
4154
4154
  const I = `${E}__`;
4155
4155
  for (const Y of Pe.current.keys())
4156
4156
  Y.startsWith(I) && Pe.current.delete(Y);
4157
4157
  for (const Y of Xe.current.keys())
4158
4158
  Y.startsWith(I) && Xe.current.delete(Y);
4159
4159
  ie.current === E && (ie.current = null);
4160
- }, [y]), pn = ke(() => {
4160
+ }, [y]), pn = Te(() => {
4161
4161
  const E = Me.current;
4162
- E && kn(E), rt([]), ce(!1), Z(!1), xe(null), O(void 0), oe(void 0), se(void 0);
4163
- }, [kn, rt]), Hn = ke(({ from: E, to: I }) => {
4162
+ E && kn(E), nt([]), ce(!1), Z(!1), xe(null), O(void 0), oe(void 0), se(void 0);
4163
+ }, [kn, nt]), Hn = Te(({ from: E, to: I }) => {
4164
4164
  const Y = Me.current;
4165
4165
  Y && console.warn(
4166
4166
  `[ChatSessionProvider] Stream sequence gap detected (${E} -> ${I}) for thread ${Y}`
4167
4167
  );
4168
- }, []), cr = ke(
4168
+ }, []), cr = Te(
4169
4169
  (E) => {
4170
4170
  const I = E.threadId;
4171
4171
  console.log("[ChatSessionProvider] 📥 Handling thread_info event:", {
@@ -4240,7 +4240,7 @@ function By({
4240
4240
  H(E);
4241
4241
  const I = (ae) => {
4242
4242
  const Q = ki(f, ae);
4243
- Re.current !== Q && (Re.current = Q, _e.current = !1), w(Q);
4243
+ ke.current !== Q && (ke.current = Q, _e.current = !1), w(Q);
4244
4244
  const Be = Ri(Q);
4245
4245
  Lo(() => {
4246
4246
  T(zo(Be));
@@ -4254,7 +4254,7 @@ function By({
4254
4254
  Y == null || Y();
4255
4255
  };
4256
4256
  }, [l, f, H, v]);
4257
- const le = ke(
4257
+ const le = Te(
4258
4258
  async (E) => {
4259
4259
  var ee;
4260
4260
  const I = `Thread ${(ee = crypto.randomUUID) == null ? void 0 : ee.call(crypto)}`, Y = {
@@ -4275,8 +4275,8 @@ function By({
4275
4275
  if (!He) return Be;
4276
4276
  const De = { ...Be.byId };
4277
4277
  delete De[I], De[Q] = { ...He, threadId: Q };
4278
- const et = Be.order.map((wt) => wt === I ? Q : wt);
4279
- return { byId: De, order: et };
4278
+ const Qe = Be.order.map((wt) => wt === I ? Q : wt);
4279
+ return { byId: De, order: Qe };
4280
4280
  }), k(Q), setTimeout(() => Mt(), 10), j(null), Q;
4281
4281
  } catch (ae) {
4282
4282
  throw T((Q) => {
@@ -4289,7 +4289,7 @@ function By({
4289
4289
  }
4290
4290
  },
4291
4291
  [l, Mt]
4292
- ), Ce = ke(
4292
+ ), Ce = Te(
4293
4293
  async (E) => {
4294
4294
  try {
4295
4295
  await l.deleteThread(E);
@@ -4306,7 +4306,7 @@ function By({
4306
4306
  }
4307
4307
  },
4308
4308
  [l, pn, kn, Mt, Tn]
4309
- ), Ge = ke(
4309
+ ), Ge = Te(
4310
4310
  async (E, I) => {
4311
4311
  try {
4312
4312
  await l.updateThread(E, I), T((Y) => {
@@ -4321,7 +4321,7 @@ function By({
4321
4321
  }
4322
4322
  },
4323
4323
  [l, Mt]
4324
- ), ze = ke(
4324
+ ), ze = Te(
4325
4325
  async (E, I, Y, ee = !1) => {
4326
4326
  await Gt(async () => {
4327
4327
  if (ft.current === E && !ee) {
@@ -4335,15 +4335,15 @@ function By({
4335
4335
  E,
4336
4336
  I ?? null,
4337
4337
  Y ?? null
4338
- ), He = Xe.current.get(Be), De = !ee && !I && !Y && He && Date.now() - He.timestamp < Ly, et = !ee && !I && !Y;
4338
+ ), He = Xe.current.get(Be), De = !ee && !I && !Y && He && Date.now() - He.timestamp < Ly, Qe = !ee && !I && !Y;
4339
4339
  let wt = !1;
4340
- if (et) {
4341
- const jt = Qe.current.get(E);
4340
+ if (Qe) {
4341
+ const jt = Ze.current.get(E);
4342
4342
  if (jt)
4343
4343
  lr(jt), wt = !0;
4344
4344
  else {
4345
4345
  const Pt = p(E);
4346
- Pt && (Qe.current.set(E, Pt), lr(Pt), wt = !0);
4346
+ Pt && (Ze.current.set(E, Pt), lr(Pt), wt = !0);
4347
4347
  }
4348
4348
  }
4349
4349
  const _t = ee || !wt || !!I || !!Y, Rn = async (jt) => {
@@ -4360,7 +4360,7 @@ function By({
4360
4360
  vt.current = null, jt && F(!1);
4361
4361
  }
4362
4362
  };
4363
- _t ? await Rn(!0) : et && wt && !De && Rn(!1).catch((jt) => {
4363
+ _t ? await Rn(!0) : Qe && wt && !De && Rn(!1).catch((jt) => {
4364
4364
  console.warn("[ChatSessionProvider] Background refresh failed:", jt);
4365
4365
  });
4366
4366
  }, `loadThread-${E}`);
@@ -4374,7 +4374,7 @@ function By({
4374
4374
  qt,
4375
4375
  It
4376
4376
  ]
4377
- ), Fe = ke(async () => {
4377
+ ), Fe = Te(async () => {
4378
4378
  await Gt(async () => {
4379
4379
  const E = Me.current;
4380
4380
  E && kn(E), ft.current = null, k(null), Me.current = null, ie.current = null, pn(), O(void 0), oe(void 0), se(void 0), z([]);
@@ -4384,12 +4384,12 @@ function By({
4384
4384
  console.warn("[ChatSessionProvider] Failed to clear lastThreadId:", I);
4385
4385
  }
4386
4386
  }, "clearCurrentThread");
4387
- }, [pn, kn, Gt]), $ = ke(
4387
+ }, [pn, kn, Gt]), $ = Te(
4388
4388
  async (E, I) => {
4389
4389
  var Q;
4390
4390
  const Y = Me.current;
4391
4391
  if (!Y) throw new Error("No active thread");
4392
- const ee = ro(E, I ?? null), ae = (Q = ot.current.get(Y)) == null ? void 0 : Q.get(ee);
4392
+ const ee = ro(E, I ?? null), ae = (Q = rt.current.get(Y)) == null ? void 0 : Q.get(ee);
4393
4393
  if (ae) {
4394
4394
  await Gt(async () => {
4395
4395
  Yt(ae, "replace", Y, { persist: !1 });
@@ -4399,10 +4399,10 @@ function By({
4399
4399
  await ze(Y, E, I ?? void 0, !0);
4400
4400
  },
4401
4401
  [Yt, Gt, ze]
4402
- ), de = ke(async () => {
4402
+ ), ue = Te(async () => {
4403
4403
  if (!Me.current) throw new Error("No active thread");
4404
4404
  await ze(Me.current, void 0, void 0, !0);
4405
- }, [ze]), ue = ke(
4405
+ }, [ze]), de = Te(
4406
4406
  async () => {
4407
4407
  if (!Me.current) throw new Error("No active thread");
4408
4408
  if (B || !W) return;
@@ -4414,13 +4414,13 @@ function By({
4414
4414
  threadId: I,
4415
4415
  checkpointId: E ?? G ?? null,
4416
4416
  checkpointNs: ge ?? X ?? null
4417
- }), { latest: ee, checkpoints: ae, snapshots: Q } = ra(Y), Be = I ? ot.current.get(I) : null;
4417
+ }), { latest: ee, checkpoints: ae, snapshots: Q } = ra(Y), Be = I ? rt.current.get(I) : null;
4418
4418
  let He = ae.length > 0;
4419
4419
  if (He && Be && Be.size > 0 && (He = ae.some((De) => {
4420
4420
  if (!(De != null && De.checkpointId))
4421
4421
  return !1;
4422
- const et = ro(De.checkpointId, De.checkpointNs ?? null);
4423
- return !Be.has(et);
4422
+ const Qe = ro(De.checkpointId, De.checkpointNs ?? null);
4423
+ return !Be.has(Qe);
4424
4424
  })), !He) {
4425
4425
  xe(null), se(void 0), ce(!1), D(null);
4426
4426
  return;
@@ -4445,7 +4445,7 @@ function By({
4445
4445
  qt,
4446
4446
  It
4447
4447
  ]
4448
- ), Te = ke(
4448
+ ), Re = Te(
4449
4449
  (E) => {
4450
4450
  if (E != null && E.threadId) {
4451
4451
  if (E.checkpointId) {
@@ -4462,7 +4462,7 @@ function By({
4462
4462
  }
4463
4463
  },
4464
4464
  [Yt, It]
4465
- ), Je = ke(
4465
+ ), ot = Te(
4466
4466
  async (E, I) => {
4467
4467
  var Qr;
4468
4468
  const Y = Me.current, ee = (E == null ? void 0 : E.text) ?? "", ae = (E == null ? void 0 : E.attachments) ?? [], Q = ae.length ? ae : (I == null ? void 0 : I.attachments) ?? [], Be = {
@@ -4477,19 +4477,19 @@ function By({
4477
4477
  const { contentParts: He, filesInfo: De } = await Kx(
4478
4478
  l,
4479
4479
  Q
4480
- ), et = [...He];
4481
- ee && ee.trim() && et.push({ type: "text", text: ee.trim() });
4480
+ ), Qe = [...He];
4481
+ ee && ee.trim() && Qe.push({ type: "text", text: ee.trim() });
4482
4482
  const wt = !!Y, _t = wt ? (I == null ? void 0 : I.checkpointId) ?? re.lastCheckpointId ?? void 0 : void 0, Rn = wt ? (I == null ? void 0 : I.checkpointNs) ?? re.lastCheckpointNs ?? void 0 : void 0, jt = {
4483
4483
  id: ((Qr = crypto.randomUUID) == null ? void 0 : Qr.call(crypto)) || `user-${Date.now()}`,
4484
4484
  role: "user",
4485
- content: et,
4485
+ content: Qe,
4486
4486
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
4487
4487
  ..._t != null ? { checkpointId: _t } : {},
4488
4488
  ...Rn != null ? { checkpointNs: Rn } : {}
4489
4489
  };
4490
- et.length > 0 && at(jt);
4491
- const Pt = { ...jt, content: et }, Jr = Q.length > 0, Zr = {
4492
- messages: et.length > 0 ? [Pt] : [],
4490
+ Qe.length > 0 && at(jt);
4491
+ const Pt = { ...jt, content: Qe }, Jr = Q.length > 0, Zr = {
4492
+ messages: Qe.length > 0 ? [Pt] : [],
4493
4493
  files_info: De,
4494
4494
  ...o && Jr && s ? { active_agent: s } : {},
4495
4495
  ...Be
@@ -4526,7 +4526,7 @@ function By({
4526
4526
  at,
4527
4527
  Ar
4528
4528
  ]
4529
- ), Dt = ke(
4529
+ ), Dt = Te(
4530
4530
  async (E, I, Y) => {
4531
4531
  if (!Me.current)
4532
4532
  throw new Error("No active thread to handle interrupt");
@@ -4537,7 +4537,7 @@ function By({
4537
4537
  } catch (Q) {
4538
4538
  console.warn("[ChatSessionProvider] optimistic interrupt_response dispatch failed:", Q);
4539
4539
  }
4540
- await Je(
4540
+ await ot(
4541
4541
  { payload: {} },
4542
4542
  {
4543
4543
  checkpointId: re.lastCheckpointId ?? void 0,
@@ -4549,7 +4549,7 @@ function By({
4549
4549
  throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${E}:`, Q), Q;
4550
4550
  }
4551
4551
  },
4552
- [Ue, re.lastCheckpointId, re.lastCheckpointNs, Je]
4552
+ [Ue, re.lastCheckpointId, re.lastCheckpointNs, ot]
4553
4553
  );
4554
4554
  dt(() => {
4555
4555
  if (a == null || a(S), S)
@@ -4585,9 +4585,9 @@ function By({
4585
4585
  nextCursor: we ?? null,
4586
4586
  nextCursorNs: ge ?? null,
4587
4587
  interrupt: re.pendingInterrupt ?? L ?? null
4588
- }), Y = Qe.current.get(E), ee = Y == null ? void 0 : Y.snapshot, ae = !ee || ee.messages.length !== I.messages.length || ee.messages.some((De, et) => {
4588
+ }), Y = Ze.current.get(E), ee = Y == null ? void 0 : Y.snapshot, ae = !ee || ee.messages.length !== I.messages.length || ee.messages.some((De, Qe) => {
4589
4589
  var wt;
4590
- return (De == null ? void 0 : De.id) !== ((wt = I.messages[et]) == null ? void 0 : wt.id);
4590
+ return (De == null ? void 0 : De.id) !== ((wt = I.messages[Qe]) == null ? void 0 : wt.id);
4591
4591
  }), Q = ((ee == null ? void 0 : ee.checkpointId) ?? null) !== I.checkpointId || ((ee == null ? void 0 : ee.checkpointNs) ?? null) !== I.checkpointNs, Be = ((ee == null ? void 0 : ee.nextCursor) ?? null) !== I.nextCursor || ((ee == null ? void 0 : ee.nextCursorNs) ?? null) !== I.nextCursorNs, He = !dc(
4592
4592
  (ee == null ? void 0 : ee.interrupt) ?? null,
4593
4593
  I.interrupt ?? null
@@ -4597,11 +4597,11 @@ function By({
4597
4597
  threadId: E,
4598
4598
  snapshot: I
4599
4599
  };
4600
- Qe.current.set(E, De), fn.current && window.clearTimeout(fn.current), fn.current = window.setTimeout(() => {
4600
+ Ze.current.set(E, De), fn.current && window.clearTimeout(fn.current), fn.current = window.setTimeout(() => {
4601
4601
  try {
4602
4602
  m(De, 100);
4603
- } catch (et) {
4604
- console.warn("[ChatSessionProvider] Failed to persist thread payload:", et);
4603
+ } catch (Qe) {
4604
+ console.warn("[ChatSessionProvider] Failed to persist thread payload:", Qe);
4605
4605
  }
4606
4606
  }, ts);
4607
4607
  }
@@ -4664,11 +4664,11 @@ function By({
4664
4664
  isHistoryLoading: B,
4665
4665
  error: _,
4666
4666
  hasMore: W,
4667
- loadOlder: ue,
4668
- seedFromSnapshot: Te,
4667
+ loadOlder: de,
4668
+ seedFromSnapshot: Re,
4669
4669
  clearState: pn,
4670
4670
  navigateToCheckpoint: $,
4671
- returnToLatest: de,
4671
+ returnToLatest: ue,
4672
4672
  loadThread: ze,
4673
4673
  clearThread: Fe,
4674
4674
  respondToInterrupt: Dt
@@ -4681,7 +4681,7 @@ function By({
4681
4681
  W,
4682
4682
  B,
4683
4683
  M,
4684
- ue,
4684
+ de,
4685
4685
  ze,
4686
4686
  re.assemblingId,
4687
4687
  re.lastBranch,
@@ -4690,20 +4690,20 @@ function By({
4690
4690
  re.messages,
4691
4691
  $,
4692
4692
  Dt,
4693
- de,
4694
- Te,
4693
+ ue,
4694
+ Re,
4695
4695
  _,
4696
4696
  K
4697
4697
  ]), Xr = it(
4698
4698
  () => ({
4699
4699
  isStreaming: Gn,
4700
4700
  error: R,
4701
- submit: Je,
4702
- send: Je,
4701
+ submit: ot,
4702
+ send: ot,
4703
4703
  stop: Nr,
4704
4704
  setAuthToken: H
4705
4705
  }),
4706
- [Gn, R, Je, Nr, H]
4706
+ [Gn, R, ot, Nr, H]
4707
4707
  );
4708
4708
  return /* @__PURE__ */ u.jsx(Dy.Provider, { value: !0, children: /* @__PURE__ */ u.jsx(id.Provider, { value: Xr, children: /* @__PURE__ */ u.jsx(od.Provider, { value: nn, children: /* @__PURE__ */ u.jsx(sd.Provider, { value: kt, children: e }) }) }) });
4709
4709
  }
@@ -4777,7 +4777,7 @@ const Uy = Os(
4777
4777
  size: "default"
4778
4778
  }
4779
4779
  }
4780
- ), tt = g.forwardRef(
4780
+ ), et = g.forwardRef(
4781
4781
  ({ className: e, variant: t, size: n, asChild: r = !1, ...o }, s) => {
4782
4782
  const i = r ? ig : "button";
4783
4783
  return /* @__PURE__ */ u.jsx(
@@ -4790,7 +4790,7 @@ const Uy = Os(
4790
4790
  );
4791
4791
  }
4792
4792
  );
4793
- tt.displayName = "Button";
4793
+ et.displayName = "Button";
4794
4794
  const ad = g.forwardRef(
4795
4795
  ({ className: e, ...t }, n) => /* @__PURE__ */ u.jsx(
4796
4796
  "textarea",
@@ -4891,7 +4891,7 @@ function Wy({
4891
4891
  }
4892
4892
  ) }),
4893
4893
  /* @__PURE__ */ u.jsx("div", { children: r ? /* @__PURE__ */ u.jsx(
4894
- tt,
4894
+ et,
4895
4895
  {
4896
4896
  type: "button",
4897
4897
  onClick: () => {
@@ -4905,7 +4905,7 @@ function Wy({
4905
4905
  children: /* @__PURE__ */ u.jsx(Fm, { size: 16 })
4906
4906
  }
4907
4907
  ) : /* @__PURE__ */ u.jsx(
4908
- tt,
4908
+ et,
4909
4909
  {
4910
4910
  type: "submit",
4911
4911
  size: "icon",
@@ -4952,7 +4952,7 @@ function Yy(e, t) {
4952
4952
  function pt(...e) {
4953
4953
  return e;
4954
4954
  }
4955
- function nt(e, t) {
4955
+ function tt(e, t) {
4956
4956
  return e(nr, t);
4957
4957
  }
4958
4958
  function Oe(e, t) {
@@ -4965,7 +4965,7 @@ function bt(e) {
4965
4965
  return e(ld);
4966
4966
  }
4967
4967
  function ve(e, t) {
4968
- return nt(e, qy(t, Bs));
4968
+ return tt(e, qy(t, Bs));
4969
4969
  }
4970
4970
  function xn(e, t) {
4971
4971
  const n = e(nr, (r) => {
@@ -5011,7 +5011,7 @@ function V(e, ...t) {
5011
5011
  Ua(e);
5012
5012
  return;
5013
5013
  case nr:
5014
- return nt(e, n(o));
5014
+ return tt(e, n(o));
5015
5015
  }
5016
5016
  };
5017
5017
  }
@@ -5039,7 +5039,7 @@ function $e(...e) {
5039
5039
  const o = Math.pow(2, e.length) - 1;
5040
5040
  return e.forEach((s, i) => {
5041
5041
  const a = Math.pow(2, i);
5042
- nt(s, (l) => {
5042
+ tt(s, (l) => {
5043
5043
  const c = n;
5044
5044
  n = n | a, t[i] = l, c !== o && n === o && r && (r(), r = null);
5045
5045
  });
@@ -5059,7 +5059,7 @@ function Jy(e) {
5059
5059
  return function(o, s) {
5060
5060
  switch (o) {
5061
5061
  case nr:
5062
- return s ? n === s ? void 0 : (r(), n = s, t = nt(e, s), t) : (r(), Kr);
5062
+ return s ? n === s ? void 0 : (r(), n = s, t = tt(e, s), t) : (r(), Kr);
5063
5063
  case Vr:
5064
5064
  r(), n = null;
5065
5065
  return;
@@ -5110,7 +5110,7 @@ function Ye() {
5110
5110
  function Zt(e) {
5111
5111
  return Hs(Ye(), (t) => ve(e, t));
5112
5112
  }
5113
- function Ze(e, t = [], { singleton: n } = { singleton: !0 }) {
5113
+ function Je(e, t = [], { singleton: n } = { singleton: !0 }) {
5114
5114
  return {
5115
5115
  constructor: e,
5116
5116
  dependencies: t,
@@ -5134,7 +5134,7 @@ function Ct(...e) {
5134
5134
  const o = Math.pow(2, e.length) - 1;
5135
5135
  return e.forEach((s, i) => {
5136
5136
  const a = Math.pow(2, i);
5137
- nt(s, (l) => {
5137
+ tt(s, (l) => {
5138
5138
  n[i] = l, r = r | a, r === o && Oe(t, n);
5139
5139
  });
5140
5140
  }), function(s, i) {
@@ -5144,7 +5144,7 @@ function Ct(...e) {
5144
5144
  return;
5145
5145
  }
5146
5146
  case nr:
5147
- return r === o && i(n), nt(t, i);
5147
+ return r === o && i(n), tt(t, i);
5148
5148
  }
5149
5149
  };
5150
5150
  }
@@ -5157,7 +5157,7 @@ function la(...e) {
5157
5157
  case Vr:
5158
5158
  return;
5159
5159
  case nr:
5160
- return Gy(...e.map((r) => nt(r, n)));
5160
+ return Gy(...e.map((r) => tt(r, n)));
5161
5161
  }
5162
5162
  };
5163
5163
  }
@@ -5167,7 +5167,7 @@ const ev = {
5167
5167
  3: "error",
5168
5168
  1: "log",
5169
5169
  2: "warn"
5170
- }, tv = () => typeof globalThis > "u" ? window : globalThis, rr = Ze(
5170
+ }, tv = () => typeof globalThis > "u" ? window : globalThis, rr = Je(
5171
5171
  () => {
5172
5172
  const e = J(
5173
5173
  3
@@ -5295,7 +5295,7 @@ function dd(e, t, n) {
5295
5295
  }
5296
5296
  }, [a, t, i]), s;
5297
5297
  }
5298
- const Bt = Ze(
5298
+ const Bt = Je(
5299
5299
  () => {
5300
5300
  const e = Ye(), t = Ye(), n = J(0), r = Ye(), o = J(0), s = Ye(), i = Ye(), a = J(0), l = J(0), c = J(0), d = J(0), f = Ye(), h = Ye(), p = J(!1), m = J(!1), y = J(!1);
5301
5301
  return ve(
@@ -5476,7 +5476,7 @@ function xd(e, t) {
5476
5476
  function xo(e, t) {
5477
5477
  return !!(e && e[0] === t[0] && e[1] === t[1]);
5478
5478
  }
5479
- const Va = Ze(
5479
+ const Va = Je(
5480
5480
  () => ({ recalcInProgress: J(!1) }),
5481
5481
  [],
5482
5482
  { singleton: !0 }
@@ -5643,7 +5643,7 @@ function pv(e) {
5643
5643
  const mv = {
5644
5644
  offsetHeight: "height",
5645
5645
  offsetWidth: "width"
5646
- }, Fn = Ze(
5646
+ }, Fn = Je(
5647
5647
  ([{ log: e }, { recalcInProgress: t }]) => {
5648
5648
  const n = Ye(), r = Ye(), o = zt(r, 0), s = Ye(), i = Ye(), a = J(0), l = J([]), c = J(void 0), d = J(void 0), f = J((C, S) => Jn(C, mv[S])), h = J(void 0), p = J(0), m = iv(), y = zt(
5649
5649
  V(n, $e(l, e, p), Pn(dv, m), ht()),
@@ -5719,7 +5719,7 @@ const mv = {
5719
5719
  fe((C) => C.changed)
5720
5720
  )
5721
5721
  );
5722
- nt(
5722
+ tt(
5723
5723
  V(
5724
5724
  a,
5725
5725
  Pn(
@@ -5737,7 +5737,7 @@ const mv = {
5737
5737
  k.length > 0 && (C -= bc(-C, k)), Oe(i, C);
5738
5738
  }
5739
5739
  }
5740
- ), nt(V(a, $e(e)), ([C, S]) => {
5740
+ ), tt(V(a, $e(e)), ([C, S]) => {
5741
5741
  C < 0 && S(
5742
5742
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
5743
5743
  { firstItemIndex: a },
@@ -5888,7 +5888,7 @@ function gv(e) {
5888
5888
  }
5889
5889
  );
5890
5890
  }
5891
- const bd = Ze(
5891
+ const bd = Je(
5892
5892
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
5893
5893
  const s = Ye(), i = Ye(), a = Zt(V(s, fe(gv)));
5894
5894
  return ve(
@@ -5915,7 +5915,7 @@ const bd = Ze(
5915
5915
  ), { groupCounts: s, topItemsIndexes: i };
5916
5916
  },
5917
5917
  pt(Fn, Bt)
5918
- ), or = Ze(
5918
+ ), or = Je(
5919
5919
  ([{ log: e }]) => {
5920
5920
  const t = J(!1), n = Zt(
5921
5921
  V(
@@ -5924,7 +5924,7 @@ const bd = Ze(
5924
5924
  ht()
5925
5925
  )
5926
5926
  );
5927
- return nt(t, (r) => {
5927
+ return tt(t, (r) => {
5928
5928
  r && bt(e)("props updated", {}, Kt.DEBUG);
5929
5929
  }), { didMount: n, propsReady: t };
5930
5930
  },
@@ -5935,7 +5935,7 @@ function Sd(e) {
5935
5935
  const t = typeof e == "number" ? { index: e } : e;
5936
5936
  return t.align || (t.align = "start"), (!t.behavior || !xv) && (t.behavior = "auto"), t.offset || (t.offset = 0), t;
5937
5937
  }
5938
- const No = Ze(
5938
+ const No = Je(
5939
5939
  ([
5940
5940
  { gap: e, listRefresh: t, sizes: n, totalCount: r },
5941
5941
  {
@@ -5975,7 +5975,7 @@ const No = Ze(
5975
5975
  };
5976
5976
  if (b(), ne === "smooth") {
5977
5977
  let B = !1;
5978
- w = nt(t, (Z) => {
5978
+ w = tt(t, (Z) => {
5979
5979
  B = B || Z;
5980
5980
  }), v = xn(d, () => {
5981
5981
  ce(B);
@@ -6017,7 +6017,7 @@ function Ga(e, t) {
6017
6017
  const n = t - 1;
6018
6018
  return typeof e == "number" ? e : e.index === "LAST" ? n : e.index;
6019
6019
  }
6020
- const _o = Ze(
6020
+ const _o = Je(
6021
6021
  ([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
6022
6022
  const a = J(!0), l = J(0), c = J(!0);
6023
6023
  return ve(
@@ -6036,7 +6036,7 @@ const _o = Ze(
6036
6036
  _n(!1)
6037
6037
  ),
6038
6038
  c
6039
- ), nt(
6039
+ ), tt(
6040
6040
  V(
6041
6041
  Ct(t, i),
6042
6042
  $e(a, n, e, c),
@@ -6073,7 +6073,7 @@ const vo = "up", ao = "down", vv = "none", wv = {
6073
6073
  scrollTop: 0,
6074
6074
  viewportHeight: 0
6075
6075
  }
6076
- }, bv = 0, jo = Ze(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
6076
+ }, bv = 0, jo = Je(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
6077
6077
  const i = J(!1), a = J(!0), l = Ye(), c = Ye(), d = J(4), f = J(bv), h = zt(
6078
6078
  V(
6079
6079
  la(V(Ee(o), yr(1), _n(!0)), V(Ee(o), yr(1), _n(!1), yc(100))),
@@ -6213,7 +6213,7 @@ function Tc(e, t) {
6213
6213
  var n;
6214
6214
  return typeof e == "number" ? e : (n = e[t]) != null ? n : 0;
6215
6215
  }
6216
- const Ya = Ze(
6216
+ const Ya = Je(
6217
6217
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
6218
6218
  const s = Ye(), i = J(0), a = J(0), l = J(0), c = zt(
6219
6219
  V(
@@ -6351,7 +6351,7 @@ function kc(e, t, n) {
6351
6351
  }
6352
6352
  return s;
6353
6353
  }
6354
- const kr = Ze(
6354
+ const kr = Je(
6355
6355
  ([
6356
6356
  { data: e, firstItemIndex: t, gap: n, sizes: r, totalCount: o },
6357
6357
  s,
@@ -6526,7 +6526,7 @@ const kr = Ze(
6526
6526
  Va
6527
6527
  ),
6528
6528
  { singleton: !0 }
6529
- ), kd = Ze(
6529
+ ), kd = Je(
6530
6530
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
6531
6531
  const s = Ye(), i = zt(
6532
6532
  V(
@@ -6539,7 +6539,7 @@ const kr = Ze(
6539
6539
  },
6540
6540
  pt(Bt, kr),
6541
6541
  { singleton: !0 }
6542
- ), Cv = Ze(
6542
+ ), Cv = Je(
6543
6543
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
6544
6544
  const n = J(!1), r = zt(
6545
6545
  V(
@@ -6555,7 +6555,7 @@ const kr = Ze(
6555
6555
  },
6556
6556
  pt(Bt, kd),
6557
6557
  { singleton: !0 }
6558
- ), Rd = Ze(() => ({
6558
+ ), Rd = Je(() => ({
6559
6559
  context: J(null)
6560
6560
  })), Tv = ({
6561
6561
  itemBottom: e,
@@ -6563,7 +6563,7 @@ const kr = Ze(
6563
6563
  locationParams: { align: n, behavior: r, ...o },
6564
6564
  viewportBottom: s,
6565
6565
  viewportTop: i
6566
- }) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Ed = Ze(
6566
+ }) => t < i ? { ...o, align: n ?? "start", behavior: r } : e > s ? { ...o, align: n ?? "end", behavior: r } : null, Ed = Je(
6567
6567
  ([
6568
6568
  { gap: e, sizes: t, totalCount: n },
6569
6569
  { fixedFooterHeight: r, fixedHeaderHeight: o, headerHeight: s, scrollingInProgress: i, scrollTop: a, viewportHeight: l },
@@ -6607,7 +6607,7 @@ const kr = Ze(
6607
6607
  function Rc(e) {
6608
6608
  return e ? e === "smooth" ? "smooth" : "auto" : !1;
6609
6609
  }
6610
- const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6610
+ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Je(
6611
6611
  ([
6612
6612
  { listRefresh: e, totalCount: t, fixedItemSize: n, data: r },
6613
6613
  { atBottomState: o, isAtBottom: s },
@@ -6628,7 +6628,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6628
6628
  index: "LAST"
6629
6629
  });
6630
6630
  }
6631
- nt(
6631
+ tt(
6632
6632
  V(
6633
6633
  Ct(V(Ee(t), yr(1)), l),
6634
6634
  $e(Ee(m), s, a, f),
@@ -6652,7 +6652,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6652
6652
  });
6653
6653
  setTimeout(S, 100);
6654
6654
  }
6655
- nt(
6655
+ tt(
6656
6656
  V(
6657
6657
  Ct(Ee(m), t, c),
6658
6658
  Ie(([C, , S]) => C && S),
@@ -6666,9 +6666,9 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6666
6666
  ([, C]) => {
6667
6667
  bt(a) && w(C !== !1);
6668
6668
  }
6669
- ), nt(y, () => {
6669
+ ), tt(y, () => {
6670
6670
  w(bt(m) !== !1);
6671
- }), nt(Ct(Ee(m), o), ([C, S]) => {
6671
+ }), tt(Ct(Ee(m), o), ([C, S]) => {
6672
6672
  C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && x("auto");
6673
6673
  });
6674
6674
  const b = J(null), T = Ye();
@@ -6684,7 +6684,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6684
6684
  V(Ee(t))
6685
6685
  ),
6686
6686
  T
6687
- ), nt(
6687
+ ), tt(
6688
6688
  V(
6689
6689
  Ct(V(T, yr(1)), l),
6690
6690
  $e(Ee(b), a, f, h),
@@ -6712,7 +6712,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6712
6712
  Rd,
6713
6713
  Ed
6714
6714
  )
6715
- ), Ev = Ze(
6715
+ ), Ev = Je(
6716
6716
  ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (ve(
6717
6717
  V(
6718
6718
  a,
@@ -6725,10 +6725,10 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6725
6725
  ), {}),
6726
6726
  pt(Fn, _o, kr, or),
6727
6727
  { singleton: !0 }
6728
- ), Iv = Ze(
6728
+ ), Iv = Je(
6729
6729
  ([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
6730
6730
  const r = J(0);
6731
- return nt(
6731
+ return tt(
6732
6732
  V(
6733
6733
  e,
6734
6734
  $e(r),
@@ -6755,7 +6755,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6755
6755
  },
6756
6756
  pt(or, Bt, kr),
6757
6757
  { singleton: !0 }
6758
- ), Id = Ze(
6758
+ ), Id = Je(
6759
6759
  ([{ scrollVelocity: e }]) => {
6760
6760
  const t = J(!1), n = Ye(), r = J(!1);
6761
6761
  return ve(
@@ -6775,7 +6775,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6775
6775
  ht()
6776
6776
  ),
6777
6777
  t
6778
- ), nt(
6778
+ ), tt(
6779
6779
  V(Ct(t, e, n), $e(r)),
6780
6780
  ([[o, s, i], a]) => {
6781
6781
  o && a && a.change && a.change(s, i);
@@ -6784,7 +6784,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6784
6784
  },
6785
6785
  pt(jo),
6786
6786
  { singleton: !0 }
6787
- ), Xa = Ze(([{ scrollContainerState: e, scrollTo: t }]) => {
6787
+ ), Xa = Je(([{ scrollContainerState: e, scrollTo: t }]) => {
6788
6788
  const n = Ye(), r = Ye(), o = Ye(), s = J(!1), i = J(void 0);
6789
6789
  return ve(
6790
6790
  V(
@@ -6816,7 +6816,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6816
6816
  windowScrollTo: o,
6817
6817
  windowViewportRect: r
6818
6818
  };
6819
- }, pt(Bt)), Av = Ze(
6819
+ }, pt(Bt)), Av = Je(
6820
6820
  ([
6821
6821
  { sizeRanges: e, sizes: t },
6822
6822
  { headerHeight: n, scrollTop: r },
@@ -6825,7 +6825,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6825
6825
  { useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
6826
6826
  ]) => {
6827
6827
  const c = Ye(), d = J(void 0), f = J(null), h = J(null);
6828
- return ve(a, f), ve(l, h), nt(
6828
+ return ve(a, f), ve(l, h), tt(
6829
6829
  V(
6830
6830
  c,
6831
6831
  $e(t, r, i, f, h, n)
@@ -6853,7 +6853,7 @@ const kv = (e, t) => typeof e == "function" ? Rc(e(t)) : t && Rc(e), Rv = Ze(
6853
6853
  function Nv(e) {
6854
6854
  return { align: "start", index: 0, offset: e.scrollTop };
6855
6855
  }
6856
- const _v = Ze(([{ topItemsIndexes: e }]) => {
6856
+ const _v = Je(([{ topItemsIndexes: e }]) => {
6857
6857
  const t = J(0);
6858
6858
  return ve(
6859
6859
  V(
@@ -6868,7 +6868,7 @@ function Ad(e) {
6868
6868
  let t = !1, n;
6869
6869
  return () => (t || (t = !0, n = e()), n);
6870
6870
  }
6871
- const jv = Ad(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Pv = Ze(
6871
+ const jv = Ad(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Pv = Je(
6872
6872
  ([
6873
6873
  { deviation: e, scrollBy: t, scrollingInProgress: n, scrollTop: r },
6874
6874
  { isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
@@ -6898,9 +6898,9 @@ const jv = Ad(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6898
6898
  function v(x) {
6899
6899
  x > 0 ? (Oe(t, { behavior: "auto", top: -x }), Oe(e, 0)) : (Oe(e, 0), Oe(t, { behavior: "auto", top: -x }));
6900
6900
  }
6901
- return nt(V(y, $e(e, s)), ([x, w, b]) => {
6901
+ return tt(V(y, $e(e, s)), ([x, w, b]) => {
6902
6902
  b && jv() ? Oe(e, w - x) : v(-x);
6903
- }), nt(
6903
+ }), tt(
6904
6904
  V(
6905
6905
  Ct(zt(s, !1), e, m),
6906
6906
  Ie(([x, w, b]) => !x && !b && w !== 0),
@@ -6914,7 +6914,7 @@ const jv = Ad(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6914
6914
  fe((x) => ({ top: -x }))
6915
6915
  ),
6916
6916
  t
6917
- ), nt(
6917
+ ), tt(
6918
6918
  V(
6919
6919
  c,
6920
6920
  $e(h, d),
@@ -6947,7 +6947,7 @@ const jv = Ad(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6947
6947
  ), { deviation: e };
6948
6948
  },
6949
6949
  pt(Bt, jo, kr, Fn, rr, Va)
6950
- ), Ov = Ze(
6950
+ ), Ov = Je(
6951
6951
  ([
6952
6952
  e,
6953
6953
  t,
@@ -6986,7 +6986,7 @@ const jv = Ad(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6986
6986
  rr,
6987
6987
  Rd
6988
6988
  )
6989
- ), Nd = Ze(
6989
+ ), Nd = Je(
6990
6990
  ([
6991
6991
  {
6992
6992
  data: e,
@@ -7104,7 +7104,7 @@ function _d(e, t, n) {
7104
7104
  })), [C] = U.useState(xc(d, T));
7105
7105
  Bo(() => {
7106
7106
  for (const k of i)
7107
- k in b && nt(C[k], b[k]);
7107
+ k in b && tt(C[k], b[k]);
7108
7108
  return () => {
7109
7109
  Object.values(C).map(Ua);
7110
7110
  };
@@ -7123,7 +7123,7 @@ function _d(e, t, n) {
7123
7123
  );
7124
7124
  }, p = (v) => {
7125
7125
  const x = U.useContext(a)[v], w = U.useCallback(
7126
- (b) => nt(x, b),
7126
+ (b) => tt(x, b),
7127
7127
  [x]
7128
7128
  );
7129
7129
  return U.useSyncExternalStore(
@@ -7134,7 +7134,7 @@ function _d(e, t, n) {
7134
7134
  }, m = (v) => {
7135
7135
  const x = U.useContext(a)[v], [w, b] = U.useState(xc(bt, x));
7136
7136
  return Bo(
7137
- () => nt(x, (T) => {
7137
+ () => tt(x, (T) => {
7138
7138
  T !== w && b(gc(T));
7139
7139
  }),
7140
7140
  [x, w]
@@ -7144,7 +7144,7 @@ function _d(e, t, n) {
7144
7144
  Component: f,
7145
7145
  useEmitter: (v, x) => {
7146
7146
  const w = U.useContext(a)[v];
7147
- Bo(() => nt(w, x), [x, w]);
7147
+ Bo(() => tt(w, x), [x, w]);
7148
7148
  },
7149
7149
  useEmitterValue: y,
7150
7150
  usePublisher: h
@@ -7217,7 +7217,7 @@ const ji = "-webkit-sticky", Ec = "sticky", Ja = Ad(() => {
7217
7217
  function Za(e) {
7218
7218
  return e;
7219
7219
  }
7220
- const Lv = /* @__PURE__ */ Ze(() => {
7220
+ const Lv = /* @__PURE__ */ Je(() => {
7221
7221
  const e = J((a) => `Item ${a}`), t = J((a) => `Group ${a}`), n = J({}), r = J(Za), o = J("div"), s = J(Kr), i = (a, l = null) => zt(
7222
7222
  V(
7223
7223
  n,
@@ -7243,7 +7243,7 @@ const Lv = /* @__PURE__ */ Ze(() => {
7243
7243
  ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
7244
7244
  TopItemListComponent: i("TopItemList")
7245
7245
  };
7246
- }), Fv = /* @__PURE__ */ Ze(
7246
+ }), Fv = /* @__PURE__ */ Je(
7247
7247
  ([e, t]) => ({ ...e, ...t }),
7248
7248
  pt(Nd, Lv)
7249
7249
  ), $v = ({ height: e }) => /* @__PURE__ */ u.jsx("div", { style: { height: e } }), zv = { overflowAnchor: "none", position: Ja(), zIndex: 1 }, Dd = { overflowAnchor: "none" }, Bv = { ...Dd, display: "inline-block", height: "100%" }, Ic = /* @__PURE__ */ U.memo(function({ showTopList: e = !1 }) {
@@ -7524,7 +7524,7 @@ const Gv = ({ children: e }) => {
7524
7524
  }
7525
7525
  },
7526
7526
  Jv
7527
- ), Qv = /* @__PURE__ */ Ld({ useEmitter: Qa, useEmitterValue: Ne, usePublisher: sn }), ew = /* @__PURE__ */ Fd({ useEmitter: Qa, useEmitterValue: Ne, usePublisher: sn }), tw = Zv, nw = /* @__PURE__ */ Ze(() => {
7527
+ ), Qv = /* @__PURE__ */ Ld({ useEmitter: Qa, useEmitterValue: Ne, usePublisher: sn }), ew = /* @__PURE__ */ Fd({ useEmitter: Qa, useEmitterValue: Ne, usePublisher: sn }), tw = Zv, nw = /* @__PURE__ */ Je(() => {
7528
7528
  const e = J((c) => /* @__PURE__ */ u.jsxs("td", { children: [
7529
7529
  "Item $",
7530
7530
  c
@@ -7594,7 +7594,7 @@ function Ho(e, t) {
7594
7594
  function sw(e, t) {
7595
7595
  return e && e.column === t.column && e.row === t.row;
7596
7596
  }
7597
- const iw = /* @__PURE__ */ Ze(
7597
+ const iw = /* @__PURE__ */ Je(
7598
7598
  ([
7599
7599
  { increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
7600
7600
  { footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: l, scrollTop: c, smoothScrollTargetReached: d, viewportHeight: f },
@@ -7605,7 +7605,7 @@ const iw = /* @__PURE__ */ Ze(
7605
7605
  C
7606
7606
  ]) => {
7607
7607
  const S = J(0), k = J(0), A = J(Ac), N = J({ height: 0, width: 0 }), M = J({ height: 0, width: 0 }), F = Ye(), q = Ye(), j = J(0), _ = J(null), D = J({ column: 0, row: 0 }), L = Ye(), ne = Ye(), K = J(!1), z = J(0), he = J(!0), W = J(!1), ce = J(!1);
7608
- nt(
7608
+ tt(
7609
7609
  V(
7610
7610
  m,
7611
7611
  $e(z),
@@ -7614,7 +7614,7 @@ const iw = /* @__PURE__ */ Ze(
7614
7614
  () => {
7615
7615
  Oe(he, !1);
7616
7616
  }
7617
- ), nt(
7617
+ ), tt(
7618
7618
  V(
7619
7619
  Ct(m, he, M, N, z, W),
7620
7620
  Ie(([O, X, oe, ge, , se]) => O && !X && oe.height !== 0 && ge.height !== 0 && !se)
@@ -7633,7 +7633,7 @@ const iw = /* @__PURE__ */ Ze(
7633
7633
  _n(0)
7634
7634
  ),
7635
7635
  k
7636
- ), nt(
7636
+ ), tt(
7637
7637
  V(
7638
7638
  m,
7639
7639
  $e(ne),
@@ -7694,7 +7694,7 @@ const iw = /* @__PURE__ */ Ze(
7694
7694
  st,
7695
7695
  at
7696
7696
  ]) => {
7697
- const { column: gt, row: rt } = ge, { height: Me, width: We } = se, { width: ut } = re;
7697
+ const { column: gt, row: nt } = ge, { height: Me, width: We } = se, { width: ut } = re;
7698
7698
  if (Ke === 0 && (O === 0 || ut === 0))
7699
7699
  return Ac;
7700
7700
  if (We === 0) {
@@ -7702,10 +7702,10 @@ const iw = /* @__PURE__ */ Ze(
7702
7702
  return ow(jc(Pe, Xe, Ue));
7703
7703
  }
7704
7704
  const vt = $d(ut, We, gt);
7705
- let ft, Qe;
7706
- st ? X === 0 && oe === 0 && Ke > 0 ? (ft = 0, Qe = Ke - 1) : (ft = vt * xs((X + rt) / (Me + rt)), Qe = vt * Nc((oe + rt) / (Me + rt)) - 1, Qe = Pi(O - 1, lo(Qe, vt - 1)), ft = Pi(Qe, lo(0, ft))) : (ft = 0, Qe = -1);
7707
- const ie = jc(ft, Qe, Ue), { bottom: _e, top: Re } = Pc(re, ge, se, ie), qe = Nc(O / vt), ot = qe * Me + (qe - 1) * rt - _e;
7708
- return { bottom: _e, itemHeight: Me, items: ie, itemWidth: We, offsetBottom: ot, offsetTop: Re, top: Re };
7705
+ let ft, Ze;
7706
+ st ? X === 0 && oe === 0 && Ke > 0 ? (ft = 0, Ze = Ke - 1) : (ft = vt * xs((X + nt) / (Me + nt)), Ze = vt * Nc((oe + nt) / (Me + nt)) - 1, Ze = Pi(O - 1, lo(Ze, vt - 1)), ft = Pi(Ze, lo(0, ft))) : (ft = 0, Ze = -1);
7707
+ const ie = jc(ft, Ze, Ue), { bottom: _e, top: ke } = Pc(re, ge, se, ie), qe = Nc(O / vt), rt = qe * Me + (qe - 1) * nt - _e;
7708
+ return { bottom: _e, itemHeight: Me, items: ie, itemWidth: We, offsetBottom: rt, offsetTop: ke, top: ke };
7709
7709
  }
7710
7710
  )
7711
7711
  ),
@@ -7855,7 +7855,7 @@ function ha(e, t, n, r) {
7855
7855
  const o = $d(e.width, n.width, t.column), s = xs(r / o), i = s * n.height + lo(0, s - 1) * t.row;
7856
7856
  return i > 0 ? i + t.row : i;
7857
7857
  }
7858
- const aw = /* @__PURE__ */ Ze(() => {
7858
+ const aw = /* @__PURE__ */ Je(() => {
7859
7859
  const e = J((f) => `Item ${f}`), t = J({}), n = J(null), r = J("virtuoso-grid-item"), o = J("virtuoso-grid-list"), s = J(Za), i = J("div"), a = J(Kr), l = (f, h = null) => zt(
7860
7860
  V(
7861
7861
  t,
@@ -7882,7 +7882,7 @@ const aw = /* @__PURE__ */ Ze(() => {
7882
7882
  scrollerRef: a,
7883
7883
  ScrollSeekPlaceholder: l("ScrollSeekPlaceholder", "div")
7884
7884
  };
7885
- }), lw = /* @__PURE__ */ Ze(
7885
+ }), lw = /* @__PURE__ */ Je(
7886
7886
  ([e, t]) => ({ ...e, ...t }),
7887
7887
  pt(iw, aw)
7888
7888
  ), cw = /* @__PURE__ */ U.memo(function() {
@@ -9800,7 +9800,7 @@ function r0({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
9800
9800
  ] }) : c ? /* @__PURE__ */ u.jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
9801
9801
  /* @__PURE__ */ u.jsx("div", { className: "text-red-500 mb-4", children: "⚠️" }),
9802
9802
  /* @__PURE__ */ u.jsx("p", { className: "text-red-600 mb-4", children: c }),
9803
- /* @__PURE__ */ u.jsx(tt, { onClick: h, variant: "outline", children: "Try Again" })
9803
+ /* @__PURE__ */ u.jsx(et, { onClick: h, variant: "outline", children: "Try Again" })
9804
9804
  ] }) : a ? o.startsWith("image/") ? /* @__PURE__ */ u.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ u.jsx(
9805
9805
  "img",
9806
9806
  {
@@ -9840,7 +9840,7 @@ function r0({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
9840
9840
  ] }),
9841
9841
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
9842
9842
  /* @__PURE__ */ u.jsxs(
9843
- tt,
9843
+ et,
9844
9844
  {
9845
9845
  variant: "outline",
9846
9846
  size: "sm",
@@ -9853,7 +9853,7 @@ function r0({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
9853
9853
  }
9854
9854
  ),
9855
9855
  /* @__PURE__ */ u.jsxs(
9856
- tt,
9856
+ et,
9857
9857
  {
9858
9858
  variant: "outline",
9859
9859
  size: "sm",
@@ -11612,13 +11612,13 @@ const ru = U.memo(function({
11612
11612
  [L, t]
11613
11613
  ), oe = (x == null ? void 0 : x.id) ?? (x == null ? void 0 : x.interrupt_id), ge = Yo(oe), se = x == null ? void 0 : x.value, re = it(() => L ? "" : C0(t.content), [L, t]), Ue = U.useCallback(async () => {
11614
11614
  const ie = D ? re : we;
11615
- async function _e(Re) {
11615
+ async function _e(ke) {
11616
11616
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
11617
- await navigator.clipboard.writeText(Re);
11617
+ await navigator.clipboard.writeText(ke);
11618
11618
  return;
11619
11619
  }
11620
11620
  if (navigator.clipboard && typeof navigator.clipboard.write == "function" && typeof ClipboardItem < "u") {
11621
- const qe = new Blob([Re], { type: "text/plain" });
11621
+ const qe = new Blob([ke], { type: "text/plain" });
11622
11622
  await navigator.clipboard.write([
11623
11623
  new ClipboardItem({
11624
11624
  "text/plain": qe
@@ -11630,8 +11630,8 @@ const ru = U.memo(function({
11630
11630
  }
11631
11631
  try {
11632
11632
  await _e(ie), S(!0), setTimeout(() => S(!1), 2e3), v == null || v(ie);
11633
- } catch (Re) {
11634
- console.error("Failed to copy:", Re);
11633
+ } catch (ke) {
11634
+ console.error("Failed to copy:", ke);
11635
11635
  }
11636
11636
  }, [D, re, we, v]), Ke = U.useCallback(() => {
11637
11637
  if (!p) return;
@@ -11663,7 +11663,7 @@ const ru = U.memo(function({
11663
11663
  default:
11664
11664
  return ie;
11665
11665
  }
11666
- }, [_]), rt = U.useCallback(() => {
11666
+ }, [_]), nt = U.useCallback(() => {
11667
11667
  const ie = te(
11668
11668
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
11669
11669
  j && "px-3 py-2 text-sm"
@@ -11704,7 +11704,7 @@ const ru = U.memo(function({
11704
11704
  }
11705
11705
  }, [j, ne, _]);
11706
11706
  if (ne && L)
11707
- return /* @__PURE__ */ u.jsx("div", { className: te(gt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(rt(), h.content), children: [
11707
+ return /* @__PURE__ */ u.jsx("div", { className: te(gt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(nt(), h.content), children: [
11708
11708
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 mb-2 pb-2 border-b border-current/10", children: [
11709
11709
  /* @__PURE__ */ u.jsx(vi, { className: te("h-4 w-4", Z) }),
11710
11710
  a && /* @__PURE__ */ u.jsx("span", { className: "font-medium text-sm", children: "Assistant" })
@@ -11729,8 +11729,8 @@ const ru = U.memo(function({
11729
11729
  }
11730
11730
  try {
11731
11731
  b == null || b(), await q(_e, !0);
11732
- } catch (Re) {
11733
- console.error("Failed to approve interrupt:", Re);
11732
+ } catch (ke) {
11733
+ console.error("Failed to approve interrupt:", ke);
11734
11734
  } finally {
11735
11735
  T == null || T();
11736
11736
  }
@@ -11746,15 +11746,15 @@ const ru = U.memo(function({
11746
11746
  }
11747
11747
  try {
11748
11748
  b == null || b(), await q(_e, !1);
11749
- } catch (Re) {
11750
- console.error("Failed to reject interrupt:", Re);
11749
+ } catch (ke) {
11750
+ console.error("Failed to reject interrupt:", ke);
11751
11751
  } finally {
11752
11752
  T == null || T();
11753
11753
  }
11754
11754
  }, [w, T, b, q]), ut = U.useCallback(({ part: ie, i: _e }) => {
11755
11755
  if (ie.type === "text") {
11756
- const Re = ie.text ?? "", qe = Re.trim(), ot = Yd(qe);
11757
- return ot && _ !== "tool" ? /* @__PURE__ */ u.jsx(zf, { data: ot }, _e) : _ === "user" && c && qe.length > d ? /* @__PURE__ */ u.jsx(
11756
+ const ke = ie.text ?? "", qe = ke.trim(), rt = Yd(qe);
11757
+ return rt && _ !== "tool" ? /* @__PURE__ */ u.jsx(zf, { data: rt }, _e) : _ === "user" && c && qe.length > d ? /* @__PURE__ */ u.jsx(
11758
11758
  I0,
11759
11759
  {
11760
11760
  text: qe,
@@ -11764,27 +11764,27 @@ const ru = U.memo(function({
11764
11764
  isCompact: j
11765
11765
  },
11766
11766
  _e
11767
- ) : /* @__PURE__ */ u.jsx(ga, { content: Re, allowHtml: !1 }, _e);
11767
+ ) : /* @__PURE__ */ u.jsx(ga, { content: ke, allowHtml: !1 }, _e);
11768
11768
  }
11769
11769
  if (ie.type === "image_url") {
11770
- const Re = ie;
11770
+ const ke = ie;
11771
11771
  return /* @__PURE__ */ u.jsx("div", { className: "my-2", children: /* @__PURE__ */ u.jsx(
11772
11772
  "img",
11773
11773
  {
11774
- src: Re.url,
11775
- alt: Re.alt ?? "",
11774
+ src: ke.url,
11775
+ alt: ke.alt ?? "",
11776
11776
  loading: "lazy",
11777
11777
  className: "border rounded max-h-[420px] w-auto object-contain"
11778
11778
  }
11779
11779
  ) }, _e);
11780
11780
  }
11781
11781
  if (ie.type === "file") {
11782
- const Re = ie, qe = Re.name || "file";
11782
+ const ke = ie, qe = ke.name || "file";
11783
11783
  return /* @__PURE__ */ u.jsxs(
11784
11784
  "a",
11785
11785
  {
11786
- href: Re.url,
11787
- onClick: (ot) => he(ot, Re, _e),
11786
+ href: ke.url,
11787
+ onClick: (rt) => he(rt, ke, _e),
11788
11788
  className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
11789
11789
  dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
11790
11790
  children: [
@@ -11799,9 +11799,9 @@ const ru = U.memo(function({
11799
11799
  );
11800
11800
  }
11801
11801
  if (ie.type === "interrupt") {
11802
- const Re = ie, qe = Yo(
11803
- (Re == null ? void 0 : Re.id) ?? (Re == null ? void 0 : Re.interrupt_id)
11804
- ), ot = !!(ge && qe && qe === ge), Pe = ot ? se ?? (Re == null ? void 0 : Re.value) : Re == null ? void 0 : Re.value, Xe = qe ? { ...Re, id: qe, interrupt_id: qe } : Re;
11802
+ const ke = ie, qe = Yo(
11803
+ (ke == null ? void 0 : ke.id) ?? (ke == null ? void 0 : ke.interrupt_id)
11804
+ ), rt = !!(ge && qe && qe === ge), Pe = rt ? se ?? (ke == null ? void 0 : ke.value) : ke == null ? void 0 : ke.value, Xe = qe ? { ...ke, id: qe, interrupt_id: qe } : ke;
11805
11805
  return /* @__PURE__ */ u.jsx(
11806
11806
  R0,
11807
11807
  {
@@ -11809,7 +11809,7 @@ const ru = U.memo(function({
11809
11809
  onApprove: Me,
11810
11810
  onReject: We,
11811
11811
  disabled: w,
11812
- isActive: ot,
11812
+ isActive: rt,
11813
11813
  payload: Pe
11814
11814
  },
11815
11815
  _e
@@ -11850,11 +11850,11 @@ const ru = U.memo(function({
11850
11850
  t.id
11851
11851
  );
11852
11852
  if (!D && !L) {
11853
- const _e = t, Re = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: _e.content.map((qe, ot) => /* @__PURE__ */ u.jsx(ut, { part: qe, i: ot }, ot)) });
11853
+ const _e = t, ke = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: _e.content.map((qe, rt) => /* @__PURE__ */ u.jsx(ut, { part: qe, i: rt }, rt)) });
11854
11854
  return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
11855
- Re,
11855
+ ke,
11856
11856
  /* @__PURE__ */ u.jsx(k0, { className: Z })
11857
- ] }) : Re;
11857
+ ] }) : ke;
11858
11858
  }
11859
11859
  }, [
11860
11860
  we,
@@ -11866,9 +11866,9 @@ const ru = U.memo(function({
11866
11866
  k,
11867
11867
  vt,
11868
11868
  Z
11869
- ]), Qe = it(() => L ? "Assistant" : T0(t), [L, t]);
11869
+ ]), Ze = it(() => L ? "Assistant" : T0(t), [L, t]);
11870
11870
  return D && !f ? null : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
11871
- /* @__PURE__ */ u.jsx("div", { className: te(gt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(rt(), h.content), children: [
11871
+ /* @__PURE__ */ u.jsx("div", { className: te(gt(), h.container), children: /* @__PURE__ */ u.jsxs("div", { className: te(nt(), h.content), children: [
11872
11872
  (i || a || D) && /* @__PURE__ */ u.jsxs(
11873
11873
  "div",
11874
11874
  {
@@ -11881,7 +11881,7 @@ const ru = U.memo(function({
11881
11881
  children: [
11882
11882
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
11883
11883
  at(),
11884
- a && Qe && /* @__PURE__ */ u.jsx("span", { className: te("font-medium", j ? "text-xs" : "text-sm"), children: Qe }),
11884
+ a && Ze && /* @__PURE__ */ u.jsx("span", { className: te("font-medium", j ? "text-xs" : "text-sm"), children: Ze }),
11885
11885
  D && /* @__PURE__ */ u.jsxs(
11886
11886
  Bd,
11887
11887
  {
@@ -11927,7 +11927,7 @@ const ru = U.memo(function({
11927
11927
  ),
11928
11928
  children: [
11929
11929
  /* @__PURE__ */ u.jsx("div", { className: "relative", children: /* @__PURE__ */ u.jsx(
11930
- tt,
11930
+ et,
11931
11931
  {
11932
11932
  variant: "ghost",
11933
11933
  size: "sm",
@@ -11939,7 +11939,7 @@ const ru = U.memo(function({
11939
11939
  }
11940
11940
  ) }),
11941
11941
  _ === "user" && p && /* @__PURE__ */ u.jsx(
11942
- tt,
11942
+ et,
11943
11943
  {
11944
11944
  variant: "ghost",
11945
11945
  size: "sm",
@@ -11950,7 +11950,7 @@ const ru = U.memo(function({
11950
11950
  }
11951
11951
  ),
11952
11952
  _ === "assistant" && m && /* @__PURE__ */ u.jsx(
11953
- tt,
11953
+ et,
11954
11954
  {
11955
11955
  variant: "ghost",
11956
11956
  size: "sm",
@@ -11988,7 +11988,7 @@ const ru = U.memo(function({
11988
11988
  ),
11989
11989
  children: [
11990
11990
  /* @__PURE__ */ u.jsx(
11991
- tt,
11991
+ et,
11992
11992
  {
11993
11993
  variant: "ghost",
11994
11994
  size: "sm",
@@ -11998,7 +11998,7 @@ const ru = U.memo(function({
11998
11998
  }
11999
11999
  ),
12000
12000
  _ === "user" && p && /* @__PURE__ */ u.jsx(
12001
- tt,
12001
+ et,
12002
12002
  {
12003
12003
  variant: "ghost",
12004
12004
  size: "sm",
@@ -12008,7 +12008,7 @@ const ru = U.memo(function({
12008
12008
  }
12009
12009
  ),
12010
12010
  _ === "assistant" && m && /* @__PURE__ */ u.jsx(
12011
- tt,
12011
+ et,
12012
12012
  {
12013
12013
  variant: "ghost",
12014
12014
  size: "sm",
@@ -12083,7 +12083,7 @@ function R0({
12083
12083
  a && /* @__PURE__ */ u.jsx(ho, { className: "pt-0 pb-3", children: a }),
12084
12084
  /* @__PURE__ */ u.jsx(Ud, { className: "pt-0", children: /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2 ml-auto", children: [
12085
12085
  /* @__PURE__ */ u.jsx(
12086
- tt,
12086
+ et,
12087
12087
  {
12088
12088
  size: "sm",
12089
12089
  variant: "outline",
@@ -12094,7 +12094,7 @@ function R0({
12094
12094
  }
12095
12095
  ),
12096
12096
  /* @__PURE__ */ u.jsx(
12097
- tt,
12097
+ et,
12098
12098
  {
12099
12099
  size: "sm",
12100
12100
  onClick: () => t(e),
@@ -12201,7 +12201,7 @@ function I0({
12201
12201
  ]
12202
12202
  }
12203
12203
  ) }),
12204
- /* @__PURE__ */ u.jsx(Mw, { asChild: !0, children: /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", className: "h-6 text-xs !text-[hsl(var(--chat-bubble-user-text))]", children: t ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
12204
+ /* @__PURE__ */ u.jsx(Mw, { asChild: !0, children: /* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", className: "h-6 text-xs !text-[hsl(var(--chat-bubble-user-text))]", children: t ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
12205
12205
  /* @__PURE__ */ u.jsx(ja, { className: "h-3 w-3 mr-1" }),
12206
12206
  " Show less"
12207
12207
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
@@ -12296,7 +12296,7 @@ const ou = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Bf = U.forwa
12296
12296
  }
12297
12297
  ]
12298
12298
  };
12299
- }, [w, j]), D = it(() => _ ? [...e, _] : e, [e, _]), L = it(() => S ? D : D.filter((W) => (W == null ? void 0 : W.role) !== "tool"), [D, S]), ne = ke((W) => {
12299
+ }, [w, j]), D = it(() => _ ? [...e, _] : e, [e, _]), L = it(() => S ? D : D.filter((W) => (W == null ? void 0 : W.role) !== "tool"), [D, S]), ne = Te((W) => {
12300
12300
  q(W), v && v(!W), x && x(W);
12301
12301
  }, [v, x]), K = it(() => {
12302
12302
  if (a)
@@ -13893,8 +13893,8 @@ var wl = "PopperContent", [qS, GS] = th(wl), ih = g.forwardRef(
13893
13893
  BS({
13894
13894
  ...j,
13895
13895
  apply: ({ elements: re, rects: Ue, availableWidth: Ke, availableHeight: st }) => {
13896
- const { width: at, height: gt } = Ue.reference, rt = re.floating.style;
13897
- rt.setProperty("--radix-popper-available-width", `${Ke}px`), rt.setProperty("--radix-popper-available-height", `${st}px`), rt.setProperty("--radix-popper-anchor-width", `${at}px`), rt.setProperty("--radix-popper-anchor-height", `${gt}px`);
13896
+ const { width: at, height: gt } = Ue.reference, nt = re.floating.style;
13897
+ nt.setProperty("--radix-popper-available-width", `${Ke}px`), nt.setProperty("--radix-popper-available-height", `${st}px`), nt.setProperty("--radix-popper-anchor-width", `${at}px`), nt.setProperty("--radix-popper-anchor-height", `${gt}px`);
13898
13898
  }
13899
13899
  }),
13900
13900
  T && US({ element: T, padding: a }),
@@ -15090,38 +15090,38 @@ function Ki({
15090
15090
  dt(() => {
15091
15091
  W || B(!1);
15092
15092
  }, [W]);
15093
- const Z = ke(() => {
15093
+ const Z = Te(() => {
15094
15094
  B(!0);
15095
- }, []), we = ke(() => {
15095
+ }, []), we = Te(() => {
15096
15096
  B(!1);
15097
- }, []), xe = !!W || ce, [G, O] = ye(null), [X, oe] = ye(""), [ge, se] = ye(null), [re, Ue] = ye([]), [Ke, st] = ye(0), [at, gt] = ye(0), [rt, Me] = ye(!1), [We, ut] = ye(null), [vt, ft] = ye(null), [Qe, ie] = ye(!1), [_e, Re] = ye(null), [qe, ot] = ye(!1), Pe = Le(!1), [Xe, Et] = ye(() => xu.value), Tt = Le(Xe), qt = Le(null), It = ke(($) => {
15097
+ }, []), xe = !!W || ce, [G, O] = ye(null), [X, oe] = ye(""), [ge, se] = ye(null), [re, Ue] = ye([]), [Ke, st] = ye(0), [at, gt] = ye(0), [nt, Me] = ye(!1), [We, ut] = ye(null), [vt, ft] = ye(null), [Ze, ie] = ye(!1), [_e, ke] = ye(null), [qe, rt] = ye(!1), Pe = Le(!1), [Xe, Et] = ye(() => xu.value), Tt = Le(Xe), qt = Le(null), It = Te(($) => {
15098
15098
  xu.value = $, Et($);
15099
- }, []), [qn, Gt] = ye(!1), dn = ke(
15100
- ($, de) => {
15099
+ }, []), [qn, Gt] = ye(!1), dn = Te(
15100
+ ($, ue) => {
15101
15101
  if (!$ || typeof $ != "object") return null;
15102
- const ue = $[de];
15103
- return typeof ue == "number" ? ue : null;
15102
+ const de = $[ue];
15103
+ return typeof de == "number" ? de : null;
15104
15104
  },
15105
15105
  []
15106
- ), tn = ke(
15107
- ($, de) => {
15106
+ ), tn = Te(
15107
+ ($, ue) => {
15108
15108
  if (!$ || typeof $ != "object") return null;
15109
- const ue = $[de];
15110
- return typeof ue == "string" && ue.trim() ? ue : null;
15109
+ const de = $[ue];
15110
+ return typeof de == "string" && de.trim() ? de : null;
15111
15111
  },
15112
15112
  []
15113
15113
  ), Mt = it(() => {
15114
15114
  const $ = Array.isArray(M) ? [...M] : [];
15115
- return $.some((ue) => dn(ue.metadata, "step") !== null) && $.sort((ue, Te) => {
15116
- const Je = dn(ue.metadata, "step"), Dt = dn(Te.metadata, "step");
15117
- if (Je !== null || Dt !== null)
15118
- return (Dt ?? Number.NEGATIVE_INFINITY) - (Je ?? Number.NEGATIVE_INFINITY);
15119
- const nn = Date.parse(ue.createdAt ?? ""), kt = Date.parse(Te.createdAt ?? "");
15115
+ return $.some((de) => dn(de.metadata, "step") !== null) && $.sort((de, Re) => {
15116
+ const ot = dn(de.metadata, "step"), Dt = dn(Re.metadata, "step");
15117
+ if (ot !== null || Dt !== null)
15118
+ return (Dt ?? Number.NEGATIVE_INFINITY) - (ot ?? Number.NEGATIVE_INFINITY);
15119
+ const nn = Date.parse(de.createdAt ?? ""), kt = Date.parse(Re.createdAt ?? "");
15120
15120
  return Number.isNaN(nn) || Number.isNaN(kt) ? 0 : kt - nn;
15121
15121
  }), $;
15122
- }, [M, dn]), Cn = Le(null), fn = Le(null), xt = ke(() => {
15122
+ }, [M, dn]), Cn = Le(null), fn = Le(null), xt = Te(() => {
15123
15123
  Cn.current && (Cn.current.value = ""), fn.current && (fn.current.value = ""), st(($) => $ + 1), gt(($) => $ + 1);
15124
- }, []), hn = ke(
15124
+ }, []), hn = Te(
15125
15125
  ($) => {
15126
15126
  It($);
15127
15127
  },
@@ -15133,12 +15133,12 @@ function Ki({
15133
15133
  const [ar, Yt] = ye("desktop");
15134
15134
  dt(() => {
15135
15135
  const $ = () => {
15136
- const de = window.innerWidth;
15137
- Yt(de < 640 ? "phone" : de < 1024 ? "tablet" : "desktop");
15136
+ const ue = window.innerWidth;
15137
+ Yt(ue < 640 ? "phone" : ue < 1024 ? "tablet" : "desktop");
15138
15138
  };
15139
15139
  return $(), window.addEventListener("resize", $), () => window.removeEventListener("resize", $);
15140
15140
  }, []), dt(() => {
15141
- ot(!1), Pe.current = !1;
15141
+ rt(!1), Pe.current = !1;
15142
15142
  }, [ne]), dt(() => {
15143
15143
  Tt.current = Xe;
15144
15144
  }, [Xe]), dt(() => {
@@ -15148,7 +15148,7 @@ function Ki({
15148
15148
  }
15149
15149
  qt.current === null && (qt.current = Tt.current), It(X ?? "");
15150
15150
  }, [X, G, It]);
15151
- const lr = ke(async () => {
15151
+ const lr = Te(async () => {
15152
15152
  if (!(!b || T || !qe))
15153
15153
  try {
15154
15154
  await S();
@@ -15159,44 +15159,41 @@ function Ki({
15159
15159
  dt(() => {
15160
15160
  (async () => {
15161
15161
  if (!y.baseUrl) {
15162
- Re(null);
15162
+ ke(null);
15163
15163
  return;
15164
15164
  }
15165
15165
  try {
15166
- const ue = (await y.getAgent("default")).uiDefaultMessage || "", Te = "# Hi — I'm Navi (SmartOrg AINAV)";
15167
- let Je = ue;
15168
- ue.trim().startsWith(Te) || (Je = `${Te}
15169
-
15170
- ${ue}`), Re(Je || null);
15171
- } catch (de) {
15172
- console.warn("Failed to fetch default message:", de), Re(null);
15166
+ const de = (await y.getAgent("default")).uiDefaultMessage || "";
15167
+ ke(de || null);
15168
+ } catch (ue) {
15169
+ console.warn("Failed to fetch default message:", ue), ke(null);
15173
15170
  }
15174
15171
  })();
15175
15172
  }, [y.baseUrl]), dt(() => {
15176
- _ && !Qe && (m == null || m(_));
15177
- }, [_, Qe, m]);
15173
+ _ && !Ze && (m == null || m(_));
15174
+ }, [_, Ze, m]);
15178
15175
  const kn = ($) => {
15179
15176
  if ($.length > us)
15180
15177
  return `Message too long (${$.length}/${us} characters)`;
15181
15178
  try {
15182
15179
  return j0($), null;
15183
- } catch (de) {
15184
- return (de == null ? void 0 : de.message) || "Invalid message";
15180
+ } catch (ue) {
15181
+ return (ue == null ? void 0 : ue.message) || "Invalid message";
15185
15182
  }
15186
15183
  }, pn = async ($) => {
15187
- const de = $.trim();
15188
- if (!(!de && re.length === 0)) {
15189
- if (de) {
15190
- const ue = kn(de);
15191
- if (ue) {
15192
- se(ue);
15184
+ const ue = $.trim();
15185
+ if (!(!ue && re.length === 0)) {
15186
+ if (ue) {
15187
+ const de = kn(ue);
15188
+ if (de) {
15189
+ se(de);
15193
15190
  return;
15194
15191
  }
15195
15192
  }
15196
15193
  try {
15197
15194
  await D(
15198
15195
  {
15199
- text: de || "",
15196
+ text: ue || "",
15200
15197
  attachments: re,
15201
15198
  payload: G ? { edit: !0, originalMessageId: G } : void 0
15202
15199
  },
@@ -15204,36 +15201,36 @@ ${ue}`), Re(Je || null);
15204
15201
  checkpointId: K ?? void 0,
15205
15202
  checkpointNs: z ?? void 0
15206
15203
  }
15207
- ), h == null || h(de), It(""), se(null), Ue([]), xt(), O(null), oe("");
15208
- } catch (ue) {
15209
- const Te = (ue == null ? void 0 : ue.message) || "Failed to send message";
15210
- se(Te), m == null || m(Te);
15204
+ ), h == null || h(ue), It(""), se(null), Ue([]), xt(), O(null), oe("");
15205
+ } catch (de) {
15206
+ const Re = (de == null ? void 0 : de.message) || "Failed to send message";
15207
+ se(Re), m == null || m(Re);
15211
15208
  }
15212
15209
  }
15213
15210
  }, Hn = U.useCallback(
15214
- ($, de) => {
15215
- c && (qt.current = Xe, O($), oe(de), It(de), se(null));
15211
+ ($, ue) => {
15212
+ c && (qt.current = Xe, O($), oe(ue), It(ue), se(null));
15216
15213
  },
15217
15214
  [Xe, c, It]
15218
15215
  ), cr = U.useCallback(() => {
15219
15216
  O(null), oe(""), se(null), It(qt.current ?? Xe), qt.current = null;
15220
- }, [Xe, It]), Ar = ke(($, de) => {
15221
- Hn($, de);
15222
- }, [Hn]), Nr = ke(($) => {
15223
- const de = (ue) => {
15224
- const Te = ue.content || [], Je = Te.filter((Dt) => Dt.type === "text").map((Dt) => Dt.text).join("");
15225
- if (Je) return Je;
15217
+ }, [Xe, It]), Ar = Te(($, ue) => {
15218
+ Hn($, ue);
15219
+ }, [Hn]), Nr = Te(($) => {
15220
+ const ue = (de) => {
15221
+ const Re = de.content || [], ot = Re.filter((Dt) => Dt.type === "text").map((Dt) => Dt.text).join("");
15222
+ if (ot) return ot;
15226
15223
  try {
15227
- return JSON.stringify(Te, null, 2);
15224
+ return JSON.stringify(Re, null, 2);
15228
15225
  } catch {
15229
- return String(Te);
15226
+ return String(Re);
15230
15227
  }
15231
15228
  };
15232
- for (let ue = $ - 1; ue >= 0; ue--)
15233
- if (w[ue].role === "user") {
15234
- const Te = de(w[ue]);
15235
- Te && D(
15236
- { text: Te },
15229
+ for (let de = $ - 1; de >= 0; de--)
15230
+ if (w[de].role === "user") {
15231
+ const Re = ue(w[de]);
15232
+ Re && D(
15233
+ { text: Re },
15237
15234
  {
15238
15235
  checkpointId: K ?? void 0,
15239
15236
  checkpointNs: z ?? void 0
@@ -15242,38 +15239,38 @@ ${ue}`), Re(Je || null);
15242
15239
  break;
15243
15240
  }
15244
15241
  }, [w, D, K, z]), Gn = ($) => {
15245
- const de = Array.from($.target.files || []);
15246
- Ue((ue) => [...ue, ...de]), $.target.value = "";
15242
+ const ue = Array.from($.target.files || []);
15243
+ Ue((de) => [...de, ...ue]), $.target.value = "";
15247
15244
  }, R = ($) => {
15248
- Ue((de) => {
15249
- const ue = de.filter((Te, Je) => $ !== Je);
15250
- return ue.length === 0 && xt(), ue;
15245
+ Ue((ue) => {
15246
+ const de = ue.filter((Re, ot) => $ !== ot);
15247
+ return de.length === 0 && xt(), de;
15251
15248
  });
15252
15249
  }, H = async ($) => {
15253
- const de = ($.target.files || [])[0];
15254
- if (de) {
15250
+ const ue = ($.target.files || [])[0];
15251
+ if (ue) {
15255
15252
  ut(null), ft(null), Me(!0);
15256
15253
  try {
15257
15254
  await D(
15258
- { attachments: [de] },
15255
+ { attachments: [ue] },
15259
15256
  {
15260
15257
  checkpointId: K ?? void 0,
15261
15258
  checkpointNs: z ?? void 0
15262
15259
  }
15263
15260
  );
15264
- const ue = `Uploaded ${de.name} - processing through chat stream`;
15265
- ft(ue);
15266
- } catch (ue) {
15267
- const Te = ue instanceof Error ? ue.message : "Failed to upload Excel file";
15268
- console.error("Excel upload failed", ue), ut(Te), m == null || m(Te);
15261
+ const de = `Uploaded ${ue.name} - processing through chat stream`;
15262
+ ft(de);
15263
+ } catch (de) {
15264
+ const Re = de instanceof Error ? de.message : "Failed to upload Excel file";
15265
+ console.error("Excel upload failed", de), ut(Re), m == null || m(Re);
15269
15266
  } finally {
15270
15267
  Me(!1), $.target.value = "", xt();
15271
15268
  }
15272
15269
  }
15273
15270
  }, le = ($) => {
15274
15271
  if (!$) return "Unknown";
15275
- const de = Date.parse($);
15276
- return Number.isNaN(de) ? $ : new Date(de).toLocaleString();
15272
+ const ue = Date.parse($);
15273
+ return Number.isNaN(ue) ? $ : new Date(ue).toLocaleString();
15277
15274
  }, Ce = async ($) => {
15278
15275
  if (v) {
15279
15276
  Gt(!0);
@@ -15282,18 +15279,18 @@ ${ue}`), Re(Je || null);
15282
15279
  await A();
15283
15280
  return;
15284
15281
  }
15285
- const de = Mt.find((Te) => Te.checkpointId === $), ue = (de == null ? void 0 : de.checkpointNs) ?? null;
15286
- await k($, ue);
15282
+ const ue = Mt.find((Re) => Re.checkpointId === $), de = (ue == null ? void 0 : ue.checkpointNs) ?? null;
15283
+ await k($, de);
15287
15284
  } finally {
15288
15285
  Gt(!1);
15289
15286
  }
15290
15287
  }
15291
15288
  }, Ge = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${f.container || ""}`, ze = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-hidden overscroll-contain break-words break-anywhere p-4 bg-transparent ${f.messagesArea || ""}`, Fe = `flex-shrink-0 w-full border-t p-4 bg-transparent ${f.inputArea || ""}`;
15292
15289
  return /* @__PURE__ */ u.jsxs("div", { className: Ge, children: [
15293
- !!_ && !Qe && /* @__PURE__ */ u.jsxs("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: [
15290
+ !!_ && !Ze && /* @__PURE__ */ u.jsxs("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: [
15294
15291
  /* @__PURE__ */ u.jsx("span", { children: _ }),
15295
15292
  /* @__PURE__ */ u.jsx(
15296
- tt,
15293
+ et,
15297
15294
  {
15298
15295
  variant: "ghost",
15299
15296
  size: "sm",
@@ -15312,18 +15309,18 @@ ${ue}`), Re(Je || null);
15312
15309
  className: "border border-border rounded px-2 py-1 text-xs bg-card text-foreground focus:outline-none focus:ring-1 focus:ring-ring dark:bg-secondary",
15313
15310
  value: K ?? "",
15314
15311
  onChange: ($) => {
15315
- const de = $.target.value || null;
15316
- Ce(de);
15312
+ const ue = $.target.value || null;
15313
+ Ce(ue);
15317
15314
  },
15318
15315
  children: [
15319
15316
  /* @__PURE__ */ u.jsx("option", { value: "", children: "Latest" }),
15320
15317
  Mt.map(($) => {
15321
- const de = dn($.metadata, "step"), ue = tn($.metadata, "source"), Te = [];
15322
- de !== null && Te.push(`Step ${de}`), ue && Te.push(ue);
15323
- const Je = Te.length ? ` — ${Te.join(" • ")}` : "";
15318
+ const ue = dn($.metadata, "step"), de = tn($.metadata, "source"), Re = [];
15319
+ ue !== null && Re.push(`Step ${ue}`), de && Re.push(de);
15320
+ const ot = Re.length ? ` — ${Re.join(" • ")}` : "";
15324
15321
  return /* @__PURE__ */ u.jsxs("option", { value: $.checkpointId, children: [
15325
15322
  le($.createdAt),
15326
- Je
15323
+ ot
15327
15324
  ] }, $.checkpointId);
15328
15325
  })
15329
15326
  ]
@@ -15357,7 +15354,7 @@ ${ue}`), Re(Je || null);
15357
15354
  Pe.current = !0;
15358
15355
  return;
15359
15356
  }
15360
- $ && ot(!0);
15357
+ $ && rt(!0);
15361
15358
  },
15362
15359
  onEdit: Ar,
15363
15360
  onRegenerate: Nr,
@@ -15385,7 +15382,7 @@ ${ue}`), Re(Je || null);
15385
15382
  /* @__PURE__ */ u.jsx("span", { className: "text-sm font-medium text-blue-800", children: "Editing message" })
15386
15383
  ] }),
15387
15384
  /* @__PURE__ */ u.jsx(
15388
- tt,
15385
+ et,
15389
15386
  {
15390
15387
  variant: "ghost",
15391
15388
  size: "sm",
@@ -15408,21 +15405,21 @@ ${ue}`), Re(Je || null);
15408
15405
  },
15409
15406
  Ke
15410
15407
  ),
15411
- re.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: re.map(($, de) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
15408
+ re.length > 0 && /* @__PURE__ */ u.jsx("div", { className: "flex flex-wrap gap-2", children: re.map(($, ue) => /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100", children: [
15412
15409
  /* @__PURE__ */ u.jsx(qi, { size: 14 }),
15413
15410
  /* @__PURE__ */ u.jsx("span", { className: "truncate max-w-[150px]", children: $.name }),
15414
15411
  /* @__PURE__ */ u.jsx(
15415
- tt,
15412
+ et,
15416
15413
  {
15417
15414
  variant: "ghost",
15418
15415
  size: "sm",
15419
- onClick: () => R(de),
15416
+ onClick: () => R(ue),
15420
15417
  className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
15421
15418
  "aria-label": `Remove ${$.name}`,
15422
15419
  children: /* @__PURE__ */ u.jsx(Or, { size: 12 })
15423
15420
  }
15424
15421
  )
15425
- ] }, de)) })
15422
+ ] }, ue)) })
15426
15423
  ] }),
15427
15424
  l && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
15428
15425
  /* @__PURE__ */ u.jsx(
@@ -15436,19 +15433,19 @@ ${ue}`), Re(Je || null);
15436
15433
  },
15437
15434
  at
15438
15435
  ),
15439
- rt && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15436
+ nt && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
15440
15437
  /* @__PURE__ */ u.jsx(Yi, { className: "h-4 w-4 animate-spin" }),
15441
15438
  " Uploading Excel file..."
15442
15439
  ] }),
15443
- vt && !rt && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: vt }),
15444
- We && !rt && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: We })
15440
+ vt && !nt && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700", children: vt }),
15441
+ We && !nt && /* @__PURE__ */ u.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: We })
15445
15442
  ] })
15446
15443
  ] }),
15447
15444
  ge && /* @__PURE__ */ u.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: ge }),
15448
15445
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-end gap-2", children: [
15449
15446
  (a || l) && /* @__PURE__ */ u.jsxs(vT, { children: [
15450
15447
  /* @__PURE__ */ u.jsx(wT, { asChild: !0, children: /* @__PURE__ */ u.jsx(
15451
- tt,
15448
+ et,
15452
15449
  {
15453
15450
  type: "button",
15454
15451
  size: "icon",
@@ -15472,9 +15469,9 @@ ${ue}`), Re(Je || null);
15472
15469
  {
15473
15470
  onClick: () => {
15474
15471
  var $;
15475
- rt || ($ = fn.current) == null || $.click();
15472
+ nt || ($ = fn.current) == null || $.click();
15476
15473
  },
15477
- className: `cursor-pointer ${rt ? "opacity-60 pointer-events-none" : ""}`,
15474
+ className: `cursor-pointer ${nt ? "opacity-60 pointer-events-none" : ""}`,
15478
15475
  children: [
15479
15476
  /* @__PURE__ */ u.jsx(Gm, { className: "h-4 w-4 mr-2" }),
15480
15477
  " Upload Excel file"
@@ -16157,7 +16154,7 @@ function vu({
16157
16154
  }, ce = (B) => B.title || `Thread ${B.threadId.slice(0, 8)}`;
16158
16155
  return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
16159
16156
  t && /* @__PURE__ */ u.jsx("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ u.jsx(
16160
- tt,
16157
+ et,
16161
16158
  {
16162
16159
  onClick: D,
16163
16160
  disabled: q || p,
@@ -16189,8 +16186,8 @@ function vu({
16189
16186
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
16190
16187
  /* @__PURE__ */ u.jsx("div", { className: "flex-1 min-w-0", children: A === B.threadId ? /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", onClick: (Z) => Z.stopPropagation(), children: [
16191
16188
  /* @__PURE__ */ u.jsx(Is, { value: M, onChange: (Z) => F(Z.target.value), onKeyDown: (Z) => he(Z, B.threadId), className: "h-6 text-sm", autoFocus: !0 }),
16192
- /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: () => K(B.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(Pa, { size: 12 }) }),
16193
- /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: z, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(Or, { size: 12 }) })
16189
+ /* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: () => K(B.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(Pa, { size: 12 }) }),
16190
+ /* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: z, className: "h-6 w-6 p-0", children: /* @__PURE__ */ u.jsx(Or, { size: 12 }) })
16194
16191
  ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
16195
16192
  /* @__PURE__ */ u.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: ce(B) }),
16196
16193
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
@@ -16199,9 +16196,9 @@ function vu({
16199
16196
  ] })
16200
16197
  ] }) }),
16201
16198
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
16202
- r && A !== B.threadId && /* @__PURE__ */ u.jsx(tt, { variant: "ghost", size: "sm", onClick: (Z) => ne(B, Z), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Cu, { size: 12 }) }),
16199
+ r && A !== B.threadId && /* @__PURE__ */ u.jsx(et, { variant: "ghost", size: "sm", onClick: (Z) => ne(B, Z), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ u.jsx(Cu, { size: 12 }) }),
16203
16200
  n && /* @__PURE__ */ u.jsx(
16204
- tt,
16201
+ et,
16205
16202
  {
16206
16203
  variant: "ghost",
16207
16204
  size: "sm",
@@ -17588,7 +17585,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17588
17585
  }
17589
17586
  };
17590
17587
  return /* @__PURE__ */ u.jsxs(Pk, { open: r, onOpenChange: o, children: [
17591
- /* @__PURE__ */ u.jsx(Ok, { asChild: !0, children: /* @__PURE__ */ u.jsxs(tt, { variant: "outline", size: "sm", className: n, children: [
17588
+ /* @__PURE__ */ u.jsx(Ok, { asChild: !0, children: /* @__PURE__ */ u.jsxs(et, { variant: "outline", size: "sm", className: n, children: [
17592
17589
  /* @__PURE__ */ u.jsx(Qm, { className: "h-4 w-4 mr-2" }),
17593
17590
  "Settings",
17594
17591
  c && /* @__PURE__ */ u.jsx(Bd, { variant: "destructive", className: "ml-2 h-4 w-4 p-0" })
@@ -17620,7 +17617,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17620
17617
  placeholder: "http://localhost:8000/api"
17621
17618
  }
17622
17619
  ),
17623
- /* @__PURE__ */ u.jsx(tt, { variant: "outline", onClick: y, children: "Test" })
17620
+ /* @__PURE__ */ u.jsx(et, { variant: "outline", onClick: y, children: "Test" })
17624
17621
  ] })
17625
17622
  ] }),
17626
17623
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between", children: [
@@ -17654,7 +17651,7 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17654
17651
  }
17655
17652
  ),
17656
17653
  /* @__PURE__ */ u.jsx(
17657
- tt,
17654
+ et,
17658
17655
  {
17659
17656
  variant: "outline",
17660
17657
  size: "icon",
@@ -17822,13 +17819,13 @@ function wR({ settings: e, onSettingsChange: t, className: n = "" }) {
17822
17819
  ] })
17823
17820
  ] }),
17824
17821
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
17825
- /* @__PURE__ */ u.jsxs(tt, { variant: "outline", onClick: p, children: [
17822
+ /* @__PURE__ */ u.jsxs(et, { variant: "outline", onClick: p, children: [
17826
17823
  /* @__PURE__ */ u.jsx(Gi, { className: "h-4 w-4 mr-2" }),
17827
17824
  "Reset"
17828
17825
  ] }),
17829
17826
  /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2", children: [
17830
- /* @__PURE__ */ u.jsx(tt, { variant: "outline", onClick: m, children: "Cancel" }),
17831
- /* @__PURE__ */ u.jsxs(tt, { onClick: h, disabled: !c, children: [
17827
+ /* @__PURE__ */ u.jsx(et, { variant: "outline", onClick: m, children: "Cancel" }),
17828
+ /* @__PURE__ */ u.jsxs(et, { onClick: h, disabled: !c, children: [
17832
17829
  /* @__PURE__ */ u.jsx(sg, { className: "h-4 w-4 mr-2" }),
17833
17830
  "Save Changes"
17834
17831
  ] })