teodor-new-chat-ui 4.1.30 → 4.1.31

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
@@ -72,10 +72,10 @@ function pm() {
72
72
  Se.unshift("Warning: " + N), Function.prototype.apply.call(console[b], console, Se);
73
73
  }
74
74
  }
75
- var R = !1, C = !1, T = !1, E = !1, I = !1, A;
75
+ var R = !1, C = !1, T = !1, k = !1, I = !1, A;
76
76
  A = Symbol.for("react.module.reference");
77
77
  function _(b) {
78
- return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || E || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
78
+ return !!(typeof b == "string" || typeof b == "function" || b === r || b === s || I || b === o || b === u || b === d || k || b === p || R || C || T || typeof b == "object" && b !== null && (b.$$typeof === h || b.$$typeof === f || b.$$typeof === i || b.$$typeof === a || b.$$typeof === l || // This needs to include all possible module reference object
79
79
  // types supported by any Flight configuration anywhere since
80
80
  // we don't know which Flight build this will end up being used
81
81
  // with.
@@ -615,8 +615,8 @@ Check the top-level render call using <` + M + ">.");
615
615
  function $n(b, N, M) {
616
616
  return xt(b, N, M, !1);
617
617
  }
618
- var ar = $n, k = Vt;
619
- Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = k;
618
+ var ar = $n, E = Vt;
619
+ Ar.Fragment = r, Ar.jsx = ar, Ar.jsxs = E;
620
620
  }()), Ar;
621
621
  }
622
622
  process.env.NODE_ENV === "production" ? wi.exports = hm() : wi.exports = pm();
@@ -655,7 +655,7 @@ const xm = is("string"), Rt = is("function"), zc = is("number"), Qr = (e) => e !
655
655
  let t;
656
656
  return e && (typeof FormData == "function" && e instanceof FormData || Rt(e.append) && ((t = ss(e)) === "formdata" || // detect form-data instance
657
657
  t === "object" && Rt(e.toString) && e.toString() === "[object FormData]"));
658
- }, Em = Jt("URLSearchParams"), [km, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
658
+ }, km = Jt("URLSearchParams"), [Em, Im, Nm, Am] = ["ReadableStream", "Request", "Response", "Headers"].map(Jt), _m = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
659
659
  function eo(e, t, { allOwnKeys: n = !1 } = {}) {
660
660
  if (e === null || typeof e > "u")
661
661
  return;
@@ -811,7 +811,7 @@ const Ym = (e) => {
811
811
  isObject: Qr,
812
812
  isPlainObject: yo,
813
813
  isEmptyObject: wm,
814
- isReadableStream: km,
814
+ isReadableStream: Em,
815
815
  isRequest: Im,
816
816
  isResponse: Nm,
817
817
  isHeaders: Am,
@@ -822,7 +822,7 @@ const Ym = (e) => {
822
822
  isRegExp: Um,
823
823
  isFunction: Rt,
824
824
  isStream: Tm,
825
- isURLSearchParams: Em,
825
+ isURLSearchParams: km,
826
826
  isTypedArray: $m,
827
827
  isFileList: Cm,
828
828
  forEach: eo,
@@ -1295,7 +1295,7 @@ function yg(e, t) {
1295
1295
  });
1296
1296
  });
1297
1297
  }
1298
- let Et = class {
1298
+ let kt = class {
1299
1299
  constructor(t) {
1300
1300
  t && this.set(t);
1301
1301
  }
@@ -1421,8 +1421,8 @@ let Et = class {
1421
1421
  return j.isArray(t) ? t.forEach(s) : s(t), this;
1422
1422
  }
1423
1423
  };
1424
- Et.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1425
- j.reduceDescriptors(Et.prototype, ({ value: e }, t) => {
1424
+ kt.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1425
+ j.reduceDescriptors(kt.prototype, ({ value: e }, t) => {
1426
1426
  let n = t[0].toUpperCase() + t.slice(1);
1427
1427
  return {
1428
1428
  get: () => e,
@@ -1431,9 +1431,9 @@ j.reduceDescriptors(Et.prototype, ({ value: e }, t) => {
1431
1431
  }
1432
1432
  };
1433
1433
  });
1434
- j.freezeMethods(Et);
1434
+ j.freezeMethods(kt);
1435
1435
  function Hs(e, t) {
1436
- const n = this || to, r = t || n, o = Et.from(r.headers);
1436
+ const n = this || to, r = t || n, o = kt.from(r.headers);
1437
1437
  let s = r.data;
1438
1438
  return j.forEach(e, function(a) {
1439
1439
  s = a.call(n, s, o.normalize(), t ? t.status : void 0);
@@ -1519,7 +1519,7 @@ const Do = (e, t, n = 3) => {
1519
1519
  }, ll = (e) => (...t) => j.asap(() => e(...t)), Rg = wt.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, wt.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
1520
1520
  new URL(wt.origin),
1521
1521
  wt.navigator && /(msie|trident)/i.test(wt.navigator.userAgent)
1522
- ) : () => !0, Eg = wt.hasStandardBrowserEnv ? (
1522
+ ) : () => !0, kg = wt.hasStandardBrowserEnv ? (
1523
1523
  // Standard browser envs support document.cookie
1524
1524
  {
1525
1525
  write(e, t, n, r, o, s) {
@@ -1546,17 +1546,17 @@ const Do = (e, t, n = 3) => {
1546
1546
  }
1547
1547
  }
1548
1548
  );
1549
- function kg(e) {
1549
+ function Eg(e) {
1550
1550
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
1551
1551
  }
1552
1552
  function Ig(e, t) {
1553
1553
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
1554
1554
  }
1555
1555
  function eu(e, t, n) {
1556
- let r = !kg(t);
1556
+ let r = !Eg(t);
1557
1557
  return e && (r || n == !1) ? Ig(e, t) : t;
1558
1558
  }
1559
- const cl = (e) => e instanceof Et ? { ...e } : e;
1559
+ const cl = (e) => e instanceof kt ? { ...e } : e;
1560
1560
  function Vn(e, t) {
1561
1561
  t = t || {};
1562
1562
  const n = {};
@@ -1624,7 +1624,7 @@ function Vn(e, t) {
1624
1624
  const tu = (e) => {
1625
1625
  const t = Vn({}, e);
1626
1626
  let { data: n, withXSRFToken: r, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = t;
1627
- if (t.headers = i = Et.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1627
+ if (t.headers = i = kt.from(i), t.url = Yc(eu(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && i.set(
1628
1628
  "Authorization",
1629
1629
  "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1630
1630
  ), j.isFormData(n)) {
@@ -1638,7 +1638,7 @@ const tu = (e) => {
1638
1638
  }
1639
1639
  }
1640
1640
  if (wt.hasStandardBrowserEnv && (r && j.isFunction(r) && (r = r(t)), r || r !== !1 && Rg(t.url))) {
1641
- const l = o && s && Eg.read(s);
1641
+ const l = o && s && kg.read(s);
1642
1642
  l && i.set(o, l);
1643
1643
  }
1644
1644
  return t;
@@ -1646,7 +1646,7 @@ const tu = (e) => {
1646
1646
  return new Promise(function(n, r) {
1647
1647
  const o = tu(e);
1648
1648
  let s = o.data;
1649
- const i = Et.from(o.headers).normalize();
1649
+ const i = kt.from(o.headers).normalize();
1650
1650
  let { responseType: a, onUploadProgress: l, onDownloadProgress: u } = o, d, f, h, p, w;
1651
1651
  function v() {
1652
1652
  p && p(), w && w(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
@@ -1656,7 +1656,7 @@ const tu = (e) => {
1656
1656
  function x() {
1657
1657
  if (!g)
1658
1658
  return;
1659
- const S = Et.from(
1659
+ const S = kt.from(
1660
1660
  "getAllResponseHeaders" in g && g.getAllResponseHeaders()
1661
1661
  ), C = {
1662
1662
  data: !a || a === "text" || a === "json" ? g.responseText : g.response,
@@ -1666,10 +1666,10 @@ const tu = (e) => {
1666
1666
  config: e,
1667
1667
  request: g
1668
1668
  };
1669
- Qc(function(E) {
1670
- n(E), v();
1671
- }, function(E) {
1672
- r(E), v();
1669
+ Qc(function(k) {
1670
+ n(k), v();
1671
+ }, function(k) {
1672
+ r(k), v();
1673
1673
  }, C), g = null;
1674
1674
  }
1675
1675
  "onloadend" in g ? g.onloadend = x : g.onreadystatechange = function() {
@@ -1848,12 +1848,12 @@ const tu = (e) => {
1848
1848
  timeout: R,
1849
1849
  onDownloadProgress: C,
1850
1850
  onUploadProgress: T,
1851
- responseType: E,
1851
+ responseType: k,
1852
1852
  headers: I,
1853
1853
  withCredentials: A = "same-origin",
1854
1854
  fetchOptions: _
1855
1855
  } = tu(w), D = t || fetch;
1856
- E = E ? (E + "").toLowerCase() : "text";
1856
+ k = k ? (k + "").toLowerCase() : "text";
1857
1857
  let L = _g([y, S && S.toAbortSignal()], R), W = null;
1858
1858
  const P = L && L.unsubscribe && (() => {
1859
1859
  L.unsubscribe();
@@ -1886,7 +1886,7 @@ const tu = (e) => {
1886
1886
  };
1887
1887
  W = s && new n(v, J);
1888
1888
  let z = await (s ? D(W, _) : D(v, J));
1889
- const $ = d && (E === "stream" || E === "response");
1889
+ const $ = d && (k === "stream" || k === "response");
1890
1890
  if (d && (C || $ && P)) {
1891
1891
  const B = {};
1892
1892
  ["status", "statusText", "headers"].forEach((Ie) => {
@@ -1903,12 +1903,12 @@ const tu = (e) => {
1903
1903
  B
1904
1904
  );
1905
1905
  }
1906
- E = E || "text";
1907
- let F = await f[j.findKey(f, E) || "text"](z, w);
1906
+ k = k || "text";
1907
+ let F = await f[j.findKey(f, k) || "text"](z, w);
1908
1908
  return !$ && P && P(), await new Promise((B, pe) => {
1909
1909
  Qc(B, pe, {
1910
1910
  data: F,
1911
- headers: Et.from(z.headers),
1911
+ headers: kt.from(z.headers),
1912
1912
  status: z.status,
1913
1913
  statusText: z.statusText,
1914
1914
  config: w,
@@ -1989,7 +1989,7 @@ function Us(e) {
1989
1989
  throw new Cr(null, e);
1990
1990
  }
1991
1991
  function gl(e) {
1992
- return Us(e), e.headers = Et.from(e.headers), e.data = Hs.call(
1992
+ return Us(e), e.headers = kt.from(e.headers), e.data = Hs.call(
1993
1993
  e,
1994
1994
  e.transformRequest
1995
1995
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), ru.getAdapter(e.adapter || to.adapter, e)(e).then(function(r) {
@@ -1997,13 +1997,13 @@ function gl(e) {
1997
1997
  e,
1998
1998
  e.transformResponse,
1999
1999
  r
2000
- ), r.headers = Et.from(r.headers), r;
2000
+ ), r.headers = kt.from(r.headers), r;
2001
2001
  }, function(r) {
2002
2002
  return Zc(r) || (Us(e), r && r.response && (r.response.data = Hs.call(
2003
2003
  e,
2004
2004
  e.transformResponse,
2005
2005
  r.response
2006
- ), r.response.headers = Et.from(r.response.headers))), Promise.reject(r);
2006
+ ), r.response.headers = kt.from(r.response.headers))), Promise.reject(r);
2007
2007
  });
2008
2008
  }
2009
2009
  const ou = "1.12.2", ls = {};
@@ -2112,7 +2112,7 @@ let Un = class {
2112
2112
  (w) => {
2113
2113
  delete s[w];
2114
2114
  }
2115
- ), n.headers = Et.concat(i, s);
2115
+ ), n.headers = kt.concat(i, s);
2116
2116
  const a = [];
2117
2117
  let l = !0;
2118
2118
  this.interceptors.request.forEach(function(v) {
@@ -2349,7 +2349,7 @@ ut.all = function(t) {
2349
2349
  ut.spread = Bg;
2350
2350
  ut.isAxiosError = Hg;
2351
2351
  ut.mergeConfig = Vn;
2352
- ut.AxiosHeaders = Et;
2352
+ ut.AxiosHeaders = kt;
2353
2353
  ut.formToJSON = (e) => Jc(j.isHTMLForm(e) ? new FormData(e) : e);
2354
2354
  ut.getAdapter = ru.getAdapter;
2355
2355
  ut.HttpStatusCode = Ti;
@@ -2853,12 +2853,11 @@ function ox(e, t) {
2853
2853
  i.text = s;
2854
2854
  continue;
2855
2855
  }
2856
- if (a.includes(s) && s.length <= 3) {
2857
- console.debug("[MessageReducer] previous includes incoming - skipping trivial incoming", { incomingLength: s.length, previousLength: a.length });
2856
+ const l = 3, u = /^[^\w\s]+$/.test(s);
2857
+ if (a.includes(s) && s.length <= l && !u)
2858
2858
  continue;
2859
- }
2860
- const u = sx(a, s);
2861
- u ? i.text = a + u : i.text = a + s;
2859
+ const d = sx(a, s);
2860
+ d ? i.text = a + d : i.text = a + s;
2862
2861
  } else
2863
2862
  n.push({ type: "text", text: s });
2864
2863
  } else
@@ -2891,7 +2890,7 @@ function ax(e) {
2891
2890
  function lx(e = {}) {
2892
2891
  const t = at(() => gn(e.baseUrl), [e.baseUrl]), n = e.streamPath ?? "/runs/stream", [r, o] = xe(e.token ?? null), s = Ge(e.headers ?? {}), i = e.credentials ?? "include", [a, l] = xe(!1), [u, d] = xe(null), [f, h] = xe(""), [p, w] = xe(null), [v, g] = xe(0), [x, y] = xe(!1), S = Ge(null), R = Ge(!0), C = Ge(0), T = Me((_) => {
2893
2892
  o(_);
2894
- }, []), E = Me(() => {
2893
+ }, []), k = Me(() => {
2895
2894
  var _;
2896
2895
  (_ = S.current) == null || _.abort(), S.current = null, l(!1), y(!1), C.current = 0, g(0);
2897
2896
  }, []), I = Me(() => {
@@ -3065,7 +3064,7 @@ function lx(e = {}) {
3065
3064
  lastSeq: v,
3066
3065
  connected: x,
3067
3066
  stream: A,
3068
- stop: E,
3067
+ stop: k,
3069
3068
  clear: I,
3070
3069
  setToken: T
3071
3070
  };
@@ -3144,7 +3143,7 @@ function dx({
3144
3143
  [h, l, u, d, f]
3145
3144
  );
3146
3145
  }
3147
- const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, Ei = 200;
3146
+ const cu = Jr(null), uu = Jr(null), du = Jr(null), fx = Jr(!1), hx = 20, px = "cachedThreads", mx = "v1", To = 300, ki = 200;
3148
3147
  function Cl(e) {
3149
3148
  if (typeof window < "u" && "requestIdleCallback" in window)
3150
3149
  try {
@@ -3216,7 +3215,7 @@ function vx(e) {
3216
3215
  return [];
3217
3216
  }
3218
3217
  }
3219
- function ki(e, t) {
3218
+ function Ei(e, t) {
3220
3219
  try {
3221
3220
  fu(e, JSON.stringify(t));
3222
3221
  } catch {
@@ -3228,7 +3227,7 @@ function Tl(e) {
3228
3227
  const n = gx();
3229
3228
  if (n.length > 0)
3230
3229
  try {
3231
- ki(e, n.slice(0, Ei));
3230
+ Ei(e, n.slice(0, ki));
3232
3231
  } catch {
3233
3232
  }
3234
3233
  return n;
@@ -3258,9 +3257,9 @@ function wx({
3258
3257
  } catch {
3259
3258
  return "unknown";
3260
3259
  }
3261
- }, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((k) => `${h}${k}`, [h]), w = Me((k) => {
3262
- if (!k || typeof k != "object") return null;
3263
- const b = k;
3260
+ }, [u]), h = at(() => `threadPayload:${mx}:${f}:`, [f]), p = Me((E) => `${h}${E}`, [h]), w = Me((E) => {
3261
+ if (!E || typeof E != "object") return null;
3262
+ const b = E;
3264
3263
  return typeof b.threadId != "string" || !Array.isArray(b.messages) ? null : {
3265
3264
  threadId: b.threadId,
3266
3265
  messages: b.messages,
@@ -3269,8 +3268,8 @@ function wx({
3269
3268
  checkpointId: b.checkpointId ?? null,
3270
3269
  checkpointNs: b.checkpointNs ?? null
3271
3270
  };
3272
- }, []), v = Me((k) => {
3273
- const b = na(p(k));
3271
+ }, []), v = Me((E) => {
3272
+ const b = na(p(E));
3274
3273
  if (!b) return null;
3275
3274
  try {
3276
3275
  const N = JSON.parse(b);
@@ -3278,39 +3277,39 @@ function wx({
3278
3277
  } catch {
3279
3278
  return null;
3280
3279
  }
3281
- }, [p, w]), g = Me((k, b = 100) => {
3280
+ }, [p, w]), g = Me((E, b = 100) => {
3282
3281
  const N = {
3283
- ...k,
3284
- messages: Array.isArray(k.messages) ? k.messages.slice(-b) : []
3282
+ ...E,
3283
+ messages: Array.isArray(E.messages) ? E.messages.slice(-b) : []
3285
3284
  };
3286
3285
  try {
3287
- fu(p(k.threadId), JSON.stringify(N));
3286
+ fu(p(E.threadId), JSON.stringify(N));
3288
3287
  } catch {
3289
3288
  }
3290
- }, [p]), x = Me((k) => {
3291
- qs(p(k));
3289
+ }, [p]), x = Me((E) => {
3290
+ qs(p(E));
3292
3291
  }, [p]), y = Me(() => {
3293
3292
  if (hr())
3294
3293
  try {
3295
- const k = h;
3294
+ const E = h;
3296
3295
  for (let b = 0; b < window.localStorage.length; b++) {
3297
3296
  const N = window.localStorage.key(b);
3298
- N && N.startsWith(k) && window.localStorage.removeItem(N);
3297
+ N && N.startsWith(E) && window.localStorage.removeItem(N);
3299
3298
  }
3300
3299
  } catch {
3301
3300
  }
3302
3301
  }, [h]), [S, R] = xe(
3303
3302
  () => {
3304
- var k;
3305
- return Gs(f, (k = l.getAuthToken) == null ? void 0 : k.call(l));
3303
+ var E;
3304
+ return Gs(f, (E = l.getAuthToken) == null ? void 0 : E.call(l));
3306
3305
  }
3307
3306
  ), [C, T] = xe(() => {
3308
3307
  var b;
3309
- const k = Tl(
3308
+ const E = Tl(
3310
3309
  Gs(f, (b = l.getAuthToken) == null ? void 0 : b.call(l))
3311
3310
  );
3312
- return Ys(k);
3313
- }), E = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
3311
+ return Ys(E);
3312
+ }), k = at(() => Xs(C), [C]), [I, A] = xe(t), [_, D] = xe(!1), [L, W] = xe(!1), [P, Y] = xe(!1), [K, J] = xe(!1), [z, $] = xe(null), [F, B] = xe(void 0), [pe, ue] = xe(void 0), {
3314
3313
  state: ee,
3315
3314
  seed: Ie,
3316
3315
  prepend: Ce,
@@ -3321,11 +3320,11 @@ function wx({
3321
3320
  ct(() => {
3322
3321
  q.current = I;
3323
3322
  }, [I]);
3324
- const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((k, b) => new Promise((N, M) => {
3323
+ const ce = Ge(!1), ie = Ge([]), $e = Ge(null), Ke = Ge(null), We = Ge(/* @__PURE__ */ new Map()), Te = Ge(I), Pe = Ge(!1), et = Ge(null), Fe = Me((E, b) => new Promise((N, M) => {
3325
3324
  const H = async () => {
3326
3325
  ce.current = !0;
3327
3326
  try {
3328
- await k(), N();
3327
+ await E(), N();
3329
3328
  } catch (X) {
3330
3329
  M(X);
3331
3330
  } finally {
@@ -3338,13 +3337,13 @@ function wx({
3338
3337
  ce.current ? ie.current.push(H) : H().catch((X) => {
3339
3338
  M(X);
3340
3339
  });
3341
- }), []), it = Ge(E.length), [ft, ne] = xe(!1), ae = Ge(!1);
3340
+ }), []), it = Ge(k.length), [ft, ne] = xe(!1), ae = Ge(!1);
3342
3341
  ct(() => {
3343
- it.current = E.length;
3344
- }, [E.length]);
3342
+ it.current = k.length;
3343
+ }, [k.length]);
3345
3344
  const de = Me(async () => {
3346
- const k = it.current > 0;
3347
- k || D(!0);
3345
+ const E = it.current > 0;
3346
+ E || D(!0);
3348
3347
  try {
3349
3348
  const b = await l.listThreads();
3350
3349
  zs(() => {
@@ -3356,14 +3355,14 @@ function wx({
3356
3355
  } catch (b) {
3357
3356
  i == null || i(String(b)), console.error("[ChatSessionProvider] Failed to refresh threads:", b);
3358
3357
  } finally {
3359
- k || D(!1);
3358
+ E || D(!1);
3360
3359
  }
3361
3360
  }, [l, i]), Ne = Ge(!1), he = Ge(null), me = Ge(null), He = Ge(""), Oe = Me(
3362
- (k, b) => {
3361
+ (E, b) => {
3363
3362
  if (!hr()) return;
3364
3363
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3365
- const N = k.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
3366
- if (k.length === 0) {
3364
+ const N = E.map((H) => `${H.threadId}:${H.updatedAt ?? ""}:${H.messageCount ?? ""}`).join("|");
3365
+ if (E.length === 0) {
3367
3366
  try {
3368
3367
  qs(S);
3369
3368
  } catch {
@@ -3375,8 +3374,8 @@ function wx({
3375
3374
  return;
3376
3375
  const M = () => {
3377
3376
  try {
3378
- const H = k.slice(0, Ei);
3379
- ki(S, H), He.current = N;
3377
+ const H = E.slice(0, ki);
3378
+ Ei(S, H), He.current = N;
3380
3379
  } catch {
3381
3380
  } finally {
3382
3381
  me.current = null;
@@ -3392,23 +3391,23 @@ function wx({
3392
3391
  },
3393
3392
  [S]
3394
3393
  ), ot = Me(
3395
- (k, b, N) => {
3396
- const M = Array.isArray(k == null ? void 0 : k.messages) ? k.messages : [], H = N ?? (k == null ? void 0 : k.threadId) ?? q.current;
3394
+ (E, b, N) => {
3395
+ const M = Array.isArray(E == null ? void 0 : E.messages) ? E.messages : [], H = N ?? (E == null ? void 0 : E.threadId) ?? q.current;
3397
3396
  if (b === "replace") {
3398
3397
  if (H) {
3399
3398
  const X = {
3400
3399
  threadId: H,
3401
3400
  messages: M.slice(),
3402
- hasMore: !!(k != null && k.hasMore),
3403
- nextCursor: (k == null ? void 0 : k.nextCursor) ?? null,
3404
- checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
3405
- checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
3401
+ hasMore: !!(E != null && E.hasMore),
3402
+ nextCursor: (E == null ? void 0 : E.nextCursor) ?? null,
3403
+ checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
3404
+ checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
3406
3405
  };
3407
3406
  We.current.set(H, X), Te.current = H;
3408
3407
  }
3409
3408
  Ie(M, {
3410
- checkpointId: (k == null ? void 0 : k.checkpointId) ?? null,
3411
- checkpointNs: (k == null ? void 0 : k.checkpointNs) ?? null
3409
+ checkpointId: (E == null ? void 0 : E.checkpointId) ?? null,
3410
+ checkpointNs: (E == null ? void 0 : E.checkpointNs) ?? null
3412
3411
  });
3413
3412
  } else if (b === "prepend" && M.length && H) {
3414
3413
  const X = We.current.get(H), Se = (X == null ? void 0 : X.messages) ?? [], we = /* @__PURE__ */ new Set(), ge = [...M, ...Se].filter((Je) => {
@@ -3417,49 +3416,49 @@ function wx({
3417
3416
  }), qe = {
3418
3417
  threadId: H,
3419
3418
  messages: ge,
3420
- hasMore: (k == null ? void 0 : k.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
3421
- nextCursor: (k == null ? void 0 : k.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
3422
- checkpointId: (X == null ? void 0 : X.checkpointId) ?? (k == null ? void 0 : k.checkpointId) ?? null,
3423
- checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (k == null ? void 0 : k.checkpointNs) ?? null
3419
+ hasMore: (E == null ? void 0 : E.hasMore) ?? (X == null ? void 0 : X.hasMore) ?? !1,
3420
+ nextCursor: (E == null ? void 0 : E.nextCursor) ?? (X == null ? void 0 : X.nextCursor) ?? null,
3421
+ checkpointId: (X == null ? void 0 : X.checkpointId) ?? (E == null ? void 0 : E.checkpointId) ?? null,
3422
+ checkpointNs: (X == null ? void 0 : X.checkpointNs) ?? (E == null ? void 0 : E.checkpointNs) ?? null
3424
3423
  };
3425
3424
  We.current.set(H, qe), Ce(M);
3426
3425
  } else b === "prepend" && M.length && Ce(M);
3427
- b === "replace" ? ($((k == null ? void 0 : k.nextCursor) ?? null), Y(!!(k != null && k.hasMore)), B((k == null ? void 0 : k.checkpointId) ?? void 0), ue((k == null ? void 0 : k.checkpointNs) ?? void 0)) : ($((X) => (k == null ? void 0 : k.nextCursor) ?? X ?? null), Y((X) => (k == null ? void 0 : k.hasMore) !== void 0 ? !!(k != null && k.hasMore) : X), B((X) => (k == null ? void 0 : k.checkpointId) ?? X ?? void 0), ue((X) => (k == null ? void 0 : k.checkpointNs) ?? X ?? void 0));
3426
+ b === "replace" ? ($((E == null ? void 0 : E.nextCursor) ?? null), Y(!!(E != null && E.hasMore)), B((E == null ? void 0 : E.checkpointId) ?? void 0), ue((E == null ? void 0 : E.checkpointNs) ?? void 0)) : ($((X) => (E == null ? void 0 : E.nextCursor) ?? X ?? null), Y((X) => (E == null ? void 0 : E.hasMore) !== void 0 ? !!(E != null && E.hasMore) : X), B((X) => (E == null ? void 0 : E.checkpointId) ?? X ?? void 0), ue((X) => (E == null ? void 0 : E.checkpointNs) ?? X ?? void 0));
3428
3427
  },
3429
3428
  [Ce, Ie]
3430
3429
  ), gt = Me(
3431
- (k) => {
3432
- Ie(k.messages, {
3433
- checkpointId: k.checkpointId,
3434
- checkpointNs: k.checkpointNs
3435
- }), $(k.nextCursor), Y(k.hasMore), B(k.checkpointId ?? void 0), ue(k.checkpointNs ?? void 0), Te.current = k.threadId;
3430
+ (E) => {
3431
+ Ie(E.messages, {
3432
+ checkpointId: E.checkpointId,
3433
+ checkpointNs: E.checkpointNs
3434
+ }), $(E.nextCursor), Y(E.hasMore), B(E.checkpointId ?? void 0), ue(E.checkpointNs ?? void 0), Te.current = E.threadId;
3436
3435
  },
3437
3436
  [Ie]
3438
- ), It = Me((k) => {
3439
- k && (We.current.delete(k), x(k), Te.current === k && (Te.current = null));
3437
+ ), It = Me((E) => {
3438
+ E && (We.current.delete(E), x(E), Te.current === E && (Te.current = null));
3440
3439
  }, [x]), Qt = Me(() => {
3441
- const k = q.current;
3442
- k && It(k), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
3443
- }, [It, Q]), On = Me(({ from: k, to: b }) => {
3440
+ const E = q.current;
3441
+ E && It(E), Q([]), Y(!1), J(!1), $(null), B(void 0), ue(void 0);
3442
+ }, [It, Q]), On = Me(({ from: E, to: b }) => {
3444
3443
  const N = q.current;
3445
3444
  N && console.warn(
3446
- `[ChatSessionProvider] Stream sequence gap detected (${k} -> ${b}) for thread ${N}`
3445
+ `[ChatSessionProvider] Stream sequence gap detected (${E} -> ${b}) for thread ${N}`
3447
3446
  );
3448
3447
  }, []), or = Me(
3449
- (k) => {
3450
- const b = k.threadId;
3448
+ (E) => {
3449
+ const b = E.threadId;
3451
3450
  console.log("[ChatSessionProvider] 📥 Handling thread_info event:", {
3452
3451
  threadId: b,
3453
- title: k.title,
3454
- created: k.created,
3455
- currentThreads: E.length
3452
+ title: E.title,
3453
+ created: E.created,
3454
+ currentThreads: k.length
3456
3455
  });
3457
3456
  const N = {
3458
3457
  threadId: b,
3459
- title: k.title || `Thread ${b.slice(0, 8)}`,
3460
- createdAt: k.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3461
- updatedAt: k.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3462
- messageCount: k.messageCount || 0
3458
+ title: E.title || `Thread ${b.slice(0, 8)}`,
3459
+ createdAt: E.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
3460
+ updatedAt: E.updatedAt || (/* @__PURE__ */ new Date()).toISOString(),
3461
+ messageCount: E.messageCount || 0
3463
3462
  };
3464
3463
  q.current !== b && (!q.current && ee.messages.length <= 1 && (Ke.current = b), A(b)), zs(() => {
3465
3464
  T((M) => {
@@ -3479,8 +3478,8 @@ function wx({
3479
3478
  baseUrl: d,
3480
3479
  onThreadInfo: or,
3481
3480
  onMessageEvent: O,
3482
- onUnhandledEvent: (k) => {
3483
- console.warn(`[ChatSessionProvider] Unhandled stream event: ${k.type}`, k);
3481
+ onUnhandledEvent: (E) => {
3482
+ console.warn(`[ChatSessionProvider] Unhandled stream event: ${E.type}`, E);
3484
3483
  },
3485
3484
  onSequenceGap: On
3486
3485
  });
@@ -3489,8 +3488,8 @@ function wx({
3489
3488
  }, [en]), ct(() => {
3490
3489
  if (!hr()) return;
3491
3490
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3492
- const k = E.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
3493
- if (E.length === 0) {
3491
+ const E = k.map((N) => `${N.threadId}:${N.updatedAt ?? ""}:${N.messageCount ?? ""}`).join("|");
3492
+ if (k.length === 0) {
3494
3493
  try {
3495
3494
  qs(S);
3496
3495
  } catch {
@@ -3498,12 +3497,12 @@ function wx({
3498
3497
  He.current = "";
3499
3498
  return;
3500
3499
  }
3501
- if (k === He.current)
3500
+ if (E === He.current)
3502
3501
  return;
3503
3502
  const b = () => {
3504
3503
  try {
3505
- const N = E.slice(0, Ei);
3506
- ki(S, N), He.current = k;
3504
+ const N = k.slice(0, ki);
3505
+ Ei(S, N), He.current = E;
3507
3506
  } catch {
3508
3507
  } finally {
3509
3508
  me.current = null;
@@ -3514,10 +3513,10 @@ function wx({
3514
3513
  }, To), () => {
3515
3514
  me.current !== null && (window.clearTimeout(me.current), me.current = null);
3516
3515
  };
3517
- }, [E, Oe]), ct(() => {
3516
+ }, [k, Oe]), ct(() => {
3518
3517
  var M;
3519
- const k = l.getAuthToken();
3520
- Mt(k);
3518
+ const E = l.getAuthToken();
3519
+ Mt(E);
3521
3520
  const b = (H) => {
3522
3521
  const X = Gs(f, H);
3523
3522
  et.current !== X && (et.current = X, Pe.current = !1), R(X);
@@ -3527,7 +3526,7 @@ function wx({
3527
3526
  }), Pe.current || (Pe.current = !0, de().catch(() => {
3528
3527
  }));
3529
3528
  };
3530
- b(k);
3529
+ b(E);
3531
3530
  const N = (M = l.onTokenChange) == null ? void 0 : M.call(l, (H) => {
3532
3531
  Mt(H), y(), b(H);
3533
3532
  });
@@ -3536,10 +3535,10 @@ function wx({
3536
3535
  };
3537
3536
  }, [l, f, Mt, y, de]);
3538
3537
  const bn = Me(
3539
- async (k) => {
3538
+ async (E) => {
3540
3539
  const b = `temp-${Date.now()}`, N = {
3541
3540
  threadId: b,
3542
- title: k || "New Chat",
3541
+ title: E || "New Chat",
3543
3542
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3544
3543
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
3545
3544
  messageCount: 0
@@ -3549,7 +3548,7 @@ function wx({
3549
3548
  order: [b, ...M.order]
3550
3549
  })), A(b);
3551
3550
  try {
3552
- const M = await l.createThread(k), H = typeof M == "string" ? M : M.threadId;
3551
+ const M = await l.createThread(E), H = typeof M == "string" ? M : M.threadId;
3553
3552
  return T((X) => {
3554
3553
  const Se = X.byId[b];
3555
3554
  if (!Se) return X;
@@ -3570,25 +3569,25 @@ function wx({
3570
3569
  },
3571
3570
  [l, de]
3572
3571
  ), yn = Me(
3573
- async (k) => {
3574
- await l.deleteThread(k);
3572
+ async (E) => {
3573
+ await l.deleteThread(E);
3575
3574
  let b = null;
3576
3575
  T((N) => {
3577
- if (!N.byId[k]) return N;
3576
+ if (!N.byId[E]) return N;
3578
3577
  const M = { ...N.byId };
3579
- delete M[k];
3580
- const H = N.order.filter((Se) => Se !== k), X = { byId: M, order: H };
3578
+ delete M[E];
3579
+ const H = N.order.filter((Se) => Se !== E), X = { byId: M, order: H };
3581
3580
  return b = Xs(X), X;
3582
- }), b && Oe(b, { immediate: !0 }), It(k), q.current === k && (Ke.current = k, A(null), q.current = null, Te.current = null, Qt()), await de();
3581
+ }), b && Oe(b, { immediate: !0 }), It(E), q.current === E && (Ke.current = E, A(null), q.current = null, Te.current = null, Qt()), await de();
3583
3582
  },
3584
3583
  [l, Qt, It, de, Oe]
3585
3584
  ), Dn = Me(
3586
- async (k, b) => {
3585
+ async (E, b) => {
3587
3586
  try {
3588
- await l.updateThread(k, b), T((N) => {
3589
- const M = N.byId[k];
3587
+ await l.updateThread(E, b), T((N) => {
3588
+ const M = N.byId[E];
3590
3589
  return M ? {
3591
- byId: { ...N.byId, [k]: { ...M, title: b } },
3590
+ byId: { ...N.byId, [E]: { ...M, title: b } },
3592
3591
  order: N.order
3593
3592
  } : N;
3594
3593
  });
@@ -3598,35 +3597,35 @@ function wx({
3598
3597
  },
3599
3598
  [l, de]
3600
3599
  ), Dt = Me(
3601
- async (k, b, N, M = !1) => {
3600
+ async (E, b, N, M = !1) => {
3602
3601
  await Fe(async () => {
3603
- if (Ke.current === k && !M) {
3602
+ if (Ke.current === E && !M) {
3604
3603
  Ke.current = null;
3605
3604
  return;
3606
3605
  }
3607
- if ($e.current === k && !M)
3606
+ if ($e.current === E && !M)
3608
3607
  return;
3609
- A((ge) => ge === k ? ge : k), q.current = k;
3608
+ A((ge) => ge === E ? ge : E), q.current = E;
3610
3609
  const H = !M && !b && !N;
3611
3610
  let X = !1;
3612
3611
  if (H) {
3613
- const ge = We.current.get(k);
3612
+ const ge = We.current.get(E);
3614
3613
  if (ge)
3615
3614
  gt(ge), X = !0;
3616
3615
  else {
3617
- const qe = v(k);
3618
- qe && (We.current.set(k, qe), gt(qe), X = !0);
3616
+ const qe = v(E);
3617
+ qe && (We.current.set(E, qe), gt(qe), X = !0);
3619
3618
  }
3620
3619
  }
3621
3620
  const Se = M || !X || !!b || !!N, we = async (ge) => {
3622
- ge && W(!0), $e.current = k;
3621
+ ge && W(!0), $e.current = E;
3623
3622
  try {
3624
3623
  const qe = await l.getMessages({
3625
- threadId: k,
3624
+ threadId: E,
3626
3625
  checkpointId: b,
3627
3626
  checkpointNs: N
3628
3627
  });
3629
- ot(qe, "replace", k);
3628
+ ot(qe, "replace", E);
3630
3629
  } catch (qe) {
3631
3630
  throw (!X || M || ge) && (i == null || i(String(qe))), qe;
3632
3631
  } finally {
@@ -3636,13 +3635,13 @@ function wx({
3636
3635
  Se ? await we(!0) : H && X && we(!1).catch((ge) => {
3637
3636
  console.warn("[ChatSessionProvider] Background refresh failed:", ge);
3638
3637
  });
3639
- }, `loadThread-${k}`);
3638
+ }, `loadThread-${E}`);
3640
3639
  },
3641
3640
  [l, gt, ot, Fe, i]
3642
3641
  ), Ln = Me(async () => {
3643
3642
  await Fe(async () => {
3644
- const k = q.current;
3645
- k && It(k), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
3643
+ const E = q.current;
3644
+ E && It(E), Ke.current = null, A(null), q.current = null, Te.current = null, Qt(), B(void 0), ue(void 0);
3646
3645
  try {
3647
3646
  localStorage.removeItem("lastThreadId");
3648
3647
  } catch (b) {
@@ -3650,22 +3649,22 @@ function wx({
3650
3649
  }
3651
3650
  }, "clearCurrentThread");
3652
3651
  }, [Qt, It, Fe]), ir = Me(
3653
- async (k) => {
3654
- const b = await l.listCheckpoints(k);
3655
- return Yg(b, k);
3652
+ async (E) => {
3653
+ const b = await l.listCheckpoints(E);
3654
+ return Yg(b, E);
3656
3655
  },
3657
3656
  [l]
3658
3657
  ), re = Me(
3659
- async (k, b) => {
3658
+ async (E, b) => {
3660
3659
  if (!q.current) throw new Error("No active thread");
3661
- await Dt(q.current, k, b ?? void 0, !0);
3660
+ await Dt(q.current, E, b ?? void 0, !0);
3662
3661
  },
3663
3662
  [Dt]
3664
3663
  ), ve = Me(async () => {
3665
3664
  if (!q.current) throw new Error("No active thread");
3666
3665
  await Dt(q.current, void 0, void 0, !0);
3667
3666
  }, [Dt]), Le = Me(
3668
- async (k) => {
3667
+ async (E) => {
3669
3668
  if (!q.current) throw new Error("No active thread");
3670
3669
  if (K || !P) return;
3671
3670
  const b = z;
@@ -3676,7 +3675,7 @@ function wx({
3676
3675
  threadId: N,
3677
3676
  checkpointId: F,
3678
3677
  checkpointNs: pe,
3679
- limit: (k == null ? void 0 : k.limit) ?? hx,
3678
+ limit: (E == null ? void 0 : E.limit) ?? hx,
3680
3679
  beforeId: b
3681
3680
  });
3682
3681
  ot(M, "prepend", N ?? void 0);
@@ -3695,7 +3694,7 @@ function wx({
3695
3694
  K
3696
3695
  ]
3697
3696
  ), Xe = Me(
3698
- async (k, b) => {
3697
+ async (E, b) => {
3699
3698
  var St;
3700
3699
  const N = q.current;
3701
3700
  !N && !(b != null && b.payloadExtras) && console.warn("[ChatSessionProvider] No thread ID - message will create new thread");
@@ -3703,7 +3702,7 @@ function wx({
3703
3702
  l,
3704
3703
  M
3705
3704
  ), Se = [...H];
3706
- k && k.trim() && Se.push({ type: "text", text: k.trim() });
3705
+ E && E.trim() && Se.push({ type: "text", text: E.trim() });
3707
3706
  const we = {
3708
3707
  id: ((St = crypto.randomUUID) == null ? void 0 : St.call(crypto)) || `user-${Date.now()}`,
3709
3708
  role: "user",
@@ -3748,7 +3747,7 @@ function wx({
3748
3747
  wn
3749
3748
  ]
3750
3749
  ), xt = Me(
3751
- async (k, b, N) => {
3750
+ async (E, b, N) => {
3752
3751
  const M = q.current;
3753
3752
  if (!M)
3754
3753
  throw new Error("No active thread to handle interrupt");
@@ -3756,7 +3755,7 @@ function wx({
3756
3755
  const H = b ? N ?? !0 : !1;
3757
3756
  await l.resume({ threadId: M, value: H });
3758
3757
  } catch (H) {
3759
- throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${k}:`, H), H;
3758
+ throw console.error(`[ChatSessionProvider] Failed to handle interrupt ${E}:`, H), H;
3760
3759
  }
3761
3760
  },
3762
3761
  [l]
@@ -3765,8 +3764,8 @@ function wx({
3765
3764
  if (a == null || a(I), I)
3766
3765
  try {
3767
3766
  localStorage.setItem("lastThreadId", I);
3768
- } catch (k) {
3769
- console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", k);
3767
+ } catch (E) {
3768
+ console.warn("[ChatSessionProvider] Failed to persist lastThreadId:", E);
3770
3769
  }
3771
3770
  }, [I, a]), ct(() => ((async () => {
3772
3771
  try {
@@ -3785,20 +3784,20 @@ function wx({
3785
3784
  }
3786
3785
  })(), () => {
3787
3786
  }), []), ct(() => {
3788
- const k = q.current;
3789
- if (!k || Te.current !== k) return;
3787
+ const E = q.current;
3788
+ if (!E || Te.current !== E) return;
3790
3789
  const b = {
3791
- threadId: k,
3790
+ threadId: E,
3792
3791
  messages: ee.messages.slice(),
3793
3792
  hasMore: P,
3794
3793
  nextCursor: z,
3795
3794
  checkpointId: ee.lastCheckpointId ?? null,
3796
3795
  checkpointNs: ee.lastCheckpointNs ?? null
3797
- }, N = We.current.get(k);
3796
+ }, N = We.current.get(E);
3798
3797
  (!N || N.messages.length !== b.messages.length || N.messages.some((H, X) => {
3799
3798
  var Se;
3800
3799
  return (H == null ? void 0 : H.id) !== ((Se = b.messages[X]) == null ? void 0 : Se.id);
3801
- }) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(k, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
3800
+ }) || (N == null ? void 0 : N.hasMore) !== b.hasMore || (N == null ? void 0 : N.nextCursor) !== b.nextCursor || (N == null ? void 0 : N.checkpointId) !== b.checkpointId || (N == null ? void 0 : N.checkpointNs) !== b.checkpointNs) && (We.current.set(E, b), he.current && window.clearTimeout(he.current), he.current = window.setTimeout(() => {
3802
3801
  try {
3803
3802
  g(b, 100);
3804
3803
  } catch (H) {
@@ -3814,7 +3813,7 @@ function wx({
3814
3813
  ]);
3815
3814
  const Vt = at(
3816
3815
  () => ({
3817
- threads: E,
3816
+ threads: k,
3818
3817
  currentThreadId: I,
3819
3818
  isLoadingThreads: _,
3820
3819
  isLoadingThread: L,
@@ -3842,7 +3841,7 @@ function wx({
3842
3841
  de,
3843
3842
  Dn,
3844
3843
  ve,
3845
- E
3844
+ k
3846
3845
  ]
3847
3846
  ), $n = at(
3848
3847
  () => ({
@@ -4032,7 +4031,7 @@ function Sx({
4032
4031
  I.key === "Enter" && !I.shiftKey ? (I.preventDefault(), y()) : I.key === "Escape" && t && (I.preventDefault(), a == null || a());
4033
4032
  },
4034
4033
  [y, t, a]
4035
- ), E = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
4034
+ ), k = `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t ? "border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]" : ""} ${d}`;
4036
4035
  return /* @__PURE__ */ c.jsx("form", { onSubmit: (I) => void y(I), className: `w-full ${u}`, children: /* @__PURE__ */ c.jsxs("div", { className: "flex items-end gap-2", children: [
4037
4036
  /* @__PURE__ */ c.jsx("div", { className: "flex-1", children: /* @__PURE__ */ c.jsx(
4038
4037
  pu,
@@ -4042,7 +4041,7 @@ function Sx({
4042
4041
  onChange: S,
4043
4042
  onKeyDown: R,
4044
4043
  placeholder: t ? "Edit your message..." : n,
4045
- className: E,
4044
+ className: k,
4046
4045
  disabled: o,
4047
4046
  maxLength: s,
4048
4047
  rows: 1,
@@ -4087,7 +4086,7 @@ function Tx(e) {
4087
4086
  function gu(e, t) {
4088
4087
  return (n) => e(t(n));
4089
4088
  }
4090
- function El(e, t) {
4089
+ function kl(e, t) {
4091
4090
  return () => e(t);
4092
4091
  }
4093
4092
  function Rx(e, t) {
@@ -4096,7 +4095,7 @@ function Rx(e, t) {
4096
4095
  function oa(e) {
4097
4096
  return e !== void 0;
4098
4097
  }
4099
- function Ex(...e) {
4098
+ function kx(...e) {
4100
4099
  return () => {
4101
4100
  e.map(Tx);
4102
4101
  };
@@ -4106,7 +4105,7 @@ function Rr() {
4106
4105
  function us(e, t) {
4107
4106
  return t(e), e;
4108
4107
  }
4109
- function kx(e, t) {
4108
+ function Ex(e, t) {
4110
4109
  return t(e);
4111
4110
  }
4112
4111
  function rt(...e) {
@@ -4133,7 +4132,7 @@ function qt(e, t) {
4133
4132
  });
4134
4133
  return n;
4135
4134
  }
4136
- function kl(e) {
4135
+ function El(e) {
4137
4136
  let t, n;
4138
4137
  return (r) => (o) => {
4139
4138
  t = o, n && clearTimeout(n), n = setTimeout(() => {
@@ -4150,7 +4149,7 @@ function nt(e = xu) {
4150
4149
  e(t, r) || (t = r, n(r));
4151
4150
  };
4152
4151
  }
4153
- function Ee(e) {
4152
+ function ke(e) {
4154
4153
  return (t) => (n) => {
4155
4154
  e(n) && t(n);
4156
4155
  };
@@ -4211,7 +4210,7 @@ function De(...e) {
4211
4210
  };
4212
4211
  }
4213
4212
  function Ix(...e) {
4214
- return (t) => e.reduceRight(kx, t);
4213
+ return (t) => e.reduceRight(Ex, t);
4215
4214
  }
4216
4215
  function Nx(e) {
4217
4216
  let t, n;
@@ -4317,11 +4316,11 @@ function Ii(...e) {
4317
4316
  case Tr:
4318
4317
  return;
4319
4318
  case Nn:
4320
- return Ex(...e.map((r) => Ye(r, n)));
4319
+ return kx(...e.map((r) => Ye(r, n)));
4321
4320
  }
4322
4321
  };
4323
4322
  }
4324
- var kt = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(kt || {});
4323
+ var Et = /* @__PURE__ */ ((e) => (e[e.DEBUG = 0] = "DEBUG", e[e.INFO = 1] = "INFO", e[e.WARN = 2] = "WARN", e[e.ERROR = 3] = "ERROR", e))(Et || {});
4325
4324
  const jx = {
4326
4325
  0: "debug",
4327
4326
  3: "error",
@@ -4402,7 +4401,7 @@ function Mx(e, t, n, r) {
4402
4401
  if (a.dataset.index === void 0)
4403
4402
  continue;
4404
4403
  const l = parseInt(a.dataset.index), u = parseFloat(a.dataset.knownSize), d = t(a, n);
4405
- if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, kt.ERROR), d === u)
4404
+ if (d === 0 && r("Zero-sized element, this should not happen", { child: a }, Et.ERROR), d === u)
4406
4405
  continue;
4407
4406
  const f = s[s.length - 1];
4408
4407
  s.length === 0 || f.size !== d || f.endIndex !== l - 1 ? s.push({ endIndex: l, size: d, startIndex: l }) : s[s.length - 1].endIndex++;
@@ -4410,7 +4409,7 @@ function Mx(e, t, n, r) {
4410
4409
  return s;
4411
4410
  }
4412
4411
  function Il(e, t, n) {
4413
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
4412
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Et.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
4414
4413
  }
4415
4414
  function vu(e, t, n) {
4416
4415
  const r = V.useRef(null), o = V.useCallback(
@@ -4716,7 +4715,7 @@ function Wr(e, t, n) {
4716
4715
  const { index: r, offset: o, size: s } = Ru(t, e, la), i = e - r, a = s * i + (i - 1) * n + o;
4717
4716
  return a > 0 ? a + n : a;
4718
4717
  }
4719
- function Eu(e, t) {
4718
+ function ku(e, t) {
4720
4719
  if (!fs(t))
4721
4720
  return e;
4722
4721
  let n = 0;
@@ -4724,12 +4723,12 @@ function Eu(e, t) {
4724
4723
  n++;
4725
4724
  return e + n;
4726
4725
  }
4727
- function ku(e, t, n) {
4726
+ function Eu(e, t, n) {
4728
4727
  if (zx(e))
4729
4728
  return t.groupIndices[e.groupIndex] + 1;
4730
4729
  {
4731
4730
  const r = e.index === "LAST" ? n : e.index;
4732
- let o = Eu(r, t);
4731
+ let o = ku(r, t);
4733
4732
  return o = Math.max(0, o, Math.min(n, o)), o;
4734
4733
  }
4735
4734
  }
@@ -4737,7 +4736,7 @@ function Hx(e, t, n, r = 0) {
4737
4736
  return r > 0 && (t = Math.max(t, Ru(e, r, la).offset)), wu(Lx(e, t, n, Bx), Vx);
4738
4737
  }
4739
4738
  function Ux(e, [t, n, r, o]) {
4740
- t.length > 0 && r("received item sizes", t, kt.DEBUG);
4739
+ t.length > 0 && r("received item sizes", t, Et.DEBUG);
4741
4740
  const s = e.sizeTree;
4742
4741
  let i = s, a = 0;
4743
4742
  if (n.length > 0 && Ze(s) && t.length === 2) {
@@ -4823,10 +4822,10 @@ const qx = {
4823
4822
  fe(
4824
4823
  U(
4825
4824
  l,
4826
- Ee((C) => C.length > 0),
4825
+ ke((C) => C.length > 0),
4827
4826
  De(v, p),
4828
- oe(([C, T, E]) => {
4829
- const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, E) || D), pr());
4827
+ oe(([C, T, k]) => {
4828
+ const I = C.reduce((A, _, D) => _t(A, _, Wr(_, T.offsetTree, k) || D), pr());
4830
4829
  return {
4831
4830
  ...T,
4832
4831
  groupIndices: C,
@@ -4839,11 +4838,11 @@ const qx = {
4839
4838
  U(
4840
4839
  r,
4841
4840
  De(v),
4842
- Ee(([C, { lastIndex: T }]) => C < T),
4843
- oe(([C, { lastIndex: T, lastSize: E }]) => [
4841
+ ke(([C, { lastIndex: T }]) => C < T),
4842
+ oe(([C, { lastIndex: T, lastSize: k }]) => [
4844
4843
  {
4845
4844
  endIndex: T,
4846
- size: E,
4845
+ size: k,
4847
4846
  startIndex: C
4848
4847
  }
4849
4848
  ])
@@ -4860,7 +4859,7 @@ const qx = {
4860
4859
  fe(
4861
4860
  U(
4862
4861
  d,
4863
- Ee((C) => C !== void 0 && Ze(lt(v).sizeTree)),
4862
+ ke((C) => C !== void 0 && Ze(lt(v).sizeTree)),
4864
4863
  oe((C) => [{ endIndex: 0, size: C, startIndex: 0 }])
4865
4864
  ),
4866
4865
  n
@@ -4870,9 +4869,9 @@ const qx = {
4870
4869
  n,
4871
4870
  De(v),
4872
4871
  sn(
4873
- ({ sizes: C }, [T, E]) => ({
4874
- changed: E !== C,
4875
- sizes: E
4872
+ ({ sizes: C }, [T, k]) => ({
4873
+ changed: k !== C,
4874
+ sizes: k
4876
4875
  }),
4877
4876
  { changed: !1, sizes: w }
4878
4877
  ),
@@ -4893,15 +4892,15 @@ const qx = {
4893
4892
  if (C > 0)
4894
4893
  je(t, !0), je(s, C + Al(C, T));
4895
4894
  else if (C < 0) {
4896
- const E = lt(g);
4897
- E.length > 0 && (C -= Al(-C, E)), je(i, C);
4895
+ const k = lt(g);
4896
+ k.length > 0 && (C -= Al(-C, k)), je(i, C);
4898
4897
  }
4899
4898
  }
4900
4899
  ), Ye(U(a, De(e)), ([C, T]) => {
4901
4900
  C < 0 && T(
4902
4901
  "`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
4903
4902
  { firstItemIndex: a },
4904
- kt.ERROR
4903
+ Et.ERROR
4905
4904
  );
4906
4905
  });
4907
4906
  const S = jt(s);
@@ -4910,8 +4909,8 @@ const qx = {
4910
4909
  s,
4911
4910
  De(v),
4912
4911
  oe(([C, T]) => {
4913
- const E = T.groupIndices.length > 0, I = [], A = T.lastSize;
4914
- if (E) {
4912
+ const k = T.groupIndices.length > 0, I = [], A = T.lastSize;
4913
+ if (k) {
4915
4914
  const _ = Hr(T.sizeTree, 0);
4916
4915
  let D = 0, L = 0;
4917
4916
  for (; D < C; ) {
@@ -4970,9 +4969,9 @@ const qx = {
4970
4969
  U(
4971
4970
  i,
4972
4971
  De(v, p),
4973
- oe(([C, { offsetTree: T }, E]) => {
4972
+ oe(([C, { offsetTree: T }, k]) => {
4974
4973
  const I = -C;
4975
- return Wr(I, T, E);
4974
+ return Wr(I, T, k);
4976
4975
  })
4977
4976
  )
4978
4977
  );
@@ -4980,7 +4979,7 @@ const qx = {
4980
4979
  U(
4981
4980
  i,
4982
4981
  De(v, p),
4983
- oe(([C, T, E]) => {
4982
+ oe(([C, T, k]) => {
4984
4983
  if (T.groupIndices.length > 0) {
4985
4984
  if (Ze(T.sizeTree))
4986
4985
  return T;
@@ -5001,14 +5000,14 @@ const qx = {
5001
5000
  return {
5002
5001
  ...T,
5003
5002
  sizeTree: I,
5004
- ...ji(T.offsetTree, 0, I, E)
5003
+ ...ji(T.offsetTree, 0, I, k)
5005
5004
  };
5006
5005
  } else {
5007
5006
  const I = Hn(T.sizeTree).reduce((A, { k: _, v: D }) => _t(A, Math.max(0, _ + C), D), pr());
5008
5007
  return {
5009
5008
  ...T,
5010
5009
  sizeTree: I,
5011
- ...ji(T.offsetTree, 0, I, E)
5010
+ ...ji(T.offsetTree, 0, I, k)
5012
5011
  };
5013
5012
  }
5014
5013
  })
@@ -5066,7 +5065,7 @@ const Iu = Ve(
5066
5065
  ), fe(
5067
5066
  U(
5068
5067
  dt(o, t, r),
5069
- Ee(([l, u]) => fs(u)),
5068
+ ke(([l, u]) => fs(u)),
5070
5069
  oe(([l, u, d]) => Gt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
5071
5070
  nt(),
5072
5071
  oe((l) => [l])
@@ -5080,12 +5079,12 @@ const Iu = Ve(
5080
5079
  const t = Z(!1), n = jt(
5081
5080
  U(
5082
5081
  t,
5083
- Ee((r) => r),
5082
+ ke((r) => r),
5084
5083
  nt()
5085
5084
  )
5086
5085
  );
5087
5086
  return Ye(t, (r) => {
5088
- r && lt(e)("props updated", {}, kt.DEBUG);
5087
+ r && lt(e)("props updated", {}, Et.DEBUG);
5089
5088
  }), { didMount: n, propsReady: t };
5090
5089
  },
5091
5090
  rt(An),
@@ -5122,16 +5121,16 @@ const no = Ve(
5122
5121
  De(e, s, o),
5123
5122
  oe(
5124
5123
  ([
5125
- [R, C, T, E, I, A, _, D],
5124
+ [R, C, T, k, I, A, _, D],
5126
5125
  L,
5127
5126
  W,
5128
5127
  P
5129
5128
  ]) => {
5130
- const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = E - 1, F = ku(Y, C, $);
5129
+ const Y = Nu(R), { align: K, behavior: J, offset: z } = Y, $ = k - 1, F = Eu(Y, C, $);
5131
5130
  let B = Wr(F, C.offsetTree, L) + A;
5132
5131
  K === "end" ? (B += W + Gt(C.sizeTree, F)[1] - T + P, F === $ && (B += _)) : K === "center" ? B += (W + Gt(C.sizeTree, F)[1] - T + P) / 2 : B -= I, z && (B += z);
5133
5132
  const pe = (ue) => {
5134
- S(), ue ? (D("retrying to scroll to", { location: R }, kt.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, kt.DEBUG));
5133
+ S(), ue ? (D("retrying to scroll to", { location: R }, Et.DEBUG), je(p, R)) : (je(w, !0), D("list did not change, scroll successful", {}, Et.DEBUG));
5135
5134
  };
5136
5135
  if (S(), J === "smooth") {
5137
5136
  let ue = !1;
@@ -5144,7 +5143,7 @@ const no = Ve(
5144
5143
  g = qt(U(t, Xx(150)), pe);
5145
5144
  return x = setTimeout(() => {
5146
5145
  S();
5147
- }, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, kt.DEBUG), { behavior: J, top: B };
5146
+ }, 1200), je(l, !0), D("scrolling from index to", { behavior: J, index: F, top: B }, Et.DEBUG), { behavior: J, top: B };
5148
5147
  }
5149
5148
  )
5150
5149
  ),
@@ -5184,7 +5183,7 @@ const ro = Ve(
5184
5183
  U(
5185
5184
  i,
5186
5185
  De(l),
5187
- Ee(([d, f]) => !!f),
5186
+ ke(([d, f]) => !!f),
5188
5187
  rn(!1)
5189
5188
  ),
5190
5189
  a
@@ -5192,7 +5191,7 @@ const ro = Ve(
5192
5191
  U(
5193
5192
  i,
5194
5193
  De(l),
5195
- Ee(([d, f]) => !!f),
5194
+ ke(([d, f]) => !!f),
5196
5195
  rn(!1)
5197
5196
  ),
5198
5197
  u
@@ -5200,7 +5199,7 @@ const ro = Ve(
5200
5199
  U(
5201
5200
  dt(t, i),
5202
5201
  De(a, n, e, u),
5203
- Ee(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
5202
+ ke(([[, d], f, { sizeTree: h }, p, w]) => d && (!Ze(h) || oa(p)) && !f && !w),
5204
5203
  De(l)
5205
5204
  ),
5206
5205
  ([, d]) => {
@@ -5236,12 +5235,12 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5236
5235
  }, Qx = 0, oo = Ve(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
5237
5236
  const i = Z(!1), a = Z(!0), l = Be(), u = Be(), d = Z(4), f = Z(Qx), h = yt(
5238
5237
  U(
5239
- Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), kl(100))),
5238
+ Ii(U(Re(o), qn(1), rn(!0)), U(Re(o), qn(1), rn(!1), El(100))),
5240
5239
  nt()
5241
5240
  ),
5242
5241
  !1
5243
5242
  ), p = yt(
5244
- U(Ii(U(n, rn(!0)), U(n, rn(!1), kl(200))), nt()),
5243
+ U(Ii(U(n, rn(!0)), U(n, rn(!1), El(200))), nt()),
5245
5244
  !1
5246
5245
  );
5247
5246
  fe(
@@ -5255,7 +5254,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5255
5254
  const w = jt(
5256
5255
  U(
5257
5256
  dt(r, Re(s), Re(t), Re(e), Re(d)),
5258
- sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, E, I]) => {
5257
+ sn((y, [{ scrollHeight: S, scrollTop: R }, C, T, k, I]) => {
5259
5258
  const A = R + C - S > -I, _ = {
5260
5259
  scrollHeight: S,
5261
5260
  scrollTop: R,
@@ -5308,7 +5307,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5308
5307
  },
5309
5308
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
5310
5309
  ),
5311
- Ee((y) => y.changed),
5310
+ ke((y) => y.changed),
5312
5311
  oe((y) => y.jump)
5313
5312
  ),
5314
5313
  0
@@ -5338,7 +5337,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5338
5337
  return fe(
5339
5338
  U(
5340
5339
  h,
5341
- Ee((y) => !y),
5340
+ ke((y) => !y),
5342
5341
  rn(0)
5343
5342
  ),
5344
5343
  x
@@ -5347,7 +5346,7 @@ const Vr = "up", Mr = "down", Jx = "none", Zx = {
5347
5346
  o,
5348
5347
  mn(100),
5349
5348
  De(h),
5350
- Ee(([y, S]) => !!S),
5349
+ ke(([y, S]) => !!S),
5351
5350
  sn(([y, S], [R]) => [S, R], [0, 0]),
5352
5351
  oe(([y, S]) => S - y)
5353
5352
  ),
@@ -5401,15 +5400,15 @@ const da = Ve(
5401
5400
  S
5402
5401
  ]) => {
5403
5402
  const R = d - y, C = g + x, T = Math.max(h - R, 0);
5404
- let E = _l;
5403
+ let k = _l;
5405
5404
  const I = Pl(S, Fo), A = Pl(S, zo);
5406
- return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (E = Vr), w < d - T + f + A && (E = Mr), E !== _l ? [
5407
- Math.max(R - h - jl(v, Fo, E) - I, 0),
5408
- R - T - x + f + jl(v, zo, E) + A
5405
+ return p -= y, p += h + x, w += h + x, w -= y, p > d + C - I && (k = Vr), w < d - T + f + A && (k = Mr), k !== _l ? [
5406
+ Math.max(R - h - jl(v, Fo, k) - I, 0),
5407
+ R - T - x + f + jl(v, zo, k) + A
5409
5408
  ] : null;
5410
5409
  }
5411
5410
  ),
5412
- Ee((d) => d != null),
5411
+ ke((d) => d != null),
5413
5412
  nt(Ur)
5414
5413
  ),
5415
5414
  [0, 0]
@@ -5429,7 +5428,7 @@ const da = Ve(
5429
5428
  );
5430
5429
  function ev(e, t, n) {
5431
5430
  if (fs(t)) {
5432
- const r = Eu(e, t);
5431
+ const r = ku(e, t);
5433
5432
  return [
5434
5433
  { index: Gt(t.groupOffsetTree, r)[0], offset: 0, size: 0 },
5435
5434
  { data: n == null ? void 0 : n[0], index: r, offset: 0, size: 0 }
@@ -5448,7 +5447,7 @@ const Qs = {
5448
5447
  topListHeight: 0,
5449
5448
  totalCount: 0
5450
5449
  };
5451
- function Eo(e, t, n, r, o, s) {
5450
+ function ko(e, t, n, r, o, s) {
5452
5451
  const { lastIndex: i, lastOffset: a, lastSize: l } = o;
5453
5452
  let u = 0, d = 0;
5454
5453
  if (e.length > 0) {
@@ -5483,7 +5482,7 @@ function _u(e, t, n, r, o, s) {
5483
5482
  offset: 0,
5484
5483
  size: 0
5485
5484
  }));
5486
- return Eo(u, [], a, o, n, r);
5485
+ return ko(u, [], a, o, n, r);
5487
5486
  }
5488
5487
  function Ol(e, t, n) {
5489
5488
  if (e.length === 0)
@@ -5539,15 +5538,15 @@ const er = Ve(
5539
5538
  Re(n),
5540
5539
  e
5541
5540
  ),
5542
- Ee(([T, E, , I, , , , , , , A]) => {
5541
+ ke(([T, k, , I, , , , , , , A]) => {
5543
5542
  const _ = A && A.length !== I;
5544
- return T && !E && !_;
5543
+ return T && !k && !_;
5545
5544
  }),
5546
5545
  oe(
5547
5546
  ([
5548
5547
  ,
5549
5548
  ,
5550
- [T, E],
5549
+ [T, k],
5551
5550
  I,
5552
5551
  A,
5553
5552
  _,
@@ -5560,10 +5559,10 @@ const er = Ve(
5560
5559
  const K = A, { offsetTree: J, sizeTree: z } = K, $ = lt(g);
5561
5560
  if (I === 0)
5562
5561
  return { ...Qs, totalCount: I };
5563
- if (T === 0 && E === 0)
5562
+ if (T === 0 && k === 0)
5564
5563
  return $ === 0 ? { ...Qs, totalCount: I } : _u($, _, A, W, P, Y || []);
5565
5564
  if (Ze(z))
5566
- return $ > 0 ? null : Eo(
5565
+ return $ > 0 ? null : ko(
5567
5566
  ev(ua(_, I), K, Y),
5568
5567
  [],
5569
5568
  I,
@@ -5582,8 +5581,8 @@ const er = Ve(
5582
5581
  }
5583
5582
  }
5584
5583
  if (!D)
5585
- return Eo([], F, I, P, K, W);
5586
- const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, E, B);
5584
+ return ko([], F, I, P, K, W);
5585
+ const B = L.length > 0 ? L[L.length - 1] + 1 : 0, pe = Hx(J, T, k, B);
5587
5586
  if (pe.length === 0)
5588
5587
  return null;
5589
5588
  const ue = I - 1, ee = us([], (Ie) => {
@@ -5598,15 +5597,15 @@ const er = Ve(
5598
5597
  }
5599
5598
  Q < B && (O += (B - Q) * q, Q = B);
5600
5599
  const ce = Math.min(Ce.end, ue);
5601
- for (let ie = Q; ie <= ce && !(O >= E); ie++)
5600
+ for (let ie = Q; ie <= ce && !(O >= k); ie++)
5602
5601
  Ie.push({ data: Y == null ? void 0 : Y[ie], index: ie, offset: O, size: q }), O += q + P;
5603
5602
  }
5604
5603
  });
5605
- return Eo(ee, F, I, P, K, W);
5604
+ return ko(ee, F, I, P, K, W);
5606
5605
  }
5607
5606
  ),
5608
5607
  //@ts-expect-error filter needs to be fixed
5609
- Ee((T) => T !== null),
5608
+ ke((T) => T !== null),
5610
5609
  nt()
5611
5610
  ),
5612
5611
  Qs
@@ -5614,7 +5613,7 @@ const er = Ve(
5614
5613
  fe(
5615
5614
  U(
5616
5615
  e,
5617
- Ee(oa),
5616
+ ke(oa),
5618
5617
  oe((T) => T == null ? void 0 : T.length)
5619
5618
  ),
5620
5619
  o
@@ -5640,10 +5639,10 @@ const er = Ve(
5640
5639
  const S = jt(
5641
5640
  U(
5642
5641
  y,
5643
- Ee(({ items: T }) => T.length > 0),
5642
+ ke(({ items: T }) => T.length > 0),
5644
5643
  De(o, e),
5645
- Ee(([{ items: T }, E]) => T[T.length - 1].originalIndex === E - 1),
5646
- oe(([, T, E]) => [T - 1, E]),
5644
+ ke(([{ items: T }, k]) => T[T.length - 1].originalIndex === k - 1),
5645
+ oe(([, T, k]) => [T - 1, k]),
5647
5646
  nt(Ur),
5648
5647
  oe(([T]) => T)
5649
5648
  )
@@ -5651,23 +5650,23 @@ const er = Ve(
5651
5650
  U(
5652
5651
  y,
5653
5652
  mn(200),
5654
- Ee(({ items: T, topItems: E }) => T.length > 0 && T[0].originalIndex === E.length),
5653
+ ke(({ items: T, topItems: k }) => T.length > 0 && T[0].originalIndex === k.length),
5655
5654
  oe(({ items: T }) => T[0].index),
5656
5655
  nt()
5657
5656
  )
5658
5657
  ), C = jt(
5659
5658
  U(
5660
5659
  y,
5661
- Ee(({ items: T }) => T.length > 0),
5660
+ ke(({ items: T }) => T.length > 0),
5662
5661
  oe(({ items: T }) => {
5663
- let E = 0, I = T.length - 1;
5664
- for (; T[E].type === "group" && E < I; )
5665
- E++;
5666
- for (; T[I].type === "group" && I > E; )
5662
+ let k = 0, I = T.length - 1;
5663
+ for (; T[k].type === "group" && k < I; )
5664
+ k++;
5665
+ for (; T[I].type === "group" && I > k; )
5667
5666
  I--;
5668
5667
  return {
5669
5668
  endIndex: T[I].index,
5670
- startIndex: T[E].index
5669
+ startIndex: T[k].index
5671
5670
  };
5672
5671
  }),
5673
5672
  nt(Tu)
@@ -5704,7 +5703,7 @@ const er = Ve(
5704
5703
  const n = Z(!1), r = yt(
5705
5704
  U(
5706
5705
  dt(n, e, t),
5707
- Ee(([o]) => o),
5706
+ ke(([o]) => o),
5708
5707
  oe(([, o, s]) => Math.max(0, o - s)),
5709
5708
  mn(0),
5710
5709
  nt()
@@ -5736,25 +5735,25 @@ const er = Ve(
5736
5735
  De(t, l, n, s, o, r, a),
5737
5736
  De(e),
5738
5737
  oe(([[f, h, p, w, v, g, x, y], S]) => {
5739
- const { align: R, behavior: C, calculateViewLocation: T = nv, done: E, ...I } = f, A = ku(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
5738
+ const { align: R, behavior: C, calculateViewLocation: T = nv, done: k, ...I } = f, A = Eu(f, h, w - 1), _ = Wr(A, h.offsetTree, S) + v + g, D = _ + Gt(h.sizeTree, A)[1], L = y + g, W = y + p - x, P = T({
5740
5739
  itemBottom: D,
5741
5740
  itemTop: _,
5742
5741
  locationParams: { align: R, behavior: C, ...I },
5743
5742
  viewportBottom: W,
5744
5743
  viewportTop: L
5745
5744
  });
5746
- return P ? E && qt(
5745
+ return P ? k && qt(
5747
5746
  U(
5748
5747
  i,
5749
- Ee((Y) => !Y),
5748
+ ke((Y) => !Y),
5750
5749
  // skips the initial publish of false, and the cleanup call.
5751
5750
  // but if scrollingInProgress is true, we skip the initial publish.
5752
5751
  qn(lt(i) ? 1 : 2)
5753
5752
  ),
5754
- E
5755
- ) : E && E(), P;
5753
+ k
5754
+ ) : k && k(), P;
5756
5755
  }),
5757
- Ee((f) => f !== null)
5756
+ ke((f) => f !== null)
5758
5757
  ),
5759
5758
  u
5760
5759
  ), {
@@ -5792,35 +5791,35 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5792
5791
  U(
5793
5792
  dt(U(Re(t), qn(1)), l),
5794
5793
  De(Re(w), s, a, f),
5795
- oe(([[C, T], E, I, A, _]) => {
5794
+ oe(([[C, T], k, I, A, _]) => {
5796
5795
  let D = T && A, L = "auto";
5797
- return D && (L = rv(E, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
5796
+ return D && (L = rv(k, I || _), D = D && !!L), { followOutputBehavior: L, shouldFollow: D, totalCount: C };
5798
5797
  }),
5799
- Ee(({ shouldFollow: C }) => C)
5798
+ ke(({ shouldFollow: C }) => C)
5800
5799
  ),
5801
5800
  ({ followOutputBehavior: C, totalCount: T }) => {
5802
5801
  g && (g(), g = null), lt(n) ? requestAnimationFrame(() => {
5803
- lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C);
5802
+ lt(d)("following output to ", { totalCount: T }, Et.DEBUG), x(C);
5804
5803
  }) : g = qt(e, () => {
5805
- lt(d)("following output to ", { totalCount: T }, kt.DEBUG), x(C), g = null;
5804
+ lt(d)("following output to ", { totalCount: T }, Et.DEBUG), x(C), g = null;
5806
5805
  });
5807
5806
  }
5808
5807
  );
5809
5808
  function y(C) {
5810
- const T = qt(o, (E) => {
5811
- C && !E.atBottom && E.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, kt.DEBUG), x("auto"));
5809
+ const T = qt(o, (k) => {
5810
+ C && !k.atBottom && k.notAtBottomBecause === "SIZE_INCREASED" && !g && (lt(d)("scrolling to bottom due to increased size", {}, Et.DEBUG), x("auto"));
5812
5811
  });
5813
5812
  setTimeout(T, 100);
5814
5813
  }
5815
5814
  Ye(
5816
5815
  U(
5817
5816
  dt(Re(w), t, u),
5818
- Ee(([C, , T]) => C && T),
5817
+ ke(([C, , T]) => C && T),
5819
5818
  sn(
5820
5819
  ({ value: C }, [, T]) => ({ refreshed: C === T, value: T }),
5821
5820
  { refreshed: !1, value: 0 }
5822
5821
  ),
5823
- Ee(({ refreshed: C }) => C),
5822
+ ke(({ refreshed: C }) => C),
5824
5823
  De(w, t)
5825
5824
  ),
5826
5825
  ([, C]) => {
@@ -5848,8 +5847,8 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5848
5847
  U(
5849
5848
  dt(U(R, qn(1)), l),
5850
5849
  De(Re(S), a, f, h),
5851
- oe(([[C, T], E, I, A, _]) => T && I && (E == null ? void 0 : E({ context: _, totalCount: C, scrollingInProgress: A }))),
5852
- Ee((C) => !!C),
5850
+ oe(([[C, T], k, I, A, _]) => T && I && (k == null ? void 0 : k({ context: _, totalCount: C, scrollingInProgress: A }))),
5851
+ ke((C) => !!C),
5853
5852
  mn(0)
5854
5853
  ),
5855
5854
  (C) => {
@@ -5877,7 +5876,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5877
5876
  U(
5878
5877
  a,
5879
5878
  De(s),
5880
- Ee(([, l]) => l !== 0),
5879
+ ke(([, l]) => l !== 0),
5881
5880
  De(o, r, t, n, e),
5882
5881
  oe(([[, l], u, d, f, h, p = []]) => _u(l, u, d, f, h, p))
5883
5882
  ),
@@ -5892,7 +5891,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5892
5891
  U(
5893
5892
  e,
5894
5893
  De(r),
5895
- Ee(([, o]) => o !== 0),
5894
+ ke(([, o]) => o !== 0),
5896
5895
  oe(([, o]) => ({ top: o }))
5897
5896
  ),
5898
5897
  (o) => {
@@ -5900,7 +5899,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5900
5899
  U(
5901
5900
  n,
5902
5901
  qn(1),
5903
- Ee((s) => s.items.length > 1)
5902
+ ke((s) => s.items.length > 1)
5904
5903
  ),
5905
5904
  () => {
5906
5905
  requestAnimationFrame(() => {
@@ -5922,7 +5921,7 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5922
5921
  U(
5923
5922
  e,
5924
5923
  De(r, t, n),
5925
- Ee(([o, s]) => !!s),
5924
+ ke(([o, s]) => !!s),
5926
5925
  oe(([o, s, i, a]) => {
5927
5926
  const { enter: l, exit: u } = s;
5928
5927
  if (i) {
@@ -5994,11 +5993,11 @@ const rv = (e, t) => typeof e == "function" ? Ml(e(t)) : t && Ml(e), ov = Ve(
5994
5993
  const R = Wx(w.sizeTree);
5995
5994
  g && x !== null && y !== null && (v = x.scrollTop - y.offsetTop), v -= S, p({ ranges: R, scrollTop: v });
5996
5995
  }
5997
- ), fe(U(d, Ee(oa), oe(lv)), o), fe(
5996
+ ), fe(U(d, ke(oa), oe(lv)), o), fe(
5998
5997
  U(
5999
5998
  s,
6000
5999
  De(d),
6001
- Ee(([, p]) => p !== void 0),
6000
+ ke(([, p]) => p !== void 0),
6002
6001
  nt(),
6003
6002
  oe(([, p]) => p.ranges)
6004
6003
  ),
@@ -6018,7 +6017,7 @@ const cv = Ve(([{ topItemsIndexes: e }]) => {
6018
6017
  return fe(
6019
6018
  U(
6020
6019
  t,
6021
- Ee((n) => n >= 0),
6020
+ ke((n) => n >= 0),
6022
6021
  oe((n) => Array.from({ length: n }).map((r, o) => o))
6023
6022
  ),
6024
6023
  e
@@ -6042,17 +6041,17 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6042
6041
  l,
6043
6042
  De(i),
6044
6043
  sn(
6045
- ([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: E }, I]) => {
6044
+ ([, x, y, S], [{ bottom: R, items: C, offsetBottom: T, totalCount: k }, I]) => {
6046
6045
  const A = R + T;
6047
6046
  let _ = 0;
6048
- return y === E && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, E, A];
6047
+ return y === k && x.length > 0 && C.length > 0 && (C[0].originalIndex === 0 && x[0].originalIndex === 0 || (_ = A - S, _ !== 0 && (_ += I))), [_, C, k, A];
6049
6048
  },
6050
6049
  [0, [], 0, 0]
6051
6050
  ),
6052
- Ee(([x]) => x !== 0),
6051
+ ke(([x]) => x !== 0),
6053
6052
  De(r, a, n, o, p, w),
6054
- Ee(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
6055
- oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, kt.DEBUG), x))
6053
+ ke(([, x, y, S, , , R]) => !R && !S && x !== 0 && y === Vr),
6054
+ oe(([[x], , , , , y]) => (y("Upward scrolling compensation", { amount: x }, Et.DEBUG), x))
6056
6055
  )
6057
6056
  );
6058
6057
  function g(x) {
@@ -6063,7 +6062,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6063
6062
  }), Ye(
6064
6063
  U(
6065
6064
  dt(yt(s, !1), e, w),
6066
- Ee(([x, y, S]) => !x && !S && y !== 0),
6065
+ ke(([x, y, S]) => !x && !S && y !== 0),
6067
6066
  oe(([x, y]) => y),
6068
6067
  mn(1)
6069
6068
  ),
@@ -6079,21 +6078,21 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6079
6078
  u,
6080
6079
  De(h, d),
6081
6080
  oe(([x, { groupIndices: y, lastSize: S, sizeTree: R }, C]) => {
6082
- function T(E) {
6083
- return E * (S + C);
6081
+ function T(k) {
6082
+ return k * (S + C);
6084
6083
  }
6085
6084
  if (y.length === 0)
6086
6085
  return T(x);
6087
6086
  {
6088
- let E = 0;
6087
+ let k = 0;
6089
6088
  const I = Hr(R, 0);
6090
6089
  let A = 0, _ = 0;
6091
6090
  for (; A < x; ) {
6092
- A++, E += I;
6091
+ A++, k += I;
6093
6092
  let D = y.length === _ + 1 ? 1 / 0 : y[_ + 1] - y[_] - 1;
6094
- A + D > x && (E -= I, D = x - A + 1), A += D, E += T(D), _++;
6093
+ A + D > x && (k -= I, D = x - A + 1), A += D, k += T(D), _++;
6095
6094
  }
6096
- return E;
6095
+ return k;
6097
6096
  }
6098
6097
  })
6099
6098
  ),
@@ -6169,7 +6168,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6169
6168
  { listState: y, topItemsIndexes: S, ...R },
6170
6169
  { scrollToIndex: C },
6171
6170
  T,
6172
- { topItemCount: E },
6171
+ { topItemCount: k },
6173
6172
  { groupCounts: I },
6174
6173
  A
6175
6174
  ]) => (fe(R.rangeChanged, A.scrollSeekRangeChanged), fe(
@@ -6189,7 +6188,7 @@ const uv = Du(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
6189
6188
  initialTopMostItemIndex: p,
6190
6189
  scrolledToInitialItem: w,
6191
6190
  sizeRanges: a,
6192
- topItemCount: E,
6191
+ topItemCount: k,
6193
6192
  topItemsIndexes: S,
6194
6193
  // input
6195
6194
  totalCount: d,
@@ -6259,12 +6258,12 @@ function $u(e, t, n) {
6259
6258
  return i.reduce((x, y) => (x[y] = Nx(g[t.events[y]]), x), {});
6260
6259
  }
6261
6260
  const f = V.forwardRef((g, x) => {
6262
- const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (E) => {
6263
- l(E, S);
6264
- })), [C] = V.useState(El(d, R));
6261
+ const { children: y, ...S } = g, [R] = V.useState(() => us(_x(e), (k) => {
6262
+ l(k, S);
6263
+ })), [C] = V.useState(kl(d, R));
6265
6264
  uo(() => {
6266
- for (const E of i)
6267
- E in S && Ye(C[E], S[E]);
6265
+ for (const k of i)
6266
+ k in S && Ye(C[k], S[k]);
6268
6267
  return () => {
6269
6268
  Object.values(C).map(sa);
6270
6269
  };
@@ -6292,7 +6291,7 @@ function $u(e, t, n) {
6292
6291
  () => lt(x)
6293
6292
  );
6294
6293
  }, w = (g) => {
6295
- const x = V.useContext(a)[g], [y, S] = V.useState(El(lt, x));
6294
+ const x = V.useContext(a)[g], [y, S] = V.useState(kl(lt, x));
6296
6295
  return uo(
6297
6296
  () => Ye(x, (R) => {
6298
6297
  R !== y && S(Rl(R));
@@ -6421,7 +6420,7 @@ const mv = /* @__PURE__ */ Ve(() => {
6421
6420
  ma("deviation", (P) => {
6422
6421
  x !== P && y(P);
6423
6422
  });
6424
- const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), E = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
6423
+ const S = Ae("EmptyPlaceholder"), R = Ae("ScrollSeekPlaceholder") || xv, C = Ae("ListComponent"), T = Ae("ItemComponent"), k = Ae("GroupComponent"), I = Ae("computeItemKey"), A = Ae("isSeeking"), _ = Ae("groupIndices").length > 0, D = Ae("alignToBottom"), L = Ae("initialItemFinalLocationReached"), W = e ? {} : {
6425
6424
  boxSizing: "border-box",
6426
6425
  ...v ? {
6427
6426
  display: "inline-block",
@@ -6457,9 +6456,9 @@ const mv = /* @__PURE__ */ Ve(() => {
6457
6456
  ...P.type === "group" ? {} : { groupIndex: P.groupIndex }
6458
6457
  }
6459
6458
  ) : P.type === "group" ? /* @__PURE__ */ bo(
6460
- E,
6459
+ k,
6461
6460
  {
6462
- ...bt(E, u),
6461
+ ...bt(k, u),
6463
6462
  "data-index": Y,
6464
6463
  "data-item-index": P.index,
6465
6464
  "data-known-size": P.size,
@@ -6590,7 +6589,7 @@ function Vu({ useEmitter: e, useEmitterValue: t, usePublisher: n }) {
6590
6589
  );
6591
6590
  });
6592
6591
  }
6593
- const Ev = ({ children: e }) => {
6592
+ const kv = ({ children: e }) => {
6594
6593
  const t = V.useContext(Fu), n = zt("viewportHeight"), r = zt("fixedItemHeight"), o = Ae("alignToBottom"), s = Ae("horizontalDirection"), i = V.useMemo(
6595
6594
  () => gu(n, (l) => Tn(l, s ? "width" : "height")),
6596
6595
  [n, s]
@@ -6598,7 +6597,7 @@ const Ev = ({ children: e }) => {
6598
6597
  return V.useEffect(() => {
6599
6598
  t && (n(t.viewportHeight), r(t.itemHeight));
6600
6599
  }, [t, n, r]), /* @__PURE__ */ c.jsx("div", { "data-viewport-type": "element", ref: a, style: hs(o), children: e });
6601
- }, kv = ({ children: e }) => {
6600
+ }, Ev = ({ children: e }) => {
6602
6601
  const t = V.useContext(Fu), n = zt("windowViewportRect"), r = zt("fixedItemHeight"), o = Ae("customScrollParent"), s = vu(
6603
6602
  n,
6604
6603
  o,
@@ -6614,7 +6613,7 @@ const Ev = ({ children: e }) => {
6614
6613
  const t = Ae("useWindowScroll"), n = Ae("topItemsIndexes").length > 0, r = Ae("customScrollParent"), o = Ae("context");
6615
6614
  return /* @__PURE__ */ c.jsxs(r || t ? jv : _v, { ...e, context: o, children: [
6616
6615
  n && /* @__PURE__ */ c.jsx(Iv, { children: /* @__PURE__ */ c.jsx(Ll, { showTopList: !0 }) }),
6617
- /* @__PURE__ */ c.jsxs(r || t ? kv : Ev, { children: [
6616
+ /* @__PURE__ */ c.jsxs(r || t ? Ev : kv, { children: [
6618
6617
  /* @__PURE__ */ c.jsx(Tv, {}),
6619
6618
  /* @__PURE__ */ c.jsx(Ll, {}),
6620
6619
  /* @__PURE__ */ c.jsx(Rv, {})
@@ -6764,12 +6763,12 @@ const $v = /* @__PURE__ */ Ve(
6764
6763
  { customScrollParent: g, useWindowScroll: x, windowScrollContainerState: y, windowScrollTo: S, windowViewportRect: R },
6765
6764
  C
6766
6765
  ]) => {
6767
- const T = Z(0), E = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
6766
+ const T = Z(0), k = Z(0), I = Z($l), A = Z({ height: 0, width: 0 }), _ = Z({ height: 0, width: 0 }), D = Be(), L = Be(), W = Z(0), P = Z(null), Y = Z({ column: 0, row: 0 }), K = Be(), J = Be(), z = Z(!1), $ = Z(0), F = Z(!0), B = Z(!1), pe = Z(!1);
6768
6767
  Ye(
6769
6768
  U(
6770
6769
  w,
6771
6770
  De($),
6772
- Ee(([O, Q]) => !!Q)
6771
+ ke(([O, Q]) => !!Q)
6773
6772
  ),
6774
6773
  () => {
6775
6774
  je(F, !1);
@@ -6777,7 +6776,7 @@ const $v = /* @__PURE__ */ Ve(
6777
6776
  ), Ye(
6778
6777
  U(
6779
6778
  dt(w, F, _, A, $, B),
6780
- Ee(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
6779
+ ke(([O, Q, q, ce, , ie]) => O && !Q && q.height !== 0 && ce.height !== 0 && !ie)
6781
6780
  ),
6782
6781
  ([, , , , O]) => {
6783
6782
  je(B, !0), ca(1, () => {
@@ -6789,15 +6788,15 @@ const $v = /* @__PURE__ */ Ve(
6789
6788
  ), fe(
6790
6789
  U(
6791
6790
  J,
6792
- Ee((O) => O != null && O.scrollTop > 0),
6791
+ ke((O) => O != null && O.scrollTop > 0),
6793
6792
  rn(0)
6794
6793
  ),
6795
- E
6794
+ k
6796
6795
  ), Ye(
6797
6796
  U(
6798
6797
  w,
6799
6798
  De(J),
6800
- Ee(([, O]) => O != null)
6799
+ ke(([, O]) => O != null)
6801
6800
  ),
6802
6801
  ([, O]) => {
6803
6802
  O && (je(A, O.viewport), je(_, O.item), je(Y, O.gap), O.scrollTop > 0 && (je(z, !0), qt(U(u, qn(1)), (Q) => {
@@ -6835,12 +6834,12 @@ const $v = /* @__PURE__ */ Ve(
6835
6834
  Re(_, fo),
6836
6835
  Re(A, fo),
6837
6836
  Re(P),
6838
- Re(E),
6837
+ Re(k),
6839
6838
  Re(z),
6840
6839
  Re(F),
6841
6840
  Re($)
6842
6841
  ),
6843
- Ee(([, , , , , , , O]) => !O),
6842
+ ke(([, , , , , , , O]) => !O),
6844
6843
  oe(
6845
6844
  ([
6846
6845
  O,
@@ -6873,14 +6872,14 @@ const $v = /* @__PURE__ */ Ve(
6873
6872
  ), fe(
6874
6873
  U(
6875
6874
  P,
6876
- Ee((O) => O !== null),
6875
+ ke((O) => O !== null),
6877
6876
  oe((O) => O.length)
6878
6877
  ),
6879
6878
  T
6880
6879
  ), fe(
6881
6880
  U(
6882
6881
  dt(A, _, I, Y),
6883
- Ee(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
6882
+ ke(([O, Q, { items: q }]) => q.length > 0 && Q.height !== 0 && O.height !== 0),
6884
6883
  oe(([O, Q, { items: q }, ce]) => {
6885
6884
  const { bottom: ie, top: $e } = Hl(O, ce, Q, q);
6886
6885
  return [$e, ie];
@@ -6901,9 +6900,9 @@ const $v = /* @__PURE__ */ Ve(
6901
6900
  const ee = jt(
6902
6901
  U(
6903
6902
  dt(I, T),
6904
- Ee(([{ items: O }]) => O.length > 0),
6903
+ ke(([{ items: O }]) => O.length > 0),
6905
6904
  De(ue),
6906
- Ee(([[O, Q], q]) => {
6905
+ ke(([[O, Q], q]) => {
6907
6906
  const ce = O.items[O.items.length - 1].index === Q - 1;
6908
6907
  return (q || O.bottom > 0 && O.itemHeight > 0 && O.offsetBottom === 0 && O.items.length === Q) && ce;
6909
6908
  }),
@@ -6913,7 +6912,7 @@ const $v = /* @__PURE__ */ Ve(
6913
6912
  ), Ie = jt(
6914
6913
  U(
6915
6914
  Re(I),
6916
- Ee(({ items: O }) => O.length > 0 && O[0].index === 0),
6915
+ ke(({ items: O }) => O.length > 0 && O[0].index === 0),
6917
6916
  rn(0),
6918
6917
  nt()
6919
6918
  )
@@ -6921,7 +6920,7 @@ const $v = /* @__PURE__ */ Ve(
6921
6920
  U(
6922
6921
  Re(I),
6923
6922
  De(z),
6924
- Ee(([{ items: O }, Q]) => O.length > 0 && !Q),
6923
+ ke(([{ items: O }, Q]) => O.length > 0 && !Q),
6925
6924
  oe(([{ items: O }]) => ({
6926
6925
  endIndex: O[O.length - 1].index,
6927
6926
  startIndex: O[0].index
@@ -6966,7 +6965,7 @@ const $v = /* @__PURE__ */ Ve(
6966
6965
  gap: Y,
6967
6966
  headerHeight: s,
6968
6967
  increaseViewportBy: e,
6969
- initialItemCount: E,
6968
+ initialItemCount: k,
6970
6969
  itemDimensions: _,
6971
6970
  overscan: n,
6972
6971
  restoreStateFrom: J,
@@ -7197,7 +7196,7 @@ const Fv = /* @__PURE__ */ Ve(() => {
7197
7196
  Kv
7198
7197
  ), qv = /* @__PURE__ */ Wu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt }), Gv = /* @__PURE__ */ Vu({ useEmitter: qu, useEmitterValue: st, usePublisher: Bt });
7199
7198
  function Ul(e, t, n) {
7200
- return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, kt.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
7199
+ return t !== "normal" && !(t != null && t.endsWith("px")) && n(`${e} was not resolved to pixel value correctly`, t, Et.WARN), t === "normal" ? 0 : parseInt(t ?? "0", 10);
7201
7200
  }
7202
7201
  const Yv = ns(
7203
7202
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
@@ -7380,7 +7379,7 @@ var tw = [
7380
7379
  "span",
7381
7380
  "svg",
7382
7381
  "ul"
7383
- ], ke = tw.reduce((e, t) => {
7382
+ ], Ee = tw.reduce((e, t) => {
7384
7383
  const n = vr(`Primitive.${t}`), r = m.forwardRef((o, s) => {
7385
7384
  const { asChild: i, ...a } = o, l = i ? n : t;
7386
7385
  return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c.jsx(l, { ...a, ref: s });
@@ -7487,7 +7486,7 @@ var ps = "Collapsible", [aw, WT] = fn(ps), [lw, xa] = aw(ps), Yu = m.forwardRef(
7487
7486
  open: l,
7488
7487
  onOpenToggle: m.useCallback(() => u((d) => !d), [u]),
7489
7488
  children: /* @__PURE__ */ c.jsx(
7490
- ke.div,
7489
+ Ee.div,
7491
7490
  {
7492
7491
  "data-state": wa(l),
7493
7492
  "data-disabled": s ? "" : void 0,
@@ -7504,7 +7503,7 @@ var Xu = "CollapsibleTrigger", Ju = m.forwardRef(
7504
7503
  (e, t) => {
7505
7504
  const { __scopeCollapsible: n, ...r } = e, o = xa(Xu, n);
7506
7505
  return /* @__PURE__ */ c.jsx(
7507
- ke.button,
7506
+ Ee.button,
7508
7507
  {
7509
7508
  type: "button",
7510
7509
  "aria-controls": o.contentId,
@@ -7543,7 +7542,7 @@ var uw = m.forwardRef((e, t) => {
7543
7542
  f.current = S.height, p.current = S.width, g.current || (y.style.transitionDuration = x.current.transitionDuration, y.style.animationName = x.current.animationName), l(r);
7544
7543
  }
7545
7544
  }, [i.open, r]), /* @__PURE__ */ c.jsx(
7546
- ke.div,
7545
+ Ee.div,
7547
7546
  {
7548
7547
  "data-state": wa(i.open),
7549
7548
  "data-disabled": i.disabled ? "" : void 0,
@@ -7606,8 +7605,8 @@ const Zu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
7606
7605
  }
7607
7606
  ));
7608
7607
  Zu.displayName = "CardDescription";
7609
- const ko = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
7610
- ko.displayName = "CardContent";
7608
+ const Eo = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: te("p-6 pt-0", e), ...t }));
7609
+ Eo.displayName = "CardContent";
7611
7610
  const Qu = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
7612
7611
  "div",
7613
7612
  {
@@ -7779,7 +7778,7 @@ function Jl(e, t, n, r) {
7779
7778
  text: vt(i)
7780
7779
  };
7781
7780
  }
7782
- function Ew(e, t) {
7781
+ function kw(e, t) {
7783
7782
  const n = e.match(/^(\s+)(?:```)/);
7784
7783
  if (n === null)
7785
7784
  return t;
@@ -7822,7 +7821,7 @@ class ba {
7822
7821
  fences(t) {
7823
7822
  const n = this.rules.block.fences.exec(t);
7824
7823
  if (n) {
7825
- const r = n[0], o = Ew(r, n[3] || "");
7824
+ const r = n[0], o = kw(r, n[3] || "");
7826
7825
  return {
7827
7826
  type: "code",
7828
7827
  raw: r,
@@ -7889,14 +7888,14 @@ class ba {
7889
7888
  `, 1)[0].replace(/^\t+/, (R) => " ".repeat(3 * R.length)), f = t.split(`
7890
7889
  `, 1)[0], this.options.pedantic ? (i = 2, p = d.trimLeft()) : (i = n[2].search(/[^ ]/), i = i > 4 ? 1 : i, p = d.slice(i), i += n[1].length), l = !1, !d && /^ *$/.test(f) && (r += f + `
7891
7890
  `, t = t.substring(f.length + 1), w = !0), !w) {
7892
- const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), E = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
7891
+ const R = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), C = new RegExp(`^ {0,${Math.min(3, i - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), T = new RegExp(`^ {0,${Math.min(3, i - 1)}}(?:\`\`\`|~~~)`), k = new RegExp(`^ {0,${Math.min(3, i - 1)}}#`);
7893
7892
  for (; t && (h = t.split(`
7894
- `, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || E.test(f) || R.test(f) || C.test(t))); ) {
7893
+ `, 1)[0], f = h, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(T.test(f) || k.test(f) || R.test(f) || C.test(t))); ) {
7895
7894
  if (f.search(/[^ ]/) >= i || !f.trim())
7896
7895
  p += `
7897
7896
  ` + f.slice(i);
7898
7897
  else {
7899
- if (l || d.search(/[^ ]/) >= 4 || T.test(d) || E.test(d) || C.test(d))
7898
+ if (l || d.search(/[^ ]/) >= 4 || T.test(d) || k.test(d) || C.test(d))
7900
7899
  break;
7901
7900
  p += `
7902
7901
  ` + f;
@@ -8335,7 +8334,7 @@ se.breaks = {
8335
8334
  br: Qe(se.br).replace("{2,}", "*").getRegex(),
8336
8335
  text: Qe(se.gfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
8337
8336
  };
8338
- function kw(e) {
8337
+ function Ew(e) {
8339
8338
  return e.replace(/---/g, "—").replace(/--/g, "–").replace(/(^|[-\u2014/(\[{"\s])'/g, "$1‘").replace(/'/g, "’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g, "$1“").replace(/"/g, "”").replace(/\.{3}/g, "…");
8340
8339
  }
8341
8340
  function Zl(e) {
@@ -8549,7 +8548,7 @@ class Rn {
8549
8548
  h = p.call({ lexer: this }, f), typeof h == "number" && h >= 0 && (d = Math.min(d, h));
8550
8549
  }), d < 1 / 0 && d >= 0 && (s = t.substring(0, d + 1));
8551
8550
  }
8552
- if (r = this.tokenizer.inlineText(s, kw)) {
8551
+ if (r = this.tokenizer.inlineText(s, Ew)) {
8553
8552
  t = t.substring(r.raw.length), r.raw.slice(-1) !== "_" && (u = r.raw.slice(-1)), l = !0, o = n[n.length - 1], o && o.type === "text" ? (o.raw += r.raw, o.text += r.text) : n.push(r);
8554
8553
  continue;
8555
8554
  }
@@ -8778,7 +8777,7 @@ class sd {
8778
8777
  return this.getNextSafeSlug(r, n.dryrun);
8779
8778
  }
8780
8779
  }
8781
- class En {
8780
+ class kn {
8782
8781
  constructor(t) {
8783
8782
  this.options = t || tr, this.options.renderer = this.options.renderer || new ya(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new od(), this.slugger = new sd();
8784
8783
  }
@@ -8786,21 +8785,21 @@ class En {
8786
8785
  * Static Parse Method
8787
8786
  */
8788
8787
  static parse(t, n) {
8789
- return new En(n).parse(t);
8788
+ return new kn(n).parse(t);
8790
8789
  }
8791
8790
  /**
8792
8791
  * Static Parse Inline Method
8793
8792
  */
8794
8793
  static parseInline(t, n) {
8795
- return new En(n).parseInline(t);
8794
+ return new kn(n).parseInline(t);
8796
8795
  }
8797
8796
  /**
8798
8797
  * Parse Loop
8799
8798
  */
8800
8799
  parse(t, n = !0) {
8801
8800
  let r = "", o, s, i, a, l, u, d, f, h, p, w, v, g, x, y, S, R, C, T;
8802
- const E = t.length;
8803
- for (o = 0; o < E; o++) {
8801
+ const k = t.length;
8802
+ for (o = 0; o < k; o++) {
8804
8803
  if (p = t[o], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[p.type] && (T = this.options.extensions.renderers[p.type].call({ parser: this }, p), T !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(p.type))) {
8805
8804
  r += T || "";
8806
8805
  continue;
@@ -8868,7 +8867,7 @@ class En {
8868
8867
  continue;
8869
8868
  }
8870
8869
  case "text": {
8871
- for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < E && t[o + 1].type === "text"; )
8870
+ for (h = p.tokens ? this.parseInline(p.tokens) : p.text; o + 1 < k && t[o + 1].type === "text"; )
8872
8871
  p = t[++o], h += `
8873
8872
  ` + (p.tokens ? this.parseInline(p.tokens) : p.text);
8874
8873
  r += n ? this.renderer.paragraph(h) : h;
@@ -9050,7 +9049,7 @@ function id(e, t) {
9050
9049
  };
9051
9050
  }
9052
9051
  function be(e, t, n) {
9053
- return id(Rn.lex, En.parse)(e, t, n);
9052
+ return id(Rn.lex, kn.parse)(e, t, n);
9054
9053
  }
9055
9054
  be.options = be.setOptions = function(e) {
9056
9055
  return be.defaults = { ...be.defaults, ...e }, fw(be.defaults), be;
@@ -9148,9 +9147,9 @@ be.walkTokens = function(e, t) {
9148
9147
  }
9149
9148
  return n;
9150
9149
  };
9151
- be.parseInline = id(Rn.lexInline, En.parseInline);
9152
- be.Parser = En;
9153
- be.parser = En.parse;
9150
+ be.parseInline = id(Rn.lexInline, kn.parseInline);
9151
+ be.Parser = kn;
9152
+ be.parser = kn.parse;
9154
9153
  be.Renderer = ya;
9155
9154
  be.TextRenderer = od;
9156
9155
  be.Lexer = Rn;
@@ -9164,7 +9163,7 @@ be.setOptions;
9164
9163
  be.use;
9165
9164
  be.walkTokens;
9166
9165
  be.parseInline;
9167
- En.parse;
9166
+ kn.parse;
9168
9167
  Rn.lex;
9169
9168
  function Ql({
9170
9169
  content: e,
@@ -9344,15 +9343,15 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
9344
9343
  onInteractOutside: i,
9345
9344
  onDismiss: a,
9346
9345
  ...l
9347
- } = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (E) => f(E)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((E) => {
9348
- const I = E.target, A = [...u.branches].some((_) => _.contains(I));
9349
- !R || A || (o == null || o(E), i == null || i(E), E.defaultPrevented || a == null || a());
9350
- }, h), T = Uw((E) => {
9351
- const I = E.target;
9352
- [...u.branches].some((_) => _.contains(I)) || (s == null || s(E), i == null || i(E), E.defaultPrevented || a == null || a());
9346
+ } = e, u = m.useContext(ld), [d, f] = m.useState(null), h = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, p] = m.useState({}), w = ze(t, (k) => f(k)), v = Array.from(u.layers), [g] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), x = v.indexOf(g), y = d ? v.indexOf(d) : -1, S = u.layersWithOutsidePointerEventsDisabled.size > 0, R = y >= x, C = Hw((k) => {
9347
+ const I = k.target, A = [...u.branches].some((_) => _.contains(I));
9348
+ !R || A || (o == null || o(k), i == null || i(k), k.defaultPrevented || a == null || a());
9349
+ }, h), T = Uw((k) => {
9350
+ const I = k.target;
9351
+ [...u.branches].some((_) => _.contains(I)) || (s == null || s(k), i == null || i(k), k.defaultPrevented || a == null || a());
9353
9352
  }, h);
9354
- return Dw((E) => {
9355
- y === u.layers.size - 1 && (r == null || r(E), !E.defaultPrevented && a && (E.preventDefault(), a()));
9353
+ return Dw((k) => {
9354
+ y === u.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && a && (k.preventDefault(), a()));
9356
9355
  }, h), m.useEffect(() => {
9357
9356
  if (d)
9358
9357
  return n && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (nc = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(d)), u.layers.add(d), rc(), () => {
@@ -9361,10 +9360,10 @@ var Lw = "DismissableLayer", Mi = "dismissableLayer.update", $w = "dismissableLa
9361
9360
  }, [d, h, n, u]), m.useEffect(() => () => {
9362
9361
  d && (u.layers.delete(d), u.layersWithOutsidePointerEventsDisabled.delete(d), rc());
9363
9362
  }, [d, u]), m.useEffect(() => {
9364
- const E = () => p({});
9365
- return document.addEventListener(Mi, E), () => document.removeEventListener(Mi, E);
9363
+ const k = () => p({});
9364
+ return document.addEventListener(Mi, k), () => document.removeEventListener(Mi, k);
9366
9365
  }, []), /* @__PURE__ */ c.jsx(
9367
- ke.div,
9366
+ Ee.div,
9368
9367
  {
9369
9368
  ...l,
9370
9369
  ref: w,
@@ -9391,7 +9390,7 @@ var zw = "DismissableLayerBranch", Bw = m.forwardRef((e, t) => {
9391
9390
  return n.branches.add(s), () => {
9392
9391
  n.branches.delete(s);
9393
9392
  };
9394
- }, [n.branches]), /* @__PURE__ */ c.jsx(ke.div, { ...e, ref: o });
9393
+ }, [n.branches]), /* @__PURE__ */ c.jsx(Ee.div, { ...e, ref: o });
9395
9394
  });
9396
9395
  Bw.displayName = zw;
9397
9396
  function Hw(e, t = globalThis == null ? void 0 : globalThis.document) {
@@ -9510,7 +9509,7 @@ var si = "focusScope.autoFocusOnMount", ii = "focusScope.autoFocusOnUnmount", oc
9510
9509
  },
9511
9510
  [n, r, p.paused]
9512
9511
  );
9513
- return /* @__PURE__ */ c.jsx(ke.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
9512
+ return /* @__PURE__ */ c.jsx(Ee.div, { tabIndex: -1, ...i, ref: h, onKeyDown: w });
9514
9513
  });
9515
9514
  gs.displayName = Ww;
9516
9515
  function Vw(e, { select: t = !1 } = {}) {
@@ -9580,7 +9579,7 @@ var Jw = "Portal", xs = m.forwardRef((e, t) => {
9580
9579
  const { container: n, ...r } = e, [o, s] = m.useState(!1);
9581
9580
  pt(() => s(!0), []);
9582
9581
  const i = n || o && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
9583
- return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t }), i) : null;
9582
+ return i ? Dc.createPortal(/* @__PURE__ */ c.jsx(Ee.div, { ...r, ref: t }), i) : null;
9584
9583
  });
9585
9584
  xs.displayName = Jw;
9586
9585
  var ai = 0;
@@ -9745,12 +9744,12 @@ var hd = ib(), ci = function() {
9745
9744
  onScrollCapture: ci,
9746
9745
  onWheelCapture: ci,
9747
9746
  onTouchMoveCapture: ci
9748
- }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), E = on(on({}, R), o);
9747
+ }), o = r[0], s = r[1], i = e.forwardProps, a = e.children, l = e.className, u = e.removeScrollBar, d = e.enabled, f = e.shards, h = e.sideCar, p = e.noRelative, w = e.noIsolation, v = e.inert, g = e.allowPinchZoom, x = e.as, y = x === void 0 ? "div" : x, S = e.gapMode, R = dd(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = h, T = rb([n, t]), k = on(on({}, R), o);
9749
9748
  return m.createElement(
9750
9749
  m.Fragment,
9751
9750
  null,
9752
9751
  d && m.createElement(C, { sideCar: hd, removeScrollBar: u, shards: f, noRelative: p, noIsolation: w, inert: v, setCallbacks: s, allowPinchZoom: !!g, lockRef: n, gapMode: S }),
9753
- i ? m.cloneElement(m.Children.only(a), on(on({}, E), { ref: T })) : m.createElement(y, on({}, E, { className: l, ref: T }), a)
9752
+ i ? m.cloneElement(m.Children.only(a), on(on({}, k), { ref: T })) : m.createElement(y, on({}, k, { className: l, ref: T }), a)
9754
9753
  );
9755
9754
  });
9756
9755
  vs.defaultProps = {
@@ -9945,10 +9944,10 @@ var lr = Di ? { passive: !1 } : !1, yb = function(e) {
9945
9944
  return e === "v" ? Sb(t) : Cb(t);
9946
9945
  }, xd = function(e, t) {
9947
9946
  return e === "v" ? Tb(t) : Rb(t);
9948
- }, Eb = function(e, t) {
9947
+ }, kb = function(e, t) {
9949
9948
  return e === "h" && t === "rtl" ? -1 : 1;
9950
- }, kb = function(e, t, n, r, o) {
9951
- var s = Eb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
9949
+ }, Eb = function(e, t, n, r, o) {
9950
+ var s = kb(e, window.getComputedStyle(t).direction), i = s * r, a = n.target, l = t.contains(a), u = !1, d = i > 0, f = 0, h = 0;
9952
9951
  do {
9953
9952
  if (!a)
9954
9953
  break;
@@ -9996,18 +9995,18 @@ function _b(e) {
9996
9995
  var a = m.useCallback(function(v, g) {
9997
9996
  if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
9998
9997
  return !i.current.allowPinchZoom;
9999
- var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, E = Math.abs(S) > Math.abs(R) ? "h" : "v";
10000
- if ("touches" in v && E === "h" && T.type === "range")
9998
+ var x = go(v), y = n.current, S = "deltaX" in v ? v.deltaX : y[0] - x[0], R = "deltaY" in v ? v.deltaY : y[1] - x[1], C, T = v.target, k = Math.abs(S) > Math.abs(R) ? "h" : "v";
9999
+ if ("touches" in v && k === "h" && T.type === "range")
10001
10000
  return !1;
10002
- var I = dc(E, T);
10001
+ var I = dc(k, T);
10003
10002
  if (!I)
10004
10003
  return !0;
10005
- if (I ? C = E : (C = E === "v" ? "h" : "v", I = dc(E, T)), !I)
10004
+ if (I ? C = k : (C = k === "v" ? "h" : "v", I = dc(k, T)), !I)
10006
10005
  return !1;
10007
10006
  if (!r.current && "changedTouches" in v && (S || R) && (r.current = C), !C)
10008
10007
  return !0;
10009
10008
  var A = r.current || C;
10010
- return kb(A, g, v, A === "h" ? S : R);
10009
+ return Eb(A, g, v, A === "h" ? S : R);
10011
10010
  }, []), l = m.useCallback(function(v) {
10012
10011
  var g = v;
10013
10012
  if (!(!cr.length || cr[cr.length - 1] !== s)) {
@@ -10152,13 +10151,13 @@ var yd = "DialogTrigger", Sd = m.forwardRef(
10152
10151
  (e, t) => {
10153
10152
  const { __scopeDialog: n, ...r } = e, o = Zt(yd, n), s = ze(t, o.triggerRef);
10154
10153
  return /* @__PURE__ */ c.jsx(
10155
- ke.button,
10154
+ Ee.button,
10156
10155
  {
10157
10156
  type: "button",
10158
10157
  "aria-haspopup": "dialog",
10159
10158
  "aria-expanded": o.open,
10160
10159
  "aria-controls": o.contentId,
10161
- "data-state": ka(o.open),
10160
+ "data-state": Ea(o.open),
10162
10161
  ...r,
10163
10162
  ref: s,
10164
10163
  onClick: le(e.onClick, o.onOpenToggle)
@@ -10188,9 +10187,9 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
10188
10187
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
10189
10188
  // ie. when `Overlay` and `Content` are siblings
10190
10189
  /* @__PURE__ */ c.jsx(ws, { as: Fb, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ c.jsx(
10191
- ke.div,
10190
+ Ee.div,
10192
10191
  {
10193
- "data-state": ka(o.open),
10192
+ "data-state": Ea(o.open),
10194
10193
  ...r,
10195
10194
  ref: t,
10196
10195
  style: { pointerEvents: "auto", ...r.style }
@@ -10198,13 +10197,13 @@ var Fb = vr("DialogOverlay.RemoveScroll"), zb = m.forwardRef(
10198
10197
  ) })
10199
10198
  );
10200
10199
  }
10201
- ), Yn = "DialogContent", Ed = m.forwardRef(
10200
+ ), Yn = "DialogContent", kd = m.forwardRef(
10202
10201
  (e, t) => {
10203
10202
  const n = Cd(Yn, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, s = Zt(Yn, e.__scopeDialog);
10204
10203
  return /* @__PURE__ */ c.jsx(Ot, { present: r || s.open, children: s.modal ? /* @__PURE__ */ c.jsx(Bb, { ...o, ref: t }) : /* @__PURE__ */ c.jsx(Hb, { ...o, ref: t }) });
10205
10204
  }
10206
10205
  );
10207
- Ed.displayName = Yn;
10206
+ kd.displayName = Yn;
10208
10207
  var Bb = m.forwardRef(
10209
10208
  (e, t) => {
10210
10209
  const n = Zt(Yn, e.__scopeDialog), r = m.useRef(null), o = ze(t, n.contentRef, r);
@@ -10212,7 +10211,7 @@ var Bb = m.forwardRef(
10212
10211
  const s = r.current;
10213
10212
  if (s) return Ta(s);
10214
10213
  }, []), /* @__PURE__ */ c.jsx(
10215
- kd,
10214
+ Ed,
10216
10215
  {
10217
10216
  ...e,
10218
10217
  ref: o,
@@ -10237,7 +10236,7 @@ var Bb = m.forwardRef(
10237
10236
  (e, t) => {
10238
10237
  const n = Zt(Yn, e.__scopeDialog), r = m.useRef(!1), o = m.useRef(!1);
10239
10238
  return /* @__PURE__ */ c.jsx(
10240
- kd,
10239
+ Ed,
10241
10240
  {
10242
10241
  ...e,
10243
10242
  ref: t,
@@ -10256,7 +10255,7 @@ var Bb = m.forwardRef(
10256
10255
  }
10257
10256
  );
10258
10257
  }
10259
- ), kd = m.forwardRef(
10258
+ ), Ed = m.forwardRef(
10260
10259
  (e, t) => {
10261
10260
  const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: s, ...i } = e, a = Zt(Yn, n), l = m.useRef(null), u = ze(t, l);
10262
10261
  return Ca(), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -10275,7 +10274,7 @@ var Bb = m.forwardRef(
10275
10274
  id: a.contentId,
10276
10275
  "aria-describedby": a.descriptionId,
10277
10276
  "aria-labelledby": a.titleId,
10278
- "data-state": ka(a.open),
10277
+ "data-state": Ea(a.open),
10279
10278
  ...i,
10280
10279
  ref: u,
10281
10280
  onDismiss: () => a.onOpenChange(!1)
@@ -10289,17 +10288,17 @@ var Bb = m.forwardRef(
10289
10288
  ] })
10290
10289
  ] });
10291
10290
  }
10292
- ), Ea = "DialogTitle", Id = m.forwardRef(
10291
+ ), ka = "DialogTitle", Id = m.forwardRef(
10293
10292
  (e, t) => {
10294
- const { __scopeDialog: n, ...r } = e, o = Zt(Ea, n);
10295
- return /* @__PURE__ */ c.jsx(ke.h2, { id: o.titleId, ...r, ref: t });
10293
+ const { __scopeDialog: n, ...r } = e, o = Zt(ka, n);
10294
+ return /* @__PURE__ */ c.jsx(Ee.h2, { id: o.titleId, ...r, ref: t });
10296
10295
  }
10297
10296
  );
10298
- Id.displayName = Ea;
10297
+ Id.displayName = ka;
10299
10298
  var Nd = "DialogDescription", Ad = m.forwardRef(
10300
10299
  (e, t) => {
10301
10300
  const { __scopeDialog: n, ...r } = e, o = Zt(Nd, n);
10302
- return /* @__PURE__ */ c.jsx(ke.p, { id: o.descriptionId, ...r, ref: t });
10301
+ return /* @__PURE__ */ c.jsx(Ee.p, { id: o.descriptionId, ...r, ref: t });
10303
10302
  }
10304
10303
  );
10305
10304
  Ad.displayName = Nd;
@@ -10307,7 +10306,7 @@ var _d = "DialogClose", jd = m.forwardRef(
10307
10306
  (e, t) => {
10308
10307
  const { __scopeDialog: n, ...r } = e, o = Zt(_d, n);
10309
10308
  return /* @__PURE__ */ c.jsx(
10310
- ke.button,
10309
+ Ee.button,
10311
10310
  {
10312
10311
  type: "button",
10313
10312
  ...r,
@@ -10318,12 +10317,12 @@ var _d = "DialogClose", jd = m.forwardRef(
10318
10317
  }
10319
10318
  );
10320
10319
  jd.displayName = _d;
10321
- function ka(e) {
10320
+ function Ea(e) {
10322
10321
  return e ? "open" : "closed";
10323
10322
  }
10324
10323
  var Pd = "DialogTitleWarning", [KT, Od] = Xv(Pd, {
10325
10324
  contentName: Yn,
10326
- titleName: Ea,
10325
+ titleName: ka,
10327
10326
  docsSlug: "dialog"
10328
10327
  }), Ub = ({ titleId: e }) => {
10329
10328
  const t = Od(Pd), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
@@ -10341,7 +10340,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
10341
10340
  const o = (s = e.current) == null ? void 0 : s.getAttribute("aria-describedby");
10342
10341
  t && o && (document.getElementById(t) || console.warn(r));
10343
10342
  }, [r, e, t]), null;
10344
- }, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = Ed, Wn = Id, Cs = Ad, Ld = jd;
10343
+ }, Md = bd, Kb = Sd, Dd = Td, ys = Rd, Ss = kd, Wn = Id, Cs = Ad, Ld = jd;
10345
10344
  const qb = Md, Gb = Dd, $d = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
10346
10345
  ys,
10347
10346
  {
@@ -10747,7 +10746,7 @@ const oy = V.memo(function({
10747
10746
  onCancelEdit: g,
10748
10747
  onCopy: x
10749
10748
  }) {
10750
- const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, E] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
10749
+ const [y, S] = xe(!1), [R, C] = xe("collapsed"), [T, k] = xe(!1), { currentThreadId: I } = ra(), { handleInterrupt: A } = hu(), { toast: _ } = Sa(), [D, L] = xe({}), [W, P] = xe(!1), [Y, K] = xe(null), J = l === "phone" || l === "half-screen", z = t.role, $ = z === "tool", F = !(r && z !== "user"), B = V.useMemo(() => {
10751
10750
  switch (z) {
10752
10751
  case "user":
10753
10752
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -10919,7 +10918,7 @@ const oy = V.memo(function({
10919
10918
  }, [A]), et = V.useCallback(({ part: ne, i: ae }) => {
10920
10919
  if (ne.type === "text") {
10921
10920
  const de = ne.text ?? "", Ne = de.trim(), he = pc(Ne);
10922
- return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: E, children: [
10921
+ return he && z !== "tool" ? /* @__PURE__ */ c.jsx(sy, { data: he }, ae) : z === "user" && f && Ne.length > h ? /* @__PURE__ */ c.jsxs(Vl, { open: T, onOpenChange: k, children: [
10923
10922
  /* @__PURE__ */ c.jsx("div", { className: te("text-sm text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: T ? /* @__PURE__ */ c.jsx(Ql, { content: Ne, allowHtml: !1 }) : /* @__PURE__ */ c.jsxs("pre", { className: te("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", J && "text-xs"), children: [
10924
10923
  Ne.substring(0, h),
10925
10924
  "..."
@@ -11394,8 +11393,8 @@ const gc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Wd = V.forwa
11394
11393
  onScrollAway: g,
11395
11394
  onAtBottom: x
11396
11395
  }, y) => {
11397
- const S = Ge(null), R = Ge(null), C = Ge(!1), [T, E] = xe(!0), I = Me((D) => {
11398
- E(D), g && g(!D), x && x(D);
11396
+ const S = Ge(null), R = Ge(null), C = Ge(!1), [T, k] = xe(!0), I = Me((D) => {
11397
+ k(D), g && g(!D), x && x(D);
11399
11398
  }, [g, x]), A = at(() => {
11400
11399
  if (a)
11401
11400
  return async () => {
@@ -11537,7 +11536,7 @@ function Ia(e) {
11537
11536
  if (!y) return [];
11538
11537
  const S = Array.from(y.querySelectorAll(`[${f}]`));
11539
11538
  return Array.from(g.itemMap.values()).sort(
11540
- (T, E) => S.indexOf(T.ref.current) - S.indexOf(E.ref.current)
11539
+ (T, k) => S.indexOf(T.ref.current) - S.indexOf(k.ref.current)
11541
11540
  );
11542
11541
  }, [g.collectionRef, g.itemMap]);
11543
11542
  }
@@ -11552,7 +11551,7 @@ function Ts(e) {
11552
11551
  const t = m.useContext(hy);
11553
11552
  return e || t || "ltr";
11554
11553
  }
11555
- const py = ["top", "right", "bottom", "left"], kn = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
11554
+ const py = ["top", "right", "bottom", "left"], En = Math.min, At = Math.max, Vo = Math.round, wo = Math.floor, cn = (e) => ({
11556
11555
  x: e,
11557
11556
  y: e
11558
11557
  }), my = {
@@ -11565,7 +11564,7 @@ const py = ["top", "right", "bottom", "left"], kn = Math.min, At = Math.max, Vo
11565
11564
  end: "start"
11566
11565
  };
11567
11566
  function $i(e, t, n) {
11568
- return At(e, kn(t, n));
11567
+ return At(e, En(t, n));
11569
11568
  }
11570
11569
  function xn(e, t) {
11571
11570
  return typeof e == "function" ? e(t) : e;
@@ -11573,7 +11572,7 @@ function xn(e, t) {
11573
11572
  function vn(e) {
11574
11573
  return e.split("-")[0];
11575
11574
  }
11576
- function Er(e) {
11575
+ function kr(e) {
11577
11576
  return e.split("-")[1];
11578
11577
  }
11579
11578
  function Na(e) {
@@ -11591,7 +11590,7 @@ function _a(e) {
11591
11590
  }
11592
11591
  function vy(e, t, n) {
11593
11592
  n === void 0 && (n = !1);
11594
- const r = Er(e), o = _a(e), s = Aa(o);
11593
+ const r = kr(e), o = _a(e), s = Aa(o);
11595
11594
  let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
11596
11595
  return t.reference[s] > t.floating[s] && (i = Ko(i)), [i, Ko(i)];
11597
11596
  }
@@ -11616,7 +11615,7 @@ function Sy(e, t, n) {
11616
11615
  }
11617
11616
  }
11618
11617
  function Cy(e, t, n, r) {
11619
- const o = Er(e);
11618
+ const o = kr(e);
11620
11619
  let s = Sy(vn(e), n === "start", r);
11621
11620
  return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Fi)))), s;
11622
11621
  }
@@ -11696,7 +11695,7 @@ function wc(e, t, n) {
11696
11695
  y: r.y
11697
11696
  };
11698
11697
  }
11699
- switch (Er(t)) {
11698
+ switch (kr(t)) {
11700
11699
  case "start":
11701
11700
  p[i] -= h * (n && u ? -1 : 1);
11702
11701
  break;
@@ -11812,7 +11811,7 @@ async function qr(e, t) {
11812
11811
  right: (C.right - x.right + w.right) / R.x
11813
11812
  };
11814
11813
  }
11815
- const Ey = (e) => ({
11814
+ const ky = (e) => ({
11816
11815
  name: "arrow",
11817
11816
  options: e,
11818
11817
  async fn(t) {
@@ -11834,9 +11833,9 @@ const Ey = (e) => ({
11834
11833
  x: n,
11835
11834
  y: r
11836
11835
  }, p = _a(o), w = Aa(p), v = await i.getDimensions(u), g = p === "y", x = g ? "top" : "left", y = g ? "bottom" : "right", S = g ? "clientHeight" : "clientWidth", R = s.reference[w] + s.reference[p] - h[p] - s.floating[w], C = h[p] - s.reference[p], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
11837
- let E = T ? T[S] : 0;
11838
- (!E || !await (i.isElement == null ? void 0 : i.isElement(T))) && (E = a.floating[S] || s.floating[w]);
11839
- const I = R / 2 - C / 2, A = E / 2 - v[w] / 2 - 1, _ = kn(f[x], A), D = kn(f[y], A), L = _, W = E - v[w] - D, P = E / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && Er(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
11836
+ let k = T ? T[S] : 0;
11837
+ (!k || !await (i.isElement == null ? void 0 : i.isElement(T))) && (k = a.floating[S] || s.floating[w]);
11838
+ const I = R / 2 - C / 2, A = k / 2 - v[w] / 2 - 1, _ = En(f[x], A), D = En(f[y], A), L = _, W = k - v[w] - D, P = k / 2 - v[w] / 2 + I, Y = $i(L, P, W), K = !l.arrow && kr(o) != null && P !== Y && s.reference[w] / 2 - (P < L ? _ : D) - v[w] / 2 < 0, J = K ? P < L ? P - L : P - W : 0;
11840
11839
  return {
11841
11840
  [p]: h[p] + J,
11842
11841
  data: {
@@ -11849,7 +11848,7 @@ const Ey = (e) => ({
11849
11848
  reset: K
11850
11849
  };
11851
11850
  }
11852
- }), ky = function(e) {
11851
+ }), Ey = function(e) {
11853
11852
  return e === void 0 && (e = {}), {
11854
11853
  name: "flip",
11855
11854
  options: e,
@@ -11875,7 +11874,7 @@ const Ey = (e) => ({
11875
11874
  return {};
11876
11875
  const x = vn(o), y = an(a), S = vn(a) === a, R = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), C = h || (S || !v ? [Ko(a)] : wy(a)), T = w !== "none";
11877
11876
  !h && T && C.push(...Cy(a, v, w, R));
11878
- const E = [a, ...C], I = await qr(t, g), A = [];
11877
+ const k = [a, ...C], I = await qr(t, g), A = [];
11879
11878
  let _ = ((r = s.flip) == null ? void 0 : r.overflows) || [];
11880
11879
  if (d && A.push(I[x]), f) {
11881
11880
  const P = vy(o, i, R);
@@ -11886,7 +11885,7 @@ const Ey = (e) => ({
11886
11885
  overflows: A
11887
11886
  }], !A.every((P) => P <= 0)) {
11888
11887
  var D, L;
11889
- const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = E[P];
11888
+ const P = (((D = s.flip) == null ? void 0 : D.index) || 0) + 1, Y = k[P];
11890
11889
  if (Y && (!(f === "alignment" ? y !== an(Y) : !1) || // We leave the current main axis only if every placement on that axis
11891
11890
  // overflows the main axis.
11892
11891
  _.every((z) => an(z.placement) === y ? z.overflows[0] > 0 : !0)))
@@ -11989,7 +11988,7 @@ async function Ny(e, t) {
11989
11988
  placement: n,
11990
11989
  platform: r,
11991
11990
  elements: o
11992
- } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = Er(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
11991
+ } = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = vn(n), a = kr(n), l = an(n) === "y", u = Kd.has(i) ? -1 : 1, d = s && l ? -1 : 1, f = xn(t, e);
11993
11992
  let {
11994
11993
  mainAxis: h,
11995
11994
  crossAxis: p,
@@ -12146,22 +12145,22 @@ const Ay = function(e) {
12146
12145
  apply: l = () => {
12147
12146
  },
12148
12147
  ...u
12149
- } = xn(e, t), d = await qr(t, u), f = vn(o), h = Er(o), p = an(o) === "y", {
12148
+ } = xn(e, t), d = await qr(t, u), f = vn(o), h = kr(o), p = an(o) === "y", {
12150
12149
  width: w,
12151
12150
  height: v
12152
12151
  } = s.floating;
12153
12152
  let g, x;
12154
12153
  f === "top" || f === "bottom" ? (g = f, x = h === (await (i.isRTL == null ? void 0 : i.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (x = f, g = h === "end" ? "top" : "bottom");
12155
- const y = v - d.top - d.bottom, S = w - d.left - d.right, R = kn(v - d[g], y), C = kn(w - d[x], S), T = !t.middlewareData.shift;
12156
- let E = R, I = C;
12157
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (E = y), T && !h) {
12154
+ const y = v - d.top - d.bottom, S = w - d.left - d.right, R = En(v - d[g], y), C = En(w - d[x], S), T = !t.middlewareData.shift;
12155
+ let k = R, I = C;
12156
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = S), (r = t.middlewareData.shift) != null && r.enabled.y && (k = y), T && !h) {
12158
12157
  const _ = At(d.left, 0), D = At(d.right, 0), L = At(d.top, 0), W = At(d.bottom, 0);
12159
- p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : E = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
12158
+ p ? I = w - 2 * (_ !== 0 || D !== 0 ? _ + D : At(d.left, d.right)) : k = v - 2 * (L !== 0 || W !== 0 ? L + W : At(d.top, d.bottom));
12160
12159
  }
12161
12160
  await l({
12162
12161
  ...t,
12163
12162
  availableWidth: I,
12164
- availableHeight: E
12163
+ availableHeight: k
12165
12164
  });
12166
12165
  const A = await i.getDimensions(a.floating);
12167
12166
  return w !== A.width || v !== A.height ? {
@@ -12175,7 +12174,7 @@ const Ay = function(e) {
12175
12174
  function Rs() {
12176
12175
  return typeof window < "u";
12177
12176
  }
12178
- function kr(e) {
12177
+ function Er(e) {
12179
12178
  return qd(e) ? (e.nodeName || "").toLowerCase() : "#document";
12180
12179
  }
12181
12180
  function Pt(e) {
@@ -12210,10 +12209,10 @@ function so(e) {
12210
12209
  }
12211
12210
  const My = /* @__PURE__ */ new Set(["table", "td", "th"]);
12212
12211
  function Dy(e) {
12213
- return My.has(kr(e));
12212
+ return My.has(Er(e));
12214
12213
  }
12215
12214
  const Ly = [":popover-open", ":modal"];
12216
- function Es(e) {
12215
+ function ks(e) {
12217
12216
  return Ly.some((t) => {
12218
12217
  try {
12219
12218
  return e.matches(t);
@@ -12232,7 +12231,7 @@ function By(e) {
12232
12231
  for (; un(t) && !br(t); ) {
12233
12232
  if (ja(t))
12234
12233
  return t;
12235
- if (Es(t))
12234
+ if (ks(t))
12236
12235
  return null;
12237
12236
  t = In(t);
12238
12237
  }
@@ -12243,12 +12242,12 @@ function Pa() {
12243
12242
  }
12244
12243
  const Hy = /* @__PURE__ */ new Set(["html", "body", "#document"]);
12245
12244
  function br(e) {
12246
- return Hy.has(kr(e));
12245
+ return Hy.has(Er(e));
12247
12246
  }
12248
12247
  function Xt(e) {
12249
12248
  return Pt(e).getComputedStyle(e);
12250
12249
  }
12251
- function ks(e) {
12250
+ function Es(e) {
12252
12251
  return Yt(e) ? {
12253
12252
  scrollLeft: e.scrollLeft,
12254
12253
  scrollTop: e.scrollTop
@@ -12258,7 +12257,7 @@ function ks(e) {
12258
12257
  };
12259
12258
  }
12260
12259
  function In(e) {
12261
- if (kr(e) === "html")
12260
+ if (Er(e) === "html")
12262
12261
  return e;
12263
12262
  const t = (
12264
12263
  // Step into the shadow DOM of the parent of a slotted node.
@@ -12348,7 +12347,7 @@ function Xn(e, t, n, r) {
12348
12347
  });
12349
12348
  }
12350
12349
  function Is(e, t) {
12351
- const n = ks(e).scrollLeft;
12350
+ const n = Es(e).scrollLeft;
12352
12351
  return t ? t.left + n : Xn(hn(e)).left + n;
12353
12352
  }
12354
12353
  function Jd(e, t) {
@@ -12365,7 +12364,7 @@ function Vy(e) {
12365
12364
  offsetParent: r,
12366
12365
  strategy: o
12367
12366
  } = e;
12368
- const s = o === "fixed", i = hn(r), a = t ? Es(t.floating) : !1;
12367
+ const s = o === "fixed", i = hn(r), a = t ? ks(t.floating) : !1;
12369
12368
  if (r === i || a && s)
12370
12369
  return n;
12371
12370
  let l = {
@@ -12373,7 +12372,7 @@ function Vy(e) {
12373
12372
  scrollTop: 0
12374
12373
  }, u = cn(1);
12375
12374
  const d = cn(0), f = un(r);
12376
- if ((f || !f && !s) && ((kr(r) !== "body" || so(i)) && (l = ks(r)), un(r))) {
12375
+ if ((f || !f && !s) && ((Er(r) !== "body" || so(i)) && (l = Es(r)), un(r))) {
12377
12376
  const p = Xn(r);
12378
12377
  u = gr(r), d.x = p.x + r.clientLeft, d.y = p.y + r.clientTop;
12379
12378
  }
@@ -12389,7 +12388,7 @@ function Ky(e) {
12389
12388
  return Array.from(e.getClientRects());
12390
12389
  }
12391
12390
  function qy(e) {
12392
- const t = hn(e), n = ks(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12391
+ const t = hn(e), n = Es(e), r = e.ownerDocument.body, o = At(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = At(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
12393
12392
  let i = -n.scrollLeft + Is(e);
12394
12393
  const a = -n.scrollTop;
12395
12394
  return Xt(r).direction === "rtl" && (i += At(t.clientWidth, r.clientWidth) - o), {
@@ -12457,7 +12456,7 @@ function Jy(e, t) {
12457
12456
  const n = t.get(e);
12458
12457
  if (n)
12459
12458
  return n;
12460
- let r = Gr(e, [], !1).filter((a) => Yt(a) && kr(a) !== "body"), o = null;
12459
+ let r = Gr(e, [], !1).filter((a) => Yt(a) && Er(a) !== "body"), o = null;
12461
12460
  const s = Xt(e).position === "fixed";
12462
12461
  let i = s ? In(e) : e;
12463
12462
  for (; Yt(i) && !br(i); ) {
@@ -12473,9 +12472,9 @@ function Zy(e) {
12473
12472
  rootBoundary: r,
12474
12473
  strategy: o
12475
12474
  } = e;
12476
- const i = [...n === "clippingAncestors" ? Es(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
12475
+ const i = [...n === "clippingAncestors" ? ks(t) ? [] : Jy(t, this._c) : [].concat(n), r], a = i[0], l = i.reduce((u, d) => {
12477
12476
  const f = Tc(t, d, o);
12478
- return u.top = At(f.top, u.top), u.right = kn(f.right, u.right), u.bottom = kn(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
12477
+ return u.top = At(f.top, u.top), u.right = En(f.right, u.right), u.bottom = En(f.bottom, u.bottom), u.left = At(f.left, u.left), u;
12479
12478
  }, Tc(t, a, o));
12480
12479
  return {
12481
12480
  width: l.right - l.left,
@@ -12505,7 +12504,7 @@ function e0(e, t, n) {
12505
12504
  l.x = Is(o);
12506
12505
  }
12507
12506
  if (r || !r && !s)
12508
- if ((kr(t) !== "body" || so(o)) && (a = ks(t)), r) {
12507
+ if ((Er(t) !== "body" || so(o)) && (a = Es(t)), r) {
12509
12508
  const p = Xn(t, !0, s, t);
12510
12509
  l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
12511
12510
  } else o && u();
@@ -12531,7 +12530,7 @@ function Rc(e, t) {
12531
12530
  }
12532
12531
  function Qd(e, t) {
12533
12532
  const n = Pt(e);
12534
- if (Es(e))
12533
+ if (ks(e))
12535
12534
  return n;
12536
12535
  if (!un(e)) {
12537
12536
  let o = In(e);
@@ -12596,19 +12595,19 @@ function o0(e, t) {
12596
12595
  return;
12597
12596
  const w = wo(f), v = wo(o.clientWidth - (d + h)), g = wo(o.clientHeight - (f + p)), x = wo(d), S = {
12598
12597
  rootMargin: -w + "px " + -v + "px " + -g + "px " + -x + "px",
12599
- threshold: At(0, kn(1, l)) || 1
12598
+ threshold: At(0, En(1, l)) || 1
12600
12599
  };
12601
12600
  let R = !0;
12602
12601
  function C(T) {
12603
- const E = T[0].intersectionRatio;
12604
- if (E !== l) {
12602
+ const k = T[0].intersectionRatio;
12603
+ if (k !== l) {
12605
12604
  if (!R)
12606
12605
  return i();
12607
- E ? i(!1, E) : r = setTimeout(() => {
12606
+ k ? i(!1, k) : r = setTimeout(() => {
12608
12607
  i(!1, 1e-7);
12609
12608
  }, 1e3);
12610
12609
  }
12611
- E === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
12610
+ k === 1 && !ef(u, e.getBoundingClientRect()) && i(), R = !1;
12612
12611
  }
12613
12612
  try {
12614
12613
  n = new IntersectionObserver(C, {
@@ -12659,7 +12658,7 @@ function s0(e, t, n, r) {
12659
12658
  }), f == null || f(), (x = p) == null || x.disconnect(), p = null, l && cancelAnimationFrame(w);
12660
12659
  };
12661
12660
  }
12662
- const i0 = Ay, a0 = _y, l0 = ky, c0 = Py, u0 = Iy, Ec = Ey, d0 = jy, f0 = (e, t, n) => {
12661
+ const i0 = Ay, a0 = _y, l0 = Ey, c0 = Py, u0 = Iy, kc = ky, d0 = jy, f0 = (e, t, n) => {
12663
12662
  const r = /* @__PURE__ */ new Map(), o = {
12664
12663
  platform: r0,
12665
12664
  ...n
@@ -12707,7 +12706,7 @@ function Go(e, t) {
12707
12706
  function tf(e) {
12708
12707
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
12709
12708
  }
12710
- function kc(e, t) {
12709
+ function Ec(e, t) {
12711
12710
  const n = tf(e);
12712
12711
  return Math.round(t * n) / n;
12713
12712
  }
@@ -12743,16 +12742,16 @@ function m0(e) {
12743
12742
  const [w, v] = m.useState(null), [g, x] = m.useState(null), y = m.useCallback((z) => {
12744
12743
  z !== T.current && (T.current = z, v(z));
12745
12744
  }, []), S = m.useCallback((z) => {
12746
- z !== E.current && (E.current = z, x(z));
12747
- }, []), R = s || w, C = i || g, T = m.useRef(null), E = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
12748
- if (!T.current || !E.current)
12745
+ z !== k.current && (k.current = z, x(z));
12746
+ }, []), R = s || w, C = i || g, T = m.useRef(null), k = m.useRef(null), I = m.useRef(d), A = l != null, _ = hi(l), D = hi(o), L = hi(u), W = m.useCallback(() => {
12747
+ if (!T.current || !k.current)
12749
12748
  return;
12750
12749
  const z = {
12751
12750
  placement: t,
12752
12751
  strategy: n,
12753
12752
  middleware: h
12754
12753
  };
12755
- D.current && (z.platform = D.current), f0(T.current, E.current, z).then(($) => {
12754
+ D.current && (z.platform = D.current), f0(T.current, k.current, z).then(($) => {
12756
12755
  const F = {
12757
12756
  ...$,
12758
12757
  // The floating element's position may be recomputed while it's closed
@@ -12776,7 +12775,7 @@ function m0(e) {
12776
12775
  Mo(() => (P.current = !0, () => {
12777
12776
  P.current = !1;
12778
12777
  }), []), Mo(() => {
12779
- if (R && (T.current = R), C && (E.current = C), R && C) {
12778
+ if (R && (T.current = R), C && (k.current = C), R && C) {
12780
12779
  if (_.current)
12781
12780
  return _.current(R, C, W);
12782
12781
  W();
@@ -12784,7 +12783,7 @@ function m0(e) {
12784
12783
  }, [R, C, W, _, A]);
12785
12784
  const Y = m.useMemo(() => ({
12786
12785
  reference: T,
12787
- floating: E,
12786
+ floating: k,
12788
12787
  setReference: y,
12789
12788
  setFloating: S
12790
12789
  }), [y, S]), K = m.useMemo(() => ({
@@ -12798,7 +12797,7 @@ function m0(e) {
12798
12797
  };
12799
12798
  if (!K.floating)
12800
12799
  return z;
12801
- const $ = kc(K.floating, d.x), F = kc(K.floating, d.y);
12800
+ const $ = Ec(K.floating, d.x), F = Ec(K.floating, d.y);
12802
12801
  return a ? {
12803
12802
  ...z,
12804
12803
  transform: "translate(" + $ + "px, " + F + "px)",
@@ -12831,10 +12830,10 @@ const g0 = (e) => {
12831
12830
  element: r,
12832
12831
  padding: o
12833
12832
  } = typeof e == "function" ? e(n) : e;
12834
- return r && t(r) ? r.current != null ? Ec({
12833
+ return r && t(r) ? r.current != null ? kc({
12835
12834
  element: r.current,
12836
12835
  padding: o
12837
- }).fn(n) : {} : r ? Ec({
12836
+ }).fn(n) : {} : r ? kc({
12838
12837
  element: r,
12839
12838
  padding: o
12840
12839
  }).fn(n) : {};
@@ -12865,7 +12864,7 @@ const g0 = (e) => {
12865
12864
  var T0 = "Arrow", nf = m.forwardRef((e, t) => {
12866
12865
  const { children: n, width: r = 10, height: o = 5, ...s } = e;
12867
12866
  return /* @__PURE__ */ c.jsx(
12868
- ke.svg,
12867
+ Ee.svg,
12869
12868
  {
12870
12869
  ...s,
12871
12870
  ref: t,
@@ -12901,9 +12900,9 @@ function rf(e) {
12901
12900
  n(void 0);
12902
12901
  }, [e]), t;
12903
12902
  }
12904
- var Ma = "Popper", [of, Ns] = fn(Ma), [E0, sf] = of(Ma), af = (e) => {
12903
+ var Ma = "Popper", [of, Ns] = fn(Ma), [k0, sf] = of(Ma), af = (e) => {
12905
12904
  const { __scopePopper: t, children: n } = e, [r, o] = m.useState(null);
12906
- return /* @__PURE__ */ c.jsx(E0, { scope: t, anchor: r, onAnchorChange: o, children: n });
12905
+ return /* @__PURE__ */ c.jsx(k0, { scope: t, anchor: r, onAnchorChange: o, children: n });
12907
12906
  };
12908
12907
  af.displayName = Ma;
12909
12908
  var lf = "PopperAnchor", cf = m.forwardRef(
@@ -12912,11 +12911,11 @@ var lf = "PopperAnchor", cf = m.forwardRef(
12912
12911
  return m.useEffect(() => {
12913
12912
  const u = l.current;
12914
12913
  l.current = (r == null ? void 0 : r.current) || i.current, u !== l.current && s.onAnchorChange(l.current);
12915
- }), r ? null : /* @__PURE__ */ c.jsx(ke.div, { ...o, ref: a });
12914
+ }), r ? null : /* @__PURE__ */ c.jsx(Ee.div, { ...o, ref: a });
12916
12915
  }
12917
12916
  );
12918
12917
  cf.displayName = lf;
12919
- var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12918
+ var Da = "PopperContent", [E0, I0] = of(Da), uf = m.forwardRef(
12920
12919
  (e, t) => {
12921
12920
  var G, O, Q, q, ce, ie;
12922
12921
  const {
@@ -12934,7 +12933,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12934
12933
  updatePositionStrategy: p = "optimized",
12935
12934
  onPlaced: w,
12936
12935
  ...v
12937
- } = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), E = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
12936
+ } = e, g = sf(Da, n), [x, y] = m.useState(null), S = ze(t, ($e) => y($e)), [R, C] = m.useState(null), T = rf(R), k = (T == null ? void 0 : T.width) ?? 0, I = (T == null ? void 0 : T.height) ?? 0, A = r + (s !== "center" ? "-" + s : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, D = Array.isArray(u) ? u : [u], L = D.length > 0, W = {
12938
12937
  padding: _,
12939
12938
  boundary: D.filter(A0),
12940
12939
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
@@ -12966,7 +12965,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
12966
12965
  }
12967
12966
  }),
12968
12967
  R && C0({ element: R, padding: a }),
12969
- _0({ arrowWidth: E, arrowHeight: I }),
12968
+ _0({ arrowWidth: k, arrowHeight: I }),
12970
12969
  h && S0({ strategy: "referenceHidden", ...W })
12971
12970
  ]
12972
12971
  }), [$, F] = hf(K), B = mt(w);
@@ -13001,7 +13000,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
13001
13000
  },
13002
13001
  dir: e.dir,
13003
13002
  children: /* @__PURE__ */ c.jsx(
13004
- k0,
13003
+ E0,
13005
13004
  {
13006
13005
  scope: n,
13007
13006
  placedSide: $,
@@ -13010,7 +13009,7 @@ var Da = "PopperContent", [k0, I0] = of(Da), uf = m.forwardRef(
13010
13009
  arrowY: ue,
13011
13010
  shouldHideArrow: ee,
13012
13011
  children: /* @__PURE__ */ c.jsx(
13013
- ke.div,
13012
+ Ee.div,
13014
13013
  {
13015
13014
  "data-side": $,
13016
13015
  "data-align": F,
@@ -13123,7 +13122,7 @@ var L0 = m.forwardRef((e, t) => {
13123
13122
  defaultProp: a ?? null,
13124
13123
  onChange: l,
13125
13124
  caller: io
13126
- }), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, E] = m.useState(0);
13125
+ }), [x, y] = m.useState(!1), S = mt(u), R = vf(n), C = m.useRef(!1), [T, k] = m.useState(0);
13127
13126
  return m.useEffect(() => {
13128
13127
  const I = h.current;
13129
13128
  if (I)
@@ -13142,15 +13141,15 @@ var L0 = m.forwardRef((e, t) => {
13142
13141
  ),
13143
13142
  onItemShiftTab: m.useCallback(() => y(!0), []),
13144
13143
  onFocusableItemAdd: m.useCallback(
13145
- () => E((I) => I + 1),
13144
+ () => k((I) => I + 1),
13146
13145
  []
13147
13146
  ),
13148
13147
  onFocusableItemRemove: m.useCallback(
13149
- () => E((I) => I - 1),
13148
+ () => k((I) => I - 1),
13150
13149
  []
13151
13150
  ),
13152
13151
  children: /* @__PURE__ */ c.jsx(
13153
- ke.div,
13152
+ Ee.div,
13154
13153
  {
13155
13154
  tabIndex: x || T === 0 ? -1 : 0,
13156
13155
  "data-orientation": r,
@@ -13199,7 +13198,7 @@ var L0 = m.forwardRef((e, t) => {
13199
13198
  focusable: r,
13200
13199
  active: o,
13201
13200
  children: /* @__PURE__ */ c.jsx(
13202
- ke.span,
13201
+ Ee.span,
13203
13202
  {
13204
13203
  tabIndex: f ? 0 : -1,
13205
13204
  "data-orientation": d.orientation,
@@ -13273,7 +13272,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
13273
13272
  Y0,
13274
13273
  Ns,
13275
13274
  wf
13276
- ]), As = Ns(), Ef = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), kf = (e) => {
13275
+ ]), As = Ns(), kf = wf(), [X0, rr] = nr(ao), [J0, lo] = nr(ao), Ef = (e) => {
13277
13276
  const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: s, modal: i = !0 } = e, a = As(t), [l, u] = m.useState(null), d = m.useRef(!1), f = mt(s), h = Ts(o);
13278
13277
  return m.useEffect(() => {
13279
13278
  const p = () => {
@@ -13304,7 +13303,7 @@ var H0 = bf, U0 = Sf, Hi = ["Enter", " "], W0 = ["ArrowDown", "PageUp", "Home"],
13304
13303
  }
13305
13304
  ) });
13306
13305
  };
13307
- kf.displayName = ao;
13306
+ Ef.displayName = ao;
13308
13307
  var Z0 = "MenuAnchor", La = m.forwardRef(
13309
13308
  (e, t) => {
13310
13309
  const { __scopeMenu: n, ...r } = e, o = As(n);
@@ -13377,7 +13376,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13377
13376
  onDismiss: p,
13378
13377
  disableOutsideScroll: w,
13379
13378
  ...v
13380
- } = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = Ef(n), R = G0(n), [C, T] = m.useState(null), E = m.useRef(null), I = ze(t, E, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
13379
+ } = e, g = rr(Ht, n), x = lo(Ht, n), y = As(n), S = kf(n), R = G0(n), [C, T] = m.useState(null), k = m.useRef(null), I = ze(t, k, g.onContentChange), A = m.useRef(0), _ = m.useRef(""), D = m.useRef(0), L = m.useRef(null), W = m.useRef("right"), P = m.useRef(0), Y = w ? ws : m.Fragment, K = w ? { as: rS, allowPinchZoom: !0 } : void 0, J = ($) => {
13381
13380
  var G, O;
13382
13381
  const F = _.current + $, B = R().filter((Q) => !Q.disabled), pe = document.activeElement, ue = (G = B.find((Q) => Q.ref.current === pe)) == null ? void 0 : G.textValue, ee = B.map((Q) => Q.textValue), Ie = mS(ee, F, ue), Ce = (O = B.find((Q) => Q.textValue === Ie)) == null ? void 0 : O.ref.current;
13383
13382
  (function Q(q) {
@@ -13403,7 +13402,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13403
13402
  onItemLeave: m.useCallback(
13404
13403
  ($) => {
13405
13404
  var F;
13406
- z($) || ((F = E.current) == null || F.focus(), T(null));
13405
+ z($) || ((F = k.current) == null || F.focus(), T(null));
13407
13406
  },
13408
13407
  [z]
13409
13408
  ),
@@ -13424,7 +13423,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13424
13423
  trapped: o,
13425
13424
  onMountAutoFocus: le(s, ($) => {
13426
13425
  var F;
13427
- $.preventDefault(), (F = E.current) == null || F.focus({ preventScroll: !0 });
13426
+ $.preventDefault(), (F = k.current) == null || F.focus({ preventScroll: !0 });
13428
13427
  }),
13429
13428
  onUnmountAutoFocus: i,
13430
13429
  children: /* @__PURE__ */ c.jsx(
@@ -13466,7 +13465,7 @@ var Ht = "MenuContent", [eS, Fa] = nr(Ht), Af = m.forwardRef(
13466
13465
  onKeyDown: le(v.onKeyDown, ($) => {
13467
13466
  const B = $.target.closest("[data-radix-menu-content]") === $.currentTarget, pe = $.ctrlKey || $.altKey || $.metaKey, ue = $.key.length === 1;
13468
13467
  B && ($.key === "Tab" && $.preventDefault(), !pe && ue && J($.key));
13469
- const ee = E.current;
13468
+ const ee = k.current;
13470
13469
  if ($.target !== ee || !V0.includes($.key)) return;
13471
13470
  $.preventDefault();
13472
13471
  const Ce = R().filter((G) => !G.disabled).map((G) => G.ref.current);
@@ -13501,14 +13500,14 @@ Af.displayName = Ht;
13501
13500
  var oS = "MenuGroup", Ba = m.forwardRef(
13502
13501
  (e, t) => {
13503
13502
  const { __scopeMenu: n, ...r } = e;
13504
- return /* @__PURE__ */ c.jsx(ke.div, { role: "group", ...r, ref: t });
13503
+ return /* @__PURE__ */ c.jsx(Ee.div, { role: "group", ...r, ref: t });
13505
13504
  }
13506
13505
  );
13507
13506
  Ba.displayName = oS;
13508
13507
  var sS = "MenuLabel", _f = m.forwardRef(
13509
13508
  (e, t) => {
13510
13509
  const { __scopeMenu: n, ...r } = e;
13511
- return /* @__PURE__ */ c.jsx(ke.div, { ...r, ref: t });
13510
+ return /* @__PURE__ */ c.jsx(Ee.div, { ...r, ref: t });
13512
13511
  }
13513
13512
  );
13514
13513
  _f.displayName = sS;
@@ -13547,7 +13546,7 @@ var Yo = "MenuItem", Ic = "menu.itemSelect", _s = m.forwardRef(
13547
13546
  _s.displayName = Yo;
13548
13547
  var jf = m.forwardRef(
13549
13548
  (e, t) => {
13550
- const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = Ef(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
13549
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...s } = e, i = Fa(Yo, n), a = kf(n), l = m.useRef(null), u = ze(t, l), [d, f] = m.useState(!1), [h, p] = m.useState("");
13551
13550
  return m.useEffect(() => {
13552
13551
  const w = l.current;
13553
13552
  w && p((w.textContent ?? "").trim());
@@ -13558,7 +13557,7 @@ var jf = m.forwardRef(
13558
13557
  disabled: r,
13559
13558
  textValue: o ?? h,
13560
13559
  children: /* @__PURE__ */ c.jsx(U0, { asChild: !0, ...a, focusable: !r, children: /* @__PURE__ */ c.jsx(
13561
- ke.div,
13560
+ Ee.div,
13562
13561
  {
13563
13562
  role: "menuitem",
13564
13563
  "data-highlighted": d ? "" : void 0,
@@ -13650,7 +13649,7 @@ var Ha = "MenuItemIndicator", [$f, cS] = nr(
13650
13649
  {
13651
13650
  present: r || Xo(s.checked) || s.checked === !0,
13652
13651
  children: /* @__PURE__ */ c.jsx(
13653
- ke.span,
13652
+ Ee.span,
13654
13653
  {
13655
13654
  ...o,
13656
13655
  ref: t,
@@ -13666,7 +13665,7 @@ var uS = "MenuSeparator", zf = m.forwardRef(
13666
13665
  (e, t) => {
13667
13666
  const { __scopeMenu: n, ...r } = e;
13668
13667
  return /* @__PURE__ */ c.jsx(
13669
- ke.div,
13668
+ Ee.div,
13670
13669
  {
13671
13670
  role: "separator",
13672
13671
  "aria-orientation": "horizontal",
@@ -13834,7 +13833,7 @@ function xS(e, t) {
13834
13833
  function Xr(e) {
13835
13834
  return (t) => t.pointerType === "mouse" ? e(t) : void 0;
13836
13835
  }
13837
- var vS = kf, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, ES = Mf, kS = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
13836
+ var vS = Ef, wS = La, bS = Nf, yS = Af, SS = Ba, CS = _f, TS = _s, RS = Pf, kS = Mf, ES = Lf, IS = Ff, NS = zf, AS = Bf, _S = Uf, jS = Vf, js = "DropdownMenu", [PS, GT] = fn(
13838
13837
  js,
13839
13838
  [Rf]
13840
13839
  ), Tt = Rf(), [OS, qf] = PS(js), Gf = (e) => {
@@ -13872,7 +13871,7 @@ var Yf = "DropdownMenuTrigger", Xf = m.forwardRef(
13872
13871
  (e, t) => {
13873
13872
  const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = qf(Yf, n), i = Tt(n);
13874
13873
  return /* @__PURE__ */ c.jsx(wS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
13875
- ke.button,
13874
+ Ee.button,
13876
13875
  {
13877
13876
  type: "button",
13878
13877
  id: s.triggerId,
@@ -13960,12 +13959,12 @@ var zS = "DropdownMenuCheckboxItem", nh = m.forwardRef((e, t) => {
13960
13959
  nh.displayName = zS;
13961
13960
  var BS = "DropdownMenuRadioGroup", HS = m.forwardRef((e, t) => {
13962
13961
  const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
13963
- return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
13962
+ return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
13964
13963
  });
13965
13964
  HS.displayName = BS;
13966
13965
  var US = "DropdownMenuRadioItem", rh = m.forwardRef((e, t) => {
13967
13966
  const { __scopeDropdownMenu: n, ...r } = e, o = Tt(n);
13968
- return /* @__PURE__ */ c.jsx(kS, { ...o, ...r, ref: t });
13967
+ return /* @__PURE__ */ c.jsx(ES, { ...o, ...r, ref: t });
13969
13968
  });
13970
13969
  rh.displayName = US;
13971
13970
  var WS = "DropdownMenuItemIndicator", oh = m.forwardRef((e, t) => {
@@ -14147,7 +14146,7 @@ function mi({
14147
14146
  messages: R,
14148
14147
  hasMoreHistory: C,
14149
14148
  isLoadingHistory: T,
14150
- send: E,
14149
+ send: k,
14151
14150
  stop: I,
14152
14151
  loadOlderMessages: A
14153
14152
  } = hu(), {
@@ -14182,11 +14181,11 @@ function mi({
14182
14181
  }, Le = me.current;
14183
14182
  if (!(Le && Le.threadId === ve.threadId && Le.checkpointId === ve.checkpointId && Le.checkpointNs === ve.checkpointNs))
14184
14183
  return x(v).then((Xe) => {
14185
- var k;
14184
+ var E;
14186
14185
  if (re) return;
14187
14186
  const xt = ((Xe == null ? void 0 : Xe.checkpoints) ?? []).slice().sort((b, N) => new Date(N.createdAt).getTime() - new Date(b.createdAt).getTime());
14188
14187
  et(xt);
14189
- const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((k = xt[0]) == null ? void 0 : k.checkpointId) ?? null;
14188
+ const Vt = Fe, $n = Vt && xt.some((b) => b.checkpointId === Vt) ? Vt : ((E = xt[0]) == null ? void 0 : E.checkpointId) ?? null;
14190
14189
  let ar = null;
14191
14190
  if ($n) {
14192
14191
  const b = xt.find((N) => N.checkpointId === $n);
@@ -14244,7 +14243,7 @@ function mi({
14244
14243
  }
14245
14244
  }
14246
14245
  try {
14247
- await E(ve || "", {
14246
+ await k(ve || "", {
14248
14247
  checkpointId: Fe ?? W ?? void 0,
14249
14248
  checkpointNs: ft ?? P ?? void 0,
14250
14249
  payloadExtras: Y ? { edit: !0, originalMessageId: Y } : void 0,
@@ -14274,13 +14273,13 @@ function mi({
14274
14273
  for (let Le = re - 1; Le >= 0; Le--)
14275
14274
  if (R[Le].role === "user") {
14276
14275
  const Xe = ve(R[Le]);
14277
- Xe && E(Xe, {
14276
+ Xe && k(Xe, {
14278
14277
  checkpointId: Fe ?? W ?? void 0,
14279
14278
  checkpointNs: ft ?? P ?? void 0
14280
14279
  });
14281
14280
  break;
14282
14281
  }
14283
- }, [R, E, Fe, ft, W, P]), Mn = (re) => {
14282
+ }, [R, k, Fe, ft, W, P]), Mn = (re) => {
14284
14283
  const ve = Array.from(re.target.files || []);
14285
14284
  pe((Le) => [...Le, ...ve]), re.target.value = "";
14286
14285
  }, Mt = (re) => {
@@ -14293,7 +14292,7 @@ function mi({
14293
14292
  if (ve) {
14294
14293
  q(null), ie(null), O(!0);
14295
14294
  try {
14296
- await E("", {
14295
+ await k("", {
14297
14296
  checkpointId: Fe ?? W ?? void 0,
14298
14297
  checkpointNs: ft ?? P ?? void 0,
14299
14298
  attachments: [ve]
@@ -14552,7 +14551,7 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
14552
14551
  dir: o,
14553
14552
  scrollHideDelay: s = 600,
14554
14553
  ...i
14555
- } = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [E, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
14554
+ } = e, [a, l] = m.useState(null), [u, d] = m.useState(null), [f, h] = m.useState(null), [p, w] = m.useState(null), [v, g] = m.useState(null), [x, y] = m.useState(0), [S, R] = m.useState(0), [C, T] = m.useState(!1), [k, I] = m.useState(!1), A = ze(t, (D) => l(D)), _ = Ts(o);
14556
14555
  return /* @__PURE__ */ c.jsx(
14557
14556
  lC,
14558
14557
  {
@@ -14571,12 +14570,12 @@ var Wa = "ScrollArea", [vh, YT] = fn(Wa), [lC, Wt] = vh(Wa), wh = m.forwardRef(
14571
14570
  onScrollbarXEnabledChange: T,
14572
14571
  scrollbarY: v,
14573
14572
  onScrollbarYChange: g,
14574
- scrollbarYEnabled: E,
14573
+ scrollbarYEnabled: k,
14575
14574
  onScrollbarYEnabledChange: I,
14576
14575
  onCornerWidthChange: y,
14577
14576
  onCornerHeightChange: R,
14578
14577
  children: /* @__PURE__ */ c.jsx(
14579
- ke.div,
14578
+ Ee.div,
14580
14579
  {
14581
14580
  dir: _,
14582
14581
  ...i,
@@ -14609,7 +14608,7 @@ var bh = "ScrollAreaViewport", yh = m.forwardRef(
14609
14608
  }
14610
14609
  ),
14611
14610
  /* @__PURE__ */ c.jsx(
14612
- ke.div,
14611
+ Ee.div,
14613
14612
  {
14614
14613
  "data-radix-scroll-area-viewport": "",
14615
14614
  ...s,
@@ -14733,7 +14732,7 @@ var cC = m.forwardRef((e, t) => {
14733
14732
  content: 0,
14734
14733
  viewport: 0,
14735
14734
  scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
14736
- }), u = kh(a.viewport, a.content), d = {
14735
+ }), u = Eh(a.viewport, a.content), d = {
14737
14736
  ...r,
14738
14737
  sizes: a,
14739
14738
  onSizesChange: l,
@@ -14874,7 +14873,7 @@ var cC = m.forwardRef((e, t) => {
14874
14873
  onWheelScroll: d,
14875
14874
  onResize: f,
14876
14875
  ...h
14877
- } = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), E = Os(f, 10);
14876
+ } = e, p = Wt(pn, n), [w, v] = m.useState(null), g = ze(t, (A) => v(A)), x = m.useRef(null), y = m.useRef(""), S = p.viewport, R = r.content - r.viewport, C = mt(d), T = mt(l), k = Os(f, 10);
14878
14877
  function I(A) {
14879
14878
  if (x.current) {
14880
14879
  const _ = A.clientX - x.current.left, D = A.clientY - x.current.top;
@@ -14887,7 +14886,7 @@ var cC = m.forwardRef((e, t) => {
14887
14886
  (w == null ? void 0 : w.contains(D)) && C(_, R);
14888
14887
  };
14889
14888
  return document.addEventListener("wheel", A, { passive: !1 }), () => document.removeEventListener("wheel", A, { passive: !1 });
14890
- }, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, E), yr(p.content, E), /* @__PURE__ */ c.jsx(
14889
+ }, [S, w, R, C]), m.useEffect(T, [r, T]), yr(w, k), yr(p.content, k), /* @__PURE__ */ c.jsx(
14891
14890
  hC,
14892
14891
  {
14893
14892
  scope: n,
@@ -14898,7 +14897,7 @@ var cC = m.forwardRef((e, t) => {
14898
14897
  onThumbPositionChange: T,
14899
14898
  onThumbPointerDown: mt(a),
14900
14899
  children: /* @__PURE__ */ c.jsx(
14901
- ke.div,
14900
+ Ee.div,
14902
14901
  {
14903
14902
  ...h,
14904
14903
  ref: g,
@@ -14940,7 +14939,7 @@ var cC = m.forwardRef((e, t) => {
14940
14939
  return a(), f.addEventListener("scroll", h), () => f.removeEventListener("scroll", h);
14941
14940
  }
14942
14941
  }, [s.viewport, d, a]), /* @__PURE__ */ c.jsx(
14943
- ke.div,
14942
+ Ee.div,
14944
14943
  {
14945
14944
  "data-state": i.hasThumb ? "visible" : "hidden",
14946
14945
  ...o,
@@ -14960,13 +14959,13 @@ var cC = m.forwardRef((e, t) => {
14960
14959
  }
14961
14960
  );
14962
14961
  Rh.displayName = Zo;
14963
- var qa = "ScrollAreaCorner", Eh = m.forwardRef(
14962
+ var qa = "ScrollAreaCorner", kh = m.forwardRef(
14964
14963
  (e, t) => {
14965
14964
  const n = Wt(qa, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
14966
14965
  return n.type !== "scroll" && r ? /* @__PURE__ */ c.jsx(mC, { ...e, ref: t }) : null;
14967
14966
  }
14968
14967
  );
14969
- Eh.displayName = qa;
14968
+ kh.displayName = qa;
14970
14969
  var mC = m.forwardRef((e, t) => {
14971
14970
  const { __scopeScrollArea: n, ...r } = e, o = Wt(qa, n), [s, i] = m.useState(0), [a, l] = m.useState(0), u = !!(s && a);
14972
14971
  return yr(o.scrollbarX, () => {
@@ -14978,7 +14977,7 @@ var mC = m.forwardRef((e, t) => {
14978
14977
  const d = ((f = o.scrollbarY) == null ? void 0 : f.offsetWidth) || 0;
14979
14978
  o.onCornerWidthChange(d), i(d);
14980
14979
  }), u ? /* @__PURE__ */ c.jsx(
14981
- ke.div,
14980
+ Ee.div,
14982
14981
  {
14983
14982
  ...r,
14984
14983
  ref: t,
@@ -14997,12 +14996,12 @@ var mC = m.forwardRef((e, t) => {
14997
14996
  function Qo(e) {
14998
14997
  return e ? parseInt(e, 10) : 0;
14999
14998
  }
15000
- function kh(e, t) {
14999
+ function Eh(e, t) {
15001
15000
  const n = e / t;
15002
15001
  return isNaN(n) ? 0 : n;
15003
15002
  }
15004
15003
  function Ps(e) {
15005
- const t = kh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
15004
+ const t = Eh(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
15006
15005
  return Math.max(r, 18);
15007
15006
  }
15008
15007
  function gC(e, t, n, r = "ltr") {
@@ -15051,7 +15050,7 @@ function yr(e, t) {
15051
15050
  }
15052
15051
  }, [e, n]);
15053
15052
  }
15054
- var Ah = wh, vC = yh, wC = Eh;
15053
+ var Ah = wh, vC = yh, wC = kh;
15055
15054
  const _h = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
15056
15055
  Ah,
15057
15056
  {
@@ -15103,7 +15102,7 @@ function Ac({
15103
15102
  deleteThread: v,
15104
15103
  renameThread: g,
15105
15104
  isLoadingThreads: x
15106
- } = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [E, I] = xe(""), [A, _] = xe(!1);
15105
+ } = ra(), [y, S] = xe(Array.isArray(h) ? h : []), R = Ge(y.length > 0), [C, T] = xe(null), [k, I] = xe(""), [A, _] = xe(!1);
15107
15106
  ct(() => {
15108
15107
  const F = Array.isArray(h) ? h : [];
15109
15108
  if (F.length > 0) {
@@ -15138,9 +15137,9 @@ function Ac({
15138
15137
  }, P = (F, B) => {
15139
15138
  B.stopPropagation(), T(F.threadId), I(F.title || `Thread ${F.threadId.slice(0, 8)}`);
15140
15139
  }, Y = async (F) => {
15141
- if (E.trim())
15140
+ if (k.trim())
15142
15141
  try {
15143
- await g(F, E.trim()), T(null), I("");
15142
+ await g(F, k.trim()), T(null), I("");
15144
15143
  } catch (B) {
15145
15144
  console.error("Failed to update title:", B);
15146
15145
  }
@@ -15189,7 +15188,7 @@ function Ac({
15189
15188
  children: [
15190
15189
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
15191
15190
  /* @__PURE__ */ c.jsx("div", { className: "flex-1 min-w-0", children: C === F.threadId ? /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", onClick: (B) => B.stopPropagation(), children: [
15192
- /* @__PURE__ */ c.jsx(Jo, { value: E, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15191
+ /* @__PURE__ */ c.jsx(Jo, { value: k, onChange: (B) => I(B.target.value), onKeyDown: (B) => J(B, F.threadId), className: "h-6 text-sm", autoFocus: !0 }),
15193
15192
  /* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: () => Y(F.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(Zi, { size: 12 }) }),
15194
15193
  /* @__PURE__ */ c.jsx(Ue, { variant: "ghost", size: "sm", onClick: K, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(fr, { size: 12 }) })
15195
15194
  ] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
@@ -15328,7 +15327,7 @@ function JT(e) {
15328
15327
  }), TC(e);
15329
15328
  }
15330
15329
  var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
15331
- ke.label,
15330
+ Ee.label,
15332
15331
  {
15333
15332
  ...e,
15334
15333
  ref: t,
@@ -15340,13 +15339,13 @@ var RC = "Label", Lh = m.forwardRef((e, t) => /* @__PURE__ */ c.jsx(
15340
15339
  ));
15341
15340
  Lh.displayName = RC;
15342
15341
  var $h = Lh;
15343
- const EC = ns(
15342
+ const kC = ns(
15344
15343
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
15345
15344
  ), $t = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15346
15345
  $h,
15347
15346
  {
15348
15347
  ref: n,
15349
- className: te(EC(), e),
15348
+ className: te(kC(), e),
15350
15349
  ...t
15351
15350
  }
15352
15351
  ));
@@ -15355,7 +15354,7 @@ function Fh(e) {
15355
15354
  const t = m.useRef({ value: e, previous: e });
15356
15355
  return m.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
15357
15356
  }
15358
- var Ms = "Switch", [kC, ZT] = fn(Ms), [IC, NC] = kC(Ms), zh = m.forwardRef(
15357
+ var Ms = "Switch", [EC, ZT] = fn(Ms), [IC, NC] = EC(Ms), zh = m.forwardRef(
15359
15358
  (e, t) => {
15360
15359
  const {
15361
15360
  __scopeSwitch: n,
@@ -15376,7 +15375,7 @@ var Ms = "Switch", [kC, ZT] = fn(Ms), [IC, NC] = kC(Ms), zh = m.forwardRef(
15376
15375
  });
15377
15376
  return /* @__PURE__ */ c.jsxs(IC, { scope: n, checked: x, disabled: a, children: [
15378
15377
  /* @__PURE__ */ c.jsx(
15379
- ke.button,
15378
+ Ee.button,
15380
15379
  {
15381
15380
  type: "button",
15382
15381
  role: "switch",
@@ -15415,7 +15414,7 @@ var Bh = "SwitchThumb", Hh = m.forwardRef(
15415
15414
  (e, t) => {
15416
15415
  const { __scopeSwitch: n, ...r } = e, o = NC(Bh, n);
15417
15416
  return /* @__PURE__ */ c.jsx(
15418
- ke.span,
15417
+ Ee.span,
15419
15418
  {
15420
15419
  "data-state": Wh(o.checked),
15421
15420
  "data-disabled": o.disabled ? "" : void 0,
@@ -15506,7 +15505,7 @@ var Kh = Object.freeze({
15506
15505
  wordWrap: "normal"
15507
15506
  }), jC = "VisuallyHidden", PC = m.forwardRef(
15508
15507
  (e, t) => /* @__PURE__ */ c.jsx(
15509
- ke.span,
15508
+ Ee.span,
15510
15509
  {
15511
15510
  ...e,
15512
15511
  ref: t,
@@ -15534,7 +15533,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
15534
15533
  disabled: h,
15535
15534
  required: p,
15536
15535
  form: w
15537
- } = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [E, I] = Gn({
15536
+ } = e, v = $s(t), [g, x] = m.useState(null), [y, S] = m.useState(null), [R, C] = m.useState(!1), T = Ts(u), [k, I] = Gn({
15538
15537
  prop: r,
15539
15538
  defaultProp: o ?? !1,
15540
15539
  onChange: s,
@@ -15559,7 +15558,7 @@ var OC = [" ", "Enter", "ArrowUp", "ArrowDown"], MC = [" ", "Enter"], Jn = "Sele
15559
15558
  contentId: ln(),
15560
15559
  value: A,
15561
15560
  onValueChange: _,
15562
- open: E,
15561
+ open: k,
15563
15562
  onOpenChange: I,
15564
15563
  dir: T,
15565
15564
  triggerPointerDownPosRef: D,
@@ -15617,7 +15616,7 @@ var Gh = "SelectTrigger", Yh = m.forwardRef(
15617
15616
  });
15618
15617
  };
15619
15618
  return /* @__PURE__ */ c.jsx(mf, { asChild: !0, ...s, children: /* @__PURE__ */ c.jsx(
15620
- ke.button,
15619
+ Ee.button,
15621
15620
  {
15622
15621
  type: "button",
15623
15622
  role: "combobox",
@@ -15655,7 +15654,7 @@ var Xh = "SelectValue", Jh = m.forwardRef(
15655
15654
  return pt(() => {
15656
15655
  u(d);
15657
15656
  }, [u, d]), /* @__PURE__ */ c.jsx(
15658
- ke.span,
15657
+ Ee.span,
15659
15658
  {
15660
15659
  ...a,
15661
15660
  ref: f,
@@ -15669,7 +15668,7 @@ Jh.displayName = Xh;
15669
15668
  var zC = "SelectIcon", Zh = m.forwardRef(
15670
15669
  (e, t) => {
15671
15670
  const { __scopeSelect: n, children: r, ...o } = e;
15672
- return /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
15671
+ return /* @__PURE__ */ c.jsx(Ee.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
15673
15672
  }
15674
15673
  );
15675
15674
  Zh.displayName = zC;
@@ -15713,7 +15712,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15713
15712
  avoidCollisions: g,
15714
15713
  //
15715
15714
  ...x
15716
- } = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), E = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
15715
+ } = e, y = jn(Zn, n), [S, R] = m.useState(null), [C, T] = m.useState(null), k = ze(t, (G) => R(G)), [I, A] = m.useState(null), [_, D] = m.useState(
15717
15716
  null
15718
15717
  ), L = Ls(n), [W, P] = m.useState(!1), Y = m.useRef(!1);
15719
15718
  m.useEffect(() => {
@@ -15831,7 +15830,7 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15831
15830
  ...x,
15832
15831
  ...Ce,
15833
15832
  onPlaced: () => P(!0),
15834
- ref: E,
15833
+ ref: k,
15835
15834
  style: {
15836
15835
  // flex layout so we can place the scroll buttons properly
15837
15836
  display: "flex",
@@ -15863,11 +15862,11 @@ var Kt = 10, [tp, Pn] = Ir(Zn), HC = "SelectContentImpl", UC = vr("SelectContent
15863
15862
  );
15864
15863
  np.displayName = HC;
15865
15864
  var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15866
- const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (E) => d(E)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
15865
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, s = jn(Zn, n), i = Pn(Zn, n), [a, l] = m.useState(null), [u, d] = m.useState(null), f = ze(t, (k) => d(k)), h = Ls(n), p = m.useRef(!1), w = m.useRef(!0), { viewport: v, selectedItem: g, selectedItemText: x, focusSelectedItem: y } = i, S = m.useCallback(() => {
15867
15866
  if (s.trigger && s.valueNode && a && u && v && g && x) {
15868
- const E = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15867
+ const k = s.trigger.getBoundingClientRect(), I = u.getBoundingClientRect(), A = s.valueNode.getBoundingClientRect(), _ = x.getBoundingClientRect();
15869
15868
  if (s.dir !== "rtl") {
15870
- const ce = _.left - I.left, ie = A.left - ce, $e = E.left - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15869
+ const ce = _.left - I.left, ie = A.left - ce, $e = k.left - ie, Ke = k.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15871
15870
  Kt,
15872
15871
  // Prevents the content from going off the starting edge of the
15873
15872
  // viewport. It may still go off the ending edge, but this can be
@@ -15878,13 +15877,13 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15878
15877
  ]);
15879
15878
  a.style.minWidth = Ke + "px", a.style.left = Pe + "px";
15880
15879
  } else {
15881
- const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - E.right - ie, Ke = E.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15880
+ const ce = I.right - _.right, ie = window.innerWidth - A.right - ce, $e = window.innerWidth - k.right - ie, Ke = k.width + $e, We = Math.max(Ke, I.width), Te = window.innerWidth - Kt, Pe = Wi(ie, [
15882
15881
  Kt,
15883
15882
  Math.max(Kt, Te - We)
15884
15883
  ]);
15885
15884
  a.style.minWidth = Ke + "px", a.style.right = Pe + "px";
15886
15885
  }
15887
- const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = E.top + E.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
15886
+ const D = h(), L = window.innerHeight - Kt * 2, W = v.scrollHeight, P = window.getComputedStyle(u), Y = parseInt(P.borderTopWidth, 10), K = parseInt(P.paddingTop, 10), J = parseInt(P.borderBottomWidth, 10), z = parseInt(P.paddingBottom, 10), $ = Y + K + W + z + J, F = Math.min(g.offsetHeight * 5, $), B = window.getComputedStyle(v), pe = parseInt(B.paddingTop, 10), ue = parseInt(B.paddingBottom, 10), ee = k.top + k.height / 2 - Kt, Ie = L - ee, Ce = g.offsetHeight / 2, G = g.offsetTop + Ce, O = Y + K + G, Q = $ - O;
15888
15887
  if (O <= ee) {
15889
15888
  const ce = D.length > 0 && g === D[D.length - 1].ref.current;
15890
15889
  a.style.bottom = "0px";
@@ -15924,8 +15923,8 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15924
15923
  u && C(window.getComputedStyle(u).zIndex);
15925
15924
  }, [u]);
15926
15925
  const T = m.useCallback(
15927
- (E) => {
15928
- E && w.current === !0 && (S(), y == null || y(), w.current = !1);
15926
+ (k) => {
15927
+ k && w.current === !0 && (S(), y == null || y(), w.current = !1);
15929
15928
  },
15930
15929
  [S, y]
15931
15930
  );
@@ -15947,7 +15946,7 @@ var WC = "SelectItemAlignedPosition", rp = m.forwardRef((e, t) => {
15947
15946
  zIndex: R
15948
15947
  },
15949
15948
  children: /* @__PURE__ */ c.jsx(
15950
- ke.div,
15949
+ Ee.div,
15951
15950
  {
15952
15951
  ...o,
15953
15952
  ref: f,
@@ -16010,7 +16009,7 @@ var [KC, Ga] = Ir(Zn, {}), Ki = "SelectViewport", op = m.forwardRef(
16010
16009
  }
16011
16010
  ),
16012
16011
  /* @__PURE__ */ c.jsx(Ds.Slot, { scope: n, children: /* @__PURE__ */ c.jsx(
16013
- ke.div,
16012
+ Ee.div,
16014
16013
  {
16015
16014
  "data-radix-select-viewport": "",
16016
16015
  role: "presentation",
@@ -16052,14 +16051,14 @@ op.displayName = Ki;
16052
16051
  var sp = "SelectGroup", [qC, GC] = Ir(sp), YC = m.forwardRef(
16053
16052
  (e, t) => {
16054
16053
  const { __scopeSelect: n, ...r } = e, o = ln();
16055
- return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(ke.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16054
+ return /* @__PURE__ */ c.jsx(qC, { scope: n, id: o, children: /* @__PURE__ */ c.jsx(Ee.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
16056
16055
  }
16057
16056
  );
16058
16057
  YC.displayName = sp;
16059
16058
  var ip = "SelectLabel", ap = m.forwardRef(
16060
16059
  (e, t) => {
16061
16060
  const { __scopeSelect: n, ...r } = e, o = GC(ip, n);
16062
- return /* @__PURE__ */ c.jsx(ke.div, { id: o.id, ...r, ref: t });
16061
+ return /* @__PURE__ */ c.jsx(Ee.div, { id: o.id, ...r, ref: t });
16063
16062
  }
16064
16063
  );
16065
16064
  ap.displayName = ip;
@@ -16103,7 +16102,7 @@ var es = "SelectItem", [XC, lp] = Ir(es), cp = m.forwardRef(
16103
16102
  disabled: o,
16104
16103
  textValue: d,
16105
16104
  children: /* @__PURE__ */ c.jsx(
16106
- ke.div,
16105
+ Ee.div,
16107
16106
  {
16108
16107
  role: "option",
16109
16108
  "aria-labelledby": v,
@@ -16162,7 +16161,7 @@ var Or = "SelectItemText", up = m.forwardRef(
16162
16161
  [l.disabled, l.value, p]
16163
16162
  ), { onNativeOptionAdd: v, onNativeOptionRemove: g } = u;
16164
16163
  return pt(() => (v(w), () => g(w)), [v, g, w]), /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
16165
- /* @__PURE__ */ c.jsx(ke.span, { id: l.textId, ...s, ref: h }),
16164
+ /* @__PURE__ */ c.jsx(Ee.span, { id: l.textId, ...s, ref: h }),
16166
16165
  l.isSelected && i.valueNode && !i.valueNodeHasChildren ? rs.createPortal(s.children, i.valueNode) : null
16167
16166
  ] });
16168
16167
  }
@@ -16171,7 +16170,7 @@ up.displayName = Or;
16171
16170
  var dp = "SelectItemIndicator", fp = m.forwardRef(
16172
16171
  (e, t) => {
16173
16172
  const { __scopeSelect: n, ...r } = e;
16174
- return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(ke.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16173
+ return lp(dp, n).isSelected ? /* @__PURE__ */ c.jsx(Ee.span, { "aria-hidden": !0, ...r, ref: t }) : null;
16175
16174
  }
16176
16175
  );
16177
16176
  fp.displayName = dp;
@@ -16232,7 +16231,7 @@ var mp = m.forwardRef((e, t) => {
16232
16231
  const u = a().find((f) => f.ref.current === document.activeElement);
16233
16232
  (d = u == null ? void 0 : u.ref.current) == null || d.scrollIntoView({ block: "nearest" });
16234
16233
  }, [a]), /* @__PURE__ */ c.jsx(
16235
- ke.div,
16234
+ Ee.div,
16236
16235
  {
16237
16236
  "aria-hidden": !0,
16238
16237
  ...o,
@@ -16253,7 +16252,7 @@ var mp = m.forwardRef((e, t) => {
16253
16252
  }), JC = "SelectSeparator", gp = m.forwardRef(
16254
16253
  (e, t) => {
16255
16254
  const { __scopeSelect: n, ...r } = e;
16256
- return /* @__PURE__ */ c.jsx(ke.div, { "aria-hidden": !0, ...r, ref: t });
16255
+ return /* @__PURE__ */ c.jsx(Ee.div, { "aria-hidden": !0, ...r, ref: t });
16257
16256
  }
16258
16257
  );
16259
16258
  gp.displayName = JC;
@@ -16279,7 +16278,7 @@ var QC = "SelectBubbleInput", xp = m.forwardRef(
16279
16278
  d.call(a, t), a.dispatchEvent(f);
16280
16279
  }
16281
16280
  }, [i, t]), /* @__PURE__ */ c.jsx(
16282
- ke.select,
16281
+ Ee.select,
16283
16282
  {
16284
16283
  ...n,
16285
16284
  style: { ...Kh, ...n.style },
@@ -16319,7 +16318,7 @@ function bp(e, t, n) {
16319
16318
  function eT(e, t) {
16320
16319
  return e.map((n, r) => e[(t + r) % e.length]);
16321
16320
  }
16322
- var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, Ep = pp, kp = gp;
16321
+ var tT = qh, yp = Yh, nT = Jh, rT = Zh, oT = Qh, Sp = ep, sT = op, Cp = ap, Tp = cp, iT = up, aT = fp, Rp = hp, kp = pp, Ep = gp;
16323
16322
  const _c = tT, jc = nT, Xi = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ c.jsxs(
16324
16323
  yp,
16325
16324
  {
@@ -16350,7 +16349,7 @@ const Ip = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16350
16349
  ));
16351
16350
  Ip.displayName = Rp.displayName;
16352
16351
  const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16353
- Ep,
16352
+ kp,
16354
16353
  {
16355
16354
  ref: n,
16356
16355
  className: te(
@@ -16361,7 +16360,7 @@ const Np = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16361
16360
  children: /* @__PURE__ */ c.jsx(dr, { className: "h-4 w-4" })
16362
16361
  }
16363
16362
  ));
16364
- Np.displayName = Ep.displayName;
16363
+ Np.displayName = kp.displayName;
16365
16364
  const Ji = m.forwardRef(({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ c.jsx(oT, { children: /* @__PURE__ */ c.jsxs(
16366
16365
  Sp,
16367
16366
  {
@@ -16416,18 +16415,18 @@ const zn = m.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
16416
16415
  ));
16417
16416
  zn.displayName = Tp.displayName;
16418
16417
  const cT = m.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
16419
- kp,
16418
+ Ep,
16420
16419
  {
16421
16420
  ref: n,
16422
16421
  className: te("-mx-1 my-1 h-px bg-muted", e),
16423
16422
  ...t
16424
16423
  }
16425
16424
  ));
16426
- cT.displayName = kp.displayName;
16425
+ cT.displayName = Ep.displayName;
16427
16426
  var uT = "Separator", Pc = "horizontal", dT = ["horizontal", "vertical"], Ap = m.forwardRef((e, t) => {
16428
16427
  const { decorative: n, orientation: r = Pc, ...o } = e, s = fT(r) ? r : Pc, a = n ? { role: "none" } : { "aria-orientation": s === "vertical" ? s : void 0, role: "separator" };
16429
16428
  return /* @__PURE__ */ c.jsx(
16430
- ke.div,
16429
+ Ee.div,
16431
16430
  {
16432
16431
  "data-orientation": s,
16433
16432
  ...a,
@@ -16607,7 +16606,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16607
16606
  /* @__PURE__ */ c.jsx(om, { className: "h-5 w-5" }),
16608
16607
  "API Configuration"
16609
16608
  ] }) }),
16610
- /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16609
+ /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16611
16610
  /* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
16612
16611
  /* @__PURE__ */ c.jsx($t, { htmlFor: "api-url", children: "API Base URL" }),
16613
16612
  /* @__PURE__ */ c.jsxs("div", { className: "flex gap-2", children: [
@@ -16674,7 +16673,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16674
16673
  /* @__PURE__ */ c.jsx(am, { className: "h-5 w-5" }),
16675
16674
  "Interface Settings"
16676
16675
  ] }) }),
16677
- /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16676
+ /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16678
16677
  /* @__PURE__ */ c.jsxs("div", { className: "space-y-2", children: [
16679
16678
  /* @__PURE__ */ c.jsx($t, { htmlFor: "layout", children: "Layout Style" }),
16680
16679
  /* @__PURE__ */ c.jsxs(
@@ -16769,7 +16768,7 @@ function eR({ settings: e, onSettingsChange: t, className: n = "" }) {
16769
16768
  /* @__PURE__ */ c.jsx(lm, { className: "h-5 w-5" }),
16770
16769
  "Behavior Settings"
16771
16770
  ] }) }),
16772
- /* @__PURE__ */ c.jsxs(ko, { className: "space-y-4", children: [
16771
+ /* @__PURE__ */ c.jsxs(Eo, { className: "space-y-4", children: [
16773
16772
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center justify-between", children: [
16774
16773
  /* @__PURE__ */ c.jsxs("div", { children: [
16775
16774
  /* @__PURE__ */ c.jsx($t, { htmlFor: "auto-save", children: "Auto-save Conversations" }),