teodor-new-chat-ui 4.3.209 → 4.3.210

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
@@ -57,17 +57,17 @@ function Dm() {
57
57
  var m = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
58
  function w(R) {
59
59
  {
60
- for (var V = arguments.length, se = new Array(V > 1 ? V - 1 : 0), Ce = 1; Ce < V; Ce++)
61
- se[Ce - 1] = arguments[Ce];
60
+ for (var V = arguments.length, se = new Array(V > 1 ? V - 1 : 0), Se = 1; Se < V; Se++)
61
+ se[Se - 1] = arguments[Se];
62
62
  b("error", R, se);
63
63
  }
64
64
  }
65
65
  function b(R, V, se) {
66
66
  {
67
- var Ce = m.ReactDebugCurrentFrame, Ge = Ce.getStackAddendum();
67
+ var Se = m.ReactDebugCurrentFrame, Ge = Se.getStackAddendum();
68
68
  Ge !== "" && (V += "%s", se = se.concat([Ge]));
69
- var at = se.map(function(Ue) {
70
- return String(Ue);
69
+ var at = se.map(function(He) {
70
+ return String(He);
71
71
  });
72
72
  at.unshift("Warning: " + V), Function.prototype.apply.call(console[R], console, at);
73
73
  }
@@ -82,9 +82,9 @@ function Dm() {
82
82
  R.$$typeof === E || R.getModuleId !== void 0));
83
83
  }
84
84
  function _(R, V, se) {
85
- var Ce = R.displayName;
86
- if (Ce)
87
- return Ce;
85
+ var Se = R.displayName;
86
+ if (Se)
87
+ return Se;
88
88
  var Ge = V.displayName || V.name || "";
89
89
  return Ge !== "" ? se + "(" + Ge + ")" : se;
90
90
  }
@@ -123,12 +123,12 @@ function Dm() {
123
123
  case l:
124
124
  return _(R, R.render, "ForwardRef");
125
125
  case f:
126
- var Ce = R.displayName || null;
127
- return Ce !== null ? Ce : F(R.type) || "Memo";
126
+ var Se = R.displayName || null;
127
+ return Se !== null ? Se : F(R.type) || "Memo";
128
128
  case p: {
129
- var Ge = R, at = Ge._payload, Ue = Ge._init;
129
+ var Ge = R, at = Ge._payload, He = Ge._init;
130
130
  try {
131
- return F(Ue(at));
131
+ return F(He(at));
132
132
  } catch {
133
133
  return null;
134
134
  }
@@ -137,9 +137,9 @@ function Dm() {
137
137
  return null;
138
138
  }
139
139
  var j = Object.assign, $ = 0, A, B, L, M, J, Y, de;
140
- function Re() {
140
+ function ke() {
141
141
  }
142
- Re.__reactDisabledLog = !0;
142
+ ke.__reactDisabledLog = !0;
143
143
  function Ae() {
144
144
  {
145
145
  if ($ === 0) {
@@ -147,7 +147,7 @@ function Dm() {
147
147
  var R = {
148
148
  configurable: !0,
149
149
  enumerable: !0,
150
- value: Re,
150
+ value: ke,
151
151
  writable: !0
152
152
  };
153
153
  Object.defineProperties(console, {
@@ -205,8 +205,8 @@ function Dm() {
205
205
  try {
206
206
  throw Error();
207
207
  } catch (Ge) {
208
- var Ce = Ge.stack.trim().match(/\n( *(at )?)/);
209
- q = Ce && Ce[1] || "";
208
+ var Se = Ge.stack.trim().match(/\n( *(at )?)/);
209
+ q = Se && Se[1] || "";
210
210
  }
211
211
  return `
212
212
  ` + q + R;
@@ -225,7 +225,7 @@ function Dm() {
225
225
  if (se !== void 0)
226
226
  return se;
227
227
  }
228
- var Ce;
228
+ var Se;
229
229
  H = !0;
230
230
  var Ge = Error.prepareStackTrace;
231
231
  Error.prepareStackTrace = void 0;
@@ -233,40 +233,40 @@ function Dm() {
233
233
  at = te.current, te.current = null, Ae();
234
234
  try {
235
235
  if (V) {
236
- var Ue = function() {
236
+ var He = function() {
237
237
  throw Error();
238
238
  };
239
- if (Object.defineProperty(Ue.prototype, "props", {
239
+ if (Object.defineProperty(He.prototype, "props", {
240
240
  set: function() {
241
241
  throw Error();
242
242
  }
243
243
  }), typeof Reflect == "object" && Reflect.construct) {
244
244
  try {
245
- Reflect.construct(Ue, []);
245
+ Reflect.construct(He, []);
246
246
  } catch (Ft) {
247
- Ce = Ft;
247
+ Se = Ft;
248
248
  }
249
- Reflect.construct(R, [], Ue);
249
+ Reflect.construct(R, [], He);
250
250
  } else {
251
251
  try {
252
- Ue.call();
252
+ He.call();
253
253
  } catch (Ft) {
254
- Ce = Ft;
254
+ Se = Ft;
255
255
  }
256
- R.call(Ue.prototype);
256
+ R.call(He.prototype);
257
257
  }
258
258
  } else {
259
259
  try {
260
260
  throw Error();
261
261
  } catch (Ft) {
262
- Ce = Ft;
262
+ Se = Ft;
263
263
  }
264
264
  R();
265
265
  }
266
266
  } catch (Ft) {
267
- if (Ft && Ce && typeof Ft.stack == "string") {
267
+ if (Ft && Se && typeof Ft.stack == "string") {
268
268
  for (var ze = Ft.stack.split(`
269
- `), Ot = Ce.stack.split(`
269
+ `), Ot = Se.stack.split(`
270
270
  `), St = ze.length - 1, yt = Ot.length - 1; St >= 1 && yt >= 0 && ze[St] !== Ot[yt]; )
271
271
  yt--;
272
272
  for (; St >= 1 && yt >= 0; St--, yt--)
@@ -315,7 +315,7 @@ function Dm() {
315
315
  case f:
316
316
  return ue(R.type, V, se);
317
317
  case p: {
318
- var Ce = R, Ge = Ce._payload, at = Ce._init;
318
+ var Se = R, Ge = Se._payload, at = Se._init;
319
319
  try {
320
320
  return ue(at(Ge), V, se);
321
321
  } catch {
@@ -332,22 +332,22 @@ function Dm() {
332
332
  } else
333
333
  Ke.setExtraStackFrame(null);
334
334
  }
335
- function Be(R, V, se, Ce, Ge) {
335
+ function Be(R, V, se, Se, Ge) {
336
336
  {
337
337
  var at = Function.call.bind(xe);
338
- for (var Ue in R)
339
- if (at(R, Ue)) {
338
+ for (var He in R)
339
+ if (at(R, He)) {
340
340
  var ze = void 0;
341
341
  try {
342
- if (typeof R[Ue] != "function") {
343
- var Ot = Error((Ce || "React class") + ": " + se + " type `" + Ue + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ue] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
342
+ if (typeof R[He] != "function") {
343
+ var Ot = Error((Se || "React class") + ": " + se + " type `" + He + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[He] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
344
  throw Ot.name = "Invariant Violation", Ot;
345
345
  }
346
- ze = R[Ue](V, Ue, Ce, se, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ ze = R[He](V, He, Se, se, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
347
  } catch (St) {
348
348
  ze = St;
349
349
  }
350
- ze && !(ze instanceof Error) && (Je(Ge), w("%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).", Ce || "React class", se, Ue, typeof ze), Je(null)), ze instanceof Error && !(ze.message in Ne) && (Ne[ze.message] = !0, Je(Ge), w("Failed %s type: %s", se, ze.message), Je(null));
350
+ ze && !(ze instanceof Error) && (Je(Ge), w("%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).", Se || "React class", se, He, typeof ze), Je(null)), ze instanceof Error && !(ze.message in Ne) && (Ne[ze.message] = !0, Je(Ge), w("Failed %s type: %s", se, ze.message), Je(null));
351
351
  }
352
352
  }
353
353
  }
@@ -397,7 +397,7 @@ function Dm() {
397
397
  }
398
398
  return R.key !== void 0;
399
399
  }
400
- function ve(R, V) {
400
+ function we(R, V) {
401
401
  typeof R.ref == "string" && pt.current;
402
402
  }
403
403
  function Le(R, V) {
@@ -411,7 +411,7 @@ function Dm() {
411
411
  });
412
412
  }
413
413
  }
414
- function He(R, V) {
414
+ function Ue(R, V) {
415
415
  {
416
416
  var se = function() {
417
417
  wt || (wt = !0, w("%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)", V));
@@ -422,7 +422,7 @@ function Dm() {
422
422
  });
423
423
  }
424
424
  }
425
- var pe = function(R, V, se, Ce, Ge, at, Ue) {
425
+ var me = function(R, V, se, Se, Ge, at, He) {
426
426
  var ze = {
427
427
  // This tag allows us to uniquely identify this as a React Element
428
428
  $$typeof: t,
@@ -430,7 +430,7 @@ function Dm() {
430
430
  type: R,
431
431
  key: V,
432
432
  ref: se,
433
- props: Ue,
433
+ props: He,
434
434
  // Record the component responsible for creating this element.
435
435
  _owner: at
436
436
  };
@@ -443,7 +443,7 @@ function Dm() {
443
443
  configurable: !1,
444
444
  enumerable: !1,
445
445
  writable: !1,
446
- value: Ce
446
+ value: Se
447
447
  }), Object.defineProperty(ze, "_source", {
448
448
  configurable: !1,
449
449
  enumerable: !1,
@@ -451,22 +451,22 @@ function Dm() {
451
451
  value: Ge
452
452
  }), Object.freeze && (Object.freeze(ze.props), Object.freeze(ze)), ze;
453
453
  };
454
- function be(R, V, se, Ce, Ge) {
454
+ function Re(R, V, se, Se, Ge) {
455
455
  {
456
- var at, Ue = {}, ze = null, Ot = null;
457
- se !== void 0 && (Ct(se), ze = "" + se), fe(V) && (Ct(V.key), ze = "" + V.key), Xe(V) && (Ot = V.ref, ve(V, Ge));
456
+ var at, He = {}, ze = null, Ot = null;
457
+ se !== void 0 && (Ct(se), ze = "" + se), fe(V) && (Ct(V.key), ze = "" + V.key), Xe(V) && (Ot = V.ref, we(V, Ge));
458
458
  for (at in V)
459
- xe.call(V, at) && !ot.hasOwnProperty(at) && (Ue[at] = V[at]);
459
+ xe.call(V, at) && !ot.hasOwnProperty(at) && (He[at] = V[at]);
460
460
  if (R && R.defaultProps) {
461
461
  var St = R.defaultProps;
462
462
  for (at in St)
463
- Ue[at] === void 0 && (Ue[at] = St[at]);
463
+ He[at] === void 0 && (He[at] = St[at]);
464
464
  }
465
465
  if (ze || Ot) {
466
466
  var yt = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
467
- ze && Le(Ue, yt), Ot && He(Ue, yt);
467
+ ze && Le(He, yt), Ot && Ue(He, yt);
468
468
  }
469
- return pe(R, ze, Ot, Ge, Ce, pt.current, Ue);
469
+ return me(R, ze, Ot, Ge, Se, pt.current, He);
470
470
  }
471
471
  }
472
472
  var bt = m.ReactCurrentOwner, kt = m.ReactDebugCurrentFrame;
@@ -477,8 +477,8 @@ function Dm() {
477
477
  } else
478
478
  kt.setExtraStackFrame(null);
479
479
  }
480
- var Se;
481
- Se = !1;
480
+ var be;
481
+ be = !1;
482
482
  function ye(R) {
483
483
  return typeof R == "object" && R !== null && R.$$typeof === t;
484
484
  }
@@ -519,8 +519,8 @@ Check the top-level render call using <` + se + ">.");
519
519
  if (Rt[se])
520
520
  return;
521
521
  Rt[se] = !0;
522
- var Ce = "";
523
- R && R._owner && R._owner !== bt.current && (Ce = " It was passed a child from " + F(R._owner.type) + "."), W(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', se, Ce), W(null);
522
+ var Se = "";
523
+ R && R._owner && R._owner !== bt.current && (Se = " It was passed a child from " + F(R._owner.type) + "."), W(R), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', se, Se), W(null);
524
524
  }
525
525
  }
526
526
  function ct(R, V) {
@@ -529,16 +529,16 @@ Check the top-level render call using <` + se + ">.");
529
529
  return;
530
530
  if (qe(R))
531
531
  for (var se = 0; se < R.length; se++) {
532
- var Ce = R[se];
533
- ye(Ce) && Vt(Ce, V);
532
+ var Se = R[se];
533
+ ye(Se) && Vt(Se, V);
534
534
  }
535
535
  else if (ye(R))
536
536
  R._store && (R._store.validated = !0);
537
537
  else if (R) {
538
538
  var Ge = y(R);
539
539
  if (typeof Ge == "function" && Ge !== R.entries)
540
- for (var at = Ge.call(R), Ue; !(Ue = at.next()).done; )
541
- ye(Ue.value) && Vt(Ue.value, V);
540
+ for (var at = Ge.call(R), He; !(He = at.next()).done; )
541
+ ye(He.value) && Vt(He.value, V);
542
542
  }
543
543
  }
544
544
  }
@@ -557,10 +557,10 @@ Check the top-level render call using <` + se + ">.");
557
557
  else
558
558
  return;
559
559
  if (se) {
560
- var Ce = F(V);
561
- Be(se, R.props, "prop", Ce, R);
562
- } else if (V.PropTypes !== void 0 && !Se) {
563
- Se = !0;
560
+ var Se = F(V);
561
+ Be(se, R.props, "prop", Se, R);
562
+ } else if (V.PropTypes !== void 0 && !be) {
563
+ be = !0;
564
564
  var Ge = F(V);
565
565
  w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ge || "Unknown");
566
566
  }
@@ -570,9 +570,9 @@ Check the top-level render call using <` + se + ">.");
570
570
  function Dn(R) {
571
571
  {
572
572
  for (var V = Object.keys(R.props), se = 0; se < V.length; se++) {
573
- var Ce = V[se];
574
- if (Ce !== "children" && Ce !== "key") {
575
- W(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Ce), W(null);
573
+ var Se = V[se];
574
+ if (Se !== "children" && Se !== "key") {
575
+ W(R), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Se), W(null);
576
576
  break;
577
577
  }
578
578
  }
@@ -580,10 +580,10 @@ Check the top-level render call using <` + se + ">.");
580
580
  }
581
581
  }
582
582
  var Jn = {};
583
- function Ln(R, V, se, Ce, Ge, at) {
583
+ function Ln(R, V, se, Se, Ge, at) {
584
584
  {
585
- var Ue = I(R);
586
- if (!Ue) {
585
+ var He = I(R);
586
+ if (!He) {
587
587
  var ze = "";
588
588
  (R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (ze += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
589
589
  var Ot = mt();
@@ -591,13 +591,13 @@ Check the top-level render call using <` + se + ">.");
591
591
  var St;
592
592
  R === null ? St = "null" : qe(R) ? St = "array" : R !== void 0 && R.$$typeof === t ? (St = "<" + (F(R.type) || "Unknown") + " />", ze = " Did you accidentally export a JSX literal instead of a component?") : St = typeof R, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", St, ze);
593
593
  }
594
- var yt = be(R, V, se, Ge, at);
594
+ var yt = Re(R, V, se, Ge, at);
595
595
  if (yt == null)
596
596
  return yt;
597
- if (Ue) {
597
+ if (He) {
598
598
  var Kt = V.children;
599
599
  if (Kt !== void 0)
600
- if (Ce)
600
+ if (Se)
601
601
  if (qe(Kt)) {
602
602
  for (var Fn = 0; Fn < Kt.length; Fn++)
603
603
  ct(Kt[Fn], R);
@@ -1882,11 +1882,11 @@ const xu = (e) => {
1882
1882
  duplex: "half"
1883
1883
  }), de;
1884
1884
  if (O.isFormData(m) && (de = Y.headers.get("content-type")) && N.setContentType(de), Y.body) {
1885
- const [Re, Ae] = wl(
1885
+ const [ke, Ae] = wl(
1886
1886
  $,
1887
1887
  Xo(bl(S))
1888
1888
  );
1889
- m = Cl(Y.body, Tl, Re, Ae);
1889
+ m = Cl(Y.body, Tl, ke, Ae);
1890
1890
  }
1891
1891
  }
1892
1892
  O.isString(E) || (E = E ? "include" : "omit");
@@ -1907,12 +1907,12 @@ const xu = (e) => {
1907
1907
  ["status", "statusText", "headers"].forEach((G) => {
1908
1908
  Y[G] = L[G];
1909
1909
  });
1910
- const de = O.toFiniteNumber(L.headers.get("content-length")), [Re, Ae] = C && wl(
1910
+ const de = O.toFiniteNumber(L.headers.get("content-length")), [ke, Ae] = C && wl(
1911
1911
  de,
1912
1912
  Xo(bl(C), !0)
1913
1913
  ) || [];
1914
1914
  L = new r(
1915
- Cl(L.body, Tl, Re, () => {
1915
+ Cl(L.body, Tl, ke, () => {
1916
1916
  Ae && Ae(), j && j();
1917
1917
  }),
1918
1918
  Y
@@ -3415,7 +3415,7 @@ function Kx(e = {}) {
3415
3415
  threadId: j.threadId ?? null,
3416
3416
  headers: {}
3417
3417
  }, (async () => {
3418
- var de, Re, Ae, G, te, q, P, H, Z, oe, ne, De, ee, ue, xe, Ne, Ke, Je;
3418
+ var de, ke, Ae, G, te, q, P, H, Z, oe, ne, De, ee, ue, xe, Ne, Ke, Je;
3419
3419
  const Y = (Be) => {
3420
3420
  var $e;
3421
3421
  try {
@@ -3434,14 +3434,14 @@ function Kx(e = {}) {
3434
3434
  if (r)
3435
3435
  Be = { Authorization: `Bearer ${r}` };
3436
3436
  else if (typeof window < "u") {
3437
- const be = window.__AUTH_TOKEN__, bt = ((de = window.localStorage) == null ? void 0 : de.getItem("authToken")) || null;
3437
+ const Re = window.__AUTH_TOKEN__, bt = ((de = window.localStorage) == null ? void 0 : de.getItem("authToken")) || null;
3438
3438
  let kt = null;
3439
3439
  try {
3440
- const Se = (Re = window.localStorage) == null ? void 0 : Re.getItem("chat-settings");
3441
- Se && (kt = ((Ae = JSON.parse(Se)) == null ? void 0 : Ae.apiKey) || null);
3440
+ const be = (ke = window.localStorage) == null ? void 0 : ke.getItem("chat-settings");
3441
+ be && (kt = ((Ae = JSON.parse(be)) == null ? void 0 : Ae.apiKey) || null);
3442
3442
  } catch {
3443
3443
  }
3444
- const W = be || bt || kt || null;
3444
+ const W = Re || bt || kt || null;
3445
3445
  W && (Be = { Authorization: `Bearer ${W}` });
3446
3446
  }
3447
3447
  } catch {
@@ -3454,8 +3454,8 @@ function Kx(e = {}) {
3454
3454
  let $e = {};
3455
3455
  if (typeof window < "u")
3456
3456
  try {
3457
- const pe = (G = window.localStorage) == null ? void 0 : G.getItem("authSessionId");
3458
- pe && ($e = { "X-Session-Id": pe });
3457
+ const me = (G = window.localStorage) == null ? void 0 : G.getItem("authSessionId");
3458
+ me && ($e = { "X-Session-Id": me });
3459
3459
  } catch {
3460
3460
  }
3461
3461
  const qe = {
@@ -3474,14 +3474,14 @@ function Kx(e = {}) {
3474
3474
  credentials: i
3475
3475
  });
3476
3476
  if (S.current && (S.current.headers = qe), !Qe.ok || !Qe.body) {
3477
- const pe = await Qe.text().catch(() => "");
3477
+ const me = await Qe.text().catch(() => "");
3478
3478
  console.debug(
3479
3479
  "[use-chat] non-OK response",
3480
3480
  Qe.status,
3481
- pe == null ? void 0 : pe.slice(0, 500)
3481
+ me == null ? void 0 : me.slice(0, 500)
3482
3482
  );
3483
- const be = `stream ${Qe.status}${pe ? ": " + pe : ""}`;
3484
- throw (te = A == null ? void 0 : A.onConnectionError) == null || te.call(A, be), J = !0, L = "error", M = be, new Error(be);
3483
+ const Re = `stream ${Qe.status}${me ? ": " + me : ""}`;
3484
+ throw (te = A == null ? void 0 : A.onConnectionError) == null || te.call(A, Re), J = !0, L = "error", M = Re, new Error(Re);
3485
3485
  }
3486
3486
  w(!0);
3487
3487
  const rt = Qe.body.getReader(), Ct = new TextDecoder();
@@ -3490,30 +3490,30 @@ function Kx(e = {}) {
3490
3490
  let Tt = 0, wt = null;
3491
3491
  const Xe = () => {
3492
3492
  if (ot.length) {
3493
- const pe = ot.join("");
3494
- ot = [], T.current && p((be) => be + pe);
3493
+ const me = ot.join("");
3494
+ ot = [], T.current && p((Re) => Re + me);
3495
3495
  }
3496
3496
  wt = null;
3497
3497
  }, fe = () => {
3498
3498
  typeof window < "u" && wt == null && (wt = requestAnimationFrame(Xe));
3499
3499
  };
3500
- let ve = Date.now();
3500
+ let we = Date.now();
3501
3501
  const Le = setInterval(() => {
3502
- var pe;
3503
- if (Date.now() - ve > 18e5) {
3504
- const be = "Stream idle timeout";
3505
- d(be), L = "error", M = be, B.abort(), (pe = A == null ? void 0 : A.onError) == null || pe.call(A, be);
3502
+ var me;
3503
+ if (Date.now() - we > 18e5) {
3504
+ const Re = "Stream idle timeout";
3505
+ d(Re), L = "error", M = Re, B.abort(), (me = A == null ? void 0 : A.onError) == null || me.call(A, Re);
3506
3506
  }
3507
- }, 5e3), He = 1024 * 1024;
3507
+ }, 5e3), Ue = 1024 * 1024;
3508
3508
  try {
3509
- const pe = Qe.headers.get("X-Thread-Id") || Qe.headers.get("x-thread-id"), be = Qe.headers.get("X-Thread-Created") || Qe.headers.get("x-thread-created"), bt = pe ?? null, kt = String(be ?? "").toLowerCase() === "true";
3509
+ const me = Qe.headers.get("X-Thread-Id") || Qe.headers.get("x-thread-id"), Re = Qe.headers.get("X-Thread-Created") || Qe.headers.get("x-thread-created"), bt = me ?? null, kt = String(Re ?? "").toLowerCase() === "true";
3510
3510
  for (S.current && !S.current.threadId && (S.current = {
3511
3511
  ...S.current,
3512
3512
  threadId: bt
3513
3513
  }), (q = A == null ? void 0 : A.onOpen) == null || q.call(A, { threadId: bt, created: kt }); ; ) {
3514
- const { value: W, done: Se } = await rt.read();
3515
- if (Se) break;
3516
- pt += Ct.decode(W, { stream: !0 }), pt.length > He && (pt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3514
+ const { value: W, done: be } = await rt.read();
3515
+ if (be) break;
3516
+ pt += Ct.decode(W, { stream: !0 }), pt.length > Ue && (pt = "", console.warn("Stream buffer reset: exceeded 1MB"));
3517
3517
  let ye;
3518
3518
  for (; (ye = pt.indexOf(`
3519
3519
 
@@ -3530,7 +3530,7 @@ function Kx(e = {}) {
3530
3530
  continue;
3531
3531
  }
3532
3532
  const Pe = qx(Rt) ? Rt.data : Rt;
3533
- ve = Date.now();
3533
+ we = Date.now();
3534
3534
  const Vt = Pe.seq;
3535
3535
  if (Vt !== void 0) {
3536
3536
  if (Vt <= Tt) {
@@ -3595,12 +3595,12 @@ function Kx(e = {}) {
3595
3595
  }
3596
3596
  }
3597
3597
  Xe(), L === null && !B.signal.aborted && (L = "complete");
3598
- } catch (pe) {
3599
- if (pe.name === "AbortError")
3598
+ } catch (me) {
3599
+ if (me.name === "AbortError")
3600
3600
  L = L ?? "aborted";
3601
3601
  else {
3602
- const be = pe.message || String(pe);
3603
- L = "error", M = be, d(be), (ue = A == null ? void 0 : A.onError) == null || ue.call(A, be);
3602
+ const Re = me.message || String(me);
3603
+ L = "error", M = Re, d(Re), (ue = A == null ? void 0 : A.onError) == null || ue.call(A, Re);
3604
3604
  }
3605
3605
  } finally {
3606
3606
  try {
@@ -3878,7 +3878,7 @@ function Xx({
3878
3878
  onThreadChange: d,
3879
3879
  checkpointMetadataCache: f
3880
3880
  }) {
3881
- const { api: p, baseUrl: h } = Tu(), g = lt(() => _n(h), [h]), [x, y] = ge([]), [m, w] = ge(t), [b, T] = ge(!1), [C, S] = ge(null), [k, N] = ge(!1), [E, I] = ge(null), { state: _, seed: D, prepend: F, pushUser: j, onEvent: $ } = Bx(), [A, B] = ge(!1), [L, M] = ge(!1), [J, Y] = ge(null), [de, Re] = ge([]), [Ae, G] = ge(!1), te = f ?? Lx(), { setCacheForThread: q } = te, P = et(m), H = et(null);
3881
+ const { api: p, baseUrl: h } = Tu(), g = lt(() => _n(h), [h]), [x, y] = ge([]), [m, w] = ge(t), [b, T] = ge(!1), [C, S] = ge(null), [k, N] = ge(!1), [E, I] = ge(null), { state: _, seed: D, prepend: F, pushUser: j, onEvent: $ } = Bx(), [A, B] = ge(!1), [L, M] = ge(!1), [J, Y] = ge(null), [de, ke] = ge([]), [Ae, G] = ge(!1), te = f ?? Lx(), { setCacheForThread: q } = te, P = et(m), H = et(null);
3882
3882
  Nt(() => {
3883
3883
  P.current = m;
3884
3884
  }, [m]);
@@ -3898,18 +3898,18 @@ function Xx({
3898
3898
  const fe = await p.listThreads();
3899
3899
  y(fe ?? []);
3900
3900
  } catch (fe) {
3901
- const ve = String(fe);
3902
- S(ve), l == null || l(ve);
3901
+ const we = String(fe);
3902
+ S(we), l == null || l(we);
3903
3903
  } finally {
3904
3904
  T(!1);
3905
3905
  }
3906
3906
  }, [p, l]), Ne = Ee(
3907
3907
  async (fe) => {
3908
3908
  try {
3909
- const ve = await p.createThread(fe);
3910
- return w(ve.threadId), await xe(), ve.threadId;
3911
- } catch (ve) {
3912
- return l == null || l(String(ve)), null;
3909
+ const we = await p.createThread(fe);
3910
+ return w(we.threadId), await xe(), we.threadId;
3911
+ } catch (we) {
3912
+ return l == null || l(String(we)), null;
3913
3913
  }
3914
3914
  },
3915
3915
  [p, xe, l]
@@ -3917,48 +3917,48 @@ function Xx({
3917
3917
  async (fe) => {
3918
3918
  try {
3919
3919
  await p.deleteThread(fe), P.current === fe && (w(null), D([], {})), await xe();
3920
- } catch (ve) {
3921
- l == null || l(String(ve));
3920
+ } catch (we) {
3921
+ l == null || l(String(we));
3922
3922
  }
3923
3923
  },
3924
3924
  [p, xe, D, l]
3925
3925
  ), Je = Ee(
3926
- async (fe, ve) => {
3926
+ async (fe, we) => {
3927
3927
  try {
3928
- await p.updateThread(fe, ve), await xe();
3928
+ await p.updateThread(fe, we), await xe();
3929
3929
  } catch (Le) {
3930
3930
  l == null || l(String(Le));
3931
3931
  }
3932
3932
  },
3933
3933
  [p, xe, l]
3934
3934
  ), Be = Ee(
3935
- (fe, ve, Le) => {
3936
- const He = ve.filter((pe) => pe.checkpointId).map((pe) => ({
3937
- checkpointId: pe.checkpointId,
3938
- checkpointNs: pe.checkpointNs ?? void 0,
3939
- createdAt: pe.createdAt ?? ""
3935
+ (fe, we, Le) => {
3936
+ const Ue = we.filter((me) => me.checkpointId).map((me) => ({
3937
+ checkpointId: me.checkpointId,
3938
+ checkpointNs: me.checkpointNs ?? void 0,
3939
+ createdAt: me.createdAt ?? ""
3940
3940
  }));
3941
- console.log(`[ChatSessionProvider] Cached metadata for ${He.length} checkpoints from ${Le}`), q(fe, He);
3941
+ console.log(`[ChatSessionProvider] Cached metadata for ${Ue.length} checkpoints from ${Le}`), q(fe, Ue);
3942
3942
  },
3943
3943
  [q]
3944
3944
  ), $e = Ee(
3945
- async (fe, ve) => {
3945
+ async (fe, we) => {
3946
3946
  if (fe) {
3947
3947
  N(!0), I(null);
3948
3948
  try {
3949
3949
  const Le = await p.getStateHistory({
3950
3950
  threadId: fe,
3951
- checkpointId: ve
3952
- }), { checkpoints: He } = Ur(Le);
3953
- Be(fe, He, `thread load (requested: ${ve})`);
3954
- let pe = ve ? He.find((be) => be.checkpointId === ve) : null;
3955
- pe || (pe = He.find((be) => be.messages && be.messages.length > 0) ?? He[0]), D((pe == null ? void 0 : pe.messages) ?? [], {
3956
- checkpointId: (pe == null ? void 0 : pe.checkpointId) ?? null,
3957
- checkpointNs: (pe == null ? void 0 : pe.checkpointNs) ?? null
3958
- }), Re(He), B(!!(pe != null && pe.nextCursor)), Y((pe == null ? void 0 : pe.nextCursor) ?? null);
3951
+ checkpointId: we
3952
+ }), { checkpoints: Ue } = Ur(Le);
3953
+ Be(fe, Ue, `thread load (requested: ${we})`);
3954
+ const me = Ue.find((Re) => Re.messages && Re.messages.length > 0) ?? Ue[0];
3955
+ D((me == null ? void 0 : me.messages) ?? [], {
3956
+ checkpointId: (me == null ? void 0 : me.checkpointId) ?? null,
3957
+ checkpointNs: (me == null ? void 0 : me.checkpointNs) ?? null
3958
+ }), ke(Ue), B(!!(me != null && me.nextCursor)), Y((me == null ? void 0 : me.nextCursor) ?? null);
3959
3959
  } catch (Le) {
3960
- const He = String(Le);
3961
- I(He), l == null || l(He);
3960
+ const Ue = String(Le);
3961
+ I(Ue), l == null || l(Ue);
3962
3962
  } finally {
3963
3963
  N(!1);
3964
3964
  }
@@ -3970,30 +3970,30 @@ function Xx({
3970
3970
  Z.current = $e;
3971
3971
  }, [$e]);
3972
3972
  const qe = Ee(
3973
- async (fe, ve) => {
3973
+ async (fe, we) => {
3974
3974
  const Le = P.current;
3975
3975
  if (Le) {
3976
3976
  G(!0);
3977
3977
  try {
3978
- const He = await p.getStateHistory({
3978
+ const Ue = await p.getStateHistory({
3979
3979
  threadId: Le,
3980
3980
  checkpointId: fe,
3981
- checkpointNs: ve ?? void 0
3982
- }), { checkpoints: pe } = Ur(He);
3983
- Be(Le, pe, "checkpoint navigation");
3984
- const be = pe.find(
3985
- (bt) => bt.checkpointId === fe && (ve ? bt.checkpointNs === ve : !0)
3981
+ checkpointNs: we ?? void 0
3982
+ }), { checkpoints: me } = Ur(Ue);
3983
+ Be(Le, me, "checkpoint navigation");
3984
+ const Re = me.find(
3985
+ (bt) => bt.checkpointId === fe && (we ? bt.checkpointNs === we : !0)
3986
3986
  );
3987
- if (!be) {
3988
- console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: fe, checkpointNs: ve });
3987
+ if (!Re) {
3988
+ console.warn("[ChatSessionProvider] Requested checkpoint not found:", { checkpointId: fe, checkpointNs: we });
3989
3989
  return;
3990
3990
  }
3991
- Re(pe), D(be.messages ?? [], {
3992
- checkpointId: be.checkpointId ?? null,
3993
- checkpointNs: be.checkpointNs ?? null
3991
+ ke(me), D(Re.messages ?? [], {
3992
+ checkpointId: Re.checkpointId ?? null,
3993
+ checkpointNs: Re.checkpointNs ?? null
3994
3994
  });
3995
- } catch (He) {
3996
- l == null || l(String(He));
3995
+ } catch (Ue) {
3996
+ l == null || l(String(Ue));
3997
3997
  } finally {
3998
3998
  G(!1);
3999
3999
  }
@@ -4001,10 +4001,10 @@ function Xx({
4001
4001
  },
4002
4002
  [p, D, l, Be]
4003
4003
  ), Ze = Ee(
4004
- (fe, ve) => {
4004
+ (fe, we) => {
4005
4005
  D(_.messages, {
4006
4006
  checkpointId: fe ?? null,
4007
- checkpointNs: ve ?? null
4007
+ checkpointNs: we ?? null
4008
4008
  });
4009
4009
  },
4010
4010
  [D, _.messages]
@@ -4017,9 +4017,9 @@ function Xx({
4017
4017
  const fe = await p.getStateHistory({
4018
4018
  threadId: P.current,
4019
4019
  checkpointId: J
4020
- }), { checkpoints: ve } = Ur(fe);
4021
- if (ve.length > 0) {
4022
- const Le = ve[ve.length - 1];
4020
+ }), { checkpoints: we } = Ur(fe);
4021
+ if (we.length > 0) {
4022
+ const Le = we[we.length - 1];
4023
4023
  F((Le == null ? void 0 : Le.messages) ?? []), B(!!(Le != null && Le.nextCursor)), Y((Le == null ? void 0 : Le.nextCursor) ?? null);
4024
4024
  }
4025
4025
  } catch (fe) {
@@ -4029,17 +4029,17 @@ function Xx({
4029
4029
  }
4030
4030
  }
4031
4031
  }, [p, J, F, l]), Ct = Ee(async () => {
4032
- D([], {}), Re([]), B(!1), Y(null);
4032
+ D([], {}), ke([]), B(!1), Y(null);
4033
4033
  }, [D]), pt = Ee(
4034
- async (fe, ve) => {
4035
- console.log("[ChatSessionProvider] Interrupt:", fe, ve);
4034
+ async (fe, we) => {
4035
+ console.log("[ChatSessionProvider] Interrupt:", fe, we);
4036
4036
  },
4037
4037
  []
4038
4038
  );
4039
4039
  Nt(() => {
4040
4040
  xe();
4041
4041
  }, [xe]), Nt(() => {
4042
- var ve, Le;
4042
+ var we, Le;
4043
4043
  if (!o || !m || k || H.current === m)
4044
4044
  return;
4045
4045
  H.current = m;
@@ -4047,34 +4047,34 @@ function Xx({
4047
4047
  id: localStorage.getItem("lastCheckpointId") || n,
4048
4048
  ns: localStorage.getItem("lastCheckpointNs") || r
4049
4049
  };
4050
- fe.id ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", fe.id), (ve = Z.current) == null || ve.call(Z, m, fe.id)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (Le = Z.current) == null || Le.call(Z, m));
4050
+ fe.id ? (console.log("[ChatSessionProvider] Loading thread with checkpoint:", fe.id), (we = Z.current) == null || we.call(Z, m, fe.id)) : (console.log("[ChatSessionProvider] Loading thread with latest checkpoint"), (Le = Z.current) == null || Le.call(Z, m));
4051
4051
  }, [o, m, k, n, r]), Nt(() => {
4052
4052
  d == null || d(m);
4053
4053
  }, [m, d]);
4054
4054
  const ot = Ee(
4055
- async (fe, ve) => {
4056
- const Le = P.current, He = (fe == null ? void 0 : fe.text) ?? "";
4057
- if (!Le && !He) return;
4055
+ async (fe, we) => {
4056
+ const Le = P.current, Ue = (fe == null ? void 0 : fe.text) ?? "";
4057
+ if (!Le && !Ue) return;
4058
4058
  if (!Le) {
4059
4059
  await Ne("New Chat");
4060
4060
  return;
4061
4061
  }
4062
- const { contentParts: pe } = await wx(
4062
+ const { contentParts: me } = await wx(
4063
4063
  p,
4064
4064
  (fe == null ? void 0 : fe.attachments) ?? []
4065
- ), be = [...pe];
4066
- He != null && He.trim() && be.push({ type: "text", text: He });
4065
+ ), Re = [...me];
4066
+ Ue != null && Ue.trim() && Re.push({ type: "text", text: Ue });
4067
4067
  const bt = {
4068
4068
  id: `msg-${Date.now()}`,
4069
4069
  role: "user",
4070
- content: be,
4070
+ content: Re,
4071
4071
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
4072
4072
  };
4073
4073
  j(bt);
4074
4074
  const kt = {
4075
4075
  threadId: Le,
4076
- checkpointId: (ve == null ? void 0 : ve.checkpointId) ?? _.lastCheckpointId ?? void 0,
4077
- checkpointNs: (ve == null ? void 0 : ve.checkpointNs) ?? _.lastCheckpointNs ?? void 0
4076
+ checkpointId: (we == null ? void 0 : we.checkpointId) ?? _.lastCheckpointId ?? void 0,
4077
+ checkpointNs: (we == null ? void 0 : we.checkpointNs) ?? _.lastCheckpointNs ?? void 0
4078
4078
  };
4079
4079
  oe(kt);
4080
4080
  },
@@ -4294,8 +4294,8 @@ function Qx({
4294
4294
  try {
4295
4295
  const Y = l(A);
4296
4296
  Y && typeof Y.then == "function" ? Y.then(() => {
4297
- var de, Re;
4298
- ((de = S.current) == null ? void 0 : de.id) === B && S.current.shouldClear && (g || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((Re = S.current) == null ? void 0 : Re.id) === B && (S.current = null);
4297
+ var de, ke;
4298
+ ((de = S.current) == null ? void 0 : de.id) === B && S.current.shouldClear && (g || (y(""), T.current && (T.current.style.height = "auto"), a == null || a(""))), ((ke = S.current) == null ? void 0 : ke.id) === B && (S.current = null);
4299
4299
  }).catch(() => {
4300
4300
  var de;
4301
4301
  ((de = S.current) == null ? void 0 : de.id) === B && (S.current = null);
@@ -6282,7 +6282,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6282
6282
  Lt(() => {
6283
6283
  B && (Y == null || Y());
6284
6284
  }, [B, Y]);
6285
- const de = (q = L.arrow) == null ? void 0 : q.x, Re = (P = L.arrow) == null ? void 0 : P.y, Ae = ((H = L.arrow) == null ? void 0 : H.centerOffset) !== 0, [G, te] = v.useState();
6285
+ const de = (q = L.arrow) == null ? void 0 : q.x, ke = (P = L.arrow) == null ? void 0 : P.y, Ae = ((H = L.arrow) == null ? void 0 : H.centerOffset) !== 0, [G, te] = v.useState();
6286
6286
  return Lt(() => {
6287
6287
  m && te(window.getComputedStyle(m).zIndex);
6288
6288
  }, [m]), /* @__PURE__ */ u.jsx(
@@ -6316,7 +6316,7 @@ var Na = "PopperContent", [Fv, $v] = Ju(Na), nd = v.forwardRef(
6316
6316
  placedSide: M,
6317
6317
  onArrowChange: C,
6318
6318
  arrowX: de,
6319
- arrowY: Re,
6319
+ arrowY: ke,
6320
6320
  shouldHideArrow: Ae,
6321
6321
  children: /* @__PURE__ */ u.jsx(
6322
6322
  _e.div,
@@ -7281,7 +7281,7 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7281
7281
  ...x
7282
7282
  } = e, y = fr(an, n), m = yo(an, n), w = Ls(n), b = Rd(n), T = Gw(n), [C, S] = v.useState(null), k = v.useRef(null), N = Ve(t, k, y.onContentChange), E = v.useRef(0), I = v.useRef(""), _ = v.useRef(0), D = v.useRef(null), F = v.useRef("right"), j = v.useRef(0), $ = g ? Ds : v.Fragment, A = g ? { as: rb, allowPinchZoom: !0 } : void 0, B = (M) => {
7283
7283
  var q, P;
7284
- const J = I.current + M, Y = T().filter((H) => !H.disabled), de = document.activeElement, Re = (q = Y.find((H) => H.ref.current === de)) == null ? void 0 : q.textValue, Ae = Y.map((H) => H.textValue), G = mb(Ae, J, Re), te = (P = Y.find((H) => H.textValue === G)) == null ? void 0 : P.ref.current;
7284
+ const J = I.current + M, Y = T().filter((H) => !H.disabled), de = document.activeElement, ke = (q = Y.find((H) => H.ref.current === de)) == null ? void 0 : q.textValue, Ae = Y.map((H) => H.textValue), G = mb(Ae, J, ke), te = (P = Y.find((H) => H.textValue === G)) == null ? void 0 : P.ref.current;
7285
7285
  (function H(Z) {
7286
7286
  I.current = Z, window.clearTimeout(E.current), Z !== "" && (E.current = window.setTimeout(() => H(""), 1e3));
7287
7287
  })(J), te && setTimeout(() => te.focus());
@@ -7366,8 +7366,8 @@ var an = "MenuContent", [eb, Pa] = dr(an), Ad = v.forwardRef(
7366
7366
  ref: N,
7367
7367
  style: { outline: "none", ...x.style },
7368
7368
  onKeyDown: ce(x.onKeyDown, (M) => {
7369
- const Y = M.target.closest("[data-radix-menu-content]") === M.currentTarget, de = M.ctrlKey || M.altKey || M.metaKey, Re = M.key.length === 1;
7370
- Y && (M.key === "Tab" && M.preventDefault(), !de && Re && B(M.key));
7369
+ const Y = M.target.closest("[data-radix-menu-content]") === M.currentTarget, de = M.ctrlKey || M.altKey || M.metaKey, ke = M.key.length === 1;
7370
+ Y && (M.key === "Tab" && M.preventDefault(), !de && ke && B(M.key));
7371
7371
  const Ae = k.current;
7372
7372
  if (M.target !== Ae || !Vw.includes(M.key)) return;
7373
7373
  M.preventDefault();
@@ -8109,7 +8109,7 @@ function $a(e) {
8109
8109
  function It(e) {
8110
8110
  return e(vf);
8111
8111
  }
8112
- function he(e, t) {
8112
+ function pe(e, t) {
8113
8113
  return it(e, d0(t, zs));
8114
8114
  }
8115
8115
  function pn(e, t) {
@@ -8230,7 +8230,7 @@ function X(e) {
8230
8230
  };
8231
8231
  }
8232
8232
  function Ht(e, t) {
8233
- return Bs(X(t), (n) => he(e, n));
8233
+ return Bs(X(t), (n) => pe(e, n));
8234
8234
  }
8235
8235
  function We() {
8236
8236
  const e = [];
@@ -8253,7 +8253,7 @@ function We() {
8253
8253
  };
8254
8254
  }
8255
8255
  function en(e) {
8256
- return Bs(We(), (t) => he(e, t));
8256
+ return Bs(We(), (t) => pe(e, t));
8257
8257
  }
8258
8258
  function tt(e, t = [], { singleton: n } = { singleton: !0 }) {
8259
8259
  return {
@@ -8293,7 +8293,7 @@ function _t(...e) {
8293
8293
  }
8294
8294
  };
8295
8295
  }
8296
- function ke(e, t = bf) {
8296
+ function Te(e, t = bf) {
8297
8297
  return U(e, gt(t));
8298
8298
  }
8299
8299
  function Yi(...e) {
@@ -8443,19 +8443,19 @@ function Sf(e, t, n) {
8443
8443
  const Wt = tt(
8444
8444
  () => {
8445
8445
  const e = We(), t = We(), n = X(0), r = We(), o = X(0), s = We(), i = We(), a = X(0), l = X(0), c = X(0), d = X(0), f = We(), p = We(), h = X(!1), g = X(!1), x = X(!1);
8446
- return he(
8446
+ return pe(
8447
8447
  U(
8448
8448
  e,
8449
8449
  ae(({ scrollTop: y }) => y)
8450
8450
  ),
8451
8451
  t
8452
- ), he(
8452
+ ), pe(
8453
8453
  U(
8454
8454
  e,
8455
8455
  ae(({ scrollHeight: y }) => y)
8456
8456
  ),
8457
8457
  i
8458
- ), he(t, o), {
8458
+ ), pe(t, o), {
8459
8459
  deviation: n,
8460
8460
  fixedFooterHeight: c,
8461
8461
  fixedHeaderHeight: l,
@@ -8805,7 +8805,7 @@ const P0 = {
8805
8805
  ),
8806
8806
  []
8807
8807
  );
8808
- he(
8808
+ pe(
8809
8809
  U(
8810
8810
  l,
8811
8811
  Ie((C) => C.length > 0),
@@ -8820,7 +8820,7 @@ const P0 = {
8820
8820
  })
8821
8821
  ),
8822
8822
  x
8823
- ), he(
8823
+ ), pe(
8824
8824
  U(
8825
8825
  r,
8826
8826
  Fe(x),
@@ -8834,7 +8834,7 @@ const P0 = {
8834
8834
  ])
8835
8835
  ),
8836
8836
  n
8837
- ), he(c, d);
8837
+ ), pe(c, d);
8838
8838
  const m = Ht(
8839
8839
  U(
8840
8840
  c,
@@ -8842,7 +8842,7 @@ const P0 = {
8842
8842
  ),
8843
8843
  !0
8844
8844
  );
8845
- he(
8845
+ pe(
8846
8846
  U(
8847
8847
  d,
8848
8848
  Ie((C) => C !== void 0 && dt(It(x).sizeTree)),
@@ -8890,7 +8890,7 @@ const P0 = {
8890
8890
  );
8891
8891
  });
8892
8892
  const b = en(s);
8893
- he(
8893
+ pe(
8894
8894
  U(
8895
8895
  s,
8896
8896
  Fe(x),
@@ -8961,7 +8961,7 @@ const P0 = {
8961
8961
  })
8962
8962
  )
8963
8963
  );
8964
- return he(
8964
+ return pe(
8965
8965
  U(
8966
8966
  i,
8967
8967
  Fe(x, h),
@@ -9036,19 +9036,19 @@ function O0(e) {
9036
9036
  const _f = tt(
9037
9037
  ([{ groupIndices: e, sizes: t, totalCount: n }, { headerHeight: r, scrollTop: o }]) => {
9038
9038
  const s = We(), i = We(), a = en(U(s, ae(O0)));
9039
- return he(
9039
+ return pe(
9040
9040
  U(
9041
9041
  a,
9042
9042
  ae((l) => l.totalCount)
9043
9043
  ),
9044
9044
  n
9045
- ), he(
9045
+ ), pe(
9046
9046
  U(
9047
9047
  a,
9048
9048
  ae((l) => l.groupIndices)
9049
9049
  ),
9050
9050
  e
9051
- ), he(
9051
+ ), pe(
9052
9052
  U(
9053
9053
  _t(o, t, r),
9054
9054
  Ie(([l, c]) => Us(c)),
@@ -9100,7 +9100,7 @@ const vo = tt(
9100
9100
  function b() {
9101
9101
  y && (y(), y = null), w && (w(), w = null), m && (clearTimeout(m), m = null), Me(l, !1);
9102
9102
  }
9103
- return he(
9103
+ return pe(
9104
9104
  U(
9105
9105
  h,
9106
9106
  Fe(n, f, r, x, a, i, p),
@@ -9115,15 +9115,15 @@ const vo = tt(
9115
9115
  const $ = Pf(T), { align: A, behavior: B, offset: L } = $, M = k - 1, J = jf($, C, M);
9116
9116
  let Y = so(J, C.offsetTree, D) + E;
9117
9117
  A === "end" ? (Y += F + gn(C.sizeTree, J)[1] - S + j, J === M && (Y += I)) : A === "center" ? Y += (F + gn(C.sizeTree, J)[1] - S + j) / 2 : Y -= N, L && (Y += L);
9118
- const de = (Re) => {
9119
- b(), Re ? (_("retrying to scroll to", { location: T }, Xt.DEBUG), Me(h, T)) : (Me(g, !0), _("list did not change, scroll successful", {}, Xt.DEBUG));
9118
+ const de = (ke) => {
9119
+ b(), ke ? (_("retrying to scroll to", { location: T }, Xt.DEBUG), Me(h, T)) : (Me(g, !0), _("list did not change, scroll successful", {}, Xt.DEBUG));
9120
9120
  };
9121
9121
  if (b(), B === "smooth") {
9122
- let Re = !1;
9122
+ let ke = !1;
9123
9123
  w = it(t, (Ae) => {
9124
- Re = Re || Ae;
9124
+ ke = ke || Ae;
9125
9125
  }), y = pn(d, () => {
9126
- de(Re);
9126
+ de(ke);
9127
9127
  });
9128
9128
  } else
9129
9129
  y = pn(U(t, D0(150)), de);
@@ -9165,7 +9165,7 @@ function Wa(e, t) {
9165
9165
  const wo = tt(
9166
9166
  ([{ defaultItemSize: e, listRefresh: t, sizes: n }, { scrollTop: r }, { scrollTargetReached: o, scrollToIndex: s }, { didMount: i }]) => {
9167
9167
  const a = X(!0), l = X(0), c = X(!0);
9168
- return he(
9168
+ return pe(
9169
9169
  U(
9170
9170
  i,
9171
9171
  Fe(l),
@@ -9173,7 +9173,7 @@ const wo = tt(
9173
9173
  wn(!1)
9174
9174
  ),
9175
9175
  a
9176
- ), he(
9176
+ ), pe(
9177
9177
  U(
9178
9178
  i,
9179
9179
  Fe(l),
@@ -9221,7 +9221,7 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9221
9221
  }, $0 = 0, bo = tt(([{ footerHeight: e, headerHeight: t, scrollBy: n, scrollContainerState: r, scrollTop: o, viewportHeight: s }]) => {
9222
9222
  const i = X(!1), a = X(!0), l = We(), c = We(), d = X(4), f = X($0), p = Ht(
9223
9223
  U(
9224
- Yi(U(ke(o), ar(1), wn(!0)), U(ke(o), ar(1), wn(!1), mc(100))),
9224
+ Yi(U(Te(o), ar(1), wn(!0)), U(Te(o), ar(1), wn(!1), mc(100))),
9225
9225
  gt()
9226
9226
  ),
9227
9227
  !1
@@ -9229,17 +9229,17 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9229
9229
  U(Yi(U(n, wn(!0)), U(n, wn(!1), mc(200))), gt()),
9230
9230
  !1
9231
9231
  );
9232
- he(
9232
+ pe(
9233
9233
  U(
9234
- _t(ke(o), ke(f)),
9234
+ _t(Te(o), Te(f)),
9235
9235
  ae(([w, b]) => w <= b),
9236
9236
  gt()
9237
9237
  ),
9238
9238
  a
9239
- ), he(U(a, An(50)), c);
9239
+ ), pe(U(a, An(50)), c);
9240
9240
  const g = en(
9241
9241
  U(
9242
- _t(r, ke(s), ke(t), ke(e), ke(d)),
9242
+ _t(r, Te(s), Te(t), Te(e), Te(d)),
9243
9243
  Cn((w, [{ scrollHeight: b, scrollTop: T }, C, S, k, N]) => {
9244
9244
  const E = T + C - b > -N, I = {
9245
9245
  scrollHeight: b,
@@ -9298,15 +9298,15 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9298
9298
  ),
9299
9299
  0
9300
9300
  );
9301
- he(
9301
+ pe(
9302
9302
  U(
9303
9303
  g,
9304
9304
  ae((w) => w.atBottom)
9305
9305
  ),
9306
9306
  i
9307
- ), he(U(i, An(50)), l);
9307
+ ), pe(U(i, An(50)), l);
9308
9308
  const y = X(Vr);
9309
- he(
9309
+ pe(
9310
9310
  U(
9311
9311
  r,
9312
9312
  ae(({ scrollTop: w }) => w),
@@ -9318,16 +9318,16 @@ const io = "up", Vr = "down", L0 = "none", F0 = {
9318
9318
  ae((w) => w.direction)
9319
9319
  ),
9320
9320
  y
9321
- ), he(U(r, An(50), wn(L0)), y);
9321
+ ), pe(U(r, An(50), wn(L0)), y);
9322
9322
  const m = X(0);
9323
- return he(
9323
+ return pe(
9324
9324
  U(
9325
9325
  p,
9326
9326
  Ie((w) => !w),
9327
9327
  wn(0)
9328
9328
  ),
9329
9329
  m
9330
- ), he(
9330
+ ), pe(
9331
9331
  U(
9332
9332
  o,
9333
9333
  An(100),
@@ -9363,15 +9363,15 @@ const Va = tt(
9363
9363
  const s = We(), i = X(0), a = X(0), l = X(0), c = Ht(
9364
9364
  U(
9365
9365
  _t(
9366
- ke(r),
9367
- ke(o),
9368
- ke(n),
9369
- ke(s, oo),
9370
- ke(l),
9371
- ke(i),
9372
- ke(t),
9373
- ke(e),
9374
- ke(a)
9366
+ Te(r),
9367
+ Te(o),
9368
+ Te(n),
9369
+ Te(s, oo),
9370
+ Te(l),
9371
+ Te(i),
9372
+ Te(t),
9373
+ Te(e),
9374
+ Te(a)
9375
9375
  ),
9376
9376
  ae(
9377
9377
  ([
@@ -9508,20 +9508,20 @@ const hr = tt(
9508
9508
  { recalcInProgress: g }
9509
9509
  ]) => {
9510
9510
  const x = X([]), y = X(0), m = We();
9511
- he(s.topItemsIndexes, x);
9511
+ pe(s.topItemsIndexes, x);
9512
9512
  const w = Ht(
9513
9513
  U(
9514
9514
  _t(
9515
9515
  h,
9516
9516
  g,
9517
- ke(l, oo),
9518
- ke(o),
9519
- ke(r),
9520
- ke(c),
9517
+ Te(l, oo),
9518
+ Te(o),
9519
+ Te(r),
9520
+ Te(c),
9521
9521
  d,
9522
- ke(x),
9523
- ke(t),
9524
- ke(n),
9522
+ Te(x),
9523
+ Te(t),
9524
+ Te(n),
9525
9525
  e
9526
9526
  ),
9527
9527
  Ie(([S, k, , N, , , , , , , E]) => {
@@ -9571,7 +9571,7 @@ const hr = tt(
9571
9571
  const Y = D.length > 0 ? D[D.length - 1] + 1 : 0, de = I0(B, S, k, Y);
9572
9572
  if (de.length === 0)
9573
9573
  return null;
9574
- const Re = N - 1, Ae = Bs([], (G) => {
9574
+ const ke = N - 1, Ae = Bs([], (G) => {
9575
9575
  for (const te of de) {
9576
9576
  const q = te.value;
9577
9577
  let P = q.offset, H = te.start;
@@ -9582,7 +9582,7 @@ const hr = tt(
9582
9582
  P += ne * Z + ne * j;
9583
9583
  }
9584
9584
  H < Y && (P += (Y - H) * Z, H = Y);
9585
- const oe = Math.min(te.end, Re);
9585
+ const oe = Math.min(te.end, ke);
9586
9586
  for (let ne = H; ne <= oe && !(P >= k); ne++)
9587
9587
  G.push({ data: $ == null ? void 0 : $[ne], index: ne, offset: P, size: Z }), P += Z + j;
9588
9588
  }
@@ -9596,26 +9596,26 @@ const hr = tt(
9596
9596
  ),
9597
9597
  Ti
9598
9598
  );
9599
- he(
9599
+ pe(
9600
9600
  U(
9601
9601
  e,
9602
9602
  Ie(Fa),
9603
9603
  ae((S) => S == null ? void 0 : S.length)
9604
9604
  ),
9605
9605
  o
9606
- ), he(
9606
+ ), pe(
9607
9607
  U(
9608
9608
  w,
9609
9609
  ae((S) => S.topListHeight)
9610
9610
  ),
9611
9611
  f
9612
- ), he(f, a), he(
9612
+ ), pe(f, a), pe(
9613
9613
  U(
9614
9614
  w,
9615
9615
  ae((S) => [S.top, S.bottom])
9616
9616
  ),
9617
9617
  i
9618
- ), he(
9618
+ ), pe(
9619
9619
  U(
9620
9620
  w,
9621
9621
  ae((S) => S.items)
@@ -9680,7 +9680,7 @@ const hr = tt(
9680
9680
  ),
9681
9681
  0
9682
9682
  );
9683
- return he(ke(i), s), { totalListHeight: i, totalListHeightChanged: s };
9683
+ return pe(Te(i), s), { totalListHeight: i, totalListHeightChanged: s };
9684
9684
  },
9685
9685
  xt(Wt, hr),
9686
9686
  { singleton: !0 }
@@ -9715,7 +9715,7 @@ const hr = tt(
9715
9715
  { scrollToIndex: c }
9716
9716
  ]) => {
9717
9717
  const d = We();
9718
- return he(
9718
+ return pe(
9719
9719
  U(
9720
9720
  d,
9721
9721
  Fe(t, l, n, s, o, r, a),
@@ -9775,8 +9775,8 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9775
9775
  }
9776
9776
  it(
9777
9777
  U(
9778
- _t(U(ke(t), ar(1)), l),
9779
- Fe(ke(g), s, a, f),
9778
+ _t(U(Te(t), ar(1)), l),
9779
+ Fe(Te(g), s, a, f),
9780
9780
  ae(([[C, S], k, N, E, I]) => {
9781
9781
  let _ = S && E, D = "auto";
9782
9782
  return _ && (D = U0(k, N || I), _ = _ && !!D), { followOutputBehavior: D, shouldFollow: _, totalCount: C };
@@ -9799,7 +9799,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9799
9799
  }
9800
9800
  it(
9801
9801
  U(
9802
- _t(ke(g), t, c),
9802
+ _t(Te(g), t, c),
9803
9803
  Ie(([C, , S]) => C && S),
9804
9804
  Cn(
9805
9805
  ({ value: C }, [, S]) => ({ refreshed: C === S, value: S }),
@@ -9813,26 +9813,26 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9813
9813
  }
9814
9814
  ), it(x, () => {
9815
9815
  w(It(g) !== !1);
9816
- }), it(_t(ke(g), o), ([C, S]) => {
9816
+ }), it(_t(Te(g), o), ([C, S]) => {
9817
9817
  C && !S.atBottom && S.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && m("auto");
9818
9818
  });
9819
9819
  const b = X(null), T = We();
9820
- return he(
9820
+ return pe(
9821
9821
  Yi(
9822
9822
  U(
9823
- ke(r),
9823
+ Te(r),
9824
9824
  ae((C) => {
9825
9825
  var S;
9826
9826
  return (S = C == null ? void 0 : C.length) != null ? S : 0;
9827
9827
  })
9828
9828
  ),
9829
- U(ke(t))
9829
+ U(Te(t))
9830
9830
  ),
9831
9831
  T
9832
9832
  ), it(
9833
9833
  U(
9834
9834
  _t(U(T, ar(1)), l),
9835
- Fe(ke(b), a, f, p),
9835
+ Fe(Te(b), a, f, p),
9836
9836
  ae(([[C, S], k, N, E, I]) => S && N && (k == null ? void 0 : k({ context: I, totalCount: C, scrollingInProgress: E }))),
9837
9837
  Ie((C) => !!C),
9838
9838
  An(0)
@@ -9858,7 +9858,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9858
9858
  Ff
9859
9859
  )
9860
9860
  ), V0 = tt(
9861
- ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (he(
9861
+ ([{ data: e, firstItemIndex: t, gap: n, sizes: r }, { initialTopMostItemIndex: o }, { initialItemCount: s, listState: i }, { didMount: a }]) => (pe(
9862
9862
  U(
9863
9863
  a,
9864
9864
  Fe(s),
@@ -9903,7 +9903,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9903
9903
  ), $f = tt(
9904
9904
  ([{ scrollVelocity: e }]) => {
9905
9905
  const t = X(!1), n = We(), r = X(!1);
9906
- return he(
9906
+ return pe(
9907
9907
  U(
9908
9908
  e,
9909
9909
  Fe(r, t, n),
@@ -9931,7 +9931,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9931
9931
  { singleton: !0 }
9932
9932
  ), Ka = tt(([{ scrollContainerState: e, scrollTo: t }]) => {
9933
9933
  const n = We(), r = We(), o = We(), s = X(!1), i = X(void 0);
9934
- return he(
9934
+ return pe(
9935
9935
  U(
9936
9936
  _t(n, r),
9937
9937
  ae(([{ scrollHeight: a, scrollTop: l, viewportHeight: c }, { offsetTop: d }]) => ({
@@ -9941,7 +9941,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9941
9941
  }))
9942
9942
  ),
9943
9943
  e
9944
- ), he(
9944
+ ), pe(
9945
9945
  U(
9946
9946
  t,
9947
9947
  Fe(r),
@@ -9970,7 +9970,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9970
9970
  { useWindowScroll: i, windowScrollContainerState: a, windowViewportRect: l }
9971
9971
  ]) => {
9972
9972
  const c = We(), d = X(void 0), f = X(null), p = X(null);
9973
- return he(a, f), he(l, p), it(
9973
+ return pe(a, f), pe(l, p), it(
9974
9974
  U(
9975
9975
  c,
9976
9976
  Fe(t, r, i, f, p, n)
@@ -9979,7 +9979,7 @@ const U0 = (e, t) => typeof e == "function" ? Cc(e(t)) : t && Cc(e), W0 = tt(
9979
9979
  const T = A0(g.sizeTree);
9980
9980
  y && m !== null && w !== null && (x = m.scrollTop - w.offsetTop), x -= b, h({ ranges: T, scrollTop: x });
9981
9981
  }
9982
- ), he(U(d, Ie(Fa), ae(G0)), o), he(
9982
+ ), pe(U(d, Ie(Fa), ae(G0)), o), pe(
9983
9983
  U(
9984
9984
  s,
9985
9985
  Fe(d),
@@ -10000,7 +10000,7 @@ function G0(e) {
10000
10000
  }
10001
10001
  const Y0 = tt(([{ topItemsIndexes: e }]) => {
10002
10002
  const t = X(0);
10003
- return he(
10003
+ return pe(
10004
10004
  U(
10005
10005
  t,
10006
10006
  Ie((n) => n >= 0),
@@ -10053,7 +10053,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10053
10053
  An(1)
10054
10054
  ),
10055
10055
  y
10056
- ), he(
10056
+ ), pe(
10057
10057
  U(
10058
10058
  f,
10059
10059
  ae((m) => ({ top: -m }))
@@ -10157,7 +10157,7 @@ const X0 = zf(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
10157
10157
  { topItemCount: k },
10158
10158
  { groupCounts: N },
10159
10159
  E
10160
- ]) => (he(T.rangeChanged, E.scrollSeekRangeChanged), he(
10160
+ ]) => (pe(T.rangeChanged, E.scrollSeekRangeChanged), pe(
10161
10161
  U(
10162
10162
  E.windowViewportRect,
10163
10163
  ae((I) => I.visibleHeight)
@@ -10771,7 +10771,7 @@ const TS = /* @__PURE__ */ tt(
10771
10771
  Me(t, [0, 0]), Me(J, !0);
10772
10772
  });
10773
10773
  }
10774
- ), he(
10774
+ ), pe(
10775
10775
  U(
10776
10776
  B,
10777
10777
  Ie((P) => P != null && P.scrollTop > 0),
@@ -10789,19 +10789,19 @@ const TS = /* @__PURE__ */ tt(
10789
10789
  Me(L, !1);
10790
10790
  }), Me(l, { top: P.scrollTop })));
10791
10791
  }
10792
- ), he(
10792
+ ), pe(
10793
10793
  U(
10794
10794
  E,
10795
10795
  ae(({ height: P }) => P)
10796
10796
  ),
10797
10797
  f
10798
- ), he(
10798
+ ), pe(
10799
10799
  U(
10800
10800
  _t(
10801
- ke(E, Po),
10802
- ke(I, Po),
10803
- ke($, (P, H) => P && P.column === H.column && P.row === H.row),
10804
- ke(c)
10801
+ Te(E, Po),
10802
+ Te(I, Po),
10803
+ Te($, (P, H) => P && P.column === H.column && P.row === H.row),
10804
+ Te(c)
10805
10805
  ),
10806
10806
  ae(([P, H, Z, oe]) => ({
10807
10807
  gap: Z,
@@ -10811,19 +10811,19 @@ const TS = /* @__PURE__ */ tt(
10811
10811
  }))
10812
10812
  ),
10813
10813
  A
10814
- ), he(
10814
+ ), pe(
10815
10815
  U(
10816
10816
  _t(
10817
- ke(S),
10817
+ Te(S),
10818
10818
  r,
10819
- ke($, CS),
10820
- ke(I, Po),
10821
- ke(E, Po),
10822
- ke(j),
10823
- ke(k),
10824
- ke(L),
10825
- ke(J),
10826
- ke(M)
10819
+ Te($, CS),
10820
+ Te(I, Po),
10821
+ Te(E, Po),
10822
+ Te(j),
10823
+ Te(k),
10824
+ Te(L),
10825
+ Te(J),
10826
+ Te(M)
10827
10827
  ),
10828
10828
  Ie(([, , , , , , , P]) => !P),
10829
10829
  ae(
@@ -10855,14 +10855,14 @@ const TS = /* @__PURE__ */ tt(
10855
10855
  )
10856
10856
  ),
10857
10857
  N
10858
- ), he(
10858
+ ), pe(
10859
10859
  U(
10860
10860
  j,
10861
10861
  Ie((P) => P !== null),
10862
10862
  ae((P) => P.length)
10863
10863
  ),
10864
10864
  S
10865
- ), he(
10865
+ ), pe(
10866
10866
  U(
10867
10867
  _t(E, I, N, $),
10868
10868
  Ie(([P, H, { items: Z }]) => Z.length > 0 && H.height !== 0 && P.height !== 0),
@@ -10874,20 +10874,20 @@ const TS = /* @__PURE__ */ tt(
10874
10874
  ),
10875
10875
  t
10876
10876
  );
10877
- const Re = X(!1);
10878
- he(
10877
+ const ke = X(!1);
10878
+ pe(
10879
10879
  U(
10880
10880
  c,
10881
- Fe(Re),
10881
+ Fe(ke),
10882
10882
  ae(([P, H]) => H || P !== 0)
10883
10883
  ),
10884
- Re
10884
+ ke
10885
10885
  );
10886
10886
  const Ae = en(
10887
10887
  U(
10888
10888
  _t(N, S),
10889
10889
  Ie(([{ items: P }]) => P.length > 0),
10890
- Fe(Re),
10890
+ Fe(ke),
10891
10891
  Ie(([[P, H], Z]) => {
10892
10892
  const oe = P.items[P.items.length - 1].index === H - 1;
10893
10893
  return (Z || P.bottom > 0 && P.itemHeight > 0 && P.offsetBottom === 0 && P.items.length === H) && oe;
@@ -10897,14 +10897,14 @@ const TS = /* @__PURE__ */ tt(
10897
10897
  )
10898
10898
  ), G = en(
10899
10899
  U(
10900
- ke(N),
10900
+ Te(N),
10901
10901
  Ie(({ items: P }) => P.length > 0 && P[0].index === 0),
10902
10902
  wn(0),
10903
10903
  gt()
10904
10904
  )
10905
10905
  ), te = en(
10906
10906
  U(
10907
- ke(N),
10907
+ Te(N),
10908
10908
  Fe(L),
10909
10909
  Ie(([{ items: P }, H]) => P.length > 0 && !H),
10910
10910
  ae(([{ items: P }]) => ({
@@ -10915,7 +10915,7 @@ const TS = /* @__PURE__ */ tt(
10915
10915
  An(0)
10916
10916
  )
10917
10917
  );
10918
- he(te, h.scrollSeekRangeChanged), he(
10918
+ pe(te, h.scrollSeekRangeChanged), pe(
10919
10919
  U(
10920
10920
  _,
10921
10921
  Fe(E, I, S, $),
@@ -10936,7 +10936,7 @@ const TS = /* @__PURE__ */ tt(
10936
10936
  ),
10937
10937
  0
10938
10938
  );
10939
- return he(
10939
+ return pe(
10940
10940
  U(
10941
10941
  T,
10942
10942
  ae((P) => ({ height: P.visibleHeight, width: P.visibleWidth }))
@@ -11009,7 +11009,7 @@ const kS = /* @__PURE__ */ tt(() => {
11009
11009
  ),
11010
11010
  p
11011
11011
  ), c = X(!1), d = X(!1);
11012
- return he(ke(d), c), {
11012
+ return pe(Te(d), c), {
11013
11013
  components: t,
11014
11014
  computeItemKey: s,
11015
11015
  context: n,
@@ -12476,7 +12476,7 @@ class tl {
12476
12476
  }
12477
12477
  }
12478
12478
  }
12479
- const we = {
12479
+ const ve = {
12480
12480
  newline: /^(?: *(?:\n|$))+/,
12481
12481
  code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
12482
12482
  fences: /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
@@ -12493,37 +12493,37 @@ const we = {
12493
12493
  _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
12494
12494
  text: /^[^\n]+/
12495
12495
  };
12496
- we._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
12497
- we._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
12498
- we.def = ft(we.def).replace("label", we._label).replace("title", we._title).getRegex();
12499
- we.bullet = /(?:[*+-]|\d{1,9}[.)])/;
12500
- we.listItemStart = ft(/^( *)(bull) */).replace("bull", we.bullet).getRegex();
12501
- we.list = ft(we.list).replace(/bull/g, we.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + we.def.source + ")").getRegex();
12502
- we._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
12503
- we._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
12504
- we.html = ft(we.html, "i").replace("comment", we._comment).replace("tag", we._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
12505
- we.paragraph = ft(we._paragraph).replace("hr", we.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", we._tag).getRegex();
12506
- we.blockquote = ft(we.blockquote).replace("paragraph", we.paragraph).getRegex();
12507
- we.normal = { ...we };
12508
- we.gfm = {
12509
- ...we.normal,
12496
+ ve._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
12497
+ ve._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
12498
+ ve.def = ft(ve.def).replace("label", ve._label).replace("title", ve._title).getRegex();
12499
+ ve.bullet = /(?:[*+-]|\d{1,9}[.)])/;
12500
+ ve.listItemStart = ft(/^( *)(bull) */).replace("bull", ve.bullet).getRegex();
12501
+ ve.list = ft(ve.list).replace(/bull/g, ve.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + ve.def.source + ")").getRegex();
12502
+ ve._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
12503
+ ve._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
12504
+ ve.html = ft(ve.html, "i").replace("comment", ve._comment).replace("tag", ve._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
12505
+ ve.paragraph = ft(ve._paragraph).replace("hr", ve.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ve._tag).getRegex();
12506
+ ve.blockquote = ft(ve.blockquote).replace("paragraph", ve.paragraph).getRegex();
12507
+ ve.normal = { ...ve };
12508
+ ve.gfm = {
12509
+ ...ve.normal,
12510
12510
  table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
12511
12511
  // Cells
12512
12512
  };
12513
- we.gfm.table = ft(we.gfm.table).replace("hr", we.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", we._tag).getRegex();
12514
- we.gfm.paragraph = ft(we._paragraph).replace("hr", we.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", we.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", we._tag).getRegex();
12515
- we.pedantic = {
12516
- ...we.normal,
12513
+ ve.gfm.table = ft(ve.gfm.table).replace("hr", ve.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ve._tag).getRegex();
12514
+ ve.gfm.paragraph = ft(ve._paragraph).replace("hr", ve.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", ve.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ve._tag).getRegex();
12515
+ ve.pedantic = {
12516
+ ...ve.normal,
12517
12517
  html: ft(
12518
12518
  `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
12519
- ).replace("comment", we._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
12519
+ ).replace("comment", ve._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
12520
12520
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
12521
12521
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
12522
12522
  fences: us,
12523
12523
  // fences not supported
12524
12524
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
12525
- paragraph: ft(we.normal._paragraph).replace("hr", we.hr).replace("heading", ` *#{1,6} *[^
12526
- ]`).replace("lheading", we.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
12525
+ paragraph: ft(ve.normal._paragraph).replace("hr", ve.hr).replace("heading", ` *#{1,6} *[^
12526
+ ]`).replace("lheading", ve.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
12527
12527
  };
12528
12528
  const le = {
12529
12529
  escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
@@ -12553,7 +12553,7 @@ le._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
12553
12553
  le.punctuation = ft(le.punctuation).replace(/punctuation/g, le._punctuation).getRegex();
12554
12554
  le.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
12555
12555
  le.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
12556
- le._comment = ft(we._comment).replace("(?:-->|$)", "-->").getRegex();
12556
+ le._comment = ft(ve._comment).replace("(?:-->|$)", "-->").getRegex();
12557
12557
  le.emStrong.lDelim = ft(le.emStrong.lDelim).replace(/punct/g, le._punctuation).getRegex();
12558
12558
  le.emStrong.rDelimAst = ft(le.emStrong.rDelimAst, "g").replace(/punct/g, le._punctuation).getRegex();
12559
12559
  le.emStrong.rDelimUnd = ft(le.emStrong.rDelimUnd, "g").replace(/punct/g, le._punctuation).getRegex();
@@ -12567,8 +12567,8 @@ le._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
12567
12567
  le._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
12568
12568
  le._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
12569
12569
  le.link = ft(le.link).replace("label", le._label).replace("href", le._href).replace("title", le._title).getRegex();
12570
- le.reflink = ft(le.reflink).replace("label", le._label).replace("ref", we._label).getRegex();
12571
- le.nolink = ft(le.nolink).replace("ref", we._label).getRegex();
12570
+ le.reflink = ft(le.reflink).replace("label", le._label).replace("ref", ve._label).getRegex();
12571
+ le.nolink = ft(le.nolink).replace("ref", ve._label).getRegex();
12572
12572
  le.reflinkSearch = ft(le.reflinkSearch, "g").replace("reflink", le.reflink).replace("nolink", le.nolink).getRegex();
12573
12573
  le.normal = { ...le };
12574
12574
  le.pedantic = {
@@ -12621,17 +12621,17 @@ class Wn {
12621
12621
  top: !0
12622
12622
  };
12623
12623
  const n = {
12624
- block: we.normal,
12624
+ block: ve.normal,
12625
12625
  inline: le.normal
12626
12626
  };
12627
- this.options.pedantic ? (n.block = we.pedantic, n.inline = le.pedantic) : this.options.gfm && (n.block = we.gfm, this.options.breaks ? n.inline = le.breaks : n.inline = le.gfm), this.tokenizer.rules = n;
12627
+ this.options.pedantic ? (n.block = ve.pedantic, n.inline = le.pedantic) : this.options.gfm && (n.block = ve.gfm, this.options.breaks ? n.inline = le.breaks : n.inline = le.gfm), this.tokenizer.rules = n;
12628
12628
  }
12629
12629
  /**
12630
12630
  * Expose Rules
12631
12631
  */
12632
12632
  static get rules() {
12633
12633
  return {
12634
- block: we,
12634
+ block: ve,
12635
12635
  inline: le
12636
12636
  };
12637
12637
  }
@@ -13267,7 +13267,7 @@ function _p(e, t) {
13267
13267
  return (n, r, o) => {
13268
13268
  typeof r == "function" && (o = r, r = null);
13269
13269
  const s = { ...r };
13270
- r = { ...me.defaults, ...s };
13270
+ r = { ...he.defaults, ...s };
13271
13271
  const i = bC(r.silent, r.async, o);
13272
13272
  if (typeof n > "u" || n === null)
13273
13273
  return i(new Error("marked(): input parameter is undefined or null"));
@@ -13285,7 +13285,7 @@ function _p(e, t) {
13285
13285
  let p;
13286
13286
  if (!f)
13287
13287
  try {
13288
- r.walkTokens && me.walkTokens(l, r.walkTokens), p = t(l, r), r.hooks && (p = r.hooks.postprocess(p));
13288
+ r.walkTokens && he.walkTokens(l, r.walkTokens), p = t(l, r), r.hooks && (p = r.hooks.postprocess(p));
13289
13289
  } catch (h) {
13290
13290
  f = h;
13291
13291
  }
@@ -13293,7 +13293,7 @@ function _p(e, t) {
13293
13293
  };
13294
13294
  if (!a || a.length < 3 || (delete r.highlight, !l.length)) return c();
13295
13295
  let d = 0;
13296
- me.walkTokens(l, function(f) {
13296
+ he.walkTokens(l, function(f) {
13297
13297
  f.type === "code" && (d++, setTimeout(() => {
13298
13298
  a(f.text, f.lang, function(p, h) {
13299
13299
  if (p)
@@ -13305,11 +13305,11 @@ function _p(e, t) {
13305
13305
  return;
13306
13306
  }
13307
13307
  if (r.async)
13308
- return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => e(a, r)).then((a) => r.walkTokens ? Promise.all(me.walkTokens(a, r.walkTokens)).then(() => a) : a).then((a) => t(a, r)).then((a) => r.hooks ? r.hooks.postprocess(a) : a).catch(i);
13308
+ return Promise.resolve(r.hooks ? r.hooks.preprocess(n) : n).then((a) => e(a, r)).then((a) => r.walkTokens ? Promise.all(he.walkTokens(a, r.walkTokens)).then(() => a) : a).then((a) => t(a, r)).then((a) => r.hooks ? r.hooks.postprocess(a) : a).catch(i);
13309
13309
  try {
13310
13310
  r.hooks && (n = r.hooks.preprocess(n));
13311
13311
  const a = e(n, r);
13312
- r.walkTokens && me.walkTokens(a, r.walkTokens);
13312
+ r.walkTokens && he.walkTokens(a, r.walkTokens);
13313
13313
  let l = t(a, r);
13314
13314
  return r.hooks && (l = r.hooks.postprocess(l)), l;
13315
13315
  } catch (a) {
@@ -13317,19 +13317,19 @@ function _p(e, t) {
13317
13317
  }
13318
13318
  };
13319
13319
  }
13320
- function me(e, t, n) {
13320
+ function he(e, t, n) {
13321
13321
  return _p(Wn.lex, Vn.parse)(e, t, n);
13322
13322
  }
13323
- me.options = me.setOptions = function(e) {
13324
- return me.defaults = { ...me.defaults, ...e }, sC(me.defaults), me;
13323
+ he.options = he.setOptions = function(e) {
13324
+ return he.defaults = { ...he.defaults, ...e }, sC(he.defaults), he;
13325
13325
  };
13326
- me.getDefaults = Rp;
13327
- me.defaults = mr;
13328
- me.use = function(...e) {
13329
- const t = me.defaults.extensions || { renderers: {}, childTokens: {} };
13326
+ he.getDefaults = Rp;
13327
+ he.defaults = mr;
13328
+ he.use = function(...e) {
13329
+ const t = he.defaults.extensions || { renderers: {}, childTokens: {} };
13330
13330
  e.forEach((n) => {
13331
13331
  const r = { ...n };
13332
- if (r.async = me.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((o) => {
13332
+ if (r.async = he.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((o) => {
13333
13333
  if (!o.name)
13334
13334
  throw new Error("extension name required");
13335
13335
  if (o.renderer) {
@@ -13346,7 +13346,7 @@ me.use = function(...e) {
13346
13346
  }
13347
13347
  o.childTokens && (t.childTokens[o.name] = o.childTokens);
13348
13348
  }), r.extensions = t), n.renderer) {
13349
- const o = me.defaults.renderer || new nl();
13349
+ const o = he.defaults.renderer || new nl();
13350
13350
  for (const s in n.renderer) {
13351
13351
  const i = o[s];
13352
13352
  o[s] = (...a) => {
@@ -13357,7 +13357,7 @@ me.use = function(...e) {
13357
13357
  r.renderer = o;
13358
13358
  }
13359
13359
  if (n.tokenizer) {
13360
- const o = me.defaults.tokenizer || new tl();
13360
+ const o = he.defaults.tokenizer || new tl();
13361
13361
  for (const s in n.tokenizer) {
13362
13362
  const i = o[s];
13363
13363
  o[s] = (...a) => {
@@ -13368,11 +13368,11 @@ me.use = function(...e) {
13368
13368
  r.tokenizer = o;
13369
13369
  }
13370
13370
  if (n.hooks) {
13371
- const o = me.defaults.hooks || new ds();
13371
+ const o = he.defaults.hooks || new ds();
13372
13372
  for (const s in n.hooks) {
13373
13373
  const i = o[s];
13374
13374
  ds.passThroughHooks.has(s) ? o[s] = (a) => {
13375
- if (me.defaults.async)
13375
+ if (he.defaults.async)
13376
13376
  return Promise.resolve(n.hooks[s].call(o, a)).then((c) => i.call(o, c));
13377
13377
  const l = n.hooks[s].call(o, a);
13378
13378
  return i.call(o, l);
@@ -13384,54 +13384,54 @@ me.use = function(...e) {
13384
13384
  r.hooks = o;
13385
13385
  }
13386
13386
  if (n.walkTokens) {
13387
- const o = me.defaults.walkTokens;
13387
+ const o = he.defaults.walkTokens;
13388
13388
  r.walkTokens = function(s) {
13389
13389
  let i = [];
13390
13390
  return i.push(n.walkTokens.call(this, s)), o && (i = i.concat(o.call(this, s))), i;
13391
13391
  };
13392
13392
  }
13393
- me.setOptions(r);
13393
+ he.setOptions(r);
13394
13394
  });
13395
13395
  };
13396
- me.walkTokens = function(e, t) {
13396
+ he.walkTokens = function(e, t) {
13397
13397
  let n = [];
13398
13398
  for (const r of e)
13399
- switch (n = n.concat(t.call(me, r)), r.type) {
13399
+ switch (n = n.concat(t.call(he, r)), r.type) {
13400
13400
  case "table": {
13401
13401
  for (const o of r.header)
13402
- n = n.concat(me.walkTokens(o.tokens, t));
13402
+ n = n.concat(he.walkTokens(o.tokens, t));
13403
13403
  for (const o of r.rows)
13404
13404
  for (const s of o)
13405
- n = n.concat(me.walkTokens(s.tokens, t));
13405
+ n = n.concat(he.walkTokens(s.tokens, t));
13406
13406
  break;
13407
13407
  }
13408
13408
  case "list": {
13409
- n = n.concat(me.walkTokens(r.items, t));
13409
+ n = n.concat(he.walkTokens(r.items, t));
13410
13410
  break;
13411
13411
  }
13412
13412
  default:
13413
- me.defaults.extensions && me.defaults.extensions.childTokens && me.defaults.extensions.childTokens[r.type] ? me.defaults.extensions.childTokens[r.type].forEach(function(o) {
13414
- n = n.concat(me.walkTokens(r[o], t));
13415
- }) : r.tokens && (n = n.concat(me.walkTokens(r.tokens, t)));
13413
+ he.defaults.extensions && he.defaults.extensions.childTokens && he.defaults.extensions.childTokens[r.type] ? he.defaults.extensions.childTokens[r.type].forEach(function(o) {
13414
+ n = n.concat(he.walkTokens(r[o], t));
13415
+ }) : r.tokens && (n = n.concat(he.walkTokens(r.tokens, t)));
13416
13416
  }
13417
13417
  return n;
13418
13418
  };
13419
- me.parseInline = _p(Wn.lexInline, Vn.parseInline);
13420
- me.Parser = Vn;
13421
- me.parser = Vn.parse;
13422
- me.Renderer = nl;
13423
- me.TextRenderer = Ap;
13424
- me.Lexer = Wn;
13425
- me.lexer = Wn.lex;
13426
- me.Tokenizer = tl;
13427
- me.Slugger = jp;
13428
- me.Hooks = ds;
13429
- me.parse = me;
13430
- me.options;
13431
- me.setOptions;
13432
- me.use;
13433
- me.walkTokens;
13434
- me.parseInline;
13419
+ he.parseInline = _p(Wn.lexInline, Vn.parseInline);
13420
+ he.Parser = Vn;
13421
+ he.parser = Vn.parse;
13422
+ he.Renderer = nl;
13423
+ he.TextRenderer = Ap;
13424
+ he.Lexer = Wn;
13425
+ he.lexer = Wn.lex;
13426
+ he.Tokenizer = tl;
13427
+ he.Slugger = jp;
13428
+ he.Hooks = ds;
13429
+ he.parse = he;
13430
+ he.options;
13431
+ he.setOptions;
13432
+ he.use;
13433
+ he.walkTokens;
13434
+ he.parseInline;
13435
13435
  Vn.parse;
13436
13436
  Wn.lex;
13437
13437
  function fs({
@@ -13444,9 +13444,9 @@ function fs({
13444
13444
  try {
13445
13445
  if (!n) {
13446
13446
  const i = e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, "").replace(/javascript:/gi, "").replace(/on\w+\s*=/gi, "");
13447
- return typeof me.parse == "function" ? me.parse(i) : me(i);
13447
+ return typeof he.parse == "function" ? he.parse(i) : he(i);
13448
13448
  }
13449
- return typeof me.parse == "function" ? me.parse(e) : me(e);
13449
+ return typeof he.parse == "function" ? he.parse(e) : he(e);
13450
13450
  } catch (i) {
13451
13451
  return console.error("[MarkdownContent] parse error", i), `<pre class="font-mono text-xs bg-background/50 rounded border p-2 whitespace-pre-wrap break-words">Error rendering markdown: ${String(i)}</pre>`;
13452
13452
  }
@@ -13595,13 +13595,13 @@ const Bc = z.memo(function({
13595
13595
  defaultCheckpointId: N = null,
13596
13596
  messageParentCheckpointId: E = null
13597
13597
  }) {
13598
- const [I, _] = ge(!1), [D, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), L = l === "phone" || l === "half-screen", M = t.role, J = M === "tool", Y = lt(() => "type" in t && t.type === "default_message" ? t : null, [t]), de = !!Y, Re = !(r && M !== "user"), {
13598
+ const [I, _] = ge(!1), [D, F] = ge("preview"), [j, $] = ge(!1), { currentThreadId: A } = xa(), { respondToInterrupt: B } = ya(), L = l === "phone" || l === "half-screen", M = t.role, J = M === "tool", Y = lt(() => "type" in t && t.type === "default_message" ? t : null, [t]), de = !!Y, ke = !(r && M !== "user"), {
13599
13599
  uploadingFiles: Ae,
13600
13600
  handleFileClick: G,
13601
13601
  fileViewerOpen: te,
13602
13602
  currentFileInfo: q,
13603
13603
  closeFileViewer: P
13604
- } = IC({ allowFileOpen: Re, currentThreadId: A }), H = z.useMemo(() => {
13604
+ } = IC({ allowFileOpen: ke, currentThreadId: A }), H = z.useMemo(() => {
13605
13605
  switch (M) {
13606
13606
  case "user":
13607
13607
  return "text-[hsl(var(--chat-bubble-user-text))]";
@@ -13625,7 +13625,7 @@ const Bc = z.memo(function({
13625
13625
  [Y, t]
13626
13626
  ), ue = (m == null ? void 0 : m.id) ?? (m == null ? void 0 : m.interrupt_id), xe = Mo(ue), Ne = m == null ? void 0 : m.value, Ke = lt(() => Y ? "" : TC(t.content), [Y, t]), Je = z.useCallback(async () => {
13627
13627
  const W = J ? Ke : Z;
13628
- async function Se(ye) {
13628
+ async function be(ye) {
13629
13629
  if (navigator.clipboard && typeof navigator.clipboard.writeText == "function") {
13630
13630
  await navigator.clipboard.writeText(ye);
13631
13631
  return;
@@ -13642,30 +13642,30 @@ const Bc = z.memo(function({
13642
13642
  throw new Error("Clipboard API not supported in this context.");
13643
13643
  }
13644
13644
  try {
13645
- await Se(W), _(!0), setTimeout(() => _(!1), 2e3), y == null || y(W);
13645
+ await be(W), _(!0), setTimeout(() => _(!1), 2e3), y == null || y(W);
13646
13646
  } catch (ye) {
13647
13647
  console.error("Failed to copy:", ye);
13648
13648
  }
13649
13649
  }, [J, Ke, Z, y]), Be = z.useCallback(() => {
13650
13650
  if (!h) return;
13651
- const W = J ? Ke : Z, Se = "type" in t && t.type === "default_message" ? void 0 : {
13651
+ const W = J ? Ke : Z, be = "type" in t && t.type === "default_message" ? void 0 : {
13652
13652
  checkpointId: t.checkpointId ?? null,
13653
13653
  checkpointNs: t.checkpointNs ?? null
13654
13654
  };
13655
- h(t.id, W, Se);
13655
+ h(t.id, W, be);
13656
13656
  }, [h, t.id, J, Ke, Z, t]), $e = z.useCallback(() => {
13657
13657
  g == null || g(n);
13658
13658
  }, [g, n]), qe = z.useCallback(() => {
13659
- const Se = Q(L ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
13659
+ const be = Q(L ? "h-3 w-3" : "h-4 w-4", "opacity-60 flex-shrink-0", H);
13660
13660
  switch (M) {
13661
13661
  case "user":
13662
- return /* @__PURE__ */ u.jsx(gm, { className: Se });
13662
+ return /* @__PURE__ */ u.jsx(gm, { className: be });
13663
13663
  case "assistant":
13664
- return /* @__PURE__ */ u.jsx(si, { className: Se });
13664
+ return /* @__PURE__ */ u.jsx(si, { className: be });
13665
13665
  case "tool":
13666
- return /* @__PURE__ */ u.jsx(mm, { className: Se });
13666
+ return /* @__PURE__ */ u.jsx(mm, { className: be });
13667
13667
  default:
13668
- return /* @__PURE__ */ u.jsx(si, { className: Se });
13668
+ return /* @__PURE__ */ u.jsx(si, { className: be });
13669
13669
  }
13670
13670
  }, [L, H, M]), Ze = z.useCallback(() => {
13671
13671
  const W = "group relative mb-4 flex w-full";
@@ -13736,15 +13736,15 @@ const Bc = z.memo(function({
13736
13736
  const rt = z.useCallback(async (W) => {
13737
13737
  if (w)
13738
13738
  return;
13739
- const Se = Mo(
13739
+ const be = Mo(
13740
13740
  (W == null ? void 0 : W.id) ?? (W == null ? void 0 : W.interrupt_id)
13741
13741
  );
13742
- if (!Se) {
13742
+ if (!be) {
13743
13743
  console.warn("Interrupt part missing id", W);
13744
13744
  return;
13745
13745
  }
13746
13746
  try {
13747
- b == null || b(), await B(Se, !0);
13747
+ b == null || b(), await B(be, !0);
13748
13748
  } catch (ye) {
13749
13749
  console.error("Failed to approve interrupt:", ye);
13750
13750
  } finally {
@@ -13753,24 +13753,24 @@ const Bc = z.memo(function({
13753
13753
  }, [w, T, b, B]), Ct = z.useCallback(async (W) => {
13754
13754
  if (w)
13755
13755
  return;
13756
- const Se = Mo(
13756
+ const be = Mo(
13757
13757
  (W == null ? void 0 : W.id) ?? (W == null ? void 0 : W.interrupt_id)
13758
13758
  );
13759
- if (!Se) {
13759
+ if (!be) {
13760
13760
  console.warn("Interrupt part missing id", W);
13761
13761
  return;
13762
13762
  }
13763
13763
  try {
13764
- b == null || b(), await B(Se, !1);
13764
+ b == null || b(), await B(be, !1);
13765
13765
  } catch (ye) {
13766
13766
  console.error("Failed to reject interrupt:", ye);
13767
13767
  } finally {
13768
13768
  T == null || T();
13769
13769
  }
13770
- }, [w, T, b, B]), pt = z.useCallback(({ part: W, i: Se }) => {
13770
+ }, [w, T, b, B]), pt = z.useCallback(({ part: W, i: be }) => {
13771
13771
  if (W.type === "text") {
13772
13772
  const ye = W.text ?? "", ht = ye.trim(), mt = Ja(ht);
13773
- return mt && M !== "tool" ? /* @__PURE__ */ u.jsx(Op, { data: mt }, Se) : M === "user" && c && ht.length > d ? /* @__PURE__ */ u.jsx(
13773
+ return mt && M !== "tool" ? /* @__PURE__ */ u.jsx(Op, { data: mt }, be) : M === "user" && c && ht.length > d ? /* @__PURE__ */ u.jsx(
13774
13774
  NC,
13775
13775
  {
13776
13776
  text: ht,
@@ -13779,8 +13779,8 @@ const Bc = z.memo(function({
13779
13779
  previewLength: d,
13780
13780
  isCompact: L
13781
13781
  },
13782
- Se
13783
- ) : /* @__PURE__ */ u.jsx(fs, { content: ye, allowHtml: !1 }, Se);
13782
+ be
13783
+ ) : /* @__PURE__ */ u.jsx(fs, { content: ye, allowHtml: !1 }, be);
13784
13784
  }
13785
13785
  if (W.type === "image_url") {
13786
13786
  const ye = W;
@@ -13792,7 +13792,7 @@ const Bc = z.memo(function({
13792
13792
  loading: "lazy",
13793
13793
  className: "border rounded max-h-[420px] w-auto object-contain"
13794
13794
  }
13795
- ) }, Se);
13795
+ ) }, be);
13796
13796
  }
13797
13797
  if (W.type === "file") {
13798
13798
  const ye = W, ht = ye.name || "file";
@@ -13800,18 +13800,18 @@ const Bc = z.memo(function({
13800
13800
  "a",
13801
13801
  {
13802
13802
  href: ye.url,
13803
- onClick: (mt) => G(mt, ye, Se),
13803
+ onClick: (mt) => G(mt, ye, be),
13804
13804
  className: `inline-flex items-center gap-2 rounded px-2 py-1 text-xs bg-gray-100 border hover:bg-gray-200
13805
13805
  dark:bg-background/10 dark:border-border/30 dark:hover:bg-background/20`,
13806
13806
  children: [
13807
- Ae[Se] ? /* @__PURE__ */ u.jsx(ua, { className: "h-4 w-4 animate-spin" }) : null,
13807
+ Ae[be] ? /* @__PURE__ */ u.jsx(ua, { className: "h-4 w-4 animate-spin" }) : null,
13808
13808
  /* @__PURE__ */ u.jsxs("span", { className: "truncate max-w-[180px]", children: [
13809
13809
  ht,
13810
- Ae[Se] ? " (processing)" : ""
13810
+ Ae[be] ? " (processing)" : ""
13811
13811
  ] })
13812
13812
  ]
13813
13813
  },
13814
- Se
13814
+ be
13815
13815
  );
13816
13816
  }
13817
13817
  if (W.type === "interrupt") {
@@ -13828,7 +13828,7 @@ const Bc = z.memo(function({
13828
13828
  isActive: mt,
13829
13829
  payload: Rt
13830
13830
  },
13831
- Se
13831
+ be
13832
13832
  );
13833
13833
  }
13834
13834
  return null;
@@ -13866,7 +13866,7 @@ const Bc = z.memo(function({
13866
13866
  t.id
13867
13867
  );
13868
13868
  if (!J && !Y) {
13869
- const Se = t, ye = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: Se.content.map((ht, mt) => /* @__PURE__ */ u.jsx(pt, { part: ht, i: mt }, mt)) });
13869
+ const be = t, ye = /* @__PURE__ */ u.jsx("div", { className: "space-y-2", children: be.content.map((ht, mt) => /* @__PURE__ */ u.jsx(pt, { part: ht, i: mt }, mt)) });
13870
13870
  return r ? /* @__PURE__ */ u.jsxs("div", { "aria-busy": "true", role: "status", children: [
13871
13871
  ye,
13872
13872
  /* @__PURE__ */ u.jsx(RC, { className: H })
@@ -13884,18 +13884,18 @@ const Bc = z.memo(function({
13884
13884
  H
13885
13885
  ]), wt = lt(() => Y ? "Assistant" : kC(t), [Y, t]), Xe = z.useMemo(() => Y ? [] : Array.isArray(C) ? C : [], [C, Y]), fe = z.useMemo(() => {
13886
13886
  var W;
13887
- return Xe.length ? N && Xe.some((Se) => Se.id === N) ? N : ((W = Xe[0]) == null ? void 0 : W.id) ?? null : null;
13888
- }, [N, Xe]), Le = z.useMemo(() => !Xe.length || !S ? null : Xe.some((W) => W.id === S) ? S : null, [S, Xe]) ?? fe, He = M === "user" && Xe.length > 0 && typeof k == "function", pe = z.useCallback(
13887
+ return Xe.length ? N && Xe.some((be) => be.id === N) ? N : ((W = Xe[0]) == null ? void 0 : W.id) ?? null : null;
13888
+ }, [N, Xe]), Le = z.useMemo(() => !Xe.length || !S ? null : Xe.some((W) => W.id === S) ? S : null, [S, Xe]) ?? fe, Ue = M === "user" && Xe.length > 0 && typeof k == "function", me = z.useCallback(
13889
13889
  (W) => {
13890
13890
  if (!k) return;
13891
- const Se = (W == null ? void 0 : W.id) ?? null, ye = (W == null ? void 0 : W.parentId) ?? E ?? null;
13892
- k(Se, ye);
13891
+ const be = (W == null ? void 0 : W.id) ?? null, ye = (W == null ? void 0 : W.parentId) ?? E ?? null;
13892
+ k(be, ye);
13893
13893
  },
13894
13894
  [E, k]
13895
- ), be = z.useMemo(() => Le ? Xe.findIndex((W) => W.id === Le) : -1, [Le, Xe]), bt = z.useMemo(() => be < 0 ? null : Xe[be] ?? null, [be, Xe]), kt = z.useCallback((W) => {
13896
- const Se = [];
13897
- if (W.step !== null && Se.push(`Step ${W.step}`), W.source && Se.push(W.source), !W.createdAt)
13898
- return Se.length ? Se.join(" • ") : W.id.slice(0, 8);
13895
+ ), Re = z.useMemo(() => Le ? Xe.findIndex((W) => W.id === Le) : -1, [Le, Xe]), bt = z.useMemo(() => Re < 0 ? null : Xe[Re] ?? null, [Re, Xe]), kt = z.useCallback((W) => {
13896
+ const be = [];
13897
+ if (W.step !== null && be.push(`Step ${W.step}`), W.source && be.push(W.source), !W.createdAt)
13898
+ return be.length ? be.join(" • ") : W.id.slice(0, 8);
13899
13899
  let ye = "";
13900
13900
  try {
13901
13901
  const ht = new Date(W.createdAt);
@@ -13938,7 +13938,7 @@ const Bc = z.memo(function({
13938
13938
  "aria-expanded": D === "expanded",
13939
13939
  onClick: () => F((W) => W === "expanded" ? "preview" : "expanded"),
13940
13940
  onKeyDown: (W) => {
13941
- (W.key === "Enter" || W.key === " ") && (W.preventDefault(), F((Se) => Se === "expanded" ? "preview" : "expanded"));
13941
+ (W.key === "Enter" || W.key === " ") && (W.preventDefault(), F((be) => be === "expanded" ? "preview" : "expanded"));
13942
13942
  },
13943
13943
  children: [
13944
13944
  /* @__PURE__ */ u.jsx("span", { children: oe.name ?? "Tool Output" }),
@@ -13949,28 +13949,28 @@ const Bc = z.memo(function({
13949
13949
  )
13950
13950
  ] }),
13951
13951
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13952
- He && bt && be >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
13952
+ Ue && bt && Re >= 0 && /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2 text-xs", children: [
13953
13953
  /* @__PURE__ */ u.jsx(
13954
13954
  "button",
13955
13955
  {
13956
13956
  type: "button",
13957
13957
  className: Q(
13958
13958
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
13959
- be > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13959
+ Re > 0 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13960
13960
  ),
13961
13961
  onClick: () => {
13962
- if (be <= 0) return;
13963
- const W = Xe[be - 1];
13964
- W && pe(W);
13962
+ if (Re <= 0) return;
13963
+ const W = Xe[Re - 1];
13964
+ W && me(W);
13965
13965
  },
13966
13966
  "aria-label": "Previous checkpoint",
13967
- disabled: be <= 0,
13967
+ disabled: Re <= 0,
13968
13968
  children: /* @__PURE__ */ u.jsx(xm, { className: "h-3 w-3" })
13969
13969
  }
13970
13970
  ),
13971
13971
  /* @__PURE__ */ u.jsxs("div", { className: "flex items-center gap-2", children: [
13972
13972
  /* @__PURE__ */ u.jsxs("span", { className: "whitespace-nowrap", children: [
13973
- be + 1,
13973
+ Re + 1,
13974
13974
  " / ",
13975
13975
  Xe.length
13976
13976
  ] }),
@@ -13982,15 +13982,15 @@ const Bc = z.memo(function({
13982
13982
  type: "button",
13983
13983
  className: Q(
13984
13984
  "flex items-center justify-center rounded border px-1.5 py-1 transition-colors",
13985
- be < Xe.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13985
+ Re < Xe.length - 1 ? "border-border text-foreground hover:bg-muted/60" : "border-border text-muted-foreground cursor-not-allowed"
13986
13986
  ),
13987
13987
  onClick: () => {
13988
- if (be >= Xe.length - 1) return;
13989
- const W = Xe[be + 1];
13990
- W && pe(W);
13988
+ if (Re >= Xe.length - 1) return;
13989
+ const W = Xe[Re + 1];
13990
+ W && me(W);
13991
13991
  },
13992
13992
  "aria-label": "Next checkpoint",
13993
- disabled: be >= Xe.length - 1,
13993
+ disabled: Re >= Xe.length - 1,
13994
13994
  children: /* @__PURE__ */ u.jsx(Xc, { className: "h-3 w-3" })
13995
13995
  }
13996
13996
  )
@@ -14422,7 +14422,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14422
14422
  ee.has(Je) || (ee.add(Je), ue.push(Ke));
14423
14423
  }
14424
14424
  return ue.reverse();
14425
- }, [Y]), Re = Ee((ee) => {
14425
+ }, [Y]), ke = Ee((ee) => {
14426
14426
  B(ee), y && y(!ee), m && m(ee);
14427
14427
  }, [y, m]), Ae = lt(() => {
14428
14428
  if (a)
@@ -14558,7 +14558,7 @@ const Hc = (e, t) => (e == null ? void 0 : e.id) ?? `message-${t}`, jC = (e) =>
14558
14558
  startReached: () => {
14559
14559
  Ae && Ae();
14560
14560
  },
14561
- atBottomStateChange: Re,
14561
+ atBottomStateChange: ke,
14562
14562
  style: { height: "100%", overscrollBehavior: "contain" },
14563
14563
  computeItemKey: (ee, ue) => Hc(ue, ee),
14564
14564
  itemContent: (ee, ue) => {
@@ -14658,7 +14658,7 @@ function Ai({
14658
14658
  checkpoints: I,
14659
14659
  interrupt: _,
14660
14660
  metadata: D
14661
- } = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), L = m ?? y ?? null, M = (E == null ? void 0 : E.id) ?? null, J = (E == null ? void 0 : E.namespace) ?? null, Y = (D == null ? void 0 : D.assemblingMessageId) ?? null, de = _, [Re, Ae] = ge(!1);
14661
+ } = ya(), { isStreaming: F, error: j, connectionState: $, submit: A, stop: B } = Jx(), L = m ?? y ?? null, M = (E == null ? void 0 : E.id) ?? null, J = (E == null ? void 0 : E.namespace) ?? null, Y = (D == null ? void 0 : D.assemblingMessageId) ?? null, de = _, [ke, Ae] = ge(!1);
14662
14662
  Nt(() => {
14663
14663
  de || Ae(!1);
14664
14664
  }, [de]);
@@ -14666,17 +14666,17 @@ function Ai({
14666
14666
  Ae(!0);
14667
14667
  }, []), te = Ee(() => {
14668
14668
  Ae(!1);
14669
- }, []), q = !!de || Re, [P, H] = ge(null), [Z, oe] = ge(""), [ne, De] = ge(null), [ee, ue] = ge(null), [xe, Ne] = ge([]), [Ke, Je] = ge(0), [Be, $e] = ge(0), [qe, Ze] = ge(!1), [Qe, rt] = ge(null), [Ct, pt] = ge(null), [ot, Tt] = ge(!1), [wt, Xe] = ge(null), [fe, ve] = ge(!1), Le = et(!1), [He, pe] = ge(() => Uc.value), be = et(He), bt = et(null), kt = Ee((K) => {
14670
- Uc.value = K, pe(K);
14671
- }, []), [W, Se] = ge(!1), ye = et(null), ht = Ee((K) => {
14669
+ }, []), q = !!de || ke, [P, H] = ge(null), [Z, oe] = ge(""), [ne, De] = ge(null), [ee, ue] = ge(null), [xe, Ne] = ge([]), [Ke, Je] = ge(0), [Be, $e] = ge(0), [qe, Ze] = ge(!1), [Qe, rt] = ge(null), [Ct, pt] = ge(null), [ot, Tt] = ge(!1), [wt, Xe] = ge(null), [fe, we] = ge(!1), Le = et(!1), [Ue, me] = ge(() => Uc.value), Re = et(Ue), bt = et(null), kt = Ee((K) => {
14670
+ Uc.value = K, me(K);
14671
+ }, []), [W, be] = ge(!1), ye = et(null), ht = Ee((K) => {
14672
14672
  if (!Array.isArray(K))
14673
14673
  return { text: null, messageId: null };
14674
14674
  for (let re = K.length - 1; re >= 0; re--) {
14675
14675
  const ie = K[re];
14676
14676
  if (!ie || ie.role !== "user") continue;
14677
- const Te = (ie.content ?? []).filter((Ye) => (Ye == null ? void 0 : Ye.type) === "text").map((Ye) => Ye.text).filter((Ye) => typeof Ye == "string" && Ye.trim().length > 0);
14677
+ const Ce = (ie.content ?? []).filter((Ye) => (Ye == null ? void 0 : Ye.type) === "text").map((Ye) => Ye.text).filter((Ye) => typeof Ye == "string" && Ye.trim().length > 0);
14678
14678
  return {
14679
- text: Te.length ? Te.join(" ").trim() : null,
14679
+ text: Ce.length ? Ce.join(" ").trim() : null,
14680
14680
  messageId: ie.id ?? null
14681
14681
  };
14682
14682
  }
@@ -14696,10 +14696,10 @@ function Ai({
14696
14696
  },
14697
14697
  []
14698
14698
  ), Pe = lt(() => {
14699
- const K = (Te) => {
14700
- if (!Array.isArray(Te) || Te.length === 0)
14699
+ const K = (Ce) => {
14700
+ if (!Array.isArray(Ce) || Ce.length === 0)
14701
14701
  return null;
14702
- const ut = Te.map((Ye) => {
14702
+ const ut = Ce.map((Ye) => {
14703
14703
  if (typeof Ye == "string")
14704
14704
  return Ye.trim();
14705
14705
  if (Ye && typeof Ye == "object" && "type" in Ye) {
@@ -14710,44 +14710,44 @@ function Ai({
14710
14710
  return null;
14711
14711
  }).filter((Ye) => !!(Ye && Ye.length));
14712
14712
  return ut.length ? ut.join(", ") : null;
14713
- }, re = Array.isArray(I) ? I.map((Te) => {
14714
- const ut = K(Te.next);
14713
+ }, re = Array.isArray(I) ? I.map((Ce) => {
14714
+ const ut = K(Ce.next);
14715
14715
  return ut ? {
14716
- ...Te,
14716
+ ...Ce,
14717
14717
  metadata: {
14718
- ...Te.metadata ?? {},
14718
+ ...Ce.metadata ?? {},
14719
14719
  next: ut
14720
14720
  }
14721
- } : Te;
14721
+ } : Ce;
14722
14722
  }) : [];
14723
- return re.some((Te) => mt(Te.metadata, "step") !== null) && re.sort((Te, ut) => {
14724
- const Ye = mt(Te.metadata, "step"), nt = mt(ut.metadata, "step");
14723
+ return re.some((Ce) => mt(Ce.metadata, "step") !== null) && re.sort((Ce, ut) => {
14724
+ const Ye = mt(Ce.metadata, "step"), nt = mt(ut.metadata, "step");
14725
14725
  if (Ye !== null || nt !== null)
14726
14726
  return (nt ?? Number.NEGATIVE_INFINITY) - (Ye ?? Number.NEGATIVE_INFINITY);
14727
- const Mt = Date.parse(Te.createdAt ?? ""), tn = Date.parse(ut.createdAt ?? "");
14727
+ const Mt = Date.parse(Ce.createdAt ?? ""), tn = Date.parse(ut.createdAt ?? "");
14728
14728
  return Number.isNaN(Mt) || Number.isNaN(tn) ? 0 : tn - Mt;
14729
14729
  }), re;
14730
14730
  }, [I, mt]), { checkpointMetaById: Vt, checkpointIndexByKey: ct } = lt(() => {
14731
14731
  const K = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map();
14732
14732
  for (const ie of Pe) {
14733
- const Te = ie.checkpointId ?? null;
14734
- if (!Te) continue;
14733
+ const Ce = ie.checkpointId ?? null;
14734
+ if (!Ce) continue;
14735
14735
  const ut = mt(ie.metadata, "step"), Ye = Rt(ie.metadata, "source"), nt = {
14736
- id: Te,
14736
+ id: Ce,
14737
14737
  step: ut,
14738
14738
  source: Ye,
14739
14739
  createdAt: ie.createdAt ?? null,
14740
14740
  namespace: ie.checkpointNs ?? null,
14741
14741
  parentId: ie.parentId ?? null
14742
14742
  };
14743
- if (K.set(Te, nt), ut !== null && Ye) {
14743
+ if (K.set(Ce, nt), ut !== null && Ye) {
14744
14744
  const Mt = `${ut}:${Ye}`, tn = re.get(Mt) ?? [];
14745
14745
  tn.push(nt), re.set(Mt, tn);
14746
14746
  }
14747
14747
  }
14748
14748
  for (const ie of re.values())
14749
- ie.sort((Te, ut) => {
14750
- const Ye = Te.createdAt ?? "";
14749
+ ie.sort((Ce, ut) => {
14750
+ const Ye = Ce.createdAt ?? "";
14751
14751
  return (ut.createdAt ?? "").localeCompare(Ye);
14752
14752
  });
14753
14753
  return { checkpointMetaById: K, checkpointIndexByKey: re };
@@ -14769,17 +14769,17 @@ function Ai({
14769
14769
  source: Zn ?? null,
14770
14770
  next: Rt(nt.metadata, "next")
14771
14771
  };
14772
- }, ie = [], Te = /* @__PURE__ */ new Set();
14772
+ }, ie = [], Ce = /* @__PURE__ */ new Set();
14773
14773
  for (const nt of K) {
14774
14774
  const Mt = ((Ye = Rt(nt.metadata, "source")) == null ? void 0 : Ye.toLowerCase()) ?? null;
14775
14775
  if (!(Mt === "input" || Mt === "user_input" || Mt === "user")) continue;
14776
14776
  const Zn = re(nt, "User input");
14777
- Zn && !Te.has(Zn.id) && (ie.push(Zn), Te.add(Zn.id));
14777
+ Zn && !Ce.has(Zn.id) && (ie.push(Zn), Ce.add(Zn.id));
14778
14778
  }
14779
14779
  if (!ie.length)
14780
14780
  for (const nt of K) {
14781
14781
  const Mt = re(nt);
14782
- Mt && !Te.has(Mt.id) && (ie.push(Mt), Te.add(Mt.id));
14782
+ Mt && !Ce.has(Mt.id) && (ie.push(Mt), Ce.add(Mt.id));
14783
14783
  }
14784
14784
  const ut = Pe.find((nt) => {
14785
14785
  var tn;
@@ -14787,7 +14787,7 @@ function Ai({
14787
14787
  });
14788
14788
  if (ut) {
14789
14789
  const nt = re(ut, "Latest loop");
14790
- nt && !Te.has(nt.id) && (ie.push(nt), Te.add(nt.id));
14790
+ nt && !Ce.has(nt.id) && (ie.push(nt), Ce.add(nt.id));
14791
14791
  }
14792
14792
  return ie;
14793
14793
  }, [Pe, ht, mt, Rt]), Dn = et(null), Jn = et(null), Ln = Ee(() => {
@@ -14809,15 +14809,15 @@ function Ai({
14809
14809
  };
14810
14810
  return K(), window.addEventListener("resize", K), () => window.removeEventListener("resize", K);
14811
14811
  }, []), Nt(() => {
14812
- ve(!1), Le.current = !1;
14812
+ we(!1), Le.current = !1;
14813
14813
  }, [L]), Nt(() => {
14814
- be.current = He;
14815
- }, [He]), Nt(() => {
14814
+ Re.current = Ue;
14815
+ }, [Ue]), Nt(() => {
14816
14816
  if (!P) {
14817
14817
  bt.current = null;
14818
14818
  return;
14819
14819
  }
14820
- bt.current === null && (bt.current = be.current), kt(Z ?? "");
14820
+ bt.current === null && (bt.current = Re.current), kt(Z ?? "");
14821
14821
  }, [Z, P, kt]);
14822
14822
  const R = Ee(async () => {
14823
14823
  if (!(!b || T || !fe))
@@ -14862,7 +14862,7 @@ function Ai({
14862
14862
  }
14863
14863
  }
14864
14864
  try {
14865
- const ie = M ?? void 0, Te = J ?? void 0, ut = P ? {
14865
+ const ie = M ?? void 0, Ce = J ?? void 0, ut = P ? {
14866
14866
  edit: !0,
14867
14867
  originalMessageId: P,
14868
14868
  ...ne != null && ne.checkpointId ? { originalCheckpointId: ne.checkpointId } : {},
@@ -14876,30 +14876,30 @@ function Ai({
14876
14876
  },
14877
14877
  {
14878
14878
  checkpointId: ie,
14879
- checkpointNs: Te
14879
+ checkpointNs: Ce
14880
14880
  }
14881
14881
  ), p == null || p(re), kt(""), ue(null), Ne([]), Ln(), H(null), oe(""), De(null);
14882
14882
  } catch (ie) {
14883
- const Te = (ie == null ? void 0 : ie.message) || "Failed to send message";
14884
- ue(Te), g == null || g(Te);
14883
+ const Ce = (ie == null ? void 0 : ie.message) || "Failed to send message";
14884
+ ue(Ce), g == null || g(Ce);
14885
14885
  }
14886
14886
  }
14887
- }, Ce = z.useCallback(
14887
+ }, Se = z.useCallback(
14888
14888
  (K, re, ie) => {
14889
- c && (bt.current = He, H(K), oe(re), kt(re), ue(null), De({
14889
+ c && (bt.current = Ue, H(K), oe(re), kt(re), ue(null), De({
14890
14890
  checkpointId: (ie == null ? void 0 : ie.checkpointId) ?? null,
14891
14891
  checkpointNs: (ie == null ? void 0 : ie.checkpointNs) ?? null
14892
14892
  }));
14893
14893
  },
14894
- [He, c, kt]
14894
+ [Ue, c, kt]
14895
14895
  ), Ge = z.useCallback(() => {
14896
- H(null), oe(""), De(null), ue(null), kt(bt.current ?? He), bt.current = null;
14897
- }, [He, kt]), at = Ee(
14896
+ H(null), oe(""), De(null), ue(null), kt(bt.current ?? Ue), bt.current = null;
14897
+ }, [Ue, kt]), at = Ee(
14898
14898
  (K, re, ie) => {
14899
- Ce(K, re, ie);
14899
+ Se(K, re, ie);
14900
14900
  },
14901
- [Ce]
14902
- ), Ue = Ee((K) => {
14901
+ [Se]
14902
+ ), He = Ee((K) => {
14903
14903
  for (let re = K - 1; re >= 0; re--)
14904
14904
  if (w[re].role === "user") {
14905
14905
  const ie = w[re].content || [], ut = ie.filter((Ye) => Ye.type === "text").map((Ye) => Ye.text).join("") || (() => {
@@ -14923,7 +14923,7 @@ function Ai({
14923
14923
  Ne((ie) => [...ie, ...re]), K.target.value = "";
14924
14924
  }, Ot = (K) => {
14925
14925
  Ne((re) => {
14926
- const ie = re.filter((Te, ut) => K !== ut);
14926
+ const ie = re.filter((Ce, ut) => K !== ut);
14927
14927
  return ie.length === 0 && Ln(), ie;
14928
14928
  });
14929
14929
  }, St = async (K) => {
@@ -14941,30 +14941,30 @@ function Ai({
14941
14941
  const ie = `Uploaded ${re.name} - processing through chat stream`;
14942
14942
  pt(ie);
14943
14943
  } catch (ie) {
14944
- const Te = ie instanceof Error ? ie.message : "Failed to upload Excel file";
14945
- console.error("Excel upload failed", ie), rt(Te), g == null || g(Te);
14944
+ const Ce = ie instanceof Error ? ie.message : "Failed to upload Excel file";
14945
+ console.error("Excel upload failed", ie), rt(Ce), g == null || g(Ce);
14946
14946
  } finally {
14947
14947
  Ze(!1), K.target.value = "", Ln();
14948
14948
  }
14949
14949
  }
14950
14950
  }, yt = async (K) => {
14951
14951
  if (y) {
14952
- Se(!0);
14952
+ be(!0);
14953
14953
  try {
14954
14954
  if (!K) {
14955
- await N(), ve(!1), requestAnimationFrame(() => {
14956
- var Te;
14957
- (Te = ye.current) == null || Te.scrollToLatest();
14955
+ await N(), we(!1), requestAnimationFrame(() => {
14956
+ var Ce;
14957
+ (Ce = ye.current) == null || Ce.scrollToLatest();
14958
14958
  });
14959
14959
  return;
14960
14960
  }
14961
- const re = Pe.find((Te) => Te.checkpointId === K), ie = (re == null ? void 0 : re.checkpointNs) ?? null;
14962
- await k(K, ie), ve(!0), requestAnimationFrame(() => {
14963
- var Te;
14964
- (Te = ye.current) == null || Te.scrollToTop();
14961
+ const re = Pe.find((Ce) => Ce.checkpointId === K), ie = (re == null ? void 0 : re.checkpointNs) ?? null;
14962
+ await k(K, ie), we(!0), requestAnimationFrame(() => {
14963
+ var Ce;
14964
+ (Ce = ye.current) == null || Ce.scrollToTop();
14965
14965
  });
14966
14966
  } finally {
14967
- Se(!1);
14967
+ be(!1);
14968
14968
  }
14969
14969
  }
14970
14970
  }, Kt = Ee(
@@ -14978,8 +14978,8 @@ function Ai({
14978
14978
  return "Latest";
14979
14979
  const re = [];
14980
14980
  K.step !== null && re.push(`Step ${K.step}`), K.source && re.push(K.source);
14981
- const ie = K.createdAt ? new Date(K.createdAt) : null, Te = ie && !Number.isNaN(ie.getTime()) ? ie.toLocaleString() : K.createdAt ?? K.id, ut = re.length ? ` — ${re.join(" • ")}` : "";
14982
- return `${Te}${ut}`;
14981
+ const ie = K.createdAt ? new Date(K.createdAt) : null, Ce = ie && !Number.isNaN(ie.getTime()) ? ie.toLocaleString() : K.createdAt ?? K.id, ut = re.length ? ` — ${re.join(" • ")}` : "";
14982
+ return `${Ce}${ut}`;
14983
14983
  },
14984
14984
  []
14985
14985
  );
@@ -15047,15 +15047,15 @@ function Ai({
15047
15047
  Le.current = !0;
15048
15048
  return;
15049
15049
  }
15050
- K && ve(!0);
15050
+ K && we(!0);
15051
15051
  },
15052
15052
  onEdit: at,
15053
- onRegenerate: Ue,
15053
+ onRegenerate: He,
15054
15054
  onCancelEdit: Ge,
15055
15055
  emptyMessage: wt ?? void 0,
15056
15056
  isNavigatingCheckpoint: W,
15057
15057
  activeInterrupt: de,
15058
- disableInterruptActions: Re,
15058
+ disableInterruptActions: ke,
15059
15059
  onInterruptActionStart: G,
15060
15060
  onInterruptActionEnd: te,
15061
15061
  showToolMessages: d,
@@ -15192,7 +15192,7 @@ function Ai({
15192
15192
  {
15193
15193
  initialValue: Z,
15194
15194
  editingMessageId: P,
15195
- value: He,
15195
+ value: Ue,
15196
15196
  onValueChange: ti,
15197
15197
  placeholder: P ? "Edit your message..." : t,
15198
15198
  isStreaming: F,
@@ -15860,8 +15860,8 @@ function Kc({
15860
15860
  } catch {
15861
15861
  return "";
15862
15862
  }
15863
- }, Re = (G) => G.title || `Thread ${G.threadId.slice(0, 8)}`, Ae = (G) => {
15864
- const te = Re(G);
15863
+ }, ke = (G) => G.title || `Thread ${G.threadId.slice(0, 8)}`, Ae = (G) => {
15864
+ const te = ke(G);
15865
15865
  return te.length <= Vc ? te : `${te.slice(0, Vc)}...`;
15866
15866
  };
15867
15867
  return /* @__PURE__ */ u.jsxs("div", { className: `flex flex-col h-full ${e} ${s.container || ""}`, children: [
@@ -16471,7 +16471,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16471
16471
  (w.value !== void 0 && w.value === P || Z) && (E(q), Z && ($.current = !0));
16472
16472
  },
16473
16473
  [w.value]
16474
- ), Re = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ae = v.useCallback(
16474
+ ), ke = v.useCallback(() => b == null ? void 0 : b.focus(), [b]), Ae = v.useCallback(
16475
16475
  (q, P, H) => {
16476
16476
  const Z = !$.current && !H;
16477
16477
  (w.value !== void 0 && w.value === P || Z) && _(q);
@@ -16498,7 +16498,7 @@ var dn = 10, [vh, Xn] = Mr(ur), pT = "SelectContentImpl", hT = Tr("SelectContent
16498
16498
  onViewportChange: S,
16499
16499
  itemRefCallback: de,
16500
16500
  selectedItem: N,
16501
- onItemLeave: Re,
16501
+ onItemLeave: ke,
16502
16502
  itemTextRefCallback: Ae,
16503
16503
  focusSelectedItem: B,
16504
16504
  selectedItemText: I,
@@ -16590,14 +16590,14 @@ var mT = "SelectItemAlignedPosition", bh = v.forwardRef((e, t) => {
16590
16590
  ]);
16591
16591
  a.style.minWidth = ee + "px", a.style.right = Ne + "px";
16592
16592
  }
16593
- const _ = p(), D = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), L = parseInt(j.paddingBottom, 10), M = $ + A + F + L + B, J = Math.min(y.offsetHeight * 5, M), Y = window.getComputedStyle(x), de = parseInt(Y.paddingTop, 10), Re = parseInt(Y.paddingBottom, 10), Ae = k.top + k.height / 2 - dn, G = D - Ae, te = y.offsetHeight / 2, q = y.offsetTop + te, P = $ + A + q, H = M - P;
16593
+ const _ = p(), D = window.innerHeight - dn * 2, F = x.scrollHeight, j = window.getComputedStyle(c), $ = parseInt(j.borderTopWidth, 10), A = parseInt(j.paddingTop, 10), B = parseInt(j.borderBottomWidth, 10), L = parseInt(j.paddingBottom, 10), M = $ + A + F + L + B, J = Math.min(y.offsetHeight * 5, M), Y = window.getComputedStyle(x), de = parseInt(Y.paddingTop, 10), ke = parseInt(Y.paddingBottom, 10), Ae = k.top + k.height / 2 - dn, G = D - Ae, te = y.offsetHeight / 2, q = y.offsetTop + te, P = $ + A + q, H = M - P;
16594
16594
  if (P <= Ae) {
16595
16595
  const oe = _.length > 0 && y === _[_.length - 1].ref.current;
16596
16596
  a.style.bottom = "0px";
16597
16597
  const ne = c.clientHeight - x.offsetTop - x.offsetHeight, De = Math.max(
16598
16598
  G,
16599
16599
  te + // viewport might have padding bottom, include it to avoid a scrollable viewport
16600
- (oe ? Re : 0) + ne + B
16600
+ (oe ? ke : 0) + ne + B
16601
16601
  ), ee = P + De;
16602
16602
  a.style.height = ee + "px";
16603
16603
  } else {