teodor-new-chat-ui 3.0.97 → 3.0.98

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
@@ -88,7 +88,7 @@ function fm() {
88
88
  function A(R) {
89
89
  return R.displayName || "Context";
90
90
  }
91
- function M(R) {
91
+ function O(R) {
92
92
  if (R == null)
93
93
  return null;
94
94
  if (typeof R.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof R == "function")
@@ -121,11 +121,11 @@ function fm() {
121
121
  return H(R, R.render, "ForwardRef");
122
122
  case h:
123
123
  var ge = R.displayName || null;
124
- return ge !== null ? ge : M(R.type) || "Memo";
124
+ return ge !== null ? ge : O(R.type) || "Memo";
125
125
  case m: {
126
126
  var Oe = R, Fe = Oe._payload, Ie = Oe._init;
127
127
  try {
128
- return M(Ie(Fe));
128
+ return O(Ie(Fe));
129
129
  } catch {
130
130
  return null;
131
131
  }
@@ -133,14 +133,14 @@ function fm() {
133
133
  }
134
134
  return null;
135
135
  }
136
- var I = Object.assign, B = 0, F, Z, D, O, G, Q, q;
136
+ var I = Object.assign, L = 0, F, X, D, M, G, Q, q;
137
137
  function $() {
138
138
  }
139
139
  $.__reactDisabledLog = !0;
140
140
  function Y() {
141
141
  {
142
- if (B === 0) {
143
- F = console.log, Z = console.info, D = console.warn, O = console.error, G = console.group, Q = console.groupCollapsed, q = console.groupEnd;
142
+ if (L === 0) {
143
+ F = console.log, X = console.info, D = console.warn, M = console.error, G = console.group, Q = console.groupCollapsed, q = console.groupEnd;
144
144
  var R = {
145
145
  configurable: !0,
146
146
  enumerable: !0,
@@ -157,12 +157,12 @@ function fm() {
157
157
  groupEnd: R
158
158
  });
159
159
  }
160
- B++;
160
+ L++;
161
161
  }
162
162
  }
163
163
  function ye() {
164
164
  {
165
- if (B--, B === 0) {
165
+ if (L--, L === 0) {
166
166
  var R = {
167
167
  configurable: !0,
168
168
  enumerable: !0,
@@ -173,13 +173,13 @@ function fm() {
173
173
  value: F
174
174
  }),
175
175
  info: I({}, R, {
176
- value: Z
176
+ value: X
177
177
  }),
178
178
  warn: I({}, R, {
179
179
  value: D
180
180
  }),
181
181
  error: I({}, R, {
182
- value: O
182
+ value: M
183
183
  }),
184
184
  group: I({}, R, {
185
185
  value: G
@@ -192,7 +192,7 @@ function fm() {
192
192
  })
193
193
  });
194
194
  }
195
- B < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
195
+ L < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
196
196
  }
197
197
  }
198
198
  var ce = w.ReactCurrentDispatcher, K;
@@ -209,13 +209,13 @@ function fm() {
209
209
  ` + K + R;
210
210
  }
211
211
  }
212
- var X = !1, te;
212
+ var J = !1, te;
213
213
  {
214
214
  var ue = typeof WeakMap == "function" ? WeakMap : Map;
215
215
  te = new ue();
216
216
  }
217
217
  function se(R, U) {
218
- if (!R || X)
218
+ if (!R || J)
219
219
  return "";
220
220
  {
221
221
  var ne = te.get(R);
@@ -223,7 +223,7 @@ function fm() {
223
223
  return ne;
224
224
  }
225
225
  var ge;
226
- X = !0;
226
+ J = !0;
227
227
  var Oe = Error.prepareStackTrace;
228
228
  Error.prepareStackTrace = void 0;
229
229
  var Fe;
@@ -280,7 +280,7 @@ function fm() {
280
280
  }
281
281
  }
282
282
  } finally {
283
- X = !1, ce.current = Fe, ye(), Error.prepareStackTrace = Oe;
283
+ J = !1, ce.current = Fe, ye(), Error.prepareStackTrace = Oe;
284
284
  }
285
285
  var Bn = R ? R.displayName || R.name : "", Wa = Bn ? _(Bn) : "";
286
286
  return typeof R == "function" && te.set(R, Wa), Wa;
@@ -348,9 +348,9 @@ function fm() {
348
348
  }
349
349
  }
350
350
  }
351
- var J = Array.isArray;
351
+ var Z = Array.isArray;
352
352
  function ae(R) {
353
- return J(R);
353
+ return Z(R);
354
354
  }
355
355
  function $e(R) {
356
356
  {
@@ -482,7 +482,7 @@ function fm() {
482
482
  function an() {
483
483
  {
484
484
  if (fr.current) {
485
- var R = M(fr.current.type);
485
+ var R = O(fr.current.type);
486
486
  if (R)
487
487
  return `
488
488
 
@@ -517,7 +517,7 @@ Check the top-level render call using <` + ne + ">.");
517
517
  return;
518
518
  Fn[ne] = !0;
519
519
  var ge = "";
520
- R && R._owner && R._owner !== fr.current && (ge = " It was passed a child from " + M(R._owner.type) + "."), ie(R), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, ge), ie(null);
520
+ R && R._owner && R._owner !== fr.current && (ge = " It was passed a child from " + O(R._owner.type) + "."), ie(R), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, ge), ie(null);
521
521
  }
522
522
  }
523
523
  function Wt(R, U) {
@@ -554,11 +554,11 @@ Check the top-level render call using <` + ne + ">.");
554
554
  else
555
555
  return;
556
556
  if (ne) {
557
- var ge = M(U);
557
+ var ge = O(U);
558
558
  rt(ne, R.props, "prop", ge, R);
559
559
  } else if (U.PropTypes !== void 0 && !Ne) {
560
560
  Ne = !0;
561
- var Oe = M(U);
561
+ var Oe = O(U);
562
562
  b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Oe || "Unknown");
563
563
  }
564
564
  typeof U.getDefaultProps == "function" && !U.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
@@ -585,7 +585,7 @@ Check the top-level render call using <` + ne + ">.");
585
585
  var ht = hr();
586
586
  ht ? Re += ht : Re += an();
587
587
  var qe;
588
- R === null ? qe = "null" : ae(R) ? qe = "array" : R !== void 0 && R.$$typeof === t ? (qe = "<" + (M(R.type) || "Unknown") + " />", Re = " Did you accidentally export a JSX literal instead of a component?") : qe = typeof R, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", qe, Re);
588
+ R === null ? qe = "null" : ae(R) ? qe = "array" : R !== void 0 && R.$$typeof === t ? (qe = "<" + (O(R.type) || "Unknown") + " />", Re = " Did you accidentally export a JSX literal instead of a component?") : qe = typeof R, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", qe, Re);
589
589
  }
590
590
  var tt = dr(R, U, ne, Oe, Fe);
591
591
  if (tt == null)
@@ -1851,13 +1851,13 @@ const Uc = (e) => {
1851
1851
  fetchOptions: P
1852
1852
  } = Uc(x), H = t || fetch;
1853
1853
  C = C ? (C + "").toLowerCase() : "text";
1854
- let A = jg([b, y && y.toAbortSignal()], E), M = null;
1854
+ let A = jg([b, y && y.toAbortSignal()], E), O = null;
1855
1855
  const I = A && A.unsubscribe && (() => {
1856
1856
  A.unsubscribe();
1857
1857
  });
1858
- let B;
1858
+ let L;
1859
1859
  try {
1860
- if (T && u && p !== "get" && p !== "head" && (B = await v(N, w)) !== 0) {
1860
+ if (T && u && p !== "get" && p !== "head" && (L = await v(N, w)) !== 0) {
1861
1861
  let Q = new n(g, {
1862
1862
  method: "POST",
1863
1863
  body: w,
@@ -1865,14 +1865,14 @@ const Uc = (e) => {
1865
1865
  }), q;
1866
1866
  if (k.isFormData(w) && (q = Q.headers.get("content-type")) && N.setContentType(q), Q.body) {
1867
1867
  const [$, Y] = rl(
1868
- B,
1868
+ L,
1869
1869
  ko(ol(T))
1870
1870
  );
1871
1871
  w = il(Q.body, al, $, Y);
1872
1872
  }
1873
1873
  }
1874
1874
  k.isString(j) || (j = j ? "include" : "omit");
1875
- const F = s && "credentials" in n.prototype, Z = {
1875
+ const F = s && "credentials" in n.prototype, X = {
1876
1876
  ...P,
1877
1877
  signal: A,
1878
1878
  method: p.toUpperCase(),
@@ -1881,10 +1881,10 @@ const Uc = (e) => {
1881
1881
  duplex: "half",
1882
1882
  credentials: F ? j : void 0
1883
1883
  };
1884
- M = s && new n(g, Z);
1885
- let D = await (s ? H(M, P) : H(g, Z));
1886
- const O = d && (C === "stream" || C === "response");
1887
- if (d && (S || O && I)) {
1884
+ O = s && new n(g, X);
1885
+ let D = await (s ? H(O, P) : H(g, X));
1886
+ const M = d && (C === "stream" || C === "response");
1887
+ if (d && (S || M && I)) {
1888
1888
  const Q = {};
1889
1889
  ["status", "statusText", "headers"].forEach((ye) => {
1890
1890
  Q[ye] = D[ye];
@@ -1902,23 +1902,23 @@ const Uc = (e) => {
1902
1902
  }
1903
1903
  C = C || "text";
1904
1904
  let G = await h[k.findKey(h, C) || "text"](D, x);
1905
- return !O && I && I(), await new Promise((Q, q) => {
1905
+ return !M && I && I(), await new Promise((Q, q) => {
1906
1906
  $c(Q, q, {
1907
1907
  data: G,
1908
1908
  headers: xt.from(D.headers),
1909
1909
  status: D.status,
1910
1910
  statusText: D.statusText,
1911
1911
  config: x,
1912
- request: M
1912
+ request: O
1913
1913
  });
1914
1914
  });
1915
1915
  } catch (F) {
1916
1916
  throw I && I(), F && F.name === "TypeError" && /Load failed|fetch/i.test(F.message) ? Object.assign(
1917
- new be("Network Error", be.ERR_NETWORK, x, M),
1917
+ new be("Network Error", be.ERR_NETWORK, x, O),
1918
1918
  {
1919
1919
  cause: F.cause || F
1920
1920
  }
1921
- ) : be.from(F, F && F.code, x, M);
1921
+ ) : be.from(F, F && F.code, x, O);
1922
1922
  }
1923
1923
  };
1924
1924
  }, Mg = /* @__PURE__ */ new Map(), Wc = (e) => {
@@ -2516,7 +2516,7 @@ function Kg(e = {}) {
2516
2516
  x.current && (x.current.abort(), x.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
2517
2517
  const T = new AbortController();
2518
2518
  return x.current = T, (async () => {
2519
- var j, P, H, A, M;
2519
+ var j, P, H, A, O;
2520
2520
  const C = (() => {
2521
2521
  var I;
2522
2522
  try {
@@ -2525,12 +2525,12 @@ function Kg(e = {}) {
2525
2525
  return !1;
2526
2526
  }
2527
2527
  })(), N = (I) => {
2528
- var B;
2528
+ var L;
2529
2529
  try {
2530
2530
  const F = JSON.parse(JSON.stringify(I));
2531
- return (B = F == null ? void 0 : F.payload) != null && B.files_info && Array.isArray(F.payload.files_info) && (F.payload.files_info = F.payload.files_info.map((Z) => ({
2532
- ...Z,
2533
- data: Z != null && Z.data ? `<base64 ${String(Z.data).length} chars>` : Z == null ? void 0 : Z.data
2531
+ return (L = F == null ? void 0 : F.payload) != null && L.files_info && Array.isArray(F.payload.files_info) && (F.payload.files_info = F.payload.files_info.map((X) => ({
2532
+ ...X,
2533
+ data: X != null && X.data ? `<base64 ${String(X.data).length} chars>` : X == null ? void 0 : X.data
2534
2534
  }))), F;
2535
2535
  } catch {
2536
2536
  return I;
@@ -2555,7 +2555,7 @@ function Kg(e = {}) {
2555
2555
  } catch {
2556
2556
  }
2557
2557
  C && console.debug("[use-chat] POST", t + n, N(y));
2558
- const B = await fetch(t + n, {
2558
+ const L = await fetch(t + n, {
2559
2559
  method: "POST",
2560
2560
  headers: {
2561
2561
  "Content-Type": "application/json",
@@ -2566,12 +2566,12 @@ function Kg(e = {}) {
2566
2566
  body: JSON.stringify(y),
2567
2567
  signal: T.signal
2568
2568
  });
2569
- if (!B.ok || !B.body) {
2570
- const G = await B.text().catch(() => "");
2571
- throw C && console.debug("[use-chat] non-OK response", B.status, G == null ? void 0 : G.slice(0, 500)), new Error(`stream ${B.status}${G ? ": " + G : ""}`);
2569
+ if (!L.ok || !L.body) {
2570
+ const G = await L.text().catch(() => "");
2571
+ throw C && console.debug("[use-chat] non-OK response", L.status, G == null ? void 0 : G.slice(0, 500)), new Error(`stream ${L.status}${G ? ": " + G : ""}`);
2572
2572
  }
2573
2573
  try {
2574
- const G = B.headers.get("X-Thread-Id") || B.headers.get("x-thread-id"), Q = B.headers.get("X-Thread-Created") || B.headers.get("x-thread-created"), q = G ?? null, $ = String(Q ?? "").toLowerCase() === "true";
2574
+ const G = L.headers.get("X-Thread-Id") || L.headers.get("x-thread-id"), Q = L.headers.get("X-Thread-Created") || L.headers.get("x-thread-created"), q = G ?? null, $ = String(Q ?? "").toLowerCase() === "true";
2575
2575
  try {
2576
2576
  (A = S == null ? void 0 : S.onOpen) == null || A.call(S, { threadId: q, created: $ });
2577
2577
  } catch (Y) {
@@ -2580,12 +2580,12 @@ function Kg(e = {}) {
2580
2580
  } catch (G) {
2581
2581
  C && console.debug("[use-chat] failed to read headers:", G);
2582
2582
  }
2583
- const F = B.body.getReader(), Z = new TextDecoder();
2584
- let D = "", O = "";
2583
+ const F = L.body.getReader(), X = new TextDecoder();
2584
+ let D = "", M = "";
2585
2585
  for (; ; ) {
2586
2586
  const { value: G, done: Q } = await F.read();
2587
2587
  if (Q) break;
2588
- D += Z.decode(G, { stream: !0 });
2588
+ D += X.decode(G, { stream: !0 });
2589
2589
  let q;
2590
2590
  for (; (q = D.indexOf(`
2591
2591
 
@@ -2603,19 +2603,19 @@ function Kg(e = {}) {
2603
2603
  }
2604
2604
  const ce = Yg(ye) ? ye.data : ye;
2605
2605
  if (C && console.debug("[use-chat] event:", ce == null ? void 0 : ce.type, ce), ce.type === "token" && e.autoAppendAssistant !== !1)
2606
- O += ce.content;
2606
+ M += ce.content;
2607
2607
  else if (ce.type === "message_delta") {
2608
2608
  const K = ce.delta.filter((_) => _.type === "text").map((_) => _.text).join("");
2609
- K && e.autoAppendAssistant !== !1 && (O += K);
2609
+ K && e.autoAppendAssistant !== !1 && (M += K);
2610
2610
  } else
2611
- O && (h((K) => K + O), O = ""), E == null || E(ce), ce.type === "checkpoint" ? v(ce.checkpointId) : ce.type === "error" && u(ce.message);
2611
+ M && (h((K) => K + M), M = ""), E == null || E(ce), ce.type === "checkpoint" ? v(ce.checkpointId) : ce.type === "error" && u(ce.message);
2612
2612
  }
2613
2613
  }
2614
- O && h((G) => G + O);
2614
+ M && h((G) => G + M);
2615
2615
  } catch (I) {
2616
2616
  if ((I == null ? void 0 : I.name) === "AbortError") return;
2617
- const B = (I == null ? void 0 : I.message) || String(I);
2618
- C && console.debug("[use-chat] error:", B), u(B), (M = S == null ? void 0 : S.onError) == null || M.call(S, B);
2617
+ const L = (I == null ? void 0 : I.message) || String(I);
2618
+ C && console.debug("[use-chat] error:", L), u(L), (O = S == null ? void 0 : S.onError) == null || O.call(S, L);
2619
2619
  } finally {
2620
2620
  a(!1), x.current = null;
2621
2621
  }
@@ -2953,30 +2953,30 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2953
2953
  }), [g, p] = fe(() => typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
2954
2954
  Le(() => {
2955
2955
  x(typeof u.getAuthToken == "function" ? u.getAuthToken() : null);
2956
- const J = u.onTokenChange((ae) => {
2956
+ const Z = u.onTokenChange((ae) => {
2957
2957
  p(ae), x(ae);
2958
2958
  });
2959
2959
  return () => {
2960
- J();
2960
+ Z();
2961
2961
  };
2962
2962
  }, [u, x]);
2963
- const w = Ke((J) => {
2964
- u.setAuthToken(J);
2965
- }, [u]), { state: b, seed: y, prepend: E, pushUser: S, onEvent: T, reset: C } = Zg(), N = s && s > 0 ? s : 6, [j, P] = fe(!1), [H, A] = fe(!1), [M, I] = fe(null), [B, F] = fe(void 0), [Z, D] = fe(void 0), O = Ke(
2966
- (J, ae) => {
2967
- const $e = Array.isArray(J == null ? void 0 : J.messages) ? J.messages : [];
2963
+ const w = Ke((Z) => {
2964
+ u.setAuthToken(Z);
2965
+ }, [u]), { state: b, seed: y, prepend: E, pushUser: S, onEvent: T, reset: C } = Zg(), N = s && s > 0 ? s : 6, [j, P] = fe(!1), [H, A] = fe(!1), [O, I] = fe(null), [L, F] = fe(void 0), [X, D] = fe(void 0), M = Ke(
2966
+ (Z, ae) => {
2967
+ const $e = Array.isArray(Z == null ? void 0 : Z.messages) ? Z.messages : [];
2968
2968
  ae === "replace" ? y($e, {
2969
- checkpointId: (J == null ? void 0 : J.checkpointId) ?? null,
2970
- checkpointNs: (J == null ? void 0 : J.checkpointNs) ?? null
2971
- }) : ae === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), E($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), I((J == null ? void 0 : J.nextCursor) ?? null), P(!!(J != null && J.hasMore)), F((Ye) => (J == null ? void 0 : J.checkpointId) ?? Ye ?? void 0), D((Ye) => (J == null ? void 0 : J.checkpointNs) ?? Ye ?? void 0);
2969
+ checkpointId: (Z == null ? void 0 : Z.checkpointId) ?? null,
2970
+ checkpointNs: (Z == null ? void 0 : Z.checkpointNs) ?? null
2971
+ }) : ae === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), E($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), I((Z == null ? void 0 : Z.nextCursor) ?? null), P(!!(Z != null && Z.hasMore)), F((Ye) => (Z == null ? void 0 : Z.checkpointId) ?? Ye ?? void 0), D((Ye) => (Z == null ? void 0 : Z.checkpointNs) ?? Ye ?? void 0);
2972
2972
  },
2973
2973
  [y, E]
2974
2974
  ), [G, Q] = fe([]), [q, $] = fe(null), Y = Ke(async () => {
2975
- const J = await u.listThreads();
2976
- Q(J);
2975
+ const Z = await u.listThreads();
2976
+ Q(Z);
2977
2977
  }, [u]), [ye, ce] = fe(!1), K = Ke(
2978
- async (J) => {
2979
- const ae = (J == null ? void 0 : J.maxAttempts) ?? 5, $e = (J == null ? void 0 : J.baseDelayMs) ?? 500, Ye = (J == null ? void 0 : J.timeoutMs) ?? 2e3;
2978
+ async (Z) => {
2979
+ const ae = (Z == null ? void 0 : Z.maxAttempts) ?? 5, $e = (Z == null ? void 0 : Z.baseDelayMs) ?? 500, Ye = (Z == null ? void 0 : Z.timeoutMs) ?? 2e3;
2980
2980
  if (!u.baseUrl) return !1;
2981
2981
  const Ze = u.baseUrl.replace(/\/+$/, ""), wt = [
2982
2982
  "/health",
@@ -3017,7 +3017,7 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3017
3017
  [u.baseUrl]
3018
3018
  );
3019
3019
  Le(() => {
3020
- let J = !0;
3020
+ let Z = !0;
3021
3021
  if (!u.baseUrl) {
3022
3022
  console.debug("[ChatProvider] skipping initial refreshThreads: api.baseUrl not configured");
3023
3023
  return;
@@ -3025,13 +3025,13 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3025
3025
  return (async () => {
3026
3026
  try {
3027
3027
  const ae = await K();
3028
- if (!J) return;
3028
+ if (!Z) return;
3029
3029
  ae ? Y().catch(() => {
3030
3030
  }) : console.warn("[ChatProvider] backend health-check failed — skipping initial loads");
3031
3031
  } catch {
3032
3032
  }
3033
3033
  })(), () => {
3034
- J = !1;
3034
+ Z = !1;
3035
3035
  };
3036
3036
  }, [Y, u.baseUrl, K]), Le(() => {
3037
3037
  r == null || r(q);
@@ -3051,49 +3051,49 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3051
3051
  }));
3052
3052
  }
3053
3053
  }, [o, i, u.baseUrl, ye]);
3054
- const X = Be(null), te = Ke(
3055
- async (J, ae, $e) => {
3054
+ const J = Be(null), te = Ke(
3055
+ async (Z, ae, $e) => {
3056
3056
  if (!u.baseUrl) {
3057
3057
  console.debug("[ChatProvider] skipping loadThread: api.baseUrl not configured");
3058
3058
  return;
3059
3059
  }
3060
- if (X.current !== J) {
3061
- X.current = J;
3060
+ if (J.current !== Z) {
3061
+ J.current = Z;
3062
3062
  try {
3063
3063
  P(!1), I(null), F(void 0), D(void 0);
3064
3064
  const Ye = await u.getMessages({
3065
- threadId: J,
3065
+ threadId: Z,
3066
3066
  checkpointId: ae,
3067
3067
  checkpointNs: $e,
3068
3068
  limit: N
3069
3069
  });
3070
- $(J), O(Ye, "replace");
3070
+ $(Z), M(Ye, "replace");
3071
3071
  } finally {
3072
- X.current = null;
3072
+ J.current = null;
3073
3073
  }
3074
3074
  }
3075
3075
  },
3076
- [u, O]
3077
- ), ue = Ke(async (J) => {
3078
- const ae = await u.listCheckpoints(J);
3079
- return rx(ae, J);
3080
- }, [u]), se = Ke(async (J, ae) => {
3076
+ [u, M]
3077
+ ), ue = Ke(async (Z) => {
3078
+ const ae = await u.listCheckpoints(Z);
3079
+ return rx(ae, Z);
3080
+ }, [u]), se = Ke(async (Z, ae) => {
3081
3081
  if (!q) throw new Error("No active thread");
3082
3082
  P(!1), I(null), F(void 0), D(void 0);
3083
3083
  const $e = await u.getMessages({
3084
3084
  threadId: q,
3085
- checkpointId: J,
3085
+ checkpointId: Z,
3086
3086
  checkpointNs: ae ?? void 0,
3087
3087
  limit: N
3088
3088
  });
3089
- O($e, "replace");
3090
- }, [u, q, O, N]), ke = Ke(async () => {
3089
+ M($e, "replace");
3090
+ }, [u, q, M, N]), ke = Ke(async () => {
3091
3091
  if (!q) throw new Error("No active thread");
3092
3092
  await te(q);
3093
3093
  }, [q, te]), Pe = Be(!1);
3094
3094
  Le(() => {
3095
- const J = Pe.current;
3096
- Pe.current = d, J && !d && q && (async () => {
3095
+ const Z = Pe.current;
3096
+ Pe.current = d, Z && !d && q && (async () => {
3097
3097
  try {
3098
3098
  const ae = await u.getMessages({
3099
3099
  threadId: q,
@@ -3102,7 +3102,7 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3102
3102
  checkpointNs: void 0,
3103
3103
  limit: N
3104
3104
  });
3105
- O(ae, "replace");
3105
+ M(ae, "replace");
3106
3106
  } catch {
3107
3107
  }
3108
3108
  try {
@@ -3110,15 +3110,15 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3110
3110
  } catch {
3111
3111
  }
3112
3112
  })();
3113
- }, [d, q, b.lastCheckpointId, b.lastCheckpointNs, u, O, Y]);
3114
- const De = Ke(async (J) => {
3115
- const ae = await u.createThread(J);
3113
+ }, [d, q, b.lastCheckpointId, b.lastCheckpointNs, u, M, Y]);
3114
+ const De = Ke(async (Z) => {
3115
+ const ae = await u.createThread(Z);
3116
3116
  return await Y(), await te(ae.threadId), ae.threadId;
3117
- }, [u, Y, te]), de = Ke(async (J) => {
3118
- await u.deleteThread(J), await Y(), q === J && ($(null), C([]), P(!1), I(null), F(void 0), D(void 0));
3119
- }, [u, Y, q, C]), je = Ke(async (J, ae) => {
3120
- await u.updateThread(J, ae), await Y();
3121
- }, [u, Y]), xe = Ke(async (J, ae) => {
3117
+ }, [u, Y, te]), de = Ke(async (Z) => {
3118
+ await u.deleteThread(Z), await Y(), q === Z && ($(null), C([]), P(!1), I(null), F(void 0), D(void 0));
3119
+ }, [u, Y, q, C]), je = Ke(async (Z, ae) => {
3120
+ await u.updateThread(Z, ae), await Y();
3121
+ }, [u, Y]), xe = Ke(async (Z, ae) => {
3122
3122
  var Ln;
3123
3123
  const $e = (ae == null ? void 0 : ae.attachments) || [], { contentParts: Ye, filesInfo: Ze } = await ix(
3124
3124
  u,
@@ -3128,7 +3128,7 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3128
3128
  c,
3129
3129
  q
3130
3130
  ), wt = [];
3131
- J && wt.push({ type: "text", text: J });
3131
+ Z && wt.push({ type: "text", text: Z });
3132
3132
  for (const Ge of Ye) wt.push(Ge);
3133
3133
  const dt = {
3134
3134
  id: ((Ln = crypto.randomUUID) == null ? void 0 : Ln.call(crypto)) || `user-${Date.now()}`,
@@ -3170,27 +3170,27 @@ function mo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3170
3170
  }
3171
3171
  );
3172
3172
  }, [q, S, m, T, b.lastCheckpointId, b.lastCheckpointNs, u, t == null ? void 0 : t.uploadPath, Y, $, a, c]), Se = Ke(
3173
- async (J) => {
3173
+ async (Z) => {
3174
3174
  if (!q) throw new Error("No active thread");
3175
3175
  if (H || !j) return;
3176
- const ae = M;
3176
+ const ae = O;
3177
3177
  if (ae) {
3178
3178
  A(!0);
3179
3179
  try {
3180
3180
  const $e = await u.getMessages({
3181
3181
  threadId: q,
3182
- checkpointId: B,
3183
- checkpointNs: Z,
3184
- limit: (J == null ? void 0 : J.limit) ?? N,
3182
+ checkpointId: L,
3183
+ checkpointNs: X,
3184
+ limit: (Z == null ? void 0 : Z.limit) ?? N,
3185
3185
  beforeId: ae
3186
3186
  });
3187
- O($e, "prepend");
3187
+ M($e, "prepend");
3188
3188
  } finally {
3189
3189
  A(!1);
3190
3190
  }
3191
3191
  }
3192
3192
  },
3193
- [u, q, B, Z, M, j, H, O, N]
3193
+ [u, q, L, X, O, j, H, M, N]
3194
3194
  ), rt = {
3195
3195
  baseUrl: u.baseUrl,
3196
3196
  token: g,
@@ -3227,7 +3227,7 @@ function Vi() {
3227
3227
  if (!e) throw new Error("useChat must be used within ChatProvider");
3228
3228
  return e;
3229
3229
  }
3230
- function L(...e) {
3230
+ function B(...e) {
3231
3231
  return um(cm(e));
3232
3232
  }
3233
3233
  const ax = Hr(
@@ -3260,7 +3260,7 @@ const ax = Hr(
3260
3260
  return /* @__PURE__ */ l.jsx(
3261
3261
  i,
3262
3262
  {
3263
- className: L(ax({ variant: t, size: n, className: e })),
3263
+ className: B(ax({ variant: t, size: n, className: e })),
3264
3264
  ref: s,
3265
3265
  ...o
3266
3266
  }
@@ -3272,7 +3272,7 @@ const Xc = f.forwardRef(
3272
3272
  ({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
3273
3273
  "textarea",
3274
3274
  {
3275
- className: L(
3275
+ className: B(
3276
3276
  "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
3277
3277
  e
3278
3278
  ),
@@ -4213,32 +4213,32 @@ const _x = {
4213
4213
  const P = Ar(T.sizeTree, 0);
4214
4214
  let H = 0, A = 0;
4215
4215
  for (; H < S; ) {
4216
- const I = T.groupIndices[A], B = T.groupIndices.length === A + 1 ? 1 / 0 : T.groupIndices[A + 1] - I - 1;
4216
+ const I = T.groupIndices[A], L = T.groupIndices.length === A + 1 ? 1 / 0 : T.groupIndices[A + 1] - I - 1;
4217
4217
  N.push({
4218
4218
  endIndex: I,
4219
4219
  size: P,
4220
4220
  startIndex: I
4221
4221
  }), N.push({
4222
- endIndex: I + 1 + B - 1,
4222
+ endIndex: I + 1 + L - 1,
4223
4223
  size: j,
4224
4224
  startIndex: I + 1
4225
- }), A++, H += B + 1;
4225
+ }), A++, H += L + 1;
4226
4226
  }
4227
- const M = Cn(T.sizeTree);
4228
- return H !== S && M.shift(), M.reduce(
4229
- (I, { k: B, v: F }) => {
4230
- let Z = I.ranges;
4231
- return I.prevSize !== 0 && (Z = [
4227
+ const O = Cn(T.sizeTree);
4228
+ return H !== S && O.shift(), O.reduce(
4229
+ (I, { k: L, v: F }) => {
4230
+ let X = I.ranges;
4231
+ return I.prevSize !== 0 && (X = [
4232
4232
  ...I.ranges,
4233
4233
  {
4234
- endIndex: B + S - 1,
4234
+ endIndex: L + S - 1,
4235
4235
  size: I.prevSize,
4236
4236
  startIndex: I.prevIndex
4237
4237
  }
4238
4238
  ]), {
4239
- prevIndex: B + S,
4239
+ prevIndex: L + S,
4240
4240
  prevSize: F,
4241
- ranges: Z
4241
+ ranges: X
4242
4242
  };
4243
4243
  },
4244
4244
  {
@@ -4287,12 +4287,12 @@ const _x = {
4287
4287
  let P = 0, H = 0, A = 0;
4288
4288
  for (; P < -S; ) {
4289
4289
  A = j[H];
4290
- const M = j[H + 1] - A - 1;
4291
- H++, P += M + 1;
4290
+ const O = j[H + 1] - A - 1;
4291
+ H++, P += O + 1;
4292
4292
  }
4293
- if (N = Cn(T.sizeTree).reduce((M, { k: I, v: B }) => St(M, Math.max(0, I + S), B), N), P !== -S) {
4294
- const M = Ar(T.sizeTree, A);
4295
- N = St(N, 0, M);
4293
+ if (N = Cn(T.sizeTree).reduce((O, { k: I, v: L }) => St(O, Math.max(0, I + S), L), N), P !== -S) {
4294
+ const O = Ar(T.sizeTree, A);
4295
+ N = St(N, 0, O);
4296
4296
  const I = Ft(T.sizeTree, -S + 1)[1];
4297
4297
  N = St(N, 1, I);
4298
4298
  }
@@ -4422,16 +4422,16 @@ const Vr = Ae(
4422
4422
  ([
4423
4423
  [E, S, T, C, N, j, P, H],
4424
4424
  A,
4425
- M,
4425
+ O,
4426
4426
  I
4427
4427
  ]) => {
4428
- const B = du(E), { align: F, behavior: Z, offset: D } = B, O = C - 1, G = cu(B, S, O);
4428
+ const L = du(E), { align: F, behavior: X, offset: D } = L, M = C - 1, G = cu(L, S, M);
4429
4429
  let Q = Pr(G, S.offsetTree, A) + j;
4430
- F === "end" ? (Q += M + Ft(S.sizeTree, G)[1] - T + I, G === O && (Q += P)) : F === "center" ? Q += (M + Ft(S.sizeTree, G)[1] - T + I) / 2 : Q -= N, D && (Q += D);
4430
+ F === "end" ? (Q += O + Ft(S.sizeTree, G)[1] - T + I, G === M && (Q += P)) : F === "center" ? Q += (O + Ft(S.sizeTree, G)[1] - T + I) / 2 : Q -= N, D && (Q += D);
4431
4431
  const q = ($) => {
4432
4432
  y(), $ ? (H("retrying to scroll to", { location: E }, vt.DEBUG), we(v, E)) : (we(x, !0), H("list did not change, scroll successful", {}, vt.DEBUG));
4433
4433
  };
4434
- if (y(), Z === "smooth") {
4434
+ if (y(), X === "smooth") {
4435
4435
  let $ = !1;
4436
4436
  b = Me(t, (Y) => {
4437
4437
  $ = $ || Y;
@@ -4442,7 +4442,7 @@ const Vr = Ae(
4442
4442
  p = Dt(z(t, Dx(150)), q);
4443
4443
  return w = setTimeout(() => {
4444
4444
  y();
4445
- }, 1200), we(c, !0), H("scrolling from index to", { behavior: Z, index: G, top: Q }, vt.DEBUG), { behavior: Z, top: Q };
4445
+ }, 1200), we(c, !0), H("scrolling from index to", { behavior: X, index: G, top: Q }, vt.DEBUG), { behavior: X, top: Q };
4446
4446
  }
4447
4447
  )
4448
4448
  ),
@@ -4560,11 +4560,11 @@ const _r = "up", Cr = "down", Lx = "none", Fx = {
4560
4560
  viewportHeight: S
4561
4561
  };
4562
4562
  if (j) {
4563
- let A, M;
4564
- return E > b.state.scrollTop ? (A = "SCROLLED_DOWN", M = b.state.scrollTop - E) : (A = "SIZE_DECREASED", M = b.state.scrollTop - E || b.scrollTopDelta), {
4563
+ let A, O;
4564
+ return E > b.state.scrollTop ? (A = "SCROLLED_DOWN", O = b.state.scrollTop - E) : (A = "SIZE_DECREASED", O = b.state.scrollTop - E || b.scrollTopDelta), {
4565
4565
  atBottom: !0,
4566
4566
  atBottomBecause: A,
4567
- scrollTopDelta: M,
4567
+ scrollTopDelta: O,
4568
4568
  state: P
4569
4569
  };
4570
4570
  }
@@ -4851,56 +4851,56 @@ const On = Ae(
4851
4851
  P,
4852
4852
  H,
4853
4853
  A,
4854
- M,
4854
+ O,
4855
4855
  I,
4856
- B
4856
+ L
4857
4857
  ]) => {
4858
- const F = j, { offsetTree: Z, sizeTree: D } = F, O = Xe(p);
4858
+ const F = j, { offsetTree: X, sizeTree: D } = F, M = Xe(p);
4859
4859
  if (N === 0)
4860
4860
  return { ...Bs, totalCount: N };
4861
4861
  if (T === 0 && C === 0)
4862
- return O === 0 ? { ...Bs, totalCount: N } : hu(O, P, j, M, I, B || []);
4862
+ return M === 0 ? { ...Bs, totalCount: N } : hu(M, P, j, O, I, L || []);
4863
4863
  if (He(D))
4864
- return O > 0 ? null : xo(
4865
- Hx(Zi(P, N), F, B),
4864
+ return M > 0 ? null : xo(
4865
+ Hx(Zi(P, N), F, L),
4866
4866
  [],
4867
4867
  N,
4868
4868
  I,
4869
4869
  F,
4870
- M
4870
+ O
4871
4871
  );
4872
4872
  const G = [];
4873
4873
  if (A.length > 0) {
4874
4874
  const ye = A[0], ce = A[A.length - 1];
4875
4875
  let K = 0;
4876
4876
  for (const _ of ns(D, ye, ce)) {
4877
- const X = _.value, te = Math.max(_.start, ye), ue = Math.min(_.end, ce);
4877
+ const J = _.value, te = Math.max(_.start, ye), ue = Math.min(_.end, ce);
4878
4878
  for (let se = te; se <= ue; se++)
4879
- G.push({ data: B == null ? void 0 : B[se], index: se, offset: K, size: X }), K += X;
4879
+ G.push({ data: L == null ? void 0 : L[se], index: se, offset: K, size: J }), K += J;
4880
4880
  }
4881
4881
  }
4882
4882
  if (!H)
4883
- return xo([], G, N, I, F, M);
4884
- const Q = A.length > 0 ? A[A.length - 1] + 1 : 0, q = Ix(Z, T, C, Q);
4883
+ return xo([], G, N, I, F, O);
4884
+ const Q = A.length > 0 ? A[A.length - 1] + 1 : 0, q = Ix(X, T, C, Q);
4885
4885
  if (q.length === 0)
4886
4886
  return null;
4887
4887
  const $ = N - 1, Y = ts([], (ye) => {
4888
4888
  for (const ce of q) {
4889
4889
  const K = ce.value;
4890
- let _ = K.offset, X = ce.start;
4890
+ let _ = K.offset, J = ce.start;
4891
4891
  const te = K.size;
4892
4892
  if (K.offset < T) {
4893
- X += Math.floor((T - K.offset + I) / (te + I));
4894
- const se = X - ce.start;
4893
+ J += Math.floor((T - K.offset + I) / (te + I));
4894
+ const se = J - ce.start;
4895
4895
  _ += se * te + se * I;
4896
4896
  }
4897
- X < Q && (_ += (Q - X) * te, X = Q);
4897
+ J < Q && (_ += (Q - J) * te, J = Q);
4898
4898
  const ue = Math.min(ce.end, $);
4899
- for (let se = X; se <= ue && !(_ >= C); se++)
4900
- ye.push({ data: B == null ? void 0 : B[se], index: se, offset: _, size: te }), _ += te + I;
4899
+ for (let se = J; se <= ue && !(_ >= C); se++)
4900
+ ye.push({ data: L == null ? void 0 : L[se], index: se, offset: _, size: te }), _ += te + I;
4901
4901
  }
4902
4902
  });
4903
- return xo(Y, G, N, I, F, M);
4903
+ return xo(Y, G, N, I, F, O);
4904
4904
  }
4905
4905
  ),
4906
4906
  //@ts-expect-error filter needs to be fixed
@@ -5034,17 +5034,17 @@ const On = Ae(
5034
5034
  Ce(t, c, n, s, o, r, a),
5035
5035
  Ce(e),
5036
5036
  re(([[h, m, v, x, g, p, w, b], y]) => {
5037
- const { align: E, behavior: S, calculateViewLocation: T = zx, done: C, ...N } = h, j = cu(h, m, x - 1), P = Pr(j, m.offsetTree, y) + g + p, H = P + Ft(m.sizeTree, j)[1], A = b + p, M = b + v - w, I = T({
5037
+ const { align: E, behavior: S, calculateViewLocation: T = zx, done: C, ...N } = h, j = cu(h, m, x - 1), P = Pr(j, m.offsetTree, y) + g + p, H = P + Ft(m.sizeTree, j)[1], A = b + p, O = b + v - w, I = T({
5038
5038
  itemBottom: H,
5039
5039
  itemTop: P,
5040
5040
  locationParams: { align: E, behavior: S, ...N },
5041
- viewportBottom: M,
5041
+ viewportBottom: O,
5042
5042
  viewportTop: A
5043
5043
  });
5044
5044
  return I ? C && Dt(
5045
5045
  z(
5046
5046
  i,
5047
- pe((B) => !B),
5047
+ pe((L) => !L),
5048
5048
  // skips the initial publish of false, and the cleanup call.
5049
5049
  // but if scrollingInProgress is true, we skip the initial publish.
5050
5050
  In(Xe(i) ? 1 : 2)
@@ -5719,7 +5719,7 @@ const tv = /* @__PURE__ */ Ae(() => {
5719
5719
  ra("deviation", (I) => {
5720
5720
  w !== I && b(I);
5721
5721
  });
5722
- const y = ve("EmptyPlaceholder"), E = ve("ScrollSeekPlaceholder") || rv, S = ve("ListComponent"), T = ve("ItemComponent"), C = ve("GroupComponent"), N = ve("computeItemKey"), j = ve("isSeeking"), P = ve("groupIndices").length > 0, H = ve("alignToBottom"), A = ve("initialItemFinalLocationReached"), M = e ? {} : {
5722
+ const y = ve("EmptyPlaceholder"), E = ve("ScrollSeekPlaceholder") || rv, S = ve("ListComponent"), T = ve("ItemComponent"), C = ve("GroupComponent"), N = ve("computeItemKey"), j = ve("isSeeking"), P = ve("groupIndices").length > 0, H = ve("alignToBottom"), A = ve("initialItemFinalLocationReached"), O = e ? {} : {
5723
5723
  boxSizing: "border-box",
5724
5724
  ...g ? {
5725
5725
  display: "inline-block",
@@ -5741,9 +5741,9 @@ const tv = /* @__PURE__ */ Ae(() => {
5741
5741
  ...ct(S, u),
5742
5742
  "data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
5743
5743
  ref: p,
5744
- style: M,
5744
+ style: O,
5745
5745
  children: (e ? t.topItems : t.items).map((I) => {
5746
- const B = I.originalIndex, F = N(B + t.firstItemIndex, I.data, u);
5746
+ const L = I.originalIndex, F = N(L + t.firstItemIndex, I.data, u);
5747
5747
  return j ? /* @__PURE__ */ uo(
5748
5748
  E,
5749
5749
  {
@@ -5758,7 +5758,7 @@ const tv = /* @__PURE__ */ Ae(() => {
5758
5758
  C,
5759
5759
  {
5760
5760
  ...ct(C, u),
5761
- "data-index": B,
5761
+ "data-index": L,
5762
5762
  "data-item-index": I.index,
5763
5763
  "data-known-size": I.size,
5764
5764
  key: F,
@@ -5770,7 +5770,7 @@ const tv = /* @__PURE__ */ Ae(() => {
5770
5770
  {
5771
5771
  ...ct(T, u),
5772
5772
  ...cv(T, I.data),
5773
- "data-index": B,
5773
+ "data-index": L,
5774
5774
  "data-item-group-index": I.groupIndex,
5775
5775
  "data-item-index": I.index,
5776
5776
  "data-known-size": I.size,
@@ -6062,20 +6062,20 @@ const Tv = /* @__PURE__ */ Ae(
6062
6062
  { customScrollParent: p, useWindowScroll: w, windowScrollContainerState: b, windowScrollTo: y, windowViewportRect: E },
6063
6063
  S
6064
6064
  ]) => {
6065
- const T = W(0), C = W(0), N = W(kl), j = W({ height: 0, width: 0 }), P = W({ height: 0, width: 0 }), H = Ee(), A = Ee(), M = W(0), I = W(null), B = W({ column: 0, row: 0 }), F = Ee(), Z = Ee(), D = W(!1), O = W(0), G = W(!0), Q = W(!1), q = W(!1);
6065
+ const T = W(0), C = W(0), N = W(kl), j = W({ height: 0, width: 0 }), P = W({ height: 0, width: 0 }), H = Ee(), A = Ee(), O = W(0), I = W(null), L = W({ column: 0, row: 0 }), F = Ee(), X = Ee(), D = W(!1), M = W(0), G = W(!0), Q = W(!1), q = W(!1);
6066
6066
  Me(
6067
6067
  z(
6068
6068
  x,
6069
- Ce(O),
6070
- pe(([_, X]) => !!X)
6069
+ Ce(M),
6070
+ pe(([_, J]) => !!J)
6071
6071
  ),
6072
6072
  () => {
6073
6073
  we(G, !1);
6074
6074
  }
6075
6075
  ), Me(
6076
6076
  z(
6077
- nt(x, G, P, j, O, Q),
6078
- pe(([_, X, te, ue, , se]) => _ && !X && te.height !== 0 && ue.height !== 0 && !se)
6077
+ nt(x, G, P, j, M, Q),
6078
+ pe(([_, J, te, ue, , se]) => _ && !J && te.height !== 0 && ue.height !== 0 && !se)
6079
6079
  ),
6080
6080
  ([, , , , _]) => {
6081
6081
  we(Q, !0), Ji(1, () => {
@@ -6086,7 +6086,7 @@ const Tv = /* @__PURE__ */ Ae(
6086
6086
  }
6087
6087
  ), le(
6088
6088
  z(
6089
- Z,
6089
+ X,
6090
6090
  pe((_) => _ != null && _.scrollTop > 0),
6091
6091
  Gt(0)
6092
6092
  ),
@@ -6094,11 +6094,11 @@ const Tv = /* @__PURE__ */ Ae(
6094
6094
  ), Me(
6095
6095
  z(
6096
6096
  x,
6097
- Ce(Z),
6097
+ Ce(X),
6098
6098
  pe(([, _]) => _ != null)
6099
6099
  ),
6100
6100
  ([, _]) => {
6101
- _ && (we(j, _.viewport), we(P, _.item), we(B, _.gap), _.scrollTop > 0 && (we(D, !0), Dt(z(u, In(1)), (X) => {
6101
+ _ && (we(j, _.viewport), we(P, _.item), we(L, _.gap), _.scrollTop > 0 && (we(D, !0), Dt(z(u, In(1)), (J) => {
6102
6102
  we(D, !1);
6103
6103
  }), we(c, { top: _.scrollTop })));
6104
6104
  }
@@ -6113,12 +6113,12 @@ const Tv = /* @__PURE__ */ Ae(
6113
6113
  nt(
6114
6114
  he(j, no),
6115
6115
  he(P, no),
6116
- he(B, (_, X) => _ && _.column === X.column && _.row === X.row),
6116
+ he(L, (_, J) => _ && _.column === J.column && _.row === J.row),
6117
6117
  he(u)
6118
6118
  ),
6119
- re(([_, X, te, ue]) => ({
6119
+ re(([_, J, te, ue]) => ({
6120
6120
  gap: te,
6121
- item: X,
6121
+ item: J,
6122
6122
  scrollTop: ue,
6123
6123
  viewport: _
6124
6124
  }))
@@ -6129,20 +6129,20 @@ const Tv = /* @__PURE__ */ Ae(
6129
6129
  nt(
6130
6130
  he(T),
6131
6131
  r,
6132
- he(B, Cv),
6132
+ he(L, Cv),
6133
6133
  he(P, no),
6134
6134
  he(j, no),
6135
6135
  he(I),
6136
6136
  he(C),
6137
6137
  he(D),
6138
6138
  he(G),
6139
- he(O)
6139
+ he(M)
6140
6140
  ),
6141
6141
  pe(([, , , , , , , _]) => !_),
6142
6142
  re(
6143
6143
  ([
6144
6144
  _,
6145
- [X, te],
6145
+ [J, te],
6146
6146
  ue,
6147
6147
  se,
6148
6148
  ke,
@@ -6152,18 +6152,18 @@ const Tv = /* @__PURE__ */ Ae(
6152
6152
  de,
6153
6153
  je
6154
6154
  ]) => {
6155
- const { column: xe, row: Se } = ue, { height: rt, width: J } = se, { width: ae } = ke;
6155
+ const { column: xe, row: Se } = ue, { height: rt, width: Z } = se, { width: ae } = ke;
6156
6156
  if (De === 0 && (_ === 0 || ae === 0))
6157
6157
  return kl;
6158
- if (J === 0) {
6158
+ if (Z === 0) {
6159
6159
  const et = Zi(je, _), ft = et + Math.max(De - 1, 0);
6160
6160
  return Sv(Ol(et, ft, Pe));
6161
6161
  }
6162
- const $e = Iu(ae, J, xe);
6162
+ const $e = Iu(ae, Z, xe);
6163
6163
  let Ye, Ze;
6164
- de ? X === 0 && te === 0 && De > 0 ? (Ye = 0, Ze = De - 1) : (Ye = $e * Do((X + Se) / (rt + Se)), Ze = $e * Pl((te + Se) / (rt + Se)) - 1, Ze = zs(_ - 1, Tr(Ze, $e - 1)), Ye = zs(Ze, Tr(0, Ye))) : (Ye = 0, Ze = -1);
6164
+ de ? J === 0 && te === 0 && De > 0 ? (Ye = 0, Ze = De - 1) : (Ye = $e * Do((J + Se) / (rt + Se)), Ze = $e * Pl((te + Se) / (rt + Se)) - 1, Ze = zs(_ - 1, Tr(Ze, $e - 1)), Ye = zs(Ze, Tr(0, Ye))) : (Ye = 0, Ze = -1);
6165
6165
  const wt = Ol(Ye, Ze, Pe), { bottom: dt, top: Rt } = Ml(ke, ue, se, wt), Qe = Pl(_ / $e), at = Qe * rt + (Qe - 1) * Se - dt;
6166
- return { bottom: dt, itemHeight: rt, items: wt, itemWidth: J, offsetBottom: at, offsetTop: Rt, top: Rt };
6166
+ return { bottom: dt, itemHeight: rt, items: wt, itemWidth: Z, offsetBottom: at, offsetTop: Rt, top: Rt };
6167
6167
  }
6168
6168
  )
6169
6169
  ),
@@ -6177,10 +6177,10 @@ const Tv = /* @__PURE__ */ Ae(
6177
6177
  T
6178
6178
  ), le(
6179
6179
  z(
6180
- nt(j, P, N, B),
6181
- pe(([_, X, { items: te }]) => te.length > 0 && X.height !== 0 && _.height !== 0),
6182
- re(([_, X, { items: te }, ue]) => {
6183
- const { bottom: se, top: ke } = Ml(_, ue, X, te);
6180
+ nt(j, P, N, L),
6181
+ pe(([_, J, { items: te }]) => te.length > 0 && J.height !== 0 && _.height !== 0),
6182
+ re(([_, J, { items: te }, ue]) => {
6183
+ const { bottom: se, top: ke } = Ml(_, ue, J, te);
6184
6184
  return [ke, se];
6185
6185
  }),
6186
6186
  ze(kr)
@@ -6192,7 +6192,7 @@ const Tv = /* @__PURE__ */ Ae(
6192
6192
  z(
6193
6193
  u,
6194
6194
  Ce($),
6195
- re(([_, X]) => X || _ !== 0)
6195
+ re(([_, J]) => J || _ !== 0)
6196
6196
  ),
6197
6197
  $
6198
6198
  );
@@ -6201,9 +6201,9 @@ const Tv = /* @__PURE__ */ Ae(
6201
6201
  nt(N, T),
6202
6202
  pe(([{ items: _ }]) => _.length > 0),
6203
6203
  Ce($),
6204
- pe(([[_, X], te]) => {
6205
- const ue = _.items[_.items.length - 1].index === X - 1;
6206
- return (te || _.bottom > 0 && _.itemHeight > 0 && _.offsetBottom === 0 && _.items.length === X) && ue;
6204
+ pe(([[_, J], te]) => {
6205
+ const ue = _.items[_.items.length - 1].index === J - 1;
6206
+ return (te || _.bottom > 0 && _.itemHeight > 0 && _.offsetBottom === 0 && _.items.length === J) && ue;
6207
6207
  }),
6208
6208
  re(([[, _]]) => _ - 1),
6209
6209
  ze()
@@ -6219,7 +6219,7 @@ const Tv = /* @__PURE__ */ Ae(
6219
6219
  z(
6220
6220
  he(N),
6221
6221
  Ce(D),
6222
- pe(([{ items: _ }, X]) => _.length > 0 && !X),
6222
+ pe(([{ items: _ }, J]) => _.length > 0 && !J),
6223
6223
  re(([{ items: _ }]) => ({
6224
6224
  endIndex: _[_.length - 1].index,
6225
6225
  startIndex: _[0].index
@@ -6231,13 +6231,13 @@ const Tv = /* @__PURE__ */ Ae(
6231
6231
  le(ce, v.scrollSeekRangeChanged), le(
6232
6232
  z(
6233
6233
  H,
6234
- Ce(j, P, T, B),
6235
- re(([_, X, te, ue, se]) => {
6234
+ Ce(j, P, T, L),
6235
+ re(([_, J, te, ue, se]) => {
6236
6236
  const ke = du(_), { align: Pe, behavior: De, offset: de } = ke;
6237
6237
  let je = ke.index;
6238
6238
  je === "LAST" && (je = ue - 1), je = Tr(0, je, zs(ue - 1, je));
6239
- let xe = wi(X, se, te, je);
6240
- return Pe === "end" ? xe = _l(xe - X.height + te.height) : Pe === "center" && (xe = _l(xe - X.height / 2 + te.height / 2)), de && (xe += de), { behavior: De, top: xe };
6239
+ let xe = wi(J, se, te, je);
6240
+ return Pe === "end" ? xe = _l(xe - J.height + te.height) : Pe === "center" && (xe = _l(xe - J.height / 2 + te.height / 2)), de && (xe += de), { behavior: De, top: xe };
6241
6241
  })
6242
6242
  ),
6243
6243
  c
@@ -6259,15 +6259,15 @@ const Tv = /* @__PURE__ */ Ae(
6259
6259
  customScrollParent: p,
6260
6260
  // input
6261
6261
  data: I,
6262
- deviation: M,
6262
+ deviation: O,
6263
6263
  footerHeight: o,
6264
- gap: B,
6264
+ gap: L,
6265
6265
  headerHeight: s,
6266
6266
  increaseViewportBy: e,
6267
6267
  initialItemCount: C,
6268
6268
  itemDimensions: P,
6269
6269
  overscan: n,
6270
- restoreStateFrom: Z,
6270
+ restoreStateFrom: X,
6271
6271
  scrollBy: i,
6272
6272
  scrollContainerState: a,
6273
6273
  scrollHeight: A,
@@ -6285,7 +6285,7 @@ const Tv = /* @__PURE__ */ Ae(
6285
6285
  // output
6286
6286
  gridState: N,
6287
6287
  horizontalDirection: q,
6288
- initialTopMostItemIndex: O,
6288
+ initialTopMostItemIndex: M,
6289
6289
  totalListHeight: K,
6290
6290
  ...m,
6291
6291
  endReached: Y,
@@ -6514,7 +6514,7 @@ const Mv = Hr(
6514
6514
  }
6515
6515
  );
6516
6516
  function Au({ className: e, variant: t, ...n }) {
6517
- return /* @__PURE__ */ l.jsx("div", { className: L(Mv({ variant: t }), e), ...n });
6517
+ return /* @__PURE__ */ l.jsx("div", { className: B(Mv({ variant: t }), e), ...n });
6518
6518
  }
6519
6519
  function ee(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
6520
6520
  return function(o) {
@@ -7148,7 +7148,7 @@ function Ws({
7148
7148
  return x.forEach((y) => b.observe(y)), () => {
7149
7149
  p = !0, b.disconnect();
7150
7150
  };
7151
- }, [c]), c ? /* @__PURE__ */ l.jsx("div", { ref: m, className: L("markdown prose max-w-none break-words dark:prose-invert", t), dangerouslySetInnerHTML: { __html: c } }) : r && o ? null : /* @__PURE__ */ l.jsx("div", { className: L("markdown prose max-w-none break-words dark:prose-invert", t), children: n });
7151
+ }, [c]), c ? /* @__PURE__ */ l.jsx("div", { ref: m, className: B("markdown prose max-w-none break-words dark:prose-invert", t), dangerouslySetInnerHTML: { __html: c } }) : r && o ? null : /* @__PURE__ */ l.jsx("div", { className: B("markdown prose max-w-none break-words dark:prose-invert", t), children: n });
7152
7152
  }
7153
7153
  async function Lu(e, t) {
7154
7154
  return await Ot(e, {
@@ -8302,7 +8302,7 @@ const Tw = dd, Rw = fd, pd = f.forwardRef(({ className: e, ...t }, n) => /* @__P
8302
8302
  fs,
8303
8303
  {
8304
8304
  ref: n,
8305
- className: L(
8305
+ className: B(
8306
8306
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
8307
8307
  e
8308
8308
  ),
@@ -8332,7 +8332,7 @@ const md = f.forwardRef(({ className: e, children: t, ...n }, r) => {
8332
8332
  hs,
8333
8333
  {
8334
8334
  ref: r,
8335
- className: L(
8335
+ className: B(
8336
8336
  "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
8337
8337
  e
8338
8338
  ),
@@ -8356,7 +8356,7 @@ const gd = ({
8356
8356
  }) => /* @__PURE__ */ l.jsx(
8357
8357
  "div",
8358
8358
  {
8359
- className: L(
8359
+ className: B(
8360
8360
  "flex flex-col space-y-1.5 text-center sm:text-left",
8361
8361
  e
8362
8362
  ),
@@ -8368,7 +8368,7 @@ const xd = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
8368
8368
  Rn,
8369
8369
  {
8370
8370
  ref: n,
8371
- className: L(
8371
+ className: B(
8372
8372
  "text-lg font-semibold leading-none tracking-tight",
8373
8373
  e
8374
8374
  ),
@@ -8380,7 +8380,7 @@ const Ew = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
8380
8380
  ps,
8381
8381
  {
8382
8382
  ref: n,
8383
- className: L("text-sm text-muted-foreground", e),
8383
+ className: B("text-sm text-muted-foreground", e),
8384
8384
  ...t
8385
8385
  }
8386
8386
  ));
@@ -8503,7 +8503,7 @@ function Iw({ className: e }) {
8503
8503
  "span",
8504
8504
  {
8505
8505
  "aria-live": "polite",
8506
- className: L("inline-block text-xs opacity-70 ml-1", e),
8506
+ className: B("inline-block text-xs opacity-70 ml-1", e),
8507
8507
  children: [
8508
8508
  "Is thinking",
8509
8509
  ".".repeat(t)
@@ -8533,8 +8533,8 @@ const jw = V.memo(function({
8533
8533
  }) {
8534
8534
  const [y, E] = fe(!1), [S, T] = fe(!1), [C, N] = fe(!1), [j, P] = fe(!1), { currentThreadId: H } = Vi();
8535
8535
  ca();
8536
- const [A, M] = fe({}), [I, B] = fe(!1), [F, Z] = fe(null), D = u === "phone" || u === "half-screen", O = t.role, G = O === "tool", Q = V.useMemo(() => {
8537
- switch (O) {
8536
+ const [A, O] = fe({}), [I, L] = fe(!1), [F, X] = fe(null), D = u === "phone" || u === "half-screen", M = t.role, G = M === "tool", Q = V.useMemo(() => {
8537
+ switch (M) {
8538
8538
  case "user":
8539
8539
  return "text-[hsl(var(--chat-bubble-user-text))]";
8540
8540
  case "assistant":
@@ -8546,7 +8546,7 @@ const jw = V.memo(function({
8546
8546
  default:
8547
8547
  return "text-[hsl(var(--chat-bubble-ai-text))]";
8548
8548
  }
8549
- }, [O]), q = un(() => Aw(t.content), [t.content]), $ = un(() => Mw(t.content), [t.content]), Y = un(() => t.content.filter((de) => de.type === "image_url"), [t.content]), ye = un(() => t.content.filter((de) => de.type === "file"), [t.content]), ce = Lw(q, r), K = async () => {
8549
+ }, [M]), q = un(() => Aw(t.content), [t.content]), $ = un(() => Mw(t.content), [t.content]), Y = un(() => t.content.filter((de) => de.type === "image_url"), [t.content]), ye = un(() => t.content.filter((de) => de.type === "file"), [t.content]), ce = Lw(q, r), K = async () => {
8550
8550
  try {
8551
8551
  const de = G ? Un(t.content) : q;
8552
8552
  await navigator.clipboard.writeText(de), E(!0), setTimeout(() => E(!1), 2e3), b == null || b(de);
@@ -8557,9 +8557,9 @@ const jw = V.memo(function({
8557
8557
  if (!g) return;
8558
8558
  const de = G ? Un(t.content) : q;
8559
8559
  g(t.id, de);
8560
- }, X = () => p == null ? void 0 : p(n), te = () => {
8561
- const je = L(D ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Q);
8562
- switch (O) {
8560
+ }, J = () => p == null ? void 0 : p(n), te = () => {
8561
+ const je = B(D ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", Q);
8562
+ switch (M) {
8563
8563
  case "user":
8564
8564
  return /* @__PURE__ */ l.jsx(Wp, { className: je });
8565
8565
  case "assistant":
@@ -8571,42 +8571,42 @@ const jw = V.memo(function({
8571
8571
  }
8572
8572
  }, ue = () => {
8573
8573
  const de = "group relative mb-4 flex w-full";
8574
- switch (O) {
8574
+ switch (M) {
8575
8575
  case "user":
8576
- return L(de, "justify-end");
8576
+ return B(de, "justify-end");
8577
8577
  case "assistant":
8578
8578
  case "tool":
8579
8579
  case "system":
8580
- return L(de, "justify-start");
8580
+ return B(de, "justify-start");
8581
8581
  default:
8582
8582
  return de;
8583
8583
  }
8584
8584
  }, se = () => {
8585
- const de = L(
8585
+ const de = B(
8586
8586
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
8587
8587
  D && "px-3 py-2 text-sm"
8588
8588
  );
8589
- switch (O) {
8589
+ switch (M) {
8590
8590
  case "user":
8591
- return L(
8591
+ return B(
8592
8592
  de,
8593
8593
  "w-full md:max-w-[95%]",
8594
8594
  "bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
8595
8595
  "border border-transparent"
8596
8596
  );
8597
8597
  case "assistant":
8598
- return L(
8598
+ return B(
8599
8599
  de,
8600
8600
  "w-full md:max-w-[95%]",
8601
8601
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
8602
8602
  "border border-border/60 dark:border-border/40"
8603
8603
  );
8604
8604
  case "tool":
8605
- return L(de, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
8605
+ return B(de, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
8606
8606
  case "system":
8607
- return L(de, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
8607
+ return B(de, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
8608
8608
  default:
8609
- return L(
8609
+ return B(
8610
8610
  de,
8611
8611
  "w-full md:max-w-[95%]",
8612
8612
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
@@ -8627,12 +8627,12 @@ const jw = V.memo(function({
8627
8627
  return /* @__PURE__ */ l.jsx(Fw, { data: Se });
8628
8628
  }
8629
8629
  if (G && $.name === "get_issues") {
8630
- const xe = t.content.find((J) => J.type === "tool_result"), Se = (xe == null ? void 0 : xe.output) ?? Un(t.content), rt = bd(Se);
8630
+ const xe = t.content.find((Z) => Z.type === "tool_result"), Se = (xe == null ? void 0 : xe.output) ?? Un(t.content), rt = bd(Se);
8631
8631
  if (rt) return /* @__PURE__ */ l.jsx(Bw, { issues: rt });
8632
8632
  }
8633
8633
  if (G && !C) {
8634
8634
  const xe = Un(t.content).slice(0, 80).replace(/\s+/g, " ");
8635
- return /* @__PURE__ */ l.jsx("div", { className: L("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", D && "text-[10px]"), children: /* @__PURE__ */ l.jsxs("span", { className: "truncate max-w-full text-current", children: [
8635
+ return /* @__PURE__ */ l.jsx("div", { className: B("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", D && "text-[10px]"), children: /* @__PURE__ */ l.jsxs("span", { className: "truncate max-w-full text-current", children: [
8636
8636
  xe,
8637
8637
  xe.length >= 80 ? "…" : ""
8638
8638
  ] }) });
@@ -8640,7 +8640,7 @@ const jw = V.memo(function({
8640
8640
  if (G && d) {
8641
8641
  const xe = Un(t.content), Se = xe.length > h;
8642
8642
  return /* @__PURE__ */ l.jsx(Fl, { open: S, onOpenChange: T, children: /* @__PURE__ */ l.jsxs("div", { className: "font-mono text-sm text-current", children: [
8643
- /* @__PURE__ */ l.jsx("pre", { className: L("whitespace-pre-wrap break-words text-current", D && "text-xs"), children: Se && !S ? xe.substring(0, h) + "..." : xe }),
8643
+ /* @__PURE__ */ l.jsx("pre", { className: B("whitespace-pre-wrap break-words text-current", D && "text-xs"), children: Se && !S ? xe.substring(0, h) + "..." : xe }),
8644
8644
  Se && /* @__PURE__ */ l.jsx(Bl, { asChild: !0, children: /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: S ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
8645
8645
  /* @__PURE__ */ l.jsx(wr, { className: "h-3 w-3 mr-1" }),
8646
8646
  "Show less"
@@ -8657,9 +8657,9 @@ const jw = V.memo(function({
8657
8657
  if (xe && kw(xe))
8658
8658
  return /* @__PURE__ */ l.jsx(Ws, { content: xe.trim(), hideFallbackDuringStreaming: !0 });
8659
8659
  const Se = Un(t.content);
8660
- return /* @__PURE__ */ l.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ l.jsx("pre", { className: L("whitespace-pre-wrap break-words text-current", D && "text-xs"), children: Se }) });
8660
+ return /* @__PURE__ */ l.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ l.jsx("pre", { className: B("whitespace-pre-wrap break-words text-current", D && "text-xs"), children: Se }) });
8661
8661
  }
8662
- const de = Y.length > 0 && O !== "tool", je = ye.length > 0 && O !== "tool" && !1;
8662
+ const de = Y.length > 0 && M !== "tool", je = ye.length > 0 && M !== "tool" && !1;
8663
8663
  return /* @__PURE__ */ l.jsxs("div", { children: [
8664
8664
  r ? (
8665
8665
  // Streaming container: reserve space and show a skeleton until we have text,
@@ -8667,7 +8667,7 @@ const jw = V.memo(function({
8667
8667
  /* @__PURE__ */ l.jsxs(
8668
8668
  "div",
8669
8669
  {
8670
- className: L(
8670
+ className: B(
8671
8671
  "relative transition-all duration-200 ease-out",
8672
8672
  D ? "text-xs" : "text-sm"
8673
8673
  ),
@@ -8687,7 +8687,7 @@ const jw = V.memo(function({
8687
8687
  ] }) }) : /* @__PURE__ */ l.jsx(
8688
8688
  "pre",
8689
8689
  {
8690
- className: L(
8690
+ className: B(
8691
8691
  "whitespace-pre-wrap break-words font-sans leading-relaxed transition-opacity duration-200",
8692
8692
  D && "text-xs"
8693
8693
  ),
@@ -8695,18 +8695,18 @@ const jw = V.memo(function({
8695
8695
  }
8696
8696
  ) });
8697
8697
  })(),
8698
- /* @__PURE__ */ l.jsx("div", { className: "mt-2", children: /* @__PURE__ */ l.jsx(Iw, { className: L(Q, D ? "text-xs" : "text-sm") }) })
8698
+ /* @__PURE__ */ l.jsx("div", { className: "mt-2", children: /* @__PURE__ */ l.jsx(Iw, { className: B(Q, D ? "text-xs" : "text-sm") }) })
8699
8699
  ]
8700
8700
  }
8701
8701
  )
8702
8702
  ) : (() => {
8703
8703
  const xe = ei(q.trim());
8704
8704
  if (xe !== null) return /* @__PURE__ */ l.jsx(nc, { data: xe });
8705
- if (O === "user" && m) {
8705
+ if (M === "user" && m) {
8706
8706
  const Se = q.trim();
8707
8707
  if (Se.length > v)
8708
8708
  return /* @__PURE__ */ l.jsxs(Fl, { open: j, onOpenChange: P, children: [
8709
- /* @__PURE__ */ l.jsx("div", { className: L("text-sm text-[hsl(var(--chat-bubble-user-text))]", D && "text-xs"), children: j ? /* @__PURE__ */ l.jsx(Ws, { content: Se, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ l.jsxs("pre", { className: L("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", D && "text-xs"), children: [
8709
+ /* @__PURE__ */ l.jsx("div", { className: B("text-sm text-[hsl(var(--chat-bubble-user-text))]", D && "text-xs"), children: j ? /* @__PURE__ */ l.jsx(Ws, { content: Se, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ l.jsxs("pre", { className: B("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", D && "text-xs"), children: [
8710
8710
  Se.substring(0, v),
8711
8711
  "..."
8712
8712
  ] }) }),
@@ -8750,11 +8750,11 @@ const jw = V.memo(function({
8750
8750
  ] });
8751
8751
  }, De = un(() => Dw(t), [t]);
8752
8752
  return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
8753
- /* @__PURE__ */ l.jsx("div", { className: L(ue(), x.container), children: /* @__PURE__ */ l.jsxs("div", { className: L(se(), x.content), children: [
8753
+ /* @__PURE__ */ l.jsx("div", { className: B(ue(), x.container), children: /* @__PURE__ */ l.jsxs("div", { className: B(se(), x.content), children: [
8754
8754
  (a || c || G) && /* @__PURE__ */ l.jsxs(
8755
8755
  "div",
8756
8756
  {
8757
- className: L(
8757
+ className: B(
8758
8758
  "flex items-center justify-between mb-2 pb-2 border-b border-current/10",
8759
8759
  D && "mb-1 pb-1",
8760
8760
  Q,
@@ -8763,12 +8763,12 @@ const jw = V.memo(function({
8763
8763
  children: [
8764
8764
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
8765
8765
  te(),
8766
- c && De && /* @__PURE__ */ l.jsx("span", { className: L("font-medium", D ? "text-xs" : "text-sm"), children: De }),
8766
+ c && De && /* @__PURE__ */ l.jsx("span", { className: B("font-medium", D ? "text-xs" : "text-sm"), children: De }),
8767
8767
  G && $.name && /* @__PURE__ */ l.jsxs(
8768
8768
  Au,
8769
8769
  {
8770
8770
  variant: "outline",
8771
- className: L(
8771
+ className: B(
8772
8772
  "text-xs flex items-center gap-1 cursor-pointer",
8773
8773
  Q,
8774
8774
  "border border-current/40",
@@ -8786,7 +8786,7 @@ const jw = V.memo(function({
8786
8786
  {
8787
8787
  variant: "ghost",
8788
8788
  size: "sm",
8789
- className: L("h-6 px-1", Q, "hover:bg-foreground/10"),
8789
+ className: B("h-6 px-1", Q, "hover:bg-foreground/10"),
8790
8790
  onClick: () => N((de) => !de),
8791
8791
  children: /* @__PURE__ */ l.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
8792
8792
  "Tool Output ",
@@ -8796,11 +8796,11 @@ const jw = V.memo(function({
8796
8796
  )
8797
8797
  ] }),
8798
8798
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
8799
- a && /* @__PURE__ */ l.jsx("span", { className: L("text-xs opacity-60", Q, D && "text-xs"), children: ke(t.createdAt) }),
8799
+ a && /* @__PURE__ */ l.jsx("span", { className: B("text-xs opacity-60", Q, D && "text-xs"), children: ke(t.createdAt) }),
8800
8800
  i && !s && /* @__PURE__ */ l.jsxs(
8801
8801
  "div",
8802
8802
  {
8803
- className: L(
8803
+ className: B(
8804
8804
  "opacity-0 group-hover:opacity-100 transition-opacity",
8805
8805
  "flex items-center gap-1",
8806
8806
  x.actions
@@ -8812,11 +8812,11 @@ const jw = V.memo(function({
8812
8812
  variant: "ghost",
8813
8813
  size: "sm",
8814
8814
  onClick: K,
8815
- className: L("h-6 w-6 p-0 hover:bg-foreground/10", Q, D && "h-5 w-5"),
8815
+ className: B("h-6 w-6 p-0 hover:bg-foreground/10", Q, D && "h-5 w-5"),
8816
8816
  children: /* @__PURE__ */ l.jsx(
8817
8817
  Ga,
8818
8818
  {
8819
- className: L(
8819
+ className: B(
8820
8820
  y ? "text-success" : Q,
8821
8821
  D ? "h-3 w-3" : "h-4 w-4"
8822
8822
  )
@@ -8824,24 +8824,24 @@ const jw = V.memo(function({
8824
8824
  )
8825
8825
  }
8826
8826
  ),
8827
- O === "user" && g && /* @__PURE__ */ l.jsx(
8827
+ M === "user" && g && /* @__PURE__ */ l.jsx(
8828
8828
  _e,
8829
8829
  {
8830
8830
  variant: "ghost",
8831
8831
  size: "sm",
8832
8832
  onClick: _,
8833
- className: L("h-6 w-6 p-0 hover:bg-foreground/10", Q, D && "h-5 w-5"),
8834
- children: /* @__PURE__ */ l.jsx(Ka, { className: L(Q, D ? "h-3 w-3" : "h-4 w-4") })
8833
+ className: B("h-6 w-6 p-0 hover:bg-foreground/10", Q, D && "h-5 w-5"),
8834
+ children: /* @__PURE__ */ l.jsx(Ka, { className: B(Q, D ? "h-3 w-3" : "h-4 w-4") })
8835
8835
  }
8836
8836
  ),
8837
- O === "assistant" && p && /* @__PURE__ */ l.jsx(
8837
+ M === "assistant" && p && /* @__PURE__ */ l.jsx(
8838
8838
  _e,
8839
8839
  {
8840
8840
  variant: "ghost",
8841
8841
  size: "sm",
8842
- onClick: X,
8843
- className: L("h-6 w-6 p-0 hover:bg-foreground/10", Q, D && "h-5 w-5"),
8844
- children: /* @__PURE__ */ l.jsx(si, { className: L(Q, D ? "h-3 w-3" : "h-4 w-4") })
8842
+ onClick: J,
8843
+ className: B("h-6 w-6 p-0 hover:bg-foreground/10", Q, D && "h-5 w-5"),
8844
+ children: /* @__PURE__ */ l.jsx(si, { className: B(Q, D ? "h-3 w-3" : "h-4 w-4") })
8845
8845
  }
8846
8846
  )
8847
8847
  ]
@@ -8852,7 +8852,7 @@ const jw = V.memo(function({
8852
8852
  }
8853
8853
  ),
8854
8854
  /* @__PURE__ */ l.jsx("div", { className: "relative", children: Pe() }),
8855
- G && C && ($.toolCallId || $.name) && /* @__PURE__ */ l.jsxs("div", { className: L("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", D && "text-xs"), children: [
8855
+ G && C && ($.toolCallId || $.name) && /* @__PURE__ */ l.jsxs("div", { className: B("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", D && "text-xs"), children: [
8856
8856
  $.name && /* @__PURE__ */ l.jsxs("div", { children: [
8857
8857
  "Function: ",
8858
8858
  $.name
@@ -8865,7 +8865,7 @@ const jw = V.memo(function({
8865
8865
  !(a || c || G) && i && !s && /* @__PURE__ */ l.jsxs(
8866
8866
  "div",
8867
8867
  {
8868
- className: L(
8868
+ className: B(
8869
8869
  "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
8870
8870
  "flex items-center gap-1",
8871
8871
  x.actions
@@ -8877,28 +8877,28 @@ const jw = V.memo(function({
8877
8877
  variant: "ghost",
8878
8878
  size: "sm",
8879
8879
  onClick: K,
8880
- className: L("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
8881
- children: /* @__PURE__ */ l.jsx(Ga, { className: L(y ? "text-success" : "text-current", D ? "h-3 w-3" : "h-4 w-4") })
8880
+ className: B("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
8881
+ children: /* @__PURE__ */ l.jsx(Ga, { className: B(y ? "text-success" : "text-current", D ? "h-3 w-3" : "h-4 w-4") })
8882
8882
  }
8883
8883
  ),
8884
- O === "user" && g && /* @__PURE__ */ l.jsx(
8884
+ M === "user" && g && /* @__PURE__ */ l.jsx(
8885
8885
  _e,
8886
8886
  {
8887
8887
  variant: "ghost",
8888
8888
  size: "sm",
8889
8889
  onClick: _,
8890
- className: L("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
8891
- children: /* @__PURE__ */ l.jsx(Ka, { className: L("text-current", D ? "h-3 w-3" : "h-4 w-4") })
8890
+ className: B("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
8891
+ children: /* @__PURE__ */ l.jsx(Ka, { className: B("text-current", D ? "h-3 w-3" : "h-4 w-4") })
8892
8892
  }
8893
8893
  ),
8894
- O === "assistant" && p && /* @__PURE__ */ l.jsx(
8894
+ M === "assistant" && p && /* @__PURE__ */ l.jsx(
8895
8895
  _e,
8896
8896
  {
8897
8897
  variant: "ghost",
8898
8898
  size: "sm",
8899
- onClick: X,
8900
- className: L("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
8901
- children: /* @__PURE__ */ l.jsx(si, { className: L("text-current", D ? "h-3 w-3" : "h-4 w-4") })
8899
+ onClick: J,
8900
+ className: B("h-6 w-6 p-0 hover:bg-background/50 text-current", D && "h-5 w-5"),
8901
+ children: /* @__PURE__ */ l.jsx(si, { className: B("text-current", D ? "h-3 w-3" : "h-4 w-4") })
8902
8902
  }
8903
8903
  )
8904
8904
  ]
@@ -8910,7 +8910,7 @@ const jw = V.memo(function({
8910
8910
  {
8911
8911
  isOpen: I,
8912
8912
  onClose: () => {
8913
- B(!1), Z(null);
8913
+ L(!1), X(null);
8914
8914
  },
8915
8915
  fileId: F.id,
8916
8916
  fileName: F.name,
@@ -9176,24 +9176,24 @@ function $w({
9176
9176
  }, [e]), Le(() => {
9177
9177
  const A = g.current;
9178
9178
  if (!A) return;
9179
- let M = !1;
9179
+ let O = !1;
9180
9180
  const I = () => {
9181
- M || (window.requestAnimationFrame(() => {
9181
+ O || (window.requestAnimationFrame(() => {
9182
9182
  const F = A.scrollHeight - A.scrollTop - A.clientHeight <= 32;
9183
- E.current && !F && (E.current = !1), b.current = F, M = !1;
9184
- }), M = !0);
9183
+ E.current && !F && (E.current = !1), b.current = F, O = !1;
9184
+ }), O = !0);
9185
9185
  };
9186
9186
  return A.addEventListener("scroll", I, { passive: !0 }), I(), () => {
9187
9187
  A.removeEventListener("scroll", I);
9188
9188
  };
9189
9189
  }, []), Le(() => {
9190
- const A = y.current, M = e.length;
9191
- if (M > A) {
9192
- const I = e[M - 1];
9190
+ const A = y.current, O = e.length;
9191
+ if (O > A) {
9192
+ const I = e[O - 1];
9193
9193
  I && I.role === "user" && requestAnimationFrame(() => {
9194
- var B;
9194
+ var L;
9195
9195
  try {
9196
- (B = p.current) == null || B.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "auto", align: "end" }), b.current = !0, E.current = !!x;
9196
+ (L = p.current) == null || L.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "auto", align: "end" }), b.current = !0, E.current = !!x;
9197
9197
  } catch {
9198
9198
  }
9199
9199
  });
@@ -9201,14 +9201,18 @@ function $w({
9201
9201
  }, [e.length, x]), Le(() => {
9202
9202
  const A = y.current;
9203
9203
  if (e.length > A) {
9204
- const M = e[e.length - 1];
9205
- M && M.role === "user" && x && requestAnimationFrame(() => {
9206
- var I;
9207
- try {
9208
- (I = p.current) == null || I.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "auto", align: "end" }), b.current = !0, E.current = !0;
9209
- } catch {
9210
- }
9211
- });
9204
+ const O = e[e.length - 1];
9205
+ if (O && O.role === "user" && x) {
9206
+ const I = g.current;
9207
+ let L = !0;
9208
+ I && (L = I.scrollHeight - I.scrollTop - I.clientHeight <= 32), L && requestAnimationFrame(() => {
9209
+ var F;
9210
+ try {
9211
+ (F = p.current) == null || F.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "auto", align: "end" }), b.current = !0, E.current = !0;
9212
+ } catch {
9213
+ }
9214
+ });
9215
+ }
9212
9216
  } else e.length < A && (b.current = !0);
9213
9217
  y.current = e.length;
9214
9218
  }, [e.length]), Le(() => {
@@ -9228,38 +9232,40 @@ function $w({
9228
9232
  await (a == null ? void 0 : a());
9229
9233
  return;
9230
9234
  }
9231
- const M = A.scrollHeight, I = A.scrollTop;
9235
+ const O = A.scrollHeight, I = A.scrollTop;
9232
9236
  w.current = !0;
9233
9237
  try {
9234
9238
  await a();
9235
9239
  } finally {
9236
9240
  requestAnimationFrame(() => {
9237
- const B = g.current;
9238
- if (!B) {
9241
+ const L = g.current;
9242
+ if (!L) {
9239
9243
  w.current = !1;
9240
9244
  return;
9241
9245
  }
9242
- const F = B.scrollHeight;
9243
- B.scrollTop = I + (F - M);
9244
- const Z = F - B.scrollTop - B.clientHeight;
9245
- b.current = Z <= 32, w.current = !1;
9246
+ const F = L.scrollHeight;
9247
+ L.scrollTop = I + (F - O);
9248
+ const X = F - L.scrollTop - L.clientHeight;
9249
+ b.current = X <= 32, w.current = !1;
9246
9250
  });
9247
9251
  }
9248
9252
  };
9249
- }, [a]), H = (A, M) => {
9250
- g.current = A, M && (typeof M == "function" ? M(A) : M.current = A);
9253
+ }, [a]), H = (A, O) => {
9254
+ g.current = A, O && (typeof O == "function" ? O(A) : O.current = A);
9251
9255
  };
9252
9256
  return Le(() => {
9253
9257
  const A = g.current;
9254
9258
  if (S.current && !t && (A && (T.current = A.scrollHeight, C.current = A.scrollTop, N.current = !0), E.current = !!x), t) {
9255
9259
  if (!x) return;
9260
+ const O = g.current;
9261
+ let I = !0;
9262
+ if (O && (I = O.scrollHeight - O.scrollTop - O.clientHeight <= 32), !I) return;
9256
9263
  requestAnimationFrame(() => {
9257
- var M;
9258
- if (b.current)
9259
- try {
9260
- (M = p.current) == null || M.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "smooth", align: "end" }), E.current = !0;
9261
- } catch {
9262
- }
9264
+ var L;
9265
+ try {
9266
+ (L = p.current) == null || L.scrollToIndex({ index: Math.max(0, e.length - 1), behavior: "smooth", align: "end" }), E.current = !0;
9267
+ } catch {
9268
+ }
9263
9269
  });
9264
9270
  }
9265
9271
  S.current = t;
@@ -9267,7 +9273,7 @@ function $w({
9267
9273
  const A = g.current;
9268
9274
  if (!A || !N.current) return;
9269
9275
  N.current = !1;
9270
- const M = T.current || 0, I = C.current || 0, F = A.scrollHeight - M;
9276
+ const O = T.current || 0, I = C.current || 0, F = A.scrollHeight - O;
9271
9277
  try {
9272
9278
  E.current ? A.scrollTop = A.scrollHeight - A.clientHeight : A.scrollTop = I + F;
9273
9279
  } catch {
@@ -9291,13 +9297,13 @@ function $w({
9291
9297
  b.current = A;
9292
9298
  },
9293
9299
  style: { height: "100%", overscrollBehavior: "contain" },
9294
- computeItemKey: (A, M) => M.id ?? `message-${A}`,
9300
+ computeItemKey: (A, O) => O.id ?? `message-${A}`,
9295
9301
  components: {
9296
- Scroller: V.forwardRef((A, M) => /* @__PURE__ */ l.jsx(
9302
+ Scroller: V.forwardRef((A, O) => /* @__PURE__ */ l.jsx(
9297
9303
  "div",
9298
9304
  {
9299
9305
  ...A,
9300
- ref: (I) => H(I, M),
9306
+ ref: (I) => H(I, O),
9301
9307
  style: {
9302
9308
  overflowAnchor: "none",
9303
9309
  willChange: t ? "scroll-position" : "transform",
@@ -9307,7 +9313,7 @@ function $w({
9307
9313
  }
9308
9314
  ))
9309
9315
  },
9310
- itemContent: (A, M) => /* @__PURE__ */ l.jsx(
9316
+ itemContent: (A, O) => /* @__PURE__ */ l.jsx(
9311
9317
  "div",
9312
9318
  {
9313
9319
  className: "mb-4 last:mb-0",
@@ -9315,19 +9321,19 @@ function $w({
9315
9321
  contentVisibility: "auto",
9316
9322
  // If this message is the currently streaming assistant message, reserve a min-height
9317
9323
  // so the container doesn't reflow excessively as HTML is progressively rendered.
9318
- minHeight: t && n === M.id ? 120 : void 0,
9319
- containIntrinsicSize: t && n === M.id ? "auto 120px" : "auto 150px",
9324
+ minHeight: t && n === O.id ? 120 : void 0,
9325
+ containIntrinsicSize: t && n === O.id ? "auto 120px" : "auto 150px",
9320
9326
  transform: "translateZ(0)",
9321
9327
  isolation: "isolate"
9322
9328
  },
9323
9329
  children: /* @__PURE__ */ l.jsx(
9324
9330
  jw,
9325
9331
  {
9326
- message: M,
9332
+ message: O,
9327
9333
  messageIndex: A,
9328
- isStreamingMessage: t && n === M.id,
9334
+ isStreamingMessage: t && n === O.id,
9329
9335
  streamingDebounceMs: r,
9330
- isEditing: i === M.id,
9336
+ isEditing: i === O.id,
9331
9337
  showActions: s,
9332
9338
  showTimestamp: !1,
9333
9339
  showAgentName: !0,
@@ -9338,7 +9344,7 @@ function $w({
9338
9344
  onRegenerate: () => u(A),
9339
9345
  onCancelEdit: d
9340
9346
  },
9341
- M.id ?? `msg-${M.role}-${A}-${M.createdAt ?? ""}`
9347
+ O.id ?? `msg-${O.role}-${A}-${O.createdAt ?? ""}`
9342
9348
  )
9343
9349
  }
9344
9350
  )
@@ -9713,14 +9719,14 @@ const oy = (e) => ({
9713
9719
  }, v = va(o), x = xa(v), g = await i.getDimensions(u), p = v === "y", w = p ? "top" : "left", b = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", E = s.reference[x] + s.reference[v] - m[v] - s.floating[x], S = m[v] - s.reference[v], T = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
9714
9720
  let C = T ? T[y] : 0;
9715
9721
  (!C || !await (i.isElement == null ? void 0 : i.isElement(T))) && (C = a.floating[y] || s.floating[x]);
9716
- const N = E / 2 - S / 2, j = C / 2 - g[x] / 2 - 1, P = pn(h[w], j), H = pn(h[b], j), A = P, M = C - g[x] - H, I = C / 2 - g[x] / 2 + N, B = Ti(A, I, M), F = !c.arrow && ir(o) != null && I !== B && s.reference[x] / 2 - (I < A ? P : H) - g[x] / 2 < 0, Z = F ? I < A ? I - A : I - M : 0;
9722
+ const N = E / 2 - S / 2, j = C / 2 - g[x] / 2 - 1, P = pn(h[w], j), H = pn(h[b], j), A = P, O = C - g[x] - H, I = C / 2 - g[x] / 2 + N, L = Ti(A, I, O), F = !c.arrow && ir(o) != null && I !== L && s.reference[x] / 2 - (I < A ? P : H) - g[x] / 2 < 0, X = F ? I < A ? I - A : I - O : 0;
9717
9723
  return {
9718
- [v]: m[v] + Z,
9724
+ [v]: m[v] + X,
9719
9725
  data: {
9720
- [v]: B,
9721
- centerOffset: I - B - Z,
9726
+ [v]: L,
9727
+ centerOffset: I - L - X,
9722
9728
  ...F && {
9723
- alignmentOffset: Z
9729
+ alignmentOffset: X
9724
9730
  }
9725
9731
  },
9726
9732
  reset: F
@@ -9763,8 +9769,8 @@ const oy = (e) => ({
9763
9769
  overflows: j
9764
9770
  }], !j.every((I) => I <= 0)) {
9765
9771
  var H, A;
9766
- const I = (((H = s.flip) == null ? void 0 : H.index) || 0) + 1, B = C[I];
9767
- if (B && (!(h === "alignment" ? b !== qt(B) : !1) || // We leave the current main axis only if every placement on that axis
9772
+ const I = (((H = s.flip) == null ? void 0 : H.index) || 0) + 1, L = C[I];
9773
+ if (L && (!(h === "alignment" ? b !== qt(L) : !1) || // We leave the current main axis only if every placement on that axis
9768
9774
  // overflows the main axis.
9769
9775
  P.every((D) => qt(D.placement) === b ? D.overflows[0] > 0 : !0)))
9770
9776
  return {
@@ -9773,24 +9779,24 @@ const oy = (e) => ({
9773
9779
  overflows: P
9774
9780
  },
9775
9781
  reset: {
9776
- placement: B
9782
+ placement: L
9777
9783
  }
9778
9784
  };
9779
- let F = (A = P.filter((Z) => Z.overflows[0] <= 0).sort((Z, D) => Z.overflows[1] - D.overflows[1])[0]) == null ? void 0 : A.placement;
9785
+ let F = (A = P.filter((X) => X.overflows[0] <= 0).sort((X, D) => X.overflows[1] - D.overflows[1])[0]) == null ? void 0 : A.placement;
9780
9786
  if (!F)
9781
9787
  switch (v) {
9782
9788
  case "bestFit": {
9783
- var M;
9784
- const Z = (M = P.filter((D) => {
9789
+ var O;
9790
+ const X = (O = P.filter((D) => {
9785
9791
  if (T) {
9786
- const O = qt(D.placement);
9787
- return O === b || // Create a bias to the `y` side axis due to horizontal
9792
+ const M = qt(D.placement);
9793
+ return M === b || // Create a bias to the `y` side axis due to horizontal
9788
9794
  // reading directions favoring greater width.
9789
- O === "y";
9795
+ M === "y";
9790
9796
  }
9791
9797
  return !0;
9792
- }).map((D) => [D.placement, D.overflows.filter((O) => O > 0).reduce((O, G) => O + G, 0)]).sort((D, O) => D[1] - O[1])[0]) == null ? void 0 : M[0];
9793
- Z && (F = Z);
9798
+ }).map((D) => [D.placement, D.overflows.filter((M) => M > 0).reduce((M, G) => M + G, 0)]).sort((D, M) => D[1] - M[1])[0]) == null ? void 0 : O[0];
9799
+ X && (F = X);
9794
9800
  break;
9795
9801
  }
9796
9802
  case "initialPlacement":
@@ -10032,8 +10038,8 @@ const ly = function(e) {
10032
10038
  const b = g - d.top - d.bottom, y = x - d.left - d.right, E = pn(g - d[p], b), S = pn(x - d[w], y), T = !t.middlewareData.shift;
10033
10039
  let C = E, N = S;
10034
10040
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (N = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = b), T && !m) {
10035
- const P = yt(d.left, 0), H = yt(d.right, 0), A = yt(d.top, 0), M = yt(d.bottom, 0);
10036
- v ? N = x - 2 * (P !== 0 || H !== 0 ? P + H : yt(d.left, d.right)) : C = g - 2 * (A !== 0 || M !== 0 ? A + M : yt(d.top, d.bottom));
10041
+ const P = yt(d.left, 0), H = yt(d.right, 0), A = yt(d.top, 0), O = yt(d.bottom, 0);
10042
+ v ? N = x - 2 * (P !== 0 || H !== 0 ? P + H : yt(d.left, d.right)) : C = g - 2 * (A !== 0 || O !== 0 ? A + O : yt(d.top, d.bottom));
10037
10043
  }
10038
10044
  await c({
10039
10045
  ...t,
@@ -10621,7 +10627,7 @@ function Ky(e) {
10621
10627
  D !== T.current && (T.current = D, g(D));
10622
10628
  }, []), y = f.useCallback((D) => {
10623
10629
  D !== C.current && (C.current = D, w(D));
10624
- }, []), E = s || x, S = i || p, T = f.useRef(null), C = f.useRef(null), N = f.useRef(d), j = c != null, P = ni(c), H = ni(o), A = ni(u), M = f.useCallback(() => {
10630
+ }, []), E = s || x, S = i || p, T = f.useRef(null), C = f.useRef(null), N = f.useRef(d), j = c != null, P = ni(c), H = ni(o), A = ni(u), O = f.useCallback(() => {
10625
10631
  if (!T.current || !C.current)
10626
10632
  return;
10627
10633
  const D = {
@@ -10629,9 +10635,9 @@ function Ky(e) {
10629
10635
  strategy: n,
10630
10636
  middleware: m
10631
10637
  };
10632
- H.current && (D.platform = H.current), Wy(T.current, C.current, D).then((O) => {
10638
+ H.current && (D.platform = H.current), Wy(T.current, C.current, D).then((M) => {
10633
10639
  const G = {
10634
- ...O,
10640
+ ...M,
10635
10641
  // The floating element's position may be recomputed while it's closed
10636
10642
  // but still mounted (such as when transitioning out). To ensure
10637
10643
  // `isPositioned` will be `false` initially on the next open, avoid
@@ -10655,11 +10661,11 @@ function Ky(e) {
10655
10661
  }), []), Ro(() => {
10656
10662
  if (E && (T.current = E), S && (C.current = S), E && S) {
10657
10663
  if (P.current)
10658
- return P.current(E, S, M);
10659
- M();
10664
+ return P.current(E, S, O);
10665
+ O();
10660
10666
  }
10661
- }, [E, S, M, P, j]);
10662
- const B = f.useMemo(() => ({
10667
+ }, [E, S, O, P, j]);
10668
+ const L = f.useMemo(() => ({
10663
10669
  reference: T,
10664
10670
  floating: C,
10665
10671
  setReference: b,
@@ -10667,7 +10673,7 @@ function Ky(e) {
10667
10673
  }), [b, y]), F = f.useMemo(() => ({
10668
10674
  reference: E,
10669
10675
  floating: S
10670
- }), [E, S]), Z = f.useMemo(() => {
10676
+ }), [E, S]), X = f.useMemo(() => {
10671
10677
  const D = {
10672
10678
  position: n,
10673
10679
  left: 0,
@@ -10675,26 +10681,26 @@ function Ky(e) {
10675
10681
  };
10676
10682
  if (!F.floating)
10677
10683
  return D;
10678
- const O = hc(F.floating, d.x), G = hc(F.floating, d.y);
10684
+ const M = hc(F.floating, d.x), G = hc(F.floating, d.y);
10679
10685
  return a ? {
10680
10686
  ...D,
10681
- transform: "translate(" + O + "px, " + G + "px)",
10687
+ transform: "translate(" + M + "px, " + G + "px)",
10682
10688
  ...Ad(F.floating) >= 1.5 && {
10683
10689
  willChange: "transform"
10684
10690
  }
10685
10691
  } : {
10686
10692
  position: n,
10687
- left: O,
10693
+ left: M,
10688
10694
  top: G
10689
10695
  };
10690
10696
  }, [n, a, F.floating, d.x, d.y]);
10691
10697
  return f.useMemo(() => ({
10692
10698
  ...d,
10693
- update: M,
10694
- refs: B,
10699
+ update: O,
10700
+ refs: L,
10695
10701
  elements: F,
10696
- floatingStyles: Z
10697
- }), [d, M, B, F, Z]);
10702
+ floatingStyles: X
10703
+ }), [d, O, L, F, X]);
10698
10704
  }
10699
10705
  const Yy = (e) => {
10700
10706
  function t(n) {
@@ -10795,7 +10801,7 @@ var Dd = "PopperAnchor", Ld = f.forwardRef(
10795
10801
  Ld.displayName = Dd;
10796
10802
  var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10797
10803
  (e, t) => {
10798
- var K, _, X, te, ue, se;
10804
+ var K, _, J, te, ue, se;
10799
10805
  const {
10800
10806
  __scopePopper: n,
10801
10807
  side: r = "bottom",
@@ -10811,12 +10817,12 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10811
10817
  updatePositionStrategy: v = "optimized",
10812
10818
  onPlaced: x,
10813
10819
  ...g
10814
- } = e, p = Od(Ca, n), [w, b] = f.useState(null), y = Te(t, (ke) => b(ke)), [E, S] = f.useState(null), T = Pd(E), C = (T == null ? void 0 : T.width) ?? 0, N = (T == null ? void 0 : T.height) ?? 0, j = r + (s !== "center" ? "-" + s : ""), P = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, H = Array.isArray(u) ? u : [u], A = H.length > 0, M = {
10820
+ } = e, p = Od(Ca, n), [w, b] = f.useState(null), y = Te(t, (ke) => b(ke)), [E, S] = f.useState(null), T = Pd(E), C = (T == null ? void 0 : T.width) ?? 0, N = (T == null ? void 0 : T.height) ?? 0, j = r + (s !== "center" ? "-" + s : ""), P = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, H = Array.isArray(u) ? u : [u], A = H.length > 0, O = {
10815
10821
  padding: P,
10816
10822
  boundary: H.filter(l0),
10817
10823
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
10818
10824
  altBoundary: A
10819
- }, { refs: I, floatingStyles: B, placement: F, isPositioned: Z, middlewareData: D } = Ky({
10825
+ }, { refs: I, floatingStyles: L, placement: F, isPositioned: X, middlewareData: D } = Ky({
10820
10826
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
10821
10827
  strategy: "fixed",
10822
10828
  placement: j,
@@ -10832,11 +10838,11 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10832
10838
  mainAxis: !0,
10833
10839
  crossAxis: !1,
10834
10840
  limiter: h === "partial" ? Jy() : void 0,
10835
- ...M
10841
+ ...O
10836
10842
  }),
10837
- c && Zy({ ...M }),
10843
+ c && Zy({ ...O }),
10838
10844
  Qy({
10839
- ...M,
10845
+ ...O,
10840
10846
  apply: ({ elements: ke, rects: Pe, availableWidth: De, availableHeight: de }) => {
10841
10847
  const { width: je, height: xe } = Pe.reference, Se = ke.floating.style;
10842
10848
  Se.setProperty("--radix-popper-available-width", `${De}px`), Se.setProperty("--radix-popper-available-height", `${de}px`), Se.setProperty("--radix-popper-anchor-width", `${je}px`), Se.setProperty("--radix-popper-anchor-height", `${xe}px`);
@@ -10844,13 +10850,13 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10844
10850
  }),
10845
10851
  E && t0({ element: E, padding: a }),
10846
10852
  c0({ arrowWidth: C, arrowHeight: N }),
10847
- m && e0({ strategy: "referenceHidden", ...M })
10853
+ m && e0({ strategy: "referenceHidden", ...O })
10848
10854
  ]
10849
- }), [O, G] = $d(F), Q = it(x);
10855
+ }), [M, G] = $d(F), Q = it(x);
10850
10856
  st(() => {
10851
- Z && (Q == null || Q());
10852
- }, [Z, Q]);
10853
- const q = (K = D.arrow) == null ? void 0 : K.x, $ = (_ = D.arrow) == null ? void 0 : _.y, Y = ((X = D.arrow) == null ? void 0 : X.centerOffset) !== 0, [ye, ce] = f.useState();
10857
+ X && (Q == null || Q());
10858
+ }, [X, Q]);
10859
+ const q = (K = D.arrow) == null ? void 0 : K.x, $ = (_ = D.arrow) == null ? void 0 : _.y, Y = ((J = D.arrow) == null ? void 0 : J.centerOffset) !== 0, [ye, ce] = f.useState();
10854
10860
  return st(() => {
10855
10861
  w && ce(window.getComputedStyle(w).zIndex);
10856
10862
  }, [w]), /* @__PURE__ */ l.jsx(
@@ -10859,8 +10865,8 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10859
10865
  ref: I.setFloating,
10860
10866
  "data-radix-popper-content-wrapper": "",
10861
10867
  style: {
10862
- ...B,
10863
- transform: Z ? B.transform : "translate(0, -200%)",
10868
+ ...L,
10869
+ transform: X ? L.transform : "translate(0, -200%)",
10864
10870
  // keep off the page when measuring
10865
10871
  minWidth: "max-content",
10866
10872
  zIndex: ye,
@@ -10881,7 +10887,7 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10881
10887
  s0,
10882
10888
  {
10883
10889
  scope: n,
10884
- placedSide: O,
10890
+ placedSide: M,
10885
10891
  onArrowChange: S,
10886
10892
  arrowX: q,
10887
10893
  arrowY: $,
@@ -10889,7 +10895,7 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10889
10895
  children: /* @__PURE__ */ l.jsx(
10890
10896
  me.div,
10891
10897
  {
10892
- "data-side": O,
10898
+ "data-side": M,
10893
10899
  "data-align": G,
10894
10900
  ...g,
10895
10901
  ref: y,
@@ -10897,7 +10903,7 @@ var Ca = "PopperContent", [s0, i0] = _d(Ca), Fd = f.forwardRef(
10897
10903
  ...g.style,
10898
10904
  // if the PopperContent hasn't been placed yet (not all measurements done)
10899
10905
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
10900
- animation: Z ? void 0 : "none"
10906
+ animation: X ? void 0 : "none"
10901
10907
  }
10902
10908
  }
10903
10909
  )
@@ -11042,10 +11048,10 @@ var m0 = f.forwardRef((e, t) => {
11042
11048
  if (N.target === N.currentTarget && j && !w) {
11043
11049
  const P = new CustomEvent(ri, u0);
11044
11050
  if (N.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
11045
- const H = E().filter((F) => F.focusable), A = H.find((F) => F.active), M = H.find((F) => F.id === g), B = [A, M, ...H].filter(
11051
+ const H = E().filter((F) => F.focusable), A = H.find((F) => F.active), O = H.find((F) => F.id === g), L = [A, O, ...H].filter(
11046
11052
  Boolean
11047
11053
  ).map((F) => F.ref.current);
11048
- Kd(B, d);
11054
+ Kd(L, d);
11049
11055
  }
11050
11056
  }
11051
11057
  S.current = !1;
@@ -11254,17 +11260,17 @@ var kt = "MenuContent", [P0, Aa] = Mn(kt), ef = f.forwardRef(
11254
11260
  onDismiss: v,
11255
11261
  disableOutsideScroll: x,
11256
11262
  ...g
11257
- } = e, p = Dn(kt, n), w = Zr(kt, n), b = ws(n), y = Xd(n), E = E0(n), [S, T] = f.useState(null), C = f.useRef(null), N = Te(t, C, p.onContentChange), j = f.useRef(0), P = f.useRef(""), H = f.useRef(0), A = f.useRef(null), M = f.useRef("right"), I = f.useRef(0), B = x ? us : f.Fragment, F = x ? { as: M0, allowPinchZoom: !0 } : void 0, Z = (O) => {
11263
+ } = e, p = Dn(kt, n), w = Zr(kt, n), b = ws(n), y = Xd(n), E = E0(n), [S, T] = f.useState(null), C = f.useRef(null), N = Te(t, C, p.onContentChange), j = f.useRef(0), P = f.useRef(""), H = f.useRef(0), A = f.useRef(null), O = f.useRef("right"), I = f.useRef(0), L = x ? us : f.Fragment, F = x ? { as: M0, allowPinchZoom: !0 } : void 0, X = (M) => {
11258
11264
  var K, _;
11259
- const G = P.current + O, Q = E().filter((X) => !X.disabled), q = document.activeElement, $ = (K = Q.find((X) => X.ref.current === q)) == null ? void 0 : K.textValue, Y = Q.map((X) => X.textValue), ye = K0(Y, G, $), ce = (_ = Q.find((X) => X.textValue === ye)) == null ? void 0 : _.ref.current;
11260
- (function X(te) {
11261
- P.current = te, window.clearTimeout(j.current), te !== "" && (j.current = window.setTimeout(() => X(""), 1e3));
11265
+ const G = P.current + M, Q = E().filter((J) => !J.disabled), q = document.activeElement, $ = (K = Q.find((J) => J.ref.current === q)) == null ? void 0 : K.textValue, Y = Q.map((J) => J.textValue), ye = K0(Y, G, $), ce = (_ = Q.find((J) => J.textValue === ye)) == null ? void 0 : _.ref.current;
11266
+ (function J(te) {
11267
+ P.current = te, window.clearTimeout(j.current), te !== "" && (j.current = window.setTimeout(() => J(""), 1e3));
11262
11268
  })(G), ce && setTimeout(() => ce.focus());
11263
11269
  };
11264
11270
  f.useEffect(() => () => window.clearTimeout(j.current), []), ua();
11265
- const D = f.useCallback((O) => {
11271
+ const D = f.useCallback((M) => {
11266
11272
  var Q, q;
11267
- return M.current === ((Q = A.current) == null ? void 0 : Q.side) && q0(O, (q = A.current) == null ? void 0 : q.area);
11273
+ return O.current === ((Q = A.current) == null ? void 0 : Q.side) && q0(M, (q = A.current) == null ? void 0 : q.area);
11268
11274
  }, []);
11269
11275
  return /* @__PURE__ */ l.jsx(
11270
11276
  P0,
@@ -11272,36 +11278,36 @@ var kt = "MenuContent", [P0, Aa] = Mn(kt), ef = f.forwardRef(
11272
11278
  scope: n,
11273
11279
  searchRef: P,
11274
11280
  onItemEnter: f.useCallback(
11275
- (O) => {
11276
- D(O) && O.preventDefault();
11281
+ (M) => {
11282
+ D(M) && M.preventDefault();
11277
11283
  },
11278
11284
  [D]
11279
11285
  ),
11280
11286
  onItemLeave: f.useCallback(
11281
- (O) => {
11287
+ (M) => {
11282
11288
  var G;
11283
- D(O) || ((G = C.current) == null || G.focus(), T(null));
11289
+ D(M) || ((G = C.current) == null || G.focus(), T(null));
11284
11290
  },
11285
11291
  [D]
11286
11292
  ),
11287
11293
  onTriggerLeave: f.useCallback(
11288
- (O) => {
11289
- D(O) && O.preventDefault();
11294
+ (M) => {
11295
+ D(M) && M.preventDefault();
11290
11296
  },
11291
11297
  [D]
11292
11298
  ),
11293
11299
  pointerGraceTimerRef: H,
11294
- onPointerGraceIntentChange: f.useCallback((O) => {
11295
- A.current = O;
11300
+ onPointerGraceIntentChange: f.useCallback((M) => {
11301
+ A.current = M;
11296
11302
  }, []),
11297
- children: /* @__PURE__ */ l.jsx(B, { ...F, children: /* @__PURE__ */ l.jsx(
11303
+ children: /* @__PURE__ */ l.jsx(L, { ...F, children: /* @__PURE__ */ l.jsx(
11298
11304
  as,
11299
11305
  {
11300
11306
  asChild: !0,
11301
11307
  trapped: o,
11302
- onMountAutoFocus: ee(s, (O) => {
11308
+ onMountAutoFocus: ee(s, (M) => {
11303
11309
  var G;
11304
- O.preventDefault(), (G = C.current) == null || G.focus({ preventScroll: !0 });
11310
+ M.preventDefault(), (G = C.current) == null || G.focus({ preventScroll: !0 });
11305
11311
  }),
11306
11312
  onUnmountAutoFocus: i,
11307
11313
  children: /* @__PURE__ */ l.jsx(
@@ -11324,8 +11330,8 @@ var kt = "MenuContent", [P0, Aa] = Mn(kt), ef = f.forwardRef(
11324
11330
  loop: r,
11325
11331
  currentTabStopId: S,
11326
11332
  onCurrentTabStopIdChange: T,
11327
- onEntryFocus: ee(c, (O) => {
11328
- w.isUsingKeyboardRef.current || O.preventDefault();
11333
+ onEntryFocus: ee(c, (M) => {
11334
+ w.isUsingKeyboardRef.current || M.preventDefault();
11329
11335
  }),
11330
11336
  preventScrollOnEntryFocus: !0,
11331
11337
  children: /* @__PURE__ */ l.jsx(
@@ -11340,25 +11346,25 @@ var kt = "MenuContent", [P0, Aa] = Mn(kt), ef = f.forwardRef(
11340
11346
  ...g,
11341
11347
  ref: N,
11342
11348
  style: { outline: "none", ...g.style },
11343
- onKeyDown: ee(g.onKeyDown, (O) => {
11344
- const Q = O.target.closest("[data-radix-menu-content]") === O.currentTarget, q = O.ctrlKey || O.altKey || O.metaKey, $ = O.key.length === 1;
11345
- Q && (O.key === "Tab" && O.preventDefault(), !q && $ && Z(O.key));
11349
+ onKeyDown: ee(g.onKeyDown, (M) => {
11350
+ const Q = M.target.closest("[data-radix-menu-content]") === M.currentTarget, q = M.ctrlKey || M.altKey || M.metaKey, $ = M.key.length === 1;
11351
+ Q && (M.key === "Tab" && M.preventDefault(), !q && $ && X(M.key));
11346
11352
  const Y = C.current;
11347
- if (O.target !== Y || !C0.includes(O.key)) return;
11348
- O.preventDefault();
11353
+ if (M.target !== Y || !C0.includes(M.key)) return;
11354
+ M.preventDefault();
11349
11355
  const ce = E().filter((K) => !K.disabled).map((K) => K.ref.current);
11350
- Yd.includes(O.key) && ce.reverse(), V0(ce);
11356
+ Yd.includes(M.key) && ce.reverse(), V0(ce);
11351
11357
  }),
11352
- onBlur: ee(e.onBlur, (O) => {
11353
- O.currentTarget.contains(O.target) || (window.clearTimeout(j.current), P.current = "");
11358
+ onBlur: ee(e.onBlur, (M) => {
11359
+ M.currentTarget.contains(M.target) || (window.clearTimeout(j.current), P.current = "");
11354
11360
  }),
11355
11361
  onPointerMove: ee(
11356
11362
  e.onPointerMove,
11357
- Lr((O) => {
11358
- const G = O.target, Q = I.current !== O.clientX;
11359
- if (O.currentTarget.contains(G) && Q) {
11360
- const q = O.clientX > I.current ? "right" : "left";
11361
- M.current = q, I.current = O.clientX;
11363
+ Lr((M) => {
11364
+ const G = M.target, Q = I.current !== M.clientX;
11365
+ if (M.currentTarget.contains(G) && Q) {
11366
+ const q = M.clientX > I.current ? "right" : "left";
11367
+ O.current = q, I.current = M.clientX;
11362
11368
  }
11363
11369
  })
11364
11370
  )
@@ -11892,7 +11898,7 @@ const kS = IS, PS = jS, _S = f.forwardRef(({ className: e, inset: t, children: n
11892
11898
  Hf,
11893
11899
  {
11894
11900
  ref: o,
11895
- className: L(
11901
+ className: B(
11896
11902
  "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
11897
11903
  t && "pl-8",
11898
11904
  e
@@ -11909,7 +11915,7 @@ const OS = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
11909
11915
  $f,
11910
11916
  {
11911
11917
  ref: n,
11912
- className: L(
11918
+ className: B(
11913
11919
  "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
11914
11920
  e
11915
11921
  ),
@@ -11922,7 +11928,7 @@ const zf = f.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
11922
11928
  {
11923
11929
  ref: r,
11924
11930
  sideOffset: t,
11925
- className: L(
11931
+ className: B(
11926
11932
  "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
11927
11933
  e
11928
11934
  ),
@@ -11934,7 +11940,7 @@ const ji = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
11934
11940
  Mf,
11935
11941
  {
11936
11942
  ref: r,
11937
- className: L(
11943
+ className: B(
11938
11944
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
11939
11945
  t && "pl-8",
11940
11946
  e
@@ -11947,7 +11953,7 @@ const MS = f.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
11947
11953
  Df,
11948
11954
  {
11949
11955
  ref: o,
11950
- className: L(
11956
+ className: B(
11951
11957
  "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
11952
11958
  e
11953
11959
  ),
@@ -11964,7 +11970,7 @@ const DS = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
11964
11970
  Lf,
11965
11971
  {
11966
11972
  ref: r,
11967
- className: L(
11973
+ className: B(
11968
11974
  "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
11969
11975
  e
11970
11976
  ),
@@ -11980,7 +11986,7 @@ const LS = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
11980
11986
  Of,
11981
11987
  {
11982
11988
  ref: r,
11983
- className: L(
11989
+ className: B(
11984
11990
  "px-2 py-1.5 text-sm font-semibold",
11985
11991
  t && "pl-8",
11986
11992
  e
@@ -11993,7 +11999,7 @@ const FS = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
11993
11999
  Bf,
11994
12000
  {
11995
12001
  ref: n,
11996
- className: L("-mx-1 my-1 h-px bg-muted", e),
12002
+ className: B("-mx-1 my-1 h-px bg-muted", e),
11997
12003
  ...t
11998
12004
  }
11999
12005
  ));
@@ -12030,8 +12036,8 @@ function Eo({
12030
12036
  hasMoreHistory: P,
12031
12037
  isLoadingHistory: H,
12032
12038
  loadOlderMessages: A,
12033
- api: M
12034
- } = Vi(), [I, B] = fe(null), [F, Z] = fe(""), [D, O] = fe(null), [G, Q] = fe([]), [q, $] = fe(!1), [Y, ye] = fe(null), [ce, K] = fe(null), [_, X] = fe(!1), [te, ue] = fe(null), [se, ke] = fe([]), [Pe, De] = fe(null), [de, je] = fe(null), xe = Be(null), Se = Be(null), rt = Be(null), [J, ae] = fe("desktop");
12039
+ api: O
12040
+ } = Vi(), [I, L] = fe(null), [F, X] = fe(""), [D, M] = fe(null), [G, Q] = fe([]), [q, $] = fe(!1), [Y, ye] = fe(null), [ce, K] = fe(null), [_, J] = fe(!1), [te, ue] = fe(null), [se, ke] = fe([]), [Pe, De] = fe(null), [de, je] = fe(null), xe = Be(null), Se = Be(null), rt = Be(null), [Z, ae] = fe("desktop");
12035
12041
  Le(() => {
12036
12042
  const oe = () => {
12037
12043
  const ie = window.innerWidth;
@@ -12081,13 +12087,13 @@ function Eo({
12081
12087
  Le(() => {
12082
12088
  (async () => {
12083
12089
  try {
12084
- const ie = await M.getAgent("default");
12090
+ const ie = await O.getAgent("default");
12085
12091
  ue(ie.uiDefaultMessage || null);
12086
12092
  } catch (ie) {
12087
12093
  console.warn("Failed to fetch default message:", ie), ue(null);
12088
12094
  }
12089
12095
  })();
12090
- }, [M]), Le(() => {
12096
+ }, [O]), Le(() => {
12091
12097
  b && !_ && (v == null || v(b));
12092
12098
  }, [b, _, v]);
12093
12099
  const Ye = (oe) => {
@@ -12112,7 +12118,7 @@ function Eo({
12112
12118
  if (ie) {
12113
12119
  const Ne = Ye(ie);
12114
12120
  if (Ne) {
12115
- O(Ne);
12121
+ M(Ne);
12116
12122
  return;
12117
12123
  }
12118
12124
  }
@@ -12122,16 +12128,16 @@ function Eo({
12122
12128
  checkpointNs: de ?? T ?? void 0,
12123
12129
  payloadExtras: I ? { edit: !0, originalMessageId: I } : void 0,
12124
12130
  attachments: G
12125
- }), h == null || h(ie), O(null), Q([]), B(null), Z("");
12131
+ }), h == null || h(ie), M(null), Q([]), L(null), X("");
12126
12132
  } catch (Ne) {
12127
12133
  const We = (Ne == null ? void 0 : Ne.message) || "Failed to send message";
12128
- O(We), v == null || v(We);
12134
+ M(We), v == null || v(We);
12129
12135
  }
12130
12136
  }
12131
12137
  }, dt = V.useCallback((oe, ie) => {
12132
- u && (B(oe), Z(ie), O(null));
12138
+ u && (L(oe), X(ie), M(null));
12133
12139
  }, [u]), Rt = V.useCallback(() => {
12134
- B(null), Z(""), O(null);
12140
+ L(null), X(""), M(null);
12135
12141
  }, []), Qe = Ke((oe, ie) => {
12136
12142
  dt(oe, ie);
12137
12143
  }, [dt]), at = Ke((oe) => {
@@ -12187,7 +12193,7 @@ function Eo({
12187
12193
  {
12188
12194
  variant: "ghost",
12189
12195
  size: "sm",
12190
- onClick: () => X(!0),
12196
+ onClick: () => J(!0),
12191
12197
  className: "text-red-800 hover:bg-red-100",
12192
12198
  "aria-label": "Dismiss error",
12193
12199
  children: /* @__PURE__ */ l.jsx(Vn, { size: 16 })
@@ -12225,7 +12231,7 @@ function Eo({
12225
12231
  streamingAssistantId: w,
12226
12232
  streamingDebounceMs: typeof s == "number" ? s : o,
12227
12233
  followNewMessages: i,
12228
- layoutSize: J,
12234
+ layoutSize: Z,
12229
12235
  enableMessageEditing: u,
12230
12236
  editingMessageId: I,
12231
12237
  onStartReached: () => {
@@ -12365,7 +12371,7 @@ const Fr = f.forwardRef(
12365
12371
  "input",
12366
12372
  {
12367
12373
  type: t,
12368
- className: L(
12374
+ className: B(
12369
12375
  "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12370
12376
  e
12371
12377
  ),
@@ -12893,7 +12899,7 @@ const nh = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
12893
12899
  th,
12894
12900
  {
12895
12901
  ref: r,
12896
- className: L("relative overflow-hidden", e),
12902
+ className: B("relative overflow-hidden", e),
12897
12903
  ...n,
12898
12904
  children: [
12899
12905
  /* @__PURE__ */ l.jsx(XS, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
@@ -12908,7 +12914,7 @@ const rh = f.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
12908
12914
  {
12909
12915
  ref: r,
12910
12916
  orientation: t,
12911
- className: L(
12917
+ className: B(
12912
12918
  "flex touch-none select-none transition-colors",
12913
12919
  t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
12914
12920
  t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
@@ -12940,7 +12946,7 @@ function ki({
12940
12946
  createThread: g,
12941
12947
  deleteThread: p,
12942
12948
  renameThread: w
12943
- } = Vi(), [b, y] = fe(m ?? []), [E, S] = fe(!1), [T, C] = fe(null), [N, j] = fe(null), [P, H] = fe(""), [A, M] = fe(!1);
12949
+ } = Vi(), [b, y] = fe(m ?? []), [E, S] = fe(!1), [T, C] = fe(null), [N, j] = fe(null), [P, H] = fe(""), [A, O] = fe(!1);
12944
12950
  Le(() => {
12945
12951
  y(m ?? []);
12946
12952
  }, [m]);
@@ -12950,15 +12956,15 @@ function ki({
12950
12956
  } catch (Y) {
12951
12957
  console.error("Failed to select thread:", Y);
12952
12958
  }
12953
- }, B = async () => {
12959
+ }, L = async () => {
12954
12960
  try {
12955
- M(!0);
12961
+ O(!0);
12956
12962
  const $ = await g();
12957
12963
  u == null || u($), a == null || a($);
12958
12964
  } catch ($) {
12959
12965
  console.error("Failed to create thread:", $);
12960
12966
  } finally {
12961
- M(!1);
12967
+ O(!1);
12962
12968
  }
12963
12969
  }, F = async ($, Y) => {
12964
12970
  if (Y.stopPropagation(), !!confirm("Delete this thread?"))
@@ -12967,7 +12973,7 @@ function ki({
12967
12973
  } catch (ye) {
12968
12974
  console.error("Failed to delete thread:", ye);
12969
12975
  }
12970
- }, Z = ($, Y) => {
12976
+ }, X = ($, Y) => {
12971
12977
  Y.stopPropagation(), j($.threadId), H($.title || `Thread ${$.threadId.slice(0, 8)}`);
12972
12978
  }, D = async ($) => {
12973
12979
  if (P.trim())
@@ -12976,10 +12982,10 @@ function ki({
12976
12982
  } catch (Y) {
12977
12983
  console.error("Failed to update title:", Y);
12978
12984
  }
12979
- }, O = () => {
12985
+ }, M = () => {
12980
12986
  j(null), H("");
12981
12987
  }, G = ($, Y) => {
12982
- $.key === "Enter" ? D(Y) : $.key === "Escape" && O();
12988
+ $.key === "Enter" ? D(Y) : $.key === "Escape" && M();
12983
12989
  }, Q = ($) => {
12984
12990
  if (!$) return "";
12985
12991
  try {
@@ -12993,7 +12999,7 @@ function ki({
12993
12999
  t && /* @__PURE__ */ l.jsx("div", { className: s.header || "flex-shrink-0 p-2 border-b bg-slate-800 border-slate-700 text-slate-100 flex justify-end", children: /* @__PURE__ */ l.jsx(
12994
13000
  _e,
12995
13001
  {
12996
- onClick: B,
13002
+ onClick: L,
12997
13003
  disabled: A || E,
12998
13004
  className: s.createButton || "p-2",
12999
13005
  size: "sm",
@@ -13020,7 +13026,7 @@ function ki({
13020
13026
  /* @__PURE__ */ l.jsx("div", { className: "flex-1 min-w-0", children: N === $.threadId ? /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", onClick: (Y) => Y.stopPropagation(), children: [
13021
13027
  /* @__PURE__ */ l.jsx(Fr, { value: P, onChange: (Y) => H(Y.target.value), onKeyDown: (Y) => G(Y, $.threadId), className: "h-6 text-sm", autoFocus: !0 }),
13022
13028
  /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: () => D($.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx($i, { size: 12 }) }),
13023
- /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: O, className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Vn, { size: 12 }) })
13029
+ /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: M, className: "h-6 w-6 p-0", children: /* @__PURE__ */ l.jsx(Vn, { size: 12 }) })
13024
13030
  ] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
13025
13031
  /* @__PURE__ */ l.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: q($) }),
13026
13032
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
@@ -13029,7 +13035,7 @@ function ki({
13029
13035
  ] })
13030
13036
  ] }) }),
13031
13037
  /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
13032
- r && N !== $.threadId && /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: (Y) => Z($, Y), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(Cc, { size: 12 }) }),
13038
+ r && N !== $.threadId && /* @__PURE__ */ l.jsx(_e, { variant: "ghost", size: "sm", onClick: (Y) => X($, Y), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ l.jsx(Cc, { size: 12 }) }),
13033
13039
  n && /* @__PURE__ */ l.jsx(
13034
13040
  _e,
13035
13041
  {
@@ -13186,7 +13192,7 @@ const Ba = f.forwardRef(
13186
13192
  ref: o,
13187
13193
  decorative: n,
13188
13194
  orientation: t,
13189
- className: L(
13195
+ className: B(
13190
13196
  "shrink-0 bg-border",
13191
13197
  t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
13192
13198
  e
@@ -13199,7 +13205,7 @@ Ba.displayName = ch.displayName;
13199
13205
  const uh = dd, aC = Cw, lC = fd, dh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13200
13206
  fs,
13201
13207
  {
13202
- className: L(
13208
+ className: B(
13203
13209
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
13204
13210
  e
13205
13211
  ),
@@ -13229,7 +13235,7 @@ const cC = Hr(
13229
13235
  hs,
13230
13236
  {
13231
13237
  ref: o,
13232
- className: L(cC({ side: e }), t),
13238
+ className: B(cC({ side: e }), t),
13233
13239
  ...r,
13234
13240
  children: [
13235
13241
  n,
@@ -13248,7 +13254,7 @@ const fh = ({
13248
13254
  }) => /* @__PURE__ */ l.jsx(
13249
13255
  "div",
13250
13256
  {
13251
- className: L(
13257
+ className: B(
13252
13258
  "flex flex-col space-y-2 text-center sm:text-left",
13253
13259
  e
13254
13260
  ),
@@ -13260,7 +13266,7 @@ const hh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13260
13266
  Rn,
13261
13267
  {
13262
13268
  ref: n,
13263
- className: L("text-lg font-semibold text-foreground", e),
13269
+ className: B("text-lg font-semibold text-foreground", e),
13264
13270
  ...t
13265
13271
  }
13266
13272
  ));
@@ -13269,7 +13275,7 @@ const ph = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13269
13275
  ps,
13270
13276
  {
13271
13277
  ref: n,
13272
- className: L("text-sm text-muted-foreground", e),
13278
+ className: B("text-sm text-muted-foreground", e),
13273
13279
  ...t
13274
13280
  }
13275
13281
  ));
@@ -13281,7 +13287,7 @@ function xc({
13281
13287
  return /* @__PURE__ */ l.jsx(
13282
13288
  "div",
13283
13289
  {
13284
- className: L("animate-pulse rounded-md bg-muted", e),
13290
+ className: B("animate-pulse rounded-md bg-muted", e),
13285
13291
  ...t
13286
13292
  }
13287
13293
  );
@@ -13620,7 +13626,7 @@ const kC = IC, PC = jC, _C = AC, Rh = f.forwardRef(({ className: e, sideOffset:
13620
13626
  {
13621
13627
  ref: r,
13622
13628
  sideOffset: t,
13623
- className: L(
13629
+ className: B(
13624
13630
  "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
13625
13631
  e
13626
13632
  ),
@@ -13678,7 +13684,7 @@ const Nh = f.forwardRef(
13678
13684
  "--sidebar-width-icon": FC,
13679
13685
  ...o
13680
13686
  },
13681
- className: L(
13687
+ className: B(
13682
13688
  "group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
13683
13689
  r
13684
13690
  ),
@@ -13703,7 +13709,7 @@ const Ih = f.forwardRef(
13703
13709
  return n === "none" ? /* @__PURE__ */ l.jsx(
13704
13710
  "div",
13705
13711
  {
13706
- className: L(
13712
+ className: B(
13707
13713
  "flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
13708
13714
  r
13709
13715
  ),
@@ -13736,7 +13742,7 @@ const Ih = f.forwardRef(
13736
13742
  /* @__PURE__ */ l.jsx(
13737
13743
  "div",
13738
13744
  {
13739
- className: L(
13745
+ className: B(
13740
13746
  "duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear",
13741
13747
  "group-data-[collapsible=offcanvas]:w-0",
13742
13748
  "group-data-[side=right]:rotate-180",
@@ -13747,7 +13753,7 @@ const Ih = f.forwardRef(
13747
13753
  /* @__PURE__ */ l.jsx(
13748
13754
  "div",
13749
13755
  {
13750
- className: L(
13756
+ className: B(
13751
13757
  "duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",
13752
13758
  e === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
13753
13759
  // Adjust the padding for floating and inset variants.
@@ -13780,7 +13786,7 @@ const jh = f.forwardRef(({ className: e, onClick: t, ...n }, r) => {
13780
13786
  "data-sidebar": "trigger",
13781
13787
  variant: "ghost",
13782
13788
  size: "icon",
13783
- className: L("h-7 w-7", e),
13789
+ className: B("h-7 w-7", e),
13784
13790
  onClick: (s) => {
13785
13791
  t == null || t(s), o();
13786
13792
  },
@@ -13804,7 +13810,7 @@ const HC = f.forwardRef(({ className: e, ...t }, n) => {
13804
13810
  tabIndex: -1,
13805
13811
  onClick: r,
13806
13812
  title: "Toggle Sidebar",
13807
- className: L(
13813
+ className: B(
13808
13814
  "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
13809
13815
  "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
13810
13816
  "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
@@ -13822,7 +13828,7 @@ const Ah = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13822
13828
  "main",
13823
13829
  {
13824
13830
  ref: n,
13825
- className: L(
13831
+ className: B(
13826
13832
  "relative flex min-h-svh flex-1 flex-col bg-background",
13827
13833
  "peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
13828
13834
  e
@@ -13836,7 +13842,7 @@ const $C = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13836
13842
  {
13837
13843
  ref: n,
13838
13844
  "data-sidebar": "input",
13839
- className: L(
13845
+ className: B(
13840
13846
  "h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
13841
13847
  e
13842
13848
  ),
@@ -13849,7 +13855,7 @@ const kh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13849
13855
  {
13850
13856
  ref: n,
13851
13857
  "data-sidebar": "header",
13852
- className: L("flex flex-col gap-2 p-2", e),
13858
+ className: B("flex flex-col gap-2 p-2", e),
13853
13859
  ...t
13854
13860
  }
13855
13861
  ));
@@ -13859,7 +13865,7 @@ const zC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13859
13865
  {
13860
13866
  ref: n,
13861
13867
  "data-sidebar": "footer",
13862
- className: L("flex flex-col gap-2 p-2", e),
13868
+ className: B("flex flex-col gap-2 p-2", e),
13863
13869
  ...t
13864
13870
  }
13865
13871
  ));
@@ -13869,7 +13875,7 @@ const UC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13869
13875
  {
13870
13876
  ref: n,
13871
13877
  "data-sidebar": "separator",
13872
- className: L("mx-2 w-auto bg-sidebar-border", e),
13878
+ className: B("mx-2 w-auto bg-sidebar-border", e),
13873
13879
  ...t
13874
13880
  }
13875
13881
  ));
@@ -13879,7 +13885,7 @@ const Ph = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13879
13885
  {
13880
13886
  ref: n,
13881
13887
  "data-sidebar": "content",
13882
- className: L(
13888
+ className: B(
13883
13889
  "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
13884
13890
  e
13885
13891
  ),
@@ -13892,7 +13898,7 @@ const _h = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13892
13898
  {
13893
13899
  ref: n,
13894
13900
  "data-sidebar": "group",
13895
- className: L("relative flex w-full min-w-0 flex-col p-2", e),
13901
+ className: B("relative flex w-full min-w-0 flex-col p-2", e),
13896
13902
  ...t
13897
13903
  }
13898
13904
  ));
@@ -13904,7 +13910,7 @@ const Oh = f.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => {
13904
13910
  {
13905
13911
  ref: r,
13906
13912
  "data-sidebar": "group-label",
13907
- className: L(
13913
+ className: B(
13908
13914
  "duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
13909
13915
  "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
13910
13916
  e
@@ -13921,7 +13927,7 @@ const WC = f.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => {
13921
13927
  {
13922
13928
  ref: r,
13923
13929
  "data-sidebar": "group-action",
13924
- className: L(
13930
+ className: B(
13925
13931
  "absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
13926
13932
  // Increases the hit area of the button on mobile.
13927
13933
  "after:absolute after:-inset-2 after:md:hidden",
@@ -13938,7 +13944,7 @@ const Mh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13938
13944
  {
13939
13945
  ref: n,
13940
13946
  "data-sidebar": "group-content",
13941
- className: L("w-full text-sm", e),
13947
+ className: B("w-full text-sm", e),
13942
13948
  ...t
13943
13949
  }
13944
13950
  ));
@@ -13948,7 +13954,7 @@ const Dh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13948
13954
  {
13949
13955
  ref: n,
13950
13956
  "data-sidebar": "menu",
13951
- className: L("flex w-full min-w-0 flex-col gap-1", e),
13957
+ className: B("flex w-full min-w-0 flex-col gap-1", e),
13952
13958
  ...t
13953
13959
  }
13954
13960
  ));
@@ -13958,7 +13964,7 @@ const Lh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
13958
13964
  {
13959
13965
  ref: n,
13960
13966
  "data-sidebar": "menu-item",
13961
- className: L("group/menu-item relative", e),
13967
+ className: B("group/menu-item relative", e),
13962
13968
  ...t
13963
13969
  }
13964
13970
  ));
@@ -13999,7 +14005,7 @@ const VC = Hr(
13999
14005
  "data-sidebar": "menu-button",
14000
14006
  "data-size": r,
14001
14007
  "data-active": t,
14002
- className: L(VC({ variant: n, size: r }), s),
14008
+ className: B(VC({ variant: n, size: r }), s),
14003
14009
  ...i
14004
14010
  }
14005
14011
  );
@@ -14027,7 +14033,7 @@ const GC = f.forwardRef(({ className: e, asChild: t = !1, showOnHover: n = !1, .
14027
14033
  {
14028
14034
  ref: o,
14029
14035
  "data-sidebar": "menu-action",
14030
- className: L(
14036
+ className: B(
14031
14037
  "absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
14032
14038
  // Increases the hit area of the button on mobile.
14033
14039
  "after:absolute after:-inset-2 after:md:hidden",
@@ -14048,7 +14054,7 @@ const KC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14048
14054
  {
14049
14055
  ref: n,
14050
14056
  "data-sidebar": "menu-badge",
14051
- className: L(
14057
+ className: B(
14052
14058
  "absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none",
14053
14059
  "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
14054
14060
  "peer-data-[size=sm]/menu-button:top-1",
@@ -14068,7 +14074,7 @@ const YC = f.forwardRef(({ className: e, showIcon: t = !1, ...n }, r) => {
14068
14074
  {
14069
14075
  ref: r,
14070
14076
  "data-sidebar": "menu-skeleton",
14071
- className: L("rounded-md h-8 flex gap-2 px-2 items-center", e),
14077
+ className: B("rounded-md h-8 flex gap-2 px-2 items-center", e),
14072
14078
  ...n,
14073
14079
  children: [
14074
14080
  t && /* @__PURE__ */ l.jsx(
@@ -14098,7 +14104,7 @@ const qC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14098
14104
  {
14099
14105
  ref: n,
14100
14106
  "data-sidebar": "menu-sub",
14101
- className: L(
14107
+ className: B(
14102
14108
  "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
14103
14109
  "group-data-[collapsible=icon]:hidden",
14104
14110
  e
@@ -14118,7 +14124,7 @@ const JC = f.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, classNa
14118
14124
  "data-sidebar": "menu-sub-button",
14119
14125
  "data-size": t,
14120
14126
  "data-active": n,
14121
- className: L(
14127
+ className: B(
14122
14128
  "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
14123
14129
  "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
14124
14130
  t === "sm" && "text-xs",
@@ -14185,7 +14191,7 @@ const QC = Hr(
14185
14191
  Hh,
14186
14192
  {
14187
14193
  ref: n,
14188
- className: L(QC(), e),
14194
+ className: B(QC(), e),
14189
14195
  ...t
14190
14196
  }
14191
14197
  ));
@@ -14314,7 +14320,7 @@ var Kh = zh, oT = Wh;
14314
14320
  const cn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14315
14321
  Kh,
14316
14322
  {
14317
- className: L(
14323
+ className: B(
14318
14324
  "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
14319
14325
  e
14320
14326
  ),
@@ -14323,7 +14329,7 @@ const cn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
14323
14329
  children: /* @__PURE__ */ l.jsx(
14324
14330
  oT,
14325
14331
  {
14326
- className: L(
14332
+ className: B(
14327
14333
  "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
14328
14334
  )
14329
14335
  }
@@ -14360,7 +14366,7 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], kn = "Sele
14360
14366
  defaultProp: a,
14361
14367
  onChange: c,
14362
14368
  caller: kn
14363
- }), H = f.useRef(null), A = p ? x || !!p.closest("form") : !0, [M, I] = f.useState(/* @__PURE__ */ new Set()), B = Array.from(M).map((F) => F.props.value).join(";");
14369
+ }), H = f.useRef(null), A = p ? x || !!p.closest("form") : !0, [O, I] = f.useState(/* @__PURE__ */ new Set()), L = Array.from(O).map((F) => F.props.value).join(";");
14364
14370
  return /* @__PURE__ */ l.jsx(Ta, { ...g, children: /* @__PURE__ */ l.jsxs(
14365
14371
  lT,
14366
14372
  {
@@ -14386,11 +14392,11 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], kn = "Sele
14386
14392
  {
14387
14393
  scope: e.__scopeSelect,
14388
14394
  onNativeOptionAdd: f.useCallback((F) => {
14389
- I((Z) => new Set(Z).add(F));
14395
+ I((X) => new Set(X).add(F));
14390
14396
  }, []),
14391
14397
  onNativeOptionRemove: f.useCallback((F) => {
14392
- I((Z) => {
14393
- const D = new Set(Z);
14398
+ I((X) => {
14399
+ const D = new Set(X);
14394
14400
  return D.delete(F), D;
14395
14401
  });
14396
14402
  }, []),
@@ -14411,10 +14417,10 @@ var sT = [" ", "Enter", "ArrowUp", "ArrowDown"], iT = [" ", "Enter"], kn = "Sele
14411
14417
  form: x,
14412
14418
  children: [
14413
14419
  j === void 0 ? /* @__PURE__ */ l.jsx("option", { value: "" }) : null,
14414
- Array.from(M)
14420
+ Array.from(O)
14415
14421
  ]
14416
14422
  },
14417
- B
14423
+ L
14418
14424
  ) : null
14419
14425
  ]
14420
14426
  }
@@ -14531,59 +14537,59 @@ var Mt = 10, [np, wn] = cr(Pn), hT = "SelectContentImpl", pT = Xn("SelectContent
14531
14537
  ...w
14532
14538
  } = e, b = bn(Pn, n), [y, E] = f.useState(null), [S, T] = f.useState(null), C = Te(t, (K) => E(K)), [N, j] = f.useState(null), [P, H] = f.useState(
14533
14539
  null
14534
- ), A = ks(n), [M, I] = f.useState(!1), B = f.useRef(!1);
14540
+ ), A = ks(n), [O, I] = f.useState(!1), L = f.useRef(!1);
14535
14541
  f.useEffect(() => {
14536
14542
  if (y) return da(y);
14537
14543
  }, [y]), ua();
14538
14544
  const F = f.useCallback(
14539
14545
  (K) => {
14540
- const [_, ...X] = A().map((se) => se.ref.current), [te] = X.slice(-1), ue = document.activeElement;
14546
+ const [_, ...J] = A().map((se) => se.ref.current), [te] = J.slice(-1), ue = document.activeElement;
14541
14547
  for (const se of K)
14542
14548
  if (se === ue || (se == null || se.scrollIntoView({ block: "nearest" }), se === _ && S && (S.scrollTop = 0), se === te && S && (S.scrollTop = S.scrollHeight), se == null || se.focus(), document.activeElement !== ue)) return;
14543
14549
  },
14544
14550
  [A, S]
14545
- ), Z = f.useCallback(
14551
+ ), X = f.useCallback(
14546
14552
  () => F([N, y]),
14547
14553
  [F, N, y]
14548
14554
  );
14549
14555
  f.useEffect(() => {
14550
- M && Z();
14551
- }, [M, Z]);
14552
- const { onOpenChange: D, triggerPointerDownPosRef: O } = b;
14556
+ O && X();
14557
+ }, [O, X]);
14558
+ const { onOpenChange: D, triggerPointerDownPosRef: M } = b;
14553
14559
  f.useEffect(() => {
14554
14560
  if (y) {
14555
14561
  let K = { x: 0, y: 0 };
14556
14562
  const _ = (te) => {
14557
14563
  var ue, se;
14558
14564
  K = {
14559
- x: Math.abs(Math.round(te.pageX) - (((ue = O.current) == null ? void 0 : ue.x) ?? 0)),
14560
- y: Math.abs(Math.round(te.pageY) - (((se = O.current) == null ? void 0 : se.y) ?? 0))
14565
+ x: Math.abs(Math.round(te.pageX) - (((ue = M.current) == null ? void 0 : ue.x) ?? 0)),
14566
+ y: Math.abs(Math.round(te.pageY) - (((se = M.current) == null ? void 0 : se.y) ?? 0))
14561
14567
  };
14562
- }, X = (te) => {
14563
- K.x <= 10 && K.y <= 10 ? te.preventDefault() : y.contains(te.target) || D(!1), document.removeEventListener("pointermove", _), O.current = null;
14568
+ }, J = (te) => {
14569
+ K.x <= 10 && K.y <= 10 ? te.preventDefault() : y.contains(te.target) || D(!1), document.removeEventListener("pointermove", _), M.current = null;
14564
14570
  };
14565
- return O.current !== null && (document.addEventListener("pointermove", _), document.addEventListener("pointerup", X, { capture: !0, once: !0 })), () => {
14566
- document.removeEventListener("pointermove", _), document.removeEventListener("pointerup", X, { capture: !0 });
14571
+ return M.current !== null && (document.addEventListener("pointermove", _), document.addEventListener("pointerup", J, { capture: !0, once: !0 })), () => {
14572
+ document.removeEventListener("pointermove", _), document.removeEventListener("pointerup", J, { capture: !0 });
14567
14573
  };
14568
14574
  }
14569
- }, [y, D, O]), f.useEffect(() => {
14575
+ }, [y, D, M]), f.useEffect(() => {
14570
14576
  const K = () => D(!1);
14571
14577
  return window.addEventListener("blur", K), window.addEventListener("resize", K), () => {
14572
14578
  window.removeEventListener("blur", K), window.removeEventListener("resize", K);
14573
14579
  };
14574
14580
  }, [D]);
14575
14581
  const [G, Q] = wp((K) => {
14576
- const _ = A().filter((ue) => !ue.disabled), X = _.find((ue) => ue.ref.current === document.activeElement), te = yp(_, K, X);
14582
+ const _ = A().filter((ue) => !ue.disabled), J = _.find((ue) => ue.ref.current === document.activeElement), te = yp(_, K, J);
14577
14583
  te && setTimeout(() => te.ref.current.focus());
14578
14584
  }), q = f.useCallback(
14579
- (K, _, X) => {
14580
- const te = !B.current && !X;
14581
- (b.value !== void 0 && b.value === _ || te) && (j(K), te && (B.current = !0));
14585
+ (K, _, J) => {
14586
+ const te = !L.current && !J;
14587
+ (b.value !== void 0 && b.value === _ || te) && (j(K), te && (L.current = !0));
14582
14588
  },
14583
14589
  [b.value]
14584
14590
  ), $ = f.useCallback(() => y == null ? void 0 : y.focus(), [y]), Y = f.useCallback(
14585
- (K, _, X) => {
14586
- const te = !B.current && !X;
14591
+ (K, _, J) => {
14592
+ const te = !L.current && !J;
14587
14593
  (b.value !== void 0 && b.value === _ || te) && H(K);
14588
14594
  },
14589
14595
  [b.value]
@@ -14610,10 +14616,10 @@ var Mt = 10, [np, wn] = cr(Pn), hT = "SelectContentImpl", pT = Xn("SelectContent
14610
14616
  selectedItem: N,
14611
14617
  onItemLeave: $,
14612
14618
  itemTextRefCallback: Y,
14613
- focusSelectedItem: Z,
14619
+ focusSelectedItem: X,
14614
14620
  selectedItemText: P,
14615
14621
  position: r,
14616
- isPositioned: M,
14622
+ isPositioned: O,
14617
14623
  searchRef: G,
14618
14624
  children: /* @__PURE__ */ l.jsx(us, { as: pT, allowPinchZoom: !0, children: /* @__PURE__ */ l.jsx(
14619
14625
  as,
@@ -14700,14 +14706,14 @@ var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14700
14706
  ]);
14701
14707
  a.style.minWidth = Pe + "px", a.style.right = je + "px";
14702
14708
  }
14703
- const H = m(), A = window.innerHeight - Mt * 2, M = g.scrollHeight, I = window.getComputedStyle(u), B = parseInt(I.borderTopWidth, 10), F = parseInt(I.paddingTop, 10), Z = parseInt(I.borderBottomWidth, 10), D = parseInt(I.paddingBottom, 10), O = B + F + M + D + Z, G = Math.min(p.offsetHeight * 5, O), Q = window.getComputedStyle(g), q = parseInt(Q.paddingTop, 10), $ = parseInt(Q.paddingBottom, 10), Y = C.top + C.height / 2 - Mt, ye = A - Y, ce = p.offsetHeight / 2, K = p.offsetTop + ce, _ = B + F + K, X = O - _;
14709
+ const H = m(), A = window.innerHeight - Mt * 2, O = g.scrollHeight, I = window.getComputedStyle(u), L = parseInt(I.borderTopWidth, 10), F = parseInt(I.paddingTop, 10), X = parseInt(I.borderBottomWidth, 10), D = parseInt(I.paddingBottom, 10), M = L + F + O + D + X, G = Math.min(p.offsetHeight * 5, M), Q = window.getComputedStyle(g), q = parseInt(Q.paddingTop, 10), $ = parseInt(Q.paddingBottom, 10), Y = C.top + C.height / 2 - Mt, ye = A - Y, ce = p.offsetHeight / 2, K = p.offsetTop + ce, _ = L + F + K, J = M - _;
14704
14710
  if (_ <= Y) {
14705
14711
  const ue = H.length > 0 && p === H[H.length - 1].ref.current;
14706
14712
  a.style.bottom = "0px";
14707
14713
  const se = u.clientHeight - g.offsetTop - g.offsetHeight, ke = Math.max(
14708
14714
  ye,
14709
14715
  ce + // viewport might have padding bottom, include it to avoid a scrollable viewport
14710
- (ue ? $ : 0) + se + Z
14716
+ (ue ? $ : 0) + se + X
14711
14717
  ), Pe = _ + ke;
14712
14718
  a.style.height = Pe + "px";
14713
14719
  } else {
@@ -14715,9 +14721,9 @@ var mT = "SelectItemAlignedPosition", op = f.forwardRef((e, t) => {
14715
14721
  a.style.top = "0px";
14716
14722
  const ke = Math.max(
14717
14723
  Y,
14718
- B + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
14724
+ L + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
14719
14725
  (ue ? q : 0) + ce
14720
- ) + X;
14726
+ ) + J;
14721
14727
  a.style.height = ke + "px", g.scrollTop = _ - Y + g.offsetTop;
14722
14728
  }
14723
14729
  a.style.margin = `${Mt}px 0`, a.style.minHeight = G + "px", a.style.maxHeight = A + "px", r == null || r(), requestAnimationFrame(() => v.current = !0);
@@ -15140,7 +15146,7 @@ const vc = ET, bc = NT, Bi = f.forwardRef(({ className: e, children: t, ...n },
15140
15146
  Sp,
15141
15147
  {
15142
15148
  ref: r,
15143
- className: L(
15149
+ className: B(
15144
15150
  "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
15145
15151
  e
15146
15152
  ),
@@ -15156,7 +15162,7 @@ const jp = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15156
15162
  Ep,
15157
15163
  {
15158
15164
  ref: n,
15159
- className: L(
15165
+ className: B(
15160
15166
  "flex cursor-default items-center justify-center py-1",
15161
15167
  e
15162
15168
  ),
@@ -15169,7 +15175,7 @@ const Ap = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15169
15175
  Np,
15170
15176
  {
15171
15177
  ref: n,
15172
- className: L(
15178
+ className: B(
15173
15179
  "flex cursor-default items-center justify-center py-1",
15174
15180
  e
15175
15181
  ),
@@ -15182,7 +15188,7 @@ const Hi = f.forwardRef(({ className: e, children: t, position: n = "popper", ..
15182
15188
  Cp,
15183
15189
  {
15184
15190
  ref: o,
15185
- className: L(
15191
+ className: B(
15186
15192
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
15187
15193
  n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
15188
15194
  e
@@ -15194,7 +15200,7 @@ const Hi = f.forwardRef(({ className: e, children: t, position: n = "popper", ..
15194
15200
  /* @__PURE__ */ l.jsx(
15195
15201
  AT,
15196
15202
  {
15197
- className: L(
15203
+ className: B(
15198
15204
  "p-1",
15199
15205
  n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
15200
15206
  ),
@@ -15210,7 +15216,7 @@ const _T = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15210
15216
  Tp,
15211
15217
  {
15212
15218
  ref: n,
15213
- className: L("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
15219
+ className: B("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
15214
15220
  ...t
15215
15221
  }
15216
15222
  ));
@@ -15219,7 +15225,7 @@ const yn = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
15219
15225
  Rp,
15220
15226
  {
15221
15227
  ref: r,
15222
- className: L(
15228
+ className: B(
15223
15229
  "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
15224
15230
  e
15225
15231
  ),
@@ -15235,7 +15241,7 @@ const OT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15235
15241
  Ip,
15236
15242
  {
15237
15243
  ref: n,
15238
- className: L("-mx-1 my-1 h-px bg-muted", e),
15244
+ className: B("-mx-1 my-1 h-px bg-muted", e),
15239
15245
  ...t
15240
15246
  }
15241
15247
  ));
@@ -15244,7 +15250,7 @@ const No = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15244
15250
  "div",
15245
15251
  {
15246
15252
  ref: n,
15247
- className: L(
15253
+ className: B(
15248
15254
  "rounded-lg border bg-card text-card-foreground shadow-sm",
15249
15255
  e
15250
15256
  ),
@@ -15256,7 +15262,7 @@ const Io = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15256
15262
  "div",
15257
15263
  {
15258
15264
  ref: n,
15259
- className: L("flex flex-col space-y-1.5 p-6", e),
15265
+ className: B("flex flex-col space-y-1.5 p-6", e),
15260
15266
  ...t
15261
15267
  }
15262
15268
  ));
@@ -15265,7 +15271,7 @@ const jo = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15265
15271
  "h3",
15266
15272
  {
15267
15273
  ref: n,
15268
- className: L(
15274
+ className: B(
15269
15275
  "text-2xl font-semibold leading-none tracking-tight",
15270
15276
  e
15271
15277
  ),
@@ -15277,18 +15283,18 @@ const MT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15277
15283
  "p",
15278
15284
  {
15279
15285
  ref: n,
15280
- className: L("text-sm text-muted-foreground", e),
15286
+ className: B("text-sm text-muted-foreground", e),
15281
15287
  ...t
15282
15288
  }
15283
15289
  ));
15284
15290
  MT.displayName = "CardDescription";
15285
- const Ao = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx("div", { ref: n, className: L("p-6 pt-0", e), ...t }));
15291
+ const Ao = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx("div", { ref: n, className: B("p-6 pt-0", e), ...t }));
15286
15292
  Ao.displayName = "CardContent";
15287
15293
  const DT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ l.jsx(
15288
15294
  "div",
15289
15295
  {
15290
15296
  ref: n,
15291
- className: L("flex items-center p-6 pt-0", e),
15297
+ className: B("flex items-center p-6 pt-0", e),
15292
15298
  ...t
15293
15299
  }
15294
15300
  ));