teodor-new-chat-ui 3.0.143 → 3.0.145

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
@@ -54,16 +54,16 @@ function gm() {
54
54
  var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
55
55
  function b(T) {
56
56
  {
57
- for (var z = arguments.length, re = new Array(z > 1 ? z - 1 : 0), xe = 1; xe < z; xe++)
58
- re[xe - 1] = arguments[xe];
59
- y("error", T, re);
57
+ for (var z = arguments.length, ne = new Array(z > 1 ? z - 1 : 0), xe = 1; xe < z; xe++)
58
+ ne[xe - 1] = arguments[xe];
59
+ y("error", T, ne);
60
60
  }
61
61
  }
62
- function y(T, z, re) {
62
+ function y(T, z, ne) {
63
63
  {
64
64
  var xe = g.ReactDebugCurrentFrame, Le = xe.getStackAddendum();
65
- Le !== "" && (z += "%s", re = re.concat([Le]));
66
- var He = re.map(function(Pe) {
65
+ Le !== "" && (z += "%s", ne = ne.concat([Le]));
66
+ var He = ne.map(function(Pe) {
67
67
  return String(Pe);
68
68
  });
69
69
  He.unshift("Warning: " + z), Function.prototype.apply.call(console[T], console, He);
@@ -78,12 +78,12 @@ function gm() {
78
78
  // with.
79
79
  T.$$typeof === I || T.getModuleId !== void 0));
80
80
  }
81
- function P(T, z, re) {
81
+ function P(T, z, ne) {
82
82
  var xe = T.displayName;
83
83
  if (xe)
84
84
  return xe;
85
85
  var Le = z.displayName || z.name || "";
86
- return Le !== "" ? re + "(" + Le + ")" : re;
86
+ return Le !== "" ? ne + "(" + Le + ")" : ne;
87
87
  }
88
88
  function B(T) {
89
89
  return T.displayName || "Context";
@@ -115,8 +115,8 @@ function gm() {
115
115
  var z = T;
116
116
  return B(z) + ".Consumer";
117
117
  case i:
118
- var re = T;
119
- return B(re._context) + ".Provider";
118
+ var ne = T;
119
+ return B(ne._context) + ".Provider";
120
120
  case l:
121
121
  return P(T, T.render, "ForwardRef");
122
122
  case h:
@@ -133,14 +133,14 @@ function gm() {
133
133
  }
134
134
  return null;
135
135
  }
136
- var _ = Object.assign, Y = 0, U, se, O, M, K, W, ee;
136
+ var _ = Object.assign, Y = 0, U, oe, O, D, K, W, ee;
137
137
  function L() {
138
138
  }
139
139
  L.__reactDisabledLog = !0;
140
140
  function Z() {
141
141
  {
142
142
  if (Y === 0) {
143
- U = console.log, se = console.info, O = console.warn, M = console.error, K = console.group, W = console.groupCollapsed, ee = console.groupEnd;
143
+ U = console.log, oe = console.info, O = console.warn, D = console.error, K = console.group, W = console.groupCollapsed, ee = console.groupEnd;
144
144
  var T = {
145
145
  configurable: !0,
146
146
  enumerable: !0,
@@ -173,13 +173,13 @@ function gm() {
173
173
  value: U
174
174
  }),
175
175
  info: _({}, T, {
176
- value: se
176
+ value: oe
177
177
  }),
178
178
  warn: _({}, T, {
179
179
  value: O
180
180
  }),
181
181
  error: _({}, T, {
182
- value: M
182
+ value: D
183
183
  }),
184
184
  group: _({}, T, {
185
185
  value: K
@@ -196,7 +196,7 @@ function gm() {
196
196
  }
197
197
  }
198
198
  var he = g.ReactCurrentDispatcher, F;
199
- function A(T, z, re) {
199
+ function A(T, z, ne) {
200
200
  {
201
201
  if (F === void 0)
202
202
  try {
@@ -214,13 +214,13 @@ function gm() {
214
214
  var ce = typeof WeakMap == "function" ? WeakMap : Map;
215
215
  J = new ce();
216
216
  }
217
- function ie(T, z) {
217
+ function se(T, z) {
218
218
  if (!T || H)
219
219
  return "";
220
220
  {
221
- var re = J.get(T);
222
- if (re !== void 0)
223
- return re;
221
+ var ne = J.get(T);
222
+ if (ne !== void 0)
223
+ return ne;
224
224
  }
225
225
  var xe;
226
226
  H = !0;
@@ -263,14 +263,14 @@ function gm() {
263
263
  } catch (bt) {
264
264
  if (bt && xe && typeof bt.stack == "string") {
265
265
  for (var Ie = bt.stack.split(`
266
- `), mt = xe.stack.split(`
267
- `), Xe = Ie.length - 1, tt = mt.length - 1; Xe >= 1 && tt >= 0 && Ie[Xe] !== mt[tt]; )
266
+ `), pt = xe.stack.split(`
267
+ `), Xe = Ie.length - 1, tt = pt.length - 1; Xe >= 1 && tt >= 0 && Ie[Xe] !== pt[tt]; )
268
268
  tt--;
269
269
  for (; Xe >= 1 && tt >= 0; Xe--, tt--)
270
- if (Ie[Xe] !== mt[tt]) {
270
+ if (Ie[Xe] !== pt[tt]) {
271
271
  if (Xe !== 1 || tt !== 1)
272
272
  do
273
- if (Xe--, tt--, tt < 0 || Ie[Xe] !== mt[tt]) {
273
+ if (Xe--, tt--, tt < 0 || Ie[Xe] !== pt[tt]) {
274
274
  var kt = `
275
275
  ` + Ie[Xe].replace(" at new ", " at ");
276
276
  return T.displayName && kt.includes("<anonymous>") && (kt = kt.replace("<anonymous>", T.displayName)), typeof T == "function" && J.set(T, kt), kt;
@@ -285,18 +285,18 @@ function gm() {
285
285
  var Yn = T ? T.displayName || T.name : "", In = Yn ? A(Yn) : "";
286
286
  return typeof T == "function" && J.set(T, In), In;
287
287
  }
288
- function Ae(T, z, re) {
289
- return ie(T, !1);
288
+ function Ae(T, z, ne) {
289
+ return se(T, !1);
290
290
  }
291
291
  function _e(T) {
292
292
  var z = T.prototype;
293
293
  return !!(z && z.isReactComponent);
294
294
  }
295
- function je(T, z, re) {
295
+ function je(T, z, ne) {
296
296
  if (T == null)
297
297
  return "";
298
298
  if (typeof T == "function")
299
- return ie(T, _e(T));
299
+ return se(T, _e(T));
300
300
  if (typeof T == "string")
301
301
  return A(T);
302
302
  switch (T) {
@@ -310,41 +310,41 @@ function gm() {
310
310
  case l:
311
311
  return Ae(T.render);
312
312
  case h:
313
- return je(T.type, z, re);
313
+ return je(T.type, z, ne);
314
314
  case m: {
315
315
  var xe = T, Le = xe._payload, He = xe._init;
316
316
  try {
317
- return je(He(Le), z, re);
317
+ return je(He(Le), z, ne);
318
318
  } catch {
319
319
  }
320
320
  }
321
321
  }
322
322
  return "";
323
323
  }
324
- var ae = Object.prototype.hasOwnProperty, Ne = {}, Se = g.ReactDebugCurrentFrame;
324
+ var ie = Object.prototype.hasOwnProperty, Ne = {}, Se = g.ReactDebugCurrentFrame;
325
325
  function fe(T) {
326
326
  if (T) {
327
- var z = T._owner, re = je(T.type, T._source, z ? z.type : null);
328
- Se.setExtraStackFrame(re);
327
+ var z = T._owner, ne = je(T.type, T._source, z ? z.type : null);
328
+ Se.setExtraStackFrame(ne);
329
329
  } else
330
330
  Se.setExtraStackFrame(null);
331
331
  }
332
- function Ce(T, z, re, xe, Le) {
332
+ function Ce(T, z, ne, xe, Le) {
333
333
  {
334
- var He = Function.call.bind(ae);
334
+ var He = Function.call.bind(ie);
335
335
  for (var Pe in T)
336
336
  if (He(T, Pe)) {
337
337
  var Ie = void 0;
338
338
  try {
339
339
  if (typeof T[Pe] != "function") {
340
- var mt = Error((xe || "React class") + ": " + re + " type `" + Pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
- throw mt.name = "Invariant Violation", mt;
340
+ var pt = Error((xe || "React class") + ": " + ne + " type `" + Pe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof T[Pe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
341
+ throw pt.name = "Invariant Violation", pt;
342
342
  }
343
- Ie = T[Pe](z, Pe, xe, re, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
343
+ Ie = T[Pe](z, Pe, xe, ne, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
344
344
  } catch (Xe) {
345
345
  Ie = Xe;
346
346
  }
347
- Ie && !(Ie instanceof Error) && (fe(Le), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", xe || "React class", re, Pe, typeof Ie), fe(null)), Ie instanceof Error && !(Ie.message in Ne) && (Ne[Ie.message] = !0, fe(Le), b("Failed %s type: %s", re, Ie.message), fe(null));
347
+ Ie && !(Ie instanceof Error) && (fe(Le), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", xe || "React class", ne, Pe, typeof Ie), fe(null)), Ie instanceof Error && !(Ie.message in Ne) && (Ne[Ie.message] = !0, fe(Le), b("Failed %s type: %s", ne, Ie.message), fe(null));
348
348
  }
349
349
  }
350
350
  }
@@ -354,11 +354,11 @@ function gm() {
354
354
  }
355
355
  function et(T) {
356
356
  {
357
- var z = typeof Symbol == "function" && Symbol.toStringTag, re = z && T[Symbol.toStringTag] || T.constructor.name || "Object";
358
- return re;
357
+ var z = typeof Symbol == "function" && Symbol.toStringTag, ne = z && T[Symbol.toStringTag] || T.constructor.name || "Object";
358
+ return ne;
359
359
  }
360
360
  }
361
- function xt(T) {
361
+ function vt(T) {
362
362
  try {
363
363
  return it(T), !1;
364
364
  } catch {
@@ -369,25 +369,25 @@ function gm() {
369
369
  return "" + T;
370
370
  }
371
371
  function an(T) {
372
- if (xt(T))
372
+ if (vt(T))
373
373
  return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(T)), it(T);
374
374
  }
375
- var V = g.ReactCurrentOwner, ne = {
375
+ var V = g.ReactCurrentOwner, ae = {
376
376
  key: !0,
377
377
  ref: !0,
378
378
  __self: !0,
379
379
  __source: !0
380
380
  }, $e, qe;
381
381
  function Re(T) {
382
- if (ae.call(T, "ref")) {
382
+ if (ie.call(T, "ref")) {
383
383
  var z = Object.getOwnPropertyDescriptor(T, "ref").get;
384
384
  if (z && z.isReactWarning)
385
385
  return !1;
386
386
  }
387
387
  return T.ref !== void 0;
388
388
  }
389
- function ht(T) {
390
- if (ae.call(T, "key")) {
389
+ function xt(T) {
390
+ if (ie.call(T, "key")) {
391
391
  var z = Object.getOwnPropertyDescriptor(T, "key").get;
392
392
  if (z && z.isReactWarning)
393
393
  return !1;
@@ -399,34 +399,34 @@ function gm() {
399
399
  }
400
400
  function En(T, z) {
401
401
  {
402
- var re = function() {
402
+ var ne = function() {
403
403
  $e || ($e = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", z));
404
404
  };
405
- re.isReactWarning = !0, Object.defineProperty(T, "key", {
406
- get: re,
405
+ ne.isReactWarning = !0, Object.defineProperty(T, "key", {
406
+ get: ne,
407
407
  configurable: !0
408
408
  });
409
409
  }
410
410
  }
411
411
  function lt(T, z) {
412
412
  {
413
- var re = function() {
413
+ var ne = function() {
414
414
  qe || (qe = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", z));
415
415
  };
416
- re.isReactWarning = !0, Object.defineProperty(T, "ref", {
417
- get: re,
416
+ ne.isReactWarning = !0, Object.defineProperty(T, "ref", {
417
+ get: ne,
418
418
  configurable: !0
419
419
  });
420
420
  }
421
421
  }
422
- var Tt = function(T, z, re, xe, Le, He, Pe) {
422
+ var Tt = function(T, z, ne, xe, Le, He, Pe) {
423
423
  var Ie = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
425
  $$typeof: t,
426
426
  // Built-in properties that belong on the element
427
427
  type: T,
428
428
  key: z,
429
- ref: re,
429
+ ref: ne,
430
430
  props: Pe,
431
431
  // Record the component responsible for creating this element.
432
432
  _owner: He
@@ -448,29 +448,29 @@ function gm() {
448
448
  value: Le
449
449
  }), Object.freeze && (Object.freeze(Ie.props), Object.freeze(Ie)), Ie;
450
450
  };
451
- function at(T, z, re, xe, Le) {
451
+ function at(T, z, ne, xe, Le) {
452
452
  {
453
- var He, Pe = {}, Ie = null, mt = null;
454
- re !== void 0 && (an(re), Ie = "" + re), ht(z) && (an(z.key), Ie = "" + z.key), Re(z) && (mt = z.ref, jt(z, Le));
453
+ var He, Pe = {}, Ie = null, pt = null;
454
+ ne !== void 0 && (an(ne), Ie = "" + ne), xt(z) && (an(z.key), Ie = "" + z.key), Re(z) && (pt = z.ref, jt(z, Le));
455
455
  for (He in z)
456
- ae.call(z, He) && !ne.hasOwnProperty(He) && (Pe[He] = z[He]);
456
+ ie.call(z, He) && !ae.hasOwnProperty(He) && (Pe[He] = z[He]);
457
457
  if (T && T.defaultProps) {
458
458
  var Xe = T.defaultProps;
459
459
  for (He in Xe)
460
460
  Pe[He] === void 0 && (Pe[He] = Xe[He]);
461
461
  }
462
- if (Ie || mt) {
462
+ if (Ie || pt) {
463
463
  var tt = typeof T == "function" ? T.displayName || T.name || "Unknown" : T;
464
- Ie && En(Pe, tt), mt && lt(Pe, tt);
464
+ Ie && En(Pe, tt), pt && lt(Pe, tt);
465
465
  }
466
- return Tt(T, Ie, mt, Le, xe, V.current, Pe);
466
+ return Tt(T, Ie, pt, Le, xe, V.current, Pe);
467
467
  }
468
468
  }
469
- var pt = g.ReactCurrentOwner, cn = g.ReactDebugCurrentFrame;
469
+ var ht = g.ReactCurrentOwner, cn = g.ReactDebugCurrentFrame;
470
470
  function Yt(T) {
471
471
  if (T) {
472
- var z = T._owner, re = je(T.type, T._source, z ? z.type : null);
473
- cn.setExtraStackFrame(re);
472
+ var z = T._owner, ne = je(T.type, T._source, z ? z.type : null);
473
+ cn.setExtraStackFrame(ne);
474
474
  } else
475
475
  cn.setExtraStackFrame(null);
476
476
  }
@@ -481,8 +481,8 @@ function gm() {
481
481
  }
482
482
  function le() {
483
483
  {
484
- if (pt.current) {
485
- var T = G(pt.current.type);
484
+ if (ht.current) {
485
+ var T = G(ht.current.type);
486
486
  if (T)
487
487
  return `
488
488
 
@@ -499,10 +499,10 @@ Check the render method of \`` + T + "`.";
499
499
  {
500
500
  var z = le();
501
501
  if (!z) {
502
- var re = typeof T == "string" ? T : T.displayName || T.name;
503
- re && (z = `
502
+ var ne = typeof T == "string" ? T : T.displayName || T.name;
503
+ ne && (z = `
504
504
 
505
- Check the top-level render call using <` + re + ">.");
505
+ Check the top-level render call using <` + ne + ">.");
506
506
  }
507
507
  return z;
508
508
  }
@@ -512,12 +512,12 @@ Check the top-level render call using <` + re + ">.");
512
512
  if (!T._store || T._store.validated || T.key != null)
513
513
  return;
514
514
  T._store.validated = !0;
515
- var re = Nn(z);
516
- if (Ye[re])
515
+ var ne = Nn(z);
516
+ if (Ye[ne])
517
517
  return;
518
- Ye[re] = !0;
518
+ Ye[ne] = !0;
519
519
  var xe = "";
520
- T && T._owner && T._owner !== pt.current && (xe = " It was passed a child from " + G(T._owner.type) + "."), Yt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', re, xe), Yt(null);
520
+ T && T._owner && T._owner !== ht.current && (xe = " It was passed a child from " + G(T._owner.type) + "."), Yt(T), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', ne, xe), Yt(null);
521
521
  }
522
522
  }
523
523
  function Gn(T, z) {
@@ -525,8 +525,8 @@ Check the top-level render call using <` + re + ">.");
525
525
  if (typeof T != "object")
526
526
  return;
527
527
  if (ot(T))
528
- for (var re = 0; re < T.length; re++) {
529
- var xe = T[re];
528
+ for (var ne = 0; ne < T.length; ne++) {
529
+ var xe = T[ne];
530
530
  te(xe) && Vn(xe, z);
531
531
  }
532
532
  else if (te(T))
@@ -544,18 +544,18 @@ Check the top-level render call using <` + re + ">.");
544
544
  var z = T.type;
545
545
  if (z == null || typeof z == "string")
546
546
  return;
547
- var re;
547
+ var ne;
548
548
  if (typeof z == "function")
549
- re = z.propTypes;
549
+ ne = z.propTypes;
550
550
  else if (typeof z == "object" && (z.$$typeof === l || // Note: Memo only checks outer props here.
551
551
  // Inner props are checked in the reconciler.
552
552
  z.$$typeof === h))
553
- re = z.propTypes;
553
+ ne = z.propTypes;
554
554
  else
555
555
  return;
556
- if (re) {
556
+ if (ne) {
557
557
  var xe = G(z);
558
- Ce(re, T.props, "prop", xe, T);
558
+ Ce(ne, T.props, "prop", xe, T);
559
559
  } else if (z.PropTypes !== void 0 && !hn) {
560
560
  hn = !0;
561
561
  var Le = G(z);
@@ -566,8 +566,8 @@ Check the top-level render call using <` + re + ">.");
566
566
  }
567
567
  function oo(T) {
568
568
  {
569
- for (var z = Object.keys(T.props), re = 0; re < z.length; re++) {
570
- var xe = z[re];
569
+ for (var z = Object.keys(T.props), ne = 0; ne < z.length; ne++) {
570
+ var xe = z[ne];
571
571
  if (xe !== "children" && xe !== "key") {
572
572
  Yt(T), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", xe), Yt(null);
573
573
  break;
@@ -577,18 +577,18 @@ Check the top-level render call using <` + re + ">.");
577
577
  }
578
578
  }
579
579
  var qt = {};
580
- function Kn(T, z, re, xe, Le, He) {
580
+ function Kn(T, z, ne, xe, Le, He) {
581
581
  {
582
582
  var Pe = j(T);
583
583
  if (!Pe) {
584
584
  var Ie = "";
585
585
  (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).length === 0) && (Ie += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var mt = Oe();
587
- mt ? Ie += mt : Ie += le();
586
+ var pt = Oe();
587
+ pt ? Ie += pt : Ie += le();
588
588
  var Xe;
589
589
  T === null ? Xe = "null" : ot(T) ? Xe = "array" : T !== void 0 && T.$$typeof === t ? (Xe = "<" + (G(T.type) || "Unknown") + " />", Ie = " Did you accidentally export a JSX literal instead of a component?") : Xe = typeof T, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Xe, Ie);
590
590
  }
591
- var tt = at(T, z, re, Le, He);
591
+ var tt = at(T, z, ne, Le, He);
592
592
  if (tt == null)
593
593
  return tt;
594
594
  if (Pe) {
@@ -604,7 +604,7 @@ Check the top-level render call using <` + re + ">.");
604
604
  else
605
605
  Gn(kt, T);
606
606
  }
607
- if (ae.call(z, "key")) {
607
+ if (ie.call(z, "key")) {
608
608
  var In = G(T), bt = Object.keys(z).filter(function(Bp) {
609
609
  return Bp !== "key";
610
610
  }), Ms = bt.length > 0 ? "{key: someKey, " + bt.join(": ..., ") + ": ...}" : "{key: someKey}";
@@ -621,11 +621,11 @@ React keys must be passed directly to JSX without using spread:
621
621
  return T === r ? oo(tt) : ro(tt), tt;
622
622
  }
623
623
  }
624
- function Op(T, z, re) {
625
- return Kn(T, z, re, !0);
624
+ function Op(T, z, ne) {
625
+ return Kn(T, z, ne, !0);
626
626
  }
627
- function Mp(T, z, re) {
628
- return Kn(T, z, re, !1);
627
+ function Mp(T, z, ne) {
628
+ return Kn(T, z, ne, !1);
629
629
  }
630
630
  var Dp = Mp, Lp = Op;
631
631
  wr.Fragment = r, wr.jsx = Dp, wr.jsxs = Lp;
@@ -1887,7 +1887,7 @@ const Vl = (e) => {
1887
1887
  }
1888
1888
  }
1889
1889
  k.isString(I) || (I = I ? "include" : "omit");
1890
- const U = s && "credentials" in n.prototype, se = {
1890
+ const U = s && "credentials" in n.prototype, oe = {
1891
1891
  ...j,
1892
1892
  signal: B,
1893
1893
  method: p.toUpperCase(),
@@ -1896,10 +1896,10 @@ const Vl = (e) => {
1896
1896
  duplex: "half",
1897
1897
  credentials: U ? I : void 0
1898
1898
  };
1899
- G = s && new n(v, se);
1900
- let O = await (s ? P(G, j) : P(v, se));
1901
- const M = d && (E === "stream" || E === "response");
1902
- if (d && (S || M && _)) {
1899
+ G = s && new n(v, oe);
1900
+ let O = await (s ? P(G, j) : P(v, oe));
1901
+ const D = d && (E === "stream" || E === "response");
1902
+ if (d && (S || D && _)) {
1903
1903
  const W = {};
1904
1904
  ["status", "statusText", "headers"].forEach((pe) => {
1905
1905
  W[pe] = O[pe];
@@ -1917,7 +1917,7 @@ const Vl = (e) => {
1917
1917
  }
1918
1918
  E = E || "text";
1919
1919
  let K = await h[k.findKey(h, E) || "text"](O, x);
1920
- return !M && _ && _(), await new Promise((W, ee) => {
1920
+ return !D && _ && _(), await new Promise((W, ee) => {
1921
1921
  Ul(W, ee, {
1922
1922
  data: K,
1923
1923
  headers: yt.from(O.headers),
@@ -2531,7 +2531,7 @@ function Jg(e = {}) {
2531
2531
  b.current && (b.current.abort(), b.current = null), a(!0), u(null), e.autoAppendAssistant !== !1 && h("");
2532
2532
  const P = new AbortController();
2533
2533
  return b.current = P, (async () => {
2534
- var _, Y, U, se, O, M;
2534
+ var _, Y, U, oe, O, D;
2535
2535
  const B = (() => {
2536
2536
  var K;
2537
2537
  try {
@@ -2589,25 +2589,25 @@ function Jg(e = {}) {
2589
2589
  let ee = null, L = null, Z = null;
2590
2590
  try {
2591
2591
  const pe = W.headers.get("X-Thread-Id") || W.headers.get("x-thread-id"), he = W.headers.get("X-Thread-Created") || W.headers.get("x-thread-created"), F = pe ?? null, A = String(he ?? "").toLowerCase() === "true";
2592
- (se = j == null ? void 0 : j.onOpen) == null || se.call(j, { threadId: F, created: A }), ee = W.body.getReader(), L = new TextDecoder();
2592
+ (oe = j == null ? void 0 : j.onOpen) == null || oe.call(j, { threadId: F, created: A }), ee = W.body.getReader(), L = new TextDecoder();
2593
2593
  let H = "", J = "", ce = y.current;
2594
2594
  for (; ; ) {
2595
- const { value: ie, done: Ae } = await ee.read();
2595
+ const { value: se, done: Ae } = await ee.read();
2596
2596
  if (Ae) break;
2597
- H += L.decode(ie, { stream: !0 });
2597
+ H += L.decode(se, { stream: !0 });
2598
2598
  let _e;
2599
2599
  for (; (_e = H.indexOf(`
2600
2600
 
2601
2601
  `)) >= 0; ) {
2602
2602
  const je = H.slice(0, _e);
2603
2603
  H = H.slice(_e + 2);
2604
- const ae = Qg(je);
2605
- if (!ae) continue;
2604
+ const ie = Qg(je);
2605
+ if (!ie) continue;
2606
2606
  let Ne;
2607
2607
  try {
2608
- Ne = JSON.parse(ae);
2608
+ Ne = JSON.parse(ie);
2609
2609
  } catch {
2610
- B && console.debug("[use-chat] skip malformed SSE data:", ae == null ? void 0 : ae.slice(0, 200));
2610
+ B && console.debug("[use-chat] skip malformed SSE data:", ie == null ? void 0 : ie.slice(0, 200));
2611
2611
  continue;
2612
2612
  }
2613
2613
  const Se = Zg(Ne) ? Ne.data : Ne;
@@ -2630,7 +2630,7 @@ function Jg(e = {}) {
2630
2630
  Z && (window.clearTimeout(Z), Z = null), J && (h((Ce) => Ce + J), J = ""), Se.type === "checkpoint" ? w(Se.checkpointId) : Se.type === "error" && u(Se.message);
2631
2631
  }
2632
2632
  }
2633
- J && h((ie) => ie + J);
2633
+ J && h((se) => se + J);
2634
2634
  } catch (pe) {
2635
2635
  if ((pe == null ? void 0 : pe.name) === "AbortError") return;
2636
2636
  const he = (pe == null ? void 0 : pe.message) || String(pe);
@@ -2645,7 +2645,7 @@ function Jg(e = {}) {
2645
2645
  } catch (K) {
2646
2646
  if ((K == null ? void 0 : K.name) === "AbortError") return;
2647
2647
  const W = (K == null ? void 0 : K.message) || String(K);
2648
- B && console.debug("[use-chat] connection error:", W), u(W), (M = j == null ? void 0 : j.onError) == null || M.call(j, W);
2648
+ B && console.debug("[use-chat] connection error:", W), u(W), (D = j == null ? void 0 : j.onError) == null || D.call(j, W);
2649
2649
  } finally {
2650
2650
  a(!1), g(!1), b.current = null;
2651
2651
  }
@@ -2952,8 +2952,8 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2952
2952
  }), [x, v] = ue(() => typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
2953
2953
  Ze(() => {
2954
2954
  w(typeof l.getAuthToken == "function" ? l.getAuthToken() : null);
2955
- const V = l.onTokenChange((ne) => {
2956
- v(ne), w(ne);
2955
+ const V = l.onTokenChange((ae) => {
2956
+ v(ae), w(ae);
2957
2957
  });
2958
2958
  return () => {
2959
2959
  V();
@@ -2961,19 +2961,19 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2961
2961
  }, [l, w]);
2962
2962
  const p = Ue((V) => {
2963
2963
  l.setAuthToken(V);
2964
- }, [l]), { state: g, seed: b, prepend: y, pushUser: R, onEvent: S, reset: C } = nv(), E = 20, [N, I] = ue(!1), [j, P] = ue(!1), [B, G] = ue(null), [_, Y] = ue(void 0), [U, se] = ue(void 0), [O, M] = ue(!1), K = Ke(!1), W = Ke([]), ee = Ue((V) => {
2965
- V.cursor !== void 0 && G(V.cursor), V.hasMore !== void 0 && I(V.hasMore), V.checkpointId !== void 0 && Y(V.checkpointId), V.checkpointNs !== void 0 && se(V.checkpointNs);
2966
- }, []), L = Ue((V, ne) => {
2964
+ }, [l]), { state: g, seed: b, prepend: y, pushUser: R, onEvent: S, reset: C } = nv(), E = 20, [N, I] = ue(!1), [j, P] = ue(!1), [B, G] = ue(null), [_, Y] = ue(void 0), [U, oe] = ue(void 0), [O, D] = ue(!1), K = Ke(!1), W = Ke([]), ee = Ue((V) => {
2965
+ V.cursor !== void 0 && G(V.cursor), V.hasMore !== void 0 && I(V.hasMore), V.checkpointId !== void 0 && Y(V.checkpointId), V.checkpointNs !== void 0 && oe(V.checkpointNs);
2966
+ }, []), L = Ue((V, ae) => {
2967
2967
  const $e = async () => {
2968
2968
  if (K.current) {
2969
- console.warn(`[ChatProvider] Operation "${ne}" queued - another operation in progress`), W.current.push($e);
2969
+ console.warn(`[ChatProvider] Operation "${ae}" queued - another operation in progress`), W.current.push($e);
2970
2970
  return;
2971
2971
  }
2972
2972
  K.current = !0;
2973
2973
  try {
2974
- console.log(`[ChatProvider] Executing operation: ${ne}`), await V();
2974
+ console.log(`[ChatProvider] Executing operation: ${ae}`), await V();
2975
2975
  } catch (qe) {
2976
- throw console.error(`[ChatProvider] Operation "${ne}" failed:`, qe), qe;
2976
+ throw console.error(`[ChatProvider] Operation "${ae}" failed:`, qe), qe;
2977
2977
  } finally {
2978
2978
  K.current = !1;
2979
2979
  const qe = W.current.shift();
@@ -2981,25 +2981,25 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
2981
2981
  });
2982
2982
  }
2983
2983
  };
2984
- K.current ? (W.current.push($e), console.log(`[ChatProvider] Queued operation: ${ne}`)) : $e().catch(() => {
2984
+ K.current ? (W.current.push($e), console.log(`[ChatProvider] Queued operation: ${ae}`)) : $e().catch(() => {
2985
2985
  });
2986
2986
  }, []), Z = Ue(
2987
- (V, ne) => {
2987
+ (V, ae) => {
2988
2988
  const $e = Array.isArray(V == null ? void 0 : V.messages) ? V.messages : [];
2989
- ne === "replace" ? (console.log("[ChatProvider] Replacing messages, count:", $e.length), b($e, {
2989
+ ae === "replace" ? (console.log("[ChatProvider] Replacing messages, count:", $e.length), b($e, {
2990
2990
  checkpointId: (V == null ? void 0 : V.checkpointId) ?? null,
2991
2991
  checkpointNs: (V == null ? void 0 : V.checkpointNs) ?? null
2992
- })) : ne === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), y($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), G((V == null ? void 0 : V.nextCursor) ?? null), I(!!(V != null && V.hasMore)), Y((qe) => (V == null ? void 0 : V.checkpointId) ?? qe ?? void 0), se((qe) => (V == null ? void 0 : V.checkpointNs) ?? qe ?? void 0);
2992
+ })) : ae === "prepend" && $e.length ? (console.log("[ChatProvider] Calling prepend with", $e.length, "messages"), y($e)) : console.log("[ChatProvider] Skipping prepend - empty list or wrong mode"), G((V == null ? void 0 : V.nextCursor) ?? null), I(!!(V != null && V.hasMore)), Y((qe) => (V == null ? void 0 : V.checkpointId) ?? qe ?? void 0), oe((qe) => (V == null ? void 0 : V.checkpointNs) ?? qe ?? void 0);
2993
2993
  },
2994
2994
  [b, y]
2995
2995
  ), [pe, he] = ue([]), [F, A] = ue(null), H = Ue(async () => {
2996
2996
  const V = await l.listThreads();
2997
2997
  he(V);
2998
- }, [l]), [J, ce] = ue(!1), ie = Ue(
2998
+ }, [l]), [J, ce] = ue(!1), se = Ue(
2999
2999
  async (V) => {
3000
- const ne = (V == null ? void 0 : V.maxAttempts) ?? 5, $e = (V == null ? void 0 : V.baseDelayMs) ?? 500, qe = (V == null ? void 0 : V.timeoutMs) ?? 2e3;
3000
+ const ae = (V == null ? void 0 : V.maxAttempts) ?? 5, $e = (V == null ? void 0 : V.baseDelayMs) ?? 500, qe = (V == null ? void 0 : V.timeoutMs) ?? 2e3;
3001
3001
  if (!l.baseUrl) return !1;
3002
- const Re = l.baseUrl.replace(/\/+$/, ""), ht = [
3002
+ const Re = l.baseUrl.replace(/\/+$/, ""), xt = [
3003
3003
  "/health",
3004
3004
  "/api/health",
3005
3005
  "/",
@@ -3008,25 +3008,25 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3008
3008
  "/api/v2/chat/health"
3009
3009
  ], jt = async (lt) => {
3010
3010
  try {
3011
- const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), pt = await fetch(lt, { method: "GET", signal: Tt.signal });
3012
- return clearTimeout(at), pt.ok;
3011
+ const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), ht = await fetch(lt, { method: "GET", signal: Tt.signal });
3012
+ return clearTimeout(at), ht.ok;
3013
3013
  } catch {
3014
3014
  return !1;
3015
3015
  }
3016
3016
  }, En = async (lt) => {
3017
3017
  try {
3018
- const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), pt = await fetch(lt, { method: "HEAD", signal: Tt.signal });
3019
- return clearTimeout(at), pt.ok;
3018
+ const Tt = new AbortController(), at = setTimeout(() => Tt.abort(), qe), ht = await fetch(lt, { method: "HEAD", signal: Tt.signal });
3019
+ return clearTimeout(at), ht.ok;
3020
3020
  } catch {
3021
3021
  return !1;
3022
3022
  }
3023
3023
  };
3024
- for (let lt = 0; lt < ne; lt++) {
3025
- console.debug(`[ChatProvider] health-check attempt ${lt + 1}/${ne}`);
3026
- for (const at of ht) {
3027
- let pt = at;
3028
- Re.endsWith("/api") && at.startsWith("/api") && (pt = at.replace(/^\/api/, "") || "/");
3029
- const cn = pt === "/" ? Re + "/" : Re + pt;
3024
+ for (let lt = 0; lt < ae; lt++) {
3025
+ console.debug(`[ChatProvider] health-check attempt ${lt + 1}/${ae}`);
3026
+ for (const at of xt) {
3027
+ let ht = at;
3028
+ Re.endsWith("/api") && at.startsWith("/api") && (ht = at.replace(/^\/api/, "") || "/");
3029
+ const cn = ht === "/" ? Re + "/" : Re + ht;
3030
3030
  if (console.debug(`[ChatProvider] checking ${cn}`), await jt(cn) || at === "/" && await En(Re + "/"))
3031
3031
  return ce(!0), !0;
3032
3032
  }
@@ -3045,16 +3045,16 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3045
3045
  }
3046
3046
  return (async () => {
3047
3047
  try {
3048
- const ne = await ie();
3048
+ const ae = await se();
3049
3049
  if (!V) return;
3050
- ne ? H().catch(() => {
3050
+ ae ? H().catch(() => {
3051
3051
  }) : console.warn("[ChatProvider] backend health-check failed — skipping initial loads");
3052
3052
  } catch {
3053
3053
  }
3054
3054
  })(), () => {
3055
3055
  V = !1;
3056
3056
  };
3057
- }, [H, l.baseUrl, ie]), Ze(() => {
3057
+ }, [H, l.baseUrl, se]), Ze(() => {
3058
3058
  r == null || r(F);
3059
3059
  }, [F, r]);
3060
3060
  const Ae = Ke(null);
@@ -3068,12 +3068,12 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3068
3068
  console.debug("[ChatProvider] deferring initial load until backend health-check passes");
3069
3069
  return;
3070
3070
  }
3071
- Ae.current !== o && (Ae.current = o, ae(o).catch(() => {
3071
+ Ae.current !== o && (Ae.current = o, ie(o).catch(() => {
3072
3072
  }));
3073
3073
  }
3074
3074
  }, [o, s, l.baseUrl, J]);
3075
- const _e = Ke(null), je = Ke(null), ae = Ue(
3076
- async (V, ne, $e) => {
3075
+ const _e = Ke(null), je = Ke(null), ie = Ue(
3076
+ async (V, ae, $e) => {
3077
3077
  await L(async () => {
3078
3078
  if (!l.baseUrl) {
3079
3079
  console.debug("[ChatProvider] skipping loadThread: api.baseUrl not configured");
@@ -3093,16 +3093,16 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3093
3093
  });
3094
3094
  const Re = await l.getMessages({
3095
3095
  threadId: V,
3096
- checkpointId: ne,
3096
+ checkpointId: ae,
3097
3097
  checkpointNs: $e,
3098
3098
  limit: E
3099
3099
  });
3100
3100
  A(V);
3101
- const ht = Array.isArray(Re == null ? void 0 : Re.messages) ? Re.messages : [];
3102
- ht.length > 0 && (console.log("[ChatProvider] Loading thread with", ht.length, "messages"), b(ht, {
3101
+ const xt = Array.isArray(Re == null ? void 0 : Re.messages) ? Re.messages : [];
3102
+ console.log("[ChatProvider] Loading thread with", xt.length, "messages"), b(xt, {
3103
3103
  checkpointId: (Re == null ? void 0 : Re.checkpointId) ?? null,
3104
3104
  checkpointNs: (Re == null ? void 0 : Re.checkpointNs) ?? null
3105
- })), G((Re == null ? void 0 : Re.nextCursor) ?? null), I(!!(Re != null && Re.hasMore)), Y((jt) => (Re == null ? void 0 : Re.checkpointId) ?? jt ?? void 0), se((jt) => (Re == null ? void 0 : Re.checkpointNs) ?? jt ?? void 0);
3105
+ }), G((Re == null ? void 0 : Re.nextCursor) ?? null), I(!!(Re != null && Re.hasMore)), Y((jt) => (Re == null ? void 0 : Re.checkpointId) ?? jt ?? void 0), oe((jt) => (Re == null ? void 0 : Re.checkpointNs) ?? jt ?? void 0);
3106
3106
  } finally {
3107
3107
  _e.current = null;
3108
3108
  }
@@ -3110,9 +3110,9 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3110
3110
  },
3111
3111
  [l, L, ee, b]
3112
3112
  ), Ne = Ue(async (V) => {
3113
- const ne = await l.listCheckpoints(V);
3114
- return cv(ne, V);
3115
- }, [l]), Se = Ue(async (V, ne) => {
3113
+ const ae = await l.listCheckpoints(V);
3114
+ return cv(ae, V);
3115
+ }, [l]), Se = Ue(async (V, ae) => {
3116
3116
  await L(async () => {
3117
3117
  if (!F) throw new Error("No active thread");
3118
3118
  ee({
@@ -3124,71 +3124,56 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3124
3124
  const $e = await l.getMessages({
3125
3125
  threadId: F,
3126
3126
  checkpointId: V,
3127
- checkpointNs: ne ?? void 0,
3127
+ checkpointNs: ae ?? void 0,
3128
3128
  limit: E
3129
3129
  });
3130
3130
  Z($e, "replace");
3131
3131
  }, `navigateToCheckpoint-${V}`);
3132
3132
  }, [l, F, Z, L, ee]), fe = Ue(async () => {
3133
3133
  if (!F) throw new Error("No active thread");
3134
- await ae(F);
3135
- }, [F, ae]), Ce = Ke(!1);
3134
+ await ie(F);
3135
+ }, [F, ie]), Ce = Ke(!1);
3136
3136
  Ze(() => {
3137
3137
  const V = Ce.current;
3138
3138
  Ce.current = u, V && !u && F && L(async () => {
3139
- M(!0);
3140
- try {
3141
- const ne = await l.getMessages({
3142
- threadId: F,
3143
- // Do not pass checkpointId/checkpointNs so the backend returns the latest
3144
- checkpointId: void 0,
3145
- checkpointNs: void 0,
3146
- limit: E
3147
- });
3148
- Z(ne, "replace");
3149
- } catch (ne) {
3150
- console.warn("[ChatProvider] Post-streaming fetch failed:", ne);
3151
- } finally {
3152
- setTimeout(() => M(!1), 100);
3153
- }
3154
3139
  try {
3155
3140
  await H();
3156
- } catch (ne) {
3157
- console.warn("[ChatProvider] Post-streaming thread refresh failed:", ne);
3141
+ } catch (ae) {
3142
+ console.warn("[ChatProvider] Post-streaming thread refresh failed:", ae);
3158
3143
  }
3159
3144
  }, "postStreamingRefresh");
3160
3145
  }, [u, F, l, Z, H, L]);
3161
3146
  const Be = Ue(async (V) => {
3162
- const ne = await l.createThread(V);
3163
- return await H(), await ae(ne.threadId), ne.threadId;
3164
- }, [l, H, ae]), ot = Ue(async (V) => {
3165
- await l.deleteThread(V), await H(), F === V && (A(null), C([]), I(!1), G(null), Y(void 0), se(void 0));
3166
- }, [l, H, F, C]), et = Ue(async (V, ne) => {
3167
- await l.updateThread(V, ne), await H();
3168
- }, [l, H]), xt = Ue(async (V, ne) => {
3147
+ const ae = await l.createThread(V);
3148
+ return await H(), await ie(ae.threadId), ae.threadId;
3149
+ }, [l, H, ie]), ot = Ue(async (V) => {
3150
+ await l.deleteThread(V), await H(), F === V && (A(null), C([]), I(!1), G(null), Y(void 0), oe(void 0));
3151
+ }, [l, H, F, C]), et = Ue(async (V, ae) => {
3152
+ await l.updateThread(V, ae), await H();
3153
+ }, [l, H]), vt = Ue(async (V, ae) => {
3169
3154
  var hn;
3170
- const $e = (ne == null ? void 0 : ne.attachments) || [], { contentParts: qe, filesInfo: Re } = await uv(
3155
+ const $e = (ae == null ? void 0 : ae.attachments) || [], { contentParts: qe, filesInfo: Re } = await uv(
3171
3156
  l,
3172
3157
  $e,
3173
3158
  t == null ? void 0 : t.uploadPath
3174
- ), ht = [];
3175
- V && V.trim() && ht.push({ type: "text", text: V.trim() });
3159
+ ), xt = [];
3160
+ V && V.trim() && xt.push({ type: "text", text: V.trim() });
3176
3161
  const jt = {
3177
3162
  id: ((hn = crypto.randomUUID) == null ? void 0 : hn.call(crypto)) || `user-${Date.now()}`,
3178
3163
  role: "user",
3179
- content: ht,
3164
+ content: xt,
3180
3165
  // ← No empty text parts
3181
3166
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
3182
- checkpointId: (ne == null ? void 0 : ne.checkpointId) ?? g.lastCheckpointId ?? void 0,
3183
- checkpointNs: (ne == null ? void 0 : ne.checkpointNs) ?? g.lastCheckpointNs ?? void 0
3167
+ checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? g.lastCheckpointId ?? void 0,
3168
+ checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? g.lastCheckpointNs ?? void 0
3184
3169
  };
3185
3170
  R(jt);
3186
3171
  const En = {
3187
3172
  ...jt,
3188
3173
  // No need to filter - messageContent already only contains text
3189
- content: ht
3174
+ content: xt
3190
3175
  // ← Clean content without empty parts
3191
- }, lt = { ...(ne == null ? void 0 : ne.payloadExtras) ?? {} }, Tt = !!lt.edit, at = lt.originalMessageId, pt = typeof at == "string" ? at : void 0, cn = $e && $e.length > 0, Yt = {
3176
+ }, lt = { ...(ae == null ? void 0 : ae.payloadExtras) ?? {} }, Tt = !!lt.edit, at = lt.originalMessageId, ht = typeof at == "string" ? at : void 0, cn = $e && $e.length > 0, Yt = {
3192
3177
  ...F ? { threadId: F } : {},
3193
3178
  payload: {
3194
3179
  messages: [En],
@@ -3197,12 +3182,12 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3197
3182
  ...i && cn && a ? { active_agent: a } : {},
3198
3183
  ...lt
3199
3184
  },
3200
- checkpointId: (ne == null ? void 0 : ne.checkpointId) ?? g.lastCheckpointId ?? void 0,
3201
- checkpointNs: (ne == null ? void 0 : ne.checkpointNs) ?? g.lastCheckpointNs ?? void 0,
3202
- nodeFilter: ne == null ? void 0 : ne.nodeFilter,
3203
- config: ne == null ? void 0 : ne.config,
3185
+ checkpointId: (ae == null ? void 0 : ae.checkpointId) ?? g.lastCheckpointId ?? void 0,
3186
+ checkpointNs: (ae == null ? void 0 : ae.checkpointNs) ?? g.lastCheckpointNs ?? void 0,
3187
+ nodeFilter: ae == null ? void 0 : ae.nodeFilter,
3188
+ config: ae == null ? void 0 : ae.config,
3204
3189
  edit: Tt,
3205
- originalMessageId: pt
3190
+ originalMessageId: ht
3206
3191
  };
3207
3192
  h(
3208
3193
  Yt,
@@ -3219,8 +3204,8 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3219
3204
  async (V) => {
3220
3205
  if (!F) throw new Error("No active thread");
3221
3206
  if (j || !N) return;
3222
- const ne = B;
3223
- if (ne) {
3207
+ const ae = B;
3208
+ if (ae) {
3224
3209
  P(!0);
3225
3210
  try {
3226
3211
  const $e = await l.getMessages({
@@ -3228,7 +3213,7 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3228
3213
  checkpointId: _,
3229
3214
  checkpointNs: U,
3230
3215
  limit: (V == null ? void 0 : V.limit) ?? E,
3231
- beforeId: ne
3216
+ beforeId: ae
3232
3217
  });
3233
3218
  Z($e, "prepend");
3234
3219
  } finally {
@@ -3264,8 +3249,8 @@ function wo({ children: e, apiConfig: t, onError: n, onThreadChange: r, initialT
3264
3249
  createThread: Be,
3265
3250
  deleteThread: ot,
3266
3251
  renameThread: et,
3267
- loadThread: ae,
3268
- send: xt,
3252
+ loadThread: ie,
3253
+ send: vt,
3269
3254
  stop: m
3270
3255
  };
3271
3256
  return /* @__PURE__ */ c.jsx(Jl.Provider, { value: an, children: e });
@@ -3275,7 +3260,7 @@ function Yi() {
3275
3260
  if (!e) throw new Error("useChat must be used within ChatProvider");
3276
3261
  return e;
3277
3262
  }
3278
- function D(...e) {
3263
+ function M(...e) {
3279
3264
  return pm(hm(e));
3280
3265
  }
3281
3266
  const dv = Wr(
@@ -3308,7 +3293,7 @@ const dv = Wr(
3308
3293
  return /* @__PURE__ */ c.jsx(
3309
3294
  i,
3310
3295
  {
3311
- className: D(dv({ variant: t, size: n, className: e })),
3296
+ className: M(dv({ variant: t, size: n, className: e })),
3312
3297
  ref: s,
3313
3298
  ...o
3314
3299
  }
@@ -3320,7 +3305,7 @@ const Zl = f.forwardRef(
3320
3305
  ({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
3321
3306
  "textarea",
3322
3307
  {
3323
- className: D(
3308
+ className: M(
3324
3309
  "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",
3325
3310
  e
3326
3311
  ),
@@ -3501,7 +3486,7 @@ function ge(e) {
3501
3486
  e(n) && t(n);
3502
3487
  };
3503
3488
  }
3504
- function oe(e) {
3489
+ function re(e) {
3505
3490
  return (t) => eu(t, e);
3506
3491
  }
3507
3492
  function Jt(e) {
@@ -3801,19 +3786,19 @@ function nu(e, t, n) {
3801
3786
  }
3802
3787
  }, [a, t, i]), s;
3803
3788
  }
3804
- const gt = Me(
3789
+ const mt = Me(
3805
3790
  () => {
3806
3791
  const e = ke(), t = ke(), n = X(0), r = ke(), o = X(0), s = ke(), i = ke(), a = X(0), l = X(0), u = X(0), d = X(0), h = ke(), m = ke(), w = X(!1), x = X(!1), v = X(!1);
3807
3792
  return de(
3808
3793
  $(
3809
3794
  e,
3810
- oe(({ scrollTop: p }) => p)
3795
+ re(({ scrollTop: p }) => p)
3811
3796
  ),
3812
3797
  t
3813
3798
  ), de(
3814
3799
  $(
3815
3800
  e,
3816
- oe(({ scrollHeight: p }) => p)
3801
+ re(({ scrollHeight: p }) => p)
3817
3802
  ),
3818
3803
  i
3819
3804
  ), de(t, o), {
@@ -4162,7 +4147,7 @@ const Lv = {
4162
4147
  current: [],
4163
4148
  prev: []
4164
4149
  }),
4165
- oe(({ prev: S }) => S)
4150
+ re(({ prev: S }) => S)
4166
4151
  ),
4167
4152
  []
4168
4153
  );
@@ -4171,7 +4156,7 @@ const Lv = {
4171
4156
  l,
4172
4157
  ge((S) => S.length > 0),
4173
4158
  Te(v, w),
4174
- oe(([S, C, E]) => {
4159
+ re(([S, C, E]) => {
4175
4160
  const N = S.reduce((I, j, P) => Et(I, j, Dr(j, C.offsetTree, E) || P), tr());
4176
4161
  return {
4177
4162
  ...C,
@@ -4186,7 +4171,7 @@ const Lv = {
4186
4171
  r,
4187
4172
  Te(v),
4188
4173
  ge(([S, { lastIndex: C }]) => S < C),
4189
- oe(([S, { lastIndex: C, lastSize: E }]) => [
4174
+ re(([S, { lastIndex: C, lastSize: E }]) => [
4190
4175
  {
4191
4176
  endIndex: C,
4192
4177
  size: E,
@@ -4199,7 +4184,7 @@ const Lv = {
4199
4184
  const g = ft(
4200
4185
  $(
4201
4186
  u,
4202
- oe((S) => S === void 0)
4187
+ re((S) => S === void 0)
4203
4188
  ),
4204
4189
  !0
4205
4190
  );
@@ -4207,7 +4192,7 @@ const Lv = {
4207
4192
  $(
4208
4193
  d,
4209
4194
  ge((S) => S !== void 0 && ze(Je(v).sizeTree)),
4210
- oe((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
4195
+ re((S) => [{ endIndex: 0, size: S, startIndex: 0 }])
4211
4196
  ),
4212
4197
  n
4213
4198
  );
@@ -4222,7 +4207,7 @@ const Lv = {
4222
4207
  }),
4223
4208
  { changed: !1, sizes: x }
4224
4209
  ),
4225
- oe((S) => S.changed)
4210
+ re((S) => S.changed)
4226
4211
  )
4227
4212
  );
4228
4213
  Fe(
@@ -4232,7 +4217,7 @@ const Lv = {
4232
4217
  (S, C) => ({ diff: S.prev - C, prev: C }),
4233
4218
  { diff: 0, prev: 0 }
4234
4219
  ),
4235
- oe((S) => S.diff)
4220
+ re((S) => S.diff)
4236
4221
  ),
4237
4222
  (S) => {
4238
4223
  const { groupIndices: C } = Je(v);
@@ -4255,7 +4240,7 @@ const Lv = {
4255
4240
  $(
4256
4241
  s,
4257
4242
  Te(v),
4258
- oe(([S, C]) => {
4243
+ re(([S, C]) => {
4259
4244
  const E = C.groupIndices.length > 0, N = [], I = C.lastSize;
4260
4245
  if (E) {
4261
4246
  const j = Or(C.sizeTree, 0);
@@ -4275,8 +4260,8 @@ const Lv = {
4275
4260
  const G = An(C.sizeTree);
4276
4261
  return P !== S && G.shift(), G.reduce(
4277
4262
  (_, { k: Y, v: U }) => {
4278
- let se = _.ranges;
4279
- return _.prevSize !== 0 && (se = [
4263
+ let oe = _.ranges;
4264
+ return _.prevSize !== 0 && (oe = [
4280
4265
  ..._.ranges,
4281
4266
  {
4282
4267
  endIndex: Y + S - 1,
@@ -4286,7 +4271,7 @@ const Lv = {
4286
4271
  ]), {
4287
4272
  prevIndex: Y + S,
4288
4273
  prevSize: U,
4289
- ranges: se
4274
+ ranges: oe
4290
4275
  };
4291
4276
  },
4292
4277
  {
@@ -4316,7 +4301,7 @@ const Lv = {
4316
4301
  $(
4317
4302
  i,
4318
4303
  Te(v, w),
4319
- oe(([S, { offsetTree: C }, E]) => {
4304
+ re(([S, { offsetTree: C }, E]) => {
4320
4305
  const N = -S;
4321
4306
  return Dr(N, C, E);
4322
4307
  })
@@ -4326,7 +4311,7 @@ const Lv = {
4326
4311
  $(
4327
4312
  i,
4328
4313
  Te(v, w),
4329
- oe(([S, C, E]) => {
4314
+ re(([S, C, E]) => {
4330
4315
  if (C.groupIndices.length > 0) {
4331
4316
  if (ze(C.sizeTree))
4332
4317
  return C;
@@ -4396,31 +4381,31 @@ function Fv(e) {
4396
4381
  }
4397
4382
  const fu = Me(
4398
4383
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
4399
- const s = ke(), i = ke(), a = Nt($(s, oe(Fv)));
4384
+ const s = ke(), i = ke(), a = Nt($(s, re(Fv)));
4400
4385
  return de(
4401
4386
  $(
4402
4387
  a,
4403
- oe((l) => l.totalCount)
4388
+ re((l) => l.totalCount)
4404
4389
  ),
4405
4390
  n
4406
4391
  ), de(
4407
4392
  $(
4408
4393
  a,
4409
- oe((l) => l.groupIndices)
4394
+ re((l) => l.groupIndices)
4410
4395
  ),
4411
4396
  e
4412
4397
  ), de(
4413
4398
  $(
4414
4399
  nt(o, t, r),
4415
4400
  ge(([l, u]) => as(u)),
4416
- oe(([l, u, d]) => zt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
4401
+ re(([l, u, d]) => zt(u.groupOffsetTree, Math.max(l - d, 0), "v")[0]),
4417
4402
  We(),
4418
- oe((l) => [l])
4403
+ re((l) => [l])
4419
4404
  ),
4420
4405
  i
4421
4406
  ), { groupCounts: s, topItemsIndexes: i };
4422
4407
  },
4423
- Ve(rn, gt)
4408
+ Ve(rn, mt)
4424
4409
  ), Cn = Me(
4425
4410
  ([{ log: e }]) => {
4426
4411
  const t = X(!1), n = Nt(
@@ -4466,20 +4451,20 @@ const qr = Me(
4466
4451
  w,
4467
4452
  Te(n, h, r, v, a, i, m),
4468
4453
  Te(e, s, o),
4469
- oe(
4454
+ re(
4470
4455
  ([
4471
4456
  [R, S, C, E, N, I, j, P],
4472
4457
  B,
4473
4458
  G,
4474
4459
  _
4475
4460
  ]) => {
4476
- const Y = hu(R), { align: U, behavior: se, offset: O } = Y, M = E - 1, K = du(Y, S, M);
4461
+ const Y = hu(R), { align: U, behavior: oe, offset: O } = Y, D = E - 1, K = du(Y, S, D);
4477
4462
  let W = Dr(K, S.offsetTree, B) + I;
4478
- U === "end" ? (W += G + zt(S.sizeTree, K)[1] - C + _, K === M && (W += j)) : U === "center" ? W += (G + zt(S.sizeTree, K)[1] - C + _) / 2 : W -= N, O && (W += O);
4463
+ U === "end" ? (W += G + zt(S.sizeTree, K)[1] - C + _, K === D && (W += j)) : U === "center" ? W += (G + zt(S.sizeTree, K)[1] - C + _) / 2 : W -= N, O && (W += O);
4479
4464
  const ee = (L) => {
4480
4465
  y(), L ? (P("retrying to scroll to", { location: R }, St.DEBUG), ye(w, R)) : (ye(x, !0), P("list did not change, scroll successful", {}, St.DEBUG));
4481
4466
  };
4482
- if (y(), se === "smooth") {
4467
+ if (y(), oe === "smooth") {
4483
4468
  let L = !1;
4484
4469
  b = Fe(t, (Z) => {
4485
4470
  L = L || Z;
@@ -4490,7 +4475,7 @@ const qr = Me(
4490
4475
  p = $t($(t, $v(150)), ee);
4491
4476
  return g = setTimeout(() => {
4492
4477
  y();
4493
- }, 1200), ye(l, !0), P("scrolling from index to", { behavior: se, index: K, top: W }, St.DEBUG), { behavior: se, top: W };
4478
+ }, 1200), ye(l, !0), P("scrolling from index to", { behavior: oe, index: K, top: W }, St.DEBUG), { behavior: oe, top: W };
4494
4479
  }
4495
4480
  )
4496
4481
  ),
@@ -4501,7 +4486,7 @@ const qr = Me(
4501
4486
  topListHeight: v
4502
4487
  };
4503
4488
  },
4504
- Ve(rn, gt, Sn),
4489
+ Ve(rn, mt, Sn),
4505
4490
  { singleton: !0 }
4506
4491
  );
4507
4492
  function $v(e) {
@@ -4564,7 +4549,7 @@ const Xr = Me(
4564
4549
  scrolledToInitialItem: a
4565
4550
  };
4566
4551
  },
4567
- Ve(rn, gt, qr, Cn),
4552
+ Ve(rn, mt, qr, Cn),
4568
4553
  { singleton: !0 }
4569
4554
  );
4570
4555
  function pu(e, t) {
@@ -4593,7 +4578,7 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4593
4578
  de(
4594
4579
  $(
4595
4580
  nt(me(o), me(h)),
4596
- oe(([b, y]) => b <= y),
4581
+ re(([b, y]) => b <= y),
4597
4582
  We()
4598
4583
  ),
4599
4584
  a
@@ -4655,14 +4640,14 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4655
4640
  { changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
4656
4641
  ),
4657
4642
  ge((b) => b.changed),
4658
- oe((b) => b.jump)
4643
+ re((b) => b.jump)
4659
4644
  ),
4660
4645
  0
4661
4646
  );
4662
4647
  de(
4663
4648
  $(
4664
4649
  x,
4665
- oe((b) => b.atBottom)
4650
+ re((b) => b.atBottom)
4666
4651
  ),
4667
4652
  i
4668
4653
  ), de($(i, un(50)), l);
@@ -4670,13 +4655,13 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4670
4655
  de(
4671
4656
  $(
4672
4657
  r,
4673
- oe(({ scrollTop: b }) => b),
4658
+ re(({ scrollTop: b }) => b),
4674
4659
  We(),
4675
4660
  Qt(
4676
4661
  (b, y) => Je(w) ? { direction: b.direction, prevScrollTop: y } : { direction: y < b.prevScrollTop ? Lr : Nr, prevScrollTop: y },
4677
4662
  { direction: Nr, prevScrollTop: 0 }
4678
4663
  ),
4679
- oe((b) => b.direction)
4664
+ re((b) => b.direction)
4680
4665
  ),
4681
4666
  p
4682
4667
  ), de($(r, un(50), Jt(Hv)), p);
@@ -4695,7 +4680,7 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4695
4680
  Te(m),
4696
4681
  ge(([b, y]) => !!y),
4697
4682
  Qt(([b, y], [R]) => [y, R], [0, 0]),
4698
- oe(([b, y]) => y - b)
4683
+ re(([b, y]) => y - b)
4699
4684
  ),
4700
4685
  g
4701
4686
  ), {
@@ -4711,7 +4696,7 @@ const Lr = "up", Nr = "down", Hv = "none", zv = {
4711
4696
  scrollDirection: p,
4712
4697
  scrollVelocity: g
4713
4698
  };
4714
- }, Ve(gt)), Fo = "top", Bo = "bottom", Ec = "none";
4699
+ }, Ve(mt)), Fo = "top", Bo = "bottom", Ec = "none";
4715
4700
  function Nc(e, t, n) {
4716
4701
  return typeof e == "number" ? n === Lr && t === Fo || n === Nr && t === Bo ? e : 0 : n === Lr ? t === Fo ? e.main : e.reverse : t === Bo ? e.main : e.reverse;
4717
4702
  }
@@ -4734,7 +4719,7 @@ const na = Me(
4734
4719
  me(e),
4735
4720
  me(a)
4736
4721
  ),
4737
- oe(
4722
+ re(
4738
4723
  ([
4739
4724
  d,
4740
4725
  h,
@@ -4770,7 +4755,7 @@ const na = Me(
4770
4755
  visibleRange: u
4771
4756
  };
4772
4757
  },
4773
- Ve(gt),
4758
+ Ve(mt),
4774
4759
  { singleton: !0 }
4775
4760
  );
4776
4761
  function Wv(e, t, n) {
@@ -4889,7 +4874,7 @@ const zn = Me(
4889
4874
  const j = I && I.length !== N;
4890
4875
  return C && !E && !j;
4891
4876
  }),
4892
- oe(
4877
+ re(
4893
4878
  ([
4894
4879
  ,
4895
4880
  ,
@@ -4903,13 +4888,13 @@ const zn = Me(
4903
4888
  _,
4904
4889
  Y
4905
4890
  ]) => {
4906
- const U = I, { offsetTree: se, sizeTree: O } = U, M = Je(p);
4891
+ const U = I, { offsetTree: oe, sizeTree: O } = U, D = Je(p);
4907
4892
  if (N === 0)
4908
4893
  return { ...zs, totalCount: N };
4909
4894
  if (C === 0 && E === 0)
4910
- return M === 0 ? { ...zs, totalCount: N } : mu(M, j, I, G, _, Y || []);
4895
+ return D === 0 ? { ...zs, totalCount: N } : mu(D, j, I, G, _, Y || []);
4911
4896
  if (ze(O))
4912
- return M > 0 ? null : So(
4897
+ return D > 0 ? null : So(
4913
4898
  Wv(ta(j, N), U, Y),
4914
4899
  [],
4915
4900
  N,
@@ -4923,13 +4908,13 @@ const zn = Me(
4923
4908
  let F = 0;
4924
4909
  for (const A of is(O, pe, he)) {
4925
4910
  const H = A.value, J = Math.max(A.start, pe), ce = Math.min(A.end, he);
4926
- for (let ie = J; ie <= ce; ie++)
4927
- K.push({ data: Y == null ? void 0 : Y[ie], index: ie, offset: F, size: H }), F += H;
4911
+ for (let se = J; se <= ce; se++)
4912
+ K.push({ data: Y == null ? void 0 : Y[se], index: se, offset: F, size: H }), F += H;
4928
4913
  }
4929
4914
  }
4930
4915
  if (!P)
4931
4916
  return So([], K, N, _, U, G);
4932
- const W = B.length > 0 ? B[B.length - 1] + 1 : 0, ee = Pv(se, C, E, W);
4917
+ const W = B.length > 0 ? B[B.length - 1] + 1 : 0, ee = Pv(oe, C, E, W);
4933
4918
  if (ee.length === 0)
4934
4919
  return null;
4935
4920
  const L = N - 1, Z = ss([], (pe) => {
@@ -4939,13 +4924,13 @@ const zn = Me(
4939
4924
  const J = F.size;
4940
4925
  if (F.offset < C) {
4941
4926
  H += Math.floor((C - F.offset + _) / (J + _));
4942
- const ie = H - he.start;
4943
- A += ie * J + ie * _;
4927
+ const se = H - he.start;
4928
+ A += se * J + se * _;
4944
4929
  }
4945
4930
  H < W && (A += (W - H) * J, H = W);
4946
4931
  const ce = Math.min(he.end, L);
4947
- for (let ie = H; ie <= ce && !(A >= E); ie++)
4948
- pe.push({ data: Y == null ? void 0 : Y[ie], index: ie, offset: A, size: J }), A += J + _;
4932
+ for (let se = H; se <= ce && !(A >= E); se++)
4933
+ pe.push({ data: Y == null ? void 0 : Y[se], index: se, offset: A, size: J }), A += J + _;
4949
4934
  }
4950
4935
  });
4951
4936
  return So(Z, K, N, _, U, G);
@@ -4961,25 +4946,25 @@ const zn = Me(
4961
4946
  $(
4962
4947
  e,
4963
4948
  ge(qi),
4964
- oe((C) => C == null ? void 0 : C.length)
4949
+ re((C) => C == null ? void 0 : C.length)
4965
4950
  ),
4966
4951
  o
4967
4952
  ), de(
4968
4953
  $(
4969
4954
  b,
4970
- oe((C) => C.topListHeight)
4955
+ re((C) => C.topListHeight)
4971
4956
  ),
4972
4957
  h
4973
4958
  ), de(h, a), de(
4974
4959
  $(
4975
4960
  b,
4976
- oe((C) => [C.top, C.bottom])
4961
+ re((C) => [C.top, C.bottom])
4977
4962
  ),
4978
4963
  i
4979
4964
  ), de(
4980
4965
  $(
4981
4966
  b,
4982
- oe((C) => C.items)
4967
+ re((C) => C.items)
4983
4968
  ),
4984
4969
  g
4985
4970
  );
@@ -4989,23 +4974,23 @@ const zn = Me(
4989
4974
  ge(({ items: C }) => C.length > 0),
4990
4975
  Te(o, e),
4991
4976
  ge(([{ items: C }, E]) => C[C.length - 1].originalIndex === E - 1),
4992
- oe(([, C, E]) => [C - 1, E]),
4977
+ re(([, C, E]) => [C - 1, E]),
4993
4978
  We(Mr),
4994
- oe(([C]) => C)
4979
+ re(([C]) => C)
4995
4980
  )
4996
4981
  ), R = Nt(
4997
4982
  $(
4998
4983
  b,
4999
4984
  un(200),
5000
4985
  ge(({ items: C, topItems: E }) => C.length > 0 && C[0].originalIndex === E.length),
5001
- oe(({ items: C }) => C[0].index),
4986
+ re(({ items: C }) => C[0].index),
5002
4987
  We()
5003
4988
  )
5004
4989
  ), S = Nt(
5005
4990
  $(
5006
4991
  b,
5007
4992
  ge(({ items: C }) => C.length > 0),
5008
- oe(({ items: C }) => {
4993
+ re(({ items: C }) => {
5009
4994
  let E = 0, N = C.length - 1;
5010
4995
  for (; C[E].type === "group" && E < N; )
5011
4996
  E++;
@@ -5037,13 +5022,13 @@ const zn = Me(
5037
5022
  const s = ke(), i = ft(
5038
5023
  $(
5039
5024
  nt(n, e, r, t, o),
5040
- oe(([a, l, u, d, h]) => a + l + u + d + h.offsetBottom + h.bottom)
5025
+ re(([a, l, u, d, h]) => a + l + u + d + h.offsetBottom + h.bottom)
5041
5026
  ),
5042
5027
  0
5043
5028
  );
5044
5029
  return de(me(i), s), { totalListHeight: i, totalListHeightChanged: s };
5045
5030
  },
5046
- Ve(gt, zn),
5031
+ Ve(mt, zn),
5047
5032
  { singleton: !0 }
5048
5033
  ), Vv = Me(
5049
5034
  ([{ viewportHeight: e }, { totalListHeight: t }]) => {
@@ -5051,7 +5036,7 @@ const zn = Me(
5051
5036
  $(
5052
5037
  nt(n, e, t),
5053
5038
  ge(([o]) => o),
5054
- oe(([, o, s]) => Math.max(0, o - s)),
5039
+ re(([, o, s]) => Math.max(0, o - s)),
5055
5040
  un(0),
5056
5041
  We()
5057
5042
  ),
@@ -5059,7 +5044,7 @@ const zn = Me(
5059
5044
  );
5060
5045
  return { alignToBottom: n, paddingTopAddition: r };
5061
5046
  },
5062
- Ve(gt, gu),
5047
+ Ve(mt, gu),
5063
5048
  { singleton: !0 }
5064
5049
  ), vu = Me(() => ({
5065
5050
  context: X(null)
@@ -5081,7 +5066,7 @@ const zn = Me(
5081
5066
  d,
5082
5067
  Te(t, l, n, s, o, r, a),
5083
5068
  Te(e),
5084
- oe(([[h, m, w, x, v, p, g, b], y]) => {
5069
+ re(([[h, m, w, x, v, p, g, b], y]) => {
5085
5070
  const { align: R, behavior: S, calculateViewLocation: C = Gv, done: E, ...N } = h, I = du(h, m, x - 1), j = Dr(I, m.offsetTree, y) + v + p, P = j + zt(m.sizeTree, I)[1], B = b + p, G = b + w - g, _ = C({
5086
5071
  itemBottom: P,
5087
5072
  itemTop: j,
@@ -5107,7 +5092,7 @@ const zn = Me(
5107
5092
  scrollIntoView: d
5108
5093
  };
5109
5094
  },
5110
- Ve(rn, gt, qr, zn, Sn),
5095
+ Ve(rn, mt, qr, zn, Sn),
5111
5096
  { singleton: !0 }
5112
5097
  );
5113
5098
  function kc(e) {
@@ -5138,7 +5123,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5138
5123
  $(
5139
5124
  nt($(me(t), Dn(1)), l),
5140
5125
  Te(me(x), s, a, h),
5141
- oe(([[S, C], E, N, I, j]) => {
5126
+ re(([[S, C], E, N, I, j]) => {
5142
5127
  let P = C && I, B = "auto";
5143
5128
  return P && (B = Kv(E, N || j), P = P && !!B), { followOutputBehavior: B, shouldFollow: P, totalCount: S };
5144
5129
  }),
@@ -5182,7 +5167,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5182
5167
  xi(
5183
5168
  $(
5184
5169
  me(r),
5185
- oe((S) => {
5170
+ re((S) => {
5186
5171
  var C;
5187
5172
  return (C = S == null ? void 0 : S.length) != null ? C : 0;
5188
5173
  })
@@ -5194,7 +5179,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5194
5179
  $(
5195
5180
  nt($(R, Dn(1)), l),
5196
5181
  Te(me(y), a, h, m),
5197
- oe(([[S, C], E, N, I, j]) => C && N && (E == null ? void 0 : E({ context: j, totalCount: S, scrollingInProgress: I }))),
5182
+ re(([[S, C], E, N, I, j]) => C && N && (E == null ? void 0 : E({ context: j, totalCount: S, scrollingInProgress: I }))),
5198
5183
  ge((S) => !!S),
5199
5184
  un(0)
5200
5185
  ),
@@ -5214,7 +5199,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5214
5199
  Xr,
5215
5200
  Cn,
5216
5201
  Sn,
5217
- gt,
5202
+ mt,
5218
5203
  vu,
5219
5204
  xu
5220
5205
  )
@@ -5225,7 +5210,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5225
5210
  Te(s),
5226
5211
  ge(([, l]) => l !== 0),
5227
5212
  Te(o, r, t, n, e),
5228
- oe(([[, l], u, d, h, m, w = []]) => mu(l, u, d, h, m, w))
5213
+ re(([[, l], u, d, h, m, w = []]) => mu(l, u, d, h, m, w))
5229
5214
  ),
5230
5215
  i
5231
5216
  ), {}),
@@ -5239,7 +5224,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5239
5224
  e,
5240
5225
  Te(r),
5241
5226
  ge(([, o]) => o !== 0),
5242
- oe(([, o]) => ({ top: o }))
5227
+ re(([, o]) => ({ top: o }))
5243
5228
  ),
5244
5229
  (o) => {
5245
5230
  $t(
@@ -5259,7 +5244,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5259
5244
  initialScrollTop: r
5260
5245
  };
5261
5246
  },
5262
- Ve(Cn, gt, zn),
5247
+ Ve(Cn, mt, zn),
5263
5248
  { singleton: !0 }
5264
5249
  ), bu = Me(
5265
5250
  ([{ scrollVelocity: e }]) => {
@@ -5269,7 +5254,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5269
5254
  e,
5270
5255
  Te(r, t, n),
5271
5256
  ge(([o, s]) => !!s),
5272
- oe(([o, s, i, a]) => {
5257
+ re(([o, s, i, a]) => {
5273
5258
  const { enter: l, exit: u } = s;
5274
5259
  if (i) {
5275
5260
  if (u(o, a))
@@ -5295,7 +5280,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5295
5280
  return de(
5296
5281
  $(
5297
5282
  nt(n, r),
5298
- oe(([{ scrollHeight: a, scrollTop: l, viewportHeight: u }, { offsetTop: d }]) => ({
5283
+ re(([{ scrollHeight: a, scrollTop: l, viewportHeight: u }, { offsetTop: d }]) => ({
5299
5284
  scrollHeight: a,
5300
5285
  scrollTop: Math.max(0, l - d),
5301
5286
  viewportHeight: u
@@ -5306,7 +5291,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5306
5291
  $(
5307
5292
  t,
5308
5293
  Te(r),
5309
- oe(([a, { offsetTop: l }]) => ({
5294
+ re(([a, { offsetTop: l }]) => ({
5310
5295
  ...a,
5311
5296
  top: a.top + l
5312
5297
  }))
@@ -5322,7 +5307,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5322
5307
  windowScrollTo: o,
5323
5308
  windowViewportRect: r
5324
5309
  };
5325
- }, Ve(gt)), Jv = Me(
5310
+ }, Ve(mt)), Jv = Me(
5326
5311
  ([
5327
5312
  { sizeRanges: e, sizes: t },
5328
5313
  { headerHeight: n, scrollTop: r },
@@ -5340,13 +5325,13 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5340
5325
  const R = Ov(x.sizeTree);
5341
5326
  p && g !== null && b !== null && (v = g.scrollTop - b.offsetTop), v -= y, w({ ranges: R, scrollTop: v });
5342
5327
  }
5343
- ), de($(d, ge(qi), oe(Zv)), o), de(
5328
+ ), de($(d, ge(qi), re(Zv)), o), de(
5344
5329
  $(
5345
5330
  s,
5346
5331
  Te(d),
5347
5332
  ge(([, w]) => w !== void 0),
5348
5333
  We(),
5349
- oe(([, w]) => w.ranges)
5334
+ re(([, w]) => w.ranges)
5350
5335
  ),
5351
5336
  e
5352
5337
  ), {
@@ -5354,7 +5339,7 @@ const Kv = (e, t) => typeof e == "function" ? kc(e(t)) : t && kc(e), Yv = Me(
5354
5339
  restoreStateFrom: d
5355
5340
  };
5356
5341
  },
5357
- Ve(rn, gt, Xr, Cn, ra)
5342
+ Ve(rn, mt, Xr, Cn, ra)
5358
5343
  );
5359
5344
  function Zv(e) {
5360
5345
  return { align: "start", index: 0, offset: e.scrollTop };
@@ -5365,7 +5350,7 @@ const Qv = Me(([{ topItemsIndexes: e }]) => {
5365
5350
  $(
5366
5351
  t,
5367
5352
  ge((n) => n >= 0),
5368
- oe((n) => Array.from({ length: n }).map((r, o) => o))
5353
+ re((n) => Array.from({ length: n }).map((r, o) => o))
5369
5354
  ),
5370
5355
  e
5371
5356
  ), { topItemCount: t };
@@ -5398,7 +5383,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5398
5383
  ge(([g]) => g !== 0),
5399
5384
  Te(r, a, n, o, w, x),
5400
5385
  ge(([, g, b, y, , , R]) => !R && !y && g !== 0 && b === Lr),
5401
- oe(([[g], , , , , b]) => (b("Upward scrolling compensation", { amount: g }, St.DEBUG), g))
5386
+ re(([[g], , , , , b]) => (b("Upward scrolling compensation", { amount: g }, St.DEBUG), g))
5402
5387
  )
5403
5388
  );
5404
5389
  function p(g) {
@@ -5410,21 +5395,21 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5410
5395
  $(
5411
5396
  nt(ft(s, !1), e, x),
5412
5397
  ge(([g, b, y]) => !g && !y && b !== 0),
5413
- oe(([g, b]) => b),
5398
+ re(([g, b]) => b),
5414
5399
  un(1)
5415
5400
  ),
5416
5401
  p
5417
5402
  ), de(
5418
5403
  $(
5419
5404
  h,
5420
- oe((g) => ({ top: -g }))
5405
+ re((g) => ({ top: -g }))
5421
5406
  ),
5422
5407
  t
5423
5408
  ), Fe(
5424
5409
  $(
5425
5410
  u,
5426
5411
  Te(m, d),
5427
- oe(([g, { groupIndices: b, lastSize: y, sizeTree: R }, S]) => {
5412
+ re(([g, { groupIndices: b, lastSize: y, sizeTree: R }, S]) => {
5428
5413
  function C(E) {
5429
5414
  return E * (y + S);
5430
5415
  }
@@ -5452,7 +5437,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5452
5437
  }
5453
5438
  ), { deviation: e };
5454
5439
  },
5455
- Ve(gt, Jr, zn, rn, Sn, Zi)
5440
+ Ve(mt, Jr, zn, rn, Sn, Zi)
5456
5441
  ), nx = Me(
5457
5442
  ([
5458
5443
  e,
@@ -5521,7 +5506,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5521
5506
  ]) => (de(R.rangeChanged, I.scrollSeekRangeChanged), de(
5522
5507
  $(
5523
5508
  I.windowViewportRect,
5524
- oe((j) => j.visibleHeight)
5509
+ re((j) => j.visibleHeight)
5525
5510
  ),
5526
5511
  v.viewportHeight
5527
5512
  ), {
@@ -5558,7 +5543,7 @@ const ex = wu(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
5558
5543
  Ve(
5559
5544
  rn,
5560
5545
  Xr,
5561
- gt,
5546
+ mt,
5562
5547
  Jv,
5563
5548
  Yv,
5564
5549
  zn,
@@ -5727,7 +5712,7 @@ const sx = /* @__PURE__ */ Me(() => {
5727
5712
  const e = X((a) => `Item ${a}`), t = X((a) => `Group ${a}`), n = X({}), r = X(sa), o = X("div"), s = X(pr), i = (a, l = null) => ft(
5728
5713
  $(
5729
5714
  n,
5730
- oe((u) => u[a]),
5715
+ re((u) => u[a]),
5731
5716
  We()
5732
5717
  ),
5733
5718
  l
@@ -6040,7 +6025,7 @@ const gx = ({ children: e }) => {
6040
6025
  ] })), r = X(null), o = X(null), s = X({}), i = X(sa), a = X(pr), l = (u, d = null) => ft(
6041
6026
  $(
6042
6027
  s,
6043
- oe((h) => h[u]),
6028
+ re((h) => h[u]),
6044
6029
  We()
6045
6030
  ),
6046
6031
  d
@@ -6110,11 +6095,11 @@ const Ix = /* @__PURE__ */ Me(
6110
6095
  { customScrollParent: p, useWindowScroll: g, windowScrollContainerState: b, windowScrollTo: y, windowViewportRect: R },
6111
6096
  S
6112
6097
  ]) => {
6113
- const C = X(0), E = X(0), N = X(_c), I = X({ height: 0, width: 0 }), j = X({ height: 0, width: 0 }), P = ke(), B = ke(), G = X(0), _ = X(null), Y = X({ column: 0, row: 0 }), U = ke(), se = ke(), O = X(!1), M = X(0), K = X(!0), W = X(!1), ee = X(!1);
6098
+ const C = X(0), E = X(0), N = X(_c), I = X({ height: 0, width: 0 }), j = X({ height: 0, width: 0 }), P = ke(), B = ke(), G = X(0), _ = X(null), Y = X({ column: 0, row: 0 }), U = ke(), oe = ke(), O = X(!1), D = X(0), K = X(!0), W = X(!1), ee = X(!1);
6114
6099
  Fe(
6115
6100
  $(
6116
6101
  x,
6117
- Te(M),
6102
+ Te(D),
6118
6103
  ge(([A, H]) => !!H)
6119
6104
  ),
6120
6105
  () => {
@@ -6122,8 +6107,8 @@ const Ix = /* @__PURE__ */ Me(
6122
6107
  }
6123
6108
  ), Fe(
6124
6109
  $(
6125
- nt(x, K, j, I, M, W),
6126
- ge(([A, H, J, ce, , ie]) => A && !H && J.height !== 0 && ce.height !== 0 && !ie)
6110
+ nt(x, K, j, I, D, W),
6111
+ ge(([A, H, J, ce, , se]) => A && !H && J.height !== 0 && ce.height !== 0 && !se)
6127
6112
  ),
6128
6113
  ([, , , , A]) => {
6129
6114
  ye(W, !0), ea(1, () => {
@@ -6134,7 +6119,7 @@ const Ix = /* @__PURE__ */ Me(
6134
6119
  }
6135
6120
  ), de(
6136
6121
  $(
6137
- se,
6122
+ oe,
6138
6123
  ge((A) => A != null && A.scrollTop > 0),
6139
6124
  Jt(0)
6140
6125
  ),
@@ -6142,7 +6127,7 @@ const Ix = /* @__PURE__ */ Me(
6142
6127
  ), Fe(
6143
6128
  $(
6144
6129
  x,
6145
- Te(se),
6130
+ Te(oe),
6146
6131
  ge(([, A]) => A != null)
6147
6132
  ),
6148
6133
  ([, A]) => {
@@ -6153,7 +6138,7 @@ const Ix = /* @__PURE__ */ Me(
6153
6138
  ), de(
6154
6139
  $(
6155
6140
  I,
6156
- oe(({ height: A }) => A)
6141
+ re(({ height: A }) => A)
6157
6142
  ),
6158
6143
  h
6159
6144
  ), de(
@@ -6164,7 +6149,7 @@ const Ix = /* @__PURE__ */ Me(
6164
6149
  me(Y, (A, H) => A && A.column === H.column && A.row === H.row),
6165
6150
  me(u)
6166
6151
  ),
6167
- oe(([A, H, J, ce]) => ({
6152
+ re(([A, H, J, ce]) => ({
6168
6153
  gap: J,
6169
6154
  item: H,
6170
6155
  scrollTop: ce,
@@ -6184,34 +6169,34 @@ const Ix = /* @__PURE__ */ Me(
6184
6169
  me(E),
6185
6170
  me(O),
6186
6171
  me(K),
6187
- me(M)
6172
+ me(D)
6188
6173
  ),
6189
6174
  ge(([, , , , , , , A]) => !A),
6190
- oe(
6175
+ re(
6191
6176
  ([
6192
6177
  A,
6193
6178
  [H, J],
6194
6179
  ce,
6195
- ie,
6180
+ se,
6196
6181
  Ae,
6197
6182
  _e,
6198
6183
  je,
6199
6184
  ,
6200
- ae,
6185
+ ie,
6201
6186
  Ne
6202
6187
  ]) => {
6203
- const { column: Se, row: fe } = ce, { height: Ce, width: Be } = ie, { width: ot } = Ae;
6188
+ const { column: Se, row: fe } = ce, { height: Ce, width: Be } = se, { width: ot } = Ae;
6204
6189
  if (je === 0 && (A === 0 || ot === 0))
6205
6190
  return _c;
6206
6191
  if (Be === 0) {
6207
- const Re = ta(Ne, A), ht = Re + Math.max(je - 1, 0);
6208
- return Ex(Dc(Re, ht, _e));
6192
+ const Re = ta(Ne, A), xt = Re + Math.max(je - 1, 0);
6193
+ return Ex(Dc(Re, xt, _e));
6209
6194
  }
6210
6195
  const et = ku(ot, Be, Se);
6211
- let xt, it;
6212
- ae ? H === 0 && J === 0 && je > 0 ? (xt = 0, it = je - 1) : (xt = et * $o((H + fe) / (Ce + fe)), it = et * Oc((J + fe) / (Ce + fe)) - 1, it = Vs(A - 1, Ir(it, et - 1)), xt = Vs(it, Ir(0, xt))) : (xt = 0, it = -1);
6213
- const an = Dc(xt, it, _e), { bottom: V, top: ne } = Lc(Ae, ce, ie, an), $e = Oc(A / et), qe = $e * Ce + ($e - 1) * fe - V;
6214
- return { bottom: V, itemHeight: Ce, items: an, itemWidth: Be, offsetBottom: qe, offsetTop: ne, top: ne };
6196
+ let vt, it;
6197
+ ie ? H === 0 && J === 0 && je > 0 ? (vt = 0, it = je - 1) : (vt = et * $o((H + fe) / (Ce + fe)), it = et * Oc((J + fe) / (Ce + fe)) - 1, it = Vs(A - 1, Ir(it, et - 1)), vt = Vs(it, Ir(0, vt))) : (vt = 0, it = -1);
6198
+ const an = Dc(vt, it, _e), { bottom: V, top: ae } = Lc(Ae, ce, se, an), $e = Oc(A / et), qe = $e * Ce + ($e - 1) * fe - V;
6199
+ return { bottom: V, itemHeight: Ce, items: an, itemWidth: Be, offsetBottom: qe, offsetTop: ae, top: ae };
6215
6200
  }
6216
6201
  )
6217
6202
  ),
@@ -6220,16 +6205,16 @@ const Ix = /* @__PURE__ */ Me(
6220
6205
  $(
6221
6206
  _,
6222
6207
  ge((A) => A !== null),
6223
- oe((A) => A.length)
6208
+ re((A) => A.length)
6224
6209
  ),
6225
6210
  C
6226
6211
  ), de(
6227
6212
  $(
6228
6213
  nt(I, j, N, Y),
6229
6214
  ge(([A, H, { items: J }]) => J.length > 0 && H.height !== 0 && A.height !== 0),
6230
- oe(([A, H, { items: J }, ce]) => {
6231
- const { bottom: ie, top: Ae } = Lc(A, ce, H, J);
6232
- return [Ae, ie];
6215
+ re(([A, H, { items: J }, ce]) => {
6216
+ const { bottom: se, top: Ae } = Lc(A, ce, H, J);
6217
+ return [Ae, se];
6233
6218
  }),
6234
6219
  We(Mr)
6235
6220
  ),
@@ -6240,7 +6225,7 @@ const Ix = /* @__PURE__ */ Me(
6240
6225
  $(
6241
6226
  u,
6242
6227
  Te(L),
6243
- oe(([A, H]) => H || A !== 0)
6228
+ re(([A, H]) => H || A !== 0)
6244
6229
  ),
6245
6230
  L
6246
6231
  );
@@ -6253,7 +6238,7 @@ const Ix = /* @__PURE__ */ Me(
6253
6238
  const ce = A.items[A.items.length - 1].index === H - 1;
6254
6239
  return (J || A.bottom > 0 && A.itemHeight > 0 && A.offsetBottom === 0 && A.items.length === H) && ce;
6255
6240
  }),
6256
- oe(([[, A]]) => A - 1),
6241
+ re(([[, A]]) => A - 1),
6257
6242
  We()
6258
6243
  )
6259
6244
  ), pe = Nt(
@@ -6268,7 +6253,7 @@ const Ix = /* @__PURE__ */ Me(
6268
6253
  me(N),
6269
6254
  Te(O),
6270
6255
  ge(([{ items: A }, H]) => A.length > 0 && !H),
6271
- oe(([{ items: A }]) => ({
6256
+ re(([{ items: A }]) => ({
6272
6257
  endIndex: A[A.length - 1].index,
6273
6258
  startIndex: A[0].index
6274
6259
  })),
@@ -6280,12 +6265,12 @@ const Ix = /* @__PURE__ */ Me(
6280
6265
  $(
6281
6266
  P,
6282
6267
  Te(I, j, C, Y),
6283
- oe(([A, H, J, ce, ie]) => {
6284
- const Ae = hu(A), { align: _e, behavior: je, offset: ae } = Ae;
6268
+ re(([A, H, J, ce, se]) => {
6269
+ const Ae = hu(A), { align: _e, behavior: je, offset: ie } = Ae;
6285
6270
  let Ne = Ae.index;
6286
6271
  Ne === "LAST" && (Ne = ce - 1), Ne = Ir(0, Ne, Vs(ce - 1, Ne));
6287
- let Se = Ci(H, ie, J, Ne);
6288
- return _e === "end" ? Se = Mc(Se - H.height + J.height) : _e === "center" && (Se = Mc(Se - H.height / 2 + J.height / 2)), ae && (Se += ae), { behavior: je, top: Se };
6272
+ let Se = Ci(H, se, J, Ne);
6273
+ return _e === "end" ? Se = Mc(Se - H.height + J.height) : _e === "center" && (Se = Mc(Se - H.height / 2 + J.height / 2)), ie && (Se += ie), { behavior: je, top: Se };
6289
6274
  })
6290
6275
  ),
6291
6276
  l
@@ -6293,14 +6278,14 @@ const Ix = /* @__PURE__ */ Me(
6293
6278
  const F = ft(
6294
6279
  $(
6295
6280
  N,
6296
- oe((A) => A.offsetBottom + A.bottom)
6281
+ re((A) => A.offsetBottom + A.bottom)
6297
6282
  ),
6298
6283
  0
6299
6284
  );
6300
6285
  return de(
6301
6286
  $(
6302
6287
  R,
6303
- oe((A) => ({ height: A.visibleHeight, width: A.visibleWidth }))
6288
+ re((A) => ({ height: A.visibleHeight, width: A.visibleWidth }))
6304
6289
  ),
6305
6290
  I
6306
6291
  ), {
@@ -6315,7 +6300,7 @@ const Ix = /* @__PURE__ */ Me(
6315
6300
  initialItemCount: E,
6316
6301
  itemDimensions: j,
6317
6302
  overscan: n,
6318
- restoreStateFrom: se,
6303
+ restoreStateFrom: oe,
6319
6304
  scrollBy: i,
6320
6305
  scrollContainerState: a,
6321
6306
  scrollHeight: B,
@@ -6333,7 +6318,7 @@ const Ix = /* @__PURE__ */ Me(
6333
6318
  // output
6334
6319
  gridState: N,
6335
6320
  horizontalDirection: ee,
6336
- initialTopMostItemIndex: M,
6321
+ initialTopMostItemIndex: D,
6337
6322
  totalListHeight: F,
6338
6323
  ...m,
6339
6324
  endReached: Z,
@@ -6345,7 +6330,7 @@ const Ix = /* @__PURE__ */ Me(
6345
6330
  ...S
6346
6331
  };
6347
6332
  },
6348
- Ve(na, gt, Jr, bu, Cn, ra, Sn)
6333
+ Ve(na, mt, Jr, bu, Cn, ra, Sn)
6349
6334
  );
6350
6335
  function ku(e, t, n) {
6351
6336
  return Ir(1, $o((e + n) / ($o(t) + n)));
@@ -6365,7 +6350,7 @@ const jx = /* @__PURE__ */ Me(() => {
6365
6350
  const e = X((h) => `Item ${h}`), t = X({}), n = X(null), r = X("virtuoso-grid-item"), o = X("virtuoso-grid-list"), s = X(sa), i = X("div"), a = X(pr), l = (h, m = null) => ft(
6366
6351
  $(
6367
6352
  t,
6368
- oe((w) => w[h]),
6353
+ re((w) => w[h]),
6369
6354
  We()
6370
6355
  ),
6371
6356
  m
@@ -6562,7 +6547,7 @@ const Bx = Wr(
6562
6547
  }
6563
6548
  );
6564
6549
  function Pu({ className: e, variant: t, ...n }) {
6565
- return /* @__PURE__ */ c.jsx("div", { className: D(Bx({ variant: t }), e), ...n });
6550
+ return /* @__PURE__ */ c.jsx("div", { className: M(Bx({ variant: t }), e), ...n });
6566
6551
  }
6567
6552
  function Q(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
6568
6553
  return function(o) {
@@ -7199,7 +7184,7 @@ function Ks({
7199
7184
  return v.forEach((R) => y.observe(R)), () => {
7200
7185
  g = !0, y.disconnect();
7201
7186
  };
7202
- }, [u]), u ? /* @__PURE__ */ c.jsx("div", { ref: w, className: D("markdown prose max-w-none break-words dark:prose-invert", t), dangerouslySetInnerHTML: { __html: u } }) : r && o ? null : /* @__PURE__ */ c.jsx("div", { className: D("markdown prose max-w-none break-words dark:prose-invert", t), children: n });
7187
+ }, [u]), u ? /* @__PURE__ */ c.jsx("div", { ref: w, className: M("markdown prose max-w-none break-words dark:prose-invert", t), dangerouslySetInnerHTML: { __html: u } }) : r && o ? null : /* @__PURE__ */ c.jsx("div", { className: M("markdown prose max-w-none break-words dark:prose-invert", t), children: n });
7203
7188
  }
7204
7189
  async function Bu(e, t) {
7205
7190
  return await Ft(e, {
@@ -8353,7 +8338,7 @@ const Iw = hd, jw = pd, gd = f.forwardRef(({ className: e, ...t }, n) => /* @__P
8353
8338
  ms,
8354
8339
  {
8355
8340
  ref: n,
8356
- className: D(
8341
+ className: M(
8357
8342
  "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",
8358
8343
  e
8359
8344
  ),
@@ -8383,7 +8368,7 @@ const vd = f.forwardRef(({ className: e, children: t, ...n }, r) => {
8383
8368
  gs,
8384
8369
  {
8385
8370
  ref: r,
8386
- className: D(
8371
+ className: M(
8387
8372
  "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",
8388
8373
  e
8389
8374
  ),
@@ -8407,7 +8392,7 @@ const xd = ({
8407
8392
  }) => /* @__PURE__ */ c.jsx(
8408
8393
  "div",
8409
8394
  {
8410
- className: D(
8395
+ className: M(
8411
8396
  "flex flex-col space-y-1.5 text-center sm:text-left",
8412
8397
  e
8413
8398
  ),
@@ -8419,7 +8404,7 @@ const bd = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
8419
8404
  _n,
8420
8405
  {
8421
8406
  ref: n,
8422
- className: D(
8407
+ className: M(
8423
8408
  "text-lg font-semibold leading-none tracking-tight",
8424
8409
  e
8425
8410
  ),
@@ -8431,7 +8416,7 @@ const kw = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
8431
8416
  vs,
8432
8417
  {
8433
8418
  ref: n,
8434
- className: D("text-sm text-muted-foreground", e),
8419
+ className: M("text-sm text-muted-foreground", e),
8435
8420
  ...t
8436
8421
  }
8437
8422
  ));
@@ -8554,7 +8539,7 @@ function Pw({ className: e }) {
8554
8539
  "span",
8555
8540
  {
8556
8541
  "aria-live": "polite",
8557
- className: D("inline-block text-xs opacity-70 ml-1", e),
8542
+ className: M("inline-block text-xs opacity-70 ml-1", e),
8558
8543
  children: [
8559
8544
  "Is thinking",
8560
8545
  ".".repeat(t)
@@ -8585,8 +8570,8 @@ const _w = q.memo(function({
8585
8570
  }) {
8586
8571
  const [y, R] = ue(!1), [S, C] = ue(!1), [E, N] = ue(!1), [I, j] = ue(!1), { currentThreadId: P } = Yi();
8587
8572
  ha();
8588
- const [B, G] = ue({}), [_, Y] = ue(!1), [U, se] = ue(null), O = u === "phone" || u === "half-screen", M = t.role, K = M === "tool", W = q.useMemo(() => {
8589
- switch (M) {
8573
+ const [B, G] = ue({}), [_, Y] = ue(!1), [U, oe] = ue(null), O = u === "phone" || u === "half-screen", D = t.role, K = D === "tool", W = q.useMemo(() => {
8574
+ switch (D) {
8590
8575
  case "user":
8591
8576
  return "text-[hsl(var(--chat-bubble-user-text))]";
8592
8577
  case "assistant":
@@ -8598,7 +8583,7 @@ const _w = q.memo(function({
8598
8583
  default:
8599
8584
  return "text-[hsl(var(--chat-bubble-ai-text))]";
8600
8585
  }
8601
- }, [M]), ee = ln(() => Ow(t.content), [t.content]), L = ln(() => Bw(t.content), [t.content]), Z = ln(() => t.content.filter((ae) => ae.type === "image_url"), [t.content]), pe = ln(() => t.content.filter((ae) => ae.type === "file"), [t.content]), he = Hw(ee, r);
8586
+ }, [D]), ee = ln(() => Ow(t.content), [t.content]), L = ln(() => Bw(t.content), [t.content]), Z = ln(() => t.content.filter((ie) => ie.type === "image_url"), [t.content]), pe = ln(() => t.content.filter((ie) => ie.type === "file"), [t.content]), he = Hw(ee, r);
8602
8587
  q.useEffect(() => {
8603
8588
  r && ee !== he && console.log("[MessageComponent] Streaming update:", {
8604
8589
  messageId: t.id,
@@ -8611,18 +8596,18 @@ const _w = q.memo(function({
8611
8596
  }, [r, ee, he, t.id]);
8612
8597
  const F = async () => {
8613
8598
  try {
8614
- const ae = K ? Zn(t.content) : ee;
8615
- await navigator.clipboard.writeText(ae), R(!0), setTimeout(() => R(!1), 2e3), b == null || b(ae);
8616
- } catch (ae) {
8617
- console.error("Failed to copy:", ae);
8599
+ const ie = K ? Zn(t.content) : ee;
8600
+ await navigator.clipboard.writeText(ie), R(!0), setTimeout(() => R(!1), 2e3), b == null || b(ie);
8601
+ } catch (ie) {
8602
+ console.error("Failed to copy:", ie);
8618
8603
  }
8619
8604
  }, A = () => {
8620
8605
  if (!v) return;
8621
- const ae = K ? Zn(t.content) : ee;
8622
- v(t.id, ae);
8606
+ const ie = K ? Zn(t.content) : ee;
8607
+ v(t.id, ie);
8623
8608
  }, H = () => p == null ? void 0 : p(n), J = () => {
8624
- const Ne = D(O ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", W);
8625
- switch (M) {
8609
+ const Ne = M(O ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", W);
8610
+ switch (D) {
8626
8611
  case "user":
8627
8612
  return /* @__PURE__ */ c.jsx(Yp, { className: Ne });
8628
8613
  case "assistant":
@@ -8633,53 +8618,53 @@ const _w = q.memo(function({
8633
8618
  return /* @__PURE__ */ c.jsx(Ja, { className: Ne });
8634
8619
  }
8635
8620
  }, ce = () => {
8636
- const ae = "group relative mb-4 flex w-full";
8637
- switch (M) {
8621
+ const ie = "group relative mb-4 flex w-full";
8622
+ switch (D) {
8638
8623
  case "user":
8639
- return D(ae, "justify-end");
8624
+ return M(ie, "justify-end");
8640
8625
  case "assistant":
8641
8626
  case "tool":
8642
8627
  case "system":
8643
- return D(ae, "justify-start");
8628
+ return M(ie, "justify-start");
8644
8629
  default:
8645
- return ae;
8630
+ return ie;
8646
8631
  }
8647
- }, ie = () => {
8648
- const ae = D(
8632
+ }, se = () => {
8633
+ const ie = M(
8649
8634
  "rounded-lg px-4 py-3 relative min-w-0 max-w-full break-words",
8650
8635
  O && "px-3 py-2 text-sm"
8651
8636
  );
8652
- switch (M) {
8637
+ switch (D) {
8653
8638
  case "user":
8654
- return D(
8655
- ae,
8639
+ return M(
8640
+ ie,
8656
8641
  "w-full md:max-w-[95%]",
8657
8642
  "bg-[hsl(var(--chat-bubble-user))] text-[hsl(var(--chat-bubble-user-text))]",
8658
8643
  "border border-transparent"
8659
8644
  );
8660
8645
  case "assistant":
8661
- return D(
8662
- ae,
8646
+ return M(
8647
+ ie,
8663
8648
  "w-full md:max-w-[95%]",
8664
8649
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
8665
8650
  "border border-border/60 dark:border-border/40"
8666
8651
  );
8667
8652
  case "tool":
8668
- return D(ae, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
8653
+ return M(ie, "w-full md:max-w-[95%] bg-secondary/50 text-secondary-foreground border border-dashed");
8669
8654
  case "system":
8670
- return D(ae, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
8655
+ return M(ie, "w-full md:max-w-[85%] bg-accent/40 text-muted-foreground border");
8671
8656
  default:
8672
- return D(
8673
- ae,
8657
+ return M(
8658
+ ie,
8674
8659
  "w-full md:max-w-[95%]",
8675
8660
  "bg-[hsl(var(--chat-bubble-ai))] text-[hsl(var(--chat-bubble-ai-text))]",
8676
8661
  "border border-border/60 dark:border-border/40"
8677
8662
  );
8678
8663
  }
8679
- }, Ae = (ae) => {
8680
- if (!ae) return "";
8664
+ }, Ae = (ie) => {
8665
+ if (!ie) return "";
8681
8666
  try {
8682
- return new Date(ae).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
8667
+ return new Date(ie).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
8683
8668
  } catch {
8684
8669
  return "";
8685
8670
  }
@@ -8700,7 +8685,7 @@ const _w = q.memo(function({
8700
8685
  }
8701
8686
  if (K && !E) {
8702
8687
  const fe = Zn(t.content).slice(0, 80).replace(/\s+/g, " ");
8703
- return /* @__PURE__ */ c.jsx("div", { className: D("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", O && "text-[10px]"), children: /* @__PURE__ */ c.jsxs("span", { className: "truncate max-w-full text-current", children: [
8688
+ return /* @__PURE__ */ c.jsx("div", { className: M("text-xs font-mono opacity-70 flex items-center justify-between gap-2 text-current", O && "text-[10px]"), children: /* @__PURE__ */ c.jsxs("span", { className: "truncate max-w-full text-current", children: [
8704
8689
  fe,
8705
8690
  fe.length >= 80 ? "…" : ""
8706
8691
  ] }) });
@@ -8708,7 +8693,7 @@ const _w = q.memo(function({
8708
8693
  if (K && d) {
8709
8694
  const fe = Zn(t.content), Ce = fe.length > h;
8710
8695
  return /* @__PURE__ */ c.jsx($c, { open: S, onOpenChange: C, children: /* @__PURE__ */ c.jsxs("div", { className: "font-mono text-sm text-current", children: [
8711
- /* @__PURE__ */ c.jsx("pre", { className: D("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Ce && !S ? fe.substring(0, h) + "..." : fe }),
8696
+ /* @__PURE__ */ c.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Ce && !S ? fe.substring(0, h) + "..." : fe }),
8712
8697
  Ce && /* @__PURE__ */ c.jsx(Hc, { asChild: !0, children: /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", className: "h-6 text-xs text-current", children: S ? /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
8713
8698
  /* @__PURE__ */ c.jsx(Cr, { className: "h-3 w-3 mr-1" }),
8714
8699
  "Show less"
@@ -8725,9 +8710,9 @@ const _w = q.memo(function({
8725
8710
  if (fe && Mw(fe))
8726
8711
  return /* @__PURE__ */ c.jsx(Ks, { content: fe.trim(), hideFallbackDuringStreaming: !0 });
8727
8712
  const Ce = Zn(t.content);
8728
- return /* @__PURE__ */ c.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c.jsx("pre", { className: D("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Ce }) });
8713
+ return /* @__PURE__ */ c.jsx("div", { className: "font-mono text-sm text-current", children: /* @__PURE__ */ c.jsx("pre", { className: M("whitespace-pre-wrap break-words text-current", O && "text-xs"), children: Ce }) });
8729
8714
  }
8730
- const Ne = Z.length > 0 && M !== "tool", Se = pe.length > 0 && M !== "tool" && !1;
8715
+ const Ne = Z.length > 0 && D !== "tool", Se = pe.length > 0 && D !== "tool" && !1;
8731
8716
  return /* @__PURE__ */ c.jsxs("div", { children: [
8732
8717
  r ? (
8733
8718
  // Streaming container: reserve space and show a skeleton until we have text,
@@ -8735,7 +8720,7 @@ const _w = q.memo(function({
8735
8720
  /* @__PURE__ */ c.jsxs(
8736
8721
  "div",
8737
8722
  {
8738
- className: D(
8723
+ className: M(
8739
8724
  "relative transition-all duration-200 ease-out",
8740
8725
  O ? "text-xs" : "text-sm"
8741
8726
  ),
@@ -8755,7 +8740,7 @@ const _w = q.memo(function({
8755
8740
  ] }) }) : /* @__PURE__ */ c.jsx(
8756
8741
  "pre",
8757
8742
  {
8758
- className: D(
8743
+ className: M(
8759
8744
  "whitespace-pre-wrap break-words font-sans leading-relaxed transition-opacity duration-200",
8760
8745
  O && "text-xs"
8761
8746
  ),
@@ -8763,18 +8748,18 @@ const _w = q.memo(function({
8763
8748
  }
8764
8749
  ) });
8765
8750
  })(),
8766
- /* @__PURE__ */ c.jsx("div", { className: "mt-2", children: /* @__PURE__ */ c.jsx(Pw, { className: D(W, O ? "text-xs" : "text-sm") }) })
8751
+ /* @__PURE__ */ c.jsx("div", { className: "mt-2", children: /* @__PURE__ */ c.jsx(Pw, { className: M(W, O ? "text-xs" : "text-sm") }) })
8767
8752
  ]
8768
8753
  }
8769
8754
  )
8770
8755
  ) : (() => {
8771
8756
  const fe = ri(ee.trim());
8772
8757
  if (fe !== null) return /* @__PURE__ */ c.jsx(ol, { data: fe });
8773
- if (M === "user" && m) {
8758
+ if (D === "user" && m) {
8774
8759
  const Ce = ee.trim();
8775
8760
  if (Ce.length > w)
8776
8761
  return /* @__PURE__ */ c.jsxs($c, { open: I, onOpenChange: j, children: [
8777
- /* @__PURE__ */ c.jsx("div", { className: D("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: I ? /* @__PURE__ */ c.jsx(Ks, { content: Ce, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ c.jsxs("pre", { className: D("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8762
+ /* @__PURE__ */ c.jsx("div", { className: M("text-sm text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: I ? /* @__PURE__ */ c.jsx(Ks, { content: Ce, hideFallbackDuringStreaming: !0 }) : /* @__PURE__ */ c.jsxs("pre", { className: M("font-sans whitespace-pre-wrap break-words bg-transparent p-0 m-0 text-[hsl(var(--chat-bubble-user-text))]", O && "text-xs"), children: [
8778
8763
  Ce.substring(0, w),
8779
8764
  "..."
8780
8765
  ] }) }),
@@ -8809,12 +8794,12 @@ const _w = q.memo(function({
8809
8794
  );
8810
8795
  })(),
8811
8796
  Ne && /* @__PURE__ */ c.jsx("div", { className: "mt-2 grid grid-cols-2 gap-2", children: Z.map((fe, Ce) => {
8812
- const Be = fe, ot = typeof Be.width == "number" ? Be.width : void 0, et = typeof Be.height == "number" ? Be.height : void 0, xt = ot && et && et > 0 ? `${ot} / ${et}` : "4 / 3", it = ot && et && et > 0 ? Math.max(120, Math.round(et / ot * 140)) : 160;
8797
+ const Be = fe, ot = typeof Be.width == "number" ? Be.width : void 0, et = typeof Be.height == "number" ? Be.height : void 0, vt = ot && et && et > 0 ? `${ot} / ${et}` : "4 / 3", it = ot && et && et > 0 ? Math.max(120, Math.round(et / ot * 140)) : 160;
8813
8798
  return /* @__PURE__ */ c.jsxs(
8814
8799
  "div",
8815
8800
  {
8816
8801
  className: "relative border rounded overflow-hidden bg-gray-100 dark:bg-gray-900/40",
8817
- style: { aspectRatio: xt, minHeight: it },
8802
+ style: { aspectRatio: vt, minHeight: it },
8818
8803
  "data-placeholder-height": it,
8819
8804
  children: [
8820
8805
  /* @__PURE__ */ c.jsx(
@@ -8839,11 +8824,11 @@ const _w = q.memo(function({
8839
8824
  ] });
8840
8825
  }, je = ln(() => $w(t), [t]);
8841
8826
  return /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
8842
- /* @__PURE__ */ c.jsx("div", { className: D(ce(), x.container), children: /* @__PURE__ */ c.jsxs("div", { className: D(ie(), x.content), children: [
8827
+ /* @__PURE__ */ c.jsx("div", { className: M(ce(), x.container), children: /* @__PURE__ */ c.jsxs("div", { className: M(se(), x.content), children: [
8843
8828
  (a || l || K) && /* @__PURE__ */ c.jsxs(
8844
8829
  "div",
8845
8830
  {
8846
- className: D(
8831
+ className: M(
8847
8832
  "flex items-center justify-between mb-2 pb-2 border-b border-current/10",
8848
8833
  O && "mb-1 pb-1",
8849
8834
  W,
@@ -8852,18 +8837,18 @@ const _w = q.memo(function({
8852
8837
  children: [
8853
8838
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", children: [
8854
8839
  J(),
8855
- l && je && /* @__PURE__ */ c.jsx("span", { className: D("font-medium", O ? "text-xs" : "text-sm"), children: je }),
8840
+ l && je && /* @__PURE__ */ c.jsx("span", { className: M("font-medium", O ? "text-xs" : "text-sm"), children: je }),
8856
8841
  K && L.name && /* @__PURE__ */ c.jsxs(
8857
8842
  Pu,
8858
8843
  {
8859
8844
  variant: "outline",
8860
- className: D(
8845
+ className: M(
8861
8846
  "text-xs flex items-center gap-1 cursor-pointer",
8862
8847
  W,
8863
8848
  "border border-current/40",
8864
8849
  O && "text-xs h-4"
8865
8850
  ),
8866
- onClick: () => N((ae) => !ae),
8851
+ onClick: () => N((ie) => !ie),
8867
8852
  children: [
8868
8853
  /* @__PURE__ */ c.jsx("span", { children: L.name }),
8869
8854
  /* @__PURE__ */ c.jsx("span", { className: "inline-flex items-center", children: E ? /* @__PURE__ */ c.jsx(Cr, { className: "h-3 w-3" }) : /* @__PURE__ */ c.jsx(Qn, { className: "h-3 w-3" }) })
@@ -8875,8 +8860,8 @@ const _w = q.memo(function({
8875
8860
  {
8876
8861
  variant: "ghost",
8877
8862
  size: "sm",
8878
- className: D("h-6 px-1", W, "hover:bg-foreground/10"),
8879
- onClick: () => N((ae) => !ae),
8863
+ className: M("h-6 px-1", W, "hover:bg-foreground/10"),
8864
+ onClick: () => N((ie) => !ie),
8880
8865
  children: /* @__PURE__ */ c.jsxs("span", { className: "text-xs flex items-center gap-1", children: [
8881
8866
  "Tool Output ",
8882
8867
  E ? /* @__PURE__ */ c.jsx(Cr, { className: "h-3 w-3" }) : /* @__PURE__ */ c.jsx(Qn, { className: "h-3 w-3" })
@@ -8885,11 +8870,11 @@ const _w = q.memo(function({
8885
8870
  )
8886
8871
  ] }),
8887
8872
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", children: [
8888
- a && /* @__PURE__ */ c.jsx("span", { className: D("text-xs opacity-60", W, O && "text-xs"), children: Ae(t.createdAt) }),
8873
+ a && /* @__PURE__ */ c.jsx("span", { className: M("text-xs opacity-60", W, O && "text-xs"), children: Ae(t.createdAt) }),
8889
8874
  i && !s && /* @__PURE__ */ c.jsxs(
8890
8875
  "div",
8891
8876
  {
8892
- className: D(
8877
+ className: M(
8893
8878
  "opacity-0 group-hover:opacity-100 transition-opacity",
8894
8879
  "flex items-center gap-1",
8895
8880
  x.actions
@@ -8901,11 +8886,11 @@ const _w = q.memo(function({
8901
8886
  variant: "ghost",
8902
8887
  size: "sm",
8903
8888
  onClick: F,
8904
- className: D("h-6 w-6 p-0 hover:bg-foreground/10", W, O && "h-5 w-5"),
8889
+ className: M("h-6 w-6 p-0 hover:bg-foreground/10", W, O && "h-5 w-5"),
8905
8890
  children: /* @__PURE__ */ c.jsx(
8906
8891
  qa,
8907
8892
  {
8908
- className: D(
8893
+ className: M(
8909
8894
  y ? "text-success" : W,
8910
8895
  O ? "h-3 w-3" : "h-4 w-4"
8911
8896
  )
@@ -8913,24 +8898,24 @@ const _w = q.memo(function({
8913
8898
  )
8914
8899
  }
8915
8900
  ),
8916
- M === "user" && v && /* @__PURE__ */ c.jsx(
8901
+ D === "user" && v && /* @__PURE__ */ c.jsx(
8917
8902
  De,
8918
8903
  {
8919
8904
  variant: "ghost",
8920
8905
  size: "sm",
8921
8906
  onClick: A,
8922
- className: D("h-6 w-6 p-0 hover:bg-foreground/10", W, O && "h-5 w-5"),
8923
- children: /* @__PURE__ */ c.jsx(Xa, { className: D(W, O ? "h-3 w-3" : "h-4 w-4") })
8907
+ className: M("h-6 w-6 p-0 hover:bg-foreground/10", W, O && "h-5 w-5"),
8908
+ children: /* @__PURE__ */ c.jsx(Xa, { className: M(W, O ? "h-3 w-3" : "h-4 w-4") })
8924
8909
  }
8925
8910
  ),
8926
- M === "assistant" && p && /* @__PURE__ */ c.jsx(
8911
+ D === "assistant" && p && /* @__PURE__ */ c.jsx(
8927
8912
  De,
8928
8913
  {
8929
8914
  variant: "ghost",
8930
8915
  size: "sm",
8931
8916
  onClick: H,
8932
- className: D("h-6 w-6 p-0 hover:bg-foreground/10", W, O && "h-5 w-5"),
8933
- children: /* @__PURE__ */ c.jsx(ci, { className: D(W, O ? "h-3 w-3" : "h-4 w-4") })
8917
+ className: M("h-6 w-6 p-0 hover:bg-foreground/10", W, O && "h-5 w-5"),
8918
+ children: /* @__PURE__ */ c.jsx(ci, { className: M(W, O ? "h-3 w-3" : "h-4 w-4") })
8934
8919
  }
8935
8920
  )
8936
8921
  ]
@@ -8941,7 +8926,7 @@ const _w = q.memo(function({
8941
8926
  }
8942
8927
  ),
8943
8928
  /* @__PURE__ */ c.jsx("div", { className: "relative", children: _e() }),
8944
- K && E && (L.toolCallId || L.name) && /* @__PURE__ */ c.jsxs("div", { className: D("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", O && "text-xs"), children: [
8929
+ K && E && (L.toolCallId || L.name) && /* @__PURE__ */ c.jsxs("div", { className: M("mt-2 pt-2 border-t border-current/10 text-xs opacity-60", O && "text-xs"), children: [
8945
8930
  L.name && /* @__PURE__ */ c.jsxs("div", { children: [
8946
8931
  "Function: ",
8947
8932
  L.name
@@ -8954,7 +8939,7 @@ const _w = q.memo(function({
8954
8939
  !(a || l || K) && i && !s && /* @__PURE__ */ c.jsxs(
8955
8940
  "div",
8956
8941
  {
8957
- className: D(
8942
+ className: M(
8958
8943
  "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",
8959
8944
  "flex items-center gap-1",
8960
8945
  x.actions
@@ -8966,28 +8951,28 @@ const _w = q.memo(function({
8966
8951
  variant: "ghost",
8967
8952
  size: "sm",
8968
8953
  onClick: F,
8969
- className: D("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8970
- children: /* @__PURE__ */ c.jsx(qa, { className: D(y ? "text-success" : "text-current", O ? "h-3 w-3" : "h-4 w-4") })
8954
+ className: M("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8955
+ children: /* @__PURE__ */ c.jsx(qa, { className: M(y ? "text-success" : "text-current", O ? "h-3 w-3" : "h-4 w-4") })
8971
8956
  }
8972
8957
  ),
8973
- M === "user" && v && /* @__PURE__ */ c.jsx(
8958
+ D === "user" && v && /* @__PURE__ */ c.jsx(
8974
8959
  De,
8975
8960
  {
8976
8961
  variant: "ghost",
8977
8962
  size: "sm",
8978
8963
  onClick: A,
8979
- className: D("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8980
- children: /* @__PURE__ */ c.jsx(Xa, { className: D("text-current", O ? "h-3 w-3" : "h-4 w-4") })
8964
+ className: M("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8965
+ children: /* @__PURE__ */ c.jsx(Xa, { className: M("text-current", O ? "h-3 w-3" : "h-4 w-4") })
8981
8966
  }
8982
8967
  ),
8983
- M === "assistant" && p && /* @__PURE__ */ c.jsx(
8968
+ D === "assistant" && p && /* @__PURE__ */ c.jsx(
8984
8969
  De,
8985
8970
  {
8986
8971
  variant: "ghost",
8987
8972
  size: "sm",
8988
8973
  onClick: H,
8989
- className: D("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8990
- children: /* @__PURE__ */ c.jsx(ci, { className: D("text-current", O ? "h-3 w-3" : "h-4 w-4") })
8974
+ className: M("h-6 w-6 p-0 hover:bg-background/50 text-current", O && "h-5 w-5"),
8975
+ children: /* @__PURE__ */ c.jsx(ci, { className: M("text-current", O ? "h-3 w-3" : "h-4 w-4") })
8991
8976
  }
8992
8977
  )
8993
8978
  ]
@@ -8999,7 +8984,7 @@ const _w = q.memo(function({
8999
8984
  {
9000
8985
  isOpen: _,
9001
8986
  onClose: () => {
9002
- Y(!1), se(null);
8987
+ Y(!1), oe(null);
9003
8988
  },
9004
8989
  fileId: U.id,
9005
8990
  fileName: U.name,
@@ -9287,6 +9272,8 @@ const sl = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Sd = q.forwa
9287
9272
  overscan: 400,
9288
9273
  increaseViewportBy: { top: 200, bottom: 400 },
9289
9274
  defaultItemHeight: 120,
9275
+ fixedItemHeight: void 0,
9276
+ itemSize: () => 120,
9290
9277
  atBottomThreshold: 100,
9291
9278
  alignToBottom: !0,
9292
9279
  startReached: () => {
@@ -9302,7 +9289,10 @@ const sl = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, Sd = q.forwa
9302
9289
  {
9303
9290
  className: "mb-4 last:mb-0",
9304
9291
  "data-message-id": G,
9305
- style: { contentVisibility: "auto" },
9292
+ style: {
9293
+ minHeight: "60px",
9294
+ containIntrinsicSize: "auto 120px"
9295
+ },
9306
9296
  children: /* @__PURE__ */ c.jsx(
9307
9297
  _w,
9308
9298
  {
@@ -9697,14 +9687,14 @@ const ay = (e) => ({
9697
9687
  }, w = Sa(o), x = ya(w), v = await i.getDimensions(u), p = w === "y", g = p ? "top" : "left", b = p ? "bottom" : "right", y = p ? "clientHeight" : "clientWidth", R = s.reference[x] + s.reference[w] - m[w] - s.floating[x], S = m[w] - s.reference[w], C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(u));
9698
9688
  let E = C ? C[y] : 0;
9699
9689
  (!E || !await (i.isElement == null ? void 0 : i.isElement(C))) && (E = a.floating[y] || s.floating[x]);
9700
- const N = R / 2 - S / 2, I = E / 2 - v[x] / 2 - 1, j = bn(h[g], I), P = bn(h[b], I), B = j, G = E - v[x] - P, _ = E / 2 - v[x] / 2 + N, Y = Ni(B, _, G), U = !l.arrow && mr(o) != null && _ !== Y && s.reference[x] / 2 - (_ < B ? j : P) - v[x] / 2 < 0, se = U ? _ < B ? _ - B : _ - G : 0;
9690
+ const N = R / 2 - S / 2, I = E / 2 - v[x] / 2 - 1, j = bn(h[g], I), P = bn(h[b], I), B = j, G = E - v[x] - P, _ = E / 2 - v[x] / 2 + N, Y = Ni(B, _, G), U = !l.arrow && mr(o) != null && _ !== Y && s.reference[x] / 2 - (_ < B ? j : P) - v[x] / 2 < 0, oe = U ? _ < B ? _ - B : _ - G : 0;
9701
9691
  return {
9702
- [w]: m[w] + se,
9692
+ [w]: m[w] + oe,
9703
9693
  data: {
9704
9694
  [w]: Y,
9705
- centerOffset: _ - Y - se,
9695
+ centerOffset: _ - Y - oe,
9706
9696
  ...U && {
9707
- alignmentOffset: se
9697
+ alignmentOffset: oe
9708
9698
  }
9709
9699
  },
9710
9700
  reset: U
@@ -9760,21 +9750,21 @@ const ay = (e) => ({
9760
9750
  placement: Y
9761
9751
  }
9762
9752
  };
9763
- let U = (B = j.filter((se) => se.overflows[0] <= 0).sort((se, O) => se.overflows[1] - O.overflows[1])[0]) == null ? void 0 : B.placement;
9753
+ let U = (B = j.filter((oe) => oe.overflows[0] <= 0).sort((oe, O) => oe.overflows[1] - O.overflows[1])[0]) == null ? void 0 : B.placement;
9764
9754
  if (!U)
9765
9755
  switch (w) {
9766
9756
  case "bestFit": {
9767
9757
  var G;
9768
- const se = (G = j.filter((O) => {
9758
+ const oe = (G = j.filter((O) => {
9769
9759
  if (C) {
9770
- const M = en(O.placement);
9771
- return M === b || // Create a bias to the `y` side axis due to horizontal
9760
+ const D = en(O.placement);
9761
+ return D === b || // Create a bias to the `y` side axis due to horizontal
9772
9762
  // reading directions favoring greater width.
9773
- M === "y";
9763
+ D === "y";
9774
9764
  }
9775
9765
  return !0;
9776
- }).map((O) => [O.placement, O.overflows.filter((M) => M > 0).reduce((M, K) => M + K, 0)]).sort((O, M) => O[1] - M[1])[0]) == null ? void 0 : G[0];
9777
- se && (U = se);
9766
+ }).map((O) => [O.placement, O.overflows.filter((D) => D > 0).reduce((D, K) => D + K, 0)]).sort((O, D) => O[1] - D[1])[0]) == null ? void 0 : G[0];
9767
+ oe && (U = oe);
9778
9768
  break;
9779
9769
  }
9780
9770
  case "initialPlacement":
@@ -10611,9 +10601,9 @@ function Xy(e) {
10611
10601
  strategy: n,
10612
10602
  middleware: m
10613
10603
  };
10614
- P.current && (O.platform = P.current), Ky(C.current, E.current, O).then((M) => {
10604
+ P.current && (O.platform = P.current), Ky(C.current, E.current, O).then((D) => {
10615
10605
  const K = {
10616
- ...M,
10606
+ ...D,
10617
10607
  // The floating element's position may be recomputed while it's closed
10618
10608
  // but still mounted (such as when transitioning out). To ensure
10619
10609
  // `isPositioned` will be `false` initially on the next open, avoid
@@ -10649,7 +10639,7 @@ function Xy(e) {
10649
10639
  }), [b, y]), U = f.useMemo(() => ({
10650
10640
  reference: R,
10651
10641
  floating: S
10652
- }), [R, S]), se = f.useMemo(() => {
10642
+ }), [R, S]), oe = f.useMemo(() => {
10653
10643
  const O = {
10654
10644
  position: n,
10655
10645
  left: 0,
@@ -10657,16 +10647,16 @@ function Xy(e) {
10657
10647
  };
10658
10648
  if (!U.floating)
10659
10649
  return O;
10660
- const M = ml(U.floating, d.x), K = ml(U.floating, d.y);
10650
+ const D = ml(U.floating, d.x), K = ml(U.floating, d.y);
10661
10651
  return a ? {
10662
10652
  ...O,
10663
- transform: "translate(" + M + "px, " + K + "px)",
10653
+ transform: "translate(" + D + "px, " + K + "px)",
10664
10654
  ..._d(U.floating) >= 1.5 && {
10665
10655
  willChange: "transform"
10666
10656
  }
10667
10657
  } : {
10668
10658
  position: n,
10669
- left: M,
10659
+ left: D,
10670
10660
  top: K
10671
10661
  };
10672
10662
  }, [n, a, U.floating, d.x, d.y]);
@@ -10675,8 +10665,8 @@ function Xy(e) {
10675
10665
  update: G,
10676
10666
  refs: Y,
10677
10667
  elements: U,
10678
- floatingStyles: se
10679
- }), [d, G, Y, U, se]);
10668
+ floatingStyles: oe
10669
+ }), [d, G, Y, U, oe]);
10680
10670
  }
10681
10671
  const Jy = (e) => {
10682
10672
  function t(n) {
@@ -10777,7 +10767,7 @@ var Bd = "PopperAnchor", $d = f.forwardRef(
10777
10767
  $d.displayName = Bd;
10778
10768
  var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10779
10769
  (e, t) => {
10780
- var F, A, H, J, ce, ie;
10770
+ var F, A, H, J, ce, se;
10781
10771
  const {
10782
10772
  __scopePopper: n,
10783
10773
  side: r = "bottom",
@@ -10798,7 +10788,7 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10798
10788
  boundary: P.filter(d0),
10799
10789
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
10800
10790
  altBoundary: B
10801
- }, { refs: _, floatingStyles: Y, placement: U, isPositioned: se, middlewareData: O } = Xy({
10791
+ }, { refs: _, floatingStyles: Y, placement: U, isPositioned: oe, middlewareData: O } = Xy({
10802
10792
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
10803
10793
  strategy: "fixed",
10804
10794
  placement: I,
@@ -10819,19 +10809,19 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10819
10809
  l && t0({ ...G }),
10820
10810
  n0({
10821
10811
  ...G,
10822
- apply: ({ elements: Ae, rects: _e, availableWidth: je, availableHeight: ae }) => {
10812
+ apply: ({ elements: Ae, rects: _e, availableWidth: je, availableHeight: ie }) => {
10823
10813
  const { width: Ne, height: Se } = _e.reference, fe = Ae.floating.style;
10824
- fe.setProperty("--radix-popper-available-width", `${je}px`), fe.setProperty("--radix-popper-available-height", `${ae}px`), fe.setProperty("--radix-popper-anchor-width", `${Ne}px`), fe.setProperty("--radix-popper-anchor-height", `${Se}px`);
10814
+ fe.setProperty("--radix-popper-available-width", `${je}px`), fe.setProperty("--radix-popper-available-height", `${ie}px`), fe.setProperty("--radix-popper-anchor-width", `${Ne}px`), fe.setProperty("--radix-popper-anchor-height", `${Se}px`);
10825
10815
  }
10826
10816
  }),
10827
10817
  R && o0({ element: R, padding: a }),
10828
10818
  f0({ arrowWidth: E, arrowHeight: N }),
10829
10819
  m && r0({ strategy: "referenceHidden", ...G })
10830
10820
  ]
10831
- }), [M, K] = Wd(U), W = ct(x);
10821
+ }), [D, K] = Wd(U), W = ct(x);
10832
10822
  st(() => {
10833
- se && (W == null || W());
10834
- }, [se, W]);
10823
+ oe && (W == null || W());
10824
+ }, [oe, W]);
10835
10825
  const ee = (F = O.arrow) == null ? void 0 : F.x, L = (A = O.arrow) == null ? void 0 : A.y, Z = ((H = O.arrow) == null ? void 0 : H.centerOffset) !== 0, [pe, he] = f.useState();
10836
10826
  return st(() => {
10837
10827
  g && he(window.getComputedStyle(g).zIndex);
@@ -10842,7 +10832,7 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10842
10832
  "data-radix-popper-content-wrapper": "",
10843
10833
  style: {
10844
10834
  ...Y,
10845
- transform: se ? Y.transform : "translate(0, -200%)",
10835
+ transform: oe ? Y.transform : "translate(0, -200%)",
10846
10836
  // keep off the page when measuring
10847
10837
  minWidth: "max-content",
10848
10838
  zIndex: pe,
@@ -10853,7 +10843,7 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10853
10843
  // hide the content if using the hide middleware and should be hidden
10854
10844
  // set visibility to hidden and disable pointer events so the UI behaves
10855
10845
  // as if the PopperContent isn't there at all
10856
- ...((ie = O.hide) == null ? void 0 : ie.referenceHidden) && {
10846
+ ...((se = O.hide) == null ? void 0 : se.referenceHidden) && {
10857
10847
  visibility: "hidden",
10858
10848
  pointerEvents: "none"
10859
10849
  }
@@ -10863,7 +10853,7 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10863
10853
  c0,
10864
10854
  {
10865
10855
  scope: n,
10866
- placedSide: M,
10856
+ placedSide: D,
10867
10857
  onArrowChange: S,
10868
10858
  arrowX: ee,
10869
10859
  arrowY: L,
@@ -10871,7 +10861,7 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10871
10861
  children: /* @__PURE__ */ c.jsx(
10872
10862
  ve.div,
10873
10863
  {
10874
- "data-side": M,
10864
+ "data-side": D,
10875
10865
  "data-align": K,
10876
10866
  ...v,
10877
10867
  ref: y,
@@ -10879,7 +10869,7 @@ var Ia = "PopperContent", [c0, l0] = Dd(Ia), Hd = f.forwardRef(
10879
10869
  ...v.style,
10880
10870
  // if the PopperContent hasn't been placed yet (not all measurements done)
10881
10871
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
10882
- animation: se ? void 0 : "none"
10872
+ animation: oe ? void 0 : "none"
10883
10873
  }
10884
10874
  }
10885
10875
  )
@@ -11236,17 +11226,17 @@ var Mt = "MenuContent", [M0, Ma] = Un(Mt), rf = f.forwardRef(
11236
11226
  onDismiss: w,
11237
11227
  disableOutsideScroll: x,
11238
11228
  ...v
11239
- } = e, p = Wn(Mt, n), g = no(Mt, n), b = Ss(n), y = Qd(n), R = j0(n), [S, C] = f.useState(null), E = f.useRef(null), N = Ee(t, E, p.onContentChange), I = f.useRef(0), j = f.useRef(""), P = f.useRef(0), B = f.useRef(null), G = f.useRef("right"), _ = f.useRef(0), Y = x ? hs : f.Fragment, U = x ? { as: F0, allowPinchZoom: !0 } : void 0, se = (M) => {
11229
+ } = e, p = Wn(Mt, n), g = no(Mt, n), b = Ss(n), y = Qd(n), R = j0(n), [S, C] = f.useState(null), E = f.useRef(null), N = Ee(t, E, p.onContentChange), I = f.useRef(0), j = f.useRef(""), P = f.useRef(0), B = f.useRef(null), G = f.useRef("right"), _ = f.useRef(0), Y = x ? hs : f.Fragment, U = x ? { as: F0, allowPinchZoom: !0 } : void 0, oe = (D) => {
11240
11230
  var F, A;
11241
- const K = j.current + M, W = R().filter((H) => !H.disabled), ee = document.activeElement, L = (F = W.find((H) => H.ref.current === ee)) == null ? void 0 : F.textValue, Z = W.map((H) => H.textValue), pe = X0(Z, K, L), he = (A = W.find((H) => H.textValue === pe)) == null ? void 0 : A.ref.current;
11231
+ const K = j.current + D, W = R().filter((H) => !H.disabled), ee = document.activeElement, L = (F = W.find((H) => H.ref.current === ee)) == null ? void 0 : F.textValue, Z = W.map((H) => H.textValue), pe = X0(Z, K, L), he = (A = W.find((H) => H.textValue === pe)) == null ? void 0 : A.ref.current;
11242
11232
  (function H(J) {
11243
11233
  j.current = J, window.clearTimeout(I.current), J !== "" && (I.current = window.setTimeout(() => H(""), 1e3));
11244
11234
  })(K), he && setTimeout(() => he.focus());
11245
11235
  };
11246
11236
  f.useEffect(() => () => window.clearTimeout(I.current), []), pa();
11247
- const O = f.useCallback((M) => {
11237
+ const O = f.useCallback((D) => {
11248
11238
  var W, ee;
11249
- return G.current === ((W = B.current) == null ? void 0 : W.side) && Z0(M, (ee = B.current) == null ? void 0 : ee.area);
11239
+ return G.current === ((W = B.current) == null ? void 0 : W.side) && Z0(D, (ee = B.current) == null ? void 0 : ee.area);
11250
11240
  }, []);
11251
11241
  return /* @__PURE__ */ c.jsx(
11252
11242
  M0,
@@ -11254,36 +11244,36 @@ var Mt = "MenuContent", [M0, Ma] = Un(Mt), rf = f.forwardRef(
11254
11244
  scope: n,
11255
11245
  searchRef: j,
11256
11246
  onItemEnter: f.useCallback(
11257
- (M) => {
11258
- O(M) && M.preventDefault();
11247
+ (D) => {
11248
+ O(D) && D.preventDefault();
11259
11249
  },
11260
11250
  [O]
11261
11251
  ),
11262
11252
  onItemLeave: f.useCallback(
11263
- (M) => {
11253
+ (D) => {
11264
11254
  var K;
11265
- O(M) || ((K = E.current) == null || K.focus(), C(null));
11255
+ O(D) || ((K = E.current) == null || K.focus(), C(null));
11266
11256
  },
11267
11257
  [O]
11268
11258
  ),
11269
11259
  onTriggerLeave: f.useCallback(
11270
- (M) => {
11271
- O(M) && M.preventDefault();
11260
+ (D) => {
11261
+ O(D) && D.preventDefault();
11272
11262
  },
11273
11263
  [O]
11274
11264
  ),
11275
11265
  pointerGraceTimerRef: P,
11276
- onPointerGraceIntentChange: f.useCallback((M) => {
11277
- B.current = M;
11266
+ onPointerGraceIntentChange: f.useCallback((D) => {
11267
+ B.current = D;
11278
11268
  }, []),
11279
11269
  children: /* @__PURE__ */ c.jsx(Y, { ...U, children: /* @__PURE__ */ c.jsx(
11280
11270
  us,
11281
11271
  {
11282
11272
  asChild: !0,
11283
11273
  trapped: o,
11284
- onMountAutoFocus: Q(s, (M) => {
11274
+ onMountAutoFocus: Q(s, (D) => {
11285
11275
  var K;
11286
- M.preventDefault(), (K = E.current) == null || K.focus({ preventScroll: !0 });
11276
+ D.preventDefault(), (K = E.current) == null || K.focus({ preventScroll: !0 });
11287
11277
  }),
11288
11278
  onUnmountAutoFocus: i,
11289
11279
  children: /* @__PURE__ */ c.jsx(
@@ -11306,8 +11296,8 @@ var Mt = "MenuContent", [M0, Ma] = Un(Mt), rf = f.forwardRef(
11306
11296
  loop: r,
11307
11297
  currentTabStopId: S,
11308
11298
  onCurrentTabStopIdChange: C,
11309
- onEntryFocus: Q(l, (M) => {
11310
- g.isUsingKeyboardRef.current || M.preventDefault();
11299
+ onEntryFocus: Q(l, (D) => {
11300
+ g.isUsingKeyboardRef.current || D.preventDefault();
11311
11301
  }),
11312
11302
  preventScrollOnEntryFocus: !0,
11313
11303
  children: /* @__PURE__ */ c.jsx(
@@ -11322,25 +11312,25 @@ var Mt = "MenuContent", [M0, Ma] = Un(Mt), rf = f.forwardRef(
11322
11312
  ...v,
11323
11313
  ref: N,
11324
11314
  style: { outline: "none", ...v.style },
11325
- onKeyDown: Q(v.onKeyDown, (M) => {
11326
- const W = M.target.closest("[data-radix-menu-content]") === M.currentTarget, ee = M.ctrlKey || M.altKey || M.metaKey, L = M.key.length === 1;
11327
- W && (M.key === "Tab" && M.preventDefault(), !ee && L && se(M.key));
11315
+ onKeyDown: Q(v.onKeyDown, (D) => {
11316
+ const W = D.target.closest("[data-radix-menu-content]") === D.currentTarget, ee = D.ctrlKey || D.altKey || D.metaKey, L = D.key.length === 1;
11317
+ W && (D.key === "Tab" && D.preventDefault(), !ee && L && oe(D.key));
11328
11318
  const Z = E.current;
11329
- if (M.target !== Z || !E0.includes(M.key)) return;
11330
- M.preventDefault();
11319
+ if (D.target !== Z || !E0.includes(D.key)) return;
11320
+ D.preventDefault();
11331
11321
  const he = R().filter((F) => !F.disabled).map((F) => F.ref.current);
11332
- Jd.includes(M.key) && he.reverse(), Y0(he);
11322
+ Jd.includes(D.key) && he.reverse(), Y0(he);
11333
11323
  }),
11334
- onBlur: Q(e.onBlur, (M) => {
11335
- M.currentTarget.contains(M.target) || (window.clearTimeout(I.current), j.current = "");
11324
+ onBlur: Q(e.onBlur, (D) => {
11325
+ D.currentTarget.contains(D.target) || (window.clearTimeout(I.current), j.current = "");
11336
11326
  }),
11337
11327
  onPointerMove: Q(
11338
11328
  e.onPointerMove,
11339
- Hr((M) => {
11340
- const K = M.target, W = _.current !== M.clientX;
11341
- if (M.currentTarget.contains(K) && W) {
11342
- const ee = M.clientX > _.current ? "right" : "left";
11343
- G.current = ee, _.current = M.clientX;
11329
+ Hr((D) => {
11330
+ const K = D.target, W = _.current !== D.clientX;
11331
+ if (D.currentTarget.contains(K) && W) {
11332
+ const ee = D.clientX > _.current ? "right" : "left";
11333
+ G.current = ee, _.current = D.clientX;
11344
11334
  }
11345
11335
  })
11346
11336
  )
@@ -11696,7 +11686,7 @@ function Hr(e) {
11696
11686
  var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS = lf, cS = df, lS = hf, uS = pf, dS = mf, fS = vf, hS = bf, Ts = "DropdownMenu", [pS, gR] = Gt(
11697
11687
  Ts,
11698
11688
  [Zd]
11699
- ), vt = Zd(), [mS, yf] = pS(Ts), Sf = (e) => {
11689
+ ), gt = Zd(), [mS, yf] = pS(Ts), Sf = (e) => {
11700
11690
  const {
11701
11691
  __scopeDropdownMenu: t,
11702
11692
  children: n,
@@ -11705,7 +11695,7 @@ var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS =
11705
11695
  defaultOpen: s,
11706
11696
  onOpenChange: i,
11707
11697
  modal: a = !0
11708
- } = e, l = vt(t), u = f.useRef(null), [d, h] = xn({
11698
+ } = e, l = gt(t), u = f.useRef(null), [d, h] = xn({
11709
11699
  prop: o,
11710
11700
  defaultProp: s ?? !1,
11711
11701
  onChange: i,
@@ -11729,7 +11719,7 @@ var Q0 = ef, eS = _a, tS = nf, nS = rf, rS = La, oS = of, sS = Cs, iS = af, aS =
11729
11719
  Sf.displayName = Ts;
11730
11720
  var Cf = "DropdownMenuTrigger", Tf = f.forwardRef(
11731
11721
  (e, t) => {
11732
- const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = yf(Cf, n), i = vt(n);
11722
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, s = yf(Cf, n), i = gt(n);
11733
11723
  return /* @__PURE__ */ c.jsx(eS, { asChild: !0, ...i, children: /* @__PURE__ */ c.jsx(
11734
11724
  ve.button,
11735
11725
  {
@@ -11755,13 +11745,13 @@ var Cf = "DropdownMenuTrigger", Tf = f.forwardRef(
11755
11745
  );
11756
11746
  Tf.displayName = Cf;
11757
11747
  var gS = "DropdownMenuPortal", Rf = (e) => {
11758
- const { __scopeDropdownMenu: t, ...n } = e, r = vt(t);
11748
+ const { __scopeDropdownMenu: t, ...n } = e, r = gt(t);
11759
11749
  return /* @__PURE__ */ c.jsx(tS, { ...r, ...n });
11760
11750
  };
11761
11751
  Rf.displayName = gS;
11762
11752
  var Ef = "DropdownMenuContent", Nf = f.forwardRef(
11763
11753
  (e, t) => {
11764
- const { __scopeDropdownMenu: n, ...r } = e, o = yf(Ef, n), s = vt(n), i = f.useRef(!1);
11754
+ const { __scopeDropdownMenu: n, ...r } = e, o = yf(Ef, n), s = gt(n), i = f.useRef(!1);
11765
11755
  return /* @__PURE__ */ c.jsx(
11766
11756
  nS,
11767
11757
  {
@@ -11793,64 +11783,64 @@ var Ef = "DropdownMenuContent", Nf = f.forwardRef(
11793
11783
  Nf.displayName = Ef;
11794
11784
  var vS = "DropdownMenuGroup", xS = f.forwardRef(
11795
11785
  (e, t) => {
11796
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11786
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11797
11787
  return /* @__PURE__ */ c.jsx(rS, { ...o, ...r, ref: t });
11798
11788
  }
11799
11789
  );
11800
11790
  xS.displayName = vS;
11801
11791
  var bS = "DropdownMenuLabel", If = f.forwardRef(
11802
11792
  (e, t) => {
11803
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11793
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11804
11794
  return /* @__PURE__ */ c.jsx(oS, { ...o, ...r, ref: t });
11805
11795
  }
11806
11796
  );
11807
11797
  If.displayName = bS;
11808
11798
  var wS = "DropdownMenuItem", jf = f.forwardRef(
11809
11799
  (e, t) => {
11810
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11800
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11811
11801
  return /* @__PURE__ */ c.jsx(sS, { ...o, ...r, ref: t });
11812
11802
  }
11813
11803
  );
11814
11804
  jf.displayName = wS;
11815
11805
  var yS = "DropdownMenuCheckboxItem", kf = f.forwardRef((e, t) => {
11816
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11806
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11817
11807
  return /* @__PURE__ */ c.jsx(iS, { ...o, ...r, ref: t });
11818
11808
  });
11819
11809
  kf.displayName = yS;
11820
11810
  var SS = "DropdownMenuRadioGroup", CS = f.forwardRef((e, t) => {
11821
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11811
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11822
11812
  return /* @__PURE__ */ c.jsx(aS, { ...o, ...r, ref: t });
11823
11813
  });
11824
11814
  CS.displayName = SS;
11825
11815
  var TS = "DropdownMenuRadioItem", Af = f.forwardRef((e, t) => {
11826
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11816
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11827
11817
  return /* @__PURE__ */ c.jsx(cS, { ...o, ...r, ref: t });
11828
11818
  });
11829
11819
  Af.displayName = TS;
11830
11820
  var RS = "DropdownMenuItemIndicator", Pf = f.forwardRef((e, t) => {
11831
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11821
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11832
11822
  return /* @__PURE__ */ c.jsx(lS, { ...o, ...r, ref: t });
11833
11823
  });
11834
11824
  Pf.displayName = RS;
11835
11825
  var ES = "DropdownMenuSeparator", _f = f.forwardRef((e, t) => {
11836
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11826
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11837
11827
  return /* @__PURE__ */ c.jsx(uS, { ...o, ...r, ref: t });
11838
11828
  });
11839
11829
  _f.displayName = ES;
11840
11830
  var NS = "DropdownMenuArrow", IS = f.forwardRef(
11841
11831
  (e, t) => {
11842
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11832
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11843
11833
  return /* @__PURE__ */ c.jsx(dS, { ...o, ...r, ref: t });
11844
11834
  }
11845
11835
  );
11846
11836
  IS.displayName = NS;
11847
11837
  var jS = "DropdownMenuSubTrigger", Of = f.forwardRef((e, t) => {
11848
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11838
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11849
11839
  return /* @__PURE__ */ c.jsx(fS, { ...o, ...r, ref: t });
11850
11840
  });
11851
11841
  Of.displayName = jS;
11852
11842
  var kS = "DropdownMenuSubContent", Mf = f.forwardRef((e, t) => {
11853
- const { __scopeDropdownMenu: n, ...r } = e, o = vt(n);
11843
+ const { __scopeDropdownMenu: n, ...r } = e, o = gt(n);
11854
11844
  return /* @__PURE__ */ c.jsx(
11855
11845
  hS,
11856
11846
  {
@@ -11874,7 +11864,7 @@ const OS = AS, MS = PS, DS = f.forwardRef(({ className: e, inset: t, children: n
11874
11864
  Uf,
11875
11865
  {
11876
11866
  ref: o,
11877
- className: D(
11867
+ className: M(
11878
11868
  "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",
11879
11869
  t && "pl-8",
11880
11870
  e
@@ -11891,7 +11881,7 @@ const LS = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
11891
11881
  Wf,
11892
11882
  {
11893
11883
  ref: n,
11894
- className: D(
11884
+ className: M(
11895
11885
  "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",
11896
11886
  e
11897
11887
  ),
@@ -11904,7 +11894,7 @@ const Vf = f.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__
11904
11894
  {
11905
11895
  ref: r,
11906
11896
  sideOffset: t,
11907
- className: D(
11897
+ className: M(
11908
11898
  "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",
11909
11899
  e
11910
11900
  ),
@@ -11916,7 +11906,7 @@ const Pi = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
11916
11906
  Ff,
11917
11907
  {
11918
11908
  ref: r,
11919
- className: D(
11909
+ className: M(
11920
11910
  "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",
11921
11911
  t && "pl-8",
11922
11912
  e
@@ -11929,7 +11919,7 @@ const FS = f.forwardRef(({ className: e, children: t, checked: n, ...r }, o) =>
11929
11919
  Bf,
11930
11920
  {
11931
11921
  ref: o,
11932
- className: D(
11922
+ className: M(
11933
11923
  "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",
11934
11924
  e
11935
11925
  ),
@@ -11946,7 +11936,7 @@ const BS = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
11946
11936
  $f,
11947
11937
  {
11948
11938
  ref: r,
11949
- className: D(
11939
+ className: M(
11950
11940
  "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",
11951
11941
  e
11952
11942
  ),
@@ -11962,7 +11952,7 @@ const $S = f.forwardRef(({ className: e, inset: t, ...n }, r) => /* @__PURE__ */
11962
11952
  Lf,
11963
11953
  {
11964
11954
  ref: r,
11965
- className: D(
11955
+ className: M(
11966
11956
  "px-2 py-1.5 text-sm font-semibold",
11967
11957
  t && "pl-8",
11968
11958
  e
@@ -11975,7 +11965,7 @@ const HS = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
11975
11965
  zf,
11976
11966
  {
11977
11967
  ref: n,
11978
- className: D("-mx-1 my-1 h-px bg-muted", e),
11968
+ className: M("-mx-1 my-1 h-px bg-muted", e),
11979
11969
  ...t
11980
11970
  }
11981
11971
  ));
@@ -12014,7 +12004,7 @@ function ko({
12014
12004
  loadOlderMessages: B,
12015
12005
  isPostStreamFetch: G,
12016
12006
  api: _
12017
- } = Yi(), [Y, U] = ue(null), [se, O] = ue(""), [M, K] = ue(null), [W, ee] = ue([]), [L, Z] = ue(!1), [pe, he] = ue(null), [F, A] = ue(null), [H, J] = ue(!1), [ce, ie] = ue(null), [Ae, _e] = ue([]), [je, ae] = ue(null), [Ne, Se] = ue(null), [fe, Ce] = ue(!1), Be = Ke(null), ot = Ke(null), et = Ke(null), [xt, it] = ue("desktop");
12007
+ } = Yi(), [Y, U] = ue(null), [oe, O] = ue(""), [D, K] = ue(null), [W, ee] = ue([]), [L, Z] = ue(!1), [pe, he] = ue(null), [F, A] = ue(null), [H, J] = ue(!1), [ce, se] = ue(null), [Ae, _e] = ue([]), [je, ie] = ue(null), [Ne, Se] = ue(null), [fe, Ce] = ue(!1), Be = Ke(null), ot = Ke(null), et = Ke(null), [vt, it] = ue("desktop");
12018
12008
  Ze(() => {
12019
12009
  const te = () => {
12020
12010
  const le = window.innerWidth;
@@ -12024,7 +12014,7 @@ function ko({
12024
12014
  }, []), Ze(() => {
12025
12015
  let te = !1;
12026
12016
  if (!x) {
12027
- _e([]), ae(null), Se(null), et.current = null;
12017
+ _e([]), ie(null), Se(null), et.current = null;
12028
12018
  return;
12029
12019
  }
12030
12020
  const le = {
@@ -12044,14 +12034,14 @@ function ko({
12044
12034
  const qt = Nn.find((Kn) => Kn.checkpointId === Gn);
12045
12035
  ro = (qt == null ? void 0 : qt.checkpointNs) ?? null;
12046
12036
  }
12047
- ae(Gn), Se(ro), et.current = le;
12037
+ ie(Gn), Se(ro), et.current = le;
12048
12038
  }).catch((Ye) => {
12049
12039
  console.error("ChatInterface - listCheckpoints error:", Ye), te || (_e([]), et.current = null);
12050
12040
  }), () => {
12051
12041
  te = !0;
12052
12042
  };
12053
12043
  }, [x, S, C, je, E]), Ze(() => {
12054
- S && (ae(S), Se(C ?? null));
12044
+ S && (ie(S), Se(C ?? null));
12055
12045
  }, [S, C]);
12056
12046
  const an = Ue(async () => {
12057
12047
  if (!(!j || P))
@@ -12065,9 +12055,9 @@ function ko({
12065
12055
  (async () => {
12066
12056
  try {
12067
12057
  const le = await _.getAgent("default");
12068
- ie(le.uiDefaultMessage || null);
12058
+ se(le.uiDefaultMessage || null);
12069
12059
  } catch (le) {
12070
- console.warn("Failed to fetch default message:", le), ie(null);
12060
+ console.warn("Failed to fetch default message:", le), se(null);
12071
12061
  }
12072
12062
  })();
12073
12063
  }, [_]), Ze(() => {
@@ -12081,7 +12071,7 @@ function ko({
12081
12071
  } catch (le) {
12082
12072
  return (le == null ? void 0 : le.message) || "Invalid message";
12083
12073
  }
12084
- }, ne = (te) => {
12074
+ }, ae = (te) => {
12085
12075
  const le = te.content || [], Oe = le.filter((Ye) => Ye.type === "text").map((Ye) => Ye.text).join("");
12086
12076
  if (Oe) return Oe;
12087
12077
  try {
@@ -12115,19 +12105,19 @@ function ko({
12115
12105
  u && (U(te), O(le), K(null));
12116
12106
  }, [u]), Re = q.useCallback(() => {
12117
12107
  U(null), O(""), K(null);
12118
- }, []), ht = Ue((te, le) => {
12108
+ }, []), xt = Ue((te, le) => {
12119
12109
  qe(te, le);
12120
12110
  }, [qe]), jt = Ue((te) => {
12121
12111
  for (let le = te - 1; le >= 0; le--)
12122
12112
  if (v[le].role === "user") {
12123
- const Oe = ne(v[le]);
12113
+ const Oe = ae(v[le]);
12124
12114
  Oe && y(Oe, {
12125
12115
  checkpointId: je ?? S ?? void 0,
12126
12116
  checkpointNs: Ne ?? C ?? void 0
12127
12117
  });
12128
12118
  break;
12129
12119
  }
12130
- }, [v, y, je, Ne, S, C, ne]), En = (te) => {
12120
+ }, [v, y, je, Ne, S, C, ae]), En = (te) => {
12131
12121
  const le = Array.from(te.target.files || []);
12132
12122
  ee((Oe) => [...Oe, ...le]);
12133
12123
  }, lt = (te) => ee((le) => le.filter((Oe, Ye) => te !== Ye)), Tt = async (te) => {
@@ -12153,16 +12143,16 @@ function ko({
12153
12143
  if (!te) return "Unknown";
12154
12144
  const le = Date.parse(te);
12155
12145
  return Number.isNaN(le) ? te : new Date(le).toLocaleString();
12156
- }, pt = async (te) => {
12146
+ }, ht = async (te) => {
12157
12147
  if (x) {
12158
12148
  Ce(!0);
12159
12149
  try {
12160
12150
  if (!te) {
12161
- await I(), ae(null), Se(null);
12151
+ await I(), ie(null), Se(null);
12162
12152
  return;
12163
12153
  }
12164
12154
  const le = Ae.find((Ye) => Ye.checkpointId === te), Oe = (le == null ? void 0 : le.checkpointNs) ?? null;
12165
- await N(te, Oe), ae(te), Se(Oe);
12155
+ await N(te, Oe), ie(te), Se(Oe);
12166
12156
  } finally {
12167
12157
  Ce(!1);
12168
12158
  }
@@ -12192,7 +12182,7 @@ function ko({
12192
12182
  value: je ?? "",
12193
12183
  onChange: (te) => {
12194
12184
  const le = te.target.value || null;
12195
- pt(le);
12185
+ ht(le);
12196
12186
  },
12197
12187
  children: [
12198
12188
  /* @__PURE__ */ c.jsx("option", { value: "", children: "Latest" }),
@@ -12214,13 +12204,13 @@ function ko({
12214
12204
  streamingAssistantId: g,
12215
12205
  streamingDebounceMs: typeof s == "number" ? s : o,
12216
12206
  followNewMessages: i,
12217
- layoutSize: xt,
12207
+ layoutSize: vt,
12218
12208
  enableMessageEditing: u,
12219
12209
  editingMessageId: Y,
12220
12210
  onStartReached: () => {
12221
12211
  an();
12222
12212
  },
12223
- onEdit: ht,
12213
+ onEdit: xt,
12224
12214
  onRegenerate: jt,
12225
12215
  onCancelEdit: Re,
12226
12216
  emptyMessage: ce ?? void 0,
@@ -12291,7 +12281,7 @@ function ko({
12291
12281
  pe && !L && /* @__PURE__ */ c.jsx("div", { className: "text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600", children: pe })
12292
12282
  ] })
12293
12283
  ] }),
12294
- M && /* @__PURE__ */ c.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: M }),
12284
+ D && /* @__PURE__ */ c.jsx("div", { className: "mb-3 text-sm text-red-600 bg-red-50 border border-red-200 rounded px-3 py-2", children: D }),
12295
12285
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-end gap-2", children: [
12296
12286
  (a || l) && /* @__PURE__ */ c.jsxs(OS, { children: [
12297
12287
  /* @__PURE__ */ c.jsx(MS, { asChild: !0, children: /* @__PURE__ */ c.jsx(
@@ -12333,7 +12323,7 @@ function ko({
12333
12323
  /* @__PURE__ */ c.jsx("div", { className: "flex-1", children: /* @__PURE__ */ c.jsx(
12334
12324
  hv,
12335
12325
  {
12336
- initialValue: se,
12326
+ initialValue: oe,
12337
12327
  editingMessageId: Y,
12338
12328
  placeholder: Y ? "Edit your message..." : t,
12339
12329
  isStreaming: p,
@@ -12343,7 +12333,7 @@ function ko({
12343
12333
  onCancelEdit: Re,
12344
12334
  onStop: R,
12345
12335
  allowEmptySend: W.length > 0,
12346
- textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${Y ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${M ? "border-red-400" : ""} ${d.textarea || ""}`
12336
+ textareaClassName: `resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${Y ? "border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50" : ""} ${D ? "border-red-400" : ""} ${d.textarea || ""}`
12347
12337
  }
12348
12338
  ) })
12349
12339
  ] })
@@ -12355,7 +12345,7 @@ const zr = f.forwardRef(
12355
12345
  "input",
12356
12346
  {
12357
12347
  type: t,
12358
- className: D(
12348
+ className: M(
12359
12349
  "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",
12360
12350
  e
12361
12351
  ),
@@ -12883,7 +12873,7 @@ const sh = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
12883
12873
  oh,
12884
12874
  {
12885
12875
  ref: r,
12886
- className: D("relative overflow-hidden", e),
12876
+ className: M("relative overflow-hidden", e),
12887
12877
  ...n,
12888
12878
  children: [
12889
12879
  /* @__PURE__ */ c.jsx(QS, { className: "h-full w-full rounded-[inherit] overflow-auto", children: t }),
@@ -12898,7 +12888,7 @@ const ih = f.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r)
12898
12888
  {
12899
12889
  ref: r,
12900
12890
  orientation: t,
12901
- className: D(
12891
+ className: M(
12902
12892
  "flex touch-none select-none transition-colors",
12903
12893
  t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
12904
12894
  t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
@@ -12957,7 +12947,7 @@ function Oi({
12957
12947
  } catch (pe) {
12958
12948
  console.error("Failed to delete thread:", pe);
12959
12949
  }
12960
- }, se = (L, Z) => {
12950
+ }, oe = (L, Z) => {
12961
12951
  Z.stopPropagation(), I(L.threadId), P(L.title || `Thread ${L.threadId.slice(0, 8)}`);
12962
12952
  }, O = async (L) => {
12963
12953
  if (j.trim())
@@ -12966,10 +12956,10 @@ function Oi({
12966
12956
  } catch (Z) {
12967
12957
  console.error("Failed to update title:", Z);
12968
12958
  }
12969
- }, M = () => {
12959
+ }, D = () => {
12970
12960
  I(null), P("");
12971
12961
  }, K = (L, Z) => {
12972
- L.key === "Enter" ? O(Z) : L.key === "Escape" && M();
12962
+ L.key === "Enter" ? O(Z) : L.key === "Escape" && D();
12973
12963
  }, W = (L) => {
12974
12964
  if (!L) return "";
12975
12965
  try {
@@ -13010,7 +13000,7 @@ function Oi({
13010
13000
  /* @__PURE__ */ c.jsx("div", { className: "flex-1 min-w-0", children: N === L.threadId ? /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2", onClick: (Z) => Z.stopPropagation(), children: [
13011
13001
  /* @__PURE__ */ c.jsx(zr, { value: j, onChange: (Z) => P(Z.target.value), onKeyDown: (Z) => K(Z, L.threadId), className: "h-6 text-sm", autoFocus: !0 }),
13012
13002
  /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", onClick: () => O(L.threadId), className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(Wi, { size: 12 }) }),
13013
- /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", onClick: M, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(er, { size: 12 }) })
13003
+ /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", onClick: D, className: "h-6 w-6 p-0", children: /* @__PURE__ */ c.jsx(er, { size: 12 }) })
13014
13004
  ] }) : /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
13015
13005
  /* @__PURE__ */ c.jsx("div", { className: "font-medium text-sm truncate text-gray-900 dark:text-slate-100", children: ee(L) }),
13016
13006
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-2 text-xs text-gray-500 dark:text-slate-400 mt-1", children: [
@@ -13019,7 +13009,7 @@ function Oi({
13019
13009
  ] })
13020
13010
  ] }) }),
13021
13011
  /* @__PURE__ */ c.jsxs("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2", children: [
13022
- r && N !== L.threadId && /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", onClick: (Z) => se(L, Z), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c.jsx(Rl, { size: 12 }) }),
13012
+ r && N !== L.threadId && /* @__PURE__ */ c.jsx(De, { variant: "ghost", size: "sm", onClick: (Z) => oe(L, Z), className: "h-6 w-6 p-0", title: "Edit title", children: /* @__PURE__ */ c.jsx(Rl, { size: 12 }) }),
13023
13013
  n && /* @__PURE__ */ c.jsx(
13024
13014
  De,
13025
13015
  {
@@ -13176,7 +13166,7 @@ const Wa = f.forwardRef(
13176
13166
  ref: o,
13177
13167
  decorative: n,
13178
13168
  orientation: t,
13179
- className: D(
13169
+ className: M(
13180
13170
  "shrink-0 bg-border",
13181
13171
  t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
13182
13172
  e
@@ -13189,7 +13179,7 @@ Wa.displayName = fh.displayName;
13189
13179
  const hh = hd, uC = Nw, dC = pd, ph = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13190
13180
  ms,
13191
13181
  {
13192
- className: D(
13182
+ className: M(
13193
13183
  "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",
13194
13184
  e
13195
13185
  ),
@@ -13219,7 +13209,7 @@ const fC = Wr(
13219
13209
  gs,
13220
13210
  {
13221
13211
  ref: o,
13222
- className: D(fC({ side: e }), t),
13212
+ className: M(fC({ side: e }), t),
13223
13213
  ...r,
13224
13214
  children: [
13225
13215
  n,
@@ -13238,7 +13228,7 @@ const mh = ({
13238
13228
  }) => /* @__PURE__ */ c.jsx(
13239
13229
  "div",
13240
13230
  {
13241
- className: D(
13231
+ className: M(
13242
13232
  "flex flex-col space-y-2 text-center sm:text-left",
13243
13233
  e
13244
13234
  ),
@@ -13250,7 +13240,7 @@ const gh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13250
13240
  _n,
13251
13241
  {
13252
13242
  ref: n,
13253
- className: D("text-lg font-semibold text-foreground", e),
13243
+ className: M("text-lg font-semibold text-foreground", e),
13254
13244
  ...t
13255
13245
  }
13256
13246
  ));
@@ -13259,7 +13249,7 @@ const vh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13259
13249
  vs,
13260
13250
  {
13261
13251
  ref: n,
13262
- className: D("text-sm text-muted-foreground", e),
13252
+ className: M("text-sm text-muted-foreground", e),
13263
13253
  ...t
13264
13254
  }
13265
13255
  ));
@@ -13271,7 +13261,7 @@ function bl({
13271
13261
  return /* @__PURE__ */ c.jsx(
13272
13262
  "div",
13273
13263
  {
13274
- className: D("animate-pulse rounded-md bg-muted", e),
13264
+ className: M("animate-pulse rounded-md bg-muted", e),
13275
13265
  ...t
13276
13266
  }
13277
13267
  );
@@ -13610,7 +13600,7 @@ const OC = AC, MC = PC, DC = _C, Ih = f.forwardRef(({ className: e, sideOffset:
13610
13600
  {
13611
13601
  ref: r,
13612
13602
  sideOffset: t,
13613
- className: D(
13603
+ className: M(
13614
13604
  "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",
13615
13605
  e
13616
13606
  ),
@@ -13668,7 +13658,7 @@ const kh = f.forwardRef(
13668
13658
  "--sidebar-width-icon": HC,
13669
13659
  ...o
13670
13660
  },
13671
- className: D(
13661
+ className: M(
13672
13662
  "group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
13673
13663
  r
13674
13664
  ),
@@ -13693,7 +13683,7 @@ const Ah = f.forwardRef(
13693
13683
  return n === "none" ? /* @__PURE__ */ c.jsx(
13694
13684
  "div",
13695
13685
  {
13696
- className: D(
13686
+ className: M(
13697
13687
  "flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
13698
13688
  r
13699
13689
  ),
@@ -13726,7 +13716,7 @@ const Ah = f.forwardRef(
13726
13716
  /* @__PURE__ */ c.jsx(
13727
13717
  "div",
13728
13718
  {
13729
- className: D(
13719
+ className: M(
13730
13720
  "duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear",
13731
13721
  "group-data-[collapsible=offcanvas]:w-0",
13732
13722
  "group-data-[side=right]:rotate-180",
@@ -13737,7 +13727,7 @@ const Ah = f.forwardRef(
13737
13727
  /* @__PURE__ */ c.jsx(
13738
13728
  "div",
13739
13729
  {
13740
- className: D(
13730
+ className: M(
13741
13731
  "duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",
13742
13732
  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)]",
13743
13733
  // Adjust the padding for floating and inset variants.
@@ -13770,7 +13760,7 @@ const Ph = f.forwardRef(({ className: e, onClick: t, ...n }, r) => {
13770
13760
  "data-sidebar": "trigger",
13771
13761
  variant: "ghost",
13772
13762
  size: "icon",
13773
- className: D("h-7 w-7", e),
13763
+ className: M("h-7 w-7", e),
13774
13764
  onClick: (s) => {
13775
13765
  t == null || t(s), o();
13776
13766
  },
@@ -13794,7 +13784,7 @@ const UC = f.forwardRef(({ className: e, ...t }, n) => {
13794
13784
  tabIndex: -1,
13795
13785
  onClick: r,
13796
13786
  title: "Toggle Sidebar",
13797
- className: D(
13787
+ className: M(
13798
13788
  "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",
13799
13789
  "[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
13800
13790
  "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
@@ -13812,7 +13802,7 @@ const _h = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13812
13802
  "main",
13813
13803
  {
13814
13804
  ref: n,
13815
- className: D(
13805
+ className: M(
13816
13806
  "relative flex min-h-svh flex-1 flex-col bg-background",
13817
13807
  "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",
13818
13808
  e
@@ -13826,7 +13816,7 @@ const WC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13826
13816
  {
13827
13817
  ref: n,
13828
13818
  "data-sidebar": "input",
13829
- className: D(
13819
+ className: M(
13830
13820
  "h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
13831
13821
  e
13832
13822
  ),
@@ -13839,7 +13829,7 @@ const Oh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13839
13829
  {
13840
13830
  ref: n,
13841
13831
  "data-sidebar": "header",
13842
- className: D("flex flex-col gap-2 p-2", e),
13832
+ className: M("flex flex-col gap-2 p-2", e),
13843
13833
  ...t
13844
13834
  }
13845
13835
  ));
@@ -13849,7 +13839,7 @@ const VC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13849
13839
  {
13850
13840
  ref: n,
13851
13841
  "data-sidebar": "footer",
13852
- className: D("flex flex-col gap-2 p-2", e),
13842
+ className: M("flex flex-col gap-2 p-2", e),
13853
13843
  ...t
13854
13844
  }
13855
13845
  ));
@@ -13859,7 +13849,7 @@ const GC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13859
13849
  {
13860
13850
  ref: n,
13861
13851
  "data-sidebar": "separator",
13862
- className: D("mx-2 w-auto bg-sidebar-border", e),
13852
+ className: M("mx-2 w-auto bg-sidebar-border", e),
13863
13853
  ...t
13864
13854
  }
13865
13855
  ));
@@ -13869,7 +13859,7 @@ const Mh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13869
13859
  {
13870
13860
  ref: n,
13871
13861
  "data-sidebar": "content",
13872
- className: D(
13862
+ className: M(
13873
13863
  "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
13874
13864
  e
13875
13865
  ),
@@ -13882,7 +13872,7 @@ const Dh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13882
13872
  {
13883
13873
  ref: n,
13884
13874
  "data-sidebar": "group",
13885
- className: D("relative flex w-full min-w-0 flex-col p-2", e),
13875
+ className: M("relative flex w-full min-w-0 flex-col p-2", e),
13886
13876
  ...t
13887
13877
  }
13888
13878
  ));
@@ -13894,7 +13884,7 @@ const Lh = f.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => {
13894
13884
  {
13895
13885
  ref: r,
13896
13886
  "data-sidebar": "group-label",
13897
- className: D(
13887
+ className: M(
13898
13888
  "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",
13899
13889
  "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
13900
13890
  e
@@ -13911,7 +13901,7 @@ const KC = f.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => {
13911
13901
  {
13912
13902
  ref: r,
13913
13903
  "data-sidebar": "group-action",
13914
- className: D(
13904
+ className: M(
13915
13905
  "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",
13916
13906
  // Increases the hit area of the button on mobile.
13917
13907
  "after:absolute after:-inset-2 after:md:hidden",
@@ -13928,7 +13918,7 @@ const Fh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13928
13918
  {
13929
13919
  ref: n,
13930
13920
  "data-sidebar": "group-content",
13931
- className: D("w-full text-sm", e),
13921
+ className: M("w-full text-sm", e),
13932
13922
  ...t
13933
13923
  }
13934
13924
  ));
@@ -13938,7 +13928,7 @@ const Bh = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13938
13928
  {
13939
13929
  ref: n,
13940
13930
  "data-sidebar": "menu",
13941
- className: D("flex w-full min-w-0 flex-col gap-1", e),
13931
+ className: M("flex w-full min-w-0 flex-col gap-1", e),
13942
13932
  ...t
13943
13933
  }
13944
13934
  ));
@@ -13948,7 +13938,7 @@ const $h = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
13948
13938
  {
13949
13939
  ref: n,
13950
13940
  "data-sidebar": "menu-item",
13951
- className: D("group/menu-item relative", e),
13941
+ className: M("group/menu-item relative", e),
13952
13942
  ...t
13953
13943
  }
13954
13944
  ));
@@ -13989,7 +13979,7 @@ const YC = Wr(
13989
13979
  "data-sidebar": "menu-button",
13990
13980
  "data-size": r,
13991
13981
  "data-active": t,
13992
- className: D(YC({ variant: n, size: r }), s),
13982
+ className: M(YC({ variant: n, size: r }), s),
13993
13983
  ...i
13994
13984
  }
13995
13985
  );
@@ -14017,7 +14007,7 @@ const qC = f.forwardRef(({ className: e, asChild: t = !1, showOnHover: n = !1, .
14017
14007
  {
14018
14008
  ref: o,
14019
14009
  "data-sidebar": "menu-action",
14020
- className: D(
14010
+ className: M(
14021
14011
  "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",
14022
14012
  // Increases the hit area of the button on mobile.
14023
14013
  "after:absolute after:-inset-2 after:md:hidden",
@@ -14038,7 +14028,7 @@ const XC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14038
14028
  {
14039
14029
  ref: n,
14040
14030
  "data-sidebar": "menu-badge",
14041
- className: D(
14031
+ className: M(
14042
14032
  "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",
14043
14033
  "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
14044
14034
  "peer-data-[size=sm]/menu-button:top-1",
@@ -14058,7 +14048,7 @@ const JC = f.forwardRef(({ className: e, showIcon: t = !1, ...n }, r) => {
14058
14048
  {
14059
14049
  ref: r,
14060
14050
  "data-sidebar": "menu-skeleton",
14061
- className: D("rounded-md h-8 flex gap-2 px-2 items-center", e),
14051
+ className: M("rounded-md h-8 flex gap-2 px-2 items-center", e),
14062
14052
  ...n,
14063
14053
  children: [
14064
14054
  t && /* @__PURE__ */ c.jsx(
@@ -14088,7 +14078,7 @@ const ZC = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14088
14078
  {
14089
14079
  ref: n,
14090
14080
  "data-sidebar": "menu-sub",
14091
- className: D(
14081
+ className: M(
14092
14082
  "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",
14093
14083
  "group-data-[collapsible=icon]:hidden",
14094
14084
  e
@@ -14108,7 +14098,7 @@ const eT = f.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, classNa
14108
14098
  "data-sidebar": "menu-sub-button",
14109
14099
  "data-size": t,
14110
14100
  "data-active": n,
14111
- className: D(
14101
+ className: M(
14112
14102
  "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",
14113
14103
  "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
14114
14104
  t === "sm" && "text-xs",
@@ -14175,7 +14165,7 @@ const nT = Wr(
14175
14165
  Uh,
14176
14166
  {
14177
14167
  ref: n,
14178
- className: D(nT(), e),
14168
+ className: M(nT(), e),
14179
14169
  ...t
14180
14170
  }
14181
14171
  ));
@@ -14304,7 +14294,7 @@ var Xh = Vh, aT = Kh;
14304
14294
  const mn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14305
14295
  Xh,
14306
14296
  {
14307
- className: D(
14297
+ className: M(
14308
14298
  "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",
14309
14299
  e
14310
14300
  ),
@@ -14313,7 +14303,7 @@ const mn = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
14313
14303
  children: /* @__PURE__ */ c.jsx(
14314
14304
  aT,
14315
14305
  {
14316
- className: D(
14306
+ className: M(
14317
14307
  "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"
14318
14308
  )
14319
14309
  }
@@ -14376,11 +14366,11 @@ var cT = [" ", "Enter", "ArrowUp", "ArrowDown"], lT = [" ", "Enter"], Bn = "Sele
14376
14366
  {
14377
14367
  scope: e.__scopeSelect,
14378
14368
  onNativeOptionAdd: f.useCallback((U) => {
14379
- _((se) => new Set(se).add(U));
14369
+ _((oe) => new Set(oe).add(U));
14380
14370
  }, []),
14381
14371
  onNativeOptionRemove: f.useCallback((U) => {
14382
- _((se) => {
14383
- const O = new Set(se);
14372
+ _((oe) => {
14373
+ const O = new Set(oe);
14384
14374
  return O.delete(U), O;
14385
14375
  });
14386
14376
  }, []),
@@ -14527,36 +14517,36 @@ var Bt = 10, [sp, Rn] = xr($n), gT = "SelectContentImpl", vT = sr("SelectContent
14527
14517
  }, [y]), pa();
14528
14518
  const U = f.useCallback(
14529
14519
  (F) => {
14530
- const [A, ...H] = B().map((ie) => ie.ref.current), [J] = H.slice(-1), ce = document.activeElement;
14531
- for (const ie of F)
14532
- if (ie === ce || (ie == null || ie.scrollIntoView({ block: "nearest" }), ie === A && S && (S.scrollTop = 0), ie === J && S && (S.scrollTop = S.scrollHeight), ie == null || ie.focus(), document.activeElement !== ce)) return;
14520
+ const [A, ...H] = B().map((se) => se.ref.current), [J] = H.slice(-1), ce = document.activeElement;
14521
+ for (const se of F)
14522
+ if (se === ce || (se == null || se.scrollIntoView({ block: "nearest" }), se === A && S && (S.scrollTop = 0), se === J && S && (S.scrollTop = S.scrollHeight), se == null || se.focus(), document.activeElement !== ce)) return;
14533
14523
  },
14534
14524
  [B, S]
14535
- ), se = f.useCallback(
14525
+ ), oe = f.useCallback(
14536
14526
  () => U([N, y]),
14537
14527
  [U, N, y]
14538
14528
  );
14539
14529
  f.useEffect(() => {
14540
- G && se();
14541
- }, [G, se]);
14542
- const { onOpenChange: O, triggerPointerDownPosRef: M } = b;
14530
+ G && oe();
14531
+ }, [G, oe]);
14532
+ const { onOpenChange: O, triggerPointerDownPosRef: D } = b;
14543
14533
  f.useEffect(() => {
14544
14534
  if (y) {
14545
14535
  let F = { x: 0, y: 0 };
14546
14536
  const A = (J) => {
14547
- var ce, ie;
14537
+ var ce, se;
14548
14538
  F = {
14549
- x: Math.abs(Math.round(J.pageX) - (((ce = M.current) == null ? void 0 : ce.x) ?? 0)),
14550
- y: Math.abs(Math.round(J.pageY) - (((ie = M.current) == null ? void 0 : ie.y) ?? 0))
14539
+ x: Math.abs(Math.round(J.pageX) - (((ce = D.current) == null ? void 0 : ce.x) ?? 0)),
14540
+ y: Math.abs(Math.round(J.pageY) - (((se = D.current) == null ? void 0 : se.y) ?? 0))
14551
14541
  };
14552
14542
  }, H = (J) => {
14553
- F.x <= 10 && F.y <= 10 ? J.preventDefault() : y.contains(J.target) || O(!1), document.removeEventListener("pointermove", A), M.current = null;
14543
+ F.x <= 10 && F.y <= 10 ? J.preventDefault() : y.contains(J.target) || O(!1), document.removeEventListener("pointermove", A), D.current = null;
14554
14544
  };
14555
- return M.current !== null && (document.addEventListener("pointermove", A), document.addEventListener("pointerup", H, { capture: !0, once: !0 })), () => {
14545
+ return D.current !== null && (document.addEventListener("pointermove", A), document.addEventListener("pointerup", H, { capture: !0, once: !0 })), () => {
14556
14546
  document.removeEventListener("pointermove", A), document.removeEventListener("pointerup", H, { capture: !0 });
14557
14547
  };
14558
14548
  }
14559
- }, [y, O, M]), f.useEffect(() => {
14549
+ }, [y, O, D]), f.useEffect(() => {
14560
14550
  const F = () => O(!1);
14561
14551
  return window.addEventListener("blur", F), window.addEventListener("resize", F), () => {
14562
14552
  window.removeEventListener("blur", F), window.removeEventListener("resize", F);
@@ -14600,7 +14590,7 @@ var Bt = 10, [sp, Rn] = xr($n), gT = "SelectContentImpl", vT = sr("SelectContent
14600
14590
  selectedItem: N,
14601
14591
  onItemLeave: L,
14602
14592
  itemTextRefCallback: Z,
14603
- focusSelectedItem: se,
14593
+ focusSelectedItem: oe,
14604
14594
  selectedItemText: j,
14605
14595
  position: r,
14606
14596
  isPositioned: G,
@@ -14651,8 +14641,8 @@ var Bt = 10, [sp, Rn] = xr($n), gT = "SelectContentImpl", vT = sr("SelectContent
14651
14641
  if (F.key === "Tab" && F.preventDefault(), !A && F.key.length === 1 && W(F.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(F.key)) {
14652
14642
  let J = B().filter((ce) => !ce.disabled).map((ce) => ce.ref.current);
14653
14643
  if (["ArrowUp", "End"].includes(F.key) && (J = J.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(F.key)) {
14654
- const ce = F.target, ie = J.indexOf(ce);
14655
- J = J.slice(ie + 1);
14644
+ const ce = F.target, se = J.indexOf(ce);
14645
+ J = J.slice(se + 1);
14656
14646
  }
14657
14647
  setTimeout(() => U(J)), F.preventDefault();
14658
14648
  }
@@ -14673,31 +14663,31 @@ var xT = "SelectItemAlignedPosition", ap = f.forwardRef((e, t) => {
14673
14663
  if (s.trigger && s.valueNode && a && u && v && p && g) {
14674
14664
  const E = s.trigger.getBoundingClientRect(), N = u.getBoundingClientRect(), I = s.valueNode.getBoundingClientRect(), j = g.getBoundingClientRect();
14675
14665
  if (s.dir !== "rtl") {
14676
- const ce = j.left - N.left, ie = I.left - ce, Ae = E.left - ie, _e = E.width + Ae, je = Math.max(_e, N.width), ae = window.innerWidth - Bt, Ne = _i(ie, [
14666
+ const ce = j.left - N.left, se = I.left - ce, Ae = E.left - se, _e = E.width + Ae, je = Math.max(_e, N.width), ie = window.innerWidth - Bt, Ne = _i(se, [
14677
14667
  Bt,
14678
14668
  // Prevents the content from going off the starting edge of the
14679
14669
  // viewport. It may still go off the ending edge, but this can be
14680
14670
  // controlled by the user since they may want to manage overflow in a
14681
14671
  // specific way.
14682
14672
  // https://github.com/radix-ui/primitives/issues/2049
14683
- Math.max(Bt, ae - je)
14673
+ Math.max(Bt, ie - je)
14684
14674
  ]);
14685
14675
  a.style.minWidth = _e + "px", a.style.left = Ne + "px";
14686
14676
  } else {
14687
- const ce = N.right - j.right, ie = window.innerWidth - I.right - ce, Ae = window.innerWidth - E.right - ie, _e = E.width + Ae, je = Math.max(_e, N.width), ae = window.innerWidth - Bt, Ne = _i(ie, [
14677
+ const ce = N.right - j.right, se = window.innerWidth - I.right - ce, Ae = window.innerWidth - E.right - se, _e = E.width + Ae, je = Math.max(_e, N.width), ie = window.innerWidth - Bt, Ne = _i(se, [
14688
14678
  Bt,
14689
- Math.max(Bt, ae - je)
14679
+ Math.max(Bt, ie - je)
14690
14680
  ]);
14691
14681
  a.style.minWidth = _e + "px", a.style.right = Ne + "px";
14692
14682
  }
14693
- const P = m(), B = window.innerHeight - Bt * 2, G = v.scrollHeight, _ = window.getComputedStyle(u), Y = parseInt(_.borderTopWidth, 10), U = parseInt(_.paddingTop, 10), se = parseInt(_.borderBottomWidth, 10), O = parseInt(_.paddingBottom, 10), M = Y + U + G + O + se, K = Math.min(p.offsetHeight * 5, M), W = window.getComputedStyle(v), ee = parseInt(W.paddingTop, 10), L = parseInt(W.paddingBottom, 10), Z = E.top + E.height / 2 - Bt, pe = B - Z, he = p.offsetHeight / 2, F = p.offsetTop + he, A = Y + U + F, H = M - A;
14683
+ const P = m(), B = window.innerHeight - Bt * 2, G = v.scrollHeight, _ = window.getComputedStyle(u), Y = parseInt(_.borderTopWidth, 10), U = parseInt(_.paddingTop, 10), oe = parseInt(_.borderBottomWidth, 10), O = parseInt(_.paddingBottom, 10), D = Y + U + G + O + oe, K = Math.min(p.offsetHeight * 5, D), W = window.getComputedStyle(v), ee = parseInt(W.paddingTop, 10), L = parseInt(W.paddingBottom, 10), Z = E.top + E.height / 2 - Bt, pe = B - Z, he = p.offsetHeight / 2, F = p.offsetTop + he, A = Y + U + F, H = D - A;
14694
14684
  if (A <= Z) {
14695
14685
  const ce = P.length > 0 && p === P[P.length - 1].ref.current;
14696
14686
  a.style.bottom = "0px";
14697
- const ie = u.clientHeight - v.offsetTop - v.offsetHeight, Ae = Math.max(
14687
+ const se = u.clientHeight - v.offsetTop - v.offsetHeight, Ae = Math.max(
14698
14688
  pe,
14699
14689
  he + // viewport might have padding bottom, include it to avoid a scrollable viewport
14700
- (ce ? L : 0) + ie + se
14690
+ (ce ? L : 0) + se + oe
14701
14691
  ), _e = A + Ae;
14702
14692
  a.style.height = _e + "px";
14703
14693
  } else {
@@ -15130,7 +15120,7 @@ const wl = jT, yl = kT, zi = f.forwardRef(({ className: e, children: t, ...n },
15130
15120
  Rp,
15131
15121
  {
15132
15122
  ref: r,
15133
- className: D(
15123
+ className: M(
15134
15124
  "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",
15135
15125
  e
15136
15126
  ),
@@ -15146,7 +15136,7 @@ const Pp = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15146
15136
  jp,
15147
15137
  {
15148
15138
  ref: n,
15149
- className: D(
15139
+ className: M(
15150
15140
  "flex cursor-default items-center justify-center py-1",
15151
15141
  e
15152
15142
  ),
@@ -15159,7 +15149,7 @@ const _p = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15159
15149
  kp,
15160
15150
  {
15161
15151
  ref: n,
15162
- className: D(
15152
+ className: M(
15163
15153
  "flex cursor-default items-center justify-center py-1",
15164
15154
  e
15165
15155
  ),
@@ -15172,7 +15162,7 @@ const Ui = f.forwardRef(({ className: e, children: t, position: n = "popper", ..
15172
15162
  Ep,
15173
15163
  {
15174
15164
  ref: o,
15175
- className: D(
15165
+ className: M(
15176
15166
  "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",
15177
15167
  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",
15178
15168
  e
@@ -15184,7 +15174,7 @@ const Ui = f.forwardRef(({ className: e, children: t, position: n = "popper", ..
15184
15174
  /* @__PURE__ */ c.jsx(
15185
15175
  _T,
15186
15176
  {
15187
- className: D(
15177
+ className: M(
15188
15178
  "p-1",
15189
15179
  n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
15190
15180
  ),
@@ -15200,7 +15190,7 @@ const DT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15200
15190
  Np,
15201
15191
  {
15202
15192
  ref: n,
15203
- className: D("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
15193
+ className: M("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
15204
15194
  ...t
15205
15195
  }
15206
15196
  ));
@@ -15209,7 +15199,7 @@ const jn = f.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__
15209
15199
  Ip,
15210
15200
  {
15211
15201
  ref: r,
15212
- className: D(
15202
+ className: M(
15213
15203
  "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",
15214
15204
  e
15215
15205
  ),
@@ -15225,7 +15215,7 @@ const LT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15225
15215
  Ap,
15226
15216
  {
15227
15217
  ref: n,
15228
- className: D("-mx-1 my-1 h-px bg-muted", e),
15218
+ className: M("-mx-1 my-1 h-px bg-muted", e),
15229
15219
  ...t
15230
15220
  }
15231
15221
  ));
@@ -15234,7 +15224,7 @@ const Ao = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15234
15224
  "div",
15235
15225
  {
15236
15226
  ref: n,
15237
- className: D(
15227
+ className: M(
15238
15228
  "rounded-lg border bg-card text-card-foreground shadow-sm",
15239
15229
  e
15240
15230
  ),
@@ -15246,7 +15236,7 @@ const Po = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15246
15236
  "div",
15247
15237
  {
15248
15238
  ref: n,
15249
- className: D("flex flex-col space-y-1.5 p-6", e),
15239
+ className: M("flex flex-col space-y-1.5 p-6", e),
15250
15240
  ...t
15251
15241
  }
15252
15242
  ));
@@ -15255,7 +15245,7 @@ const _o = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15255
15245
  "h3",
15256
15246
  {
15257
15247
  ref: n,
15258
- className: D(
15248
+ className: M(
15259
15249
  "text-2xl font-semibold leading-none tracking-tight",
15260
15250
  e
15261
15251
  ),
@@ -15267,18 +15257,18 @@ const FT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15267
15257
  "p",
15268
15258
  {
15269
15259
  ref: n,
15270
- className: D("text-sm text-muted-foreground", e),
15260
+ className: M("text-sm text-muted-foreground", e),
15271
15261
  ...t
15272
15262
  }
15273
15263
  ));
15274
15264
  FT.displayName = "CardDescription";
15275
- const Oo = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: D("p-6 pt-0", e), ...t }));
15265
+ const Oo = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx("div", { ref: n, className: M("p-6 pt-0", e), ...t }));
15276
15266
  Oo.displayName = "CardContent";
15277
15267
  const BT = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ c.jsx(
15278
15268
  "div",
15279
15269
  {
15280
15270
  ref: n,
15281
- className: D("flex items-center p-6 pt-0", e),
15271
+ className: M("flex items-center p-6 pt-0", e),
15282
15272
  ...t
15283
15273
  }
15284
15274
  ));