teodor-new-chat-ui 3.0.94 → 3.0.96

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 V, { useState as fe, useRef as Ye, useCallback as Ke, useEffect as $e, useReducer as Dp, useMemo as un, createContext as wc, useContext as yc, createElement as uo, useLayoutEffect as Lp } from "react";
2
+ import V, { useState as fe, useRef as Ke, useCallback as Ge, useEffect as Fe, useReducer as Dp, useMemo as un, createContext as wc, useContext as yc, createElement as uo, useLayoutEffect as Lp } from "react";
3
3
  import { Square as Fp, Send as Bp, X as Vn, ExternalLink as $p, Download as Hp, Image as Sc, FileText as Va, Loader as zp, ChevronUp as wr, ChevronDown as Wn, Copy as Ga, Edit as Ka, RotateCcw as si, Bot as Ya, Wrench as Up, User as Wp, ChevronRight as Vp, Check as Hi, Circle as Gp, Edit3 as Cc, Paperclip as qa, Loader2 as Kp, Plus as Yp, FileSpreadsheet as qp, MessageSquarePlus as Xp, MessageSquare as Jp, Calendar as Zp, Trash2 as Qp, PanelLeft as em, Settings as tm, Server as nm, EyeOff as rm, Eye as om, Layout as sm, MessageCircle as im, Save as am } from "lucide-react";
4
4
  import { Slot as tr, createSlot as Xn, createSlottable as lm } from "@radix-ui/react-slot";
5
5
  import { cva as $r } from "class-variance-authority";
@@ -23,11 +23,11 @@ function dm() {
23
23
  Xa = 1;
24
24
  var e = V, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
25
25
  function i(a, c, u) {
26
- var d, h = {}, m = null, x = null;
27
- u !== void 0 && (m = "" + u), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (x = c.ref);
26
+ var d, h = {}, m = null, v = null;
27
+ u !== void 0 && (m = "" + u), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (v = c.ref);
28
28
  for (d in c) r.call(c, d) && !s.hasOwnProperty(d) && (h[d] = c[d]);
29
29
  if (a && a.defaultProps) for (d in c = a.defaultProps, c) h[d] === void 0 && (h[d] = c[d]);
30
- return { $$typeof: t, type: a, key: m, ref: x, props: h, _owner: o.current };
30
+ return { $$typeof: t, type: a, key: m, ref: v, props: h, _owner: o.current };
31
31
  }
32
32
  return gr.Fragment = n, gr.jsx = i, gr.jsxs = i, gr;
33
33
  }
@@ -44,11 +44,11 @@ var xr = {};
44
44
  var Ja;
45
45
  function fm() {
46
46
  return Ja || (Ja = 1, process.env.NODE_ENV !== "production" && function() {
47
- var e = V, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), v = Symbol.iterator, g = "@@iterator";
47
+ var e = V, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), v = Symbol.for("react.offscreen"), x = Symbol.iterator, g = "@@iterator";
48
48
  function p(E) {
49
49
  if (E === null || typeof E != "object")
50
50
  return null;
51
- var z = v && E[v] || E[g];
51
+ var z = x && E[x] || E[g];
52
52
  return typeof z == "function" ? z : null;
53
53
  }
54
54
  var w = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
@@ -63,16 +63,16 @@ function fm() {
63
63
  {
64
64
  var ge = w.ReactDebugCurrentFrame, Oe = ge.getStackAddendum();
65
65
  Oe !== "" && (z += "%s", ne = ne.concat([Oe]));
66
- var Fe = ne.map(function(Ie) {
66
+ var Le = ne.map(function(Ie) {
67
67
  return String(Ie);
68
68
  });
69
- Fe.unshift("Warning: " + z), Function.prototype.apply.call(console[E], console, Fe);
69
+ Le.unshift("Warning: " + z), Function.prototype.apply.call(console[E], console, Le);
70
70
  }
71
71
  }
72
72
  var N = !1, S = !1, T = !1, C = !1, R = !1, I;
73
73
  I = Symbol.for("react.module.reference");
74
- function A(E) {
75
- return !!(typeof E == "string" || typeof E == "function" || E === r || E === s || R || E === o || E === u || E === d || C || E === x || N || S || T || typeof E == "object" && E !== null && (E.$$typeof === m || E.$$typeof === h || E.$$typeof === i || E.$$typeof === a || E.$$typeof === c || // This needs to include all possible module reference object
74
+ function k(E) {
75
+ return !!(typeof E == "string" || typeof E == "function" || E === r || E === s || R || E === o || E === u || E === d || C || E === v || N || S || T || typeof E == "object" && E !== null && (E.$$typeof === m || E.$$typeof === h || E.$$typeof === i || E.$$typeof === a || E.$$typeof === c || // This needs to include all possible module reference object
76
76
  // types supported by any Flight configuration anywhere since
77
77
  // we don't know which Flight build this will end up being used
78
78
  // with.
@@ -123,9 +123,9 @@ function fm() {
123
123
  var ge = E.displayName || null;
124
124
  return ge !== null ? ge : U(E.type) || "Memo";
125
125
  case m: {
126
- var Oe = E, Fe = Oe._payload, Ie = Oe._init;
126
+ var Oe = E, Le = Oe._payload, Ie = Oe._init;
127
127
  try {
128
- return U(Ie(Fe));
128
+ return U(Ie(Le));
129
129
  } catch {
130
130
  return null;
131
131
  }
@@ -226,8 +226,8 @@ function fm() {
226
226
  X = !0;
227
227
  var Oe = Error.prepareStackTrace;
228
228
  Error.prepareStackTrace = void 0;
229
- var Fe;
230
- Fe = ce.current, ce.current = null, Y();
229
+ var Le;
230
+ Le = ce.current, ce.current = null, Y();
231
231
  try {
232
232
  if (z) {
233
233
  var Ie = function() {
@@ -280,7 +280,7 @@ function fm() {
280
280
  }
281
281
  }
282
282
  } finally {
283
- X = !1, ce.current = Fe, ye(), Error.prepareStackTrace = Oe;
283
+ X = !1, ce.current = Le, ye(), Error.prepareStackTrace = Oe;
284
284
  }
285
285
  var Bn = E ? E.displayName || E.name : "", Wa = Bn ? P(Bn) : "";
286
286
  return typeof E == "function" && te.set(E, Wa), Wa;
@@ -312,9 +312,9 @@ function fm() {
312
312
  case h:
313
313
  return De(E.type, z, ne);
314
314
  case m: {
315
- var ge = E, Oe = ge._payload, Fe = ge._init;
315
+ var ge = E, Oe = ge._payload, Le = ge._init;
316
316
  try {
317
- return De(Fe(Oe), z, ne);
317
+ return De(Le(Oe), z, ne);
318
318
  } catch {
319
319
  }
320
320
  }
@@ -331,9 +331,9 @@ function fm() {
331
331
  }
332
332
  function rt(E, z, ne, ge, Oe) {
333
333
  {
334
- var Fe = Function.call.bind(de);
334
+ var Le = Function.call.bind(de);
335
335
  for (var Ie in E)
336
- if (Fe(E, Ie)) {
336
+ if (Le(E, Ie)) {
337
337
  var Re = void 0;
338
338
  try {
339
339
  if (typeof E[Ie] != "function") {
@@ -352,13 +352,13 @@ function fm() {
352
352
  function ae(E) {
353
353
  return J(E);
354
354
  }
355
- function Le(E) {
355
+ function $e(E) {
356
356
  {
357
357
  var z = typeof Symbol == "function" && Symbol.toStringTag, ne = z && E[Symbol.toStringTag] || E.constructor.name || "Object";
358
358
  return ne;
359
359
  }
360
360
  }
361
- function Ve(E) {
361
+ function Ye(E) {
362
362
  try {
363
363
  return Ze(E), !1;
364
364
  } catch {
@@ -369,8 +369,8 @@ function fm() {
369
369
  return "" + E;
370
370
  }
371
371
  function wt(E) {
372
- if (Ve(E))
373
- return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Le(E)), Ze(E);
372
+ if (Ye(E))
373
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", $e(E)), Ze(E);
374
374
  }
375
375
  var dt = w.ReactCurrentOwner, Rt = {
376
376
  key: !0,
@@ -419,7 +419,7 @@ function fm() {
419
419
  });
420
420
  }
421
421
  }
422
- var Ge = function(E, z, ne, ge, Oe, Fe, Ie) {
422
+ var Ve = function(E, z, ne, ge, Oe, Le, Ie) {
423
423
  var Re = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
425
  $$typeof: t,
@@ -429,7 +429,7 @@ function fm() {
429
429
  ref: ne,
430
430
  props: Ie,
431
431
  // Record the component responsible for creating this element.
432
- _owner: Fe
432
+ _owner: Le
433
433
  };
434
434
  return Re._store = {}, Object.defineProperty(Re._store, "validated", {
435
435
  configurable: !1,
@@ -450,20 +450,20 @@ function fm() {
450
450
  };
451
451
  function dr(E, z, ne, ge, Oe) {
452
452
  {
453
- var Fe, Ie = {}, Re = null, ht = null;
453
+ var Le, Ie = {}, Re = null, ht = null;
454
454
  ne !== void 0 && (wt(ne), Re = "" + ne), ft(z) && (wt(z.key), Re = "" + z.key), et(z) && (ht = z.ref, sn(z, Oe));
455
- for (Fe in z)
456
- de.call(z, Fe) && !Rt.hasOwnProperty(Fe) && (Ie[Fe] = z[Fe]);
455
+ for (Le in z)
456
+ de.call(z, Le) && !Rt.hasOwnProperty(Le) && (Ie[Le] = z[Le]);
457
457
  if (E && E.defaultProps) {
458
458
  var qe = E.defaultProps;
459
- for (Fe in qe)
460
- Ie[Fe] === void 0 && (Ie[Fe] = qe[Fe]);
459
+ for (Le in qe)
460
+ Ie[Le] === void 0 && (Ie[Le] = qe[Le]);
461
461
  }
462
462
  if (Re || ht) {
463
463
  var tt = typeof E == "function" ? E.displayName || E.name || "Unknown" : E;
464
464
  Re && ur(Ie, tt), ht && Ln(Ie, tt);
465
465
  }
466
- return Ge(E, Re, ht, Oe, ge, dt.current, Ie);
466
+ return Ve(E, Re, ht, Oe, ge, dt.current, Ie);
467
467
  }
468
468
  }
469
469
  var fr = w.ReactCurrentOwner, oe = w.ReactDebugCurrentFrame;
@@ -534,7 +534,7 @@ Check the top-level render call using <` + ne + ">.");
534
534
  else if (E) {
535
535
  var Oe = p(E);
536
536
  if (typeof Oe == "function" && Oe !== E.entries)
537
- for (var Fe = Oe.call(E), Ie; !(Ie = Fe.next()).done; )
537
+ for (var Le = Oe.call(E), Ie; !(Ie = Le.next()).done; )
538
538
  Ue(Ie.value) && pr(Ie.value, z);
539
539
  }
540
540
  }
@@ -576,9 +576,9 @@ Check the top-level render call using <` + ne + ">.");
576
576
  E.ref !== null && (ie(E), b("Invalid attribute `ref` supplied to `React.Fragment`."), ie(null));
577
577
  }
578
578
  }
579
- function Ua(E, z, ne, ge, Oe, Fe) {
579
+ function Ua(E, z, ne, ge, Oe, Le) {
580
580
  {
581
- var Ie = A(E);
581
+ var Ie = k(E);
582
582
  if (!Ie) {
583
583
  var Re = "";
584
584
  (E === void 0 || typeof E == "object" && E !== null && Object.keys(E).length === 0) && (Re += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
@@ -587,7 +587,7 @@ Check the top-level render call using <` + ne + ">.");
587
587
  var qe;
588
588
  E === null ? qe = "null" : ae(E) ? qe = "array" : E !== void 0 && E.$$typeof === t ? (qe = "<" + (U(E.type) || "Unknown") + " />", Re = " Did you accidentally export a JSX literal instead of a component?") : qe = typeof E, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", qe, Re);
589
589
  }
590
- var tt = dr(E, z, ne, Oe, Fe);
590
+ var tt = dr(E, z, ne, Oe, Le);
591
591
  if (tt == null)
592
592
  return tt;
593
593
  if (Ie) {
@@ -796,7 +796,7 @@ const Km = (e) => {
796
796
  }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
797
797
  typeof setImmediate == "function",
798
798
  gt(Sn.postMessage)
799
- ), Xm = typeof queueMicrotask < "u" ? queueMicrotask.bind(Sn) : typeof process < "u" && process.nextTick || Pc, Jm = (e) => e != null && gt(e[qo]), k = {
799
+ ), Xm = typeof queueMicrotask < "u" ? queueMicrotask.bind(Sn) : typeof process < "u" && process.nextTick || Pc, Jm = (e) => e != null && gt(e[qo]), A = {
800
800
  isArray: nr,
801
801
  isArrayBuffer: Nc,
802
802
  isBuffer: Hr,
@@ -859,7 +859,7 @@ const Km = (e) => {
859
859
  function be(e, t, n, r, o) {
860
860
  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);
861
861
  }
862
- k.inherits(be, Error, {
862
+ A.inherits(be, Error, {
863
863
  toJSON: function() {
864
864
  return {
865
865
  // Standard
@@ -874,7 +874,7 @@ k.inherits(be, Error, {
874
874
  columnNumber: this.columnNumber,
875
875
  stack: this.stack,
876
876
  // Axios
877
- config: k.toJSONObject(this.config),
877
+ config: A.toJSONObject(this.config),
878
878
  code: this.code,
879
879
  status: this.status
880
880
  };
@@ -902,7 +902,7 @@ Object.defineProperties(be, Oc);
902
902
  Object.defineProperty(_c, "isAxiosError", { value: !0 });
903
903
  be.from = (e, t, n, r, o, s) => {
904
904
  const i = Object.create(_c);
905
- k.toFlatObject(e, i, function(d) {
905
+ A.toFlatObject(e, i, function(d) {
906
906
  return d !== Error.prototype;
907
907
  }, (u) => u !== "isAxiosError");
908
908
  const a = e && e.message ? e.message : "Error", c = t == null && e ? e.code : t;
@@ -910,10 +910,10 @@ be.from = (e, t, n, r, o, s) => {
910
910
  };
911
911
  const Zm = null;
912
912
  function li(e) {
913
- return k.isPlainObject(e) || k.isArray(e);
913
+ return A.isPlainObject(e) || A.isArray(e);
914
914
  }
915
915
  function Mc(e) {
916
- return k.endsWith(e, "[]") ? e.slice(0, -2) : e;
916
+ return A.endsWith(e, "[]") ? e.slice(0, -2) : e;
917
917
  }
918
918
  function Qa(e, t, n) {
919
919
  return e ? e.concat(t).map(function(o, s) {
@@ -921,73 +921,73 @@ function Qa(e, t, n) {
921
921
  }).join(n ? "." : "") : t;
922
922
  }
923
923
  function Qm(e) {
924
- return k.isArray(e) && !e.some(li);
924
+ return A.isArray(e) && !e.some(li);
925
925
  }
926
- const eg = k.toFlatObject(k, {}, null, function(t) {
926
+ const eg = A.toFlatObject(A, {}, null, function(t) {
927
927
  return /^is[A-Z]/.test(t);
928
928
  });
929
929
  function Zo(e, t, n) {
930
- if (!k.isObject(e))
930
+ if (!A.isObject(e))
931
931
  throw new TypeError("target must be an object");
932
- t = t || new FormData(), n = k.toFlatObject(n, {
932
+ t = t || new FormData(), n = A.toFlatObject(n, {
933
933
  metaTokens: !0,
934
934
  dots: !1,
935
935
  indexes: !1
936
936
  }, !1, function(g, p) {
937
- return !k.isUndefined(p[g]);
937
+ return !A.isUndefined(p[g]);
938
938
  });
939
- const r = n.metaTokens, o = n.visitor || d, s = n.dots, i = n.indexes, c = (n.Blob || typeof Blob < "u" && Blob) && k.isSpecCompliantForm(t);
940
- if (!k.isFunction(o))
939
+ const r = n.metaTokens, o = n.visitor || d, s = n.dots, i = n.indexes, c = (n.Blob || typeof Blob < "u" && Blob) && A.isSpecCompliantForm(t);
940
+ if (!A.isFunction(o))
941
941
  throw new TypeError("visitor must be a function");
942
- function u(v) {
943
- if (v === null) return "";
944
- if (k.isDate(v))
945
- return v.toISOString();
946
- if (k.isBoolean(v))
947
- return v.toString();
948
- if (!c && k.isBlob(v))
942
+ function u(x) {
943
+ if (x === null) return "";
944
+ if (A.isDate(x))
945
+ return x.toISOString();
946
+ if (A.isBoolean(x))
947
+ return x.toString();
948
+ if (!c && A.isBlob(x))
949
949
  throw new be("Blob is not supported. Use a Buffer instead.");
950
- return k.isArrayBuffer(v) || k.isTypedArray(v) ? c && typeof Blob == "function" ? new Blob([v]) : Buffer.from(v) : v;
951
- }
952
- function d(v, g, p) {
953
- let w = v;
954
- if (v && !p && typeof v == "object") {
955
- if (k.endsWith(g, "{}"))
956
- g = r ? g : g.slice(0, -2), v = JSON.stringify(v);
957
- else if (k.isArray(v) && Qm(v) || (k.isFileList(v) || k.endsWith(g, "[]")) && (w = k.toArray(v)))
950
+ return A.isArrayBuffer(x) || A.isTypedArray(x) ? c && typeof Blob == "function" ? new Blob([x]) : Buffer.from(x) : x;
951
+ }
952
+ function d(x, g, p) {
953
+ let w = x;
954
+ if (x && !p && typeof x == "object") {
955
+ if (A.endsWith(g, "{}"))
956
+ g = r ? g : g.slice(0, -2), x = JSON.stringify(x);
957
+ else if (A.isArray(x) && Qm(x) || (A.isFileList(x) || A.endsWith(g, "[]")) && (w = A.toArray(x)))
958
958
  return g = Mc(g), w.forEach(function(y, N) {
959
- !(k.isUndefined(y) || y === null) && t.append(
959
+ !(A.isUndefined(y) || y === null) && t.append(
960
960
  // eslint-disable-next-line no-nested-ternary
961
961
  i === !0 ? Qa([g], N, s) : i === null ? g : g + "[]",
962
962
  u(y)
963
963
  );
964
964
  }), !1;
965
965
  }
966
- return li(v) ? !0 : (t.append(Qa(p, g, s), u(v)), !1);
966
+ return li(x) ? !0 : (t.append(Qa(p, g, s), u(x)), !1);
967
967
  }
968
968
  const h = [], m = Object.assign(eg, {
969
969
  defaultVisitor: d,
970
970
  convertValue: u,
971
971
  isVisitable: li
972
972
  });
973
- function x(v, g) {
974
- if (!k.isUndefined(v)) {
975
- if (h.indexOf(v) !== -1)
973
+ function v(x, g) {
974
+ if (!A.isUndefined(x)) {
975
+ if (h.indexOf(x) !== -1)
976
976
  throw Error("Circular reference detected in " + g.join("."));
977
- h.push(v), k.forEach(v, function(w, b) {
978
- (!(k.isUndefined(w) || w === null) && o.call(
977
+ h.push(x), A.forEach(x, function(w, b) {
978
+ (!(A.isUndefined(w) || w === null) && o.call(
979
979
  t,
980
980
  w,
981
- k.isString(b) ? b.trim() : b,
981
+ A.isString(b) ? b.trim() : b,
982
982
  g,
983
983
  m
984
- )) === !0 && x(w, g ? g.concat(b) : [b]);
984
+ )) === !0 && v(w, g ? g.concat(b) : [b]);
985
985
  }), h.pop();
986
986
  }
987
987
  }
988
- if (!k.isObject(e))
988
+ if (!A.isObject(e))
989
989
  throw new TypeError("data must be an object");
990
- return x(e), t;
990
+ return v(e), t;
991
991
  }
992
992
  function el(e) {
993
993
  const t = {
@@ -1025,12 +1025,12 @@ function Lc(e, t, n) {
1025
1025
  if (!t)
1026
1026
  return e;
1027
1027
  const r = n && n.encode || tg;
1028
- k.isFunction(n) && (n = {
1028
+ A.isFunction(n) && (n = {
1029
1029
  serialize: n
1030
1030
  });
1031
1031
  const o = n && n.serialize;
1032
1032
  let s;
1033
- if (o ? s = o(t, n) : s = k.isURLSearchParams(t) ? t.toString() : new Ui(t, n).toString(r), s) {
1033
+ if (o ? s = o(t, n) : s = A.isURLSearchParams(t) ? t.toString() : new Ui(t, n).toString(r), s) {
1034
1034
  const i = e.indexOf("#");
1035
1035
  i !== -1 && (e = e.slice(0, i)), e += (e.indexOf("?") === -1 ? "?" : "&") + s;
1036
1036
  }
@@ -1085,7 +1085,7 @@ class tl {
1085
1085
  * @returns {void}
1086
1086
  */
1087
1087
  forEach(t) {
1088
- k.forEach(this.handlers, function(r) {
1088
+ A.forEach(this.handlers, function(r) {
1089
1089
  r !== null && t(r);
1090
1090
  });
1091
1091
  }
@@ -1117,13 +1117,13 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", lg
1117
1117
  function ug(e, t) {
1118
1118
  return Zo(e, new lt.classes.URLSearchParams(), {
1119
1119
  visitor: function(n, r, o, s) {
1120
- return lt.isNode && k.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1120
+ return lt.isNode && A.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1121
1121
  },
1122
1122
  ...t
1123
1123
  });
1124
1124
  }
1125
1125
  function dg(e) {
1126
- return k.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1126
+ return A.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
1127
1127
  }
1128
1128
  function fg(e) {
1129
1129
  const t = {}, n = Object.keys(e);
@@ -1139,20 +1139,20 @@ function Bc(e) {
1139
1139
  let i = n[s++];
1140
1140
  if (i === "__proto__") return !0;
1141
1141
  const a = Number.isFinite(+i), c = s >= n.length;
1142
- return i = !i && k.isArray(o) ? o.length : i, c ? (k.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !a) : ((!o[i] || !k.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && k.isArray(o[i]) && (o[i] = fg(o[i])), !a);
1142
+ return i = !i && A.isArray(o) ? o.length : i, c ? (A.hasOwnProp(o, i) ? o[i] = [o[i], r] : o[i] = r, !a) : ((!o[i] || !A.isObject(o[i])) && (o[i] = []), t(n, r, o[i], s) && A.isArray(o[i]) && (o[i] = fg(o[i])), !a);
1143
1143
  }
1144
- if (k.isFormData(e) && k.isFunction(e.entries)) {
1144
+ if (A.isFormData(e) && A.isFunction(e.entries)) {
1145
1145
  const n = {};
1146
- return k.forEachEntry(e, (r, o) => {
1146
+ return A.forEachEntry(e, (r, o) => {
1147
1147
  t(dg(r), o, n, 0);
1148
1148
  }), n;
1149
1149
  }
1150
1150
  return null;
1151
1151
  }
1152
1152
  function hg(e, t, n) {
1153
- if (k.isString(e))
1153
+ if (A.isString(e))
1154
1154
  try {
1155
- return (t || JSON.parse)(e), k.trim(e);
1155
+ return (t || JSON.parse)(e), A.trim(e);
1156
1156
  } catch (r) {
1157
1157
  if (r.name !== "SyntaxError")
1158
1158
  throw r;
@@ -1163,20 +1163,20 @@ const Wr = {
1163
1163
  transitional: Fc,
1164
1164
  adapter: ["xhr", "http", "fetch"],
1165
1165
  transformRequest: [function(t, n) {
1166
- const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = k.isObject(t);
1167
- if (s && k.isHTMLForm(t) && (t = new FormData(t)), k.isFormData(t))
1166
+ const r = n.getContentType() || "", o = r.indexOf("application/json") > -1, s = A.isObject(t);
1167
+ if (s && A.isHTMLForm(t) && (t = new FormData(t)), A.isFormData(t))
1168
1168
  return o ? JSON.stringify(Bc(t)) : t;
1169
- if (k.isArrayBuffer(t) || k.isBuffer(t) || k.isStream(t) || k.isFile(t) || k.isBlob(t) || k.isReadableStream(t))
1169
+ if (A.isArrayBuffer(t) || A.isBuffer(t) || A.isStream(t) || A.isFile(t) || A.isBlob(t) || A.isReadableStream(t))
1170
1170
  return t;
1171
- if (k.isArrayBufferView(t))
1171
+ if (A.isArrayBufferView(t))
1172
1172
  return t.buffer;
1173
- if (k.isURLSearchParams(t))
1173
+ if (A.isURLSearchParams(t))
1174
1174
  return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
1175
1175
  let a;
1176
1176
  if (s) {
1177
1177
  if (r.indexOf("application/x-www-form-urlencoded") > -1)
1178
1178
  return ug(t, this.formSerializer).toString();
1179
- if ((a = k.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1179
+ if ((a = A.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
1180
1180
  const c = this.env && this.env.FormData;
1181
1181
  return Zo(
1182
1182
  a ? { "files[]": t } : t,
@@ -1189,9 +1189,9 @@ const Wr = {
1189
1189
  }],
1190
1190
  transformResponse: [function(t) {
1191
1191
  const n = this.transitional || Wr.transitional, r = n && n.forcedJSONParsing, o = this.responseType === "json";
1192
- if (k.isResponse(t) || k.isReadableStream(t))
1192
+ if (A.isResponse(t) || A.isReadableStream(t))
1193
1193
  return t;
1194
- if (t && k.isString(t) && (r && !this.responseType || o)) {
1194
+ if (t && A.isString(t) && (r && !this.responseType || o)) {
1195
1195
  const i = !(n && n.silentJSONParsing) && o;
1196
1196
  try {
1197
1197
  return JSON.parse(t, this.parseReviver);
@@ -1225,10 +1225,10 @@ const Wr = {
1225
1225
  }
1226
1226
  }
1227
1227
  };
1228
- k.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1228
+ A.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
1229
1229
  Wr.headers[e] = {};
1230
1230
  });
1231
- const pg = k.toObjectSet([
1231
+ const pg = A.toObjectSet([
1232
1232
  "age",
1233
1233
  "authorization",
1234
1234
  "content-length",
@@ -1258,7 +1258,7 @@ function vr(e) {
1258
1258
  return e && String(e).trim().toLowerCase();
1259
1259
  }
1260
1260
  function ho(e) {
1261
- return e === !1 || e == null ? e : k.isArray(e) ? e.map(ho) : String(e);
1261
+ return e === !1 || e == null ? e : A.isArray(e) ? e.map(ho) : String(e);
1262
1262
  }
1263
1263
  function gg(e) {
1264
1264
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
@@ -1269,12 +1269,12 @@ function gg(e) {
1269
1269
  }
1270
1270
  const xg = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
1271
1271
  function _s(e, t, n, r, o) {
1272
- if (k.isFunction(r))
1272
+ if (A.isFunction(r))
1273
1273
  return r.call(this, t, n);
1274
- if (o && (t = n), !!k.isString(t)) {
1275
- if (k.isString(r))
1274
+ if (o && (t = n), !!A.isString(t)) {
1275
+ if (A.isString(r))
1276
1276
  return t.indexOf(r) !== -1;
1277
- if (k.isRegExp(r))
1277
+ if (A.isRegExp(r))
1278
1278
  return r.test(t);
1279
1279
  }
1280
1280
  }
@@ -1282,7 +1282,7 @@ function vg(e) {
1282
1282
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, r) => n.toUpperCase() + r);
1283
1283
  }
1284
1284
  function bg(e, t) {
1285
- const n = k.toCamelCase(" " + t);
1285
+ const n = A.toCamelCase(" " + t);
1286
1286
  ["get", "set", "has"].forEach((r) => {
1287
1287
  Object.defineProperty(e, r + n, {
1288
1288
  value: function(o, s, i) {
@@ -1302,20 +1302,20 @@ let xt = class {
1302
1302
  const d = vr(c);
1303
1303
  if (!d)
1304
1304
  throw new Error("header name must be a non-empty string");
1305
- const h = k.findKey(o, d);
1305
+ const h = A.findKey(o, d);
1306
1306
  (!h || o[h] === void 0 || u === !0 || u === void 0 && o[h] !== !1) && (o[h || c] = ho(a));
1307
1307
  }
1308
- const i = (a, c) => k.forEach(a, (u, d) => s(u, d, c));
1309
- if (k.isPlainObject(t) || t instanceof this.constructor)
1308
+ const i = (a, c) => A.forEach(a, (u, d) => s(u, d, c));
1309
+ if (A.isPlainObject(t) || t instanceof this.constructor)
1310
1310
  i(t, n);
1311
- else if (k.isString(t) && (t = t.trim()) && !xg(t))
1311
+ else if (A.isString(t) && (t = t.trim()) && !xg(t))
1312
1312
  i(mg(t), n);
1313
- else if (k.isObject(t) && k.isIterable(t)) {
1313
+ else if (A.isObject(t) && A.isIterable(t)) {
1314
1314
  let a = {}, c, u;
1315
1315
  for (const d of t) {
1316
- if (!k.isArray(d))
1316
+ if (!A.isArray(d))
1317
1317
  throw TypeError("Object iterator must return a key-value pair");
1318
- a[u = d[0]] = (c = a[u]) ? k.isArray(c) ? [...c, d[1]] : [c, d[1]] : d[1];
1318
+ a[u = d[0]] = (c = a[u]) ? A.isArray(c) ? [...c, d[1]] : [c, d[1]] : d[1];
1319
1319
  }
1320
1320
  i(a, n);
1321
1321
  } else
@@ -1324,16 +1324,16 @@ let xt = class {
1324
1324
  }
1325
1325
  get(t, n) {
1326
1326
  if (t = vr(t), t) {
1327
- const r = k.findKey(this, t);
1327
+ const r = A.findKey(this, t);
1328
1328
  if (r) {
1329
1329
  const o = this[r];
1330
1330
  if (!n)
1331
1331
  return o;
1332
1332
  if (n === !0)
1333
1333
  return gg(o);
1334
- if (k.isFunction(n))
1334
+ if (A.isFunction(n))
1335
1335
  return n.call(this, o, r);
1336
- if (k.isRegExp(n))
1336
+ if (A.isRegExp(n))
1337
1337
  return n.exec(o);
1338
1338
  throw new TypeError("parser must be boolean|regexp|function");
1339
1339
  }
@@ -1341,7 +1341,7 @@ let xt = class {
1341
1341
  }
1342
1342
  has(t, n) {
1343
1343
  if (t = vr(t), t) {
1344
- const r = k.findKey(this, t);
1344
+ const r = A.findKey(this, t);
1345
1345
  return !!(r && this[r] !== void 0 && (!n || _s(this, this[r], r, n)));
1346
1346
  }
1347
1347
  return !1;
@@ -1351,11 +1351,11 @@ let xt = class {
1351
1351
  let o = !1;
1352
1352
  function s(i) {
1353
1353
  if (i = vr(i), i) {
1354
- const a = k.findKey(r, i);
1354
+ const a = A.findKey(r, i);
1355
1355
  a && (!n || _s(r, r[a], a, n)) && (delete r[a], o = !0);
1356
1356
  }
1357
1357
  }
1358
- return k.isArray(t) ? t.forEach(s) : s(t), o;
1358
+ return A.isArray(t) ? t.forEach(s) : s(t), o;
1359
1359
  }
1360
1360
  clear(t) {
1361
1361
  const n = Object.keys(this);
@@ -1368,8 +1368,8 @@ let xt = class {
1368
1368
  }
1369
1369
  normalize(t) {
1370
1370
  const n = this, r = {};
1371
- return k.forEach(this, (o, s) => {
1372
- const i = k.findKey(r, s);
1371
+ return A.forEach(this, (o, s) => {
1372
+ const i = A.findKey(r, s);
1373
1373
  if (i) {
1374
1374
  n[i] = ho(o), delete n[s];
1375
1375
  return;
@@ -1383,8 +1383,8 @@ let xt = class {
1383
1383
  }
1384
1384
  toJSON(t) {
1385
1385
  const n = /* @__PURE__ */ Object.create(null);
1386
- return k.forEach(this, (r, o) => {
1387
- r != null && r !== !1 && (n[o] = t && k.isArray(r) ? r.join(", ") : r);
1386
+ return A.forEach(this, (r, o) => {
1387
+ r != null && r !== !1 && (n[o] = t && A.isArray(r) ? r.join(", ") : r);
1388
1388
  }), n;
1389
1389
  }
1390
1390
  [Symbol.iterator]() {
@@ -1415,11 +1415,11 @@ let xt = class {
1415
1415
  const a = vr(i);
1416
1416
  r[a] || (bg(o, i), r[a] = !0);
1417
1417
  }
1418
- return k.isArray(t) ? t.forEach(s) : s(t), this;
1418
+ return A.isArray(t) ? t.forEach(s) : s(t), this;
1419
1419
  }
1420
1420
  };
1421
1421
  xt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1422
- k.reduceDescriptors(xt.prototype, ({ value: e }, t) => {
1422
+ A.reduceDescriptors(xt.prototype, ({ value: e }, t) => {
1423
1423
  let n = t[0].toUpperCase() + t.slice(1);
1424
1424
  return {
1425
1425
  get: () => e,
@@ -1428,11 +1428,11 @@ k.reduceDescriptors(xt.prototype, ({ value: e }, t) => {
1428
1428
  }
1429
1429
  };
1430
1430
  });
1431
- k.freezeMethods(xt);
1431
+ A.freezeMethods(xt);
1432
1432
  function Os(e, t) {
1433
1433
  const n = this || Wr, r = t || n, o = xt.from(r.headers);
1434
1434
  let s = r.data;
1435
- return k.forEach(e, function(a) {
1435
+ return A.forEach(e, function(a) {
1436
1436
  s = a.call(n, s, o.normalize(), t ? t.status : void 0);
1437
1437
  }), o.normalize(), s;
1438
1438
  }
@@ -1442,7 +1442,7 @@ function $c(e) {
1442
1442
  function rr(e, t, n) {
1443
1443
  be.call(this, e ?? "canceled", be.ERR_CANCELED, t, n), this.name = "CanceledError";
1444
1444
  }
1445
- k.inherits(rr, be, {
1445
+ A.inherits(rr, be, {
1446
1446
  __CANCEL__: !0
1447
1447
  });
1448
1448
  function Hc(e, t, n) {
@@ -1471,8 +1471,8 @@ function yg(e, t) {
1471
1471
  m += n[h++], h = h % e;
1472
1472
  if (o = (o + 1) % e, o === s && (s = (s + 1) % e), u - i < t)
1473
1473
  return;
1474
- const x = d && u - d;
1475
- return x ? Math.round(m * 1e3 / x) : void 0;
1474
+ const v = d && u - d;
1475
+ return v ? Math.round(m * 1e3 / v) : void 0;
1476
1476
  };
1477
1477
  }
1478
1478
  function Sg(e, t) {
@@ -1513,7 +1513,7 @@ const Ao = (e, t, n = 3) => {
1513
1513
  total: e,
1514
1514
  loaded: r
1515
1515
  }), t[1]];
1516
- }, ol = (e) => (...t) => k.asap(() => e(...t)), Cg = lt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, lt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1516
+ }, ol = (e) => (...t) => A.asap(() => e(...t)), Cg = lt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, lt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1517
1517
  new URL(lt.origin),
1518
1518
  lt.navigator && /(msie|trident)/i.test(lt.navigator.userAgent)
1519
1519
  ) : () => !0, Tg = lt.hasStandardBrowserEnv ? (
@@ -1521,7 +1521,7 @@ const Ao = (e, t, n = 3) => {
1521
1521
  {
1522
1522
  write(e, t, n, r, o, s) {
1523
1523
  const i = [e + "=" + encodeURIComponent(t)];
1524
- k.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), k.isString(r) && i.push("path=" + r), k.isString(o) && i.push("domain=" + o), s === !0 && i.push("secure"), document.cookie = i.join("; ");
1524
+ A.isNumber(n) && i.push("expires=" + new Date(n).toGMTString()), A.isString(r) && i.push("path=" + r), A.isString(o) && i.push("domain=" + o), s === !0 && i.push("secure"), document.cookie = i.join("; ");
1525
1525
  },
1526
1526
  read(e) {
1527
1527
  const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
@@ -1558,21 +1558,21 @@ function En(e, t) {
1558
1558
  t = t || {};
1559
1559
  const n = {};
1560
1560
  function r(u, d, h, m) {
1561
- return k.isPlainObject(u) && k.isPlainObject(d) ? k.merge.call({ caseless: m }, u, d) : k.isPlainObject(d) ? k.merge({}, d) : k.isArray(d) ? d.slice() : d;
1561
+ return A.isPlainObject(u) && A.isPlainObject(d) ? A.merge.call({ caseless: m }, u, d) : A.isPlainObject(d) ? A.merge({}, d) : A.isArray(d) ? d.slice() : d;
1562
1562
  }
1563
1563
  function o(u, d, h, m) {
1564
- if (k.isUndefined(d)) {
1565
- if (!k.isUndefined(u))
1564
+ if (A.isUndefined(d)) {
1565
+ if (!A.isUndefined(u))
1566
1566
  return r(void 0, u, h, m);
1567
1567
  } else return r(u, d, h, m);
1568
1568
  }
1569
1569
  function s(u, d) {
1570
- if (!k.isUndefined(d))
1570
+ if (!A.isUndefined(d))
1571
1571
  return r(void 0, d);
1572
1572
  }
1573
1573
  function i(u, d) {
1574
- if (k.isUndefined(d)) {
1575
- if (!k.isUndefined(u))
1574
+ if (A.isUndefined(d)) {
1575
+ if (!A.isUndefined(u))
1576
1576
  return r(void 0, u);
1577
1577
  } else return r(void 0, d);
1578
1578
  }
@@ -1613,9 +1613,9 @@ function En(e, t) {
1613
1613
  validateStatus: a,
1614
1614
  headers: (u, d, h) => o(sl(u), sl(d), h, !0)
1615
1615
  };
1616
- return k.forEach(Object.keys({ ...e, ...t }), function(d) {
1616
+ return A.forEach(Object.keys({ ...e, ...t }), function(d) {
1617
1617
  const h = c[d] || o, m = h(e[d], t[d], d);
1618
- k.isUndefined(m) && h !== a || (n[d] = m);
1618
+ A.isUndefined(m) && h !== a || (n[d] = m);
1619
1619
  }), n;
1620
1620
  }
1621
1621
  const Uc = (e) => {
@@ -1624,17 +1624,17 @@ const Uc = (e) => {
1624
1624
  if (t.headers = i = xt.from(i), t.url = Lc(zc(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1625
1625
  "Authorization",
1626
1626
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1627
- ), k.isFormData(n)) {
1627
+ ), A.isFormData(n)) {
1628
1628
  if (lt.hasStandardBrowserEnv || lt.hasStandardBrowserWebWorkerEnv)
1629
1629
  i.setContentType(void 0);
1630
- else if (k.isFunction(n.getHeaders)) {
1630
+ else if (A.isFunction(n.getHeaders)) {
1631
1631
  const c = n.getHeaders(), u = ["content-type", "content-length"];
1632
1632
  Object.entries(c).forEach(([d, h]) => {
1633
1633
  u.includes(d.toLowerCase()) && i.set(d, h);
1634
1634
  });
1635
1635
  }
1636
1636
  }
1637
- if (lt.hasStandardBrowserEnv && (r && k.isFunction(r) && (r = r(t)), r || r !== !1 && Cg(t.url))) {
1637
+ if (lt.hasStandardBrowserEnv && (r && A.isFunction(r) && (r = r(t)), r || r !== !1 && Cg(t.url))) {
1638
1638
  const c = o && s && Tg.read(s);
1639
1639
  c && i.set(o, c);
1640
1640
  }
@@ -1644,9 +1644,9 @@ const Uc = (e) => {
1644
1644
  const o = Uc(e);
1645
1645
  let s = o.data;
1646
1646
  const i = xt.from(o.headers).normalize();
1647
- let { responseType: a, onUploadProgress: c, onDownloadProgress: u } = o, d, h, m, x, v;
1647
+ let { responseType: a, onUploadProgress: c, onDownloadProgress: u } = o, d, h, m, v, x;
1648
1648
  function g() {
1649
- x && x(), v && v(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
1649
+ v && v(), x && x(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
1650
1650
  }
1651
1651
  let p = new XMLHttpRequest();
1652
1652
  p.open(o.method.toUpperCase(), o.url, !0), p.timeout = o.timeout;
@@ -1685,9 +1685,9 @@ const Uc = (e) => {
1685
1685
  e,
1686
1686
  p
1687
1687
  )), p = null;
1688
- }, s === void 0 && i.setContentType(null), "setRequestHeader" in p && k.forEach(i.toJSON(), function(N, S) {
1688
+ }, s === void 0 && i.setContentType(null), "setRequestHeader" in p && A.forEach(i.toJSON(), function(N, S) {
1689
1689
  p.setRequestHeader(S, N);
1690
- }), k.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), a && a !== "json" && (p.responseType = o.responseType), u && ([m, v] = Ao(u, !0), p.addEventListener("progress", m)), c && p.upload && ([h, x] = Ao(c), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", x)), (o.cancelToken || o.signal) && (d = (y) => {
1690
+ }), A.isUndefined(o.withCredentials) || (p.withCredentials = !!o.withCredentials), a && a !== "json" && (p.responseType = o.responseType), u && ([m, x] = Ao(u, !0), p.addEventListener("progress", m)), c && p.upload && ([h, v] = Ao(c), p.upload.addEventListener("progress", h), p.upload.addEventListener("loadend", v)), (o.cancelToken || o.signal) && (d = (y) => {
1691
1691
  p && (r(!y || y.type ? new rr(null, e, p) : y), p.abort(), p = null);
1692
1692
  }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
1693
1693
  const b = wg(o.url);
@@ -1718,7 +1718,7 @@ const Uc = (e) => {
1718
1718
  };
1719
1719
  e.forEach((u) => u.addEventListener("abort", s));
1720
1720
  const { signal: c } = r;
1721
- return c.unsubscribe = () => k.asap(a), c;
1721
+ return c.unsubscribe = () => A.asap(a), c;
1722
1722
  }
1723
1723
  }, kg = function* (e, t) {
1724
1724
  let n = e.byteLength;
@@ -1777,65 +1777,65 @@ const Uc = (e) => {
1777
1777
  }, {
1778
1778
  highWaterMark: 2
1779
1779
  });
1780
- }, al = 64 * 1024, { isFunction: eo } = k, _g = (({ Request: e, Response: t }) => ({
1780
+ }, al = 64 * 1024, { isFunction: eo } = A, _g = (({ Request: e, Response: t }) => ({
1781
1781
  Request: e,
1782
1782
  Response: t
1783
- }))(k.global), {
1783
+ }))(A.global), {
1784
1784
  ReadableStream: ll,
1785
1785
  TextEncoder: cl
1786
- } = k.global, ul = (e, ...t) => {
1786
+ } = A.global, ul = (e, ...t) => {
1787
1787
  try {
1788
1788
  return !!e(...t);
1789
1789
  } catch {
1790
1790
  return !1;
1791
1791
  }
1792
1792
  }, Og = (e) => {
1793
- e = k.merge.call({
1793
+ e = A.merge.call({
1794
1794
  skipUndefined: !0
1795
1795
  }, _g, e);
1796
1796
  const { fetch: t, Request: n, Response: r } = e, o = t ? eo(t) : typeof fetch == "function", s = eo(n), i = eo(r);
1797
1797
  if (!o)
1798
1798
  return !1;
1799
- const a = o && eo(ll), c = o && (typeof cl == "function" ? /* @__PURE__ */ ((v) => (g) => v.encode(g))(new cl()) : async (v) => new Uint8Array(await new n(v).arrayBuffer())), u = s && a && ul(() => {
1800
- let v = !1;
1799
+ const a = o && eo(ll), c = o && (typeof cl == "function" ? /* @__PURE__ */ ((x) => (g) => x.encode(g))(new cl()) : async (x) => new Uint8Array(await new n(x).arrayBuffer())), u = s && a && ul(() => {
1800
+ let x = !1;
1801
1801
  const g = new n(lt.origin, {
1802
1802
  body: new ll(),
1803
1803
  method: "POST",
1804
1804
  get duplex() {
1805
- return v = !0, "half";
1805
+ return x = !0, "half";
1806
1806
  }
1807
1807
  }).headers.has("Content-Type");
1808
- return v && !g;
1809
- }), d = i && a && ul(() => k.isReadableStream(new r("").body)), h = {
1810
- stream: d && ((v) => v.body)
1808
+ return x && !g;
1809
+ }), d = i && a && ul(() => A.isReadableStream(new r("").body)), h = {
1810
+ stream: d && ((x) => x.body)
1811
1811
  };
1812
- o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((v) => {
1813
- !h[v] && (h[v] = (g, p) => {
1814
- let w = g && g[v];
1812
+ o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((x) => {
1813
+ !h[x] && (h[x] = (g, p) => {
1814
+ let w = g && g[x];
1815
1815
  if (w)
1816
1816
  return w.call(g);
1817
- throw new be(`Response type '${v}' is not supported`, be.ERR_NOT_SUPPORT, p);
1817
+ throw new be(`Response type '${x}' is not supported`, be.ERR_NOT_SUPPORT, p);
1818
1818
  });
1819
1819
  });
1820
- const m = async (v) => {
1821
- if (v == null)
1820
+ const m = async (x) => {
1821
+ if (x == null)
1822
1822
  return 0;
1823
- if (k.isBlob(v))
1824
- return v.size;
1825
- if (k.isSpecCompliantForm(v))
1823
+ if (A.isBlob(x))
1824
+ return x.size;
1825
+ if (A.isSpecCompliantForm(x))
1826
1826
  return (await new n(lt.origin, {
1827
1827
  method: "POST",
1828
- body: v
1828
+ body: x
1829
1829
  }).arrayBuffer()).byteLength;
1830
- if (k.isArrayBufferView(v) || k.isArrayBuffer(v))
1831
- return v.byteLength;
1832
- if (k.isURLSearchParams(v) && (v = v + ""), k.isString(v))
1833
- return (await c(v)).byteLength;
1834
- }, x = async (v, g) => {
1835
- const p = k.toFiniteNumber(v.getContentLength());
1830
+ if (A.isArrayBufferView(x) || A.isArrayBuffer(x))
1831
+ return x.byteLength;
1832
+ if (A.isURLSearchParams(x) && (x = x + ""), A.isString(x))
1833
+ return (await c(x)).byteLength;
1834
+ }, v = async (x, g) => {
1835
+ const p = A.toFiniteNumber(x.getContentLength());
1836
1836
  return p ?? m(g);
1837
1837
  };
1838
- return async (v) => {
1838
+ return async (x) => {
1839
1839
  let {
1840
1840
  url: g,
1841
1841
  method: p,
@@ -1848,8 +1848,8 @@ const Uc = (e) => {
1848
1848
  responseType: C,
1849
1849
  headers: R,
1850
1850
  withCredentials: I = "same-origin",
1851
- fetchOptions: A
1852
- } = Uc(v), M = t || fetch;
1851
+ fetchOptions: k
1852
+ } = Uc(x), M = t || fetch;
1853
1853
  C = C ? (C + "").toLowerCase() : "text";
1854
1854
  let H = jg([b, y && y.toAbortSignal()], N), U = null;
1855
1855
  const j = H && H.unsubscribe && (() => {
@@ -1857,13 +1857,13 @@ const Uc = (e) => {
1857
1857
  });
1858
1858
  let $;
1859
1859
  try {
1860
- if (T && u && p !== "get" && p !== "head" && ($ = await x(R, w)) !== 0) {
1860
+ if (T && u && p !== "get" && p !== "head" && ($ = await v(R, w)) !== 0) {
1861
1861
  let Z = new n(g, {
1862
1862
  method: "POST",
1863
1863
  body: w,
1864
1864
  duplex: "half"
1865
1865
  }), q;
1866
- if (k.isFormData(w) && (q = Z.headers.get("content-type")) && R.setContentType(q), Z.body) {
1866
+ if (A.isFormData(w) && (q = Z.headers.get("content-type")) && R.setContentType(q), Z.body) {
1867
1867
  const [F, Y] = rl(
1868
1868
  $,
1869
1869
  Ao(ol(T))
@@ -1871,9 +1871,9 @@ const Uc = (e) => {
1871
1871
  w = il(Z.body, al, F, Y);
1872
1872
  }
1873
1873
  }
1874
- k.isString(I) || (I = I ? "include" : "omit");
1874
+ A.isString(I) || (I = I ? "include" : "omit");
1875
1875
  const L = s && "credentials" in n.prototype, Q = {
1876
- ...A,
1876
+ ...k,
1877
1877
  signal: H,
1878
1878
  method: p.toUpperCase(),
1879
1879
  headers: R.normalize().toJSON(),
@@ -1882,14 +1882,14 @@ const Uc = (e) => {
1882
1882
  credentials: L ? I : void 0
1883
1883
  };
1884
1884
  U = s && new n(g, Q);
1885
- let O = await (s ? M(U, A) : M(g, Q));
1885
+ let O = await (s ? M(U, k) : M(g, Q));
1886
1886
  const _ = d && (C === "stream" || C === "response");
1887
1887
  if (d && (S || _ && j)) {
1888
1888
  const Z = {};
1889
1889
  ["status", "statusText", "headers"].forEach((ye) => {
1890
1890
  Z[ye] = O[ye];
1891
1891
  });
1892
- const q = k.toFiniteNumber(O.headers.get("content-length")), [F, Y] = S && rl(
1892
+ const q = A.toFiniteNumber(O.headers.get("content-length")), [F, Y] = S && rl(
1893
1893
  q,
1894
1894
  Ao(ol(S), !0)
1895
1895
  ) || [];
@@ -1901,24 +1901,24 @@ const Uc = (e) => {
1901
1901
  );
1902
1902
  }
1903
1903
  C = C || "text";
1904
- let G = await h[k.findKey(h, C) || "text"](O, v);
1904
+ let G = await h[A.findKey(h, C) || "text"](O, x);
1905
1905
  return !_ && j && j(), await new Promise((Z, q) => {
1906
1906
  Hc(Z, q, {
1907
1907
  data: G,
1908
1908
  headers: xt.from(O.headers),
1909
1909
  status: O.status,
1910
1910
  statusText: O.statusText,
1911
- config: v,
1911
+ config: x,
1912
1912
  request: U
1913
1913
  });
1914
1914
  });
1915
1915
  } catch (L) {
1916
1916
  throw j && j(), L && L.name === "TypeError" && /Load failed|fetch/i.test(L.message) ? Object.assign(
1917
- new be("Network Error", be.ERR_NETWORK, v, U),
1917
+ new be("Network Error", be.ERR_NETWORK, x, U),
1918
1918
  {
1919
1919
  cause: L.cause || L
1920
1920
  }
1921
- ) : be.from(L, L && L.code, v, U);
1921
+ ) : be.from(L, L && L.code, x, U);
1922
1922
  }
1923
1923
  };
1924
1924
  }, Mg = /* @__PURE__ */ new Map(), Wc = (e) => {
@@ -1941,7 +1941,7 @@ const ui = {
1941
1941
  get: Wc
1942
1942
  }
1943
1943
  };
1944
- k.forEach(ui, (e, t) => {
1944
+ A.forEach(ui, (e, t) => {
1945
1945
  if (e) {
1946
1946
  try {
1947
1947
  Object.defineProperty(e, "name", { value: t });
@@ -1950,9 +1950,9 @@ k.forEach(ui, (e, t) => {
1950
1950
  Object.defineProperty(e, "adapterName", { value: t });
1951
1951
  }
1952
1952
  });
1953
- const dl = (e) => `- ${e}`, Dg = (e) => k.isFunction(e) || e === null || e === !1, Vc = {
1953
+ const dl = (e) => `- ${e}`, Dg = (e) => A.isFunction(e) || e === null || e === !1, Vc = {
1954
1954
  getAdapter: (e, t) => {
1955
- e = k.isArray(e) ? e : [e];
1955
+ e = A.isArray(e) ? e : [e];
1956
1956
  const { length: n } = e;
1957
1957
  let r, o;
1958
1958
  const s = {};
@@ -1961,7 +1961,7 @@ const dl = (e) => `- ${e}`, Dg = (e) => k.isFunction(e) || e === null || e === !
1961
1961
  let a;
1962
1962
  if (o = r, !Dg(r) && (o = ui[(a = String(r)).toLowerCase()], o === void 0))
1963
1963
  throw new be(`Unknown adapter '${a}'`);
1964
- if (o && (k.isFunction(o) || (o = o.get(t))))
1964
+ if (o && (A.isFunction(o) || (o = o.get(t))))
1965
1965
  break;
1966
1966
  s[a || "#" + i] = o;
1967
1967
  }
@@ -2091,7 +2091,7 @@ let Tn = class {
2091
2091
  silentJSONParsing: Vt.transitional(Vt.boolean),
2092
2092
  forcedJSONParsing: Vt.transitional(Vt.boolean),
2093
2093
  clarifyTimeoutError: Vt.transitional(Vt.boolean)
2094
- }, !1), o != null && (k.isFunction(o) ? n.paramsSerializer = {
2094
+ }, !1), o != null && (A.isFunction(o) ? n.paramsSerializer = {
2095
2095
  serialize: o
2096
2096
  } : po.assertOptions(o, {
2097
2097
  encode: Vt.function,
@@ -2100,14 +2100,14 @@ let Tn = class {
2100
2100
  baseUrl: Vt.spelling("baseURL"),
2101
2101
  withXsrfToken: Vt.spelling("withXSRFToken")
2102
2102
  }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
2103
- let i = s && k.merge(
2103
+ let i = s && A.merge(
2104
2104
  s.common,
2105
2105
  s[n.method]
2106
2106
  );
2107
- s && k.forEach(
2107
+ s && A.forEach(
2108
2108
  ["delete", "get", "head", "post", "put", "patch", "common"],
2109
- (v) => {
2110
- delete s[v];
2109
+ (x) => {
2110
+ delete s[x];
2111
2111
  }
2112
2112
  ), n.headers = xt.concat(i, s);
2113
2113
  const a = [];
@@ -2121,26 +2121,26 @@ let Tn = class {
2121
2121
  });
2122
2122
  let d, h = 0, m;
2123
2123
  if (!c) {
2124
- const v = [fl.bind(this), void 0];
2125
- for (v.unshift(...a), v.push(...u), m = v.length, d = Promise.resolve(n); h < m; )
2126
- d = d.then(v[h++], v[h++]);
2124
+ const x = [fl.bind(this), void 0];
2125
+ for (x.unshift(...a), x.push(...u), m = x.length, d = Promise.resolve(n); h < m; )
2126
+ d = d.then(x[h++], x[h++]);
2127
2127
  return d;
2128
2128
  }
2129
2129
  m = a.length;
2130
- let x = n;
2130
+ let v = n;
2131
2131
  for (; h < m; ) {
2132
- const v = a[h++], g = a[h++];
2132
+ const x = a[h++], g = a[h++];
2133
2133
  try {
2134
- x = v(x);
2134
+ v = x(v);
2135
2135
  } catch (p) {
2136
2136
  g.call(this, p);
2137
2137
  break;
2138
2138
  }
2139
2139
  }
2140
2140
  try {
2141
- d = fl.call(this, x);
2142
- } catch (v) {
2143
- return Promise.reject(v);
2141
+ d = fl.call(this, v);
2142
+ } catch (x) {
2143
+ return Promise.reject(x);
2144
2144
  }
2145
2145
  for (h = 0, m = u.length; h < m; )
2146
2146
  d = d.then(u[h++], u[h++]);
@@ -2152,7 +2152,7 @@ let Tn = class {
2152
2152
  return Lc(n, t.params, t.paramsSerializer);
2153
2153
  }
2154
2154
  };
2155
- k.forEach(["delete", "get", "head", "options"], function(t) {
2155
+ A.forEach(["delete", "get", "head", "options"], function(t) {
2156
2156
  Tn.prototype[t] = function(n, r) {
2157
2157
  return this.request(En(r || {}, {
2158
2158
  method: t,
@@ -2161,7 +2161,7 @@ k.forEach(["delete", "get", "head", "options"], function(t) {
2161
2161
  }));
2162
2162
  };
2163
2163
  });
2164
- k.forEach(["post", "put", "patch"], function(t) {
2164
+ A.forEach(["post", "put", "patch"], function(t) {
2165
2165
  function n(r) {
2166
2166
  return function(s, i, a) {
2167
2167
  return this.request(En(a || {}, {
@@ -2255,7 +2255,7 @@ function Bg(e) {
2255
2255
  };
2256
2256
  }
2257
2257
  function $g(e) {
2258
- return k.isObject(e) && e.isAxiosError === !0;
2258
+ return A.isObject(e) && e.isAxiosError === !0;
2259
2259
  }
2260
2260
  const di = {
2261
2261
  Continue: 100,
@@ -2327,7 +2327,7 @@ Object.entries(di).forEach(([e, t]) => {
2327
2327
  });
2328
2328
  function Yc(e) {
2329
2329
  const t = new Tn(e), n = Rc(Tn.prototype.request, t);
2330
- return k.extend(n, Tn.prototype, t, { allOwnKeys: !0 }), k.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2330
+ return A.extend(n, Tn.prototype, t, { allOwnKeys: !0 }), A.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
2331
2331
  return Yc(En(e, o));
2332
2332
  }, n;
2333
2333
  }
@@ -2347,7 +2347,7 @@ Je.spread = Bg;
2347
2347
  Je.isAxiosError = $g;
2348
2348
  Je.mergeConfig = En;
2349
2349
  Je.AxiosHeaders = xt;
2350
- Je.formToJSON = (e) => Bc(k.isHTMLForm(e) ? new FormData(e) : e);
2350
+ Je.formToJSON = (e) => Bc(A.isHTMLForm(e) ? new FormData(e) : e);
2351
2351
  Je.getAdapter = Vc.getAdapter;
2352
2352
  Je.HttpStatusCode = di;
2353
2353
  Je.default = Je;
@@ -2504,19 +2504,19 @@ class Gg {
2504
2504
  }
2505
2505
  const Nn = new Gg();
2506
2506
  function Kg(e = {}) {
2507
- const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = fe(e.token ?? null), s = Ye(e.headers ?? {}), [i, a] = fe(!1), [c, u] = fe(null), [d, h] = fe(""), [m, x] = fe(null), v = Ye(null), g = Ke((y) => {
2507
+ const t = e.baseUrl ?? "/api/chat", n = e.streamPath ?? "/runs/stream", [r, o] = fe(e.token ?? null), s = Ke(e.headers ?? {}), [i, a] = fe(!1), [c, u] = fe(null), [d, h] = fe(""), [m, v] = fe(null), x = Ke(null), g = Ge((y) => {
2508
2508
  o(y);
2509
- }, []), p = Ke(() => {
2509
+ }, []), p = Ge(() => {
2510
2510
  var y;
2511
- (y = v.current) == null || y.abort(), v.current = null, a(!1);
2512
- }, []), w = Ke(() => {
2513
- h(""), x(null), u(null);
2514
- }, []), b = Ke(
2511
+ (y = x.current) == null || y.abort(), x.current = null, a(!1);
2512
+ }, []), w = Ge(() => {
2513
+ h(""), v(null), u(null);
2514
+ }, []), b = Ge(
2515
2515
  (y, N, S) => {
2516
- v.current && (v.current.abort(), v.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
2516
+ x.current && (x.current.abort(), x.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
2517
2517
  const T = new AbortController();
2518
- return v.current = T, (async () => {
2519
- var I, A, M, H, U;
2518
+ return x.current = T, (async () => {
2519
+ var I, k, M, H, U;
2520
2520
  const C = (() => {
2521
2521
  var j;
2522
2522
  try {
@@ -2545,7 +2545,7 @@ function Kg(e = {}) {
2545
2545
  const Z = window.__AUTH_TOKEN__, q = ((I = window.localStorage) == null ? void 0 : I.getItem("authToken")) || null;
2546
2546
  let F = null;
2547
2547
  try {
2548
- const ye = (A = window.localStorage) == null ? void 0 : A.getItem("chat-settings");
2548
+ const ye = (k = window.localStorage) == null ? void 0 : k.getItem("chat-settings");
2549
2549
  ye && (F = ((M = JSON.parse(ye)) == null ? void 0 : M.apiKey) || null);
2550
2550
  } catch {
2551
2551
  }
@@ -2608,7 +2608,7 @@ function Kg(e = {}) {
2608
2608
  const K = ce.delta.filter((P) => P.type === "text").map((P) => P.text).join("");
2609
2609
  K && e.autoAppendAssistant !== !1 && (_ += K);
2610
2610
  } else
2611
- _ && (h((K) => K + _), _ = ""), N == null || N(ce), ce.type === "checkpoint" ? x(ce.checkpointId) : ce.type === "error" && u(ce.message);
2611
+ _ && (h((K) => K + _), _ = ""), N == null || N(ce), ce.type === "checkpoint" ? v(ce.checkpointId) : ce.type === "error" && u(ce.message);
2612
2612
  }
2613
2613
  }
2614
2614
  _ && h((G) => G + _);
@@ -2617,15 +2617,15 @@ function Kg(e = {}) {
2617
2617
  const $ = (j == null ? void 0 : j.message) || String(j);
2618
2618
  C && console.debug("[use-chat] error:", $), u($), (U = S == null ? void 0 : S.onError) == null || U.call(S, $);
2619
2619
  } finally {
2620
- a(!1), v.current = null;
2620
+ a(!1), x.current = null;
2621
2621
  }
2622
2622
  })(), { close: () => T.abort() };
2623
2623
  },
2624
2624
  [t, r, e.autoAppendAssistant]
2625
2625
  );
2626
- return $e(() => () => {
2626
+ return Fe(() => () => {
2627
2627
  var y;
2628
- return (y = v.current) == null ? void 0 : y.abort();
2628
+ return (y = x.current) == null ? void 0 : y.abort();
2629
2629
  }, []), {
2630
2630
  isStreaming: i,
2631
2631
  error: c,
@@ -2707,16 +2707,16 @@ function Jg(e, t) {
2707
2707
  }
2708
2708
  }
2709
2709
  function Zg(e = []) {
2710
- const [t, n] = Dp(Jg, { ...Xg, messages: e }), r = Ye([]), o = Ye(null), s = Ye(null), i = Ke(() => {
2710
+ const [t, n] = Dp(Jg, { ...Xg, messages: e }), r = Ke([]), o = Ke(null), s = Ke(null), i = Ge(() => {
2711
2711
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), o.current = null, s.current = null;
2712
2712
  const d = r.current;
2713
2713
  d.length && (r.current = [], n({ type: "batch", payload: { events: d } }));
2714
- }, []), a = Ke(() => {
2714
+ }, []), a = Ge(() => {
2715
2715
  typeof window < "u" && typeof window.requestAnimationFrame == "function" ? o.current === null && (o.current = window.requestAnimationFrame(() => i())) : s.current === null && (s.current = setTimeout(i, 8));
2716
- }, [i]), c = Ke((d) => {
2716
+ }, [i]), c = Ge((d) => {
2717
2717
  r.current.push(d), a();
2718
2718
  }, [a]);
2719
- $e(() => () => {
2719
+ Fe(() => () => {
2720
2720
  o.current !== null && typeof window < "u" && window.cancelAnimationFrame(o.current), s.current !== null && clearTimeout(s.current), r.current = [];
2721
2721
  }, []);
2722
2722
  const u = un(() => ({
@@ -2936,13 +2936,13 @@ async function ix(e, t = [], n, r, o, s) {
2936
2936
  const qc = wc(null);
2937
2937
  function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialThreadId: o = null, historyPageSize: s, autoLoadInitial: i = !0, enableFileAgentRouting: a = !1, fileAgentId: c = "invoice_reader" }) {
2938
2938
  const u = Nn;
2939
- $e(() => {
2939
+ Fe(() => {
2940
2940
  t && u.updateConfig({
2941
2941
  baseUrl: t.baseUrl,
2942
2942
  authToken: t.apiKey
2943
2943
  });
2944
2944
  }, [u, t]);
2945
- const { isStreaming: d, error: h, stream: m, stop: x, setToken: v } = Kg({
2945
+ const { isStreaming: d, error: h, stream: m, stop: v, setToken: x } = Kg({
2946
2946
  baseUrl: u.baseUrl,
2947
2947
  token: null,
2948
2948
  // we update with setStreamToken below when the API tells us the token
@@ -2951,32 +2951,32 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2951
2951
  // Ensure the path matches the chat endpoint
2952
2952
  streamPath: "/chat/runs/stream"
2953
2953
  }), [g, p] = fe(() => typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
2954
- $e(() => {
2955
- v(typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
2954
+ Fe(() => {
2955
+ x(typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
2956
2956
  const J = u.onTokenChange((ae) => {
2957
- p(ae), v(ae);
2957
+ p(ae), x(ae);
2958
2958
  });
2959
2959
  return () => {
2960
2960
  J();
2961
2961
  };
2962
- }, [u, v]);
2963
- const w = Ke((J) => {
2962
+ }, [u, x]);
2963
+ const w = Ge((J) => {
2964
2964
  u.setAuthToken(J);
2965
- }, [u]), { state: b, seed: y, prepend: N, pushUser: S, onEvent: T, reset: C } = Zg(), R = s && s > 0 ? s : 6, [I, A] = fe(!1), [M, H] = fe(!1), [U, j] = fe(null), [$, L] = fe(void 0), [Q, O] = fe(void 0), _ = Ke(
2965
+ }, [u]), { state: b, seed: y, prepend: N, pushUser: S, onEvent: T, reset: C } = Zg(), R = s && s > 0 ? s : 6, [I, k] = fe(!1), [M, H] = fe(!1), [U, j] = fe(null), [$, L] = fe(void 0), [Q, O] = fe(void 0), _ = Ge(
2966
2966
  (J, ae) => {
2967
- const Le = Array.isArray(J == null ? void 0 : J.messages) ? J.messages : [];
2968
- ae === "replace" ? y(Le, {
2967
+ const $e = Array.isArray(J == null ? void 0 : J.messages) ? J.messages : [];
2968
+ ae === "replace" ? y($e, {
2969
2969
  checkpointId: (J == null ? void 0 : J.checkpointId) ?? null,
2970
2970
  checkpointNs: (J == null ? void 0 : J.checkpointNs) ?? null
2971
- }) : ae === "prepend" && Le.length ? (console.log("[ChatProvider] Calling prepend with", Le.length, "messages"), N(Le)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), j((J == null ? void 0 : J.nextCursor) ?? null), A(!!(J != null && J.hasMore)), L((Ve) => (J == null ? void 0 : J.checkpointId) ?? Ve ?? void 0), O((Ve) => (J == null ? void 0 : J.checkpointNs) ?? Ve ?? void 0);
2971
+ }) : ae === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), N($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), j((J == null ? void 0 : J.nextCursor) ?? null), k(!!(J != null && J.hasMore)), L((Ye) => (J == null ? void 0 : J.checkpointId) ?? Ye ?? void 0), O((Ye) => (J == null ? void 0 : J.checkpointNs) ?? Ye ?? void 0);
2972
2972
  },
2973
2973
  [y, N]
2974
- ), [G, Z] = fe([]), [q, F] = fe(null), Y = Ke(async () => {
2974
+ ), [G, Z] = fe([]), [q, F] = fe(null), Y = Ge(async () => {
2975
2975
  const J = await u.listThreads();
2976
2976
  Z(J);
2977
- }, [u]), [ye, ce] = fe(!1), K = Ke(
2977
+ }, [u]), [ye, ce] = fe(!1), K = Ge(
2978
2978
  async (J) => {
2979
- const ae = (J == null ? void 0 : J.maxAttempts) ?? 5, Le = (J == null ? void 0 : J.baseDelayMs) ?? 500, Ve = (J == null ? void 0 : J.timeoutMs) ?? 2e3;
2979
+ const ae = (J == null ? void 0 : J.maxAttempts) ?? 5, $e = (J == null ? void 0 : J.baseDelayMs) ?? 500, Ye = (J == null ? void 0 : J.timeoutMs) ?? 2e3;
2980
2980
  if (!u.baseUrl) return !1;
2981
2981
  const Ze = u.baseUrl.replace(/\/+$/, ""), wt = [
2982
2982
  "/health",
@@ -2987,14 +2987,14 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2987
2987
  "/api/v2/chat/health"
2988
2988
  ], dt = async (Qe) => {
2989
2989
  try {
2990
- const at = new AbortController(), et = setTimeout(() => at.abort(), Ve), ft = await fetch(Qe, { method: "GET", signal: at.signal });
2990
+ const at = new AbortController(), et = setTimeout(() => at.abort(), Ye), ft = await fetch(Qe, { method: "GET", signal: at.signal });
2991
2991
  return clearTimeout(et), ft.ok;
2992
2992
  } catch {
2993
2993
  return !1;
2994
2994
  }
2995
2995
  }, Rt = async (Qe) => {
2996
2996
  try {
2997
- const at = new AbortController(), et = setTimeout(() => at.abort(), Ve), ft = await fetch(Qe, { method: "HEAD", signal: at.signal });
2997
+ const at = new AbortController(), et = setTimeout(() => at.abort(), Ye), ft = await fetch(Qe, { method: "HEAD", signal: at.signal });
2998
2998
  return clearTimeout(et), ft.ok;
2999
2999
  } catch {
3000
3000
  return !1;
@@ -3009,14 +3009,14 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3009
3009
  if (console.debug(`[ChatProvider] checking ${sn}`), await dt(sn) || et === "/" && await Rt(Ze + "/"))
3010
3010
  return ce(!0), !0;
3011
3011
  }
3012
- const at = Le * Math.pow(2, Qe);
3012
+ const at = $e * Math.pow(2, Qe);
3013
3013
  await new Promise((et) => setTimeout(et, at));
3014
3014
  }
3015
3015
  return ce(!1), !1;
3016
3016
  },
3017
3017
  [u.baseUrl]
3018
3018
  );
3019
- $e(() => {
3019
+ Fe(() => {
3020
3020
  let J = !0;
3021
3021
  if (!u.baseUrl) {
3022
3022
  console.debug("[ChatProvider] skipping initial refreshThreads: api.baseUrl not configured");
@@ -3033,11 +3033,11 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3033
3033
  })(), () => {
3034
3034
  J = !1;
3035
3035
  };
3036
- }, [Y, u.baseUrl, K]), $e(() => {
3036
+ }, [Y, u.baseUrl, K]), Fe(() => {
3037
3037
  r == null || r(q);
3038
3038
  }, [q, r]);
3039
- const P = Ye(null);
3040
- $e(() => {
3039
+ const P = Ke(null);
3040
+ Fe(() => {
3041
3041
  if (o && i) {
3042
3042
  if (!u.baseUrl) {
3043
3043
  console.debug("[ChatProvider] skipping initial load: api.baseUrl not configured");
@@ -3051,8 +3051,8 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3051
3051
  }));
3052
3052
  }
3053
3053
  }, [o, i, u.baseUrl, ye]);
3054
- const X = Ye(null), te = Ke(
3055
- async (J, ae, Le) => {
3054
+ const X = Ke(null), te = Ge(
3055
+ async (J, ae, $e) => {
3056
3056
  if (!u.baseUrl) {
3057
3057
  console.debug("[ChatProvider] skipping loadThread: api.baseUrl not configured");
3058
3058
  return;
@@ -3060,78 +3060,76 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3060
3060
  if (X.current !== J) {
3061
3061
  X.current = J;
3062
3062
  try {
3063
- A(!1), j(null), L(void 0), O(void 0);
3064
- const Ve = await u.getMessages({
3063
+ k(!1), j(null), L(void 0), O(void 0);
3064
+ const Ye = await u.getMessages({
3065
3065
  threadId: J,
3066
3066
  checkpointId: ae,
3067
- checkpointNs: Le,
3067
+ checkpointNs: $e,
3068
3068
  limit: R
3069
3069
  });
3070
- F(J), _(Ve, "replace");
3070
+ F(J), _(Ye, "replace");
3071
3071
  } finally {
3072
3072
  X.current = null;
3073
3073
  }
3074
3074
  }
3075
3075
  },
3076
3076
  [u, _]
3077
- ), ue = Ke(async (J) => {
3077
+ ), ue = Ge(async (J) => {
3078
3078
  const ae = await u.listCheckpoints(J);
3079
3079
  return rx(ae, J);
3080
- }, [u]), se = Ke(async (J, ae) => {
3080
+ }, [u]), se = Ge(async (J, ae) => {
3081
3081
  if (!q) throw new Error("No active thread");
3082
- A(!1), j(null), L(void 0), O(void 0);
3083
- const Le = await u.getMessages({
3082
+ k(!1), j(null), L(void 0), O(void 0);
3083
+ const $e = await u.getMessages({
3084
3084
  threadId: q,
3085
3085
  checkpointId: J,
3086
3086
  checkpointNs: ae ?? void 0,
3087
3087
  limit: R
3088
3088
  });
3089
- _(Le, "replace");
3090
- }, [u, q, _, R]), Ae = Ke(async () => {
3089
+ _($e, "replace");
3090
+ }, [u, q, _, R]), Ae = Ge(async () => {
3091
3091
  if (!q) throw new Error("No active thread");
3092
3092
  await te(q);
3093
- }, [q, te]), Pe = Ye(!1);
3094
- $e(() => {
3093
+ }, [q, te]), Pe = Ke(!1);
3094
+ Fe(() => {
3095
3095
  const J = Pe.current;
3096
- if (Pe.current = d, J && !d && q) {
3097
- const ae = b.lastCheckpointId ?? void 0, Le = b.lastCheckpointNs ?? void 0;
3098
- (async () => {
3099
- try {
3100
- const Ve = await u.getMessages({
3101
- threadId: q,
3102
- checkpointId: ae,
3103
- checkpointNs: Le,
3104
- limit: R
3105
- });
3106
- _(Ve, "replace");
3107
- } catch {
3108
- }
3109
- try {
3110
- await Y();
3111
- } catch {
3112
- }
3113
- })();
3114
- }
3096
+ Pe.current = d, J && !d && q && (async () => {
3097
+ try {
3098
+ const ae = await u.getMessages({
3099
+ threadId: q,
3100
+ // Do not pass checkpointId/checkpointNs so the backend returns the latest
3101
+ checkpointId: void 0,
3102
+ checkpointNs: void 0,
3103
+ limit: R
3104
+ });
3105
+ _(ae, "replace");
3106
+ } catch {
3107
+ }
3108
+ try {
3109
+ await Y();
3110
+ } catch {
3111
+ }
3112
+ })();
3115
3113
  }, [d, q, b.lastCheckpointId, b.lastCheckpointNs, u, _, Y]);
3116
- const De = Ke(async (J) => {
3114
+ const De = Ge(async (J) => {
3117
3115
  const ae = await u.createThread(J);
3118
3116
  return await Y(), await te(ae.threadId), ae.threadId;
3119
- }, [u, Y, te]), de = Ke(async (J) => {
3120
- await u.deleteThread(J), await Y(), q === J && (F(null), C([]), A(!1), j(null), L(void 0), O(void 0));
3121
- }, [u, Y, q, C]), je = Ke(async (J, ae) => {
3117
+ }, [u, Y, te]), de = Ge(async (J) => {
3118
+ await u.deleteThread(J), await Y(), q === J && (F(null), C([]), k(!1), j(null), L(void 0), O(void 0));
3119
+ }, [u, Y, q, C]), je = Ge(async (J, ae) => {
3122
3120
  await u.updateThread(J, ae), await Y();
3123
- }, [u, Y]), xe = Ke(async (J, ae) => {
3121
+ }, [u, Y]), xe = Ge(async (J, ae) => {
3124
3122
  var Ln;
3125
- const Le = (ae == null ? void 0 : ae.attachments) || [], { contentParts: Ve, filesInfo: Ze } = await ix(
3123
+ const $e = (ae == null ? void 0 : ae.attachments) || [], { contentParts: Ye, filesInfo: Ze } = await ix(
3126
3124
  u,
3127
- Le,
3125
+ $e,
3128
3126
  t == null ? void 0 : t.uploadPath,
3129
3127
  a,
3130
3128
  c,
3131
3129
  q
3132
3130
  ), wt = [];
3133
3131
  J && wt.push({ type: "text", text: J });
3134
- for (const Ge of Ve) wt.push(Ge);
3132
+ for (const Ve of Ye) wt.push(Ve);
3135
3133
  const dt = {
3136
3134
  id: ((Ln = crypto.randomUUID) == null ? void 0 : Ln.call(crypto)) || `user-${Date.now()}`,
3137
3135
  role: "user",
@@ -3143,12 +3141,12 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3143
3141
  S(dt);
3144
3142
  const Rt = {
3145
3143
  ...dt,
3146
- content: dt.content.filter((Ge) => Ge.type === "text" || Ge.type === "image_url" || Ge.type === "file")
3147
- }, Qe = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, at = !!Qe.edit, et = Qe.originalMessageId, ft = typeof et == "string" ? et : void 0, sn = Le && Le.length > 0, ur = {
3144
+ content: dt.content.filter((Ve) => Ve.type === "text" || Ve.type === "image_url" || Ve.type === "file")
3145
+ }, Qe = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, at = !!Qe.edit, et = Qe.originalMessageId, ft = typeof et == "string" ? et : void 0, sn = $e && $e.length > 0, ur = {
3148
3146
  ...q ? { threadId: q } : {},
3149
3147
  payload: {
3150
3148
  messages: [Rt],
3151
- attachments: dt.content.filter((Ge) => Ge.type === "file").map((Ge) => ({ type: "file", url: Ge.url, mimeType: Ge.mimeType, name: Ge.name, size: Ge.size })),
3149
+ attachments: dt.content.filter((Ve) => Ve.type === "file").map((Ve) => ({ type: "file", url: Ve.url, mimeType: Ve.mimeType, name: Ve.name, size: Ve.size })),
3152
3150
  files_info: Ze,
3153
3151
  ...a && sn && c ? { active_agent: c } : {},
3154
3152
  ...Qe
@@ -3162,16 +3160,16 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3162
3160
  };
3163
3161
  m(
3164
3162
  ur,
3165
- (Ge) => T(Ge),
3163
+ (Ve) => T(Ve),
3166
3164
  {
3167
- onError: (Ge) => console.warn("stream error", Ge),
3168
- onOpen: ({ threadId: Ge, created: dr }) => {
3169
- !q && Ge && (F(Ge), dr && Y().catch(() => {
3165
+ onError: (Ve) => console.warn("stream error", Ve),
3166
+ onOpen: ({ threadId: Ve, created: dr }) => {
3167
+ !q && Ve && (F(Ve), dr && Y().catch(() => {
3170
3168
  }));
3171
3169
  }
3172
3170
  }
3173
3171
  );
3174
- }, [q, S, m, T, b.lastCheckpointId, b.lastCheckpointNs, u, t == null ? void 0 : t.uploadPath, Y, F, a, c]), Se = Ke(
3172
+ }, [q, S, m, T, b.lastCheckpointId, b.lastCheckpointNs, u, t == null ? void 0 : t.uploadPath, Y, F, a, c]), Se = Ge(
3175
3173
  async (J) => {
3176
3174
  if (!q) throw new Error("No active thread");
3177
3175
  if (M || !I) return;
@@ -3179,14 +3177,14 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3179
3177
  if (ae) {
3180
3178
  H(!0);
3181
3179
  try {
3182
- const Le = await u.getMessages({
3180
+ const $e = await u.getMessages({
3183
3181
  threadId: q,
3184
3182
  checkpointId: $,
3185
3183
  checkpointNs: Q,
3186
3184
  limit: (J == null ? void 0 : J.limit) ?? R,
3187
3185
  beforeId: ae
3188
3186
  });
3189
- _(Le, "prepend");
3187
+ _($e, "prepend");
3190
3188
  } finally {
3191
3189
  H(!1);
3192
3190
  }
@@ -3220,7 +3218,7 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3220
3218
  renameThread: je,
3221
3219
  loadThread: te,
3222
3220
  send: xe,
3223
- stop: x
3221
+ stop: v
3224
3222
  };
3225
3223
  return /* @__PURE__ */ l.jsx(qc.Provider, { value: rt, children: e });
3226
3224
  }
@@ -3298,9 +3296,9 @@ function lx({
3298
3296
  textareaClassName: d = "",
3299
3297
  allowEmptySend: h = !1
3300
3298
  }) {
3301
- const [m, x] = V.useState(e), [v, g] = V.useTransition(), p = V.useRef(null);
3299
+ const [m, v] = V.useState(e), [x, g] = V.useTransition(), p = V.useRef(null);
3302
3300
  V.useEffect(() => {
3303
- x(e ?? ""), p.current && (p.current.style.height = "auto", p.current.style.height = `${p.current.scrollHeight}px`);
3301
+ v(e ?? ""), p.current && (p.current.style.height = "auto", p.current.style.height = `${p.current.scrollHeight}px`);
3304
3302
  }, [e, t]);
3305
3303
  const w = V.useCallback(() => {
3306
3304
  const R = p.current;
@@ -3315,18 +3313,18 @@ function lx({
3315
3313
  const I = (m ?? "").trim();
3316
3314
  !I && !h || g(() => {
3317
3315
  try {
3318
- const A = i(I);
3319
- A && typeof A.then == "function" ? A.then(() => {
3320
- x(""), p.current && (p.current.style.height = "auto");
3316
+ const k = i(I);
3317
+ k && typeof k.then == "function" ? k.then(() => {
3318
+ v(""), p.current && (p.current.style.height = "auto");
3321
3319
  }).catch(() => {
3322
- }) : (x(""), p.current && (p.current.style.height = "auto"));
3320
+ }) : (v(""), p.current && (p.current.style.height = "auto"));
3323
3321
  } catch {
3324
3322
  }
3325
3323
  });
3326
3324
  },
3327
3325
  [m, i, h]
3328
3326
  ), y = V.useCallback((R) => {
3329
- x(R.target.value), p.current && (p.current.style.height = "auto", p.current.style.height = `${p.current.scrollHeight}px`);
3327
+ v(R.target.value), p.current && (p.current.style.height = "auto", p.current.style.height = `${p.current.scrollHeight}px`);
3330
3328
  }, []), N = V.useCallback(
3331
3329
  (R) => {
3332
3330
  R.key === "Enter" && !R.shiftKey ? (R.preventDefault(), b()) : R.key === "Escape" && t && (R.preventDefault(), a == null || a());
@@ -3371,7 +3369,7 @@ function lx({
3371
3369
  size: "icon",
3372
3370
  className: "shrink-0",
3373
3371
  title: t ? "Save changes" : "Send message",
3374
- disabled: o || !m.trim() && !h || v,
3372
+ disabled: o || !m.trim() && !h || x,
3375
3373
  children: /* @__PURE__ */ l.jsx(Bp, { size: 16 })
3376
3374
  }
3377
3375
  ) })
@@ -3676,10 +3674,10 @@ function wx(e, t, n, r, o, s, i, a, c) {
3676
3674
  let m = d.parentElement;
3677
3675
  for (; !m.dataset.virtuosoScroller; )
3678
3676
  m = m.parentElement;
3679
- const x = m.lastElementChild.dataset.viewportType === "window";
3680
- let v;
3681
- x && (v = m.ownerDocument.defaultView);
3682
- const g = i ? a ? i.scrollLeft : i.scrollTop : x ? a ? v.scrollX || v.document.documentElement.scrollLeft : v.scrollY || v.document.documentElement.scrollTop : a ? m.scrollLeft : m.scrollTop, p = i ? a ? i.scrollWidth : i.scrollHeight : x ? a ? v.document.documentElement.scrollWidth : v.document.documentElement.scrollHeight : a ? m.scrollWidth : m.scrollHeight, w = i ? a ? i.offsetWidth : i.offsetHeight : x ? a ? v.innerWidth : v.innerHeight : a ? m.offsetWidth : m.offsetHeight;
3677
+ const v = m.lastElementChild.dataset.viewportType === "window";
3678
+ let x;
3679
+ v && (x = m.ownerDocument.defaultView);
3680
+ const g = i ? a ? i.scrollLeft : i.scrollTop : v ? a ? x.scrollX || x.document.documentElement.scrollLeft : x.scrollY || x.document.documentElement.scrollTop : a ? m.scrollLeft : m.scrollTop, p = i ? a ? i.scrollWidth : i.scrollHeight : v ? a ? x.document.documentElement.scrollWidth : x.document.documentElement.scrollHeight : a ? m.scrollWidth : m.scrollHeight, w = i ? a ? i.offsetWidth : i.offsetHeight : v ? a ? x.innerWidth : x.innerHeight : a ? m.offsetWidth : m.offsetHeight;
3683
3681
  r({
3684
3682
  scrollHeight: p,
3685
3683
  scrollTop: Math.max(g, 0),
@@ -3720,11 +3718,11 @@ function eu(e, t, n) {
3720
3718
  const u = c.getBoundingClientRect(), d = u.width;
3721
3719
  let h, m;
3722
3720
  if (t) {
3723
- const x = t.getBoundingClientRect(), v = u.top - x.top;
3724
- m = x.height - Math.max(0, v), h = v + t.scrollTop;
3721
+ const v = t.getBoundingClientRect(), x = u.top - v.top;
3722
+ m = v.height - Math.max(0, x), h = x + t.scrollTop;
3725
3723
  } else {
3726
- const x = i.current.ownerDocument.defaultView;
3727
- m = x.innerHeight - Math.max(0, u.top), h = u.top + x.scrollY;
3724
+ const v = i.current.ownerDocument.defaultView;
3725
+ m = v.innerHeight - Math.max(0, u.top), h = u.top + v.scrollY;
3728
3726
  }
3729
3727
  r.current = {
3730
3728
  offsetTop: h,
@@ -3757,7 +3755,7 @@ function eu(e, t, n) {
3757
3755
  }
3758
3756
  const pt = ke(
3759
3757
  () => {
3760
- const e = Ee(), t = Ee(), n = W(0), r = Ee(), o = W(0), s = Ee(), i = Ee(), a = W(0), c = W(0), u = W(0), d = W(0), h = Ee(), m = Ee(), x = W(!1), v = W(!1), g = W(!1);
3758
+ const e = Ee(), t = Ee(), n = W(0), r = Ee(), o = W(0), s = Ee(), i = Ee(), a = W(0), c = W(0), u = W(0), d = W(0), h = Ee(), m = Ee(), v = W(!1), x = W(!1), g = W(!1);
3761
3759
  return le(
3762
3760
  B(
3763
3761
  e,
@@ -3776,12 +3774,12 @@ const pt = ke(
3776
3774
  fixedHeaderHeight: c,
3777
3775
  footerHeight: d,
3778
3776
  headerHeight: a,
3779
- horizontalDirection: v,
3777
+ horizontalDirection: x,
3780
3778
  scrollBy: m,
3781
3779
  // input
3782
3780
  scrollContainerState: e,
3783
3781
  scrollHeight: i,
3784
- scrollingInProgress: x,
3782
+ scrollingInProgress: v,
3785
3783
  // signals
3786
3784
  scrollTo: h,
3787
3785
  scrollTop: t,
@@ -4041,8 +4039,8 @@ function jx(e, [t, n, r, o]) {
4041
4039
  const s = e.sizeTree;
4042
4040
  let i = s, a = 0;
4043
4041
  if (n.length > 0 && Be(s) && t.length === 2) {
4044
- const m = t[0].size, x = t[1].size;
4045
- i = n.reduce((v, g) => St(St(v, g, m), g + 1, x), i);
4042
+ const m = t[0].size, v = t[1].size;
4043
+ i = n.reduce((x, g) => St(St(x, g, m), g + 1, v), i);
4046
4044
  } else
4047
4045
  [i, a] = Rx(i, t);
4048
4046
  if (i === s)
@@ -4050,7 +4048,7 @@ function jx(e, [t, n, r, o]) {
4050
4048
  const { lastIndex: c, lastOffset: u, lastSize: d, offsetTree: h } = bi(e.offsetTree, a, i, o);
4051
4049
  return {
4052
4050
  groupIndices: n,
4053
- groupOffsetTree: n.reduce((m, x) => St(m, x, Pr(x, h, o)), Gn()),
4051
+ groupOffsetTree: n.reduce((m, v) => St(m, v, Pr(v, h, o)), Gn()),
4054
4052
  lastIndex: c,
4055
4053
  lastOffset: u,
4056
4054
  lastSize: d,
@@ -4105,9 +4103,9 @@ const _x = {
4105
4103
  offsetWidth: "width"
4106
4104
  }, Zt = ke(
4107
4105
  ([{ log: e }, { recalcInProgress: t }]) => {
4108
- const n = Ee(), r = Ee(), o = ut(r, 0), s = Ee(), i = Ee(), a = W(0), c = W([]), u = W(void 0), d = W(void 0), h = W((S, T) => fn(S, _x[T])), m = W(void 0), x = W(0), v = Tx(), g = ut(
4109
- B(n, Ce(c, e, x), Yt(jx, v), He()),
4110
- v
4106
+ const n = Ee(), r = Ee(), o = ut(r, 0), s = Ee(), i = Ee(), a = W(0), c = W([]), u = W(void 0), d = W(void 0), h = W((S, T) => fn(S, _x[T])), m = W(void 0), v = W(0), x = Tx(), g = ut(
4107
+ B(n, Ce(c, e, v), Yt(jx, x), He()),
4108
+ x
4111
4109
  ), p = ut(
4112
4110
  B(
4113
4111
  c,
@@ -4124,9 +4122,9 @@ const _x = {
4124
4122
  B(
4125
4123
  c,
4126
4124
  pe((S) => S.length > 0),
4127
- Ce(g, x),
4125
+ Ce(g, v),
4128
4126
  re(([S, T, C]) => {
4129
- const R = S.reduce((I, A, M) => St(I, A, Pr(A, T.offsetTree, C) || M), Gn());
4127
+ const R = S.reduce((I, k, M) => St(I, k, Pr(k, T.offsetTree, C) || M), Gn());
4130
4128
  return {
4131
4129
  ...T,
4132
4130
  groupIndices: S,
@@ -4174,7 +4172,7 @@ const _x = {
4174
4172
  changed: C !== S,
4175
4173
  sizes: C
4176
4174
  }),
4177
- { changed: !1, sizes: v }
4175
+ { changed: !1, sizes: x }
4178
4176
  ),
4179
4177
  re((S) => S.changed)
4180
4178
  )
@@ -4212,13 +4210,13 @@ const _x = {
4212
4210
  re(([S, T]) => {
4213
4211
  const C = T.groupIndices.length > 0, R = [], I = T.lastSize;
4214
4212
  if (C) {
4215
- const A = kr(T.sizeTree, 0);
4213
+ const k = kr(T.sizeTree, 0);
4216
4214
  let M = 0, H = 0;
4217
4215
  for (; M < S; ) {
4218
4216
  const j = T.groupIndices[H], $ = T.groupIndices.length === H + 1 ? 1 / 0 : T.groupIndices[H + 1] - j - 1;
4219
4217
  R.push({
4220
4218
  endIndex: j,
4221
- size: A,
4219
+ size: k,
4222
4220
  startIndex: j
4223
4221
  }), R.push({
4224
4222
  endIndex: j + 1 + $ - 1,
@@ -4251,10 +4249,10 @@ const _x = {
4251
4249
  ).ranges;
4252
4250
  }
4253
4251
  return Cn(T.sizeTree).reduce(
4254
- (A, { k: M, v: H }) => ({
4252
+ (k, { k: M, v: H }) => ({
4255
4253
  prevIndex: M + S,
4256
4254
  prevSize: H,
4257
- ranges: [...A.ranges, { endIndex: M + S - 1, size: A.prevSize, startIndex: A.prevIndex }]
4255
+ ranges: [...k.ranges, { endIndex: M + S - 1, size: k.prevSize, startIndex: k.prevIndex }]
4258
4256
  }),
4259
4257
  {
4260
4258
  prevIndex: 0,
@@ -4269,7 +4267,7 @@ const _x = {
4269
4267
  const N = Ct(
4270
4268
  B(
4271
4269
  i,
4272
- Ce(g, x),
4270
+ Ce(g, v),
4273
4271
  re(([S, { offsetTree: T }, C]) => {
4274
4272
  const R = -S;
4275
4273
  return Pr(R, T, C);
@@ -4279,20 +4277,20 @@ const _x = {
4279
4277
  return le(
4280
4278
  B(
4281
4279
  i,
4282
- Ce(g, x),
4280
+ Ce(g, v),
4283
4281
  re(([S, T, C]) => {
4284
4282
  if (T.groupIndices.length > 0) {
4285
4283
  if (Be(T.sizeTree))
4286
4284
  return T;
4287
4285
  let R = Gn();
4288
4286
  const I = Xe(p);
4289
- let A = 0, M = 0, H = 0;
4290
- for (; A < -S; ) {
4287
+ let k = 0, M = 0, H = 0;
4288
+ for (; k < -S; ) {
4291
4289
  H = I[M];
4292
4290
  const U = I[M + 1] - H - 1;
4293
- M++, A += U + 1;
4291
+ M++, k += U + 1;
4294
4292
  }
4295
- if (R = Cn(T.sizeTree).reduce((U, { k: j, v: $ }) => St(U, Math.max(0, j + S), $), R), A !== -S) {
4293
+ if (R = Cn(T.sizeTree).reduce((U, { k: j, v: $ }) => St(U, Math.max(0, j + S), $), R), k !== -S) {
4296
4294
  const U = kr(T.sizeTree, H);
4297
4295
  R = St(R, 0, U);
4298
4296
  const j = Ft(T.sizeTree, -S + 1)[1];
@@ -4304,7 +4302,7 @@ const _x = {
4304
4302
  ...bi(T.offsetTree, 0, R, C)
4305
4303
  };
4306
4304
  } else {
4307
- const R = Cn(T.sizeTree).reduce((I, { k: A, v: M }) => St(I, Math.max(0, A + S), M), Gn());
4305
+ const R = Cn(T.sizeTree).reduce((I, { k, v: M }) => St(I, Math.max(0, k + S), M), Gn());
4308
4306
  return {
4309
4307
  ...T,
4310
4308
  sizeTree: R,
@@ -4321,7 +4319,7 @@ const _x = {
4321
4319
  defaultItemSize: d,
4322
4320
  firstItemIndex: a,
4323
4321
  fixedItemSize: u,
4324
- gap: x,
4322
+ gap: v,
4325
4323
  groupIndices: c,
4326
4324
  itemSize: h,
4327
4325
  listRefresh: b,
@@ -4410,28 +4408,28 @@ const Vr = ke(
4410
4408
  },
4411
4409
  { log: m }
4412
4410
  ]) => {
4413
- const x = Ee(), v = Ee(), g = W(0);
4411
+ const v = Ee(), x = Ee(), g = W(0);
4414
4412
  let p = null, w = null, b = null;
4415
4413
  function y() {
4416
4414
  p && (p(), p = null), b && (b(), b = null), w && (clearTimeout(w), w = null), we(c, !1);
4417
4415
  }
4418
4416
  return le(
4419
4417
  B(
4420
- x,
4418
+ v,
4421
4419
  Ce(n, h, r, g, a, i, m),
4422
4420
  Ce(e, s, o),
4423
4421
  re(
4424
4422
  ([
4425
- [N, S, T, C, R, I, A, M],
4423
+ [N, S, T, C, R, I, k, M],
4426
4424
  H,
4427
4425
  U,
4428
4426
  j
4429
4427
  ]) => {
4430
4428
  const $ = du(N), { align: L, behavior: Q, offset: O } = $, _ = C - 1, G = cu($, S, _);
4431
4429
  let Z = Pr(G, S.offsetTree, H) + I;
4432
- L === "end" ? (Z += U + Ft(S.sizeTree, G)[1] - T + j, G === _ && (Z += A)) : L === "center" ? Z += (U + Ft(S.sizeTree, G)[1] - T + j) / 2 : Z -= R, O && (Z += O);
4430
+ L === "end" ? (Z += U + Ft(S.sizeTree, G)[1] - T + j, G === _ && (Z += k)) : L === "center" ? Z += (U + Ft(S.sizeTree, G)[1] - T + j) / 2 : Z -= R, O && (Z += O);
4433
4431
  const q = (F) => {
4434
- y(), F ? (M("retrying to scroll to", { location: N }, vt.DEBUG), we(x, N)) : (we(v, !0), M("list did not change, scroll successful", {}, vt.DEBUG));
4432
+ y(), F ? (M("retrying to scroll to", { location: N }, vt.DEBUG), we(v, N)) : (we(x, !0), M("list did not change, scroll successful", {}, vt.DEBUG));
4435
4433
  };
4436
4434
  if (y(), Q === "smooth") {
4437
4435
  let F = !1;
@@ -4450,8 +4448,8 @@ const Vr = ke(
4450
4448
  ),
4451
4449
  u
4452
4450
  ), {
4453
- scrollTargetReached: v,
4454
- scrollToIndex: x,
4451
+ scrollTargetReached: x,
4452
+ scrollToIndex: v,
4455
4453
  topListHeight: g
4456
4454
  };
4457
4455
  },
@@ -4500,7 +4498,7 @@ const Gr = ke(
4500
4498
  B(
4501
4499
  nt(t, i),
4502
4500
  Ce(a, n, e, u),
4503
- pe(([[, d], h, { sizeTree: m }, x, v]) => d && (!Be(m) || Gi(x)) && !h && !v),
4501
+ pe(([[, d], h, { sizeTree: m }, v, x]) => d && (!Be(m) || Gi(v)) && !h && !x),
4504
4502
  Ce(c)
4505
4503
  ),
4506
4504
  ([, d]) => {
@@ -4540,7 +4538,7 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4540
4538
  He()
4541
4539
  ),
4542
4540
  !1
4543
- ), x = ut(
4541
+ ), v = ut(
4544
4542
  B(mi(B(n, Gt(!0)), B(n, Gt(!1), wl(200))), He()),
4545
4543
  !1
4546
4544
  );
@@ -4552,11 +4550,11 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4552
4550
  ),
4553
4551
  a
4554
4552
  ), le(B(a, nn(50)), u);
4555
- const v = Ct(
4553
+ const x = Ct(
4556
4554
  B(
4557
4555
  nt(r, he(s), he(t), he(e), he(d)),
4558
4556
  Yt((b, [{ scrollHeight: y, scrollTop: N }, S, T, C, R]) => {
4559
- const I = N + S - y > -R, A = {
4557
+ const I = N + S - y > -R, k = {
4560
4558
  scrollHeight: y,
4561
4559
  scrollTop: N,
4562
4560
  viewportHeight: S
@@ -4567,14 +4565,14 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4567
4565
  atBottom: !0,
4568
4566
  atBottomBecause: H,
4569
4567
  scrollTopDelta: U,
4570
- state: A
4568
+ state: k
4571
4569
  };
4572
4570
  }
4573
4571
  let M;
4574
- return A.scrollHeight > b.state.scrollHeight ? M = "SIZE_INCREASED" : S < b.state.viewportHeight ? M = "VIEWPORT_HEIGHT_DECREASING" : N < b.state.scrollTop ? M = "SCROLLING_UPWARDS" : M = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
4572
+ return k.scrollHeight > b.state.scrollHeight ? M = "SIZE_INCREASED" : S < b.state.viewportHeight ? M = "VIEWPORT_HEIGHT_DECREASING" : N < b.state.scrollTop ? M = "SCROLLING_UPWARDS" : M = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
4575
4573
  atBottom: !1,
4576
4574
  notAtBottomBecause: M,
4577
- state: A
4575
+ state: k
4578
4576
  };
4579
4577
  }, Fx),
4580
4578
  He((b, y) => b && b.atBottom === y.atBottom)
@@ -4615,7 +4613,7 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4615
4613
  );
4616
4614
  le(
4617
4615
  B(
4618
- v,
4616
+ x,
4619
4617
  re((b) => b.atBottom)
4620
4618
  ),
4621
4619
  i
@@ -4627,7 +4625,7 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4627
4625
  re(({ scrollTop: b }) => b),
4628
4626
  He(),
4629
4627
  Yt(
4630
- (b, y) => Xe(x) ? { direction: b.direction, prevScrollTop: y } : { direction: y < b.prevScrollTop ? _r : Cr, prevScrollTop: y },
4628
+ (b, y) => Xe(v) ? { direction: b.direction, prevScrollTop: y } : { direction: y < b.prevScrollTop ? _r : Cr, prevScrollTop: y },
4631
4629
  { direction: Cr, prevScrollTop: 0 }
4632
4630
  ),
4633
4631
  re((b) => b.direction)
@@ -4653,7 +4651,7 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4653
4651
  ),
4654
4652
  w
4655
4653
  ), {
4656
- atBottomState: v,
4654
+ atBottomState: x,
4657
4655
  atBottomStateChange: c,
4658
4656
  atBottomThreshold: d,
4659
4657
  atTopStateChange: u,
@@ -4693,7 +4691,7 @@ const Qi = ke(
4693
4691
  d,
4694
4692
  h,
4695
4693
  m,
4696
- [x, v],
4694
+ [v, x],
4697
4695
  g,
4698
4696
  p,
4699
4697
  w,
@@ -4703,7 +4701,7 @@ const Qi = ke(
4703
4701
  const N = d - b, S = p + w, T = Math.max(m - N, 0);
4704
4702
  let C = Tl;
4705
4703
  const R = El(y, Oo), I = El(y, Mo);
4706
- return x -= b, x += m + w, v += m + w, v -= b, x > d + S - R && (C = _r), v < d - T + h + I && (C = Cr), C !== Tl ? [
4704
+ return v -= b, v += m + w, x += m + w, x -= b, v > d + S - R && (C = _r), x < d - T + h + I && (C = Cr), C !== Tl ? [
4707
4705
  Math.max(N - m - Rl(g, Oo, C) - R, 0),
4708
4706
  N - T - w + h + Rl(g, Mo, C) + I
4709
4707
  ] : null;
@@ -4756,14 +4754,14 @@ function xo(e, t, n, r, o, s) {
4756
4754
  const g = e[e.length - 1];
4757
4755
  d = g.offset + g.size;
4758
4756
  }
4759
- const h = n - i, m = a + h * c + (h - 1) * r, x = u, v = m - d;
4757
+ const h = n - i, m = a + h * c + (h - 1) * r, v = u, x = m - d;
4760
4758
  return {
4761
4759
  bottom: d,
4762
4760
  firstItemIndex: s,
4763
4761
  items: Nl(e, o, s),
4764
- offsetBottom: v,
4762
+ offsetBottom: x,
4765
4763
  offsetTop: u,
4766
- top: x,
4764
+ top: v,
4767
4765
  topItems: Nl(t, o, s),
4768
4766
  topListHeight: t.reduce((g, p) => p.size + g, 0),
4769
4767
  totalCount: n
@@ -4819,16 +4817,16 @@ const On = ke(
4819
4817
  { initialTopMostItemIndex: u, scrolledToInitialItem: d },
4820
4818
  { topListHeight: h },
4821
4819
  m,
4822
- { didMount: x },
4823
- { recalcInProgress: v }
4820
+ { didMount: v },
4821
+ { recalcInProgress: x }
4824
4822
  ]) => {
4825
4823
  const g = W([]), p = W(0), w = Ee();
4826
4824
  le(s.topItemsIndexes, g);
4827
4825
  const b = ut(
4828
4826
  B(
4829
4827
  nt(
4830
- x,
4831
4828
  v,
4829
+ x,
4832
4830
  he(c, Ar),
4833
4831
  he(o),
4834
4832
  he(r),
@@ -4840,8 +4838,8 @@ const On = ke(
4840
4838
  e
4841
4839
  ),
4842
4840
  pe(([T, C, , R, , , , , , , I]) => {
4843
- const A = I && I.length !== R;
4844
- return T && !C && !A;
4841
+ const k = I && I.length !== R;
4842
+ return T && !C && !k;
4845
4843
  }),
4846
4844
  re(
4847
4845
  ([
@@ -4850,7 +4848,7 @@ const On = ke(
4850
4848
  [T, C],
4851
4849
  R,
4852
4850
  I,
4853
- A,
4851
+ k,
4854
4852
  M,
4855
4853
  H,
4856
4854
  U,
@@ -4861,10 +4859,10 @@ const On = ke(
4861
4859
  if (R === 0)
4862
4860
  return { ...Bs, totalCount: R };
4863
4861
  if (T === 0 && C === 0)
4864
- return _ === 0 ? { ...Bs, totalCount: R } : hu(_, A, I, U, j, $ || []);
4862
+ return _ === 0 ? { ...Bs, totalCount: R } : hu(_, k, I, U, j, $ || []);
4865
4863
  if (Be(O))
4866
4864
  return _ > 0 ? null : xo(
4867
- $x(Zi(A, R), L, $),
4865
+ $x(Zi(k, R), L, $),
4868
4866
  [],
4869
4867
  R,
4870
4868
  j,
@@ -5035,10 +5033,10 @@ const On = ke(
5035
5033
  d,
5036
5034
  Ce(t, c, n, s, o, r, a),
5037
5035
  Ce(e),
5038
- re(([[h, m, x, v, g, p, w, b], y]) => {
5039
- const { align: N, behavior: S, calculateViewLocation: T = zx, done: C, ...R } = h, I = cu(h, m, v - 1), A = Pr(I, m.offsetTree, y) + g + p, M = A + Ft(m.sizeTree, I)[1], H = b + p, U = b + x - w, j = T({
5036
+ re(([[h, m, v, x, g, p, w, b], y]) => {
5037
+ const { align: N, behavior: S, calculateViewLocation: T = zx, done: C, ...R } = h, I = cu(h, m, x - 1), k = Pr(I, m.offsetTree, y) + g + p, M = k + Ft(m.sizeTree, I)[1], H = b + p, U = b + v - w, j = T({
5040
5038
  itemBottom: M,
5041
- itemTop: A,
5039
+ itemTop: k,
5042
5040
  locationParams: { align: N, behavior: S, ...R },
5043
5041
  viewportBottom: U,
5044
5042
  viewportTop: H
@@ -5077,9 +5075,9 @@ const Ux = (e, t) => typeof e == "function" ? Il(e(t)) : t && Il(e), Wx = ke(
5077
5075
  { log: d },
5078
5076
  { scrollingInProgress: h },
5079
5077
  { context: m },
5080
- { scrollIntoView: x }
5078
+ { scrollIntoView: v }
5081
5079
  ]) => {
5082
- const v = W(!1), g = Ee();
5080
+ const x = W(!1), g = Ee();
5083
5081
  let p = null;
5084
5082
  function w(S) {
5085
5083
  we(i, {
@@ -5091,10 +5089,10 @@ const Ux = (e, t) => typeof e == "function" ? Il(e(t)) : t && Il(e), Wx = ke(
5091
5089
  Me(
5092
5090
  B(
5093
5091
  nt(B(he(t), In(1)), c),
5094
- Ce(he(v), s, a, h),
5095
- re(([[S, T], C, R, I, A]) => {
5092
+ Ce(he(x), s, a, h),
5093
+ re(([[S, T], C, R, I, k]) => {
5096
5094
  let M = T && I, H = "auto";
5097
- return M && (H = Ux(C, R || A), M = M && !!H), { followOutputBehavior: H, shouldFollow: M, totalCount: S };
5095
+ return M && (H = Ux(C, R || k), M = M && !!H), { followOutputBehavior: H, shouldFollow: M, totalCount: S };
5098
5096
  }),
5099
5097
  pe(({ shouldFollow: S }) => S)
5100
5098
  ),
@@ -5114,21 +5112,21 @@ const Ux = (e, t) => typeof e == "function" ? Il(e(t)) : t && Il(e), Wx = ke(
5114
5112
  }
5115
5113
  Me(
5116
5114
  B(
5117
- nt(he(v), t, u),
5115
+ nt(he(x), t, u),
5118
5116
  pe(([S, , T]) => S && T),
5119
5117
  Yt(
5120
5118
  ({ value: S }, [, T]) => ({ refreshed: S === T, value: T }),
5121
5119
  { refreshed: !1, value: 0 }
5122
5120
  ),
5123
5121
  pe(({ refreshed: S }) => S),
5124
- Ce(v, t)
5122
+ Ce(x, t)
5125
5123
  ),
5126
5124
  ([, S]) => {
5127
5125
  Xe(a) && b(S !== !1);
5128
5126
  }
5129
5127
  ), Me(g, () => {
5130
- b(Xe(v) !== !1);
5131
- }), Me(nt(he(v), o), ([S, T]) => {
5128
+ b(Xe(x) !== !1);
5129
+ }), Me(nt(he(x), o), ([S, T]) => {
5132
5130
  S && !T.atBottom && T.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && w("auto");
5133
5131
  });
5134
5132
  const y = W(null), N = Ee();
@@ -5148,18 +5146,18 @@ const Ux = (e, t) => typeof e == "function" ? Il(e(t)) : t && Il(e), Wx = ke(
5148
5146
  B(
5149
5147
  nt(B(N, In(1)), c),
5150
5148
  Ce(he(y), a, h, m),
5151
- re(([[S, T], C, R, I, A]) => T && R && (C == null ? void 0 : C({ context: A, totalCount: S, scrollingInProgress: I }))),
5149
+ re(([[S, T], C, R, I, k]) => T && R && (C == null ? void 0 : C({ context: k, totalCount: S, scrollingInProgress: I }))),
5152
5150
  pe((S) => !!S),
5153
5151
  nn(0)
5154
5152
  ),
5155
5153
  (S) => {
5156
5154
  p && (p(), p = null), Xe(n) ? requestAnimationFrame(() => {
5157
- Xe(d)("scrolling into view", {}), we(x, S);
5155
+ Xe(d)("scrolling into view", {}), we(v, S);
5158
5156
  }) : p = Dt(e, () => {
5159
- Xe(d)("scrolling into view", {}), we(x, S), p = null;
5157
+ Xe(d)("scrolling into view", {}), we(v, S), p = null;
5160
5158
  });
5161
5159
  }
5162
- ), { autoscrollToBottom: g, followOutput: v, scrollIntoViewOnChange: y };
5160
+ ), { autoscrollToBottom: g, followOutput: x, scrollIntoViewOnChange: y };
5163
5161
  },
5164
5162
  ze(
5165
5163
  Zt,
@@ -5179,7 +5177,7 @@ const Ux = (e, t) => typeof e == "function" ? Il(e(t)) : t && Il(e), Wx = ke(
5179
5177
  Ce(s),
5180
5178
  pe(([, c]) => c !== 0),
5181
5179
  Ce(o, r, t, n, e),
5182
- re(([[, c], u, d, h, m, x = []]) => hu(c, u, d, h, m, x))
5180
+ re(([[, c], u, d, h, m, v = []]) => hu(c, u, d, h, m, v))
5183
5181
  ),
5184
5182
  i
5185
5183
  ), {}),
@@ -5290,17 +5288,17 @@ const Ux = (e, t) => typeof e == "function" ? Il(e(t)) : t && Il(e), Wx = ke(
5290
5288
  u,
5291
5289
  Ce(t, r, i, h, m, n)
5292
5290
  ),
5293
- ([x, v, g, p, w, b, y]) => {
5294
- const N = kx(v.sizeTree);
5295
- p && w !== null && b !== null && (g = w.scrollTop - b.offsetTop), g -= y, x({ ranges: N, scrollTop: g });
5291
+ ([v, x, g, p, w, b, y]) => {
5292
+ const N = kx(x.sizeTree);
5293
+ p && w !== null && b !== null && (g = w.scrollTop - b.offsetTop), g -= y, v({ ranges: N, scrollTop: g });
5296
5294
  }
5297
5295
  ), le(B(d, pe(Gi), re(Yx)), o), le(
5298
5296
  B(
5299
5297
  s,
5300
5298
  Ce(d),
5301
- pe(([, x]) => x !== void 0),
5299
+ pe(([, v]) => v !== void 0),
5302
5300
  He(),
5303
- re(([, x]) => x.ranges)
5301
+ re(([, v]) => v.ranges)
5304
5302
  ),
5305
5303
  e
5306
5304
  ), {
@@ -5334,8 +5332,8 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5334
5332
  { isAtBottom: o, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: a },
5335
5333
  { listState: c },
5336
5334
  { beforeUnshiftWith: u, gap: d, shiftWithOffset: h, sizes: m },
5337
- { log: x },
5338
- { recalcInProgress: v }
5335
+ { log: v },
5336
+ { recalcInProgress: x }
5339
5337
  ]) => {
5340
5338
  const g = Ct(
5341
5339
  B(
@@ -5344,13 +5342,13 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5344
5342
  Yt(
5345
5343
  ([, w, b, y], [{ bottom: N, items: S, offsetBottom: T, totalCount: C }, R]) => {
5346
5344
  const I = N + T;
5347
- let A = 0;
5348
- return b === C && w.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && w[0].originalIndex === 0 || (A = I - y, A !== 0 && (A += R))), [A, S, C, I];
5345
+ let k = 0;
5346
+ return b === C && w.length > 0 && S.length > 0 && (S[0].originalIndex === 0 && w[0].originalIndex === 0 || (k = I - y, k !== 0 && (k += R))), [k, S, C, I];
5349
5347
  },
5350
5348
  [0, [], 0, 0]
5351
5349
  ),
5352
5350
  pe(([w]) => w !== 0),
5353
- Ce(r, a, n, o, x, v),
5351
+ Ce(r, a, n, o, v, x),
5354
5352
  pe(([, w, b, y, , , N]) => !N && !y && w !== 0 && b === _r),
5355
5353
  re(([[w], , , , , b]) => (b("Upward scrolling compensation", { amount: w }, vt.DEBUG), w))
5356
5354
  )
@@ -5362,7 +5360,7 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5362
5360
  y && Xx() ? we(e, b - w) : p(-w);
5363
5361
  }), Me(
5364
5362
  B(
5365
- nt(ut(s, !1), e, v),
5363
+ nt(ut(s, !1), e, x),
5366
5364
  pe(([w, b, y]) => !w && !y && b !== 0),
5367
5365
  re(([w, b]) => b),
5368
5366
  nn(1)
@@ -5387,11 +5385,11 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5387
5385
  {
5388
5386
  let C = 0;
5389
5387
  const R = kr(N, 0);
5390
- let I = 0, A = 0;
5388
+ let I = 0, k = 0;
5391
5389
  for (; I < w; ) {
5392
5390
  I++, C += R;
5393
- let M = b.length === A + 1 ? 1 / 0 : b[A + 1] - b[A] - 1;
5394
- I + M > w && (C -= R, M = w - I + 1), I += M, C += T(M), A++;
5391
+ let M = b.length === k + 1 ? 1 / 0 : b[k + 1] - b[k] - 1;
5392
+ I + M > w && (C -= R, M = w - I + 1), I += M, C += T(M), k++;
5395
5393
  }
5396
5394
  return C;
5397
5395
  }
@@ -5400,7 +5398,7 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5400
5398
  (w) => {
5401
5399
  we(e, w), requestAnimationFrame(() => {
5402
5400
  we(t, { top: w }), requestAnimationFrame(() => {
5403
- we(e, 0), we(v, !1);
5401
+ we(e, 0), we(x, !1);
5404
5402
  });
5405
5403
  });
5406
5404
  }
@@ -5462,7 +5460,7 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5462
5460
  totalCount: d,
5463
5461
  trackItemSizes: h
5464
5462
  },
5465
- { initialItemFinalLocationReached: m, initialTopMostItemIndex: x, scrolledToInitialItem: v },
5463
+ { initialItemFinalLocationReached: m, initialTopMostItemIndex: v, scrolledToInitialItem: x },
5466
5464
  g,
5467
5465
  p,
5468
5466
  w,
@@ -5475,7 +5473,7 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5475
5473
  ]) => (le(N.rangeChanged, I.scrollSeekRangeChanged), le(
5476
5474
  B(
5477
5475
  I.windowViewportRect,
5478
- re((A) => A.visibleHeight)
5476
+ re((k) => k.visibleHeight)
5479
5477
  ),
5480
5478
  g.viewportHeight
5481
5479
  ), {
@@ -5486,8 +5484,8 @@ const Xx = vu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5486
5484
  gap: o,
5487
5485
  groupCounts: R,
5488
5486
  initialItemFinalLocationReached: m,
5489
- initialTopMostItemIndex: x,
5490
- scrolledToInitialItem: v,
5487
+ initialTopMostItemIndex: v,
5488
+ scrolledToInitialItem: x,
5491
5489
  sizeRanges: a,
5492
5490
  topItemCount: C,
5493
5491
  topItemsIndexes: y,
@@ -5581,7 +5579,7 @@ function wu(e, t, n) {
5581
5579
  },
5582
5580
  [w, p]
5583
5581
  );
5584
- }, x = (p) => {
5582
+ }, v = (p) => {
5585
5583
  const w = V.useContext(a)[p], b = V.useCallback(
5586
5584
  (y) => Me(w, y),
5587
5585
  [w]
@@ -5591,7 +5589,7 @@ function wu(e, t, n) {
5591
5589
  () => Xe(w),
5592
5590
  () => Xe(w)
5593
5591
  );
5594
- }, v = (p) => {
5592
+ }, x = (p) => {
5595
5593
  const w = V.useContext(a)[p], [b, y] = V.useState(bl(Xe, w));
5596
5594
  return to(
5597
5595
  () => Me(w, (N) => {
@@ -5599,7 +5597,7 @@ function wu(e, t, n) {
5599
5597
  }),
5600
5598
  [w, b]
5601
5599
  ), b;
5602
- }, g = V.version.startsWith("18") ? x : v;
5600
+ }, g = V.version.startsWith("18") ? v : x;
5603
5601
  return {
5604
5602
  Component: h,
5605
5603
  useEmitter: (p, w) => {
@@ -5620,21 +5618,21 @@ function ev(e) {
5620
5618
  function Tu(e, t, n, r = sr, o, s) {
5621
5619
  const i = V.useRef(null), a = V.useRef(null), c = V.useRef(null), u = V.useCallback(
5622
5620
  (m) => {
5623
- let x, v, g;
5621
+ let v, x, g;
5624
5622
  const p = m.target;
5625
5623
  if (ev(p) || $s(p)) {
5626
5624
  const b = $s(p) ? p : p.defaultView;
5627
- g = s ? b.scrollX : b.scrollY, x = s ? b.document.documentElement.scrollWidth : b.document.documentElement.scrollHeight, v = s ? b.innerWidth : b.innerHeight;
5625
+ g = s ? b.scrollX : b.scrollY, v = s ? b.document.documentElement.scrollWidth : b.document.documentElement.scrollHeight, x = s ? b.innerWidth : b.innerHeight;
5628
5626
  } else
5629
- g = s ? p.scrollLeft : p.scrollTop, x = s ? p.scrollWidth : p.scrollHeight, v = s ? p.offsetWidth : p.offsetHeight;
5627
+ g = s ? p.scrollLeft : p.scrollTop, v = s ? p.scrollWidth : p.scrollHeight, x = s ? p.offsetWidth : p.offsetHeight;
5630
5628
  const w = () => {
5631
5629
  e({
5632
- scrollHeight: x,
5630
+ scrollHeight: v,
5633
5631
  scrollTop: Math.max(g, 0),
5634
- viewportHeight: v
5632
+ viewportHeight: x
5635
5633
  });
5636
5634
  };
5637
- m.suppressFlushSync ? w() : Tc.flushSync(w), a.current !== null && (g === a.current || g <= 0 || g === x - v) && (a.current = null, t(!0), c.current && (clearTimeout(c.current), c.current = null));
5635
+ m.suppressFlushSync ? w() : Tc.flushSync(w), a.current !== null && (g === a.current || g <= 0 || g === v - x) && (a.current = null, t(!0), c.current && (clearTimeout(c.current), c.current = null));
5638
5636
  },
5639
5637
  [e, t, s]
5640
5638
  );
@@ -5645,23 +5643,23 @@ function Tu(e, t, n, r = sr, o, s) {
5645
5643
  };
5646
5644
  }, [i, u, n, r, o]);
5647
5645
  function d(m) {
5648
- const x = i.current;
5649
- if (!x || (s ? "offsetWidth" in x && x.offsetWidth === 0 : "offsetHeight" in x && x.offsetHeight === 0))
5646
+ const v = i.current;
5647
+ if (!v || (s ? "offsetWidth" in v && v.offsetWidth === 0 : "offsetHeight" in v && v.offsetHeight === 0))
5650
5648
  return;
5651
- const v = m.behavior === "smooth";
5649
+ const x = m.behavior === "smooth";
5652
5650
  let g, p, w;
5653
- $s(x) ? (p = Math.max(
5654
- fn(x.document.documentElement, s ? "width" : "height"),
5655
- s ? x.document.documentElement.scrollWidth : x.document.documentElement.scrollHeight
5656
- ), g = s ? x.innerWidth : x.innerHeight, w = s ? window.scrollX : window.scrollY) : (p = x[s ? "scrollWidth" : "scrollHeight"], g = fn(x, s ? "width" : "height"), w = x[s ? "scrollLeft" : "scrollTop"]);
5651
+ $s(v) ? (p = Math.max(
5652
+ fn(v.document.documentElement, s ? "width" : "height"),
5653
+ s ? v.document.documentElement.scrollWidth : v.document.documentElement.scrollHeight
5654
+ ), g = s ? v.innerWidth : v.innerHeight, w = s ? window.scrollX : window.scrollY) : (p = v[s ? "scrollWidth" : "scrollHeight"], g = fn(v, s ? "width" : "height"), w = v[s ? "scrollLeft" : "scrollTop"]);
5657
5655
  const b = p - g;
5658
5656
  if (m.top = Math.ceil(Math.max(Math.min(b, m.top), 0)), fu(g, p) || m.top === w) {
5659
- e({ scrollHeight: p, scrollTop: w, viewportHeight: g }), v && t(!0);
5657
+ e({ scrollHeight: p, scrollTop: w, viewportHeight: g }), x && t(!0);
5660
5658
  return;
5661
5659
  }
5662
- v ? (a.current = m.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
5660
+ x ? (a.current = m.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
5663
5661
  c.current = null, a.current = null, t(!0);
5664
- }, 1e3)) : a.current = null, s && (m = { behavior: m.behavior, left: m.top }), x.scrollTo(m);
5662
+ }, 1e3)) : a.current = null, s && (m = { behavior: m.behavior, left: m.top }), v.scrollTo(m);
5665
5663
  }
5666
5664
  function h(m) {
5667
5665
  s && (m = { behavior: m.behavior, left: m.top }), i.current.scrollBy(m);
@@ -5707,13 +5705,13 @@ const tv = /* @__PURE__ */ ke(() => {
5707
5705
  ([e, t]) => ({ ...e, ...t }),
5708
5706
  ze(bu, tv)
5709
5707
  ), rv = ({ height: e }) => /* @__PURE__ */ l.jsx("div", { style: { height: e } }), ov = { overflowAnchor: "none", position: ta(), zIndex: 1 }, Ru = { overflowAnchor: "none" }, sv = { ...Ru, display: "inline-block", height: "100%" }, kl = /* @__PURE__ */ V.memo(function({ showTopList: e = !1 }) {
5710
- const t = ve("listState"), n = jt("sizeRanges"), r = ve("useWindowScroll"), o = ve("customScrollParent"), s = jt("windowScrollContainerState"), i = jt("scrollContainerState"), a = o || r ? s : i, c = ve("itemContent"), u = ve("context"), d = ve("groupContent"), h = ve("trackItemSizes"), m = ve("itemSize"), x = ve("log"), v = jt("gap"), g = ve("horizontalDirection"), { callbackRef: p } = wx(
5708
+ const t = ve("listState"), n = jt("sizeRanges"), r = ve("useWindowScroll"), o = ve("customScrollParent"), s = jt("windowScrollContainerState"), i = jt("scrollContainerState"), a = o || r ? s : i, c = ve("itemContent"), u = ve("context"), d = ve("groupContent"), h = ve("trackItemSizes"), m = ve("itemSize"), v = ve("log"), x = jt("gap"), g = ve("horizontalDirection"), { callbackRef: p } = wx(
5711
5709
  n,
5712
5710
  m,
5713
5711
  h,
5714
5712
  e ? sr : a,
5715
- x,
5716
5713
  v,
5714
+ x,
5717
5715
  o,
5718
5716
  g,
5719
5717
  ve("skipAnimationFrameInResizeObserver")
@@ -5721,7 +5719,7 @@ const tv = /* @__PURE__ */ ke(() => {
5721
5719
  ra("deviation", (j) => {
5722
5720
  w !== j && b(j);
5723
5721
  });
5724
- const y = ve("EmptyPlaceholder"), N = ve("ScrollSeekPlaceholder") || rv, S = ve("ListComponent"), T = ve("ItemComponent"), C = ve("GroupComponent"), R = ve("computeItemKey"), I = ve("isSeeking"), A = ve("groupIndices").length > 0, M = ve("alignToBottom"), H = ve("initialItemFinalLocationReached"), U = e ? {} : {
5722
+ const y = ve("EmptyPlaceholder"), N = ve("ScrollSeekPlaceholder") || rv, S = ve("ListComponent"), T = ve("ItemComponent"), C = ve("GroupComponent"), R = ve("computeItemKey"), I = ve("isSeeking"), k = ve("groupIndices").length > 0, M = ve("alignToBottom"), H = ve("initialItemFinalLocationReached"), U = e ? {} : {
5725
5723
  boxSizing: "border-box",
5726
5724
  ...g ? {
5727
5725
  display: "inline-block",
@@ -5779,7 +5777,7 @@ const tv = /* @__PURE__ */ ke(() => {
5779
5777
  key: L,
5780
5778
  style: g ? sv : Ru
5781
5779
  },
5782
- A ? c(j.index, j.groupIndex, j.data, u) : c(j.index, j.data, u)
5780
+ k ? c(j.index, j.groupIndex, j.data, u) : c(j.index, j.data, u)
5783
5781
  );
5784
5782
  })
5785
5783
  }
@@ -5840,7 +5838,7 @@ const uv = /* @__PURE__ */ V.memo(function() {
5840
5838
  });
5841
5839
  function Eu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5842
5840
  return V.memo(function({ children: r, style: o, context: s, ...i }) {
5843
- const a = n("scrollContainerState"), c = t("ScrollerComponent"), u = n("smoothScrollTargetReached"), d = t("scrollerRef"), h = t("horizontalDirection") || !1, { scrollByCallback: m, scrollerRef: x, scrollToCallback: v } = Tu(
5841
+ const a = n("scrollContainerState"), c = t("ScrollerComponent"), u = n("smoothScrollTargetReached"), d = t("scrollerRef"), h = t("horizontalDirection") || !1, { scrollByCallback: m, scrollerRef: v, scrollToCallback: x } = Tu(
5844
5842
  a,
5845
5843
  u,
5846
5844
  c,
@@ -5848,12 +5846,12 @@ function Eu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5848
5846
  void 0,
5849
5847
  h
5850
5848
  );
5851
- return e("scrollTo", v), e("scrollBy", m), /* @__PURE__ */ l.jsx(
5849
+ return e("scrollTo", x), e("scrollBy", m), /* @__PURE__ */ l.jsx(
5852
5850
  c,
5853
5851
  {
5854
5852
  "data-testid": "virtuoso-scroller",
5855
5853
  "data-virtuoso-scroller": !0,
5856
- ref: x,
5854
+ ref: v,
5857
5855
  style: { ...h ? av : iv, ...o },
5858
5856
  tabIndex: 0,
5859
5857
  ...i,
@@ -5865,22 +5863,22 @@ function Eu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5865
5863
  }
5866
5864
  function Nu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
5867
5865
  return V.memo(function({ children: r, style: o, context: s, ...i }) {
5868
- const a = n("windowScrollContainerState"), c = t("ScrollerComponent"), u = n("smoothScrollTargetReached"), d = t("totalListHeight"), h = t("deviation"), m = t("customScrollParent"), x = V.useRef(null), v = t("scrollerRef"), { scrollByCallback: g, scrollerRef: p, scrollToCallback: w } = Tu(
5866
+ const a = n("windowScrollContainerState"), c = t("ScrollerComponent"), u = n("smoothScrollTargetReached"), d = t("totalListHeight"), h = t("deviation"), m = t("customScrollParent"), v = V.useRef(null), x = t("scrollerRef"), { scrollByCallback: g, scrollerRef: p, scrollToCallback: w } = Tu(
5869
5867
  a,
5870
5868
  u,
5871
5869
  c,
5872
- v,
5870
+ x,
5873
5871
  m
5874
5872
  );
5875
5873
  return Cu(() => {
5876
5874
  var b;
5877
- return p.current = m || ((b = x.current) == null ? void 0 : b.ownerDocument.defaultView), () => {
5875
+ return p.current = m || ((b = v.current) == null ? void 0 : b.ownerDocument.defaultView), () => {
5878
5876
  p.current = null;
5879
5877
  };
5880
5878
  }, [p, m]), e("windowScrollTo", w), e("scrollBy", g), /* @__PURE__ */ l.jsx(
5881
5879
  c,
5882
5880
  {
5883
- ref: x,
5881
+ ref: v,
5884
5882
  "data-virtuoso-scroller": !0,
5885
5883
  style: { position: "relative", ...o, ...d !== 0 ? { height: d + h } : {} },
5886
5884
  ...i,
@@ -6059,15 +6057,15 @@ const Tv = /* @__PURE__ */ ke(
6059
6057
  { increaseViewportBy: e, listBoundary: t, overscan: n, visibleRange: r },
6060
6058
  { footerHeight: o, headerHeight: s, scrollBy: i, scrollContainerState: a, scrollTo: c, scrollTop: u, smoothScrollTargetReached: d, viewportHeight: h },
6061
6059
  m,
6062
- x,
6063
- { didMount: v, propsReady: g },
6060
+ v,
6061
+ { didMount: x, propsReady: g },
6064
6062
  { customScrollParent: p, useWindowScroll: w, windowScrollContainerState: b, windowScrollTo: y, windowViewportRect: N },
6065
6063
  S
6066
6064
  ]) => {
6067
- const T = W(0), C = W(0), R = W(Al), I = W({ height: 0, width: 0 }), A = W({ height: 0, width: 0 }), M = Ee(), H = Ee(), U = W(0), j = W(null), $ = W({ column: 0, row: 0 }), L = Ee(), Q = Ee(), O = W(!1), _ = W(0), G = W(!0), Z = W(!1), q = W(!1);
6065
+ const T = W(0), C = W(0), R = W(Al), I = W({ height: 0, width: 0 }), k = W({ height: 0, width: 0 }), M = Ee(), H = Ee(), U = W(0), j = W(null), $ = W({ column: 0, row: 0 }), L = Ee(), Q = Ee(), O = W(!1), _ = W(0), G = W(!0), Z = W(!1), q = W(!1);
6068
6066
  Me(
6069
6067
  B(
6070
- v,
6068
+ x,
6071
6069
  Ce(_),
6072
6070
  pe(([P, X]) => !!X)
6073
6071
  ),
@@ -6076,7 +6074,7 @@ const Tv = /* @__PURE__ */ ke(
6076
6074
  }
6077
6075
  ), Me(
6078
6076
  B(
6079
- nt(v, G, A, I, _, Z),
6077
+ nt(x, G, k, I, _, Z),
6080
6078
  pe(([P, X, te, ue, , se]) => P && !X && te.height !== 0 && ue.height !== 0 && !se)
6081
6079
  ),
6082
6080
  ([, , , , P]) => {
@@ -6095,12 +6093,12 @@ const Tv = /* @__PURE__ */ ke(
6095
6093
  C
6096
6094
  ), Me(
6097
6095
  B(
6098
- v,
6096
+ x,
6099
6097
  Ce(Q),
6100
6098
  pe(([, P]) => P != null)
6101
6099
  ),
6102
6100
  ([, P]) => {
6103
- P && (we(I, P.viewport), we(A, P.item), we($, P.gap), P.scrollTop > 0 && (we(O, !0), Dt(B(u, In(1)), (X) => {
6101
+ P && (we(I, P.viewport), we(k, P.item), we($, P.gap), P.scrollTop > 0 && (we(O, !0), Dt(B(u, In(1)), (X) => {
6104
6102
  we(O, !1);
6105
6103
  }), we(c, { top: P.scrollTop })));
6106
6104
  }
@@ -6114,7 +6112,7 @@ const Tv = /* @__PURE__ */ ke(
6114
6112
  B(
6115
6113
  nt(
6116
6114
  he(I, no),
6117
- he(A, no),
6115
+ he(k, no),
6118
6116
  he($, (P, X) => P && P.column === X.column && P.row === X.row),
6119
6117
  he(u)
6120
6118
  ),
@@ -6132,7 +6130,7 @@ const Tv = /* @__PURE__ */ ke(
6132
6130
  he(T),
6133
6131
  r,
6134
6132
  he($, Cv),
6135
- he(A, no),
6133
+ he(k, no),
6136
6134
  he(I, no),
6137
6135
  he(j),
6138
6136
  he(C),
@@ -6161,10 +6159,10 @@ const Tv = /* @__PURE__ */ ke(
6161
6159
  const et = Zi(je, P), ft = et + Math.max(De - 1, 0);
6162
6160
  return Sv(Ol(et, ft, Pe));
6163
6161
  }
6164
- const Le = Iu(ae, J, xe);
6165
- let Ve, Ze;
6166
- de ? X === 0 && te === 0 && De > 0 ? (Ve = 0, Ze = De - 1) : (Ve = Le * Do((X + Se) / (rt + Se)), Ze = Le * Pl((te + Se) / (rt + Se)) - 1, Ze = zs(P - 1, Tr(Ze, Le - 1)), Ve = zs(Ze, Tr(0, Ve))) : (Ve = 0, Ze = -1);
6167
- const wt = Ol(Ve, Ze, Pe), { bottom: dt, top: Rt } = Ml(Ae, ue, se, wt), Qe = Pl(P / Le), at = Qe * rt + (Qe - 1) * Se - dt;
6162
+ const $e = Iu(ae, J, xe);
6163
+ let Ye, Ze;
6164
+ de ? X === 0 && te === 0 && De > 0 ? (Ye = 0, Ze = De - 1) : (Ye = $e * Do((X + Se) / (rt + Se)), Ze = $e * Pl((te + Se) / (rt + Se)) - 1, Ze = zs(P - 1, Tr(Ze, $e - 1)), Ye = zs(Ze, Tr(0, Ye))) : (Ye = 0, Ze = -1);
6165
+ const wt = Ol(Ye, Ze, Pe), { bottom: dt, top: Rt } = Ml(Ae, ue, se, wt), Qe = Pl(P / $e), at = Qe * rt + (Qe - 1) * Se - dt;
6168
6166
  return { bottom: dt, itemHeight: rt, items: wt, itemWidth: J, offsetBottom: at, offsetTop: Rt, top: Rt };
6169
6167
  }
6170
6168
  )
@@ -6179,7 +6177,7 @@ const Tv = /* @__PURE__ */ ke(
6179
6177
  T
6180
6178
  ), le(
6181
6179
  B(
6182
- nt(I, A, R, $),
6180
+ nt(I, k, R, $),
6183
6181
  pe(([P, X, { items: te }]) => te.length > 0 && X.height !== 0 && P.height !== 0),
6184
6182
  re(([P, X, { items: te }, ue]) => {
6185
6183
  const { bottom: se, top: Ae } = Ml(P, ue, X, te);
@@ -6230,10 +6228,10 @@ const Tv = /* @__PURE__ */ ke(
6230
6228
  nn(0)
6231
6229
  )
6232
6230
  );
6233
- le(ce, x.scrollSeekRangeChanged), le(
6231
+ le(ce, v.scrollSeekRangeChanged), le(
6234
6232
  B(
6235
6233
  M,
6236
- Ce(I, A, T, $),
6234
+ Ce(I, k, T, $),
6237
6235
  re(([P, X, te, ue, se]) => {
6238
6236
  const Ae = du(P), { align: Pe, behavior: De, offset: de } = Ae;
6239
6237
  let je = Ae.index;
@@ -6267,7 +6265,7 @@ const Tv = /* @__PURE__ */ ke(
6267
6265
  headerHeight: s,
6268
6266
  increaseViewportBy: e,
6269
6267
  initialItemCount: C,
6270
- itemDimensions: A,
6268
+ itemDimensions: k,
6271
6269
  overscan: n,
6272
6270
  restoreStateFrom: Q,
6273
6271
  scrollBy: i,
@@ -6283,7 +6281,7 @@ const Tv = /* @__PURE__ */ ke(
6283
6281
  windowScrollContainerState: b,
6284
6282
  windowScrollTo: y,
6285
6283
  windowViewportRect: N,
6286
- ...x,
6284
+ ...v,
6287
6285
  // output
6288
6286
  gridState: R,
6289
6287
  horizontalDirection: q,
@@ -6319,7 +6317,7 @@ const Rv = /* @__PURE__ */ ke(() => {
6319
6317
  const e = W((h) => `Item ${h}`), t = W({}), n = W(null), r = W("virtuoso-grid-item"), o = W("virtuoso-grid-list"), s = W(na), i = W("div"), a = W(sr), c = (h, m = null) => ut(
6320
6318
  B(
6321
6319
  t,
6322
- re((x) => x[h]),
6320
+ re((v) => v[h]),
6323
6321
  He()
6324
6322
  ),
6325
6323
  m
@@ -6346,7 +6344,7 @@ const Rv = /* @__PURE__ */ ke(() => {
6346
6344
  ([e, t]) => ({ ...e, ...t }),
6347
6345
  ze(Tv, Rv)
6348
6346
  ), Nv = /* @__PURE__ */ V.memo(function() {
6349
- const e = We("gridState"), t = We("listClassName"), n = We("itemClassName"), r = We("itemContent"), o = We("computeItemKey"), s = We("isSeeking"), i = kt("scrollHeight"), a = We("ItemComponent"), c = We("ListComponent"), u = We("ScrollSeekPlaceholder"), d = We("context"), h = kt("itemDimensions"), m = kt("gap"), x = We("log"), v = We("stateRestoreInProgress"), g = kt("reportReadyState"), p = _n(
6347
+ const e = We("gridState"), t = We("listClassName"), n = We("itemClassName"), r = We("itemContent"), o = We("computeItemKey"), s = We("isSeeking"), i = kt("scrollHeight"), a = We("ItemComponent"), c = We("ListComponent"), u = We("ScrollSeekPlaceholder"), d = We("context"), h = kt("itemDimensions"), m = kt("gap"), v = We("log"), x = We("stateRestoreInProgress"), g = kt("reportReadyState"), p = _n(
6350
6348
  V.useMemo(
6351
6349
  () => (w) => {
6352
6350
  const b = w.parentElement.parentElement.scrollHeight;
@@ -6357,18 +6355,18 @@ const Rv = /* @__PURE__ */ ke(() => {
6357
6355
  h({ height: N, width: S });
6358
6356
  }
6359
6357
  m({
6360
- column: Dl("column-gap", getComputedStyle(w).columnGap, x),
6361
- row: Dl("row-gap", getComputedStyle(w).rowGap, x)
6358
+ column: Dl("column-gap", getComputedStyle(w).columnGap, v),
6359
+ row: Dl("row-gap", getComputedStyle(w).rowGap, v)
6362
6360
  });
6363
6361
  },
6364
- [i, h, m, x]
6362
+ [i, h, m, v]
6365
6363
  ),
6366
6364
  !0,
6367
6365
  !1
6368
6366
  );
6369
6367
  return Cu(() => {
6370
6368
  e.itemHeight > 0 && e.itemWidth > 0 && g(!0);
6371
- }, [e]), v ? null : /* @__PURE__ */ l.jsx(
6369
+ }, [e]), x ? null : /* @__PURE__ */ l.jsx(
6372
6370
  c,
6373
6371
  {
6374
6372
  className: t,
@@ -6545,14 +6543,14 @@ function zt(e, t = []) {
6545
6543
  n = [...n, i];
6546
6544
  const u = (h) => {
6547
6545
  var w;
6548
- const { scope: m, children: x, ...v } = h, g = ((w = m == null ? void 0 : m[e]) == null ? void 0 : w[c]) || a, p = f.useMemo(() => v, Object.values(v));
6549
- return /* @__PURE__ */ l.jsx(g.Provider, { value: p, children: x });
6546
+ const { scope: m, children: v, ...x } = h, g = ((w = m == null ? void 0 : m[e]) == null ? void 0 : w[c]) || a, p = f.useMemo(() => x, Object.values(x));
6547
+ return /* @__PURE__ */ l.jsx(g.Provider, { value: p, children: v });
6550
6548
  };
6551
6549
  u.displayName = s + "Provider";
6552
6550
  function d(h, m) {
6553
6551
  var g;
6554
- const x = ((g = m == null ? void 0 : m[e]) == null ? void 0 : g[c]) || a, v = f.useContext(x);
6555
- if (v) return v;
6552
+ const v = ((g = m == null ? void 0 : m[e]) == null ? void 0 : g[c]) || a, x = f.useContext(v);
6553
+ if (x) return x;
6556
6554
  if (i !== void 0) return i;
6557
6555
  throw new Error(`\`${h}\` must be used within \`${s}\``);
6558
6556
  }
@@ -6718,22 +6716,22 @@ function Uv(e) {
6718
6716
  }, [a]), st(() => {
6719
6717
  const u = r.current, d = o.current;
6720
6718
  if (d !== e) {
6721
- const m = s.current, x = ro(u);
6722
- e ? c("MOUNT") : x === "none" || (u == null ? void 0 : u.display) === "none" ? c("UNMOUNT") : c(d && m !== x ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
6719
+ const m = s.current, v = ro(u);
6720
+ e ? c("MOUNT") : v === "none" || (u == null ? void 0 : u.display) === "none" ? c("UNMOUNT") : c(d && m !== v ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
6723
6721
  }
6724
6722
  }, [e, c]), st(() => {
6725
6723
  if (t) {
6726
6724
  let u;
6727
- const d = t.ownerDocument.defaultView ?? window, h = (x) => {
6728
- const g = ro(r.current).includes(CSS.escape(x.animationName));
6729
- if (x.target === t && g && (c("ANIMATION_END"), !o.current)) {
6725
+ const d = t.ownerDocument.defaultView ?? window, h = (v) => {
6726
+ const g = ro(r.current).includes(CSS.escape(v.animationName));
6727
+ if (v.target === t && g && (c("ANIMATION_END"), !o.current)) {
6730
6728
  const p = t.style.animationFillMode;
6731
6729
  t.style.animationFillMode = "forwards", u = d.setTimeout(() => {
6732
6730
  t.style.animationFillMode === "forwards" && (t.style.animationFillMode = p);
6733
6731
  });
6734
6732
  }
6735
- }, m = (x) => {
6736
- x.target === t && (s.current = ro(r.current));
6733
+ }, m = (v) => {
6734
+ v.target === t && (s.current = ro(r.current));
6737
6735
  };
6738
6736
  return t.addEventListener("animationstart", m), t.addEventListener("animationcancel", h), t.addEventListener("animationend", h), () => {
6739
6737
  d.clearTimeout(u), t.removeEventListener("animationstart", m), t.removeEventListener("animationcancel", h), t.removeEventListener("animationend", h);
@@ -6828,7 +6826,7 @@ var ia = "CollapsibleContent", qv = f.forwardRef(
6828
6826
  );
6829
6827
  qv.displayName = ia;
6830
6828
  var Xv = f.forwardRef((e, t) => {
6831
- const { __scopeCollapsible: n, present: r, children: o, ...s } = e, i = sa(ia, n), [a, c] = f.useState(r), u = f.useRef(null), d = Te(t, u), h = f.useRef(0), m = h.current, x = f.useRef(0), v = x.current, g = i.open || a, p = f.useRef(g), w = f.useRef(void 0);
6829
+ const { __scopeCollapsible: n, present: r, children: o, ...s } = e, i = sa(ia, n), [a, c] = f.useState(r), u = f.useRef(null), d = Te(t, u), h = f.useRef(0), m = h.current, v = f.useRef(0), x = v.current, g = i.open || a, p = f.useRef(g), w = f.useRef(void 0);
6832
6830
  return f.useEffect(() => {
6833
6831
  const b = requestAnimationFrame(() => p.current = !1);
6834
6832
  return () => cancelAnimationFrame(b);
@@ -6840,7 +6838,7 @@ var Xv = f.forwardRef((e, t) => {
6840
6838
  animationName: b.style.animationName
6841
6839
  }, b.style.transitionDuration = "0s", b.style.animationName = "none";
6842
6840
  const y = b.getBoundingClientRect();
6843
- h.current = y.height, x.current = y.width, p.current || (b.style.transitionDuration = w.current.transitionDuration, b.style.animationName = w.current.animationName), c(r);
6841
+ h.current = y.height, v.current = y.width, p.current || (b.style.transitionDuration = w.current.transitionDuration, b.style.animationName = w.current.animationName), c(r);
6844
6842
  }
6845
6843
  }, [i.open, r]), /* @__PURE__ */ l.jsx(
6846
6844
  me.div,
@@ -6853,7 +6851,7 @@ var Xv = f.forwardRef((e, t) => {
6853
6851
  ref: d,
6854
6852
  style: {
6855
6853
  "--radix-collapsible-content-height": m ? `${m}px` : void 0,
6856
- "--radix-collapsible-content-width": v ? `${v}px` : void 0,
6854
+ "--radix-collapsible-content-width": x ? `${x}px` : void 0,
6857
6855
  ...e.style
6858
6856
  },
6859
6857
  children: g && o
@@ -7006,8 +7004,8 @@ function sb(e, t = !1) {
7006
7004
  return `${e.length}:${n}:${r}`;
7007
7005
  }
7008
7006
  function ib(e, t) {
7009
- const [n, r] = fe(e), o = Ye(e), s = Ye(null);
7010
- return $e(() => {
7007
+ const [n, r] = fe(e), o = Ke(e), s = Ke(null);
7008
+ return Fe(() => {
7011
7009
  if (!t) {
7012
7010
  r(e);
7013
7011
  return;
@@ -7030,17 +7028,17 @@ function Ws({
7030
7028
  streamingThrottleMs: s = 100
7031
7029
  }) {
7032
7030
  const i = ib(e, r), a = sb(i, r), [c, u] = fe(() => {
7033
- var x;
7034
- return ((x = br.get(a)) == null ? void 0 : x.html) ?? null;
7035
- }), d = Ye(null), h = Ye([]);
7036
- $e(() => {
7031
+ var v;
7032
+ return ((v = br.get(a)) == null ? void 0 : v.html) ?? null;
7033
+ }), d = Ke(null), h = Ke([]);
7034
+ Fe(() => {
7037
7035
  h.current = [];
7038
- const x = br.get(a);
7039
- if (x && x.source === i) {
7040
- x.html !== c && u(x.html);
7036
+ const v = br.get(a);
7037
+ if (v && v.source === i) {
7038
+ v.html !== c && u(v.html);
7041
7039
  return;
7042
7040
  }
7043
- if (x && x.html !== c && u(x.html), !is) {
7041
+ if (v && v.html !== c && u(v.html), !is) {
7044
7042
  let C = !1;
7045
7043
  return (async () => {
7046
7044
  try {
@@ -7053,12 +7051,12 @@ function Ws({
7053
7051
  C = !0;
7054
7052
  };
7055
7053
  }
7056
- let v = !0, g = !1;
7054
+ let x = !0, g = !1;
7057
7055
  const p = `${a}::${Date.now().toString(36)}::${Math.random().toString(36).slice(2)}`;
7058
7056
  d.current = p;
7059
7057
  const w = (C) => {
7060
7058
  const R = C.data;
7061
- if (!R || R.id !== p || R.key && R.key !== a || !v) return;
7059
+ if (!R || R.id !== p || R.key && R.key !== a || !x) return;
7062
7060
  g = !0;
7063
7061
  const I = R.html ?? "";
7064
7062
  br.set(a, { html: I, source: i }), u(I);
@@ -7096,14 +7094,14 @@ function Ws({
7096
7094
  console.warn("[MarkdownContent] worker timeout (ms=" + S + "), falling back to main-thread parse for", a);
7097
7095
  try {
7098
7096
  const C = await $l(i);
7099
- br.set(a, { html: C, source: i }), v && d.current === p && u(C);
7097
+ br.set(a, { html: C, source: i }), x && d.current === p && u(C);
7100
7098
  } catch (C) {
7101
7099
  console.error("[MarkdownContent] fallback parse failed", C);
7102
7100
  }
7103
7101
  }
7104
7102
  }, S);
7105
7103
  return () => {
7106
- if (v = !1, clearTimeout(T), dn.removeEventListener("message", w), d.current === p && (d.current = null), !vo) {
7104
+ if (x = !1, clearTimeout(T), dn.removeEventListener("message", w), d.current === p && (d.current = null), !vo) {
7107
7105
  const C = Er.indexOf(y);
7108
7106
  C >= 0 && Er.splice(C, 1);
7109
7107
  }
@@ -7115,10 +7113,10 @@ function Ws({
7115
7113
  const m = V.useRef(null);
7116
7114
  return V.useEffect(() => {
7117
7115
  if (!c) return;
7118
- const x = m.current;
7119
- if (!x) return;
7120
- const v = Array.from(x.querySelectorAll("pre code"));
7121
- if (!v.length) return;
7116
+ const v = m.current;
7117
+ if (!v) return;
7118
+ const x = Array.from(v.querySelectorAll("pre code"));
7119
+ if (!x.length) return;
7122
7120
  let g = null, p = !1;
7123
7121
  const w = (y, N) => {
7124
7122
  for (const S of y) {
@@ -7131,8 +7129,8 @@ function Ws({
7131
7129
  if (R) {
7132
7130
  g = R;
7133
7131
  try {
7134
- v.forEach((I) => {
7135
- x.contains(I) && (g == null || g.highlightElement(I));
7132
+ x.forEach((I) => {
7133
+ v.contains(I) && (g == null || g.highlightElement(I));
7136
7134
  });
7137
7135
  } catch {
7138
7136
  }
@@ -7146,8 +7144,8 @@ function Ws({
7146
7144
  }
7147
7145
  N.unobserve(T);
7148
7146
  }
7149
- }, b = new IntersectionObserver(w, { root: x, threshold: 0.1 });
7150
- return v.forEach((y) => b.observe(y)), () => {
7147
+ }, b = new IntersectionObserver(w, { root: v, threshold: 0.1 });
7148
+ return x.forEach((y) => b.observe(y)), () => {
7151
7149
  p = !0, b.disconnect();
7152
7150
  };
7153
7151
  }, [c]), c ? /* @__PURE__ */ l.jsx("div", { ref: m, className: D("markdown prose max-w-none break-words dark:prose-invert", t), dangerouslySetInnerHTML: { __html: c } }) : r && o ? null : /* @__PURE__ */ l.jsx("div", { className: D("markdown prose max-w-none break-words dark:prose-invert", t), children: n });
@@ -7302,12 +7300,12 @@ var pb = "DismissableLayer", Si = "dismissableLayer.update", mb = "dismissableLa
7302
7300
  onInteractOutside: i,
7303
7301
  onDismiss: a,
7304
7302
  ...c
7305
- } = e, u = f.useContext(Fu), [d, h] = f.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, x] = f.useState({}), v = Te(t, (C) => h(C)), g = Array.from(u.layers), [p] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), w = g.indexOf(p), b = d ? g.indexOf(d) : -1, y = u.layersWithOutsidePointerEventsDisabled.size > 0, N = b >= w, S = bb((C) => {
7306
- const R = C.target, I = [...u.branches].some((A) => A.contains(R));
7303
+ } = e, u = f.useContext(Fu), [d, h] = f.useState(null), m = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = f.useState({}), x = Te(t, (C) => h(C)), g = Array.from(u.layers), [p] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), w = g.indexOf(p), b = d ? g.indexOf(d) : -1, y = u.layersWithOutsidePointerEventsDisabled.size > 0, N = b >= w, S = bb((C) => {
7304
+ const R = C.target, I = [...u.branches].some((k) => k.contains(R));
7307
7305
  !N || I || (o == null || o(C), i == null || i(C), C.defaultPrevented || a == null || a());
7308
7306
  }, m), T = wb((C) => {
7309
7307
  const R = C.target;
7310
- [...u.branches].some((A) => A.contains(R)) || (s == null || s(C), i == null || i(C), C.defaultPrevented || a == null || a());
7308
+ [...u.branches].some((k) => k.contains(R)) || (s == null || s(C), i == null || i(C), C.defaultPrevented || a == null || a());
7311
7309
  }, m);
7312
7310
  return hb((C) => {
7313
7311
  b === u.layers.size - 1 && (r == null || r(C), !C.defaultPrevented && a && (C.preventDefault(), a()));
@@ -7319,13 +7317,13 @@ var pb = "DismissableLayer", Si = "dismissableLayer.update", mb = "dismissableLa
7319
7317
  }, [d, m, n, u]), f.useEffect(() => () => {
7320
7318
  d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), Vl());
7321
7319
  }, [d, u]), f.useEffect(() => {
7322
- const C = () => x({});
7320
+ const C = () => v({});
7323
7321
  return document.addEventListener(Si, C), () => document.removeEventListener(Si, C);
7324
7322
  }, []), /* @__PURE__ */ l.jsx(
7325
7323
  me.div,
7326
7324
  {
7327
7325
  ...c,
7328
- ref: v,
7326
+ ref: x,
7329
7327
  style: {
7330
7328
  pointerEvents: y ? N ? "auto" : "none" : void 0,
7331
7329
  ...e.style
@@ -7411,7 +7409,7 @@ var Ks = "focusScope.autoFocusOnMount", Ys = "focusScope.autoFocusOnUnmount", Gl
7411
7409
  onMountAutoFocus: o,
7412
7410
  onUnmountAutoFocus: s,
7413
7411
  ...i
7414
- } = e, [a, c] = f.useState(null), u = it(o), d = it(s), h = f.useRef(null), m = Te(t, (g) => c(g)), x = f.useRef({
7412
+ } = e, [a, c] = f.useState(null), u = it(o), d = it(s), h = f.useRef(null), m = Te(t, (g) => c(g)), v = f.useRef({
7415
7413
  paused: !1,
7416
7414
  pause() {
7417
7415
  this.paused = !0;
@@ -7423,11 +7421,11 @@ var Ks = "focusScope.autoFocusOnMount", Ys = "focusScope.autoFocusOnUnmount", Gl
7423
7421
  f.useEffect(() => {
7424
7422
  if (r) {
7425
7423
  let g = function(y) {
7426
- if (x.paused || !a) return;
7424
+ if (v.paused || !a) return;
7427
7425
  const N = y.target;
7428
7426
  a.contains(N) ? h.current = N : ln(h.current, { select: !0 });
7429
7427
  }, p = function(y) {
7430
- if (x.paused || !a) return;
7428
+ if (v.paused || !a) return;
7431
7429
  const N = y.relatedTarget;
7432
7430
  N !== null && (a.contains(N) || ln(h.current, { select: !0 }));
7433
7431
  }, w = function(y) {
@@ -7441,9 +7439,9 @@ var Ks = "focusScope.autoFocusOnMount", Ys = "focusScope.autoFocusOnUnmount", Gl
7441
7439
  document.removeEventListener("focusin", g), document.removeEventListener("focusout", p), b.disconnect();
7442
7440
  };
7443
7441
  }
7444
- }, [r, a, x.paused]), f.useEffect(() => {
7442
+ }, [r, a, v.paused]), f.useEffect(() => {
7445
7443
  if (a) {
7446
- Yl.add(x);
7444
+ Yl.add(v);
7447
7445
  const g = document.activeElement;
7448
7446
  if (!a.contains(g)) {
7449
7447
  const w = new CustomEvent(Ks, Gl);
@@ -7452,23 +7450,23 @@ var Ks = "focusScope.autoFocusOnMount", Ys = "focusScope.autoFocusOnUnmount", Gl
7452
7450
  return () => {
7453
7451
  a.removeEventListener(Ks, u), setTimeout(() => {
7454
7452
  const w = new CustomEvent(Ys, Gl);
7455
- a.addEventListener(Ys, d), a.dispatchEvent(w), w.defaultPrevented || ln(g ?? document.body, { select: !0 }), a.removeEventListener(Ys, d), Yl.remove(x);
7453
+ a.addEventListener(Ys, d), a.dispatchEvent(w), w.defaultPrevented || ln(g ?? document.body, { select: !0 }), a.removeEventListener(Ys, d), Yl.remove(v);
7456
7454
  }, 0);
7457
7455
  };
7458
7456
  }
7459
- }, [a, u, d, x]);
7460
- const v = f.useCallback(
7457
+ }, [a, u, d, v]);
7458
+ const x = f.useCallback(
7461
7459
  (g) => {
7462
- if (!n && !r || x.paused) return;
7460
+ if (!n && !r || v.paused) return;
7463
7461
  const p = g.key === "Tab" && !g.altKey && !g.ctrlKey && !g.metaKey, w = document.activeElement;
7464
7462
  if (p && w) {
7465
7463
  const b = g.currentTarget, [y, N] = Cb(b);
7466
7464
  y && N ? !g.shiftKey && w === N ? (g.preventDefault(), n && ln(y, { select: !0 })) : g.shiftKey && w === y && (g.preventDefault(), n && ln(N, { select: !0 })) : w === b && g.preventDefault();
7467
7465
  }
7468
7466
  },
7469
- [n, r, x.paused]
7467
+ [n, r, v.paused]
7470
7468
  );
7471
- return /* @__PURE__ */ l.jsx(me.div, { tabIndex: -1, ...i, ref: m, onKeyDown: v });
7469
+ return /* @__PURE__ */ l.jsx(me.div, { tabIndex: -1, ...i, ref: m, onKeyDown: x });
7472
7470
  });
7473
7471
  as.displayName = yb;
7474
7472
  function Sb(e, { select: t = !1 } = {}) {
@@ -7703,11 +7701,11 @@ var Uu = Lb(), Js = function() {
7703
7701
  onScrollCapture: Js,
7704
7702
  onWheelCapture: Js,
7705
7703
  onTouchMoveCapture: Js
7706
- }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, d = e.enabled, h = e.shards, m = e.sideCar, x = e.noRelative, v = e.noIsolation, g = e.inert, p = e.allowPinchZoom, w = e.as, b = w === void 0 ? "div" : w, y = e.gapMode, N = Hu(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = m, T = Ob([n, t]), C = Kt(Kt({}, N), o);
7704
+ }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, c = e.className, u = e.removeScrollBar, d = e.enabled, h = e.shards, m = e.sideCar, v = e.noRelative, x = e.noIsolation, g = e.inert, p = e.allowPinchZoom, w = e.as, b = w === void 0 ? "div" : w, y = e.gapMode, N = Hu(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = m, T = Ob([n, t]), C = Kt(Kt({}, N), o);
7707
7705
  return f.createElement(
7708
7706
  f.Fragment,
7709
7707
  null,
7710
- d && f.createElement(S, { sideCar: Uu, removeScrollBar: u, shards: h, noRelative: x, noIsolation: v, inert: g, setCallbacks: s, allowPinchZoom: !!p, lockRef: n, gapMode: y }),
7708
+ d && f.createElement(S, { sideCar: Uu, removeScrollBar: u, shards: h, noRelative: v, noIsolation: x, inert: g, setCallbacks: s, allowPinchZoom: !!p, lockRef: n, gapMode: y }),
7711
7709
  i ? f.cloneElement(f.Children.only(a), Kt(Kt({}, C), { ref: T })) : f.createElement(b, Kt({}, C, { className: c, ref: T }), a)
7712
7710
  );
7713
7711
  });
@@ -7910,8 +7908,8 @@ var $n = Ci ? { passive: !1 } : !1, Zb = function(e) {
7910
7908
  do {
7911
7909
  if (!a)
7912
7910
  break;
7913
- var x = Ku(e, a), v = x[0], g = x[1], p = x[2], w = g - p - s * v;
7914
- (v || w) && Gu(e, a) && (h += w, m += v);
7911
+ var v = Ku(e, a), x = v[0], g = v[1], p = v[2], w = g - p - s * x;
7912
+ (x || w) && Gu(e, a) && (h += w, m += x);
7915
7913
  var b = a.parentNode;
7916
7914
  a = b && b.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? b.host : b;
7917
7915
  } while (
@@ -8008,12 +8006,12 @@ function lw(e) {
8008
8006
  }), document.removeEventListener("wheel", c, $n), document.removeEventListener("touchmove", c, $n), document.removeEventListener("touchstart", d, $n);
8009
8007
  };
8010
8008
  }, []);
8011
- var x = e.removeScrollBar, v = e.inert;
8009
+ var v = e.removeScrollBar, x = e.inert;
8012
8010
  return f.createElement(
8013
8011
  f.Fragment,
8014
8012
  null,
8015
- v ? f.createElement(s, { styles: iw(o) }) : null,
8016
- x ? f.createElement(Jb, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
8013
+ x ? f.createElement(s, { styles: iw(o) }) : null,
8014
+ v ? f.createElement(Jb, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
8017
8015
  );
8018
8016
  }
8019
8017
  function cw(e) {
@@ -8055,8 +8053,8 @@ var dw = function(e) {
8055
8053
  d(m);
8056
8054
  else
8057
8055
  try {
8058
- var x = m.getAttribute(r), v = x !== null && x !== "false", g = (zn.get(m) || 0) + 1, p = (s.get(m) || 0) + 1;
8059
- zn.set(m, g), s.set(m, p), i.push(m), g === 1 && v && ao.set(m, !0), p === 1 && m.setAttribute(n, "true"), v || m.setAttribute(r, "true");
8056
+ var v = m.getAttribute(r), x = v !== null && v !== "false", g = (zn.get(m) || 0) + 1, p = (s.get(m) || 0) + 1;
8057
+ zn.set(m, g), s.set(m, p), i.push(m), g === 1 && x && ao.set(m, !0), p === 1 && m.setAttribute(n, "true"), x || m.setAttribute(r, "true");
8060
8058
  } catch (w) {
8061
8059
  console.error("aria-hidden: cannot operate on ", m, w);
8062
8060
  }
@@ -8064,8 +8062,8 @@ var dw = function(e) {
8064
8062
  };
8065
8063
  return d(t), a.clear(), Qs++, function() {
8066
8064
  i.forEach(function(h) {
8067
- var m = zn.get(h) - 1, x = s.get(h) - 1;
8068
- zn.set(h, m), s.set(h, x), m || (ao.has(h) || h.removeAttribute(r), ao.delete(h)), x || h.removeAttribute(n);
8065
+ var m = zn.get(h) - 1, v = s.get(h) - 1;
8066
+ zn.set(h, m), s.set(h, v), m || (ao.has(h) || h.removeAttribute(r), ao.delete(h)), v || h.removeAttribute(n);
8069
8067
  }), Qs--, Qs || (zn = /* @__PURE__ */ new WeakMap(), zn = /* @__PURE__ */ new WeakMap(), ao = /* @__PURE__ */ new WeakMap(), lo = {});
8070
8068
  };
8071
8069
  }, da = function(e, t, n) {
@@ -8389,7 +8387,7 @@ const Ew = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
8389
8387
  Ew.displayName = ps.displayName;
8390
8388
  function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8391
8389
  const [s, i] = fe(!1), [a, c] = fe(null), [u, d] = fe(null), { toast: h } = ca();
8392
- $e(() => {
8390
+ Fe(() => {
8393
8391
  e && n && m();
8394
8392
  }, [e, n]);
8395
8393
  const m = async () => {
@@ -8404,14 +8402,14 @@ function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8404
8402
  i(!1);
8405
8403
  }
8406
8404
  }
8407
- }, x = async () => {
8405
+ }, v = async () => {
8408
8406
  if (n)
8409
8407
  try {
8410
8408
  await ab(n), h({ title: "Download started", description: `Downloading ${r}` });
8411
8409
  } catch (w) {
8412
8410
  console.error("Failed to download file:", w), h({ title: "Download failed", description: String(w), variant: "destructive" });
8413
8411
  }
8414
- }, v = async () => {
8412
+ }, x = async () => {
8415
8413
  if (n)
8416
8414
  try {
8417
8415
  const w = await zl(n), b = new Blob([w], { type: o }), y = URL.createObjectURL(b);
@@ -8469,7 +8467,7 @@ function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8469
8467
  {
8470
8468
  variant: "outline",
8471
8469
  size: "sm",
8472
- onClick: v,
8470
+ onClick: x,
8473
8471
  className: "flex items-center gap-2",
8474
8472
  children: [
8475
8473
  /* @__PURE__ */ l.jsx($p, { className: "h-4 w-4" }),
@@ -8482,7 +8480,7 @@ function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8482
8480
  {
8483
8481
  variant: "outline",
8484
8482
  size: "sm",
8485
- onClick: x,
8483
+ onClick: v,
8486
8484
  className: "flex items-center gap-2",
8487
8485
  children: [
8488
8486
  /* @__PURE__ */ l.jsx(Hp, { className: "h-4 w-4" }),
@@ -8498,7 +8496,7 @@ function Nw({ isOpen: e, onClose: t, fileId: n, fileName: r, mimeType: o }) {
8498
8496
  const Co = "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";
8499
8497
  function Iw({ className: e }) {
8500
8498
  const [t, n] = fe(0);
8501
- return $e(() => {
8499
+ return Fe(() => {
8502
8500
  const r = setInterval(() => n((o) => (o + 1) % 4), 500);
8503
8501
  return () => clearInterval(r);
8504
8502
  }, []), /* @__PURE__ */ l.jsxs(
@@ -8526,14 +8524,14 @@ const jw = V.memo(function({
8526
8524
  truncateToolMessages: d = !0,
8527
8525
  toolMessagePreviewLength: h = 200,
8528
8526
  truncateUserMessages: m = !0,
8529
- userMessagePreviewLength: x = 200,
8530
- customStyles: v = {},
8527
+ userMessagePreviewLength: v = 200,
8528
+ customStyles: x = {},
8531
8529
  onEdit: g,
8532
8530
  onRegenerate: p,
8533
8531
  onCancelEdit: w,
8534
8532
  onCopy: b
8535
8533
  }) {
8536
- const [y, N] = fe(!1), [S, T] = fe(!1), [C, R] = fe(!1), [I, A] = fe(!1), { currentThreadId: M } = Vi();
8534
+ const [y, N] = fe(!1), [S, T] = fe(!1), [C, R] = fe(!1), [I, k] = fe(!1), { currentThreadId: M } = Vi();
8537
8535
  ca();
8538
8536
  const [H, U] = fe({}), [j, $] = fe(!1), [L, Q] = fe(null), O = u === "phone" || u === "half-screen", _ = t.role, G = _ === "tool", Z = V.useMemo(() => {
8539
8537
  switch (_) {
@@ -8706,10 +8704,10 @@ const jw = V.memo(function({
8706
8704
  if (xe !== null) return /* @__PURE__ */ l.jsx(nc, { data: xe });
8707
8705
  if (_ === "user" && m) {
8708
8706
  const Se = q.trim();
8709
- if (Se.length > x)
8710
- return /* @__PURE__ */ l.jsxs(Fl, { open: I, onOpenChange: A, children: [
8707
+ if (Se.length > v)
8708
+ return /* @__PURE__ */ l.jsxs(Fl, { open: I, onOpenChange: k, children: [
8711
8709
  /* @__PURE__ */ l.jsx("div", { className: D("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: I ? /* @__PURE__ */ l.jsx(Ws, { content: Se, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ l.jsxs("pre", { className: D("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8712
- Se.substring(0, x),
8710
+ Se.substring(0, v),
8713
8711
  "..."
8714
8712
  ] }) }),
8715
8713
  /* @__PURE__ */ l.jsx(Bl, { asChild: !0, children: /* @__PURE__ */ l.jsx(
@@ -8724,7 +8722,7 @@ const jw = V.memo(function({
8724
8722
  ] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
8725
8723
  /* @__PURE__ */ l.jsx(Wn, { className: "h-3 w-3 mr-1" }),
8726
8724
  " Show more (",
8727
- Se.length - x,
8725
+ Se.length - v,
8728
8726
  " chars)"
8729
8727
  ] })
8730
8728
  }
@@ -8752,7 +8750,7 @@ const jw = V.memo(function({
8752
8750
  ] });
8753
8751
  }, De = un(() => Dw(t), [t]);
8754
8752
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
8755
- /* @__PURE__ */ l.jsx("div", { className: D(ue(), v.container), children: /* @__PURE__ */ l.jsxs("div", { className: D(se(), v.content), children: [
8753
+ /* @__PURE__ */ l.jsx("div", { className: D(ue(), x.container), children: /* @__PURE__ */ l.jsxs("div", { className: D(se(), x.content), children: [
8756
8754
  (a || c || G) && /* @__PURE__ */ l.jsxs(
8757
8755
  "div",
8758
8756
  {
@@ -8760,7 +8758,7 @@ const jw = V.memo(function({
8760
8758
  "flex items-center justify-between mb-2 pb-2 border-b border-current/10",
8761
8759
  O && "mb-1 pb-1",
8762
8760
  Z,
8763
- v.header
8761
+ x.header
8764
8762
  ),
8765
8763
  children: [
8766
8764
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -8805,7 +8803,7 @@ const jw = V.memo(function({
8805
8803
  className: D(
8806
8804
  "opacity-0 group-hover:opacity-100 transition-opacity",
8807
8805
  "flex items-center gap-1",
8808
- v.actions
8806
+ x.actions
8809
8807
  ),
8810
8808
  children: [
8811
8809
  /* @__PURE__ */ l.jsx(
@@ -8870,7 +8868,7 @@ const jw = V.memo(function({
8870
8868
  className: D(
8871
8869
  "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
8872
8870
  "flex items-center gap-1",
8873
- v.actions
8871
+ x.actions
8874
8872
  ),
8875
8873
  children: [
8876
8874
  /* @__PURE__ */ l.jsx(
@@ -9047,8 +9045,8 @@ function Dw(e) {
9047
9045
  return e.name && e.name.trim() ? e.name : e.model && e.model.includes("/") ? e.model.split("/").pop() || null : e.model || null;
9048
9046
  }
9049
9047
  function Lw(e, t) {
9050
- const [n, r] = fe(e), o = Ye(e), s = Ye(null);
9051
- return $e(() => {
9048
+ const [n, r] = fe(e), o = Ke(e), s = Ke(null);
9049
+ return Fe(() => {
9052
9050
  if (!t) {
9053
9051
  r(e);
9054
9052
  return;
@@ -9107,7 +9105,7 @@ function bd(e) {
9107
9105
  const u = c[1], d = /Issue\(([\s\S]*?)\)(?:,|$)/g;
9108
9106
  let h = null;
9109
9107
  for (; (h = d.exec(u)) !== null; ) {
9110
- const m = h[1], x = /title\s*=\s*(['"])([\s\S]*?)\1/.exec(m), v = /description\s*=\s*(['"])([\s\S]*?)\1/.exec(m), g = x ? x[2].trim() : "", p = v ? v[2].trim() : "";
9108
+ const m = h[1], v = /title\s*=\s*(['"])([\s\S]*?)\1/.exec(m), x = /description\s*=\s*(['"])([\s\S]*?)\1/.exec(m), g = v ? v[2].trim() : "", p = x ? x[2].trim() : "";
9111
9109
  n[i].push({ title: g, description: p });
9112
9110
  }
9113
9111
  }
@@ -9165,32 +9163,44 @@ function Hw({
9165
9163
  onCancelEdit: d,
9166
9164
  className: h,
9167
9165
  style: m,
9168
- emptyMessage: x,
9169
- followNewMessages: v = !0
9166
+ emptyMessage: v,
9167
+ followNewMessages: x = !0
9170
9168
  }) {
9171
- const g = Ye(null), p = Ye(null), w = Ye(!1), b = Ye(!0), y = Ye(e.length), N = Ye(!!v), S = t ? b.current ? "smooth" : !1 : "smooth";
9172
- $e(() => {
9169
+ const g = Ke(null), p = Ke(null), w = Ke(!1), b = Ke(!0), y = Ke(e.length), N = Ke(!!x), S = t ? b.current ? "smooth" : !1 : "smooth";
9170
+ Fe(() => {
9173
9171
  console.log("[MessageList] Messages updated:", {
9174
9172
  count: e.length,
9175
9173
  firstThree: e.slice(0, 3).map((R) => `${R.role}:${R.id.slice(0, 8)}`),
9176
9174
  lastThree: e.slice(-3).map((R) => `${R.role}:${R.id.slice(0, 8)}`)
9177
9175
  });
9178
- }, [e]), $e(() => {
9176
+ }, [e]), Fe(() => {
9179
9177
  const R = g.current;
9180
9178
  if (!R) return;
9181
9179
  let I = !1;
9182
- const A = () => {
9180
+ const k = () => {
9183
9181
  I || (window.requestAnimationFrame(() => {
9184
9182
  const H = R.scrollHeight - R.scrollTop - R.clientHeight <= 32;
9185
9183
  N.current && !H && (N.current = !1), b.current = H, I = !1;
9186
9184
  }), I = !0);
9187
9185
  };
9188
- return R.addEventListener("scroll", A, { passive: !0 }), A(), () => {
9189
- R.removeEventListener("scroll", A);
9186
+ return R.addEventListener("scroll", k, { passive: !0 }), k(), () => {
9187
+ R.removeEventListener("scroll", k);
9190
9188
  };
9191
- }, []), $e(() => {
9189
+ }, []), Fe(() => {
9190
+ const R = y.current, I = e.length;
9191
+ if (I > R) {
9192
+ const k = e[I - 1];
9193
+ k && k.role === "user" && requestAnimationFrame(() => {
9194
+ var M;
9195
+ try {
9196
+ (M = p.current) == null || M.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "auto", align: "end" }), b.current = !0, N.current = !!x;
9197
+ } catch {
9198
+ }
9199
+ });
9200
+ }
9201
+ }, [e.length, x]), Fe(() => {
9192
9202
  e.length < y.current && (b.current = !0), y.current = e.length;
9193
- }, [e.length]), $e(() => {
9203
+ }, [e.length]), Fe(() => {
9194
9204
  var R;
9195
9205
  t || w.current || b.current && ((R = p.current) == null || R.scrollToIndex({
9196
9206
  index: Math.max(0, e.length - 1),
@@ -9207,7 +9217,7 @@ function Hw({
9207
9217
  await (a == null ? void 0 : a());
9208
9218
  return;
9209
9219
  }
9210
- const I = R.scrollHeight, A = R.scrollTop;
9220
+ const I = R.scrollHeight, k = R.scrollTop;
9211
9221
  w.current = !0;
9212
9222
  try {
9213
9223
  await a();
@@ -9219,7 +9229,7 @@ function Hw({
9219
9229
  return;
9220
9230
  }
9221
9231
  const H = M.scrollHeight;
9222
- M.scrollTop = A + (H - I);
9232
+ M.scrollTop = k + (H - I);
9223
9233
  const U = H - M.scrollTop - M.clientHeight;
9224
9234
  b.current = U <= 32, w.current = !1;
9225
9235
  });
@@ -9228,12 +9238,12 @@ function Hw({
9228
9238
  }, [a]), C = (R, I) => {
9229
9239
  g.current = R, I && (typeof I == "function" ? I(R) : I.current = R);
9230
9240
  };
9231
- return $e(() => {
9241
+ return Fe(() => {
9232
9242
  if (!t) {
9233
- N.current = !!v;
9243
+ N.current = !!x;
9234
9244
  return;
9235
9245
  }
9236
- v && requestAnimationFrame(() => {
9246
+ x && requestAnimationFrame(() => {
9237
9247
  var R;
9238
9248
  if (b.current)
9239
9249
  try {
@@ -9241,7 +9251,7 @@ function Hw({
9241
9251
  } catch {
9242
9252
  }
9243
9253
  });
9244
- }, [t, n]), e.length === 0 ? /* @__PURE__ */ l.jsx("div", { className: h, style: m, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: x || "No messages yet. Start a conversation!" }) }) : /* @__PURE__ */ l.jsx("div", { className: h, style: m, children: /* @__PURE__ */ l.jsx(
9254
+ }, [t, n]), e.length === 0 ? /* @__PURE__ */ l.jsx("div", { className: h, style: m, children: /* @__PURE__ */ l.jsx("div", { className: "flex items-center justify-center py-8 text-muted-foreground text-center max-w-md mx-auto", children: v || "No messages yet. Start a conversation!" }) }) : /* @__PURE__ */ l.jsx("div", { className: h, style: m, children: /* @__PURE__ */ l.jsx(
9245
9255
  bv,
9246
9256
  {
9247
9257
  ref: (R) => {
@@ -9265,7 +9275,7 @@ function Hw({
9265
9275
  "div",
9266
9276
  {
9267
9277
  ...R,
9268
- ref: (A) => C(A, I),
9278
+ ref: (k) => C(k, I),
9269
9279
  style: {
9270
9280
  overflowAnchor: "none",
9271
9281
  willChange: t ? "scroll-position" : "transform",
@@ -9368,14 +9378,14 @@ function ma(e) {
9368
9378
  }
9369
9379
  );
9370
9380
  u.displayName = a;
9371
- const d = e + "CollectionItemSlot", h = "data-radix-collection-item", m = Xn(d), x = V.forwardRef(
9381
+ const d = e + "CollectionItemSlot", h = "data-radix-collection-item", m = Xn(d), v = V.forwardRef(
9372
9382
  (g, p) => {
9373
9383
  const { scope: w, children: b, ...y } = g, N = V.useRef(null), S = Te(p, N), T = s(d, w);
9374
9384
  return V.useEffect(() => (T.itemMap.set(N, { ref: N, ...y }), () => void T.itemMap.delete(N))), /* @__PURE__ */ l.jsx(m, { [h]: "", ref: S, children: b });
9375
9385
  }
9376
9386
  );
9377
- x.displayName = d;
9378
- function v(g) {
9387
+ v.displayName = d;
9388
+ function x(g) {
9379
9389
  const p = s(e + "CollectionConsumer", g);
9380
9390
  return V.useCallback(() => {
9381
9391
  const b = p.collectionRef.current;
@@ -9387,8 +9397,8 @@ function ma(e) {
9387
9397
  }, [p.collectionRef, p.itemMap]);
9388
9398
  }
9389
9399
  return [
9390
- { Provider: i, Slot: u, ItemSlot: x },
9391
- v,
9400
+ { Provider: i, Slot: u, ItemSlot: v },
9401
+ x,
9392
9402
  r
9393
9403
  ];
9394
9404
  }
@@ -9509,47 +9519,47 @@ function sc(e, t, n) {
9509
9519
  floating: o
9510
9520
  } = e;
9511
9521
  const s = qt(t), i = va(t), a = xa(i), c = on(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;
9512
- let x;
9522
+ let v;
9513
9523
  switch (c) {
9514
9524
  case "top":
9515
- x = {
9525
+ v = {
9516
9526
  x: d,
9517
9527
  y: r.y - o.height
9518
9528
  };
9519
9529
  break;
9520
9530
  case "bottom":
9521
- x = {
9531
+ v = {
9522
9532
  x: d,
9523
9533
  y: r.y + r.height
9524
9534
  };
9525
9535
  break;
9526
9536
  case "right":
9527
- x = {
9537
+ v = {
9528
9538
  x: r.x + r.width,
9529
9539
  y: h
9530
9540
  };
9531
9541
  break;
9532
9542
  case "left":
9533
- x = {
9543
+ v = {
9534
9544
  x: r.x - o.width,
9535
9545
  y: h
9536
9546
  };
9537
9547
  break;
9538
9548
  default:
9539
- x = {
9549
+ v = {
9540
9550
  x: r.x,
9541
9551
  y: r.y
9542
9552
  };
9543
9553
  }
9544
9554
  switch (ir(t)) {
9545
9555
  case "start":
9546
- x[i] -= m * (n && u ? -1 : 1);
9556
+ v[i] -= m * (n && u ? -1 : 1);
9547
9557
  break;
9548
9558
  case "end":
9549
- x[i] += m * (n && u ? -1 : 1);
9559
+ v[i] += m * (n && u ? -1 : 1);
9550
9560
  break;
9551
9561
  }
9552
- return x;
9562
+ return v;
9553
9563
  }
9554
9564
  const ry = async (e, t, n) => {
9555
9565
  const {
@@ -9565,7 +9575,7 @@ const ry = async (e, t, n) => {
9565
9575
  }), {
9566
9576
  x: d,
9567
9577
  y: h
9568
- } = sc(u, r, c), m = r, x = {}, v = 0;
9578
+ } = sc(u, r, c), m = r, v = {}, x = 0;
9569
9579
  for (let g = 0; g < a.length; g++) {
9570
9580
  const {
9571
9581
  name: p,
@@ -9581,7 +9591,7 @@ const ry = async (e, t, n) => {
9581
9591
  initialPlacement: r,
9582
9592
  placement: m,
9583
9593
  strategy: o,
9584
- middlewareData: x,
9594
+ middlewareData: v,
9585
9595
  rects: u,
9586
9596
  platform: i,
9587
9597
  elements: {
@@ -9589,13 +9599,13 @@ const ry = async (e, t, n) => {
9589
9599
  floating: t
9590
9600
  }
9591
9601
  });
9592
- d = b ?? d, h = y ?? h, x = {
9593
- ...x,
9602
+ d = b ?? d, h = y ?? h, v = {
9603
+ ...v,
9594
9604
  [p]: {
9595
- ...x[p],
9605
+ ...v[p],
9596
9606
  ...N
9597
9607
  }
9598
- }, S && v <= 50 && (v++, typeof S == "object" && (S.placement && (m = S.placement), S.rects && (u = S.rects === !0 ? await i.getElementRects({
9608
+ }, S && x <= 50 && (x++, typeof S == "object" && (S.placement && (m = S.placement), S.rects && (u = S.rects === !0 ? await i.getElementRects({
9599
9609
  reference: e,
9600
9610
  floating: t,
9601
9611
  strategy: o
@@ -9609,7 +9619,7 @@ const ry = async (e, t, n) => {
9609
9619
  y: h,
9610
9620
  placement: m,
9611
9621
  strategy: o,
9612
- middlewareData: x
9622
+ middlewareData: v
9613
9623
  };
9614
9624
  };
9615
9625
  async function Or(e, t) {
@@ -9627,8 +9637,8 @@ async function Or(e, t) {
9627
9637
  rootBoundary: d = "viewport",
9628
9638
  elementContext: h = "floating",
9629
9639
  altBoundary: m = !1,
9630
- padding: x = 0
9631
- } = rn(t, e), v = wd(x), p = a[m ? h === "floating" ? "reference" : "floating" : h], w = Ho(await s.getClippingRect({
9640
+ padding: v = 0
9641
+ } = rn(t, e), x = wd(v), p = a[m ? h === "floating" ? "reference" : "floating" : h], w = Ho(await s.getClippingRect({
9632
9642
  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)),
9633
9643
  boundary: u,
9634
9644
  rootBoundary: d,
@@ -9651,10 +9661,10 @@ async function Or(e, t) {
9651
9661
  strategy: c
9652
9662
  }) : b);
9653
9663
  return {
9654
- top: (w.top - S.top + v.top) / N.y,
9655
- bottom: (S.bottom - w.bottom + v.bottom) / N.y,
9656
- left: (w.left - S.left + v.left) / N.x,
9657
- right: (S.right - w.right + v.right) / N.x
9664
+ top: (w.top - S.top + x.top) / N.y,
9665
+ bottom: (S.bottom - w.bottom + x.bottom) / N.y,
9666
+ left: (w.left - S.left + x.left) / N.x,
9667
+ right: (S.right - w.right + x.right) / N.x
9658
9668
  };
9659
9669
  }
9660
9670
  const oy = (e) => ({
@@ -9678,14 +9688,14 @@ const oy = (e) => ({
9678
9688
  const h = wd(d), m = {
9679
9689
  x: n,
9680
9690
  y: r
9681
- }, x = va(o), v = xa(x), g = await i.getDimensions(u), p = x === "y", w = p ? "top" : "left", b = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", N = s.reference[v] + s.reference[x] - m[x] - s.floating[v], S = m[x] - s.reference[x], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
9691
+ }, v = va(o), x = xa(v), g = await i.getDimensions(u), p = v === "y", w = p ? "top" : "left", b = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", N = s.reference[x] + s.reference[v] - m[v] - s.floating[x], S = m[v] - s.reference[v], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
9682
9692
  let C = T ? T[y] : 0;
9683
- (!C || !await (i.isElement == null ? void 0 : i.isElement(T))) && (C = a.floating[y] || s.floating[v]);
9684
- const R = N / 2 - S / 2, I = C / 2 - g[v] / 2 - 1, A = pn(h[w], I), M = pn(h[b], I), H = A, U = C - g[v] - M, j = C / 2 - g[v] / 2 + R, $ = Ti(H, j, U), L = !c.arrow && ir(o) != null && j !== $ && s.reference[v] / 2 - (j < H ? A : M) - g[v] / 2 < 0, Q = L ? j < H ? j - H : j - U : 0;
9693
+ (!C || !await (i.isElement == null ? void 0 : i.isElement(T))) && (C = a.floating[y] || s.floating[x]);
9694
+ const R = N / 2 - S / 2, I = C / 2 - g[x] / 2 - 1, k = pn(h[w], I), M = pn(h[b], I), H = k, U = C - g[x] - M, j = C / 2 - g[x] / 2 + R, $ = Ti(H, j, U), L = !c.arrow && ir(o) != null && j !== $ && s.reference[x] / 2 - (j < H ? k : M) - g[x] / 2 < 0, Q = L ? j < H ? j - H : j - U : 0;
9685
9695
  return {
9686
- [x]: m[x] + Q,
9696
+ [v]: m[v] + Q,
9687
9697
  data: {
9688
- [x]: $,
9698
+ [v]: $,
9689
9699
  centerOffset: j - $ - Q,
9690
9700
  ...L && {
9691
9701
  alignmentOffset: Q
@@ -9711,22 +9721,22 @@ const oy = (e) => ({
9711
9721
  mainAxis: d = !0,
9712
9722
  crossAxis: h = !0,
9713
9723
  fallbackPlacements: m,
9714
- fallbackStrategy: x = "bestFit",
9715
- fallbackAxisSideDirection: v = "none",
9724
+ fallbackStrategy: v = "bestFit",
9725
+ fallbackAxisSideDirection: x = "none",
9716
9726
  flipAlignment: g = !0,
9717
9727
  ...p
9718
9728
  } = rn(e, t);
9719
9729
  if ((n = s.arrow) != null && n.alignmentOffset)
9720
9730
  return {};
9721
- const w = on(o), b = qt(a), y = on(a) === a, N = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), S = m || (y || !g ? [$o(a)] : Jw(a)), T = v !== "none";
9722
- !m && T && S.push(...ty(a, g, v, N));
9731
+ const w = on(o), b = qt(a), y = on(a) === a, N = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), S = m || (y || !g ? [$o(a)] : Jw(a)), T = x !== "none";
9732
+ !m && T && S.push(...ty(a, g, x, N));
9723
9733
  const C = [a, ...S], R = await Or(t, p), I = [];
9724
- let A = ((r = s.flip) == null ? void 0 : r.overflows) || [];
9734
+ let k = ((r = s.flip) == null ? void 0 : r.overflows) || [];
9725
9735
  if (d && I.push(R[w]), h) {
9726
9736
  const j = Xw(o, i, N);
9727
9737
  I.push(R[j[0]], R[j[1]]);
9728
9738
  }
9729
- if (A = [...A, {
9739
+ if (k = [...k, {
9730
9740
  placement: o,
9731
9741
  overflows: I
9732
9742
  }], !I.every((j) => j <= 0)) {
@@ -9734,22 +9744,22 @@ const oy = (e) => ({
9734
9744
  const j = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, $ = C[j];
9735
9745
  if ($ && (!(h === "alignment" ? b !== qt($) : !1) || // We leave the current main axis only if every placement on that axis
9736
9746
  // overflows the main axis.
9737
- A.every((O) => qt(O.placement) === b ? O.overflows[0] > 0 : !0)))
9747
+ k.every((O) => qt(O.placement) === b ? O.overflows[0] > 0 : !0)))
9738
9748
  return {
9739
9749
  data: {
9740
9750
  index: j,
9741
- overflows: A
9751
+ overflows: k
9742
9752
  },
9743
9753
  reset: {
9744
9754
  placement: $
9745
9755
  }
9746
9756
  };
9747
- let L = (H = A.filter((Q) => Q.overflows[0] <= 0).sort((Q, O) => Q.overflows[1] - O.overflows[1])[0]) == null ? void 0 : H.placement;
9757
+ let L = (H = k.filter((Q) => Q.overflows[0] <= 0).sort((Q, O) => Q.overflows[1] - O.overflows[1])[0]) == null ? void 0 : H.placement;
9748
9758
  if (!L)
9749
- switch (x) {
9759
+ switch (v) {
9750
9760
  case "bestFit": {
9751
9761
  var U;
9752
- const Q = (U = A.filter((O) => {
9762
+ const Q = (U = k.filter((O) => {
9753
9763
  if (T) {
9754
9764
  const _ = qt(O.placement);
9755
9765
  return _ === b || // Create a bias to the `y` side axis due to horizontal
@@ -9837,8 +9847,8 @@ async function ay(e, t) {
9837
9847
  } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = on(n), a = ir(n), c = qt(n) === "y", u = yd.has(i) ? -1 : 1, d = s && c ? -1 : 1, h = rn(t, e);
9838
9848
  let {
9839
9849
  mainAxis: m,
9840
- crossAxis: x,
9841
- alignmentAxis: v
9850
+ crossAxis: v,
9851
+ alignmentAxis: x
9842
9852
  } = typeof h == "number" ? {
9843
9853
  mainAxis: h,
9844
9854
  crossAxis: 0,
@@ -9848,12 +9858,12 @@ async function ay(e, t) {
9848
9858
  crossAxis: h.crossAxis || 0,
9849
9859
  alignmentAxis: h.alignmentAxis
9850
9860
  };
9851
- return a && typeof v == "number" && (x = a === "end" ? v * -1 : v), c ? {
9852
- x: x * d,
9861
+ return a && typeof x == "number" && (v = a === "end" ? x * -1 : x), c ? {
9862
+ x: v * d,
9853
9863
  y: m * u
9854
9864
  } : {
9855
9865
  x: m * u,
9856
- y: x * d
9866
+ y: v * d
9857
9867
  };
9858
9868
  }
9859
9869
  const ly = function(e) {
@@ -9907,19 +9917,19 @@ const ly = function(e) {
9907
9917
  x: n,
9908
9918
  y: r
9909
9919
  }, d = await Or(t, c), h = qt(on(o)), m = ga(h);
9910
- let x = u[m], v = u[h];
9920
+ let v = u[m], x = u[h];
9911
9921
  if (s) {
9912
- const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", b = x + d[p], y = x - d[w];
9913
- x = Ti(b, x, y);
9922
+ const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", b = v + d[p], y = v - d[w];
9923
+ v = Ti(b, v, y);
9914
9924
  }
9915
9925
  if (i) {
9916
- const p = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", b = v + d[p], y = v - d[w];
9917
- v = Ti(b, v, y);
9926
+ const p = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", b = x + d[p], y = x - d[w];
9927
+ x = Ti(b, x, y);
9918
9928
  }
9919
9929
  const g = a.fn({
9920
9930
  ...t,
9921
- [m]: x,
9922
- [h]: v
9931
+ [m]: v,
9932
+ [h]: x
9923
9933
  });
9924
9934
  return {
9925
9935
  ...g,
@@ -9952,7 +9962,7 @@ const ly = function(e) {
9952
9962
  x: n,
9953
9963
  y: r
9954
9964
  }, h = qt(o), m = ga(h);
9955
- let x = d[m], v = d[h];
9965
+ let v = d[m], x = d[h];
9956
9966
  const g = rn(a, t), p = typeof g == "number" ? {
9957
9967
  mainAxis: g,
9958
9968
  crossAxis: 0
@@ -9963,16 +9973,16 @@ const ly = function(e) {
9963
9973
  };
9964
9974
  if (c) {
9965
9975
  const y = m === "y" ? "height" : "width", N = s.reference[m] - s.floating[y] + p.mainAxis, S = s.reference[m] + s.reference[y] - p.mainAxis;
9966
- x < N ? x = N : x > S && (x = S);
9976
+ v < N ? v = N : v > S && (v = S);
9967
9977
  }
9968
9978
  if (u) {
9969
9979
  var w, b;
9970
9980
  const y = m === "y" ? "width" : "height", N = yd.has(on(o)), S = s.reference[h] - s.floating[y] + (N && ((w = i.offset) == null ? void 0 : w[h]) || 0) + (N ? 0 : p.crossAxis), T = s.reference[h] + s.reference[y] + (N ? 0 : ((b = i.offset) == null ? void 0 : b[h]) || 0) - (N ? p.crossAxis : 0);
9971
- v < S ? v = S : v > T && (v = T);
9981
+ x < S ? x = S : x > T && (x = T);
9972
9982
  }
9973
9983
  return {
9974
- [m]: x,
9975
- [h]: v
9984
+ [m]: v,
9985
+ [h]: x
9976
9986
  };
9977
9987
  }
9978
9988
  };
@@ -9991,17 +10001,17 @@ const ly = function(e) {
9991
10001
  apply: c = () => {
9992
10002
  },
9993
10003
  ...u
9994
- } = rn(e, t), d = await Or(t, u), h = on(o), m = ir(o), x = qt(o) === "y", {
9995
- width: v,
10004
+ } = rn(e, t), d = await Or(t, u), h = on(o), m = ir(o), v = qt(o) === "y", {
10005
+ width: x,
9996
10006
  height: g
9997
10007
  } = s.floating;
9998
10008
  let p, w;
9999
10009
  h === "top" || h === "bottom" ? (p = h, w = m === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (w = h, p = m === "end" ? "top" : "bottom");
10000
- const b = g - d.top - d.bottom, y = v - d.left - d.right, N = pn(g - d[p], b), S = pn(v - d[w], y), T = !t.middlewareData.shift;
10010
+ const b = g - d.top - d.bottom, y = x - d.left - d.right, N = pn(g - d[p], b), S = pn(x - d[w], y), T = !t.middlewareData.shift;
10001
10011
  let C = N, R = S;
10002
10012
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (R = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = b), T && !m) {
10003
- const A = yt(d.left, 0), M = yt(d.right, 0), H = yt(d.top, 0), U = yt(d.bottom, 0);
10004
- x ? R = v - 2 * (A !== 0 || M !== 0 ? A + M : yt(d.left, d.right)) : C = g - 2 * (H !== 0 || U !== 0 ? H + U : yt(d.top, d.bottom));
10013
+ const k = yt(d.left, 0), M = yt(d.right, 0), H = yt(d.top, 0), U = yt(d.bottom, 0);
10014
+ v ? R = x - 2 * (k !== 0 || M !== 0 ? k + M : yt(d.left, d.right)) : C = g - 2 * (H !== 0 || U !== 0 ? H + U : yt(d.top, d.bottom));
10005
10015
  }
10006
10016
  await c({
10007
10017
  ...t,
@@ -10009,7 +10019,7 @@ const ly = function(e) {
10009
10019
  availableHeight: C
10010
10020
  });
10011
10021
  const I = await i.getDimensions(a.floating);
10012
- return v !== I.width || g !== I.height ? {
10022
+ return x !== I.width || g !== I.height ? {
10013
10023
  reset: {
10014
10024
  rects: !0
10015
10025
  }
@@ -10178,11 +10188,11 @@ function kn(e, t, n, r) {
10178
10188
  const a = Sy(s, n, r) ? Rd(s) : Xt(0);
10179
10189
  let c = (o.left + a.x) / i.x, u = (o.top + a.y) / i.y, d = o.width / i.x, h = o.height / i.y;
10180
10190
  if (s) {
10181
- const m = Tt(s), x = r && Bt(r) ? Tt(r) : r;
10182
- let v = m, g = Ei(v);
10183
- for (; g && r && x !== v; ) {
10191
+ const m = Tt(s), v = r && Bt(r) ? Tt(r) : r;
10192
+ let x = m, g = Ei(x);
10193
+ for (; g && r && v !== x; ) {
10184
10194
  const p = Yn(g), w = g.getBoundingClientRect(), b = $t(g), y = w.left + (g.clientLeft + parseFloat(b.paddingLeft)) * p.x, N = w.top + (g.clientTop + parseFloat(b.paddingTop)) * p.y;
10185
- c *= p.x, u *= p.y, d *= p.x, h *= p.y, c += y, u += N, v = Tt(g), g = Ei(v);
10195
+ c *= p.x, u *= p.y, d *= p.x, h *= p.y, c += y, u += N, x = Tt(g), g = Ei(x);
10186
10196
  }
10187
10197
  }
10188
10198
  return Ho({
@@ -10219,8 +10229,8 @@ function Cy(e) {
10219
10229
  }, u = Xt(1);
10220
10230
  const d = Xt(0), h = Jt(r);
10221
10231
  if ((h || !h && !s) && ((ar(r) !== "body" || qr(i)) && (c = vs(r)), Jt(r))) {
10222
- const x = kn(r);
10223
- u = Yn(r), d.x = x.x + r.clientLeft, d.y = x.y + r.clientTop;
10232
+ const v = kn(r);
10233
+ u = Yn(r), d.x = v.x + r.clientLeft, d.y = v.y + r.clientTop;
10224
10234
  }
10225
10235
  const m = i && !h && !s ? Ed(i, c) : Xt(0);
10226
10236
  return {
@@ -10255,8 +10265,8 @@ function Ey(e, t) {
10255
10265
  }
10256
10266
  const u = bs(r);
10257
10267
  if (u <= 0) {
10258
- const d = r.ownerDocument, h = d.body, m = getComputedStyle(h), x = d.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, v = Math.abs(r.clientWidth - h.clientWidth - x);
10259
- v <= cc && (s -= v);
10268
+ const d = r.ownerDocument, h = d.body, m = getComputedStyle(h), v = d.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, x = Math.abs(r.clientWidth - h.clientWidth - v);
10269
+ x <= cc && (s -= x);
10260
10270
  } else u <= cc && (s += u);
10261
10271
  return {
10262
10272
  width: s,
@@ -10351,8 +10361,8 @@ function Py(e, t, n) {
10351
10361
  }
10352
10362
  if (r || !r && !s)
10353
10363
  if ((ar(t) !== "body" || qr(o)) && (a = vs(t)), r) {
10354
- const x = kn(t, !0, s, t);
10355
- c.x = x.x + t.clientLeft, c.y = x.y + t.clientTop;
10364
+ const v = kn(t, !0, s, t);
10365
+ c.x = v.x + t.clientLeft, c.y = v.y + t.clientTop;
10356
10366
  } else o && u();
10357
10367
  s && !r && o && u();
10358
10368
  const d = o && !r && !s ? Ed(o, a) : Xt(0), h = i.left + a.scrollLeft - c.x - d.x, m = i.top + a.scrollTop - c.y - d.y;
@@ -10435,12 +10445,12 @@ function Dy(e, t) {
10435
10445
  left: d,
10436
10446
  top: h,
10437
10447
  width: m,
10438
- height: x
10448
+ height: v
10439
10449
  } = u;
10440
- if (a || t(), !m || !x)
10450
+ if (a || t(), !m || !v)
10441
10451
  return;
10442
- const v = co(h), g = co(o.clientWidth - (d + m)), p = co(o.clientHeight - (h + x)), w = co(d), y = {
10443
- rootMargin: -v + "px " + -g + "px " + -p + "px " + -w + "px",
10452
+ const x = co(h), g = co(o.clientWidth - (d + m)), p = co(o.clientHeight - (h + v)), w = co(d), y = {
10453
+ rootMargin: -x + "px " + -g + "px " + -p + "px " + -w + "px",
10444
10454
  threshold: yt(0, pn(1, c)) || 1
10445
10455
  };
10446
10456
  let N = !0;
@@ -10483,25 +10493,25 @@ function Ly(e, t, n, r) {
10483
10493
  }), s && w.addEventListener("resize", n);
10484
10494
  });
10485
10495
  const h = u && a ? Dy(u, n) : null;
10486
- let m = -1, x = null;
10487
- i && (x = new ResizeObserver((w) => {
10496
+ let m = -1, v = null;
10497
+ i && (v = new ResizeObserver((w) => {
10488
10498
  let [b] = w;
10489
- b && b.target === u && x && (x.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
10499
+ b && b.target === u && v && (v.unobserve(t), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
10490
10500
  var y;
10491
- (y = x) == null || y.observe(t);
10501
+ (y = v) == null || y.observe(t);
10492
10502
  })), n();
10493
- }), u && !c && x.observe(u), x.observe(t));
10494
- let v, g = c ? kn(e) : null;
10503
+ }), u && !c && v.observe(u), v.observe(t));
10504
+ let x, g = c ? kn(e) : null;
10495
10505
  c && p();
10496
10506
  function p() {
10497
10507
  const w = kn(e);
10498
- g && !jd(g, w) && n(), g = w, v = requestAnimationFrame(p);
10508
+ g && !jd(g, w) && n(), g = w, x = requestAnimationFrame(p);
10499
10509
  }
10500
10510
  return n(), () => {
10501
10511
  var w;
10502
10512
  d.forEach((b) => {
10503
10513
  o && b.removeEventListener("scroll", n), s && b.removeEventListener("resize", n);
10504
- }), h == null || h(), (w = x) == null || w.disconnect(), x = null, c && cancelAnimationFrame(v);
10514
+ }), h == null || h(), (w = v) == null || w.disconnect(), v = null, c && cancelAnimationFrame(x);
10505
10515
  };
10506
10516
  }
10507
10517
  const Fy = ly, By = cy, $y = sy, Hy = dy, zy = iy, fc = oy, Uy = uy, Wy = (e, t, n) => {
@@ -10583,13 +10593,13 @@ function Ky(e) {
10583
10593
  placement: t,
10584
10594
  middlewareData: {},
10585
10595
  isPositioned: !1
10586
- }), [m, x] = f.useState(r);
10587
- zo(m, r) || x(r);
10588
- const [v, g] = f.useState(null), [p, w] = f.useState(null), b = f.useCallback((O) => {
10596
+ }), [m, v] = f.useState(r);
10597
+ zo(m, r) || v(r);
10598
+ const [x, g] = f.useState(null), [p, w] = f.useState(null), b = f.useCallback((O) => {
10589
10599
  O !== T.current && (T.current = O, g(O));
10590
10600
  }, []), y = f.useCallback((O) => {
10591
10601
  O !== C.current && (C.current = O, w(O));
10592
- }, []), N = s || v, S = i || p, T = f.useRef(null), C = f.useRef(null), R = f.useRef(d), I = c != null, A = ni(c), M = ni(o), H = ni(u), U = f.useCallback(() => {
10602
+ }, []), N = s || x, S = i || p, T = f.useRef(null), C = f.useRef(null), R = f.useRef(d), I = c != null, k = ni(c), M = ni(o), H = ni(u), U = f.useCallback(() => {
10593
10603
  if (!T.current || !C.current)
10594
10604
  return;
10595
10605
  const O = {
@@ -10622,11 +10632,11 @@ function Ky(e) {
10622
10632
  j.current = !1;
10623
10633
  }), []), Ro(() => {
10624
10634
  if (N && (T.current = N), S && (C.current = S), N && S) {
10625
- if (A.current)
10626
- return A.current(N, S, U);
10635
+ if (k.current)
10636
+ return k.current(N, S, U);
10627
10637
  U();
10628
10638
  }
10629
- }, [N, S, U, A, I]);
10639
+ }, [N, S, U, k, I]);
10630
10640
  const $ = f.useMemo(() => ({
10631
10641
  reference: T,
10632
10642
  floating: C,
@@ -10776,11 +10786,11 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10776
10786
  collisionPadding: d = 0,
10777
10787
  sticky: h = "partial",
10778
10788
  hideWhenDetached: m = !1,
10779
- updatePositionStrategy: x = "optimized",
10780
- onPlaced: v,
10789
+ updatePositionStrategy: v = "optimized",
10790
+ onPlaced: x,
10781
10791
  ...g
10782
- } = e, p = Od(Ca, n), [w, b] = f.useState(null), y = Te(t, (Ae) => b(Ae)), [N, S] = f.useState(null), T = Pd(N), C = (T == null ? void 0 : T.width) ?? 0, R = (T == null ? void 0 : T.height) ?? 0, I = r + (s !== "center" ? "-" + s : ""), A = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, M = Array.isArray(u) ? u : [u], H = M.length > 0, U = {
10783
- padding: A,
10792
+ } = e, p = Od(Ca, n), [w, b] = f.useState(null), y = Te(t, (Ae) => b(Ae)), [N, S] = f.useState(null), T = Pd(N), C = (T == null ? void 0 : T.width) ?? 0, R = (T == null ? void 0 : T.height) ?? 0, I = r + (s !== "center" ? "-" + s : ""), k = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, M = Array.isArray(u) ? u : [u], H = M.length > 0, U = {
10793
+ padding: k,
10784
10794
  boundary: M.filter(l0),
10785
10795
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
10786
10796
  altBoundary: H
@@ -10789,7 +10799,7 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10789
10799
  strategy: "fixed",
10790
10800
  placement: I,
10791
10801
  whileElementsMounted: (...Ae) => Ly(...Ae, {
10792
- animationFrame: x === "always"
10802
+ animationFrame: v === "always"
10793
10803
  }),
10794
10804
  elements: {
10795
10805
  reference: p.anchor
@@ -10814,7 +10824,7 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10814
10824
  c0({ arrowWidth: C, arrowHeight: R }),
10815
10825
  m && e0({ strategy: "referenceHidden", ...U })
10816
10826
  ]
10817
- }), [_, G] = Hd(L), Z = it(v);
10827
+ }), [_, G] = Hd(L), Z = it(x);
10818
10828
  st(() => {
10819
10829
  Q && (Z == null || Z());
10820
10830
  }, [Q, Z]);
@@ -10935,9 +10945,9 @@ var c0 = (e) => ({
10935
10945
  options: e,
10936
10946
  fn(t) {
10937
10947
  var p, w, b;
10938
- const { placement: n, rects: r, middlewareData: o } = t, i = ((p = o.arrow) == null ? void 0 : p.centerOffset) !== 0, a = i ? 0 : e.arrowWidth, c = i ? 0 : e.arrowHeight, [u, d] = Hd(n), h = { start: "0%", center: "50%", end: "100%" }[d], m = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + a / 2, x = (((b = o.arrow) == null ? void 0 : b.y) ?? 0) + c / 2;
10939
- let v = "", g = "";
10940
- return u === "bottom" ? (v = i ? h : `${m}px`, g = `${-c}px`) : u === "top" ? (v = i ? h : `${m}px`, g = `${r.floating.height + c}px`) : u === "right" ? (v = `${-c}px`, g = i ? h : `${x}px`) : u === "left" && (v = `${r.floating.width + c}px`, g = i ? h : `${x}px`), { data: { x: v, y: g } };
10948
+ const { placement: n, rects: r, middlewareData: o } = t, i = ((p = o.arrow) == null ? void 0 : p.centerOffset) !== 0, a = i ? 0 : e.arrowWidth, c = i ? 0 : e.arrowHeight, [u, d] = Hd(n), h = { start: "0%", center: "50%", end: "100%" }[d], m = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + a / 2, v = (((b = o.arrow) == null ? void 0 : b.y) ?? 0) + c / 2;
10949
+ let x = "", g = "";
10950
+ return u === "bottom" ? (x = i ? h : `${m}px`, g = `${-c}px`) : u === "top" ? (x = i ? h : `${m}px`, g = `${r.floating.height + c}px`) : u === "right" ? (x = `${-c}px`, g = i ? h : `${v}px`) : u === "left" && (x = `${r.floating.width + c}px`, g = i ? h : `${v}px`), { data: { x, y: g } };
10941
10951
  }
10942
10952
  });
10943
10953
  function Hd(e) {
@@ -10963,7 +10973,7 @@ var m0 = f.forwardRef((e, t) => {
10963
10973
  onEntryFocus: u,
10964
10974
  preventScrollOnEntryFocus: d = !1,
10965
10975
  ...h
10966
- } = e, m = f.useRef(null), x = Te(t, m), v = ms(s), [g, p] = hn({
10976
+ } = e, m = f.useRef(null), v = Te(t, m), x = ms(s), [g, p] = hn({
10967
10977
  prop: i,
10968
10978
  defaultProp: a ?? null,
10969
10979
  onChange: c,
@@ -10978,7 +10988,7 @@ var m0 = f.forwardRef((e, t) => {
10978
10988
  {
10979
10989
  scope: n,
10980
10990
  orientation: r,
10981
- dir: v,
10991
+ dir: x,
10982
10992
  loop: o,
10983
10993
  currentTabStopId: g,
10984
10994
  onItemFocus: f.useCallback(
@@ -11000,7 +11010,7 @@ var m0 = f.forwardRef((e, t) => {
11000
11010
  tabIndex: w || T === 0 ? -1 : 0,
11001
11011
  "data-orientation": r,
11002
11012
  ...h,
11003
- ref: x,
11013
+ ref: v,
11004
11014
  style: { outline: "none", ...e.style },
11005
11015
  onMouseDown: ee(e.onMouseDown, () => {
11006
11016
  S.current = !0;
@@ -11008,8 +11018,8 @@ var m0 = f.forwardRef((e, t) => {
11008
11018
  onFocus: ee(e.onFocus, (R) => {
11009
11019
  const I = !S.current;
11010
11020
  if (R.target === R.currentTarget && I && !w) {
11011
- const A = new CustomEvent(ri, u0);
11012
- if (R.currentTarget.dispatchEvent(A), !A.defaultPrevented) {
11021
+ const k = new CustomEvent(ri, u0);
11022
+ if (R.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
11013
11023
  const M = N().filter((L) => L.focusable), H = M.find((L) => L.active), U = M.find((L) => L.id === g), $ = [H, U, ...M].filter(
11014
11024
  Boolean
11015
11025
  ).map((L) => L.ref.current);
@@ -11032,11 +11042,11 @@ var m0 = f.forwardRef((e, t) => {
11032
11042
  tabStopId: s,
11033
11043
  children: i,
11034
11044
  ...a
11035
- } = e, c = Lt(), u = s || c, d = p0(Vd, n), h = d.currentTabStopId === u, m = zd(n), { onFocusableItemAdd: x, onFocusableItemRemove: v, currentTabStopId: g } = d;
11045
+ } = e, c = Lt(), u = s || c, d = p0(Vd, n), h = d.currentTabStopId === u, m = zd(n), { onFocusableItemAdd: v, onFocusableItemRemove: x, currentTabStopId: g } = d;
11036
11046
  return f.useEffect(() => {
11037
11047
  if (r)
11038
- return x(), () => v();
11039
- }, [r, x, v]), /* @__PURE__ */ l.jsx(
11048
+ return v(), () => x();
11049
+ }, [r, v, x]), /* @__PURE__ */ l.jsx(
11040
11050
  Ni.ItemSlot,
11041
11051
  {
11042
11052
  scope: n,
@@ -11121,11 +11131,11 @@ var w0 = Wd, y0 = Gd, Ii = ["Enter", " "], S0 = ["ArrowDown", "PageUp", "Home"],
11121
11131
  ]), ws = lr(), Xd = Ud(), [I0, Dn] = Mn(Jr), [j0, Zr] = Mn(Jr), Jd = (e) => {
11122
11132
  const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = ws(t), [c, u] = f.useState(null), d = f.useRef(!1), h = it(s), m = ms(o);
11123
11133
  return f.useEffect(() => {
11124
- const x = () => {
11125
- d.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
11126
- }, v = () => d.current = !1;
11127
- return document.addEventListener("keydown", x, { capture: !0 }), () => {
11128
- document.removeEventListener("keydown", x, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
11134
+ const v = () => {
11135
+ d.current = !0, document.addEventListener("pointerdown", x, { capture: !0, once: !0 }), document.addEventListener("pointermove", x, { capture: !0, once: !0 });
11136
+ }, x = () => d.current = !1;
11137
+ return document.addEventListener("keydown", v, { capture: !0 }), () => {
11138
+ document.removeEventListener("keydown", v, { capture: !0 }), document.removeEventListener("pointerdown", x, { capture: !0 }), document.removeEventListener("pointermove", x, { capture: !0 });
11129
11139
  };
11130
11140
  }, []), /* @__PURE__ */ l.jsx(Ta, { ...a, children: /* @__PURE__ */ l.jsx(
11131
11141
  I0,
@@ -11219,14 +11229,14 @@ var At = "MenuContent", [P0, ka] = Mn(At), ef = f.forwardRef(
11219
11229
  onPointerDownOutside: d,
11220
11230
  onFocusOutside: h,
11221
11231
  onInteractOutside: m,
11222
- onDismiss: x,
11223
- disableOutsideScroll: v,
11232
+ onDismiss: v,
11233
+ disableOutsideScroll: x,
11224
11234
  ...g
11225
- } = e, p = Dn(At, n), w = Zr(At, n), b = ws(n), y = Xd(n), N = E0(n), [S, T] = f.useState(null), C = f.useRef(null), R = Te(t, C, p.onContentChange), I = f.useRef(0), A = f.useRef(""), M = f.useRef(0), H = f.useRef(null), U = f.useRef("right"), j = f.useRef(0), $ = v ? us : f.Fragment, L = v ? { as: M0, allowPinchZoom: !0 } : void 0, Q = (_) => {
11235
+ } = e, p = Dn(At, n), w = Zr(At, n), b = ws(n), y = Xd(n), N = E0(n), [S, T] = f.useState(null), C = f.useRef(null), R = Te(t, C, p.onContentChange), I = f.useRef(0), k = f.useRef(""), M = f.useRef(0), H = f.useRef(null), U = f.useRef("right"), j = f.useRef(0), $ = x ? us : f.Fragment, L = x ? { as: M0, allowPinchZoom: !0 } : void 0, Q = (_) => {
11226
11236
  var K, P;
11227
- const G = A.current + _, Z = N().filter((X) => !X.disabled), q = document.activeElement, F = (K = Z.find((X) => X.ref.current === q)) == null ? void 0 : K.textValue, Y = Z.map((X) => X.textValue), ye = K0(Y, G, F), ce = (P = Z.find((X) => X.textValue === ye)) == null ? void 0 : P.ref.current;
11237
+ const G = k.current + _, Z = N().filter((X) => !X.disabled), q = document.activeElement, F = (K = Z.find((X) => X.ref.current === q)) == null ? void 0 : K.textValue, Y = Z.map((X) => X.textValue), ye = K0(Y, G, F), ce = (P = Z.find((X) => X.textValue === ye)) == null ? void 0 : P.ref.current;
11228
11238
  (function X(te) {
11229
- A.current = te, window.clearTimeout(I.current), te !== "" && (I.current = window.setTimeout(() => X(""), 1e3));
11239
+ k.current = te, window.clearTimeout(I.current), te !== "" && (I.current = window.setTimeout(() => X(""), 1e3));
11230
11240
  })(G), ce && setTimeout(() => ce.focus());
11231
11241
  };
11232
11242
  f.useEffect(() => () => window.clearTimeout(I.current), []), ua();
@@ -11238,7 +11248,7 @@ var At = "MenuContent", [P0, ka] = Mn(At), ef = f.forwardRef(
11238
11248
  P0,
11239
11249
  {
11240
11250
  scope: n,
11241
- searchRef: A,
11251
+ searchRef: k,
11242
11252
  onItemEnter: f.useCallback(
11243
11253
  (_) => {
11244
11254
  O(_) && _.preventDefault();
@@ -11281,7 +11291,7 @@ var At = "MenuContent", [P0, ka] = Mn(At), ef = f.forwardRef(
11281
11291
  onPointerDownOutside: d,
11282
11292
  onFocusOutside: h,
11283
11293
  onInteractOutside: m,
11284
- onDismiss: x,
11294
+ onDismiss: v,
11285
11295
  children: /* @__PURE__ */ l.jsx(
11286
11296
  w0,
11287
11297
  {
@@ -11318,7 +11328,7 @@ var At = "MenuContent", [P0, ka] = Mn(At), ef = f.forwardRef(
11318
11328
  Yd.includes(_.key) && ce.reverse(), V0(ce);
11319
11329
  }),
11320
11330
  onBlur: ee(e.onBlur, (_) => {
11321
- _.currentTarget.contains(_.target) || (window.clearTimeout(I.current), A.current = "");
11331
+ _.currentTarget.contains(_.target) || (window.clearTimeout(I.current), k.current = "");
11322
11332
  }),
11323
11333
  onPointerMove: ee(
11324
11334
  e.onPointerMove,
@@ -11363,7 +11373,7 @@ var Uo = "MenuItem", pc = "menu.itemSelect", ys = f.forwardRef(
11363
11373
  const h = s.current;
11364
11374
  if (!n && h) {
11365
11375
  const m = new CustomEvent(pc, { bubbles: !0, cancelable: !0 });
11366
- h.addEventListener(pc, (x) => r == null ? void 0 : r(x), { once: !0 }), Au(h, m), m.defaultPrevented ? u.current = !1 : i.onClose();
11376
+ h.addEventListener(pc, (v) => r == null ? void 0 : r(v), { once: !0 }), Au(h, m), m.defaultPrevented ? u.current = !1 : i.onClose();
11367
11377
  }
11368
11378
  };
11369
11379
  return /* @__PURE__ */ l.jsx(
@@ -11392,10 +11402,10 @@ var Uo = "MenuItem", pc = "menu.itemSelect", ys = f.forwardRef(
11392
11402
  ys.displayName = Uo;
11393
11403
  var nf = f.forwardRef(
11394
11404
  (e, t) => {
11395
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = ka(Uo, n), a = Xd(n), c = f.useRef(null), u = Te(t, c), [d, h] = f.useState(!1), [m, x] = f.useState("");
11405
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = ka(Uo, n), a = Xd(n), c = f.useRef(null), u = Te(t, c), [d, h] = f.useState(!1), [m, v] = f.useState("");
11396
11406
  return f.useEffect(() => {
11397
- const v = c.current;
11398
- v && x((v.textContent ?? "").trim());
11407
+ const x = c.current;
11408
+ x && v((x.textContent ?? "").trim());
11399
11409
  }, [s.children]), /* @__PURE__ */ l.jsx(
11400
11410
  Dr.ItemSlot,
11401
11411
  {
@@ -11413,13 +11423,13 @@ var nf = f.forwardRef(
11413
11423
  ref: u,
11414
11424
  onPointerMove: ee(
11415
11425
  e.onPointerMove,
11416
- Lr((v) => {
11417
- r ? i.onItemLeave(v) : (i.onItemEnter(v), v.defaultPrevented || v.currentTarget.focus({ preventScroll: !0 }));
11426
+ Lr((x) => {
11427
+ r ? i.onItemLeave(x) : (i.onItemEnter(x), x.defaultPrevented || x.currentTarget.focus({ preventScroll: !0 }));
11418
11428
  })
11419
11429
  ),
11420
11430
  onPointerLeave: ee(
11421
11431
  e.onPointerLeave,
11422
- Lr((v) => i.onItemLeave(v))
11432
+ Lr((x) => i.onItemLeave(x))
11423
11433
  ),
11424
11434
  onFocus: ee(e.onFocus, () => h(!0)),
11425
11435
  onBlur: ee(e.onBlur, () => h(!1))
@@ -11564,11 +11574,11 @@ var W0 = "MenuSub", [fR, hf] = Mn(W0), yr = "MenuSubTrigger", pf = f.forwardRef(
11564
11574
  onPointerLeave: ee(
11565
11575
  e.onPointerLeave,
11566
11576
  Lr((h) => {
11567
- var x, v;
11577
+ var v, x;
11568
11578
  d();
11569
- const m = (x = n.content) == null ? void 0 : x.getBoundingClientRect();
11579
+ const m = (v = n.content) == null ? void 0 : v.getBoundingClientRect();
11570
11580
  if (m) {
11571
- const g = (v = n.content) == null ? void 0 : v.dataset.side, p = g === "right", w = p ? -5 : 5, b = m[p ? "left" : "right"], y = m[p ? "right" : "left"];
11581
+ const g = (x = n.content) == null ? void 0 : x.dataset.side, p = g === "right", w = p ? -5 : 5, b = m[p ? "left" : "right"], y = m[p ? "right" : "left"];
11572
11582
  s.onPointerGraceIntentChange({
11573
11583
  area: [
11574
11584
  // Apply a bleed on clientX to ensure that our exit point is
@@ -11591,9 +11601,9 @@ var W0 = "MenuSub", [fR, hf] = Mn(W0), yr = "MenuSubTrigger", pf = f.forwardRef(
11591
11601
  })
11592
11602
  ),
11593
11603
  onKeyDown: ee(e.onKeyDown, (h) => {
11594
- var x;
11604
+ var v;
11595
11605
  const m = s.searchRef.current !== "";
11596
- e.disabled || m && h.key === " " || T0[r.dir].includes(h.key) && (n.onOpenChange(!0), (x = n.content) == null || x.focus(), h.preventDefault());
11606
+ e.disabled || m && h.key === " " || T0[r.dir].includes(h.key) && (n.onOpenChange(!0), (v = n.content) == null || v.focus(), h.preventDefault());
11597
11607
  })
11598
11608
  }
11599
11609
  ) });
@@ -11627,9 +11637,9 @@ var mf = "MenuSubContent", gf = f.forwardRef(
11627
11637
  i.onClose(), d.preventDefault();
11628
11638
  }),
11629
11639
  onKeyDown: ee(e.onKeyDown, (d) => {
11630
- var x;
11640
+ var v;
11631
11641
  const h = d.currentTarget.contains(d.target), m = R0[i.dir].includes(d.key);
11632
- h && m && (s.onOpenChange(!1), (x = a.trigger) == null || x.focus(), d.preventDefault());
11642
+ h && m && (s.onOpenChange(!1), (v = a.trigger) == null || v.focus(), d.preventDefault());
11633
11643
  })
11634
11644
  }
11635
11645
  ) }) }) });
@@ -11980,10 +11990,10 @@ function Eo({
11980
11990
  customStyles: d = {},
11981
11991
  onMessageSent: h,
11982
11992
  onExcelUploadSuccess: m,
11983
- onError: x
11993
+ onError: v
11984
11994
  }) {
11985
11995
  const {
11986
- currentThreadId: v,
11996
+ currentThreadId: x,
11987
11997
  messages: g,
11988
11998
  isStreaming: p,
11989
11999
  streamingAssistantId: w,
@@ -11995,30 +12005,30 @@ function Eo({
11995
12005
  listCheckpoints: C,
11996
12006
  navigateToCheckpoint: R,
11997
12007
  returnToLatest: I,
11998
- hasMoreHistory: A,
12008
+ hasMoreHistory: k,
11999
12009
  isLoadingHistory: M,
12000
12010
  loadOlderMessages: H,
12001
12011
  api: U
12002
- } = Vi(), [j, $] = fe(null), [L, Q] = fe(""), [O, _] = fe(null), [G, Z] = fe([]), [q, F] = fe(!1), [Y, ye] = fe(null), [ce, K] = fe(null), [P, X] = fe(!1), [te, ue] = fe(null), [se, Ae] = fe([]), [Pe, De] = fe(null), [de, je] = fe(null), xe = Ye(null), Se = Ye(null), rt = Ye(null), [J, ae] = fe("desktop");
12003
- $e(() => {
12012
+ } = Vi(), [j, $] = fe(null), [L, Q] = fe(""), [O, _] = fe(null), [G, Z] = fe([]), [q, F] = fe(!1), [Y, ye] = fe(null), [ce, K] = fe(null), [P, X] = fe(!1), [te, ue] = fe(null), [se, Ae] = fe([]), [Pe, De] = fe(null), [de, je] = fe(null), xe = Ke(null), Se = Ke(null), rt = Ke(null), [J, ae] = fe("desktop");
12013
+ Fe(() => {
12004
12014
  const oe = () => {
12005
12015
  const ie = window.innerWidth;
12006
12016
  ae(ie < 640 ? "phone" : ie < 1024 ? "tablet" : "desktop");
12007
12017
  };
12008
12018
  return oe(), window.addEventListener("resize", oe), () => window.removeEventListener("resize", oe);
12009
- }, []), $e(() => {
12019
+ }, []), Fe(() => {
12010
12020
  let oe = !1;
12011
- if (!v) {
12021
+ if (!x) {
12012
12022
  Ae([]), De(null), je(null), rt.current = null;
12013
12023
  return;
12014
12024
  }
12015
12025
  const ie = {
12016
- threadId: v,
12026
+ threadId: x,
12017
12027
  checkpointId: S ?? null,
12018
12028
  checkpointNs: T ?? null
12019
12029
  }, Ne = rt.current;
12020
12030
  if (!(Ne && Ne.threadId === ie.threadId && Ne.checkpointId === ie.checkpointId && Ne.checkpointNs === ie.checkpointNs))
12021
- return C(v).then((Ue) => {
12031
+ return C(x).then((Ue) => {
12022
12032
  var pr;
12023
12033
  if (oe) return;
12024
12034
  const an = ((Ue == null ? void 0 : Ue.checkpoints) ?? []).slice().sort((Wt, mr) => new Date(mr.createdAt).getTime() - new Date(Wt.createdAt).getTime());
@@ -12035,18 +12045,18 @@ function Eo({
12035
12045
  }), () => {
12036
12046
  oe = !0;
12037
12047
  };
12038
- }, [v, S, T, Pe, C]), $e(() => {
12048
+ }, [x, S, T, Pe, C]), Fe(() => {
12039
12049
  S && (De(S), je(T ?? null));
12040
12050
  }, [S, T]);
12041
- const Le = Ke(async () => {
12042
- if (!(!A || M))
12051
+ const $e = Ge(async () => {
12052
+ if (!(!k || M))
12043
12053
  try {
12044
12054
  await H();
12045
12055
  } catch (oe) {
12046
12056
  console.warn("loadOlderMessages failed", oe);
12047
12057
  }
12048
- }, [A, M, H]);
12049
- $e(() => {
12058
+ }, [k, M, H]);
12059
+ Fe(() => {
12050
12060
  (async () => {
12051
12061
  try {
12052
12062
  const ie = await U.getAgent("default");
@@ -12055,10 +12065,10 @@ function Eo({
12055
12065
  console.warn("Failed to fetch default message:", ie), ue(null);
12056
12066
  }
12057
12067
  })();
12058
- }, [U]), $e(() => {
12059
- b && !P && (x == null || x(b));
12060
- }, [b, P, x]);
12061
- const Ve = (oe) => {
12068
+ }, [U]), Fe(() => {
12069
+ b && !P && (v == null || v(b));
12070
+ }, [b, P, v]);
12071
+ const Ye = (oe) => {
12062
12072
  if (oe.length > To)
12063
12073
  return `Message too long (${oe.length}/${To} characters)`;
12064
12074
  try {
@@ -12078,7 +12088,7 @@ function Eo({
12078
12088
  const ie = oe.trim();
12079
12089
  if (!(!ie && G.length === 0)) {
12080
12090
  if (ie) {
12081
- const Ne = Ve(ie);
12091
+ const Ne = Ye(ie);
12082
12092
  if (Ne) {
12083
12093
  _(Ne);
12084
12094
  return;
@@ -12093,16 +12103,16 @@ function Eo({
12093
12103
  }), h == null || h(ie), _(null), Z([]), $(null), Q("");
12094
12104
  } catch (Ne) {
12095
12105
  const Ue = (Ne == null ? void 0 : Ne.message) || "Failed to send message";
12096
- _(Ue), x == null || x(Ue);
12106
+ _(Ue), v == null || v(Ue);
12097
12107
  }
12098
12108
  }
12099
12109
  }, dt = V.useCallback((oe, ie) => {
12100
12110
  u && ($(oe), Q(ie), _(null));
12101
12111
  }, [u]), Rt = V.useCallback(() => {
12102
12112
  $(null), Q(""), _(null);
12103
- }, []), Qe = Ke((oe, ie) => {
12113
+ }, []), Qe = Ge((oe, ie) => {
12104
12114
  dt(oe, ie);
12105
- }, [dt]), at = Ke((oe) => {
12115
+ }, [dt]), at = Ge((oe) => {
12106
12116
  for (let ie = oe - 1; ie >= 0; ie--)
12107
12117
  if (g[ie].role === "user") {
12108
12118
  const Ne = Ze(g[ie]);
@@ -12129,7 +12139,7 @@ function Eo({
12129
12139
  K(Ne);
12130
12140
  } catch (Ne) {
12131
12141
  const Ue = Ne instanceof Error ? Ne.message : "Failed to upload Excel file";
12132
- console.error("Excel upload failed", Ne), ye(Ue), x == null || x(Ue);
12142
+ console.error("Excel upload failed", Ne), ye(Ue), v == null || v(Ue);
12133
12143
  } finally {
12134
12144
  F(!1), oe.target.value = "";
12135
12145
  }
@@ -12139,15 +12149,15 @@ function Eo({
12139
12149
  const ie = Date.parse(oe);
12140
12150
  return Number.isNaN(ie) ? oe : new Date(ie).toLocaleString();
12141
12151
  }, Ln = async (oe) => {
12142
- if (!v) return;
12152
+ if (!x) return;
12143
12153
  if (!oe) {
12144
12154
  await I(), De(null), je(null);
12145
12155
  return;
12146
12156
  }
12147
12157
  const ie = se.find((Ue) => Ue.checkpointId === oe), Ne = (ie == null ? void 0 : ie.checkpointNs) ?? null;
12148
12158
  await R(oe, Ne), De(oe), je(Ne);
12149
- }, Ge = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, dr = `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 || ""}`, fr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
12150
- return /* @__PURE__ */ l.jsxs("div", { className: Ge, children: [
12159
+ }, Ve = `flex flex-1 w-full flex-col min-h-0 min-w-0 max-h-full overflow-hidden bg-transparent ${e} ${d.container || ""}`, dr = `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 || ""}`, fr = `flex-shrink-0 w-full border-t p-4 bg-transparent ${d.inputArea || ""}`;
12160
+ return /* @__PURE__ */ l.jsxs("div", { className: Ve, children: [
12151
12161
  !!b && !P && /* @__PURE__ */ l.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: [
12152
12162
  /* @__PURE__ */ l.jsx("span", { children: b }),
12153
12163
  /* @__PURE__ */ l.jsx(
@@ -12162,7 +12172,7 @@ function Eo({
12162
12172
  }
12163
12173
  )
12164
12174
  ] }),
12165
- v && se.length > 0 && /* @__PURE__ */ l.jsxs("div", { className: "flex-shrink-0 flex items-center gap-2 px-4 py-2 border-b border-border bg-muted/60 text-xs dark:bg-muted/50", children: [
12175
+ x && se.length > 0 && /* @__PURE__ */ l.jsxs("div", { className: "flex-shrink-0 flex items-center gap-2 px-4 py-2 border-b border-border bg-muted/60 text-xs dark:bg-muted/50", children: [
12166
12176
  /* @__PURE__ */ l.jsx("span", { className: "opacity-70", children: "Checkpoint:" }),
12167
12177
  /* @__PURE__ */ l.jsxs(
12168
12178
  "select",
@@ -12197,7 +12207,7 @@ function Eo({
12197
12207
  enableMessageEditing: u,
12198
12208
  editingMessageId: j,
12199
12209
  onStartReached: () => {
12200
- Le();
12210
+ $e();
12201
12211
  },
12202
12212
  onEdit: Qe,
12203
12213
  onRegenerate: at,
@@ -12357,21 +12367,21 @@ var Ma = "ScrollArea", [Uf, pR] = zt(Ma), [$S, _t] = Uf(Ma), Wf = f.forwardRef(
12357
12367
  dir: o,
12358
12368
  scrollHideDelay: s = 600,
12359
12369
  ...i
12360
- } = e, [a, c] = f.useState(null), [u, d] = f.useState(null), [h, m] = f.useState(null), [x, v] = f.useState(null), [g, p] = f.useState(null), [w, b] = f.useState(0), [y, N] = f.useState(0), [S, T] = f.useState(!1), [C, R] = f.useState(!1), I = Te(t, (M) => c(M)), A = ms(o);
12370
+ } = e, [a, c] = f.useState(null), [u, d] = f.useState(null), [h, m] = f.useState(null), [v, x] = f.useState(null), [g, p] = f.useState(null), [w, b] = f.useState(0), [y, N] = f.useState(0), [S, T] = f.useState(!1), [C, R] = f.useState(!1), I = Te(t, (M) => c(M)), k = ms(o);
12361
12371
  return /* @__PURE__ */ l.jsx(
12362
12372
  $S,
12363
12373
  {
12364
12374
  scope: n,
12365
12375
  type: r,
12366
- dir: A,
12376
+ dir: k,
12367
12377
  scrollHideDelay: s,
12368
12378
  scrollArea: a,
12369
12379
  viewport: u,
12370
12380
  onViewportChange: d,
12371
12381
  content: h,
12372
12382
  onContentChange: m,
12373
- scrollbarX: x,
12374
- onScrollbarXChange: v,
12383
+ scrollbarX: v,
12384
+ onScrollbarXChange: x,
12375
12385
  scrollbarXEnabled: S,
12376
12386
  onScrollbarXEnabledChange: T,
12377
12387
  scrollbarY: g,
@@ -12383,7 +12393,7 @@ var Ma = "ScrollArea", [Uf, pR] = zt(Ma), [$S, _t] = Uf(Ma), Wf = f.forwardRef(
12383
12393
  children: /* @__PURE__ */ l.jsx(
12384
12394
  me.div,
12385
12395
  {
12386
- dir: A,
12396
+ dir: k,
12387
12397
  ...i,
12388
12398
  ref: I,
12389
12399
  style: {
@@ -12503,8 +12513,8 @@ var HS = f.forwardRef((e, t) => {
12503
12513
  if (u) {
12504
12514
  let h = u[d];
12505
12515
  const m = () => {
12506
- const x = u[d];
12507
- h !== x && (c("SCROLL"), i()), h = x;
12516
+ const v = u[d];
12517
+ h !== v && (c("SCROLL"), i()), h = v;
12508
12518
  };
12509
12519
  return u.addEventListener("scroll", m), () => u.removeEventListener("scroll", m);
12510
12520
  }
@@ -12547,8 +12557,8 @@ var HS = f.forwardRef((e, t) => {
12547
12557
  onThumbPointerUp: () => i.current = 0,
12548
12558
  onThumbPointerDown: (m) => i.current = m
12549
12559
  };
12550
- function h(m, x) {
12551
- return YS(m, i.current, a, x);
12560
+ function h(m, v) {
12561
+ return YS(m, i.current, a, v);
12552
12562
  }
12553
12563
  return n === "horizontal" ? /* @__PURE__ */ l.jsx(
12554
12564
  US,
@@ -12557,8 +12567,8 @@ var HS = f.forwardRef((e, t) => {
12557
12567
  ref: t,
12558
12568
  onThumbPositionChange: () => {
12559
12569
  if (o.viewport && s.current) {
12560
- const m = o.viewport.scrollLeft, x = mc(m, a, o.dir);
12561
- s.current.style.transform = `translate3d(${x}px, 0, 0)`;
12570
+ const m = o.viewport.scrollLeft, v = mc(m, a, o.dir);
12571
+ s.current.style.transform = `translate3d(${v}px, 0, 0)`;
12562
12572
  }
12563
12573
  },
12564
12574
  onWheelScroll: (m) => {
@@ -12575,8 +12585,8 @@ var HS = f.forwardRef((e, t) => {
12575
12585
  ref: t,
12576
12586
  onThumbPositionChange: () => {
12577
12587
  if (o.viewport && s.current) {
12578
- const m = o.viewport.scrollTop, x = mc(m, a);
12579
- s.current.style.transform = `translate3d(0, ${x}px, 0)`;
12588
+ const m = o.viewport.scrollTop, v = mc(m, a);
12589
+ s.current.style.transform = `translate3d(0, ${v}px, 0)`;
12580
12590
  }
12581
12591
  },
12582
12592
  onWheelScroll: (m) => {
@@ -12679,24 +12689,24 @@ var HS = f.forwardRef((e, t) => {
12679
12689
  onWheelScroll: d,
12680
12690
  onResize: h,
12681
12691
  ...m
12682
- } = e, x = _t(en, n), [v, g] = f.useState(null), p = Te(t, (I) => g(I)), w = f.useRef(null), b = f.useRef(""), y = x.viewport, N = r.content - r.viewport, S = it(d), T = it(c), C = Ts(h, 10);
12692
+ } = e, v = _t(en, n), [x, g] = f.useState(null), p = Te(t, (I) => g(I)), w = f.useRef(null), b = f.useRef(""), y = v.viewport, N = r.content - r.viewport, S = it(d), T = it(c), C = Ts(h, 10);
12683
12693
  function R(I) {
12684
12694
  if (w.current) {
12685
- const A = I.clientX - w.current.left, M = I.clientY - w.current.top;
12686
- u({ x: A, y: M });
12695
+ const k = I.clientX - w.current.left, M = I.clientY - w.current.top;
12696
+ u({ x: k, y: M });
12687
12697
  }
12688
12698
  }
12689
12699
  return f.useEffect(() => {
12690
- const I = (A) => {
12691
- const M = A.target;
12692
- (v == null ? void 0 : v.contains(M)) && S(A, N);
12700
+ const I = (k) => {
12701
+ const M = k.target;
12702
+ (x == null ? void 0 : x.contains(M)) && S(k, N);
12693
12703
  };
12694
12704
  return document.addEventListener("wheel", I, { passive: !1 }), () => document.removeEventListener("wheel", I, { passive: !1 });
12695
- }, [y, v, N, S]), f.useEffect(T, [r, T]), Qn(v, C), Qn(x.content, C), /* @__PURE__ */ l.jsx(
12705
+ }, [y, x, N, S]), f.useEffect(T, [r, T]), Qn(x, C), Qn(v.content, C), /* @__PURE__ */ l.jsx(
12696
12706
  VS,
12697
12707
  {
12698
12708
  scope: n,
12699
- scrollbar: v,
12709
+ scrollbar: x,
12700
12710
  hasThumb: o,
12701
12711
  onThumbChange: it(s),
12702
12712
  onThumbPointerUp: it(i),
@@ -12709,12 +12719,12 @@ var HS = f.forwardRef((e, t) => {
12709
12719
  ref: p,
12710
12720
  style: { position: "absolute", ...m.style },
12711
12721
  onPointerDown: ee(e.onPointerDown, (I) => {
12712
- I.button === 0 && (I.target.setPointerCapture(I.pointerId), w.current = v.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", x.viewport && (x.viewport.style.scrollBehavior = "auto"), R(I));
12722
+ I.button === 0 && (I.target.setPointerCapture(I.pointerId), w.current = x.getBoundingClientRect(), b.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", v.viewport && (v.viewport.style.scrollBehavior = "auto"), R(I));
12713
12723
  }),
12714
12724
  onPointerMove: ee(e.onPointerMove, R),
12715
12725
  onPointerUp: ee(e.onPointerUp, (I) => {
12716
- const A = I.target;
12717
- A.hasPointerCapture(I.pointerId) && A.releasePointerCapture(I.pointerId), document.body.style.webkitUserSelect = b.current, x.viewport && (x.viewport.style.scrollBehavior = ""), w.current = null;
12726
+ const k = I.target;
12727
+ k.hasPointerCapture(I.pointerId) && k.releasePointerCapture(I.pointerId), document.body.style.webkitUserSelect = b.current, v.viewport && (v.viewport.style.scrollBehavior = ""), w.current = null;
12718
12728
  })
12719
12729
  }
12720
12730
  )
@@ -12738,8 +12748,8 @@ var HS = f.forwardRef((e, t) => {
12738
12748
  if (h) {
12739
12749
  const m = () => {
12740
12750
  if (d(), !u.current) {
12741
- const x = qS(h, a);
12742
- u.current = x, a();
12751
+ const v = qS(h, a);
12752
+ u.current = v, a();
12743
12753
  }
12744
12754
  };
12745
12755
  return a(), h.addEventListener("scroll", m), () => h.removeEventListener("scroll", m);
@@ -12756,8 +12766,8 @@ var HS = f.forwardRef((e, t) => {
12756
12766
  ...r
12757
12767
  },
12758
12768
  onPointerDownCapture: ee(e.onPointerDownCapture, (h) => {
12759
- const x = h.target.getBoundingClientRect(), v = h.clientX - x.left, g = h.clientY - x.top;
12760
- i.onThumbPointerDown({ x: v, y: g });
12769
+ const v = h.target.getBoundingClientRect(), x = h.clientX - v.left, g = h.clientY - v.top;
12770
+ i.onThumbPointerDown({ x, y: g });
12761
12771
  }),
12762
12772
  onPointerUp: ee(e.onPointerUp, i.onThumbPointerUp)
12763
12773
  }
@@ -12903,13 +12913,13 @@ function Ai({
12903
12913
  const {
12904
12914
  loadThread: h,
12905
12915
  threads: m,
12906
- refreshThreads: x,
12907
- currentThreadId: v,
12916
+ refreshThreads: v,
12917
+ currentThreadId: x,
12908
12918
  createThread: g,
12909
12919
  deleteThread: p,
12910
12920
  renameThread: w
12911
- } = Vi(), [b, y] = fe(m ?? []), [N, S] = fe(!1), [T, C] = fe(null), [R, I] = fe(null), [A, M] = fe(""), [H, U] = fe(!1);
12912
- $e(() => {
12921
+ } = Vi(), [b, y] = fe(m ?? []), [N, S] = fe(!1), [T, C] = fe(null), [R, I] = fe(null), [k, M] = fe(""), [H, U] = fe(!1);
12922
+ Fe(() => {
12913
12923
  y(m ?? []);
12914
12924
  }, [m]);
12915
12925
  const j = async (F) => {
@@ -12938,9 +12948,9 @@ function Ai({
12938
12948
  }, Q = (F, Y) => {
12939
12949
  Y.stopPropagation(), I(F.threadId), M(F.title || `Thread ${F.threadId.slice(0, 8)}`);
12940
12950
  }, O = async (F) => {
12941
- if (A.trim())
12951
+ if (k.trim())
12942
12952
  try {
12943
- await w(F, A.trim()), I(null), M("");
12953
+ await w(F, k.trim()), I(null), M("");
12944
12954
  } catch (Y) {
12945
12955
  console.error("Failed to update title:", Y);
12946
12956
  }
@@ -12982,11 +12992,11 @@ function Ai({
12982
12992
  "div",
12983
12993
  {
12984
12994
  onClick: () => j(F.threadId),
12985
- className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? v) === F.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
12995
+ className: `group relative p-3 rounded-lg cursor-pointer transition-colors border ${(i ?? x) === F.threadId ? `${s.activeThread || "bg-slate-600 border-slate-500"} ` : `${s.threadItem || "bg-slate-700 border-slate-600 hover:bg-slate-600 text-gray-900 dark:text-slate-100"}`} ${s.threadItem || ""} text-gray-900 dark:text-slate-100`,
12986
12996
  children: [
12987
12997
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between", children: [
12988
12998
  /* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: R === F.threadId ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", onClick: (Y) => Y.stopPropagation(), children: [
12989
- /* @__PURE__ */ l.jsx(Fr, { value: A, onChange: (Y) => M(Y.target.value), onKeyDown: (Y) => G(Y, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
12999
+ /* @__PURE__ */ l.jsx(Fr, { value: k, onChange: (Y) => M(Y.target.value), onKeyDown: (Y) => G(Y, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
12990
13000
  /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: () => O(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Hi, { size: 12 }) }),
12991
13001
  /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: _, className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Vn, { size: 12 }) })
12992
13002
  ] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
@@ -13324,7 +13334,7 @@ var Br = "Tooltip", [pC, Ns] = Rs(Br), bh = (e) => {
13324
13334
  onOpenChange: s,
13325
13335
  disableHoverableContent: i,
13326
13336
  delayDuration: a
13327
- } = e, c = Ha(Br, e.__scopeTooltip), u = Es(t), [d, h] = f.useState(null), m = Lt(), x = f.useRef(0), v = i ?? c.disableHoverableContent, g = a ?? c.delayDuration, p = f.useRef(!1), [w, b] = hn({
13337
+ } = e, c = Ha(Br, e.__scopeTooltip), u = Es(t), [d, h] = f.useState(null), m = Lt(), v = f.useRef(0), x = i ?? c.disableHoverableContent, g = a ?? c.delayDuration, p = f.useRef(!1), [w, b] = hn({
13328
13338
  prop: r,
13329
13339
  defaultProp: o ?? !1,
13330
13340
  onChange: (C) => {
@@ -13332,16 +13342,16 @@ var Br = "Tooltip", [pC, Ns] = Rs(Br), bh = (e) => {
13332
13342
  },
13333
13343
  caller: Br
13334
13344
  }), y = f.useMemo(() => w ? p.current ? "delayed-open" : "instant-open" : "closed", [w]), N = f.useCallback(() => {
13335
- window.clearTimeout(x.current), x.current = 0, p.current = !1, b(!0);
13345
+ window.clearTimeout(v.current), v.current = 0, p.current = !1, b(!0);
13336
13346
  }, [b]), S = f.useCallback(() => {
13337
- window.clearTimeout(x.current), x.current = 0, b(!1);
13347
+ window.clearTimeout(v.current), v.current = 0, b(!1);
13338
13348
  }, [b]), T = f.useCallback(() => {
13339
- window.clearTimeout(x.current), x.current = window.setTimeout(() => {
13340
- p.current = !0, b(!0), x.current = 0;
13349
+ window.clearTimeout(v.current), v.current = window.setTimeout(() => {
13350
+ p.current = !0, b(!0), v.current = 0;
13341
13351
  }, g);
13342
13352
  }, [g, b]);
13343
13353
  return f.useEffect(() => () => {
13344
- x.current && (window.clearTimeout(x.current), x.current = 0);
13354
+ v.current && (window.clearTimeout(v.current), v.current = 0);
13345
13355
  }, []), /* @__PURE__ */ l.jsx(Ta, { ...u, children: /* @__PURE__ */ l.jsx(
13346
13356
  pC,
13347
13357
  {
@@ -13355,11 +13365,11 @@ var Br = "Tooltip", [pC, Ns] = Rs(Br), bh = (e) => {
13355
13365
  c.isOpenDelayedRef.current ? T() : N();
13356
13366
  }, [c.isOpenDelayedRef, T, N]),
13357
13367
  onTriggerLeave: f.useCallback(() => {
13358
- v ? S() : (window.clearTimeout(x.current), x.current = 0);
13359
- }, [S, v]),
13368
+ x ? S() : (window.clearTimeout(v.current), v.current = 0);
13369
+ }, [S, x]),
13360
13370
  onOpen: N,
13361
13371
  onClose: S,
13362
- disableHoverableContent: v,
13372
+ disableHoverableContent: x,
13363
13373
  children: n
13364
13374
  }
13365
13375
  ) });
@@ -13404,27 +13414,27 @@ var mC = "TooltipPortal", [wR, gC] = Rs(mC, {
13404
13414
  ), xC = f.forwardRef((e, t) => {
13405
13415
  const n = Ns(er, e.__scopeTooltip), r = Ha(er, e.__scopeTooltip), o = f.useRef(null), s = Te(t, o), [i, a] = f.useState(null), { trigger: c, onClose: u } = n, d = o.current, { onPointerInTransitChange: h } = r, m = f.useCallback(() => {
13406
13416
  a(null), h(!1);
13407
- }, [h]), x = f.useCallback(
13408
- (v, g) => {
13409
- const p = v.currentTarget, w = { x: v.clientX, y: v.clientY }, b = SC(w, p.getBoundingClientRect()), y = CC(w, b), N = TC(g.getBoundingClientRect()), S = EC([...y, ...N]);
13417
+ }, [h]), v = f.useCallback(
13418
+ (x, g) => {
13419
+ const p = x.currentTarget, w = { x: x.clientX, y: x.clientY }, b = SC(w, p.getBoundingClientRect()), y = CC(w, b), N = TC(g.getBoundingClientRect()), S = EC([...y, ...N]);
13410
13420
  a(S), h(!0);
13411
13421
  },
13412
13422
  [h]
13413
13423
  );
13414
13424
  return f.useEffect(() => () => m(), [m]), f.useEffect(() => {
13415
13425
  if (c && d) {
13416
- const v = (p) => x(p, d), g = (p) => x(p, c);
13417
- return c.addEventListener("pointerleave", v), d.addEventListener("pointerleave", g), () => {
13418
- c.removeEventListener("pointerleave", v), d.removeEventListener("pointerleave", g);
13426
+ const x = (p) => v(p, d), g = (p) => v(p, c);
13427
+ return c.addEventListener("pointerleave", x), d.addEventListener("pointerleave", g), () => {
13428
+ c.removeEventListener("pointerleave", x), d.removeEventListener("pointerleave", g);
13419
13429
  };
13420
13430
  }
13421
- }, [c, d, x, m]), f.useEffect(() => {
13431
+ }, [c, d, v, m]), f.useEffect(() => {
13422
13432
  if (i) {
13423
- const v = (g) => {
13433
+ const x = (g) => {
13424
13434
  const p = g.target, w = { x: g.clientX, y: g.clientY }, b = (c == null ? void 0 : c.contains(p)) || (d == null ? void 0 : d.contains(p)), y = !RC(w, i);
13425
13435
  b ? m() : y && (m(), u());
13426
13436
  };
13427
- return document.addEventListener("pointermove", v), () => document.removeEventListener("pointermove", v);
13437
+ return document.addEventListener("pointermove", x), () => document.removeEventListener("pointermove", x);
13428
13438
  }
13429
13439
  }, [c, d, i, u, m]), /* @__PURE__ */ l.jsx(Sh, { ...e, ref: s });
13430
13440
  }), [vC, bC] = Rs(Br, { isInside: !1 }), wC = lm("TooltipContent"), Sh = f.forwardRef(
@@ -13440,8 +13450,8 @@ var mC = "TooltipPortal", [wR, gC] = Rs(mC, {
13440
13450
  return f.useEffect(() => (document.addEventListener(Pi, d), () => document.removeEventListener(Pi, d)), [d]), f.useEffect(() => {
13441
13451
  if (c.trigger) {
13442
13452
  const h = (m) => {
13443
- const x = m.target;
13444
- x != null && x.contains(c.trigger) && d();
13453
+ const v = m.target;
13454
+ v != null && v.contains(c.trigger) && d();
13445
13455
  };
13446
13456
  return window.addEventListener("scroll", h, { capture: !0 }), () => window.removeEventListener("scroll", h, { capture: !0 });
13447
13457
  }
@@ -13613,30 +13623,30 @@ const Nh = f.forwardRef(
13613
13623
  children: s,
13614
13624
  ...i
13615
13625
  }, a) => {
13616
- const c = rC(), [u, d] = f.useState(!1), [h, m] = f.useState(e), x = t ?? h, v = f.useCallback(
13626
+ const c = rC(), [u, d] = f.useState(!1), [h, m] = f.useState(e), v = t ?? h, x = f.useCallback(
13617
13627
  (b) => {
13618
- const y = typeof b == "function" ? b(x) : b;
13628
+ const y = typeof b == "function" ? b(v) : b;
13619
13629
  n ? n(y) : m(y), document.cookie = `${OC}=${y}; path=/; max-age=${MC}`;
13620
13630
  },
13621
- [n, x]
13622
- ), g = f.useCallback(() => c ? d((b) => !b) : v((b) => !b), [c, v, d]);
13631
+ [n, v]
13632
+ ), g = f.useCallback(() => c ? d((b) => !b) : x((b) => !b), [c, x, d]);
13623
13633
  f.useEffect(() => {
13624
13634
  const b = (y) => {
13625
13635
  y.key === BC && (y.metaKey || y.ctrlKey) && (y.preventDefault(), g());
13626
13636
  };
13627
13637
  return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
13628
13638
  }, [g]);
13629
- const p = x ? "expanded" : "collapsed", w = f.useMemo(
13639
+ const p = v ? "expanded" : "collapsed", w = f.useMemo(
13630
13640
  () => ({
13631
13641
  state: p,
13632
- open: x,
13633
- setOpen: v,
13642
+ open: v,
13643
+ setOpen: x,
13634
13644
  isMobile: c,
13635
13645
  openMobile: u,
13636
13646
  setOpenMobile: d,
13637
13647
  toggleSidebar: g
13638
13648
  }),
13639
- [p, x, v, c, u, d, g]
13649
+ [p, v, x, c, u, d, g]
13640
13650
  );
13641
13651
  return /* @__PURE__ */ l.jsx(Eh.Provider, { value: w, children: /* @__PURE__ */ l.jsx(AC, { delayDuration: 0, children: /* @__PURE__ */ l.jsx(
13642
13652
  "div",
@@ -14175,7 +14185,7 @@ var js = "Switch", [eT, SR] = zt(js), [tT, nT] = eT(js), zh = f.forwardRef(
14175
14185
  onCheckedChange: u,
14176
14186
  form: d,
14177
14187
  ...h
14178
- } = e, [m, x] = f.useState(null), v = Te(t, (y) => x(y)), g = f.useRef(!1), p = m ? d || !!m.closest("form") : !0, [w, b] = hn({
14188
+ } = e, [m, v] = f.useState(null), x = Te(t, (y) => v(y)), g = f.useRef(!1), p = m ? d || !!m.closest("form") : !0, [w, b] = hn({
14179
14189
  prop: o,
14180
14190
  defaultProp: s ?? !1,
14181
14191
  onChange: u,
@@ -14194,7 +14204,7 @@ var js = "Switch", [eT, SR] = zt(js), [tT, nT] = eT(js), zh = f.forwardRef(
14194
14204
  disabled: a,
14195
14205
  value: c,
14196
14206
  ...h,
14197
- ref: v,
14207
+ ref: x,
14198
14208
  onClick: ee(e.onClick, (y) => {
14199
14209
  b((N) => !N), p && (g.current = y.isPropagationStopped(), g.current || y.stopPropagation());
14200
14210
  })
@@ -14245,13 +14255,13 @@ var rT = "SwitchBubbleInput", Vh = f.forwardRef(
14245
14255
  return f.useEffect(() => {
14246
14256
  const d = i.current;
14247
14257
  if (!d) return;
14248
- const h = window.HTMLInputElement.prototype, x = Object.getOwnPropertyDescriptor(
14258
+ const h = window.HTMLInputElement.prototype, v = Object.getOwnPropertyDescriptor(
14249
14259
  h,
14250
14260
  "checked"
14251
14261
  ).set;
14252
- if (c !== n && x) {
14253
- const v = new Event("click", { bubbles: r });
14254
- x.call(d, n), d.dispatchEvent(v);
14262
+ if (c !== n && v) {
14263
+ const x = new Event("click", { bubbles: r });
14264
+ v.call(d, n), d.dispatchEvent(x);
14255
14265
  }
14256
14266
  }, [c, n, r]), /* @__PURE__ */ l.jsx(
14257
14267
  "input",
@@ -14316,23 +14326,23 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], An = "Sele
14316
14326
  name: d,
14317
14327
  autoComplete: h,
14318
14328
  disabled: m,
14319
- required: x,
14320
- form: v
14329
+ required: v,
14330
+ form: x
14321
14331
  } = e, g = Ps(t), [p, w] = f.useState(null), [b, y] = f.useState(null), [N, S] = f.useState(!1), T = ms(u), [C, R] = hn({
14322
14332
  prop: r,
14323
14333
  defaultProp: o ?? !1,
14324
14334
  onChange: s,
14325
14335
  caller: An
14326
- }), [I, A] = hn({
14336
+ }), [I, k] = hn({
14327
14337
  prop: i,
14328
14338
  defaultProp: a,
14329
14339
  onChange: c,
14330
14340
  caller: An
14331
- }), M = f.useRef(null), H = p ? v || !!p.closest("form") : !0, [U, j] = f.useState(/* @__PURE__ */ new Set()), $ = Array.from(U).map((L) => L.props.value).join(";");
14341
+ }), M = f.useRef(null), H = p ? x || !!p.closest("form") : !0, [U, j] = f.useState(/* @__PURE__ */ new Set()), $ = Array.from(U).map((L) => L.props.value).join(";");
14332
14342
  return /* @__PURE__ */ l.jsx(Ta, { ...g, children: /* @__PURE__ */ l.jsxs(
14333
14343
  lT,
14334
14344
  {
14335
- required: x,
14345
+ required: v,
14336
14346
  scope: t,
14337
14347
  trigger: p,
14338
14348
  onTriggerChange: w,
@@ -14342,7 +14352,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], An = "Sele
14342
14352
  onValueNodeHasChildrenChange: S,
14343
14353
  contentId: Lt(),
14344
14354
  value: I,
14345
- onValueChange: A,
14355
+ onValueChange: k,
14346
14356
  open: C,
14347
14357
  onOpenChange: R,
14348
14358
  dir: T,
@@ -14369,14 +14379,14 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], An = "Sele
14369
14379
  vp,
14370
14380
  {
14371
14381
  "aria-hidden": !0,
14372
- required: x,
14382
+ required: v,
14373
14383
  tabIndex: -1,
14374
14384
  name: d,
14375
14385
  autoComplete: h,
14376
14386
  value: I,
14377
- onChange: (L) => A(L.target.value),
14387
+ onChange: (L) => k(L.target.value),
14378
14388
  disabled: m,
14379
- form: v,
14389
+ form: x,
14380
14390
  children: [
14381
14391
  I === void 0 ? /* @__PURE__ */ l.jsx("option", { value: "" }) : null,
14382
14392
  Array.from(U)
@@ -14391,11 +14401,11 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], An = "Sele
14391
14401
  Yh.displayName = An;
14392
14402
  var qh = "SelectTrigger", Xh = f.forwardRef(
14393
14403
  (e, t) => {
14394
- const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ps(n), i = bn(qh, n), a = i.disabled || r, c = Te(t, i.onTriggerChange), u = As(n), d = f.useRef("touch"), [h, m, x] = wp((g) => {
14404
+ const { __scopeSelect: n, disabled: r = !1, ...o } = e, s = Ps(n), i = bn(qh, n), a = i.disabled || r, c = Te(t, i.onTriggerChange), u = As(n), d = f.useRef("touch"), [h, m, v] = wp((g) => {
14395
14405
  const p = u().filter((y) => !y.disabled), w = p.find((y) => y.value === i.value), b = yp(p, g, w);
14396
14406
  b !== void 0 && i.onValueChange(b.value);
14397
- }), v = (g) => {
14398
- a || (i.onOpenChange(!0), x()), g && (i.triggerPointerDownPosRef.current = {
14407
+ }), x = (g) => {
14408
+ a || (i.onOpenChange(!0), v()), g && (i.triggerPointerDownPosRef.current = {
14399
14409
  x: Math.round(g.pageX),
14400
14410
  y: Math.round(g.pageY)
14401
14411
  });
@@ -14417,16 +14427,16 @@ var qh = "SelectTrigger", Xh = f.forwardRef(
14417
14427
  ...o,
14418
14428
  ref: c,
14419
14429
  onClick: ee(o.onClick, (g) => {
14420
- g.currentTarget.focus(), d.current !== "mouse" && v(g);
14430
+ g.currentTarget.focus(), d.current !== "mouse" && x(g);
14421
14431
  }),
14422
14432
  onPointerDown: ee(o.onPointerDown, (g) => {
14423
14433
  d.current = g.pointerType;
14424
14434
  const p = g.target;
14425
- p.hasPointerCapture(g.pointerId) && p.releasePointerCapture(g.pointerId), g.button === 0 && g.ctrlKey === !1 && g.pointerType === "mouse" && (v(g), g.preventDefault());
14435
+ p.hasPointerCapture(g.pointerId) && p.releasePointerCapture(g.pointerId), g.button === 0 && g.ctrlKey === !1 && g.pointerType === "mouse" && (x(g), g.preventDefault());
14426
14436
  }),
14427
14437
  onKeyDown: ee(o.onKeyDown, (g) => {
14428
14438
  const p = h.current !== "";
14429
- !(g.ctrlKey || g.altKey || g.metaKey) && g.key.length === 1 && m(g.key), !(p && g.key === " ") && sT.includes(g.key) && (v(), g.preventDefault());
14439
+ !(g.ctrlKey || g.altKey || g.metaKey) && g.key.length === 1 && m(g.key), !(p && g.key === " ") && sT.includes(g.key) && (x(), g.preventDefault());
14430
14440
  })
14431
14441
  }
14432
14442
  ) });
@@ -14491,13 +14501,13 @@ var Mt = 10, [np, wn] = cr(Pn), hT = "SelectContentImpl", pT = Xn("SelectContent
14491
14501
  alignOffset: d,
14492
14502
  arrowPadding: h,
14493
14503
  collisionBoundary: m,
14494
- collisionPadding: x,
14495
- sticky: v,
14504
+ collisionPadding: v,
14505
+ sticky: x,
14496
14506
  hideWhenDetached: g,
14497
14507
  avoidCollisions: p,
14498
14508
  //
14499
14509
  ...w
14500
- } = e, b = bn(Pn, n), [y, N] = f.useState(null), [S, T] = f.useState(null), C = Te(t, (K) => N(K)), [R, I] = f.useState(null), [A, M] = f.useState(
14510
+ } = e, b = bn(Pn, n), [y, N] = f.useState(null), [S, T] = f.useState(null), C = Te(t, (K) => N(K)), [R, I] = f.useState(null), [k, M] = f.useState(
14501
14511
  null
14502
14512
  ), H = As(n), [U, j] = f.useState(!1), $ = f.useRef(!1);
14503
14513
  f.useEffect(() => {
@@ -14562,8 +14572,8 @@ var Mt = 10, [np, wn] = cr(Pn), hT = "SelectContentImpl", pT = Xn("SelectContent
14562
14572
  alignOffset: d,
14563
14573
  arrowPadding: h,
14564
14574
  collisionBoundary: m,
14565
- collisionPadding: x,
14566
- sticky: v,
14575
+ collisionPadding: v,
14576
+ sticky: x,
14567
14577
  hideWhenDetached: g,
14568
14578
  avoidCollisions: p
14569
14579
  } : {};
@@ -14579,7 +14589,7 @@ var Mt = 10, [np, wn] = cr(Pn), hT = "SelectContentImpl", pT = Xn("SelectContent
14579
14589
  onItemLeave: F,
14580
14590
  itemTextRefCallback: Y,
14581
14591
  focusSelectedItem: Q,
14582
- selectedItemText: A,
14592
+ selectedItemText: k,
14583
14593
  position: r,
14584
14594
  isPositioned: U,
14585
14595
  searchRef: G,
@@ -14647,11 +14657,11 @@ var Mt = 10, [np, wn] = cr(Pn), hT = "SelectContentImpl", pT = Xn("SelectContent
14647
14657
  );
14648
14658
  rp.displayName = hT;
14649
14659
  var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14650
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = bn(Pn, n), i = wn(Pn, n), [a, c] = f.useState(null), [u, d] = f.useState(null), h = Te(t, (C) => d(C)), m = As(n), x = f.useRef(!1), v = f.useRef(!0), { viewport: g, selectedItem: p, selectedItemText: w, focusSelectedItem: b } = i, y = f.useCallback(() => {
14660
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = bn(Pn, n), i = wn(Pn, n), [a, c] = f.useState(null), [u, d] = f.useState(null), h = Te(t, (C) => d(C)), m = As(n), v = f.useRef(!1), x = f.useRef(!0), { viewport: g, selectedItem: p, selectedItemText: w, focusSelectedItem: b } = i, y = f.useCallback(() => {
14651
14661
  if (s.trigger && s.valueNode && a && u && g && p && w) {
14652
- const C = s.trigger.getBoundingClientRect(), R = u.getBoundingClientRect(), I = s.valueNode.getBoundingClientRect(), A = w.getBoundingClientRect();
14662
+ const C = s.trigger.getBoundingClientRect(), R = u.getBoundingClientRect(), I = s.valueNode.getBoundingClientRect(), k = w.getBoundingClientRect();
14653
14663
  if (s.dir !== "rtl") {
14654
- const ue = A.left - R.left, se = I.left - ue, Ae = C.left - se, Pe = C.width + Ae, De = Math.max(Pe, R.width), de = window.innerWidth - Mt, je = ki(se, [
14664
+ const ue = k.left - R.left, se = I.left - ue, Ae = C.left - se, Pe = C.width + Ae, De = Math.max(Pe, R.width), de = window.innerWidth - Mt, je = ki(se, [
14655
14665
  Mt,
14656
14666
  // Prevents the content from going off the starting edge of the
14657
14667
  // viewport. It may still go off the ending edge, but this can be
@@ -14662,7 +14672,7 @@ var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14662
14672
  ]);
14663
14673
  a.style.minWidth = Pe + "px", a.style.left = je + "px";
14664
14674
  } else {
14665
- const ue = R.right - A.right, se = window.innerWidth - I.right - ue, Ae = window.innerWidth - C.right - se, Pe = C.width + Ae, De = Math.max(Pe, R.width), de = window.innerWidth - Mt, je = ki(se, [
14675
+ const ue = R.right - k.right, se = window.innerWidth - I.right - ue, Ae = window.innerWidth - C.right - se, Pe = C.width + Ae, De = Math.max(Pe, R.width), de = window.innerWidth - Mt, je = ki(se, [
14666
14676
  Mt,
14667
14677
  Math.max(Mt, de - De)
14668
14678
  ]);
@@ -14688,7 +14698,7 @@ var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14688
14698
  ) + X;
14689
14699
  a.style.height = Ae + "px", g.scrollTop = P - Y + g.offsetTop;
14690
14700
  }
14691
- a.style.margin = `${Mt}px 0`, a.style.minHeight = G + "px", a.style.maxHeight = H + "px", r == null || r(), requestAnimationFrame(() => x.current = !0);
14701
+ a.style.margin = `${Mt}px 0`, a.style.minHeight = G + "px", a.style.maxHeight = H + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
14692
14702
  }
14693
14703
  }, [
14694
14704
  m,
@@ -14709,7 +14719,7 @@ var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14709
14719
  }, [u]);
14710
14720
  const T = f.useCallback(
14711
14721
  (C) => {
14712
- C && v.current === !0 && (y(), b == null || b(), v.current = !1);
14722
+ C && x.current === !0 && (y(), b == null || b(), x.current = !1);
14713
14723
  },
14714
14724
  [y, b]
14715
14725
  );
@@ -14718,7 +14728,7 @@ var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14718
14728
  {
14719
14729
  scope: n,
14720
14730
  contentWrapper: a,
14721
- shouldExpandOnScrollRef: x,
14731
+ shouldExpandOnScrollRef: v,
14722
14732
  onScrollButtonChange: T,
14723
14733
  children: /* @__PURE__ */ l.jsx(
14724
14734
  "div",
@@ -14816,11 +14826,11 @@ var [xT, za] = cr(Pn, {}), Mi = "SelectViewport", sp = f.forwardRef(
14816
14826
  onScroll: ee(o.onScroll, (u) => {
14817
14827
  const d = u.currentTarget, { contentWrapper: h, shouldExpandOnScrollRef: m } = i;
14818
14828
  if (m != null && m.current && h) {
14819
- const x = Math.abs(c.current - d.scrollTop);
14820
- if (x > 0) {
14821
- const v = window.innerHeight - Mt * 2, g = parseFloat(h.style.minHeight), p = parseFloat(h.style.height), w = Math.max(g, p);
14822
- if (w < v) {
14823
- const b = w + x, y = Math.min(v, b), N = b - y;
14829
+ const v = Math.abs(c.current - d.scrollTop);
14830
+ if (v > 0) {
14831
+ const x = window.innerHeight - Mt * 2, g = parseFloat(h.style.minHeight), p = parseFloat(h.style.height), w = Math.max(g, p);
14832
+ if (w < x) {
14833
+ const b = w + v, y = Math.min(x, b), N = b - y;
14824
14834
  h.style.height = y + "px", h.style.bottom === "0px" && (d.scrollTop = N > 0 ? N : 0, h.style.justifyContent = "flex-end");
14825
14835
  }
14826
14836
  }
@@ -14855,7 +14865,7 @@ var Ko = "SelectItem", [yT, cp] = cr(Ko), up = f.forwardRef(
14855
14865
  disabled: o = !1,
14856
14866
  textValue: s,
14857
14867
  ...i
14858
- } = e, a = bn(Ko, n), c = wn(Ko, n), u = a.value === r, [d, h] = f.useState(s ?? ""), [m, x] = f.useState(!1), v = Te(
14868
+ } = e, a = bn(Ko, n), c = wn(Ko, n), u = a.value === r, [d, h] = f.useState(s ?? ""), [m, v] = f.useState(!1), x = Te(
14859
14869
  t,
14860
14870
  (b) => {
14861
14871
  var y;
@@ -14898,9 +14908,9 @@ var Ko = "SelectItem", [yT, cp] = cr(Ko), up = f.forwardRef(
14898
14908
  "data-disabled": o ? "" : void 0,
14899
14909
  tabIndex: o ? void 0 : -1,
14900
14910
  ...i,
14901
- ref: v,
14902
- onFocus: ee(i.onFocus, () => x(!0)),
14903
- onBlur: ee(i.onBlur, () => x(!1)),
14911
+ ref: x,
14912
+ onFocus: ee(i.onFocus, () => v(!0)),
14913
+ onBlur: ee(i.onBlur, () => v(!1)),
14904
14914
  onClick: ee(i.onClick, () => {
14905
14915
  p.current !== "mouse" && w();
14906
14916
  }),
@@ -14941,11 +14951,11 @@ var Sr = "SelectItemText", dp = f.forwardRef(
14941
14951
  var b;
14942
14952
  return (b = a.itemTextRefCallback) == null ? void 0 : b.call(a, w, c.value, c.disabled);
14943
14953
  }
14944
- ), x = d == null ? void 0 : d.textContent, v = f.useMemo(
14945
- () => /* @__PURE__ */ l.jsx("option", { value: c.value, disabled: c.disabled, children: x }, c.value),
14946
- [c.disabled, c.value, x]
14954
+ ), v = d == null ? void 0 : d.textContent, x = f.useMemo(
14955
+ () => /* @__PURE__ */ l.jsx("option", { value: c.value, disabled: c.disabled, children: v }, c.value),
14956
+ [c.disabled, c.value, v]
14947
14957
  ), { onNativeOptionAdd: g, onNativeOptionRemove: p } = u;
14948
- return st(() => (g(v), () => p(v)), [g, p, v]), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
14958
+ return st(() => (g(x), () => p(x)), [g, p, x]), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
14949
14959
  /* @__PURE__ */ l.jsx(me.span, { id: c.textId, ...s, ref: m }),
14950
14960
  c.isSelected && i.valueNode && !i.valueNodeHasChildren ? Yo.createPortal(s.children, i.valueNode) : null
14951
14961
  ] });
@@ -15282,10 +15292,10 @@ const LT = {
15282
15292
  };
15283
15293
  function TR({ settings: e, onSettingsChange: t, className: n = "" }) {
15284
15294
  const [r, o] = fe(!1), [s, i] = fe(!1), [a, c] = fe(e), [u, d] = fe(!1), { toast: h } = ca();
15285
- $e(() => {
15295
+ Fe(() => {
15286
15296
  const p = JSON.stringify(a) !== JSON.stringify(e);
15287
15297
  d(p);
15288
- }, [a, e]), $e(() => {
15298
+ }, [a, e]), Fe(() => {
15289
15299
  c(e);
15290
15300
  }, [e]);
15291
15301
  const m = () => {
@@ -15293,12 +15303,12 @@ function TR({ settings: e, onSettingsChange: t, className: n = "" }) {
15293
15303
  title: "Settings saved",
15294
15304
  description: "Your chat configuration has been updated successfully."
15295
15305
  });
15296
- }, x = () => {
15306
+ }, v = () => {
15297
15307
  c(LT), d(!0), h({
15298
15308
  title: "Settings reset",
15299
15309
  description: "Configuration has been reset to defaults."
15300
15310
  });
15301
- }, v = () => {
15311
+ }, x = () => {
15302
15312
  c(e), d(!1), o(!1);
15303
15313
  }, g = async () => {
15304
15314
  try {
@@ -15550,12 +15560,12 @@ function TR({ settings: e, onSettingsChange: t, className: n = "" }) {
15550
15560
  ] })
15551
15561
  ] }),
15552
15562
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between pt-6 border-t", children: [
15553
- /* @__PURE__ */ l.jsxs(_e, { variant: "outline", onClick: x, children: [
15563
+ /* @__PURE__ */ l.jsxs(_e, { variant: "outline", onClick: v, children: [
15554
15564
  /* @__PURE__ */ l.jsx(si, { className: "h-4 w-4 mr-2" }),
15555
15565
  "Reset"
15556
15566
  ] }),
15557
15567
  /* @__PURE__ */ l.jsxs("div", { className: "flex gap-2", children: [
15558
- /* @__PURE__ */ l.jsx(_e, { variant: "outline", onClick: v, children: "Cancel" }),
15568
+ /* @__PURE__ */ l.jsx(_e, { variant: "outline", onClick: x, children: "Cancel" }),
15559
15569
  /* @__PURE__ */ l.jsxs(_e, { onClick: m, disabled: !u, children: [
15560
15570
  /* @__PURE__ */ l.jsx(am, { className: "h-4 w-4 mr-2" }),
15561
15571
  "Save Changes"