@8wave/ai-elements 0.121.0-beta.55 → 0.121.0-beta.56

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 (117) hide show
  1. package/dist/_chunks/{Agent-BdoXh8b0.js → Agent-FDL4Wq0B.js} +95 -71
  2. package/dist/_chunks/Agent-FDL4Wq0B.js.map +1 -0
  3. package/dist/_chunks/{PkStreamingMarkdown-Bev81_Lp.js → PkStreamingMarkdown-DPW6VsEn.js} +6 -6
  4. package/dist/_chunks/{PkStreamingMarkdown-Bev81_Lp.js.map → PkStreamingMarkdown-DPW6VsEn.js.map} +1 -1
  5. package/dist/_chunks/{PkToolChatFile-a37ez2k5.js → PkToolChatFile-BL6_6_YP.js} +4 -4
  6. package/dist/_chunks/{PkToolChatFile-a37ez2k5.js.map → PkToolChatFile-BL6_6_YP.js.map} +1 -1
  7. package/dist/_chunks/{PkToolRequestGeolocation-BantUie4.js → PkToolRequestGeolocation-nLx_fany.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestGeolocation-BantUie4.js.map → PkToolRequestGeolocation-nLx_fany.js.map} +1 -1
  9. package/dist/_chunks/{PkToolRequestOAuthConnection-CB5ziPOE.js → PkToolRequestOAuthConnection-BeULtYsM.js} +2 -2
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-CB5ziPOE.js.map → PkToolRequestOAuthConnection-BeULtYsM.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowArtifact-CecXXZSh.js → PkToolShowArtifact-BbxJB9sw.js} +2 -2
  12. package/dist/_chunks/{PkToolShowArtifact-CecXXZSh.js.map → PkToolShowArtifact-BbxJB9sw.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowContactForm-3BGkXgD9.js → PkToolShowContactForm-MPqFOYBD.js} +2 -2
  14. package/dist/_chunks/{PkToolShowContactForm-3BGkXgD9.js.map → PkToolShowContactForm-MPqFOYBD.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowForm-BXOmY4ce.js → PkToolShowForm-BCt6k0Qn.js} +3 -3
  16. package/dist/_chunks/{PkToolShowForm-BXOmY4ce.js.map → PkToolShowForm-BCt6k0Qn.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowImageGallery-BisEror8.js → PkToolShowImageGallery-D5Mj0OMR.js} +2 -2
  18. package/dist/_chunks/{PkToolShowImageGallery-BisEror8.js.map → PkToolShowImageGallery-D5Mj0OMR.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowProductList-BmPdjUSS.js → PkToolShowProductList-Fsm9LxbT.js} +2 -2
  20. package/dist/_chunks/{PkToolShowProductList-BmPdjUSS.js.map → PkToolShowProductList-Fsm9LxbT.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowSources-Cv8UguNA.js → PkToolShowSources-CmSKmV61.js} +3 -3
  22. package/dist/_chunks/{PkToolShowSources-Cv8UguNA.js.map → PkToolShowSources-CmSKmV61.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowSuggestedReply-lzs6-CcI.js → PkToolShowSuggestedReply-Bp3CzPjY.js} +2 -2
  24. package/dist/_chunks/{PkToolShowSuggestedReply-lzs6-CcI.js.map → PkToolShowSuggestedReply-Bp3CzPjY.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowVideo-BPYYn43O.js → PkToolShowVideo-2G2Sty3S.js} +2 -2
  26. package/dist/_chunks/{PkToolShowVideo-BPYYn43O.js.map → PkToolShowVideo-2G2Sty3S.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowWebPages-CbE_bnHt.js → PkToolShowWebPages-BpNBC0sK.js} +2 -2
  28. package/dist/_chunks/{PkToolShowWebPages-CbE_bnHt.js.map → PkToolShowWebPages-BpNBC0sK.js.map} +1 -1
  29. package/dist/_chunks/{chatImagePolicy-CZeGEXvB.js → chatImagePolicy-ulDURWxd.js} +2 -2
  30. package/dist/_chunks/{chatImagePolicy-CZeGEXvB.js.map → chatImagePolicy-ulDURWxd.js.map} +1 -1
  31. package/dist/_chunks/{markdown-DtRRqlac.js → markdown-CYo6_RtA.js} +8 -8
  32. package/dist/_chunks/{markdown-DtRRqlac.js.map → markdown-CYo6_RtA.js.map} +1 -1
  33. package/dist/ai-elements.es.js +2419 -2422
  34. package/dist/ai-elements.es.js.map +1 -1
  35. package/dist-vue/PkChatbot.js +1 -1
  36. package/dist-vue/PkChatbotEmptyState.js +1 -1
  37. package/dist-vue/PkChatbotInput.js +1 -1
  38. package/dist-vue/PkChatbotMessages.js +1 -1
  39. package/dist-vue/PkChatbotStepPayload.js +1 -1
  40. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  41. package/dist-vue/PkChatbotSteps.js +1 -1
  42. package/dist-vue/PkChatbotViewChat.js +1 -1
  43. package/dist-vue/PkChatbotViewConversations.js +1 -1
  44. package/dist-vue/PkChatbotViewFiles.js +1 -1
  45. package/dist-vue/PkChatbotViewProfile.js +1 -1
  46. package/dist-vue/_chunks/{Agent-B-jQOrER.js → Agent-CZUFbLo7.js} +85 -80
  47. package/dist-vue/_chunks/Agent-CZUFbLo7.js.map +1 -0
  48. package/dist-vue/_chunks/{Document-DQtliJu6.js → Document-C06S5S5M.js} +2 -2
  49. package/dist-vue/_chunks/{Document-DQtliJu6.js.map → Document-C06S5S5M.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkChatbot-BFAcqm6m.js → PkChatbot-BjD_4yaD.js} +8 -8
  51. package/dist-vue/_chunks/{PkChatbot-BFAcqm6m.js.map → PkChatbot-BjD_4yaD.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotEmptyState-fADhr37n.js → PkChatbotEmptyState-CMNmmQdu.js} +2 -2
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-fADhr37n.js.map → PkChatbotEmptyState-CMNmmQdu.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkChatbotInput-CUOcwWDz.js → PkChatbotInput-CdpjDIzr.js} +2 -2
  55. package/dist-vue/_chunks/{PkChatbotInput-CUOcwWDz.js.map → PkChatbotInput-CdpjDIzr.js.map} +1 -1
  56. package/dist-vue/_chunks/PkChatbotMessages-ozG-o8mm.js +965 -0
  57. package/dist-vue/_chunks/PkChatbotMessages-ozG-o8mm.js.map +1 -0
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-CQD8lb4l.js → PkChatbotStepPayload-WwVYTghY.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-CQD8lb4l.js.map → PkChatbotStepPayload-WwVYTghY.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Bj1ZBPMz.js → PkChatbotStepToolDetail-BV2J0bAi.js} +3 -3
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-Bj1ZBPMz.js.map → PkChatbotStepToolDetail-BV2J0bAi.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotSteps-DhIEYst5.js → PkChatbotSteps-D2z1P3h3.js} +5 -5
  63. package/dist-vue/_chunks/{PkChatbotSteps-DhIEYst5.js.map → PkChatbotSteps-D2z1P3h3.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotViewChat-CW4SxAtr.js → PkChatbotViewChat-BqFY0Evp.js} +7 -7
  65. package/dist-vue/_chunks/{PkChatbotViewChat-CW4SxAtr.js.map → PkChatbotViewChat-BqFY0Evp.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-BXxXUgso.js → PkChatbotViewConversations-DF_c4X6k.js} +3 -3
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-BXxXUgso.js.map → PkChatbotViewConversations-DF_c4X6k.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotViewFiles-i_OUsdlU.js → PkChatbotViewFiles-B76IwGGP.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-i_OUsdlU.js.map → PkChatbotViewFiles-B76IwGGP.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotViewProfile-x0oUCbeL.js → PkChatbotViewProfile-Bt0eH8fO.js} +2 -2
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-x0oUCbeL.js.map → PkChatbotViewProfile-Bt0eH8fO.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkStreamingMarkdown-qZLlI83D.js → PkStreamingMarkdown-DbcGdYgv.js} +3 -3
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-qZLlI83D.js.map → PkStreamingMarkdown-DbcGdYgv.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkToolChatFile-DPkLqqDt.js → PkToolChatFile-CVRYORvL.js} +2 -2
  75. package/dist-vue/_chunks/{PkToolChatFile-DPkLqqDt.js.map → PkToolChatFile-CVRYORvL.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkToolRequestGeolocation-CY-NC6Rc.js → PkToolRequestGeolocation-DXHDyI5N.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-CY-NC6Rc.js.map → PkToolRequestGeolocation-DXHDyI5N.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-RkbnKSde.js → PkToolRequestOAuthConnection-D5hBaUNG.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-RkbnKSde.js.map → PkToolRequestOAuthConnection-D5hBaUNG.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowArtifact-BDZjRnfs.js → PkToolShowArtifact-CucTREqR.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowArtifact-BDZjRnfs.js.map → PkToolShowArtifact-CucTREqR.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowContactForm-CcIF7fNS.js → PkToolShowContactForm-B3uOHhnG.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowContactForm-CcIF7fNS.js.map → PkToolShowContactForm-B3uOHhnG.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolShowDiagram-CD70YQgq.js → PkToolShowDiagram-CHLApsxe.js} +2 -2
  85. package/dist-vue/_chunks/{PkToolShowDiagram-CD70YQgq.js.map → PkToolShowDiagram-CHLApsxe.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShowForm-edPn56Ka.js → PkToolShowForm-CblYA_3B.js} +4 -4
  87. package/dist-vue/_chunks/{PkToolShowForm-edPn56Ka.js.map → PkToolShowForm-CblYA_3B.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowImageGallery-82BzTTbf.js → PkToolShowImageGallery-uhRKuPJK.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-82BzTTbf.js.map → PkToolShowImageGallery-uhRKuPJK.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowProductList-CKPDiMkx.js → PkToolShowProductList-BIbKoptX.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowProductList-CKPDiMkx.js.map → PkToolShowProductList-BIbKoptX.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowSources-CHH2vKVG.js → PkToolShowSources-Ci8ssht-.js} +3 -3
  93. package/dist-vue/_chunks/{PkToolShowSources-CHH2vKVG.js.map → PkToolShowSources-Ci8ssht-.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowSuggestedReply-CThFJVUq.js → PkToolShowSuggestedReply-CQgkPMgE.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-CThFJVUq.js.map → PkToolShowSuggestedReply-CQgkPMgE.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowVideo-C5TKoW1f.js → PkToolShowVideo-hQQ_Kr8f.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowVideo-C5TKoW1f.js.map → PkToolShowVideo-hQQ_Kr8f.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowWebPages-CuwLXH1I.js → PkToolShowWebPages-BUlVSK43.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CuwLXH1I.js.map → PkToolShowWebPages-BUlVSK43.js.map} +1 -1
  100. package/dist-vue/_chunks/{createChatbotApiClient-B3U31J_K.js → createChatbotApiClient-BYGLKd_e.js} +14 -14
  101. package/dist-vue/_chunks/{createChatbotApiClient-B3U31J_K.js.map → createChatbotApiClient-BYGLKd_e.js.map} +1 -1
  102. package/dist-vue/_chunks/{useChatbotStore-D2L4m3iJ.js → useChatbotStore-O0u7mVit.js} +475 -475
  103. package/dist-vue/_chunks/{useChatbotStore-D2L4m3iJ.js.map → useChatbotStore-O0u7mVit.js.map} +1 -1
  104. package/dist-vue/_chunks/{utils-C8jnMPj0.js → utils-CqPytB2D.js} +8 -8
  105. package/dist-vue/_chunks/{utils-C8jnMPj0.js.map → utils-CqPytB2D.js.map} +1 -1
  106. package/dist-vue/api.js +1 -1
  107. package/dist-vue/composables.js +6 -6
  108. package/dist-vue/composables.js.map +1 -1
  109. package/dist-vue/index.js +140 -140
  110. package/dist-vue/index.js.map +1 -1
  111. package/dist-vue/locales.js +4 -4
  112. package/dist-vue/packages/models/src/schema/Agent.d.ts +6 -0
  113. package/package.json +1 -1
  114. package/dist/_chunks/Agent-BdoXh8b0.js.map +0 -1
  115. package/dist-vue/_chunks/Agent-B-jQOrER.js.map +0 -1
  116. package/dist-vue/_chunks/PkChatbotMessages-CcTQozaF.js +0 -968
  117. package/dist-vue/_chunks/PkChatbotMessages-CcTQozaF.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  import { C as e, D as t, O as n, S as r, _ as i, a, g as o, h as s, i as c, l, m as u, o as d, p as f, r as p, s as m, u as h, v as g, w as _, x as v } from "./schemas-BO5QlXAp.js";
2
- import { $ as ee, J as y, K as te, Q as ne, U as re, W as ie, Z as ae, z as oe } from "./Agent-B-jQOrER.js";
3
- import { r as se, t as ce } from "./createChatbotApiClient-B3U31J_K.js";
4
- import { n as le } from "./src-B-ZKEhTU.js";
5
- import { d as ue, r as de } from "./message-DuibQyHy.js";
6
- import { n as fe, t as pe } from "./useSafeLocalStorage-a2eHEqAi.js";
7
- import { computed as b, getCurrentScope as me, isReadonly as he, nextTick as ge, onScopeDispose as _e, reactive as ve, ref as x, shallowRef as ye, toRefs as be, toValue as xe, watch as S, watchEffect as Se } from "vue";
8
- import { useI18n as Ce } from "vue-i18n";
9
- import { useDocumentVisibility as we, usePreferredDark as Te } from "@vueuse/core";
10
- import { defineStore as Ee } from "pinia";
2
+ import { $ as y, B as b, G as ee, Q as te, W as ne, Y as re, et as ie, q as ae } from "./Agent-CZUFbLo7.js";
3
+ import { r as oe, t as se } from "./createChatbotApiClient-BYGLKd_e.js";
4
+ import { n as ce } from "./src-B-ZKEhTU.js";
5
+ import { d as le, r as ue } from "./message-DuibQyHy.js";
6
+ import { n as de, t as fe } from "./useSafeLocalStorage-a2eHEqAi.js";
7
+ import { computed as x, getCurrentScope as pe, isReadonly as me, nextTick as he, onScopeDispose as ge, reactive as _e, ref as S, shallowRef as ve, toRefs as ye, toValue as be, watch as C, watchEffect as xe } from "vue";
8
+ import { useI18n as Se } from "vue-i18n";
9
+ import { useDocumentVisibility as Ce, usePreferredDark as we } from "@vueuse/core";
10
+ import { defineStore as Te } from "pinia";
11
11
  // ../../packages/utils/src/device-context.ts
12
- function De() {
12
+ function Ee() {
13
13
  let e = navigator.connection, t = navigator.userAgentData;
14
14
  return {
15
15
  dateTime: (/* @__PURE__ */ new Date()).toISOString(),
@@ -39,7 +39,7 @@ function De() {
39
39
  historyLength: window.history.length
40
40
  };
41
41
  }
42
- async function Oe(e) {
42
+ async function De(e) {
43
43
  if (!navigator.geolocation || !navigator.permissions) return null;
44
44
  try {
45
45
  if ((await navigator.permissions.query({ name: "geolocation" })).state !== "granted") return null;
@@ -57,16 +57,16 @@ async function Oe(e) {
57
57
  }
58
58
  }
59
59
  // ../../packages/composable/src/chatbot/hostTools.ts
60
- var ke = "agentstudio:page-navigation", Ae = (e) => typeof e?.afterOutput == "function", je = (e) => e.toolMetadata?.source === ae, Me = (e, t) => {
60
+ var Oe = "agentstudio:page-navigation", ke = (e) => typeof e?.afterOutput == "function", Ae = (e) => e.toolMetadata?.source === te, je = (e, t) => {
61
61
  if (!t || !e?.length) return;
62
- let n = new Set(t.allowed), r = e.filter((e) => n.has(e.name) && !te(e.name)).map(({ execute: e, confirmation: t, policy: n, ...r }) => r);
62
+ let n = new Set(t.allowed), r = e.filter((e) => n.has(e.name) && !ae(e.name)).map(({ execute: e, confirmation: t, policy: n, ...r }) => r);
63
63
  return r.length > 0 ? r : void 0;
64
64
  };
65
- function Ne(e) {
65
+ function Me(e) {
66
66
  let t = 0, n = 0, r = (t) => {
67
67
  n = t, e.onPendingChange?.(n);
68
68
  }, i = Promise.resolve(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = (e) => {
69
- Ae(e) && e.abandon?.();
69
+ ke(e) && e.abandon?.();
70
70
  }, c = (e, t) => t.requireConfirmation.includes(e.name) || t.confirmDestructive && e.annotations?.destructiveHint === !0, l = (t, n) => e.addToolOutput({
71
71
  tool: t.toolName,
72
72
  toolCallId: t.toolCallId,
@@ -80,7 +80,7 @@ function Ne(e) {
80
80
  async function d(n, r) {
81
81
  let i = () => r === t, d = e.capability(), f = e.registry()?.find((e) => e.name === n.toolName), p = f?.policy?.timeoutMs ?? d?.timeoutMs;
82
82
  if (!f || p === void 0) {
83
- u(n, ne(n.readOnly));
83
+ u(n, y(n.readOnly));
84
84
  return;
85
85
  }
86
86
  let m;
@@ -117,7 +117,7 @@ function Ne(e) {
117
117
  s(r);
118
118
  return;
119
119
  }
120
- if (Ae(r)) {
120
+ if (ke(r)) {
121
121
  l(n, r.result ?? null);
122
122
  let t = !1, a = () => {
123
123
  t || (t = !0, o.delete(a), r.abandon?.());
@@ -129,7 +129,7 @@ function Ne(e) {
129
129
  } catch (e) {
130
130
  if (v?.then(s, () => void 0), !i()) return;
131
131
  let t = g.signal.aborted;
132
- u(n, t ? ne(n.readOnly) : e instanceof Error && e.message ? e.message : "The host app failed to run this call.");
132
+ u(n, t ? y(n.readOnly) : e instanceof Error && e.message ? e.message : "The host app failed to run this call.");
133
133
  } finally {
134
134
  clearTimeout(_), a.delete(n.toolCallId), e.onActivity?.(void 0);
135
135
  }
@@ -150,65 +150,65 @@ function Ne(e) {
150
150
  };
151
151
  }
152
152
  // ../../node_modules/.pnpm/@ai-sdk+provider@4.0.34/node_modules/@ai-sdk/provider/dist/index.js
153
- var Pe = "vercel.ai.error", Fe = Symbol.for(Pe), C = class e extends Error {
153
+ var Ne = "vercel.ai.error", Pe = Symbol.for(Ne), w = class e extends Error {
154
154
  constructor({ name: e, message: t, cause: n }) {
155
- super(t), this[Fe] = !0, this.name = e, this.cause = n;
155
+ super(t), this[Pe] = !0, this.name = e, this.cause = n;
156
156
  }
157
157
  static isInstance(t) {
158
- return e.hasMarker(t, Pe);
158
+ return e.hasMarker(t, Ne);
159
159
  }
160
160
  static hasMarker(e, t) {
161
161
  let n = Symbol.for(t);
162
162
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
163
163
  }
164
- }, Ie = "AI_APICallError", Le = `vercel.ai.error.${Ie}`, Re = Symbol.for(Le), ze = class extends C {
164
+ }, Fe = "AI_APICallError", Ie = `vercel.ai.error.${Fe}`, Le = Symbol.for(Ie), Re = class extends w {
165
165
  constructor({ message: e, url: t, requestBodyValues: n, statusCode: r, responseHeaders: i, responseBody: a, cause: o, isRetryable: s = r != null && (r === 408 || r === 409 || r === 429 || r >= 500), data: c }) {
166
166
  super({
167
- name: Ie,
167
+ name: Fe,
168
168
  message: e,
169
169
  cause: o
170
- }), this[Re] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
170
+ }), this[Le] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
171
171
  }
172
172
  static isInstance(e) {
173
- return C.hasMarker(e, Le);
173
+ return w.hasMarker(e, Ie);
174
174
  }
175
- }, w = "AI_EmptyResponseBodyError", Be = `vercel.ai.error.${w}`, Ve = Symbol.for(Be), T = class extends C {
175
+ }, T = "AI_EmptyResponseBodyError", ze = `vercel.ai.error.${T}`, Be = Symbol.for(ze), E = class extends w {
176
176
  constructor({ message: e = "Empty response body" } = {}) {
177
177
  super({
178
- name: w,
178
+ name: T,
179
179
  message: e
180
- }), this[Ve] = !0;
180
+ }), this[Be] = !0;
181
181
  }
182
182
  static isInstance(e) {
183
- return C.hasMarker(e, Be);
183
+ return w.hasMarker(e, ze);
184
184
  }
185
185
  };
186
- function He(e) {
186
+ function Ve(e) {
187
187
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
188
188
  }
189
- var Ue = "AI_InvalidArgumentError", We = `vercel.ai.error.${Ue}`, Ge = Symbol.for(We), Ke = class extends C {
189
+ var He = "AI_InvalidArgumentError", Ue = `vercel.ai.error.${He}`, We = Symbol.for(Ue), Ge = class extends w {
190
190
  constructor({ message: e, cause: t, argument: n }) {
191
191
  super({
192
- name: Ue,
192
+ name: He,
193
193
  message: e,
194
194
  cause: t
195
- }), this[Ge] = !0, this.argument = n;
195
+ }), this[We] = !0, this.argument = n;
196
196
  }
197
197
  static isInstance(e) {
198
- return C.hasMarker(e, We);
198
+ return w.hasMarker(e, Ue);
199
199
  }
200
- }, qe = "AI_JSONParseError", Je = `vercel.ai.error.${qe}`, Ye = Symbol.for(Je), Xe = class extends C {
200
+ }, Ke = "AI_JSONParseError", qe = `vercel.ai.error.${Ke}`, Je = Symbol.for(qe), Ye = class extends w {
201
201
  constructor({ text: e, cause: t }) {
202
202
  super({
203
- name: qe,
204
- message: `JSON parsing failed: Text: ${e}.\nError message: ${He(t)}`,
203
+ name: Ke,
204
+ message: `JSON parsing failed: Text: ${e}.\nError message: ${Ve(t)}`,
205
205
  cause: t
206
- }), this[Ye] = !0, this.text = e;
206
+ }), this[Je] = !0, this.text = e;
207
207
  }
208
208
  static isInstance(e) {
209
- return C.hasMarker(e, Je);
209
+ return w.hasMarker(e, qe);
210
210
  }
211
- }, Ze = "AI_TypeValidationError", Qe = `vercel.ai.error.${Ze}`, $e = Symbol.for(Qe), E = class e extends C {
211
+ }, Xe = "AI_TypeValidationError", Ze = `vercel.ai.error.${Xe}`, Qe = Symbol.for(Ze), D = class e extends w {
212
212
  constructor({ value: e, cause: t, context: n }) {
213
213
  let r = "Type validation failed";
214
214
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -217,13 +217,13 @@ var Ue = "AI_InvalidArgumentError", We = `vercel.ai.error.${Ue}`, Ge = Symbol.fo
217
217
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
218
218
  }
219
219
  super({
220
- name: Ze,
221
- message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${He(t)}`,
220
+ name: Xe,
221
+ message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${Ve(t)}`,
222
222
  cause: t
223
- }), this[$e] = !0, this.value = e, this.context = n;
223
+ }), this[Qe] = !0, this.value = e, this.context = n;
224
224
  }
225
225
  static isInstance(e) {
226
- return C.hasMarker(e, Qe);
226
+ return w.hasMarker(e, Ze);
227
227
  }
228
228
  static wrap({ value: t, cause: n, context: r }) {
229
229
  return e.isInstance(n) && n.value === t && n.context?.field === r?.field && n.context?.entityName === r?.entityName && n.context?.entityId === r?.entityId ? n : new e({
@@ -232,25 +232,25 @@ var Ue = "AI_InvalidArgumentError", We = `vercel.ai.error.${Ue}`, Ge = Symbol.fo
232
232
  context: r
233
233
  });
234
234
  }
235
- }, et = "AI_UnsupportedFunctionalityError", tt = `vercel.ai.error.${et}`, nt = Symbol.for(tt), D = class extends C {
235
+ }, $e = "AI_UnsupportedFunctionalityError", et = `vercel.ai.error.${$e}`, tt = Symbol.for(et), O = class extends w {
236
236
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
237
237
  super({
238
- name: et,
238
+ name: $e,
239
239
  message: t
240
- }), this[nt] = !0, this.functionality = e;
240
+ }), this[tt] = !0, this.functionality = e;
241
241
  }
242
242
  static isInstance(e) {
243
- return C.hasMarker(e, tt);
243
+ return w.hasMarker(e, et);
244
244
  }
245
- }, rt = class extends Error {
245
+ }, nt = class extends Error {
246
246
  constructor(e, t) {
247
247
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
248
248
  }
249
- }, it = 10, at = 13, O = 32;
250
- function k(e) {}
251
- function ot(e) {
249
+ }, rt = 10, it = 13, k = 32;
250
+ function A(e) {}
251
+ function at(e) {
252
252
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
253
- let { onEvent: t = k, onError: n = k, onRetry: r = k, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
253
+ let { onEvent: t = A, onError: n = A, onRetry: r = A, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
254
254
  function m(e) {
255
255
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
256
256
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -269,7 +269,7 @@ function ot(e) {
269
269
  n !== "" && (o.push(n), s = n.length), h();
270
270
  }
271
271
  function h() {
272
- a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new rt(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
272
+ a !== void 0 && (s + u.length <= a || (p = !0, o.length = 0, s = 0, l = void 0, u = "", d = 0, f = void 0, n(new nt(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
273
273
  }
274
274
  function g(e) {
275
275
  let n = 0;
@@ -285,9 +285,9 @@ function ot(e) {
285
285
  continue;
286
286
  }
287
287
  let i = e.charCodeAt(n);
288
- if (st(e, n, i)) {
289
- let i = e.charCodeAt(n + 5) === O ? n + 6 : n + 5, a = e.slice(i, r);
290
- if (d === 0 && e.charCodeAt(r + 1) === it) {
288
+ if (ot(e, n, i)) {
289
+ let i = e.charCodeAt(n + 5) === k ? n + 6 : n + 5, a = e.slice(i, r);
290
+ if (d === 0 && e.charCodeAt(r + 1) === rt) {
291
291
  t({
292
292
  id: l,
293
293
  event: f,
@@ -297,7 +297,7 @@ function ot(e) {
297
297
  }
298
298
  u = d === 0 ? a : `${u}
299
299
  ${a}`, d++;
300
- } else A(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === O ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
300
+ } else j(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === k ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
301
301
  n = r + 1, r = e.indexOf("\n", n);
302
302
  }
303
303
  return e.slice(n);
@@ -305,35 +305,35 @@ ${a}`, d++;
305
305
  for (; n < e.length;) {
306
306
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
307
307
  if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
308
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === at && e.charCodeAt(n) === it && n++;
308
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === it && e.charCodeAt(n) === rt && n++;
309
309
  }
310
310
  return e.slice(n);
311
311
  }
312
312
  function _(e, t, n) {
313
313
  if (t === n) {
314
- ee();
314
+ y();
315
315
  return;
316
316
  }
317
317
  let r = e.charCodeAt(t);
318
- if (st(e, t, r)) {
319
- let r = e.charCodeAt(t + 5) === O ? t + 6 : t + 5, i = e.slice(r, n);
318
+ if (ot(e, t, r)) {
319
+ let r = e.charCodeAt(t + 5) === k ? t + 6 : t + 5, i = e.slice(r, n);
320
320
  u = d === 0 ? i : `${u}
321
321
  ${i}`, d++;
322
322
  return;
323
323
  }
324
- if (A(e, t, r)) {
325
- f = e.slice(e.charCodeAt(t + 6) === O ? t + 7 : t + 6, n) || void 0;
324
+ if (j(e, t, r)) {
325
+ f = e.slice(e.charCodeAt(t + 6) === k ? t + 7 : t + 6, n) || void 0;
326
326
  return;
327
327
  }
328
328
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
329
- let r = e.slice(e.charCodeAt(t + 3) === O ? t + 4 : t + 3, n);
329
+ let r = e.slice(e.charCodeAt(t + 3) === k ? t + 4 : t + 3, n);
330
330
  l = r.includes("\0") ? void 0 : r;
331
331
  return;
332
332
  }
333
333
  if (r === 58) {
334
334
  if (i) {
335
335
  let r = e.slice(t, n);
336
- i(r.slice(e.charCodeAt(t + 1) === O ? 2 : 1));
336
+ i(r.slice(e.charCodeAt(t + 1) === k ? 2 : 1));
337
337
  }
338
338
  return;
339
339
  }
@@ -342,7 +342,7 @@ ${i}`, d++;
342
342
  v(a, "", a);
343
343
  return;
344
344
  }
345
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === O ? 2 : 1;
345
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === k ? 2 : 1;
346
346
  v(s, a.slice(o + c), a);
347
347
  }
348
348
  function v(e, t, i) {
@@ -358,13 +358,13 @@ ${t}`, d++;
358
358
  l = t.includes("\0") ? void 0 : t;
359
359
  break;
360
360
  case "retry":
361
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new rt(`Invalid \`retry\` value: "${t}"`, {
361
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new nt(`Invalid \`retry\` value: "${t}"`, {
362
362
  type: "invalid-retry",
363
363
  value: t,
364
364
  line: i
365
365
  }));
366
366
  break;
367
- default: n(new rt(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
367
+ default: n(new nt(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
368
368
  type: "unknown-field",
369
369
  field: e,
370
370
  value: t,
@@ -372,14 +372,14 @@ ${t}`, d++;
372
372
  }));
373
373
  }
374
374
  }
375
- function ee() {
375
+ function y() {
376
376
  d > 0 && t({
377
377
  id: l,
378
378
  event: f,
379
379
  data: u
380
380
  }), l = void 0, u = "", d = 0, f = void 0;
381
381
  }
382
- function y(e = {}) {
382
+ function b(e = {}) {
383
383
  if (e.consume && o.length > 0) {
384
384
  let e = o.join("");
385
385
  _(e, 0, e.length);
@@ -388,22 +388,22 @@ ${t}`, d++;
388
388
  }
389
389
  return {
390
390
  feed: m,
391
- reset: y
391
+ reset: b
392
392
  };
393
393
  }
394
- function st(e, t, n) {
394
+ function ot(e, t, n) {
395
395
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
396
396
  }
397
- function A(e, t, n) {
397
+ function j(e, t, n) {
398
398
  return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
399
399
  }
400
400
  // ../../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
401
- var ct = class extends TransformStream {
401
+ var st = class extends TransformStream {
402
402
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
403
403
  let i;
404
404
  super({
405
405
  start(a) {
406
- i = ot({
406
+ i = at({
407
407
  onEvent: (e) => {
408
408
  a.enqueue(e);
409
409
  },
@@ -422,8 +422,8 @@ var ct = class extends TransformStream {
422
422
  }
423
423
  };
424
424
  new TextDecoder();
425
- var { btoa: lt, atob: ut } = globalThis;
426
- function j(e) {
425
+ var { btoa: ct, atob: lt } = globalThis;
426
+ function M(e) {
427
427
  if (e == null) return {};
428
428
  let t = {};
429
429
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -435,28 +435,28 @@ function j(e) {
435
435
  }
436
436
  return t;
437
437
  }
438
- var M = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
438
+ var N = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
439
439
  let i = () => {
440
440
  let e = n.length, r = Array(t);
441
441
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
442
442
  return r.join("");
443
443
  };
444
444
  if (e == null) return i;
445
- if (n.includes(r)) throw new Ke({
445
+ if (n.includes(r)) throw new Ge({
446
446
  argument: "separator",
447
447
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
448
448
  });
449
449
  return () => `${e}${r}${i()}`;
450
- }, dt = M();
451
- function N(e) {
450
+ }, ut = N();
451
+ function P(e) {
452
452
  return globalThis.Buffer?.isBuffer(e) ?? !1;
453
453
  }
454
- var ft = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, pt = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
455
- function mt(e) {
454
+ var dt = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, ft = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
455
+ function pt(e) {
456
456
  let t = JSON.parse(e);
457
- return typeof t != "object" || !t || ft.test(e) === !1 && pt.test(e) === !1 ? t : ht(t);
457
+ return typeof t != "object" || !t || dt.test(e) === !1 && ft.test(e) === !1 ? t : mt(t);
458
458
  }
459
- function ht(e) {
459
+ function mt(e) {
460
460
  let t = [e];
461
461
  for (; t.length;) {
462
462
  let e = t;
@@ -471,35 +471,35 @@ function ht(e) {
471
471
  }
472
472
  return e;
473
473
  }
474
- function gt(e) {
474
+ function ht(e) {
475
475
  let { stackTraceLimit: t } = Error;
476
476
  try {
477
477
  Error.stackTraceLimit = 0;
478
478
  } catch {
479
- return mt(e);
479
+ return pt(e);
480
480
  }
481
481
  try {
482
- return mt(e);
482
+ return pt(e);
483
483
  } finally {
484
484
  Error.stackTraceLimit = t;
485
485
  }
486
486
  }
487
- function _t(e) {
487
+ function gt(e) {
488
488
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
489
489
  let { additionalProperties: t } = e;
490
- e.additionalProperties = t != null && typeof t != "boolean" && P(t);
490
+ e.additionalProperties = t != null && typeof t != "boolean" && F(t);
491
491
  let { properties: n } = e;
492
- if (n != null) for (let e of Object.keys(n)) n[e] = P(n[e]);
492
+ if (n != null) for (let e of Object.keys(n)) n[e] = F(n[e]);
493
493
  }
494
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(P) : P(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(P)), e.allOf != null && (e.allOf = e.allOf.map(P)), e.oneOf != null && (e.oneOf = e.oneOf.map(P));
494
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(F) : F(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(F)), e.allOf != null && (e.allOf = e.allOf.map(F)), e.oneOf != null && (e.oneOf = e.oneOf.map(F));
495
495
  let { definitions: t } = e;
496
- if (t != null) for (let e of Object.keys(t)) t[e] = P(t[e]);
496
+ if (t != null) for (let e of Object.keys(t)) t[e] = F(t[e]);
497
497
  return e;
498
498
  }
499
- function P(e) {
500
- return typeof e == "boolean" ? e : _t(e);
499
+ function F(e) {
500
+ return typeof e == "boolean" ? e : gt(e);
501
501
  }
502
- var vt = Symbol("Let zodToJsonSchema decide on which parser to use"), yt = {
502
+ var _t = Symbol("Let zodToJsonSchema decide on which parser to use"), vt = {
503
503
  name: void 0,
504
504
  $refStrategy: "root",
505
505
  basePath: ["#"],
@@ -519,24 +519,24 @@ var vt = Symbol("Let zodToJsonSchema decide on which parser to use"), yt = {
519
519
  emailStrategy: "format:email",
520
520
  base64Strategy: "contentEncoding:base64",
521
521
  nameStrategy: "ref"
522
- }, bt = (e) => typeof e == "string" ? {
523
- ...yt,
522
+ }, yt = (e) => typeof e == "string" ? {
523
+ ...vt,
524
524
  name: e
525
525
  } : {
526
- ...yt,
526
+ ...vt,
527
527
  ...e
528
528
  };
529
- function F() {
529
+ function I() {
530
530
  return {};
531
531
  }
532
- function xt(e, t) {
532
+ function bt(e, t) {
533
533
  let n = { type: "array" };
534
534
  return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = K(e.type._def, {
535
535
  ...t,
536
536
  currentPath: [...t.currentPath, "items"]
537
537
  })), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
538
538
  }
539
- function St(e) {
539
+ function xt(e) {
540
540
  let t = {
541
541
  type: "integer",
542
542
  format: "int64"
@@ -553,16 +553,16 @@ function St(e) {
553
553
  }
554
554
  return t;
555
555
  }
556
- function I() {
556
+ function L() {
557
557
  return { type: "boolean" };
558
558
  }
559
- function Ct(e, t) {
559
+ function St(e, t) {
560
560
  return K(e.type._def, t);
561
561
  }
562
- var L = (e, t) => K(e.innerType._def, t);
563
- function wt(e, t, n) {
562
+ var R = (e, t) => K(e.innerType._def, t);
563
+ function Ct(e, t, n) {
564
564
  let r = n ?? t.dateStrategy;
565
- if (Array.isArray(r)) return { anyOf: r.map((n) => wt(e, t, n)) };
565
+ if (Array.isArray(r)) return { anyOf: r.map((n) => Ct(e, t, n)) };
566
566
  switch (r) {
567
567
  case "string":
568
568
  case "format:date-time": return {
@@ -573,10 +573,10 @@ function wt(e, t, n) {
573
573
  type: "string",
574
574
  format: "date"
575
575
  };
576
- case "integer": return Tt(e);
576
+ case "integer": return wt(e);
577
577
  }
578
578
  }
579
- var Tt = (e) => {
579
+ var wt = (e) => {
580
580
  let t = {
581
581
  type: "integer",
582
582
  format: "unix-time"
@@ -589,14 +589,14 @@ var Tt = (e) => {
589
589
  }
590
590
  return t;
591
591
  };
592
- function R(e, t) {
592
+ function Tt(e, t) {
593
593
  return {
594
594
  ...K(e.innerType._def, t),
595
595
  default: e.defaultValue()
596
596
  };
597
597
  }
598
598
  function Et(e, t) {
599
- return t.effectStrategy === "input" ? K(e.schema._def, t) : F();
599
+ return t.effectStrategy === "input" ? K(e.schema._def, t) : I();
600
600
  }
601
601
  function Dt(e) {
602
602
  return {
@@ -828,7 +828,7 @@ function Pt(e, t) {
828
828
  propertyNames: { enum: e.keyType._def.values }
829
829
  };
830
830
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
831
- let { type: r, ...i } = Ct(e.keyType._def, t);
831
+ let { type: r, ...i } = St(e.keyType._def, t);
832
832
  return {
833
833
  ...n,
834
834
  propertyNames: i
@@ -850,7 +850,7 @@ function Ft(e, t) {
850
850
  "items",
851
851
  "0"
852
852
  ]
853
- }) || F(), K(e.valueType._def, {
853
+ }) || I(), K(e.valueType._def, {
854
854
  ...t,
855
855
  currentPath: [
856
856
  ...t.currentPath,
@@ -858,7 +858,7 @@ function Ft(e, t) {
858
858
  "items",
859
859
  "1"
860
860
  ]
861
- }) || F()],
861
+ }) || I()],
862
862
  minItems: 2,
863
863
  maxItems: 2
864
864
  }
@@ -872,7 +872,7 @@ function It(e) {
872
872
  };
873
873
  }
874
874
  function Lt() {
875
- return { not: F() };
875
+ return { not: I() };
876
876
  }
877
877
  function Rt() {
878
878
  return { type: "null" };
@@ -1019,7 +1019,7 @@ var qt = (e, t) => {
1019
1019
  "1"
1020
1020
  ]
1021
1021
  });
1022
- return n ? { anyOf: [{ not: F() }, n] } : F();
1022
+ return n ? { anyOf: [{ not: I() }, n] } : I();
1023
1023
  }, G = (e, t) => {
1024
1024
  if (t.pipeStrategy === "input") return K(e.in._def, t);
1025
1025
  if (t.pipeStrategy === "output") return K(e.out._def, t);
@@ -1085,22 +1085,22 @@ function Xt(e, t) {
1085
1085
  };
1086
1086
  }
1087
1087
  function Zt() {
1088
- return { not: F() };
1088
+ return { not: I() };
1089
1089
  }
1090
1090
  function Qt() {
1091
- return F();
1091
+ return I();
1092
1092
  }
1093
1093
  var $t = (e, t) => K(e.innerType._def, t), en = (e, t, n) => {
1094
1094
  switch (t) {
1095
1095
  case "ZodString": return B(e, n);
1096
1096
  case "ZodNumber": return Ut(e);
1097
1097
  case "ZodObject": return Wt(e, n);
1098
- case "ZodBigInt": return St(e);
1099
- case "ZodBoolean": return I();
1100
- case "ZodDate": return wt(e, n);
1098
+ case "ZodBigInt": return xt(e);
1099
+ case "ZodBoolean": return L();
1100
+ case "ZodDate": return Ct(e, n);
1101
1101
  case "ZodUndefined": return Zt();
1102
1102
  case "ZodNull": return Rt();
1103
- case "ZodArray": return xt(e, n);
1103
+ case "ZodArray": return bt(e, n);
1104
1104
  case "ZodUnion":
1105
1105
  case "ZodDiscriminatedUnion": return Bt(e, n);
1106
1106
  case "ZodIntersection": return kt(e, n);
@@ -1118,12 +1118,12 @@ var $t = (e, t) => K(e.innerType._def, t), en = (e, t, n) => {
1118
1118
  case "ZodNaN":
1119
1119
  case "ZodNever": return Lt();
1120
1120
  case "ZodEffects": return Et(e, n);
1121
- case "ZodAny": return F();
1121
+ case "ZodAny": return I();
1122
1122
  case "ZodUnknown": return Qt();
1123
- case "ZodDefault": return R(e, n);
1124
- case "ZodBranded": return Ct(e, n);
1123
+ case "ZodDefault": return Tt(e, n);
1124
+ case "ZodBranded": return St(e, n);
1125
1125
  case "ZodReadonly": return $t(e, n);
1126
- case "ZodCatch": return L(e, n);
1126
+ case "ZodCatch": return R(e, n);
1127
1127
  case "ZodPipeline": return G(e, n);
1128
1128
  case "ZodFunction":
1129
1129
  case "ZodVoid":
@@ -1141,7 +1141,7 @@ function K(e, t, n = !1) {
1141
1141
  let r = t.seen.get(e);
1142
1142
  if (t.override) {
1143
1143
  let i = t.override?.(e, t, r, n);
1144
- if (i !== vt) return i;
1144
+ if (i !== _t) return i;
1145
1145
  }
1146
1146
  if (r && !n) {
1147
1147
  let e = nn(r, t);
@@ -1165,10 +1165,10 @@ var nn = (e, t) => {
1165
1165
  case "root": return { $ref: e.path.join("/") };
1166
1166
  case "relative": return { $ref: tn(t.currentPath, e.path) };
1167
1167
  case "none":
1168
- case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), F()) : t.$refStrategy === "seen" ? F() : void 0;
1168
+ case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), I()) : t.$refStrategy === "seen" ? I() : void 0;
1169
1169
  }
1170
1170
  }, rn = (e, t, n) => (e.description && (n.description = e.description), n), an = (e) => {
1171
- let t = bt(e), n = t.name === void 0 ? t.basePath : [
1171
+ let t = yt(e), n = t.name === void 0 ? t.basePath : [
1172
1172
  ...t.basePath,
1173
1173
  t.definitionPath,
1174
1174
  t.name
@@ -1197,7 +1197,7 @@ var nn = (e, t) => {
1197
1197
  n.definitionPath,
1198
1198
  t
1199
1199
  ]
1200
- }, !0) ?? F()
1200
+ }, !0) ?? I()
1201
1201
  }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = K(e._def, i === void 0 ? n : {
1202
1202
  ...n,
1203
1203
  currentPath: [
@@ -1205,7 +1205,7 @@ var nn = (e, t) => {
1205
1205
  n.definitionPath,
1206
1206
  i
1207
1207
  ]
1208
- }, !1) ?? F(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1208
+ }, !1) ?? I(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1209
1209
  o !== void 0 && (a.title = o);
1210
1210
  let s = i === void 0 ? r ? {
1211
1211
  ...a,
@@ -1250,7 +1250,7 @@ function dn(e) {
1250
1250
  function fn(e) {
1251
1251
  return ln(() => {
1252
1252
  if (!pn(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1253
- return _t(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1253
+ return gt(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1254
1254
  }, { validate: async (t) => {
1255
1255
  let n = await e["~standard"].validate(t);
1256
1256
  return "value" in n ? {
@@ -1258,7 +1258,7 @@ function fn(e) {
1258
1258
  value: n.value
1259
1259
  } : {
1260
1260
  success: !1,
1261
- error: new E({
1261
+ error: new D({
1262
1262
  value: t,
1263
1263
  cause: n.issues
1264
1264
  })
@@ -1283,7 +1283,7 @@ function mn(e, t) {
1283
1283
  }
1284
1284
  function hn(e, r) {
1285
1285
  let i = r?.useReferences ?? !1;
1286
- return ln(() => _t(n(e, {
1286
+ return ln(() => gt(n(e, {
1287
1287
  target: "draft-7",
1288
1288
  io: "input",
1289
1289
  reused: i ? "ref" : "inline"
@@ -1310,7 +1310,7 @@ async function _n({ value: e, schema: t, context: n }) {
1310
1310
  schema: t,
1311
1311
  context: n
1312
1312
  });
1313
- if (!r.success) throw E.wrap({
1313
+ if (!r.success) throw D.wrap({
1314
1314
  value: e,
1315
1315
  cause: r.error,
1316
1316
  context: n
@@ -1332,7 +1332,7 @@ async function vn({ value: e, schema: t, context: n }) {
1332
1332
  rawValue: e
1333
1333
  } : {
1334
1334
  success: !1,
1335
- error: E.wrap({
1335
+ error: D.wrap({
1336
1336
  value: e,
1337
1337
  cause: t.error,
1338
1338
  context: n
@@ -1342,7 +1342,7 @@ async function vn({ value: e, schema: t, context: n }) {
1342
1342
  } catch (t) {
1343
1343
  return {
1344
1344
  success: !1,
1345
- error: E.wrap({
1345
+ error: D.wrap({
1346
1346
  value: e,
1347
1347
  cause: t,
1348
1348
  context: n
@@ -1353,7 +1353,7 @@ async function vn({ value: e, schema: t, context: n }) {
1353
1353
  }
1354
1354
  async function yn({ text: e, schema: t }) {
1355
1355
  try {
1356
- let n = gt(e);
1356
+ let n = ht(e);
1357
1357
  return t == null ? {
1358
1358
  success: !0,
1359
1359
  value: n,
@@ -1365,7 +1365,7 @@ async function yn({ text: e, schema: t }) {
1365
1365
  } catch (t) {
1366
1366
  return {
1367
1367
  success: !1,
1368
- error: Xe.isInstance(t) ? t : new Xe({
1368
+ error: Ye.isInstance(t) ? t : new Ye({
1369
1369
  text: e,
1370
1370
  cause: t
1371
1371
  }),
@@ -1374,7 +1374,7 @@ async function yn({ text: e, schema: t }) {
1374
1374
  }
1375
1375
  }
1376
1376
  function bn({ stream: e, schema: t }) {
1377
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new ct()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1377
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new st()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1378
1378
  e !== "[DONE]" && n.enqueue(await yn({
1379
1379
  text: e,
1380
1380
  schema: t
@@ -1386,7 +1386,7 @@ async function xn(e) {
1386
1386
  }
1387
1387
  new TextDecoder();
1388
1388
  // ../../node_modules/.pnpm/ai@7.0.154_zod@4.6.7/node_modules/ai/dist/index.js
1389
- var Sn = "AI_InvalidArgumentError", Cn = `vercel.ai.error.${Sn}`, wn = Symbol.for(Cn), Tn = class extends C {
1389
+ var Sn = "AI_InvalidArgumentError", Cn = `vercel.ai.error.${Sn}`, wn = Symbol.for(Cn), Tn = class extends w {
1390
1390
  constructor({ parameter: e, value: t, message: n }) {
1391
1391
  super({
1392
1392
  name: Sn,
@@ -1394,9 +1394,9 @@ var Sn = "AI_InvalidArgumentError", Cn = `vercel.ai.error.${Sn}`, wn = Symbol.fo
1394
1394
  }), this[wn] = !0, this.parameter = e, this.value = t;
1395
1395
  }
1396
1396
  static isInstance(e) {
1397
- return C.hasMarker(e, Cn);
1397
+ return w.hasMarker(e, Cn);
1398
1398
  }
1399
- }, En = "AI_UIMessageStreamError", Dn = `vercel.ai.error.${En}`, On = Symbol.for(Dn), J = class extends C {
1399
+ }, En = "AI_UIMessageStreamError", Dn = `vercel.ai.error.${En}`, On = Symbol.for(Dn), J = class extends w {
1400
1400
  constructor({ chunkType: e, chunkId: t, message: n }) {
1401
1401
  super({
1402
1402
  name: En,
@@ -1404,7 +1404,7 @@ var Sn = "AI_InvalidArgumentError", Cn = `vercel.ai.error.${Sn}`, wn = Symbol.fo
1404
1404
  }), this[On] = !0, this.chunkType = e, this.chunkId = t;
1405
1405
  }
1406
1406
  static isInstance(e) {
1407
- return C.hasMarker(e, Dn);
1407
+ return w.hasMarker(e, Dn);
1408
1408
  }
1409
1409
  };
1410
1410
  function kn(e, t) {
@@ -1449,7 +1449,7 @@ var Y = {
1449
1449
  Y.string(),
1450
1450
  Y.instanceof(Uint8Array),
1451
1451
  Y.instanceof(ArrayBuffer),
1452
- Y.custom(N, { message: "Must be a Buffer" })
1452
+ Y.custom(P, { message: "Must be a Buffer" })
1453
1453
  ]), jn = Y.record(Y.string(), Y.string()), Mn = Y.object({
1454
1454
  type: Y.literal("text"),
1455
1455
  text: Y.string(),
@@ -1866,13 +1866,13 @@ async function Xn(e) {
1866
1866
  state: "failed-parse"
1867
1867
  });
1868
1868
  }
1869
- M({
1869
+ N({
1870
1870
  prefix: "steer",
1871
1871
  size: 24
1872
- }), new TextEncoder(), new TextEncoder(), M({
1872
+ }), new TextEncoder(), new TextEncoder(), N({
1873
1873
  prefix: "aitxt",
1874
1874
  size: 24
1875
- }), M({
1875
+ }), N({
1876
1876
  prefix: "call",
1877
1877
  size: 24
1878
1878
  }), TransformStream;
@@ -2600,28 +2600,28 @@ function cr() {
2600
2600
  reject: t
2601
2601
  };
2602
2602
  }
2603
- M({
2603
+ N({
2604
2604
  prefix: "aitxt",
2605
2605
  size: 24
2606
- }), M({
2606
+ }), N({
2607
2607
  prefix: "call",
2608
2608
  size: 24
2609
- }), M({
2609
+ }), N({
2610
2610
  prefix: "aitxt",
2611
2611
  size: 24
2612
- }), M({
2612
+ }), N({
2613
2613
  prefix: "call",
2614
2614
  size: 24
2615
- }), Y.record(Y.string(), X.optional()), Y.record(Y.string(), Y.string()), M({
2615
+ }), Y.record(Y.string(), X.optional()), Y.record(Y.string(), Y.string()), N({
2616
2616
  prefix: "call",
2617
2617
  size: 24
2618
- }), M({
2618
+ }), N({
2619
2619
  prefix: "call",
2620
2620
  size: 24
2621
- }), new TextEncoder(), M({
2621
+ }), new TextEncoder(), N({
2622
2622
  prefix: "call",
2623
2623
  size: 24
2624
- }), M({
2624
+ }), N({
2625
2625
  prefix: "aiobj",
2626
2626
  size: 24
2627
2627
  });
@@ -2657,10 +2657,10 @@ var { atob: lr } = globalThis, ur = class {
2657
2657
  });
2658
2658
  }
2659
2659
  };
2660
- M({
2660
+ N({
2661
2661
  prefix: "aiobj",
2662
2662
  size: 24
2663
- }), M({
2663
+ }), N({
2664
2664
  prefix: "call",
2665
2665
  size: 24
2666
2666
  }), Y.object({
@@ -2680,19 +2680,19 @@ M({
2680
2680
  description: Y.string().optional(),
2681
2681
  parameters: Y.record(Y.string(), Y.unknown())
2682
2682
  })).optional()
2683
- }), M({
2683
+ }), N({
2684
2684
  prefix: "call",
2685
2685
  size: 24
2686
- }), M({
2686
+ }), N({
2687
2687
  prefix: "call",
2688
2688
  size: 24
2689
- }), M({
2689
+ }), N({
2690
2690
  prefix: "call",
2691
2691
  size: 24
2692
2692
  });
2693
2693
  async function dr({ response: e, url: t, fallbackMessage: n }) {
2694
2694
  let r = await e.text();
2695
- return new ze({
2695
+ return new Re({
2696
2696
  message: r || n,
2697
2697
  url: t,
2698
2698
  requestBodyValues: void 0,
@@ -2702,7 +2702,7 @@ async function dr({ response: e, url: t, fallbackMessage: n }) {
2702
2702
  }
2703
2703
  async function fr(e) {
2704
2704
  if (e == null) return [];
2705
- if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new D({
2705
+ if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new O({
2706
2706
  functionality: "FileList",
2707
2707
  message: "FileList is not supported in the current environment"
2708
2708
  });
@@ -2731,8 +2731,8 @@ var mr = class {
2731
2731
  }
2732
2732
  async sendMessages({ abortSignal: e, ...t }) {
2733
2733
  let n = await xn(this.body), r = await xn(this.headers), i = await xn(this.credentials), a = {
2734
- ...j(r),
2735
- ...j(t.headers)
2734
+ ...M(r),
2735
+ ...M(t.headers)
2736
2736
  }, o = await this.prepareSendMessagesRequest?.({
2737
2737
  api: this.api,
2738
2738
  id: t.chatId,
@@ -2746,7 +2746,7 @@ var mr = class {
2746
2746
  requestMetadata: t.metadata,
2747
2747
  trigger: t.trigger,
2748
2748
  messageId: t.messageId
2749
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : j(o.headers), l = o?.body === void 0 ? {
2749
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : M(o.headers), l = o?.body === void 0 ? {
2750
2750
  ...n,
2751
2751
  ...t.body,
2752
2752
  id: t.chatId,
@@ -2768,13 +2768,13 @@ var mr = class {
2768
2768
  url: s,
2769
2769
  fallbackMessage: "Failed to fetch the chat response."
2770
2770
  });
2771
- if (!d.body) throw new T({ message: "The response body is empty." });
2771
+ if (!d.body) throw new E({ message: "The response body is empty." });
2772
2772
  return this.processResponseStream(d.body);
2773
2773
  }
2774
2774
  async reconnectToStream(e) {
2775
2775
  let t = await xn(this.body), n = await xn(this.headers), r = await xn(this.credentials), i = {
2776
- ...j(n),
2777
- ...j(e.headers)
2776
+ ...M(n),
2777
+ ...M(e.headers)
2778
2778
  }, a = await this.prepareReconnectToStreamRequest?.({
2779
2779
  api: this.api,
2780
2780
  id: e.chatId,
@@ -2794,7 +2794,7 @@ var mr = class {
2794
2794
  });
2795
2795
  o = pr(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
2796
2796
  }
2797
- let s = a?.headers === void 0 ? i : j(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2797
+ let s = a?.headers === void 0 ? i : M(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2798
2798
  method: "GET",
2799
2799
  headers: s,
2800
2800
  credentials: c,
@@ -2806,7 +2806,7 @@ var mr = class {
2806
2806
  url: o,
2807
2807
  fallbackMessage: "Failed to fetch the chat response."
2808
2808
  });
2809
- if (!l.body) throw new T({ message: "The response body is empty." });
2809
+ if (!l.body) throw new E({ message: "The response body is empty." });
2810
2810
  return this.processResponseStream(l.body);
2811
2811
  }
2812
2812
  }, hr = class extends mr {
@@ -2826,7 +2826,7 @@ var mr = class {
2826
2826
  get id() {
2827
2827
  return this._id ??= this.generateId();
2828
2828
  }
2829
- constructor({ generateId: e = dt, id: t, transport: n = new hr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
2829
+ constructor({ generateId: e = ut, id: t, transport: n = new hr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
2830
2830
  this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.interruptedMessageIds = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new ur(), this.activeStopCount = 0, this.stopGeneration = 0, this.sendMessage = async (e, t) => {
2831
2831
  if (e == null) {
2832
2832
  let e = this.pendingApprovalMessageId;
@@ -3083,7 +3083,7 @@ var mr = class {
3083
3083
  status: "submitted",
3084
3084
  error: void 0
3085
3085
  });
3086
- let d = this.lastMessage, f = e === "submit-message" && i != null ? this.state.messages.findIndex((e) => e.id === i) : this.state.messages.length - 1, p = f === -1 ? d : this.state.messages[f], m = p?.id, h = e === "resume-stream" && p?.role === "assistant" && p.parts.some((e) => Q(e) && (e.state === "input-streaming" || e.state === "input-available" && e.providerExecuted || e.state === "approval-responded")) ? this.state.snapshot(p) : void 0, g = f !== -1 && f < this.state.messages.length - 1 && p?.role === "assistant", _ = !1, v = !1, ee = !1, y;
3086
+ let d = this.lastMessage, f = e === "submit-message" && i != null ? this.state.messages.findIndex((e) => e.id === i) : this.state.messages.length - 1, p = f === -1 ? d : this.state.messages[f], m = p?.id, h = e === "resume-stream" && p?.role === "assistant" && p.parts.some((e) => Q(e) && (e.state === "input-streaming" || e.state === "input-available" && e.providerExecuted || e.state === "approval-responded")) ? this.state.snapshot(p) : void 0, g = f !== -1 && f < this.state.messages.length - 1 && p?.role === "assistant", _ = !1, v = !1, y = !1, b;
3087
3087
  try {
3088
3088
  let s = {
3089
3089
  state: e === "resume-stream" && this.resumableStreamState != null ? this.resumableStreamState : ar({
@@ -3093,7 +3093,7 @@ var mr = class {
3093
3093
  abortController: o,
3094
3094
  completionPromise: a
3095
3095
  };
3096
- y = s, s.abortController.signal.addEventListener("abort", () => {
3096
+ b = s, s.abortController.signal.addEventListener("abort", () => {
3097
3097
  _ = !0;
3098
3098
  }), this.activeResponse = s;
3099
3099
  let l;
@@ -3139,34 +3139,34 @@ var mr = class {
3139
3139
  }), _) return c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === s.state && (this.resumableStreamState = void 0)), null;
3140
3140
  c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === s.state && (this.resumableStreamState = void 0));
3141
3141
  } catch (e) {
3142
- if (_ || e.name === "AbortError") return _ = !0, c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === y?.state && (this.resumableStreamState = void 0)), null;
3142
+ if (_ || e.name === "AbortError") return _ = !0, c() && (this.setStatus({ status: "ready" }), this.resumableStreamState === b?.state && (this.resumableStreamState = void 0)), null;
3143
3143
  if (!c()) return null;
3144
- if (ee = !0, e instanceof TypeError) {
3144
+ if (y = !0, e instanceof TypeError) {
3145
3145
  let t = e.message.toLowerCase();
3146
3146
  v = t.includes("fetch") || t.includes("network") || t === "load failed";
3147
3147
  }
3148
- v ? this.resumableStreamState = y?.state : this.resumableStreamState === y?.state && (this.resumableStreamState = void 0), this.onError && e instanceof Error && this.onError(e), this.setStatus({
3148
+ v ? this.resumableStreamState = b?.state : this.resumableStreamState === b?.state && (this.resumableStreamState = void 0), this.onError && e instanceof Error && this.onError(e), this.setStatus({
3149
3149
  status: "error",
3150
3150
  error: e
3151
3151
  });
3152
3152
  } finally {
3153
3153
  try {
3154
- if (y) {
3155
- let { message: e, finishReason: t } = y.state;
3156
- t === "interrupted" ? this.interruptedMessageIds.add(e.id) : !_ && !ee && this.interruptedMessageIds.delete(e.id), this.onFinish?.({
3157
- message: y.state.message,
3154
+ if (b) {
3155
+ let { message: e, finishReason: t } = b.state;
3156
+ t === "interrupted" ? this.interruptedMessageIds.add(e.id) : !_ && !y && this.interruptedMessageIds.delete(e.id), this.onFinish?.({
3157
+ message: b.state.message,
3158
3158
  messages: this.state.messages,
3159
3159
  isAbort: _,
3160
3160
  isDisconnect: v,
3161
- isError: ee,
3162
- finishReason: y.state.finishReason
3161
+ isError: y,
3162
+ finishReason: b.state.finishReason
3163
3163
  });
3164
3164
  }
3165
3165
  } finally {
3166
- this.activeResponse === y && (this.activeResponse = void 0), l();
3166
+ this.activeResponse === b && (this.activeResponse = void 0), l();
3167
3167
  }
3168
3168
  }
3169
- !_ && !ee && y?.state.finishReason !== "interrupted" && await this.runAutomaticRequest(() => this.makeRequest({
3169
+ !_ && !y && b?.state.finishReason !== "interrupted" && await this.runAutomaticRequest(() => this.makeRequest({
3170
3170
  trigger: "submit-message",
3171
3171
  messageId: this.lastMessage?.id,
3172
3172
  metadata: t,
@@ -3437,13 +3437,13 @@ var Lr = function(e, t, n, r) {
3437
3437
  function Rr() {
3438
3438
  for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
3439
3439
  var r, i, a = $({}, Nr), o = !1, s = !1;
3440
- if (!me()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
3440
+ if (!pe()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
3441
3441
  var c = typeof window > "u" || typeof document > "u";
3442
3442
  t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = $($({}, a), t[2]));
3443
- var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : x(r);
3443
+ var l = c ? a.serverTTL : a.ttl, u = typeof r == "function" ? r : S(r);
3444
3444
  i === void 0 && (i = a.fetcher);
3445
3445
  var d = null;
3446
- d ||= ve({
3446
+ d ||= _e({
3447
3447
  data: void 0,
3448
3448
  error: void 0,
3449
3449
  isValidating: !0,
@@ -3513,7 +3513,7 @@ function Rr() {
3513
3513
  };
3514
3514
  a.refreshInterval && (m = setTimeout(h, a.refreshInterval)), a.revalidateOnFocus && (document.addEventListener("visibilitychange", p, !1), window.addEventListener("focus", p, !1));
3515
3515
  }
3516
- _e(function() {
3516
+ ge(function() {
3517
3517
  o = !0, m &&= (clearTimeout(m), null), !c && a.revalidateOnFocus && (document.removeEventListener("visibilitychange", p, !1), window.removeEventListener("focus", p, !1));
3518
3518
  var e = jr.get(u.value);
3519
3519
  e && (e.data = e.data.filter(function(e) {
@@ -3521,11 +3521,11 @@ function Rr() {
3521
3521
  }));
3522
3522
  });
3523
3523
  try {
3524
- S(u, function(e) {
3525
- he(u) || (u.value = e), d.key = e, d.isValidating = !!e, Pr(u.value, d, l), !c && !s && u.value && f(), s = !1;
3524
+ C(u, function(e) {
3525
+ me(u) || (u.value = e), d.key = e, d.isValidating = !!e, Pr(u.value, d, l), !c && !s && u.value && f(), s = !1;
3526
3526
  }, { immediate: !0 });
3527
3527
  } catch {}
3528
- return $($({}, be(d)), { mutate: function(e, t) {
3528
+ return $($({}, ye(d)), { mutate: function(e, t) {
3529
3529
  return f(e, $($({}, t), { forceRevalidate: !0 }));
3530
3530
  } });
3531
3531
  }
@@ -3613,10 +3613,10 @@ var Ur = class {
3613
3613
  }
3614
3614
  };
3615
3615
  function Gr(e) {
3616
- let t = ye([]), n = ye("ready"), r = ye(), i = ye(), a;
3617
- return S(t, (e) => {
3616
+ let t = ve([]), n = ve("ready"), r = ve(), i = ve(), a;
3617
+ return C(t, (e) => {
3618
3618
  a != null && !a.isPublishing && a.setMessagesFromConsumer(e);
3619
- }, { flush: "sync" }), S(() => xe(e), (e) => {
3619
+ }, { flush: "sync" }), C(() => be(e), (e) => {
3620
3620
  a?.dispose();
3621
3621
  let { throttle: o, ...s } = e ?? {}, c = new Ur({
3622
3622
  initialMessages: s.messages ?? [],
@@ -3629,10 +3629,10 @@ function Gr(e) {
3629
3629
  ...s,
3630
3630
  state: c
3631
3631
  });
3632
- }, { immediate: !0 }), me() != null && _e(() => {
3632
+ }, { immediate: !0 }), pe() != null && ge(() => {
3633
3633
  a?.dispose();
3634
3634
  }), {
3635
- id: b(() => i.value.id),
3635
+ id: x(() => i.value.id),
3636
3636
  status: n,
3637
3637
  messages: t,
3638
3638
  error: r,
@@ -3659,39 +3659,39 @@ var Kr = "voice-", qr = (e) => e?.role === "assistant" && e.parts.some((e) => e.
3659
3659
  }, Qr = 12e4, $r = 1e3, ei = 5e3, ti = 100, ni = 3e4, ri = 5e3, ii = 250, ai = 1e3, oi = "\n\n", si = (e) => {
3660
3660
  let t = e.type ?? "";
3661
3661
  return t === "dynamic-tool" ? e.toolName ?? "" : t.startsWith("tool-") ? t.slice(5) : "";
3662
- }, ci = (e) => e?.role === "assistant" && e.parts.some((e) => oe(si(e)) && !e.providerExecuted && !se.has(e.state ?? "")), li = ({ messages: e }) => {
3662
+ }, ci = (e) => e?.role === "assistant" && e.parts.some((e) => b(si(e)) && !e.providerExecuted && !oe.has(e.state ?? "")), li = ({ messages: e }) => {
3663
3663
  let t = e[e.length - 1];
3664
3664
  if (!t || t.role !== "assistant") return !1;
3665
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && (oe(si(e)) || ee(e)));
3666
- return r.length > 0 && r.every((e) => se.has(e.state ?? ""));
3665
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && (b(si(e)) || ie(e)));
3666
+ return r.length > 0 && r.every((e) => oe.has(e.state ?? ""));
3667
3667
  };
3668
3668
  function ui(e) {
3669
- return Ee(`chatbot-${e}`, () => {
3670
- let { t, te: n, locale: r } = Ce({ useScope: "global" }), i = x(""), a = x(), o = x(e), s = x(), c = x(), l = x(), u = x(), d = x(), f = x(), p = x(), m = x(), h = x(), g = x(), _ = x(), v = x(), ne = x(), ae = x(), oe = x(), se = x(), me = ye(), he = x(0), be = x(), xe = ye(), Ee = ye(), Ae = x(), Pe = x({}), Fe = x(!1), C = x(0), Ie = x(), Le = x(!1), Re = Te(), ze = b(() => {
3669
+ return Te(`chatbot-${e}`, () => {
3670
+ let { t, te: n, locale: r } = Se({ useScope: "global" }), i = S(""), a = S(), o = S(e), s = S(), c = S(), l = S(), u = S(), d = S(), f = S(), p = S(), m = S(), h = S(), g = S(), _ = S(), v = S(), y = S(), b = S(), te = S(), oe = S(), pe = ve(), me = S(0), ye = S(), be = ve(), Te = ve(), ke = S(), Ne = S({}), Pe = S(!1), w = S(0), Fe = S(), Ie = S(!1), Le = we(), Re = x(() => {
3671
3671
  let e = u.value?.theme;
3672
- return e && e !== "auto" || (e = Ie.value), e ? e === "dark" : Re.value;
3673
- }), w = b(() => c.value === "reasoning"), Be = b(() => w.value ? g.value?.filter((e) => ![
3672
+ return e && e !== "auto" || (e = Fe.value), e ? e === "dark" : Le.value;
3673
+ }), T = x(() => c.value === "reasoning"), ze = x(() => T.value ? g.value?.filter((e) => ![
3674
3674
  "upvote",
3675
3675
  "downvote",
3676
3676
  "feedback"
3677
- ].includes(e)) : g.value), Ve = pe(b(() => `${o.value}-chatId`), null);
3678
- Se(() => {
3679
- Ve.value ||= dt();
3677
+ ].includes(e)) : g.value), Be = fe(x(() => `${o.value}-chatId`), null);
3678
+ xe(() => {
3679
+ Be.value ||= ut();
3680
3680
  });
3681
- let T = b({
3682
- get: () => Ve.value,
3681
+ let E = x({
3682
+ get: () => Be.value,
3683
3683
  set: (e) => {
3684
- Ve.value = e;
3684
+ Be.value = e;
3685
3685
  }
3686
- }), He = fe(b(() => `${o.value}-pageAccessOff`), !1), Ue = b(() => He.value ? [] : xe.value ?? []), We = () => He.value ? [] : Ee.value?.() ?? [], Ge = b(() => !!(be.value && xe.value?.length)), Ke = pe(b(() => `${o.value}-pageNotice`), null), qe = b(() => {
3687
- let e = be.value?.level;
3688
- return e && e !== ie.Off && Ue.value.length && !y(Ke.value ?? void 0, e) ? e : void 0;
3686
+ }), Ve = de(x(() => `${o.value}-pageAccessOff`), !1), He = x(() => Ve.value ? [] : be.value ?? []), Ue = () => Ve.value ? [] : Te.value?.() ?? [], We = x(() => !!(ye.value && be.value?.length)), Ge = fe(x(() => `${o.value}-pageNotice`), null), Ke = x(() => {
3687
+ let e = ye.value?.level;
3688
+ return e && e !== ee.Off && He.value.length && !re(Ge.value ?? void 0, e) ? e : void 0;
3689
3689
  });
3690
- function Je() {
3691
- Ke.value = be.value?.level ?? null;
3690
+ function qe() {
3691
+ Ge.value = ye.value?.level ?? null;
3692
3692
  }
3693
- let Ye = x(), Xe = x(!1), Ze = b(() => Ye.value?.message?.toLowerCase().includes("conversation-blocked") ?? !1);
3694
- function Qe(e) {
3693
+ let Je = S(), Ye = S(!1), Xe = x(() => Je.value?.message?.toLowerCase().includes("conversation-blocked") ?? !1);
3694
+ function Ze(e) {
3695
3695
  try {
3696
3696
  let t = JSON.parse(e.message);
3697
3697
  return t.status === 404 || t.type?.includes("entity-not-found");
@@ -3699,101 +3699,101 @@ function ui(e) {
3699
3699
  return !1;
3700
3700
  }
3701
3701
  }
3702
- function $e(e) {
3703
- if (Qe(e)) {
3704
- let e = P.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? de(t) : void 0;
3705
- T.value = dt(), Ye.value = void 0, ge(() => {
3706
- P.value.clearError(), n && P.value.sendMessage({ text: n });
3702
+ function Qe(e) {
3703
+ if (Ze(e)) {
3704
+ let e = F.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? ue(t) : void 0;
3705
+ E.value = ut(), Je.value = void 0, he(() => {
3706
+ F.value.clearError(), n && F.value.sendMessage({ text: n });
3707
3707
  });
3708
- } else le.error(e), Ye.value = e, Ze.value && (Xe.value = !0);
3708
+ } else ce.error(e), Je.value = e, Xe.value && (Ye.value = !0);
3709
3709
  }
3710
- let E = b(() => ce({
3710
+ let D = x(() => se({
3711
3711
  baseUrl: i.value,
3712
3712
  basePath: a.value,
3713
3713
  headers: () => p.value
3714
- })), et = x(null), tt = () => ({
3715
- ...De(),
3716
- ...et.value ?? {}
3717
- }), nt = () => {
3718
- let e = C.value;
3714
+ })), $e = S(null), et = () => ({
3715
+ ...Ee(),
3716
+ ...$e.value ?? {}
3717
+ }), tt = () => {
3718
+ let e = w.value;
3719
3719
  return new Promise((t) => {
3720
3720
  let n = setTimeout(() => {
3721
3721
  r(), t(!1);
3722
- }, 3e4), r = S(() => [C.value, P.value.status], ([i, a]) => {
3722
+ }, 3e4), r = C(() => [w.value, F.value.status], ([i, a]) => {
3723
3723
  i > e && a === "streaming" && (clearTimeout(n), r(), t(!0));
3724
3724
  });
3725
3725
  });
3726
- }, D = ye(), rt = (e, t) => new Promise((n) => {
3727
- D.value?.answer(!1), D.value = {
3726
+ }, O = ve(), nt = (e, t) => new Promise((n) => {
3727
+ O.value?.answer(!1), O.value = {
3728
3728
  toolCallId: e.toolCallId,
3729
3729
  question: t?.question,
3730
3730
  details: t?.details,
3731
3731
  answer: (e) => {
3732
- D.value = void 0, n(e);
3732
+ O.value = void 0, n(e);
3733
3733
  }
3734
3734
  };
3735
3735
  });
3736
- function it(e) {
3737
- D.value?.answer(e);
3736
+ function rt(e) {
3737
+ O.value?.answer(e);
3738
3738
  }
3739
- let at = Ne({
3739
+ let it = Me({
3740
3740
  registry: () => [
3741
- ...(me.value ?? []).filter((e) => !te(e.name)),
3742
- ...Ue.value,
3743
- ...We()
3741
+ ...(pe.value ?? []).filter((e) => !ae(e.name)),
3742
+ ...He.value,
3743
+ ...Ue()
3744
3744
  ],
3745
- capability: () => se.value,
3746
- addToolOutput: (e) => void P.value.addToolOutput(e),
3747
- confirm: rt,
3748
- waitForResume: nt,
3745
+ capability: () => oe.value,
3746
+ addToolOutput: (e) => void F.value.addToolOutput(e),
3747
+ confirm: nt,
3748
+ waitForResume: tt,
3749
3749
  onPendingChange: (e) => {
3750
- he.value = e;
3750
+ me.value = e;
3751
3751
  },
3752
3752
  onActivity: (e) => {
3753
3753
  if (e?.provider !== "page") {
3754
- Ae.value = void 0;
3754
+ ke.value = void 0;
3755
3755
  return;
3756
3756
  }
3757
- let t = [...Ue.value, ...We()].find((t) => t.name === e.toolName), n;
3757
+ let t = [...He.value, ...Ue()].find((t) => t.name === e.toolName), n;
3758
3758
  try {
3759
3759
  n = t?.describe?.(e.input);
3760
3760
  } catch {
3761
3761
  n = void 0;
3762
3762
  }
3763
- n && (Pe.value = {
3764
- ...Pe.value,
3763
+ n && (Ne.value = {
3764
+ ...Ne.value,
3765
3765
  [e.toolCallId]: n
3766
- }), e.readOnly ? Ae.value = void 0 : (Ae.value = { title: n ?? t?.annotations?.title ?? e.toolName }, Fe.value = !0);
3766
+ }), e.readOnly ? ke.value = void 0 : (ke.value = { title: n ?? t?.annotations?.title ?? e.toolName }, Pe.value = !0);
3767
3767
  }
3768
3768
  });
3769
- async function O() {
3770
- k(), Ae.value = void 0, Fe.value = !1, H.value = "", await P.value.stop();
3769
+ async function k() {
3770
+ A(), ke.value = void 0, Pe.value = !1, H.value = "", await F.value.stop();
3771
3771
  }
3772
- function k() {
3773
- at.cancelAll(), D.value?.answer(!1);
3772
+ function A() {
3773
+ it.cancelAll(), O.value?.answer(!1);
3774
3774
  }
3775
- async function ot(e) {
3776
- He.value = e, e && await O();
3775
+ async function at(e) {
3776
+ Ve.value = e, e && await k();
3777
3777
  }
3778
- S(T, () => k(), { flush: "sync" });
3779
- let st = !1, A, ct = x(), lt, ut = x([]), j = x([]), M = x([]), N = x({}), ft = /* @__PURE__ */ new Map(), pt = /* @__PURE__ */ new Set();
3780
- function mt(e, t, n) {
3781
- j.value.includes(e) || (j.value = [...j.value, e]), ft.set(e, Date.now()), n ? pt.add(e) : pt.delete(e), t && (N.value = {
3782
- ...N.value,
3778
+ C(E, () => A(), { flush: "sync" });
3779
+ let ot = !1, j, st = S(), ct, lt = S([]), M = S([]), N = S([]), P = S({}), dt = /* @__PURE__ */ new Map(), ft = /* @__PURE__ */ new Set();
3780
+ function pt(e, t, n) {
3781
+ M.value.includes(e) || (M.value = [...M.value, e]), dt.set(e, Date.now()), n ? ft.add(e) : ft.delete(e), t && (P.value = {
3782
+ ...P.value,
3783
3783
  [e]: t
3784
3784
  }), q || vn();
3785
3785
  }
3786
- function ht(e) {
3787
- N.value = Object.fromEntries(Object.entries(N.value).filter(([t]) => t !== e));
3786
+ function mt(e) {
3787
+ P.value = Object.fromEntries(Object.entries(P.value).filter(([t]) => t !== e));
3788
3788
  }
3789
- function gt(e) {
3790
- ft.delete(e), j.value = j.value.filter((t) => t !== e), M.value = M.value.filter((t) => t !== e), ht(e);
3789
+ function ht(e) {
3790
+ dt.delete(e), M.value = M.value.filter((t) => t !== e), N.value = N.value.filter((t) => t !== e), mt(e);
3791
3791
  }
3792
- let _t = Gr(() => ({
3793
- id: T.value,
3792
+ let gt = Gr(() => ({
3793
+ id: E.value,
3794
3794
  transport: new hr({
3795
- api: E.value.getChatEndpoint(o.value, w.value ? "reasoning" : "chat"),
3796
- prepareReconnectToStreamRequest: ({ id: e }) => ({ api: E.value.getChatStreamEndpoint(o.value, e) }),
3795
+ api: D.value.getChatEndpoint(o.value, T.value ? "reasoning" : "chat"),
3796
+ prepareReconnectToStreamRequest: ({ id: e }) => ({ api: D.value.getChatStreamEndpoint(o.value, e) }),
3797
3797
  prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
3798
3798
  id: t,
3799
3799
  messages: [e[e.length - 1]],
@@ -3808,16 +3808,16 @@ function ui(e) {
3808
3808
  reasoning: d.value?.reasoning,
3809
3809
  webSearch: f.value?.webSearch,
3810
3810
  smoothStream: u.value?.smoothStream,
3811
- deviceContext: tt(),
3812
- externalContext: oe.value,
3811
+ deviceContext: et(),
3812
+ externalContext: te.value,
3813
3813
  disabledTools: f.value?.disabled,
3814
- fallbackModels: ne.value,
3815
- gatewayOptions: ae.value,
3816
- hostTools: Me(me.value, se.value),
3817
- pageTools: be.value && Ue.value.length ? {
3814
+ fallbackModels: y.value,
3815
+ gatewayOptions: b.value,
3816
+ hostTools: je(pe.value, oe.value),
3817
+ pageTools: ye.value && He.value.length ? {
3818
3818
  version: 1,
3819
- features: [...re],
3820
- forms: We().map(({ name: e, description: t, inputSchema: n, annotations: r }) => ({
3819
+ features: [...ne],
3820
+ forms: Ue().map(({ name: e, description: t, inputSchema: n, annotations: r }) => ({
3821
3821
  name: e,
3822
3822
  description: t,
3823
3823
  inputSchema: n,
@@ -3830,46 +3830,46 @@ function ui(e) {
3830
3830
  }),
3831
3831
  sendAutomaticallyWhen: (e) => li(e) || _r(e),
3832
3832
  onError: (e) => {
3833
- st ? le.warn(e) : $e(e);
3833
+ ot ? ce.warn(e) : Qe(e);
3834
3834
  },
3835
3835
  onToolCall: ({ toolCall: e }) => {
3836
- if (!je(e) || st) return;
3836
+ if (!Ae(e) || ot) return;
3837
3837
  let t = e;
3838
- at.enqueue({
3838
+ it.enqueue({
3839
3839
  toolCallId: t.toolCallId,
3840
3840
  toolName: t.toolName,
3841
3841
  input: t.input,
3842
- messageId: vt()?.id ?? "",
3842
+ messageId: _t()?.id ?? "",
3843
3843
  readOnly: t.toolMetadata?.readOnly === !0,
3844
3844
  provider: t.toolMetadata?.provider === "page" ? "page" : "app"
3845
3845
  });
3846
3846
  },
3847
3847
  onData: (e) => {
3848
- e.type === "data-turnStream" ? lt = e.data.streamId : e.type === "data-audioTranscripts" && (P.value.messages = ue(P.value.messages, e.data));
3848
+ e.type === "data-turnStream" ? ct = e.data.streamId : e.type === "data-audioTranscripts" && (F.value.messages = le(F.value.messages, e.data));
3849
3849
  },
3850
3850
  onFinish: () => {
3851
- let e = T.value;
3852
- !w.value && !I.value.some((t) => t.id === e) && zt(o.value);
3851
+ let e = E.value;
3852
+ !T.value && !L.value.some((t) => t.id === e) && zt(o.value);
3853
3853
  }
3854
- })), P = b(() => ve(_t)), vt = () => P.value.messages[P.value.messages.length - 1];
3855
- S(T, (e, t) => {
3856
- if (t && !w.value && (G() || A?.chatId === t)) {
3857
- let e = P.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
3858
- mt(t, n ? de(n) ?? "" : "", P.value.status === "streaming" || A?.chatId === t);
3854
+ })), F = x(() => _e(gt)), _t = () => F.value.messages[F.value.messages.length - 1];
3855
+ C(E, (e, t) => {
3856
+ if (t && !T.value && (G() || j?.chatId === t)) {
3857
+ let e = F.value.messages.filter((e) => e.role === "user"), n = e[e.length - 1];
3858
+ pt(t, n ? ue(n) ?? "" : "", F.value.status === "streaming" || j?.chatId === t);
3859
3859
  }
3860
- gt(e), lt = void 0, clearTimeout(fn), dn.value = !1, P.value.stop();
3860
+ ht(e), ct = void 0, clearTimeout(fn), dn.value = !1, F.value.stop();
3861
3861
  }, { flush: "sync" });
3862
- let yt = b(() => {
3862
+ let vt = x(() => {
3863
3863
  let e = u.value?.initialMessage;
3864
3864
  return e?.[r.value] ? e[r.value] : n("message.defaultAgentWelcome") ? t("message.defaultAgentWelcome") : "";
3865
- }), bt = dt(), F = b(() => ({
3866
- id: bt,
3865
+ }), yt = ut(), I = x(() => ({
3866
+ id: yt,
3867
3867
  role: "assistant",
3868
3868
  parts: [{
3869
3869
  type: "text",
3870
- text: yt.value
3870
+ text: vt.value
3871
3871
  }]
3872
- })), xt = b(() => {
3872
+ })), bt = x(() => {
3873
3873
  let e = (e) => e.map((e) => e.role !== "user" || !e.parts.some((e) => e.type === "file") ? e : {
3874
3874
  ...e,
3875
3875
  parts: e.parts.map((e) => {
@@ -3879,20 +3879,20 @@ function ui(e) {
3879
3879
  let e = t.url.slice(13);
3880
3880
  return {
3881
3881
  ...t,
3882
- url: E.value.getMediaUrl(o.value, T.value, e)
3882
+ url: D.value.getMediaUrl(o.value, E.value, e)
3883
3883
  };
3884
3884
  }
3885
3885
  return t.url.startsWith("blob:") ? t : {
3886
3886
  ...t,
3887
- url: E.value.appendAuthToken(t.url)
3887
+ url: D.value.appendAuthToken(t.url)
3888
3888
  };
3889
3889
  })
3890
- }), t = P.value.id === T.value ? P.value.messages : [];
3891
- return w.value ? e(t) : !Le.value && t[0]?.role !== "assistant" ? [F.value, ...e(t)] : e(t);
3892
- }), St = b(() => {
3890
+ }), t = F.value.id === E.value ? F.value.messages : [];
3891
+ return T.value ? e(t) : !Ie.value && t[0]?.role !== "assistant" ? [I.value, ...e(t)] : e(t);
3892
+ }), xt = x(() => {
3893
3893
  let e = u.value?.messagePlaceholder;
3894
3894
  return e?.[r.value] ? e[r.value] : n("placeholder.askAnything") ? t("placeholder.askAnything") : "";
3895
- }), I = x([]), Ct = x(!1), L = x([]), wt = x(!1), Tt = x("chat"), R = x([]), Et = x(), Dt = x(!1), Ot = x(!1), kt = x(), At = x(!1), jt = x(!1), z = x(), B = x(""), V = x([]), H = x(""), Mt = x(0), U = fe(b(() => `${o.value}-queue`), {}), W = b(() => U.value[T.value] ?? []), Nt = b(() => !w.value);
3895
+ }), L = S([]), St = S(!1), R = S([]), Ct = S(!1), wt = S("chat"), Tt = S([]), Et = S(), Dt = S(!1), Ot = S(!1), kt = S(), At = S(!1), jt = S(!1), z = S(), B = S(""), V = S([]), H = S(""), Mt = S(0), U = de(x(() => `${o.value}-queue`), {}), W = x(() => U.value[E.value] ?? []), Nt = x(() => !T.value);
3896
3896
  function Pt(e, t) {
3897
3897
  let n = Object.fromEntries(Object.entries(U.value).filter(([t]) => t !== e));
3898
3898
  U.value = t.length > 0 ? {
@@ -3908,109 +3908,109 @@ function ui(e) {
3908
3908
  e && (B.value = B.value ? `${B.value}${oi}${e}` : e);
3909
3909
  }
3910
3910
  function Lt(e) {
3911
- Pt(T.value, W.value.filter((t, n) => n !== e));
3911
+ Pt(E.value, W.value.filter((t, n) => n !== e));
3912
3912
  }
3913
3913
  function Rt(e) {
3914
3914
  let t = W.value[e];
3915
3915
  Lt(e), It(t ?? "");
3916
3916
  }
3917
3917
  async function zt(e) {
3918
- if (w.value) I.value = [];
3918
+ if (T.value) L.value = [];
3919
3919
  else {
3920
- Ct.value = !0;
3920
+ St.value = !0;
3921
3921
  try {
3922
- let t = await E.value.getConversations(e, l.value), n = new Set(t.map((e) => e.id)), r = j.value.filter((e) => !n.has(e) && N.value[e]).map((t) => ({
3922
+ let t = await D.value.getConversations(e, l.value), n = new Set(t.map((e) => e.id)), r = M.value.filter((e) => !n.has(e) && P.value[e]).map((t) => ({
3923
3923
  id: t,
3924
3924
  agentId: e,
3925
- title: N.value[t],
3925
+ title: P.value[t],
3926
3926
  summary: null,
3927
3927
  messages: [],
3928
3928
  lastMessageAt: /* @__PURE__ */ new Date()
3929
3929
  }));
3930
- I.value = [...r, ...t];
3930
+ L.value = [...r, ...t];
3931
3931
  } catch {
3932
- I.value = [];
3932
+ L.value = [];
3933
3933
  return;
3934
3934
  } finally {
3935
- Ct.value = !1;
3935
+ St.value = !1;
3936
3936
  }
3937
- yn([.../* @__PURE__ */ new Set([...mn(), ...I.value.map((e) => e.id)])]);
3937
+ yn([.../* @__PURE__ */ new Set([...mn(), ...L.value.map((e) => e.id)])]);
3938
3938
  }
3939
3939
  }
3940
3940
  async function Bt() {
3941
- let e = T.value;
3942
- if (!e) L.value = [];
3941
+ let e = E.value;
3942
+ if (!e) R.value = [];
3943
3943
  else {
3944
- wt.value = !0;
3944
+ Ct.value = !0;
3945
3945
  try {
3946
- L.value = await E.value.getChatFiles(e);
3946
+ R.value = await D.value.getChatFiles(e);
3947
3947
  } catch {
3948
- L.value = [];
3948
+ R.value = [];
3949
3949
  } finally {
3950
- wt.value = !1;
3950
+ Ct.value = !1;
3951
3951
  }
3952
3952
  }
3953
3953
  }
3954
3954
  function Vt(e, t = !1) {
3955
- return E.value.getChatFileDownloadUrl(e, t);
3955
+ return D.value.getChatFileDownloadUrl(e, t);
3956
3956
  }
3957
3957
  function Ht(e) {
3958
- return E.value.getChatFilePreviewUrl(e);
3958
+ return D.value.getChatFilePreviewUrl(e);
3959
3959
  }
3960
3960
  async function Ut(e) {
3961
- await E.value.deleteChatFile(e);
3962
- let t = L.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
3963
- L.value = L.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
3961
+ await D.value.deleteChatFile(e);
3962
+ let t = R.value.find((t) => t.documentId === e), n = t?.kind === "spreadsheet" ? t.sourceAttachmentId ?? t.documentId : void 0;
3963
+ R.value = R.value.filter((t) => t.documentId !== e && (!n || t.documentId !== n && t.sourceAttachmentId !== n));
3964
3964
  }
3965
3965
  async function Wt(e, t) {
3966
- if (!w.value) try {
3967
- let n = await E.value.getChat(e, t);
3968
- if (t !== T.value || P.value.status !== "ready" || P.value.messages.length > 0) return;
3969
- n && (P.value.messages = n.messages, Xe.value = n.blocked ?? !1, Gt(e, t, n.turnInProgress === !0));
3966
+ if (!T.value) try {
3967
+ let n = await D.value.getChat(e, t);
3968
+ if (t !== E.value || F.value.status !== "ready" || F.value.messages.length > 0) return;
3969
+ n && (F.value.messages = n.messages, Ye.value = n.blocked ?? !1, Gt(e, t, n.turnInProgress === !0));
3970
3970
  } catch {}
3971
3971
  }
3972
3972
  async function Gt(e, t, n) {
3973
- n && (await Kt(t), t !== T.value || G()) || (await qt(e, t), t === T.value && await Zt());
3973
+ n && (await Kt(t), t !== E.value || G()) || (await qt(e, t), t === E.value && await Zt());
3974
3974
  }
3975
3975
  async function Kt(e) {
3976
3976
  let t = { chatId: e };
3977
- A = t, ct.value = e;
3978
- let n = () => A === t && e === T.value, r = Date.now() + Qr;
3977
+ j = t, st.value = e;
3978
+ let n = () => j === t && e === E.value, r = Date.now() + Qr;
3979
3979
  try {
3980
3980
  for (; n() && !G() && Date.now() < r;) {
3981
- st = !0;
3981
+ ot = !0;
3982
3982
  try {
3983
- await P.value.resumeStream();
3983
+ await F.value.resumeStream();
3984
3984
  } finally {
3985
- st = !1;
3985
+ ot = !1;
3986
3986
  }
3987
3987
  if (!n()) return;
3988
- P.value.clearError();
3989
- let t = await E.value.getChat(o.value, e).catch(() => null);
3988
+ F.value.clearError();
3989
+ let t = await D.value.getChat(o.value, e).catch(() => null);
3990
3990
  if (!t || !n() || G()) return;
3991
3991
  if (!t.turnInProgress) {
3992
- P.value.messages = t.messages;
3992
+ F.value.messages = t.messages;
3993
3993
  return;
3994
3994
  }
3995
3995
  await new Promise((e) => setTimeout(e, $r));
3996
3996
  }
3997
3997
  } finally {
3998
- A === t && (A = void 0, ct.value = void 0);
3998
+ j === t && (j = void 0, st.value = void 0);
3999
3999
  }
4000
4000
  }
4001
4001
  async function qt(e, t) {
4002
4002
  let n;
4003
4003
  try {
4004
- n = Number(sessionStorage.getItem(ke)), sessionStorage.removeItem(ke);
4004
+ n = Number(sessionStorage.getItem(Oe)), sessionStorage.removeItem(Oe);
4005
4005
  } catch {
4006
4006
  return;
4007
4007
  }
4008
- if (!(!n || Date.now() - n > 6e4 || He.value)) for (let n = 0; n < 12; n++) {
4009
- let n = P.value.messages[P.value.messages.length - 1];
4008
+ if (!(!n || Date.now() - n > 6e4 || Ve.value)) for (let n = 0; n < 12; n++) {
4009
+ let n = F.value.messages[F.value.messages.length - 1];
4010
4010
  if (n?.role === "assistant") {
4011
- let e = n.parts.filter((e) => ee(e) && e.state === "input-available"), t = e.filter((e) => e.toolMetadata?.provider === "page" && e.toolMetadata.readOnly === !0);
4011
+ let e = n.parts.filter((e) => ie(e) && e.state === "input-available"), t = e.filter((e) => e.toolMetadata?.provider === "page" && e.toolMetadata.readOnly === !0);
4012
4012
  if (e.length > 0) {
4013
- if (t.length === e.length && !He.value) for (let e of t) at.enqueue({
4013
+ if (t.length === e.length && !Ve.value) for (let e of t) it.enqueue({
4014
4014
  toolCallId: e.toolCallId,
4015
4015
  toolName: e.toolName,
4016
4016
  input: e.input,
@@ -4022,32 +4022,32 @@ function ui(e) {
4022
4022
  }
4023
4023
  if (n.parts[n.parts.length - 1]?.type === "text") return;
4024
4024
  }
4025
- if (await new Promise((e) => setTimeout(e, 1500)), t !== T.value || P.value.status !== "ready") return;
4025
+ if (await new Promise((e) => setTimeout(e, 1500)), t !== E.value || F.value.status !== "ready") return;
4026
4026
  try {
4027
- let n = await E.value.getChat(e, t);
4028
- n && t === T.value && (P.value.messages = n.messages);
4027
+ let n = await D.value.getChat(e, t);
4028
+ n && t === E.value && (F.value.messages = n.messages);
4029
4029
  } catch {
4030
4030
  return;
4031
4031
  }
4032
4032
  }
4033
4033
  }
4034
4034
  let G = () => {
4035
- let e = P.value.status;
4035
+ let e = F.value.status;
4036
4036
  return e === "submitted" || e === "streaming";
4037
- }, Jt = () => G() || A?.chatId === T.value || he.value > 0, Yt = () => {
4038
- let e = vt();
4039
- return D.value !== void 0 || qr(e) || ci(e);
4037
+ }, Jt = () => G() || j?.chatId === E.value || me.value > 0, Yt = () => {
4038
+ let e = _t();
4039
+ return O.value !== void 0 || qr(e) || ci(e);
4040
4040
  }, Xt = /* @__PURE__ */ new Set();
4041
4041
  async function Zt() {
4042
- let e = T.value;
4043
- if (!(Xt.has(e) || W.value.length === 0 || Jt() || Ye.value)) {
4042
+ let e = E.value;
4043
+ if (!(Xt.has(e) || W.value.length === 0 || Jt() || Je.value)) {
4044
4044
  if (Yt()) It(Ft(e));
4045
4045
  else {
4046
4046
  Xt.add(e);
4047
4047
  try {
4048
4048
  let t = Date.now() + ri;
4049
- for (; Date.now() < t && (await Promise.race([E.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), ai))])).includes(e);) await new Promise((e) => setTimeout(e, ii));
4050
- if (e !== T.value || Jt()) return;
4049
+ for (; Date.now() < t && (await Promise.race([D.value.getRunningTurns(o.value, [e]).catch(() => []), new Promise((t) => setTimeout(() => t([e]), ai))])).includes(e);) await new Promise((e) => setTimeout(e, ii));
4050
+ if (e !== E.value || Jt()) return;
4051
4051
  let n = Ft(e);
4052
4052
  n && sn(n);
4053
4053
  } finally {
@@ -4058,35 +4058,35 @@ function ui(e) {
4058
4058
  }
4059
4059
  let Qt = 0, $t = 0;
4060
4060
  async function en() {
4061
- if (w.value || G()) return "indeterminate";
4062
- let e = T.value, t = Qt += 1;
4061
+ if (T.value || G()) return "indeterminate";
4062
+ let e = E.value, t = Qt += 1;
4063
4063
  try {
4064
- let n = await E.value.getChat(o.value, e);
4065
- if (!n || e !== T.value || G() || t <= $t) return "indeterminate";
4064
+ let n = await D.value.getChat(o.value, e);
4065
+ if (!n || e !== E.value || G() || t <= $t) return "indeterminate";
4066
4066
  $t = t;
4067
- let r = n.messages, i = Zr(r, P.value.messages);
4068
- return P.value.messages = [...r, ...i], Xe.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
4067
+ let r = n.messages, i = Zr(r, F.value.messages);
4068
+ return F.value.messages = [...r, ...i], Ye.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
4069
4069
  } catch {}
4070
4070
  return "indeterminate";
4071
4071
  }
4072
4072
  function tn(e) {
4073
- P.value.messages = [...P.value.messages, e];
4073
+ F.value.messages = [...F.value.messages, e];
4074
4074
  }
4075
4075
  async function K(e) {
4076
4076
  try {
4077
- R.value = await E.value.getMessageFeedbacks(e);
4077
+ Tt.value = await D.value.getMessageFeedbacks(e);
4078
4078
  } catch {
4079
- R.value = [];
4079
+ Tt.value = [];
4080
4080
  }
4081
4081
  }
4082
4082
  function nn(e) {
4083
- let t = R.value.findIndex((t) => t.messageId === e.messageId);
4084
- t >= 0 ? R.value[t] = e : R.value.push(e);
4083
+ let t = Tt.value.findIndex((t) => t.messageId === e.messageId);
4084
+ t >= 0 ? Tt.value[t] = e : Tt.value.push(e);
4085
4085
  }
4086
4086
  function rn(e) {
4087
- let t = xt.value, n = t.findIndex((t) => t.id === e.id), r = de(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
4087
+ let t = bt.value, n = t.findIndex((t) => t.id === e.id), r = ue(e) ?? "", i = t.slice(0, n).reverse().find((e) => e.role === "user");
4088
4088
  return {
4089
- userQuestion: de(i ?? e) ?? "",
4089
+ userQuestion: ue(i ?? e) ?? "",
4090
4090
  assistantMessage: r
4091
4091
  };
4092
4092
  }
@@ -4095,8 +4095,8 @@ function ui(e) {
4095
4095
  Wt(e, t),
4096
4096
  zt(e),
4097
4097
  K(t)
4098
- ]), et.value || Oe((e, t) => E.value.reverseGeocode(e, t, r.value)).then((e) => {
4099
- e && (et.value = e);
4098
+ ]), $e.value || De((e, t) => D.value.reverseGeocode(e, t, r.value)).then((e) => {
4099
+ e && ($e.value = e);
4100
4100
  });
4101
4101
  }
4102
4102
  async function on() {
@@ -4107,11 +4107,11 @@ function ui(e) {
4107
4107
  filename: e.mediaSource.name,
4108
4108
  providerMetadata: { "8bot": { media: e.mediaSource } }
4109
4109
  }));
4110
- !w.value && Jt() ? e && t.length === 0 && (Pt(T.value, [...W.value, e]), B.value = "") : (w.value && xt.value.length > 0 && await wn(), sn(e, t), B.value = "", Cn());
4110
+ !T.value && Jt() ? e && t.length === 0 && (Pt(E.value, [...W.value, e]), B.value = "") : (T.value && bt.value.length > 0 && await wn(), sn(e, t), B.value = "", Cn());
4111
4111
  }
4112
4112
  function sn(e, t = []) {
4113
- k(), H.value = e, Mt.value = P.value.messages.length;
4114
- let n = P.value.sendMessage;
4113
+ A(), H.value = e, Mt.value = F.value.messages.length;
4114
+ let n = F.value.sendMessage;
4115
4115
  n({
4116
4116
  text: e,
4117
4117
  files: t.length > 0 ? t : void 0
@@ -4120,56 +4120,56 @@ function ui(e) {
4120
4120
  function cn(e) {
4121
4121
  let t = e.trim();
4122
4122
  if (!t) return;
4123
- if (P.value.status !== "ready") {
4124
- le.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
4123
+ if (F.value.status !== "ready") {
4124
+ ce.warn("[useChatbotStore] sendMessage called before chat is ready. Listen for the \"ready\" event on the widget element.");
4125
4125
  return;
4126
4126
  }
4127
- let n = P.value.sendMessage;
4128
- k(), n({ text: t });
4127
+ let n = F.value.sendMessage;
4128
+ A(), n({ text: t });
4129
4129
  }
4130
4130
  async function ln() {
4131
- let e = P.value.messages.slice(Mt.value).some((e) => e.parts.some(ee)), t = H.value, n = t.length > 0 && !e, r = T.value, i = Mt.value, a = A?.chatId === r, s = lt, c = Ft(r), l = (e = "") => {
4131
+ let e = F.value.messages.slice(Mt.value).some((e) => e.parts.some(ie)), t = H.value, n = t.length > 0 && !e, r = E.value, i = Mt.value, a = j?.chatId === r, s = ct, c = Ft(r), l = (e = "") => {
4132
4132
  B.value = [
4133
4133
  e,
4134
4134
  c,
4135
4135
  B.value
4136
4136
  ].filter(Boolean).join(oi);
4137
- }, u = () => r === T.value && !G() && Mt.value === i ? !1 : (c && Pt(r, [c, ...U.value[r] ?? []]), !0);
4138
- A = void 0, ct.value = void 0, k(), await P.value.stop();
4139
- let d = w.value || e && !a || await E.value.stopChatTurn(o.value, r, s).catch(() => !0);
4137
+ }, u = () => r === E.value && !G() && Mt.value === i ? !1 : (c && Pt(r, [c, ...U.value[r] ?? []]), !0);
4138
+ j = void 0, st.value = void 0, A(), await F.value.stop();
4139
+ let d = T.value || e && !a || await D.value.stopChatTurn(o.value, r, s).catch(() => !0);
4140
4140
  if (!u()) {
4141
4141
  if (a || !d) {
4142
4142
  if (await en(), u()) return;
4143
- if (a || P.value.messages.length > Mt.value) {
4143
+ if (a || F.value.messages.length > Mt.value) {
4144
4144
  H.value = "", l();
4145
4145
  return;
4146
4146
  }
4147
4147
  }
4148
- n ? (l(t), P.value.messages = P.value.messages.slice(0, Mt.value), H.value = "") : l();
4148
+ n ? (l(t), F.value.messages = F.value.messages.slice(0, Mt.value), H.value = "") : l();
4149
4149
  }
4150
4150
  }
4151
- S(() => P.value.messages, (e) => {
4152
- let t = D.value?.toolCallId;
4153
- t && !e.some((e) => e.parts.some((e) => e.toolCallId === t)) && k();
4154
- }), S(() => P.value.status, (e) => {
4155
- e === "submitted" && (C.value++, lt = void 0);
4151
+ C(() => F.value.messages, (e) => {
4152
+ let t = O.value?.toolCallId;
4153
+ t && !e.some((e) => e.parts.some((e) => e.toolCallId === t)) && A();
4154
+ }), C(() => F.value.status, (e) => {
4155
+ e === "submitted" && (w.value++, ct = void 0);
4156
4156
  });
4157
4157
  let un;
4158
- S(() => [P.value.status, he.value], ([e, t]) => {
4158
+ C(() => [F.value.status, me.value], ([e, t]) => {
4159
4159
  clearTimeout(un), e === "ready" && t === 0 && (un = setTimeout(() => {
4160
- Fe.value = !1;
4160
+ Pe.value = !1;
4161
4161
  }, 1500));
4162
4162
  });
4163
- let dn = x(!1), fn;
4164
- S(() => !D.value && !qr(vt()) && (G() || he.value > 0), (e) => {
4163
+ let dn = S(!1), fn;
4164
+ C(() => !O.value && !qr(_t()) && (G() || me.value > 0), (e) => {
4165
4165
  clearTimeout(fn), e ? dn.value = !0 : fn = setTimeout(() => {
4166
4166
  dn.value = !1;
4167
4167
  }, 400);
4168
4168
  }, { immediate: !0 });
4169
- let pn = b(() => {
4170
- let e = ut.value.filter((e) => e !== T.value);
4171
- return dn.value || ct.value === T.value ? [...e, T.value] : e;
4172
- }), mn = () => [.../* @__PURE__ */ new Set([...ut.value, ...j.value])], hn = we(), q, gn = 0, _n = 0;
4169
+ let pn = x(() => {
4170
+ let e = lt.value.filter((e) => e !== E.value);
4171
+ return dn.value || st.value === E.value ? [...e, E.value] : e;
4172
+ }), mn = () => [.../* @__PURE__ */ new Set([...lt.value, ...M.value])], hn = Ce(), q, gn = 0, _n = 0;
4173
4173
  function vn() {
4174
4174
  clearTimeout(q), q = void 0, mn().length !== 0 && hn.value === "visible" && (q = setTimeout(() => {
4175
4175
  q = void 0, yn(mn());
@@ -4177,52 +4177,52 @@ function ui(e) {
4177
4177
  }
4178
4178
  async function yn(e) {
4179
4179
  let t = e.slice(0, ti);
4180
- if (w.value || t.length === 0) {
4180
+ if (T.value || t.length === 0) {
4181
4181
  vn();
4182
4182
  return;
4183
4183
  }
4184
4184
  let n = gn += 1, r;
4185
4185
  try {
4186
- r = await E.value.getRunningTurns(o.value, t);
4186
+ r = await D.value.getRunningTurns(o.value, t);
4187
4187
  } catch {
4188
4188
  vn();
4189
4189
  return;
4190
4190
  }
4191
4191
  if (n <= _n) return;
4192
4192
  _n = n;
4193
- for (let e of r) pt.add(e);
4194
- let i = new Set(t), a = mn().filter((e) => i.has(e) && !r.includes(e)), s = (e) => j.value.includes(e) && !pt.has(e), c = a.filter((e) => s(e) && Date.now() - (ft.get(e) ?? 0) > ni), l = a.filter((e) => !s(e));
4195
- ut.value = [...ut.value.filter((e) => !i.has(e)), ...r];
4196
- let u = l.filter((e) => j.value.includes(e));
4197
- (u.length > 0 || c.length > 0) && (j.value = j.value.filter((e) => !u.includes(e) && !c.includes(e)), M.value = [...M.value, ...u.filter((e) => e !== T.value && !M.value.includes(e))]), l.length > 0 && zt(o.value), vn();
4193
+ for (let e of r) ft.add(e);
4194
+ let i = new Set(t), a = mn().filter((e) => i.has(e) && !r.includes(e)), s = (e) => M.value.includes(e) && !ft.has(e), c = a.filter((e) => s(e) && Date.now() - (dt.get(e) ?? 0) > ni), l = a.filter((e) => !s(e));
4195
+ lt.value = [...lt.value.filter((e) => !i.has(e)), ...r];
4196
+ let u = l.filter((e) => M.value.includes(e));
4197
+ (u.length > 0 || c.length > 0) && (M.value = M.value.filter((e) => !u.includes(e) && !c.includes(e)), N.value = [...N.value, ...u.filter((e) => e !== E.value && !N.value.includes(e))]), l.length > 0 && zt(o.value), vn();
4198
4198
  }
4199
- S(hn, (e) => {
4199
+ C(hn, (e) => {
4200
4200
  e === "visible" ? yn(mn()) : (clearTimeout(q), q = void 0);
4201
- }), _e(() => clearTimeout(q));
4202
- let bn = b(() => M.value.map((e) => ({
4201
+ }), ge(() => clearTimeout(q));
4202
+ let bn = x(() => N.value.map((e) => ({
4203
4203
  chatId: e,
4204
- title: I.value.find((t) => t.id === e)?.title || N.value[e] || void 0
4204
+ title: L.value.find((t) => t.id === e)?.title || P.value[e] || void 0
4205
4205
  })));
4206
4206
  function xn(e) {
4207
- gt(e), T.value = e, Bn("chat");
4207
+ ht(e), E.value = e, Bn("chat");
4208
4208
  }
4209
4209
  function Sn(e) {
4210
- M.value = M.value.filter((t) => t !== e), ht(e);
4210
+ N.value = N.value.filter((t) => t !== e), mt(e);
4211
4211
  }
4212
- S(() => [P.value.status, P.value.id], ([e, t], [n, r]) => {
4212
+ C(() => [F.value.status, F.value.id], ([e, t], [n, r]) => {
4213
4213
  if (t === r) {
4214
- if (e === "error") A?.chatId !== T.value && It(Ft(T.value));
4214
+ if (e === "error") j?.chatId !== E.value && It(Ft(E.value));
4215
4215
  else if (e === "ready" && (n === "streaming" || n === "submitted")) {
4216
4216
  if (Yt()) {
4217
- It(Ft(T.value));
4217
+ It(Ft(E.value));
4218
4218
  return;
4219
4219
  }
4220
4220
  Zt();
4221
4221
  }
4222
4222
  }
4223
- }), S(he, (e) => {
4224
- e === 0 && P.value.status === "ready" && Zt();
4225
- }), S(() => P.value.status, (e) => {
4223
+ }), C(me, (e) => {
4224
+ e === 0 && F.value.status === "ready" && Zt();
4225
+ }), C(() => F.value.status, (e) => {
4226
4226
  e === "ready" && H.value.length > 0 && (H.value = "");
4227
4227
  });
4228
4228
  function Cn(e = !1) {
@@ -4230,30 +4230,30 @@ function ui(e) {
4230
4230
  V.value = [], Z.value = null;
4231
4231
  }
4232
4232
  async function wn() {
4233
- return H.value = "", Pe.value = {}, T.value = dt(), await ge(), P.value.clearError(), Ye.value = void 0, Xe.value = !1, Cn(!0), Bn("chat"), T.value;
4233
+ return H.value = "", Ne.value = {}, E.value = ut(), await he(), F.value.clearError(), Je.value = void 0, Ye.value = !1, Cn(!0), Bn("chat"), E.value;
4234
4234
  }
4235
4235
  async function Tn(e) {
4236
- P.value.status !== "ready" && (H.value = "", await ln()), k(), await P.value.regenerate(e);
4236
+ F.value.status !== "ready" && (H.value = "", await ln()), A(), await F.value.regenerate(e);
4237
4237
  }
4238
4238
  function En(e) {
4239
4239
  if (e.tool === "requestGeolocation") {
4240
4240
  let t = e.output;
4241
- "latitude" in t && (et.value = {
4241
+ "latitude" in t && ($e.value = {
4242
4242
  geolocationLatitude: t.latitude,
4243
4243
  geolocationLongitude: t.longitude,
4244
4244
  geolocationAccuracy: t.accuracy,
4245
4245
  geolocationCity: t.city
4246
4246
  });
4247
4247
  }
4248
- P.value.addToolOutput(e);
4248
+ F.value.addToolOutput(e);
4249
4249
  }
4250
4250
  function Dn(e) {
4251
- P.value.addToolApprovalResponse(e);
4251
+ F.value.addToolApprovalResponse(e);
4252
4252
  }
4253
- let On = b(() => P.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), J = b(() => _.value?.maxFilesPerMessage ?? 5), kn = b(() => _.value?.maxFilesPerChat ?? 20), Y = b(() => Math.max(0, Math.min(J.value - V.value.length, kn.value - On.value - V.value.length))), X = b(() => Y.value <= 0), Z = x(null), An = () => {
4253
+ let On = x(() => F.value.messages.reduce((e, t) => e + t.parts.filter((e) => e.type === "file").length, 0)), J = x(() => _.value?.maxFilesPerMessage ?? 5), kn = x(() => _.value?.maxFilesPerChat ?? 20), Y = x(() => Math.max(0, Math.min(J.value - V.value.length, kn.value - On.value - V.value.length))), X = x(() => Y.value <= 0), Z = S(null), An = () => {
4254
4254
  Z.value = null;
4255
4255
  };
4256
- S(X, (e) => {
4256
+ C(X, (e) => {
4257
4257
  e || (Z.value = null);
4258
4258
  });
4259
4259
  async function jn(e) {
@@ -4267,7 +4267,7 @@ function ui(e) {
4267
4267
  };
4268
4268
  return;
4269
4269
  }
4270
- let t = dt(), n = {
4270
+ let t = ut(), n = {
4271
4271
  id: t,
4272
4272
  file: e,
4273
4273
  localUrl: URL.createObjectURL(e),
@@ -4275,7 +4275,7 @@ function ui(e) {
4275
4275
  };
4276
4276
  V.value = [...V.value, n];
4277
4277
  try {
4278
- let n = await E.value.uploadMedia(o.value, T.value, e);
4278
+ let n = await D.value.uploadMedia(o.value, E.value, e);
4279
4279
  V.value = V.value.map((e) => e.id === t ? {
4280
4280
  ...e,
4281
4281
  state: "done",
@@ -4292,9 +4292,9 @@ function ui(e) {
4292
4292
  }
4293
4293
  async function Mn(e, t) {
4294
4294
  let { userQuestion: n, assistantMessage: r } = rn(e);
4295
- nn(await E.value.submitMessageFeedback({
4295
+ nn(await D.value.submitMessageFeedback({
4296
4296
  messageId: e.id,
4297
- chatId: T.value,
4297
+ chatId: E.value,
4298
4298
  agentId: o.value,
4299
4299
  vote: t,
4300
4300
  userQuestion: n,
@@ -4314,14 +4314,14 @@ function ui(e) {
4314
4314
  if (Et.value) try {
4315
4315
  Dt.value = !0, Ot.value = !1, kt.value = void 0;
4316
4316
  let { userQuestion: t, assistantMessage: n } = rn(Et.value);
4317
- nn(await E.value.submitMessageFeedback({
4317
+ nn(await D.value.submitMessageFeedback({
4318
4318
  messageId: Et.value.id,
4319
- chatId: T.value,
4319
+ chatId: E.value,
4320
4320
  agentId: o.value,
4321
4321
  userQuestion: t,
4322
4322
  assistantMessage: n,
4323
4323
  comment: e
4324
- })), Ot.value = !0, await K(T.value);
4324
+ })), Ot.value = !0, await K(E.value);
4325
4325
  } catch {
4326
4326
  kt.value = n("message.feedbackSubmitError") ? t("message.feedbackSubmitError") : "Failed to submit feedback";
4327
4327
  } finally {
@@ -4330,9 +4330,9 @@ function ui(e) {
4330
4330
  }
4331
4331
  async function Ln(e) {
4332
4332
  try {
4333
- jt.value = !0, At.value = !1, z.value = void 0, await E.value.submitLead({
4333
+ jt.value = !0, At.value = !1, z.value = void 0, await D.value.submitLead({
4334
4334
  agentId: o.value,
4335
- chatId: T.value,
4335
+ chatId: E.value,
4336
4336
  ...e
4337
4337
  }), At.value = !0;
4338
4338
  } catch {
@@ -4342,31 +4342,31 @@ function ui(e) {
4342
4342
  }
4343
4343
  }
4344
4344
  async function Rn(e, t) {
4345
- let n = await E.value.updateChatTitle(o.value, e, t);
4346
- I.value = I.value.map((t) => t.id === e ? {
4345
+ let n = await D.value.updateChatTitle(o.value, e, t);
4346
+ L.value = L.value.map((t) => t.id === e ? {
4347
4347
  ...t,
4348
4348
  title: n.title
4349
4349
  } : t);
4350
4350
  }
4351
4351
  async function zn(e) {
4352
- await E.value.deleteChat(o.value, e), I.value = I.value.filter((t) => t.id !== e), T.value === e && await wn();
4352
+ await D.value.deleteChat(o.value, e), L.value = L.value.filter((t) => t.id !== e), E.value === e && await wn();
4353
4353
  }
4354
4354
  function Bn(e) {
4355
- Tt.value = e;
4355
+ wt.value = e;
4356
4356
  }
4357
4357
  let Vn;
4358
4358
  function Hn(e) {
4359
- let t = () => E.value.getChat(o.value, e).then((e) => e !== null);
4359
+ let t = () => D.value.getChat(o.value, e).then((e) => e !== null);
4360
4360
  return t().catch(() => t().catch(() => !1));
4361
4361
  }
4362
- return S(l, async (e) => {
4362
+ return C(l, async (e) => {
4363
4363
  if (!e || e === Vn) return;
4364
4364
  let t = Vn;
4365
4365
  if (Vn = e, t === void 0) return;
4366
- let n = T.value, r = !w.value && await Hn(n);
4367
- l.value === e && T.value === n && (r ? zt(o.value) : (I.value = [], R.value = [], L.value = [], ut.value = [], j.value = [], M.value = [], N.value = {}, await wn(), B.value = ""));
4366
+ let n = E.value, r = !T.value && await Hn(n);
4367
+ l.value === e && E.value === n && (r ? zt(o.value) : (L.value = [], Tt.value = [], R.value = [], lt.value = [], M.value = [], N.value = [], P.value = {}, await wn(), B.value = ""));
4368
4368
  }), {
4369
- apiClient: E,
4369
+ apiClient: D,
4370
4370
  baseUrl: i,
4371
4371
  basePath: a,
4372
4372
  agentId: o,
@@ -4380,47 +4380,47 @@ function ui(e) {
4380
4380
  revisedAnswers: m,
4381
4381
  model: h,
4382
4382
  actionsInput: g,
4383
- actions: Be,
4383
+ actions: ze,
4384
4384
  agentFileUpload: _,
4385
4385
  agentVoice: v,
4386
- fallbackModels: ne,
4387
- gatewayOptions: ae,
4388
- externalContext: oe,
4389
- agentHostTools: se,
4390
- hostToolRegistry: me,
4391
- hostToolsPending: he,
4392
- agentPageAccess: be,
4393
- pageToolRegistry: xe,
4394
- pageFormsProvider: Ee,
4395
- pageAction: Ae,
4396
- hostStepTitles: Pe,
4397
- pageControlActive: Fe,
4386
+ fallbackModels: y,
4387
+ gatewayOptions: b,
4388
+ externalContext: te,
4389
+ agentHostTools: oe,
4390
+ hostToolRegistry: pe,
4391
+ hostToolsPending: me,
4392
+ agentPageAccess: ye,
4393
+ pageToolRegistry: be,
4394
+ pageFormsProvider: Te,
4395
+ pageAction: ke,
4396
+ hostStepTitles: Ne,
4397
+ pageControlActive: Pe,
4398
4398
  isWorking: dn,
4399
- stopHostActions: O,
4400
- pageNoticeLevel: qe,
4401
- closePageNotice: Je,
4402
- hostConfirmation: D,
4403
- respondHostConfirmation: it,
4404
- pageAccessAvailable: Ge,
4405
- pageAccessOff: He,
4406
- setPageAccessOff: ot,
4407
- systemTheme: Ie,
4408
- hideWelcomeMessage: Le,
4409
- isDark: ze,
4410
- chat: P,
4411
- messages: xt,
4412
- conversations: I,
4413
- isLoadingConversations: Ct,
4414
- chatFiles: L,
4415
- isLoadingChatFiles: wt,
4399
+ stopHostActions: k,
4400
+ pageNoticeLevel: Ke,
4401
+ closePageNotice: qe,
4402
+ hostConfirmation: O,
4403
+ respondHostConfirmation: rt,
4404
+ pageAccessAvailable: We,
4405
+ pageAccessOff: Ve,
4406
+ setPageAccessOff: at,
4407
+ systemTheme: Fe,
4408
+ hideWelcomeMessage: Ie,
4409
+ isDark: Re,
4410
+ chat: F,
4411
+ messages: bt,
4412
+ conversations: L,
4413
+ isLoadingConversations: St,
4414
+ chatFiles: R,
4415
+ isLoadingChatFiles: Ct,
4416
4416
  input: B,
4417
4417
  pendingAttachments: V,
4418
4418
  isAttachmentLimitReached: X,
4419
4419
  fileLimitError: Z,
4420
- localChatId: T,
4421
- isConversationBlocked: Xe,
4422
- inputMessagePlaceholder: St,
4423
- chatError: Ye,
4420
+ localChatId: E,
4421
+ isConversationBlocked: Ye,
4422
+ inputMessagePlaceholder: xt,
4423
+ chatError: Je,
4424
4424
  runningChatIds: pn,
4425
4425
  backgroundAnswers: bn,
4426
4426
  openBackgroundAnswer: xn,
@@ -4429,8 +4429,8 @@ function ui(e) {
4429
4429
  queuedMessages: W,
4430
4430
  removeQueuedMessage: Lt,
4431
4431
  editQueuedMessage: Rt,
4432
- activeView: Tt,
4433
- messageFeedbacks: R,
4432
+ activeView: wt,
4433
+ messageFeedbacks: Tt,
4434
4434
  feedbackDialogMessage: Et,
4435
4435
  isFeedbackSubmitting: Dt,
4436
4436
  isFeedbackSubmitted: Ot,
@@ -4438,7 +4438,7 @@ function ui(e) {
4438
4438
  isLeadSubmitted: At,
4439
4439
  isLoadingSubmitLead: jt,
4440
4440
  submitLeadError: z,
4441
- buildDeviceContext: tt,
4441
+ buildDeviceContext: et,
4442
4442
  initialize: an,
4443
4443
  loadConversations: zt,
4444
4444
  loadChatFiles: Bt,
@@ -4468,6 +4468,6 @@ function ui(e) {
4468
4468
  };
4469
4469
  })();
4470
4470
  }
4471
- export { dt as a, hr as i, ui as n, Gr as r, Kr as t };
4471
+ export { ut as a, hr as i, ui as n, Gr as r, Kr as t };
4472
4472
 
4473
- //# sourceMappingURL=useChatbotStore-D2L4m3iJ.js.map
4473
+ //# sourceMappingURL=useChatbotStore-O0u7mVit.js.map