@marimo-team/islands 0.26.1-dev27 → 0.26.1-dev29

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 (76) hide show
  1. package/dist/{ErrorBoundary-zpe6C93k.js → ErrorBoundary-CPcZlpvU.js} +1 -1
  2. package/dist/{chat-ui-DOvIzlMA.js → chat-ui-CWmSnBs8.js} +899 -899
  3. package/dist/{code-visibility-BtvMUvQ6.js → code-visibility-CHvnQsso.js} +2 -2
  4. package/dist/{common-B46KECgx.js → common-9OlCmjdr.js} +6565 -6565
  5. package/dist/{config-DL9e-OWE.js → config-1ku0tAiU.js} +27 -28
  6. package/dist/{data-grid-overlay-editor-CLCJ44fs.js → data-grid-overlay-editor-D6x_MBSD.js} +1 -1
  7. package/dist/{dropdown-menu-DYN2RV5d.js → dropdown-menu-D65ZUqka.js} +1983 -1983
  8. package/dist/{error-entries-CncQR572.js → error-entries-DFHEq_SO.js} +515 -519
  9. package/dist/{feedback-button-CnyHlwaY.js → feedback-button-CodkZ3hF.js} +19 -19
  10. package/dist/{glide-data-editor-C3znsea0.js → glide-data-editor-BZxvtSp-.js} +35 -35
  11. package/dist/{globals-DHoGn4Qt.js → globals-DFf-tSyE.js} +1 -1
  12. package/dist/{html-to-image-BU7H-AM1.js → html-to-image-D6Gtk5ik.js} +24005 -23992
  13. package/dist/main.js +864 -864
  14. package/dist/{number-overlay-editor-DwK5S3_f.js → number-overlay-editor-CfwFMv_U.js} +1 -1
  15. package/dist/{process-output-xJm8T5-E.js → process-output-ZBdibqlG.js} +2 -2
  16. package/dist/{reveal-component-Dsp5kSt3.js → reveal-component-CDfNuSFv.js} +3 -3
  17. package/dist/style.css +1 -1
  18. package/dist/{vega-component-DpTyTrz3.js → vega-component-D61CTW1X.js} +1 -1
  19. package/package.json +1 -1
  20. package/src/__mocks__/intersection-observer.ts +45 -0
  21. package/src/components/databases/engine-variable.tsx +2 -2
  22. package/src/components/dependency-graph/panels.tsx +2 -2
  23. package/src/components/editor/actions/useCellActionButton.tsx +2 -8
  24. package/src/components/editor/cell/code/__tests__/code-placeholder.test.tsx +40 -0
  25. package/src/components/editor/cell/code/cell-editor.tsx +41 -104
  26. package/src/components/editor/cell/code/code-placeholder.css +61 -11
  27. package/src/components/editor/cell/code/code-placeholder.tsx +52 -29
  28. package/src/components/editor/cell/useSplitCell.tsx +2 -2
  29. package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +6 -10
  30. package/src/components/editor/errors/auto-fix.tsx +8 -7
  31. package/src/components/editor/navigation/__tests__/navigation.test.ts +3 -12
  32. package/src/components/editor/navigation/focus-utils.ts +20 -8
  33. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +3 -11
  34. package/src/components/editor/navigation/navigation.ts +2 -2
  35. package/src/components/editor/notebook-cell.tsx +15 -24
  36. package/src/components/editor/output/MarimoTracebackOutput.tsx +2 -2
  37. package/src/components/editor/renderers/vertical-layout/__tests__/useFocusFirstEditor.test.ts +6 -9
  38. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +2 -5
  39. package/src/components/find-replace/find-replace.tsx +3 -7
  40. package/src/components/variables/__tests__/variables-table.test.tsx +1 -2
  41. package/src/core/ai/__tests__/staged-cells.test.ts +6 -39
  42. package/src/core/ai/staged-cells.ts +2 -20
  43. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +15 -13
  44. package/src/core/ai/tools/edit-notebook-tool.ts +13 -8
  45. package/src/core/cells/__tests__/cell-editor-view.test.ts +44 -0
  46. package/src/core/cells/__tests__/cells.test.ts +0 -1
  47. package/src/core/cells/__tests__/focus.test.ts +1 -7
  48. package/src/core/cells/__tests__/harness.ts +0 -1
  49. package/src/core/cells/cells.ts +15 -10
  50. package/src/core/cells/focus.ts +1 -1
  51. package/src/core/cells/scrollCellIntoView.ts +4 -14
  52. package/src/core/cells/utils.ts +0 -13
  53. package/src/core/codemirror/__tests__/cell-documents.test.ts +79 -0
  54. package/src/core/codemirror/__tests__/editor-mount-scheduler.test.ts +75 -105
  55. package/src/core/codemirror/__tests__/format.test.ts +85 -63
  56. package/src/core/codemirror/__tests__/use-lazy-editor-mount.test.tsx +193 -0
  57. package/src/core/codemirror/cell-documents.ts +132 -0
  58. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +0 -1
  59. package/src/core/codemirror/copilot/getCodes.ts +3 -14
  60. package/src/core/codemirror/editor-mount-scheduler.ts +41 -48
  61. package/src/core/codemirror/extensions.ts +2 -2
  62. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -16
  63. package/src/core/codemirror/find-replace/__tests__/search-highlight.test.ts +30 -0
  64. package/src/core/codemirror/find-replace/__tests__/unmounted-cells.test.ts +145 -0
  65. package/src/core/codemirror/find-replace/navigate.ts +88 -129
  66. package/src/core/codemirror/find-replace/search-highlight.ts +3 -1
  67. package/src/core/codemirror/find-replace/state.ts +7 -2
  68. package/src/core/codemirror/format.ts +25 -31
  69. package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +8 -9
  70. package/src/core/codemirror/language/cell-code.ts +7 -0
  71. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +25 -0
  72. package/src/core/codemirror/lsp/notebook-lsp.ts +6 -16
  73. package/src/core/codemirror/use-lazy-editor-mount.ts +67 -0
  74. package/src/core/codemirror/utils.ts +2 -6
  75. package/src/utils/__tests__/shared-intersection-observer.test.ts +49 -0
  76. package/src/utils/shared-intersection-observer.ts +53 -0
@@ -3,27 +3,27 @@ import { g as n, h as r, r as i, t as a } from "./button-Z2R2272J.js";
3
3
  import { t as o } from "./react-Bgs_wQh3.js";
4
4
  import { t as s } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { i as c, t as l } from "./copy-icon-rYV2znAe.js";
6
- import { At as u, Bt as d, Dt as f, Et as p, Ft as m, Ht as h, J as g, Lt as _, M as v, Ot as y, Pt as b, Rt as x, U as S, V as C, W as w, Y as T, a as E, dt as D, et as O, f as k, g as A, h as j, ht as M, l as N, m as P, n as ee, nt as te, p as F, r as ne, st as re, t as ie, tt as ae, u as oe, v as se, wt as ce, xt as le } from "./html-to-image-BU7H-AM1.js";
7
- import { h as I, t as ue } from "./tooltip-DSWC_Td_.js";
8
- import { d as de } from "./select-CKLRKIzB.js";
9
- import { Cn as fe, _ as pe, f as me, h as he, i as ge, n as _e, t as ve, xn as ye } from "./dropdown-menu-DYN2RV5d.js";
10
- import { a as be, l as xe } from "./config-DL9e-OWE.js";
11
- import { F as Se, G as Ce, M as we, Tt as Te, Vt as Ee, g as De, i as Oe, in as ke, kt as Ae, r as je, t as Me, yt as Ne } from "./error-entries-CncQR572.js";
12
- import { c as Pe, d as Fe, l as Ie, n as Le, t as Re, u as ze } from "./process-output-xJm8T5-E.js";
13
- import { t as Be } from "./pencil-AWgwbH4D.js";
14
- import { n as Ve, r as He, s as Ue } from "./assertNever-BHnIohkX.js";
15
- import { t as We } from "./jsx-runtime-D8btoEHk.js";
16
- import { Bt as Ge, G as Ke, Ht as qe, J as Je, K as Ye, W as Xe, X as Ze, Y as Qe, Z as $e, at as et, ct as tt, d as nt, et as rt, ft as it, g as at, gt as ot, it as st, mt as ct, nt as lt, ot as ut, pt as dt, q as ft, tt as pt, ut as mt } from "./use-restore-focus-ocw7t85i.js";
17
- import { n as ht } from "./error-banner-D-AC7pQx.js";
18
- import { t as gt } from "./isEmpty-CdX7MTE1.js";
19
- import { t as _t } from "./objects-DCmMvZtn.js";
20
- import { t as vt } from "./useEvent-BoN7U38T.js";
21
- import { At as yt, B as bt, Ct as xt, Dt as St, G as Ct, H as wt, Ot as Tt, W as Et, bt as Dt, it as Ot, rt as kt, xt as At } from "./dist-BIaGGUbU.js";
22
- import { n as jt, o as Mt, r as Nt } from "./dist-m0MWV-aw.js";
23
- import { n as Pt } from "./dist-CQfpgadU.js";
24
- import { n as Ft, t as It } from "./esm-Dw2ZydG_.js";
25
- import { t as Lt } from "./useAsyncData-P5-Oovhq.js";
26
- var Rt = I("ban", [["circle", {
6
+ import { $ as u, At as d, Bt as f, Dt as p, Et as m, Ft as h, Ht as g, Lt as _, M as v, Ot as y, Pt as b, Q as x, Rt as S, St as C, U as w, V as T, W as E, a as D, dt as O, et as ee, f as k, g as A, h as j, ht as te, l as M, m as ne, n as re, p as N, q as ie, r as ae, rt as oe, st as se, t as ce, u as le, v as ue, wt as de } from "./html-to-image-D6Gtk5ik.js";
7
+ import { h as P, t as fe } from "./tooltip-DSWC_Td_.js";
8
+ import { d as pe } from "./select-CKLRKIzB.js";
9
+ import { Cn as me, f as he, g as ge, i as _e, n as ve, t as ye, v as be, xn as xe } from "./dropdown-menu-D65ZUqka.js";
10
+ import { i as Se, l as Ce } from "./config-1ku0tAiU.js";
11
+ import { F as we, J as Te, R as Ee, Tt as De, Vt as Oe, h as ke, i as Ae, in as je, kt as Me, r as Ne, t as Pe, yt as Fe } from "./error-entries-DFHEq_SO.js";
12
+ import { c as Ie, d as Le, l as Re, n as ze, t as Be, u as Ve } from "./process-output-ZBdibqlG.js";
13
+ import { t as He } from "./pencil-AWgwbH4D.js";
14
+ import { n as Ue, r as We, s as Ge } from "./assertNever-BHnIohkX.js";
15
+ import { t as Ke } from "./jsx-runtime-D8btoEHk.js";
16
+ import { Bt as qe, G as Je, Ht as Ye, J as Xe, K as Ze, W as Qe, X as $e, Y as et, Z as tt, at as nt, ct as rt, d as it, et as at, ft as ot, g as st, gt as ct, it as lt, mt as ut, nt as dt, ot as ft, pt, q as mt, tt as ht, ut as gt } from "./use-restore-focus-ocw7t85i.js";
17
+ import { n as _t } from "./error-banner-D-AC7pQx.js";
18
+ import { t as vt } from "./isEmpty-CdX7MTE1.js";
19
+ import { t as yt } from "./objects-DCmMvZtn.js";
20
+ import { t as bt } from "./useEvent-BoN7U38T.js";
21
+ import { At as xt, B as St, Ct, Dt as wt, G as Tt, H as Et, Ot as Dt, W as Ot, bt as kt, it as At, rt as jt, xt as Mt } from "./dist-BIaGGUbU.js";
22
+ import { n as Nt, o as Pt, r as Ft } from "./dist-m0MWV-aw.js";
23
+ import { n as It, t as Lt } from "./esm-Dw2ZydG_.js";
24
+ import { n as Rt } from "./dist-CQfpgadU.js";
25
+ import { t as zt } from "./useAsyncData-P5-Oovhq.js";
26
+ var Bt = P("ban", [["circle", {
27
27
  cx: "12",
28
28
  cy: "12",
29
29
  r: "10",
@@ -31,13 +31,13 @@ var Rt = I("ban", [["circle", {
31
31
  }], ["path", {
32
32
  d: "M4.929 4.929 19.07 19.071",
33
33
  key: "196cmz"
34
- }]]), zt = I("book-open", [["path", {
34
+ }]]), Vt = P("book-open", [["path", {
35
35
  d: "M12 7v14",
36
36
  key: "1akyts"
37
37
  }], ["path", {
38
38
  d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
39
39
  key: "ruj8y"
40
- }]]), Bt = I("bot-message-square", [
40
+ }]]), Ht = P("bot-message-square", [
41
41
  ["path", {
42
42
  d: "M12 6V2H8",
43
43
  key: "1155em"
@@ -62,7 +62,7 @@ var Rt = I("ban", [["circle", {
62
62
  d: "M9 11v2",
63
63
  key: "1ueba0"
64
64
  }]
65
- ]), Vt = I("brain", [
65
+ ]), Ut = P("brain", [
66
66
  ["path", {
67
67
  d: "M12 18V5",
68
68
  key: "adv99a"
@@ -95,7 +95,7 @@ var Rt = I("ban", [["circle", {
95
95
  d: "M6.003 5.125a4 4 0 0 0-2.526 5.77",
96
96
  key: "q97ue3"
97
97
  }]
98
- ]), Ht = I("bug", [
98
+ ]), Wt = P("bug", [
99
99
  ["path", {
100
100
  d: "M12 20v-9",
101
101
  key: "1qisl0"
@@ -140,7 +140,7 @@ var Rt = I("ban", [["circle", {
140
140
  d: "M9 7.13V6a3 3 0 1 1 6 0v1.13",
141
141
  key: "1vgav8"
142
142
  }]
143
- ]), Ut = I("circle-slash", [["circle", {
143
+ ]), Gt = P("circle-slash", [["circle", {
144
144
  cx: "12",
145
145
  cy: "12",
146
146
  r: "10",
@@ -151,7 +151,7 @@ var Rt = I("ban", [["circle", {
151
151
  y1: "15",
152
152
  y2: "9",
153
153
  key: "1dfufj"
154
- }]]), Wt = I("file-search", [
154
+ }]]), Kt = P("file-search", [
155
155
  ["path", {
156
156
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
157
157
  key: "1oefj6"
@@ -170,7 +170,7 @@ var Rt = I("ban", [["circle", {
170
170
  d: "M13.3 16.3 15 18",
171
171
  key: "2quom7"
172
172
  }]
173
- ]), Gt = I("list-checks", [
173
+ ]), qt = P("list-checks", [
174
174
  ["path", {
175
175
  d: "M13 5h8",
176
176
  key: "a7qcls"
@@ -191,7 +191,7 @@ var Rt = I("ban", [["circle", {
191
191
  d: "m3 7 2 2 4-4",
192
192
  key: "1obspn"
193
193
  }]
194
- ]), Kt = I("notebook", [
194
+ ]), Jt = P("notebook", [
195
195
  ["path", {
196
196
  d: "M2 6h4",
197
197
  key: "aawbzj"
@@ -220,16 +220,16 @@ var Rt = I("ban", [["circle", {
220
220
  d: "M16 2v20",
221
221
  key: "rotuqe"
222
222
  }]
223
- ]), qt = I("paperclip", [["path", {
223
+ ]), Yt = P("paperclip", [["path", {
224
224
  d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
225
225
  key: "1miecu"
226
- }]]), Jt = I("rotate-cw", [["path", {
226
+ }]]), Xt = P("rotate-cw", [["path", {
227
227
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
228
228
  key: "1p45f6"
229
229
  }], ["path", {
230
230
  d: "M21 3v5h-5",
231
231
  key: "1q7to0"
232
- }]]), Yt = I("scan-search", [
232
+ }]]), Zt = P("scan-search", [
233
233
  ["path", {
234
234
  d: "M3 7V5a2 2 0 0 1 2-2h2",
235
235
  key: "aa7l1z"
@@ -256,13 +256,13 @@ var Rt = I("ban", [["circle", {
256
256
  d: "m16 16-1.9-1.9",
257
257
  key: "1dq9hf"
258
258
  }]
259
- ]), Xt = I("send-horizontal", [["path", {
259
+ ]), Qt = P("send-horizontal", [["path", {
260
260
  d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
261
261
  key: "117uat"
262
262
  }], ["path", {
263
263
  d: "M6 12h16",
264
264
  key: "s4cdu5"
265
- }]]), Zt = I("settings", [["path", {
265
+ }]]), $t = P("settings", [["path", {
266
266
  d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
267
267
  key: "1i5ecw"
268
268
  }], ["circle", {
@@ -270,7 +270,7 @@ var Rt = I("ban", [["circle", {
270
270
  cy: "12",
271
271
  r: "3",
272
272
  key: "1v7zrd"
273
- }]]), Qt = I("shield-question-mark", [
273
+ }]]), en = P("shield-question-mark", [
274
274
  ["path", {
275
275
  d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
276
276
  key: "oel41y"
@@ -283,65 +283,65 @@ var Rt = I("ban", [["circle", {
283
283
  d: "M12 17h.01",
284
284
  key: "p32p05"
285
285
  }]
286
- ]), L = s(), $t = "vercel.ai.error", en = Symbol.for($t), R = class e extends Error {
286
+ ]), F = s(), tn = "vercel.ai.error", nn = Symbol.for(tn), I = class e extends Error {
287
287
  constructor({ name: e, message: t, cause: n }) {
288
- super(t), this[en] = !0, this.name = e, this.cause = n;
288
+ super(t), this[nn] = !0, this.name = e, this.cause = n;
289
289
  }
290
290
  static isInstance(t) {
291
- return e.hasMarker(t, $t);
291
+ return e.hasMarker(t, tn);
292
292
  }
293
293
  static hasMarker(e, t) {
294
294
  let n = Symbol.for(t);
295
295
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
296
296
  }
297
- }, tn = "AI_APICallError", nn = `vercel.ai.error.${tn}`, rn = Symbol.for(nn), an = class extends R {
297
+ }, rn = "AI_APICallError", an = `vercel.ai.error.${rn}`, on = Symbol.for(an), sn = class extends I {
298
298
  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 }) {
299
299
  super({
300
- name: tn,
300
+ name: rn,
301
301
  message: e,
302
302
  cause: o
303
- }), this[rn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
303
+ }), this[on] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
304
304
  }
305
305
  static isInstance(e) {
306
- return R.hasMarker(e, nn);
306
+ return I.hasMarker(e, an);
307
307
  }
308
- }, on = "AI_EmptyResponseBodyError", sn = `vercel.ai.error.${on}`, cn = Symbol.for(sn), ln = class extends R {
308
+ }, cn = "AI_EmptyResponseBodyError", ln = `vercel.ai.error.${cn}`, un = Symbol.for(ln), dn = class extends I {
309
309
  constructor({ message: e = "Empty response body" } = {}) {
310
310
  super({
311
- name: on,
311
+ name: cn,
312
312
  message: e
313
- }), this[cn] = !0;
313
+ }), this[un] = !0;
314
314
  }
315
315
  static isInstance(e) {
316
- return R.hasMarker(e, sn);
316
+ return I.hasMarker(e, ln);
317
317
  }
318
318
  };
319
- function un(e) {
319
+ function fn(e) {
320
320
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
321
321
  }
322
- var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn = class extends R {
322
+ var pn = "AI_InvalidArgumentError", mn = `vercel.ai.error.${pn}`, hn = Symbol.for(mn), gn = class extends I {
323
323
  constructor({ message: e, cause: t, argument: n }) {
324
324
  super({
325
- name: dn,
325
+ name: pn,
326
326
  message: e,
327
327
  cause: t
328
- }), this[pn] = !0, this.argument = n;
328
+ }), this[hn] = !0, this.argument = n;
329
329
  }
330
330
  static isInstance(e) {
331
- return R.hasMarker(e, fn);
331
+ return I.hasMarker(e, mn);
332
332
  }
333
- }, hn = "AI_JSONParseError", gn = `vercel.ai.error.${hn}`, _n = Symbol.for(gn), vn = class extends R {
333
+ }, _n = "AI_JSONParseError", vn = `vercel.ai.error.${_n}`, yn = Symbol.for(vn), bn = class extends I {
334
334
  constructor({ text: e, cause: t }) {
335
335
  super({
336
- name: hn,
337
- message: `JSON parsing failed: Text: ${e}.\nError message: ${un(t)}`,
336
+ name: _n,
337
+ message: `JSON parsing failed: Text: ${e}.\nError message: ${fn(t)}`,
338
338
  cause: t
339
- }), this[_n] = !0, this.text = e;
339
+ }), this[yn] = !0, this.text = e;
340
340
  }
341
341
  static isInstance(e) {
342
- return R.hasMarker(e, gn);
342
+ return I.hasMarker(e, vn);
343
343
  }
344
- }, yn = "AI_TypeValidationError", bn = `vercel.ai.error.${yn}`, xn = Symbol.for(bn), Sn = class e extends R {
344
+ }, xn = "AI_TypeValidationError", Sn = `vercel.ai.error.${xn}`, Cn = Symbol.for(Sn), wn = class e extends I {
345
345
  constructor({ value: e, cause: t, context: n }) {
346
346
  let r = "Type validation failed";
347
347
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -350,13 +350,13 @@ var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.fo
350
350
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
351
351
  }
352
352
  super({
353
- name: yn,
354
- message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${un(t)}`,
353
+ name: xn,
354
+ message: `${r}: Value: ${JSON.stringify(e)}.\nError message: ${fn(t)}`,
355
355
  cause: t
356
- }), this[xn] = !0, this.value = e, this.context = n;
356
+ }), this[Cn] = !0, this.value = e, this.context = n;
357
357
  }
358
358
  static isInstance(e) {
359
- return R.hasMarker(e, bn);
359
+ return I.hasMarker(e, Sn);
360
360
  }
361
361
  static wrap({ value: t, cause: n, context: r }) {
362
362
  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({
@@ -365,25 +365,25 @@ var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.fo
365
365
  context: r
366
366
  });
367
367
  }
368
- }, Cn = "AI_UnsupportedFunctionalityError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En = class extends R {
368
+ }, Tn = "AI_UnsupportedFunctionalityError", En = `vercel.ai.error.${Tn}`, Dn = Symbol.for(En), On = class extends I {
369
369
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
370
370
  super({
371
- name: Cn,
371
+ name: Tn,
372
372
  message: t
373
- }), this[Tn] = !0, this.functionality = e;
373
+ }), this[Dn] = !0, this.functionality = e;
374
374
  }
375
375
  static isInstance(e) {
376
- return R.hasMarker(e, wn);
376
+ return I.hasMarker(e, En);
377
377
  }
378
- }, Dn = class extends Error {
378
+ }, kn = class extends Error {
379
379
  constructor(e, t) {
380
380
  super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
381
381
  }
382
- }, On = 10, kn = 13, z = 32;
383
- function An(e) {}
384
- function jn(e) {
382
+ }, An = 10, jn = 13, L = 32;
383
+ function Mn(e) {}
384
+ function Nn(e) {
385
385
  if (typeof e == "function") throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");
386
- let { onEvent: t = An, onError: n = An, onRetry: r = An, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
386
+ let { onEvent: t = Mn, onError: n = Mn, onRetry: r = Mn, onComment: i, maxBufferSize: a } = e, o = [], s = 0, c = !0, l, u = "", d = 0, f, p = !1;
387
387
  function m(e) {
388
388
  if (p) throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");
389
389
  if (c && (c = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), o.length === 0) {
@@ -402,7 +402,7 @@ function jn(e) {
402
402
  n !== "" && (o.push(n), s = n.length), h();
403
403
  }
404
404
  function h() {
405
- 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 Dn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
405
+ 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 kn(`Buffered data exceeded max buffer size of ${a} characters`, { type: "max-buffer-size-exceeded" }))));
406
406
  }
407
407
  function g(e) {
408
408
  let n = 0;
@@ -418,9 +418,9 @@ function jn(e) {
418
418
  continue;
419
419
  }
420
420
  let i = e.charCodeAt(n);
421
- if (Mn(e, n, i)) {
422
- let i = e.charCodeAt(n + 5) === z ? n + 6 : n + 5, a = e.slice(i, r);
423
- if (d === 0 && e.charCodeAt(r + 1) === On) {
421
+ if (Pn(e, n, i)) {
422
+ let i = e.charCodeAt(n + 5) === L ? n + 6 : n + 5, a = e.slice(i, r);
423
+ if (d === 0 && e.charCodeAt(r + 1) === An) {
424
424
  t({
425
425
  id: l,
426
426
  event: f,
@@ -430,7 +430,7 @@ function jn(e) {
430
430
  }
431
431
  u = d === 0 ? a : `${u}
432
432
  ${a}`, d++;
433
- } else Nn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === z ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
433
+ } else Fn(e, n, i) ? f = e.slice(e.charCodeAt(n + 6) === L ? n + 7 : n + 6, r) || void 0 : _(e, n, r);
434
434
  n = r + 1, r = e.indexOf("\n", n);
435
435
  }
436
436
  return e.slice(n);
@@ -438,7 +438,7 @@ ${a}`, d++;
438
438
  for (; n < e.length;) {
439
439
  let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
440
440
  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;
441
- _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === kn && e.charCodeAt(n) === On && n++;
441
+ _(e, n, i), n = i + 1, e.charCodeAt(n - 1) === jn && e.charCodeAt(n) === An && n++;
442
442
  }
443
443
  return e.slice(n);
444
444
  }
@@ -448,25 +448,25 @@ ${a}`, d++;
448
448
  return;
449
449
  }
450
450
  let r = e.charCodeAt(t);
451
- if (Mn(e, t, r)) {
452
- let r = e.charCodeAt(t + 5) === z ? t + 6 : t + 5, i = e.slice(r, n);
451
+ if (Pn(e, t, r)) {
452
+ let r = e.charCodeAt(t + 5) === L ? t + 6 : t + 5, i = e.slice(r, n);
453
453
  u = d === 0 ? i : `${u}
454
454
  ${i}`, d++;
455
455
  return;
456
456
  }
457
- if (Nn(e, t, r)) {
458
- f = e.slice(e.charCodeAt(t + 6) === z ? t + 7 : t + 6, n) || void 0;
457
+ if (Fn(e, t, r)) {
458
+ f = e.slice(e.charCodeAt(t + 6) === L ? t + 7 : t + 6, n) || void 0;
459
459
  return;
460
460
  }
461
461
  if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
462
- let r = e.slice(e.charCodeAt(t + 3) === z ? t + 4 : t + 3, n);
462
+ let r = e.slice(e.charCodeAt(t + 3) === L ? t + 4 : t + 3, n);
463
463
  l = r.includes("\0") ? void 0 : r;
464
464
  return;
465
465
  }
466
466
  if (r === 58) {
467
467
  if (i) {
468
468
  let r = e.slice(t, n);
469
- i(r.slice(e.charCodeAt(t + 1) === z ? 2 : 1));
469
+ i(r.slice(e.charCodeAt(t + 1) === L ? 2 : 1));
470
470
  }
471
471
  return;
472
472
  }
@@ -475,7 +475,7 @@ ${i}`, d++;
475
475
  v(a, "", a);
476
476
  return;
477
477
  }
478
- let s = a.slice(0, o), c = a.charCodeAt(o + 1) === z ? 2 : 1;
478
+ let s = a.slice(0, o), c = a.charCodeAt(o + 1) === L ? 2 : 1;
479
479
  v(s, a.slice(o + c), a);
480
480
  }
481
481
  function v(e, t, i) {
@@ -491,13 +491,13 @@ ${t}`, d++;
491
491
  l = t.includes("\0") ? void 0 : t;
492
492
  break;
493
493
  case "retry":
494
- /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Dn(`Invalid \`retry\` value: "${t}"`, {
494
+ /^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new kn(`Invalid \`retry\` value: "${t}"`, {
495
495
  type: "invalid-retry",
496
496
  value: t,
497
497
  line: i
498
498
  }));
499
499
  break;
500
- default: n(new Dn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
500
+ default: n(new kn(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
501
501
  type: "unknown-field",
502
502
  field: e,
503
503
  value: t,
@@ -524,20 +524,20 @@ ${t}`, d++;
524
524
  reset: b
525
525
  };
526
526
  }
527
- function Mn(e, t, n) {
527
+ function Pn(e, t, n) {
528
528
  return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
529
529
  }
530
- function Nn(e, t, n) {
530
+ function Fn(e, t, n) {
531
531
  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;
532
532
  }
533
533
  //#endregion
534
534
  //#region ../node_modules/.pnpm/eventsource-parser@3.1.0/node_modules/eventsource-parser/dist/stream.js
535
- var Pn = class extends TransformStream {
535
+ var In = class extends TransformStream {
536
536
  constructor({ onError: e, onRetry: t, onComment: n, maxBufferSize: r } = {}) {
537
537
  let i;
538
538
  super({
539
539
  start(a) {
540
- i = jn({
540
+ i = Nn({
541
541
  onEvent: (e) => {
542
542
  a.enqueue(e);
543
543
  },
@@ -556,8 +556,8 @@ var Pn = class extends TransformStream {
556
556
  }
557
557
  };
558
558
  new TextDecoder();
559
- var { btoa: Fn, atob: In } = globalThis;
560
- function Ln(e) {
559
+ var { btoa: Ln, atob: Rn } = globalThis;
560
+ function zn(e) {
561
561
  if (e == null) return {};
562
562
  let t = {};
563
563
  if (e instanceof Headers) e.forEach((e, n) => {
@@ -569,28 +569,28 @@ function Ln(e) {
569
569
  }
570
570
  return t;
571
571
  }
572
- var B = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
572
+ var R = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
573
573
  let i = () => {
574
574
  let e = n.length, r = Array(t);
575
575
  for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
576
576
  return r.join("");
577
577
  };
578
578
  if (e == null) return i;
579
- if (n.includes(r)) throw new mn({
579
+ if (n.includes(r)) throw new gn({
580
580
  argument: "separator",
581
581
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
582
582
  });
583
583
  return () => `${e}${r}${i()}`;
584
- }, Rn = B();
585
- function zn(e) {
584
+ }, Bn = R();
585
+ function Vn(e) {
586
586
  return globalThis.Buffer?.isBuffer(e) ?? !1;
587
587
  }
588
- var Bn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Vn = /"(?: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*:/;
589
- function Hn(e) {
588
+ var Hn = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, Un = /"(?: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*:/;
589
+ function Wn(e) {
590
590
  let t = JSON.parse(e);
591
- return typeof t != "object" || !t || Bn.test(e) === !1 && Vn.test(e) === !1 ? t : Un(t);
591
+ return typeof t != "object" || !t || Hn.test(e) === !1 && Un.test(e) === !1 ? t : Gn(t);
592
592
  }
593
- function Un(e) {
593
+ function Gn(e) {
594
594
  let t = [e];
595
595
  for (; t.length;) {
596
596
  let e = t;
@@ -605,35 +605,35 @@ function Un(e) {
605
605
  }
606
606
  return e;
607
607
  }
608
- function Wn(e) {
608
+ function Kn(e) {
609
609
  let { stackTraceLimit: t } = Error;
610
610
  try {
611
611
  Error.stackTraceLimit = 0;
612
612
  } catch {
613
- return Hn(e);
613
+ return Wn(e);
614
614
  }
615
615
  try {
616
- return Hn(e);
616
+ return Wn(e);
617
617
  } finally {
618
618
  Error.stackTraceLimit = t;
619
619
  }
620
620
  }
621
- function Gn(e) {
621
+ function qn(e) {
622
622
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
623
623
  let { additionalProperties: t } = e;
624
- e.additionalProperties = t != null && typeof t != "boolean" && V(t);
624
+ e.additionalProperties = t != null && typeof t != "boolean" && z(t);
625
625
  let { properties: n } = e;
626
- if (n != null) for (let e of Object.keys(n)) n[e] = V(n[e]);
626
+ if (n != null) for (let e of Object.keys(n)) n[e] = z(n[e]);
627
627
  }
628
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(V) : V(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(V)), e.allOf != null && (e.allOf = e.allOf.map(V)), e.oneOf != null && (e.oneOf = e.oneOf.map(V));
628
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(z) : z(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(z)), e.allOf != null && (e.allOf = e.allOf.map(z)), e.oneOf != null && (e.oneOf = e.oneOf.map(z));
629
629
  let { definitions: t } = e;
630
- if (t != null) for (let e of Object.keys(t)) t[e] = V(t[e]);
630
+ if (t != null) for (let e of Object.keys(t)) t[e] = z(t[e]);
631
631
  return e;
632
632
  }
633
- function V(e) {
634
- return typeof e == "boolean" ? e : Gn(e);
633
+ function z(e) {
634
+ return typeof e == "boolean" ? e : qn(e);
635
635
  }
636
- var Kn = Symbol("Let zodToJsonSchema decide on which parser to use"), qn = {
636
+ var Jn = Symbol("Let zodToJsonSchema decide on which parser to use"), Yn = {
637
637
  name: void 0,
638
638
  $refStrategy: "root",
639
639
  basePath: ["#"],
@@ -653,24 +653,24 @@ var Kn = Symbol("Let zodToJsonSchema decide on which parser to use"), qn = {
653
653
  emailStrategy: "format:email",
654
654
  base64Strategy: "contentEncoding:base64",
655
655
  nameStrategy: "ref"
656
- }, Jn = (e) => typeof e == "string" ? {
657
- ...qn,
656
+ }, Xn = (e) => typeof e == "string" ? {
657
+ ...Yn,
658
658
  name: e
659
659
  } : {
660
- ...qn,
660
+ ...Yn,
661
661
  ...e
662
662
  };
663
- function H() {
663
+ function B() {
664
664
  return {};
665
665
  }
666
- function Yn(e, t) {
666
+ function Zn(e, t) {
667
667
  let n = { type: "array" };
668
- return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = K(e.type._def, {
668
+ return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = W(e.type._def, {
669
669
  ...t,
670
670
  currentPath: [...t.currentPath, "items"]
671
671
  })), 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;
672
672
  }
673
- function Xn(e) {
673
+ function Qn(e) {
674
674
  let t = {
675
675
  type: "integer",
676
676
  format: "int64"
@@ -687,16 +687,16 @@ function Xn(e) {
687
687
  }
688
688
  return t;
689
689
  }
690
- function Zn() {
690
+ function $n() {
691
691
  return { type: "boolean" };
692
692
  }
693
- function Qn(e, t) {
694
- return K(e.type._def, t);
693
+ function er(e, t) {
694
+ return W(e.type._def, t);
695
695
  }
696
- var $n = (e, t) => K(e.innerType._def, t);
697
- function er(e, t, n) {
696
+ var tr = (e, t) => W(e.innerType._def, t);
697
+ function nr(e, t, n) {
698
698
  let r = n ?? t.dateStrategy;
699
- if (Array.isArray(r)) return { anyOf: r.map((n) => er(e, t, n)) };
699
+ if (Array.isArray(r)) return { anyOf: r.map((n) => nr(e, t, n)) };
700
700
  switch (r) {
701
701
  case "string":
702
702
  case "format:date-time": return {
@@ -707,10 +707,10 @@ function er(e, t, n) {
707
707
  type: "string",
708
708
  format: "date"
709
709
  };
710
- case "integer": return tr(e);
710
+ case "integer": return rr(e);
711
711
  }
712
712
  }
713
- var tr = (e) => {
713
+ var rr = (e) => {
714
714
  let t = {
715
715
  type: "integer",
716
716
  format: "unix-time"
@@ -723,31 +723,31 @@ var tr = (e) => {
723
723
  }
724
724
  return t;
725
725
  };
726
- function nr(e, t) {
726
+ function ir(e, t) {
727
727
  return {
728
- ...K(e.innerType._def, t),
728
+ ...W(e.innerType._def, t),
729
729
  default: e.defaultValue()
730
730
  };
731
731
  }
732
- function rr(e, t) {
733
- return t.effectStrategy === "input" ? K(e.schema._def, t) : H();
732
+ function ar(e, t) {
733
+ return t.effectStrategy === "input" ? W(e.schema._def, t) : B();
734
734
  }
735
- function ir(e) {
735
+ function or(e) {
736
736
  return {
737
737
  type: "string",
738
738
  enum: Array.from(e.values)
739
739
  };
740
740
  }
741
- var ar = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
742
- function or(e, t) {
743
- let n = [K(e.left._def, {
741
+ var sr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
742
+ function cr(e, t) {
743
+ let n = [W(e.left._def, {
744
744
  ...t,
745
745
  currentPath: [
746
746
  ...t.currentPath,
747
747
  "allOf",
748
748
  "0"
749
749
  ]
750
- }), K(e.right._def, {
750
+ }), W(e.right._def, {
751
751
  ...t,
752
752
  currentPath: [
753
753
  ...t.currentPath,
@@ -756,7 +756,7 @@ function or(e, t) {
756
756
  ]
757
757
  })].filter((e) => !!e), r = [];
758
758
  return n.forEach((e) => {
759
- if (ar(e)) r.push(...e.allOf);
759
+ if (sr(e)) r.push(...e.allOf);
760
760
  else {
761
761
  let t = e;
762
762
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -767,19 +767,19 @@ function or(e, t) {
767
767
  }
768
768
  }), r.length ? { allOf: r } : void 0;
769
769
  }
770
- function sr(e) {
770
+ function lr(e) {
771
771
  let t = typeof e.value;
772
772
  return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
773
773
  type: t === "bigint" ? "integer" : t,
774
774
  const: e.value
775
775
  };
776
776
  }
777
- var cr = void 0, U = {
777
+ var ur = void 0, V = {
778
778
  cuid: /^[cC][^\s-]{8,}$/,
779
779
  cuid2: /^[0-9a-z]+$/,
780
780
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
781
781
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
782
- emoji: () => (cr === void 0 && (cr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), cr),
782
+ emoji: () => (ur === void 0 && (ur = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), ur),
783
783
  uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
784
784
  ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
785
785
  ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
@@ -790,7 +790,7 @@ var cr = void 0, U = {
790
790
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
791
791
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
792
792
  };
793
- function lr(e, t) {
793
+ function dr(e, t) {
794
794
  let n = { type: "string" };
795
795
  if (e.checks) for (let r of e.checks) switch (r.kind) {
796
796
  case "min":
@@ -802,108 +802,108 @@ function lr(e, t) {
802
802
  case "email":
803
803
  switch (t.emailStrategy) {
804
804
  case "format:email":
805
- W(n, "email", r.message, t);
805
+ H(n, "email", r.message, t);
806
806
  break;
807
807
  case "format:idn-email":
808
- W(n, "idn-email", r.message, t);
808
+ H(n, "idn-email", r.message, t);
809
809
  break;
810
- case "pattern:zod": G(n, U.email, r.message, t);
810
+ case "pattern:zod": U(n, V.email, r.message, t);
811
811
  }
812
812
  break;
813
813
  case "url":
814
- W(n, "uri", r.message, t);
814
+ H(n, "uri", r.message, t);
815
815
  break;
816
816
  case "uuid":
817
- W(n, "uuid", r.message, t);
817
+ H(n, "uuid", r.message, t);
818
818
  break;
819
819
  case "regex":
820
- G(n, r.regex, r.message, t);
820
+ U(n, r.regex, r.message, t);
821
821
  break;
822
822
  case "cuid":
823
- G(n, U.cuid, r.message, t);
823
+ U(n, V.cuid, r.message, t);
824
824
  break;
825
825
  case "cuid2":
826
- G(n, U.cuid2, r.message, t);
826
+ U(n, V.cuid2, r.message, t);
827
827
  break;
828
828
  case "startsWith":
829
- G(n, RegExp(`^${ur(r.value, t)}`), r.message, t);
829
+ U(n, RegExp(`^${fr(r.value, t)}`), r.message, t);
830
830
  break;
831
831
  case "endsWith":
832
- G(n, RegExp(`${ur(r.value, t)}$`), r.message, t);
832
+ U(n, RegExp(`${fr(r.value, t)}$`), r.message, t);
833
833
  break;
834
834
  case "datetime":
835
- W(n, "date-time", r.message, t);
835
+ H(n, "date-time", r.message, t);
836
836
  break;
837
837
  case "date":
838
- W(n, "date", r.message, t);
838
+ H(n, "date", r.message, t);
839
839
  break;
840
840
  case "time":
841
- W(n, "time", r.message, t);
841
+ H(n, "time", r.message, t);
842
842
  break;
843
843
  case "duration":
844
- W(n, "duration", r.message, t);
844
+ H(n, "duration", r.message, t);
845
845
  break;
846
846
  case "length":
847
847
  n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
848
848
  break;
849
849
  case "includes":
850
- G(n, RegExp(ur(r.value, t)), r.message, t);
850
+ U(n, RegExp(fr(r.value, t)), r.message, t);
851
851
  break;
852
852
  case "ip":
853
- r.version !== "v6" && W(n, "ipv4", r.message, t), r.version !== "v4" && W(n, "ipv6", r.message, t);
853
+ r.version !== "v6" && H(n, "ipv4", r.message, t), r.version !== "v4" && H(n, "ipv6", r.message, t);
854
854
  break;
855
855
  case "base64url":
856
- G(n, U.base64url, r.message, t);
856
+ U(n, V.base64url, r.message, t);
857
857
  break;
858
858
  case "jwt":
859
- G(n, U.jwt, r.message, t);
859
+ U(n, V.jwt, r.message, t);
860
860
  break;
861
861
  case "cidr":
862
- r.version !== "v6" && G(n, U.ipv4Cidr, r.message, t), r.version !== "v4" && G(n, U.ipv6Cidr, r.message, t);
862
+ r.version !== "v6" && U(n, V.ipv4Cidr, r.message, t), r.version !== "v4" && U(n, V.ipv6Cidr, r.message, t);
863
863
  break;
864
864
  case "emoji":
865
- G(n, U.emoji(), r.message, t);
865
+ U(n, V.emoji(), r.message, t);
866
866
  break;
867
867
  case "ulid":
868
- G(n, U.ulid, r.message, t);
868
+ U(n, V.ulid, r.message, t);
869
869
  break;
870
870
  case "base64":
871
871
  switch (t.base64Strategy) {
872
872
  case "format:binary":
873
- W(n, "binary", r.message, t);
873
+ H(n, "binary", r.message, t);
874
874
  break;
875
875
  case "contentEncoding:base64":
876
876
  n.contentEncoding = "base64";
877
877
  break;
878
- case "pattern:zod": G(n, U.base64, r.message, t);
878
+ case "pattern:zod": U(n, V.base64, r.message, t);
879
879
  }
880
880
  break;
881
- case "nanoid": G(n, U.nanoid, r.message, t);
881
+ case "nanoid": U(n, V.nanoid, r.message, t);
882
882
  }
883
883
  return n;
884
884
  }
885
- function ur(e, t) {
886
- return t.patternStrategy === "escape" ? fr(e) : e;
885
+ function fr(e, t) {
886
+ return t.patternStrategy === "escape" ? mr(e) : e;
887
887
  }
888
- var dr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
889
- function fr(e) {
888
+ var pr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
889
+ function mr(e) {
890
890
  let t = "";
891
- for (let n = 0; n < e.length; n++) dr.has(e[n]) || (t += "\\"), t += e[n];
891
+ for (let n = 0; n < e.length; n++) pr.has(e[n]) || (t += "\\"), t += e[n];
892
892
  return t;
893
893
  }
894
- function W(e, t, n, r) {
894
+ function H(e, t, n, r) {
895
895
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
896
896
  format: t,
897
897
  ...n && r.errorMessages && { errorMessage: { format: n } }
898
898
  })) : e.format = t;
899
899
  }
900
- function G(e, t, n, r) {
900
+ function U(e, t, n, r) {
901
901
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
902
- pattern: pr(t, r),
902
+ pattern: hr(t, r),
903
903
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
904
- })) : e.pattern = pr(t, r);
904
+ })) : e.pattern = hr(t, r);
905
905
  }
906
- function pr(e, t) {
906
+ function hr(e, t) {
907
907
  if (!t.applyRegexFlags || !e.flags) return e.source;
908
908
  let n = {
909
909
  i: e.flags.includes("i"),
@@ -942,16 +942,16 @@ function pr(e, t) {
942
942
  }
943
943
  return i;
944
944
  }
945
- function mr(e, t) {
945
+ function gr(e, t) {
946
946
  let n = {
947
947
  type: "object",
948
- additionalProperties: K(e.valueType._def, {
948
+ additionalProperties: W(e.valueType._def, {
949
949
  ...t,
950
950
  currentPath: [...t.currentPath, "additionalProperties"]
951
951
  }) ?? t.allowedAdditionalProperties
952
952
  };
953
953
  if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
954
- let { type: r, ...i } = lr(e.keyType._def, t);
954
+ let { type: r, ...i } = dr(e.keyType._def, t);
955
955
  return {
956
956
  ...n,
957
957
  propertyNames: i
@@ -962,7 +962,7 @@ function mr(e, t) {
962
962
  propertyNames: { enum: e.keyType._def.values }
963
963
  };
964
964
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
965
- let { type: r, ...i } = Qn(e.keyType._def, t);
965
+ let { type: r, ...i } = er(e.keyType._def, t);
966
966
  return {
967
967
  ...n,
968
968
  propertyNames: i
@@ -970,13 +970,13 @@ function mr(e, t) {
970
970
  }
971
971
  return n;
972
972
  }
973
- function hr(e, t) {
974
- return t.mapStrategy === "record" ? mr(e, t) : {
973
+ function _r(e, t) {
974
+ return t.mapStrategy === "record" ? gr(e, t) : {
975
975
  type: "array",
976
976
  maxItems: 125,
977
977
  items: {
978
978
  type: "array",
979
- items: [K(e.keyType._def, {
979
+ items: [W(e.keyType._def, {
980
980
  ...t,
981
981
  currentPath: [
982
982
  ...t.currentPath,
@@ -984,7 +984,7 @@ function hr(e, t) {
984
984
  "items",
985
985
  "0"
986
986
  ]
987
- }) || H(), K(e.valueType._def, {
987
+ }) || B(), W(e.valueType._def, {
988
988
  ...t,
989
989
  currentPath: [
990
990
  ...t.currentPath,
@@ -992,37 +992,37 @@ function hr(e, t) {
992
992
  "items",
993
993
  "1"
994
994
  ]
995
- }) || H()],
995
+ }) || B()],
996
996
  minItems: 2,
997
997
  maxItems: 2
998
998
  }
999
999
  };
1000
1000
  }
1001
- function gr(e) {
1001
+ function vr(e) {
1002
1002
  let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
1003
1003
  return {
1004
1004
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
1005
1005
  enum: n
1006
1006
  };
1007
1007
  }
1008
- function _r() {
1009
- return { not: H() };
1008
+ function yr() {
1009
+ return { not: B() };
1010
1010
  }
1011
- function vr() {
1011
+ function br() {
1012
1012
  return { type: "null" };
1013
1013
  }
1014
- var yr = {
1014
+ var xr = {
1015
1015
  ZodString: "string",
1016
1016
  ZodNumber: "number",
1017
1017
  ZodBigInt: "integer",
1018
1018
  ZodBoolean: "boolean",
1019
1019
  ZodNull: "null"
1020
1020
  };
1021
- function br(e, t) {
1021
+ function Sr(e, t) {
1022
1022
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
1023
- if (n.every((e) => e._def.typeName in yr && (!e._def.checks || !e._def.checks.length))) {
1023
+ if (n.every((e) => e._def.typeName in xr && (!e._def.checks || !e._def.checks.length))) {
1024
1024
  let e = n.reduce((e, t) => {
1025
- let n = yr[t._def.typeName];
1025
+ let n = xr[t._def.typeName];
1026
1026
  return n && !e.includes(n) ? [...e, n] : e;
1027
1027
  }, []);
1028
1028
  return { type: e.length > 1 ? e : e[0] };
@@ -1050,10 +1050,10 @@ function br(e, t) {
1050
1050
  type: "string",
1051
1051
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
1052
1052
  };
1053
- return xr(e, t);
1053
+ return Cr(e, t);
1054
1054
  }
1055
- var xr = (e, t) => {
1056
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => K(e._def, {
1055
+ var Cr = (e, t) => {
1056
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => W(e._def, {
1057
1057
  ...t,
1058
1058
  currentPath: [
1059
1059
  ...t.currentPath,
@@ -1063,15 +1063,15 @@ var xr = (e, t) => {
1063
1063
  })).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
1064
1064
  return n.length ? { anyOf: n } : void 0;
1065
1065
  };
1066
- function Sr(e, t) {
1066
+ function wr(e, t) {
1067
1067
  if ([
1068
1068
  "ZodString",
1069
1069
  "ZodNumber",
1070
1070
  "ZodBigInt",
1071
1071
  "ZodBoolean",
1072
1072
  "ZodNull"
1073
- ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [yr[e.innerType._def.typeName], "null"] };
1074
- let n = K(e.innerType._def, {
1073
+ ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [xr[e.innerType._def.typeName], "null"] };
1074
+ let n = W(e.innerType._def, {
1075
1075
  ...t,
1076
1076
  currentPath: [
1077
1077
  ...t.currentPath,
@@ -1081,7 +1081,7 @@ function Sr(e, t) {
1081
1081
  });
1082
1082
  return n && { anyOf: [n, { type: "null" }] };
1083
1083
  }
1084
- function Cr(e) {
1084
+ function Tr(e) {
1085
1085
  let t = { type: "number" };
1086
1086
  if (!e.checks) return t;
1087
1087
  for (let n of e.checks) switch (n.kind) {
@@ -1098,7 +1098,7 @@ function Cr(e) {
1098
1098
  }
1099
1099
  return t;
1100
1100
  }
1101
- function wr(e, t) {
1101
+ function Er(e, t) {
1102
1102
  let n = {
1103
1103
  type: "object",
1104
1104
  properties: {}
@@ -1106,7 +1106,7 @@ function wr(e, t) {
1106
1106
  for (let e in i) {
1107
1107
  let a = i[e];
1108
1108
  if (a === void 0 || a._def === void 0) continue;
1109
- let o = Er(a), s = K(a._def, {
1109
+ let o = Or(a), s = W(a._def, {
1110
1110
  ...t,
1111
1111
  currentPath: [
1112
1112
  ...t.currentPath,
@@ -1122,11 +1122,11 @@ function wr(e, t) {
1122
1122
  s !== void 0 && (n.properties[e] = s, o || r.push(e));
1123
1123
  }
1124
1124
  r.length && (n.required = r);
1125
- let a = Tr(e, t);
1125
+ let a = Dr(e, t);
1126
1126
  return a !== void 0 && (n.additionalProperties = a), n;
1127
1127
  }
1128
- function Tr(e, t) {
1129
- if (e.catchall._def.typeName !== "ZodNever") return K(e.catchall._def, {
1128
+ function Dr(e, t) {
1129
+ if (e.catchall._def.typeName !== "ZodNever") return W(e.catchall._def, {
1130
1130
  ...t,
1131
1131
  currentPath: [...t.currentPath, "additionalProperties"]
1132
1132
  });
@@ -1136,16 +1136,16 @@ function Tr(e, t) {
1136
1136
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
1137
1137
  }
1138
1138
  }
1139
- function Er(e) {
1139
+ function Or(e) {
1140
1140
  try {
1141
1141
  return e.isOptional();
1142
1142
  } catch {
1143
1143
  return !0;
1144
1144
  }
1145
1145
  }
1146
- var Dr = (e, t) => {
1147
- if (t.currentPath.toString() === t.propertyPath?.toString()) return K(e.innerType._def, t);
1148
- let n = K(e.innerType._def, {
1146
+ var kr = (e, t) => {
1147
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return W(e.innerType._def, t);
1148
+ let n = W(e.innerType._def, {
1149
1149
  ...t,
1150
1150
  currentPath: [
1151
1151
  ...t.currentPath,
@@ -1153,11 +1153,11 @@ var Dr = (e, t) => {
1153
1153
  "1"
1154
1154
  ]
1155
1155
  });
1156
- return n ? { anyOf: [{ not: H() }, n] } : H();
1157
- }, Or = (e, t) => {
1158
- if (t.pipeStrategy === "input") return K(e.in._def, t);
1159
- if (t.pipeStrategy === "output") return K(e.out._def, t);
1160
- let n = K(e.in._def, {
1156
+ return n ? { anyOf: [{ not: B() }, n] } : B();
1157
+ }, Ar = (e, t) => {
1158
+ if (t.pipeStrategy === "input") return W(e.in._def, t);
1159
+ if (t.pipeStrategy === "output") return W(e.out._def, t);
1160
+ let n = W(e.in._def, {
1161
1161
  ...t,
1162
1162
  currentPath: [
1163
1163
  ...t.currentPath,
@@ -1165,7 +1165,7 @@ var Dr = (e, t) => {
1165
1165
  "0"
1166
1166
  ]
1167
1167
  });
1168
- return { allOf: [n, K(e.out._def, {
1168
+ return { allOf: [n, W(e.out._def, {
1169
1169
  ...t,
1170
1170
  currentPath: [
1171
1171
  ...t.currentPath,
@@ -1174,25 +1174,25 @@ var Dr = (e, t) => {
1174
1174
  ]
1175
1175
  })].filter((e) => e !== void 0) };
1176
1176
  };
1177
- function kr(e, t) {
1178
- return K(e.type._def, t);
1177
+ function jr(e, t) {
1178
+ return W(e.type._def, t);
1179
1179
  }
1180
- function Ar(e, t) {
1180
+ function Mr(e, t) {
1181
1181
  let n = {
1182
1182
  type: "array",
1183
1183
  uniqueItems: !0,
1184
- items: K(e.valueType._def, {
1184
+ items: W(e.valueType._def, {
1185
1185
  ...t,
1186
1186
  currentPath: [...t.currentPath, "items"]
1187
1187
  })
1188
1188
  };
1189
1189
  return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
1190
1190
  }
1191
- function jr(e, t) {
1191
+ function Nr(e, t) {
1192
1192
  return e.rest ? {
1193
1193
  type: "array",
1194
1194
  minItems: e.items.length,
1195
- items: e.items.map((e, n) => K(e._def, {
1195
+ items: e.items.map((e, n) => W(e._def, {
1196
1196
  ...t,
1197
1197
  currentPath: [
1198
1198
  ...t.currentPath,
@@ -1200,7 +1200,7 @@ function jr(e, t) {
1200
1200
  `${n}`
1201
1201
  ]
1202
1202
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
1203
- additionalItems: K(e.rest._def, {
1203
+ additionalItems: W(e.rest._def, {
1204
1204
  ...t,
1205
1205
  currentPath: [...t.currentPath, "additionalItems"]
1206
1206
  })
@@ -1208,7 +1208,7 @@ function jr(e, t) {
1208
1208
  type: "array",
1209
1209
  minItems: e.items.length,
1210
1210
  maxItems: e.items.length,
1211
- items: e.items.map((e, n) => K(e._def, {
1211
+ items: e.items.map((e, n) => W(e._def, {
1212
1212
  ...t,
1213
1213
  currentPath: [
1214
1214
  ...t.currentPath,
@@ -1218,47 +1218,47 @@ function jr(e, t) {
1218
1218
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
1219
1219
  };
1220
1220
  }
1221
- function Mr() {
1222
- return { not: H() };
1221
+ function Pr() {
1222
+ return { not: B() };
1223
1223
  }
1224
- function Nr() {
1225
- return H();
1224
+ function Fr() {
1225
+ return B();
1226
1226
  }
1227
- var Pr = (e, t) => K(e.innerType._def, t), Fr = (e, t, n) => {
1227
+ var Ir = (e, t) => W(e.innerType._def, t), Lr = (e, t, n) => {
1228
1228
  switch (t) {
1229
- case "ZodString": return lr(e, n);
1230
- case "ZodNumber": return Cr(e);
1231
- case "ZodObject": return wr(e, n);
1232
- case "ZodBigInt": return Xn(e);
1233
- case "ZodBoolean": return Zn();
1234
- case "ZodDate": return er(e, n);
1235
- case "ZodUndefined": return Mr();
1236
- case "ZodNull": return vr();
1237
- case "ZodArray": return Yn(e, n);
1229
+ case "ZodString": return dr(e, n);
1230
+ case "ZodNumber": return Tr(e);
1231
+ case "ZodObject": return Er(e, n);
1232
+ case "ZodBigInt": return Qn(e);
1233
+ case "ZodBoolean": return $n();
1234
+ case "ZodDate": return nr(e, n);
1235
+ case "ZodUndefined": return Pr();
1236
+ case "ZodNull": return br();
1237
+ case "ZodArray": return Zn(e, n);
1238
1238
  case "ZodUnion":
1239
- case "ZodDiscriminatedUnion": return br(e, n);
1240
- case "ZodIntersection": return or(e, n);
1241
- case "ZodTuple": return jr(e, n);
1242
- case "ZodRecord": return mr(e, n);
1243
- case "ZodLiteral": return sr(e);
1244
- case "ZodEnum": return ir(e);
1245
- case "ZodNativeEnum": return gr(e);
1246
- case "ZodNullable": return Sr(e, n);
1247
- case "ZodOptional": return Dr(e, n);
1248
- case "ZodMap": return hr(e, n);
1249
- case "ZodSet": return Ar(e, n);
1239
+ case "ZodDiscriminatedUnion": return Sr(e, n);
1240
+ case "ZodIntersection": return cr(e, n);
1241
+ case "ZodTuple": return Nr(e, n);
1242
+ case "ZodRecord": return gr(e, n);
1243
+ case "ZodLiteral": return lr(e);
1244
+ case "ZodEnum": return or(e);
1245
+ case "ZodNativeEnum": return vr(e);
1246
+ case "ZodNullable": return wr(e, n);
1247
+ case "ZodOptional": return kr(e, n);
1248
+ case "ZodMap": return _r(e, n);
1249
+ case "ZodSet": return Mr(e, n);
1250
1250
  case "ZodLazy": return () => e.getter()._def;
1251
- case "ZodPromise": return kr(e, n);
1251
+ case "ZodPromise": return jr(e, n);
1252
1252
  case "ZodNaN":
1253
- case "ZodNever": return _r();
1254
- case "ZodEffects": return rr(e, n);
1255
- case "ZodAny": return H();
1256
- case "ZodUnknown": return Nr();
1257
- case "ZodDefault": return nr(e, n);
1258
- case "ZodBranded": return Qn(e, n);
1259
- case "ZodReadonly": return Pr(e, n);
1260
- case "ZodCatch": return $n(e, n);
1261
- case "ZodPipeline": return Or(e, n);
1253
+ case "ZodNever": return yr();
1254
+ case "ZodEffects": return ar(e, n);
1255
+ case "ZodAny": return B();
1256
+ case "ZodUnknown": return Fr();
1257
+ case "ZodDefault": return ir(e, n);
1258
+ case "ZodBranded": return er(e, n);
1259
+ case "ZodReadonly": return Ir(e, n);
1260
+ case "ZodCatch": return tr(e, n);
1261
+ case "ZodPipeline": return Ar(e, n);
1262
1262
  case "ZodFunction":
1263
1263
  case "ZodVoid":
1264
1264
  case "ZodSymbol": return;
@@ -1266,19 +1266,19 @@ var Pr = (e, t) => K(e.innerType._def, t), Fr = (e, t, n) => {
1266
1266
  /* c8 ignore next */
1267
1267
  return ((e) => void 0)(t);
1268
1268
  }
1269
- }, Ir = (e, t) => {
1269
+ }, Rr = (e, t) => {
1270
1270
  let n = 0;
1271
1271
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
1272
1272
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
1273
1273
  };
1274
- function K(e, t, n = !1) {
1274
+ function W(e, t, n = !1) {
1275
1275
  let r = t.seen.get(e);
1276
1276
  if (t.override) {
1277
1277
  let i = t.override?.(e, t, r, n);
1278
- if (i !== Kn) return i;
1278
+ if (i !== Jn) return i;
1279
1279
  }
1280
1280
  if (r && !n) {
1281
- let e = Lr(r, t);
1281
+ let e = zr(r, t);
1282
1282
  if (e !== void 0) return e;
1283
1283
  }
1284
1284
  let i = {
@@ -1287,22 +1287,22 @@ function K(e, t, n = !1) {
1287
1287
  jsonSchema: void 0
1288
1288
  };
1289
1289
  t.seen.set(e, i);
1290
- let a = Fr(e, e.typeName, t), o = typeof a == "function" ? K(a(), t) : a;
1291
- if (o && Rr(e, t, o), t.postProcess) {
1290
+ let a = Lr(e, e.typeName, t), o = typeof a == "function" ? W(a(), t) : a;
1291
+ if (o && Br(e, t, o), t.postProcess) {
1292
1292
  let n = t.postProcess(o, e, t);
1293
1293
  return i.jsonSchema = o, n;
1294
1294
  }
1295
1295
  return i.jsonSchema = o, o;
1296
1296
  }
1297
- var Lr = (e, t) => {
1297
+ var zr = (e, t) => {
1298
1298
  switch (t.$refStrategy) {
1299
1299
  case "root": return { $ref: e.path.join("/") };
1300
- case "relative": return { $ref: Ir(t.currentPath, e.path) };
1300
+ case "relative": return { $ref: Rr(t.currentPath, e.path) };
1301
1301
  case "none":
1302
- 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`), H()) : t.$refStrategy === "seen" ? H() : void 0;
1302
+ 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`), B()) : t.$refStrategy === "seen" ? B() : void 0;
1303
1303
  }
1304
- }, Rr = (e, t, n) => (e.description && (n.description = e.description), n), zr = (e) => {
1305
- let t = Jn(e), n = t.name === void 0 ? t.basePath : [
1304
+ }, Br = (e, t, n) => (e.description && (n.description = e.description), n), Vr = (e) => {
1305
+ let t = Xn(e), n = t.name === void 0 ? t.basePath : [
1306
1306
  ...t.basePath,
1307
1307
  t.definitionPath,
1308
1308
  t.name
@@ -1321,25 +1321,25 @@ var Lr = (e, t) => {
1321
1321
  jsonSchema: void 0
1322
1322
  }]))
1323
1323
  };
1324
- }, Br = (e, t) => {
1325
- let n = zr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1324
+ }, Hr = (e, t) => {
1325
+ let n = Vr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1326
1326
  ...e,
1327
- [t]: K(r._def, {
1327
+ [t]: W(r._def, {
1328
1328
  ...n,
1329
1329
  currentPath: [
1330
1330
  ...n.basePath,
1331
1331
  n.definitionPath,
1332
1332
  t
1333
1333
  ]
1334
- }, !0) ?? H()
1335
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = K(e._def, i === void 0 ? n : {
1334
+ }, !0) ?? B()
1335
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = W(e._def, i === void 0 ? n : {
1336
1336
  ...n,
1337
1337
  currentPath: [
1338
1338
  ...n.basePath,
1339
1339
  n.definitionPath,
1340
1340
  i
1341
1341
  ]
1342
- }, !1) ?? H(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1342
+ }, !1) ?? B(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1343
1343
  o !== void 0 && (a.title = o);
1344
1344
  let s = i === void 0 ? r ? {
1345
1345
  ...a,
@@ -1356,14 +1356,14 @@ var Lr = (e, t) => {
1356
1356
  }
1357
1357
  };
1358
1358
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1359
- }, Vr = Symbol.for("vercel.ai.schema");
1360
- function Hr(e) {
1359
+ }, Ur = Symbol.for("vercel.ai.schema");
1360
+ function Wr(e) {
1361
1361
  let t;
1362
1362
  return () => (t ??= e(), t);
1363
1363
  }
1364
- function Ur(e, { validate: t } = {}) {
1364
+ function Gr(e, { validate: t } = {}) {
1365
1365
  return {
1366
- [Vr]: !0,
1366
+ [Ur]: !0,
1367
1367
  _type: void 0,
1368
1368
  get jsonSchema() {
1369
1369
  return typeof e == "function" && (e = e()), e;
@@ -1371,20 +1371,20 @@ function Ur(e, { validate: t } = {}) {
1371
1371
  validate: t
1372
1372
  };
1373
1373
  }
1374
- function Wr(e) {
1375
- return typeof e == "object" && !!e && Vr in e && e[Vr] === !0 && "jsonSchema" in e && "validate" in e;
1374
+ function Kr(e) {
1375
+ return typeof e == "object" && !!e && Ur in e && e[Ur] === !0 && "jsonSchema" in e && "validate" in e;
1376
1376
  }
1377
- function Gr(e) {
1378
- return e == null ? Ur({
1377
+ function qr(e) {
1378
+ return e == null ? Gr({
1379
1379
  type: "object",
1380
1380
  properties: {},
1381
1381
  additionalProperties: !1
1382
- }) : Wr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? Zr(e) : Kr(e) : e();
1382
+ }) : Kr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? $r(e) : Jr(e) : e();
1383
1383
  }
1384
- function Kr(e) {
1385
- return Ur(() => {
1386
- if (!qr(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1387
- return Gn(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1384
+ function Jr(e) {
1385
+ return Gr(() => {
1386
+ if (!Yr(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1387
+ return qn(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1388
1388
  }, { validate: async (t) => {
1389
1389
  let n = await e["~standard"].validate(t);
1390
1390
  return "value" in n ? {
@@ -1392,19 +1392,19 @@ function Kr(e) {
1392
1392
  value: n.value
1393
1393
  } : {
1394
1394
  success: !1,
1395
- error: new Sn({
1395
+ error: new wn({
1396
1396
  value: t,
1397
1397
  cause: n.issues
1398
1398
  })
1399
1399
  };
1400
1400
  } });
1401
1401
  }
1402
- function qr(e) {
1402
+ function Yr(e) {
1403
1403
  return e["~standard"].jsonSchema != null;
1404
1404
  }
1405
- function Jr(e, t) {
1405
+ function Xr(e, t) {
1406
1406
  let n = t?.useReferences ?? !1;
1407
- return Ur(() => Br(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1407
+ return Gr(() => Hr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1408
1408
  let n = await e.safeParseAsync(t);
1409
1409
  return n.success ? {
1410
1410
  success: !0,
@@ -1415,14 +1415,14 @@ function Jr(e, t) {
1415
1415
  };
1416
1416
  } });
1417
1417
  }
1418
- function Yr(e, t) {
1418
+ function Zr(e, t) {
1419
1419
  let n = t?.useReferences ?? !1;
1420
- return Ur(() => Gn(ot(e, {
1420
+ return Gr(() => qn(ct(e, {
1421
1421
  target: "draft-7",
1422
1422
  io: "input",
1423
1423
  reused: n ? "ref" : "inline"
1424
1424
  })), { validate: async (t) => {
1425
- let n = await ct(e, t);
1425
+ let n = await ut(e, t);
1426
1426
  return n.success ? {
1427
1427
  success: !0,
1428
1428
  value: n.data
@@ -1432,27 +1432,27 @@ function Yr(e, t) {
1432
1432
  };
1433
1433
  } });
1434
1434
  }
1435
- function Xr(e) {
1435
+ function Qr(e) {
1436
1436
  return "_zod" in e;
1437
1437
  }
1438
- function Zr(e, t) {
1439
- return Xr(e) ? Yr(e, t) : Jr(e, t);
1438
+ function $r(e, t) {
1439
+ return Qr(e) ? Zr(e, t) : Xr(e, t);
1440
1440
  }
1441
- async function Qr({ value: e, schema: t, context: n }) {
1442
- let r = await $r({
1441
+ async function ei({ value: e, schema: t, context: n }) {
1442
+ let r = await ti({
1443
1443
  value: e,
1444
1444
  schema: t,
1445
1445
  context: n
1446
1446
  });
1447
- if (!r.success) throw Sn.wrap({
1447
+ if (!r.success) throw wn.wrap({
1448
1448
  value: e,
1449
1449
  cause: r.error,
1450
1450
  context: n
1451
1451
  });
1452
1452
  return r.value;
1453
1453
  }
1454
- async function $r({ value: e, schema: t, context: n }) {
1455
- let r = Gr(t);
1454
+ async function ti({ value: e, schema: t, context: n }) {
1455
+ let r = qr(t);
1456
1456
  try {
1457
1457
  if (r.validate == null) return {
1458
1458
  success: !0,
@@ -1466,7 +1466,7 @@ async function $r({ value: e, schema: t, context: n }) {
1466
1466
  rawValue: e
1467
1467
  } : {
1468
1468
  success: !1,
1469
- error: Sn.wrap({
1469
+ error: wn.wrap({
1470
1470
  value: e,
1471
1471
  cause: t.error,
1472
1472
  context: n
@@ -1476,7 +1476,7 @@ async function $r({ value: e, schema: t, context: n }) {
1476
1476
  } catch (t) {
1477
1477
  return {
1478
1478
  success: !1,
1479
- error: Sn.wrap({
1479
+ error: wn.wrap({
1480
1480
  value: e,
1481
1481
  cause: t,
1482
1482
  context: n
@@ -1485,21 +1485,21 @@ async function $r({ value: e, schema: t, context: n }) {
1485
1485
  };
1486
1486
  }
1487
1487
  }
1488
- async function ei({ text: e, schema: t }) {
1488
+ async function ni({ text: e, schema: t }) {
1489
1489
  try {
1490
- let n = Wn(e);
1490
+ let n = Kn(e);
1491
1491
  return t == null ? {
1492
1492
  success: !0,
1493
1493
  value: n,
1494
1494
  rawValue: n
1495
- } : await $r({
1495
+ } : await ti({
1496
1496
  value: n,
1497
1497
  schema: t
1498
1498
  });
1499
1499
  } catch (t) {
1500
1500
  return {
1501
1501
  success: !1,
1502
- error: vn.isInstance(t) ? t : new vn({
1502
+ error: bn.isInstance(t) ? t : new bn({
1503
1503
  text: e,
1504
1504
  cause: t
1505
1505
  }),
@@ -1507,42 +1507,42 @@ async function ei({ text: e, schema: t }) {
1507
1507
  };
1508
1508
  }
1509
1509
  }
1510
- function ti({ stream: e, schema: t }) {
1511
- return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Pn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1512
- e !== "[DONE]" && n.enqueue(await ei({
1510
+ function ri({ stream: e, schema: t }) {
1511
+ return e.pipeThrough(new TextDecoderStream()).pipeThrough(new In()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1512
+ e !== "[DONE]" && n.enqueue(await ni({
1513
1513
  text: e,
1514
1514
  schema: t
1515
1515
  }));
1516
1516
  } }));
1517
1517
  }
1518
- async function ni(e) {
1518
+ async function ii(e) {
1519
1519
  return typeof e == "function" && (e = e()), e;
1520
1520
  }
1521
1521
  new TextDecoder();
1522
1522
  //#endregion
1523
1523
  //#region ../node_modules/.pnpm/ai@7.0.145_zod@4.6.7/node_modules/ai/dist/index.js
1524
- var ri = "AI_InvalidArgumentError", ii = `vercel.ai.error.${ri}`, ai = Symbol.for(ii), oi = class extends R {
1524
+ var ai = "AI_InvalidArgumentError", oi = `vercel.ai.error.${ai}`, si = Symbol.for(oi), ci = class extends I {
1525
1525
  constructor({ parameter: e, value: t, message: n }) {
1526
1526
  super({
1527
- name: ri,
1527
+ name: ai,
1528
1528
  message: `Invalid argument for parameter ${e}: ${n}`
1529
- }), this[ai] = !0, this.parameter = e, this.value = t;
1529
+ }), this[si] = !0, this.parameter = e, this.value = t;
1530
1530
  }
1531
1531
  static isInstance(e) {
1532
- return R.hasMarker(e, ii);
1532
+ return I.hasMarker(e, oi);
1533
1533
  }
1534
- }, si = "AI_UIMessageStreamError", ci = `vercel.ai.error.${si}`, li = Symbol.for(ci), ui = class extends R {
1534
+ }, li = "AI_UIMessageStreamError", ui = `vercel.ai.error.${li}`, di = Symbol.for(ui), G = class extends I {
1535
1535
  constructor({ chunkType: e, chunkId: t, message: n }) {
1536
1536
  super({
1537
- name: si,
1537
+ name: li,
1538
1538
  message: n
1539
- }), this[li] = !0, this.chunkType = e, this.chunkId = t;
1539
+ }), this[di] = !0, this.chunkType = e, this.chunkId = t;
1540
1540
  }
1541
1541
  static isInstance(e) {
1542
- return R.hasMarker(e, ci);
1542
+ return I.hasMarker(e, ui);
1543
1543
  }
1544
1544
  };
1545
- function di(e, t) {
1545
+ function fi(e, t) {
1546
1546
  if (e === void 0 && t === void 0) return;
1547
1547
  if (e === void 0) return t;
1548
1548
  if (t === void 0) return e;
@@ -1551,236 +1551,236 @@ function di(e, t) {
1551
1551
  let i = t[r];
1552
1552
  if (i === void 0) continue;
1553
1553
  let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
1554
- n[r] = o && s ? di(a, i) : i;
1554
+ n[r] = o && s ? fi(a, i) : i;
1555
1555
  }
1556
1556
  return n;
1557
1557
  }
1558
- var q = {
1559
- array: Je,
1560
- boolean: Qe,
1561
- custom: Ze,
1562
- discriminatedUnion: $e,
1563
- enum: Xe,
1564
- instanceof: Ke,
1565
- lazy: rt,
1566
- literal: pt,
1567
- looseObject: lt,
1568
- never: st,
1569
- null: Ye,
1570
- number: et,
1571
- object: ut,
1572
- record: tt,
1573
- string: mt,
1574
- union: it,
1575
- unknown: dt
1576
- }, fi = q.lazy(() => q.union([
1577
- q.null(),
1578
- q.string(),
1579
- q.number(),
1580
- q.boolean(),
1581
- q.record(q.string(), fi.optional()),
1582
- q.array(fi)
1583
- ])), J = q.record(q.string(), q.record(q.string(), fi.optional())), pi = q.union([
1584
- q.string(),
1585
- q.instanceof(Uint8Array),
1586
- q.instanceof(ArrayBuffer),
1587
- q.custom(zn, { message: "Must be a Buffer" })
1588
- ]), mi = q.record(q.string(), q.string()), hi = q.object({
1589
- type: q.literal("text"),
1590
- text: q.string(),
1558
+ var K = {
1559
+ array: Xe,
1560
+ boolean: et,
1561
+ custom: $e,
1562
+ discriminatedUnion: tt,
1563
+ enum: Qe,
1564
+ instanceof: Je,
1565
+ lazy: at,
1566
+ literal: ht,
1567
+ looseObject: dt,
1568
+ never: lt,
1569
+ null: Ze,
1570
+ number: nt,
1571
+ object: ft,
1572
+ record: rt,
1573
+ string: gt,
1574
+ union: ot,
1575
+ unknown: pt
1576
+ }, q = K.lazy(() => K.union([
1577
+ K.null(),
1578
+ K.string(),
1579
+ K.number(),
1580
+ K.boolean(),
1581
+ K.record(K.string(), q.optional()),
1582
+ K.array(q)
1583
+ ])), J = K.record(K.string(), K.record(K.string(), q.optional())), pi = K.union([
1584
+ K.string(),
1585
+ K.instanceof(Uint8Array),
1586
+ K.instanceof(ArrayBuffer),
1587
+ K.custom(Vn, { message: "Must be a Buffer" })
1588
+ ]), mi = K.record(K.string(), K.string()), hi = K.object({
1589
+ type: K.literal("text"),
1590
+ text: K.string(),
1591
1591
  providerOptions: J.optional()
1592
- }), gi = q.object({
1593
- type: q.literal("image"),
1594
- image: q.union([
1592
+ }), gi = K.object({
1593
+ type: K.literal("image"),
1594
+ image: K.union([
1595
1595
  pi,
1596
- q.instanceof(URL),
1596
+ K.instanceof(URL),
1597
1597
  mi
1598
1598
  ]),
1599
- mediaType: q.string().optional(),
1599
+ mediaType: K.string().optional(),
1600
1600
  providerOptions: J.optional()
1601
- }), _i = q.discriminatedUnion("type", [
1602
- q.object({
1603
- type: q.literal("data"),
1601
+ }), _i = K.discriminatedUnion("type", [
1602
+ K.object({
1603
+ type: K.literal("data"),
1604
1604
  data: pi
1605
1605
  }),
1606
- q.object({
1607
- type: q.literal("url"),
1608
- url: q.instanceof(URL)
1606
+ K.object({
1607
+ type: K.literal("url"),
1608
+ url: K.instanceof(URL)
1609
1609
  }),
1610
- q.object({
1611
- type: q.literal("reference"),
1610
+ K.object({
1611
+ type: K.literal("reference"),
1612
1612
  reference: mi
1613
1613
  }),
1614
- q.object({
1615
- type: q.literal("text"),
1616
- text: q.string()
1614
+ K.object({
1615
+ type: K.literal("text"),
1616
+ text: K.string()
1617
1617
  })
1618
- ]), vi = q.discriminatedUnion("type", [q.object({
1619
- type: q.literal("data"),
1618
+ ]), vi = K.discriminatedUnion("type", [K.object({
1619
+ type: K.literal("data"),
1620
1620
  data: pi
1621
- }), q.object({
1622
- type: q.literal("url"),
1623
- url: q.instanceof(URL)
1624
- })]), yi = q.object({
1625
- type: q.literal("file"),
1626
- data: q.union([
1621
+ }), K.object({
1622
+ type: K.literal("url"),
1623
+ url: K.instanceof(URL)
1624
+ })]), yi = K.object({
1625
+ type: K.literal("file"),
1626
+ data: K.union([
1627
1627
  _i,
1628
1628
  pi,
1629
- q.instanceof(URL),
1629
+ K.instanceof(URL),
1630
1630
  mi
1631
1631
  ]),
1632
- filename: q.string().optional(),
1633
- mediaType: q.string(),
1632
+ filename: K.string().optional(),
1633
+ mediaType: K.string(),
1634
1634
  providerOptions: J.optional()
1635
- }), bi = q.object({
1636
- type: q.literal("reasoning"),
1637
- text: q.string(),
1635
+ }), bi = K.object({
1636
+ type: K.literal("reasoning"),
1637
+ text: K.string(),
1638
1638
  providerOptions: J.optional()
1639
- }), xi = q.object({
1640
- type: q.literal("custom"),
1641
- kind: q.string().transform((e) => e),
1639
+ }), xi = K.object({
1640
+ type: K.literal("custom"),
1641
+ kind: K.string().transform((e) => e),
1642
1642
  providerOptions: J.optional()
1643
- }), Si = q.object({
1644
- type: q.literal("reasoning-file"),
1645
- data: q.union([
1643
+ }), Si = K.object({
1644
+ type: K.literal("reasoning-file"),
1645
+ data: K.union([
1646
1646
  vi,
1647
1647
  pi,
1648
- q.instanceof(URL)
1648
+ K.instanceof(URL)
1649
1649
  ]),
1650
- mediaType: q.string(),
1650
+ mediaType: K.string(),
1651
1651
  providerOptions: J.optional()
1652
- }), Ci = q.object({
1653
- type: q.literal("tool-call"),
1654
- toolCallId: q.string(),
1655
- toolName: q.string(),
1656
- input: q.unknown(),
1652
+ }), Ci = K.object({
1653
+ type: K.literal("tool-call"),
1654
+ toolCallId: K.string(),
1655
+ toolName: K.string(),
1656
+ input: K.unknown(),
1657
1657
  providerOptions: J.optional(),
1658
- providerExecuted: q.boolean().optional()
1659
- }), wi = q.discriminatedUnion("type", [
1660
- q.object({
1661
- type: q.literal("text"),
1662
- value: q.string(),
1658
+ providerExecuted: K.boolean().optional()
1659
+ }), wi = K.discriminatedUnion("type", [
1660
+ K.object({
1661
+ type: K.literal("text"),
1662
+ value: K.string(),
1663
1663
  providerOptions: J.optional()
1664
1664
  }),
1665
- q.object({
1666
- type: q.literal("json"),
1667
- value: fi,
1665
+ K.object({
1666
+ type: K.literal("json"),
1667
+ value: q,
1668
1668
  providerOptions: J.optional()
1669
1669
  }),
1670
- q.object({
1671
- type: q.literal("execution-denied"),
1672
- reason: q.string().optional(),
1670
+ K.object({
1671
+ type: K.literal("execution-denied"),
1672
+ reason: K.string().optional(),
1673
1673
  providerOptions: J.optional()
1674
1674
  }),
1675
- q.object({
1676
- type: q.literal("error-text"),
1677
- value: q.string(),
1675
+ K.object({
1676
+ type: K.literal("error-text"),
1677
+ value: K.string(),
1678
1678
  providerOptions: J.optional()
1679
1679
  }),
1680
- q.object({
1681
- type: q.literal("error-json"),
1682
- value: fi,
1680
+ K.object({
1681
+ type: K.literal("error-json"),
1682
+ value: q,
1683
1683
  providerOptions: J.optional()
1684
1684
  }),
1685
- q.object({
1686
- type: q.literal("content"),
1687
- value: q.array(q.union([
1688
- q.object({
1689
- type: q.literal("text"),
1690
- text: q.string(),
1685
+ K.object({
1686
+ type: K.literal("content"),
1687
+ value: K.array(K.union([
1688
+ K.object({
1689
+ type: K.literal("text"),
1690
+ text: K.string(),
1691
1691
  providerOptions: J.optional()
1692
1692
  }),
1693
- q.object({
1694
- type: q.literal("file"),
1693
+ K.object({
1694
+ type: K.literal("file"),
1695
1695
  data: _i,
1696
- mediaType: q.string(),
1697
- filename: q.string().optional(),
1696
+ mediaType: K.string(),
1697
+ filename: K.string().optional(),
1698
1698
  providerOptions: J.optional()
1699
1699
  }),
1700
- q.object({
1701
- type: q.literal("file-data"),
1702
- data: q.string(),
1703
- mediaType: q.string(),
1704
- filename: q.string().optional(),
1700
+ K.object({
1701
+ type: K.literal("file-data"),
1702
+ data: K.string(),
1703
+ mediaType: K.string(),
1704
+ filename: K.string().optional(),
1705
1705
  providerOptions: J.optional()
1706
1706
  }),
1707
- q.object({
1708
- type: q.literal("file-url"),
1709
- url: q.string(),
1710
- mediaType: q.string().optional(),
1707
+ K.object({
1708
+ type: K.literal("file-url"),
1709
+ url: K.string(),
1710
+ mediaType: K.string().optional(),
1711
1711
  providerOptions: J.optional()
1712
1712
  }),
1713
- q.object({
1714
- type: q.literal("file-id"),
1715
- fileId: q.union([q.string(), q.record(q.string(), q.string())]),
1713
+ K.object({
1714
+ type: K.literal("file-id"),
1715
+ fileId: K.union([K.string(), K.record(K.string(), K.string())]),
1716
1716
  providerOptions: J.optional()
1717
1717
  }),
1718
- q.object({
1719
- type: q.literal("file-reference"),
1720
- providerReference: q.record(q.string(), q.string()),
1718
+ K.object({
1719
+ type: K.literal("file-reference"),
1720
+ providerReference: K.record(K.string(), K.string()),
1721
1721
  providerOptions: J.optional()
1722
1722
  }),
1723
- q.object({
1724
- type: q.literal("image-data"),
1725
- data: q.string(),
1726
- mediaType: q.string(),
1723
+ K.object({
1724
+ type: K.literal("image-data"),
1725
+ data: K.string(),
1726
+ mediaType: K.string(),
1727
1727
  providerOptions: J.optional()
1728
1728
  }),
1729
- q.object({
1730
- type: q.literal("image-url"),
1731
- url: q.string(),
1729
+ K.object({
1730
+ type: K.literal("image-url"),
1731
+ url: K.string(),
1732
1732
  providerOptions: J.optional()
1733
1733
  }),
1734
- q.object({
1735
- type: q.literal("image-file-id"),
1736
- fileId: q.union([q.string(), q.record(q.string(), q.string())]),
1734
+ K.object({
1735
+ type: K.literal("image-file-id"),
1736
+ fileId: K.union([K.string(), K.record(K.string(), K.string())]),
1737
1737
  providerOptions: J.optional()
1738
1738
  }),
1739
- q.object({
1740
- type: q.literal("image-file-reference"),
1741
- providerReference: q.record(q.string(), q.string()),
1739
+ K.object({
1740
+ type: K.literal("image-file-reference"),
1741
+ providerReference: K.record(K.string(), K.string()),
1742
1742
  providerOptions: J.optional()
1743
1743
  }),
1744
- q.object({
1745
- type: q.literal("custom"),
1744
+ K.object({
1745
+ type: K.literal("custom"),
1746
1746
  providerOptions: J.optional()
1747
1747
  })
1748
1748
  ]))
1749
1749
  })
1750
- ]), Ti = q.object({
1751
- type: q.literal("tool-result"),
1752
- toolCallId: q.string(),
1753
- toolName: q.string(),
1750
+ ]), Ti = K.object({
1751
+ type: K.literal("tool-result"),
1752
+ toolCallId: K.string(),
1753
+ toolName: K.string(),
1754
1754
  output: wi,
1755
1755
  providerOptions: J.optional()
1756
- }), Ei = q.object({
1757
- type: q.literal("tool-approval-request"),
1758
- approvalId: q.string(),
1759
- toolCallId: q.string(),
1760
- reason: q.string().optional(),
1761
- isAutomatic: q.boolean().optional(),
1762
- signature: q.string().optional(),
1763
- inputSchemaInput: q.unknown().optional()
1764
- }), Di = q.object({
1765
- type: q.literal("tool-approval-response"),
1766
- approvalId: q.string(),
1767
- approved: q.boolean(),
1768
- reason: q.string().optional()
1769
- }), Oi = q.object({
1770
- role: q.literal("system"),
1771
- content: q.string(),
1756
+ }), Ei = K.object({
1757
+ type: K.literal("tool-approval-request"),
1758
+ approvalId: K.string(),
1759
+ toolCallId: K.string(),
1760
+ reason: K.string().optional(),
1761
+ isAutomatic: K.boolean().optional(),
1762
+ signature: K.string().optional(),
1763
+ inputSchemaInput: K.unknown().optional()
1764
+ }), Di = K.object({
1765
+ type: K.literal("tool-approval-response"),
1766
+ approvalId: K.string(),
1767
+ approved: K.boolean(),
1768
+ reason: K.string().optional()
1769
+ }), Oi = K.object({
1770
+ role: K.literal("system"),
1771
+ content: K.string(),
1772
1772
  providerOptions: J.optional()
1773
- }), ki = q.object({
1774
- role: q.literal("user"),
1775
- content: q.union([q.string(), q.array(q.union([
1773
+ }), ki = K.object({
1774
+ role: K.literal("user"),
1775
+ content: K.union([K.string(), K.array(K.union([
1776
1776
  hi,
1777
1777
  gi,
1778
1778
  yi
1779
1779
  ]))]),
1780
1780
  providerOptions: J.optional()
1781
- }), Ai = q.object({
1782
- role: q.literal("assistant"),
1783
- content: q.union([q.string(), q.array(q.union([
1781
+ }), Ai = K.object({
1782
+ role: K.literal("assistant"),
1783
+ content: K.union([K.string(), K.array(K.union([
1784
1784
  hi,
1785
1785
  xi,
1786
1786
  yi,
@@ -1791,12 +1791,12 @@ var q = {
1791
1791
  Ei
1792
1792
  ]))]),
1793
1793
  providerOptions: J.optional()
1794
- }), ji = q.object({
1795
- role: q.literal("tool"),
1796
- content: q.array(q.union([Ti, Di])),
1794
+ }), ji = K.object({
1795
+ role: K.literal("tool"),
1796
+ content: K.array(K.union([Ti, Di])),
1797
1797
  providerOptions: J.optional()
1798
1798
  });
1799
- q.union([
1799
+ K.union([
1800
1800
  Oi,
1801
1801
  ki,
1802
1802
  Ai,
@@ -1989,11 +1989,11 @@ async function Ni(e) {
1989
1989
  value: void 0,
1990
1990
  state: "undefined-input"
1991
1991
  };
1992
- let t = await ei({ text: e });
1992
+ let t = await ni({ text: e });
1993
1993
  return t.success ? {
1994
1994
  value: t.value,
1995
1995
  state: "successful-parse"
1996
- } : (t = await ei({ text: Mi(e) }), t.success ? {
1996
+ } : (t = await ni({ text: Mi(e) }), t.success ? {
1997
1997
  value: t.value,
1998
1998
  state: "repaired-parse"
1999
1999
  } : {
@@ -2001,10 +2001,10 @@ async function Ni(e) {
2001
2001
  state: "failed-parse"
2002
2002
  });
2003
2003
  }
2004
- new TextEncoder(), new TextEncoder(), B({
2004
+ new TextEncoder(), new TextEncoder(), R({
2005
2005
  prefix: "aitxt",
2006
2006
  size: 24
2007
- }), B({
2007
+ }), R({
2008
2008
  prefix: "call",
2009
2009
  size: 24
2010
2010
  });
@@ -2073,193 +2073,193 @@ function Bi({ status: e, statusText: t, headers: n, stream: r, keepAliveMs: i, c
2073
2073
  headers: Pi(n, zi)
2074
2074
  });
2075
2075
  }
2076
- var Vi = q.object({
2077
- source: q.discriminatedUnion("sourceType", [q.object({
2078
- type: q.literal("source"),
2079
- sourceType: q.literal("url"),
2080
- id: q.string(),
2081
- url: q.string(),
2082
- title: q.string().optional(),
2076
+ var Vi = K.object({
2077
+ source: K.discriminatedUnion("sourceType", [K.object({
2078
+ type: K.literal("source"),
2079
+ sourceType: K.literal("url"),
2080
+ id: K.string(),
2081
+ url: K.string(),
2082
+ title: K.string().optional(),
2083
2083
  providerMetadata: J.optional()
2084
- }), q.object({
2085
- type: q.literal("source"),
2086
- sourceType: q.literal("document"),
2087
- id: q.string(),
2088
- mediaType: q.string(),
2089
- title: q.string(),
2090
- filename: q.string().optional(),
2084
+ }), K.object({
2085
+ type: K.literal("source"),
2086
+ sourceType: K.literal("document"),
2087
+ id: K.string(),
2088
+ mediaType: K.string(),
2089
+ title: K.string(),
2090
+ filename: K.string().optional(),
2091
2091
  providerMetadata: J.optional()
2092
2092
  })]),
2093
- startIndex: q.number().int().nonnegative().optional(),
2094
- endIndex: q.number().int().nonnegative().optional(),
2095
- citedText: q.string().optional()
2096
- }), Hi = q.record(q.string(), fi.optional()), Ui = Hr(() => Zr(q.union([
2097
- q.looseObject({
2098
- type: q.literal("text-start"),
2099
- id: q.string(),
2093
+ startIndex: K.number().int().nonnegative().optional(),
2094
+ endIndex: K.number().int().nonnegative().optional(),
2095
+ citedText: K.string().optional()
2096
+ }), Hi = K.record(K.string(), q.optional()), Ui = Wr(() => $r(K.union([
2097
+ K.looseObject({
2098
+ type: K.literal("text-start"),
2099
+ id: K.string(),
2100
2100
  providerMetadata: J.optional()
2101
2101
  }),
2102
- q.looseObject({
2103
- type: q.literal("text-delta"),
2104
- id: q.string(),
2105
- delta: q.string(),
2102
+ K.looseObject({
2103
+ type: K.literal("text-delta"),
2104
+ id: K.string(),
2105
+ delta: K.string(),
2106
2106
  providerMetadata: J.optional()
2107
2107
  }),
2108
- q.looseObject({
2109
- type: q.literal("text-end"),
2110
- id: q.string(),
2111
- citations: q.array(Vi).optional(),
2108
+ K.looseObject({
2109
+ type: K.literal("text-end"),
2110
+ id: K.string(),
2111
+ citations: K.array(Vi).optional(),
2112
2112
  providerMetadata: J.optional()
2113
2113
  }),
2114
- q.looseObject({
2115
- type: q.literal("error"),
2116
- errorText: q.string()
2114
+ K.looseObject({
2115
+ type: K.literal("error"),
2116
+ errorText: K.string()
2117
2117
  }),
2118
- q.looseObject({
2119
- type: q.literal("tool-input-start"),
2120
- toolCallId: q.string(),
2121
- toolName: q.string(),
2122
- inputEncoding: q.enum(["json", "text"]).optional(),
2123
- providerExecuted: q.boolean().optional(),
2118
+ K.looseObject({
2119
+ type: K.literal("tool-input-start"),
2120
+ toolCallId: K.string(),
2121
+ toolName: K.string(),
2122
+ inputEncoding: K.enum(["json", "text"]).optional(),
2123
+ providerExecuted: K.boolean().optional(),
2124
2124
  providerMetadata: J.optional(),
2125
2125
  toolMetadata: Hi.optional(),
2126
- dynamic: q.boolean().optional(),
2127
- title: q.string().optional()
2126
+ dynamic: K.boolean().optional(),
2127
+ title: K.string().optional()
2128
2128
  }),
2129
- q.looseObject({
2130
- type: q.literal("tool-input-delta"),
2131
- toolCallId: q.string(),
2132
- inputTextDelta: q.string()
2129
+ K.looseObject({
2130
+ type: K.literal("tool-input-delta"),
2131
+ toolCallId: K.string(),
2132
+ inputTextDelta: K.string()
2133
2133
  }),
2134
- q.looseObject({
2135
- type: q.literal("tool-input-available"),
2136
- toolCallId: q.string(),
2137
- toolName: q.string(),
2138
- input: q.unknown(),
2139
- providerExecuted: q.boolean().optional(),
2134
+ K.looseObject({
2135
+ type: K.literal("tool-input-available"),
2136
+ toolCallId: K.string(),
2137
+ toolName: K.string(),
2138
+ input: K.unknown(),
2139
+ providerExecuted: K.boolean().optional(),
2140
2140
  providerMetadata: J.optional(),
2141
2141
  toolMetadata: Hi.optional(),
2142
- dynamic: q.boolean().optional(),
2143
- title: q.string().optional()
2142
+ dynamic: K.boolean().optional(),
2143
+ title: K.string().optional()
2144
2144
  }),
2145
- q.looseObject({
2146
- type: q.literal("tool-input-error"),
2147
- toolCallId: q.string(),
2148
- toolName: q.string(),
2149
- input: q.unknown(),
2150
- providerExecuted: q.boolean().optional(),
2145
+ K.looseObject({
2146
+ type: K.literal("tool-input-error"),
2147
+ toolCallId: K.string(),
2148
+ toolName: K.string(),
2149
+ input: K.unknown(),
2150
+ providerExecuted: K.boolean().optional(),
2151
2151
  providerMetadata: J.optional(),
2152
2152
  toolMetadata: Hi.optional(),
2153
- dynamic: q.boolean().optional(),
2154
- errorText: q.string(),
2155
- title: q.string().optional()
2153
+ dynamic: K.boolean().optional(),
2154
+ errorText: K.string(),
2155
+ title: K.string().optional()
2156
2156
  }),
2157
- q.looseObject({
2158
- type: q.literal("tool-approval-request"),
2159
- approvalId: q.string(),
2160
- toolCallId: q.string(),
2161
- approvalDescriptor: q.unknown().optional(),
2162
- inputSchemaInput: q.unknown().optional(),
2163
- reason: q.string().optional(),
2164
- isAutomatic: q.boolean().optional(),
2165
- signature: q.string().optional()
2157
+ K.looseObject({
2158
+ type: K.literal("tool-approval-request"),
2159
+ approvalId: K.string(),
2160
+ toolCallId: K.string(),
2161
+ approvalDescriptor: K.unknown().optional(),
2162
+ inputSchemaInput: K.unknown().optional(),
2163
+ reason: K.string().optional(),
2164
+ isAutomatic: K.boolean().optional(),
2165
+ signature: K.string().optional()
2166
2166
  }),
2167
- q.looseObject({
2168
- type: q.literal("tool-approval-response"),
2169
- approvalId: q.string(),
2170
- approved: q.boolean(),
2171
- reason: q.string().optional(),
2172
- providerExecuted: q.boolean().optional(),
2167
+ K.looseObject({
2168
+ type: K.literal("tool-approval-response"),
2169
+ approvalId: K.string(),
2170
+ approved: K.boolean(),
2171
+ reason: K.string().optional(),
2172
+ providerExecuted: K.boolean().optional(),
2173
2173
  providerMetadata: J.optional()
2174
2174
  }),
2175
- q.looseObject({
2176
- type: q.literal("tool-output-available"),
2177
- toolCallId: q.string(),
2178
- output: q.unknown(),
2179
- providerExecuted: q.boolean().optional(),
2175
+ K.looseObject({
2176
+ type: K.literal("tool-output-available"),
2177
+ toolCallId: K.string(),
2178
+ output: K.unknown(),
2179
+ providerExecuted: K.boolean().optional(),
2180
2180
  providerMetadata: J.optional(),
2181
2181
  toolMetadata: Hi.optional(),
2182
- dynamic: q.boolean().optional(),
2183
- preliminary: q.boolean().optional()
2182
+ dynamic: K.boolean().optional(),
2183
+ preliminary: K.boolean().optional()
2184
2184
  }),
2185
- q.looseObject({
2186
- type: q.literal("tool-output-error"),
2187
- toolCallId: q.string(),
2188
- errorText: q.string(),
2189
- providerExecuted: q.boolean().optional(),
2185
+ K.looseObject({
2186
+ type: K.literal("tool-output-error"),
2187
+ toolCallId: K.string(),
2188
+ errorText: K.string(),
2189
+ providerExecuted: K.boolean().optional(),
2190
2190
  providerMetadata: J.optional(),
2191
2191
  toolMetadata: Hi.optional(),
2192
- dynamic: q.boolean().optional()
2192
+ dynamic: K.boolean().optional()
2193
2193
  }),
2194
- q.looseObject({
2195
- type: q.literal("tool-output-denied"),
2196
- toolCallId: q.string()
2194
+ K.looseObject({
2195
+ type: K.literal("tool-output-denied"),
2196
+ toolCallId: K.string()
2197
2197
  }),
2198
- q.looseObject({
2199
- type: q.literal("reasoning-start"),
2200
- id: q.string(),
2198
+ K.looseObject({
2199
+ type: K.literal("reasoning-start"),
2200
+ id: K.string(),
2201
2201
  providerMetadata: J.optional()
2202
2202
  }),
2203
- q.looseObject({
2204
- type: q.literal("reasoning-delta"),
2205
- id: q.string(),
2206
- delta: q.string(),
2203
+ K.looseObject({
2204
+ type: K.literal("reasoning-delta"),
2205
+ id: K.string(),
2206
+ delta: K.string(),
2207
2207
  providerMetadata: J.optional()
2208
2208
  }),
2209
- q.looseObject({
2210
- type: q.literal("reasoning-end"),
2211
- id: q.string(),
2209
+ K.looseObject({
2210
+ type: K.literal("reasoning-end"),
2211
+ id: K.string(),
2212
2212
  providerMetadata: J.optional()
2213
2213
  }),
2214
- q.looseObject({
2215
- type: q.literal("custom"),
2216
- kind: q.string().transform((e) => e),
2214
+ K.looseObject({
2215
+ type: K.literal("custom"),
2216
+ kind: K.string().transform((e) => e),
2217
2217
  providerMetadata: J.optional()
2218
2218
  }),
2219
- q.looseObject({
2220
- type: q.literal("source-url"),
2221
- sourceId: q.string(),
2222
- url: q.string(),
2223
- title: q.string().optional(),
2219
+ K.looseObject({
2220
+ type: K.literal("source-url"),
2221
+ sourceId: K.string(),
2222
+ url: K.string(),
2223
+ title: K.string().optional(),
2224
2224
  providerMetadata: J.optional()
2225
2225
  }),
2226
- q.looseObject({
2227
- type: q.literal("source-document"),
2228
- sourceId: q.string(),
2229
- mediaType: q.string(),
2230
- title: q.string(),
2231
- filename: q.string().optional(),
2226
+ K.looseObject({
2227
+ type: K.literal("source-document"),
2228
+ sourceId: K.string(),
2229
+ mediaType: K.string(),
2230
+ title: K.string(),
2231
+ filename: K.string().optional(),
2232
2232
  providerMetadata: J.optional()
2233
2233
  }),
2234
- q.looseObject({
2235
- type: q.literal("file"),
2236
- url: q.string(),
2237
- mediaType: q.string(),
2234
+ K.looseObject({
2235
+ type: K.literal("file"),
2236
+ url: K.string(),
2237
+ mediaType: K.string(),
2238
2238
  providerMetadata: J.optional()
2239
2239
  }),
2240
- q.looseObject({
2241
- type: q.literal("reasoning-file"),
2242
- url: q.string(),
2243
- mediaType: q.string(),
2240
+ K.looseObject({
2241
+ type: K.literal("reasoning-file"),
2242
+ url: K.string(),
2243
+ mediaType: K.string(),
2244
2244
  providerMetadata: J.optional()
2245
2245
  }),
2246
- q.looseObject({
2247
- type: q.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2248
- id: q.string().optional(),
2249
- data: q.unknown(),
2250
- transient: q.boolean().optional()
2246
+ K.looseObject({
2247
+ type: K.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2248
+ id: K.string().optional(),
2249
+ data: K.unknown(),
2250
+ transient: K.boolean().optional()
2251
2251
  }),
2252
- q.looseObject({ type: q.literal("start-step") }),
2253
- q.looseObject({ type: q.literal("finish-step") }),
2254
- q.looseObject({ type: q.literal("reset-step") }),
2255
- q.looseObject({
2256
- type: q.literal("start"),
2257
- messageId: q.string().optional(),
2258
- messageMetadata: q.unknown().optional()
2252
+ K.looseObject({ type: K.literal("start-step") }),
2253
+ K.looseObject({ type: K.literal("finish-step") }),
2254
+ K.looseObject({ type: K.literal("reset-step") }),
2255
+ K.looseObject({
2256
+ type: K.literal("start"),
2257
+ messageId: K.string().optional(),
2258
+ messageMetadata: K.unknown().optional()
2259
2259
  }),
2260
- q.looseObject({
2261
- type: q.literal("finish"),
2262
- finishReason: q.enum([
2260
+ K.looseObject({
2261
+ type: K.literal("finish"),
2262
+ finishReason: K.enum([
2263
2263
  "stop",
2264
2264
  "length",
2265
2265
  "content-filter",
@@ -2267,15 +2267,15 @@ var Vi = q.object({
2267
2267
  "error",
2268
2268
  "other"
2269
2269
  ]).optional(),
2270
- messageMetadata: q.unknown().optional()
2270
+ messageMetadata: K.unknown().optional()
2271
2271
  }),
2272
- q.looseObject({
2273
- type: q.literal("abort"),
2274
- reason: q.string().optional()
2272
+ K.looseObject({
2273
+ type: K.literal("abort"),
2274
+ reason: K.string().optional()
2275
2275
  }),
2276
- q.looseObject({
2277
- type: q.literal("message-metadata"),
2278
- messageMetadata: q.unknown()
2276
+ K.looseObject({
2277
+ type: K.literal("message-metadata"),
2278
+ messageMetadata: K.unknown()
2279
2279
  })
2280
2280
  ])));
2281
2281
  function Wi(e) {
@@ -2347,7 +2347,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2347
2347
  }
2348
2348
  }
2349
2349
  }
2350
- if (t == null) throw new ui({
2350
+ if (t == null) throw new G({
2351
2351
  chunkType: "tool-invocation",
2352
2352
  chunkId: e,
2353
2353
  message: `No tool invocation found for tool call ID "${e}".`
@@ -2356,7 +2356,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2356
2356
  }
2357
2357
  function h(e) {
2358
2358
  let t = r.message.parts.filter(Y).find((t) => t.approval?.id === e);
2359
- if (t == null) throw new ui({
2359
+ if (t == null) throw new G({
2360
2360
  chunkType: "tool-approval-response",
2361
2361
  chunkId: e,
2362
2362
  message: `No tool invocation found for approval ID "${e}".`
@@ -2421,8 +2421,8 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2421
2421
  }
2422
2422
  async function v(e) {
2423
2423
  if (e != null) {
2424
- let n = r.message.metadata == null ? e : di(r.message.metadata, e);
2425
- t != null && await Qr({
2424
+ let n = r.message.metadata == null ? e : fi(r.message.metadata, e);
2425
+ t != null && await ei({
2426
2426
  value: n,
2427
2427
  schema: t,
2428
2428
  context: {
@@ -2445,7 +2445,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2445
2445
  }
2446
2446
  case "text-delta": {
2447
2447
  let t = r.activeTextParts[e.id];
2448
- if (t == null) throw new ui({
2448
+ if (t == null) throw new G({
2449
2449
  chunkType: "text-delta",
2450
2450
  chunkId: e.id,
2451
2451
  message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
@@ -2455,7 +2455,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2455
2455
  }
2456
2456
  case "text-end": {
2457
2457
  let t = r.activeTextParts[e.id];
2458
- if (t == null) throw new ui({
2458
+ if (t == null) throw new G({
2459
2459
  chunkType: "text-end",
2460
2460
  chunkId: e.id,
2461
2461
  message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
@@ -2485,7 +2485,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2485
2485
  }
2486
2486
  case "reasoning-delta": {
2487
2487
  let t = r.activeReasoningParts[e.id];
2488
- if (t == null) throw new ui({
2488
+ if (t == null) throw new G({
2489
2489
  chunkType: "reasoning-delta",
2490
2490
  chunkId: e.id,
2491
2491
  message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
@@ -2495,7 +2495,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2495
2495
  }
2496
2496
  case "reasoning-end": {
2497
2497
  let t = r.activeReasoningParts[e.id];
2498
- if (t == null) throw new ui({
2498
+ if (t == null) throw new G({
2499
2499
  chunkType: "reasoning-end",
2500
2500
  chunkId: e.id,
2501
2501
  message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
@@ -2566,7 +2566,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2566
2566
  }
2567
2567
  case "tool-input-delta": {
2568
2568
  let t = r.partialToolCalls[e.toolCallId];
2569
- if (t == null) throw new ui({
2569
+ if (t == null) throw new G({
2570
2570
  chunkType: "tool-input-delta",
2571
2571
  chunkId: e.toolCallId,
2572
2572
  message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
@@ -2747,7 +2747,7 @@ function Xi({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2747
2747
  default: if (Wi(e)) {
2748
2748
  if (n?.[e.type] != null) {
2749
2749
  let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
2750
- await Qr({
2750
+ await ei({
2751
2751
  value: e.data,
2752
2752
  schema: n[e.type],
2753
2753
  context: {
@@ -2796,28 +2796,28 @@ function Qi() {
2796
2796
  reject: t
2797
2797
  };
2798
2798
  }
2799
- B({
2799
+ R({
2800
2800
  prefix: "aitxt",
2801
2801
  size: 24
2802
- }), B({
2802
+ }), R({
2803
2803
  prefix: "call",
2804
2804
  size: 24
2805
- }), B({
2805
+ }), R({
2806
2806
  prefix: "aitxt",
2807
2807
  size: 24
2808
- }), B({
2808
+ }), R({
2809
2809
  prefix: "call",
2810
2810
  size: 24
2811
- }), q.record(q.string(), fi.optional()), q.record(q.string(), q.string()), B({
2811
+ }), K.record(K.string(), q.optional()), K.record(K.string(), K.string()), R({
2812
2812
  prefix: "call",
2813
2813
  size: 24
2814
- }), B({
2814
+ }), R({
2815
2815
  prefix: "call",
2816
2816
  size: 24
2817
- }), new TextEncoder(), B({
2817
+ }), new TextEncoder(), R({
2818
2818
  prefix: "call",
2819
2819
  size: 24
2820
- }), B({
2820
+ }), R({
2821
2821
  prefix: "aiobj",
2822
2822
  size: 24
2823
2823
  });
@@ -2853,15 +2853,15 @@ var { atob: $i } = globalThis, ea = class {
2853
2853
  });
2854
2854
  }
2855
2855
  };
2856
- B({
2856
+ R({
2857
2857
  prefix: "aiobj",
2858
2858
  size: 24
2859
- }), B({
2859
+ }), R({
2860
2860
  prefix: "call",
2861
2861
  size: 24
2862
- }), q.object({
2863
- token: q.string().refine((e) => e.trim().length > 0),
2864
- url: q.string().refine((e) => {
2862
+ }), K.object({
2863
+ token: K.string().refine((e) => e.trim().length > 0),
2864
+ url: K.string().refine((e) => {
2865
2865
  try {
2866
2866
  let t = new URL(e);
2867
2867
  return (t.protocol === "ws:" || t.protocol === "wss:") && t.hostname !== "";
@@ -2869,26 +2869,26 @@ B({
2869
2869
  return !1;
2870
2870
  }
2871
2871
  }),
2872
- expiresAt: q.number().positive().max(2 ** 53 - 1).optional(),
2873
- tools: q.array(q.object({
2874
- type: q.literal("function"),
2875
- name: q.string().min(1),
2876
- description: q.string().optional(),
2877
- parameters: q.record(q.string(), q.unknown())
2872
+ expiresAt: K.number().positive().max(2 ** 53 - 1).optional(),
2873
+ tools: K.array(K.object({
2874
+ type: K.literal("function"),
2875
+ name: K.string().min(1),
2876
+ description: K.string().optional(),
2877
+ parameters: K.record(K.string(), K.unknown())
2878
2878
  })).optional()
2879
- }), B({
2879
+ }), R({
2880
2880
  prefix: "call",
2881
2881
  size: 24
2882
- }), B({
2882
+ }), R({
2883
2883
  prefix: "call",
2884
2884
  size: 24
2885
- }), B({
2885
+ }), R({
2886
2886
  prefix: "call",
2887
2887
  size: 24
2888
2888
  });
2889
2889
  async function ta({ response: e, url: t, fallbackMessage: n }) {
2890
2890
  let r = await e.text();
2891
- return new an({
2891
+ return new sn({
2892
2892
  message: r || n,
2893
2893
  url: t,
2894
2894
  requestBodyValues: void 0,
@@ -2898,7 +2898,7 @@ async function ta({ response: e, url: t, fallbackMessage: n }) {
2898
2898
  }
2899
2899
  async function na(e) {
2900
2900
  if (e == null) return [];
2901
- if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new En({
2901
+ if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new On({
2902
2902
  functionality: "FileList",
2903
2903
  message: "FileList is not supported in the current environment"
2904
2904
  });
@@ -2926,9 +2926,9 @@ var ia = class {
2926
2926
  this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
2927
2927
  }
2928
2928
  async sendMessages({ abortSignal: e, ...t }) {
2929
- let n = await ni(this.body), r = await ni(this.headers), i = await ni(this.credentials), a = {
2930
- ...Ln(r),
2931
- ...Ln(t.headers)
2929
+ let n = await ii(this.body), r = await ii(this.headers), i = await ii(this.credentials), a = {
2930
+ ...zn(r),
2931
+ ...zn(t.headers)
2932
2932
  }, o = await this.prepareSendMessagesRequest?.({
2933
2933
  api: this.api,
2934
2934
  id: t.chatId,
@@ -2942,7 +2942,7 @@ var ia = class {
2942
2942
  requestMetadata: t.metadata,
2943
2943
  trigger: t.trigger,
2944
2944
  messageId: t.messageId
2945
- }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : Ln(o.headers), l = o?.body === void 0 ? {
2945
+ }), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : zn(o.headers), l = o?.body === void 0 ? {
2946
2946
  ...n,
2947
2947
  ...t.body,
2948
2948
  id: t.chatId,
@@ -2964,13 +2964,13 @@ var ia = class {
2964
2964
  url: s,
2965
2965
  fallbackMessage: "Failed to fetch the chat response."
2966
2966
  });
2967
- if (!d.body) throw new ln({ message: "The response body is empty." });
2967
+ if (!d.body) throw new dn({ message: "The response body is empty." });
2968
2968
  return this.processResponseStream(d.body);
2969
2969
  }
2970
2970
  async reconnectToStream(e) {
2971
- let t = await ni(this.body), n = await ni(this.headers), r = await ni(this.credentials), i = {
2972
- ...Ln(n),
2973
- ...Ln(e.headers)
2971
+ let t = await ii(this.body), n = await ii(this.headers), r = await ii(this.credentials), i = {
2972
+ ...zn(n),
2973
+ ...zn(e.headers)
2974
2974
  }, a = await this.prepareReconnectToStreamRequest?.({
2975
2975
  api: this.api,
2976
2976
  id: e.chatId,
@@ -2983,14 +2983,14 @@ var ia = class {
2983
2983
  requestMetadata: e.metadata
2984
2984
  }), o = a?.api;
2985
2985
  if (o == null) {
2986
- if (e.chatId === "." || e.chatId === "..") throw new oi({
2986
+ if (e.chatId === "." || e.chatId === "..") throw new ci({
2987
2987
  parameter: "chatId",
2988
2988
  value: e.chatId,
2989
2989
  message: "Chat IDs must not be \".\" or \"..\" when using the default reconnect URL."
2990
2990
  });
2991
2991
  o = ra(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
2992
2992
  }
2993
- let s = a?.headers === void 0 ? i : Ln(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2993
+ let s = a?.headers === void 0 ? i : zn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
2994
2994
  method: "GET",
2995
2995
  headers: s,
2996
2996
  credentials: c,
@@ -3002,7 +3002,7 @@ var ia = class {
3002
3002
  url: o,
3003
3003
  fallbackMessage: "Failed to fetch the chat response."
3004
3004
  });
3005
- if (!l.body) throw new ln({ message: "The response body is empty." });
3005
+ if (!l.body) throw new dn({ message: "The response body is empty." });
3006
3006
  return this.processResponseStream(l.body);
3007
3007
  }
3008
3008
  }, aa = class extends ia {
@@ -3010,7 +3010,7 @@ var ia = class {
3010
3010
  super(t), this.resumeStreamIsReplay = e;
3011
3011
  }
3012
3012
  processResponseStream(e) {
3013
- return ti({
3013
+ return ri({
3014
3014
  stream: e,
3015
3015
  schema: Ui
3016
3016
  }).pipeThrough(new TransformStream({ async transform(e, t) {
@@ -3022,7 +3022,7 @@ var ia = class {
3022
3022
  get id() {
3023
3023
  return this._id ??= this.generateId();
3024
3024
  }
3025
- constructor({ generateId: e = Rn, id: t, transport: n = new aa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3025
+ constructor({ generateId: e = Bn, id: t, transport: n = new aa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3026
3026
  this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.resumableStreamState = void 0, this.jobExecutor = new ea(), this.activeStopCount = 0, this.stopGeneration = 0, this.sendMessage = async (e, t) => {
3027
3027
  if (e == null) {
3028
3028
  let e = this.pendingApprovalMessageId;
@@ -3062,12 +3062,12 @@ var ia = class {
3062
3062
  } else n = e;
3063
3063
  if (e.messageId != null) {
3064
3064
  let t = this.state.messages.findIndex((t) => t.id === e.messageId);
3065
- if (t === -1) throw new oi({
3065
+ if (t === -1) throw new ci({
3066
3066
  parameter: "message.messageId",
3067
3067
  value: e.messageId,
3068
3068
  message: `message with id ${e.messageId} not found`
3069
3069
  });
3070
- if (this.state.messages[t].role !== "user") throw new oi({
3070
+ if (this.state.messages[t].role !== "user") throw new ci({
3071
3071
  parameter: "message.messageId",
3072
3072
  value: e.messageId,
3073
3073
  message: `message with id ${e.messageId} is not a user message`
@@ -3091,7 +3091,7 @@ var ia = class {
3091
3091
  });
3092
3092
  }, this.regenerate = async ({ messageId: e, ...t } = {}) => {
3093
3093
  let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
3094
- if (n === -1) throw new oi({
3094
+ if (n === -1) throw new ci({
3095
3095
  parameter: "messageId",
3096
3096
  value: e,
3097
3097
  message: `message ${e} not found`
@@ -3396,7 +3396,7 @@ var la = /* @__PURE__ */ t(((e, t) => {
3396
3396
  };
3397
3397
  }
3398
3398
  t.exports = n;
3399
- })), X = /* @__PURE__ */ e(o(), 1), ua = /* @__PURE__ */ e(la(), 1), Z = We();
3399
+ })), X = /* @__PURE__ */ e(o(), 1), ua = /* @__PURE__ */ e(la(), 1), Z = Ke();
3400
3400
  function da(e, t) {
3401
3401
  return t == null ? e : (0, ua.default)(e, t);
3402
3402
  }
@@ -3622,7 +3622,7 @@ function Ea(e) {
3622
3622
  //#endregion
3623
3623
  //#region src/components/chat/agent-activity.tsx
3624
3624
  var Da = (e) => {
3625
- let t = (0, L.c)(19), { running: n, thinking: i, interrupted: a, defaultOpen: o, timing: s, toolCount: c, failedCount: l, steps: u } = e, d = i !== void 0 && i, f = a !== void 0 && a, p = o !== void 0 && o, m = c === void 0 ? 0 : c, h = l === void 0 ? 0 : l, g = u === void 0 ? Oa : u, [_, v] = X.useState(), y = _ ?? (n || p), b = ja(n), x = g.length > 0, S;
3625
+ let t = (0, F.c)(19), { running: n, thinking: i, interrupted: a, defaultOpen: o, timing: s, toolCount: c, failedCount: l, steps: u } = e, d = i !== void 0 && i, f = a !== void 0 && a, p = o !== void 0 && o, m = c === void 0 ? 0 : c, h = l === void 0 ? 0 : l, g = u === void 0 ? Oa : u, [_, v] = X.useState(), y = _ ?? (n || p), b = ja(n), x = g.length > 0, S;
3626
3626
  t[0] !== h || t[1] !== f || t[2] !== b || t[3] !== n || t[4] !== d || t[5] !== s || t[6] !== m ? (S = n ? /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)("output", {
3627
3627
  className: ka,
3628
3628
  children: d ? "Thinking…" : "Working…"
@@ -3647,7 +3647,7 @@ var Da = (e) => {
3647
3647
  onClick: () => v(!y),
3648
3648
  "aria-expanded": y,
3649
3649
  className: "group/activity -mx-1.5 flex items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-1 focus-visible:outline-(--slate-8)",
3650
- children: [C, /* @__PURE__ */ (0, Z.jsx)(fe, {
3650
+ children: [C, /* @__PURE__ */ (0, Z.jsx)(me, {
3651
3651
  "aria-hidden": !0,
3652
3652
  className: r("size-3 shrink-0 opacity-60 transition-transform group-hover/activity:opacity-100", y && "rotate-90")
3653
3653
  })]
@@ -3671,7 +3671,7 @@ function Aa({ interrupted: e, timing: t, toolCount: n }) {
3671
3671
  return e ? r ? `Stopped after ${r}` : "Stopped" : n === 0 ? r ? `Thought for ${r}` : "Thought process" : r ? `Worked for ${r}` : `Worked through ${n} ${n === 1 ? "step" : "steps"}`;
3672
3672
  }
3673
3673
  function ja(e) {
3674
- let t = (0, L.c)(3), [n, r] = X.useState(Ma), i, a;
3674
+ let t = (0, F.c)(3), [n, r] = X.useState(Ma), i, a;
3675
3675
  return t[0] === e ? (i = t[1], a = t[2]) : (i = () => {
3676
3676
  if (!e) return;
3677
3677
  let t = () => r(Date.now()), n = requestAnimationFrame(t), i = setInterval(t, 1e3);
@@ -3686,7 +3686,7 @@ function Ma() {
3686
3686
  //#endregion
3687
3687
  //#region src/components/chat/chat-components.tsx
3688
3688
  var Na = (e) => {
3689
- let t = (0, L.c)(6), { attachment: n } = e;
3689
+ let t = (0, F.c)(6), { attachment: n } = e;
3690
3690
  if (n.mediaType?.startsWith("image/")) {
3691
3691
  let e = n.filename || "Attachment", r;
3692
3692
  return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, Z.jsx)("img", {
@@ -3696,14 +3696,14 @@ var Na = (e) => {
3696
3696
  }), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
3697
3697
  }
3698
3698
  let r;
3699
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, Z.jsx)(Fe, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
3699
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, Z.jsx)(Le, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
3700
3700
  let i = n.filename || "Attachment", a;
3701
3701
  return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, Z.jsxs)("div", {
3702
3702
  className: "flex flex-row gap-1 items-center text-xs",
3703
3703
  children: [r, i]
3704
3704
  }), t[4] = i, t[5] = a), a;
3705
3705
  }, Pa = (e) => {
3706
- let t = (0, L.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
3706
+ let t = (0, F.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
3707
3707
  t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, Z.jsx)("span", {
3708
3708
  className: "truncate font-medium",
3709
3709
  children: r
@@ -3724,7 +3724,7 @@ var Na = (e) => {
3724
3724
  s
3725
3725
  ] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
3726
3726
  let l = c;
3727
- if (a && be(a)) {
3727
+ if (a && Se(a)) {
3728
3728
  let e = i ?? r, n;
3729
3729
  return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, Z.jsx)("a", {
3730
3730
  href: a,
@@ -3745,8 +3745,8 @@ var Na = (e) => {
3745
3745
  //#endregion
3746
3746
  //#region src/components/chat/chat-markdown.tsx
3747
3747
  function Fa(e) {
3748
- let t = (0, L.c)(3), { content: n } = e, r = Ge(at)?.mode, i = r !== "agent" && r !== "code_mode", a;
3749
- return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, Z.jsx)(ne, {
3748
+ let t = (0, F.c)(3), { content: n } = e, r = qe(st)?.mode, i = r !== "agent" && r !== "code_mode", a;
3749
+ return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ (0, Z.jsx)(ae, {
3750
3750
  content: n,
3751
3751
  allowNotebookInsertion: i
3752
3752
  }), t[0] = n, t[1] = i, t[2] = a) : a = t[2], a;
@@ -3764,7 +3764,7 @@ function La(e) {
3764
3764
  //#endregion
3765
3765
  //#region src/components/chat/tool-call/tool-args.tsx
3766
3766
  var Ra = (e) => {
3767
- let t = (0, L.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
3767
+ let t = (0, F.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
3768
3768
  if (n == null) return null;
3769
3769
  let a;
3770
3770
  t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, Z.jsx)("h3", {
@@ -3784,12 +3784,12 @@ var Ra = (e) => {
3784
3784
  children: [a, s]
3785
3785
  }), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
3786
3786
  }, za = (e) => {
3787
- let t = (0, L.c)(27), { toolName: n, input: i, approval: o, onApprove: s, className: c } = e, l;
3787
+ let t = (0, F.c)(27), { toolName: n, input: i, approval: o, onApprove: s, className: c } = e, l;
3788
3788
  t[0] === c ? l = t[1] : (l = r("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
3789
3789
  let u;
3790
3790
  t[2] === n ? u = t[3] : (u = La(n), t[2] = n, t[3] = u);
3791
3791
  let d = `Approval required for ${u}`, f;
3792
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Z.jsx)(Qt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
3792
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, Z.jsx)(en, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
3793
3793
  let p;
3794
3794
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, Z.jsx)("span", {
3795
3795
  className: "font-semibold",
@@ -3853,47 +3853,47 @@ var Ra = (e) => {
3853
3853
  get_marimo_rules: {
3854
3854
  running: "Reading marimo guidelines",
3855
3855
  done: "Read marimo guidelines",
3856
- icon: zt
3856
+ icon: Vt
3857
3857
  },
3858
3858
  get_active_notebooks: {
3859
3859
  running: "Listing notebooks",
3860
3860
  done: "Listed notebooks",
3861
- icon: Kt
3861
+ icon: Jt
3862
3862
  },
3863
3863
  get_lightweight_cell_map: {
3864
3864
  running: "Reading notebook",
3865
3865
  done: "Read notebook",
3866
- icon: Wt
3866
+ icon: Kt
3867
3867
  },
3868
3868
  get_cell_runtime_data: {
3869
3869
  running: "Inspecting cells",
3870
3870
  done: "Inspected cells",
3871
- icon: Yt
3871
+ icon: Zt
3872
3872
  },
3873
3873
  get_cell_outputs: {
3874
3874
  running: "Reading cell outputs",
3875
3875
  done: "Read cell outputs",
3876
- icon: Yt
3876
+ icon: Zt
3877
3877
  },
3878
3878
  get_tables_and_variables: {
3879
3879
  running: "Reading variables",
3880
3880
  done: "Read variables",
3881
- icon: f
3881
+ icon: p
3882
3882
  },
3883
3883
  get_database_tables: {
3884
3884
  running: "Reading database tables",
3885
3885
  done: "Read database tables",
3886
- icon: d
3886
+ icon: f
3887
3887
  },
3888
3888
  get_notebook_errors: {
3889
3889
  running: "Checking for errors",
3890
3890
  done: "Checked for errors",
3891
- icon: Ht
3891
+ icon: Wt
3892
3892
  },
3893
3893
  lint_notebook: {
3894
3894
  running: "Linting notebook",
3895
3895
  done: "Linted notebook",
3896
- icon: Gt
3896
+ icon: qt
3897
3897
  },
3898
3898
  get_cell_dependency_graph: {
3899
3899
  running: "Reading dependency graph",
@@ -3904,12 +3904,12 @@ var Ra = (e) => {
3904
3904
  add_cell: {
3905
3905
  running: "Adding cell",
3906
3906
  done: "Added cell",
3907
- icon: ye
3907
+ icon: xe
3908
3908
  },
3909
3909
  update_cell: {
3910
3910
  running: "Editing cell",
3911
3911
  done: "Edited cell",
3912
- icon: Be
3912
+ icon: He
3913
3913
  },
3914
3914
  delete_cell: {
3915
3915
  running: "Deleting cell",
@@ -3922,7 +3922,7 @@ function Ha(e, t, n) {
3922
3922
  if (r === "execute_code") return {
3923
3923
  label: n === "running" ? "Running code" : "Ran code",
3924
3924
  detail: Ga(t) ? Wa(t.code) : void 0,
3925
- icon: u
3925
+ icon: d
3926
3926
  };
3927
3927
  if (r === "edit_notebook_tool") {
3928
3928
  let e = Ua(t);
@@ -3936,7 +3936,7 @@ function Ha(e, t, n) {
3936
3936
  }
3937
3937
  return {
3938
3938
  label: n === "running" ? "Editing notebook" : "Edited notebook",
3939
- icon: Be
3939
+ icon: He
3940
3940
  };
3941
3941
  }
3942
3942
  if (Object.hasOwn(Ba, r)) {
@@ -3949,7 +3949,7 @@ function Ha(e, t, n) {
3949
3949
  return {
3950
3950
  label: n === "running" ? "Calling" : "Called",
3951
3951
  detail: r,
3952
- icon: p
3952
+ icon: m
3953
3953
  };
3954
3954
  }
3955
3955
  function Ua(e) {
@@ -3971,17 +3971,17 @@ function Ga(e) {
3971
3971
  //#endregion
3972
3972
  //#region src/components/chat/tool-call/tool-result.tsx
3973
3973
  function Ka(e) {
3974
- return e == null || typeof e == "object" && gt(e);
3975
- }
3976
- var qa = lt({
3977
- status: mt().default("success"),
3978
- auth_required: Qe().default(!1),
3979
- action_url: ft().optional(),
3980
- next_steps: ft().optional(),
3981
- meta: ft().optional(),
3982
- message: mt().nullish()
3974
+ return e == null || typeof e == "object" && vt(e);
3975
+ }
3976
+ var qa = dt({
3977
+ status: gt().default("success"),
3978
+ auth_required: et().default(!1),
3979
+ action_url: mt().optional(),
3980
+ next_steps: mt().optional(),
3981
+ meta: mt().optional(),
3982
+ message: gt().nullish()
3983
3983
  }), Ja = (e) => {
3984
- let t = (0, L.c)(12), { data: n } = e, r;
3984
+ let t = (0, F.c)(12), { data: n } = e, r;
3985
3985
  if (t[0] !== n) {
3986
3986
  let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
3987
3987
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, Z.jsx)("h3", {
@@ -4027,7 +4027,7 @@ var qa = lt({
4027
4027
  } else r = t[1];
4028
4028
  return r;
4029
4029
  }, Ya = (e) => {
4030
- let t = (0, L.c)(8), { result: n } = e, r;
4030
+ let t = (0, F.c)(8), { result: n } = e, r;
4031
4031
  t[0] === n ? r = t[1] : (r = qa.safeParse(n), t[0] = n, t[1] = r);
4032
4032
  let i = r;
4033
4033
  if (i.success) {
@@ -4058,7 +4058,7 @@ function Xa(e) {
4058
4058
  //#endregion
4059
4059
  //#region src/components/chat/tool-call/tool-step.tsx
4060
4060
  var Za = (e) => {
4061
- let t = (0, L.c)(58), { toolName: n, state: i, input: a, result: o, errorText: s, approval: c, isActive: l, className: u } = e, d = l === void 0 || l, [f, p] = X.useState(!1), m, h, g, _, v, y, b, x, S, C, w;
4061
+ let t = (0, F.c)(58), { toolName: n, state: i, input: a, result: o, errorText: s, approval: c, isActive: l, className: u } = e, d = l === void 0 || l, [f, p] = X.useState(!1), m, h, g, _, v, y, b, x, S, C, w;
4062
4062
  if (t[0] !== u || t[1] !== a || t[2] !== d || t[3] !== f || t[4] !== i || t[5] !== n) {
4063
4063
  let e = Ia.has(i), { label: o, detail: s, icon: c } = Ha(n, a, e ? "running" : "done");
4064
4064
  g = o, h = s, _ = Qa(i, e && !d, c);
@@ -4087,15 +4087,15 @@ var Za = (e) => {
4087
4087
  className: "shrink-0 opacity-80",
4088
4088
  children: ["· ", _.suffix]
4089
4089
  }), t[31] = _.suffix, t[32] = O);
4090
- let k = f && "rotate-90 opacity-100", A;
4091
- t[33] === k ? A = t[34] : (A = r("size-3 shrink-0 opacity-40 transition-transform group-hover/step:opacity-100", k), t[33] = k, t[34] = A);
4092
- let j;
4093
- t[35] === A ? j = t[36] : (j = /* @__PURE__ */ (0, Z.jsx)(fe, {
4090
+ let ee = f && "rotate-90 opacity-100", k;
4091
+ t[33] === ee ? k = t[34] : (k = r("size-3 shrink-0 opacity-40 transition-transform group-hover/step:opacity-100", ee), t[33] = ee, t[34] = k);
4092
+ let A;
4093
+ t[35] === k ? A = t[36] : (A = /* @__PURE__ */ (0, Z.jsx)(me, {
4094
4094
  "aria-hidden": !0,
4095
- className: A
4096
- }), t[35] = A, t[36] = j);
4097
- let M;
4098
- t[37] !== E || t[38] !== D || t[39] !== O || t[40] !== j || t[41] !== b || t[42] !== x || t[43] !== S || t[44] !== C || t[45] !== T ? (M = /* @__PURE__ */ (0, Z.jsxs)("button", {
4095
+ className: k
4096
+ }), t[35] = k, t[36] = A);
4097
+ let j;
4098
+ t[37] !== E || t[38] !== D || t[39] !== O || t[40] !== A || t[41] !== b || t[42] !== x || t[43] !== S || t[44] !== C || t[45] !== T ? (j = /* @__PURE__ */ (0, Z.jsxs)("button", {
4099
4099
  type: b,
4100
4100
  onClick: x,
4101
4101
  "aria-expanded": S,
@@ -4105,46 +4105,46 @@ var Za = (e) => {
4105
4105
  E,
4106
4106
  D,
4107
4107
  O,
4108
- j
4108
+ A
4109
4109
  ]
4110
- }), t[37] = E, t[38] = D, t[39] = O, t[40] = j, t[41] = b, t[42] = x, t[43] = S, t[44] = C, t[45] = T, t[46] = M) : M = t[46];
4111
- let N;
4112
- t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (N = f && /* @__PURE__ */ (0, Z.jsx)($a, {
4110
+ }), t[37] = E, t[38] = D, t[39] = O, t[40] = A, t[41] = b, t[42] = x, t[43] = S, t[44] = C, t[45] = T, t[46] = j) : j = t[46];
4111
+ let te;
4112
+ t[47] !== c || t[48] !== s || t[49] !== a || t[50] !== f || t[51] !== o || t[52] !== i ? (te = f && /* @__PURE__ */ (0, Z.jsx)($a, {
4113
4113
  state: i,
4114
4114
  input: a,
4115
4115
  result: o,
4116
4116
  errorText: s,
4117
4117
  approval: c
4118
- }), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] = N) : N = t[53];
4119
- let P;
4120
- return t[54] !== M || t[55] !== N || t[56] !== w ? (P = /* @__PURE__ */ (0, Z.jsxs)("div", {
4118
+ }), t[47] = c, t[48] = s, t[49] = a, t[50] = f, t[51] = o, t[52] = i, t[53] = te) : te = t[53];
4119
+ let M;
4120
+ return t[54] !== j || t[55] !== te || t[56] !== w ? (M = /* @__PURE__ */ (0, Z.jsxs)("div", {
4121
4121
  className: w,
4122
- children: [M, N]
4123
- }), t[54] = M, t[55] = N, t[56] = w, t[57] = P) : P = t[57], P;
4122
+ children: [j, te]
4123
+ }), t[54] = j, t[55] = te, t[56] = w, t[57] = M) : M = t[57], M;
4124
4124
  };
4125
4125
  function Qa(e, t, n) {
4126
4126
  if (t) return {
4127
- icon: Ut,
4127
+ icon: Gt,
4128
4128
  suffix: "Stopped"
4129
4129
  };
4130
4130
  switch (e) {
4131
4131
  case "output-error": return {
4132
- icon: h,
4132
+ icon: g,
4133
4133
  suffix: "Failed"
4134
4134
  };
4135
4135
  case "output-denied": return {
4136
- icon: Rt,
4136
+ icon: Bt,
4137
4137
  suffix: "Denied"
4138
4138
  };
4139
4139
  case "output-available": return { icon: n };
4140
4140
  default: return {
4141
- icon: m,
4141
+ icon: h,
4142
4142
  spinning: !0
4143
4143
  };
4144
4144
  }
4145
4145
  }
4146
4146
  var $a = (e) => {
4147
- let t = (0, L.c)(16), { state: n, input: r, result: i, errorText: a, approval: o } = e, s;
4147
+ let t = (0, F.c)(16), { state: n, input: r, result: i, errorText: a, approval: o } = e, s;
4148
4148
  t[0] === r ? s = t[1] : (s = /* @__PURE__ */ (0, Z.jsx)(Ra, { input: r }), t[0] = r, t[1] = s);
4149
4149
  let c;
4150
4150
  t[2] !== i || t[3] !== n ? (c = n === "output-available" && i != null && /* @__PURE__ */ (0, Z.jsx)(Ya, { result: i }), t[2] = i, t[3] = n, t[4] = c) : c = t[4];
@@ -4175,7 +4175,7 @@ function eo(e) {
4175
4175
  //#endregion
4176
4176
  //#region src/components/chat/tool-call/tool-call-view.tsx
4177
4177
  var to = (e) => {
4178
- let t = (0, L.c)(16), n, r, i, a, o;
4178
+ let t = (0, F.c)(16), n, r, i, a, o;
4179
4179
  if (t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5]) : ({toolName: o, state: a, approval: n, onApprove: r, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o), a === "approval-requested") {
4180
4180
  let e;
4181
4181
  return t[6] !== n || t[7] !== r || t[8] !== i || t[9] !== o ? (e = n != null && r != null ? /* @__PURE__ */ (0, Z.jsx)(za, {
@@ -4234,7 +4234,7 @@ var to = (e) => {
4234
4234
  }, t);
4235
4235
  case "reasoning": return /* @__PURE__ */ (0, Z.jsxs)("div", {
4236
4236
  className: "flex gap-1.5 py-1.5 text-muted-foreground",
4237
- children: [/* @__PURE__ */ (0, Z.jsx)(Vt, {
4237
+ children: [/* @__PURE__ */ (0, Z.jsx)(Ut, {
4238
4238
  "aria-hidden": !0,
4239
4239
  className: "-ml-px mt-1 size-3 shrink-0"
4240
4240
  }), /* @__PURE__ */ (0, Z.jsxs)("div", {
@@ -4252,12 +4252,12 @@ var to = (e) => {
4252
4252
  url: e.url
4253
4253
  } }, t);
4254
4254
  case "source-document": return /* @__PURE__ */ (0, Z.jsx)(Pa, {
4255
- icon: /* @__PURE__ */ (0, Z.jsx)(x, { className: "h-3 w-3 shrink-0" }),
4255
+ icon: /* @__PURE__ */ (0, Z.jsx)(S, { className: "h-3 w-3 shrink-0" }),
4256
4256
  title: e.title,
4257
4257
  subtitle: e.filename
4258
4258
  }, t);
4259
4259
  case "source-url": return /* @__PURE__ */ (0, Z.jsx)(Pa, {
4260
- icon: /* @__PURE__ */ (0, Z.jsx)(ke, { className: "h-3 w-3 shrink-0" }),
4260
+ icon: /* @__PURE__ */ (0, Z.jsx)(je, { className: "h-3 w-3 shrink-0" }),
4261
4261
  title: e.title ?? e.url,
4262
4262
  subtitle: e.title ? e.url : void 0,
4263
4263
  href: e.url
@@ -4267,7 +4267,7 @@ var to = (e) => {
4267
4267
  children: e.kind
4268
4268
  }, t);
4269
4269
  case "step-start": return null;
4270
- default: return Ve(e), null;
4270
+ default: return Ue(e), null;
4271
4271
  }
4272
4272
  }
4273
4273
  };
@@ -4343,12 +4343,12 @@ var ho = class extends j {
4343
4343
  super(), this.store = e;
4344
4344
  }
4345
4345
  getItems() {
4346
- let e = this.store.get(De);
4346
+ let e = this.store.get(ke);
4347
4347
  return e.cellIds.map((t, n) => {
4348
4348
  let r = e.cellData[t];
4349
4349
  return {
4350
4350
  uri: this.asURI(t),
4351
- name: Ne(r.name, n),
4351
+ name: Fe(r.name, n),
4352
4352
  type: this.contextType,
4353
4353
  description: "Cell code",
4354
4354
  data: {
@@ -4365,7 +4365,7 @@ var ho = class extends j {
4365
4365
  };
4366
4366
  }
4367
4367
  formatContext(e) {
4368
- return P({
4368
+ return ne({
4369
4369
  type: "cell",
4370
4370
  data: {
4371
4371
  cellId: e.data.cellId,
@@ -4402,9 +4402,9 @@ var _o = class extends j {
4402
4402
  super(), this.store = e;
4403
4403
  }
4404
4404
  getItems() {
4405
- let e = this.store.get(De), t = [];
4405
+ let e = this.store.get(ke), t = [];
4406
4406
  for (let n of e.cellIds) {
4407
- let r = bo(n, e, this.store.get(Ee(n))), i = r.cellOutput;
4407
+ let r = bo(n, e, this.store.get(Oe(n))), i = r.cellOutput;
4408
4408
  if (!i) continue;
4409
4409
  let a = i.output.mimetype || "unknown";
4410
4410
  t.push({
@@ -4428,7 +4428,7 @@ var _o = class extends j {
4428
4428
  detail: `${t.outputType} output`,
4429
4429
  boost: t.outputType === "media" ? k.HIGH : k.MEDIUM,
4430
4430
  type: this.contextType,
4431
- section: F.CELL_OUTPUT,
4431
+ section: N.CELL_OUTPUT,
4432
4432
  apply: `@${n}`,
4433
4433
  info: () => {
4434
4434
  let e = document.createElement("div");
@@ -4465,7 +4465,7 @@ var _o = class extends j {
4465
4465
  outputType: t.outputType,
4466
4466
  mimetype: t.output.mimetype
4467
4467
  }, o = `Cell Code:\n${i}\n\n`;
4468
- return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), P({
4468
+ return t.outputType === "text" && t.processedContent ? o += `Output:\n${t.processedContent}` : t.outputType === "media" && (o += `Media Output: Contains ${t.output.mimetype} content`, t.imageUrl && (o += `\nImage URL: ${t.imageUrl}`)), ne({
4469
4469
  type: this.contextType,
4470
4470
  data: a,
4471
4471
  details: o
@@ -4480,7 +4480,7 @@ async function vo(e, t, r) {
4480
4480
  let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
4481
4481
  if (i.length === 0) return [];
4482
4482
  let a = i.flatMap((e) => {
4483
- let i = document.getElementById(Ae.create(t));
4483
+ let i = document.getElementById(Me.create(t));
4484
4484
  return i ? {
4485
4485
  cellId: t,
4486
4486
  cellName: r,
@@ -4493,15 +4493,15 @@ async function vo(e, t, r) {
4493
4493
  type: "file",
4494
4494
  filename: `${r}-output-screenshot`,
4495
4495
  mediaType: "image/png",
4496
- url: await ie(e.element)
4496
+ url: await ce(e.element)
4497
4497
  })));
4498
4498
  } catch (e) {
4499
4499
  return n.error("Error downloading cell output images:", e), [];
4500
4500
  }
4501
4501
  }
4502
4502
  function yo(e) {
4503
- if (E(e)) return null;
4504
- let t = e.mimetype, n = go(t, String(e.data)) ? "media" : "text", r = Re(e), i, a = !1;
4503
+ if (D(e)) return null;
4504
+ let t = e.mimetype, n = go(t, String(e.data)) ? "media" : "text", r = Be(e), i, a = !1;
4505
4505
  return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
4506
4506
  processedContent: r,
4507
4507
  imageUrl: i,
@@ -4511,8 +4511,8 @@ function yo(e) {
4511
4511
  };
4512
4512
  }
4513
4513
  function bo(e, t, n, r) {
4514
- let i = t.cellData[e], a = t.cellIds.indexOf(e), o = Ne(i.name, a), s = r?.map(yo).filter((e) => e !== null), c;
4515
- return n !== null && !E(n) && (c = yo(n) ?? void 0), {
4514
+ let i = t.cellData[e], a = t.cellIds.indexOf(e), o = Fe(i.name, a), s = r?.map(yo).filter((e) => e !== null), c;
4515
+ return n !== null && !D(n) && (c = yo(n) ?? void 0), {
4516
4516
  cellId: e,
4517
4517
  cellName: o,
4518
4518
  cellCode: i.code,
@@ -4524,14 +4524,14 @@ function bo(e, t, n, r) {
4524
4524
  //#region src/core/ai/context/providers/error.ts
4525
4525
  function xo(e, t) {
4526
4526
  let n = [`Code:\n${e.cellCode}`];
4527
- if (e.tracebackHtml && n.push(`Traceback:\n${Te(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => je(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
4528
- let r = oe(e.cellId, t);
4527
+ if (e.tracebackHtml && n.push(`Traceback:\n${De(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Ne(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
4528
+ let r = le(e.cellId, t);
4529
4529
  r && n.push(`Database schema:\n${r}`);
4530
4530
  }
4531
4531
  return n.join("\n\n");
4532
4532
  }
4533
4533
  function So(e, t) {
4534
- return P({
4534
+ return ne({
4535
4535
  type: "error",
4536
4536
  data: {
4537
4537
  name: e.cellName || `Cell ${e.cellId}`,
@@ -4541,12 +4541,12 @@ function So(e, t) {
4541
4541
  });
4542
4542
  }
4543
4543
  function Co(e) {
4544
- return e.errorData.length === 1 ? Me(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Te(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
4544
+ return e.errorData.length === 1 ? Pe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? De(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
4545
4545
  }
4546
4546
  function wo(e) {
4547
4547
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
4548
4548
  }
4549
- var To = new T("error", "errors"), Eo = class extends j {
4549
+ var To = new ie("error", "errors"), Eo = class extends j {
4550
4550
  title = "Errors";
4551
4551
  mentionPrefix = "@";
4552
4552
  contextType = "error";
@@ -4555,7 +4555,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4555
4555
  super(), this.store = e;
4556
4556
  }
4557
4557
  getItems() {
4558
- let e = Oe(this.store);
4558
+ let e = Ae(this.store);
4559
4559
  if (e.length === 0) return [];
4560
4560
  let t = [{
4561
4561
  uri: this.asURI("all"),
@@ -4588,7 +4588,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4588
4588
  detail: `${t} ${To.pluralize(t)}`,
4589
4589
  type: "error",
4590
4590
  apply: "@error://all",
4591
- section: F.ERROR,
4591
+ section: N.ERROR,
4592
4592
  info: () => {
4593
4593
  let e = document.createElement("div");
4594
4594
  e.classList.add("mo-cm-tooltip", "docs-documentation", "min-w-[200px]", "flex", "flex-col", "gap-1", "p-2");
@@ -4608,19 +4608,19 @@ var To = new T("error", "errors"), Eo = class extends j {
4608
4608
  detail: Co(t),
4609
4609
  type: "error"
4610
4610
  }),
4611
- section: F.ERROR
4611
+ section: N.ERROR
4612
4612
  };
4613
4613
  }
4614
4614
  return {
4615
4615
  label: "Error",
4616
4616
  displayLabel: "Error",
4617
- section: F.ERROR
4617
+ section: N.ERROR
4618
4618
  };
4619
4619
  }
4620
4620
  formatContext(e) {
4621
4621
  return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => So(e, this.store)).join("\n\n");
4622
4622
  }
4623
- }, Do = le(), Oo = {
4623
+ }, Do = O(), Oo = {
4624
4624
  maxDepth: 3,
4625
4625
  maxResults: 20,
4626
4626
  defaultResultsLimit: 5,
@@ -4727,7 +4727,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4727
4727
  return {
4728
4728
  ...this.createBasicCompletion(e),
4729
4729
  type: "file",
4730
- section: F.FILE,
4730
+ section: N.FILE,
4731
4731
  boost: t.isDirectory ? k.MEDIUM : k.LOW,
4732
4732
  detail: t.path,
4733
4733
  displayLabel: `${i} ${r}`,
@@ -4742,7 +4742,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4742
4742
  description: e.message
4743
4743
  }), null));
4744
4744
  if (!l) return;
4745
- let u = l.mimeType || "text/plain", d = Pe({
4745
+ let u = l.mimeType || "text/plain", d = Ie({
4746
4746
  contents: l.contents ?? "",
4747
4747
  mimeType: u,
4748
4748
  isBase64: l.isBase64 ?? !1
@@ -4751,7 +4751,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4751
4751
  from: a,
4752
4752
  to: o,
4753
4753
  insert: ""
4754
- } }), Mt(e);
4754
+ } }), Pt(e);
4755
4755
  },
4756
4756
  info: () => {
4757
4757
  let e = document.createElement("div");
@@ -4765,7 +4765,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4765
4765
  }
4766
4766
  formatContext(e) {
4767
4767
  let { data: t, name: n } = e;
4768
- return P({
4768
+ return ne({
4769
4769
  type: this.contextType,
4770
4770
  data: {
4771
4771
  name: n,
@@ -4805,7 +4805,7 @@ var To = new T("error", "errors"), Eo = class extends j {
4805
4805
  l += `${t}\n`;
4806
4806
  }
4807
4807
  }
4808
- return P({
4808
+ return ne({
4809
4809
  type: this.contextType,
4810
4810
  data: {
4811
4811
  name: o,
@@ -4821,11 +4821,11 @@ var To = new T("error", "errors"), Eo = class extends j {
4821
4821
  displayLabel: t,
4822
4822
  detail: n.source === "memory" ? "in-memory" : n.source,
4823
4823
  boost: n.source_type === "local" ? k.LOCAL_TABLE : k.REMOTE_TABLE,
4824
- type: te(n),
4824
+ type: ee(n),
4825
4825
  apply: `@${t}`,
4826
4826
  section: {
4827
- name: te(n) === "dataframe" ? "Dataframe" : "Table",
4828
- rank: F.TABLE.rank
4827
+ name: ee(n) === "dataframe" ? "Dataframe" : "Table",
4828
+ rank: N.TABLE.rank
4829
4829
  },
4830
4830
  info: () => this.createTableInfoElement(t, n)
4831
4831
  };
@@ -4910,13 +4910,13 @@ var To = new T("error", "errors"), Eo = class extends j {
4910
4910
  displayLabel: n.name,
4911
4911
  detail: n.dataType ?? "",
4912
4912
  type: this.contextType,
4913
- section: F.VARIABLE,
4914
- info: () => re(n)
4913
+ section: N.VARIABLE,
4914
+ info: () => se(n)
4915
4915
  };
4916
4916
  }
4917
4917
  formatContext(e) {
4918
4918
  let { data: t } = e, { variable: n } = t;
4919
- return P({
4919
+ return ne({
4920
4920
  type: this.contextType,
4921
4921
  data: {
4922
4922
  name: n.name,
@@ -4929,11 +4929,11 @@ var To = new T("error", "errors"), Eo = class extends j {
4929
4929
  //#endregion
4930
4930
  //#region src/core/ai/context/context.ts
4931
4931
  function Mo(e) {
4932
- let t = e.get(ae), n = e.get(O), r = e.get(M);
4933
- return new A().register(new Ao(n)).register(new jo(r, n)).register(new Eo(e)).register(new _o(e)).register(new ho(e)).register(new N(t.connectionsMap, n));
4932
+ let t = e.get(u), n = e.get(x), r = e.get(C);
4933
+ return new A().register(new Ao(n)).register(new jo(r, n)).register(new Eo(e)).register(new _o(e)).register(new ho(e)).register(new M(t.connectionsMap, n));
4934
4934
  }
4935
4935
  function No() {
4936
- return new ko(Ce());
4936
+ return new ko(Te());
4937
4937
  }
4938
4938
  //#endregion
4939
4939
  //#region src/components/editor/ai/completion-utils.ts
@@ -4955,7 +4955,7 @@ async function Fo(e) {
4955
4955
  type: "file",
4956
4956
  mediaType: t.type,
4957
4957
  filename: e.name,
4958
- url: await Ie(t)
4958
+ url: await Re(t)
4959
4959
  };
4960
4960
  }));
4961
4961
  }
@@ -4968,11 +4968,11 @@ function Io(e) {
4968
4968
  //#endregion
4969
4969
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/utils/facet.js
4970
4970
  function Lo(e) {
4971
- return At.define({ combine: (t) => t[0] ?? e });
4971
+ return Mt.define({ combine: (t) => t[0] ?? e });
4972
4972
  }
4973
4973
  //#endregion
4974
4974
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-ai@0.3.10_@codemirror+state@6.7.6_@codemirror+view@6.43.13/node_modules/@marimo-team/codemirror-ai/dist/prompt-history/extension.js
4975
- var Ro = Lo({}), zo = St.define(), Bo = St.define(), Vo = 50, Ho = Tt.define({
4975
+ var Ro = Lo({}), zo = wt.define(), Bo = wt.define(), Vo = 50, Ho = Dt.define({
4976
4976
  create() {
4977
4977
  return {
4978
4978
  prompts: [],
@@ -5031,7 +5031,7 @@ function Go(e = {}) {
5031
5031
  navigationIndex: -1,
5032
5032
  originalText: ""
5033
5033
  })), Ro.of(t ?? {})];
5034
- return n && r.push(Ot.of([{
5034
+ return n && r.push(At.of([{
5035
5035
  key: "ArrowUp",
5036
5036
  run: Uo
5037
5037
  }, {
@@ -5041,7 +5041,7 @@ function Go(e = {}) {
5041
5041
  }
5042
5042
  //#endregion
5043
5043
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_7a070d6d3cd24348faf68fbca252ab72/node_modules/@marimo-team/codemirror-mcp/dist/state.js
5044
- var Ko = St.define(), Q = Tt.define({
5044
+ var Ko = wt.define(), Q = Dt.define({
5045
5045
  create() {
5046
5046
  return /* @__PURE__ */ new Map();
5047
5047
  },
@@ -5053,7 +5053,7 @@ var Ko = St.define(), Q = Tt.define({
5053
5053
  }
5054
5054
  return r;
5055
5055
  }
5056
- }), qo = Tt.define({
5056
+ }), qo = Dt.define({
5057
5057
  create() {
5058
5058
  return {
5059
5059
  onResourceClick: void 0,
@@ -5065,8 +5065,8 @@ var Ko = St.define(), Q = Tt.define({
5065
5065
  update(e) {
5066
5066
  return e;
5067
5067
  }
5068
- }), Jo = St.define();
5069
- Tt.define({
5068
+ }), Jo = wt.define();
5069
+ Dt.define({
5070
5070
  create() {
5071
5071
  return /* @__PURE__ */ new Map();
5072
5072
  },
@@ -5114,7 +5114,7 @@ function $(e) {
5114
5114
  }
5115
5115
  //#endregion
5116
5116
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_7a070d6d3cd24348faf68fbca252ab72/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
5117
- var Zo = class extends Ct {
5117
+ var Zo = class extends Tt {
5118
5118
  resource;
5119
5119
  view;
5120
5120
  constructor(e, t) {
@@ -5135,7 +5135,7 @@ var Zo = class extends Ct {
5135
5135
  e.preventDefault(), e.stopPropagation(), i(this.resource);
5136
5136
  }), e;
5137
5137
  }
5138
- }, Qo = class extends Ct {
5138
+ }, Qo = class extends Tt {
5139
5139
  uri;
5140
5140
  view;
5141
5141
  constructor(e, t) {
@@ -5155,12 +5155,12 @@ function $o(e) {
5155
5155
  let a = e.state.doc.sliceString(r, i);
5156
5156
  for (let i of $(a)) {
5157
5157
  let a = r + i.index, o = i[0].slice(1), s = t.get(o);
5158
- s ? n.push(bt.replace({ widget: new Zo(s, e) }).range(a, a + i[0].length)) : n.push(bt.replace({ widget: new Qo(o, e) }).range(a, a + i[0].length));
5158
+ s ? n.push(St.replace({ widget: new Zo(s, e) }).range(a, a + i[0].length)) : n.push(St.replace({ widget: new Qo(o, e) }).range(a, a + i[0].length));
5159
5159
  }
5160
5160
  }
5161
- return bt.set(n);
5161
+ return St.set(n);
5162
5162
  }
5163
- var es = Et.fromClass(class {
5163
+ var es = Ot.fromClass(class {
5164
5164
  decorations;
5165
5165
  constructor(e) {
5166
5166
  this.decorations = $o(e);
@@ -5200,7 +5200,7 @@ function ns(e, t, n, r = 0) {
5200
5200
  return null;
5201
5201
  }
5202
5202
  function rs(e) {
5203
- return kt((t, n) => {
5203
+ return jt((t, n) => {
5204
5204
  let { from: r, text: i } = t.state.doc.lineAt(n), a = ns(i, n, t.state.field(Q), r);
5205
5205
  return a ? {
5206
5206
  pos: a.start,
@@ -5270,8 +5270,8 @@ function cs(e, t) {
5270
5270
  }
5271
5271
  return null;
5272
5272
  }
5273
- var ls = Dt.transactionFilter.of((e) => {
5274
- let t = e.annotation(yt.userEvent);
5273
+ var ls = kt.transactionFilter.of((e) => {
5274
+ let t = e.annotation(xt.userEvent);
5275
5275
  if (!t) return e;
5276
5276
  let n = e.startState.selection.main;
5277
5277
  if (!n.empty) return e;
@@ -5444,11 +5444,11 @@ function hs(e, t) {
5444
5444
  };
5445
5445
  }
5446
5446
  function gs(e, t = {}) {
5447
- return Et.fromClass(hs(e, t));
5447
+ return Ot.fromClass(hs(e, t));
5448
5448
  }
5449
5449
  //#endregion
5450
5450
  //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_7a070d6d3cd24348faf68fbca252ab72/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5451
- var _s = wt.baseTheme({
5451
+ var _s = Et.baseTheme({
5452
5452
  ".cm-resource-widget": {
5453
5453
  background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
5454
5454
  borderRadius: "4px",
@@ -5481,10 +5481,10 @@ function Ss(e) {
5481
5481
  let { language: t, store: r, onAddFiles: i } = e, a = () => xs(r);
5482
5482
  return [
5483
5483
  t.data.of({ autocomplete: Yo(async () => a(), (e) => e.type === vs ? bs : Mo(r).getProvider(e.type)?.formatCompletion(e) || {}) }),
5484
- xt.high(Ot.of([{
5484
+ Ct.high(At.of([{
5485
5485
  key: "Tab",
5486
5486
  preventDefault: !0,
5487
- run: (e) => jt(e)
5487
+ run: (e) => Nt(e)
5488
5488
  }])),
5489
5489
  Do.of({ addAttachment: (e) => i?.([e]) }),
5490
5490
  ...i ? [t.data.of({ autocomplete: No().createCompletionSource() })] : [],
@@ -5513,26 +5513,26 @@ function Cs(e) {
5513
5513
  }
5514
5514
  //#endregion
5515
5515
  //#region src/components/editor/ai/prompt-input.tsx
5516
- var ws = "marimo:ai-prompt-history", Ts = new Se(Je(mt()), () => []), Es = (e) => {
5517
- let t = (0, L.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: m } = e, h = vt(l), _ = vt(d), v = qe(), { theme: y } = nt(), b;
5518
- t[0] === p ? b = t[1] : (b = (e) => p ? Po([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = b);
5519
- let x = vt(b), S;
5520
- if (t[2] !== x || t[3] !== _ || t[4] !== h || t[5] !== f || t[6] !== a || t[7] !== v) {
5521
- let e = Pt(), n;
5522
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = Nt({}), t[9] = n) : n = t[9];
5516
+ var ws = "marimo:ai-prompt-history", Ts = new Ee(Xe(gt()), () => []), Es = (e) => {
5517
+ let t = (0, F.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: m } = e, h = bt(l), g = bt(d), _ = Ye(), { theme: v } = it(), y;
5518
+ t[0] === p ? y = t[1] : (y = (e) => p ? Po([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = y);
5519
+ let b = bt(y), x;
5520
+ if (t[2] !== b || t[3] !== g || t[4] !== h || t[5] !== f || t[6] !== a || t[7] !== _) {
5521
+ let e = Rt(), n;
5522
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (n = Ft({}), t[9] = n) : n = t[9];
5523
5523
  let r = Ss({
5524
5524
  language: e.language,
5525
- store: v,
5525
+ store: _,
5526
5526
  onAddFiles: f
5527
- }), i = e.language.data.of({ autocomplete: x }), o;
5527
+ }), i = e.language.data.of({ autocomplete: b }), o;
5528
5528
  t[10] === Symbol.for("react.memo_cache_sentinel") ? (o = Go({ storage: {
5529
5529
  load: Ds,
5530
5530
  save: Os
5531
5531
  } }), t[10] = o) : o = t[10];
5532
5532
  let s;
5533
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (s = Ft(), t[11] = s) : s = t[11];
5533
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (s = It(), t[11] = s) : s = t[11];
5534
5534
  let c;
5535
- t[12] === h ? c = t[13] : (c = xt.highest(Ot.of([{
5535
+ t[12] === h ? c = t[13] : (c = Ct.highest(At.of([{
5536
5536
  preventDefault: !0,
5537
5537
  stopPropagation: !0,
5538
5538
  any: (e, t) => {
@@ -5541,40 +5541,40 @@ var ws = "marimo:ai-prompt-history", Ts = new Se(Je(mt()), () => []), Es = (e) =
5541
5541
  }
5542
5542
  }])), t[12] = h, t[13] = c);
5543
5543
  let l;
5544
- t[14] === _ ? l = t[15] : (l = Ot.of([{
5544
+ t[14] === g ? l = t[15] : (l = At.of([{
5545
5545
  key: "Escape",
5546
5546
  preventDefault: !0,
5547
5547
  stopPropagation: !0,
5548
- run: () => (_(), !0)
5549
- }]), t[14] = _, t[15] = l), S = [
5550
- ...a ? g(a) : [],
5548
+ run: () => (g(), !0)
5549
+ }]), t[14] = g, t[15] = l), x = [
5550
+ ...a ? oe(a) : [],
5551
5551
  n,
5552
5552
  e,
5553
5553
  r,
5554
5554
  i,
5555
5555
  o,
5556
- wt.lineWrapping,
5556
+ Et.lineWrapping,
5557
5557
  s,
5558
5558
  c,
5559
5559
  l
5560
- ], t[2] = x, t[3] = _, t[4] = h, t[5] = f, t[6] = a, t[7] = v, t[8] = S;
5561
- } else S = t[8];
5562
- let C = S, w;
5563
- t[16] === s ? w = t[17] : (w = r("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = w);
5564
- let T = y === "dark" ? "dark" : "light", E = a ? void 0 : i || "Generate with AI, @ to include context", D;
5565
- return t[18] !== C || t[19] !== o || t[20] !== m || t[21] !== c || t[22] !== u || t[23] !== w || t[24] !== T || t[25] !== E || t[26] !== n ? (D = /* @__PURE__ */ (0, Z.jsx)(It, {
5560
+ ], t[2] = b, t[3] = g, t[4] = h, t[5] = f, t[6] = a, t[7] = _, t[8] = x;
5561
+ } else x = t[8];
5562
+ let S = x, C;
5563
+ t[16] === s ? C = t[17] : (C = r("mo-ai-prompt flex-1 font-sans text-sm leading-6 overflow-auto my-1", s), t[16] = s, t[17] = C);
5564
+ let w = v === "dark" ? "dark" : "light", T = a ? void 0 : i || "Generate with AI, @ to include context", E;
5565
+ return t[18] !== S || t[19] !== o || t[20] !== m || t[21] !== c || t[22] !== u || t[23] !== C || t[24] !== w || t[25] !== T || t[26] !== n ? (E = /* @__PURE__ */ (0, Z.jsx)(Lt, {
5566
5566
  ref: o,
5567
- className: w,
5567
+ className: C,
5568
5568
  width: "100%",
5569
5569
  maxHeight: m,
5570
5570
  value: n,
5571
5571
  basicSetup: !1,
5572
- extensions: C,
5572
+ extensions: S,
5573
5573
  onChange: c,
5574
5574
  onKeyDown: u,
5575
- theme: T,
5576
- placeholder: E
5577
- }), t[18] = C, t[19] = o, t[20] = m, t[21] = c, t[22] = u, t[23] = w, t[24] = T, t[25] = E, t[26] = n, t[27] = D) : D = t[27], D;
5575
+ theme: w,
5576
+ placeholder: T
5577
+ }), t[18] = S, t[19] = o, t[20] = m, t[21] = c, t[22] = u, t[23] = C, t[24] = w, t[25] = T, t[26] = n, t[27] = E) : E = t[27], E;
5578
5578
  };
5579
5579
  function Ds() {
5580
5580
  return Ts.get(ws);
@@ -5584,11 +5584,11 @@ function Os(e) {
5584
5584
  }
5585
5585
  //#endregion
5586
5586
  //#region src/plugins/impl/chat/chat-ui.tsx
5587
- var ks = ce, As = ut({
5588
- type: pt("stream_chunk"),
5589
- message_id: mt(),
5590
- content: ft().nullable().transform((e) => e),
5591
- is_final: Qe().optional()
5587
+ var ks = de, As = ft({
5588
+ type: ht("stream_chunk"),
5589
+ message_id: gt(),
5590
+ content: mt().nullable().transform((e) => e),
5591
+ is_final: et().optional()
5592
5592
  });
5593
5593
  function js(e, t) {
5594
5594
  let { controllerRef: r, activeRequestIdRef: i } = t, a = r.current;
@@ -5608,7 +5608,7 @@ var Ms = (e) => {
5608
5608
  }, [s]);
5609
5609
  let b = (0, X.useRef)(null), x = (0, X.useRef)(null), S = (0, X.useRef)(null), [C, w] = (0, X.useState)(null), T = () => {
5610
5610
  S.current = null, w(null);
5611
- }, { data: E } = Lt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : E, { messages: k, sendMessage: A, setMessages: j, status: M, stop: N, error: P, regenerate: te, clearError: F, addToolApprovalResponse: ne } = ba({
5611
+ }, { data: E } = zt(async () => (await e.get_chat_history({})).messages, []), D = e.value.length > 0 ? e.value : E, { messages: O, sendMessage: ee, setMessages: k, status: A, stop: j, error: M, regenerate: ne, clearError: N, addToolApprovalResponse: ie } = ba({
5612
5612
  sendAutomaticallyWhen: ({ messages: e }) => Io(e),
5613
5613
  transport: new aa({ fetch: async (t, r) => {
5614
5614
  if (r === void 0) return fetch(t);
@@ -5624,7 +5624,7 @@ var Ms = (e) => {
5624
5624
  let t = i.messages.map((e) => ({
5625
5625
  ...e,
5626
5626
  content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
5627
- })), r = D();
5627
+ })), r = te();
5628
5628
  T();
5629
5629
  let s = new ReadableStream({
5630
5630
  start(t) {
@@ -5660,7 +5660,7 @@ var Ms = (e) => {
5660
5660
  return new Response(t, { status: 400 });
5661
5661
  }
5662
5662
  } }),
5663
- messages: O,
5663
+ messages: D,
5664
5664
  onFinish: ({ messages: t, isAbort: r, finishReason: i }) => {
5665
5665
  if (p(void 0), m.current && (m.current.value = ""), n.debug("Finished streaming message:", {
5666
5666
  finishReason: i,
@@ -5684,7 +5684,7 @@ var Ms = (e) => {
5684
5684
  n.error("An error occurred:", e);
5685
5685
  }
5686
5686
  });
5687
- i(e.host, Le.TYPE, (e) => {
5687
+ i(e.host, ze.TYPE, (e) => {
5688
5688
  let t = As.safeParse(e.detail.message);
5689
5689
  if (t.success) {
5690
5690
  if (t.data.content && t.data.message_id === x.current) {
@@ -5697,27 +5697,27 @@ var Ms = (e) => {
5697
5697
  });
5698
5698
  }
5699
5699
  });
5700
- let re = M === "submitted" || M === "streaming", ie = (t) => {
5701
- let n = k.findIndex((e) => e.id === t);
5700
+ let ae = A === "submitted" || A === "streaming", oe = (t) => {
5701
+ let n = O.findIndex((e) => e.id === t);
5702
5702
  if (n !== -1) {
5703
- let r = k.filter((e) => e.id !== t);
5704
- e.delete_chat_message({ index: n }), j(r), e.setValue(r), r.length === 0 && T();
5703
+ let r = O.filter((e) => e.id !== t);
5704
+ e.delete_chat_message({ index: n }), k(r), e.setValue(r), r.length === 0 && T();
5705
5705
  }
5706
- }, ae = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, oe = {
5706
+ }, se = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, ce = {
5707
5707
  triggerCompletionRegex: /^\/(\w+)?/,
5708
5708
  completions: e.prompts.map((e) => ({
5709
5709
  label: `/${e}`,
5710
5710
  displayLabel: e,
5711
5711
  apply: e
5712
5712
  }))
5713
- }, se = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5713
+ }, le = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5714
5714
  (0, X.useEffect)(() => {
5715
5715
  _.current?.scrollTo({
5716
5716
  top: _.current.scrollHeight,
5717
5717
  behavior: "smooth"
5718
5718
  });
5719
- }, [k.length, _]);
5720
- let ce = () => {
5719
+ }, [O.length, _]);
5720
+ let ue = () => {
5721
5721
  let e = g.current?.view;
5722
5722
  if (e) {
5723
5723
  let t = e.state.doc.length;
@@ -5739,21 +5739,21 @@ var Ms = (e) => {
5739
5739
  "aria-label": "Reset chat",
5740
5740
  variant: "text",
5741
5741
  size: "icon",
5742
- disabled: k.length === 0,
5742
+ disabled: O.length === 0,
5743
5743
  onClick: () => {
5744
- j([]), e.setValue([]), e.delete_chat_history({}), F(), T();
5744
+ k([]), e.setValue([]), e.delete_chat_history({}), N(), T();
5745
5745
  },
5746
- children: /* @__PURE__ */ (0, Z.jsx)(Jt, { className: "h-3 w-3" })
5746
+ children: /* @__PURE__ */ (0, Z.jsx)(Xt, { className: "h-3 w-3" })
5747
5747
  })
5748
5748
  }),
5749
5749
  /* @__PURE__ */ (0, Z.jsxs)("div", {
5750
5750
  className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
5751
5751
  ref: _,
5752
5752
  children: [
5753
- k.length === 0 && /* @__PURE__ */ (0, Z.jsxs)("div", {
5753
+ O.length === 0 && /* @__PURE__ */ (0, Z.jsxs)("div", {
5754
5754
  className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
5755
5755
  children: [
5756
- /* @__PURE__ */ (0, Z.jsx)(Bt, { className: "h-12 w-12 mb-4" }),
5756
+ /* @__PURE__ */ (0, Z.jsx)(Ht, { className: "h-12 w-12 mb-4" }),
5757
5757
  /* @__PURE__ */ (0, Z.jsx)("h3", {
5758
5758
  className: "text-lg font-semibold mb-2",
5759
5759
  children: "No messages yet"
@@ -5764,8 +5764,8 @@ var Ms = (e) => {
5764
5764
  })
5765
5765
  ]
5766
5766
  }),
5767
- k.map((e, t) => {
5768
- let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t === k.length - 1;
5767
+ O.map((e, t) => {
5768
+ let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), i = t === O.length - 1;
5769
5769
  return /* @__PURE__ */ (0, Z.jsxs)("div", {
5770
5770
  className: r("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
5771
5771
  children: [/* @__PURE__ */ (0, Z.jsx)("div", {
@@ -5773,8 +5773,8 @@ var Ms = (e) => {
5773
5773
  children: no({
5774
5774
  message: e,
5775
5775
  isLast: i,
5776
- isActive: re,
5777
- addToolApprovalResponse: i ? ne : void 0
5776
+ isActive: ae,
5777
+ addToolApprovalResponse: i ? ie : void 0
5778
5778
  })
5779
5779
  }), /* @__PURE__ */ (0, Z.jsxs)("div", {
5780
5780
  className: "flex justify-end text-xs gap-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100",
@@ -5785,27 +5785,27 @@ var Ms = (e) => {
5785
5785
  }), /* @__PURE__ */ (0, Z.jsx)("button", {
5786
5786
  type: "button",
5787
5787
  "aria-label": "Delete message",
5788
- onClick: () => ie(e.id),
5788
+ onClick: () => oe(e.id),
5789
5789
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5790
5790
  children: /* @__PURE__ */ (0, Z.jsx)(y, { className: "h-3 w-3 text-(--red-9)" })
5791
5791
  })]
5792
5792
  })]
5793
5793
  }, e.id);
5794
5794
  }),
5795
- re && k.at(-1)?.role !== "assistant" && /* @__PURE__ */ (0, Z.jsx)("div", {
5795
+ ae && O.at(-1)?.role !== "assistant" && /* @__PURE__ */ (0, Z.jsx)("div", {
5796
5796
  className: "flex items-center justify-center mb-4",
5797
- children: /* @__PURE__ */ (0, Z.jsx)(ee, { size: "small" })
5797
+ children: /* @__PURE__ */ (0, Z.jsx)(re, { size: "small" })
5798
5798
  }),
5799
- P && /* @__PURE__ */ (0, Z.jsxs)("div", {
5799
+ M && /* @__PURE__ */ (0, Z.jsxs)("div", {
5800
5800
  className: "flex items-center justify-center space-x-2 mb-4",
5801
- children: [/* @__PURE__ */ (0, Z.jsx)(ht, { error: P }), /* @__PURE__ */ (0, Z.jsx)(a, {
5801
+ children: [/* @__PURE__ */ (0, Z.jsx)(_t, { error: M }), /* @__PURE__ */ (0, Z.jsx)(a, {
5802
5802
  variant: "outline",
5803
5803
  size: "sm",
5804
- onClick: () => te(),
5804
+ onClick: () => ne(),
5805
5805
  children: "Retry"
5806
5806
  })]
5807
5807
  }),
5808
- C && !re && !P && /* @__PURE__ */ (0, Z.jsx)("div", {
5808
+ C && !ae && !M && /* @__PURE__ */ (0, Z.jsx)("div", {
5809
5809
  className: "flex justify-center py-2",
5810
5810
  children: /* @__PURE__ */ (0, Z.jsx)("span", {
5811
5811
  className: "text-xs text-muted-foreground",
@@ -5818,13 +5818,13 @@ var Ms = (e) => {
5818
5818
  onSubmit: async (n) => {
5819
5819
  if (n.preventDefault(), e.disabled) return;
5820
5820
  let r = f ? await Fo(f) : void 0;
5821
- A({
5821
+ ee({
5822
5822
  role: "user",
5823
5823
  parts: [{
5824
5824
  type: "text",
5825
5825
  text: t
5826
5826
  }, ...r ?? []]
5827
- }), ce();
5827
+ }), ue();
5828
5828
  },
5829
5829
  ref: h,
5830
5830
  inert: e.disabled || void 0,
@@ -5845,7 +5845,7 @@ var Ms = (e) => {
5845
5845
  }),
5846
5846
  /* @__PURE__ */ (0, Z.jsx)(Es, {
5847
5847
  className: "rounded-sm mr-2",
5848
- placeholder: se,
5848
+ placeholder: le,
5849
5849
  value: t,
5850
5850
  inputRef: g,
5851
5851
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
@@ -5854,7 +5854,7 @@ var Ms = (e) => {
5854
5854
  t.trim() && h.current?.requestSubmit();
5855
5855
  },
5856
5856
  onClose: () => {},
5857
- additionalCompletions: oe
5857
+ additionalCompletions: ce
5858
5858
  }),
5859
5859
  f && f.length === 1 && /* @__PURE__ */ (0, Z.jsx)("span", {
5860
5860
  title: f[0].name,
@@ -5873,14 +5873,14 @@ var Ms = (e) => {
5873
5873
  onClick: () => {
5874
5874
  p(void 0), m.current && (m.current.value = "");
5875
5875
  },
5876
- children: /* @__PURE__ */ (0, Z.jsx)(Ue, { className: "size-3" })
5876
+ children: /* @__PURE__ */ (0, Z.jsx)(Ge, { className: "size-3" })
5877
5877
  }),
5878
- ae && /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(a, {
5878
+ se && /* @__PURE__ */ (0, Z.jsxs)(Z.Fragment, { children: [/* @__PURE__ */ (0, Z.jsx)(a, {
5879
5879
  type: "button",
5880
5880
  variant: "text",
5881
5881
  size: "sm",
5882
5882
  onClick: () => m.current?.click(),
5883
- children: /* @__PURE__ */ (0, Z.jsx)(qt, { className: "h-4" })
5883
+ children: /* @__PURE__ */ (0, Z.jsx)(Yt, { className: "h-4" })
5884
5884
  }), /* @__PURE__ */ (0, Z.jsx)("input", {
5885
5885
  type: "file",
5886
5886
  ref: m,
@@ -5891,15 +5891,15 @@ var Ms = (e) => {
5891
5891
  e.target.files && p([...e.target.files]);
5892
5892
  }
5893
5893
  })] }),
5894
- re ? /* @__PURE__ */ (0, Z.jsx)(ue, {
5894
+ ae ? /* @__PURE__ */ (0, Z.jsx)(fe, {
5895
5895
  content: "Stop generating",
5896
5896
  children: /* @__PURE__ */ (0, Z.jsx)(a, {
5897
5897
  type: "button",
5898
5898
  variant: "link",
5899
5899
  size: "xs",
5900
- onClick: () => N(),
5900
+ onClick: () => j(),
5901
5901
  className: "text-(--red-9) hover:text-(--red-11)",
5902
- children: /* @__PURE__ */ (0, Z.jsx)(ze, { className: "h-4 w-4 fill-current" })
5902
+ children: /* @__PURE__ */ (0, Z.jsx)(Ve, { className: "h-4 w-4 fill-current" })
5903
5903
  })
5904
5904
  }) : /* @__PURE__ */ (0, Z.jsx)(a, {
5905
5905
  type: "submit",
@@ -5908,7 +5908,7 @@ var Ms = (e) => {
5908
5908
  size: "xs",
5909
5909
  className: "text-(--slate-11)",
5910
5910
  "aria-label": "Send message",
5911
- children: /* @__PURE__ */ (0, Z.jsx)(Xt, { className: "h-4 w-4" })
5911
+ children: /* @__PURE__ */ (0, Z.jsx)(Qt, { className: "h-4 w-4" })
5912
5912
  })
5913
5913
  ]
5914
5914
  })
@@ -5948,7 +5948,7 @@ var Ms = (e) => {
5948
5948
  description: "Penalizes new tokens (-2: favor, 2: avoid)"
5949
5949
  }
5950
5950
  }, Ps = (e) => {
5951
- let t = (0, L.c)(16), { config: n, onChange: r } = e, [i, o] = (0, X.useState)(!1), s;
5951
+ let t = (0, F.c)(16), { config: n, onChange: r } = e, [i, o] = (0, X.useState)(!1), s;
5952
5952
  t[0] !== n || t[1] !== r ? (s = (e, t) => {
5953
5953
  let i = t === null || Number.isNaN(t) ? null : t;
5954
5954
  if (i !== null) {
@@ -5966,15 +5966,15 @@ var Ms = (e) => {
5966
5966
  e.key === "Enter" && (e.preventDefault(), o(!1));
5967
5967
  }, t[3] = l) : l = t[3];
5968
5968
  let u = l, d;
5969
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, Z.jsx)(ue, {
5969
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, Z.jsx)(fe, {
5970
5970
  content: "Configuration",
5971
- children: /* @__PURE__ */ (0, Z.jsx)(w, {
5971
+ children: /* @__PURE__ */ (0, Z.jsx)(E, {
5972
5972
  asChild: !0,
5973
5973
  children: /* @__PURE__ */ (0, Z.jsx)(a, {
5974
5974
  variant: "outline",
5975
5975
  size: "sm",
5976
5976
  className: "border-none shadow-none hover:bg-transparent",
5977
- children: /* @__PURE__ */ (0, Z.jsx)(Zt, { className: "h-3 w-3" })
5977
+ children: /* @__PURE__ */ (0, Z.jsx)($t, { className: "h-3 w-3" })
5978
5978
  })
5979
5979
  })
5980
5980
  }), t[4] = d) : d = t[4];
@@ -5990,19 +5990,19 @@ var Ms = (e) => {
5990
5990
  let [t, n] = e;
5991
5991
  return /* @__PURE__ */ (0, Z.jsxs)("div", {
5992
5992
  className: "grid grid-cols-3 items-center gap-1",
5993
- children: [/* @__PURE__ */ (0, Z.jsxs)(de, {
5993
+ children: [/* @__PURE__ */ (0, Z.jsxs)(pe, {
5994
5994
  htmlFor: t,
5995
5995
  className: "flex w-full justify-between col-span-3 align-end",
5996
- children: [He.startCase(t), /* @__PURE__ */ (0, Z.jsx)(ue, {
5996
+ children: [We.startCase(t), /* @__PURE__ */ (0, Z.jsx)(fe, {
5997
5997
  delayDuration: 200,
5998
5998
  side: "top",
5999
5999
  content: /* @__PURE__ */ (0, Z.jsx)("div", {
6000
6000
  className: "text-xs flex flex-col",
6001
6001
  children: Ns[t].description
6002
6002
  }),
6003
- children: /* @__PURE__ */ (0, Z.jsx)(xe, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
6003
+ children: /* @__PURE__ */ (0, Z.jsx)(Ce, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
6004
6004
  })]
6005
- }), /* @__PURE__ */ (0, Z.jsx)(pe, {
6005
+ }), /* @__PURE__ */ (0, Z.jsx)(be, {
6006
6006
  id: t,
6007
6007
  "aria-label": t,
6008
6008
  value: n ?? NaN,
@@ -6015,10 +6015,10 @@ var Ms = (e) => {
6015
6015
  className: "col-span-3"
6016
6016
  })]
6017
6017
  }, t);
6018
- }, t[9] = c, t[10] = e), p = _t.entries(n).map(e), t[6] = n, t[7] = c, t[8] = p;
6018
+ }, t[9] = c, t[10] = e), p = yt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = p;
6019
6019
  } else p = t[8];
6020
6020
  let m;
6021
- t[11] === p ? m = t[12] : (m = /* @__PURE__ */ (0, Z.jsx)(S, {
6021
+ t[11] === p ? m = t[12] : (m = /* @__PURE__ */ (0, Z.jsx)(w, {
6022
6022
  className: "w-70 border",
6023
6023
  children: /* @__PURE__ */ (0, Z.jsxs)("div", {
6024
6024
  className: "grid gap-3",
@@ -6026,40 +6026,40 @@ var Ms = (e) => {
6026
6026
  })
6027
6027
  }), t[11] = p, t[12] = m);
6028
6028
  let h;
6029
- return t[13] !== i || t[14] !== m ? (h = /* @__PURE__ */ (0, Z.jsxs)(C, {
6029
+ return t[13] !== i || t[14] !== m ? (h = /* @__PURE__ */ (0, Z.jsxs)(T, {
6030
6030
  open: i,
6031
6031
  onOpenChange: o,
6032
6032
  children: [d, m]
6033
6033
  }), t[13] = i, t[14] = m, t[15] = h) : h = t[15], h;
6034
6034
  }, Fs = (e) => {
6035
- let t = (0, L.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, X.useState)(!1), [s, c] = (0, X.useState)(""), l;
6035
+ let t = (0, F.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, X.useState)(!1), [s, c] = (0, X.useState)(""), l;
6036
6036
  t[0] === r ? l = t[1] : (l = (e) => {
6037
6037
  [...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
6038
6038
  }, t[0] = r, t[1] = l);
6039
6039
  let u = l, d;
6040
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, Z.jsx)(ue, {
6040
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, Z.jsx)(fe, {
6041
6041
  content: "Select a prompt",
6042
- children: /* @__PURE__ */ (0, Z.jsx)(me, {
6042
+ children: /* @__PURE__ */ (0, Z.jsx)(he, {
6043
6043
  asChild: !0,
6044
6044
  children: /* @__PURE__ */ (0, Z.jsx)(a, {
6045
6045
  variant: "outline",
6046
6046
  size: "sm",
6047
6047
  className: "border-none shadow-none hover:bg-transparent",
6048
- children: /* @__PURE__ */ (0, Z.jsx)(se, { className: "h-3 w-3" })
6048
+ children: /* @__PURE__ */ (0, Z.jsx)(ue, { className: "h-3 w-3" })
6049
6049
  })
6050
6050
  })
6051
6051
  }), t[2] = d) : d = t[2];
6052
6052
  let f;
6053
6053
  if (t[3] !== u || t[4] !== n) {
6054
6054
  let e;
6055
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, Z.jsx)(ge, {
6055
+ t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, Z.jsx)(_e, {
6056
6056
  onSelect: () => u(e),
6057
6057
  className: "whitespace-normal text-left",
6058
6058
  children: e
6059
6059
  }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
6060
6060
  } else f = t[5];
6061
6061
  let p;
6062
- t[8] === f ? p = t[9] : (p = /* @__PURE__ */ (0, Z.jsx)(ks, { children: /* @__PURE__ */ (0, Z.jsxs)(ve, { children: [d, /* @__PURE__ */ (0, Z.jsx)(_e, {
6062
+ t[8] === f ? p = t[9] : (p = /* @__PURE__ */ (0, Z.jsx)(ks, { children: /* @__PURE__ */ (0, Z.jsxs)(ye, { children: [d, /* @__PURE__ */ (0, Z.jsx)(ve, {
6063
6063
  side: "right",
6064
6064
  align: "end",
6065
6065
  onCloseAutoFocus: Ls,
@@ -6069,7 +6069,7 @@ var Ms = (e) => {
6069
6069
  let m;
6070
6070
  t[10] === Symbol.for("react.memo_cache_sentinel") ? (m = () => o(!1), t[10] = m) : m = t[10];
6071
6071
  let h;
6072
- t[11] !== r || t[12] !== s ? (h = /* @__PURE__ */ (0, Z.jsx)(S, {
6072
+ t[11] !== r || t[12] !== s ? (h = /* @__PURE__ */ (0, Z.jsx)(w, {
6073
6073
  side: "right",
6074
6074
  align: "end",
6075
6075
  className: "min-w-80 px-2",
@@ -6080,13 +6080,13 @@ var Ms = (e) => {
6080
6080
  }, s)
6081
6081
  }), t[11] = r, t[12] = s, t[13] = h) : h = t[13];
6082
6082
  let g;
6083
- return t[14] !== i || t[15] !== p || t[16] !== h ? (g = /* @__PURE__ */ (0, Z.jsxs)(C, {
6083
+ return t[14] !== i || t[15] !== p || t[16] !== h ? (g = /* @__PURE__ */ (0, Z.jsxs)(T, {
6084
6084
  open: i,
6085
6085
  onOpenChange: o,
6086
6086
  children: [p, h]
6087
6087
  }), t[14] = i, t[15] = p, t[16] = h, t[17] = g) : g = t[17], g;
6088
6088
  }, Is = (e) => {
6089
- let t = (0, L.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
6089
+ let t = (0, F.c)(30), { prompt: n, onClose: r, onSelect: i } = e, o;
6090
6090
  t[0] === n ? o = t[1] : (o = () => [...n.matchAll(/{{(\w+)}}/g)].reduce(Rs, {}), t[0] = n, t[1] = o);
6091
6091
  let [s, c] = (0, X.useState)(o), l;
6092
6092
  t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = (e, t) => {
@@ -6115,11 +6115,11 @@ var Ms = (e) => {
6115
6115
  let [n, r] = e;
6116
6116
  return /* @__PURE__ */ (0, Z.jsxs)("div", {
6117
6117
  className: "grid grid-cols-4 items-center gap-2",
6118
- children: [/* @__PURE__ */ (0, Z.jsx)(de, {
6118
+ children: [/* @__PURE__ */ (0, Z.jsx)(pe, {
6119
6119
  htmlFor: n,
6120
6120
  className: "font-semibold text-base",
6121
6121
  children: n
6122
- }), /* @__PURE__ */ (0, Z.jsx)(he, {
6122
+ }), /* @__PURE__ */ (0, Z.jsx)(ge, {
6123
6123
  id: n,
6124
6124
  value: r,
6125
6125
  onChange: (e) => u(n, e.target.value),