teodor-new-chat-ui 3.0.145 → 3.0.147

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
@@ -1,5 +1,5 @@
1
1
  import * as f from "react";
2
- import q, { useState as ue, useRef as Ke, useCallback as Ue, useEffect as Ze, useReducer as $p, useMemo as ln, createContext as Sl, useContext as Cl, createElement as go, useLayoutEffect as Hp } from "react";
2
+ import q, { useState as ue, useRef as We, useCallback as Ue, useEffect as Xe, useReducer as $p, useMemo as mn, createContext as Sl, useContext as Cl, createElement as go, useLayoutEffect as Hp } from "react";
3
3
  import { Square as zp, Send as Up, X as er, ExternalLink as Wp, Download as Vp, Image as Tl, FileText as Ya, Loader as Gp, ChevronUp as Cr, ChevronDown as Qn, Copy as qa, Edit as Xa, RotateCcw as ci, Bot as Ja, Wrench as Kp, User as Yp, Paperclip as li, ChevronRight as qp, Check as Wi, Circle as Xp, Edit3 as Rl, Loader2 as Jp, Plus as Zp, FileSpreadsheet as Qp, MessageSquarePlus as em, MessageSquare as tm, Calendar as nm, Trash2 as rm, PanelLeft as om, Settings as sm, Server as im, EyeOff as am, Eye as cm, Layout as lm, MessageCircle as um, Save as dm } from "lucide-react";
4
4
  import { Slot as ur, createSlot as sr, createSlottable as fm } from "@radix-ui/react-slot";
5
5
  import { cva as Wr } from "class-variance-authority";
@@ -263,19 +263,19 @@ function gm() {
263
263
  } catch (bt) {
264
264
  if (bt && xe && typeof bt.stack == "string") {
265
265
  for (var Ie = bt.stack.split(`
266
- `), pt = xe.stack.split(`
267
- `), Xe = Ie.length - 1, tt = pt.length - 1; Xe >= 1 && tt >= 0 && Ie[Xe] !== pt[tt]; )
266
+ `), mt = xe.stack.split(`
267
+ `), Je = Ie.length - 1, tt = mt.length - 1; Je >= 1 && tt >= 0 && Ie[Je] !== mt[tt]; )
268
268
  tt--;
269
- for (; Xe >= 1 && tt >= 0; Xe--, tt--)
270
- if (Ie[Xe] !== pt[tt]) {
271
- if (Xe !== 1 || tt !== 1)
269
+ for (; Je >= 1 && tt >= 0; Je--, tt--)
270
+ if (Ie[Je] !== mt[tt]) {
271
+ if (Je !== 1 || tt !== 1)
272
272
  do
273
- if (Xe--, tt--, tt < 0 || Ie[Xe] !== pt[tt]) {
273
+ if (Je--, tt--, tt < 0 || Ie[Je] !== mt[tt]) {
274
274
  var kt = `
275
- ` + Ie[Xe].replace(" at new ", " at ");
275
+ ` + Ie[Je].replace(" at new ", " at ");
276
276
  return T.displayName && kt.includes("<anonymous>") && (kt = kt.replace("<anonymous>", T.displayName)), typeof T == "function" && J.set(T, kt), kt;
277
277
  }
278
- while (Xe >= 1 && tt >= 0);
278
+ while (Je >= 1 && tt >= 0);
279
279
  break;
280
280
  }
281
281
  }
@@ -321,15 +321,15 @@ function gm() {
321
321
  }
322
322
  return "";
323
323
  }
324
- var ie = Object.prototype.hasOwnProperty, Ne = {}, Se = g.ReactDebugCurrentFrame;
324
+ var ie = Object.prototype.hasOwnProperty, Ne = {}, Ce = g.ReactDebugCurrentFrame;
325
325
  function fe(T) {
326
326
  if (T) {
327
327
  var z = T._owner, ne = je(T.type, T._source, z ? z.type : null);
328
- Se.setExtraStackFrame(ne);
328
+ Ce.setExtraStackFrame(ne);
329
329
  } else
330
- Se.setExtraStackFrame(null);
330
+ Ce.setExtraStackFrame(null);
331
331
  }
332
- function Ce(T, z, ne, xe, Le) {
332
+ function Te(T, z, ne, xe, Le) {
333
333
  {
334
334
  var He = Function.call.bind(ie);
335
335
  for (var Pe in T)
@@ -337,19 +337,19 @@ function gm() {
337
337
  var Ie = void 0;
338
338
  try {
339
339
  if (typeof T[Pe] != "function") {
340
- var pt = Error((xe || "React class") + ": " + ne + " type `" + Pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
- throw pt.name = "Invariant Violation", pt;
340
+ var mt = Error((xe || "React class") + ": " + ne + " type `" + Pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
+ throw mt.name = "Invariant Violation", mt;
342
342
  }
343
343
  Ie = T[Pe](z, Pe, xe, ne, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
344
- } catch (Xe) {
345
- Ie = Xe;
344
+ } catch (Je) {
345
+ Ie = Je;
346
346
  }
347
347
  Ie && !(Ie instanceof Error) && (fe(Le), b("%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).", xe || "React class", ne, Pe, typeof Ie), fe(null)), Ie instanceof Error && !(Ie.message in Ne) && (Ne[Ie.message] = !0, fe(Le), b("Failed %s type: %s", ne, Ie.message), fe(null));
348
348
  }
349
349
  }
350
350
  }
351
351
  var Be = Array.isArray;
352
- function ot(T) {
352
+ function st(T) {
353
353
  return Be(T);
354
354
  }
355
355
  function et(T) {
@@ -358,27 +358,27 @@ function gm() {
358
358
  return ne;
359
359
  }
360
360
  }
361
- function vt(T) {
361
+ function xt(T) {
362
362
  try {
363
- return it(T), !1;
363
+ return at(T), !1;
364
364
  } catch {
365
365
  return !0;
366
366
  }
367
367
  }
368
- function it(T) {
368
+ function at(T) {
369
369
  return "" + T;
370
370
  }
371
371
  function an(T) {
372
- if (vt(T))
373
- return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(T)), it(T);
372
+ if (xt(T))
373
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(T)), at(T);
374
374
  }
375
375
  var V = g.ReactCurrentOwner, ae = {
376
376
  key: !0,
377
377
  ref: !0,
378
378
  __self: !0,
379
379
  __source: !0
380
- }, $e, qe;
381
- function Re(T) {
380
+ }, $e, rt;
381
+ function we(T) {
382
382
  if (ie.call(T, "ref")) {
383
383
  var z = Object.getOwnPropertyDescriptor(T, "ref").get;
384
384
  if (z && z.isReactWarning)
@@ -386,7 +386,7 @@ function gm() {
386
386
  }
387
387
  return T.ref !== void 0;
388
388
  }
389
- function xt(T) {
389
+ function qe(T) {
390
390
  if (ie.call(T, "key")) {
391
391
  var z = Object.getOwnPropertyDescriptor(T, "key").get;
392
392
  if (z && z.isReactWarning)
@@ -408,10 +408,10 @@ function gm() {
408
408
  });
409
409
  }
410
410
  }
411
- function lt(T, z) {
411
+ function ut(T, z) {
412
412
  {
413
413
  var ne = function() {
414
- qe || (qe = !0, b("%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)", z));
414
+ rt || (rt = !0, b("%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)", z));
415
415
  };
416
416
  ne.isReactWarning = !0, Object.defineProperty(T, "ref", {
417
417
  get: ne,
@@ -448,25 +448,25 @@ function gm() {
448
448
  value: Le
449
449
  }), Object.freeze && (Object.freeze(Ie.props), Object.freeze(Ie)), Ie;
450
450
  };
451
- function at(T, z, ne, xe, Le) {
451
+ function ct(T, z, ne, xe, Le) {
452
452
  {
453
- var He, Pe = {}, Ie = null, pt = null;
454
- ne !== void 0 && (an(ne), Ie = "" + ne), xt(z) && (an(z.key), Ie = "" + z.key), Re(z) && (pt = z.ref, jt(z, Le));
453
+ var He, Pe = {}, Ie = null, mt = null;
454
+ ne !== void 0 && (an(ne), Ie = "" + ne), qe(z) && (an(z.key), Ie = "" + z.key), we(z) && (mt = z.ref, jt(z, Le));
455
455
  for (He in z)
456
456
  ie.call(z, He) && !ae.hasOwnProperty(He) && (Pe[He] = z[He]);
457
457
  if (T && T.defaultProps) {
458
- var Xe = T.defaultProps;
459
- for (He in Xe)
460
- Pe[He] === void 0 && (Pe[He] = Xe[He]);
458
+ var Je = T.defaultProps;
459
+ for (He in Je)
460
+ Pe[He] === void 0 && (Pe[He] = Je[He]);
461
461
  }
462
- if (Ie || pt) {
462
+ if (Ie || mt) {
463
463
  var tt = typeof T == "function" ? T.displayName || T.name || "Unknown" : T;
464
- Ie && En(Pe, tt), pt && lt(Pe, tt);
464
+ Ie && En(Pe, tt), mt && ut(Pe, tt);
465
465
  }
466
- return Tt(T, Ie, pt, Le, xe, V.current, Pe);
466
+ return Tt(T, Ie, mt, Le, xe, V.current, Pe);
467
467
  }
468
468
  }
469
- var ht = g.ReactCurrentOwner, cn = g.ReactDebugCurrentFrame;
469
+ var pt = g.ReactCurrentOwner, cn = g.ReactDebugCurrentFrame;
470
470
  function Yt(T) {
471
471
  if (T) {
472
472
  var z = T._owner, ne = je(T.type, T._source, z ? z.type : null);
@@ -474,15 +474,15 @@ function gm() {
474
474
  } else
475
475
  cn.setExtraStackFrame(null);
476
476
  }
477
- var hn;
478
- hn = !1;
477
+ var fn;
478
+ fn = !1;
479
479
  function te(T) {
480
480
  return typeof T == "object" && T !== null && T.$$typeof === t;
481
481
  }
482
482
  function le() {
483
483
  {
484
- if (ht.current) {
485
- var T = G(ht.current.type);
484
+ if (pt.current) {
485
+ var T = G(pt.current.type);
486
486
  if (T)
487
487
  return `
488
488
 
@@ -517,14 +517,14 @@ Check the top-level render call using <` + ne + ">.");
517
517
  return;
518
518
  Ye[ne] = !0;
519
519
  var xe = "";
520
- T && T._owner && T._owner !== ht.current && (xe = " It was passed a child from " + G(T._owner.type) + "."), Yt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, xe), Yt(null);
520
+ T && T._owner && T._owner !== pt.current && (xe = " It was passed a child from " + G(T._owner.type) + "."), Yt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, xe), Yt(null);
521
521
  }
522
522
  }
523
523
  function Gn(T, z) {
524
524
  {
525
525
  if (typeof T != "object")
526
526
  return;
527
- if (ot(T))
527
+ if (st(T))
528
528
  for (var ne = 0; ne < T.length; ne++) {
529
529
  var xe = T[ne];
530
530
  te(xe) && Vn(xe, z);
@@ -555,9 +555,9 @@ Check the top-level render call using <` + ne + ">.");
555
555
  return;
556
556
  if (ne) {
557
557
  var xe = G(z);
558
- Ce(ne, T.props, "prop", xe, T);
559
- } else if (z.PropTypes !== void 0 && !hn) {
560
- hn = !0;
558
+ Te(ne, T.props, "prop", xe, T);
559
+ } else if (z.PropTypes !== void 0 && !fn) {
560
+ fn = !0;
561
561
  var Le = G(z);
562
562
  b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Le || "Unknown");
563
563
  }
@@ -583,19 +583,19 @@ Check the top-level render call using <` + ne + ">.");
583
583
  if (!Pe) {
584
584
  var Ie = "";
585
585
  (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Ie += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var pt = Oe();
587
- pt ? Ie += pt : Ie += le();
588
- var Xe;
589
- T === null ? Xe = "null" : ot(T) ? Xe = "array" : T !== void 0 && T.$$typeof === t ? (Xe = "<" + (G(T.type) || "Unknown") + " />", Ie = " Did you accidentally export a JSX literal instead of a component?") : Xe = typeof T, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Xe, Ie);
586
+ var mt = Oe();
587
+ mt ? Ie += mt : Ie += le();
588
+ var Je;
589
+ T === null ? Je = "null" : st(T) ? Je = "array" : T !== void 0 && T.$$typeof === t ? (Je = "<" + (G(T.type) || "Unknown") + " />", Ie = " Did you accidentally export a JSX literal instead of a component?") : Je = typeof T, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Je, Ie);
590
590
  }
591
- var tt = at(T, z, ne, Le, He);
591
+ var tt = ct(T, z, ne, Le, He);
592
592
  if (tt == null)
593
593
  return tt;
594
594
  if (Pe) {
595
595
  var kt = z.children;
596
596
  if (kt !== void 0)
597
597
  if (xe)
598
- if (ot(kt)) {
598
+ if (st(kt)) {
599
599
  for (var Yn = 0; Yn < kt.length; Yn++)
600
600
  Gn(kt[Yn], T);
601
601
  Object.freeze && Object.freeze(kt);
@@ -871,10 +871,10 @@ const Jm = (e) => {
871
871
  asap: eg,
872
872
  isIterable: tg
873
873
  };
874
- function we(e, t, n, r, o) {
874
+ function ye(e, t, n, r, o) {
875
875
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), r && (this.request = r), o && (this.response = o, this.status = o.status ? o.status : null);
876
876
  }
877
- k.inherits(we, Error, {
877
+ k.inherits(ye, Error, {
878
878
  toJSON: function() {
879
879
  return {
880
880
  // Standard
@@ -895,7 +895,7 @@ k.inherits(we, Error, {
895
895
  };
896
896
  }
897
897
  });
898
- const Ml = we.prototype, Dl = {};
898
+ const Ml = ye.prototype, Dl = {};
899
899
  [
900
900
  "ERR_BAD_OPTION_VALUE",
901
901
  "ERR_BAD_OPTION",
@@ -913,15 +913,15 @@ const Ml = we.prototype, Dl = {};
913
913
  ].forEach((e) => {
914
914
  Dl[e] = { value: e };
915
915
  });
916
- Object.defineProperties(we, Dl);
916
+ Object.defineProperties(ye, Dl);
917
917
  Object.defineProperty(Ml, "isAxiosError", { value: !0 });
918
- we.from = (e, t, n, r, o, s) => {
918
+ ye.from = (e, t, n, r, o, s) => {
919
919
  const i = Object.create(Ml);
920
920
  k.toFlatObject(e, i, function(d) {
921
921
  return d !== Error.prototype;
922
922
  }, (u) => u !== "isAxiosError");
923
923
  const a = e && e.message ? e.message : "Error", l = t == null && e ? e.code : t;
924
- return we.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
924
+ return ye.call(i, a, l, n, r, o), e && i.cause == null && Object.defineProperty(i, "cause", { value: e, configurable: !0 }), i.name = e && e.name || "Error", s && Object.assign(i, s), i;
925
925
  };
926
926
  const ng = null;
927
927
  function fi(e) {
@@ -961,7 +961,7 @@ function ns(e, t, n) {
961
961
  if (k.isBoolean(x))
962
962
  return x.toString();
963
963
  if (!l && k.isBlob(x))
964
- throw new we("Blob is not supported. Use a Buffer instead.");
964
+ throw new ye("Blob is not supported. Use a Buffer instead.");
965
965
  return k.isArrayBuffer(x) || k.isTypedArray(x) ? l && typeof Blob == "function" ? new Blob([x]) : Buffer.from(x) : x;
966
966
  }
967
967
  function d(x, v, p) {
@@ -1125,14 +1125,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", fg
1125
1125
  hasStandardBrowserWebWorkerEnv: dg,
1126
1126
  navigator: hi,
1127
1127
  origin: fg
1128
- }, Symbol.toStringTag, { value: "Module" })), ut = {
1128
+ }, Symbol.toStringTag, { value: "Module" })), dt = {
1129
1129
  ...hg,
1130
1130
  ...lg
1131
1131
  };
1132
1132
  function pg(e, t) {
1133
- return ns(e, new ut.classes.URLSearchParams(), {
1133
+ return ns(e, new dt.classes.URLSearchParams(), {
1134
1134
  visitor: function(n, r, o, s) {
1135
- return ut.isNode && k.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1135
+ return dt.isNode && k.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1136
1136
  },
1137
1137
  ...t
1138
1138
  });
@@ -1212,7 +1212,7 @@ const Yr = {
1212
1212
  return JSON.parse(t, this.parseReviver);
1213
1213
  } catch (a) {
1214
1214
  if (i)
1215
- throw a.name === "SyntaxError" ? we.from(a, we.ERR_BAD_RESPONSE, this, null, this.response) : a;
1215
+ throw a.name === "SyntaxError" ? ye.from(a, ye.ERR_BAD_RESPONSE, this, null, this.response) : a;
1216
1216
  }
1217
1217
  }
1218
1218
  return t;
@@ -1227,8 +1227,8 @@ const Yr = {
1227
1227
  maxContentLength: -1,
1228
1228
  maxBodyLength: -1,
1229
1229
  env: {
1230
- FormData: ut.classes.FormData,
1231
- Blob: ut.classes.Blob
1230
+ FormData: dt.classes.FormData,
1231
+ Blob: dt.classes.Blob
1232
1232
  },
1233
1233
  validateStatus: function(t) {
1234
1234
  return t >= 200 && t < 300;
@@ -1455,16 +1455,16 @@ function zl(e) {
1455
1455
  return !!(e && e.__CANCEL__);
1456
1456
  }
1457
1457
  function fr(e, t, n) {
1458
- we.call(this, e ?? "canceled", we.ERR_CANCELED, t, n), this.name = "CanceledError";
1458
+ ye.call(this, e ?? "canceled", ye.ERR_CANCELED, t, n), this.name = "CanceledError";
1459
1459
  }
1460
- k.inherits(fr, we, {
1460
+ k.inherits(fr, ye, {
1461
1461
  __CANCEL__: !0
1462
1462
  });
1463
1463
  function Ul(e, t, n) {
1464
1464
  const r = n.config.validateStatus;
1465
- !n.status || !r || r(n.status) ? e(n) : t(new we(
1465
+ !n.status || !r || r(n.status) ? e(n) : t(new ye(
1466
1466
  "Request failed with status code " + n.status,
1467
- [we.ERR_BAD_REQUEST, we.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1467
+ [ye.ERR_BAD_REQUEST, ye.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
1468
1468
  n.config,
1469
1469
  n.request,
1470
1470
  n
@@ -1528,10 +1528,10 @@ const Mo = (e, t, n = 3) => {
1528
1528
  total: e,
1529
1529
  loaded: r
1530
1530
  }), t[1]];
1531
- }, ic = (e) => (...t) => k.asap(() => e(...t)), Ng = ut.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, ut.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1532
- new URL(ut.origin),
1533
- ut.navigator && /(msie|trident)/i.test(ut.navigator.userAgent)
1534
- ) : () => !0, Ig = ut.hasStandardBrowserEnv ? (
1531
+ }, ic = (e) => (...t) => k.asap(() => e(...t)), Ng = dt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, dt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1532
+ new URL(dt.origin),
1533
+ dt.navigator && /(msie|trident)/i.test(dt.navigator.userAgent)
1534
+ ) : () => !0, Ig = dt.hasStandardBrowserEnv ? (
1535
1535
  // Standard browser envs support document.cookie
1536
1536
  {
1537
1537
  write(e, t, n, r, o, s) {
@@ -1640,7 +1640,7 @@ const Vl = (e) => {
1640
1640
  "Authorization",
1641
1641
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1642
1642
  ), k.isFormData(n)) {
1643
- if (ut.hasStandardBrowserEnv || ut.hasStandardBrowserWebWorkerEnv)
1643
+ if (dt.hasStandardBrowserEnv || dt.hasStandardBrowserWebWorkerEnv)
1644
1644
  i.setContentType(void 0);
1645
1645
  else if (k.isFunction(n.getHeaders)) {
1646
1646
  const l = n.getHeaders(), u = ["content-type", "content-length"];
@@ -1649,7 +1649,7 @@ const Vl = (e) => {
1649
1649
  });
1650
1650
  }
1651
1651
  }
1652
- if (ut.hasStandardBrowserEnv && (r && k.isFunction(r) && (r = r(t)), r || r !== !1 && Ng(t.url))) {
1652
+ if (dt.hasStandardBrowserEnv && (r && k.isFunction(r) && (r = r(t)), r || r !== !1 && Ng(t.url))) {
1653
1653
  const l = o && s && Ig.read(s);
1654
1654
  l && i.set(o, l);
1655
1655
  }
@@ -1687,16 +1687,16 @@ const Vl = (e) => {
1687
1687
  "onloadend" in p ? p.onloadend = g : p.onreadystatechange = function() {
1688
1688
  !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(g);
1689
1689
  }, p.onabort = function() {
1690
- p && (r(new we("Request aborted", we.ECONNABORTED, e, p)), p = null);
1690
+ p && (r(new ye("Request aborted", ye.ECONNABORTED, e, p)), p = null);
1691
1691
  }, p.onerror = function(R) {
1692
- const S = R && R.message ? R.message : "Network Error", C = new we(S, we.ERR_NETWORK, e, p);
1692
+ const S = R && R.message ? R.message : "Network Error", C = new ye(S, ye.ERR_NETWORK, e, p);
1693
1693
  C.event = R || null, r(C), p = null;
1694
1694
  }, p.ontimeout = function() {
1695
1695
  let R = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1696
1696
  const S = o.transitional || $l;
1697
- o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(new we(
1697
+ o.timeoutErrorMessage && (R = o.timeoutErrorMessage), r(new ye(
1698
1698
  R,
1699
- S.clarifyTimeoutError ? we.ETIMEDOUT : we.ECONNABORTED,
1699
+ S.clarifyTimeoutError ? ye.ETIMEDOUT : ye.ECONNABORTED,
1700
1700
  e,
1701
1701
  p
1702
1702
  )), p = null;
@@ -1706,8 +1706,8 @@ const Vl = (e) => {
1706
1706
  p && (r(!y || y.type ? new fr(null, e, p) : y), p.abort(), p = null);
1707
1707
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1708
1708
  const b = Tg(o.url);
1709
- if (b && ut.protocols.indexOf(b) === -1) {
1710
- r(new we("Unsupported protocol " + b + ":", we.ERR_BAD_REQUEST, e));
1709
+ if (b && dt.protocols.indexOf(b) === -1) {
1710
+ r(new ye("Unsupported protocol " + b + ":", ye.ERR_BAD_REQUEST, e));
1711
1711
  return;
1712
1712
  }
1713
1713
  p.send(s || null);
@@ -1720,11 +1720,11 @@ const Vl = (e) => {
1720
1720
  if (!o) {
1721
1721
  o = !0, a();
1722
1722
  const d = u instanceof Error ? u : this.reason;
1723
- r.abort(d instanceof we ? d : new fr(d instanceof Error ? d.message : d));
1723
+ r.abort(d instanceof ye ? d : new fr(d instanceof Error ? d.message : d));
1724
1724
  }
1725
1725
  };
1726
1726
  let i = t && setTimeout(() => {
1727
- i = null, s(new we(`timeout ${t} of ms exceeded`, we.ETIMEDOUT));
1727
+ i = null, s(new ye(`timeout ${t} of ms exceeded`, ye.ETIMEDOUT));
1728
1728
  }, t);
1729
1729
  const a = () => {
1730
1730
  e && (i && clearTimeout(i), i = null, e.forEach((u) => {
@@ -1813,7 +1813,7 @@ const Vl = (e) => {
1813
1813
  return !1;
1814
1814
  const a = o && so(uc), l = o && (typeof dc == "function" ? /* @__PURE__ */ ((x) => (v) => x.encode(v))(new dc()) : async (x) => new Uint8Array(await new n(x).arrayBuffer())), u = s && a && fc(() => {
1815
1815
  let x = !1;
1816
- const v = new n(ut.origin, {
1816
+ const v = new n(dt.origin, {
1817
1817
  body: new uc(),
1818
1818
  method: "POST",
1819
1819
  get duplex() {
@@ -1829,7 +1829,7 @@ const Vl = (e) => {
1829
1829
  let g = v && v[x];
1830
1830
  if (g)
1831
1831
  return g.call(v);
1832
- throw new we(`Response type '${x}' is not supported`, we.ERR_NOT_SUPPORT, p);
1832
+ throw new ye(`Response type '${x}' is not supported`, ye.ERR_NOT_SUPPORT, p);
1833
1833
  });
1834
1834
  });
1835
1835
  const m = async (x) => {
@@ -1838,7 +1838,7 @@ const Vl = (e) => {
1838
1838
  if (k.isBlob(x))
1839
1839
  return x.size;
1840
1840
  if (k.isSpecCompliantForm(x))
1841
- return (await new n(ut.origin, {
1841
+ return (await new n(dt.origin, {
1842
1842
  method: "POST",
1843
1843
  body: x
1844
1844
  }).arrayBuffer()).byteLength;
@@ -1929,11 +1929,11 @@ const Vl = (e) => {
1929
1929
  });
1930
1930
  } catch (U) {
1931
1931
  throw _ && _(), U && U.name === "TypeError" && /Load failed|fetch/i.test(U.message) ? Object.assign(
1932
- new we("Network Error", we.ERR_NETWORK, x, G),
1932
+ new ye("Network Error", ye.ERR_NETWORK, x, G),
1933
1933
  {
1934
1934
  cause: U.cause || U
1935
1935
  }
1936
- ) : we.from(U, U && U.code, x, G);
1936
+ ) : ye.from(U, U && U.code, x, G);
1937
1937
  }
1938
1938
  };
1939
1939
  }, Bg = /* @__PURE__ */ new Map(), Gl = (e) => {
@@ -1975,7 +1975,7 @@ const hc = (e) => `- ${e}`, $g = (e) => k.isFunction(e) || e === null || e === !
1975
1975
  r = e[i];
1976
1976
  let a;
1977
1977
  if (o = r, !$g(r) && (o = pi[(a = String(r)).toLowerCase()], o === void 0))
1978
- throw new we(`Unknown adapter '${a}'`);
1978
+ throw new ye(`Unknown adapter '${a}'`);
1979
1979
  if (o && (k.isFunction(o) || (o = o.get(t))))
1980
1980
  break;
1981
1981
  s[a || "#" + i] = o;
@@ -1987,7 +1987,7 @@ const hc = (e) => `- ${e}`, $g = (e) => k.isFunction(e) || e === null || e === !
1987
1987
  let a = n ? i.length > 1 ? `since :
1988
1988
  ` + i.map(hc).join(`
1989
1989
  `) : " " + hc(i[0]) : "as no adapter specified";
1990
- throw new we(
1990
+ throw new ye(
1991
1991
  "There is no suitable adapter to dispatch the request " + a,
1992
1992
  "ERR_NOT_SUPPORT"
1993
1993
  );
@@ -2031,9 +2031,9 @@ rs.transitional = function(t, n, r) {
2031
2031
  }
2032
2032
  return (s, i, a) => {
2033
2033
  if (t === !1)
2034
- throw new we(
2034
+ throw new ye(
2035
2035
  o(i, " has been removed" + (n ? " in " + n : "")),
2036
- we.ERR_DEPRECATED
2036
+ ye.ERR_DEPRECATED
2037
2037
  );
2038
2038
  return n && !mc[i] && (mc[i] = !0, console.warn(
2039
2039
  o(
@@ -2048,7 +2048,7 @@ rs.spelling = function(t) {
2048
2048
  };
2049
2049
  function Hg(e, t, n) {
2050
2050
  if (typeof e != "object")
2051
- throw new we("options must be an object", we.ERR_BAD_OPTION_VALUE);
2051
+ throw new ye("options must be an object", ye.ERR_BAD_OPTION_VALUE);
2052
2052
  const r = Object.keys(e);
2053
2053
  let o = r.length;
2054
2054
  for (; o-- > 0; ) {
@@ -2056,11 +2056,11 @@ function Hg(e, t, n) {
2056
2056
  if (i) {
2057
2057
  const a = e[s], l = a === void 0 || i(a, s, e);
2058
2058
  if (l !== !0)
2059
- throw new we("option " + s + " must be " + l, we.ERR_BAD_OPTION_VALUE);
2059
+ throw new ye("option " + s + " must be " + l, ye.ERR_BAD_OPTION_VALUE);
2060
2060
  continue;
2061
2061
  }
2062
2062
  if (n !== !0)
2063
- throw new we("Unknown option " + s, we.ERR_BAD_OPTION);
2063
+ throw new ye("Unknown option " + s, ye.ERR_BAD_OPTION);
2064
2064
  }
2065
2065
  }
2066
2066
  const bo = {
@@ -2353,7 +2353,7 @@ Qe.CancelToken = zg;
2353
2353
  Qe.isCancel = zl;
2354
2354
  Qe.VERSION = Yl;
2355
2355
  Qe.toFormData = ns;
2356
- Qe.AxiosError = we;
2356
+ Qe.AxiosError = ye;
2357
2357
  Qe.Cancel = Qe.CanceledError;
2358
2358
  Qe.all = function(t) {
2359
2359
  return Promise.all(t);
@@ -2519,7 +2519,7 @@ class Xg {
2519
2519
  }
2520
2520
  const Mn = new Xg();
2521
2521
  function Jg(e = {}) {
2522
- const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = ue(e.token ?? null), s = Ke(e.headers ?? {}), [i, a] = ue(!1), [l, u] = ue(null), [d, h] = ue(""), [m, w] = ue(null), [x, v] = ue(0), [p, g] = ue(!1), b = Ke(null), y = Ke(0), R = Ue((N) => {
2522
+ const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = ue(e.token ?? null), s = We(e.headers ?? {}), [i, a] = ue(!1), [l, u] = ue(null), [d, h] = ue(""), [m, w] = ue(null), [x, v] = ue(0), [p, g] = ue(!1), b = We(null), y = We(0), R = Ue((N) => {
2523
2523
  o(N);
2524
2524
  }, []), S = Ue(() => {
2525
2525
  var N;
@@ -2610,24 +2610,24 @@ function Jg(e = {}) {
2610
2610
  B && console.debug("[use-chat] skip malformed SSE data:", ie == null ? void 0 : ie.slice(0, 200));
2611
2611
  continue;
2612
2612
  }
2613
- const Se = Zg(Ne) ? Ne.data : Ne;
2614
- B && console.debug("[use-chat] event:", Se == null ? void 0 : Se.type, Se);
2615
- const fe = Se.seq;
2613
+ const Ce = Zg(Ne) ? Ne.data : Ne;
2614
+ B && console.debug("[use-chat] event:", Ce == null ? void 0 : Ce.type, Ce);
2615
+ const fe = Ce.seq;
2616
2616
  if (fe !== void 0 && (ce > 0 && fe > ce + 1 && console.warn(`[use-chat] Gap detected: expected ${ce + 1}, got ${fe}`), ce = fe, y.current = fe, v(fe)), fe !== void 0 && fe <= y.current) {
2617
2617
  B && console.debug("[use-chat] Duplicate event ignored:", fe);
2618
2618
  continue;
2619
2619
  }
2620
- if (Se.type === "token" && e.autoAppendAssistant !== !1)
2621
- J += Se.content, Z || (Z = window.setTimeout(() => {
2622
- J && (h((Ce) => Ce + J), J = ""), Z = null;
2623
- }, 50)), I == null || I(Se);
2624
- else if (Se.type === "message_delta") {
2625
- const Ce = Se.delta.filter((Be) => Be.type === "text").map((Be) => Be.text).join("");
2626
- Ce && e.autoAppendAssistant !== !1 && (J += Ce, Z || (Z = window.setTimeout(() => {
2620
+ if (Ce.type === "token" && e.autoAppendAssistant !== !1)
2621
+ J += Ce.content, Z || (Z = window.setTimeout(() => {
2622
+ J && (h((Te) => Te + J), J = ""), Z = null;
2623
+ }, 50)), I == null || I(Ce);
2624
+ else if (Ce.type === "message_delta") {
2625
+ const Te = Ce.delta.filter((Be) => Be.type === "text").map((Be) => Be.text).join("");
2626
+ Te && e.autoAppendAssistant !== !1 && (J += Te, Z || (Z = window.setTimeout(() => {
2627
2627
  J && (h((Be) => Be + J), J = ""), Z = null;
2628
- }, 50))), I == null || I(Se);
2628
+ }, 50))), I == null || I(Ce);
2629
2629
  } else
2630
- Z && (window.clearTimeout(Z), Z = null), J && (h((Ce) => Ce + J), J = ""), Se.type === "checkpoint" ? w(Se.checkpointId) : Se.type === "error" && u(Se.message);
2630
+ Z && (window.clearTimeout(Z), Z = null), J && (h((Te) => Te + J), J = ""), Ce.type === "checkpoint" ? w(Ce.checkpointId) : Ce.type === "error" && u(Ce.message);
2631
2631
  }
2632
2632
  }
2633
2633
  J && h((se) => se + J);
@@ -2653,7 +2653,7 @@ function Jg(e = {}) {
2653
2653
  },
2654
2654
  [t, r, e.autoAppendAssistant]
2655
2655
  );
2656
- return Ze(() => () => {
2656
+ return Xe(() => () => {
2657
2657
  var N;
2658
2658
  return (N = b.current) == null ? void 0 : N.abort();
2659
2659
  }, []), {
@@ -2742,7 +2742,7 @@ function tv(e, t) {
2742
2742
  }
2743
2743
  }
2744
2744
  function nv(e = []) {
2745
- const [t, n] = $p(tv, { ...ev, messages: e }), r = Ke([]), o = Ke(null), s = Ke(null), i = Ue(() => {
2745
+ const [t, n] = $p(tv, { ...ev, messages: e }), r = We([]), o = We(null), s = We(null), i = Ue(() => {
2746
2746
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
2747
2747
  const d = r.current;
2748
2748
  d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
@@ -2751,10 +2751,10 @@ function nv(e = []) {
2751
2751
  }, [i]), l = Ue((d) => {
2752
2752
  r.current.push(d), a();
2753
2753
  }, [a]);
2754
- Ze(() => () => {
2754
+ Xe(() => () => {
2755
2755
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
2756
2756
  }, []);
2757
- const u = ln(() => ({
2757
+ const u = mn(() => ({
2758
2758
  reset: (d) => n({ type: "reset", payload: { messages: d } }),
2759
2759
  seed: (d, h) => n({ type: "seed", payload: { messages: d, ...h ?? {} } }),
2760
2760
  prepend: (d) => n({ type: "prepend", payload: { messages: d } }),
@@ -2935,7 +2935,7 @@ async function uv(e, t = [], n, r, o, s) {
2935
2935
  const Jl = Sl(null);
2936
2936
  function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialThreadId: o = null, autoLoadInitial: s = !0, enableFileAgentRouting: i = !1, fileAgentId: a = "invoice_reader" }) {
2937
2937
  const l = Mn;
2938
- Ze(() => {
2938
+ Xe(() => {
2939
2939
  t && l.updateConfig({
2940
2940
  baseUrl: t.baseUrl,
2941
2941
  authToken: t.apiKey
@@ -2950,7 +2950,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2950
2950
  // Ensure the path matches the chat endpoint
2951
2951
  streamPath: "/chat/runs/stream"
2952
2952
  }), [x, v] = ue(() => typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
2953
- Ze(() => {
2953
+ Xe(() => {
2954
2954
  w(typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
2955
2955
  const V = l.onTokenChange((ae) => {
2956
2956
  v(ae), w(ae);
@@ -2961,19 +2961,19 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2961
2961
  }, [l, w]);
2962
2962
  const p = Ue((V) => {
2963
2963
  l.setAuthToken(V);
2964
- }, [l]), { state: g, seed: b, prepend: y, pushUser: R, onEvent: S, reset: C } = nv(), E = 20, [N, I] = ue(!1), [j, P] = ue(!1), [B, G] = ue(null), [_, Y] = ue(void 0), [U, oe] = ue(void 0), [O, D] = ue(!1), K = Ke(!1), W = Ke([]), ee = Ue((V) => {
2964
+ }, [l]), { state: g, seed: b, prepend: y, pushUser: R, onEvent: S, reset: C } = nv(), E = 20, [N, I] = ue(!1), [j, P] = ue(!1), [B, G] = ue(null), [_, Y] = ue(void 0), [U, oe] = ue(void 0), [O, D] = ue(!1), K = We(!1), W = We([]), ee = Ue((V) => {
2965
2965
  V.cursor !== void 0 && G(V.cursor), V.hasMore !== void 0 && I(V.hasMore), V.checkpointId !== void 0 && Y(V.checkpointId), V.checkpointNs !== void 0 && oe(V.checkpointNs);
2966
- }, []), L = Ue((V, ae) => {
2967
- const $e = async () => {
2966
+ }, []), L = Ue((V, ae) => new Promise(($e, rt) => {
2967
+ const we = async () => {
2968
2968
  if (K.current) {
2969
- console.warn(`[ChatProvider] Operation "${ae}" queued - another operation in progress`), W.current.push($e);
2969
+ console.warn(`[ChatProvider] Operation "${ae}" queued - another operation in progress`), W.current.push(we);
2970
2970
  return;
2971
2971
  }
2972
2972
  K.current = !0;
2973
2973
  try {
2974
- console.log(`[ChatProvider] Executing operation: ${ae}`), await V();
2974
+ console.log(`[ChatProvider] Executing operation: ${ae}`), await V(), $e();
2975
2975
  } catch (qe) {
2976
- throw console.error(`[ChatProvider] Operation "${ae}" failed:`, qe), qe;
2976
+ console.error(`[ChatProvider] Operation "${ae}" failed:`, qe), rt(qe);
2977
2977
  } finally {
2978
2978
  K.current = !1;
2979
2979
  const qe = W.current.shift();
@@ -2981,15 +2981,16 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2981
2981
  });
2982
2982
  }
2983
2983
  };
2984
- K.current ? (W.current.push($e), console.log(`[ChatProvider] Queued operation: ${ae}`)) : $e().catch(() => {
2984
+ K.current ? (W.current.push(we), console.log(`[ChatProvider] Queued operation: ${ae}`)) : we().catch((qe) => {
2985
+ rt(qe);
2985
2986
  });
2986
- }, []), Z = Ue(
2987
+ }), []), Z = Ue(
2987
2988
  (V, ae) => {
2988
2989
  const $e = Array.isArray(V == null ? void 0 : V.messages) ? V.messages : [];
2989
2990
  ae === "replace" ? (console.log("[ChatProvider] Replacing messages, count:", $e.length), b($e, {
2990
2991
  checkpointId: (V == null ? void 0 : V.checkpointId) ?? null,
2991
2992
  checkpointNs: (V == null ? void 0 : V.checkpointNs) ?? null
2992
- })) : ae === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), y($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), G((V == null ? void 0 : V.nextCursor) ?? null), I(!!(V != null && V.hasMore)), Y((qe) => (V == null ? void 0 : V.checkpointId) ?? qe ?? void 0), oe((qe) => (V == null ? void 0 : V.checkpointNs) ?? qe ?? void 0);
2993
+ })) : ae === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), y($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), G((V == null ? void 0 : V.nextCursor) ?? null), I(!!(V != null && V.hasMore)), Y((rt) => (V == null ? void 0 : V.checkpointId) ?? rt ?? void 0), oe((rt) => (V == null ? void 0 : V.checkpointNs) ?? rt ?? void 0);
2993
2994
  },
2994
2995
  [b, y]
2995
2996
  ), [pe, he] = ue([]), [F, A] = ue(null), H = Ue(async () => {
@@ -2997,47 +2998,47 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2997
2998
  he(V);
2998
2999
  }, [l]), [J, ce] = ue(!1), se = Ue(
2999
3000
  async (V) => {
3000
- const ae = (V == null ? void 0 : V.maxAttempts) ?? 5, $e = (V == null ? void 0 : V.baseDelayMs) ?? 500, qe = (V == null ? void 0 : V.timeoutMs) ?? 2e3;
3001
+ const ae = (V == null ? void 0 : V.maxAttempts) ?? 5, $e = (V == null ? void 0 : V.baseDelayMs) ?? 500, rt = (V == null ? void 0 : V.timeoutMs) ?? 2e3;
3001
3002
  if (!l.baseUrl) return !1;
3002
- const Re = l.baseUrl.replace(/\/+$/, ""), xt = [
3003
+ const we = l.baseUrl.replace(/\/+$/, ""), qe = [
3003
3004
  "/health",
3004
3005
  "/api/health",
3005
3006
  "/",
3006
3007
  // root
3007
3008
  "/api/v2/health",
3008
3009
  "/api/v2/chat/health"
3009
- ], jt = async (lt) => {
3010
+ ], jt = async (ut) => {
3010
3011
  try {
3011
- const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), ht = await fetch(lt, { method: "GET", signal: Tt.signal });
3012
- return clearTimeout(at), ht.ok;
3012
+ const Tt = new AbortController(), ct = setTimeout(() => Tt.abort(), rt), pt = await fetch(ut, { method: "GET", signal: Tt.signal });
3013
+ return clearTimeout(ct), pt.ok;
3013
3014
  } catch {
3014
3015
  return !1;
3015
3016
  }
3016
- }, En = async (lt) => {
3017
+ }, En = async (ut) => {
3017
3018
  try {
3018
- const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), ht = await fetch(lt, { method: "HEAD", signal: Tt.signal });
3019
- return clearTimeout(at), ht.ok;
3019
+ const Tt = new AbortController(), ct = setTimeout(() => Tt.abort(), rt), pt = await fetch(ut, { method: "HEAD", signal: Tt.signal });
3020
+ return clearTimeout(ct), pt.ok;
3020
3021
  } catch {
3021
3022
  return !1;
3022
3023
  }
3023
3024
  };
3024
- for (let lt = 0; lt < ae; lt++) {
3025
- console.debug(`[ChatProvider] health-check attempt ${lt + 1}/${ae}`);
3026
- for (const at of xt) {
3027
- let ht = at;
3028
- Re.endsWith("/api") && at.startsWith("/api") && (ht = at.replace(/^\/api/, "") || "/");
3029
- const cn = ht === "/" ? Re + "/" : Re + ht;
3030
- if (console.debug(`[ChatProvider] checking ${cn}`), await jt(cn) || at === "/" && await En(Re + "/"))
3025
+ for (let ut = 0; ut < ae; ut++) {
3026
+ console.debug(`[ChatProvider] health-check attempt ${ut + 1}/${ae}`);
3027
+ for (const ct of qe) {
3028
+ let pt = ct;
3029
+ we.endsWith("/api") && ct.startsWith("/api") && (pt = ct.replace(/^\/api/, "") || "/");
3030
+ const cn = pt === "/" ? we + "/" : we + pt;
3031
+ if (console.debug(`[ChatProvider] checking ${cn}`), await jt(cn) || ct === "/" && await En(we + "/"))
3031
3032
  return ce(!0), !0;
3032
3033
  }
3033
- const Tt = $e * Math.pow(2, lt);
3034
- await new Promise((at) => setTimeout(at, Tt));
3034
+ const Tt = $e * Math.pow(2, ut);
3035
+ await new Promise((ct) => setTimeout(ct, Tt));
3035
3036
  }
3036
3037
  return ce(!1), !1;
3037
3038
  },
3038
3039
  [l.baseUrl]
3039
3040
  );
3040
- Ze(() => {
3041
+ Xe(() => {
3041
3042
  let V = !0;
3042
3043
  if (!l.baseUrl) {
3043
3044
  console.debug("[ChatProvider] skipping initial refreshThreads: api.baseUrl not configured");
@@ -3054,11 +3055,11 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3054
3055
  })(), () => {
3055
3056
  V = !1;
3056
3057
  };
3057
- }, [H, l.baseUrl, se]), Ze(() => {
3058
+ }, [H, l.baseUrl, se]), Xe(() => {
3058
3059
  r == null || r(F);
3059
3060
  }, [F, r]);
3060
- const Ae = Ke(null);
3061
- Ze(() => {
3061
+ const Ae = We(null);
3062
+ Xe(() => {
3062
3063
  if (o && s) {
3063
3064
  if (!l.baseUrl) {
3064
3065
  console.debug("[ChatProvider] skipping initial load: api.baseUrl not configured");
@@ -3072,7 +3073,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3072
3073
  }));
3073
3074
  }
3074
3075
  }, [o, s, l.baseUrl, J]);
3075
- const _e = Ke(null), je = Ke(null), ie = Ue(
3076
+ const _e = We(null), je = We(null), ie = Ue(
3076
3077
  async (V, ae, $e) => {
3077
3078
  await L(async () => {
3078
3079
  if (!l.baseUrl) {
@@ -3091,18 +3092,18 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3091
3092
  checkpointId: void 0,
3092
3093
  checkpointNs: void 0
3093
3094
  });
3094
- const Re = await l.getMessages({
3095
+ const we = await l.getMessages({
3095
3096
  threadId: V,
3096
3097
  checkpointId: ae,
3097
3098
  checkpointNs: $e,
3098
3099
  limit: E
3099
3100
  });
3100
3101
  A(V);
3101
- const xt = Array.isArray(Re == null ? void 0 : Re.messages) ? Re.messages : [];
3102
- console.log("[ChatProvider] Loading thread with", xt.length, "messages"), b(xt, {
3103
- checkpointId: (Re == null ? void 0 : Re.checkpointId) ?? null,
3104
- checkpointNs: (Re == null ? void 0 : Re.checkpointNs) ?? null
3105
- }), G((Re == null ? void 0 : Re.nextCursor) ?? null), I(!!(Re != null && Re.hasMore)), Y((jt) => (Re == null ? void 0 : Re.checkpointId) ?? jt ?? void 0), oe((jt) => (Re == null ? void 0 : Re.checkpointNs) ?? jt ?? void 0);
3102
+ const qe = Array.isArray(we == null ? void 0 : we.messages) ? we.messages : [];
3103
+ console.log("[ChatProvider] Loading thread with", qe.length, "messages"), b(qe, {
3104
+ checkpointId: (we == null ? void 0 : we.checkpointId) ?? null,
3105
+ checkpointNs: (we == null ? void 0 : we.checkpointNs) ?? null
3106
+ }), G((we == null ? void 0 : we.nextCursor) ?? null), I(!!(we != null && we.hasMore)), Y((jt) => (we == null ? void 0 : we.checkpointId) ?? jt ?? void 0), oe((jt) => (we == null ? void 0 : we.checkpointNs) ?? jt ?? void 0);
3106
3107
  } finally {
3107
3108
  _e.current = null;
3108
3109
  }
@@ -3112,7 +3113,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3112
3113
  ), Ne = Ue(async (V) => {
3113
3114
  const ae = await l.listCheckpoints(V);
3114
3115
  return cv(ae, V);
3115
- }, [l]), Se = Ue(async (V, ae) => {
3116
+ }, [l]), Ce = Ue(async (V, ae) => {
3116
3117
  await L(async () => {
3117
3118
  if (!F) throw new Error("No active thread");
3118
3119
  ee({
@@ -3132,10 +3133,10 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3132
3133
  }, [l, F, Z, L, ee]), fe = Ue(async () => {
3133
3134
  if (!F) throw new Error("No active thread");
3134
3135
  await ie(F);
3135
- }, [F, ie]), Ce = Ke(!1);
3136
- Ze(() => {
3137
- const V = Ce.current;
3138
- Ce.current = u, V && !u && F && L(async () => {
3136
+ }, [F, ie]), Te = We(!1);
3137
+ Xe(() => {
3138
+ const V = Te.current;
3139
+ Te.current = u, V && !u && F && L(async () => {
3139
3140
  try {
3140
3141
  await H();
3141
3142
  } catch (ae) {
@@ -3146,22 +3147,22 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3146
3147
  const Be = Ue(async (V) => {
3147
3148
  const ae = await l.createThread(V);
3148
3149
  return await H(), await ie(ae.threadId), ae.threadId;
3149
- }, [l, H, ie]), ot = Ue(async (V) => {
3150
+ }, [l, H, ie]), st = Ue(async (V) => {
3150
3151
  await l.deleteThread(V), await H(), F === V && (A(null), C([]), I(!1), G(null), Y(void 0), oe(void 0));
3151
3152
  }, [l, H, F, C]), et = Ue(async (V, ae) => {
3152
3153
  await l.updateThread(V, ae), await H();
3153
- }, [l, H]), vt = Ue(async (V, ae) => {
3154
- var hn;
3155
- const $e = (ae == null ? void 0 : ae.attachments) || [], { contentParts: qe, filesInfo: Re } = await uv(
3154
+ }, [l, H]), xt = Ue(async (V, ae) => {
3155
+ var fn;
3156
+ const $e = (ae == null ? void 0 : ae.attachments) || [], { contentParts: rt, filesInfo: we } = await uv(
3156
3157
  l,
3157
3158
  $e,
3158
3159
  t == null ? void 0 : t.uploadPath
3159
- ), xt = [];
3160
- V && V.trim() && xt.push({ type: "text", text: V.trim() });
3160
+ ), qe = [];
3161
+ V && V.trim() && qe.push({ type: "text", text: V.trim() });
3161
3162
  const jt = {
3162
- id: ((hn = crypto.randomUUID) == null ? void 0 : hn.call(crypto)) || `user-${Date.now()}`,
3163
+ id: ((fn = crypto.randomUUID) == null ? void 0 : fn.call(crypto)) || `user-${Date.now()}`,
3163
3164
  role: "user",
3164
- content: xt,
3165
+ content: qe,
3165
3166
  // ← No empty text parts
3166
3167
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3167
3168
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? g.lastCheckpointId ?? void 0,
@@ -3171,23 +3172,23 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3171
3172
  const En = {
3172
3173
  ...jt,
3173
3174
  // No need to filter - messageContent already only contains text
3174
- content: xt
3175
+ content: qe
3175
3176
  // ← Clean content without empty parts
3176
- }, lt = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, Tt = !!lt.edit, at = lt.originalMessageId, ht = typeof at == "string" ? at : void 0, cn = $e && $e.length > 0, Yt = {
3177
+ }, ut = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, Tt = !!ut.edit, ct = ut.originalMessageId, pt = typeof ct == "string" ? ct : void 0, cn = $e && $e.length > 0, Yt = {
3177
3178
  ...F ? { threadId: F } : {},
3178
3179
  payload: {
3179
3180
  messages: [En],
3180
3181
  // Remove attachments array since we're not including file parts in message content
3181
- files_info: Re,
3182
+ files_info: we,
3182
3183
  ...i && cn && a ? { active_agent: a } : {},
3183
- ...lt
3184
+ ...ut
3184
3185
  },
3185
3186
  checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? g.lastCheckpointId ?? void 0,
3186
3187
  checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? g.lastCheckpointNs ?? void 0,
3187
3188
  nodeFilter: ae == null ? void 0 : ae.nodeFilter,
3188
3189
  config: ae == null ? void 0 : ae.config,
3189
3190
  edit: Tt,
3190
- originalMessageId: ht
3191
+ originalMessageId: pt
3191
3192
  };
3192
3193
  h(
3193
3194
  Yt,
@@ -3200,7 +3201,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3200
3201
  }
3201
3202
  }
3202
3203
  );
3203
- }, [F, R, h, S, g.lastCheckpointId, g.lastCheckpointNs, l, t == null ? void 0 : t.uploadPath, H, A, i, a]), it = Ue(
3204
+ }, [F, R, h, S, g.lastCheckpointId, g.lastCheckpointNs, l, t == null ? void 0 : t.uploadPath, H, A, i, a]), at = Ue(
3204
3205
  async (V) => {
3205
3206
  if (!F) throw new Error("No active thread");
3206
3207
  if (j || !N) return;
@@ -3240,17 +3241,17 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3240
3241
  isLoadingHistory: j,
3241
3242
  isPostStreamFetch: O,
3242
3243
  // NEW: expose flag for post-stream fetches to consumers
3243
- loadOlderMessages: it,
3244
+ loadOlderMessages: at,
3244
3245
  historyPageSize: E,
3245
3246
  listCheckpoints: Ne,
3246
- navigateToCheckpoint: Se,
3247
+ navigateToCheckpoint: Ce,
3247
3248
  returnToLatest: fe,
3248
3249
  refreshThreads: H,
3249
3250
  createThread: Be,
3250
- deleteThread: ot,
3251
+ deleteThread: st,
3251
3252
  renameThread: et,
3252
3253
  loadThread: ie,
3253
- send: vt,
3254
+ send: xt,
3254
3255
  stop: m
3255
3256
  };
3256
3257
  return /* @__PURE__ */ c.jsx(Jl.Provider, { value: an, children: e });
@@ -3440,19 +3441,19 @@ function ss(e, t) {
3440
3441
  function vv(e, t) {
3441
3442
  return t(e);
3442
3443
  }
3443
- function Ve(...e) {
3444
+ function Ge(...e) {
3444
3445
  return e;
3445
3446
  }
3446
3447
  function Fe(e, t) {
3447
3448
  return e(yn, t);
3448
3449
  }
3449
- function ye(e, t) {
3450
+ function Se(e, t) {
3450
3451
  e(os, t);
3451
3452
  }
3452
3453
  function Xi(e) {
3453
3454
  e(hr);
3454
3455
  }
3455
- function Je(e) {
3456
+ function Ze(e) {
3456
3457
  return e(Ql);
3457
3458
  }
3458
3459
  function de(e, t) {
@@ -3475,7 +3476,7 @@ function Sc(e) {
3475
3476
  function tu(e, t) {
3476
3477
  return e === t;
3477
3478
  }
3478
- function We(e = tu) {
3479
+ function Ve(e = tu) {
3479
3480
  let t;
3480
3481
  return (n) => (r) => {
3481
3482
  e(t, r) || (t = r, n(r));
@@ -3516,7 +3517,7 @@ function Dn(e) {
3516
3517
  e > 0 ? e-- : t(n);
3517
3518
  };
3518
3519
  }
3519
- function un(e) {
3520
+ function ln(e) {
3520
3521
  let t = null, n;
3521
3522
  return (r) => (o) => {
3522
3523
  t = o, !n && (n = setTimeout(() => {
@@ -3524,7 +3525,7 @@ function un(e) {
3524
3525
  }, e));
3525
3526
  };
3526
3527
  }
3527
- function Te(...e) {
3528
+ function Re(...e) {
3528
3529
  const t = new Array(e.length);
3529
3530
  let n = 0, r = null;
3530
3531
  const o = Math.pow(2, e.length) - 1;
@@ -3575,7 +3576,7 @@ function X(e) {
3575
3576
  return n(r, o);
3576
3577
  };
3577
3578
  }
3578
- function ft(e, t) {
3579
+ function ht(e, t) {
3579
3580
  return ss(X(t), (n) => de(e, n));
3580
3581
  }
3581
3582
  function ke() {
@@ -3626,7 +3627,7 @@ function nt(...e) {
3626
3627
  return e.forEach((s, i) => {
3627
3628
  const a = Math.pow(2, i);
3628
3629
  Fe(s, (l) => {
3629
- n[i] = l, r = r | a, r === o && ye(t, n);
3630
+ n[i] = l, r = r | a, r === o && Se(t, n);
3630
3631
  });
3631
3632
  }), function(s, i) {
3632
3633
  switch (s) {
@@ -3640,7 +3641,7 @@ function nt(...e) {
3640
3641
  };
3641
3642
  }
3642
3643
  function me(e, t = tu) {
3643
- return $(e, We(t));
3644
+ return $(e, Ve(t));
3644
3645
  }
3645
3646
  function xi(...e) {
3646
3647
  return function(t, n) {
@@ -3667,7 +3668,7 @@ const Sv = {
3667
3668
  return {
3668
3669
  log: X((t, n, r = 1) => {
3669
3670
  var o;
3670
- const s = (o = Cv().VIRTUOSO_LOG_LEVEL) != null ? o : Je(e);
3671
+ const s = (o = Cv().VIRTUOSO_LOG_LEVEL) != null ? o : Ze(e);
3671
3672
  r >= s && console[Sv[r]](
3672
3673
  "%creact-virtuoso: %c%s %o",
3673
3674
  "color: #0253b3; font-weight: bold",
@@ -3786,7 +3787,7 @@ function nu(e, t, n) {
3786
3787
  }
3787
3788
  }, [a, t, i]), s;
3788
3789
  }
3789
- const mt = Me(
3790
+ const gt = Me(
3790
3791
  () => {
3791
3792
  const e = ke(), t = ke(), n = X(0), r = ke(), o = X(0), s = ke(), i = ke(), a = X(0), l = X(0), u = X(0), d = X(0), h = ke(), m = ke(), w = X(!1), x = X(!1), v = X(!1);
3792
3793
  return de(
@@ -3857,7 +3858,7 @@ function zt(e, t, n = "k") {
3857
3858
  return zt(e.l, t, n);
3858
3859
  }
3859
3860
  function Et(e, t, n) {
3860
- return ze(e) ? iu(t, n, 1) : t === e.k ? rt(e, { k: t, v: n }) : t < e.k ? Tc(rt(e, { l: Et(e.l, t, n) })) : Tc(rt(e, { r: Et(e.r, t, n) }));
3861
+ return ze(e) ? iu(t, n, 1) : t === e.k ? ot(e, { k: t, v: n }) : t < e.k ? Tc(ot(e, { l: Et(e.l, t, n) })) : Tc(ot(e, { r: Et(e.r, t, n) }));
3861
3862
  }
3862
3863
  function tr() {
3863
3864
  return _r;
@@ -3878,9 +3879,9 @@ function bi(e, t) {
3878
3879
  return r;
3879
3880
  {
3880
3881
  const [s, i] = su(r);
3881
- return yo(rt(e, { k: s, l: ou(r), v: i }));
3882
+ return yo(ot(e, { k: s, l: ou(r), v: i }));
3882
3883
  }
3883
- } else return t < n ? yo(rt(e, { l: bi(r, t) })) : yo(rt(e, { r: bi(o, t) }));
3884
+ } else return t < n ? yo(ot(e, { l: bi(r, t) })) : yo(ot(e, { r: bi(o, t) }));
3884
3885
  }
3885
3886
  function An(e) {
3886
3887
  return ze(e) ? [] : [...An(e.l), { k: e.k, v: e.v }, ...An(e.r)];
@@ -3898,12 +3899,12 @@ function yo(e) {
3898
3899
  return e;
3899
3900
  if (n > r.lvl + 1) {
3900
3901
  if (Hs(t))
3901
- return au(rt(e, { lvl: n - 1 }));
3902
+ return au(ot(e, { lvl: n - 1 }));
3902
3903
  if (!ze(t) && !ze(t.r))
3903
- return rt(t.r, {
3904
- l: rt(t, { r: t.r.l }),
3904
+ return ot(t.r, {
3905
+ l: ot(t, { r: t.r.l }),
3905
3906
  lvl: n,
3906
- r: rt(e, {
3907
+ r: ot(e, {
3907
3908
  l: t.r.r,
3908
3909
  lvl: n - 1
3909
3910
  })
@@ -3911,22 +3912,22 @@ function yo(e) {
3911
3912
  throw new Error("Unexpected empty nodes");
3912
3913
  } else {
3913
3914
  if (Hs(e))
3914
- return yi(rt(e, { lvl: n - 1 }));
3915
+ return yi(ot(e, { lvl: n - 1 }));
3915
3916
  if (!ze(r) && !ze(r.l)) {
3916
3917
  const o = r.l, s = Hs(o) ? r.lvl - 1 : r.lvl;
3917
- return rt(o, {
3918
- l: rt(e, {
3918
+ return ot(o, {
3919
+ l: ot(e, {
3919
3920
  lvl: n - 1,
3920
3921
  r: o.l
3921
3922
  }),
3922
3923
  lvl: o.lvl + 1,
3923
- r: yi(rt(r, { l: o.r, lvl: s }))
3924
+ r: yi(ot(r, { l: o.r, lvl: s }))
3924
3925
  });
3925
3926
  } else
3926
3927
  throw new Error("Unexpected empty nodes");
3927
3928
  }
3928
3929
  }
3929
- function rt(e, t) {
3930
+ function ot(e, t) {
3930
3931
  return iu(
3931
3932
  t.k !== void 0 ? t.k : e.k,
3932
3933
  t.v !== void 0 ? t.v : e.v,
@@ -3936,7 +3937,7 @@ function rt(e, t) {
3936
3937
  );
3937
3938
  }
3938
3939
  function ou(e) {
3939
- return ze(e.r) ? e.l : yo(rt(e, { r: ou(e.r) }));
3940
+ return ze(e.r) ? e.l : yo(ot(e, { r: ou(e.r) }));
3940
3941
  }
3941
3942
  function Hs(e) {
3942
3943
  return ze(e) || e.lvl > e.r.lvl;
@@ -3952,11 +3953,11 @@ function Tc(e) {
3952
3953
  }
3953
3954
  function au(e) {
3954
3955
  const { l: t } = e;
3955
- return !ze(t) && t.lvl === e.lvl ? rt(t, { r: rt(e, { l: t.r }) }) : e;
3956
+ return !ze(t) && t.lvl === e.lvl ? ot(t, { r: ot(e, { l: t.r }) }) : e;
3956
3957
  }
3957
3958
  function yi(e) {
3958
3959
  const { lvl: t, r: n } = e;
3959
- return !ze(n) && !ze(n.r) && n.lvl === t && n.r.lvl === t ? rt(n, { l: rt(e, { r: n.l }), lvl: t + 1 }) : e;
3960
+ return !ze(n) && !ze(n.r) && n.lvl === t && n.r.lvl === t ? ot(n, { l: ot(e, { r: n.l }), lvl: t + 1 }) : e;
3960
3961
  }
3961
3962
  function Ev(e) {
3962
3963
  return ru(e, ({ k: t, v: n }) => ({ index: t, value: n }));
@@ -4136,13 +4137,13 @@ const Lv = {
4136
4137
  offsetWidth: "width"
4137
4138
  }, rn = Me(
4138
4139
  ([{ log: e }, { recalcInProgress: t }]) => {
4139
- const n = ke(), r = ke(), o = ft(r, 0), s = ke(), i = ke(), a = X(0), l = X([]), u = X(void 0), d = X(void 0), h = X((S, C) => vn(S, Lv[C])), m = X(void 0), w = X(0), x = Iv(), v = ft(
4140
- $(n, Te(l, e, w), Qt(_v, x), We()),
4140
+ const n = ke(), r = ke(), o = ht(r, 0), s = ke(), i = ke(), a = X(0), l = X([]), u = X(void 0), d = X(void 0), h = X((S, C) => vn(S, Lv[C])), m = X(void 0), w = X(0), x = Iv(), v = ht(
4141
+ $(n, Re(l, e, w), Qt(_v, x), Ve()),
4141
4142
  x
4142
- ), p = ft(
4143
+ ), p = ht(
4143
4144
  $(
4144
4145
  l,
4145
- We(),
4146
+ Ve(),
4146
4147
  Qt((S, C) => ({ current: C, prev: S.current }), {
4147
4148
  current: [],
4148
4149
  prev: []
@@ -4155,7 +4156,7 @@ const Lv = {
4155
4156
  $(
4156
4157
  l,
4157
4158
  ge((S) => S.length > 0),
4158
- Te(v, w),
4159
+ Re(v, w),
4159
4160
  re(([S, C, E]) => {
4160
4161
  const N = S.reduce((I, j, P) => Et(I, j, Dr(j, C.offsetTree, E) || P), tr());
4161
4162
  return {
@@ -4169,7 +4170,7 @@ const Lv = {
4169
4170
  ), de(
4170
4171
  $(
4171
4172
  r,
4172
- Te(v),
4173
+ Re(v),
4173
4174
  ge(([S, { lastIndex: C }]) => S < C),
4174
4175
  re(([S, { lastIndex: C, lastSize: E }]) => [
4175
4176
  {
@@ -4181,7 +4182,7 @@ const Lv = {
4181
4182
  ),
4182
4183
  n
4183
4184
  ), de(u, d);
4184
- const g = ft(
4185
+ const g = ht(
4185
4186
  $(
4186
4187
  u,
4187
4188
  re((S) => S === void 0)
@@ -4191,7 +4192,7 @@ const Lv = {
4191
4192
  de(
4192
4193
  $(
4193
4194
  d,
4194
- ge((S) => S !== void 0 && ze(Je(v).sizeTree)),
4195
+ ge((S) => S !== void 0 && ze(Ze(v).sizeTree)),
4195
4196
  re((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
4196
4197
  ),
4197
4198
  n
@@ -4199,7 +4200,7 @@ const Lv = {
4199
4200
  const b = Nt(
4200
4201
  $(
4201
4202
  n,
4202
- Te(v),
4203
+ Re(v),
4203
4204
  Qt(
4204
4205
  ({ sizes: S }, [C, E]) => ({
4205
4206
  changed: E !== S,
@@ -4220,15 +4221,15 @@ const Lv = {
4220
4221
  re((S) => S.diff)
4221
4222
  ),
4222
4223
  (S) => {
4223
- const { groupIndices: C } = Je(v);
4224
+ const { groupIndices: C } = Ze(v);
4224
4225
  if (S > 0)
4225
- ye(t, !0), ye(s, S + Rc(S, C));
4226
+ Se(t, !0), Se(s, S + Rc(S, C));
4226
4227
  else if (S < 0) {
4227
- const E = Je(p);
4228
- E.length > 0 && (S -= Rc(-S, E)), ye(i, S);
4228
+ const E = Ze(p);
4229
+ E.length > 0 && (S -= Rc(-S, E)), Se(i, S);
4229
4230
  }
4230
4231
  }
4231
- ), Fe($(a, Te(e)), ([S, C]) => {
4232
+ ), Fe($(a, Re(e)), ([S, C]) => {
4232
4233
  S < 0 && C(
4233
4234
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
4234
4235
  { firstItemIndex: a },
@@ -4239,7 +4240,7 @@ const Lv = {
4239
4240
  de(
4240
4241
  $(
4241
4242
  s,
4242
- Te(v),
4243
+ Re(v),
4243
4244
  re(([S, C]) => {
4244
4245
  const E = C.groupIndices.length > 0, N = [], I = C.lastSize;
4245
4246
  if (E) {
@@ -4300,7 +4301,7 @@ const Lv = {
4300
4301
  const R = Nt(
4301
4302
  $(
4302
4303
  i,
4303
- Te(v, w),
4304
+ Re(v, w),
4304
4305
  re(([S, { offsetTree: C }, E]) => {
4305
4306
  const N = -S;
4306
4307
  return Dr(N, C, E);
@@ -4310,13 +4311,13 @@ const Lv = {
4310
4311
  return de(
4311
4312
  $(
4312
4313
  i,
4313
- Te(v, w),
4314
+ Re(v, w),
4314
4315
  re(([S, C, E]) => {
4315
4316
  if (C.groupIndices.length > 0) {
4316
4317
  if (ze(C.sizeTree))
4317
4318
  return C;
4318
4319
  let N = tr();
4319
- const I = Je(p);
4320
+ const I = Ze(p);
4320
4321
  let j = 0, P = 0, B = 0;
4321
4322
  for (; j < -S; ) {
4322
4323
  B = I[P];
@@ -4367,7 +4368,7 @@ const Lv = {
4367
4368
  unshiftWith: s
4368
4369
  };
4369
4370
  },
4370
- Ve(Sn, Zi),
4371
+ Ge(Sn, Zi),
4371
4372
  { singleton: !0 }
4372
4373
  );
4373
4374
  function Fv(e) {
@@ -4399,27 +4400,27 @@ const fu = Me(
4399
4400
  nt(o, t, r),
4400
4401
  ge(([l, u]) => as(u)),
4401
4402
  re(([l, u, d]) => zt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
4402
- We(),
4403
+ Ve(),
4403
4404
  re((l) => [l])
4404
4405
  ),
4405
4406
  i
4406
4407
  ), { groupCounts: s, topItemsIndexes: i };
4407
4408
  },
4408
- Ve(rn, mt)
4409
+ Ge(rn, gt)
4409
4410
  ), Cn = Me(
4410
4411
  ([{ log: e }]) => {
4411
4412
  const t = X(!1), n = Nt(
4412
4413
  $(
4413
4414
  t,
4414
4415
  ge((r) => r),
4415
- We()
4416
+ Ve()
4416
4417
  )
4417
4418
  );
4418
4419
  return Fe(t, (r) => {
4419
- r && Je(e)("props updated", {}, St.DEBUG);
4420
+ r && Ze(e)("props updated", {}, St.DEBUG);
4420
4421
  }), { didMount: n, propsReady: t };
4421
4422
  },
4422
- Ve(Sn),
4423
+ Ge(Sn),
4423
4424
  { singleton: !0 }
4424
4425
  ), Bv = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
4425
4426
  function hu(e) {
@@ -4444,13 +4445,13 @@ const qr = Me(
4444
4445
  const w = ke(), x = ke(), v = X(0);
4445
4446
  let p = null, g = null, b = null;
4446
4447
  function y() {
4447
- p && (p(), p = null), b && (b(), b = null), g && (clearTimeout(g), g = null), ye(l, !1);
4448
+ p && (p(), p = null), b && (b(), b = null), g && (clearTimeout(g), g = null), Se(l, !1);
4448
4449
  }
4449
4450
  return de(
4450
4451
  $(
4451
4452
  w,
4452
- Te(n, h, r, v, a, i, m),
4453
- Te(e, s, o),
4453
+ Re(n, h, r, v, a, i, m),
4454
+ Re(e, s, o),
4454
4455
  re(
4455
4456
  ([
4456
4457
  [R, S, C, E, N, I, j, P],
@@ -4462,7 +4463,7 @@ const qr = Me(
4462
4463
  let W = Dr(K, S.offsetTree, B) + I;
4463
4464
  U === "end" ? (W += G + zt(S.sizeTree, K)[1] - C + _, K === D && (W += j)) : U === "center" ? W += (G + zt(S.sizeTree, K)[1] - C + _) / 2 : W -= N, O && (W += O);
4464
4465
  const ee = (L) => {
4465
- y(), L ? (P("retrying to scroll to", { location: R }, St.DEBUG), ye(w, R)) : (ye(x, !0), P("list did not change, scroll successful", {}, St.DEBUG));
4466
+ y(), L ? (P("retrying to scroll to", { location: R }, St.DEBUG), Se(w, R)) : (Se(x, !0), P("list did not change, scroll successful", {}, St.DEBUG));
4466
4467
  };
4467
4468
  if (y(), oe === "smooth") {
4468
4469
  let L = !1;
@@ -4475,7 +4476,7 @@ const qr = Me(
4475
4476
  p = $t($(t, $v(150)), ee);
4476
4477
  return g = setTimeout(() => {
4477
4478
  y();
4478
- }, 1200), ye(l, !0), P("scrolling from index to", { behavior: oe, index: K, top: W }, St.DEBUG), { behavior: oe, top: W };
4479
+ }, 1200), Se(l, !0), P("scrolling from index to", { behavior: oe, index: K, top: W }, St.DEBUG), { behavior: oe, top: W };
4479
4480
  }
4480
4481
  )
4481
4482
  ),
@@ -4486,7 +4487,7 @@ const qr = Me(
4486
4487
  topListHeight: v
4487
4488
  };
4488
4489
  },
4489
- Ve(rn, mt, Sn),
4490
+ Ge(rn, gt, Sn),
4490
4491
  { singleton: !0 }
4491
4492
  );
4492
4493
  function $v(e) {
@@ -4514,7 +4515,7 @@ const Xr = Me(
4514
4515
  return de(
4515
4516
  $(
4516
4517
  i,
4517
- Te(l),
4518
+ Re(l),
4518
4519
  ge(([d, h]) => !!h),
4519
4520
  Jt(!1)
4520
4521
  ),
@@ -4522,7 +4523,7 @@ const Xr = Me(
4522
4523
  ), de(
4523
4524
  $(
4524
4525
  i,
4525
- Te(l),
4526
+ Re(l),
4526
4527
  ge(([d, h]) => !!h),
4527
4528
  Jt(!1)
4528
4529
  ),
@@ -4530,17 +4531,17 @@ const Xr = Me(
4530
4531
  ), Fe(
4531
4532
  $(
4532
4533
  nt(t, i),
4533
- Te(a, n, e, u),
4534
+ Re(a, n, e, u),
4534
4535
  ge(([[, d], h, { sizeTree: m }, w, x]) => d && (!ze(m) || qi(w)) && !h && !x),
4535
- Te(l)
4536
+ Re(l)
4536
4537
  ),
4537
4538
  ([, d]) => {
4538
4539
  $t(o, () => {
4539
- ye(u, !0);
4540
+ Se(u, !0);
4540
4541
  }), ea(4, () => {
4541
4542
  $t(r, () => {
4542
- ye(a, !0);
4543
- }), ye(s, d);
4543
+ Se(a, !0);
4544
+ }), Se(s, d);
4544
4545
  });
4545
4546
  }
4546
4547
  ), {
@@ -4549,7 +4550,7 @@ const Xr = Me(
4549
4550
  scrolledToInitialItem: a
4550
4551
  };
4551
4552
  },
4552
- Ve(rn, mt, qr, Cn),
4553
+ Ge(rn, gt, qr, Cn),
4553
4554
  { singleton: !0 }
4554
4555
  );
4555
4556
  function pu(e, t) {
@@ -4565,24 +4566,24 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4565
4566
  viewportHeight: 0
4566
4567
  }
4567
4568
  }, Uv = 0, Jr = Me(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
4568
- const i = X(!1), a = X(!0), l = ke(), u = ke(), d = X(4), h = X(Uv), m = ft(
4569
+ const i = X(!1), a = X(!0), l = ke(), u = ke(), d = X(4), h = X(Uv), m = ht(
4569
4570
  $(
4570
4571
  xi($(me(o), Dn(1), Jt(!0)), $(me(o), Dn(1), Jt(!1), Sc(100))),
4571
- We()
4572
+ Ve()
4572
4573
  ),
4573
4574
  !1
4574
- ), w = ft(
4575
- $(xi($(n, Jt(!0)), $(n, Jt(!1), Sc(200))), We()),
4575
+ ), w = ht(
4576
+ $(xi($(n, Jt(!0)), $(n, Jt(!1), Sc(200))), Ve()),
4576
4577
  !1
4577
4578
  );
4578
4579
  de(
4579
4580
  $(
4580
4581
  nt(me(o), me(h)),
4581
4582
  re(([b, y]) => b <= y),
4582
- We()
4583
+ Ve()
4583
4584
  ),
4584
4585
  a
4585
- ), de($(a, un(50)), u);
4586
+ ), de($(a, ln(50)), u);
4586
4587
  const x = Nt(
4587
4588
  $(
4588
4589
  nt(r, me(s), me(t), me(e), me(d)),
@@ -4608,9 +4609,9 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4608
4609
  state: j
4609
4610
  };
4610
4611
  }, zv),
4611
- We((b, y) => b && b.atBottom === y.atBottom)
4612
+ Ve((b, y) => b && b.atBottom === y.atBottom)
4612
4613
  )
4613
- ), v = ft(
4614
+ ), v = ht(
4614
4615
  $(
4615
4616
  r,
4616
4617
  Qt(
@@ -4650,21 +4651,21 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4650
4651
  re((b) => b.atBottom)
4651
4652
  ),
4652
4653
  i
4653
- ), de($(i, un(50)), l);
4654
+ ), de($(i, ln(50)), l);
4654
4655
  const p = X(Nr);
4655
4656
  de(
4656
4657
  $(
4657
4658
  r,
4658
4659
  re(({ scrollTop: b }) => b),
4659
- We(),
4660
+ Ve(),
4660
4661
  Qt(
4661
- (b, y) => Je(w) ? { direction: b.direction, prevScrollTop: y } : { direction: y < b.prevScrollTop ? Lr : Nr, prevScrollTop: y },
4662
+ (b, y) => Ze(w) ? { direction: b.direction, prevScrollTop: y } : { direction: y < b.prevScrollTop ? Lr : Nr, prevScrollTop: y },
4662
4663
  { direction: Nr, prevScrollTop: 0 }
4663
4664
  ),
4664
4665
  re((b) => b.direction)
4665
4666
  ),
4666
4667
  p
4667
- ), de($(r, un(50), Jt(Hv)), p);
4668
+ ), de($(r, ln(50), Jt(Hv)), p);
4668
4669
  const g = X(0);
4669
4670
  return de(
4670
4671
  $(
@@ -4676,8 +4677,8 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4676
4677
  ), de(
4677
4678
  $(
4678
4679
  o,
4679
- un(100),
4680
- Te(m),
4680
+ ln(100),
4681
+ Re(m),
4681
4682
  ge(([b, y]) => !!y),
4682
4683
  Qt(([b, y], [R]) => [y, R], [0, 0]),
4683
4684
  re(([b, y]) => y - b)
@@ -4696,7 +4697,7 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4696
4697
  scrollDirection: p,
4697
4698
  scrollVelocity: g
4698
4699
  };
4699
- }, Ve(mt)), Fo = "top", Bo = "bottom", Ec = "none";
4700
+ }, Ge(gt)), Fo = "top", Bo = "bottom", Ec = "none";
4700
4701
  function Nc(e, t, n) {
4701
4702
  return typeof e == "number" ? n === Lr && t === Fo || n === Nr && t === Bo ? e : 0 : n === Lr ? t === Fo ? e.main : e.reverse : t === Bo ? e.main : e.reverse;
4702
4703
  }
@@ -4706,7 +4707,7 @@ function Ic(e, t) {
4706
4707
  }
4707
4708
  const na = Me(
4708
4709
  ([{ deviation: e, fixedHeaderHeight: t, headerHeight: n, scrollTop: r, viewportHeight: o }]) => {
4709
- const s = ke(), i = X(0), a = X(0), l = X(0), u = ft(
4710
+ const s = ke(), i = X(0), a = X(0), l = X(0), u = ht(
4710
4711
  $(
4711
4712
  nt(
4712
4713
  me(r),
@@ -4741,7 +4742,7 @@ const na = Me(
4741
4742
  }
4742
4743
  ),
4743
4744
  ge((d) => d != null),
4744
- We(Mr)
4745
+ Ve(Mr)
4745
4746
  ),
4746
4747
  [0, 0]
4747
4748
  );
@@ -4755,7 +4756,7 @@ const na = Me(
4755
4756
  visibleRange: u
4756
4757
  };
4757
4758
  },
4758
- Ve(mt),
4759
+ Ge(gt),
4759
4760
  { singleton: !0 }
4760
4761
  );
4761
4762
  function Wv(e, t, n) {
@@ -4855,7 +4856,7 @@ const zn = Me(
4855
4856
  ]) => {
4856
4857
  const v = X([]), p = X(0), g = ke();
4857
4858
  de(s.topItemsIndexes, v);
4858
- const b = ft(
4859
+ const b = ht(
4859
4860
  $(
4860
4861
  nt(
4861
4862
  w,
@@ -4888,7 +4889,7 @@ const zn = Me(
4888
4889
  _,
4889
4890
  Y
4890
4891
  ]) => {
4891
- const U = I, { offsetTree: oe, sizeTree: O } = U, D = Je(p);
4892
+ const U = I, { offsetTree: oe, sizeTree: O } = U, D = Ze(p);
4892
4893
  if (N === 0)
4893
4894
  return { ...zs, totalCount: N };
4894
4895
  if (C === 0 && E === 0)
@@ -4938,7 +4939,7 @@ const zn = Me(
4938
4939
  ),
4939
4940
  //@ts-expect-error filter needs to be fixed
4940
4941
  ge((C) => C !== null),
4941
- We()
4942
+ Ve()
4942
4943
  ),
4943
4944
  zs
4944
4945
  );
@@ -4972,19 +4973,19 @@ const zn = Me(
4972
4973
  $(
4973
4974
  b,
4974
4975
  ge(({ items: C }) => C.length > 0),
4975
- Te(o, e),
4976
+ Re(o, e),
4976
4977
  ge(([{ items: C }, E]) => C[C.length - 1].originalIndex === E - 1),
4977
4978
  re(([, C, E]) => [C - 1, E]),
4978
- We(Mr),
4979
+ Ve(Mr),
4979
4980
  re(([C]) => C)
4980
4981
  )
4981
4982
  ), R = Nt(
4982
4983
  $(
4983
4984
  b,
4984
- un(200),
4985
+ ln(200),
4985
4986
  ge(({ items: C, topItems: E }) => C.length > 0 && C[0].originalIndex === E.length),
4986
4987
  re(({ items: C }) => C[0].index),
4987
- We()
4988
+ Ve()
4988
4989
  )
4989
4990
  ), S = Nt(
4990
4991
  $(
@@ -5001,12 +5002,12 @@ const zn = Me(
5001
5002
  startIndex: C[E].index
5002
5003
  };
5003
5004
  }),
5004
- We(cu)
5005
+ Ve(cu)
5005
5006
  )
5006
5007
  );
5007
5008
  return { endReached: y, initialItemCount: p, itemsRendered: g, listState: b, rangeChanged: S, startReached: R, topItemsIndexes: v, ...m };
5008
5009
  },
5009
- Ve(
5010
+ Ge(
5010
5011
  rn,
5011
5012
  fu,
5012
5013
  na,
@@ -5019,7 +5020,7 @@ const zn = Me(
5019
5020
  { singleton: !0 }
5020
5021
  ), gu = Me(
5021
5022
  ([{ fixedFooterHeight: e, fixedHeaderHeight: t, footerHeight: n, headerHeight: r }, { listState: o }]) => {
5022
- const s = ke(), i = ft(
5023
+ const s = ke(), i = ht(
5023
5024
  $(
5024
5025
  nt(n, e, r, t, o),
5025
5026
  re(([a, l, u, d, h]) => a + l + u + d + h.offsetBottom + h.bottom)
@@ -5028,23 +5029,23 @@ const zn = Me(
5028
5029
  );
5029
5030
  return de(me(i), s), { totalListHeight: i, totalListHeightChanged: s };
5030
5031
  },
5031
- Ve(mt, zn),
5032
+ Ge(gt, zn),
5032
5033
  { singleton: !0 }
5033
5034
  ), Vv = Me(
5034
5035
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
5035
- const n = X(!1), r = ft(
5036
+ const n = X(!1), r = ht(
5036
5037
  $(
5037
5038
  nt(n, e, t),
5038
5039
  ge(([o]) => o),
5039
5040
  re(([, o, s]) => Math.max(0, o - s)),
5040
- un(0),
5041
- We()
5041
+ ln(0),
5042
+ Ve()
5042
5043
  ),
5043
5044
  0
5044
5045
  );
5045
5046
  return { alignToBottom: n, paddingTopAddition: r };
5046
5047
  },
5047
- Ve(mt, gu),
5048
+ Ge(gt, gu),
5048
5049
  { singleton: !0 }
5049
5050
  ), vu = Me(() => ({
5050
5051
  context: X(null)
@@ -5064,8 +5065,8 @@ const zn = Me(
5064
5065
  return de(
5065
5066
  $(
5066
5067
  d,
5067
- Te(t, l, n, s, o, r, a),
5068
- Te(e),
5068
+ Re(t, l, n, s, o, r, a),
5069
+ Re(e),
5069
5070
  re(([[h, m, w, x, v, p, g, b], y]) => {
5070
5071
  const { align: R, behavior: S, calculateViewLocation: C = Gv, done: E, ...N } = h, I = du(h, m, x - 1), j = Dr(I, m.offsetTree, y) + v + p, P = j + zt(m.sizeTree, I)[1], B = b + p, G = b + w - g, _ = C({
5071
5072
  itemBottom: P,
@@ -5080,7 +5081,7 @@ const zn = Me(
5080
5081
  ge((Y) => !Y),
5081
5082
  // skips the initial publish of false, and the cleanup call.
5082
5083
  // but if scrollingInProgress is true, we skip the initial publish.
5083
- Dn(Je(i) ? 1 : 2)
5084
+ Dn(Ze(i) ? 1 : 2)
5084
5085
  ),
5085
5086
  E
5086
5087
  ) : E && E(), _;
@@ -5092,7 +5093,7 @@ const zn = Me(
5092
5093
  scrollIntoView: d
5093
5094
  };
5094
5095
  },
5095
- Ve(rn, mt, qr, zn, Sn),
5096
+ Ge(rn, gt, qr, zn, Sn),
5096
5097
  { singleton: !0 }
5097
5098
  );
5098
5099
  function kc(e) {
@@ -5113,7 +5114,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5113
5114
  const x = X(!1), v = ke();
5114
5115
  let p = null;
5115
5116
  function g(S) {
5116
- ye(i, {
5117
+ Se(i, {
5117
5118
  align: "end",
5118
5119
  behavior: S,
5119
5120
  index: "LAST"
@@ -5122,7 +5123,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5122
5123
  Fe(
5123
5124
  $(
5124
5125
  nt($(me(t), Dn(1)), l),
5125
- Te(me(x), s, a, h),
5126
+ Re(me(x), s, a, h),
5126
5127
  re(([[S, C], E, N, I, j]) => {
5127
5128
  let P = C && I, B = "auto";
5128
5129
  return P && (B = Kv(E, N || j), P = P && !!B), { followOutputBehavior: B, shouldFollow: P, totalCount: S };
@@ -5130,16 +5131,16 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5130
5131
  ge(({ shouldFollow: S }) => S)
5131
5132
  ),
5132
5133
  ({ followOutputBehavior: S, totalCount: C }) => {
5133
- p && (p(), p = null), Je(n) ? requestAnimationFrame(() => {
5134
- Je(d)("following output to ", { totalCount: C }, St.DEBUG), g(S);
5134
+ p && (p(), p = null), Ze(n) ? requestAnimationFrame(() => {
5135
+ Ze(d)("following output to ", { totalCount: C }, St.DEBUG), g(S);
5135
5136
  }) : p = $t(e, () => {
5136
- Je(d)("following output to ", { totalCount: C }, St.DEBUG), g(S), p = null;
5137
+ Ze(d)("following output to ", { totalCount: C }, St.DEBUG), g(S), p = null;
5137
5138
  });
5138
5139
  }
5139
5140
  );
5140
5141
  function b(S) {
5141
5142
  const C = $t(o, (E) => {
5142
- S && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !p && (Je(d)("scrolling to bottom due to increased size", {}, St.DEBUG), g("auto"));
5143
+ S && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !p && (Ze(d)("scrolling to bottom due to increased size", {}, St.DEBUG), g("auto"));
5143
5144
  });
5144
5145
  setTimeout(C, 100);
5145
5146
  }
@@ -5152,13 +5153,13 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5152
5153
  { refreshed: !1, value: 0 }
5153
5154
  ),
5154
5155
  ge(({ refreshed: S }) => S),
5155
- Te(x, t)
5156
+ Re(x, t)
5156
5157
  ),
5157
5158
  ([, S]) => {
5158
- Je(a) && b(S !== !1);
5159
+ Ze(a) && b(S !== !1);
5159
5160
  }
5160
5161
  ), Fe(v, () => {
5161
- b(Je(x) !== !1);
5162
+ b(Ze(x) !== !1);
5162
5163
  }), Fe(nt(me(x), o), ([S, C]) => {
5163
5164
  S && !C.atBottom && C.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && g("auto");
5164
5165
  });
@@ -5178,28 +5179,28 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5178
5179
  ), Fe(
5179
5180
  $(
5180
5181
  nt($(R, Dn(1)), l),
5181
- Te(me(y), a, h, m),
5182
+ Re(me(y), a, h, m),
5182
5183
  re(([[S, C], E, N, I, j]) => C && N && (E == null ? void 0 : E({ context: j, totalCount: S, scrollingInProgress: I }))),
5183
5184
  ge((S) => !!S),
5184
- un(0)
5185
+ ln(0)
5185
5186
  ),
5186
5187
  (S) => {
5187
- p && (p(), p = null), Je(n) ? requestAnimationFrame(() => {
5188
- Je(d)("scrolling into view", {}), ye(w, S);
5188
+ p && (p(), p = null), Ze(n) ? requestAnimationFrame(() => {
5189
+ Ze(d)("scrolling into view", {}), Se(w, S);
5189
5190
  }) : p = $t(e, () => {
5190
- Je(d)("scrolling into view", {}), ye(w, S), p = null;
5191
+ Ze(d)("scrolling into view", {}), Se(w, S), p = null;
5191
5192
  });
5192
5193
  }
5193
5194
  ), { autoscrollToBottom: v, followOutput: x, scrollIntoViewOnChange: y };
5194
5195
  },
5195
- Ve(
5196
+ Ge(
5196
5197
  rn,
5197
5198
  Jr,
5198
5199
  qr,
5199
5200
  Xr,
5200
5201
  Cn,
5201
5202
  Sn,
5202
- mt,
5203
+ gt,
5203
5204
  vu,
5204
5205
  xu
5205
5206
  )
@@ -5207,14 +5208,14 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5207
5208
  ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (de(
5208
5209
  $(
5209
5210
  a,
5210
- Te(s),
5211
+ Re(s),
5211
5212
  ge(([, l]) => l !== 0),
5212
- Te(o, r, t, n, e),
5213
+ Re(o, r, t, n, e),
5213
5214
  re(([[, l], u, d, h, m, w = []]) => mu(l, u, d, h, m, w))
5214
5215
  ),
5215
5216
  i
5216
5217
  ), {}),
5217
- Ve(rn, Xr, zn, Cn),
5218
+ Ge(rn, Xr, zn, Cn),
5218
5219
  { singleton: !0 }
5219
5220
  ), Xv = Me(
5220
5221
  ([{ didMount: e }, { scrollTo: t }, { listState: n }]) => {
@@ -5222,7 +5223,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5222
5223
  return Fe(
5223
5224
  $(
5224
5225
  e,
5225
- Te(r),
5226
+ Re(r),
5226
5227
  ge(([, o]) => o !== 0),
5227
5228
  re(([, o]) => ({ top: o }))
5228
5229
  ),
@@ -5235,7 +5236,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5235
5236
  ),
5236
5237
  () => {
5237
5238
  requestAnimationFrame(() => {
5238
- ye(t, o);
5239
+ Se(t, o);
5239
5240
  });
5240
5241
  }
5241
5242
  );
@@ -5244,7 +5245,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5244
5245
  initialScrollTop: r
5245
5246
  };
5246
5247
  },
5247
- Ve(Cn, mt, zn),
5248
+ Ge(Cn, gt, zn),
5248
5249
  { singleton: !0 }
5249
5250
  ), bu = Me(
5250
5251
  ([{ scrollVelocity: e }]) => {
@@ -5252,7 +5253,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5252
5253
  return de(
5253
5254
  $(
5254
5255
  e,
5255
- Te(r, t, n),
5256
+ Re(r, t, n),
5256
5257
  ge(([o, s]) => !!s),
5257
5258
  re(([o, s, i, a]) => {
5258
5259
  const { enter: l, exit: u } = s;
@@ -5263,17 +5264,17 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5263
5264
  return !0;
5264
5265
  return i;
5265
5266
  }),
5266
- We()
5267
+ Ve()
5267
5268
  ),
5268
5269
  t
5269
5270
  ), Fe(
5270
- $(nt(t, e, n), Te(r)),
5271
+ $(nt(t, e, n), Re(r)),
5271
5272
  ([[o, s, i], a]) => {
5272
5273
  o && a && a.change && a.change(s, i);
5273
5274
  }
5274
5275
  ), { isSeeking: t, scrollSeekConfiguration: r, scrollSeekRangeChanged: n, scrollVelocity: e };
5275
5276
  },
5276
- Ve(Jr),
5277
+ Ge(Jr),
5277
5278
  { singleton: !0 }
5278
5279
  ), ra = Me(([{ scrollContainerState: e, scrollTo: t }]) => {
5279
5280
  const n = ke(), r = ke(), o = ke(), s = X(!1), i = X(void 0);
@@ -5290,7 +5291,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5290
5291
  ), de(
5291
5292
  $(
5292
5293
  t,
5293
- Te(r),
5294
+ Re(r),
5294
5295
  re(([a, { offsetTop: l }]) => ({
5295
5296
  ...a,
5296
5297
  top: a.top + l
@@ -5307,7 +5308,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5307
5308
  windowScrollTo: o,
5308
5309
  windowViewportRect: r
5309
5310
  };
5310
- }, Ve(mt)), Jv = Me(
5311
+ }, Ge(gt)), Jv = Me(
5311
5312
  ([
5312
5313
  { sizeRanges: e, sizes: t },
5313
5314
  { headerHeight: n, scrollTop: r },
@@ -5319,7 +5320,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5319
5320
  return de(a, h), de(l, m), Fe(
5320
5321
  $(
5321
5322
  u,
5322
- Te(t, r, i, h, m, n)
5323
+ Re(t, r, i, h, m, n)
5323
5324
  ),
5324
5325
  ([w, x, v, p, g, b, y]) => {
5325
5326
  const R = Ov(x.sizeTree);
@@ -5328,9 +5329,9 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5328
5329
  ), de($(d, ge(qi), re(Zv)), o), de(
5329
5330
  $(
5330
5331
  s,
5331
- Te(d),
5332
+ Re(d),
5332
5333
  ge(([, w]) => w !== void 0),
5333
- We(),
5334
+ Ve(),
5334
5335
  re(([, w]) => w.ranges)
5335
5336
  ),
5336
5337
  e
@@ -5339,7 +5340,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5339
5340
  restoreStateFrom: d
5340
5341
  };
5341
5342
  },
5342
- Ve(rn, mt, Xr, Cn, ra)
5343
+ Ge(rn, gt, Xr, Cn, ra)
5343
5344
  );
5344
5345
  function Zv(e) {
5345
5346
  return { align: "start", index: 0, offset: e.scrollTop };
@@ -5354,7 +5355,7 @@ const Qv = Me(([{ topItemsIndexes: e }]) => {
5354
5355
  ),
5355
5356
  e
5356
5357
  ), { topItemCount: t };
5357
- }, Ve(zn));
5358
+ }, Ge(zn));
5358
5359
  function wu(e) {
5359
5360
  let t = !1, n;
5360
5361
  return () => (t || (t = !0, n = e()), n);
@@ -5371,7 +5372,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5371
5372
  const v = Nt(
5372
5373
  $(
5373
5374
  l,
5374
- Te(i),
5375
+ Re(i),
5375
5376
  Qt(
5376
5377
  ([, g, b, y], [{ bottom: R, items: S, offsetBottom: C, totalCount: E }, N]) => {
5377
5378
  const I = R + C;
@@ -5381,22 +5382,22 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5381
5382
  [0, [], 0, 0]
5382
5383
  ),
5383
5384
  ge(([g]) => g !== 0),
5384
- Te(r, a, n, o, w, x),
5385
+ Re(r, a, n, o, w, x),
5385
5386
  ge(([, g, b, y, , , R]) => !R && !y && g !== 0 && b === Lr),
5386
5387
  re(([[g], , , , , b]) => (b("Upward scrolling compensation", { amount: g }, St.DEBUG), g))
5387
5388
  )
5388
5389
  );
5389
5390
  function p(g) {
5390
- g > 0 ? (ye(t, { behavior: "auto", top: -g }), ye(e, 0)) : (ye(e, 0), ye(t, { behavior: "auto", top: -g }));
5391
+ g > 0 ? (Se(t, { behavior: "auto", top: -g }), Se(e, 0)) : (Se(e, 0), Se(t, { behavior: "auto", top: -g }));
5391
5392
  }
5392
- return Fe($(v, Te(e, s)), ([g, b, y]) => {
5393
- y && ex() ? ye(e, b - g) : p(-g);
5393
+ return Fe($(v, Re(e, s)), ([g, b, y]) => {
5394
+ y && ex() ? Se(e, b - g) : p(-g);
5394
5395
  }), Fe(
5395
5396
  $(
5396
- nt(ft(s, !1), e, x),
5397
+ nt(ht(s, !1), e, x),
5397
5398
  ge(([g, b, y]) => !g && !y && b !== 0),
5398
5399
  re(([g, b]) => b),
5399
- un(1)
5400
+ ln(1)
5400
5401
  ),
5401
5402
  p
5402
5403
  ), de(
@@ -5408,7 +5409,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5408
5409
  ), Fe(
5409
5410
  $(
5410
5411
  u,
5411
- Te(m, d),
5412
+ Re(m, d),
5412
5413
  re(([g, { groupIndices: b, lastSize: y, sizeTree: R }, S]) => {
5413
5414
  function C(E) {
5414
5415
  return E * (y + S);
@@ -5429,15 +5430,15 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5429
5430
  })
5430
5431
  ),
5431
5432
  (g) => {
5432
- ye(e, g), requestAnimationFrame(() => {
5433
- ye(t, { top: g }), requestAnimationFrame(() => {
5434
- ye(e, 0), ye(x, !1);
5433
+ Se(e, g), requestAnimationFrame(() => {
5434
+ Se(t, { top: g }), requestAnimationFrame(() => {
5435
+ Se(e, 0), Se(x, !1);
5435
5436
  });
5436
5437
  });
5437
5438
  }
5438
5439
  ), { deviation: e };
5439
5440
  },
5440
- Ve(mt, Jr, zn, rn, Sn, Zi)
5441
+ Ge(gt, Jr, zn, rn, Sn, Zi)
5441
5442
  ), nx = Me(
5442
5443
  ([
5443
5444
  e,
@@ -5464,7 +5465,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5464
5465
  ...u,
5465
5466
  ...d
5466
5467
  }),
5467
- Ve(
5468
+ Ge(
5468
5469
  na,
5469
5470
  qv,
5470
5471
  Cn,
@@ -5540,10 +5541,10 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5540
5541
  sizes: l,
5541
5542
  ...p
5542
5543
  }),
5543
- Ve(
5544
+ Ge(
5544
5545
  rn,
5545
5546
  Xr,
5546
- mt,
5547
+ gt,
5547
5548
  Jv,
5548
5549
  Yv,
5549
5550
  zn,
@@ -5568,22 +5569,22 @@ const io = typeof document < "u" ? q.useLayoutEffect : q.useEffect;
5568
5569
  function Su(e, t, n) {
5569
5570
  const r = Object.keys(t.required || {}), o = Object.keys(t.optional || {}), s = Object.keys(t.methods || {}), i = Object.keys(t.events || {}), a = q.createContext({});
5570
5571
  function l(p, g) {
5571
- p.propsReady && ye(p.propsReady, !1);
5572
+ p.propsReady && Se(p.propsReady, !1);
5572
5573
  for (const b of r) {
5573
5574
  const y = p[t.required[b]];
5574
- ye(y, g[b]);
5575
+ Se(y, g[b]);
5575
5576
  }
5576
5577
  for (const b of o)
5577
5578
  if (b in g) {
5578
5579
  const y = p[t.optional[b]];
5579
- ye(y, g[b]);
5580
+ Se(y, g[b]);
5580
5581
  }
5581
- p.propsReady && ye(p.propsReady, !0);
5582
+ p.propsReady && Se(p.propsReady, !0);
5582
5583
  }
5583
5584
  function u(p) {
5584
5585
  return s.reduce((g, b) => (g[b] = (y) => {
5585
5586
  const R = p[t.methods[b]];
5586
- ye(R, y);
5587
+ Se(R, y);
5587
5588
  }, g), {});
5588
5589
  }
5589
5590
  function d(p) {
@@ -5608,7 +5609,7 @@ function Su(e, t, n) {
5608
5609
  const g = q.useContext(a);
5609
5610
  return q.useCallback(
5610
5611
  (b) => {
5611
- ye(g[p], b);
5612
+ Se(g[p], b);
5612
5613
  },
5613
5614
  [g, p]
5614
5615
  );
@@ -5619,11 +5620,11 @@ function Su(e, t, n) {
5619
5620
  );
5620
5621
  return q.useSyncExternalStore(
5621
5622
  b,
5622
- () => Je(g),
5623
- () => Je(g)
5623
+ () => Ze(g),
5624
+ () => Ze(g)
5624
5625
  );
5625
5626
  }, x = (p) => {
5626
- const g = q.useContext(a)[p], [b, y] = q.useState(yc(Je, g));
5627
+ const g = q.useContext(a)[p], [b, y] = q.useState(yc(Ze, g));
5627
5628
  return io(
5628
5629
  () => Fe(g, (R) => {
5629
5630
  R !== b && y(wc(R));
@@ -5709,11 +5710,11 @@ function sa(e) {
5709
5710
  return e;
5710
5711
  }
5711
5712
  const sx = /* @__PURE__ */ Me(() => {
5712
- const e = X((a) => `Item ${a}`), t = X((a) => `Group ${a}`), n = X({}), r = X(sa), o = X("div"), s = X(pr), i = (a, l = null) => ft(
5713
+ const e = X((a) => `Item ${a}`), t = X((a) => `Group ${a}`), n = X({}), r = X(sa), o = X("div"), s = X(pr), i = (a, l = null) => ht(
5713
5714
  $(
5714
5715
  n,
5715
5716
  re((u) => u[a]),
5716
- We()
5717
+ Ve()
5717
5718
  ),
5718
5719
  l
5719
5720
  );
@@ -5736,7 +5737,7 @@ const sx = /* @__PURE__ */ Me(() => {
5736
5737
  };
5737
5738
  }), ix = /* @__PURE__ */ Me(
5738
5739
  ([e, t]) => ({ ...e, ...t }),
5739
- Ve(yu, sx)
5740
+ Ge(yu, sx)
5740
5741
  ), ax = ({ height: e }) => /* @__PURE__ */ c.jsx("div", { style: { height: e } }), cx = { overflowAnchor: "none", position: oa(), zIndex: 1 }, Nu = { overflowAnchor: "none" }, lx = { ...Nu, display: "inline-block", height: "100%" }, Pc = /* @__PURE__ */ q.memo(function({ showTopList: e = !1 }) {
5741
5742
  const t = be("listState"), n = _t("sizeRanges"), r = be("useWindowScroll"), o = be("customScrollParent"), s = _t("windowScrollContainerState"), i = _t("scrollContainerState"), a = o || r ? s : i, l = be("itemContent"), u = be("context"), d = be("groupContent"), h = be("trackItemSizes"), m = be("itemSize"), w = be("log"), x = _t("gap"), v = be("horizontalDirection"), { callbackRef: p } = Tv(
5742
5743
  n,
@@ -5768,10 +5769,10 @@ const sx = /* @__PURE__ */ Me(() => {
5768
5769
  },
5769
5770
  ...B ? {} : { visibility: "hidden" }
5770
5771
  };
5771
- return !e && t.totalCount === 0 && y ? /* @__PURE__ */ c.jsx(y, { ...dt(y, u) }) : /* @__PURE__ */ c.jsx(
5772
+ return !e && t.totalCount === 0 && y ? /* @__PURE__ */ c.jsx(y, { ...ft(y, u) }) : /* @__PURE__ */ c.jsx(
5772
5773
  S,
5773
5774
  {
5774
- ...dt(S, u),
5775
+ ...ft(S, u),
5775
5776
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
5776
5777
  ref: p,
5777
5778
  style: G,
@@ -5780,7 +5781,7 @@ const sx = /* @__PURE__ */ Me(() => {
5780
5781
  return I ? /* @__PURE__ */ go(
5781
5782
  R,
5782
5783
  {
5783
- ...dt(R, u),
5784
+ ...ft(R, u),
5784
5785
  height: _.size,
5785
5786
  index: _.index,
5786
5787
  key: U,
@@ -5790,7 +5791,7 @@ const sx = /* @__PURE__ */ Me(() => {
5790
5791
  ) : _.type === "group" ? /* @__PURE__ */ go(
5791
5792
  E,
5792
5793
  {
5793
- ...dt(E, u),
5794
+ ...ft(E, u),
5794
5795
  "data-index": Y,
5795
5796
  "data-item-index": _.index,
5796
5797
  "data-known-size": _.size,
@@ -5801,7 +5802,7 @@ const sx = /* @__PURE__ */ Me(() => {
5801
5802
  ) : /* @__PURE__ */ go(
5802
5803
  C,
5803
5804
  {
5804
- ...dt(C, u),
5805
+ ...ft(C, u),
5805
5806
  ...hx(C, _.data),
5806
5807
  "data-index": Y,
5807
5808
  "data-item-group-index": _.groupIndex,
@@ -5837,7 +5838,7 @@ const sx = /* @__PURE__ */ Me(() => {
5837
5838
  width: "100%",
5838
5839
  zIndex: 1
5839
5840
  };
5840
- function dt(e, t) {
5841
+ function ft(e, t) {
5841
5842
  if (typeof e != "string")
5842
5843
  return { context: t };
5843
5844
  }
@@ -5855,7 +5856,7 @@ const px = /* @__PURE__ */ q.memo(function() {
5855
5856
  !0,
5856
5857
  be("skipAnimationFrameInResizeObserver")
5857
5858
  ), o = be("context");
5858
- return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...dt(e, o) }) }) : null;
5859
+ return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...ft(e, o) }) }) : null;
5859
5860
  }), mx = /* @__PURE__ */ q.memo(function() {
5860
5861
  const e = be("FooterComponent"), t = _t("footerHeight"), n = be("HeaderFooterTag"), r = Hn(
5861
5862
  q.useMemo(
@@ -5867,7 +5868,7 @@ const px = /* @__PURE__ */ q.memo(function() {
5867
5868
  !0,
5868
5869
  be("skipAnimationFrameInResizeObserver")
5869
5870
  ), o = be("context");
5870
- return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...dt(e, o) }) }) : null;
5871
+ return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...ft(e, o) }) }) : null;
5871
5872
  });
5872
5873
  function Iu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5873
5874
  return q.memo(function({ children: r, style: o, context: s, ...i }) {
@@ -5888,7 +5889,7 @@ function Iu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5888
5889
  style: { ...h ? dx : ux, ...o },
5889
5890
  tabIndex: 0,
5890
5891
  ...i,
5891
- ...dt(l, s),
5892
+ ...ft(l, s),
5892
5893
  children: r
5893
5894
  }
5894
5895
  );
@@ -5915,7 +5916,7 @@ function ju({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5915
5916
  "data-virtuoso-scroller": !0,
5916
5917
  style: { position: "relative", ...o, ...d !== 0 ? { height: d + h } : {} },
5917
5918
  ...i,
5918
- ...dt(l, s),
5919
+ ...ft(l, s),
5919
5920
  children: r
5920
5921
  }
5921
5922
  );
@@ -5940,7 +5941,7 @@ const gx = ({ children: e }) => {
5940
5941
  }, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "window", ref: s, style: cs(i), children: e });
5941
5942
  }, xx = ({ children: e }) => {
5942
5943
  const t = be("TopItemListComponent") || "div", n = be("headerHeight"), r = { ...fx, marginTop: `${n}px` }, o = be("context");
5943
- return /* @__PURE__ */ c.jsx(t, { style: r, ...dt(t, o), children: e });
5944
+ return /* @__PURE__ */ c.jsx(t, { style: r, ...ft(t, o), children: e });
5944
5945
  }, bx = /* @__PURE__ */ q.memo(function(e) {
5945
5946
  const t = be("useWindowScroll"), n = be("topItemsIndexes").length > 0, r = be("customScrollParent"), o = be("context");
5946
5947
  return /* @__PURE__ */ c.jsxs(r || t ? Sx : yx, { ...e, context: o, children: [
@@ -6022,11 +6023,11 @@ const gx = ({ children: e }) => {
6022
6023
  ] })), t = X(null), n = X((u) => /* @__PURE__ */ c.jsxs("td", { colSpan: 1e3, children: [
6023
6024
  "Group ",
6024
6025
  u
6025
- ] })), r = X(null), o = X(null), s = X({}), i = X(sa), a = X(pr), l = (u, d = null) => ft(
6026
+ ] })), r = X(null), o = X(null), s = X({}), i = X(sa), a = X(pr), l = (u, d = null) => ht(
6026
6027
  $(
6027
6028
  s,
6028
6029
  re((h) => h[u]),
6029
- We()
6030
+ Ve()
6030
6031
  ),
6031
6032
  d
6032
6033
  );
@@ -6051,7 +6052,7 @@ const gx = ({ children: e }) => {
6051
6052
  GroupComponent: l("Group", "tr")
6052
6053
  };
6053
6054
  });
6054
- Ve(yu, Tx);
6055
+ Ge(yu, Tx);
6055
6056
  oa();
6056
6057
  const _c = {
6057
6058
  bottom: 0,
@@ -6099,11 +6100,11 @@ const Ix = /* @__PURE__ */ Me(
6099
6100
  Fe(
6100
6101
  $(
6101
6102
  x,
6102
- Te(D),
6103
+ Re(D),
6103
6104
  ge(([A, H]) => !!H)
6104
6105
  ),
6105
6106
  () => {
6106
- ye(K, !1);
6107
+ Se(K, !1);
6107
6108
  }
6108
6109
  ), Fe(
6109
6110
  $(
@@ -6111,10 +6112,10 @@ const Ix = /* @__PURE__ */ Me(
6111
6112
  ge(([A, H, J, ce, , se]) => A && !H && J.height !== 0 && ce.height !== 0 && !se)
6112
6113
  ),
6113
6114
  ([, , , , A]) => {
6114
- ye(W, !0), ea(1, () => {
6115
- ye(P, A);
6115
+ Se(W, !0), ea(1, () => {
6116
+ Se(P, A);
6116
6117
  }), $t($(u), () => {
6117
- ye(t, [0, 0]), ye(K, !0);
6118
+ Se(t, [0, 0]), Se(K, !0);
6118
6119
  });
6119
6120
  }
6120
6121
  ), de(
@@ -6127,13 +6128,13 @@ const Ix = /* @__PURE__ */ Me(
6127
6128
  ), Fe(
6128
6129
  $(
6129
6130
  x,
6130
- Te(oe),
6131
+ Re(oe),
6131
6132
  ge(([, A]) => A != null)
6132
6133
  ),
6133
6134
  ([, A]) => {
6134
- A && (ye(I, A.viewport), ye(j, A.item), ye(Y, A.gap), A.scrollTop > 0 && (ye(O, !0), $t($(u, Dn(1)), (H) => {
6135
- ye(O, !1);
6136
- }), ye(l, { top: A.scrollTop })));
6135
+ A && (Se(I, A.viewport), Se(j, A.item), Se(Y, A.gap), A.scrollTop > 0 && (Se(O, !0), $t($(u, Dn(1)), (H) => {
6136
+ Se(O, !1);
6137
+ }), Se(l, { top: A.scrollTop })));
6137
6138
  }
6138
6139
  ), de(
6139
6140
  $(
@@ -6185,18 +6186,18 @@ const Ix = /* @__PURE__ */ Me(
6185
6186
  ie,
6186
6187
  Ne
6187
6188
  ]) => {
6188
- const { column: Se, row: fe } = ce, { height: Ce, width: Be } = se, { width: ot } = Ae;
6189
- if (je === 0 && (A === 0 || ot === 0))
6189
+ const { column: Ce, row: fe } = ce, { height: Te, width: Be } = se, { width: st } = Ae;
6190
+ if (je === 0 && (A === 0 || st === 0))
6190
6191
  return _c;
6191
6192
  if (Be === 0) {
6192
- const Re = ta(Ne, A), xt = Re + Math.max(je - 1, 0);
6193
- return Ex(Dc(Re, xt, _e));
6193
+ const we = ta(Ne, A), qe = we + Math.max(je - 1, 0);
6194
+ return Ex(Dc(we, qe, _e));
6194
6195
  }
6195
- const et = ku(ot, Be, Se);
6196
- let vt, it;
6197
- ie ? H === 0 && J === 0 && je > 0 ? (vt = 0, it = je - 1) : (vt = et * $o((H + fe) / (Ce + fe)), it = et * Oc((J + fe) / (Ce + fe)) - 1, it = Vs(A - 1, Ir(it, et - 1)), vt = Vs(it, Ir(0, vt))) : (vt = 0, it = -1);
6198
- const an = Dc(vt, it, _e), { bottom: V, top: ae } = Lc(Ae, ce, se, an), $e = Oc(A / et), qe = $e * Ce + ($e - 1) * fe - V;
6199
- return { bottom: V, itemHeight: Ce, items: an, itemWidth: Be, offsetBottom: qe, offsetTop: ae, top: ae };
6196
+ const et = ku(st, Be, Ce);
6197
+ let xt, at;
6198
+ ie ? H === 0 && J === 0 && je > 0 ? (xt = 0, at = je - 1) : (xt = et * $o((H + fe) / (Te + fe)), at = et * Oc((J + fe) / (Te + fe)) - 1, at = Vs(A - 1, Ir(at, et - 1)), xt = Vs(at, Ir(0, xt))) : (xt = 0, at = -1);
6199
+ const an = Dc(xt, at, _e), { bottom: V, top: ae } = Lc(Ae, ce, se, an), $e = Oc(A / et), rt = $e * Te + ($e - 1) * fe - V;
6200
+ return { bottom: V, itemHeight: Te, items: an, itemWidth: Be, offsetBottom: rt, offsetTop: ae, top: ae };
6200
6201
  }
6201
6202
  )
6202
6203
  ),
@@ -6216,7 +6217,7 @@ const Ix = /* @__PURE__ */ Me(
6216
6217
  const { bottom: se, top: Ae } = Lc(A, ce, H, J);
6217
6218
  return [Ae, se];
6218
6219
  }),
6219
- We(Mr)
6220
+ Ve(Mr)
6220
6221
  ),
6221
6222
  t
6222
6223
  );
@@ -6224,7 +6225,7 @@ const Ix = /* @__PURE__ */ Me(
6224
6225
  de(
6225
6226
  $(
6226
6227
  u,
6227
- Te(L),
6228
+ Re(L),
6228
6229
  re(([A, H]) => H || A !== 0)
6229
6230
  ),
6230
6231
  L
@@ -6233,49 +6234,49 @@ const Ix = /* @__PURE__ */ Me(
6233
6234
  $(
6234
6235
  nt(N, C),
6235
6236
  ge(([{ items: A }]) => A.length > 0),
6236
- Te(L),
6237
+ Re(L),
6237
6238
  ge(([[A, H], J]) => {
6238
6239
  const ce = A.items[A.items.length - 1].index === H - 1;
6239
6240
  return (J || A.bottom > 0 && A.itemHeight > 0 && A.offsetBottom === 0 && A.items.length === H) && ce;
6240
6241
  }),
6241
6242
  re(([[, A]]) => A - 1),
6242
- We()
6243
+ Ve()
6243
6244
  )
6244
6245
  ), pe = Nt(
6245
6246
  $(
6246
6247
  me(N),
6247
6248
  ge(({ items: A }) => A.length > 0 && A[0].index === 0),
6248
6249
  Jt(0),
6249
- We()
6250
+ Ve()
6250
6251
  )
6251
6252
  ), he = Nt(
6252
6253
  $(
6253
6254
  me(N),
6254
- Te(O),
6255
+ Re(O),
6255
6256
  ge(([{ items: A }, H]) => A.length > 0 && !H),
6256
6257
  re(([{ items: A }]) => ({
6257
6258
  endIndex: A[A.length - 1].index,
6258
6259
  startIndex: A[0].index
6259
6260
  })),
6260
- We(cu),
6261
- un(0)
6261
+ Ve(cu),
6262
+ ln(0)
6262
6263
  )
6263
6264
  );
6264
6265
  de(he, w.scrollSeekRangeChanged), de(
6265
6266
  $(
6266
6267
  P,
6267
- Te(I, j, C, Y),
6268
+ Re(I, j, C, Y),
6268
6269
  re(([A, H, J, ce, se]) => {
6269
6270
  const Ae = hu(A), { align: _e, behavior: je, offset: ie } = Ae;
6270
6271
  let Ne = Ae.index;
6271
6272
  Ne === "LAST" && (Ne = ce - 1), Ne = Ir(0, Ne, Vs(ce - 1, Ne));
6272
- let Se = Ci(H, se, J, Ne);
6273
- return _e === "end" ? Se = Mc(Se - H.height + J.height) : _e === "center" && (Se = Mc(Se - H.height / 2 + J.height / 2)), ie && (Se += ie), { behavior: je, top: Se };
6273
+ let Ce = Ci(H, se, J, Ne);
6274
+ return _e === "end" ? Ce = Mc(Ce - H.height + J.height) : _e === "center" && (Ce = Mc(Ce - H.height / 2 + J.height / 2)), ie && (Ce += ie), { behavior: je, top: Ce };
6274
6275
  })
6275
6276
  ),
6276
6277
  l
6277
6278
  );
6278
- const F = ft(
6279
+ const F = ht(
6279
6280
  $(
6280
6281
  N,
6281
6282
  re((A) => A.offsetBottom + A.bottom)
@@ -6330,7 +6331,7 @@ const Ix = /* @__PURE__ */ Me(
6330
6331
  ...S
6331
6332
  };
6332
6333
  },
6333
- Ve(na, mt, Jr, bu, Cn, ra, Sn)
6334
+ Ge(na, gt, Jr, bu, Cn, ra, Sn)
6334
6335
  );
6335
6336
  function ku(e, t, n) {
6336
6337
  return Ir(1, $o((e + n) / ($o(t) + n)));
@@ -6347,11 +6348,11 @@ function Ci(e, t, n, r) {
6347
6348
  return i > 0 ? i + t.row : i;
6348
6349
  }
6349
6350
  const jx = /* @__PURE__ */ Me(() => {
6350
- const e = X((h) => `Item ${h}`), t = X({}), n = X(null), r = X("virtuoso-grid-item"), o = X("virtuoso-grid-list"), s = X(sa), i = X("div"), a = X(pr), l = (h, m = null) => ft(
6351
+ const e = X((h) => `Item ${h}`), t = X({}), n = X(null), r = X("virtuoso-grid-item"), o = X("virtuoso-grid-list"), s = X(sa), i = X("div"), a = X(pr), l = (h, m = null) => ht(
6351
6352
  $(
6352
6353
  t,
6353
6354
  re((w) => w[h]),
6354
- We()
6355
+ Ve()
6355
6356
  ),
6356
6357
  m
6357
6358
  ), u = X(!1), d = X(!1);
@@ -6375,9 +6376,9 @@ const jx = /* @__PURE__ */ Me(() => {
6375
6376
  };
6376
6377
  }), kx = /* @__PURE__ */ Me(
6377
6378
  ([e, t]) => ({ ...e, ...t }),
6378
- Ve(Ix, jx)
6379
+ Ge(Ix, jx)
6379
6380
  ), Ax = /* @__PURE__ */ q.memo(function() {
6380
- const e = Ge("gridState"), t = Ge("listClassName"), n = Ge("itemClassName"), r = Ge("itemContent"), o = Ge("computeItemKey"), s = Ge("isSeeking"), i = Ot("scrollHeight"), a = Ge("ItemComponent"), l = Ge("ListComponent"), u = Ge("ScrollSeekPlaceholder"), d = Ge("context"), h = Ot("itemDimensions"), m = Ot("gap"), w = Ge("log"), x = Ge("stateRestoreInProgress"), v = Ot("reportReadyState"), p = Hn(
6381
+ const e = Ke("gridState"), t = Ke("listClassName"), n = Ke("itemClassName"), r = Ke("itemContent"), o = Ke("computeItemKey"), s = Ke("isSeeking"), i = Ot("scrollHeight"), a = Ke("ItemComponent"), l = Ke("ListComponent"), u = Ke("ScrollSeekPlaceholder"), d = Ke("context"), h = Ot("itemDimensions"), m = Ot("gap"), w = Ke("log"), x = Ke("stateRestoreInProgress"), v = Ot("reportReadyState"), p = Hn(
6381
6382
  q.useMemo(
6382
6383
  () => (g) => {
6383
6384
  const b = g.parentElement.parentElement.scrollHeight;
@@ -6404,7 +6405,7 @@ const jx = /* @__PURE__ */ Me(() => {
6404
6405
  {
6405
6406
  className: t,
6406
6407
  ref: p,
6407
- ...dt(l, d),
6408
+ ...ft(l, d),
6408
6409
  "data-testid": "virtuoso-item-list",
6409
6410
  style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
6410
6411
  children: e.items.map((g) => {
@@ -6412,7 +6413,7 @@ const jx = /* @__PURE__ */ Me(() => {
6412
6413
  return s ? /* @__PURE__ */ c.jsx(
6413
6414
  u,
6414
6415
  {
6415
- ...dt(u, d),
6416
+ ...ft(u, d),
6416
6417
  height: e.itemHeight,
6417
6418
  index: g.index,
6418
6419
  width: e.itemWidth
@@ -6421,7 +6422,7 @@ const jx = /* @__PURE__ */ Me(() => {
6421
6422
  ) : /* @__PURE__ */ go(
6422
6423
  a,
6423
6424
  {
6424
- ...dt(a, d),
6425
+ ...ft(a, d),
6425
6426
  className: n,
6426
6427
  "data-index": g.index,
6427
6428
  key: b
@@ -6432,7 +6433,7 @@ const jx = /* @__PURE__ */ Me(() => {
6432
6433
  }
6433
6434
  );
6434
6435
  }), Px = q.memo(function() {
6435
- const e = Ge("HeaderComponent"), t = Ot("headerHeight"), n = Ge("headerFooterTag"), r = Hn(
6436
+ const e = Ke("HeaderComponent"), t = Ot("headerHeight"), n = Ke("headerFooterTag"), r = Hn(
6436
6437
  q.useMemo(
6437
6438
  () => (s) => {
6438
6439
  t(vn(s, "height"));
@@ -6441,10 +6442,10 @@ const jx = /* @__PURE__ */ Me(() => {
6441
6442
  ),
6442
6443
  !0,
6443
6444
  !1
6444
- ), o = Ge("context");
6445
- return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...dt(e, o) }) }) : null;
6445
+ ), o = Ke("context");
6446
+ return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...ft(e, o) }) }) : null;
6446
6447
  }), _x = q.memo(function() {
6447
- const e = Ge("FooterComponent"), t = Ot("footerHeight"), n = Ge("headerFooterTag"), r = Hn(
6448
+ const e = Ke("FooterComponent"), t = Ot("footerHeight"), n = Ke("headerFooterTag"), r = Hn(
6448
6449
  q.useMemo(
6449
6450
  () => (s) => {
6450
6451
  t(vn(s, "height"));
@@ -6453,8 +6454,8 @@ const jx = /* @__PURE__ */ Me(() => {
6453
6454
  ),
6454
6455
  !0,
6455
6456
  !1
6456
- ), o = Ge("context");
6457
- return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...dt(e, o) }) }) : null;
6457
+ ), o = Ke("context");
6458
+ return e ? /* @__PURE__ */ c.jsx(n, { ref: r, children: /* @__PURE__ */ c.jsx(e, { ...ft(e, o) }) }) : null;
6458
6459
  }), Ox = ({ children: e }) => {
6459
6460
  const t = q.useContext(Tu), n = Ot("itemDimensions"), r = Ot("viewportDimensions"), o = Hn(
6460
6461
  q.useMemo(
@@ -6470,20 +6471,20 @@ const jx = /* @__PURE__ */ Me(() => {
6470
6471
  t && (r({ height: t.viewportHeight, width: t.viewportWidth }), n({ height: t.itemHeight, width: t.itemWidth }));
6471
6472
  }, [t, r, n]), /* @__PURE__ */ c.jsx("div", { ref: o, style: cs(!1), children: e });
6472
6473
  }, Mx = ({ children: e }) => {
6473
- const t = q.useContext(Tu), n = Ot("windowViewportRect"), r = Ot("itemDimensions"), o = Ge("customScrollParent"), s = nu(n, o, !1);
6474
+ const t = q.useContext(Tu), n = Ot("windowViewportRect"), r = Ot("itemDimensions"), o = Ke("customScrollParent"), s = nu(n, o, !1);
6474
6475
  return q.useEffect(() => {
6475
6476
  t && (r({ height: t.itemHeight, width: t.itemWidth }), n({ offsetTop: 0, visibleHeight: t.viewportHeight, visibleWidth: t.viewportWidth }));
6476
6477
  }, [t, n, r]), /* @__PURE__ */ c.jsx("div", { ref: s, style: cs(!1), children: e });
6477
6478
  }, Dx = /* @__PURE__ */ q.memo(function({ ...e }) {
6478
- const t = Ge("useWindowScroll"), n = Ge("customScrollParent"), r = n || t ? Fx : Lx, o = n || t ? Mx : Ox, s = Ge("context");
6479
- return /* @__PURE__ */ c.jsx(r, { ...e, ...dt(r, s), children: /* @__PURE__ */ c.jsxs(o, { children: [
6479
+ const t = Ke("useWindowScroll"), n = Ke("customScrollParent"), r = n || t ? Fx : Lx, o = n || t ? Mx : Ox, s = Ke("context");
6480
+ return /* @__PURE__ */ c.jsx(r, { ...e, ...ft(r, s), children: /* @__PURE__ */ c.jsxs(o, { children: [
6480
6481
  /* @__PURE__ */ c.jsx(Px, {}),
6481
6482
  /* @__PURE__ */ c.jsx(Ax, {}),
6482
6483
  /* @__PURE__ */ c.jsx(_x, {})
6483
6484
  ] }) });
6484
6485
  }), {
6485
6486
  useEmitter: Au,
6486
- useEmitterValue: Ge,
6487
+ useEmitterValue: Ke,
6487
6488
  usePublisher: Ot
6488
6489
  } = /* @__PURE__ */ Su(
6489
6490
  kx,
@@ -6526,7 +6527,7 @@ const jx = /* @__PURE__ */ Me(() => {
6526
6527
  }
6527
6528
  },
6528
6529
  Dx
6529
- ), Lx = /* @__PURE__ */ Iu({ useEmitter: Au, useEmitterValue: Ge, usePublisher: Ot }), Fx = /* @__PURE__ */ ju({ useEmitter: Au, useEmitterValue: Ge, usePublisher: Ot });
6530
+ ), Lx = /* @__PURE__ */ Iu({ useEmitter: Au, useEmitterValue: Ke, usePublisher: Ot }), Fx = /* @__PURE__ */ ju({ useEmitter: Au, useEmitterValue: Ke, usePublisher: Ot });
6530
6531
  function Fc(e, t, n) {
6531
6532
  return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, St.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
6532
6533
  }
@@ -6619,8 +6620,8 @@ function Hx(...e) {
6619
6620
  };
6620
6621
  return n.scopeName = t.scopeName, n;
6621
6622
  }
6622
- var st = globalThis != null && globalThis.document ? f.useLayoutEffect : () => {
6623
- }, zx = f[" useInsertionEffect ".trim().toString()] || st;
6623
+ var it = globalThis != null && globalThis.document ? f.useLayoutEffect : () => {
6624
+ }, zx = f[" useInsertionEffect ".trim().toString()] || it;
6624
6625
  function xn({
6625
6626
  prop: e,
6626
6627
  defaultProp: t,
@@ -6746,13 +6747,13 @@ function Kx(e) {
6746
6747
  return f.useEffect(() => {
6747
6748
  const u = co(r.current);
6748
6749
  s.current = a === "mounted" ? u : "none";
6749
- }, [a]), st(() => {
6750
+ }, [a]), it(() => {
6750
6751
  const u = r.current, d = o.current;
6751
6752
  if (d !== e) {
6752
6753
  const m = s.current, w = co(u);
6753
6754
  e ? l("MOUNT") : w === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(d && m !== w ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
6754
6755
  }
6755
- }, [e, l]), st(() => {
6756
+ }, [e, l]), it(() => {
6756
6757
  if (t) {
6757
6758
  let u;
6758
6759
  const d = t.ownerDocument.defaultView ?? window, h = (w) => {
@@ -6790,7 +6791,7 @@ var qx = f[" useId ".trim().toString()] || (() => {
6790
6791
  }), Xx = 0;
6791
6792
  function Ht(e) {
6792
6793
  const [t, n] = f.useState(qx());
6793
- return st(() => {
6794
+ return it(() => {
6794
6795
  n((r) => r ?? String(Xx++));
6795
6796
  }, [e]), e || (t ? `radix-${t}` : "");
6796
6797
  }
@@ -6863,7 +6864,7 @@ var eb = f.forwardRef((e, t) => {
6863
6864
  return f.useEffect(() => {
6864
6865
  const b = requestAnimationFrame(() => p.current = !1);
6865
6866
  return () => cancelAnimationFrame(b);
6866
- }, []), st(() => {
6867
+ }, []), it(() => {
6867
6868
  const b = u.current;
6868
6869
  if (b) {
6869
6870
  g.current = g.current || {
@@ -7037,8 +7038,8 @@ function lb(e, t = !1) {
7037
7038
  return `${e.length}:${n}:${r}`;
7038
7039
  }
7039
7040
  function ub(e, t) {
7040
- const [n, r] = ue(e), o = Ke(e), s = Ke(null);
7041
- return Ze(() => {
7041
+ const [n, r] = ue(e), o = We(e), s = We(null);
7042
+ return Xe(() => {
7042
7043
  if (!t) {
7043
7044
  r(e);
7044
7045
  return;
@@ -7065,8 +7066,8 @@ function Ks({
7065
7066
  const a = ub(e, r), l = lb(a, r), [u, d] = ue(() => {
7066
7067
  var x;
7067
7068
  return ((x = Sr.get(l)) == null ? void 0 : x.html) ?? null;
7068
- }), h = Ke(null), m = Ke([]);
7069
- Ze(() => {
7069
+ }), h = We(null), m = We([]);
7070
+ Xe(() => {
7070
7071
  m.current = [];
7071
7072
  const x = Sr.get(l);
7072
7073
  if (x && x.source === a) {
@@ -7304,7 +7305,7 @@ function ha() {
7304
7305
  dismiss: (n) => Ar({ type: "DISMISS_TOAST", toastId: n })
7305
7306
  };
7306
7307
  }
7307
- function ct(e) {
7308
+ function lt(e) {
7308
7309
  const t = f.useRef(e);
7309
7310
  return f.useEffect(() => {
7310
7311
  t.current = e;
@@ -7314,7 +7315,7 @@ function ct(e) {
7314
7315
  }, []);
7315
7316
  }
7316
7317
  function vb(e, t = globalThis == null ? void 0 : globalThis.document) {
7317
- const n = ct(e);
7318
+ const n = lt(e);
7318
7319
  f.useEffect(() => {
7319
7320
  const r = (o) => {
7320
7321
  o.key === "Escape" && n(o);
@@ -7387,7 +7388,7 @@ var yb = "DismissableLayerBranch", Sb = f.forwardRef((e, t) => {
7387
7388
  });
7388
7389
  Sb.displayName = yb;
7389
7390
  function Cb(e, t = globalThis == null ? void 0 : globalThis.document) {
7390
- const n = ct(e), r = f.useRef(!1), o = f.useRef(() => {
7391
+ const n = lt(e), r = f.useRef(!1), o = f.useRef(() => {
7391
7392
  });
7392
7393
  return f.useEffect(() => {
7393
7394
  const s = (a) => {
@@ -7417,7 +7418,7 @@ function Cb(e, t = globalThis == null ? void 0 : globalThis.document) {
7417
7418
  };
7418
7419
  }
7419
7420
  function Tb(e, t = globalThis == null ? void 0 : globalThis.document) {
7420
- const n = ct(e), r = f.useRef(!1);
7421
+ const n = lt(e), r = f.useRef(!1);
7421
7422
  return f.useEffect(() => {
7422
7423
  const o = (s) => {
7423
7424
  s.target && !r.current && Hu(wb, n, { originalEvent: s }, {
@@ -7445,7 +7446,7 @@ var Xs = "focusScope.autoFocusOnMount", Js = "focusScope.autoFocusOnUnmount", Yc
7445
7446
  onMountAutoFocus: o,
7446
7447
  onUnmountAutoFocus: s,
7447
7448
  ...i
7448
- } = e, [a, l] = f.useState(null), u = ct(o), d = ct(s), h = f.useRef(null), m = Ee(t, (v) => l(v)), w = f.useRef({
7449
+ } = e, [a, l] = f.useState(null), u = lt(o), d = lt(s), h = f.useRef(null), m = Ee(t, (v) => l(v)), w = f.useRef({
7449
7450
  paused: !1,
7450
7451
  pause() {
7451
7452
  this.paused = !0;
@@ -7459,15 +7460,15 @@ var Xs = "focusScope.autoFocusOnMount", Js = "focusScope.autoFocusOnUnmount", Yc
7459
7460
  let v = function(y) {
7460
7461
  if (w.paused || !a) return;
7461
7462
  const R = y.target;
7462
- a.contains(R) ? h.current = R : pn(h.current, { select: !0 });
7463
+ a.contains(R) ? h.current = R : hn(h.current, { select: !0 });
7463
7464
  }, p = function(y) {
7464
7465
  if (w.paused || !a) return;
7465
7466
  const R = y.relatedTarget;
7466
- R !== null && (a.contains(R) || pn(h.current, { select: !0 }));
7467
+ R !== null && (a.contains(R) || hn(h.current, { select: !0 }));
7467
7468
  }, g = function(y) {
7468
7469
  if (document.activeElement === document.body)
7469
7470
  for (const S of y)
7470
- S.removedNodes.length > 0 && pn(a);
7471
+ S.removedNodes.length > 0 && hn(a);
7471
7472
  };
7472
7473
  document.addEventListener("focusin", v), document.addEventListener("focusout", p);
7473
7474
  const b = new MutationObserver(g);
@@ -7481,12 +7482,12 @@ var Xs = "focusScope.autoFocusOnMount", Js = "focusScope.autoFocusOnUnmount", Yc
7481
7482
  const v = document.activeElement;
7482
7483
  if (!a.contains(v)) {
7483
7484
  const g = new CustomEvent(Xs, Yc);
7484
- a.addEventListener(Xs, u), a.dispatchEvent(g), g.defaultPrevented || (Eb(Ab(zu(a)), { select: !0 }), document.activeElement === v && pn(a));
7485
+ a.addEventListener(Xs, u), a.dispatchEvent(g), g.defaultPrevented || (Eb(Ab(zu(a)), { select: !0 }), document.activeElement === v && hn(a));
7485
7486
  }
7486
7487
  return () => {
7487
7488
  a.removeEventListener(Xs, u), setTimeout(() => {
7488
7489
  const g = new CustomEvent(Js, Yc);
7489
- a.addEventListener(Js, d), a.dispatchEvent(g), g.defaultPrevented || pn(v ?? document.body, { select: !0 }), a.removeEventListener(Js, d), Xc.remove(w);
7490
+ a.addEventListener(Js, d), a.dispatchEvent(g), g.defaultPrevented || hn(v ?? document.body, { select: !0 }), a.removeEventListener(Js, d), Xc.remove(w);
7490
7491
  }, 0);
7491
7492
  };
7492
7493
  }
@@ -7497,7 +7498,7 @@ var Xs = "focusScope.autoFocusOnMount", Js = "focusScope.autoFocusOnUnmount", Yc
7497
7498
  const p = v.key === "Tab" && !v.altKey && !v.ctrlKey && !v.metaKey, g = document.activeElement;
7498
7499
  if (p && g) {
7499
7500
  const b = v.currentTarget, [y, R] = Nb(b);
7500
- y && R ? !v.shiftKey && g === R ? (v.preventDefault(), n && pn(y, { select: !0 })) : v.shiftKey && g === y && (v.preventDefault(), n && pn(R, { select: !0 })) : g === b && v.preventDefault();
7501
+ y && R ? !v.shiftKey && g === R ? (v.preventDefault(), n && hn(y, { select: !0 })) : v.shiftKey && g === y && (v.preventDefault(), n && hn(R, { select: !0 })) : g === b && v.preventDefault();
7501
7502
  }
7502
7503
  },
7503
7504
  [n, r, w.paused]
@@ -7508,7 +7509,7 @@ us.displayName = Rb;
7508
7509
  function Eb(e, { select: t = !1 } = {}) {
7509
7510
  const n = document.activeElement;
7510
7511
  for (const r of e)
7511
- if (pn(r, { select: t }), document.activeElement !== n) return;
7512
+ if (hn(r, { select: t }), document.activeElement !== n) return;
7512
7513
  }
7513
7514
  function Nb(e) {
7514
7515
  const t = zu(e), n = qc(t, e), r = qc(t.reverse(), e);
@@ -7540,7 +7541,7 @@ function Ib(e, { upTo: t }) {
7540
7541
  function jb(e) {
7541
7542
  return e instanceof HTMLInputElement && "select" in e;
7542
7543
  }
7543
- function pn(e, { select: t = !1 } = {}) {
7544
+ function hn(e, { select: t = !1 } = {}) {
7544
7545
  if (e && e.focus) {
7545
7546
  const n = document.activeElement;
7546
7547
  e.focus({ preventScroll: !0 }), e !== n && jb(e) && t && e.select();
@@ -7570,7 +7571,7 @@ function Ab(e) {
7570
7571
  var Pb = "Portal", ds = f.forwardRef((e, t) => {
7571
7572
  var a;
7572
7573
  const { container: n, ...r } = e, [o, s] = f.useState(!1);
7573
- st(() => s(!0), []);
7574
+ it(() => s(!0), []);
7574
7575
  const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
7575
7576
  return i ? El.createPortal(/* @__PURE__ */ c.jsx(ve.div, { ...r, ref: t }), i) : null;
7576
7577
  });
@@ -8423,7 +8424,7 @@ const kw = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
8423
8424
  kw.displayName = vs.displayName;
8424
8425
  function Aw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8425
8426
  const [s, i] = ue(!1), [a, l] = ue(null), [u, d] = ue(null), { toast: h } = ha();
8426
- Ze(() => {
8427
+ Xe(() => {
8427
8428
  e && n && m();
8428
8429
  }, [e, n]);
8429
8430
  const m = async () => {
@@ -8532,7 +8533,7 @@ function Aw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8532
8533
  const No = "prose prose-sm max-w-none break-words dark:prose-invert prose-headings:break-words prose-p:break-words prose-li:break-words prose-td:break-words prose-th:break-words prose-a:break-all prose-code:break-words prose-blockquote:break-words";
8533
8534
  function Pw({ className: e }) {
8534
8535
  const [t, n] = ue(0);
8535
- return Ze(() => {
8536
+ return Xe(() => {
8536
8537
  const r = setInterval(() => n((o) => (o + 1) % 4), 500);
8537
8538
  return () => clearInterval(r);
8538
8539
  }, []), /* @__PURE__ */ c.jsxs(
@@ -8583,7 +8584,7 @@ const _w = q.memo(function({
8583
8584
  default:
8584
8585
  return "text-[hsl(var(--chat-bubble-ai-text))]";
8585
8586
  }
8586
- }, [D]), ee = ln(() => Ow(t.content), [t.content]), L = ln(() => Bw(t.content), [t.content]), Z = ln(() => t.content.filter((ie) => ie.type === "image_url"), [t.content]), pe = ln(() => t.content.filter((ie) => ie.type === "file"), [t.content]), he = Hw(ee, r);
8587
+ }, [D]), ee = mn(() => Ow(t.content), [t.content]), L = mn(() => Bw(t.content), [t.content]), Z = mn(() => t.content.filter((ie) => ie.type === "image_url"), [t.content]), pe = mn(() => t.content.filter((ie) => ie.type === "file"), [t.content]), he = Hw(ee, r);
8587
8588
  q.useEffect(() => {
8588
8589
  r && ee !== he && console.log("[MessageComponent] Streaming update:", {
8589
8590
  messageId: t.id,
@@ -8675,12 +8676,12 @@ const _w = q.memo(function({
8675
8676
  /* @__PURE__ */ c.jsx("span", { className: "text-sm text-muted-foreground", children: "File upload" })
8676
8677
  ] });
8677
8678
  if (t.model === "reflection") {
8678
- const fe = ee.trim(), Ce = ri(fe);
8679
- if (Ce && typeof Ce == "object")
8680
- return /* @__PURE__ */ c.jsx(zw, { data: Ce });
8679
+ const fe = ee.trim(), Te = ri(fe);
8680
+ if (Te && typeof Te == "object")
8681
+ return /* @__PURE__ */ c.jsx(zw, { data: Te });
8681
8682
  }
8682
8683
  if (K && L.name === "get_issues") {
8683
- const fe = t.content.find((ot) => ot.type === "tool_result"), Ce = (fe == null ? void 0 : fe.output) ?? Zn(t.content), Be = yd(Ce);
8684
+ const fe = t.content.find((st) => st.type === "tool_result"), Te = (fe == null ? void 0 : fe.output) ?? Zn(t.content), Be = yd(Te);
8684
8685
  if (Be) return /* @__PURE__ */ c.jsx(Uw, { issues: Be });
8685
8686
  }
8686
8687
  if (K && !E) {
@@ -8691,10 +8692,10 @@ const _w = q.memo(function({
8691
8692
  ] }) });
8692
8693
  }
8693
8694
  if (K && d) {
8694
- const fe = Zn(t.content), Ce = fe.length > h;
8695
+ const fe = Zn(t.content), Te = fe.length > h;
8695
8696
  return /* @__PURE__ */ c.jsx($c, { open: S, onOpenChange: C, children: /* @__PURE__ */ c.jsxs("div", { className: "font-mono text-sm text-current", children: [
8696
- /* @__PURE__ */ c.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Ce && !S ? fe.substring(0, h) + "..." : fe }),
8697
- Ce && /* @__PURE__ */ c.jsx(Hc, { asChild: !0, children: /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: S ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
8697
+ /* @__PURE__ */ c.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Te && !S ? fe.substring(0, h) + "..." : fe }),
8698
+ Te && /* @__PURE__ */ c.jsx(Hc, { asChild: !0, children: /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: S ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
8698
8699
  /* @__PURE__ */ c.jsx(Cr, { className: "h-3 w-3 mr-1" }),
8699
8700
  "Show less"
8700
8701
  ] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -8709,10 +8710,10 @@ const _w = q.memo(function({
8709
8710
  const fe = Ww(t.content);
8710
8711
  if (fe && Mw(fe))
8711
8712
  return /* @__PURE__ */ c.jsx(Ks, { content: fe.trim(), hideFallbackDuringStreaming: !0 });
8712
- const Ce = Zn(t.content);
8713
- return /* @__PURE__ */ c.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Ce }) });
8713
+ const Te = Zn(t.content);
8714
+ return /* @__PURE__ */ c.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Te }) });
8714
8715
  }
8715
- const Ne = Z.length > 0 && D !== "tool", Se = pe.length > 0 && D !== "tool" && !1;
8716
+ const Ne = Z.length > 0 && D !== "tool", Ce = pe.length > 0 && D !== "tool" && !1;
8716
8717
  return /* @__PURE__ */ c.jsxs("div", { children: [
8717
8718
  r ? (
8718
8719
  // Streaming container: reserve space and show a skeleton until we have text,
@@ -8732,7 +8733,7 @@ const _w = q.memo(function({
8732
8733
  const fe = ri(he);
8733
8734
  if (fe !== null)
8734
8735
  return /* @__PURE__ */ c.jsx(ol, { data: fe });
8735
- const Ce = Lw(Dw(he)), Be = he.trim().length === 0;
8736
+ const Te = Lw(Dw(he)), Be = he.trim().length === 0;
8736
8737
  return /* @__PURE__ */ c.jsx(c.Fragment, { children: Be ? /* @__PURE__ */ c.jsx("div", { className: "w-full", children: /* @__PURE__ */ c.jsxs("div", { className: "animate-pulse space-y-2", children: [
8737
8738
  /* @__PURE__ */ c.jsx("div", { className: "h-3 bg-slate-200 dark:bg-slate-700 rounded w-3/4" }),
8738
8739
  /* @__PURE__ */ c.jsx("div", { className: "h-3 bg-slate-200 dark:bg-slate-700 rounded w-5/6" }),
@@ -8744,7 +8745,7 @@ const _w = q.memo(function({
8744
8745
  "whitespace-pre-wrap break-words font-sans leading-relaxed transition-opacity duration-200",
8745
8746
  O && "text-xs"
8746
8747
  ),
8747
- children: Ce
8748
+ children: Te
8748
8749
  }
8749
8750
  ) });
8750
8751
  })(),
@@ -8756,11 +8757,11 @@ const _w = q.memo(function({
8756
8757
  const fe = ri(ee.trim());
8757
8758
  if (fe !== null) return /* @__PURE__ */ c.jsx(ol, { data: fe });
8758
8759
  if (D === "user" && m) {
8759
- const Ce = ee.trim();
8760
- if (Ce.length > w)
8760
+ const Te = ee.trim();
8761
+ if (Te.length > w)
8761
8762
  return /* @__PURE__ */ c.jsxs($c, { open: I, onOpenChange: j, children: [
8762
- /* @__PURE__ */ c.jsx("div", { className: M("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: I ? /* @__PURE__ */ c.jsx(Ks, { content: Ce, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ c.jsxs("pre", { className: M("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8763
- Ce.substring(0, w),
8763
+ /* @__PURE__ */ c.jsx("div", { className: M("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: I ? /* @__PURE__ */ c.jsx(Ks, { content: Te, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ c.jsxs("pre", { className: M("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8764
+ Te.substring(0, w),
8764
8765
  "..."
8765
8766
  ] }) }),
8766
8767
  /* @__PURE__ */ c.jsx(Hc, { asChild: !0, children: /* @__PURE__ */ c.jsx(
@@ -8775,7 +8776,7 @@ const _w = q.memo(function({
8775
8776
  ] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
8776
8777
  /* @__PURE__ */ c.jsx(Qn, { className: "h-3 w-3 mr-1" }),
8777
8778
  " Show more (",
8778
- Ce.length - w,
8779
+ Te.length - w,
8779
8780
  " chars)"
8780
8781
  ] })
8781
8782
  }
@@ -8793,14 +8794,14 @@ const _w = q.memo(function({
8793
8794
  }
8794
8795
  );
8795
8796
  })(),
8796
- Ne && /* @__PURE__ */ c.jsx("div", { className: "mt-2 grid grid-cols-2 gap-2", children: Z.map((fe, Ce) => {
8797
- const Be = fe, ot = typeof Be.width == "number" ? Be.width : void 0, et = typeof Be.height == "number" ? Be.height : void 0, vt = ot && et && et > 0 ? `${ot} / ${et}` : "4 / 3", it = ot && et && et > 0 ? Math.max(120, Math.round(et / ot * 140)) : 160;
8797
+ Ne && /* @__PURE__ */ c.jsx("div", { className: "mt-2 grid grid-cols-2 gap-2", children: Z.map((fe, Te) => {
8798
+ const Be = fe, st = typeof Be.width == "number" ? Be.width : void 0, et = typeof Be.height == "number" ? Be.height : void 0, xt = st && et && et > 0 ? `${st} / ${et}` : "4 / 3", at = st && et && et > 0 ? Math.max(120, Math.round(et / st * 140)) : 160;
8798
8799
  return /* @__PURE__ */ c.jsxs(
8799
8800
  "div",
8800
8801
  {
8801
8802
  className: "relative border rounded overflow-hidden bg-gray-100 dark:bg-gray-900/40",
8802
- style: { aspectRatio: vt, minHeight: it },
8803
- "data-placeholder-height": it,
8803
+ style: { aspectRatio: xt, minHeight: at },
8804
+ "data-placeholder-height": at,
8804
8805
  children: [
8805
8806
  /* @__PURE__ */ c.jsx(
8806
8807
  "img",
@@ -8817,12 +8818,12 @@ const _w = q.memo(function({
8817
8818
  ] })
8818
8819
  ]
8819
8820
  },
8820
- Ce
8821
+ Te
8821
8822
  );
8822
8823
  }) }),
8823
- Se
8824
+ Ce
8824
8825
  ] });
8825
- }, je = ln(() => $w(t), [t]);
8826
+ }, je = mn(() => $w(t), [t]);
8826
8827
  return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
8827
8828
  /* @__PURE__ */ c.jsx("div", { className: M(ce(), x.container), children: /* @__PURE__ */ c.jsxs("div", { className: M(se(), x.content), children: [
8828
8829
  (a || l || K) && /* @__PURE__ */ c.jsxs(
@@ -9119,8 +9120,8 @@ function $w(e) {
9119
9120
  return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
9120
9121
  }
9121
9122
  function Hw(e, t) {
9122
- const [n, r] = ue(e), o = Ke(e), s = Ke(null);
9123
- return Ze(() => {
9123
+ const [n, r] = ue(e), o = We(e), s = We(null);
9124
+ return Xe(() => {
9124
9125
  if (!t) {
9125
9126
  r(e);
9126
9127
  return;
@@ -9243,9 +9244,9 @@ const sl = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Sd = q.forwa
9243
9244
  onScrollAway: p,
9244
9245
  onAtBottom: g
9245
9246
  }, b) => {
9246
- const y = Ke(null), R = Ke(null), S = Ke(!1), [C, E] = ue(!0), N = Ue((P) => {
9247
+ const y = We(null), R = We(null), S = We(!1), [C, E] = ue(!0), N = Ue((P) => {
9247
9248
  E(P), p && p(!P), g && g(P);
9248
- }, [p, g]), I = ln(() => {
9249
+ }, [p, g]), I = mn(() => {
9249
9250
  if (a)
9250
9251
  return async () => {
9251
9252
  if (!S.current) {
@@ -9257,8 +9258,15 @@ const sl = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Sd = q.forwa
9257
9258
  }
9258
9259
  }
9259
9260
  };
9260
- }, [a]), j = ln(() => !x || v ? !1 : t && C ? "auto" : !1, [t, C, x, v]);
9261
- return e.length === 0 ? /* @__PURE__ */ c.jsx("div", { className: h, style: m, children: /* @__PURE__ */ c.jsx("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: w || "No messages yet. Start a conversation!" }) }) : /* @__PURE__ */ c.jsx("div", { className: h, style: m, children: /* @__PURE__ */ c.jsx(
9261
+ }, [a]), j = We(!1);
9262
+ return Xe(() => {
9263
+ if (!x || v) {
9264
+ j.current !== !1 && (j.current = !1);
9265
+ return;
9266
+ }
9267
+ const P = t && C ? "auto" : !1;
9268
+ j.current !== P && (j.current = P);
9269
+ }, [t, C, x, v]), e.length === 0 ? /* @__PURE__ */ c.jsx("div", { className: h, style: m, children: /* @__PURE__ */ c.jsx("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: w || "No messages yet. Start a conversation!" }) }) : /* @__PURE__ */ c.jsx("div", { className: h, style: m, children: /* @__PURE__ */ c.jsx(
9262
9270
  Cx,
9263
9271
  {
9264
9272
  ref: (P) => {
@@ -9268,12 +9276,10 @@ const sl = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Sd = q.forwa
9268
9276
  R.current = P instanceof HTMLDivElement ? P : null;
9269
9277
  },
9270
9278
  data: e,
9271
- followOutput: j,
9279
+ followOutput: j.current,
9272
9280
  overscan: 400,
9273
9281
  increaseViewportBy: { top: 200, bottom: 400 },
9274
9282
  defaultItemHeight: 120,
9275
- fixedItemHeight: void 0,
9276
- itemSize: () => 120,
9277
9283
  atBottomThreshold: 100,
9278
9284
  alignToBottom: !0,
9279
9285
  startReached: () => {
@@ -9418,10 +9424,10 @@ const qw = ["top", "right", "bottom", "left"], bn = Math.min, Rt = Math.max, Uo
9418
9424
  function Ni(e, t, n) {
9419
9425
  return Rt(e, bn(t, n));
9420
9426
  }
9421
- function dn(e, t) {
9427
+ function un(e, t) {
9422
9428
  return typeof e == "function" ? e(t) : e;
9423
9429
  }
9424
- function fn(e) {
9430
+ function dn(e) {
9425
9431
  return e.split("-")[0];
9426
9432
  }
9427
9433
  function mr(e) {
@@ -9435,7 +9441,7 @@ function ya(e) {
9435
9441
  }
9436
9442
  const Zw = /* @__PURE__ */ new Set(["top", "bottom"]);
9437
9443
  function en(e) {
9438
- return Zw.has(fn(e)) ? "y" : "x";
9444
+ return Zw.has(dn(e)) ? "y" : "x";
9439
9445
  }
9440
9446
  function Sa(e) {
9441
9447
  return wa(en(e));
@@ -9468,7 +9474,7 @@ function ry(e, t, n) {
9468
9474
  }
9469
9475
  function oy(e, t, n, r) {
9470
9476
  const o = mr(e);
9471
- let s = ry(fn(e), n === "start", r);
9477
+ let s = ry(dn(e), n === "start", r);
9472
9478
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Ii)))), s;
9473
9479
  }
9474
9480
  function Wo(e) {
@@ -9514,7 +9520,7 @@ function cl(e, t, n) {
9514
9520
  reference: r,
9515
9521
  floating: o
9516
9522
  } = e;
9517
- const s = en(t), i = Sa(t), a = ya(i), l = fn(t), u = s === "y", d = r.x + r.width / 2 - o.width / 2, h = r.y + r.height / 2 - o.height / 2, m = r[a] / 2 - o[a] / 2;
9523
+ const s = en(t), i = Sa(t), a = ya(i), l = dn(t), u = s === "y", d = r.x + r.width / 2 - o.width / 2, h = r.y + r.height / 2 - o.height / 2, m = r[a] / 2 - o[a] / 2;
9518
9524
  let w;
9519
9525
  switch (l) {
9520
9526
  case "top":
@@ -9634,7 +9640,7 @@ async function Fr(e, t) {
9634
9640
  elementContext: h = "floating",
9635
9641
  altBoundary: m = !1,
9636
9642
  padding: w = 0
9637
- } = dn(t, e), x = Cd(w), p = a[m ? h === "floating" ? "reference" : "floating" : h], g = Vo(await s.getClippingRect({
9643
+ } = un(t, e), x = Cd(w), p = a[m ? h === "floating" ? "reference" : "floating" : h], g = Vo(await s.getClippingRect({
9638
9644
  element: (n = await (s.isElement == null ? void 0 : s.isElement(p))) == null || n ? p : p.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
9639
9645
  boundary: u,
9640
9646
  rootBoundary: d,
@@ -9678,7 +9684,7 @@ const ay = (e) => ({
9678
9684
  } = t, {
9679
9685
  element: u,
9680
9686
  padding: d = 0
9681
- } = dn(e, t) || {};
9687
+ } = un(e, t) || {};
9682
9688
  if (u == null)
9683
9689
  return {};
9684
9690
  const h = Cd(d), m = {
@@ -9721,10 +9727,10 @@ const ay = (e) => ({
9721
9727
  fallbackAxisSideDirection: x = "none",
9722
9728
  flipAlignment: v = !0,
9723
9729
  ...p
9724
- } = dn(e, t);
9730
+ } = un(e, t);
9725
9731
  if ((n = s.arrow) != null && n.alignmentOffset)
9726
9732
  return {};
9727
- const g = fn(o), b = en(a), y = fn(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), S = m || (y || !v ? [Wo(a)] : ey(a)), C = x !== "none";
9733
+ const g = dn(o), b = en(a), y = dn(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), S = m || (y || !v ? [Wo(a)] : ey(a)), C = x !== "none";
9728
9734
  !m && C && S.push(...oy(a, v, x, R));
9729
9735
  const E = [a, ...S], N = await Fr(t, p), I = [];
9730
9736
  let j = ((r = s.flip) == null ? void 0 : r.overflows) || [];
@@ -9803,7 +9809,7 @@ const ly = function(e) {
9803
9809
  } = t, {
9804
9810
  strategy: r = "referenceHidden",
9805
9811
  ...o
9806
- } = dn(e, t);
9812
+ } = un(e, t);
9807
9813
  switch (r) {
9808
9814
  case "referenceHidden": {
9809
9815
  const s = await Fr(t, {
@@ -9840,7 +9846,7 @@ async function uy(e, t) {
9840
9846
  placement: n,
9841
9847
  platform: r,
9842
9848
  elements: o
9843
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = fn(n), a = mr(n), l = en(n) === "y", u = Td.has(i) ? -1 : 1, d = s && l ? -1 : 1, h = dn(t, e);
9849
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = dn(n), a = mr(n), l = en(n) === "y", u = Td.has(i) ? -1 : 1, d = s && l ? -1 : 1, h = un(t, e);
9844
9850
  let {
9845
9851
  mainAxis: m,
9846
9852
  crossAxis: w,
@@ -9909,10 +9915,10 @@ const dy = function(e) {
9909
9915
  }
9910
9916
  },
9911
9917
  ...l
9912
- } = dn(e, t), u = {
9918
+ } = un(e, t), u = {
9913
9919
  x: n,
9914
9920
  y: r
9915
- }, d = await Fr(t, l), h = en(fn(o)), m = wa(h);
9921
+ }, d = await Fr(t, l), h = en(dn(o)), m = wa(h);
9916
9922
  let w = u[m], x = u[h];
9917
9923
  if (s) {
9918
9924
  const p = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", b = w + d[p], y = w - d[g];
@@ -9954,12 +9960,12 @@ const dy = function(e) {
9954
9960
  offset: a = 0,
9955
9961
  mainAxis: l = !0,
9956
9962
  crossAxis: u = !0
9957
- } = dn(e, t), d = {
9963
+ } = un(e, t), d = {
9958
9964
  x: n,
9959
9965
  y: r
9960
9966
  }, h = en(o), m = wa(h);
9961
9967
  let w = d[m], x = d[h];
9962
- const v = dn(a, t), p = typeof v == "number" ? {
9968
+ const v = un(a, t), p = typeof v == "number" ? {
9963
9969
  mainAxis: v,
9964
9970
  crossAxis: 0
9965
9971
  } : {
@@ -9973,7 +9979,7 @@ const dy = function(e) {
9973
9979
  }
9974
9980
  if (u) {
9975
9981
  var g, b;
9976
- const y = m === "y" ? "width" : "height", R = Td.has(fn(o)), S = s.reference[h] - s.floating[y] + (R && ((g = i.offset) == null ? void 0 : g[h]) || 0) + (R ? 0 : p.crossAxis), C = s.reference[h] + s.reference[y] + (R ? 0 : ((b = i.offset) == null ? void 0 : b[h]) || 0) - (R ? p.crossAxis : 0);
9982
+ const y = m === "y" ? "width" : "height", R = Td.has(dn(o)), S = s.reference[h] - s.floating[y] + (R && ((g = i.offset) == null ? void 0 : g[h]) || 0) + (R ? 0 : p.crossAxis), C = s.reference[h] + s.reference[y] + (R ? 0 : ((b = i.offset) == null ? void 0 : b[h]) || 0) - (R ? p.crossAxis : 0);
9977
9983
  x < S ? x = S : x > C && (x = C);
9978
9984
  }
9979
9985
  return {
@@ -9997,7 +10003,7 @@ const dy = function(e) {
9997
10003
  apply: l = () => {
9998
10004
  },
9999
10005
  ...u
10000
- } = dn(e, t), d = await Fr(t, u), h = fn(o), m = mr(o), w = en(o) === "y", {
10006
+ } = un(e, t), d = await Fr(t, u), h = dn(o), m = mr(o), w = en(o) === "y", {
10001
10007
  width: x,
10002
10008
  height: v
10003
10009
  } = s.floating;
@@ -10730,7 +10736,7 @@ Od.displayName = s0;
10730
10736
  var i0 = Od;
10731
10737
  function Md(e) {
10732
10738
  const [t, n] = f.useState(void 0);
10733
- return st(() => {
10739
+ return it(() => {
10734
10740
  if (e) {
10735
10741
  n({ width: e.offsetWidth, height: e.offsetHeight });
10736
10742
  const r = new ResizeObserver((o) => {
@@ -10810,20 +10816,20 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10810
10816
  n0({
10811
10817
  ...G,
10812
10818
  apply: ({ elements: Ae, rects: _e, availableWidth: je, availableHeight: ie }) => {
10813
- const { width: Ne, height: Se } = _e.reference, fe = Ae.floating.style;
10814
- fe.setProperty("--radix-popper-available-width", `${je}px`), fe.setProperty("--radix-popper-available-height", `${ie}px`), fe.setProperty("--radix-popper-anchor-width", `${Ne}px`), fe.setProperty("--radix-popper-anchor-height", `${Se}px`);
10819
+ const { width: Ne, height: Ce } = _e.reference, fe = Ae.floating.style;
10820
+ fe.setProperty("--radix-popper-available-width", `${je}px`), fe.setProperty("--radix-popper-available-height", `${ie}px`), fe.setProperty("--radix-popper-anchor-width", `${Ne}px`), fe.setProperty("--radix-popper-anchor-height", `${Ce}px`);
10815
10821
  }
10816
10822
  }),
10817
10823
  R && o0({ element: R, padding: a }),
10818
10824
  f0({ arrowWidth: E, arrowHeight: N }),
10819
10825
  m && r0({ strategy: "referenceHidden", ...G })
10820
10826
  ]
10821
- }), [D, K] = Wd(U), W = ct(x);
10822
- st(() => {
10827
+ }), [D, K] = Wd(U), W = lt(x);
10828
+ it(() => {
10823
10829
  oe && (W == null || W());
10824
10830
  }, [oe, W]);
10825
10831
  const ee = (F = O.arrow) == null ? void 0 : F.x, L = (A = O.arrow) == null ? void 0 : A.y, Z = ((H = O.arrow) == null ? void 0 : H.centerOffset) !== 0, [pe, he] = f.useState();
10826
- return st(() => {
10832
+ return it(() => {
10827
10833
  g && he(window.getComputedStyle(g).zIndex);
10828
10834
  }, [g]), /* @__PURE__ */ c.jsx(
10829
10835
  "div",
@@ -10972,7 +10978,7 @@ var x0 = f.forwardRef((e, t) => {
10972
10978
  defaultProp: a ?? null,
10973
10979
  onChange: l,
10974
10980
  caller: eo
10975
- }), [g, b] = f.useState(!1), y = ct(u), R = Vd(n), S = f.useRef(!1), [C, E] = f.useState(0);
10981
+ }), [g, b] = f.useState(!1), y = lt(u), R = Vd(n), S = f.useRef(!1), [C, E] = f.useState(0);
10976
10982
  return f.useEffect(() => {
10977
10983
  const N = m.current;
10978
10984
  if (N)
@@ -11123,7 +11129,7 @@ var C0 = Kd, T0 = qd, Ai = ["Enter", " "], R0 = ["ArrowDown", "PageUp", "Home"],
11123
11129
  vr,
11124
11130
  Gd
11125
11131
  ]), Ss = vr(), Qd = Gd(), [A0, Wn] = Un(to), [P0, no] = Un(to), ef = (e) => {
11126
- const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ss(t), [l, u] = f.useState(null), d = f.useRef(!1), h = ct(s), m = xs(o);
11132
+ const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = Ss(t), [l, u] = f.useState(null), d = f.useRef(!1), h = lt(s), m = xs(o);
11127
11133
  return f.useEffect(() => {
11128
11134
  const w = () => {
11129
11135
  d.current = !0, document.addEventListener("pointerdown", x, { capture: !0, once: !0 }), document.addEventListener("pointermove", x, { capture: !0, once: !0 });
@@ -11459,7 +11465,7 @@ var cf = "MenuRadioGroup", [z0, U0] = Un(
11459
11465
  } }
11460
11466
  ), lf = f.forwardRef(
11461
11467
  (e, t) => {
11462
- const { value: n, onValueChange: r, ...o } = e, s = ct(r);
11468
+ const { value: n, onValueChange: r, ...o } = e, s = lt(r);
11463
11469
  return /* @__PURE__ */ c.jsx(z0, { scope: e.__scopeMenu, value: n, onValueChange: s, children: /* @__PURE__ */ c.jsx(La, { ...o, ref: t }) });
11464
11470
  }
11465
11471
  );
@@ -11686,7 +11692,7 @@ function Hr(e) {
11686
11692
  var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS = lf, cS = df, lS = hf, uS = pf, dS = mf, fS = vf, hS = bf, Ts = "DropdownMenu", [pS, gR] = Gt(
11687
11693
  Ts,
11688
11694
  [Zd]
11689
- ), gt = Zd(), [mS, yf] = pS(Ts), Sf = (e) => {
11695
+ ), vt = Zd(), [mS, yf] = pS(Ts), Sf = (e) => {
11690
11696
  const {
11691
11697
  __scopeDropdownMenu: t,
11692
11698
  children: n,
@@ -11695,7 +11701,7 @@ var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS =
11695
11701
  defaultOpen: s,
11696
11702
  onOpenChange: i,
11697
11703
  modal: a = !0
11698
- } = e, l = gt(t), u = f.useRef(null), [d, h] = xn({
11704
+ } = e, l = vt(t), u = f.useRef(null), [d, h] = xn({
11699
11705
  prop: o,
11700
11706
  defaultProp: s ?? !1,
11701
11707
  onChange: i,
@@ -11719,7 +11725,7 @@ var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS =
11719
11725
  Sf.displayName = Ts;
11720
11726
  var Cf = "DropdownMenuTrigger", Tf = f.forwardRef(
11721
11727
  (e, t) => {
11722
- const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = yf(Cf, n), i = gt(n);
11728
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = yf(Cf, n), i = vt(n);
11723
11729
  return /* @__PURE__ */ c.jsx(eS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
11724
11730
  ve.button,
11725
11731
  {
@@ -11745,13 +11751,13 @@ var Cf = "DropdownMenuTrigger", Tf = f.forwardRef(
11745
11751
  );
11746
11752
  Tf.displayName = Cf;
11747
11753
  var gS = "DropdownMenuPortal", Rf = (e) => {
11748
- const { __scopeDropdownMenu: t, ...n } = e, r = gt(t);
11754
+ const { __scopeDropdownMenu: t, ...n } = e, r = vt(t);
11749
11755
  return /* @__PURE__ */ c.jsx(tS, { ...r, ...n });
11750
11756
  };
11751
11757
  Rf.displayName = gS;
11752
11758
  var Ef = "DropdownMenuContent", Nf = f.forwardRef(
11753
11759
  (e, t) => {
11754
- const { __scopeDropdownMenu: n, ...r } = e, o = yf(Ef, n), s = gt(n), i = f.useRef(!1);
11760
+ const { __scopeDropdownMenu: n, ...r } = e, o = yf(Ef, n), s = vt(n), i = f.useRef(!1);
11755
11761
  return /* @__PURE__ */ c.jsx(
11756
11762
  nS,
11757
11763
  {
@@ -11783,64 +11789,64 @@ var Ef = "DropdownMenuContent", Nf = f.forwardRef(
11783
11789
  Nf.displayName = Ef;
11784
11790
  var vS = "DropdownMenuGroup", xS = f.forwardRef(
11785
11791
  (e, t) => {
11786
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11792
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11787
11793
  return /* @__PURE__ */ c.jsx(rS, { ...o, ...r, ref: t });
11788
11794
  }
11789
11795
  );
11790
11796
  xS.displayName = vS;
11791
11797
  var bS = "DropdownMenuLabel", If = f.forwardRef(
11792
11798
  (e, t) => {
11793
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11799
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11794
11800
  return /* @__PURE__ */ c.jsx(oS, { ...o, ...r, ref: t });
11795
11801
  }
11796
11802
  );
11797
11803
  If.displayName = bS;
11798
11804
  var wS = "DropdownMenuItem", jf = f.forwardRef(
11799
11805
  (e, t) => {
11800
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11806
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11801
11807
  return /* @__PURE__ */ c.jsx(sS, { ...o, ...r, ref: t });
11802
11808
  }
11803
11809
  );
11804
11810
  jf.displayName = wS;
11805
11811
  var yS = "DropdownMenuCheckboxItem", kf = f.forwardRef((e, t) => {
11806
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11812
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11807
11813
  return /* @__PURE__ */ c.jsx(iS, { ...o, ...r, ref: t });
11808
11814
  });
11809
11815
  kf.displayName = yS;
11810
11816
  var SS = "DropdownMenuRadioGroup", CS = f.forwardRef((e, t) => {
11811
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11817
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11812
11818
  return /* @__PURE__ */ c.jsx(aS, { ...o, ...r, ref: t });
11813
11819
  });
11814
11820
  CS.displayName = SS;
11815
11821
  var TS = "DropdownMenuRadioItem", Af = f.forwardRef((e, t) => {
11816
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11822
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11817
11823
  return /* @__PURE__ */ c.jsx(cS, { ...o, ...r, ref: t });
11818
11824
  });
11819
11825
  Af.displayName = TS;
11820
11826
  var RS = "DropdownMenuItemIndicator", Pf = f.forwardRef((e, t) => {
11821
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11827
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11822
11828
  return /* @__PURE__ */ c.jsx(lS, { ...o, ...r, ref: t });
11823
11829
  });
11824
11830
  Pf.displayName = RS;
11825
11831
  var ES = "DropdownMenuSeparator", _f = f.forwardRef((e, t) => {
11826
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11832
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11827
11833
  return /* @__PURE__ */ c.jsx(uS, { ...o, ...r, ref: t });
11828
11834
  });
11829
11835
  _f.displayName = ES;
11830
11836
  var NS = "DropdownMenuArrow", IS = f.forwardRef(
11831
11837
  (e, t) => {
11832
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11838
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11833
11839
  return /* @__PURE__ */ c.jsx(dS, { ...o, ...r, ref: t });
11834
11840
  }
11835
11841
  );
11836
11842
  IS.displayName = NS;
11837
11843
  var jS = "DropdownMenuSubTrigger", Of = f.forwardRef((e, t) => {
11838
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11844
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11839
11845
  return /* @__PURE__ */ c.jsx(fS, { ...o, ...r, ref: t });
11840
11846
  });
11841
11847
  Of.displayName = jS;
11842
11848
  var kS = "DropdownMenuSubContent", Mf = f.forwardRef((e, t) => {
11843
- const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11849
+ const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11844
11850
  return /* @__PURE__ */ c.jsx(
11845
11851
  hS,
11846
11852
  {
@@ -12004,17 +12010,17 @@ function ko({
12004
12010
  loadOlderMessages: B,
12005
12011
  isPostStreamFetch: G,
12006
12012
  api: _
12007
- } = Yi(), [Y, U] = ue(null), [oe, O] = ue(""), [D, K] = ue(null), [W, ee] = ue([]), [L, Z] = ue(!1), [pe, he] = ue(null), [F, A] = ue(null), [H, J] = ue(!1), [ce, se] = ue(null), [Ae, _e] = ue([]), [je, ie] = ue(null), [Ne, Se] = ue(null), [fe, Ce] = ue(!1), Be = Ke(null), ot = Ke(null), et = Ke(null), [vt, it] = ue("desktop");
12008
- Ze(() => {
12013
+ } = Yi(), [Y, U] = ue(null), [oe, O] = ue(""), [D, K] = ue(null), [W, ee] = ue([]), [L, Z] = ue(!1), [pe, he] = ue(null), [F, A] = ue(null), [H, J] = ue(!1), [ce, se] = ue(null), [Ae, _e] = ue([]), [je, ie] = ue(null), [Ne, Ce] = ue(null), [fe, Te] = ue(!1), Be = We(null), st = We(null), et = We(null), [xt, at] = ue("desktop");
12014
+ Xe(() => {
12009
12015
  const te = () => {
12010
12016
  const le = window.innerWidth;
12011
- it(le < 640 ? "phone" : le < 1024 ? "tablet" : "desktop");
12017
+ at(le < 640 ? "phone" : le < 1024 ? "tablet" : "desktop");
12012
12018
  };
12013
12019
  return te(), window.addEventListener("resize", te), () => window.removeEventListener("resize", te);
12014
- }, []), Ze(() => {
12020
+ }, []), Xe(() => {
12015
12021
  let te = !1;
12016
12022
  if (!x) {
12017
- _e([]), ie(null), Se(null), et.current = null;
12023
+ _e([]), ie(null), Ce(null), et.current = null;
12018
12024
  return;
12019
12025
  }
12020
12026
  const le = {
@@ -12034,14 +12040,14 @@ function ko({
12034
12040
  const qt = Nn.find((Kn) => Kn.checkpointId === Gn);
12035
12041
  ro = (qt == null ? void 0 : qt.checkpointNs) ?? null;
12036
12042
  }
12037
- ie(Gn), Se(ro), et.current = le;
12043
+ ie(Gn), Ce(ro), et.current = le;
12038
12044
  }).catch((Ye) => {
12039
12045
  console.error("ChatInterface - listCheckpoints error:", Ye), te || (_e([]), et.current = null);
12040
12046
  }), () => {
12041
12047
  te = !0;
12042
12048
  };
12043
- }, [x, S, C, je, E]), Ze(() => {
12044
- S && (ie(S), Se(C ?? null));
12049
+ }, [x, S, C, je, E]), Xe(() => {
12050
+ S && (ie(S), Ce(C ?? null));
12045
12051
  }, [S, C]);
12046
12052
  const an = Ue(async () => {
12047
12053
  if (!(!j || P))
@@ -12051,7 +12057,7 @@ function ko({
12051
12057
  console.warn("loadOlderMessages failed", te);
12052
12058
  }
12053
12059
  }, [j, P, B]);
12054
- Ze(() => {
12060
+ Xe(() => {
12055
12061
  (async () => {
12056
12062
  try {
12057
12063
  const le = await _.getAgent("default");
@@ -12060,7 +12066,7 @@ function ko({
12060
12066
  console.warn("Failed to fetch default message:", le), se(null);
12061
12067
  }
12062
12068
  })();
12063
- }, [_]), Ze(() => {
12069
+ }, [_]), Xe(() => {
12064
12070
  b && !H && (w == null || w(b));
12065
12071
  }, [b, H, w]);
12066
12072
  const V = (te) => {
@@ -12101,13 +12107,13 @@ function ko({
12101
12107
  K(Ye), w == null || w(Ye);
12102
12108
  }
12103
12109
  }
12104
- }, qe = q.useCallback((te, le) => {
12110
+ }, rt = q.useCallback((te, le) => {
12105
12111
  u && (U(te), O(le), K(null));
12106
- }, [u]), Re = q.useCallback(() => {
12112
+ }, [u]), we = q.useCallback(() => {
12107
12113
  U(null), O(""), K(null);
12108
- }, []), xt = Ue((te, le) => {
12109
- qe(te, le);
12110
- }, [qe]), jt = Ue((te) => {
12114
+ }, []), qe = Ue((te, le) => {
12115
+ rt(te, le);
12116
+ }, [rt]), jt = Ue((te) => {
12111
12117
  for (let le = te - 1; le >= 0; le--)
12112
12118
  if (v[le].role === "user") {
12113
12119
  const Oe = ae(v[le]);
@@ -12120,7 +12126,7 @@ function ko({
12120
12126
  }, [v, y, je, Ne, S, C, ae]), En = (te) => {
12121
12127
  const le = Array.from(te.target.files || []);
12122
12128
  ee((Oe) => [...Oe, ...le]);
12123
- }, lt = (te) => ee((le) => le.filter((Oe, Ye) => te !== Ye)), Tt = async (te) => {
12129
+ }, ut = (te) => ee((le) => le.filter((Oe, Ye) => te !== Ye)), Tt = async (te) => {
12124
12130
  const le = (te.target.files || [])[0];
12125
12131
  if (le) {
12126
12132
  he(null), A(null), Z(!0);
@@ -12139,25 +12145,25 @@ function ko({
12139
12145
  Z(!1), te.target.value = "";
12140
12146
  }
12141
12147
  }
12142
- }, at = (te) => {
12148
+ }, ct = (te) => {
12143
12149
  if (!te) return "Unknown";
12144
12150
  const le = Date.parse(te);
12145
12151
  return Number.isNaN(le) ? te : new Date(le).toLocaleString();
12146
- }, ht = async (te) => {
12152
+ }, pt = async (te) => {
12147
12153
  if (x) {
12148
- Ce(!0);
12154
+ Te(!0);
12149
12155
  try {
12150
12156
  if (!te) {
12151
- await I(), ie(null), Se(null);
12157
+ await I(), ie(null), Ce(null);
12152
12158
  return;
12153
12159
  }
12154
12160
  const le = Ae.find((Ye) => Ye.checkpointId === te), Oe = (le == null ? void 0 : le.checkpointNs) ?? null;
12155
- await N(te, Oe), ie(te), Se(Oe);
12161
+ await N(te, Oe), ie(te), Ce(Oe);
12156
12162
  } finally {
12157
- Ce(!1);
12163
+ Te(!1);
12158
12164
  }
12159
12165
  }
12160
- }, cn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, Yt = `flex-1 min-h-0 min-w-0 max-h-full w-full overflow-y-auto overflow-x-auto overscroll-contain break-words break-anywhere p-4 bg-transparent ${d.messagesArea || ""}`, hn = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
12166
+ }, cn = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, Yt = `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 ${d.messagesArea || ""}`, fn = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
12161
12167
  return /* @__PURE__ */ c.jsxs("div", { className: cn, children: [
12162
12168
  !!b && !H && /* @__PURE__ */ c.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: [
12163
12169
  /* @__PURE__ */ c.jsx("span", { children: b }),
@@ -12182,12 +12188,12 @@ function ko({
12182
12188
  value: je ?? "",
12183
12189
  onChange: (te) => {
12184
12190
  const le = te.target.value || null;
12185
- ht(le);
12191
+ pt(le);
12186
12192
  },
12187
12193
  children: [
12188
12194
  /* @__PURE__ */ c.jsx("option", { value: "", children: "Latest" }),
12189
12195
  Ae.map((te) => /* @__PURE__ */ c.jsxs("option", { value: te.checkpointId, children: [
12190
- at(te.createdAt),
12196
+ ct(te.createdAt),
12191
12197
  te.preview ? ` — ${te.preview.slice(0, 40)}` : ""
12192
12198
  ] }, te.checkpointId))
12193
12199
  ]
@@ -12204,20 +12210,20 @@ function ko({
12204
12210
  streamingAssistantId: g,
12205
12211
  streamingDebounceMs: typeof s == "number" ? s : o,
12206
12212
  followNewMessages: i,
12207
- layoutSize: vt,
12213
+ layoutSize: xt,
12208
12214
  enableMessageEditing: u,
12209
12215
  editingMessageId: Y,
12210
12216
  onStartReached: () => {
12211
12217
  an();
12212
12218
  },
12213
- onEdit: xt,
12219
+ onEdit: qe,
12214
12220
  onRegenerate: jt,
12215
- onCancelEdit: Re,
12221
+ onCancelEdit: we,
12216
12222
  emptyMessage: ce ?? void 0,
12217
12223
  isNavigatingCheckpoint: fe || G
12218
12224
  }
12219
12225
  ),
12220
- /* @__PURE__ */ c.jsxs("div", { className: hn, children: [
12226
+ /* @__PURE__ */ c.jsxs("div", { className: fn, children: [
12221
12227
  Y && /* @__PURE__ */ c.jsx("div", { className: "mb-3 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
12222
12228
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", children: [
12223
12229
  /* @__PURE__ */ c.jsx(Rl, { size: 16, className: "text-blue-600" }),
@@ -12228,7 +12234,7 @@ function ko({
12228
12234
  {
12229
12235
  variant: "ghost",
12230
12236
  size: "sm",
12231
- onClick: Re,
12237
+ onClick: we,
12232
12238
  className: "text-blue-600 hover:bg-blue-100",
12233
12239
  children: /* @__PURE__ */ c.jsx(er, { size: 16 })
12234
12240
  }
@@ -12254,7 +12260,7 @@ function ko({
12254
12260
  {
12255
12261
  variant: "ghost",
12256
12262
  size: "sm",
12257
- onClick: () => lt(le),
12263
+ onClick: () => ut(le),
12258
12264
  className: "h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400",
12259
12265
  "aria-label": `Remove ${te.name}`,
12260
12266
  children: /* @__PURE__ */ c.jsx(er, { size: 12 })
@@ -12266,7 +12272,7 @@ function ko({
12266
12272
  /* @__PURE__ */ c.jsx(
12267
12273
  "input",
12268
12274
  {
12269
- ref: ot,
12275
+ ref: st,
12270
12276
  type: "file",
12271
12277
  accept: ".xls,.xlsx,.xlsm",
12272
12278
  onChange: Tt,
@@ -12309,7 +12315,7 @@ function ko({
12309
12315
  {
12310
12316
  onClick: () => {
12311
12317
  var te;
12312
- L || (te = ot.current) == null || te.click();
12318
+ L || (te = st.current) == null || te.click();
12313
12319
  },
12314
12320
  className: `cursor-pointer ${L ? "opacity-60 pointer-events-none" : ""}`,
12315
12321
  children: [
@@ -12330,7 +12336,7 @@ function ko({
12330
12336
  disabled: !1,
12331
12337
  maxLength: Io,
12332
12338
  onSend: $e,
12333
- onCancelEdit: Re,
12339
+ onCancelEdit: we,
12334
12340
  onStop: R,
12335
12341
  allowEmptySend: W.length > 0,
12336
12342
  textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${Y ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${D ? "border-red-400" : ""} ${d.textarea || ""}`
@@ -12691,7 +12697,7 @@ var WS = f.forwardRef((e, t) => {
12691
12697
  onWheelScroll: d,
12692
12698
  onResize: h,
12693
12699
  ...m
12694
- } = e, w = Lt(sn, n), [x, v] = f.useState(null), p = Ee(t, (I) => v(I)), g = f.useRef(null), b = f.useRef(""), y = w.viewport, R = r.content - r.viewport, S = ct(d), C = ct(l), E = Es(h, 10);
12700
+ } = e, w = Lt(sn, n), [x, v] = f.useState(null), p = Ee(t, (I) => v(I)), g = f.useRef(null), b = f.useRef(""), y = w.viewport, R = r.content - r.viewport, S = lt(d), C = lt(l), E = Es(h, 10);
12695
12701
  function N(I) {
12696
12702
  if (g.current) {
12697
12703
  const j = I.clientX - g.current.left, P = I.clientY - g.current.top;
@@ -12710,10 +12716,10 @@ var WS = f.forwardRef((e, t) => {
12710
12716
  scope: n,
12711
12717
  scrollbar: x,
12712
12718
  hasThumb: o,
12713
- onThumbChange: ct(s),
12714
- onThumbPointerUp: ct(i),
12719
+ onThumbChange: lt(s),
12720
+ onThumbPointerUp: lt(i),
12715
12721
  onThumbPositionChange: C,
12716
- onThumbPointerDown: ct(a),
12722
+ onThumbPointerDown: lt(a),
12717
12723
  children: /* @__PURE__ */ c.jsx(
12718
12724
  ve.div,
12719
12725
  {
@@ -12849,14 +12855,14 @@ var ZS = (e, t = () => {
12849
12855
  }(), () => window.cancelAnimationFrame(r);
12850
12856
  };
12851
12857
  function Es(e, t) {
12852
- const n = ct(e), r = f.useRef(0);
12858
+ const n = lt(e), r = f.useRef(0);
12853
12859
  return f.useEffect(() => () => window.clearTimeout(r.current), []), f.useCallback(() => {
12854
12860
  window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
12855
12861
  }, [n, t]);
12856
12862
  }
12857
12863
  function cr(e, t) {
12858
- const n = ct(t);
12859
- st(() => {
12864
+ const n = lt(t);
12865
+ it(() => {
12860
12866
  let r = 0;
12861
12867
  if (e) {
12862
12868
  const o = new ResizeObserver(() => {
@@ -12921,7 +12927,7 @@ function Oi({
12921
12927
  deleteThread: p,
12922
12928
  renameThread: g
12923
12929
  } = Yi(), [b, y] = ue(m ?? []), [R, S] = ue(!1), [C, E] = ue(null), [N, I] = ue(null), [j, P] = ue(""), [B, G] = ue(!1);
12924
- Ze(() => {
12930
+ Xe(() => {
12925
12931
  y(m ?? []);
12926
12932
  }, [m]);
12927
12933
  const _ = async (L) => {
@@ -13034,7 +13040,7 @@ function Oi({
13034
13040
  }
13035
13041
  const ah = Sl(null);
13036
13042
  function xR({ children: e, basePath: t = "/chat" }) {
13037
- const n = ln(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
13043
+ const n = mn(() => t ? t === "/" ? "" : t.endsWith("/") ? t.slice(0, -1) : t : "/chat", [t]), r = {
13038
13044
  basePath: n,
13039
13045
  buildThreadPath: (o) => `${n}/${o}`,
13040
13046
  buildBasePath: () => n
@@ -14291,7 +14297,7 @@ function qh(e) {
14291
14297
  return e ? "checked" : "unchecked";
14292
14298
  }
14293
14299
  var Xh = Vh, aT = Kh;
14294
- const mn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14300
+ const pn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14295
14301
  Xh,
14296
14302
  {
14297
14303
  className: M(
@@ -14310,7 +14316,7 @@ const mn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14310
14316
  )
14311
14317
  }
14312
14318
  ));
14313
- mn.displayName = Xh.displayName;
14319
+ pn.displayName = Xh.displayName;
14314
14320
  var cT = [" ", "Enter", "ArrowUp", "ArrowDown"], lT = [" ", "Enter"], Bn = "Select", [Ps, _s, uT] = ba(Bn), [xr, ER] = Gt(Bn, [
14315
14321
  uT,
14316
14322
  vr
@@ -14448,7 +14454,7 @@ Qh.displayName = Zh;
14448
14454
  var ep = "SelectValue", tp = f.forwardRef(
14449
14455
  (e, t) => {
14450
14456
  const { __scopeSelect: n, className: r, style: o, children: s, placeholder: i = "", ...a } = e, l = Tn(ep, n), { onValueNodeHasChildrenChange: u } = l, d = s !== void 0, h = Ee(t, l.onValueNodeChange);
14451
- return st(() => {
14457
+ return it(() => {
14452
14458
  u(d);
14453
14459
  }, [u, d]), /* @__PURE__ */ c.jsx(
14454
14460
  ve.span,
@@ -14474,7 +14480,7 @@ rp.displayName = mT;
14474
14480
  var $n = "SelectContent", op = f.forwardRef(
14475
14481
  (e, t) => {
14476
14482
  const n = Tn($n, e.__scopeSelect), [r, o] = f.useState();
14477
- if (st(() => {
14483
+ if (it(() => {
14478
14484
  o(new DocumentFragment());
14479
14485
  }, []), !n.open) {
14480
14486
  const s = r;
@@ -14714,9 +14720,9 @@ var xT = "SelectItemAlignedPosition", ap = f.forwardRef((e, t) => {
14714
14720
  s.dir,
14715
14721
  r
14716
14722
  ]);
14717
- st(() => y(), [y]);
14723
+ it(() => y(), [y]);
14718
14724
  const [R, S] = f.useState();
14719
- st(() => {
14725
+ it(() => {
14720
14726
  u && S(window.getComputedStyle(u).zIndex);
14721
14727
  }, [u]);
14722
14728
  const C = f.useCallback(
@@ -14957,7 +14963,7 @@ var Er = "SelectItemText", pp = f.forwardRef(
14957
14963
  () => /* @__PURE__ */ c.jsx("option", { value: l.value, disabled: l.disabled, children: w }, l.value),
14958
14964
  [l.disabled, l.value, w]
14959
14965
  ), { onNativeOptionAdd: v, onNativeOptionRemove: p } = u;
14960
- return st(() => (v(x), () => p(x)), [v, p, x]), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
14966
+ return it(() => (v(x), () => p(x)), [v, p, x]), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
14961
14967
  /* @__PURE__ */ c.jsx(ve.span, { id: l.textId, ...s, ref: m }),
14962
14968
  l.isSelected && i.valueNode && !i.valueNodeHasChildren ? Zo.createPortal(s.children, i.valueNode) : null
14963
14969
  ] });
@@ -14973,7 +14979,7 @@ var mp = "SelectItemIndicator", gp = f.forwardRef(
14973
14979
  gp.displayName = mp;
14974
14980
  var Bi = "SelectScrollUpButton", vp = f.forwardRef((e, t) => {
14975
14981
  const n = Rn(Bi, e.__scopeSelect), r = Ka(Bi, e.__scopeSelect), [o, s] = f.useState(!1), i = Ee(t, r.onScrollButtonChange);
14976
- return st(() => {
14982
+ return it(() => {
14977
14983
  if (n.viewport && n.isPositioned) {
14978
14984
  let a = function() {
14979
14985
  const u = l.scrollTop > 0;
@@ -14997,7 +15003,7 @@ var Bi = "SelectScrollUpButton", vp = f.forwardRef((e, t) => {
14997
15003
  vp.displayName = Bi;
14998
15004
  var $i = "SelectScrollDownButton", xp = f.forwardRef((e, t) => {
14999
15005
  const n = Rn($i, e.__scopeSelect), r = Ka($i, e.__scopeSelect), [o, s] = f.useState(!1), i = Ee(t, r.onScrollButtonChange);
15000
- return st(() => {
15006
+ return it(() => {
15001
15007
  if (n.viewport && n.isPositioned) {
15002
15008
  let a = function() {
15003
15009
  const u = l.scrollHeight - l.clientHeight, d = Math.ceil(l.scrollTop) < u;
@@ -15023,7 +15029,7 @@ var bp = f.forwardRef((e, t) => {
15023
15029
  const { __scopeSelect: n, onAutoScroll: r, ...o } = e, s = Rn("SelectScrollButton", n), i = f.useRef(null), a = _s(n), l = f.useCallback(() => {
15024
15030
  i.current !== null && (window.clearInterval(i.current), i.current = null);
15025
15031
  }, []);
15026
- return f.useEffect(() => () => l(), [l]), st(() => {
15032
+ return f.useEffect(() => () => l(), [l]), it(() => {
15027
15033
  var d;
15028
15034
  const u = a().find((h) => h.ref.current === document.activeElement);
15029
15035
  (d = u == null ? void 0 : u.ref.current) == null || d.scrollIntoView({ block: "nearest" });
@@ -15090,7 +15096,7 @@ function Sp(e) {
15090
15096
  return e === "" || e === void 0;
15091
15097
  }
15092
15098
  function Cp(e) {
15093
- const t = ct(e), n = f.useRef(""), r = f.useRef(0), o = f.useCallback(
15099
+ const t = lt(e), n = f.useRef(""), r = f.useRef(0), o = f.useCallback(
15094
15100
  (i) => {
15095
15101
  const a = n.current + i;
15096
15102
  t(a), function l(u) {
@@ -15294,10 +15300,10 @@ const $T = {
15294
15300
  };
15295
15301
  function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15296
15302
  const [r, o] = ue(!1), [s, i] = ue(!1), [a, l] = ue(e), [u, d] = ue(!1), { toast: h } = ha();
15297
- Ze(() => {
15303
+ Xe(() => {
15298
15304
  const p = JSON.stringify(a) !== JSON.stringify(e);
15299
15305
  d(p);
15300
- }, [a, e]), Ze(() => {
15306
+ }, [a, e]), Xe(() => {
15301
15307
  l(e);
15302
15308
  }, [e]);
15303
15309
  const m = () => {
@@ -15366,7 +15372,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15366
15372
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15367
15373
  /* @__PURE__ */ c.jsx(Pt, { htmlFor: "enable-auth", children: "Enable Authentication" }),
15368
15374
  /* @__PURE__ */ c.jsx(
15369
- mn,
15375
+ pn,
15370
15376
  {
15371
15377
  id: "enable-auth",
15372
15378
  checked: a.api.enableAuth,
@@ -15459,7 +15465,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15459
15465
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15460
15466
  /* @__PURE__ */ c.jsx(Pt, { htmlFor: "show-timestamps", children: "Show Timestamps" }),
15461
15467
  /* @__PURE__ */ c.jsx(
15462
- mn,
15468
+ pn,
15463
15469
  {
15464
15470
  id: "show-timestamps",
15465
15471
  checked: a.ui.showTimestamps,
@@ -15473,7 +15479,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15473
15479
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15474
15480
  /* @__PURE__ */ c.jsx(Pt, { htmlFor: "show-agent-names", children: "Show Agent Names" }),
15475
15481
  /* @__PURE__ */ c.jsx(
15476
- mn,
15482
+ pn,
15477
15483
  {
15478
15484
  id: "show-agent-names",
15479
15485
  checked: a.ui.showAgentNames,
@@ -15487,7 +15493,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15487
15493
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15488
15494
  /* @__PURE__ */ c.jsx(Pt, { htmlFor: "compact-messages", children: "Compact Messages" }),
15489
15495
  /* @__PURE__ */ c.jsx(
15490
- mn,
15496
+ pn,
15491
15497
  {
15492
15498
  id: "compact-messages",
15493
15499
  checked: a.ui.compactMessages,
@@ -15513,7 +15519,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15513
15519
  /* @__PURE__ */ c.jsx("p", { className: "text-sm text-muted-foreground", children: "Automatically save messages to threads" })
15514
15520
  ] }),
15515
15521
  /* @__PURE__ */ c.jsx(
15516
- mn,
15522
+ pn,
15517
15523
  {
15518
15524
  id: "auto-save",
15519
15525
  checked: a.behavior.autoSave,
@@ -15530,7 +15536,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15530
15536
  /* @__PURE__ */ c.jsx("p", { className: "text-sm text-muted-foreground", children: "Stream responses in real-time" })
15531
15537
  ] }),
15532
15538
  /* @__PURE__ */ c.jsx(
15533
- mn,
15539
+ pn,
15534
15540
  {
15535
15541
  id: "enable-streaming",
15536
15542
  checked: a.behavior.enableStreaming,
@@ -15547,7 +15553,7 @@ function NR({ settings: e, onSettingsChange: t, className: n = "" }) {
15547
15553
  /* @__PURE__ */ c.jsx("p", { className: "text-sm text-muted-foreground", children: "Show typing indicator during responses" })
15548
15554
  ] }),
15549
15555
  /* @__PURE__ */ c.jsx(
15550
- mn,
15556
+ pn,
15551
15557
  {
15552
15558
  id: "typing-indicator",
15553
15559
  checked: a.behavior.showTypingIndicator,