@deepagents/react-genai 7.0.2 → 7.1.1

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.
Files changed (71) hide show
  1. package/dist/index.js +833 -836
  2. package/dist/index.js.map +1 -1
  3. package/dist/lib/chat/agent-context.d.ts +6 -6
  4. package/dist/lib/chat/chat-manager.d.ts +4 -4
  5. package/dist/lib/chat/chat.d.ts +3 -3
  6. package/dist/lib/chat/citations.d.ts +1 -1
  7. package/dist/lib/chat/client-tool-output.d.ts +3 -3
  8. package/dist/lib/chat/markdown-paragraph.d.ts +1 -1
  9. package/dist/lib/chat/message-parts.d.ts +2 -2
  10. package/dist/lib/chat/read-only-transport.d.ts +1 -1
  11. package/dist/lib/chat/tool-abort.d.ts +1 -1
  12. package/dist/lib/chat/tools-schema.d.ts +1 -1
  13. package/dist/lib/chat/trajectory/IndexProgressSegment.d.ts +2 -2
  14. package/dist/lib/chat/trajectory/messages-context.d.ts +4 -4
  15. package/dist/lib/chat/trajectory/nested-trajectory.d.ts +1 -1
  16. package/dist/lib/chat/trajectory/segments/index.d.ts +6 -6
  17. package/dist/lib/chat/trajectory/tool-label.d.ts +3 -3
  18. package/dist/lib/chat/trajectory/trajectories/collapsible-disclosure.d.ts +1 -1
  19. package/dist/lib/chat/trajectory/trajectories/compact-messages.d.ts +5 -5
  20. package/dist/lib/chat/trajectory/trajectories/message-actions.d.ts +1 -1
  21. package/dist/lib/chat/trajectory/trajectories/messages-shell.d.ts +2 -2
  22. package/dist/lib/chat/trajectory/trajectories/messages.d.ts +2 -2
  23. package/dist/lib/chat/trajectory/trajectories/thinking-hint.d.ts +1 -1
  24. package/dist/lib/chat/trajectory/trajectories/thinking-hint.d.ts.map +1 -1
  25. package/dist/lib/chat/trajectory/trajectories/timeline-item.d.ts +1 -1
  26. package/dist/lib/chat/trajectory/trajectories/timeline.d.ts +3 -3
  27. package/dist/lib/chat/trajectory/trajectories/timelined-messages.d.ts +2 -2
  28. package/dist/lib/chat/trajectory/trajectories/user-message.d.ts +2 -2
  29. package/dist/lib/chat/trajectory/trajectories/user-message.d.ts.map +1 -1
  30. package/dist/lib/chat/trajectory/trajectory-segments.d.ts +1 -1
  31. package/dist/lib/chat/usage.d.ts.map +1 -1
  32. package/dist/lib/chat/zukhruf-chat-transport.d.ts +3 -3
  33. package/dist/lib/components/ChatAction.d.ts +1 -1
  34. package/dist/lib/components/ChatComposer.d.ts +4 -4
  35. package/dist/lib/components/ChatTextarea.d.ts +1 -1
  36. package/dist/lib/components/CitationPill.d.ts +1 -1
  37. package/dist/lib/components/InteractiveResponse.d.ts +2 -2
  38. package/dist/lib/components/PendingToolInput.d.ts +3 -3
  39. package/dist/lib/components/SubmitButton.d.ts +1 -1
  40. package/dist/lib/components/Tip/TipProvider.d.ts +2 -1
  41. package/dist/lib/components/queue.d.ts +1 -1
  42. package/dist/lib/components/text-shimmer.d.ts +1 -1
  43. package/dist/lib/components/tool-debug.d.ts +1 -1
  44. package/dist/lib/components/tool-error.d.ts +2 -2
  45. package/dist/lib/copy/assistant-snapshot.d.ts +2 -2
  46. package/dist/lib/copy/snapshot-context.d.ts +1 -1
  47. package/dist/lib/copy/snapshot-render.d.ts +2 -2
  48. package/dist/lib/copy/use-copy-element-as-image.d.ts +2 -2
  49. package/dist/lib/elements/ChainOfThought.d.ts +8 -8
  50. package/dist/lib/elements/CodeBlock.d.ts +1 -1
  51. package/dist/lib/elements/Conversation.d.ts +1 -1
  52. package/dist/lib/elements/Message.d.ts +4 -4
  53. package/dist/lib/elements/PromptInput.d.ts +2 -2
  54. package/dist/lib/elements/PromptInput.d.ts.map +1 -1
  55. package/dist/lib/elements/Response.d.ts +1 -1
  56. package/dist/lib/elements/Task.d.ts +1 -1
  57. package/dist/lib/elements/Tool.d.ts +3 -3
  58. package/dist/lib/elements/Tool.d.ts.map +1 -1
  59. package/dist/lib/elements/ToolDebug.d.ts +1 -1
  60. package/dist/lib/elements/interactive-element.d.ts +2 -2
  61. package/dist/lib/elements/table-panel-extension.d.ts +3 -3
  62. package/dist/lib/hooks/use-auto-resize-textarea.d.ts +1 -1
  63. package/dist/lib/renderers/render-part.d.ts +1 -1
  64. package/dist/lib/tools/helpers.d.ts +3 -3
  65. package/dist/lib/tools/registry.d.ts +4 -4
  66. package/dist/lib/ui/ArrowUpIcon.d.ts +2 -2
  67. package/dist/lib/ui/TheButton.d.ts +1 -1
  68. package/dist/lib/ui/TheButton.d.ts.map +1 -1
  69. package/package.json +6 -6
  70. package/dist/lib/renderers/icon-picker.d.ts +0 -16
  71. package/dist/lib/renderers/icon-picker.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -21,34 +21,34 @@ import { SKIP as Rt, visit as zt } from "unist-util-visit";
21
21
  import { Prism as Bt } from "react-syntax-highlighter";
22
22
  import { oneDark as Vt, oneLight as Ht } from "react-syntax-highlighter/dist/esm/styles/prism/index.js";
23
23
  import { createPortal as Ut } from "react-dom";
24
- import { stripReminders as Wt } from "@deepagents/context/browser";
25
- import { Composer as B, PersistedPromptText as Gt, useComposer as Kt } from "@deepagents/react-input/browser";
26
- import { get as qt } from "lodash-es";
27
- import { formatCompactNumber as Jt, formatNullableNumber as Yt } from "@deepagents/react-formatters";
28
- import { transform as Xt } from "sucrase";
29
- import { nanoid as Zt } from "nanoid";
24
+ import { isRecord as Wt, stripReminders as Gt } from "@deepagents/context/browser";
25
+ import { Composer as B, PersistedPromptText as Kt, useComposer as qt } from "@deepagents/react-input/browser";
26
+ import { get as Jt } from "lodash-es";
27
+ import { formatCompactNumber as Yt, formatNullableNumber as Xt } from "@deepagents/react-formatters";
28
+ import { transform as Zt } from "sucrase";
29
+ import { nanoid as Qt } from "nanoid";
30
30
  //#region src/lib/chat/prefill.ts
31
- var Qt = "pending-chat-prefill";
32
- function $t() {
31
+ var $t = "pending-chat-prefill";
32
+ function en() {
33
33
  try {
34
- let e = sessionStorage.getItem(Qt);
34
+ let e = sessionStorage.getItem($t);
35
35
  return e ? JSON.parse(e) : null;
36
36
  } catch {
37
- return sessionStorage.removeItem(Qt), null;
37
+ return sessionStorage.removeItem($t), null;
38
38
  }
39
39
  }
40
- function en(e) {
41
- sessionStorage.setItem(Qt, JSON.stringify(e));
40
+ function tn(e) {
41
+ sessionStorage.setItem($t, JSON.stringify(e));
42
42
  }
43
- function tn() {
44
- sessionStorage.removeItem(Qt);
43
+ function nn() {
44
+ sessionStorage.removeItem($t);
45
45
  }
46
46
  //#endregion
47
47
  //#region src/lib/chat/chat-manager.ts
48
- function nn(e) {
48
+ function rn(e) {
49
49
  return e === "streaming" || e === "submitted";
50
50
  }
51
- var rn = class {
51
+ var an = class {
52
52
  chat = null;
53
53
  prevStatus = "ready";
54
54
  listeners = /* @__PURE__ */ new Set();
@@ -72,7 +72,7 @@ var rn = class {
72
72
  syncStatus(e) {
73
73
  this.sentAwaitingStatus = !1;
74
74
  let t = this.prevStatus;
75
- this.prevStatus = e, nn(t) && e === "ready" && this.processQueue();
75
+ this.prevStatus = e, rn(t) && e === "ready" && this.processQueue();
76
76
  }
77
77
  initialize(e) {
78
78
  this.chat && (this._initialMessagesApplied ||= (this._initialMessages && this._initialMessages.length > 0 && this.chat.messages.length === 0 && (this.chat.setMessages(this._initialMessages), this._hasSubmitted = !0, this.notify()), !0), this._enableResume && !this._resumed && (this.chat.resumeStream(), this._resumed = !0), e && this.consumePrefill(e));
@@ -115,7 +115,7 @@ var rn = class {
115
115
  }
116
116
  }
117
117
  isChatBusy() {
118
- return this.sentAwaitingStatus || this.chat !== null && nn(this.chat.status);
118
+ return this.sentAwaitingStatus || this.chat !== null && rn(this.chat.status);
119
119
  }
120
120
  directSubmit(e) {
121
121
  this.chat && (this._hasSubmitted = !0, this.sentAwaitingStatus = !0, this.chat.sendMessage({
@@ -159,14 +159,14 @@ var rn = class {
159
159
  }
160
160
  resetChat(e) {
161
161
  let t = crypto.randomUUID();
162
- e && en({
162
+ e && tn({
163
163
  prompt: e,
164
164
  targetChatId: t
165
165
  }), this.onResetChat(t);
166
166
  }
167
167
  consumePrefill(e) {
168
- let t = $t();
169
- !t || t.targetChatId !== e || (tn(), this.submit({
168
+ let t = en();
169
+ !t || t.targetChatId !== e || (nn(), this.submit({
170
170
  prompt: t.prompt,
171
171
  persistedPrompt: t.prompt
172
172
  }));
@@ -205,7 +205,7 @@ var rn = class {
205
205
  };
206
206
  //#endregion
207
207
  //#region src/lib/chat/client-tool-output.ts
208
- async function an(e, t, n) {
208
+ async function on(e, t, n) {
209
209
  let r = t?.[n.toolName];
210
210
  n.toolName.startsWith("render") && r?.static === !1 && r.requiresUserInput !== !0 && await e.addToolOutput({
211
211
  toolCallId: n.toolCallId,
@@ -216,30 +216,30 @@ async function an(e, t, n) {
216
216
  }
217
217
  //#endregion
218
218
  //#region src/lib/chat/chat.tsx
219
- function on(e) {
219
+ function sn(e) {
220
220
  let n = t({
221
221
  id: e.chatId,
222
222
  experimental_throttle: 50,
223
223
  messages: e.initialMessages,
224
224
  transport: e.transport,
225
- sendAutomaticallyWhen: sn,
225
+ sendAutomaticallyWhen: cn,
226
226
  async onToolCall(t) {
227
227
  let { toolCall: r } = t;
228
- await an(n, e.registry, r);
228
+ await on(n, e.registry, r);
229
229
  },
230
230
  onData: e.onData,
231
231
  onFinish: e.onFinish
232
232
  });
233
233
  return n;
234
234
  }
235
- function sn(e) {
235
+ function cn(e) {
236
236
  return k(e) || O(e);
237
237
  }
238
- function cn(t) {
238
+ function ln(t) {
239
239
  let n = e(2), r;
240
- return n[0] === t ? r = n[1] : (r = /* @__PURE__ */ L(ln, { ...t }), n[0] = t, n[1] = r), r;
240
+ return n[0] === t ? r = n[1] : (r = /* @__PURE__ */ L(un, { ...t }), n[0] = t, n[1] = r), r;
241
241
  }
242
- function ln(t) {
242
+ function un(t) {
243
243
  let n = e(13), r;
244
244
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { initial: "smooth" }, n[0] = r) : r = n[0];
245
245
  let { scrollRef: i, contentRef: a } = re(r), { hasSubmitted: o } = H(), s;
@@ -262,7 +262,7 @@ function ln(t) {
262
262
  children: u
263
263
  }), n[9] = i, n[10] = s, n[11] = u, n[12] = d) : d = n[12], d;
264
264
  }
265
- function un(t) {
265
+ function dn(t) {
266
266
  let n = e(12), { hasSubmitted: r } = H(), i;
267
267
  n[0] !== r || n[1] !== t.className ? (i = F(r ? F("bg-background sticky top-0 z-10 shrink-0 space-y-1 backdrop-blur-md", t.className) : "relative flex justify-center py-4"), n[0] = r, n[1] = t.className, n[2] = i) : i = n[2];
268
268
  let a;
@@ -291,8 +291,8 @@ function un(t) {
291
291
  children: c
292
292
  }), n[9] = i, n[10] = c, n[11] = l) : l = n[11], l;
293
293
  }
294
- un.displayName = "AgentHeader.Root";
295
- function dn(t) {
294
+ dn.displayName = "AgentHeader.Root";
295
+ function fn(t) {
296
296
  let n = e(6), { hasSubmitted: r } = H(), i;
297
297
  n[0] !== r || n[1] !== t.children || n[2] !== t.icon ? (i = !r && /* @__PURE__ */ L(A.div, {
298
298
  exit: { opacity: 0 },
@@ -308,8 +308,8 @@ function dn(t) {
308
308
  children: i
309
309
  }), n[4] = i, n[5] = a), a;
310
310
  }
311
- dn.displayName = "AgentHeader.Hero";
312
- function fn(t) {
311
+ fn.displayName = "AgentHeader.Hero";
312
+ function pn(t) {
313
313
  let n = e(2), r;
314
314
  return n[0] === t.children ? r = n[1] : (r = /* @__PURE__ */ L(A.h2, {
315
315
  layout: "position",
@@ -317,8 +317,8 @@ function fn(t) {
317
317
  children: t.children
318
318
  }), n[0] = t.children, n[1] = r), r;
319
319
  }
320
- fn.displayName = "AgentHeader.Title";
321
- function pn(t) {
320
+ pn.displayName = "AgentHeader.Title";
321
+ function mn(t) {
322
322
  let n = e(5), { hasSubmitted: r } = H(), i;
323
323
  n[0] !== r || n[1] !== t.children ? (i = r && t.children && /* @__PURE__ */ L(A.p, {
324
324
  initial: { opacity: 0 },
@@ -330,15 +330,15 @@ function pn(t) {
330
330
  let a;
331
331
  return n[3] === i ? a = n[4] : (a = /* @__PURE__ */ L(ee, { children: i }), n[3] = i, n[4] = a), a;
332
332
  }
333
- pn.displayName = "AgentHeader.Description";
334
- var mn = {
335
- Root: un,
336
- Hero: dn,
337
- Title: fn,
338
- Description: pn
339
- }, hn = s(void 0), gn = s("ready"), _n = s(void 0), vn = s(null);
340
- function yn({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry: i, initialMessages: a, transport: o, resume: s, onData: c, onFinish: l, onResetChat: u, queueEnabled: d = !0 }) {
341
- let f = on({
333
+ mn.displayName = "AgentHeader.Description";
334
+ var hn = {
335
+ Root: dn,
336
+ Hero: fn,
337
+ Title: pn,
338
+ Description: mn
339
+ }, gn = s(void 0), _n = s("ready"), vn = s(void 0), yn = s(null);
340
+ function bn({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry: i, initialMessages: a, transport: o, resume: s, onData: c, onFinish: l, onResetChat: u, queueEnabled: d = !0 }) {
341
+ let f = sn({
342
342
  chatId: e,
343
343
  transport: o,
344
344
  registry: i,
@@ -351,7 +351,7 @@ function yn({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
351
351
  }, [u]);
352
352
  let S = p((e) => {
353
353
  x.current(e);
354
- }, []), [C] = b(() => new rn({
354
+ }, []), [C] = b(() => new an({
355
355
  queueEnabled: d,
356
356
  hasSubmitted: !!n || (a?.length ?? 0) > 0,
357
357
  initialMessages: a,
@@ -389,13 +389,13 @@ function yn({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
389
389
  f.status,
390
390
  f.error
391
391
  ]);
392
- return /* @__PURE__ */ L(vn, {
392
+ return /* @__PURE__ */ L(yn, {
393
393
  value: C,
394
- children: /* @__PURE__ */ L(hn.Provider, {
394
+ children: /* @__PURE__ */ L(gn.Provider, {
395
395
  value: T,
396
- children: /* @__PURE__ */ L(gn.Provider, {
396
+ children: /* @__PURE__ */ L(_n.Provider, {
397
397
  value: f.status,
398
- children: /* @__PURE__ */ L(_n.Provider, {
398
+ children: /* @__PURE__ */ L(vn.Provider, {
399
399
  value: E,
400
400
  children: t
401
401
  })
@@ -404,16 +404,16 @@ function yn({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
404
404
  });
405
405
  }
406
406
  function V() {
407
- let e = m(hn);
407
+ let e = m(gn);
408
408
  if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
409
409
  return e;
410
410
  }
411
- function bn() {
412
- let t = e(2), n = m(gn), r;
411
+ function xn() {
412
+ let t = e(2), n = m(_n), r;
413
413
  return t[0] === n ? r = t[1] : (r = { status: n }, t[0] = n, t[1] = r), r;
414
414
  }
415
415
  function H() {
416
- let t = e(5), n = m(vn);
416
+ let t = e(5), n = m(yn);
417
417
  if (!n) throw Error("useAgentMeta must be used within an AgentProvider");
418
418
  let r, i;
419
419
  t[0] === n.hasSubmitted ? (r = t[1], i = t[2]) : (r = () => n.hasSubmitted, i = () => n.hasSubmitted, t[0] = n.hasSubmitted, t[1] = r, t[2] = i);
@@ -421,18 +421,18 @@ function H() {
421
421
  return t[3] === a ? o = t[4] : (o = { hasSubmitted: a }, t[3] = a, t[4] = o), o;
422
422
  }
423
423
  function U() {
424
- let e = m(_n);
424
+ let e = m(vn);
425
425
  if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
426
426
  return e;
427
427
  }
428
- function xn() {
429
- let e = m(vn);
428
+ function Sn() {
429
+ let e = m(yn);
430
430
  if (!e) throw Error("useChatManager must be used within an AgentProvider");
431
431
  return e;
432
432
  }
433
433
  //#endregion
434
434
  //#region src/lib/chat/citations.ts
435
- function Sn(e) {
435
+ function Cn(e) {
436
436
  let t = /* @__PURE__ */ new Set(), n = [];
437
437
  for (let r of e) for (let e of r.parts) e.type === "source-url" && (t.has(e.url) || (t.add(e.url), n.push({
438
438
  url: e.url,
@@ -440,13 +440,13 @@ function Sn(e) {
440
440
  })));
441
441
  return n;
442
442
  }
443
- function Cn(e, t) {
443
+ function wn(e, t) {
444
444
  let n = e.findIndex((e) => e.url === t);
445
445
  return n === -1 ? null : n + 1;
446
446
  }
447
447
  //#endregion
448
448
  //#region src/lib/chat/read-only-transport.ts
449
- var wn = class {
449
+ var Tn = class {
450
450
  sendMessages() {
451
451
  return Promise.reject(/* @__PURE__ */ Error("This chat is read-only: it has no transport to send messages through."));
452
452
  }
@@ -456,19 +456,19 @@ var wn = class {
456
456
  };
457
457
  //#endregion
458
458
  //#region src/lib/chat/tool-abort.ts
459
- function Tn(e, t) {
459
+ function En(e, t) {
460
460
  return t === "streaming" || t === "submitted" ? !1 : e === "input-streaming" || e === "input-available";
461
461
  }
462
- function En(e, t) {
463
- return Tn(e.state, t);
462
+ function Dn(e, t) {
463
+ return En(e.state, t);
464
464
  }
465
- function Dn(t) {
466
- let n = e(3), { status: r } = bn(), i;
467
- return n[0] !== t || n[1] !== r ? (i = En(t, r), n[0] = t, n[1] = r, n[2] = i) : i = n[2], i;
465
+ function On(t) {
466
+ let n = e(3), { status: r } = xn(), i;
467
+ return n[0] !== t || n[1] !== r ? (i = Dn(t, r), n[0] = t, n[1] = r, n[2] = i) : i = n[2], i;
468
468
  }
469
469
  //#endregion
470
470
  //#region src/lib/chat/tools-schema.ts
471
- function On(e) {
471
+ function kn(e) {
472
472
  return Object.entries(e).reduce((e, [t, n]) => (n.static || (e[t] = {
473
473
  inputSchema: z.toJSONSchema(n.inputSchema, {
474
474
  io: "input",
@@ -479,7 +479,7 @@ function On(e) {
479
479
  }
480
480
  //#endregion
481
481
  //#region src/lib/components/text-shimmer.tsx
482
- function kn(t) {
482
+ function W(t) {
483
483
  let n = e(11), { children: r, as: i, className: a, duration: o, enabled: s } = t, c = i === void 0 ? "p" : i, l = s === void 0 || s, u = l && "shimmer", d;
484
484
  n[0] !== a || n[1] !== u ? (d = F(u, a), n[0] = a, n[1] = u, n[2] = d) : d = n[2];
485
485
  let f;
@@ -731,7 +731,7 @@ function Xn(t) {
731
731
  }, t), n[3] = a, n[4] = e), o = r.map(e), n[0] = a, n[1] = r, n[2] = o;
732
732
  } else o = n[2];
733
733
  let s;
734
- return n[5] !== i || n[6] !== o ? (s = /* @__PURE__ */ L(kn, {
734
+ return n[5] !== i || n[6] !== o ? (s = /* @__PURE__ */ L(W, {
735
735
  as: "span",
736
736
  enabled: i,
737
737
  className: "text-muted-foreground min-w-0 flex-1 truncate text-xs",
@@ -1051,16 +1051,16 @@ var gr = {
1051
1051
  EventLog: nr,
1052
1052
  PerAdapter: dr
1053
1053
  }, _r = s(void 0), vr = s(void 0);
1054
- function W() {
1054
+ function G() {
1055
1055
  let e = f(_r);
1056
1056
  if (!e) throw Error("useMessagesContext must be used within <Messages>");
1057
1057
  return e;
1058
1058
  }
1059
- function G() {
1060
- let e = f(_r), { status: t } = bn();
1059
+ function K() {
1060
+ let e = f(_r), { status: t } = xn();
1061
1061
  return e?.status ?? t;
1062
1062
  }
1063
- function K() {
1063
+ function q() {
1064
1064
  let e = f(vr);
1065
1065
  if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
1066
1066
  return e;
@@ -1170,7 +1170,7 @@ function Er(t) {
1170
1170
  ...i
1171
1171
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
1172
1172
  }
1173
- var q = Object.assign(br, {
1173
+ var J = Object.assign(br, {
1174
1174
  Header: xr,
1175
1175
  Heading: Sr,
1176
1176
  Title: Cr,
@@ -1385,12 +1385,12 @@ function $r(t) {
1385
1385
  let g;
1386
1386
  r[4] === a ? g = r[5] : (g = F("my-4", a), r[4] = a, r[5] = g);
1387
1387
  let _;
1388
- r[6] !== c || r[7] !== s || r[8] !== h || r[9] !== m || r[10] !== d || r[11] !== p || r[12] !== o ? (_ = (m || h) && /* @__PURE__ */ R(q.Header, {
1388
+ r[6] !== c || r[7] !== s || r[8] !== h || r[9] !== m || r[10] !== d || r[11] !== p || r[12] !== o ? (_ = (m || h) && /* @__PURE__ */ R(J.Header, {
1389
1389
  className: F(!m && "justify-end"),
1390
- children: [m && /* @__PURE__ */ R(q.Heading, { children: [o && /* @__PURE__ */ L(q.Title, { children: o }), s && /* @__PURE__ */ L(q.Description, {
1390
+ children: [m && /* @__PURE__ */ R(J.Heading, { children: [o && /* @__PURE__ */ L(J.Title, { children: o }), s && /* @__PURE__ */ L(J.Description, {
1391
1391
  className: F(o && "mt-1"),
1392
1392
  children: s
1393
- })] }), h && /* @__PURE__ */ R(q.Actions, {
1393
+ })] }), h && /* @__PURE__ */ R(J.Actions, {
1394
1394
  "data-copy-exclude": "assistant-snapshot",
1395
1395
  children: [
1396
1396
  d && /* @__PURE__ */ L(Mt, { className: Lr }),
@@ -1402,12 +1402,12 @@ function $r(t) {
1402
1402
  let v;
1403
1403
  r[14] === Symbol.for("react.memo_cache_sentinel") ? (v = F("overflow-hidden", "[&>[data-streamdown=table-wrapper]]:m-0 [&>[data-streamdown=table-wrapper]]:gap-0 [&>[data-streamdown=table-wrapper]]:rounded-none [&>[data-streamdown=table-wrapper]]:border-0 [&>[data-streamdown=table-wrapper]]:bg-transparent [&>[data-streamdown=table-wrapper]]:p-0", "[&>[data-streamdown=table-wrapper]>div:last-child]:rounded-none [&>[data-streamdown=table-wrapper]>div:last-child]:border-0", "[&_[data-streamdown=table]]:tabular-nums", "[&_[data-streamdown=table-header]]:bg-muted/30", "[&_[data-streamdown=table-header-cell]]:text-muted-foreground [&_[data-streamdown=table-header-cell]]:text-xs [&_[data-streamdown=table-header-cell]]:font-medium", "[&_[data-streamdown=table-cell]]:py-2", "[&_[data-streamdown=table-row]]:hover:bg-muted/30"), r[14] = v) : v = r[14];
1404
1404
  let y;
1405
- r[15] === i ? y = r[16] : (y = /* @__PURE__ */ L(q.Content, {
1405
+ r[15] === i ? y = r[16] : (y = /* @__PURE__ */ L(J.Content, {
1406
1406
  className: v,
1407
1407
  children: i
1408
1408
  }), r[15] = i, r[16] = y);
1409
1409
  let b;
1410
- return r[17] !== g || r[18] !== _ || r[19] !== y ? (b = /* @__PURE__ */ R(q, {
1410
+ return r[17] !== g || r[18] !== _ || r[19] !== y ? (b = /* @__PURE__ */ R(J, {
1411
1411
  "data-streamdown": "table-wrapper",
1412
1412
  className: g,
1413
1413
  children: [_, y]
@@ -1504,7 +1504,7 @@ var ti = class extends n.Component {
1504
1504
  children: ["Failed to render content: ", this.state.error?.message]
1505
1505
  }) : this.props.children;
1506
1506
  }
1507
- }, J = u((t) => {
1507
+ }, Y = u((t) => {
1508
1508
  let n = e(8), r, i;
1509
1509
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
1510
1510
  let a;
@@ -1515,7 +1515,7 @@ var ti = class extends n.Component {
1515
1515
  ...i
1516
1516
  }) }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
1517
1517
  });
1518
- J.displayName = "Response";
1518
+ Y.displayName = "Response";
1519
1519
  //#endregion
1520
1520
  //#region src/lib/ui/use-copy-feedback.ts
1521
1521
  function ni(t) {
@@ -1625,12 +1625,12 @@ var ri = s({ code: "" }), ii = (t) => {
1625
1625
  try {
1626
1626
  await s(c), e?.();
1627
1627
  } catch (e) {
1628
- t?.(e);
1628
+ t?.(e instanceof Error ? e : Error(String(e)));
1629
1629
  }
1630
1630
  }, u = o ? et : st;
1631
1631
  return /* @__PURE__ */ L(j, {
1632
1632
  className: F("shrink-0", i),
1633
- onClick: l,
1633
+ onClick: () => void l(),
1634
1634
  size: "icon",
1635
1635
  variant: "ghost",
1636
1636
  ...a,
@@ -1736,52 +1736,45 @@ var ri = s({ code: "" }), ii = (t) => {
1736
1736
  children: [s, l]
1737
1737
  }), n[11] = a, n[12] = o, n[13] = l, n[14] = u) : u = n[14], u;
1738
1738
  }, di = (t) => {
1739
- let n = e(30), r, i, a, o;
1739
+ let n = e(24), r, i, a, o;
1740
1740
  if (n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({className: r, output: a, errorText: i, ...o} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o), !(a || i)) return null;
1741
- let s = a, c;
1742
- n[5] === s ? c = n[6] : (c = /* @__PURE__ */ L("div", { children: s }), n[5] = s, n[6] = c);
1743
- let u = c;
1744
- if (typeof a == "object" && !l(a)) {
1745
- let e;
1746
- n[7] === a ? e = n[8] : (e = JSON.stringify(a, null, 2), n[7] = a, n[8] = e);
1747
- let t;
1748
- n[9] === e ? t = n[10] : (t = /* @__PURE__ */ L(ii, {
1749
- code: e,
1750
- language: "json"
1751
- }), n[9] = e, n[10] = t), u = t;
1752
- } else if (typeof a == "string") {
1753
- let e;
1754
- n[11] === a ? e = n[12] : (e = /* @__PURE__ */ L(ii, {
1755
- code: a,
1756
- language: "json"
1757
- }), n[11] = a, n[12] = e), u = e;
1758
- }
1759
- let d;
1760
- n[13] === r ? d = n[14] : (d = F("space-y-2 p-4", r), n[13] = r, n[14] = d);
1761
- let f = i ? "Error" : "Result", p;
1762
- n[15] === f ? p = n[16] : (p = /* @__PURE__ */ L("h4", {
1741
+ let s;
1742
+ n[5] === r ? s = n[6] : (s = F("space-y-2 p-4", r), n[5] = r, n[6] = s);
1743
+ let c = i ? "Error" : "Result", l;
1744
+ n[7] === c ? l = n[8] : (l = /* @__PURE__ */ L("h4", {
1763
1745
  className: "text-muted-foreground text-xs font-medium tracking-wide uppercase",
1764
- children: f
1765
- }), n[15] = f, n[16] = p);
1766
- let m = i ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground", h;
1767
- n[17] === m ? h = n[18] : (h = F("overflow-x-auto rounded-md text-xs [&_table]:w-full", m), n[17] = m, n[18] = h);
1768
- let g;
1769
- n[19] === i ? g = n[20] : (g = i && /* @__PURE__ */ L("div", { children: i }), n[19] = i, n[20] = g);
1770
- let _;
1771
- n[21] !== u || n[22] !== h || n[23] !== g ? (_ = /* @__PURE__ */ R("div", {
1772
- className: h,
1773
- children: [g, u]
1774
- }), n[21] = u, n[22] = h, n[23] = g, n[24] = _) : _ = n[24];
1775
- let v;
1776
- return n[25] !== o || n[26] !== d || n[27] !== p || n[28] !== _ ? (v = /* @__PURE__ */ R("div", {
1746
+ children: c
1747
+ }), n[7] = c, n[8] = l);
1748
+ let u = i ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground", d;
1749
+ n[9] === u ? d = n[10] : (d = F("overflow-x-auto rounded-md text-xs [&_table]:w-full", u), n[9] = u, n[10] = d);
1750
+ let f;
1751
+ n[11] === i ? f = n[12] : (f = i && /* @__PURE__ */ L("div", { children: i }), n[11] = i, n[12] = f);
1752
+ let p;
1753
+ n[13] === a ? p = n[14] : (p = fi(a), n[13] = a, n[14] = p);
1754
+ let m;
1755
+ n[15] !== d || n[16] !== f || n[17] !== p ? (m = /* @__PURE__ */ R("div", {
1777
1756
  className: d,
1757
+ children: [f, p]
1758
+ }), n[15] = d, n[16] = f, n[17] = p, n[18] = m) : m = n[18];
1759
+ let h;
1760
+ return n[19] !== o || n[20] !== s || n[21] !== l || n[22] !== m ? (h = /* @__PURE__ */ R("div", {
1761
+ className: s,
1778
1762
  ...o,
1779
- children: [p, _]
1780
- }), n[25] = o, n[26] = d, n[27] = p, n[28] = _, n[29] = v) : v = n[29], v;
1763
+ children: [l, m]
1764
+ }), n[19] = o, n[20] = s, n[21] = l, n[22] = m, n[23] = h) : h = n[23], h;
1781
1765
  };
1766
+ function fi(e) {
1767
+ return typeof e == "string" ? /* @__PURE__ */ L(ii, {
1768
+ code: e,
1769
+ language: "json"
1770
+ }) : l(e) ? /* @__PURE__ */ L("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ L(ii, {
1771
+ code: JSON.stringify(e, null, 2),
1772
+ language: "json"
1773
+ }) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ L("div", { children: e }) : /* @__PURE__ */ L("div", {});
1774
+ }
1782
1775
  //#endregion
1783
1776
  //#region src/lib/components/tool-debug.tsx
1784
- function fi(t) {
1777
+ function pi(t) {
1785
1778
  let n = e(21), { part: r } = t, i;
1786
1779
  n[0] === r ? i = n[1] : (i = C(r), n[0] = r, n[1] = i);
1787
1780
  let a = `Executing ${i}`, o;
@@ -1795,7 +1788,7 @@ function fi(t) {
1795
1788
  let c;
1796
1789
  n[8] === r.output ? c = n[9] : (c = typeof r.output == "string" ? r.output : JSON.stringify(r.output, null, 2), n[8] = r.output, n[9] = c);
1797
1790
  let l;
1798
- n[10] === c ? l = n[11] : (l = /* @__PURE__ */ L(J, {
1791
+ n[10] === c ? l = n[11] : (l = /* @__PURE__ */ L(Y, {
1799
1792
  className: "break-all",
1800
1793
  children: c
1801
1794
  }), n[10] = c, n[11] = l);
@@ -1812,38 +1805,38 @@ function fi(t) {
1812
1805
  children: [o, d]
1813
1806
  }), n[18] = o, n[19] = d, n[20] = f) : f = n[20], f;
1814
1807
  }
1815
- function pi(t) {
1816
- let n = e(19), { part: r } = t, i = `Executing ${r.toolName}`, a = r.type, o;
1817
- n[0] !== r.state || n[1] !== i || n[2] !== a ? (o = /* @__PURE__ */ L(ci, {
1808
+ function mi(t) {
1809
+ let n = e(19), { part: r } = t, i = `Executing ${r.toolName}`, a;
1810
+ n[0] !== r.state || n[1] !== r.type || n[2] !== i ? (a = /* @__PURE__ */ L(ci, {
1818
1811
  title: i,
1819
1812
  state: r.state,
1820
- type: a
1821
- }), n[0] = r.state, n[1] = i, n[2] = a, n[3] = o) : o = n[3];
1813
+ type: r.type
1814
+ }), n[0] = r.state, n[1] = r.type, n[2] = i, n[3] = a) : a = n[3];
1815
+ let o;
1816
+ n[4] === r.input ? o = n[5] : (o = /* @__PURE__ */ L(ui, { input: r.input }), n[4] = r.input, n[5] = o);
1822
1817
  let s;
1823
- n[4] === r.input ? s = n[5] : (s = /* @__PURE__ */ L(ui, { input: r.input }), n[4] = r.input, n[5] = s);
1818
+ n[6] === r.output ? s = n[7] : (s = typeof r.output == "string" ? r.output : JSON.stringify(r.output, null, 2), n[6] = r.output, n[7] = s);
1824
1819
  let c;
1825
- n[6] === r.output ? c = n[7] : (c = typeof r.output == "string" ? r.output : JSON.stringify(r.output, null, 2), n[6] = r.output, n[7] = c);
1826
- let l;
1827
- n[8] === c ? l = n[9] : (l = /* @__PURE__ */ L(J, {
1820
+ n[8] === s ? c = n[9] : (c = /* @__PURE__ */ L(Y, {
1828
1821
  className: "break-all",
1829
- children: c
1830
- }), n[8] = c, n[9] = l);
1831
- let u;
1832
- n[10] !== r.errorText || n[11] !== l ? (u = /* @__PURE__ */ L(di, {
1833
- output: l,
1822
+ children: s
1823
+ }), n[8] = s, n[9] = c);
1824
+ let l;
1825
+ n[10] !== r.errorText || n[11] !== c ? (l = /* @__PURE__ */ L(di, {
1826
+ output: c,
1834
1827
  errorText: r.errorText
1835
- }), n[10] = r.errorText, n[11] = l, n[12] = u) : u = n[12];
1828
+ }), n[10] = r.errorText, n[11] = c, n[12] = l) : l = n[12];
1829
+ let u;
1830
+ n[13] !== o || n[14] !== l ? (u = /* @__PURE__ */ R(li, { children: [o, l] }), n[13] = o, n[14] = l, n[15] = u) : u = n[15];
1836
1831
  let d;
1837
- n[13] !== s || n[14] !== u ? (d = /* @__PURE__ */ R(li, { children: [s, u] }), n[13] = s, n[14] = u, n[15] = d) : d = n[15];
1838
- let f;
1839
- return n[16] !== o || n[17] !== d ? (f = /* @__PURE__ */ R(oi, {
1832
+ return n[16] !== a || n[17] !== u ? (d = /* @__PURE__ */ R(oi, {
1840
1833
  "data-copy-exclude": "assistant-snapshot",
1841
- children: [o, d]
1842
- }), n[16] = o, n[17] = d, n[18] = f) : f = n[18], f;
1834
+ children: [a, u]
1835
+ }), n[16] = a, n[17] = u, n[18] = d) : d = n[18], d;
1843
1836
  }
1844
1837
  //#endregion
1845
1838
  //#region src/lib/ui/TheButton.tsx
1846
- function mi(t, n) {
1839
+ function hi(t, n) {
1847
1840
  let r = e(4), i = !!t, [a, o] = b(!1), s, c;
1848
1841
  return r[0] !== n || r[1] !== i ? (s = () => {
1849
1842
  if (!i) return;
@@ -1855,32 +1848,32 @@ function mi(t, n) {
1855
1848
  };
1856
1849
  }, c = [i, n], r[0] = n, r[1] = i, r[2] = s, r[3] = c) : (s = r[2], c = r[3]), h(s, c), i && a;
1857
1850
  }
1858
- function hi(e) {
1859
- return typeof e == "function" || typeof e == "object" && !!e && "$$typeof" in e && typeof e.render == "function";
1851
+ function gi(e) {
1852
+ return typeof e == "function" || typeof e == "object" && !!e && "$$typeof" in e && "render" in e && typeof e.render == "function";
1860
1853
  }
1861
- function gi(t) {
1854
+ function _i(t) {
1862
1855
  let n = e(4), { icon: r } = t;
1863
- if (hi(r)) {
1856
+ if (gi(r)) {
1864
1857
  let e = r, t;
1865
1858
  return n[0] === e ? t = n[1] : (t = /* @__PURE__ */ L(e, { className: "size-4" }), n[0] = e, n[1] = t), t;
1866
1859
  }
1867
1860
  let i;
1868
1861
  return n[2] === r ? i = n[3] : (i = /* @__PURE__ */ L(I, { children: r }), n[2] = r, n[3] = i), i;
1869
1862
  }
1870
- function _i() {
1863
+ function vi() {
1871
1864
  let t = e(1), n;
1872
1865
  return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ L(pt, { className: "size-4 animate-spin" }), t[0] = n) : n = t[0], n;
1873
1866
  }
1874
- function vi(t) {
1867
+ function yi(t) {
1875
1868
  let n = e(11), { icon: r, showSpinner: i } = t, a;
1876
1869
  n[0] !== r || n[1] !== i ? (a = r && /* @__PURE__ */ L("div", {
1877
1870
  className: F("absolute inset-0 flex items-center justify-center transition-all duration-300 ease-in-out", i ? "-translate-x-full opacity-0" : "translate-x-0 opacity-100"),
1878
- children: /* @__PURE__ */ L(gi, { icon: r })
1871
+ children: /* @__PURE__ */ L(_i, { icon: r })
1879
1872
  }), n[0] = r, n[1] = i, n[2] = a) : a = n[2];
1880
1873
  let o = i ? "translate-x-0 opacity-100" : "translate-x-full opacity-0", s;
1881
1874
  n[3] === o ? s = n[4] : (s = F("absolute inset-0 transition-all duration-300 ease-in-out", o), n[3] = o, n[4] = s);
1882
1875
  let c;
1883
- n[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ L(_i, {}), n[5] = c) : c = n[5];
1876
+ n[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ L(vi, {}), n[5] = c) : c = n[5];
1884
1877
  let l;
1885
1878
  n[6] === s ? l = n[7] : (l = /* @__PURE__ */ L("div", {
1886
1879
  className: s,
@@ -1892,16 +1885,16 @@ function vi(t) {
1892
1885
  children: [a, l]
1893
1886
  }), n[8] = a, n[9] = l, n[10] = u) : u = n[10], u;
1894
1887
  }
1895
- function yi(t) {
1888
+ function bi(t) {
1896
1889
  let n = e(13), { icon: r, showSpinner: i, children: a } = t, o;
1897
1890
  n[0] !== r || n[1] !== i ? (o = r && /* @__PURE__ */ L("div", {
1898
1891
  className: F("overflow-hidden transition-all duration-300 ease-in-out", i ? "w-0 opacity-0" : "w-4 opacity-100"),
1899
- children: /* @__PURE__ */ L(gi, { icon: r })
1892
+ children: /* @__PURE__ */ L(_i, { icon: r })
1900
1893
  }), n[0] = r, n[1] = i, n[2] = o) : o = n[2];
1901
1894
  let s = i ? "w-4 opacity-100" : "-ms-2 w-0 opacity-0", c = r ? "-ms-2" : "", l;
1902
1895
  n[3] !== s || n[4] !== c ? (l = F("overflow-hidden transition-all duration-300 ease-in-out", s, c), n[3] = s, n[4] = c, n[5] = l) : l = n[5];
1903
1896
  let u;
1904
- n[6] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ L(_i, {}), n[6] = u) : u = n[6];
1897
+ n[6] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ L(vi, {}), n[6] = u) : u = n[6];
1905
1898
  let d;
1906
1899
  n[7] === l ? d = n[8] : (d = /* @__PURE__ */ L("div", {
1907
1900
  className: l,
@@ -1914,7 +1907,7 @@ function yi(t) {
1914
1907
  a
1915
1908
  ] }), n[9] = a, n[10] = o, n[11] = d, n[12] = f) : f = n[12], f;
1916
1909
  }
1917
- function bi(t) {
1910
+ function xi(t) {
1918
1911
  let n = e(7), { tooltip: r, children: i } = t;
1919
1912
  if (!r) return i;
1920
1913
  let a;
@@ -1924,14 +1917,14 @@ function bi(t) {
1924
1917
  let s;
1925
1918
  return n[4] !== a || n[5] !== o ? (s = /* @__PURE__ */ R(He, { children: [a, o] }), n[4] = a, n[5] = o, n[6] = s) : s = n[6], s;
1926
1919
  }
1927
- function xi(t) {
1928
- let n = e(18), { loading: r, disabled: i, children: a, delay: o, icon: s, tooltip: c, size: l, ...u } = t, d = mi(r, o === void 0 ? 300 : o), f;
1920
+ function Si(t) {
1921
+ let n = e(18), { loading: r, disabled: i, children: a, delay: o, icon: s, tooltip: c, size: l, ...u } = t, d = hi(r, o === void 0 ? 300 : o), f;
1929
1922
  n[0] === l ? f = n[1] : (f = l?.startsWith("icon"), n[0] = l, n[1] = f);
1930
- let p = f, m = bi, h = j, g = i || r, _ = F("cursor-pointer gap-2", u.className), v;
1931
- n[2] !== a || n[3] !== s || n[4] !== p || n[5] !== d ? (v = p ? /* @__PURE__ */ L(vi, {
1923
+ let p = f, m = xi, h = j, g = i || r, _ = F("cursor-pointer gap-2", u.className), v;
1924
+ n[2] !== a || n[3] !== s || n[4] !== p || n[5] !== d ? (v = p ? /* @__PURE__ */ L(yi, {
1932
1925
  icon: s,
1933
1926
  showSpinner: d
1934
- }) : /* @__PURE__ */ L(yi, {
1927
+ }) : /* @__PURE__ */ L(bi, {
1935
1928
  icon: s,
1936
1929
  showSpinner: d,
1937
1930
  children: a
@@ -1952,35 +1945,35 @@ function xi(t) {
1952
1945
  }
1953
1946
  //#endregion
1954
1947
  //#region src/lib/copy/copy-image.ts
1955
- var Si = "data-copy-exclude", Ci = {
1948
+ var Ci = "data-copy-exclude", wi = {
1956
1949
  image: "image",
1957
1950
  assistantSnapshot: "assistant-snapshot"
1958
1951
  };
1959
- function wi(e) {
1952
+ function Ti(e) {
1960
1953
  return typeof e == "object" && !!e && "getAttribute" in e && typeof e.getAttribute == "function";
1961
1954
  }
1962
- function Ti(e, t) {
1963
- if (!wi(e)) return !1;
1964
- let n = e.getAttribute(Si);
1955
+ function Ei(e, t) {
1956
+ if (!Ti(e)) return !1;
1957
+ let n = e.getAttribute(Ci);
1965
1958
  return n ? n.split(/\s+/).includes(t) : !1;
1966
1959
  }
1967
- function Ei(e, t) {
1968
- return !Ti(e, t);
1960
+ function Di(e, t) {
1961
+ return !Ei(e, t);
1969
1962
  }
1970
- function Di({ clipboard: e, ClipboardItem: t }) {
1963
+ function Oi({ clipboard: e, ClipboardItem: t }) {
1971
1964
  return typeof e?.write == "function" && typeof t == "function" ? "image" : typeof e?.writeText == "function" ? "text" : "none";
1972
1965
  }
1973
1966
  //#endregion
1974
1967
  //#region src/lib/copy/snapshot-context.ts
1975
- var Oi = s(!1);
1968
+ var ki = s(!1);
1976
1969
  //#endregion
1977
1970
  //#region src/lib/copy/snapshot-render.tsx
1978
- function ki() {
1971
+ function Ai() {
1979
1972
  return new Promise((e) => {
1980
1973
  requestAnimationFrame(() => e());
1981
1974
  });
1982
1975
  }
1983
- function Ai(t) {
1976
+ function ji(t) {
1984
1977
  let n = e(9), { contentRef: r, children: i, width: a, padding: o, className: s } = t, c = a === void 0 ? 1120 : a, l = o === void 0 ? 24 : o, u = s === void 0 ? "bg-background text-foreground flex flex-col gap-3" : s;
1985
1978
  if (typeof document > "u") return null;
1986
1979
  let d;
@@ -2001,7 +1994,7 @@ function Ai(t) {
2001
1994
  return n[4] !== i || n[5] !== u || n[6] !== r || n[7] !== f ? (p = Ut(/* @__PURE__ */ L("div", {
2002
1995
  "aria-hidden": "true",
2003
1996
  style: d,
2004
- children: /* @__PURE__ */ L(Oi, {
1997
+ children: /* @__PURE__ */ L(ki, {
2005
1998
  value: !0,
2006
1999
  children: /* @__PURE__ */ L("div", {
2007
2000
  ref: r,
@@ -2014,13 +2007,13 @@ function Ai(t) {
2014
2007
  }
2015
2008
  //#endregion
2016
2009
  //#region src/lib/copy/use-copy-element-as-image.ts
2017
- function ji(e) {
2010
+ function Mi(e) {
2018
2011
  let t = getComputedStyle(e).backgroundColor;
2019
2012
  if (t !== "rgba(0, 0, 0, 0)") return t;
2020
2013
  let n = getComputedStyle(document.body).backgroundColor;
2021
2014
  return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
2022
2015
  }
2023
- function Mi({ elementRef: e, excludeMode: t, fallbackText: n }) {
2016
+ function Ni({ elementRef: e, excludeMode: t, fallbackText: n }) {
2024
2017
  let [r, i] = b(!1), [a, o] = b(null), s = y(null), c = p(() => {
2025
2018
  s.current !== null && (window.clearTimeout(s.current), s.current = null);
2026
2019
  }, []), l = p((e) => {
@@ -2037,9 +2030,9 @@ function Mi({ elementRef: e, excludeMode: t, fallbackText: n }) {
2037
2030
  }), !0), [n, l]), d = p(async () => {
2038
2031
  if (!e.current) throw Error("Nothing is ready to copy yet.");
2039
2032
  let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
2040
- backgroundColor: ji(e.current),
2033
+ backgroundColor: Mi(e.current),
2041
2034
  pixelRatio: 2,
2042
- filter: (e) => Ei(e, t)
2035
+ filter: (e) => Di(e, t)
2043
2036
  });
2044
2037
  if (!r) throw Error("Unable to render the image for copying.");
2045
2038
  await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), l({
@@ -2055,7 +2048,7 @@ function Mi({ elementRef: e, excludeMode: t, fallbackText: n }) {
2055
2048
  copy: p(async () => {
2056
2049
  i(!0), o(null);
2057
2050
  try {
2058
- let e = Di({
2051
+ let e = Oi({
2059
2052
  clipboard: typeof navigator > "u" ? void 0 : navigator.clipboard,
2060
2053
  ClipboardItem: typeof window > "u" ? void 0 : window.ClipboardItem
2061
2054
  });
@@ -2090,29 +2083,29 @@ function Mi({ elementRef: e, excludeMode: t, fallbackText: n }) {
2090
2083
  }
2091
2084
  //#endregion
2092
2085
  //#region src/lib/copy/assistant-snapshot.tsx
2093
- function Ni(e) {
2086
+ function Pi(e) {
2094
2087
  return e.parts.filter(E).map((e) => e.text).join("\n");
2095
2088
  }
2096
- function Y() {
2097
- return m(Oi);
2089
+ function X() {
2090
+ return m(ki);
2098
2091
  }
2099
- function Pi(t) {
2100
- let n = e(28), { message: r, renderContent: i, className: a } = t, o = y(null), [s, c] = b(!1), l;
2101
- n[0] === r ? l = n[1] : (l = Ni(r), n[0] = r, n[1] = l);
2092
+ function Fi(t) {
2093
+ let n = e(30), { message: r, renderContent: i, className: a } = t, o = y(null), [s, c] = b(!1), l;
2094
+ n[0] === r ? l = n[1] : (l = Pi(r), n[0] = r, n[1] = l);
2102
2095
  let u = l, d;
2103
2096
  n[2] === u ? d = n[3] : (d = {
2104
2097
  elementRef: o,
2105
- excludeMode: Ci.assistantSnapshot,
2098
+ excludeMode: wi.assistantSnapshot,
2106
2099
  fallbackText: u
2107
2100
  }, n[2] = u, n[3] = d);
2108
- let { copy: f, feedback: p, isCopying: m } = Mi(d), h;
2101
+ let { copy: f, feedback: p, isCopying: m } = Ni(d), h;
2109
2102
  n[4] !== f || n[5] !== s ? (h = async () => {
2110
- s || c(!0), await ki(), await f();
2103
+ s || c(!0), await Ai(), await f();
2111
2104
  }, n[4] = f, n[5] = s, n[6] = h) : h = n[6];
2112
2105
  let g = h, _ = "Copy snapshot";
2113
2106
  m ? _ = "Copying snapshot" : p?.kind === "success" && (_ = p.mode === "image" ? "Copied snapshot" : "Copied text");
2114
2107
  let v;
2115
- n[7] !== i || n[8] !== s ? (v = s && /* @__PURE__ */ L(Ai, {
2108
+ n[7] !== i || n[8] !== s ? (v = s && /* @__PURE__ */ L(ji, {
2116
2109
  contentRef: o,
2117
2110
  children: i()
2118
2111
  }), n[7] = i, n[8] = s, n[9] = v) : v = n[9];
@@ -2124,89 +2117,91 @@ function Pi(t) {
2124
2117
  children: p.message
2125
2118
  }), n[12] = p, n[13] = S);
2126
2119
  let C;
2127
- n[14] === p?.kind ? C = n[15] : (C = p?.kind === "success" ? /* @__PURE__ */ L(Qe, { className: "size-4" }) : /* @__PURE__ */ L(ot, { className: "size-4" }), n[14] = p?.kind, n[15] = C);
2120
+ n[14] === g ? C = n[15] : (C = () => void g(), n[14] = g, n[15] = C);
2128
2121
  let w;
2129
- n[16] !== g || n[17] !== m || n[18] !== _ || n[19] !== C ? (w = /* @__PURE__ */ L(xi, {
2122
+ n[16] === p?.kind ? w = n[17] : (w = p?.kind === "success" ? /* @__PURE__ */ L(Qe, { className: "size-4" }) : /* @__PURE__ */ L(ot, { className: "size-4" }), n[16] = p?.kind, n[17] = w);
2123
+ let T;
2124
+ n[18] !== m || n[19] !== _ || n[20] !== C || n[21] !== w ? (T = /* @__PURE__ */ L(Si, {
2130
2125
  type: "button",
2131
2126
  size: "icon-sm",
2132
2127
  variant: "ghost",
2133
2128
  loading: m,
2134
- onClick: g,
2129
+ onClick: C,
2135
2130
  "aria-label": _,
2136
- icon: C
2137
- }), n[16] = g, n[17] = m, n[18] = _, n[19] = C, n[20] = w) : w = n[20];
2138
- let T;
2139
- n[21] !== x || n[22] !== S || n[23] !== w ? (T = /* @__PURE__ */ R("div", {
2131
+ icon: w
2132
+ }), n[18] = m, n[19] = _, n[20] = C, n[21] = w, n[22] = T) : T = n[22];
2133
+ let E;
2134
+ n[23] !== x || n[24] !== S || n[25] !== T ? (E = /* @__PURE__ */ R("div", {
2140
2135
  "data-copy-exclude": "assistant-snapshot",
2141
2136
  className: x,
2142
- children: [S, w]
2143
- }), n[21] = x, n[22] = S, n[23] = w, n[24] = T) : T = n[24];
2144
- let E;
2145
- return n[25] !== v || n[26] !== T ? (E = /* @__PURE__ */ R(I, { children: [v, T] }), n[25] = v, n[26] = T, n[27] = E) : E = n[27], E;
2137
+ children: [S, T]
2138
+ }), n[23] = x, n[24] = S, n[25] = T, n[26] = E) : E = n[26];
2139
+ let D;
2140
+ return n[27] !== E || n[28] !== v ? (D = /* @__PURE__ */ R(I, { children: [v, E] }), n[27] = E, n[28] = v, n[29] = D) : D = n[29], D;
2146
2141
  }
2147
2142
  //#endregion
2148
2143
  //#region src/lib/tools/helpers.ts
2149
- function Fi(e) {
2144
+ function Ii(e) {
2150
2145
  return D(e) && e.toolMetadata?.kind === "subagent";
2151
2146
  }
2152
- function Ii(e) {
2147
+ function Li(e) {
2153
2148
  let t = e.toolMetadata?.displayName;
2154
2149
  return typeof t == "string" ? t : "Subagent";
2155
2150
  }
2156
- function Li(e, t) {
2151
+ function Ri(e, t) {
2157
2152
  let n = e.type.replace("tool-", "");
2158
2153
  return {
2159
2154
  toolKey: n,
2160
2155
  toolEntry: t?.[n]
2161
2156
  };
2162
2157
  }
2163
- function Ri(e, t) {
2158
+ function zi(e, t) {
2164
2159
  return e?.static === !1 && !!e?.requiresUserInput && t === "input-available";
2165
2160
  }
2166
2161
  //#endregion
2167
2162
  //#region src/lib/chat/markdown-paragraph.tsx
2168
- function zi(t) {
2163
+ function Bi(t) {
2169
2164
  let n = e(4), { children: i } = t, a = r.Children.toArray(i);
2170
- if (!a.some(Vi)) {
2165
+ if (!a.some(Hi)) {
2171
2166
  let e;
2172
2167
  return n[0] === i ? e = n[1] : (e = /* @__PURE__ */ L("p", { children: i }), n[0] = i, n[1] = e), e;
2173
2168
  }
2174
- if (a.length > 0 && a.every(Bi)) return i;
2169
+ if (a.length > 0 && a.every(Vi)) return i;
2175
2170
  let o;
2176
2171
  return n[2] === i ? o = n[3] : (o = /* @__PURE__ */ L("div", { children: i }), n[2] = i, n[3] = o), o;
2177
2172
  }
2178
- function Bi(e) {
2173
+ function Vi(e) {
2179
2174
  return r.isValidElement(e) && typeof e.type != "string";
2180
2175
  }
2181
- function Vi(e) {
2176
+ function Hi(e) {
2182
2177
  return r.isValidElement(e) && typeof e.type != "string";
2183
2178
  }
2184
2179
  //#endregion
2185
2180
  //#region src/lib/components/InteractiveResponse.tsx
2186
- function Hi(e) {
2187
- let t = { p: zi }, n = {};
2181
+ function Ui(e) {
2182
+ let t = { p: Bi }, n = {};
2188
2183
  for (let r of e) Ke(r), t[r.name] = r.component, n[r.name] = r.allowedAttributes;
2189
2184
  return {
2190
2185
  components: t,
2191
2186
  allowedTags: n
2192
2187
  };
2193
2188
  }
2194
- function Ui(t) {
2189
+ function Wi(t) {
2195
2190
  let n = e(10), r, i;
2196
2191
  n[0] === t ? (r = n[1], i = n[2]) : ({elements: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
2197
2192
  let a;
2198
2193
  n[3] === r ? a = n[4] : (a = r ?? [], n[3] = r, n[4] = a);
2199
2194
  let o;
2200
- n[5] === a ? o = n[6] : (o = Hi(a), n[5] = a, n[6] = o);
2195
+ n[5] === a ? o = n[6] : (o = Ui(a), n[5] = a, n[6] = o);
2201
2196
  let s = o, c;
2202
- return n[7] !== i || n[8] !== s ? (c = /* @__PURE__ */ L(J, {
2197
+ return n[7] !== i || n[8] !== s ? (c = /* @__PURE__ */ L(Y, {
2203
2198
  ...s,
2204
2199
  ...i
2205
2200
  }), n[7] = i, n[8] = s, n[9] = c) : c = n[9], c;
2206
2201
  }
2207
2202
  //#endregion
2208
2203
  //#region src/lib/renderers/render-part.tsx
2209
- function Wi(t) {
2204
+ function Gi(t) {
2210
2205
  let n = e(23), { part: r } = t, { addToolApprovalResponse: i } = U();
2211
2206
  if (r.state !== "approval-requested") return null;
2212
2207
  let a;
@@ -2259,7 +2254,7 @@ function Wi(t) {
2259
2254
  children: [u, p]
2260
2255
  }), n[19] = s, n[20] = u, n[21] = p, n[22] = m) : m = n[22], m;
2261
2256
  }
2262
- function Gi(t) {
2257
+ function Ki(t) {
2263
2258
  let n = e(22), { part: r } = t, { registry: i } = V();
2264
2259
  if (r.input === void 0) {
2265
2260
  let e;
@@ -2269,7 +2264,7 @@ function Gi(t) {
2269
2264
  }) : /* @__PURE__ */ L(ft, { className: "size-4 animate-spin" }), n[0] = r.errorText, n[1] = r.output, n[2] = r.state, n[3] = e) : e = n[3], e;
2270
2265
  }
2271
2266
  let a;
2272
- n[4] === r ? a = n[5] : (a = /* @__PURE__ */ L(Wi, { part: r }), n[4] = r, n[5] = a);
2267
+ n[4] === r ? a = n[5] : (a = /* @__PURE__ */ L(Gi, { part: r }), n[4] = r, n[5] = a);
2273
2268
  let o = a;
2274
2269
  if (!i) return o;
2275
2270
  let s = i[r.type.replace("tool-", "")];
@@ -2296,8 +2291,8 @@ function Gi(t) {
2296
2291
  }
2297
2292
  //#endregion
2298
2293
  //#region src/lib/chat/message-parts.tsx
2299
- var Ki = { animation: "slideUp" };
2300
- function qi(t) {
2294
+ var qi = { animation: "slideUp" };
2295
+ function Ji(t) {
2301
2296
  let n = e(3), { filename: r, url: i } = t, a = r ?? "Attached image", o;
2302
2297
  return n[0] !== a || n[1] !== i ? (o = /* @__PURE__ */ L("img", {
2303
2298
  src: i,
@@ -2305,7 +2300,7 @@ function qi(t) {
2305
2300
  className: "max-h-64 rounded-md border object-contain"
2306
2301
  }), n[0] = a, n[1] = i, n[2] = o) : o = n[2], o;
2307
2302
  }
2308
- function Ji(t) {
2303
+ function Yi(t) {
2309
2304
  let n = e(16), { filename: r, mediaType: i, url: a } = t, o = r || "Untitled", s;
2310
2305
  n[0] !== i || n[1] !== o || n[2] !== a ? (s = a?.startsWith("data:") ? null : a && i.startsWith("video/") ? /* @__PURE__ */ L("video", {
2311
2306
  controls: !0,
@@ -2349,24 +2344,24 @@ function Ji(t) {
2349
2344
  children: [c, f]
2350
2345
  }), n[13] = c, n[14] = f, n[15] = p) : p = n[15], p;
2351
2346
  }
2352
- function Yi(t) {
2347
+ function Xi(t) {
2353
2348
  let n = e(4), { filename: r, mediaType: i, url: a } = t, o;
2354
- return n[0] !== r || n[1] !== i || n[2] !== a ? (o = i.startsWith("image/") ? /* @__PURE__ */ L(qi, {
2349
+ return n[0] !== r || n[1] !== i || n[2] !== a ? (o = i.startsWith("image/") ? /* @__PURE__ */ L(Ji, {
2355
2350
  filename: r,
2356
2351
  url: a
2357
- }) : /* @__PURE__ */ L(Ji, {
2352
+ }) : /* @__PURE__ */ L(Yi, {
2358
2353
  filename: r,
2359
2354
  mediaType: i,
2360
2355
  url: a
2361
2356
  }), n[0] = r, n[1] = i, n[2] = a, n[3] = o) : o = n[3], o;
2362
2357
  }
2363
- function Xi(t) {
2364
- let n = e(9), { text: r, elements: i, className: a } = t, { status: o } = bn(), s = Y(), c;
2358
+ function Zi(t) {
2359
+ let n = e(9), { text: r, elements: i, className: a } = t, { status: o } = xn(), s = X(), c;
2365
2360
  n[0] === a ? c = n[1] : (c = F("text-sm", a), n[0] = a, n[1] = c);
2366
2361
  let l = !s && o === "streaming", u;
2367
- n[2] !== i || n[3] !== l || n[4] !== r ? (u = /* @__PURE__ */ L(Ui, {
2362
+ n[2] !== i || n[3] !== l || n[4] !== r ? (u = /* @__PURE__ */ L(Wi, {
2368
2363
  elements: i,
2369
- animated: Ki,
2364
+ animated: qi,
2370
2365
  isAnimating: l,
2371
2366
  children: r
2372
2367
  }), n[2] = i, n[3] = l, n[4] = r, n[5] = u) : u = n[5];
@@ -2376,35 +2371,35 @@ function Xi(t) {
2376
2371
  children: u
2377
2372
  }), n[6] = c, n[7] = u, n[8] = d) : d = n[8], d;
2378
2373
  }
2379
- function Zi(t) {
2380
- let n = e(8), { part: r } = t, i = Qi(), a;
2381
- n[0] !== r || n[1] !== i ? (a = i && /* @__PURE__ */ L(fi, { part: r }), n[0] = r, n[1] = i, n[2] = a) : a = n[2];
2374
+ function Qi(t) {
2375
+ let n = e(8), { part: r } = t, i = $i(), a;
2376
+ n[0] !== r || n[1] !== i ? (a = i && /* @__PURE__ */ L(pi, { part: r }), n[0] = r, n[1] = i, n[2] = a) : a = n[2];
2382
2377
  let o;
2383
- n[3] === r ? o = n[4] : (o = /* @__PURE__ */ L(Gi, { part: r }), n[3] = r, n[4] = o);
2378
+ n[3] === r ? o = n[4] : (o = /* @__PURE__ */ L(Ki, { part: r }), n[3] = r, n[4] = o);
2384
2379
  let s;
2385
2380
  return n[5] !== a || n[6] !== o ? (s = /* @__PURE__ */ R(I, { children: [a, o] }), n[5] = a, n[6] = o, n[7] = s) : s = n[7], s;
2386
2381
  }
2387
- function Qi() {
2388
- let { debugMode: e } = V(), t = Y();
2382
+ function $i() {
2383
+ let { debugMode: e } = V(), t = X();
2389
2384
  return !!e && !t;
2390
2385
  }
2391
2386
  //#endregion
2392
2387
  //#region src/lib/chat/trajectory/tool-label.tsx
2393
- function $i(e) {
2388
+ function ea(e) {
2394
2389
  return !!e && e !== "output-available";
2395
2390
  }
2396
- function ea(t) {
2397
- let n = e(5), { label: r, part: i, state: a } = t, o = Y(), s;
2398
- return n[0] !== o || n[1] !== r || n[2] !== i || n[3] !== a ? (s = !o && !!r.actions && !!i && !$i(a), n[0] = o, n[1] = r, n[2] = i, n[3] = a, n[4] = s) : s = n[4], s;
2399
- }
2400
2391
  function ta(t) {
2392
+ let n = e(5), { label: r, part: i, state: a } = t, o = X(), s;
2393
+ return n[0] !== o || n[1] !== r || n[2] !== i || n[3] !== a ? (s = !o && !!r.actions && !!i && !ea(a), n[0] = o, n[1] = r, n[2] = i, n[3] = a, n[4] = s) : s = n[4], s;
2394
+ }
2395
+ function na(t) {
2401
2396
  let n = e(18), { label: r, part: i } = t, a = r.icon, o = r.actions, s;
2402
2397
  n[0] !== r || n[1] !== i ? (s = {
2403
2398
  label: r,
2404
2399
  part: i,
2405
2400
  state: i.state
2406
2401
  }, n[0] = r, n[1] = i, n[2] = s) : s = n[2];
2407
- let c = ea(s), l;
2402
+ let c = ta(s), l;
2408
2403
  n[3] !== a || n[4] !== r.isError ? (l = a && /* @__PURE__ */ L(a, { className: F("size-3.5", r.isError ? "text-destructive" : "text-muted-foreground") }), n[3] = a, n[4] = r.isError, n[5] = l) : l = n[5];
2409
2404
  let u;
2410
2405
  n[6] === r.name ? u = n[7] : (u = /* @__PURE__ */ L("span", {
@@ -2424,7 +2419,7 @@ function ta(t) {
2424
2419
  children: [d, f]
2425
2420
  }), n[15] = d, n[16] = f, n[17] = p) : p = n[17], p;
2426
2421
  }
2427
- function na(t) {
2422
+ function ra(t) {
2428
2423
  let n = e(3), { name: r, value: i } = t, a;
2429
2424
  return n[0] !== r || n[1] !== i ? (a = /* @__PURE__ */ R("span", {
2430
2425
  "data-slot": "tool-arg",
@@ -2436,15 +2431,15 @@ function na(t) {
2436
2431
  ]
2437
2432
  }), n[0] = r, n[1] = i, n[2] = a) : a = n[2], a;
2438
2433
  }
2439
- function ra(t) {
2434
+ function ia(t) {
2440
2435
  let n = e(23), { label: r, state: i, part: a, children: o } = t, s = r.actions, c;
2441
2436
  n[0] !== r || n[1] !== a || n[2] !== i ? (c = {
2442
2437
  label: r,
2443
2438
  part: a,
2444
2439
  state: i
2445
2440
  }, n[0] = r, n[1] = a, n[2] = i, n[3] = c) : c = n[3];
2446
- let l = ea(c), u;
2447
- n[4] === r.args ? u = n[5] : (u = r.args ? Object.entries(r.args).map(ia) : "...", n[4] = r.args, n[5] = u);
2441
+ let l = ta(c), u;
2442
+ n[4] === r.args ? u = n[5] : (u = r.args ? Object.entries(r.args).map(aa) : "...", n[4] = r.args, n[5] = u);
2448
2443
  let d;
2449
2444
  n[6] !== o || n[7] !== r.name || n[8] !== u ? (d = /* @__PURE__ */ R("span", {
2450
2445
  className: "text-muted-foreground min-w-0 truncate font-mono text-xs [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:mr-1 [&>[data-slot=tool-arg]+[data-slot=tool-arg]]:before:content-[',']",
@@ -2477,25 +2472,25 @@ function ra(t) {
2477
2472
  children: [p, m]
2478
2473
  }), n[20] = p, n[21] = m, n[22] = h) : h = n[22], h;
2479
2474
  }
2480
- function ia(e) {
2475
+ function aa(e) {
2481
2476
  let [t, n] = e;
2482
- return /* @__PURE__ */ L(na, {
2477
+ return /* @__PURE__ */ L(ra, {
2483
2478
  name: t,
2484
2479
  value: n
2485
2480
  }, t);
2486
2481
  }
2487
2482
  //#endregion
2488
2483
  //#region src/lib/chat/trajectory/segments/index.tsx
2489
- function aa(e) {
2484
+ function oa(e) {
2490
2485
  return e.type === "text" && e.providerMetadata?.openai?.phase === "commentary";
2491
2486
  }
2492
- function oa(t) {
2487
+ function sa(t) {
2493
2488
  let n = e(9), { segment: r, elements: i, className: a } = t, o;
2494
2489
  if (n[0] !== a || n[1] !== i || n[2] !== r.parts) {
2495
2490
  let e;
2496
2491
  n[4] !== a || n[5] !== i ? (e = (e) => {
2497
2492
  let { part: t, idx: n } = e;
2498
- return t.type === "text" ? /* @__PURE__ */ L(Xi, {
2493
+ return t.type === "text" ? /* @__PURE__ */ L(Zi, {
2499
2494
  text: t.text,
2500
2495
  elements: i,
2501
2496
  className: a
@@ -2505,26 +2500,26 @@ function oa(t) {
2505
2500
  let s;
2506
2501
  return n[7] === o ? s = n[8] : (s = /* @__PURE__ */ L(I, { children: o }), n[7] = o, n[8] = s), s;
2507
2502
  }
2508
- function sa(t) {
2503
+ function ca(t) {
2509
2504
  let n = e(4), { segment: r } = t, { part: i } = r;
2510
2505
  if (i.type !== "file") return null;
2511
2506
  let a;
2512
- return n[0] !== i.filename || n[1] !== i.mediaType || n[2] !== i.url ? (a = /* @__PURE__ */ L(Yi, {
2507
+ return n[0] !== i.filename || n[1] !== i.mediaType || n[2] !== i.url ? (a = /* @__PURE__ */ L(Xi, {
2513
2508
  filename: i.filename,
2514
2509
  mediaType: i.mediaType,
2515
2510
  url: i.url
2516
2511
  }), n[0] = i.filename, n[1] = i.mediaType, n[2] = i.url, n[3] = a) : a = n[3], a;
2517
2512
  }
2518
- function ca(t) {
2513
+ function la(t) {
2519
2514
  let n = e(9), { segment: r } = t, { messages: i } = U(), a;
2520
- n[0] === i ? a = n[1] : (a = Sn(i), n[0] = i, n[1] = a);
2515
+ n[0] === i ? a = n[1] : (a = Cn(i), n[0] = i, n[1] = a);
2521
2516
  let o = a, s;
2522
2517
  if (n[2] !== r.parts || n[3] !== o) {
2523
2518
  let e;
2524
2519
  n[5] === o ? e = n[6] : (e = (e) => {
2525
2520
  let { part: t, idx: n } = e;
2526
2521
  if (t.type !== "source-url") return null;
2527
- let r = Cn(o, t.url);
2522
+ let r = wn(o, t.url);
2528
2523
  return r === null ? null : /* @__PURE__ */ L(yr, {
2529
2524
  source: {
2530
2525
  url: t.url,
@@ -2537,45 +2532,45 @@ function ca(t) {
2537
2532
  let c;
2538
2533
  return n[7] === s ? c = n[8] : (c = /* @__PURE__ */ L("span", { children: s }), n[7] = s, n[8] = c), c;
2539
2534
  }
2540
- function la(t) {
2541
- let n = e(3), { segment: r } = t, i = G();
2542
- if (Y()) return null;
2535
+ function ua(t) {
2536
+ let n = e(3), { segment: r } = t, i = K();
2537
+ if (X()) return null;
2543
2538
  let { part: a } = r;
2544
2539
  if (a.type !== "reasoning") return null;
2545
2540
  let o = i === "streaming", s;
2546
2541
  return n[0] !== a.text || n[1] !== o ? (s = /* @__PURE__ */ L("div", {
2547
2542
  className: "text-muted-foreground text-xs",
2548
- children: /* @__PURE__ */ L(J, {
2549
- animated: Ki,
2543
+ children: /* @__PURE__ */ L(Y, {
2544
+ animated: qi,
2550
2545
  isAnimating: o,
2551
2546
  children: a.text
2552
2547
  })
2553
2548
  }), n[0] = a.text, n[1] = o, n[2] = s) : s = n[2], s;
2554
2549
  }
2555
- function ua(t) {
2550
+ function da(t) {
2556
2551
  let n = e(2), { segment: r } = t;
2557
- if (!Qi()) return null;
2552
+ if (!$i()) return null;
2558
2553
  let { part: i } = r;
2559
2554
  if (i.type !== "dynamic-tool") return null;
2560
2555
  let a;
2561
- return n[0] === i ? a = n[1] : (a = /* @__PURE__ */ L(pi, { part: i }), n[0] = i, n[1] = a), a;
2556
+ return n[0] === i ? a = n[1] : (a = /* @__PURE__ */ L(mi, { part: i }), n[0] = i, n[1] = a), a;
2562
2557
  }
2563
- var da = s(null), fa = s(null);
2564
- function pa() {
2565
- let e = f(da);
2558
+ var fa = s(null), pa = s(null);
2559
+ function ma() {
2560
+ let e = f(fa);
2566
2561
  if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
2567
2562
  return e;
2568
2563
  }
2569
- function ma(t) {
2570
- let n = e(31), { segment: r, children: i } = t, a = V(), o = G(), s, c, l, u, d, f;
2564
+ function ha(t) {
2565
+ let n = e(31), { segment: r, children: i } = t, a = V(), o = K(), s, c, l, u, d, f;
2571
2566
  if (n[0] !== a.registry || n[1] !== r || n[2] !== o) {
2572
2567
  u = Symbol.for("react.early_return_sentinel");
2573
2568
  bb0: {
2574
- if ({toolEntry: d} = Li(r.part, a.registry), {part: f} = r, !T(f)) {
2569
+ if ({toolEntry: d} = Ri(r.part, a.registry), {part: f} = r, !T(f)) {
2575
2570
  u = null;
2576
2571
  break bb0;
2577
2572
  }
2578
- c = Ri(d, f.state), s = !c && En(f, o), l = d?.label?.(f);
2573
+ c = zi(d, f.state), s = !c && Dn(f, o), l = d?.label?.(f);
2579
2574
  }
2580
2575
  n[0] = a.registry, n[1] = r, n[2] = o, n[3] = s, n[4] = c, n[5] = l, n[6] = u, n[7] = d, n[8] = f;
2581
2576
  } else s = n[3], c = n[4], l = n[5], u = n[6], d = n[7], f = n[8];
@@ -2601,37 +2596,37 @@ function ma(t) {
2601
2596
  aborted: s
2602
2597
  }, n[19] = s, n[20] = h, n[21] = f.state, n[22] = v) : v = n[22];
2603
2598
  let y;
2604
- n[23] === i ? y = n[24] : (y = i ?? /* @__PURE__ */ L(ga, {}), n[23] = i, n[24] = y);
2599
+ n[23] === i ? y = n[24] : (y = i ?? /* @__PURE__ */ L(_a, {}), n[23] = i, n[24] = y);
2605
2600
  let b;
2606
- n[25] !== v || n[26] !== y ? (b = /* @__PURE__ */ L(fa, {
2601
+ n[25] !== v || n[26] !== y ? (b = /* @__PURE__ */ L(pa, {
2607
2602
  value: v,
2608
2603
  children: y
2609
2604
  }), n[25] = v, n[26] = y, n[27] = b) : b = n[27];
2610
2605
  let x;
2611
- return n[28] !== _ || n[29] !== b ? (x = /* @__PURE__ */ L(da, {
2606
+ return n[28] !== _ || n[29] !== b ? (x = /* @__PURE__ */ L(fa, {
2612
2607
  value: _,
2613
2608
  children: b
2614
2609
  }), n[28] = _, n[29] = b, n[30] = x) : x = n[30], x;
2615
2610
  }
2616
- function ha() {
2617
- let t = e(2), { part: n, activeClientInput: r } = pa();
2611
+ function ga() {
2612
+ let t = e(2), { part: n, activeClientInput: r } = ma();
2618
2613
  if (r) return null;
2619
2614
  let i;
2620
- return t[0] === n ? i = t[1] : (i = /* @__PURE__ */ L(Zi, { part: n }), t[0] = n, t[1] = i), i;
2615
+ return t[0] === n ? i = t[1] : (i = /* @__PURE__ */ L(Qi, { part: n }), t[0] = n, t[1] = i), i;
2621
2616
  }
2622
- function ga(t) {
2623
- let n = e(9), { children: r } = t, { part: i, label: a, defaultOpen: o } = pa();
2617
+ function _a(t) {
2618
+ let n = e(9), { children: r } = t, { part: i, label: a, defaultOpen: o } = ma();
2624
2619
  if (!a) {
2625
2620
  let e;
2626
2621
  return n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ L("div", {
2627
2622
  className: "min-w-0 flex-1",
2628
- children: /* @__PURE__ */ L(ha, {})
2623
+ children: /* @__PURE__ */ L(ga, {})
2629
2624
  }), n[0] = e) : e = n[0], e;
2630
2625
  }
2631
2626
  let s;
2632
2627
  n[1] !== r || n[2] !== a || n[3] !== i ? (s = /* @__PURE__ */ L(P, {
2633
2628
  className: "cursor-pointer",
2634
- children: /* @__PURE__ */ L(ra, {
2629
+ children: /* @__PURE__ */ L(ia, {
2635
2630
  label: a,
2636
2631
  state: i.state,
2637
2632
  part: i,
@@ -2641,7 +2636,7 @@ function ga(t) {
2641
2636
  let c;
2642
2637
  n[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ L(N, {
2643
2638
  className: "mb-2",
2644
- children: /* @__PURE__ */ L(ha, {})
2639
+ children: /* @__PURE__ */ L(ga, {})
2645
2640
  }), n[5] = c) : c = n[5];
2646
2641
  let l;
2647
2642
  return n[6] !== o || n[7] !== s ? (l = /* @__PURE__ */ R(M, {
@@ -2650,32 +2645,32 @@ function ga(t) {
2650
2645
  children: [s, c]
2651
2646
  }), n[6] = o, n[7] = s, n[8] = l) : l = n[8], l;
2652
2647
  }
2653
- var X = {
2654
- Text: oa,
2655
- File: sa,
2656
- Source: ca,
2657
- Reasoning: la,
2658
- DynamicTool: ua,
2659
- Tool: ma,
2660
- ToolDisclosure: ga,
2661
- ToolContent: ha
2648
+ var Z = {
2649
+ Text: sa,
2650
+ File: ca,
2651
+ Source: la,
2652
+ Reasoning: ua,
2653
+ DynamicTool: da,
2654
+ Tool: ha,
2655
+ ToolDisclosure: _a,
2656
+ ToolContent: ga
2662
2657
  };
2663
2658
  //#endregion
2664
2659
  //#region src/lib/chat/trajectory/trajectory-segments.ts
2665
- function _a(e) {
2660
+ function va(e) {
2666
2661
  return T(e) ? "tool" : e.type === "dynamic-tool" ? "dynamic-tool" : e.type === "reasoning" && "text" in e && e.text ? "reasoning" : null;
2667
2662
  }
2668
- function va(e, t) {
2663
+ function ya(e, t) {
2669
2664
  return e.kind === "text" || e.kind === "file" || e.kind === "source" ? !1 : e.kind === "reasoning" || e.kind !== "dynamic-tool" || !!t;
2670
2665
  }
2671
- function ya(e, t, n) {
2666
+ function ba(e, t, n) {
2672
2667
  let r = e[t + 1];
2673
- return !!r && va(r, n);
2668
+ return !!r && ya(r, n);
2674
2669
  }
2675
- function ba(e) {
2670
+ function xa(e) {
2676
2671
  let t = [];
2677
2672
  for (let n = 0; n < e.length; n++) {
2678
- let r = e[n], i = _a(r);
2673
+ let r = e[n], i = va(r);
2679
2674
  if (i) t.push({
2680
2675
  kind: i,
2681
2676
  part: r,
@@ -2714,13 +2709,13 @@ function ba(e) {
2714
2709
  }
2715
2710
  return t;
2716
2711
  }
2717
- function Z(e, t) {
2712
+ function Q(e, t) {
2718
2713
  return e.kind === "text" || e.kind === "source" ? e.parts[0]?.idx ?? t : e.idx;
2719
2714
  }
2720
2715
  //#endregion
2721
2716
  //#region src/lib/chat/trajectory/nested-trajectory.tsx
2722
- function xa(e, t) {
2723
- let n = `${Z(e, t)}:${e.kind}`;
2717
+ function Sa(e, t) {
2718
+ let n = `${Q(e, t)}:${e.kind}`;
2724
2719
  if (e.kind === "text") return `${n}:${e.parts.map(({ part: e }) => e.type === "text" ? e.text : "").join("")}`;
2725
2720
  if (e.kind === "reasoning" && e.part.type === "reasoning") return `${n}:${e.part.text}`;
2726
2721
  if ((e.kind === "tool" || e.kind === "dynamic-tool") && D(e.part)) {
@@ -2729,38 +2724,38 @@ function xa(e, t) {
2729
2724
  }
2730
2725
  return e.kind === "file" && e.part.type === "file" ? `${n}:${e.part.url}:${e.part.mediaType}:${e.part.filename ?? ""}` : n;
2731
2726
  }
2732
- function Sa(e, t, n) {
2727
+ function Ca(e, t, n) {
2733
2728
  return e.kind === "file" || e.kind === "source" ? !0 : e.kind === "tool" || e.kind === "dynamic-tool" ? D(e.part) ? e.part.state === "output-error" || e.part.state === "output-available" && e.part.preliminary !== !0 : !1 : t < n - 1;
2734
2729
  }
2735
- var Ca = u(function(t) {
2730
+ var wa = u(function(t) {
2736
2731
  let n = e(8), { segment: r } = t;
2737
2732
  if (r.kind === "tool") {
2738
2733
  let e;
2739
- return n[0] === r ? e = n[1] : (e = /* @__PURE__ */ L(X.Tool, { segment: r }), n[0] = r, n[1] = e), e;
2734
+ return n[0] === r ? e = n[1] : (e = /* @__PURE__ */ L(Z.Tool, { segment: r }), n[0] = r, n[1] = e), e;
2740
2735
  }
2741
2736
  if (r.kind === "reasoning") {
2742
2737
  let e;
2743
- return n[2] === r ? e = n[3] : (e = /* @__PURE__ */ L(X.Reasoning, { segment: r }), n[2] = r, n[3] = e), e;
2738
+ return n[2] === r ? e = n[3] : (e = /* @__PURE__ */ L(Z.Reasoning, { segment: r }), n[2] = r, n[3] = e), e;
2744
2739
  }
2745
2740
  if (r.kind === "text") {
2746
2741
  let e;
2747
- return n[4] === r ? e = n[5] : (e = /* @__PURE__ */ L(X.Text, {
2742
+ return n[4] === r ? e = n[5] : (e = /* @__PURE__ */ L(Z.Text, {
2748
2743
  segment: r,
2749
2744
  className: "text-xs"
2750
2745
  }), n[4] = r, n[5] = e), e;
2751
2746
  }
2752
2747
  if (r.kind === "file") {
2753
2748
  let e;
2754
- return n[6] === r ? e = n[7] : (e = /* @__PURE__ */ L(X.File, { segment: r }), n[6] = r, n[7] = e), e;
2749
+ return n[6] === r ? e = n[7] : (e = /* @__PURE__ */ L(Z.File, { segment: r }), n[6] = r, n[7] = e), e;
2755
2750
  }
2756
2751
  return null;
2757
- }, wa);
2758
- function wa(e, t) {
2752
+ }, Ta);
2753
+ function Ta(e, t) {
2759
2754
  return e.complete && t.complete && e.cacheKey === t.cacheKey;
2760
2755
  }
2761
- function Ta(t) {
2756
+ function Ea(t) {
2762
2757
  let n = e(11), { parts: r, className: i } = t, a;
2763
- n[0] === r ? a = n[1] : (a = ba(r), n[0] = r, n[1] = a);
2758
+ n[0] === r ? a = n[1] : (a = xa(r), n[0] = r, n[1] = a);
2764
2759
  let o = a;
2765
2760
  if (o.length === 0) return null;
2766
2761
  let s;
@@ -2769,11 +2764,11 @@ function Ta(t) {
2769
2764
  if (n[4] !== o) {
2770
2765
  let e;
2771
2766
  n[6] === o.length ? e = n[7] : (e = (e, t) => {
2772
- let n = `${Z(e, t)}-${e.kind}`;
2773
- return /* @__PURE__ */ L(Ca, {
2767
+ let n = `${Q(e, t)}-${e.kind}`;
2768
+ return /* @__PURE__ */ L(wa, {
2774
2769
  segment: e,
2775
- cacheKey: xa(e, t),
2776
- complete: Sa(e, t, o.length)
2770
+ cacheKey: Sa(e, t),
2771
+ complete: Ca(e, t, o.length)
2777
2772
  }, n);
2778
2773
  }, n[6] = o.length, n[7] = e), c = o.map(e), n[4] = o, n[5] = c;
2779
2774
  } else c = n[5];
@@ -2785,7 +2780,7 @@ function Ta(t) {
2785
2780
  }
2786
2781
  //#endregion
2787
2782
  //#region src/lib/components/ChatAction.tsx
2788
- function Q(t) {
2783
+ function $(t) {
2789
2784
  let n = e(12), r, i, a;
2790
2785
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({icon: i, className: r, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
2791
2786
  let o;
@@ -2805,13 +2800,13 @@ function Q(t) {
2805
2800
  }
2806
2801
  //#endregion
2807
2802
  //#region src/lib/chat/trajectory/trajectories/message-actions.tsx
2808
- function Ea() {
2809
- let { index: e } = K(), { messages: t } = W(), n = G();
2803
+ function Da() {
2804
+ let { index: e } = q(), { messages: t } = G(), n = K();
2810
2805
  return !(e === t.length - 1 && (n === "submitted" || n === "streaming" || n === "error"));
2811
2806
  }
2812
- function Da(t) {
2807
+ function Oa(t) {
2813
2808
  let n = e(5), { className: r, children: i } = t;
2814
- if (!Ea() || a.toArray(i).length === 0) return null;
2809
+ if (!Da() || a.toArray(i).length === 0) return null;
2815
2810
  let o;
2816
2811
  n[0] === r ? o = n[1] : (o = F("mt-1 flex items-center gap-0.5", r), n[0] = r, n[1] = o);
2817
2812
  let s;
@@ -2821,45 +2816,45 @@ function Da(t) {
2821
2816
  children: i
2822
2817
  }), n[2] = i, n[3] = o, n[4] = s) : s = n[4], s;
2823
2818
  }
2824
- function Oa(t) {
2825
- let n = e(12), { className: r } = t, { message: i } = K(), [a, o] = ni(), s = a ? "Copied" : "Copy message", c;
2819
+ function ka(t) {
2820
+ let n = e(12), { className: r } = t, { message: i } = q(), [a, o] = ni(), s = a ? "Copied" : "Copy message", c;
2826
2821
  n[0] === r ? c = n[1] : (c = F("p-1.5", r), n[0] = r, n[1] = c);
2827
2822
  let l;
2828
- n[2] !== o || n[3] !== i ? (l = () => o(Ni(i)), n[2] = o, n[3] = i, n[4] = l) : l = n[4];
2823
+ n[2] !== o || n[3] !== i ? (l = () => void o(Pi(i)), n[2] = o, n[3] = i, n[4] = l) : l = n[4];
2829
2824
  let u;
2830
2825
  n[5] === a ? u = n[6] : (u = L(a ? Qe : ot, { className: "size-3.5" }), n[5] = a, n[6] = u);
2831
2826
  let d;
2832
- return n[7] !== s || n[8] !== c || n[9] !== l || n[10] !== u ? (d = /* @__PURE__ */ L(Q, {
2827
+ return n[7] !== s || n[8] !== c || n[9] !== l || n[10] !== u ? (d = /* @__PURE__ */ L($, {
2833
2828
  "aria-label": s,
2834
2829
  className: c,
2835
2830
  onClick: l,
2836
2831
  icon: u
2837
2832
  }), n[7] = s, n[8] = c, n[9] = l, n[10] = u, n[11] = d) : d = n[11], d;
2838
2833
  }
2839
- function ka(t) {
2840
- let n = e(9), { className: r } = t, { message: i } = K(), { regenerate: a } = U(), o;
2834
+ function Aa(t) {
2835
+ let n = e(9), { className: r } = t, { message: i } = q(), { regenerate: a } = U(), o;
2841
2836
  n[0] === r ? o = n[1] : (o = F("p-1.5", r), n[0] = r, n[1] = o);
2842
2837
  let s;
2843
- n[2] !== i.id || n[3] !== a ? (s = () => a({ messageId: i.id }), n[2] = i.id, n[3] = a, n[4] = s) : s = n[4];
2838
+ n[2] !== i.id || n[3] !== a ? (s = () => void a({ messageId: i.id }), n[2] = i.id, n[3] = a, n[4] = s) : s = n[4];
2844
2839
  let c;
2845
2840
  n[5] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ L(bt, { className: "size-3.5" }), n[5] = c) : c = n[5];
2846
2841
  let l;
2847
- return n[6] !== o || n[7] !== s ? (l = /* @__PURE__ */ L(Q, {
2842
+ return n[6] !== o || n[7] !== s ? (l = /* @__PURE__ */ L($, {
2848
2843
  "aria-label": "Regenerate response",
2849
2844
  className: o,
2850
2845
  onClick: s,
2851
2846
  icon: c
2852
2847
  }), n[6] = o, n[7] = s, n[8] = l) : l = n[8], l;
2853
2848
  }
2854
- function Aa(t) {
2855
- let n = e(12), { className: r } = t, { message: i } = K(), [a, o] = ni(), s = a ? "Copied" : "Copy debug JSON", c;
2849
+ function ja(t) {
2850
+ let n = e(12), { className: r } = t, { message: i } = q(), [a, o] = ni(), s = a ? "Copied" : "Copy debug JSON", c;
2856
2851
  n[0] === r ? c = n[1] : (c = F("p-1.5", r), n[0] = r, n[1] = c);
2857
2852
  let l;
2858
- n[2] !== o || n[3] !== i ? (l = () => o(JSON.stringify(i, null, 2)), n[2] = o, n[3] = i, n[4] = l) : l = n[4];
2853
+ n[2] !== o || n[3] !== i ? (l = () => void o(JSON.stringify(i, null, 2)), n[2] = o, n[3] = i, n[4] = l) : l = n[4];
2859
2854
  let u;
2860
2855
  n[5] === a ? u = n[6] : (u = L(a ? Qe : Ze, { className: "size-3.5" }), n[5] = a, n[6] = u);
2861
2856
  let d;
2862
- return n[7] !== s || n[8] !== c || n[9] !== l || n[10] !== u ? (d = /* @__PURE__ */ L(Q, {
2857
+ return n[7] !== s || n[8] !== c || n[9] !== l || n[10] !== u ? (d = /* @__PURE__ */ L($, {
2863
2858
  "aria-label": s,
2864
2859
  className: c,
2865
2860
  onClick: l,
@@ -2868,11 +2863,11 @@ function Aa(t) {
2868
2863
  }
2869
2864
  //#endregion
2870
2865
  //#region src/lib/chat/trajectory/trajectories/messages-error.tsx
2871
- function ja(t) {
2866
+ function Ma(t) {
2872
2867
  let n = e(7), { onTryAgain: r, error: i } = t, a = i instanceof Error ? i.message : "An error occurred. Please try again.", o;
2873
2868
  n[0] === a ? o = n[1] : (o = /* @__PURE__ */ L("div", {
2874
2869
  className: "text-destructive text-sm",
2875
- children: /* @__PURE__ */ L(J, {
2870
+ children: /* @__PURE__ */ L(Y, {
2876
2871
  mode: "static",
2877
2872
  children: a
2878
2873
  })
@@ -2894,18 +2889,18 @@ function ja(t) {
2894
2889
  })
2895
2890
  }), n[4] = o, n[5] = s, n[6] = c) : c = n[6], c;
2896
2891
  }
2897
- function Ma(t) {
2892
+ function Na(t) {
2898
2893
  let n = e(3), { error: r, onRetry: i } = t;
2899
2894
  if (!r || !i) return null;
2900
2895
  let a;
2901
- return n[0] !== r || n[1] !== i ? (a = /* @__PURE__ */ L(ja, {
2896
+ return n[0] !== r || n[1] !== i ? (a = /* @__PURE__ */ L(Ma, {
2902
2897
  onTryAgain: i,
2903
2898
  error: r
2904
2899
  }), n[0] = r, n[1] = i, n[2] = a) : a = n[2], a;
2905
2900
  }
2906
2901
  //#endregion
2907
2902
  //#region src/lib/chat/trajectory/trajectories/messages-shell.tsx
2908
- function Na(t) {
2903
+ function Pa(t) {
2909
2904
  let n = e(14), { messages: r, className: i, elements: a, status: o, children: s } = t, c;
2910
2905
  n[0] !== a || n[1] !== r || n[2] !== o ? (c = {
2911
2906
  messages: r,
@@ -2930,7 +2925,7 @@ function Na(t) {
2930
2925
  children: f
2931
2926
  }), n[11] = f, n[12] = l, n[13] = p) : p = n[13], p;
2932
2927
  }
2933
- function Pa(t) {
2928
+ function Fa(t) {
2934
2929
  let n = e(5), { className: r, children: i } = t, a;
2935
2930
  n[0] === r ? a = n[1] : (a = F("flex flex-col gap-4", r), n[0] = r, n[1] = a);
2936
2931
  let o;
@@ -2939,7 +2934,7 @@ function Pa(t) {
2939
2934
  children: i
2940
2935
  }), n[2] = i, n[3] = a, n[4] = o) : o = n[4], o;
2941
2936
  }
2942
- function Fa(t) {
2937
+ function Ia(t) {
2943
2938
  let n = e(9), { message: r, index: i, className: a, children: o } = t, s;
2944
2939
  n[0] !== i || n[1] !== r ? (s = {
2945
2940
  message: r,
@@ -2958,7 +2953,7 @@ function Fa(t) {
2958
2953
  }
2959
2954
  //#endregion
2960
2955
  //#region src/lib/components/PendingToolInput.tsx
2961
- function Ia() {
2956
+ function La() {
2962
2957
  let { registry: e } = V(), t = U().messages;
2963
2958
  return v(() => {
2964
2959
  if (!e) return null;
@@ -2979,8 +2974,8 @@ function Ia() {
2979
2974
  return null;
2980
2975
  }, [t, e]);
2981
2976
  }
2982
- function La(t) {
2983
- let n = e(10), { children: r, className: a } = t, o = Ia(), s = o?.entry.component, c = o ? "hidden" : "visible", l;
2977
+ function Ra(t) {
2978
+ let n = e(10), { children: r, className: a } = t, o = La(), s = o?.entry.component, c = o ? "hidden" : "visible", l;
2984
2979
  n[0] !== r || n[1] !== c ? (l = /* @__PURE__ */ L(i, {
2985
2980
  mode: c,
2986
2981
  children: r
@@ -2995,7 +2990,7 @@ function La(t) {
2995
2990
  }
2996
2991
  //#endregion
2997
2992
  //#region src/lib/chat/trajectory/trajectories/thinking-hint.ts
2998
- function Ra(e, t) {
2993
+ function za(e, t) {
2999
2994
  if (e === "error" || e === "ready" || !t) return null;
3000
2995
  if (t.role !== "assistant") return "Thinking...";
3001
2996
  for (let e = t.parts.length - 1; e >= 0; e--) {
@@ -3006,17 +3001,15 @@ function Ra(e, t) {
3006
3001
  let n = t.parts[e];
3007
3002
  if (w(n) && n.text) return n.text;
3008
3003
  if (D(n)) {
3009
- if (n.input) {
3010
- let e = n.input;
3011
- for (let t of [
3012
- "reasoning",
3013
- "thoughts",
3014
- "thought",
3015
- "hint"
3016
- ]) {
3017
- let n = e[t];
3018
- if (typeof n == "string" && n.length > 0) return n;
3019
- }
3004
+ let e = n.input;
3005
+ if (Wt(e)) for (let t of [
3006
+ "reasoning",
3007
+ "thoughts",
3008
+ "thought",
3009
+ "hint"
3010
+ ]) {
3011
+ let n = e[t];
3012
+ if (typeof n == "string" && n.length > 0) return n;
3020
3013
  }
3021
3014
  return n.toolCallId;
3022
3015
  }
@@ -3026,7 +3019,7 @@ function Ra(e, t) {
3026
3019
  }
3027
3020
  //#endregion
3028
3021
  //#region src/lib/chat/trajectory/trajectories/timeline-dot.tsx
3029
- function za(t) {
3022
+ function Ba(t) {
3030
3023
  let n = e(5), { isLast: r } = t, i = r !== void 0 && r, a;
3031
3024
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ L("span", { className: "bg-muted-foreground/50 z-10 mt-1 size-2 shrink-0 rounded-full" }), n[0] = a) : a = n[0];
3032
3025
  let o;
@@ -3039,7 +3032,7 @@ function za(t) {
3039
3032
  }
3040
3033
  //#endregion
3041
3034
  //#region src/lib/chat/trajectory/trajectories/timeline-item.tsx
3042
- function Ba(t) {
3035
+ function Va(t) {
3043
3036
  let n = e(6), { marker: r, children: i, className: a } = t, o;
3044
3037
  n[0] === a ? o = n[1] : (o = F("relative z-0 flex gap-3 pl-5", a), n[0] = a, n[1] = o);
3045
3038
  let s;
@@ -3050,20 +3043,20 @@ function Ba(t) {
3050
3043
  }
3051
3044
  //#endregion
3052
3045
  //#region src/lib/chat/trajectory/trajectories/trajectory-thinking.tsx
3053
- function Va() {
3054
- let t = e(6), n = G(), { messages: r } = W(), i = Ia(), a = r[r.length - 1], o;
3055
- t[0] !== n || t[1] !== a ? (o = Ra(n, a), t[0] = n, t[1] = a, t[2] = o) : o = t[2];
3046
+ function Ha() {
3047
+ let t = e(6), n = K(), { messages: r } = G(), i = La(), a = r[r.length - 1], o;
3048
+ t[0] !== n || t[1] !== a ? (o = za(n, a), t[0] = n, t[1] = a, t[2] = o) : o = t[2];
3056
3049
  let s = o;
3057
3050
  if (!s || i) return null;
3058
3051
  let c;
3059
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ L(za, { isLast: !0 }), t[3] = c) : c = t[3];
3052
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ L(Ba, { isLast: !0 }), t[3] = c) : c = t[3];
3060
3053
  let l;
3061
- return t[4] === s ? l = t[5] : (l = /* @__PURE__ */ L(Ba, {
3054
+ return t[4] === s ? l = t[5] : (l = /* @__PURE__ */ L(Va, {
3062
3055
  className: "mt-2",
3063
3056
  marker: c,
3064
3057
  children: /* @__PURE__ */ L("span", {
3065
3058
  role: "status",
3066
- children: /* @__PURE__ */ L(kn, {
3059
+ children: /* @__PURE__ */ L(W, {
3067
3060
  as: "span",
3068
3061
  className: "text-muted-foreground line-clamp-2 font-mono text-xs",
3069
3062
  children: s
@@ -3073,13 +3066,13 @@ function Va() {
3073
3066
  }
3074
3067
  //#endregion
3075
3068
  //#region src/lib/chat/usage.ts
3076
- var $ = [
3069
+ var Ua = [
3077
3070
  "inputTokens",
3078
3071
  "outputTokens",
3079
3072
  "reasoningTokens",
3080
3073
  "cachedInputTokens",
3081
3074
  "totalTokens"
3082
- ], Ha = {
3075
+ ], Wa = {
3083
3076
  inputTokens: [["inputTokens"], ["raw", "prompt_tokens"]],
3084
3077
  outputTokens: [["outputTokens"], ["raw", "completion_tokens"]],
3085
3078
  reasoningTokens: [
@@ -3103,7 +3096,7 @@ var $ = [
3103
3096
  ],
3104
3097
  totalTokens: [["totalTokens"], ["raw", "total_tokens"]]
3105
3098
  };
3106
- function Ua(e) {
3099
+ function Ga(e) {
3107
3100
  if (typeof e == "number" && Number.isFinite(e) && e >= 0) return e;
3108
3101
  if (typeof e == "string" && e.trim().length > 0) {
3109
3102
  let t = Number(e);
@@ -3111,7 +3104,7 @@ function Ua(e) {
3111
3104
  }
3112
3105
  return null;
3113
3106
  }
3114
- function Wa(e) {
3107
+ function Ka(e) {
3115
3108
  if (!e || typeof e != "object") return null;
3116
3109
  let t = {
3117
3110
  inputTokens: null,
@@ -3120,21 +3113,19 @@ function Wa(e) {
3120
3113
  cachedInputTokens: null,
3121
3114
  totalTokens: null
3122
3115
  };
3123
- for (let n of $) for (let r of Ha[n]) {
3124
- let i = Ua(qt(e, r));
3116
+ for (let n of Ua) for (let r of Wa[n]) {
3117
+ let i = Ga(Jt(e, r));
3125
3118
  if (i !== null) {
3126
3119
  t[n] = i;
3127
3120
  break;
3128
3121
  }
3129
3122
  }
3130
- return $.some((e) => t[e] !== null) ? t : null;
3123
+ return Ua.some((e) => t[e] !== null) ? t : null;
3131
3124
  }
3132
- function Ga(e) {
3133
- if (!e || typeof e != "object") return null;
3134
- let t = e;
3135
- return Wa(t.totalUsage ?? t.usage);
3125
+ function qa(e) {
3126
+ return Wt(e) ? Ka(e.totalUsage ?? e.usage) : null;
3136
3127
  }
3137
- function Ka(e, t) {
3128
+ function Ja(e, t) {
3138
3129
  let n = {
3139
3130
  inputTokens: null,
3140
3131
  outputTokens: null,
@@ -3142,7 +3133,7 @@ function Ka(e, t) {
3142
3133
  cachedInputTokens: null,
3143
3134
  totalTokens: null
3144
3135
  };
3145
- for (let r of $) {
3136
+ for (let r of Ua) {
3146
3137
  let i = e[r];
3147
3138
  if (i === null) continue;
3148
3139
  if (!t) {
@@ -3154,9 +3145,9 @@ function Ka(e, t) {
3154
3145
  let o = i - a;
3155
3146
  o >= 0 && (n[r] = o);
3156
3147
  }
3157
- return $.some((e) => n[e] !== null) ? n : null;
3148
+ return Ua.some((e) => n[e] !== null) ? n : null;
3158
3149
  }
3159
- function qa(e) {
3150
+ function Ya(e) {
3160
3151
  if (e.length === 0) return null;
3161
3152
  let t = {
3162
3153
  inputTokens: null,
@@ -3165,7 +3156,7 @@ function qa(e) {
3165
3156
  cachedInputTokens: null,
3166
3157
  totalTokens: null
3167
3158
  };
3168
- for (let n of $) {
3159
+ for (let n of Ua) {
3169
3160
  let r = 0, i = !1;
3170
3161
  for (let t of e) {
3171
3162
  let e = t[n];
@@ -3173,34 +3164,34 @@ function qa(e) {
3173
3164
  }
3174
3165
  i && (t[n] = r);
3175
3166
  }
3176
- return $.some((e) => t[e] !== null) ? t : null;
3167
+ return Ua.some((e) => t[e] !== null) ? t : null;
3177
3168
  }
3178
- function Ja(e) {
3169
+ function Xa(e) {
3179
3170
  let t = {}, n = [], r = null, i = null;
3180
3171
  for (let a of e) {
3181
3172
  if (a.role !== "assistant") continue;
3182
- let e = a.metadata, o = Wa(e?.usage), s = Wa(e?.totalUsage), c = o ?? (s ? Ka(s, r) : null);
3173
+ let e = Wt(a.metadata) ? a.metadata : void 0, o = Ka(e?.usage), s = Ka(e?.totalUsage), c = o ?? (s ? Ja(s, r) : null);
3183
3174
  c && (t[a.id] = c, n.push(c)), s && (i = s, r = s);
3184
3175
  }
3185
3176
  return {
3186
3177
  assistantUsageByMessageId: t,
3187
- chatUsageSummary: i ?? qa(n)
3178
+ chatUsageSummary: i ?? Ya(n)
3188
3179
  };
3189
3180
  }
3190
- function Ya() {
3181
+ function Za() {
3191
3182
  let t = e(2), n = U(), r;
3192
- return t[0] === n.messages ? r = t[1] : (r = Ja(n.messages), t[0] = n.messages, t[1] = r), r;
3183
+ return t[0] === n.messages ? r = t[1] : (r = Xa(n.messages), t[0] = n.messages, t[1] = r), r;
3193
3184
  }
3194
- function Xa(e) {
3195
- return Yt(e);
3185
+ function Qa(e) {
3186
+ return Xt(e);
3196
3187
  }
3197
- function Za(e) {
3198
- let t = [`↑ ${Jt(e.inputTokens)}`, `↓ ${Jt(e.outputTokens)}`];
3199
- return e.totalTokens !== null && t.push(`· ${e.totalTokens.toLocaleString()} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Jt(e.cachedInputTokens)} cached)`), t.join(" ");
3188
+ function $a(e) {
3189
+ let t = [`↑ ${Yt(e.inputTokens)}`, `↓ ${Yt(e.outputTokens)}`];
3190
+ return e.totalTokens !== null && t.push(`· ${e.totalTokens.toLocaleString()} tokens`), e.cachedInputTokens !== null && e.cachedInputTokens > 0 && t.push(`(${Yt(e.cachedInputTokens)} cached)`), t.join(" ");
3200
3191
  }
3201
3192
  //#endregion
3202
3193
  //#region src/lib/chat/zukhruf-chat-transport.ts
3203
- var Qa = "x-upload-filename", $a = z.strictObject({
3194
+ var eo = "x-upload-filename", to = z.strictObject({
3204
3195
  path: z.string().startsWith("/"),
3205
3196
  name: z.string().min(1),
3206
3197
  mediaType: z.enum([
@@ -3218,19 +3209,19 @@ var Qa = "x-upload-filename", $a = z.strictObject({
3218
3209
  ]),
3219
3210
  size: z.int().nonnegative(),
3220
3211
  url: z.url()
3221
- }), eo = class extends S {
3212
+ }), no = class extends S {
3222
3213
  sessionsApi;
3223
3214
  request;
3224
3215
  constructor({ api: e, fetch: t = (e, t) => globalThis.fetch(e, t), tools: n = {}, elements: r = [] }) {
3225
- let i = io(e), a = r.map(Je);
3216
+ let i = oo(e), a = r.map(Je);
3226
3217
  super({
3227
3218
  api: i,
3228
3219
  fetch: async (e, n) => {
3229
3220
  let r = await t(e, n);
3230
3221
  if ((n?.method ?? "GET").toUpperCase() !== "POST" || !r.ok) return r;
3231
3222
  let i = await r.json();
3232
- if (!ao(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
3233
- let a = io(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
3223
+ if (!so(i)) throw Error("Zukhruf returned an invalid accepted-turn response");
3224
+ let a = oo(String(e)), o = decodeURIComponent(a.slice(a.lastIndexOf("/") + 1));
3234
3225
  if (i.sessionId !== o) throw Error("Zukhruf returned a different session ID");
3235
3226
  let s = n?.signal;
3236
3227
  return s?.addEventListener("abort", () => {
@@ -3245,7 +3236,7 @@ var Qa = "x-upload-filename", $a = z.strictObject({
3245
3236
  let o = t[t.length - 1];
3246
3237
  if (!o) throw Error("A message is required");
3247
3238
  return {
3248
- api: to(i, e),
3239
+ api: ro(i, e),
3249
3240
  body: {
3250
3241
  sessionId: e,
3251
3242
  message: o,
@@ -3256,47 +3247,47 @@ var Qa = "x-upload-filename", $a = z.strictObject({
3256
3247
  };
3257
3248
  },
3258
3249
  prepareReconnectToStreamRequest: ({ headers: e, id: t }) => ({
3259
- api: `${to(i, t)}/stream`,
3250
+ api: `${ro(i, t)}/stream`,
3260
3251
  headers: e
3261
3252
  })
3262
3253
  }), this.sessionsApi = i, this.request = t;
3263
3254
  }
3264
3255
  async uploadFile(e, t) {
3265
- let n = await this.request(`${to(this.sessionsApi, e)}/uploads`, {
3256
+ let n = await this.request(`${ro(this.sessionsApi, e)}/uploads`, {
3266
3257
  method: "POST",
3267
3258
  headers: {
3268
3259
  "content-type": t.type,
3269
- [Qa]: encodeURIComponent(t.name)
3260
+ [eo]: encodeURIComponent(t.name)
3270
3261
  },
3271
3262
  body: t
3272
3263
  });
3273
- if (!n.ok) throw Error(await no(n, t));
3274
- let r = $a.safeParse(await n.json());
3264
+ if (!n.ok) throw Error(await io(n, t));
3265
+ let r = to.safeParse(await n.json());
3275
3266
  if (!r.success) throw Error("Zukhruf returned an invalid upload response");
3276
3267
  return r.data;
3277
3268
  }
3278
3269
  };
3279
- function to(e, t) {
3270
+ function ro(e, t) {
3280
3271
  return `${e}/${encodeURIComponent(t)}`;
3281
3272
  }
3282
- async function no(e, t) {
3283
- let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = ro(await e.json().catch(() => null));
3273
+ async function io(e, t) {
3274
+ let n = `Uploading ${t.name} failed with HTTP ${e.status}`, r = ao(await e.json().catch(() => null));
3284
3275
  return r ? `${n}: ${r}` : n;
3285
3276
  }
3286
- function ro(e) {
3277
+ function ao(e) {
3287
3278
  if (typeof e != "object" || !e) return null;
3288
3279
  let t = "cause" in e && typeof e.cause == "object" && e.cause !== null ? e.cause : null;
3289
3280
  return [t && "code" in t && typeof t.code == "string" ? t.code : null, t && "detail" in t && typeof t.detail == "string" ? t.detail : "error" in e && typeof e.error == "string" ? e.error : null].filter((e) => e !== null).join(" — ") || null;
3290
3281
  }
3291
- function io(e) {
3282
+ function oo(e) {
3292
3283
  return e.replace(/\/$/, "");
3293
3284
  }
3294
- function ao(e) {
3285
+ function so(e) {
3295
3286
  return typeof e == "object" && !!e && "ok" in e && e.ok === !0 && "sessionId" in e && typeof e.sessionId == "string" && "turnId" in e && typeof e.turnId == "string";
3296
3287
  }
3297
3288
  //#endregion
3298
3289
  //#region src/lib/chat/trajectory/trajectories/collapsible-disclosure.tsx
3299
- function oo(t) {
3290
+ function co(t) {
3300
3291
  let n = e(24), { label: r, open: i, onOpenChange: a, children: o, className: s, triggerClassName: c, contentClassName: l, chevronClassName: u } = t, d;
3301
3292
  n[0] === c ? d = n[1] : (d = F("flex items-center font-mono", c), n[0] = c, n[1] = d);
3302
3293
  let f;
@@ -3330,19 +3321,19 @@ function oo(t) {
3330
3321
  }
3331
3322
  //#endregion
3332
3323
  //#region src/lib/chat/trajectory/trajectories/user-message.tsx
3333
- function so(t) {
3324
+ function lo(t) {
3334
3325
  let n = e(7), { metadata: r } = t;
3335
3326
  if (!r) return null;
3336
3327
  let i, a, o;
3337
3328
  if (n[0] !== r) {
3338
3329
  o = Symbol.for("react.early_return_sentinel");
3339
3330
  bb0: {
3340
- let e = Ga(r);
3331
+ let e = qa(r);
3341
3332
  if (!e) {
3342
3333
  o = null;
3343
3334
  break bb0;
3344
3335
  }
3345
- i = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", a = Za(e);
3336
+ i = "text-muted-foreground mt-2 text-xs tabular-nums opacity-60", a = $a(e);
3346
3337
  }
3347
3338
  n[0] = r, n[1] = i, n[2] = a, n[3] = o;
3348
3339
  } else i = n[1], a = n[2], o = n[3];
@@ -3353,24 +3344,27 @@ function so(t) {
3353
3344
  children: a
3354
3345
  }), n[4] = i, n[5] = a, n[6] = s) : s = n[6], s;
3355
3346
  }
3356
- function co(e) {
3357
- let t = e.metadata?.reminders;
3347
+ function uo(e, t) {
3348
+ return Wt(e.metadata) ? e.metadata[t] : void 0;
3349
+ }
3350
+ function fo(e) {
3351
+ let t = uo(e, "reminders");
3358
3352
  return Array.isArray(t) ? t.filter((e) => {
3359
3353
  if (!e || typeof e != "object") return !1;
3360
3354
  let t = e;
3361
3355
  return typeof t.id == "string" && t.id.length > 0 && typeof t.text == "string" && t.text.trim().length > 0;
3362
3356
  }) : [];
3363
3357
  }
3364
- function lo(e) {
3365
- let t = e.metadata?.uploads;
3358
+ function po(e) {
3359
+ let t = uo(e, "uploads");
3366
3360
  return Array.isArray(t) ? t.flatMap((e) => {
3367
- let t = $a.safeParse(e);
3361
+ let t = to.safeParse(e);
3368
3362
  return t.success ? [t.data] : [];
3369
3363
  }) : [];
3370
3364
  }
3371
- function uo(t) {
3365
+ function mo(t) {
3372
3366
  let n = e(7), { text: r } = t, [i, a] = b(!1), o;
3373
- n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(fo), n[0] = o) : o = n[0];
3367
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(ho), n[0] = o) : o = n[0];
3374
3368
  let s = !i && "line-clamp-3", c;
3375
3369
  n[1] === s ? c = n[2] : (c = F("hover:text-foreground w-full cursor-pointer text-left whitespace-pre-wrap", s), n[1] = s, n[2] = c);
3376
3370
  let l;
@@ -3382,21 +3376,21 @@ function uo(t) {
3382
3376
  children: r
3383
3377
  }) }), n[3] = i, n[4] = c, n[5] = r, n[6] = l) : l = n[6], l;
3384
3378
  }
3385
- function fo(e) {
3379
+ function ho(e) {
3386
3380
  return !e;
3387
3381
  }
3388
- function po(t) {
3382
+ function go(t) {
3389
3383
  let n = e(8), { reminders: r } = t, [i, a] = b(!1);
3390
3384
  if (r.length === 0) return null;
3391
3385
  let o = `${r.length} reminder${r.length === 1 ? "" : "s"} attached`, s;
3392
- n[0] === r ? s = n[1] : (s = r.map(mo), n[0] = r, n[1] = s);
3386
+ n[0] === r ? s = n[1] : (s = r.map(_o), n[0] = r, n[1] = s);
3393
3387
  let c;
3394
3388
  n[2] === s ? c = n[3] : (c = /* @__PURE__ */ L("ul", {
3395
3389
  className: "border-ink-12 text-muted-foreground space-y-1 border-l pl-3 text-xs",
3396
3390
  children: s
3397
3391
  }), n[2] = s, n[3] = c);
3398
3392
  let l;
3399
- return n[4] !== o || n[5] !== i || n[6] !== c ? (l = /* @__PURE__ */ L(oo, {
3393
+ return n[4] !== o || n[5] !== i || n[6] !== c ? (l = /* @__PURE__ */ L(co, {
3400
3394
  label: o,
3401
3395
  open: i,
3402
3396
  onOpenChange: a,
@@ -3407,10 +3401,10 @@ function po(t) {
3407
3401
  children: c
3408
3402
  }), n[4] = o, n[5] = i, n[6] = c, n[7] = l) : l = n[7], l;
3409
3403
  }
3410
- function mo(e) {
3411
- return /* @__PURE__ */ L(uo, { text: e.text }, e.id);
3404
+ function _o(e) {
3405
+ return /* @__PURE__ */ L(mo, { text: e.text }, e.id);
3412
3406
  }
3413
- function ho(t) {
3407
+ function vo(t) {
3414
3408
  let n = e(19), { upload: r } = t;
3415
3409
  if (r.mediaType.startsWith("video/")) {
3416
3410
  let e;
@@ -3476,17 +3470,17 @@ function ho(t) {
3476
3470
  })
3477
3471
  }), n[16] = r.name, n[17] = r.url, n[18] = i) : i = n[18], i;
3478
3472
  }
3479
- function go(t) {
3473
+ function yo(t) {
3480
3474
  let n = e(13), { message: r } = t, i, a, o, s, c, l;
3481
3475
  if (n[0] !== r) {
3482
3476
  l = Symbol.for("react.early_return_sentinel");
3483
3477
  bb0: {
3484
- let e = lo(r);
3478
+ let e = po(r);
3485
3479
  if (e.length === 0) {
3486
3480
  l = null;
3487
3481
  break bb0;
3488
3482
  }
3489
- i = le, a = "list", o = "Attached files", s = "max-w-full gap-2 py-0", c = e.map(_o);
3483
+ i = le, a = "list", o = "Attached files", s = "max-w-full gap-2 py-0", c = e.map(bo);
3490
3484
  }
3491
3485
  n[0] = r, n[1] = i, n[2] = a, n[3] = o, n[4] = s, n[5] = c, n[6] = l;
3492
3486
  } else i = n[1], a = n[2], o = n[3], s = n[4], c = n[5], l = n[6];
@@ -3499,23 +3493,23 @@ function go(t) {
3499
3493
  children: c
3500
3494
  }), n[7] = i, n[8] = a, n[9] = o, n[10] = s, n[11] = c, n[12] = u) : u = n[12], u;
3501
3495
  }
3502
- function _o(e) {
3496
+ function bo(e) {
3503
3497
  return /* @__PURE__ */ L("div", {
3504
3498
  role: "listitem",
3505
3499
  "data-slot": "attachment",
3506
- children: /* @__PURE__ */ L(ho, { upload: e })
3500
+ children: /* @__PURE__ */ L(vo, { upload: e })
3507
3501
  }, e.path);
3508
3502
  }
3509
- function vo(t) {
3503
+ function xo(t) {
3510
3504
  let n = e(10), { body: r, reminders: i, metadata: a } = t, o;
3511
3505
  n[0] === r ? o = n[1] : (o = /* @__PURE__ */ L("div", {
3512
3506
  className: "flex-1 space-y-3",
3513
3507
  children: r
3514
3508
  }), n[0] = r, n[1] = o);
3515
3509
  let s;
3516
- n[2] === i ? s = n[3] : (s = /* @__PURE__ */ L(po, { reminders: i }), n[2] = i, n[3] = s);
3510
+ n[2] === i ? s = n[3] : (s = /* @__PURE__ */ L(go, { reminders: i }), n[2] = i, n[3] = s);
3517
3511
  let c;
3518
- n[4] === a ? c = n[5] : (c = a !== void 0 && /* @__PURE__ */ L(so, { metadata: a }), n[4] = a, n[5] = c);
3512
+ n[4] === a ? c = n[5] : (c = a !== void 0 && /* @__PURE__ */ L(lo, { metadata: a }), n[4] = a, n[5] = c);
3519
3513
  let l;
3520
3514
  return n[6] !== o || n[7] !== s || n[8] !== c ? (l = /* @__PURE__ */ R("div", {
3521
3515
  className: "bg-secondary flex max-w-[80%] flex-col gap-3 rounded-lg p-3",
@@ -3526,34 +3520,34 @@ function vo(t) {
3526
3520
  ]
3527
3521
  }), n[6] = o, n[7] = s, n[8] = c, n[9] = l) : l = n[9], l;
3528
3522
  }
3529
- function yo({ message: e }) {
3530
- let t = e.metadata?.reminders, { message: n, reminders: r } = v(() => ({
3531
- message: Wt(e),
3532
- reminders: co(e)
3533
- }), [e, t]), i = e.metadata?.alias, a = typeof i == "string" && i.trim().length > 0 ? i : void 0;
3534
- return a ? /* @__PURE__ */ L(vo, {
3535
- reminders: r,
3523
+ function So({ message: e }) {
3524
+ let { message: t, reminders: n } = v(() => ({
3525
+ message: Gt(e),
3526
+ reminders: fo(e)
3527
+ }), [e, uo(e, "reminders")]), r = uo(e, "alias"), i = typeof r == "string" && r.trim().length > 0 ? r : void 0;
3528
+ return i ? /* @__PURE__ */ L(xo, {
3529
+ reminders: n,
3536
3530
  body: /* @__PURE__ */ L("div", {
3537
3531
  className: "text-sm whitespace-pre-wrap",
3538
- children: a
3532
+ children: i
3539
3533
  })
3540
3534
  }) : /* @__PURE__ */ R("div", {
3541
3535
  className: "flex w-full min-w-0 flex-col items-end gap-3",
3542
- children: [/* @__PURE__ */ L(go, { message: n }), /* @__PURE__ */ L(vo, {
3543
- reminders: r,
3544
- metadata: n.metadata,
3545
- body: n.parts.map((e, t) => e.type === "text" ? /* @__PURE__ */ L("div", {
3536
+ children: [/* @__PURE__ */ L(yo, { message: t }), /* @__PURE__ */ L(xo, {
3537
+ reminders: n,
3538
+ metadata: t.metadata,
3539
+ body: t.parts.map((e, n) => e.type === "text" ? /* @__PURE__ */ L("div", {
3546
3540
  className: "text-sm whitespace-pre-wrap",
3547
- children: /* @__PURE__ */ L(Gt, { text: e.text })
3548
- }, `${n.id}-${t}-text`) : null)
3541
+ children: /* @__PURE__ */ L(Kt, { text: e.text })
3542
+ }, `${t.id}-${n}-text`) : null)
3549
3543
  })]
3550
3544
  });
3551
3545
  }
3552
- var bo = u(function(t) {
3553
- let n = e(7), { className: r } = t, { message: i } = K(), a;
3546
+ var Co = u(function(t) {
3547
+ let n = e(7), { className: r } = t, { message: i } = q(), a;
3554
3548
  n[0] === r ? a = n[1] : (a = F("flex justify-end", r), n[0] = r, n[1] = a);
3555
3549
  let o;
3556
- n[2] === i ? o = n[3] : (o = /* @__PURE__ */ L(yo, { message: i }), n[2] = i, n[3] = o);
3550
+ n[2] === i ? o = n[3] : (o = /* @__PURE__ */ L(So, { message: i }), n[2] = i, n[3] = o);
3557
3551
  let s;
3558
3552
  return n[4] !== a || n[5] !== o ? (s = /* @__PURE__ */ L("div", {
3559
3553
  className: a,
@@ -3562,20 +3556,20 @@ var bo = u(function(t) {
3562
3556
  });
3563
3557
  //#endregion
3564
3558
  //#region src/lib/chat/trajectory/trajectories/compact-messages.tsx
3565
- function xo(e) {
3566
- return e.kind === "tool" ? !Fi(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
3559
+ function wo(e) {
3560
+ return e.kind === "tool" ? !Ii(e.part) : e.kind === "dynamic-tool" || e.kind === "reasoning";
3567
3561
  }
3568
- function So(e, t) {
3562
+ function To(e, t) {
3569
3563
  return e.kind === "tool" ? !0 : e.kind === "reasoning" || e.kind === "dynamic-tool" ? !!t : !1;
3570
3564
  }
3571
- function Co(e) {
3572
- return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !aa(e));
3565
+ function Eo(e) {
3566
+ return e.kind === "text" && e.parts.some(({ part: e }) => e.type === "text" && !oa(e));
3573
3567
  }
3574
- function wo(e, t) {
3568
+ function Do(e, t) {
3575
3569
  let n = [];
3576
3570
  for (let r = 0; r < e.length; r++) {
3577
3571
  let i = e[r];
3578
- if (!xo(i)) {
3572
+ if (!wo(i)) {
3579
3573
  n.push({
3580
3574
  kind: "segment",
3581
3575
  segment: i,
@@ -3584,25 +3578,25 @@ function wo(e, t) {
3584
3578
  continue;
3585
3579
  }
3586
3580
  let a = [], o = r;
3587
- for (; r < e.length && xo(e[r]);) {
3581
+ for (; r < e.length && wo(e[r]);) {
3588
3582
  let n = e[r];
3589
- So(n, t) && a.push({ segment: n }), r++;
3583
+ To(n, t) && a.push({ segment: n }), r++;
3590
3584
  }
3591
3585
  r--, a.length > 0 && n.push({
3592
3586
  kind: "group",
3593
3587
  items: a,
3594
- hasLaterText: e.slice(r + 1).some((e) => Co(e)),
3588
+ hasLaterText: e.slice(r + 1).some((e) => Eo(e)),
3595
3589
  firstIndex: o
3596
3590
  });
3597
3591
  }
3598
3592
  return n;
3599
3593
  }
3600
- function To(e) {
3594
+ function Oo(e) {
3601
3595
  if (e.kind !== "tool" && e.kind !== "dynamic-tool") return;
3602
3596
  let { part: t } = e;
3603
3597
  return D(t) ? t.state : void 0;
3604
3598
  }
3605
- function Eo({ groupStatus: e, labelCount: t }) {
3599
+ function ko({ groupStatus: e, labelCount: t }) {
3606
3600
  return e === "running" ? {
3607
3601
  title: "text-info",
3608
3602
  detail: "text-info/80",
@@ -3625,20 +3619,20 @@ function Eo({ groupStatus: e, labelCount: t }) {
3625
3619
  chevron: "text-muted-foreground"
3626
3620
  };
3627
3621
  }
3628
- function Do(e) {
3622
+ function Ao(e) {
3629
3623
  return typeof e == "object" && !!e && !Array.isArray(e);
3630
3624
  }
3631
- function Oo(e, t = 80) {
3625
+ function jo(e, t = 80) {
3632
3626
  let n = e.replace(/\s+/g, " ").trim();
3633
3627
  return n.length <= t ? n : `${n.slice(0, t - 3).trimEnd()}...`;
3634
3628
  }
3635
- function ko(e) {
3636
- if (typeof e == "string") return Oo(e, 48);
3629
+ function Mo(e) {
3630
+ if (typeof e == "string") return jo(e, 48);
3637
3631
  if (typeof e == "number" || typeof e == "boolean") return String(e);
3638
3632
  if (Array.isArray(e)) return `${e.length} items`;
3639
3633
  }
3640
- function Ao(e) {
3641
- if (!Do(e)) return;
3634
+ function No(e) {
3635
+ if (!Ao(e)) return;
3642
3636
  let t = [
3643
3637
  "command",
3644
3638
  "query",
@@ -3650,13 +3644,13 @@ function Ao(e) {
3650
3644
  "checks"
3651
3645
  ], n = [...t.filter((t) => t in e).map((t) => [t, e[t]]), ...Object.entries(e).filter(([e]) => !t.includes(e))], r = {};
3652
3646
  for (let [e, t] of n) {
3653
- let n = ko(t);
3647
+ let n = Mo(t);
3654
3648
  if (n && (r[e] = n, Object.keys(r).length >= 2)) break;
3655
3649
  }
3656
3650
  return Object.keys(r).length > 0 ? r : void 0;
3657
3651
  }
3658
- function jo(e) {
3659
- if (Do(e)) for (let t of [
3652
+ function Po(e) {
3653
+ if (Ao(e)) for (let t of [
3660
3654
  "reasoning",
3661
3655
  "thoughts",
3662
3656
  "thought",
@@ -3664,36 +3658,36 @@ function jo(e) {
3664
3658
  "detail"
3665
3659
  ]) {
3666
3660
  let n = e[t];
3667
- if (typeof n == "string" && n.trim().length > 0) return Oo(n);
3661
+ if (typeof n == "string" && n.trim().length > 0) return jo(n);
3668
3662
  }
3669
3663
  }
3670
- function Mo(e) {
3664
+ function Fo(e) {
3671
3665
  if (e.kind !== "reasoning") return;
3672
3666
  let { part: t } = e;
3673
- if (t.type === "reasoning") return Oo(t.text, 96);
3667
+ if (t.type === "reasoning") return jo(t.text, 96);
3674
3668
  }
3675
- function No(e, t) {
3669
+ function Io(e, t) {
3676
3670
  if (e.kind === "reasoning") return {
3677
3671
  kind: "reasoning",
3678
3672
  name: "reasoning",
3679
- detail: Mo(e)
3673
+ detail: Fo(e)
3680
3674
  };
3681
3675
  if (e.kind === "dynamic-tool" && e.part.type === "dynamic-tool") {
3682
3676
  let t = e.part;
3683
3677
  return {
3684
3678
  kind: "dynamic-tool",
3685
3679
  name: t.toolName || "Tool",
3686
- args: Ao(t.input),
3687
- detail: jo(t.input)
3680
+ args: No(t.input),
3681
+ detail: Po(t.input)
3688
3682
  };
3689
3683
  }
3690
3684
  if (e.kind === "tool" && T(e.part)) {
3691
- let n = e.part, { toolEntry: r, toolKey: i } = Li(n, t), a = r?.label?.(n);
3685
+ let n = e.part, { toolEntry: r, toolKey: i } = Ri(n, t), a = r?.label?.(n);
3692
3686
  return {
3693
3687
  kind: "tool",
3694
3688
  name: a?.name ?? i,
3695
- args: a?.args ?? Ao(n.input),
3696
- detail: a?.detail ?? jo(n.input),
3689
+ args: a?.args ?? No(n.input),
3690
+ detail: a?.detail ?? Po(n.input),
3697
3691
  isError: a?.isError
3698
3692
  };
3699
3693
  }
@@ -3702,54 +3696,54 @@ function No(e, t) {
3702
3696
  name: "Step"
3703
3697
  };
3704
3698
  }
3705
- function Po(e) {
3699
+ function Lo(e) {
3706
3700
  if (!e) return;
3707
3701
  let t = Object.entries(e).filter((e) => typeof e[1] == "string" && e[1].trim().length > 0);
3708
- if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${Oo(t, 36)}`).join(", ");
3702
+ if (t.length !== 0) return t.slice(0, 2).map(([e, t]) => `${e}: ${jo(t, 36)}`).join(", ");
3709
3703
  }
3710
- function Fo(e) {
3711
- let t = Po(e.args);
3704
+ function Ro(e) {
3705
+ let t = Lo(e.args);
3712
3706
  return t ? `${e.name}(${t})` : e.name;
3713
3707
  }
3714
- function Io(e) {
3708
+ function zo(e) {
3715
3709
  return e === "output-available" || e === "output-error" || e === "output-denied";
3716
3710
  }
3717
- function Lo(e) {
3718
- return !!e && !Io(e);
3711
+ function Bo(e) {
3712
+ return !!e && !zo(e);
3719
3713
  }
3720
- function Ro(e, t) {
3721
- return Tn(e, t);
3714
+ function Vo(e, t) {
3715
+ return En(e, t);
3722
3716
  }
3723
- function zo({ items: e, labels: t, status: n, hasLaterText: r }) {
3724
- return e.some(({ segment: e }) => Ro(To(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
3725
- let t = To(e);
3717
+ function Ho({ items: e, labels: t, status: n, hasLaterText: r }) {
3718
+ return e.some(({ segment: e }) => Vo(Oo(e), n)) ? "aborted" : !r && (n === "streaming" || n === "submitted") ? "running" : t.some((e) => e.isError) || e.some(({ segment: e }) => {
3719
+ let t = Oo(e);
3726
3720
  return t === "output-error" || t === "output-denied";
3727
- }) ? "error" : e.some(({ segment: e }) => Lo(To(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
3721
+ }) ? "error" : e.some(({ segment: e }) => Bo(Oo(e))) || !r && t.every((e) => e.kind === "reasoning") && (n === "streaming" || n === "submitted") ? "running" : "complete";
3728
3722
  }
3729
- function Bo(e) {
3723
+ function Uo(e) {
3730
3724
  return e && `${e[0].toUpperCase()}${e.slice(1)}`;
3731
3725
  }
3732
- function Vo(e) {
3726
+ function Wo(e) {
3733
3727
  return e.filter((e) => e.kind !== "reasoning").length;
3734
3728
  }
3735
- function Ho(e, t) {
3736
- let n = Vo(e);
3729
+ function Go(e, t) {
3730
+ let n = Wo(e);
3737
3731
  if (n !== 0) return `${t === "running" || t === "aborted" ? "running" : "ran"} ${n} ${n === 1 ? "tool" : "tools"}`;
3738
3732
  }
3739
- function Uo(e, t) {
3740
- let n = Ho(e, t);
3741
- if (n) return Bo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
3733
+ function Ko(e, t) {
3734
+ let n = Go(e, t);
3735
+ if (n) return Uo(t === "error" ? `${n} with issues` : t === "aborted" ? `cancelled after ${n}` : n);
3742
3736
  }
3743
- function Wo(e, t, n) {
3737
+ function qo(e, t, n) {
3744
3738
  let r = e.length === 1 ? e[0] : void 0;
3745
3739
  if (t === "running") return n || (r?.kind === "reasoning" ? `Reasoning${r.detail ? ` ${r.detail}` : ""}` : e.every((e) => e.kind === "reasoning") ? "Reasoning" : "Working...");
3746
3740
  if (r) {
3747
- let e = Fo(r);
3741
+ let e = Ro(r);
3748
3742
  return t === "error" ? `Failed ${e}` : t === "aborted" ? `Cancelled ${e}` : r.kind === "reasoning" ? `Reasoned${r.detail ? ` ${r.detail}` : ""}` : `Called ${e}`;
3749
3743
  }
3750
- return e.every((e) => e.kind === "reasoning") ? "Reasoned" : Uo(e, t) ?? "Ran tools";
3744
+ return e.every((e) => e.kind === "reasoning") ? "Reasoned" : Ko(e, t) ?? "Ran tools";
3751
3745
  }
3752
- function Go(e, t) {
3746
+ function Jo(e, t) {
3753
3747
  if (t !== "running") {
3754
3748
  if (e.length === 1) {
3755
3749
  let t = e[0];
@@ -3758,28 +3752,28 @@ function Go(e, t) {
3758
3752
  return Array.from(new Set([...e].sort((e, t) => e.kind === "reasoning" && t.kind !== "reasoning" ? 1 : e.kind !== "reasoning" && t.kind === "reasoning" ? -1 : 0).map((e) => e.name))).slice(0, 3).join(", ") || void 0;
3759
3753
  }
3760
3754
  }
3761
- function Ko(e) {
3755
+ function Yo(e) {
3762
3756
  let t;
3763
3757
  for (let n = e.length - 1; n >= 0; n--) {
3764
3758
  let r = e[n].segment;
3765
3759
  if (r.kind === "dynamic-tool" && r.part.type === "dynamic-tool") {
3766
- let e = jo(r.part.input);
3760
+ let e = Po(r.part.input);
3767
3761
  if (e) return e;
3768
3762
  }
3769
3763
  if (r.kind === "tool" && T(r.part)) {
3770
- let e = jo(r.part.input);
3764
+ let e = Po(r.part.input);
3771
3765
  if (e) return e;
3772
3766
  }
3773
- r.kind === "reasoning" && (t ??= Mo(r));
3767
+ r.kind === "reasoning" && (t ??= Fo(r));
3774
3768
  }
3775
3769
  return t;
3776
3770
  }
3777
- function qo(e, t) {
3778
- return !e || e.role !== "assistant" ? !1 : wo(ba(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
3771
+ function Xo(e, t) {
3772
+ return !e || e.role !== "assistant" ? !1 : Do(xa(e.parts), t).some((e) => e.kind === "group" && !e.hasLaterText);
3779
3773
  }
3780
- function Jo() {
3781
- let t = e(8), { message: n } = K(), { debugMode: r } = V(), i;
3782
- t[0] === n.parts ? i = t[1] : (i = ba(n.parts), t[0] = n.parts, t[1] = i);
3774
+ function Zo() {
3775
+ let t = e(8), { message: n } = q(), { debugMode: r } = V(), i;
3776
+ t[0] === n.parts ? i = t[1] : (i = xa(n.parts), t[0] = n.parts, t[1] = i);
3783
3777
  let a = i, o;
3784
3778
  if (t[2] !== r || t[3] !== n.id || t[4] !== a) {
3785
3779
  let e;
@@ -3788,30 +3782,30 @@ function Jo() {
3788
3782
  key: `${n.id}-${e.firstIndex}-group-${e.hasLaterText ? "past" : "current"}`
3789
3783
  } : {
3790
3784
  ...e,
3791
- key: `${n.id}-${Z(e.segment, e.segmentIndex)}-${e.segment.kind}`
3792
- }, t[6] = n.id, t[7] = e), o = wo(a, r).map(e), t[2] = r, t[3] = n.id, t[4] = a, t[5] = o;
3785
+ key: `${n.id}-${Q(e.segment, e.segmentIndex)}-${e.segment.kind}`
3786
+ }, t[6] = n.id, t[7] = e), o = Do(a, r).map(e), t[2] = r, t[3] = n.id, t[4] = a, t[5] = o;
3793
3787
  } else o = t[5];
3794
3788
  return o;
3795
3789
  }
3796
- var Yo = s(null);
3797
- function Xo() {
3798
- let e = f(Yo);
3790
+ var Qo = s(null);
3791
+ function $o() {
3792
+ let e = f(Qo);
3799
3793
  if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
3800
3794
  return e;
3801
3795
  }
3802
- function Zo(t) {
3803
- let n = e(21), { group: r, children: i } = t, { registry: a } = V(), { message: o } = K(), s = G(), [c, l] = b(!r.hasLaterText), u, d, f;
3796
+ function es(t) {
3797
+ let n = e(21), { group: r, children: i } = t, { registry: a } = V(), { message: o } = q(), s = K(), [c, l] = b(!r.hasLaterText), u, d, f;
3804
3798
  if (n[0] !== r.hasLaterText || n[1] !== r.items || n[2] !== a || n[3] !== s) {
3805
3799
  let e;
3806
3800
  n[7] === a ? e = n[8] : (e = (e) => {
3807
3801
  let { segment: t } = e;
3808
- return No(t, a);
3809
- }, n[7] = a, n[8] = e), d = r.items.map(e), u = zo({
3802
+ return Io(t, a);
3803
+ }, n[7] = a, n[8] = e), d = r.items.map(e), u = Ho({
3810
3804
  items: r.items,
3811
3805
  labels: d,
3812
3806
  status: s,
3813
3807
  hasLaterText: r.hasLaterText
3814
- }), f = Eo({
3808
+ }), f = ko({
3815
3809
  groupStatus: u,
3816
3810
  labelCount: d.length
3817
3811
  }), n[0] = r.hasLaterText, n[1] = r.items, n[2] = a, n[3] = s, n[4] = u, n[5] = d, n[6] = f;
@@ -3832,12 +3826,12 @@ function Zo(t) {
3832
3826
  children: i
3833
3827
  }), n[15] = i, n[16] = c, n[17] = h) : h = n[17];
3834
3828
  let g;
3835
- return n[18] !== m || n[19] !== h ? (g = /* @__PURE__ */ L(Yo, {
3829
+ return n[18] !== m || n[19] !== h ? (g = /* @__PURE__ */ L(Qo, {
3836
3830
  value: m,
3837
3831
  children: h
3838
3832
  }), n[18] = m, n[19] = h, n[20] = g) : g = n[20], g;
3839
3833
  }
3840
- function Qo(t) {
3834
+ function ts(t) {
3841
3835
  let n = e(3), { children: r } = t, i;
3842
3836
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L("button", {
3843
3837
  type: "button",
@@ -3852,11 +3846,11 @@ function Qo(t) {
3852
3846
  })
3853
3847
  }), n[1] = r, n[2] = a), a;
3854
3848
  }
3855
- function $o() {
3856
- let t = e(12), { items: n, labels: r, groupStatus: i, tone: a } = Xo(), o;
3857
- t[0] !== i || t[1] !== n || t[2] !== r ? (o = Wo(r, i, Ko(n)), t[0] = i, t[1] = n, t[2] = r, t[3] = o) : o = t[3];
3849
+ function ns() {
3850
+ let t = e(12), { items: n, labels: r, groupStatus: i, tone: a } = $o(), o;
3851
+ t[0] !== i || t[1] !== n || t[2] !== r ? (o = qo(r, i, Yo(n)), t[0] = i, t[1] = n, t[2] = r, t[3] = o) : o = t[3];
3858
3852
  let s = o, c;
3859
- t[4] !== i || t[5] !== r ? (c = Go(r, i), t[4] = i, t[5] = r, t[6] = c) : c = t[6];
3853
+ t[4] !== i || t[5] !== r ? (c = Jo(r, i), t[4] = i, t[5] = r, t[6] = c) : c = t[6];
3860
3854
  let l = c, u;
3861
3855
  return t[7] !== l || t[8] !== i || t[9] !== s || t[10] !== a ? (u = {
3862
3856
  title: s,
@@ -3865,11 +3859,11 @@ function $o() {
3865
3859
  groupStatus: i
3866
3860
  }, t[7] = l, t[8] = i, t[9] = s, t[10] = a, t[11] = u) : u = t[11], u;
3867
3861
  }
3868
- function es(t) {
3869
- let n = e(9), { title: r, suffix: i, children: a } = t, { title: o, tone: s, groupStatus: c } = $o(), l = r ?? o, u = i ? `${l} · ${i}` : l, d = c === "running", f = c === "running" ? "text-info" : s.title, p;
3862
+ function rs(t) {
3863
+ let n = e(9), { title: r, suffix: i, children: a } = t, { title: o, tone: s, groupStatus: c } = ns(), l = r ?? o, u = i ? `${l} · ${i}` : l, d = c === "running", f = c === "running" ? "text-info" : s.title, p;
3870
3864
  n[0] === f ? p = n[1] : (p = F("max-w-full min-w-0 truncate", f), n[0] = f, n[1] = p);
3871
3865
  let m;
3872
- n[2] !== d || n[3] !== p || n[4] !== u ? (m = /* @__PURE__ */ L(kn, {
3866
+ n[2] !== d || n[3] !== p || n[4] !== u ? (m = /* @__PURE__ */ L(W, {
3873
3867
  as: "span",
3874
3868
  enabled: d,
3875
3869
  className: p,
@@ -3881,12 +3875,12 @@ function es(t) {
3881
3875
  children: [m, a]
3882
3876
  }), n[6] = a, n[7] = m, n[8] = h) : h = n[8], h;
3883
3877
  }
3884
- function ts() {
3885
- let t = e(2), { tone: n } = Xo(), r;
3878
+ function is() {
3879
+ let t = e(2), { tone: n } = $o(), r;
3886
3880
  return t[0] === n.chevron ? r = t[1] : (r = /* @__PURE__ */ L(An, { className: n.chevron }), t[0] = n.chevron, t[1] = r), r;
3887
3881
  }
3888
- function ns(t) {
3889
- let n = e(5), { detail: r } = t, { title: i, detail: a, tone: o } = $o();
3882
+ function as(t) {
3883
+ let n = e(5), { detail: r } = t, { title: i, detail: a, tone: o } = ns();
3890
3884
  if (r === null) return null;
3891
3885
  let s = r ?? a;
3892
3886
  if (!s || s === i) return null;
@@ -3898,8 +3892,8 @@ function ns(t) {
3898
3892
  children: s
3899
3893
  }), n[2] = s, n[3] = c, n[4] = l) : l = n[4], l;
3900
3894
  }
3901
- function rs(t) {
3902
- let n = e(14), { children: r } = t, { items: i, messageId: a, groupStatus: o } = Xo(), s = o === "running", c;
3895
+ function os(t) {
3896
+ let n = e(14), { children: r } = t, { items: i, messageId: a, groupStatus: o } = $o(), s = o === "running", c;
3903
3897
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (c = {
3904
3898
  initial: "instant",
3905
3899
  resize: "instant"
@@ -3908,8 +3902,8 @@ function rs(t) {
3908
3902
  n[1] === f ? p = n[2] : (p = F("mt-2", f), n[1] = f, n[2] = p);
3909
3903
  let m = s ? u : void 0, h;
3910
3904
  n[3] !== r || n[4] !== i || n[5] !== a ? (h = r ?? i.map((e, t) => {
3911
- let { segment: n } = e, r = `${a}-${Z(n, t)}-${n.kind}`;
3912
- return n.kind === "tool" ? /* @__PURE__ */ L(X.Tool, { segment: n }, r) : n.kind === "reasoning" ? /* @__PURE__ */ L(X.Reasoning, { segment: n }, r) : n.kind === "dynamic-tool" ? /* @__PURE__ */ L(X.DynamicTool, { segment: n }, r) : null;
3905
+ let { segment: n } = e, r = `${a}-${Q(n, t)}-${n.kind}`;
3906
+ return n.kind === "tool" ? /* @__PURE__ */ L(Z.Tool, { segment: n }, r) : n.kind === "reasoning" ? /* @__PURE__ */ L(Z.Reasoning, { segment: n }, r) : n.kind === "dynamic-tool" ? /* @__PURE__ */ L(Z.DynamicTool, { segment: n }, r) : null;
3913
3907
  }), n[3] = r, n[4] = i, n[5] = a, n[6] = h) : h = n[6];
3914
3908
  let g;
3915
3909
  n[7] !== m || n[8] !== h ? (g = /* @__PURE__ */ L("div", {
@@ -3923,11 +3917,11 @@ function rs(t) {
3923
3917
  children: g
3924
3918
  }), n[10] = d, n[11] = p, n[12] = g, n[13] = _) : _ = n[13], _;
3925
3919
  }
3926
- function is(t) {
3927
- let n = e(19), { item: r, textClassName: i } = t, a = i === void 0 ? "my-4" : i, { elements: o } = W(), { segment: s } = r;
3920
+ function ss(t) {
3921
+ let n = e(19), { item: r, textClassName: i } = t, a = i === void 0 ? "my-4" : i, { elements: o } = G(), { segment: s } = r;
3928
3922
  if (s.kind === "text") {
3929
3923
  let e;
3930
- n[0] === s.parts ? e = n[1] : (e = s.parts.filter(as), n[0] = s.parts, n[1] = e);
3924
+ n[0] === s.parts ? e = n[1] : (e = s.parts.filter(cs), n[0] = s.parts, n[1] = e);
3931
3925
  let t = e;
3932
3926
  if (t.length === 0) return null;
3933
3927
  let r;
@@ -3936,7 +3930,7 @@ function is(t) {
3936
3930
  parts: t
3937
3931
  }, n[2] = s, n[3] = t, n[4] = r) : r = n[4];
3938
3932
  let i;
3939
- return n[5] !== o || n[6] !== r || n[7] !== a ? (i = /* @__PURE__ */ L(X.Text, {
3933
+ return n[5] !== o || n[6] !== r || n[7] !== a ? (i = /* @__PURE__ */ L(Z.Text, {
3940
3934
  segment: r,
3941
3935
  elements: o,
3942
3936
  className: a
@@ -3944,75 +3938,75 @@ function is(t) {
3944
3938
  }
3945
3939
  if (s.kind === "file") {
3946
3940
  let e;
3947
- return n[9] === s ? e = n[10] : (e = /* @__PURE__ */ L(X.File, { segment: s }), n[9] = s, n[10] = e), e;
3941
+ return n[9] === s ? e = n[10] : (e = /* @__PURE__ */ L(Z.File, { segment: s }), n[9] = s, n[10] = e), e;
3948
3942
  }
3949
3943
  if (s.kind === "source") {
3950
3944
  let e;
3951
- return n[11] === s ? e = n[12] : (e = /* @__PURE__ */ L(X.Source, { segment: s }), n[11] = s, n[12] = e), e;
3945
+ return n[11] === s ? e = n[12] : (e = /* @__PURE__ */ L(Z.Source, { segment: s }), n[11] = s, n[12] = e), e;
3952
3946
  }
3953
3947
  if (s.kind === "tool") {
3954
3948
  let e;
3955
- return n[13] === s ? e = n[14] : (e = /* @__PURE__ */ L(X.Tool, { segment: s }), n[13] = s, n[14] = e), e;
3949
+ return n[13] === s ? e = n[14] : (e = /* @__PURE__ */ L(Z.Tool, { segment: s }), n[13] = s, n[14] = e), e;
3956
3950
  }
3957
3951
  if (s.kind === "reasoning") {
3958
3952
  let e;
3959
- return n[15] === s ? e = n[16] : (e = /* @__PURE__ */ L(X.Reasoning, { segment: s }), n[15] = s, n[16] = e), e;
3953
+ return n[15] === s ? e = n[16] : (e = /* @__PURE__ */ L(Z.Reasoning, { segment: s }), n[15] = s, n[16] = e), e;
3960
3954
  }
3961
3955
  if (s.kind === "dynamic-tool") {
3962
3956
  let e;
3963
- return n[17] === s ? e = n[18] : (e = /* @__PURE__ */ L(X.DynamicTool, { segment: s }), n[17] = s, n[18] = e), e;
3957
+ return n[17] === s ? e = n[18] : (e = /* @__PURE__ */ L(Z.DynamicTool, { segment: s }), n[17] = s, n[18] = e), e;
3964
3958
  }
3965
3959
  return null;
3966
3960
  }
3967
- function as(e) {
3961
+ function cs(e) {
3968
3962
  let { part: t } = e;
3969
- return !aa(t);
3970
- }
3971
- var os = {
3972
- Group: Zo,
3973
- GroupTrigger: Qo,
3974
- GroupTitle: es,
3975
- GroupChevron: ts,
3976
- GroupDetail: ns,
3977
- GroupContent: rs,
3978
- Segment: is
3963
+ return !oa(t);
3964
+ }
3965
+ var ls = {
3966
+ Group: es,
3967
+ GroupTrigger: ts,
3968
+ GroupTitle: rs,
3969
+ GroupChevron: is,
3970
+ GroupDetail: as,
3971
+ GroupContent: os,
3972
+ Segment: ss
3979
3973
  };
3980
- function ss() {
3981
- let t = e(1), n = G(), { messages: r } = W(), { debugMode: i } = V(), a = r[r.length - 1];
3982
- if (n !== "ready" && n !== "error" && qo(a, i)) return null;
3974
+ function us() {
3975
+ let t = e(1), n = K(), { messages: r } = G(), { debugMode: i } = V(), a = r[r.length - 1];
3976
+ if (n !== "ready" && n !== "error" && Xo(a, i)) return null;
3983
3977
  let o;
3984
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ L(Va, {}), t[0] = o) : o = t[0], o;
3978
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ L(Ha, {}), t[0] = o) : o = t[0], o;
3985
3979
  }
3986
- var cs = {
3987
- Root: Na,
3988
- List: Pa,
3989
- Item: Fa,
3990
- UserBubble: bo,
3980
+ var ds = {
3981
+ Root: Pa,
3982
+ List: Fa,
3983
+ Item: Ia,
3984
+ UserBubble: Co,
3991
3985
  AssistantContent: u(function(t) {
3992
- let n = e(5), { className: r } = t, i = Jo(), a;
3993
- n[0] === i ? a = n[1] : (a = i.map(ls), n[0] = i, n[1] = a);
3986
+ let n = e(5), { className: r } = t, i = Zo(), a;
3987
+ n[0] === i ? a = n[1] : (a = i.map(fs), n[0] = i, n[1] = a);
3994
3988
  let o;
3995
3989
  return n[2] !== r || n[3] !== a ? (o = /* @__PURE__ */ L("div", {
3996
3990
  className: r,
3997
3991
  children: a
3998
3992
  }), n[2] = r, n[3] = a, n[4] = o) : o = n[4], o;
3999
3993
  }),
4000
- Actions: Da,
4001
- CopyAction: Oa,
4002
- RegenerateAction: ka,
4003
- CopyDebugJsonAction: Aa,
4004
- Thinking: ss,
4005
- Error: Ma
3994
+ Actions: Oa,
3995
+ CopyAction: ka,
3996
+ RegenerateAction: Aa,
3997
+ CopyDebugJsonAction: ja,
3998
+ Thinking: us,
3999
+ Error: Na
4006
4000
  };
4007
- function ls(e) {
4008
- return e.kind === "group" ? /* @__PURE__ */ R(Zo, {
4001
+ function fs(e) {
4002
+ return e.kind === "group" ? /* @__PURE__ */ R(es, {
4009
4003
  group: e,
4010
- children: [/* @__PURE__ */ R(Qo, { children: [/* @__PURE__ */ L(es, { children: /* @__PURE__ */ L(ts, {}) }), /* @__PURE__ */ L(ns, {})] }), /* @__PURE__ */ L(rs, {})]
4011
- }, e.key) : /* @__PURE__ */ L(is, { item: e }, e.key);
4004
+ children: [/* @__PURE__ */ R(ts, { children: [/* @__PURE__ */ L(rs, { children: /* @__PURE__ */ L(is, {}) }), /* @__PURE__ */ L(as, {})] }), /* @__PURE__ */ L(os, {})]
4005
+ }, e.key) : /* @__PURE__ */ L(ss, { item: e }, e.key);
4012
4006
  }
4013
4007
  //#endregion
4014
4008
  //#region src/lib/chat/trajectory/trajectories/messages.tsx
4015
- function us(t) {
4009
+ function ps(t) {
4016
4010
  let n = e(8), { message: r, className: i } = t, a;
4017
4011
  n[0] === i ? a = n[1] : (a = F("text-destructive/90 bg-destructive/10 flex items-start gap-2 rounded-md px-3 py-2 text-sm", i), n[0] = i, n[1] = a);
4018
4012
  let o;
@@ -4025,13 +4019,13 @@ function us(t) {
4025
4019
  children: [o, s]
4026
4020
  }), n[5] = a, n[6] = s, n[7] = c) : c = n[7], c;
4027
4021
  }
4028
- function ds(t) {
4022
+ function ms(t) {
4029
4023
  let n = e(15), { part: r } = t, i = V(), a, o;
4030
4024
  if (n[0] !== i.registry || n[1] !== r) {
4031
4025
  o = Symbol.for("react.early_return_sentinel");
4032
4026
  bb0: {
4033
- let { toolEntry: e } = Li(r, i.registry);
4034
- if (e && Ri(e, r.state)) {
4027
+ let { toolEntry: e } = Ri(r, i.registry);
4028
+ if (e && zi(e, r.state)) {
4035
4029
  let t = e.label?.(r);
4036
4030
  if (!t) {
4037
4031
  o = null;
@@ -4064,14 +4058,14 @@ function ds(t) {
4064
4058
  } else a = n[2], o = n[3];
4065
4059
  if (o !== Symbol.for("react.early_return_sentinel")) return o;
4066
4060
  let s = a, c;
4067
- n[4] !== s || n[5] !== r ? (c = s && /* @__PURE__ */ L(ta, {
4061
+ n[4] !== s || n[5] !== r ? (c = s && /* @__PURE__ */ L(na, {
4068
4062
  label: s,
4069
4063
  part: r
4070
4064
  }), n[4] = s, n[5] = r, n[6] = c) : c = n[6];
4071
4065
  let l;
4072
- n[7] === s ? l = n[8] : (l = s?.isError && s.detail && /* @__PURE__ */ L(us, { message: s.detail }), n[7] = s, n[8] = l);
4066
+ n[7] === s ? l = n[8] : (l = s?.isError && s.detail && /* @__PURE__ */ L(ps, { message: s.detail }), n[7] = s, n[8] = l);
4073
4067
  let u;
4074
- n[9] === r ? u = n[10] : (u = /* @__PURE__ */ L(Zi, { part: r }), n[9] = r, n[10] = u);
4068
+ n[9] === r ? u = n[10] : (u = /* @__PURE__ */ L(Qi, { part: r }), n[9] = r, n[10] = u);
4075
4069
  let d;
4076
4070
  return n[11] !== c || n[12] !== l || n[13] !== u ? (d = /* @__PURE__ */ R(I, { children: [
4077
4071
  c,
@@ -4079,9 +4073,9 @@ function ds(t) {
4079
4073
  u
4080
4074
  ] }), n[11] = c, n[12] = l, n[13] = u, n[14] = d) : d = n[14], d;
4081
4075
  }
4082
- function fs(t) {
4076
+ function hs(t) {
4083
4077
  let n = e(5), { part: r } = t, [i, a] = b(!1), o;
4084
- n[0] === r.text ? o = n[1] : (o = /* @__PURE__ */ L(J, {
4078
+ n[0] === r.text ? o = n[1] : (o = /* @__PURE__ */ L(Y, {
4085
4079
  mode: "static",
4086
4080
  children: r.text
4087
4081
  }), n[0] = r.text, n[1] = o);
@@ -4089,7 +4083,7 @@ function fs(t) {
4089
4083
  return n[2] !== i || n[3] !== o ? (s = /* @__PURE__ */ L("div", {
4090
4084
  "data-copy-exclude": "assistant-snapshot",
4091
4085
  className: "bg-muted/30 prose max-w-auto prose-sm text-muted-foreground border-border mb-4 w-full min-w-full rounded-lg p-3",
4092
- children: /* @__PURE__ */ L(oo, {
4086
+ children: /* @__PURE__ */ L(co, {
4093
4087
  label: "Reasoning",
4094
4088
  open: i,
4095
4089
  onOpenChange: a,
@@ -4100,31 +4094,31 @@ function fs(t) {
4100
4094
  })
4101
4095
  }), n[2] = i, n[3] = o, n[4] = s) : s = n[4], s;
4102
4096
  }
4103
- function ps(t) {
4104
- let n = e(15), { part: r } = t, { elements: i } = W(), a = Qi();
4097
+ function gs(t) {
4098
+ let n = e(15), { part: r } = t, { elements: i } = G(), a = $i();
4105
4099
  if (r.type === "text") {
4106
4100
  if (r.providerMetadata?.openai?.phase === "commentary") return null;
4107
4101
  let e;
4108
- return n[0] !== i || n[1] !== r.text ? (e = /* @__PURE__ */ L(Xi, {
4102
+ return n[0] !== i || n[1] !== r.text ? (e = /* @__PURE__ */ L(Zi, {
4109
4103
  text: r.text,
4110
4104
  elements: i
4111
4105
  }), n[0] = i, n[1] = r.text, n[2] = e) : e = n[2], e;
4112
4106
  }
4113
4107
  if (r.type === "dynamic-tool") {
4114
4108
  let e;
4115
- return n[3] !== a || n[4] !== r ? (e = a ? /* @__PURE__ */ L(pi, { part: r }) : null, n[3] = a, n[4] = r, n[5] = e) : e = n[5], e;
4109
+ return n[3] !== a || n[4] !== r ? (e = a ? /* @__PURE__ */ L(mi, { part: r }) : null, n[3] = a, n[4] = r, n[5] = e) : e = n[5], e;
4116
4110
  }
4117
4111
  if (T(r)) {
4118
4112
  let e;
4119
- return n[6] === r ? e = n[7] : (e = /* @__PURE__ */ L(ds, { part: r }), n[6] = r, n[7] = e), e;
4113
+ return n[6] === r ? e = n[7] : (e = /* @__PURE__ */ L(ms, { part: r }), n[6] = r, n[7] = e), e;
4120
4114
  }
4121
4115
  if (r.type === "reasoning" && r.text) {
4122
4116
  let e;
4123
- return n[8] !== a || n[9] !== r ? (e = a ? /* @__PURE__ */ L(fs, { part: r }) : null, n[8] = a, n[9] = r, n[10] = e) : e = n[10], e;
4117
+ return n[8] !== a || n[9] !== r ? (e = a ? /* @__PURE__ */ L(hs, { part: r }) : null, n[8] = a, n[9] = r, n[10] = e) : e = n[10], e;
4124
4118
  }
4125
4119
  if (r.type === "file") {
4126
4120
  let e;
4127
- return n[11] !== r.filename || n[12] !== r.mediaType || n[13] !== r.url ? (e = /* @__PURE__ */ L(Yi, {
4121
+ return n[11] !== r.filename || n[12] !== r.mediaType || n[13] !== r.url ? (e = /* @__PURE__ */ L(Xi, {
4128
4122
  filename: r.filename,
4129
4123
  mediaType: r.mediaType,
4130
4124
  url: r.url
@@ -4132,13 +4126,13 @@ function ps(t) {
4132
4126
  }
4133
4127
  return null;
4134
4128
  }
4135
- var ms = u(function(t) {
4136
- let n = e(10), { className: r } = t, { message: i } = K(), a;
4129
+ var _s = u(function(t) {
4130
+ let n = e(10), { className: r } = t, { message: i } = q(), a;
4137
4131
  n[0] === r ? a = n[1] : (a = F("flex-1 space-y-3", r), n[0] = r, n[1] = a);
4138
4132
  let o;
4139
4133
  if (n[2] !== i.id || n[3] !== i.parts) {
4140
4134
  let e;
4141
- n[5] === i.id ? e = n[6] : (e = (e, t) => /* @__PURE__ */ L(ps, { part: e }, `${i.id}-${t}`), n[5] = i.id, n[6] = e), o = i.parts.map(e), n[2] = i.id, n[3] = i.parts, n[4] = o;
4135
+ n[5] === i.id ? e = n[6] : (e = (e, t) => /* @__PURE__ */ L(gs, { part: e }, `${i.id}-${t}`), n[5] = i.id, n[6] = e), o = i.parts.map(e), n[2] = i.id, n[3] = i.parts, n[4] = o;
4142
4136
  } else o = n[4];
4143
4137
  let s;
4144
4138
  return n[7] !== a || n[8] !== o ? (s = /* @__PURE__ */ L("div", {
@@ -4146,13 +4140,13 @@ var ms = u(function(t) {
4146
4140
  children: o
4147
4141
  }), n[7] = a, n[8] = o, n[9] = s) : s = n[9], s;
4148
4142
  });
4149
- function hs(t) {
4143
+ function vs(t) {
4150
4144
  let n = e(9), { className: r, label: i } = t, a;
4151
- n[0] === i ? a = n[1] : (a = i && i.split("\n").filter(gs).pop() || "Thinking...", n[0] = i, n[1] = a);
4145
+ n[0] === i ? a = n[1] : (a = i && i.split("\n").filter(ys).pop() || "Thinking...", n[0] = i, n[1] = a);
4152
4146
  let o = a, s;
4153
4147
  n[2] === r ? s = n[3] : (s = F("flex items-start", r), n[2] = r, n[3] = s);
4154
4148
  let c;
4155
- n[4] === o ? c = n[5] : (c = /* @__PURE__ */ L(kn, {
4149
+ n[4] === o ? c = n[5] : (c = /* @__PURE__ */ L(W, {
4156
4150
  className: "text-muted-foreground line-clamp-2 text-sm",
4157
4151
  children: o
4158
4152
  }), n[4] = o, n[5] = c);
@@ -4163,33 +4157,33 @@ function hs(t) {
4163
4157
  children: c
4164
4158
  }), n[6] = s, n[7] = c, n[8] = l) : l = n[8], l;
4165
4159
  }
4166
- function gs(e) {
4160
+ function ys(e) {
4167
4161
  return e.trim();
4168
4162
  }
4169
- function _s() {
4170
- let t = e(5), n = G(), { messages: r } = W(), i = r[r.length - 1], a;
4171
- t[0] !== n || t[1] !== i ? (a = Ra(n, i), t[0] = n, t[1] = i, t[2] = a) : a = t[2];
4163
+ function bs() {
4164
+ let t = e(5), n = K(), { messages: r } = G(), i = r[r.length - 1], a;
4165
+ t[0] !== n || t[1] !== i ? (a = za(n, i), t[0] = n, t[1] = i, t[2] = a) : a = t[2];
4172
4166
  let o = a;
4173
4167
  if (!o) return null;
4174
4168
  let s;
4175
- return t[3] === o ? s = t[4] : (s = /* @__PURE__ */ L(hs, {
4169
+ return t[3] === o ? s = t[4] : (s = /* @__PURE__ */ L(vs, {
4176
4170
  label: o,
4177
4171
  className: "mt-2"
4178
4172
  }), t[3] = o, t[4] = s), s;
4179
4173
  }
4180
- var vs = {
4181
- Root: Na,
4182
- List: Pa,
4183
- Item: Fa,
4184
- UserBubble: bo,
4185
- AssistantContent: ms,
4186
- Thinking: _s,
4187
- Error: Ma,
4188
- Actions: Da,
4189
- CopyAction: Oa,
4190
- RegenerateAction: ka,
4191
- CopyDebugJsonAction: Aa
4192
- }, ys = {
4174
+ var xs = {
4175
+ Root: Pa,
4176
+ List: Fa,
4177
+ Item: Ia,
4178
+ UserBubble: Co,
4179
+ AssistantContent: _s,
4180
+ Thinking: bs,
4181
+ Error: Na,
4182
+ Actions: Oa,
4183
+ CopyAction: ka,
4184
+ RegenerateAction: Aa,
4185
+ CopyDebugJsonAction: ja
4186
+ }, Ss = {
4193
4187
  braille: {
4194
4188
  frames: [
4195
4189
  "⠋",
@@ -4256,10 +4250,10 @@ var vs = {
4256
4250
  interval: 100
4257
4251
  }
4258
4252
  };
4259
- function bs(t) {
4253
+ function Cs(t) {
4260
4254
  let n = e(14), r, i, a;
4261
4255
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({className: r, variant: a, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
4262
- let { frames: o, interval: s } = ys[a === void 0 ? "braille" : a], [c, l] = b(0), u, d;
4256
+ let { frames: o, interval: s } = Ss[a === void 0 ? "braille" : a], [c, l] = b(0), u, d;
4263
4257
  n[4] !== o.length || n[5] !== s ? (u = () => {
4264
4258
  if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
4265
4259
  let e = setInterval(() => {
@@ -4280,9 +4274,9 @@ function bs(t) {
4280
4274
  }
4281
4275
  //#endregion
4282
4276
  //#region src/lib/chat/trajectory/trajectories/timeline.tsx
4283
- function xs(t) {
4277
+ function ws(t) {
4284
4278
  let n = e(11), { Icon: r, isLast: i, isLoading: a, aborted: o, state: s, isError: c } = t, l;
4285
- n[0] !== r || n[1] !== o || n[2] !== c || n[3] !== a || n[4] !== s ? (l = a ? /* @__PURE__ */ L(bs, { className: "text-muted-foreground z-10 shrink-0 text-sm" }) : o ? /* @__PURE__ */ L(Xe, { className: "text-destructive z-10 size-3.5 shrink-0" }) : /* @__PURE__ */ L(r, { className: F("z-10 size-3.5 shrink-0", s === "output-error" || c ? "text-destructive" : "text-muted-foreground") }), n[0] = r, n[1] = o, n[2] = c, n[3] = a, n[4] = s, n[5] = l) : l = n[5];
4279
+ n[0] !== r || n[1] !== o || n[2] !== c || n[3] !== a || n[4] !== s ? (l = a ? /* @__PURE__ */ L(Cs, { className: "text-muted-foreground z-10 shrink-0 text-sm" }) : o ? /* @__PURE__ */ L(Xe, { className: "text-destructive z-10 size-3.5 shrink-0" }) : /* @__PURE__ */ L(r, { className: F("z-10 size-3.5 shrink-0", s === "output-error" || c ? "text-destructive" : "text-muted-foreground") }), n[0] = r, n[1] = o, n[2] = c, n[3] = a, n[4] = s, n[5] = l) : l = n[5];
4286
4280
  let u;
4287
4281
  n[6] === i ? u = n[7] : (u = !i && /* @__PURE__ */ L("span", { className: "bg-border w-px flex-1" }), n[6] = i, n[7] = u);
4288
4282
  let d;
@@ -4291,16 +4285,16 @@ function xs(t) {
4291
4285
  children: [l, u]
4292
4286
  }), n[8] = l, n[9] = u, n[10] = d) : d = n[10], d;
4293
4287
  }
4294
- function Ss(t) {
4295
- let n = e(15), { isLast: r, label: i, state: a, aborted: o, children: s } = t, c = f(fa), l = i ?? c?.label, u = a ?? c?.state, d = o ?? c?.aborted ?? !1, p = l?.icon, m = !!u && !d && u !== "output-available" && u !== "output-error", h;
4296
- n[0] !== p || n[1] !== d || n[2] !== l?.isError || n[3] !== u || n[4] !== r || n[5] !== m ? (h = p ? /* @__PURE__ */ L(xs, {
4288
+ function Ts(t) {
4289
+ let n = e(15), { isLast: r, label: i, state: a, aborted: o, children: s } = t, c = f(pa), l = i ?? c?.label, u = a ?? c?.state, d = o ?? c?.aborted ?? !1, p = l?.icon, m = !!u && !d && u !== "output-available" && u !== "output-error", h;
4290
+ n[0] !== p || n[1] !== d || n[2] !== l?.isError || n[3] !== u || n[4] !== r || n[5] !== m ? (h = p ? /* @__PURE__ */ L(ws, {
4297
4291
  Icon: p,
4298
4292
  isLast: r,
4299
4293
  isLoading: m,
4300
4294
  aborted: d,
4301
4295
  state: u,
4302
4296
  isError: l?.isError ?? !1
4303
- }) : /* @__PURE__ */ L(za, { isLast: r }), n[0] = p, n[1] = d, n[2] = l?.isError, n[3] = u, n[4] = r, n[5] = m, n[6] = h) : h = n[6];
4297
+ }) : /* @__PURE__ */ L(Ba, { isLast: r }), n[0] = p, n[1] = d, n[2] = l?.isError, n[3] = u, n[4] = r, n[5] = m, n[6] = h) : h = n[6];
4304
4298
  let g = h, _ = r ? "" : "pb-3.5", v;
4305
4299
  n[7] === _ ? v = n[8] : (v = F("min-w-0 flex-1", _), n[7] = _, n[8] = v);
4306
4300
  let y;
@@ -4309,16 +4303,16 @@ function Ss(t) {
4309
4303
  children: s
4310
4304
  }), n[9] = s, n[10] = v, n[11] = y) : y = n[11];
4311
4305
  let b;
4312
- return n[12] !== g || n[13] !== y ? (b = /* @__PURE__ */ L(Ba, {
4306
+ return n[12] !== g || n[13] !== y ? (b = /* @__PURE__ */ L(Va, {
4313
4307
  marker: g,
4314
4308
  children: y
4315
4309
  }), n[12] = g, n[13] = y, n[14] = b) : b = n[14], b;
4316
4310
  }
4317
- function Cs(t) {
4311
+ function Es(t) {
4318
4312
  let n = e(10), { label: r, state: i, part: a, defaultOpen: o, children: s } = t, c = o !== void 0 && o, l;
4319
4313
  n[0] !== r || n[1] !== a || n[2] !== i ? (l = /* @__PURE__ */ L(P, {
4320
4314
  className: "cursor-pointer",
4321
- children: /* @__PURE__ */ L(ra, {
4315
+ children: /* @__PURE__ */ L(ia, {
4322
4316
  label: r,
4323
4317
  state: i,
4324
4318
  part: a
@@ -4333,58 +4327,58 @@ function Cs(t) {
4333
4327
  children: [l, u]
4334
4328
  }), n[6] = c, n[7] = l, n[8] = u, n[9] = d) : d = n[9], d;
4335
4329
  }
4336
- var ws = {
4337
- Item: Ss,
4338
- Disclosure: Cs
4339
- }, Ts = {
4340
- Root: Na,
4341
- List: Pa,
4342
- Item: Fa,
4343
- UserBubble: bo,
4330
+ var Ds = {
4331
+ Item: Ts,
4332
+ Disclosure: Es
4333
+ }, Os = {
4334
+ Root: Pa,
4335
+ List: Fa,
4336
+ Item: Ia,
4337
+ UserBubble: Co,
4344
4338
  AssistantContent: u(function(t) {
4345
- let n = e(12), { className: r } = t, { message: i } = K(), { elements: a } = W(), { debugMode: o } = V(), s = Qi(), c = Y(), l;
4346
- n[0] === i.parts ? l = n[1] : (l = ba(i.parts), n[0] = i.parts, n[1] = l);
4339
+ let n = e(12), { className: r } = t, { message: i } = q(), { elements: a } = G(), { debugMode: o } = V(), s = $i(), c = X(), l;
4340
+ n[0] === i.parts ? l = n[1] : (l = xa(i.parts), n[0] = i.parts, n[1] = l);
4347
4341
  let u = l, d;
4348
4342
  n[2] !== o || n[3] !== a || n[4] !== c || n[5] !== i.id || n[6] !== u || n[7] !== s ? (d = u.map((e, t) => {
4349
- let n = `${i.id}-${Z(e, t)}-${e.kind}`;
4350
- if (e.kind === "text") return /* @__PURE__ */ L(X.Text, {
4343
+ let n = `${i.id}-${Q(e, t)}-${e.kind}`;
4344
+ if (e.kind === "text") return /* @__PURE__ */ L(Z.Text, {
4351
4345
  segment: e,
4352
4346
  elements: a,
4353
4347
  className: "my-4"
4354
4348
  }, n);
4355
- if (e.kind === "file") return /* @__PURE__ */ L(X.File, { segment: e }, n);
4356
- if (e.kind === "source") return /* @__PURE__ */ L(X.Source, { segment: e }, n);
4349
+ if (e.kind === "file") return /* @__PURE__ */ L(Z.File, { segment: e }, n);
4350
+ if (e.kind === "source") return /* @__PURE__ */ L(Z.Source, { segment: e }, n);
4357
4351
  if (e.kind === "dynamic-tool") {
4358
4352
  if (!s) return null;
4359
- let r = !ya(u, t, !0);
4360
- return /* @__PURE__ */ L(ws.Item, {
4353
+ let r = !ba(u, t, !0);
4354
+ return /* @__PURE__ */ L(Ds.Item, {
4361
4355
  isLast: r,
4362
- children: /* @__PURE__ */ L(X.DynamicTool, { segment: e })
4356
+ children: /* @__PURE__ */ L(Z.DynamicTool, { segment: e })
4363
4357
  }, n);
4364
4358
  }
4365
4359
  if (e.kind === "reasoning") {
4366
4360
  if (c || e.part.type !== "reasoning") return null;
4367
- let r = !ya(u, t, o), i = {
4361
+ let r = !ba(u, t, o), i = {
4368
4362
  name: "Reasoning",
4369
4363
  icon: ut,
4370
4364
  args: { text: [...e.part.text].slice(0, 60).join("") }
4371
4365
  };
4372
- return /* @__PURE__ */ L(ws.Item, {
4366
+ return /* @__PURE__ */ L(Ds.Item, {
4373
4367
  isLast: r,
4374
4368
  label: i,
4375
- children: /* @__PURE__ */ L(ws.Disclosure, {
4369
+ children: /* @__PURE__ */ L(Ds.Disclosure, {
4376
4370
  label: i,
4377
- children: /* @__PURE__ */ L(X.Reasoning, { segment: e })
4371
+ children: /* @__PURE__ */ L(Z.Reasoning, { segment: e })
4378
4372
  })
4379
4373
  }, n);
4380
4374
  }
4381
4375
  if (e.kind === "tool") {
4382
- let r = !ya(u, t, o);
4383
- return /* @__PURE__ */ L(X.Tool, {
4376
+ let r = !ba(u, t, o);
4377
+ return /* @__PURE__ */ L(Z.Tool, {
4384
4378
  segment: e,
4385
- children: /* @__PURE__ */ L(ws.Item, {
4379
+ children: /* @__PURE__ */ L(Ds.Item, {
4386
4380
  isLast: r,
4387
- children: /* @__PURE__ */ L(X.ToolDisclosure, {})
4381
+ children: /* @__PURE__ */ L(Z.ToolDisclosure, {})
4388
4382
  })
4389
4383
  }, n);
4390
4384
  }
@@ -4396,16 +4390,16 @@ var ws = {
4396
4390
  children: d
4397
4391
  }), n[9] = r, n[10] = d, n[11] = f) : f = n[11], f;
4398
4392
  }),
4399
- Actions: Da,
4400
- CopyAction: Oa,
4401
- RegenerateAction: ka,
4402
- CopyDebugJsonAction: Aa,
4403
- Thinking: Va,
4404
- Error: Ma
4393
+ Actions: Oa,
4394
+ CopyAction: ka,
4395
+ RegenerateAction: Aa,
4396
+ CopyDebugJsonAction: ja,
4397
+ Thinking: Ha,
4398
+ Error: Na
4405
4399
  };
4406
4400
  //#endregion
4407
4401
  //#region src/lib/components/ChatComposer.tsx
4408
- function Es(t) {
4402
+ function ks(t) {
4409
4403
  let n = e(9), r, i;
4410
4404
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
4411
4405
  let { hasSubmitted: a } = H(), o;
@@ -4417,7 +4411,7 @@ function Es(t) {
4417
4411
  ...i
4418
4412
  }), n[5] = a, n[6] = i, n[7] = o, n[8] = s) : s = n[8], s;
4419
4413
  }
4420
- function Ds(t) {
4414
+ function As(t) {
4421
4415
  let n = e(8), r, i;
4422
4416
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
4423
4417
  let a;
@@ -4428,7 +4422,7 @@ function Ds(t) {
4428
4422
  ...i
4429
4423
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
4430
4424
  }
4431
- function Os(t) {
4425
+ function js(t) {
4432
4426
  let n = e(8), r, i;
4433
4427
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
4434
4428
  let a;
@@ -4439,7 +4433,7 @@ function Os(t) {
4439
4433
  ...i
4440
4434
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
4441
4435
  }
4442
- function ks(t) {
4436
+ function Ms(t) {
4443
4437
  let n = e(8), r, i;
4444
4438
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
4445
4439
  let a;
@@ -4450,7 +4444,7 @@ function ks(t) {
4450
4444
  ...i
4451
4445
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
4452
4446
  }
4453
- function As(t) {
4447
+ function Ns(t) {
4454
4448
  let n = e(8), r, i;
4455
4449
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
4456
4450
  let a;
@@ -4461,7 +4455,7 @@ function As(t) {
4461
4455
  ...i
4462
4456
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
4463
4457
  }
4464
- function js(t) {
4458
+ function Ps(t) {
4465
4459
  let n = e(8), r, i;
4466
4460
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
4467
4461
  let a;
@@ -4472,9 +4466,9 @@ function js(t) {
4472
4466
  ...i
4473
4467
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
4474
4468
  }
4475
- function Ms(t) {
4469
+ function Fs(t) {
4476
4470
  let n = e(3), r;
4477
- n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ L(Q, { icon: /* @__PURE__ */ L(gt, { className: "size-4" }) }), n[0] = r) : r = n[0];
4471
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ L($, { icon: /* @__PURE__ */ L(gt, { className: "size-4" }) }), n[0] = r) : r = n[0];
4478
4472
  let i;
4479
4473
  return n[1] === t ? i = n[2] : (i = /* @__PURE__ */ L(B.AttachFiles, {
4480
4474
  "aria-label": "Attach files",
@@ -4482,15 +4476,15 @@ function Ms(t) {
4482
4476
  ...t
4483
4477
  }), n[1] = t, n[2] = i), i;
4484
4478
  }
4485
- function Ns() {
4486
- let t = e(6), { actions: n, meta: r } = Kt("ChatComposer.CommandButton"), i;
4479
+ function Is() {
4480
+ let t = e(6), { actions: n, meta: r } = qt("ChatComposer.CommandButton"), i;
4487
4481
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L(vt, { className: "size-4" }), t[0] = i) : i = t[0];
4488
4482
  let a = r.activePopup?.trigger === "/", o;
4489
4483
  t[1] === n ? o = t[2] : (o = (e) => {
4490
4484
  e.stopPropagation(), n.toggleSlashMenu();
4491
4485
  }, t[1] = n, t[2] = o);
4492
4486
  let s;
4493
- return t[3] !== a || t[4] !== o ? (s = /* @__PURE__ */ L(Q, {
4487
+ return t[3] !== a || t[4] !== o ? (s = /* @__PURE__ */ L($, {
4494
4488
  "data-command-button": !0,
4495
4489
  icon: i,
4496
4490
  "aria-label": "Toggle command menu",
@@ -4498,21 +4492,21 @@ function Ns() {
4498
4492
  onClick: o
4499
4493
  }), t[3] = a, t[4] = o, t[5] = s) : s = t[5], s;
4500
4494
  }
4501
- var Ps = {
4502
- Provider: Es,
4503
- Root: Ds,
4495
+ var Ls = {
4496
+ Provider: ks,
4497
+ Root: As,
4504
4498
  Popup: B.Popup,
4505
- Content: Os,
4506
- Attachments: As,
4507
- Editor: ks,
4499
+ Content: js,
4500
+ Attachments: Ns,
4501
+ Editor: Ms,
4508
4502
  Error: B.Error,
4509
- Toolbar: js,
4510
- CommandButton: Ns,
4511
- AttachFiles: Ms
4503
+ Toolbar: Ps,
4504
+ CommandButton: Is,
4505
+ AttachFiles: Fs
4512
4506
  };
4513
4507
  //#endregion
4514
4508
  //#region src/lib/components/ChatTextarea.tsx
4515
- function Fs(t) {
4509
+ function Rs(t) {
4516
4510
  let n = e(10), r, i, a;
4517
4511
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({className: r, ref: a, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
4518
4512
  let o;
@@ -4529,7 +4523,7 @@ function Fs(t) {
4529
4523
  }
4530
4524
  //#endregion
4531
4525
  //#region src/lib/components/queue.tsx
4532
- function Is(t) {
4526
+ function zs(t) {
4533
4527
  let n = e(5), { children: r, className: i } = t, a;
4534
4528
  n[0] === i ? a = n[1] : (a = F("border-border flex flex-col border-b px-2 py-1.5", i), n[0] = i, n[1] = a);
4535
4529
  let o;
@@ -4538,7 +4532,7 @@ function Is(t) {
4538
4532
  children: r
4539
4533
  }), n[2] = r, n[3] = a, n[4] = o) : o = n[4], o;
4540
4534
  }
4541
- function Ls(t) {
4535
+ function Bs(t) {
4542
4536
  let n = e(5), { children: r, className: i } = t, a;
4543
4537
  n[0] === i ? a = n[1] : (a = F("flex items-center gap-2 px-2 py-1.5", i), n[0] = i, n[1] = a);
4544
4538
  let o;
@@ -4547,24 +4541,24 @@ function Ls(t) {
4547
4541
  children: r
4548
4542
  }), n[2] = r, n[3] = a, n[4] = o) : o = n[4], o;
4549
4543
  }
4550
- function Rs(t) {
4544
+ function Vs(t) {
4551
4545
  let n = e(4), { className: r } = t, i;
4552
4546
  n[0] === r ? i = n[1] : (i = F("text-muted-foreground size-3.5 shrink-0", r), n[0] = r, n[1] = i);
4553
4547
  let a;
4554
4548
  return n[2] === i ? a = n[3] : (a = /* @__PURE__ */ L(dt, { className: i }), n[2] = i, n[3] = a), a;
4555
4549
  }
4556
- function zs(t) {
4550
+ function Hs(t) {
4557
4551
  let n = e(7), { children: r, className: i } = t, a;
4558
4552
  n[0] === i ? a = n[1] : (a = F("min-w-0 flex-1 truncate text-sm", i), n[0] = i, n[1] = a);
4559
4553
  let o;
4560
- n[2] === r ? o = n[3] : (o = typeof r == "string" ? /* @__PURE__ */ L(Gt, { text: r }) : r, n[2] = r, n[3] = o);
4554
+ n[2] === r ? o = n[3] : (o = typeof r == "string" ? /* @__PURE__ */ L(Kt, { text: r }) : r, n[2] = r, n[3] = o);
4561
4555
  let s;
4562
4556
  return n[4] !== a || n[5] !== o ? (s = /* @__PURE__ */ L("span", {
4563
4557
  className: a,
4564
4558
  children: o
4565
4559
  }), n[4] = a, n[5] = o, n[6] = s) : s = n[6], s;
4566
4560
  }
4567
- function Bs(t) {
4561
+ function Us(t) {
4568
4562
  let n = e(6), { onClick: r, className: i } = t, a;
4569
4563
  n[0] === i ? a = n[1] : (a = F("text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors", i), n[0] = i, n[1] = a);
4570
4564
  let o;
@@ -4578,13 +4572,13 @@ function Bs(t) {
4578
4572
  children: o
4579
4573
  }), n[3] = r, n[4] = a, n[5] = s) : s = n[5], s;
4580
4574
  }
4581
- var Vs = {
4582
- Root: Is,
4583
- Item: Ls,
4584
- Icon: Rs,
4585
- Text: zs,
4586
- Remove: Bs
4587
- }, Hs = {
4575
+ var Ws = {
4576
+ Root: zs,
4577
+ Item: Bs,
4578
+ Icon: Vs,
4579
+ Text: Hs,
4580
+ Remove: Us
4581
+ }, Gs = {
4588
4582
  normal: {
4589
4583
  d: "m5 12 7-7 7 7",
4590
4584
  translateY: 0
@@ -4598,7 +4592,7 @@ var Vs = {
4598
4592
  ],
4599
4593
  transition: { duration: .4 }
4600
4594
  }
4601
- }, Us = {
4595
+ }, Ks = {
4602
4596
  normal: { d: "M12 19V5" },
4603
4597
  animate: {
4604
4598
  d: [
@@ -4608,7 +4602,7 @@ var Vs = {
4608
4602
  ],
4609
4603
  transition: { duration: .4 }
4610
4604
  }
4611
- }, Ws = c((t, n) => {
4605
+ }, qs = c((t, n) => {
4612
4606
  let r = e(29), i, a, o, s, c;
4613
4607
  r[0] === t ? (i = r[1], a = r[2], o = r[3], s = r[4], c = r[5]) : ({onMouseEnter: a, onMouseLeave: o, className: i, size: c, ...s} = t, r[0] = t, r[1] = i, r[2] = a, r[3] = o, r[4] = s, r[5] = c);
4614
4608
  let l = c === void 0 ? 20 : c, u = te(), d = y(!1), f;
@@ -4630,11 +4624,11 @@ var Vs = {
4630
4624
  r[16] === u ? (b = r[17], x = r[18]) : (b = /* @__PURE__ */ L(A.path, {
4631
4625
  animate: u,
4632
4626
  d: "m5 12 7-7 7 7",
4633
- variants: Hs
4627
+ variants: Gs
4634
4628
  }), x = /* @__PURE__ */ L(A.path, {
4635
4629
  animate: u,
4636
4630
  d: "M12 19V5",
4637
- variants: Us
4631
+ variants: Ks
4638
4632
  }), r[16] = u, r[17] = b, r[18] = x);
4639
4633
  let S;
4640
4634
  r[19] !== l || r[20] !== b || r[21] !== x ? (S = /* @__PURE__ */ R("svg", {
@@ -4658,10 +4652,10 @@ var Vs = {
4658
4652
  children: S
4659
4653
  }), r[23] = m, r[24] = g, r[25] = s, r[26] = v, r[27] = S, r[28] = C) : C = r[28], C;
4660
4654
  });
4661
- Ws.displayName = "ArrowUpIcon";
4655
+ qs.displayName = "ArrowUpIcon";
4662
4656
  //#endregion
4663
4657
  //#region src/lib/components/SubmitButton.tsx
4664
- var Gs = {
4658
+ var Js = {
4665
4659
  duration: .15,
4666
4660
  ease: [
4667
4661
  0,
@@ -4669,7 +4663,7 @@ var Gs = {
4669
4663
  .2,
4670
4664
  1
4671
4665
  ]
4672
- }, Ks = {
4666
+ }, Ys = {
4673
4667
  duration: .12,
4674
4668
  ease: [
4675
4669
  0,
@@ -4678,7 +4672,7 @@ var Gs = {
4678
4672
  1
4679
4673
  ]
4680
4674
  };
4681
- function qs(t) {
4675
+ function Xs(t) {
4682
4676
  let n = e(40), r, i, a, o;
4683
4677
  n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({variant: o, className: r, disabled: i, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o);
4684
4678
  let s = ne(), c = o === "stop", l;
@@ -4718,7 +4712,7 @@ function qs(t) {
4718
4712
  scale: .7
4719
4713
  }, n[21] = s, n[22] = y);
4720
4714
  let b;
4721
- n[23] === c ? b = n[24] : (b = L(c ? Xs : Ys, {}), n[23] = c, n[24] = b);
4715
+ n[23] === c ? b = n[24] : (b = L(c ? $s : Qs, {}), n[23] = c, n[24] = b);
4722
4716
  let x;
4723
4717
  n[25] !== y || n[26] !== b || n[27] !== g || n[28] !== _ ? (x = /* @__PURE__ */ L(ee, {
4724
4718
  initial: !1,
@@ -4726,7 +4720,7 @@ function qs(t) {
4726
4720
  initial: _,
4727
4721
  animate: v,
4728
4722
  exit: y,
4729
- transition: Ks,
4723
+ transition: Ys,
4730
4724
  className: "absolute flex items-center justify-center",
4731
4725
  children: b
4732
4726
  }, g)
@@ -4736,7 +4730,7 @@ function qs(t) {
4736
4730
  initial: l,
4737
4731
  animate: u,
4738
4732
  exit: d,
4739
- transition: Gs,
4733
+ transition: Js,
4740
4734
  whileHover: f,
4741
4735
  whileTap: p,
4742
4736
  "aria-label": m,
@@ -4746,7 +4740,7 @@ function qs(t) {
4746
4740
  children: x
4747
4741
  }), n[30] = i, n[31] = a, n[32] = l, n[33] = x, n[34] = d, n[35] = f, n[36] = p, n[37] = m, n[38] = h, n[39] = S) : S = n[39], S;
4748
4742
  }
4749
- function Js(t) {
4743
+ function Zs(t) {
4750
4744
  let n = e(2), { children: r } = t, i;
4751
4745
  return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ L("svg", {
4752
4746
  width: "20",
@@ -4757,13 +4751,13 @@ function Js(t) {
4757
4751
  children: r
4758
4752
  }), n[0] = r, n[1] = i), i;
4759
4753
  }
4760
- function Ys() {
4754
+ function Qs() {
4761
4755
  let t = e(1), n;
4762
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ L(Ws, {}), t[0] = n) : n = t[0], n;
4756
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ L(qs, {}), t[0] = n) : n = t[0], n;
4763
4757
  }
4764
- function Xs() {
4758
+ function $s() {
4765
4759
  let t = e(1), n;
4766
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ L(Js, { children: /* @__PURE__ */ L("rect", {
4760
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ L(Zs, { children: /* @__PURE__ */ L("rect", {
4767
4761
  x: "5",
4768
4762
  y: "5",
4769
4763
  width: "10",
@@ -4773,9 +4767,9 @@ function Xs() {
4773
4767
  }
4774
4768
  //#endregion
4775
4769
  //#region src/lib/components/tool-error.tsx
4776
- function Zs(t) {
4770
+ function ec(t) {
4777
4771
  let n = e(25), { title: r, detail: i, detailLabel: a, part: o, error: s } = t, c = r === void 0 ? "Failed to render tool" : r, l = a === void 0 ? "View details" : a, u = U(), d;
4778
- n[0] === s.issues ? d = n[1] : (d = s.issues.map(Qs).join("\n"), n[0] = s.issues, n[1] = d);
4772
+ n[0] === s.issues ? d = n[1] : (d = s.issues.map(tc).join("\n"), n[0] = s.issues, n[1] = d);
4779
4773
  let f = d, p;
4780
4774
  n[2] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ L(Ye, { className: "size-5" }), n[2] = p) : p = n[2];
4781
4775
  let m;
@@ -4843,62 +4837,62 @@ function Zs(t) {
4843
4837
  ]
4844
4838
  }), n[21] = y, n[22] = S, n[23] = m, n[24] = w) : w = n[24], w;
4845
4839
  }
4846
- function Qs(e) {
4840
+ function tc(e) {
4847
4841
  return `${e.path.join(".")}: ${e.message}`;
4848
4842
  }
4849
4843
  //#endregion
4850
4844
  //#region src/lib/components/Tip/TipProvider.tsx
4851
- var $s = s("");
4852
- function ec() {
4853
- return f($s);
4854
- }
4855
- var tc = "tips:history", nc = "tips:session";
4845
+ var nc = s("");
4856
4846
  function rc() {
4847
+ return f(nc);
4848
+ }
4849
+ var ic = "tips:history", ac = "tips:session";
4850
+ function oc() {
4857
4851
  try {
4858
- return JSON.parse(localStorage.getItem(tc) ?? "{}");
4852
+ return JSON.parse(localStorage.getItem(ic) ?? "{}");
4859
4853
  } catch {
4860
4854
  return {};
4861
4855
  }
4862
4856
  }
4863
- function ic(e, t) {
4857
+ function sc(e, t) {
4864
4858
  try {
4865
- let n = rc();
4866
- n[e] = t, localStorage.setItem(tc, JSON.stringify(n));
4859
+ let n = oc();
4860
+ n[e] = t, localStorage.setItem(ic, JSON.stringify(n));
4867
4861
  } catch {}
4868
4862
  }
4869
- function ac(e) {
4863
+ function cc(e) {
4870
4864
  try {
4871
- let t = localStorage.getItem(nc), n = t ? JSON.parse(t) : {
4865
+ let t = localStorage.getItem(ac), n = t ? JSON.parse(t) : {
4872
4866
  id: "",
4873
4867
  n: 0
4874
4868
  };
4875
- return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(nc, JSON.stringify(n))), n.n;
4869
+ return n.id !== e && (n.id = e, n.n += 1, localStorage.setItem(ac, JSON.stringify(n))), n.n;
4876
4870
  } catch {
4877
4871
  return 0;
4878
4872
  }
4879
4873
  }
4880
- function oc(e, t, n) {
4874
+ function lc(e, t, n) {
4881
4875
  let r = n[e];
4882
4876
  return r == null ? Infinity : t - r;
4883
4877
  }
4884
- async function sc(e, t, n) {
4885
- let r = rc(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
4878
+ async function uc(e, t, n) {
4879
+ let r = oc(), i = await Promise.all(e.map((e) => e.isRelevant(t))), a = e.filter((e, t) => i[t]);
4886
4880
  if (a.length === 0) return null;
4887
- let o = a.filter((e) => oc(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
4888
- s.sort((e, t) => oc(t.id, n, r) - oc(e.id, n, r));
4881
+ let o = a.filter((e) => lc(e.id, n, r) >= e.cooldownSessions), s = o.length > 0 ? o : a;
4882
+ s.sort((e, t) => lc(t.id, n, r) - lc(e.id, n, r));
4889
4883
  let c = s[0], l = await c.content(t);
4890
4884
  return {
4891
4885
  id: c.id,
4892
4886
  text: l
4893
4887
  };
4894
4888
  }
4895
- function cc(t) {
4889
+ function dc(t) {
4896
4890
  let n = e(17), { tips: r, streaming: i, chatId: a, context: o, children: s } = t, c;
4897
- n[0] === a ? c = n[1] : (c = () => ac(a), n[0] = a, n[1] = c);
4891
+ n[0] === a ? c = n[1] : (c = () => cc(a), n[0] = a, n[1] = c);
4898
4892
  let [l] = b(c), [u, d] = b(""), f = y(!1), p = y(!1), m;
4899
4893
  n[2] !== o || n[3] !== l || n[4] !== r ? (m = () => {
4900
- p.current || (p.current = !0, sc(r, o, l).then((e) => {
4901
- e && (d(e.text), ic(e.id, l));
4894
+ p.current || (p.current = !0, uc(r, o, l).then((e) => {
4895
+ e && (d(e.text), sc(e.id, l));
4902
4896
  }).finally(() => {
4903
4897
  p.current = !1;
4904
4898
  }));
@@ -4917,14 +4911,14 @@ function cc(t) {
4917
4911
  let C;
4918
4912
  n[12] === i ? C = n[13] : (C = [i], n[12] = i, n[13] = C), h(S, C);
4919
4913
  let w;
4920
- return n[14] !== s || n[15] !== u ? (w = /* @__PURE__ */ L($s, {
4914
+ return n[14] !== s || n[15] !== u ? (w = /* @__PURE__ */ L(nc, {
4921
4915
  value: u,
4922
4916
  children: s
4923
4917
  }), n[14] = s, n[15] = u, n[16] = w) : w = n[16], w;
4924
4918
  }
4925
- function lc(t) {
4926
- let n = e(6), { tips: r, context: i, children: a } = t, { chatId: o } = V(), { status: s } = bn(), c = s === "streaming" || s === "submitted", l = o ?? "", u;
4927
- return n[0] !== a || n[1] !== i || n[2] !== c || n[3] !== l || n[4] !== r ? (u = /* @__PURE__ */ L(cc, {
4919
+ function fc(t) {
4920
+ let n = e(6), { tips: r, context: i, children: a } = t, { chatId: o } = V(), { status: s } = xn(), c = s === "streaming" || s === "submitted", l = o ?? "", u;
4921
+ return n[0] !== a || n[1] !== i || n[2] !== c || n[3] !== l || n[4] !== r ? (u = /* @__PURE__ */ L(dc, {
4928
4922
  tips: r,
4929
4923
  streaming: c,
4930
4924
  chatId: l,
@@ -4934,14 +4928,14 @@ function lc(t) {
4934
4928
  }
4935
4929
  //#endregion
4936
4930
  //#region src/lib/components/Tip/TipLine.tsx
4937
- var uc = 1.5;
4938
- function dc(t) {
4939
- let n = e(12), { className: r } = t, i = ec(), [a, o] = b(i), [s, c] = b(!1);
4931
+ var pc = 1.5;
4932
+ function mc(t) {
4933
+ let n = e(12), { className: r } = t, i = rc(), [a, o] = b(i), [s, c] = b(!1);
4940
4934
  i !== a && (o(i), i && c(!0));
4941
4935
  let l, u;
4942
4936
  n[0] === s ? (l = n[1], u = n[2]) : (l = () => {
4943
4937
  if (!s) return;
4944
- let e = setTimeout(() => c(!1), uc * 1e3);
4938
+ let e = setTimeout(() => c(!1), pc * 1e3);
4945
4939
  return () => clearTimeout(e);
4946
4940
  }, u = [s], n[0] = s, n[1] = l, n[2] = u), h(l, u);
4947
4941
  let d;
@@ -4949,10 +4943,10 @@ function dc(t) {
4949
4943
  let f;
4950
4944
  n[5] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ L(ut, { className: "size-3 shrink-0" }), n[5] = f) : f = n[5];
4951
4945
  let p;
4952
- n[6] !== s || n[7] !== i ? (p = /* @__PURE__ */ R(kn, {
4946
+ n[6] !== s || n[7] !== i ? (p = /* @__PURE__ */ R(W, {
4953
4947
  as: "span",
4954
4948
  enabled: s,
4955
- duration: uc,
4949
+ duration: pc,
4956
4950
  children: ["Tip: ", i]
4957
4951
  }), n[6] = s, n[7] = i, n[8] = p) : p = n[8];
4958
4952
  let m;
@@ -4963,7 +4957,7 @@ function dc(t) {
4963
4957
  }
4964
4958
  //#endregion
4965
4959
  //#region src/lib/dynamic-ui/error-boundary.tsx
4966
- var fc = class extends n.Component {
4960
+ var hc = class extends n.Component {
4967
4961
  constructor(e) {
4968
4962
  super(e), this.state = {
4969
4963
  hasError: !1,
@@ -4984,14 +4978,14 @@ var fc = class extends n.Component {
4984
4978
  }), this.props.onRetry?.(e);
4985
4979
  };
4986
4980
  render() {
4987
- return this.state.hasError ? /* @__PURE__ */ L(pc, {
4981
+ return this.state.hasError ? /* @__PURE__ */ L(gc, {
4988
4982
  error: this.state.error,
4989
4983
  code: this.props.code,
4990
4984
  onRetry: this.props.onRetry ? this.handleRetry : void 0
4991
4985
  }) : this.props.children;
4992
4986
  }
4993
4987
  };
4994
- function pc(t) {
4988
+ function gc(t) {
4995
4989
  let n = e(16), { error: r, code: i, onRetry: a } = t, o;
4996
4990
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ L(_e, { children: /* @__PURE__ */ R(ve, {
4997
4991
  className: "text-destructive flex items-center gap-2",
@@ -5045,24 +5039,24 @@ function pc(t) {
5045
5039
  }
5046
5040
  //#endregion
5047
5041
  //#region src/lib/dynamic-ui/safe-scope.ts
5048
- var mc = {
5042
+ var _c = {
5049
5043
  useState: n.useState,
5050
5044
  useEffect: n.useEffect,
5051
5045
  useMemo: n.useMemo,
5052
5046
  useCallback: n.useCallback,
5053
5047
  useReducer: n.useReducer,
5054
5048
  useId: n.useId
5055
- }, hc = {
5049
+ }, vc = {
5056
5050
  Fragment: n.Fragment,
5057
5051
  createElement: n.createElement
5058
5052
  };
5059
- function gc() {
5053
+ function yc() {
5060
5054
  return {
5061
- ...mc,
5062
- ...hc,
5055
+ ..._c,
5056
+ ...vc,
5063
5057
  React: {
5064
- ...mc,
5065
- ...hc
5058
+ ..._c,
5059
+ ...vc
5066
5060
  },
5067
5061
  ...ie,
5068
5062
  window: void 0,
@@ -5086,22 +5080,22 @@ function gc() {
5086
5080
  prompt: void 0
5087
5081
  };
5088
5082
  }
5089
- function _c() {
5090
- return Object.keys(gc());
5083
+ function bc() {
5084
+ return Object.keys(yc());
5091
5085
  }
5092
- function vc() {
5093
- return Object.values(gc());
5086
+ function xc() {
5087
+ return Object.values(yc());
5094
5088
  }
5095
5089
  //#endregion
5096
5090
  //#region src/lib/dynamic-ui/transpiler.ts
5097
- function yc(e) {
5091
+ function Sc(e) {
5098
5092
  return e.replace(/^import\s+.*?from\s+['"][^'"]+['"];?\s*$/gm, "").replace(/^import\s+['"][^'"]+['"];?\s*$/gm, "").replace(/^export\s+default\s+\w+;?\s*$/gm, "").replace(/^export\s+default\s+/gm, "const Component = ").trim();
5099
5093
  }
5100
- function bc(e) {
5094
+ function Cc(e) {
5101
5095
  try {
5102
5096
  return {
5103
5097
  success: !0,
5104
- code: Xt(yc(e), {
5098
+ code: Zt(Sc(e), {
5105
5099
  transforms: ["jsx", "typescript"],
5106
5100
  jsxRuntime: "classic",
5107
5101
  production: !0
@@ -5114,7 +5108,7 @@ function bc(e) {
5114
5108
  };
5115
5109
  }
5116
5110
  }
5117
- function xc(e) {
5111
+ function wc(e) {
5118
5112
  let t = [/(?:const|let|var)\s+([A-Z][a-zA-Z0-9]*)\s*=/g, /function\s+([A-Z][a-zA-Z0-9]*)\s*\(/g], n = /* @__PURE__ */ new Set();
5119
5113
  for (let r of t) {
5120
5114
  let t;
@@ -5122,25 +5116,25 @@ function xc(e) {
5122
5116
  }
5123
5117
  return Array.from(n);
5124
5118
  }
5125
- function Sc(e) {
5119
+ function Tc(e) {
5126
5120
  return `
5127
5121
  return (function() {
5128
5122
  ${e}
5129
- ${xc(e).map((e) => `if (typeof ${e} !== 'undefined') return ${e};`).join("\n ")}
5123
+ ${wc(e).map((e) => `if (typeof ${e} !== 'undefined') return ${e};`).join("\n ")}
5130
5124
  return null;
5131
5125
  })();
5132
5126
  `;
5133
5127
  }
5134
5128
  //#endregion
5135
5129
  //#region src/lib/dynamic-ui/DynamicRenderer.tsx
5136
- function Cc(e) {
5130
+ function Ec(e) {
5137
5131
  try {
5138
- let t = bc(e);
5132
+ let t = Cc(e);
5139
5133
  if (!t.success) return {
5140
5134
  success: !1,
5141
5135
  error: `Transpilation failed: ${t.error}`
5142
5136
  };
5143
- let n = Sc(t.code), r = _c(), i = vc(), a = Function(...r, n)(...i);
5137
+ let n = Tc(t.code), r = bc(), i = xc(), a = Function(...r, n)(...i);
5144
5138
  return a ? {
5145
5139
  success: !0,
5146
5140
  Component: a
@@ -5155,9 +5149,9 @@ function Cc(e) {
5155
5149
  };
5156
5150
  }
5157
5151
  }
5158
- function wc(t) {
5152
+ function Dc(t) {
5159
5153
  let n = e(17), { code: r, onRetry: i } = t, a;
5160
- n[0] === r ? a = n[1] : (a = Cc(r), n[0] = r, n[1] = a);
5154
+ n[0] === r ? a = n[1] : (a = Ec(r), n[0] = r, n[1] = a);
5161
5155
  let o = a;
5162
5156
  if (!o.success) {
5163
5157
  let e;
@@ -5165,7 +5159,7 @@ function wc(t) {
5165
5159
  let t;
5166
5160
  n[4] !== i || n[5] !== o.error ? (t = i ? () => i(o.error) : void 0, n[4] = i, n[5] = o.error, n[6] = t) : t = n[6];
5167
5161
  let a;
5168
- return n[7] !== r || n[8] !== e || n[9] !== t ? (a = /* @__PURE__ */ L(pc, {
5162
+ return n[7] !== r || n[8] !== e || n[9] !== t ? (a = /* @__PURE__ */ L(gc, {
5169
5163
  error: e,
5170
5164
  code: r,
5171
5165
  onRetry: t
@@ -5174,7 +5168,7 @@ function wc(t) {
5174
5168
  let s = o.Component, c;
5175
5169
  n[11] === s ? c = n[12] : (c = /* @__PURE__ */ L(s, {}), n[11] = s, n[12] = c);
5176
5170
  let l;
5177
- return n[13] !== r || n[14] !== i || n[15] !== c ? (l = /* @__PURE__ */ L(fc, {
5171
+ return n[13] !== r || n[14] !== i || n[15] !== c ? (l = /* @__PURE__ */ L(hc, {
5178
5172
  code: r,
5179
5173
  onRetry: i,
5180
5174
  children: c
@@ -5182,20 +5176,20 @@ function wc(t) {
5182
5176
  }
5183
5177
  //#endregion
5184
5178
  //#region src/lib/elements/PromptInput.tsx
5185
- var Tc = s(null), Ec = s(null), Dc = () => {
5186
- let e = m(Tc);
5179
+ var Oc = s(null), kc = s(null), Ac = () => {
5180
+ let e = m(Oc);
5187
5181
  if (!e) throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");
5188
5182
  return e;
5189
- }, Oc = () => m(Tc), kc = () => {
5190
- let e = m(Ec);
5183
+ }, jc = () => m(Oc), Mc = () => {
5184
+ let e = m(kc);
5191
5185
  if (!e) throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");
5192
5186
  return e;
5193
- }, Ac = () => m(Ec);
5194
- function jc({ initialInput: e = "", children: t }) {
5187
+ }, Nc = () => m(kc);
5188
+ function Pc({ initialInput: e = "", children: t }) {
5195
5189
  let [n, r] = b(e), i = p(() => r(""), []), [a, o] = b([]), s = y(null), c = y(() => {}), l = p((e) => {
5196
5190
  let t = Array.from(e);
5197
5191
  t.length !== 0 && o((e) => e.concat(t.map((e) => ({
5198
- id: Zt(),
5192
+ id: Qt(),
5199
5193
  type: "file",
5200
5194
  url: URL.createObjectURL(e),
5201
5195
  mediaType: e.type,
@@ -5246,23 +5240,23 @@ function jc({ initialInput: e = "", children: t }) {
5246
5240
  g,
5247
5241
  _
5248
5242
  ]);
5249
- return /* @__PURE__ */ L(Tc.Provider, {
5243
+ return /* @__PURE__ */ L(Oc.Provider, {
5250
5244
  value: x,
5251
- children: /* @__PURE__ */ L(Ec.Provider, {
5245
+ children: /* @__PURE__ */ L(kc.Provider, {
5252
5246
  value: g,
5253
5247
  children: t
5254
5248
  })
5255
5249
  });
5256
5250
  }
5257
- var Mc = s(null), Nc = () => {
5258
- let e = Ac(), t = m(Mc), n = e ?? t;
5251
+ var Fc = s(null), Ic = () => {
5252
+ let e = Nc(), t = m(Fc), n = e ?? t;
5259
5253
  if (!n) throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");
5260
5254
  return n;
5261
5255
  };
5262
- function Pc(t) {
5256
+ function Lc(t) {
5263
5257
  let n = e(47), r, i, a;
5264
5258
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({data: i, className: r, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
5265
- let o = Nc(), s = i.filename || "", c = (i.mediaType?.startsWith("image/") && i.url ? "image" : "file") == "image", l = s || (c ? "Image" : "Attachment"), u;
5259
+ let o = Ic(), s = i.filename || "", c = (i.mediaType?.startsWith("image/") && i.url ? "image" : "file") == "image", l = s || (c ? "Image" : "Attachment"), u;
5266
5260
  n[4] === r ? u = n[5] : (u = F("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none", r), n[4] = r, n[5] = u);
5267
5261
  let d;
5268
5262
  n[6] !== i.id || n[7] !== a || n[8] !== u ? (d = /* @__PURE__ */ L("div", {
@@ -5348,7 +5342,7 @@ function Pc(t) {
5348
5342
  })
5349
5343
  }), n[38] = S, n[39] = C, n[40] = w) : w = n[40];
5350
5344
  let T;
5351
- n[41] !== b || n[42] !== w ? (T = /* @__PURE__ */ L(rl, {
5345
+ n[41] !== b || n[42] !== w ? (T = /* @__PURE__ */ L(ol, {
5352
5346
  className: "w-auto p-2",
5353
5347
  children: /* @__PURE__ */ R("div", {
5354
5348
  className: "w-auto space-y-3",
@@ -5356,12 +5350,12 @@ function Pc(t) {
5356
5350
  })
5357
5351
  }), n[41] = b, n[42] = w, n[43] = T) : T = n[43];
5358
5352
  let E;
5359
- return n[44] !== y || n[45] !== T ? (E = /* @__PURE__ */ R(tl, { children: [y, T] }), n[44] = y, n[45] = T, n[46] = E) : E = n[46], E;
5353
+ return n[44] !== y || n[45] !== T ? (E = /* @__PURE__ */ R(il, { children: [y, T] }), n[44] = y, n[45] = T, n[46] = E) : E = n[46], E;
5360
5354
  }
5361
- function Fc(t) {
5355
+ function Rc(t) {
5362
5356
  let n = e(15), r, i, a;
5363
5357
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({children: r, className: i, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
5364
- let s = Nc();
5358
+ let s = Ic();
5365
5359
  if (!s.files.length) return null;
5366
5360
  let c;
5367
5361
  n[4] === i ? c = n[5] : (c = F("flex w-full flex-wrap items-center gap-2 p-3", i), n[4] = i, n[5] = c);
@@ -5377,10 +5371,10 @@ function Fc(t) {
5377
5371
  children: l
5378
5372
  }), n[11] = a, n[12] = c, n[13] = l, n[14] = u) : u = n[14], u;
5379
5373
  }
5380
- var Ic = (t) => {
5374
+ var zc = (t) => {
5381
5375
  let n = e(10), r, i;
5382
5376
  n[0] === t ? (r = n[1], i = n[2]) : ({label: i, ...r} = t, n[0] = t, n[1] = r, n[2] = i);
5383
- let a = i === void 0 ? "Add photos or files" : i, o = Nc(), s;
5377
+ let a = i === void 0 ? "Add photos or files" : i, o = Ic(), s;
5384
5378
  n[3] === o ? s = n[4] : (s = (e) => {
5385
5379
  e.preventDefault(), o.openFileDialog();
5386
5380
  }, n[3] = o, n[4] = s);
@@ -5396,8 +5390,8 @@ var Ic = (t) => {
5396
5390
  a
5397
5391
  ]
5398
5392
  }), n[6] = a, n[7] = r, n[8] = s, n[9] = l) : l = n[9], l;
5399
- }, Lc = ({ className: e, accept: t, multiple: n, globalDrop: r, syncHiddenInput: i, maxFiles: a, maxFileSize: o, onError: s, onSubmit: c, children: l, ...u }) => {
5400
- let d = Oc(), f = !!d, m = y(null), g = y(null), [_, x] = b([]), S = f ? d.attachments.files : _, C = y(S);
5393
+ }, Bc = ({ className: e, accept: t, multiple: n, globalDrop: r, syncHiddenInput: i, maxFiles: a, maxFileSize: o, onError: s, onSubmit: c, children: l, ...u }) => {
5394
+ let d = jc(), f = !!d, m = y(null), g = y(null), [_, x] = b([]), S = f ? d.attachments.files : _, C = y(S);
5401
5395
  C.current = S;
5402
5396
  let w = p(() => {
5403
5397
  m.current?.click();
@@ -5432,7 +5426,7 @@ var Ic = (t) => {
5432
5426
  });
5433
5427
  let i = [];
5434
5428
  for (let e of n) i.push({
5435
- id: Zt(),
5429
+ id: Qt(),
5436
5430
  type: "file",
5437
5431
  url: URL.createObjectURL(e),
5438
5432
  mediaType: e.type,
@@ -5487,7 +5481,7 @@ var Ic = (t) => {
5487
5481
  let t = await (await fetch(e)).blob();
5488
5482
  return new Promise((e) => {
5489
5483
  let n = new FileReader();
5490
- n.onloadend = () => e(n.result), n.onerror = () => e(null), n.readAsDataURL(t);
5484
+ n.onloadend = () => e(typeof n.result == "string" ? n.result : null), n.onerror = () => e(null), n.readAsDataURL(t);
5491
5485
  });
5492
5486
  } catch {
5493
5487
  return null;
@@ -5521,7 +5515,10 @@ var Ic = (t) => {
5521
5515
  className: F("w-full", e),
5522
5516
  onSubmit: (e) => {
5523
5517
  e.preventDefault();
5524
- let t = e.currentTarget, n = f ? d.textInput.value : new FormData(t).get("message") || "";
5518
+ let t = e.currentTarget, n = f ? d.textInput.value : (() => {
5519
+ let e = new FormData(t).get("message");
5520
+ return typeof e == "string" ? e : "";
5521
+ })();
5525
5522
  f || t.reset(), Promise.all(S.map(async ({ id: e, ...t }) => {
5526
5523
  if (t.url && t.url.startsWith("blob:")) {
5527
5524
  let e = await re(t.url);
@@ -5550,11 +5547,11 @@ var Ic = (t) => {
5550
5547
  children: l
5551
5548
  })
5552
5549
  })] });
5553
- return f ? ae : /* @__PURE__ */ L(Mc.Provider, {
5550
+ return f ? ae : /* @__PURE__ */ L(Fc.Provider, {
5554
5551
  value: ie,
5555
5552
  children: ae
5556
5553
  });
5557
- }, Rc = (t) => {
5554
+ }, Vc = (t) => {
5558
5555
  let n = e(8), r, i;
5559
5556
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5560
5557
  let a;
@@ -5564,10 +5561,10 @@ var Ic = (t) => {
5564
5561
  className: a,
5565
5562
  ...i
5566
5563
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5567
- }, zc = (t) => {
5564
+ }, Hc = (t) => {
5568
5565
  let n = e(24), r, i, a, o;
5569
5566
  n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({onChange: i, className: r, placeholder: o, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o);
5570
- let s = o === void 0 ? "What would you like to know?" : o, c = Oc(), l = Nc(), [u, d] = b(!1), f;
5567
+ let s = o === void 0 ? "What would you like to know?" : o, c = jc(), l = Ic(), [u, d] = b(!1), f;
5571
5568
  n[5] !== l || n[6] !== u ? (f = (e) => {
5572
5569
  if (e.key === "Enter") {
5573
5570
  if (u || e.nativeEvent.isComposing || e.shiftKey) return;
@@ -5616,7 +5613,7 @@ var Ic = (t) => {
5616
5613
  ...a,
5617
5614
  ..._
5618
5615
  }), n[17] = _, n[18] = p, n[19] = h, n[20] = s, n[21] = a, n[22] = v, n[23] = S) : S = n[23], S;
5619
- }, Bc = (t) => {
5616
+ }, Uc = (t) => {
5620
5617
  let n = e(8), r, i;
5621
5618
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5622
5619
  let a;
@@ -5627,7 +5624,7 @@ var Ic = (t) => {
5627
5624
  className: a,
5628
5625
  ...i
5629
5626
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5630
- }, Vc = (t) => {
5627
+ }, Wc = (t) => {
5631
5628
  let n = e(8), r, i;
5632
5629
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5633
5630
  let a;
@@ -5638,7 +5635,7 @@ var Ic = (t) => {
5638
5635
  className: a,
5639
5636
  ...i
5640
5637
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5641
- }, Hc = (t) => {
5638
+ }, Gc = (t) => {
5642
5639
  let n = e(8), r, i;
5643
5640
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5644
5641
  let a;
@@ -5648,7 +5645,7 @@ var Ic = (t) => {
5648
5645
  className: a,
5649
5646
  ...i
5650
5647
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5651
- }, Uc = (t) => {
5648
+ }, Kc = (t) => {
5652
5649
  let n = e(12), r, i, o, s;
5653
5650
  if (n[0] !== t) {
5654
5651
  let { variant: e, className: c, size: l, ...u } = t;
@@ -5664,14 +5661,14 @@ var Ic = (t) => {
5664
5661
  variant: s,
5665
5662
  ...i
5666
5663
  }), n[7] = c, n[8] = i, n[9] = l, n[10] = s, n[11] = u) : u = n[11], u;
5667
- }, Wc = (t) => {
5664
+ }, qc = (t) => {
5668
5665
  let n = e(2), r;
5669
5666
  return n[0] === t ? r = n[1] : (r = /* @__PURE__ */ L(Ee, { ...t }), n[0] = t, n[1] = r), r;
5670
- }, Gc = (t) => {
5667
+ }, Jc = (t) => {
5671
5668
  let n = e(12), r, i, a;
5672
5669
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({className: i, children: r, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
5673
5670
  let o;
5674
- n[4] !== i || n[5] !== a ? (o = /* @__PURE__ */ L(Uc, {
5671
+ n[4] !== i || n[5] !== a ? (o = /* @__PURE__ */ L(Kc, {
5675
5672
  className: i,
5676
5673
  ...a
5677
5674
  }), n[4] = i, n[5] = a, n[6] = o) : o = n[6];
@@ -5682,7 +5679,7 @@ var Ic = (t) => {
5682
5679
  render: o,
5683
5680
  children: s
5684
5681
  }), n[9] = o, n[10] = s, n[11] = c) : c = n[11], c;
5685
- }, Kc = (t) => {
5682
+ }, Yc = (t) => {
5686
5683
  let n = e(8), r, i;
5687
5684
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5688
5685
  let a;
@@ -5693,7 +5690,7 @@ var Ic = (t) => {
5693
5690
  className: a,
5694
5691
  ...i
5695
5692
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5696
- }, qc = (t) => {
5693
+ }, Xc = (t) => {
5697
5694
  let n = e(8), r, i;
5698
5695
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5699
5696
  let a;
@@ -5703,7 +5700,7 @@ var Ic = (t) => {
5703
5700
  className: a,
5704
5701
  ...i
5705
5702
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5706
- }, Jc = (t) => {
5703
+ }, Zc = (t) => {
5707
5704
  let n = e(19), r, i, a, o, s, c;
5708
5705
  n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6]) : ({className: i, variant: s, size: c, status: o, children: r, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c);
5709
5706
  let l = s === void 0 ? "default" : s, u = c === void 0 ? "icon-sm" : c, d;
@@ -5731,7 +5728,7 @@ var Ic = (t) => {
5731
5728
  ...a,
5732
5729
  children: m
5733
5730
  }), n[13] = a, n[14] = u, n[15] = p, n[16] = m, n[17] = l, n[18] = h) : h = n[18], h;
5734
- }, Yc = (t) => {
5731
+ }, Qc = (t) => {
5735
5732
  let n = e(21), r, i, a, o;
5736
5733
  n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({className: r, textareaRef: o, onTranscriptionChange: i, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o);
5737
5734
  let [s, c] = b(!1), [l, u] = b(null), f = y(null), p, m;
@@ -5769,17 +5766,17 @@ var Ic = (t) => {
5769
5766
  let S = !l, C;
5770
5767
  n[15] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ L(ht, { className: "size-4" }), n[15] = C) : C = n[15];
5771
5768
  let w;
5772
- return n[16] !== a || n[17] !== x || n[18] !== S || n[19] !== _ ? (w = /* @__PURE__ */ L(Uc, {
5769
+ return n[16] !== a || n[17] !== x || n[18] !== S || n[19] !== _ ? (w = /* @__PURE__ */ L(Kc, {
5773
5770
  className: x,
5774
5771
  disabled: S,
5775
5772
  onClick: _,
5776
5773
  ...a,
5777
5774
  children: C
5778
5775
  }), n[16] = a, n[17] = x, n[18] = S, n[19] = _, n[20] = w) : w = n[20], w;
5779
- }, Xc = (t) => {
5776
+ }, $c = (t) => {
5780
5777
  let n = e(2), r;
5781
5778
  return n[0] === t ? r = n[1] : (r = /* @__PURE__ */ L(Le, { ...t }), n[0] = t, n[1] = r), r;
5782
- }, Zc = (t) => {
5779
+ }, el = (t) => {
5783
5780
  let n = e(8), r, i;
5784
5781
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5785
5782
  let a;
@@ -5789,7 +5786,7 @@ var Ic = (t) => {
5789
5786
  className: a,
5790
5787
  ...i
5791
5788
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5792
- }, Qc = (t) => {
5789
+ }, tl = (t) => {
5793
5790
  let n = e(8), r, i;
5794
5791
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5795
5792
  let a;
@@ -5799,7 +5796,7 @@ var Ic = (t) => {
5799
5796
  className: a,
5800
5797
  ...i
5801
5798
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5802
- }, $c = (t) => {
5799
+ }, nl = (t) => {
5803
5800
  let n = e(8), r, i;
5804
5801
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5805
5802
  let a;
@@ -5809,7 +5806,7 @@ var Ic = (t) => {
5809
5806
  className: a,
5810
5807
  ...i
5811
5808
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5812
- }, el = (t) => {
5809
+ }, rl = (t) => {
5813
5810
  let n = e(8), r, i;
5814
5811
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5815
5812
  let a;
@@ -5819,10 +5816,10 @@ var Ic = (t) => {
5819
5816
  className: a,
5820
5817
  ...i
5821
5818
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5822
- }, tl = (t) => {
5819
+ }, il = (t) => {
5823
5820
  let n = e(2), r;
5824
5821
  return n[0] === t ? r = n[1] : (r = /* @__PURE__ */ L(Ae, { ...t }), n[0] = t, n[1] = r), r;
5825
- }, nl = (t) => {
5822
+ }, al = (t) => {
5826
5823
  let n = e(8), r, i, a;
5827
5824
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({delay: i, closeDelay: a, ...r} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
5828
5825
  let o = i === void 0 ? 0 : i, s = a === void 0 ? 0 : a, c;
@@ -5831,7 +5828,7 @@ var Ic = (t) => {
5831
5828
  closeDelay: s,
5832
5829
  ...r
5833
5830
  }), n[4] = s, n[5] = o, n[6] = r, n[7] = c) : c = n[7], c;
5834
- }, rl = (t) => {
5831
+ }, ol = (t) => {
5835
5832
  let n = e(6), r, i;
5836
5833
  n[0] === t ? (r = n[1], i = n[2]) : ({align: i, ...r} = t, n[0] = t, n[1] = r, n[2] = i);
5837
5834
  let a = i === void 0 ? "start" : i, o;
@@ -5839,7 +5836,7 @@ var Ic = (t) => {
5839
5836
  align: a,
5840
5837
  ...r
5841
5838
  }), n[3] = a, n[4] = r, n[5] = o) : o = n[5], o;
5842
- }, il = (t) => {
5839
+ }, sl = (t) => {
5843
5840
  let n = e(8), r, i;
5844
5841
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5845
5842
  let a;
@@ -5849,7 +5846,7 @@ var Ic = (t) => {
5849
5846
  className: a,
5850
5847
  ...i
5851
5848
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5852
- }, al = (t) => {
5849
+ }, cl = (t) => {
5853
5850
  let n = e(8), r, i;
5854
5851
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5855
5852
  let a;
@@ -5859,7 +5856,7 @@ var Ic = (t) => {
5859
5856
  className: a,
5860
5857
  ...i
5861
5858
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5862
- }, ol = (t) => {
5859
+ }, ll = (t) => {
5863
5860
  let n = e(10), r, i, a;
5864
5861
  n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({className: i, children: r, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
5865
5862
  let o;
@@ -5870,7 +5867,7 @@ var Ic = (t) => {
5870
5867
  ...a,
5871
5868
  children: r
5872
5869
  }), n[6] = r, n[7] = a, n[8] = o, n[9] = s) : s = n[9], s;
5873
- }, sl = (t) => {
5870
+ }, ul = (t) => {
5874
5871
  let n = e(8), r, i;
5875
5872
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5876
5873
  let a;
@@ -5880,7 +5877,7 @@ var Ic = (t) => {
5880
5877
  className: a,
5881
5878
  ...i
5882
5879
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5883
- }, cl = (t) => {
5880
+ }, dl = (t) => {
5884
5881
  let n = e(8), r, i;
5885
5882
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5886
5883
  let a;
@@ -5890,7 +5887,7 @@ var Ic = (t) => {
5890
5887
  className: a,
5891
5888
  ...i
5892
5889
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5893
- }, ll = (t) => {
5890
+ }, fl = (t) => {
5894
5891
  let n = e(8), r, i;
5895
5892
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5896
5893
  let a;
@@ -5900,7 +5897,7 @@ var Ic = (t) => {
5900
5897
  className: a,
5901
5898
  ...i
5902
5899
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5903
- }, ul = (t) => {
5900
+ }, pl = (t) => {
5904
5901
  let n = e(8), r, i;
5905
5902
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5906
5903
  let a;
@@ -5910,7 +5907,7 @@ var Ic = (t) => {
5910
5907
  className: a,
5911
5908
  ...i
5912
5909
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5913
- }, dl = (t) => {
5910
+ }, ml = (t) => {
5914
5911
  let n = e(8), r, i;
5915
5912
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5916
5913
  let a;
@@ -5920,7 +5917,7 @@ var Ic = (t) => {
5920
5917
  className: a,
5921
5918
  ...i
5922
5919
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5923
- }, fl = (t) => {
5920
+ }, hl = (t) => {
5924
5921
  let n = e(8), r, i;
5925
5922
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5926
5923
  let a;
@@ -5930,7 +5927,7 @@ var Ic = (t) => {
5930
5927
  className: a,
5931
5928
  ...i
5932
5929
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5933
- }, pl = (t) => {
5930
+ }, gl = (t) => {
5934
5931
  let n = e(8), r, i;
5935
5932
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5936
5933
  let a;
@@ -5940,7 +5937,7 @@ var Ic = (t) => {
5940
5937
  className: a,
5941
5938
  ...i
5942
5939
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5943
- }, ml = (t) => {
5940
+ }, _l = (t) => {
5944
5941
  let n = e(8), r, i;
5945
5942
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5946
5943
  let a;
@@ -5950,7 +5947,7 @@ var Ic = (t) => {
5950
5947
  className: a,
5951
5948
  ...i
5952
5949
  }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
5953
- }, hl = (t) => {
5950
+ }, vl = (t) => {
5954
5951
  let n = e(8), r, i;
5955
5952
  n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
5956
5953
  let a;
@@ -5963,7 +5960,7 @@ var Ic = (t) => {
5963
5960
  };
5964
5961
  //#endregion
5965
5962
  //#region src/lib/hooks/use-async-generator.ts
5966
- function gl() {
5963
+ function yl() {
5967
5964
  let [e, t] = b({
5968
5965
  loading: !1,
5969
5966
  error: null
@@ -5993,7 +5990,7 @@ function gl() {
5993
5990
  }
5994
5991
  //#endregion
5995
5992
  //#region src/lib/hooks/use-auto-resize-textarea.ts
5996
- function _l(t) {
5993
+ function bl(t) {
5997
5994
  let n = e(16), { minHeight: r, maxHeight: i, value: a } = t, o = y(null), s;
5998
5995
  n[0] !== i || n[1] !== r ? (s = (e) => {
5999
5996
  let t = o.current;
@@ -6030,22 +6027,22 @@ function _l(t) {
6030
6027
  }
6031
6028
  //#endregion
6032
6029
  //#region src/lib/hooks/use-keyboard.ts
6033
- function vl(e) {
6030
+ function xl(e) {
6034
6031
  let t = [];
6035
6032
  return e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), t.push(e.key.toLowerCase()), t.join("+");
6036
6033
  }
6037
- function yl(t) {
6034
+ function Sl(t) {
6038
6035
  let n = e(4), { enabled: r, handlers: i } = t, a = r === void 0 || r, o, s;
6039
6036
  n[0] !== a || n[1] !== i ? (o = () => {
6040
6037
  if (!a) return;
6041
6038
  let e = (e) => {
6042
- let t = vl(e), n = i[t];
6039
+ let t = xl(e), n = i[t];
6043
6040
  n ||= i[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
6044
6041
  };
6045
6042
  return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
6046
6043
  }, s = [a, i], n[0] = a, n[1] = i, n[2] = o, n[3] = s) : (o = n[2], s = n[3]), h(o, s);
6047
6044
  }
6048
6045
  //#endregion
6049
- export { mn as AgentHeader, yn as AgentProvider, ln as AgentScrollArea, Pi as AssistantSnapshot, Si as COPY_EXCLUSION_ATTRIBUTE, Ci as COPY_EXCLUSION_MODES, Q as ChatActionButton, cn as ChatBot, Ps as ChatComposer, rn as ChatManager, Fs as ChatTextarea, yr as CitationPill, ii as CodeBlock, ai as CodeBlockCopyButton, cs as CompactMessages, os as CompactTrajectory, Oa as CopyAction, Aa as CopyDebugJsonAction, wc as DynamicRenderer, pc as DynamicUIError, fc as DynamicUIErrorBoundary, gr as IndexProgress, Ui as InteractiveResponse, vr as MessageItemCtx, so as MessageMetadata, Vs as MessageQueue, vs as Messages, Da as MessagesActions, _r as MessagesCtx, Ma as MessagesError, Fa as MessagesItem, Pa as MessagesList, Na as MessagesRoot, bo as MessagesUserBubble, Ta as NestedTrajectory, La as PendingToolInput, Lc as PromptInput, Ic as PromptInputActionAddAttachments, Wc as PromptInputActionMenu, Kc as PromptInputActionMenuContent, qc as PromptInputActionMenuItem, Gc as PromptInputActionMenuTrigger, Pc as PromptInputAttachment, Fc as PromptInputAttachments, Rc as PromptInputBody, Uc as PromptInputButton, ll as PromptInputCommand, fl as PromptInputCommandEmpty, pl as PromptInputCommandGroup, ul as PromptInputCommandInput, ml as PromptInputCommandItem, dl as PromptInputCommandList, hl as PromptInputCommandSeparator, Vc as PromptInputFooter, Bc as PromptInputHeader, tl as PromptInputHoverCard, rl as PromptInputHoverCardContent, nl as PromptInputHoverCardTrigger, jc as PromptInputProvider, Xc as PromptInputSelect, Qc as PromptInputSelectContent, $c as PromptInputSelectItem, Zc as PromptInputSelectTrigger, el as PromptInputSelectValue, Yc as PromptInputSpeechButton, Jc as PromptInputSubmit, al as PromptInputTab, sl as PromptInputTabBody, cl as PromptInputTabItem, ol as PromptInputTabLabel, il as PromptInputTabsList, zc as PromptInputTextarea, Hc as PromptInputTools, wn as ReadOnlyChatTransport, ka as RegenerateAction, J as Response, X as Segment, Ai as SnapshotRenderPortal, qs as SubmitButton, kn as TextShimmer, xi as TheButton, Ts as TimelinedMessages, dc as TipLine, cc as TipProvider, $s as TipValueContext, lc as Tips, na as ToolArg, Zs as ToolError, yo as UserMessageContent, eo as ZukhrufChatTransport, Cn as citationIndexOf, tn as clearPrefill, gc as createSafeScope, qe as defineElements, Ni as extractAssistantRawText, Sn as extractSourcesFromMessages, Za as formatUsageBreakdown, Xa as formatUsageValue, Fn as getIndexProgressEvents, _c as getScopeKeys, vc as getScopeValues, Z as getSegmentKey, Ti as hasCopyExclusion, Ri as isActiveClientInputTool, aa as isCommentaryTextPart, Fi as isSubagentPart, En as isToolAborted, Tn as isToolStateAborted, Ga as parseMetadataUsage, Wa as parseUsage, $t as readPrefill, Di as resolveCopyToClipboardStrategy, Li as resolveToolEntry, On as serializeToolsRegistry, Ei as shouldIncludeInCopyImage, Ii as subagentDisplayName, bc as transpileJSX, Ia as useActivePendingToolInput, V as useAgent, on as useAgentChatSetup, U as useAgentMessages, H as useAgentMeta, bn as useAgentStatus, gl as useAsyncGenerator, _l as useAutoResizeTextarea, xn as useChatManager, Xo as useCompactGroup, Mi as useCopyElementAsImage, Y as useIsAssistantSnapshotRender, Dn as useIsToolAborted, yl as useKeyboard, K as useMessageItem, W as useMessagesContext, G as useMessagesStatus, Ya as useNormalizedUsageTracking, Nc as usePromptInputAttachments, Dc as usePromptInputController, kc as useProviderAttachments, ec as useTipValue, pa as useToolSegment, Jo as useTrajectoryItems, ki as waitForNextPaint, Sc as wrapAsComponent, en as writePrefill };
6046
+ export { hn as AgentHeader, bn as AgentProvider, un as AgentScrollArea, Fi as AssistantSnapshot, Ci as COPY_EXCLUSION_ATTRIBUTE, wi as COPY_EXCLUSION_MODES, $ as ChatActionButton, ln as ChatBot, Ls as ChatComposer, an as ChatManager, Rs as ChatTextarea, yr as CitationPill, ii as CodeBlock, ai as CodeBlockCopyButton, ds as CompactMessages, ls as CompactTrajectory, ka as CopyAction, ja as CopyDebugJsonAction, Dc as DynamicRenderer, gc as DynamicUIError, hc as DynamicUIErrorBoundary, gr as IndexProgress, Wi as InteractiveResponse, vr as MessageItemCtx, lo as MessageMetadata, Ws as MessageQueue, xs as Messages, Oa as MessagesActions, _r as MessagesCtx, Na as MessagesError, Ia as MessagesItem, Fa as MessagesList, Pa as MessagesRoot, Co as MessagesUserBubble, Ea as NestedTrajectory, Ra as PendingToolInput, Bc as PromptInput, zc as PromptInputActionAddAttachments, qc as PromptInputActionMenu, Yc as PromptInputActionMenuContent, Xc as PromptInputActionMenuItem, Jc as PromptInputActionMenuTrigger, Lc as PromptInputAttachment, Rc as PromptInputAttachments, Vc as PromptInputBody, Kc as PromptInputButton, fl as PromptInputCommand, hl as PromptInputCommandEmpty, gl as PromptInputCommandGroup, pl as PromptInputCommandInput, _l as PromptInputCommandItem, ml as PromptInputCommandList, vl as PromptInputCommandSeparator, Wc as PromptInputFooter, Uc as PromptInputHeader, il as PromptInputHoverCard, ol as PromptInputHoverCardContent, al as PromptInputHoverCardTrigger, Pc as PromptInputProvider, $c as PromptInputSelect, tl as PromptInputSelectContent, nl as PromptInputSelectItem, el as PromptInputSelectTrigger, rl as PromptInputSelectValue, Qc as PromptInputSpeechButton, Zc as PromptInputSubmit, cl as PromptInputTab, ul as PromptInputTabBody, dl as PromptInputTabItem, ll as PromptInputTabLabel, sl as PromptInputTabsList, Hc as PromptInputTextarea, Gc as PromptInputTools, Tn as ReadOnlyChatTransport, Aa as RegenerateAction, Y as Response, Z as Segment, ji as SnapshotRenderPortal, Xs as SubmitButton, W as TextShimmer, Si as TheButton, Os as TimelinedMessages, mc as TipLine, dc as TipProvider, nc as TipValueContext, fc as Tips, ra as ToolArg, ec as ToolError, So as UserMessageContent, no as ZukhrufChatTransport, wn as citationIndexOf, nn as clearPrefill, yc as createSafeScope, qe as defineElements, Pi as extractAssistantRawText, Cn as extractSourcesFromMessages, $a as formatUsageBreakdown, Qa as formatUsageValue, Fn as getIndexProgressEvents, bc as getScopeKeys, xc as getScopeValues, Q as getSegmentKey, Ei as hasCopyExclusion, zi as isActiveClientInputTool, oa as isCommentaryTextPart, Ii as isSubagentPart, Dn as isToolAborted, En as isToolStateAborted, qa as parseMetadataUsage, Ka as parseUsage, en as readPrefill, Oi as resolveCopyToClipboardStrategy, Ri as resolveToolEntry, kn as serializeToolsRegistry, Di as shouldIncludeInCopyImage, Li as subagentDisplayName, Cc as transpileJSX, La as useActivePendingToolInput, V as useAgent, sn as useAgentChatSetup, U as useAgentMessages, H as useAgentMeta, xn as useAgentStatus, yl as useAsyncGenerator, bl as useAutoResizeTextarea, Sn as useChatManager, $o as useCompactGroup, Ni as useCopyElementAsImage, X as useIsAssistantSnapshotRender, On as useIsToolAborted, Sl as useKeyboard, q as useMessageItem, G as useMessagesContext, K as useMessagesStatus, Za as useNormalizedUsageTracking, Ic as usePromptInputAttachments, Ac as usePromptInputController, Mc as useProviderAttachments, rc as useTipValue, ma as useToolSegment, Zo as useTrajectoryItems, Ai as waitForNextPaint, Tc as wrapAsComponent, tn as writePrefill };
6050
6047
 
6051
6048
  //# sourceMappingURL=index.js.map