@marimo-team/islands 0.25.3-dev5 → 0.25.3-dev52

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 (220) hide show
  1. package/dist/{ConnectedDataExplorerComponent-CNMliVzw.js → ConnectedDataExplorerComponent-Da5OoEUL.js} +14 -14
  2. package/dist/{ErrorBoundary-BiZWOrv4.js → ErrorBoundary-CUo_Ic7t.js} +8 -8
  3. package/dist/{abnfDiagram-VCTEODGH-D-Ez91gV.js → abnfDiagram-VCTEODGH-Bz3mrprX.js} +2 -2
  4. package/dist/any-language-editor-k2B8YI3Y.js +75 -0
  5. package/dist/{architectureDiagram-5GKGNRK7-CTpcNtO8.js → architectureDiagram-5GKGNRK7-Cs5ujb9K.js} +1 -1
  6. package/dist/{arrays-CN1djC4k.js → arrays-R6JsImiT.js} +8 -0
  7. package/dist/{button-CvjkwdSk.js → button-BxB3RDjN.js} +1 -1
  8. package/dist/{capabilities-CQ5IjhzL.js → capabilities-BgR0osfN.js} +2 -2
  9. package/dist/{chat-ui-0lKdOoQ3.js → chat-ui-C1Gjgokv.js} +1103 -1103
  10. package/dist/{check-EDwSwP89.js → check-P35dc2dH.js} +1 -1
  11. package/dist/{chunk-IMKFNOWR-DGxi-zeo.js → chunk-IMKFNOWR-CcTSaxZt.js} +1 -1
  12. package/dist/{chunk-SHT3W25Y-CV9J3rAB.js → chunk-SHT3W25Y-DcJcjOaO.js} +1 -1
  13. package/dist/{chunk-SVP7TREG-BL-9Fqgg.js → chunk-SVP7TREG-BVtDTjaF.js} +1 -1
  14. package/dist/{chunk-TICWLB2K-Cu_XMjDM.js → chunk-TICWLB2K-BkDFkh8q.js} +1 -1
  15. package/dist/{chunk-YOKDWASO-DPZk8vhS.js → chunk-YOKDWASO-DKplTrBY.js} +20 -20
  16. package/dist/{classDiagram-ZZMXUADV-BXXV13Hq.js → classDiagram-ZZMXUADV-CfAt7HT5.js} +2 -2
  17. package/dist/{classDiagram-v2-VYDZK3BY-B7FXJ1Cp.js → classDiagram-v2-VYDZK3BY-CGEjNYa2.js} +2 -2
  18. package/dist/{code-visibility-CW5_8ZOI.js → code-visibility-DzaLpJoD.js} +6 -6
  19. package/dist/{common-mzWw4FdI.js → common-DrIlkaBD.js} +3112 -3015
  20. package/dist/{copy-icon-Ft7t9bqz.js → copy-icon-CPoxUG7G.js} +3 -3
  21. package/dist/{cynefinDiagram-5FMLGOSQ-CH96rwba.js → cynefinDiagram-5FMLGOSQ-BW6NmfJi.js} +1 -1
  22. package/dist/{dagre-GXQ25YYZ-BD3PmpFY.js → dagre-GXQ25YYZ-CWg3CTuF.js} +1 -1
  23. package/dist/{data-grid-overlay-editor-CJmehSdc.js → data-grid-overlay-editor-CpywyzkT.js} +5 -5
  24. package/dist/{data-grid-types-BH_r7g7l.js → data-grid-types-0PJ-9N5n.js} +1 -1
  25. package/dist/{diagram-S7CK7UJ4-BsSJJldB.js → diagram-S7CK7UJ4-BPxtoS-z.js} +1 -1
  26. package/dist/{diagram-UQ7AKVKN-muQtNZc4.js → diagram-UQ7AKVKN-DA-vJdFL.js} +1 -1
  27. package/dist/{diagram-VX7I27RA-CdhuZAqR.js → diagram-VX7I27RA-D6bkR84S.js} +1 -1
  28. package/dist/{diagram-Z3DM3KII-BD8mXjOj.js → diagram-Z3DM3KII-m60g4cAT.js} +1 -1
  29. package/dist/{dialog-CEBFZNyc.js → dialog-C1PcpCqX.js} +3 -3
  30. package/dist/{dist-DpBpA_n1.js → dist-Lm-D-Vr6.js} +3 -3
  31. package/dist/{dropdown-menu-CP_qCYHC.js → dropdown-menu-MG5hiCIa.js} +76 -76
  32. package/dist/{ebnfDiagram-PWID7BFC-BIN1sweE.js → ebnfDiagram-PWID7BFC-CK99sho2.js} +2 -2
  33. package/dist/{erDiagram-RLTQ6QDP-Ctp5cfoN.js → erDiagram-RLTQ6QDP-Bryq0tdE.js} +1 -1
  34. package/dist/{error-banner-D-WCIiMt.js → error-banner-Sl2FlSJ4.js} +2 -2
  35. package/dist/{error-entries-DSvFWT_M.js → error-entries-CMNtA8NK.js} +959 -959
  36. package/dist/{feedback-button-BcT1FBud.js → feedback-button-BCFNXBWr.js} +29 -29
  37. package/dist/{flowDiagram-HODETNUW-3EfLrlFb.js → flowDiagram-HODETNUW-D-3aRpfS.js} +2 -2
  38. package/dist/{formats-CeOmU1MU.js → formats-6pLWWrY2.js} +3 -3
  39. package/dist/{ganttDiagram-EL5Y4UJY-BQT16JSc.js → ganttDiagram-EL5Y4UJY-Dh_4cBJZ.js} +2 -2
  40. package/dist/{glide-data-editor-XckatD0j.js → glide-data-editor-BR-7x3LR.js} +370 -368
  41. package/dist/{glide-utils-DJyqh0EM.js → glide-utils-Bt8_pBa2.js} +16 -16
  42. package/dist/{globals-jRrLCkrP.js → globals-ebwjc5xx.js} +3 -3
  43. package/dist/{highlighted-body-KPVGNVTW-zwjq21tf.js → highlighted-body-KPVGNVTW-3Ziwfz-V.js} +2 -2
  44. package/dist/{html-to-image-B8s5SgGm.js → html-to-image-By72ALyI.js} +29 -29
  45. package/dist/{infoDiagram-27XIBGKW-DipQoHxl.js → infoDiagram-27XIBGKW-s1C1kgfU.js} +1 -1
  46. package/dist/{ishikawaDiagram-5VMMS53U-DgFMjSGz.js → ishikawaDiagram-5VMMS53U-CCsRgolY.js} +1 -1
  47. package/dist/{kanban-definition-UXKFOSKX-w1ACVjgl.js → kanban-definition-UXKFOSKX-BrmxDlcc.js} +1 -1
  48. package/dist/{label-BDKF3Afc.js → label-BRnUC0NX.js} +2 -2
  49. package/dist/{linear-Cnaq3Tfb.js → linear-DWERh7eI.js} +121 -73
  50. package/dist/{loader-BQOfjTIJ.js → loader-Bm8cy3e8.js} +12 -12
  51. package/dist/main.js +2358 -2221
  52. package/dist/{mermaid-CHo49Yv-.js → mermaid-DKI0869I.js} +38 -38
  53. package/dist/mermaid-HWGCJPDP-Du3-HPQA.js +2 -0
  54. package/dist/{mindmap-definition-YA3MSWOX-CrT0KSfX.js → mindmap-definition-YA3MSWOX-641xJysF.js} +1 -1
  55. package/dist/{number-overlay-editor-pZx8dUDV.js → number-overlay-editor-D0AcvGX2.js} +3 -3
  56. package/dist/{objects-CzUgoMIF.js → objects-DCmMvZtn.js} +1 -3
  57. package/dist/{once-BtE-wKRL.js → once-eG8Vmvjd.js} +1 -1
  58. package/dist/{pegDiagram-XKGWAZYB-BqvywNJA.js → pegDiagram-XKGWAZYB-keVUAUeS.js} +2 -2
  59. package/dist/{pieDiagram-E7YTZNPT-BfxJ_XCc.js → pieDiagram-E7YTZNPT-DHktXPO_.js} +1 -1
  60. package/dist/precisionRound-DhAzeRcm.js +49 -0
  61. package/dist/{process-output-CKRXyszb.js → process-output-D-OMW5sV.js} +4 -4
  62. package/dist/{quadrantDiagram-AXDQQJYC-Ccw0xMjN.js → quadrantDiagram-AXDQQJYC-Blrm7V7_.js} +1 -1
  63. package/dist/{railroadDiagram-O6MQD6OU-8vFLVTPu.js → railroadDiagram-O6MQD6OU-BVEF4OV_.js} +2 -2
  64. package/dist/{react-vega-BED0DjiB.js → react-vega-C4T9Rb_w.js} +12284 -12270
  65. package/dist/{requirementDiagram-BXWQKSXE-a_MxGvxe.js → requirementDiagram-BXWQKSXE-CWo-UAKV.js} +1 -1
  66. package/dist/{reveal-component-79ez8-D5.js → reveal-component-D77NcMhc.js} +10 -10
  67. package/dist/{select-BButFi-d.js → select-B0LRDH0g.js} +4 -4
  68. package/dist/{sequenceDiagram-WJ2MYXX4-CXFMnxGh.js → sequenceDiagram-WJ2MYXX4-CHQvLnq4.js} +1 -1
  69. package/dist/{spec-BwarBpUJ.js → spec-C-LRKGtT.js} +4 -4
  70. package/dist/{stateDiagram-D77RDMKH-DQeA_CwI.js → stateDiagram-D77RDMKH-BOJZgbUJ.js} +2 -2
  71. package/dist/{stateDiagram-v2-MP3YSRHH-BxxQucm1.js → stateDiagram-v2-MP3YSRHH-C53XXdYH.js} +2 -2
  72. package/dist/style.css +1 -1
  73. package/dist/{swimlanes-42K2YHIH-Do6L-cYg.js → swimlanes-42K2YHIH-D2o1gOtw.js} +1 -1
  74. package/dist/{swimlanesDiagram-VR7AAH4N-DUzPvSVU.js → swimlanesDiagram-VR7AAH4N-BHFzN1Wk.js} +2 -2
  75. package/dist/{swiper-component-DKntyn8p.js → swiper-component-DfhRvAFi.js} +2 -2
  76. package/dist/{time-BieKwdYS.js → time-BaMbJs4z.js} +18 -18
  77. package/dist/{timeline-definition-24CTP7MA-D3c46WM5.js → timeline-definition-24CTP7MA-rv7QUa46.js} +1 -1
  78. package/dist/{toDate-vIXljnsr.js → toDate-CjPuEPou.js} +21 -20
  79. package/dist/{toast-B9UMEi8u.js → toast-CFWpihJU.js} +4 -4
  80. package/dist/{tooltip-BO1REbqs.js → tooltip-CKO1pHJo.js} +2 -2
  81. package/dist/{use-restore-focus-BEM7sFWl.js → use-restore-focus-DBCITLeF.js} +1 -1
  82. package/dist/{useAsyncData-Deh5kszT.js → useAsyncData-ChgNtdmE.js} +15 -14
  83. package/dist/{useDateFormatter-D8XruNGG.js → useDateFormatter-c_yJtkAe.js} +2 -2
  84. package/dist/{useDeepCompareMemoize-DXwzRINI.js → useDeepCompareMemoize-Bet7kSsI.js} +1 -1
  85. package/dist/{useIframeCapabilities-DBETvvPl.js → useIframeCapabilities-BkdeVdXC.js} +1 -1
  86. package/dist/{useLifecycle-j7D9uD1o.js → useLifecycle-VVmz_24o.js} +3 -3
  87. package/dist/{useTheme-CRnjkku0.js → useTheme-DympCsQg.js} +5 -5
  88. package/dist/{vega-component-DTG6zxaY.js → vega-component-DnfQeoyt.js} +147 -147
  89. package/dist/{vega-embed-container-BNHE18G9.js → vega-embed-container--LYZqguO.js} +2 -2
  90. package/dist/{vega-loader.browser-DNST6uVf.js → vega-loader.browser-B9Pz0EGP.js} +298 -507
  91. package/dist/{vennDiagram-4TSXK5OY-BSZD8JcZ.js → vennDiagram-4TSXK5OY-D36Zk7t-.js} +1 -1
  92. package/dist/{wardleyDiagram-VM6X3IG4-48cUWkfA.js → wardleyDiagram-VM6X3IG4-BLBolvyQ.js} +1 -1
  93. package/dist/{xychartDiagram-S5SC5T6Z-CswYgYeu.js → xychartDiagram-S5SC5T6Z-CfH57l0v.js} +2 -2
  94. package/package.json +4 -4
  95. package/src/__tests__/fixtures/{pair-preview.ts → pair-config.ts} +3 -2
  96. package/src/__tests__/host-imports.test.ts +1 -0
  97. package/src/__tests__/mount.test.ts +8 -8
  98. package/src/components/app-config/ai-config.tsx +5 -1
  99. package/src/components/chat/__tests__/message-queue.test.tsx +17 -0
  100. package/src/components/chat/chat-panel.tsx +3 -7
  101. package/src/components/chat/chat-utils.ts +4 -8
  102. package/src/components/data-table/__tests__/context-menu-interaction.test.tsx +130 -0
  103. package/src/components/data-table/__tests__/date-popover.test.tsx +72 -0
  104. package/src/components/data-table/__tests__/export-actions.test.tsx +417 -6
  105. package/src/components/data-table/column-visibility-dropdown.tsx +8 -13
  106. package/src/components/data-table/columns.tsx +2 -1
  107. package/src/components/data-table/context-menu.tsx +36 -20
  108. package/src/components/data-table/date-popover.tsx +6 -4
  109. package/src/components/data-table/export-actions.tsx +263 -161
  110. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +2 -2
  111. package/src/components/data-table/schemas.ts +14 -36
  112. package/src/components/editor/Output.tsx +5 -1
  113. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +111 -18
  114. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +80 -252
  115. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +186 -34
  116. package/src/components/editor/actions/pair-with-agent-commands.ts +42 -51
  117. package/src/components/editor/actions/pair-with-agent-modal.tsx +96 -36
  118. package/src/components/editor/ai/add-cell-with-ai.tsx +3 -3
  119. package/src/components/editor/cell/CreateCellButton.tsx +8 -10
  120. package/src/components/editor/cell/code/__tests__/language-toggle.test.tsx +54 -0
  121. package/src/components/editor/cell/code/cell-editor.tsx +1 -1
  122. package/src/components/editor/cell/code/language-toggle.tsx +8 -7
  123. package/src/components/editor/chrome/wrapper/__tests__/attachment-status.test.tsx +277 -78
  124. package/src/components/editor/chrome/wrapper/footer-items/attachment-status.tsx +196 -41
  125. package/src/components/editor/connections/components.tsx +1 -1
  126. package/src/components/editor/controls/__tests__/command-palette.test.tsx +53 -0
  127. package/src/components/editor/controls/command-palette.tsx +22 -10
  128. package/src/components/editor/dynamic-favicon.tsx +21 -40
  129. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +139 -36
  130. package/src/components/editor/errors/send-error-report-button.tsx +10 -7
  131. package/src/components/editor/file-tree/file-viewer.tsx +4 -2
  132. package/src/components/editor/output/MarimoTracebackOutput.tsx +28 -22
  133. package/src/components/editor/output/console/ConsoleOutput.tsx +8 -18
  134. package/src/components/pages/home-page.tsx +4 -4
  135. package/src/components/slides/slide-cell-view.tsx +1 -1
  136. package/src/components/tracing/tracing.tsx +2 -2
  137. package/src/core/attachments/__tests__/toast.test.tsx +58 -0
  138. package/src/core/attachments/state.ts +5 -8
  139. package/src/core/attachments/toast.ts +15 -0
  140. package/src/core/cells/__tests__/error-report.test.ts +53 -3
  141. package/src/core/cells/__tests__/notebook-outline.test.ts +113 -0
  142. package/src/core/cells/__tests__/session.test.ts +18 -3
  143. package/src/core/cells/cells.ts +2 -1
  144. package/src/core/cells/error-report.ts +14 -6
  145. package/src/core/cells/pending-delete-service.ts +2 -6
  146. package/src/core/cells/session.ts +19 -1
  147. package/src/core/config/pair.ts +5 -3
  148. package/src/core/datasets/__tests__/data-source-discovery.test.ts +4 -4
  149. package/src/core/datasets/data-source-discovery.ts +4 -6
  150. package/src/core/edit-app.tsx +2 -2
  151. package/src/core/host/AGENTS.md +11 -2
  152. package/src/core/host/__tests__/attachments.test.ts +56 -0
  153. package/src/core/host/__tests__/document.test.ts +126 -0
  154. package/src/core/host/__tests__/events.test.ts +49 -0
  155. package/src/core/host/__tests__/fixtures.ts +41 -0
  156. package/src/core/host/__tests__/notebook-client.test.ts +496 -0
  157. package/src/core/host/connection.ts +81 -0
  158. package/src/core/host/events.ts +68 -0
  159. package/src/core/host/notebook-client.ts +316 -0
  160. package/src/core/host/resources/attachments.ts +19 -0
  161. package/src/core/host/resources/document.ts +101 -0
  162. package/src/core/hotkeys/actions.ts +2 -4
  163. package/src/core/islands/__tests__/bootstrap.test.ts +0 -26
  164. package/src/core/islands/bootstrap.ts +0 -1
  165. package/src/core/network/connection.ts +4 -2
  166. package/src/core/run-app.tsx +2 -2
  167. package/src/core/runtime/__tests__/runtime.test.ts +5 -12
  168. package/src/core/runtime/runtime.ts +5 -5
  169. package/src/core/static/files.ts +2 -0
  170. package/src/core/websocket/__tests__/{useMarimoKernelConnection.test.ts → connection-state.test.ts} +15 -17
  171. package/src/core/websocket/__tests__/{useWebSocket.test.ts → createConnectionTransport.test.ts} +1 -1
  172. package/src/core/websocket/__tests__/useNotebookClient.hook.test.tsx +149 -0
  173. package/src/core/websocket/__tests__/{useMarimoKernelConnection.hook.test.tsx → useNotebookSession.hook.test.tsx} +168 -253
  174. package/src/core/websocket/connection-state.ts +70 -0
  175. package/src/core/websocket/state.ts +7 -0
  176. package/src/core/websocket/transports/__tests__/sse.test.ts +18 -4
  177. package/src/core/websocket/transports/create.ts +31 -0
  178. package/src/core/websocket/transports/sse.ts +14 -2
  179. package/src/core/websocket/transports/transport.ts +12 -23
  180. package/src/core/websocket/types.ts +9 -39
  181. package/src/core/websocket/useNotebookClient.ts +78 -0
  182. package/src/core/websocket/{useMarimoKernelConnection.tsx → useNotebookSession.tsx} +53 -233
  183. package/src/hooks/__tests__/useAsyncData.test.tsx +148 -0
  184. package/src/hooks/useAsyncData.ts +3 -3
  185. package/src/hooks/useDataSourceDiscovery.ts +6 -4
  186. package/src/hooks/useElapsedTime.ts +3 -3
  187. package/src/hooks/useInputHistory.ts +4 -7
  188. package/src/hooks/useResizeObserver.ts +4 -7
  189. package/src/mount.tsx +3 -3
  190. package/src/plugins/core/registerReactComponent.tsx +1 -1
  191. package/src/plugins/impl/DropdownPlugin.tsx +2 -6
  192. package/src/plugins/impl/FormPlugin.tsx +1 -1
  193. package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +84 -0
  194. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +2 -0
  195. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +241 -2
  196. package/src/plugins/impl/anywidget/runtime.ts +21 -9
  197. package/src/plugins/impl/anywidget/widget-binding.ts +160 -82
  198. package/src/plugins/impl/code/any-language-editor.tsx +2 -2
  199. package/src/plugins/impl/data-editor/glide-data-editor.tsx +8 -5
  200. package/src/plugins/impl/data-editor/glide-utils.ts +3 -1
  201. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +5 -3
  202. package/src/plugins/impl/panel/PanelPlugin.tsx +15 -16
  203. package/src/plugins/impl/panel/__tests__/utils.test.ts +39 -1
  204. package/src/plugins/impl/panel/utils.ts +17 -0
  205. package/src/plugins/impl/vega/make-selectable.ts +3 -6
  206. package/src/stories/__tests__/editor-story.test.tsx +33 -0
  207. package/src/stories/editor.stories.tsx +24 -17
  208. package/src/utils/__tests__/arrays.test.ts +35 -0
  209. package/src/utils/__tests__/numbers.test.ts +48 -1
  210. package/src/utils/__tests__/objects.test.ts +21 -0
  211. package/src/utils/arrays.ts +10 -0
  212. package/src/utils/numbers.ts +28 -17
  213. package/src/utils/objects.ts +3 -7
  214. package/src/utils/once.ts +19 -19
  215. package/dist/any-language-editor-DZ_YTVus.js +0 -76
  216. package/dist/mermaid-HWGCJPDP-ByCsZnYF.js +0 -2
  217. package/dist/precisionRound-DMIVQrt2.js +0 -97
  218. package/src/core/host/__tests__/protocol.test.ts +0 -214
  219. package/src/core/host/protocol.ts +0 -1943
  220. package/src/core/websocket/useWebSocket.tsx +0 -88
@@ -1,28 +1,28 @@
1
1
  import { a as e, t } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { c as n, g as r, h as i, t as a } from "./button-CvjkwdSk.js";
2
+ import { c as n, g as r, h as i, t as a } from "./button-BxB3RDjN.js";
3
3
  import { t as o } from "./react-sHtZdjeP.js";
4
4
  import { t as s } from "./compiler-runtime-CldRdSsv.js";
5
- import { i as c, t as l } from "./copy-icon-Ft7t9bqz.js";
6
- import { F as u, H as d, U as f, V as p, X as m, Y as h, Z as g, _, a as v, c as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, p as D, r as O, t as k, v as A, x as ee, y as j, z as te } from "./html-to-image-B8s5SgGm.js";
7
- import { h as M, t as ne } from "./tooltip-BO1REbqs.js";
8
- import { Ct as re, Dt as ie, L as ae, Pt as oe, Rt as se, St as ce, Ut as le, Z as ue, ct as de, fn as fe, h as pe, hn as me, ht as he, i as ge, it as _e, ln as ve, lt as ye, r as be, t as xe, tn as Se, tt as Ce, un as we, w as Te, wt as Ee } from "./error-entries-DSvFWT_M.js";
9
- import { A as De, C as Oe, M as ke, b as Ae } from "./select-BButFi-d.js";
10
- import { _ as je, f as Me, h as Ne, i as Pe, n as Fe, t as Ie } from "./dropdown-menu-CP_qCYHC.js";
11
- import { C as Le, d as Re } from "./toDate-vIXljnsr.js";
12
- import { d as ze, f as Be, i as Ve, n as He, t as Ue, u as We } from "./process-output-CKRXyszb.js";
13
- import { t as Ge } from "./jsx-runtime-3BD1kT0s.js";
14
- import { A as Ke, C as qe, D as Je, E as Ye, F as Xe, L as Ze, M as Qe, O as $e, P as et, R as tt, S as nt, T as rt, V as it, b as at, j as ot, v as st, w as ct, x as lt, y as ut, z as dt } from "./use-restore-focus-BEM7sFWl.js";
15
- import { n as ft } from "./error-banner-D-WCIiMt.js";
16
- import { t as pt } from "./label-BDKF3Afc.js";
17
- import { t as mt } from "./isEmpty-BSZ1LaUo.js";
18
- import { A as ht, T as gt, n as _t } from "./useTheme-CRnjkku0.js";
19
- import { $ as vt, Mt as yt, Pt as bt, Rt as xt, Vt as St, Z as Ct, ht as wt, jt as Tt, mt as Et, nt as Dt, tt as Ot, zt as kt } from "./dist-DoE4XJBC.js";
20
- import { t as At } from "./objects-CzUgoMIF.js";
21
- import { n as jt, o as Mt, r as Nt } from "./dist-CkTTIdBe.js";
22
- import { n as Pt } from "./dist-CrSP_H1M.js";
23
- import { n as Ft, t as It } from "./esm-AMFssoNp.js";
24
- import { t as Lt } from "./useAsyncData-Deh5kszT.js";
25
- var Rt = M("ban", [["circle", {
5
+ import { i as c, t as l } from "./copy-icon-CPoxUG7G.js";
6
+ import { F as u, H as d, U as f, V as p, X as m, Y as h, Z as g, _, a as v, c as y, d as b, f as x, g as S, h as C, l as w, m as T, n as E, p as D, r as O, t as k, v as A, x as ee, y as te, z as ne } from "./html-to-image-By72ALyI.js";
7
+ import { h as j, t as re } from "./tooltip-CKO1pHJo.js";
8
+ import { Ct as ie, Et as ae, Ht as oe, L as se, Lt as ce, Nt as le, St as ue, X as de, cn as fe, ct as pe, dn as me, en as he, et as ge, h as _e, i as ve, ln as ye, mn as be, mt as xe, r as Se, rt as Ce, st as we, t as Te, w as Ee, xt as De } from "./error-entries-CMNtA8NK.js";
9
+ import { A as Oe, C as ke, M as Ae, b as je } from "./select-B0LRDH0g.js";
10
+ import { _ as Me, f as Ne, h as Pe, i as Fe, n as Ie, t as Le } from "./dropdown-menu-MG5hiCIa.js";
11
+ import { C as Re, d as ze } from "./toDate-CjPuEPou.js";
12
+ import { d as Be, f as Ve, i as He, n as Ue, t as We, u as Ge } from "./process-output-D-OMW5sV.js";
13
+ import { t as Ke } from "./jsx-runtime-3BD1kT0s.js";
14
+ import { A as qe, C as Je, D as Ye, E as Xe, F as Ze, L as Qe, M as $e, O as et, P as tt, R as nt, S as rt, T as it, V as at, b as ot, j as st, v as ct, w as lt, x as ut, y as dt, z as ft } from "./use-restore-focus-DBCITLeF.js";
15
+ import { n as pt } from "./error-banner-Sl2FlSJ4.js";
16
+ import { t as mt } from "./label-BRnUC0NX.js";
17
+ import { t as ht } from "./isEmpty-BSZ1LaUo.js";
18
+ import { A as gt, T as _t, n as vt } from "./useTheme-DympCsQg.js";
19
+ import { $ as yt, Mt as bt, Pt as xt, Rt as St, Vt as Ct, Z as wt, ht as Tt, jt as Et, mt as Dt, nt as Ot, tt as kt, zt as At } from "./dist-DoE4XJBC.js";
20
+ import { t as jt } from "./objects-DCmMvZtn.js";
21
+ import { n as Mt, o as Nt, r as Pt } from "./dist-CkTTIdBe.js";
22
+ import { n as Ft } from "./dist-CrSP_H1M.js";
23
+ import { n as It, t as Lt } from "./esm-AMFssoNp.js";
24
+ import { t as Rt } from "./useAsyncData-ChgNtdmE.js";
25
+ var zt = j("ban", [["circle", {
26
26
  cx: "12",
27
27
  cy: "12",
28
28
  r: "10",
@@ -30,7 +30,7 @@ var Rt = M("ban", [["circle", {
30
30
  }], ["path", {
31
31
  d: "M4.929 4.929 19.07 19.071",
32
32
  key: "196cmz"
33
- }]]), zt = M("bot-message-square", [
33
+ }]]), Bt = j("bot-message-square", [
34
34
  ["path", {
35
35
  d: "M12 6V2H8",
36
36
  key: "1155em"
@@ -55,13 +55,13 @@ var Rt = M("ban", [["circle", {
55
55
  d: "M9 11v2",
56
56
  key: "1ueba0"
57
57
  }]
58
- ]), Bt = M("circle-check-big", [["path", {
58
+ ]), Vt = j("circle-check-big", [["path", {
59
59
  d: "M21.801 10A10 10 0 1 1 17 3.335",
60
60
  key: "yps3ct"
61
61
  }], ["path", {
62
62
  d: "m9 11 3 3L22 4",
63
63
  key: "1pflzl"
64
- }]]), Vt = M("circle-slash", [["circle", {
64
+ }]]), Ht = j("circle-slash", [["circle", {
65
65
  cx: "12",
66
66
  cy: "12",
67
67
  r: "10",
@@ -72,22 +72,22 @@ var Rt = M("ban", [["circle", {
72
72
  y1: "15",
73
73
  y2: "9",
74
74
  key: "1dfufj"
75
- }]]), Ht = M("paperclip", [["path", {
75
+ }]]), Ut = j("paperclip", [["path", {
76
76
  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",
77
77
  key: "1miecu"
78
- }]]), Ut = M("rotate-cw", [["path", {
78
+ }]]), Wt = j("rotate-cw", [["path", {
79
79
  d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
80
80
  key: "1p45f6"
81
81
  }], ["path", {
82
82
  d: "M21 3v5h-5",
83
83
  key: "1q7to0"
84
- }]]), Wt = M("send-horizontal", [["path", {
84
+ }]]), Gt = j("send-horizontal", [["path", {
85
85
  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",
86
86
  key: "117uat"
87
87
  }], ["path", {
88
88
  d: "M6 12h16",
89
89
  key: "s4cdu5"
90
- }]]), Gt = M("settings", [["path", {
90
+ }]]), Kt = j("settings", [["path", {
91
91
  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",
92
92
  key: "1i5ecw"
93
93
  }], ["circle", {
@@ -95,7 +95,7 @@ var Rt = M("ban", [["circle", {
95
95
  cy: "12",
96
96
  r: "3",
97
97
  key: "1v7zrd"
98
- }]]), Kt = M("shield-question-mark", [
98
+ }]]), qt = j("shield-question-mark", [
99
99
  ["path", {
100
100
  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",
101
101
  key: "oel41y"
@@ -108,66 +108,66 @@ var Rt = M("ban", [["circle", {
108
108
  d: "M12 17h.01",
109
109
  key: "p32p05"
110
110
  }]
111
- ]), N = s(), qt = "vercel.ai.error", Jt = Symbol.for(qt), Yt, Xt, P = class e extends (Xt = Error, Yt = Jt, Xt) {
111
+ ]), M = s(), Jt = "vercel.ai.error", Yt = Symbol.for(Jt), Xt, Zt, N = class e extends (Zt = Error, Xt = Yt, Zt) {
112
112
  constructor({ name: e, message: t, cause: n }) {
113
- super(t), this[Yt] = !0, this.name = e, this.cause = n;
113
+ super(t), this[Xt] = !0, this.name = e, this.cause = n;
114
114
  }
115
115
  static isInstance(t) {
116
- return e.hasMarker(t, qt);
116
+ return e.hasMarker(t, Jt);
117
117
  }
118
118
  static hasMarker(e, t) {
119
119
  let n = Symbol.for(t);
120
120
  return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
121
121
  }
122
- }, Zt = "AI_APICallError", Qt = `vercel.ai.error.${Zt}`, $t = Symbol.for(Qt), en, tn, nn = class extends (tn = P, en = $t, tn) {
122
+ }, Qt = "AI_APICallError", $t = `vercel.ai.error.${Qt}`, en = Symbol.for($t), tn, nn, rn = class extends (nn = N, tn = en, nn) {
123
123
  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 }) {
124
124
  super({
125
- name: Zt,
125
+ name: Qt,
126
126
  message: e,
127
127
  cause: o
128
- }), this[en] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
128
+ }), this[tn] = !0, this.url = t, this.requestBodyValues = n, this.statusCode = r, this.responseHeaders = i, this.responseBody = a, this.isRetryable = s, this.data = c;
129
129
  }
130
130
  static isInstance(e) {
131
- return P.hasMarker(e, Qt);
131
+ return N.hasMarker(e, $t);
132
132
  }
133
- }, rn = "AI_EmptyResponseBodyError", an = `vercel.ai.error.${rn}`, on = Symbol.for(an), sn, cn, ln = class extends (cn = P, sn = on, cn) {
133
+ }, an = "AI_EmptyResponseBodyError", on = `vercel.ai.error.${an}`, sn = Symbol.for(on), cn, ln, un = class extends (ln = N, cn = sn, ln) {
134
134
  constructor({ message: e = "Empty response body" } = {}) {
135
135
  super({
136
- name: rn,
136
+ name: an,
137
137
  message: e
138
- }), this[sn] = !0;
138
+ }), this[cn] = !0;
139
139
  }
140
140
  static isInstance(e) {
141
- return P.hasMarker(e, an);
141
+ return N.hasMarker(e, on);
142
142
  }
143
143
  };
144
- function un(e) {
144
+ function dn(e) {
145
145
  return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.toString() : JSON.stringify(e);
146
146
  }
147
- var dn = "AI_InvalidArgumentError", fn = `vercel.ai.error.${dn}`, pn = Symbol.for(fn), mn, hn, gn = class extends (hn = P, mn = pn, hn) {
147
+ var fn = "AI_InvalidArgumentError", pn = `vercel.ai.error.${fn}`, mn = Symbol.for(pn), hn, gn, _n = class extends (gn = N, hn = mn, gn) {
148
148
  constructor({ message: e, cause: t, argument: n }) {
149
149
  super({
150
- name: dn,
150
+ name: fn,
151
151
  message: e,
152
152
  cause: t
153
- }), this[mn] = !0, this.argument = n;
153
+ }), this[hn] = !0, this.argument = n;
154
154
  }
155
155
  static isInstance(e) {
156
- return P.hasMarker(e, fn);
156
+ return N.hasMarker(e, pn);
157
157
  }
158
- }, _n = "AI_JSONParseError", vn = `vercel.ai.error.${_n}`, yn = Symbol.for(vn), bn, xn, Sn = class extends (xn = P, bn = yn, xn) {
158
+ }, vn = "AI_JSONParseError", yn = `vercel.ai.error.${vn}`, bn = Symbol.for(yn), xn, Sn, Cn = class extends (Sn = N, xn = bn, Sn) {
159
159
  constructor({ text: e, cause: t }) {
160
160
  super({
161
- name: _n,
161
+ name: vn,
162
162
  message: `JSON parsing failed: Text: ${e}.
163
- Error message: ${un(t)}`,
163
+ Error message: ${dn(t)}`,
164
164
  cause: t
165
- }), this[bn] = !0, this.text = e;
165
+ }), this[xn] = !0, this.text = e;
166
166
  }
167
167
  static isInstance(e) {
168
- return P.hasMarker(e, vn);
168
+ return N.hasMarker(e, yn);
169
169
  }
170
- }, Cn = "AI_TypeValidationError", wn = `vercel.ai.error.${Cn}`, Tn = Symbol.for(wn), En, Dn, On = class e extends (Dn = P, En = Tn, Dn) {
170
+ }, wn = "AI_TypeValidationError", Tn = `vercel.ai.error.${wn}`, En = Symbol.for(Tn), Dn, On, P = class e extends (On = N, Dn = En, On) {
171
171
  constructor({ value: e, cause: t, context: n }) {
172
172
  let r = "Type validation failed";
173
173
  if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
@@ -176,14 +176,14 @@ Error message: ${un(t)}`,
176
176
  n.entityName && e.push(n.entityName), n.entityId && e.push(`id: "${n.entityId}"`), r += e.join(", "), r += ")";
177
177
  }
178
178
  super({
179
- name: Cn,
179
+ name: wn,
180
180
  message: `${r}: Value: ${JSON.stringify(e)}.
181
- Error message: ${un(t)}`,
181
+ Error message: ${dn(t)}`,
182
182
  cause: t
183
- }), this[En] = !0, this.value = e, this.context = n;
183
+ }), this[Dn] = !0, this.value = e, this.context = n;
184
184
  }
185
185
  static isInstance(e) {
186
- return P.hasMarker(e, wn);
186
+ return N.hasMarker(e, Tn);
187
187
  }
188
188
  static wrap({ value: t, cause: n, context: r }) {
189
189
  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({
@@ -192,7 +192,7 @@ Error message: ${un(t)}`,
192
192
  context: r
193
193
  });
194
194
  }
195
- }, kn = "AI_UnsupportedFunctionalityError", An = `vercel.ai.error.${kn}`, jn = Symbol.for(An), Mn, Nn, Pn = class extends (Nn = P, Mn = jn, Nn) {
195
+ }, kn = "AI_UnsupportedFunctionalityError", An = `vercel.ai.error.${kn}`, jn = Symbol.for(An), Mn, Nn, Pn = class extends (Nn = N, Mn = jn, Nn) {
196
196
  constructor({ functionality: e, message: t = `'${e}' functionality not supported.` }) {
197
197
  super({
198
198
  name: kn,
@@ -200,7 +200,7 @@ Error message: ${un(t)}`,
200
200
  }), this[Mn] = !0, this.functionality = e;
201
201
  }
202
202
  static isInstance(e) {
203
- return P.hasMarker(e, An);
203
+ return N.hasMarker(e, An);
204
204
  }
205
205
  }, Fn = class extends Error {
206
206
  constructor(e, t) {
@@ -403,7 +403,7 @@ var F = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRS
403
403
  return r.join("");
404
404
  };
405
405
  if (e == null) return i;
406
- if (n.includes(r)) throw new gn({
406
+ if (n.includes(r)) throw new _n({
407
407
  argument: "separator",
408
408
  message: `The separator "${r}" must not be part of the alphabet "${n}".`
409
409
  });
@@ -448,19 +448,19 @@ function $n(e) {
448
448
  function er(e) {
449
449
  if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
450
450
  let { additionalProperties: t } = e;
451
- e.additionalProperties = t != null && typeof t != "boolean" && I(t);
451
+ e.additionalProperties = t != null && typeof t != "boolean" && tr(t);
452
452
  let { properties: n } = e;
453
- if (n != null) for (let e of Object.keys(n)) n[e] = I(n[e]);
453
+ if (n != null) for (let e of Object.keys(n)) n[e] = tr(n[e]);
454
454
  }
455
- e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(I) : I(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(I)), e.allOf != null && (e.allOf = e.allOf.map(I)), e.oneOf != null && (e.oneOf = e.oneOf.map(I));
455
+ e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(tr) : tr(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(tr)), e.allOf != null && (e.allOf = e.allOf.map(tr)), e.oneOf != null && (e.oneOf = e.oneOf.map(tr));
456
456
  let { definitions: t } = e;
457
- if (t != null) for (let e of Object.keys(t)) t[e] = I(t[e]);
457
+ if (t != null) for (let e of Object.keys(t)) t[e] = tr(t[e]);
458
458
  return e;
459
459
  }
460
- function I(e) {
460
+ function tr(e) {
461
461
  return typeof e == "boolean" ? e : er(e);
462
462
  }
463
- var tr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), nr = {
463
+ var nr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), rr = {
464
464
  name: void 0,
465
465
  $refStrategy: "root",
466
466
  basePath: ["#"],
@@ -480,24 +480,24 @@ var tr = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
480
480
  emailStrategy: "format:email",
481
481
  base64Strategy: "contentEncoding:base64",
482
482
  nameStrategy: "ref"
483
- }, rr = (e) => typeof e == "string" ? {
484
- ...nr,
483
+ }, ir = (e) => typeof e == "string" ? {
484
+ ...rr,
485
485
  name: e
486
486
  } : {
487
- ...nr,
487
+ ...rr,
488
488
  ...e
489
489
  };
490
- function L() {
490
+ function I() {
491
491
  return {};
492
492
  }
493
- function ir(e, t) {
493
+ function ar(e, t) {
494
494
  let n = { type: "array" };
495
- return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = V(e.type._def, {
495
+ return e.type?._def && e.type?._def?.typeName !== "ZodAny" && (n.items = B(e.type._def, {
496
496
  ...t,
497
497
  currentPath: [...t.currentPath, "items"]
498
498
  })), 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;
499
499
  }
500
- function ar(e) {
500
+ function or(e) {
501
501
  let t = {
502
502
  type: "integer",
503
503
  format: "int64"
@@ -514,16 +514,16 @@ function ar(e) {
514
514
  }
515
515
  return t;
516
516
  }
517
- function or() {
517
+ function sr() {
518
518
  return { type: "boolean" };
519
519
  }
520
- function sr(e, t) {
521
- return V(e.type._def, t);
520
+ function cr(e, t) {
521
+ return B(e.type._def, t);
522
522
  }
523
- var cr = (e, t) => V(e.innerType._def, t);
524
- function lr(e, t, n) {
523
+ var lr = (e, t) => B(e.innerType._def, t);
524
+ function ur(e, t, n) {
525
525
  let r = n ?? t.dateStrategy;
526
- if (Array.isArray(r)) return { anyOf: r.map((n) => lr(e, t, n)) };
526
+ if (Array.isArray(r)) return { anyOf: r.map((n) => ur(e, t, n)) };
527
527
  switch (r) {
528
528
  case "string":
529
529
  case "format:date-time": return {
@@ -534,10 +534,10 @@ function lr(e, t, n) {
534
534
  type: "string",
535
535
  format: "date"
536
536
  };
537
- case "integer": return ur(e);
537
+ case "integer": return dr(e);
538
538
  }
539
539
  }
540
- var ur = (e) => {
540
+ var dr = (e) => {
541
541
  let t = {
542
542
  type: "integer",
543
543
  format: "unix-time"
@@ -550,31 +550,31 @@ var ur = (e) => {
550
550
  }
551
551
  return t;
552
552
  };
553
- function dr(e, t) {
553
+ function fr(e, t) {
554
554
  return {
555
- ...V(e.innerType._def, t),
555
+ ...B(e.innerType._def, t),
556
556
  default: e.defaultValue()
557
557
  };
558
558
  }
559
- function fr(e, t) {
560
- return t.effectStrategy === "input" ? V(e.schema._def, t) : L();
559
+ function pr(e, t) {
560
+ return t.effectStrategy === "input" ? B(e.schema._def, t) : I();
561
561
  }
562
- function pr(e) {
562
+ function mr(e) {
563
563
  return {
564
564
  type: "string",
565
565
  enum: Array.from(e.values)
566
566
  };
567
567
  }
568
- var mr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
- function hr(e, t) {
570
- let n = [V(e.left._def, {
568
+ var hr = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
569
+ function gr(e, t) {
570
+ let n = [B(e.left._def, {
571
571
  ...t,
572
572
  currentPath: [
573
573
  ...t.currentPath,
574
574
  "allOf",
575
575
  "0"
576
576
  ]
577
- }), V(e.right._def, {
577
+ }), B(e.right._def, {
578
578
  ...t,
579
579
  currentPath: [
580
580
  ...t.currentPath,
@@ -583,7 +583,7 @@ function hr(e, t) {
583
583
  ]
584
584
  })].filter((e) => !!e), r = [];
585
585
  return n.forEach((e) => {
586
- if (mr(e)) r.push(...e.allOf);
586
+ if (hr(e)) r.push(...e.allOf);
587
587
  else {
588
588
  let t = e;
589
589
  if ("additionalProperties" in e && e.additionalProperties === !1) {
@@ -594,19 +594,19 @@ function hr(e, t) {
594
594
  }
595
595
  }), r.length ? { allOf: r } : void 0;
596
596
  }
597
- function gr(e) {
597
+ function _r(e) {
598
598
  let t = typeof e.value;
599
599
  return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
600
600
  type: t === "bigint" ? "integer" : t,
601
601
  const: e.value
602
602
  };
603
603
  }
604
- var _r = void 0, R = {
604
+ var vr = void 0, L = {
605
605
  cuid: /^[cC][^\s-]{8,}$/,
606
606
  cuid2: /^[0-9a-z]+$/,
607
607
  ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
608
608
  email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
609
- emoji: () => (_r === void 0 && (_r = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), _r),
609
+ emoji: () => (vr === void 0 && (vr = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), vr),
610
610
  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}$/,
611
611
  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])$/,
612
612
  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])$/,
@@ -617,7 +617,7 @@ var _r = void 0, R = {
617
617
  nanoid: /^[a-zA-Z0-9_-]{21}$/,
618
618
  jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
619
619
  };
620
- function vr(e, t) {
620
+ function yr(e, t) {
621
621
  let n = { type: "string" };
622
622
  if (e.checks) for (let r of e.checks) switch (r.kind) {
623
623
  case "min":
@@ -629,108 +629,108 @@ function vr(e, t) {
629
629
  case "email":
630
630
  switch (t.emailStrategy) {
631
631
  case "format:email":
632
- z(n, "email", r.message, t);
632
+ R(n, "email", r.message, t);
633
633
  break;
634
634
  case "format:idn-email":
635
- z(n, "idn-email", r.message, t);
635
+ R(n, "idn-email", r.message, t);
636
636
  break;
637
- case "pattern:zod": B(n, R.email, r.message, t);
637
+ case "pattern:zod": z(n, L.email, r.message, t);
638
638
  }
639
639
  break;
640
640
  case "url":
641
- z(n, "uri", r.message, t);
641
+ R(n, "uri", r.message, t);
642
642
  break;
643
643
  case "uuid":
644
- z(n, "uuid", r.message, t);
644
+ R(n, "uuid", r.message, t);
645
645
  break;
646
646
  case "regex":
647
- B(n, r.regex, r.message, t);
647
+ z(n, r.regex, r.message, t);
648
648
  break;
649
649
  case "cuid":
650
- B(n, R.cuid, r.message, t);
650
+ z(n, L.cuid, r.message, t);
651
651
  break;
652
652
  case "cuid2":
653
- B(n, R.cuid2, r.message, t);
653
+ z(n, L.cuid2, r.message, t);
654
654
  break;
655
655
  case "startsWith":
656
- B(n, RegExp(`^${yr(r.value, t)}`), r.message, t);
656
+ z(n, RegExp(`^${br(r.value, t)}`), r.message, t);
657
657
  break;
658
658
  case "endsWith":
659
- B(n, RegExp(`${yr(r.value, t)}$`), r.message, t);
659
+ z(n, RegExp(`${br(r.value, t)}$`), r.message, t);
660
660
  break;
661
661
  case "datetime":
662
- z(n, "date-time", r.message, t);
662
+ R(n, "date-time", r.message, t);
663
663
  break;
664
664
  case "date":
665
- z(n, "date", r.message, t);
665
+ R(n, "date", r.message, t);
666
666
  break;
667
667
  case "time":
668
- z(n, "time", r.message, t);
668
+ R(n, "time", r.message, t);
669
669
  break;
670
670
  case "duration":
671
- z(n, "duration", r.message, t);
671
+ R(n, "duration", r.message, t);
672
672
  break;
673
673
  case "length":
674
674
  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;
675
675
  break;
676
676
  case "includes":
677
- B(n, RegExp(yr(r.value, t)), r.message, t);
677
+ z(n, RegExp(br(r.value, t)), r.message, t);
678
678
  break;
679
679
  case "ip":
680
- r.version !== "v6" && z(n, "ipv4", r.message, t), r.version !== "v4" && z(n, "ipv6", r.message, t);
680
+ r.version !== "v6" && R(n, "ipv4", r.message, t), r.version !== "v4" && R(n, "ipv6", r.message, t);
681
681
  break;
682
682
  case "base64url":
683
- B(n, R.base64url, r.message, t);
683
+ z(n, L.base64url, r.message, t);
684
684
  break;
685
685
  case "jwt":
686
- B(n, R.jwt, r.message, t);
686
+ z(n, L.jwt, r.message, t);
687
687
  break;
688
688
  case "cidr":
689
- r.version !== "v6" && B(n, R.ipv4Cidr, r.message, t), r.version !== "v4" && B(n, R.ipv6Cidr, r.message, t);
689
+ r.version !== "v6" && z(n, L.ipv4Cidr, r.message, t), r.version !== "v4" && z(n, L.ipv6Cidr, r.message, t);
690
690
  break;
691
691
  case "emoji":
692
- B(n, R.emoji(), r.message, t);
692
+ z(n, L.emoji(), r.message, t);
693
693
  break;
694
694
  case "ulid":
695
- B(n, R.ulid, r.message, t);
695
+ z(n, L.ulid, r.message, t);
696
696
  break;
697
697
  case "base64":
698
698
  switch (t.base64Strategy) {
699
699
  case "format:binary":
700
- z(n, "binary", r.message, t);
700
+ R(n, "binary", r.message, t);
701
701
  break;
702
702
  case "contentEncoding:base64":
703
703
  n.contentEncoding = "base64";
704
704
  break;
705
- case "pattern:zod": B(n, R.base64, r.message, t);
705
+ case "pattern:zod": z(n, L.base64, r.message, t);
706
706
  }
707
707
  break;
708
- case "nanoid": B(n, R.nanoid, r.message, t);
708
+ case "nanoid": z(n, L.nanoid, r.message, t);
709
709
  }
710
710
  return n;
711
711
  }
712
- function yr(e, t) {
713
- return t.patternStrategy === "escape" ? xr(e) : e;
712
+ function br(e, t) {
713
+ return t.patternStrategy === "escape" ? Sr(e) : e;
714
714
  }
715
- var br = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
- function xr(e) {
715
+ var xr = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
716
+ function Sr(e) {
717
717
  let t = "";
718
- for (let n = 0; n < e.length; n++) br.has(e[n]) || (t += "\\"), t += e[n];
718
+ for (let n = 0; n < e.length; n++) xr.has(e[n]) || (t += "\\"), t += e[n];
719
719
  return t;
720
720
  }
721
- function z(e, t, n, r) {
721
+ function R(e, t, n, r) {
722
722
  e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
723
723
  format: t,
724
724
  ...n && r.errorMessages && { errorMessage: { format: n } }
725
725
  })) : e.format = t;
726
726
  }
727
- function B(e, t, n, r) {
727
+ function z(e, t, n, r) {
728
728
  e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
729
- pattern: Sr(t, r),
729
+ pattern: Cr(t, r),
730
730
  ...n && r.errorMessages && { errorMessage: { pattern: n } }
731
- })) : e.pattern = Sr(t, r);
731
+ })) : e.pattern = Cr(t, r);
732
732
  }
733
- function Sr(e, t) {
733
+ function Cr(e, t) {
734
734
  if (!t.applyRegexFlags || !e.flags) return e.source;
735
735
  let n = {
736
736
  i: e.flags.includes("i"),
@@ -778,16 +778,16 @@ function Sr(e, t) {
778
778
  }
779
779
  return i;
780
780
  }
781
- function Cr(e, t) {
781
+ function wr(e, t) {
782
782
  let n = {
783
783
  type: "object",
784
- additionalProperties: V(e.valueType._def, {
784
+ additionalProperties: B(e.valueType._def, {
785
785
  ...t,
786
786
  currentPath: [...t.currentPath, "additionalProperties"]
787
787
  }) ?? t.allowedAdditionalProperties
788
788
  };
789
789
  if (e.keyType?._def.typeName === "ZodString" && e.keyType._def.checks?.length) {
790
- let { type: r, ...i } = vr(e.keyType._def, t);
790
+ let { type: r, ...i } = yr(e.keyType._def, t);
791
791
  return {
792
792
  ...n,
793
793
  propertyNames: i
@@ -798,7 +798,7 @@ function Cr(e, t) {
798
798
  propertyNames: { enum: e.keyType._def.values }
799
799
  };
800
800
  if (e.keyType?._def.typeName === "ZodBranded" && e.keyType._def.type._def.typeName === "ZodString" && e.keyType._def.type._def.checks?.length) {
801
- let { type: r, ...i } = sr(e.keyType._def, t);
801
+ let { type: r, ...i } = cr(e.keyType._def, t);
802
802
  return {
803
803
  ...n,
804
804
  propertyNames: i
@@ -806,13 +806,13 @@ function Cr(e, t) {
806
806
  }
807
807
  return n;
808
808
  }
809
- function wr(e, t) {
810
- return t.mapStrategy === "record" ? Cr(e, t) : {
809
+ function Tr(e, t) {
810
+ return t.mapStrategy === "record" ? wr(e, t) : {
811
811
  type: "array",
812
812
  maxItems: 125,
813
813
  items: {
814
814
  type: "array",
815
- items: [V(e.keyType._def, {
815
+ items: [B(e.keyType._def, {
816
816
  ...t,
817
817
  currentPath: [
818
818
  ...t.currentPath,
@@ -820,7 +820,7 @@ function wr(e, t) {
820
820
  "items",
821
821
  "0"
822
822
  ]
823
- }) || L(), V(e.valueType._def, {
823
+ }) || I(), B(e.valueType._def, {
824
824
  ...t,
825
825
  currentPath: [
826
826
  ...t.currentPath,
@@ -828,37 +828,37 @@ function wr(e, t) {
828
828
  "items",
829
829
  "1"
830
830
  ]
831
- }) || L()],
831
+ }) || I()],
832
832
  minItems: 2,
833
833
  maxItems: 2
834
834
  }
835
835
  };
836
836
  }
837
- function Tr(e) {
837
+ function Er(e) {
838
838
  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)));
839
839
  return {
840
840
  type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
841
841
  enum: n
842
842
  };
843
843
  }
844
- function Er() {
845
- return { not: L() };
846
- }
847
844
  function Dr() {
845
+ return { not: I() };
846
+ }
847
+ function Or() {
848
848
  return { type: "null" };
849
849
  }
850
- var Or = {
850
+ var kr = {
851
851
  ZodString: "string",
852
852
  ZodNumber: "number",
853
853
  ZodBigInt: "integer",
854
854
  ZodBoolean: "boolean",
855
855
  ZodNull: "null"
856
856
  };
857
- function kr(e, t) {
857
+ function Ar(e, t) {
858
858
  let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
859
- if (n.every((e) => e._def.typeName in Or && (!e._def.checks || !e._def.checks.length))) {
859
+ if (n.every((e) => e._def.typeName in kr && (!e._def.checks || !e._def.checks.length))) {
860
860
  let e = n.reduce((e, t) => {
861
- let n = Or[t._def.typeName];
861
+ let n = kr[t._def.typeName];
862
862
  return n && !e.includes(n) ? [...e, n] : e;
863
863
  }, []);
864
864
  return { type: e.length > 1 ? e : e[0] };
@@ -886,10 +886,10 @@ function kr(e, t) {
886
886
  type: "string",
887
887
  enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
888
888
  };
889
- return Ar(e, t);
889
+ return jr(e, t);
890
890
  }
891
- var Ar = (e, t) => {
892
- let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => V(e._def, {
891
+ var jr = (e, t) => {
892
+ let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => B(e._def, {
893
893
  ...t,
894
894
  currentPath: [
895
895
  ...t.currentPath,
@@ -899,15 +899,15 @@ var Ar = (e, t) => {
899
899
  })).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
900
900
  return n.length ? { anyOf: n } : void 0;
901
901
  };
902
- function jr(e, t) {
902
+ function Mr(e, t) {
903
903
  if ([
904
904
  "ZodString",
905
905
  "ZodNumber",
906
906
  "ZodBigInt",
907
907
  "ZodBoolean",
908
908
  "ZodNull"
909
- ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Or[e.innerType._def.typeName], "null"] };
910
- let n = V(e.innerType._def, {
909
+ ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [kr[e.innerType._def.typeName], "null"] };
910
+ let n = B(e.innerType._def, {
911
911
  ...t,
912
912
  currentPath: [
913
913
  ...t.currentPath,
@@ -917,7 +917,7 @@ function jr(e, t) {
917
917
  });
918
918
  return n && { anyOf: [n, { type: "null" }] };
919
919
  }
920
- function Mr(e) {
920
+ function Nr(e) {
921
921
  let t = { type: "number" };
922
922
  if (!e.checks) return t;
923
923
  for (let n of e.checks) switch (n.kind) {
@@ -934,7 +934,7 @@ function Mr(e) {
934
934
  }
935
935
  return t;
936
936
  }
937
- function Nr(e, t) {
937
+ function Pr(e, t) {
938
938
  let n = {
939
939
  type: "object",
940
940
  properties: {}
@@ -942,7 +942,7 @@ function Nr(e, t) {
942
942
  for (let e in i) {
943
943
  let a = i[e];
944
944
  if (a === void 0 || a._def === void 0) continue;
945
- let o = Fr(a), s = V(a._def, {
945
+ let o = Ir(a), s = B(a._def, {
946
946
  ...t,
947
947
  currentPath: [
948
948
  ...t.currentPath,
@@ -958,11 +958,11 @@ function Nr(e, t) {
958
958
  s !== void 0 && (n.properties[e] = s, o || r.push(e));
959
959
  }
960
960
  r.length && (n.required = r);
961
- let a = Pr(e, t);
961
+ let a = Fr(e, t);
962
962
  return a !== void 0 && (n.additionalProperties = a), n;
963
963
  }
964
- function Pr(e, t) {
965
- if (e.catchall._def.typeName !== "ZodNever") return V(e.catchall._def, {
964
+ function Fr(e, t) {
965
+ if (e.catchall._def.typeName !== "ZodNever") return B(e.catchall._def, {
966
966
  ...t,
967
967
  currentPath: [...t.currentPath, "additionalProperties"]
968
968
  });
@@ -972,16 +972,16 @@ function Pr(e, t) {
972
972
  case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
973
973
  }
974
974
  }
975
- function Fr(e) {
975
+ function Ir(e) {
976
976
  try {
977
977
  return e.isOptional();
978
978
  } catch {
979
979
  return !0;
980
980
  }
981
981
  }
982
- var Ir = (e, t) => {
983
- if (t.currentPath.toString() === t.propertyPath?.toString()) return V(e.innerType._def, t);
984
- let n = V(e.innerType._def, {
982
+ var Lr = (e, t) => {
983
+ if (t.currentPath.toString() === t.propertyPath?.toString()) return B(e.innerType._def, t);
984
+ let n = B(e.innerType._def, {
985
985
  ...t,
986
986
  currentPath: [
987
987
  ...t.currentPath,
@@ -989,11 +989,11 @@ var Ir = (e, t) => {
989
989
  "1"
990
990
  ]
991
991
  });
992
- return n ? { anyOf: [{ not: L() }, n] } : L();
993
- }, Lr = (e, t) => {
994
- if (t.pipeStrategy === "input") return V(e.in._def, t);
995
- if (t.pipeStrategy === "output") return V(e.out._def, t);
996
- let n = V(e.in._def, {
992
+ return n ? { anyOf: [{ not: I() }, n] } : I();
993
+ }, Rr = (e, t) => {
994
+ if (t.pipeStrategy === "input") return B(e.in._def, t);
995
+ if (t.pipeStrategy === "output") return B(e.out._def, t);
996
+ let n = B(e.in._def, {
997
997
  ...t,
998
998
  currentPath: [
999
999
  ...t.currentPath,
@@ -1001,7 +1001,7 @@ var Ir = (e, t) => {
1001
1001
  "0"
1002
1002
  ]
1003
1003
  });
1004
- return { allOf: [n, V(e.out._def, {
1004
+ return { allOf: [n, B(e.out._def, {
1005
1005
  ...t,
1006
1006
  currentPath: [
1007
1007
  ...t.currentPath,
@@ -1010,25 +1010,25 @@ var Ir = (e, t) => {
1010
1010
  ]
1011
1011
  })].filter((e) => e !== void 0) };
1012
1012
  };
1013
- function Rr(e, t) {
1014
- return V(e.type._def, t);
1015
- }
1016
1013
  function zr(e, t) {
1014
+ return B(e.type._def, t);
1015
+ }
1016
+ function Br(e, t) {
1017
1017
  let n = {
1018
1018
  type: "array",
1019
1019
  uniqueItems: !0,
1020
- items: V(e.valueType._def, {
1020
+ items: B(e.valueType._def, {
1021
1021
  ...t,
1022
1022
  currentPath: [...t.currentPath, "items"]
1023
1023
  })
1024
1024
  };
1025
1025
  return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
1026
1026
  }
1027
- function Br(e, t) {
1027
+ function Vr(e, t) {
1028
1028
  return e.rest ? {
1029
1029
  type: "array",
1030
1030
  minItems: e.items.length,
1031
- items: e.items.map((e, n) => V(e._def, {
1031
+ items: e.items.map((e, n) => B(e._def, {
1032
1032
  ...t,
1033
1033
  currentPath: [
1034
1034
  ...t.currentPath,
@@ -1036,7 +1036,7 @@ function Br(e, t) {
1036
1036
  `${n}`
1037
1037
  ]
1038
1038
  })).reduce((e, t) => t === void 0 ? e : [...e, t], []),
1039
- additionalItems: V(e.rest._def, {
1039
+ additionalItems: B(e.rest._def, {
1040
1040
  ...t,
1041
1041
  currentPath: [...t.currentPath, "additionalItems"]
1042
1042
  })
@@ -1044,7 +1044,7 @@ function Br(e, t) {
1044
1044
  type: "array",
1045
1045
  minItems: e.items.length,
1046
1046
  maxItems: e.items.length,
1047
- items: e.items.map((e, n) => V(e._def, {
1047
+ items: e.items.map((e, n) => B(e._def, {
1048
1048
  ...t,
1049
1049
  currentPath: [
1050
1050
  ...t.currentPath,
@@ -1054,65 +1054,65 @@ function Br(e, t) {
1054
1054
  })).reduce((e, t) => t === void 0 ? e : [...e, t], [])
1055
1055
  };
1056
1056
  }
1057
- function Vr() {
1058
- return { not: L() };
1059
- }
1060
1057
  function Hr() {
1061
- return L();
1058
+ return { not: I() };
1059
+ }
1060
+ function Ur() {
1061
+ return I();
1062
1062
  }
1063
- var Ur = (e, t) => V(e.innerType._def, t), Wr = (e, t, n) => {
1063
+ var Wr = (e, t) => B(e.innerType._def, t), Gr = (e, t, n) => {
1064
1064
  switch (t) {
1065
- case "ZodString": return vr(e, n);
1066
- case "ZodNumber": return Mr(e);
1067
- case "ZodObject": return Nr(e, n);
1068
- case "ZodBigInt": return ar(e);
1069
- case "ZodBoolean": return or();
1070
- case "ZodDate": return lr(e, n);
1071
- case "ZodUndefined": return Vr();
1072
- case "ZodNull": return Dr();
1073
- case "ZodArray": return ir(e, n);
1065
+ case "ZodString": return yr(e, n);
1066
+ case "ZodNumber": return Nr(e);
1067
+ case "ZodObject": return Pr(e, n);
1068
+ case "ZodBigInt": return or(e);
1069
+ case "ZodBoolean": return sr();
1070
+ case "ZodDate": return ur(e, n);
1071
+ case "ZodUndefined": return Hr();
1072
+ case "ZodNull": return Or();
1073
+ case "ZodArray": return ar(e, n);
1074
1074
  case "ZodUnion":
1075
- case "ZodDiscriminatedUnion": return kr(e, n);
1076
- case "ZodIntersection": return hr(e, n);
1077
- case "ZodTuple": return Br(e, n);
1078
- case "ZodRecord": return Cr(e, n);
1079
- case "ZodLiteral": return gr(e);
1080
- case "ZodEnum": return pr(e);
1081
- case "ZodNativeEnum": return Tr(e);
1082
- case "ZodNullable": return jr(e, n);
1083
- case "ZodOptional": return Ir(e, n);
1084
- case "ZodMap": return wr(e, n);
1085
- case "ZodSet": return zr(e, n);
1075
+ case "ZodDiscriminatedUnion": return Ar(e, n);
1076
+ case "ZodIntersection": return gr(e, n);
1077
+ case "ZodTuple": return Vr(e, n);
1078
+ case "ZodRecord": return wr(e, n);
1079
+ case "ZodLiteral": return _r(e);
1080
+ case "ZodEnum": return mr(e);
1081
+ case "ZodNativeEnum": return Er(e);
1082
+ case "ZodNullable": return Mr(e, n);
1083
+ case "ZodOptional": return Lr(e, n);
1084
+ case "ZodMap": return Tr(e, n);
1085
+ case "ZodSet": return Br(e, n);
1086
1086
  case "ZodLazy": return () => e.getter()._def;
1087
- case "ZodPromise": return Rr(e, n);
1087
+ case "ZodPromise": return zr(e, n);
1088
1088
  case "ZodNaN":
1089
- case "ZodNever": return Er();
1090
- case "ZodEffects": return fr(e, n);
1091
- case "ZodAny": return L();
1092
- case "ZodUnknown": return Hr();
1093
- case "ZodDefault": return dr(e, n);
1094
- case "ZodBranded": return sr(e, n);
1095
- case "ZodReadonly": return Ur(e, n);
1096
- case "ZodCatch": return cr(e, n);
1097
- case "ZodPipeline": return Lr(e, n);
1089
+ case "ZodNever": return Dr();
1090
+ case "ZodEffects": return pr(e, n);
1091
+ case "ZodAny": return I();
1092
+ case "ZodUnknown": return Ur();
1093
+ case "ZodDefault": return fr(e, n);
1094
+ case "ZodBranded": return cr(e, n);
1095
+ case "ZodReadonly": return Wr(e, n);
1096
+ case "ZodCatch": return lr(e, n);
1097
+ case "ZodPipeline": return Rr(e, n);
1098
1098
  case "ZodFunction":
1099
1099
  case "ZodVoid":
1100
1100
  case "ZodSymbol": return;
1101
1101
  default: return /* @__PURE__ */ ((e) => void 0)(t);
1102
1102
  }
1103
- }, Gr = (e, t) => {
1103
+ }, Kr = (e, t) => {
1104
1104
  let n = 0;
1105
1105
  for (; n < e.length && n < t.length && e[n] === t[n]; n++);
1106
1106
  return [(e.length - n).toString(), ...t.slice(n)].join("/");
1107
1107
  };
1108
- function V(e, t, n = !1) {
1108
+ function B(e, t, n = !1) {
1109
1109
  let r = t.seen.get(e);
1110
1110
  if (t.override) {
1111
1111
  let i = t.override?.call(t, e, t, r, n);
1112
- if (i !== tr) return i;
1112
+ if (i !== nr) return i;
1113
1113
  }
1114
1114
  if (r && !n) {
1115
- let e = Kr(r, t);
1115
+ let e = qr(r, t);
1116
1116
  if (e !== void 0) return e;
1117
1117
  }
1118
1118
  let i = {
@@ -1121,22 +1121,22 @@ function V(e, t, n = !1) {
1121
1121
  jsonSchema: void 0
1122
1122
  };
1123
1123
  t.seen.set(e, i);
1124
- let a = Wr(e, e.typeName, t), o = typeof a == "function" ? V(a(), t) : a;
1125
- if (o && qr(e, t, o), t.postProcess) {
1124
+ let a = Gr(e, e.typeName, t), o = typeof a == "function" ? B(a(), t) : a;
1125
+ if (o && Jr(e, t, o), t.postProcess) {
1126
1126
  let n = t.postProcess(o, e, t);
1127
1127
  return i.jsonSchema = o, n;
1128
1128
  }
1129
1129
  return i.jsonSchema = o, o;
1130
1130
  }
1131
- var Kr = (e, t) => {
1131
+ var qr = (e, t) => {
1132
1132
  switch (t.$refStrategy) {
1133
1133
  case "root": return { $ref: e.path.join("/") };
1134
- case "relative": return { $ref: Gr(t.currentPath, e.path) };
1134
+ case "relative": return { $ref: Kr(t.currentPath, e.path) };
1135
1135
  case "none":
1136
- 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`), L()) : t.$refStrategy === "seen" ? L() : void 0;
1136
+ case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), I()) : t.$refStrategy === "seen" ? I() : void 0;
1137
1137
  }
1138
- }, qr = (e, t, n) => (e.description && (n.description = e.description), n), Jr = (e) => {
1139
- let t = rr(e), n = t.name === void 0 ? t.basePath : [
1138
+ }, Jr = (e, t, n) => (e.description && (n.description = e.description), n), Yr = (e) => {
1139
+ let t = ir(e), n = t.name === void 0 ? t.basePath : [
1140
1140
  ...t.basePath,
1141
1141
  t.definitionPath,
1142
1142
  t.name
@@ -1155,25 +1155,25 @@ var Kr = (e, t) => {
1155
1155
  jsonSchema: void 0
1156
1156
  }]))
1157
1157
  };
1158
- }, Yr = (e, t) => {
1159
- let n = Jr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1158
+ }, Xr = (e, t) => {
1159
+ let n = Yr(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
1160
1160
  ...e,
1161
- [t]: V(r._def, {
1161
+ [t]: B(r._def, {
1162
1162
  ...n,
1163
1163
  currentPath: [
1164
1164
  ...n.basePath,
1165
1165
  n.definitionPath,
1166
1166
  t
1167
1167
  ]
1168
- }, !0) ?? L()
1169
- }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = V(e._def, i === void 0 ? n : {
1168
+ }, !0) ?? I()
1169
+ }), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = B(e._def, i === void 0 ? n : {
1170
1170
  ...n,
1171
1171
  currentPath: [
1172
1172
  ...n.basePath,
1173
1173
  n.definitionPath,
1174
1174
  i
1175
1175
  ]
1176
- }, !1) ?? L(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1176
+ }, !1) ?? I(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
1177
1177
  o !== void 0 && (a.title = o);
1178
1178
  let s = i === void 0 ? r ? {
1179
1179
  ...a,
@@ -1190,14 +1190,14 @@ var Kr = (e, t) => {
1190
1190
  }
1191
1191
  };
1192
1192
  return s.$schema = "http://json-schema.org/draft-07/schema#", s;
1193
- }, Xr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
- function Zr(e) {
1193
+ }, Zr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
1194
+ function Qr(e) {
1195
1195
  let t;
1196
1196
  return () => (t ??= e(), t);
1197
1197
  }
1198
- function Qr(e, { validate: t } = {}) {
1198
+ function $r(e, { validate: t } = {}) {
1199
1199
  return {
1200
- [Xr]: !0,
1200
+ [Zr]: !0,
1201
1201
  _type: void 0,
1202
1202
  get jsonSchema() {
1203
1203
  return typeof e == "function" && (e = e()), e;
@@ -1205,19 +1205,19 @@ function Qr(e, { validate: t } = {}) {
1205
1205
  validate: t
1206
1206
  };
1207
1207
  }
1208
- function $r(e) {
1209
- return typeof e == "object" && !!e && Xr in e && e[Xr] === !0 && "jsonSchema" in e && "validate" in e;
1210
- }
1211
1208
  function ei(e) {
1212
- return e == null ? Qr({
1209
+ return typeof e == "object" && !!e && Zr in e && e[Zr] === !0 && "jsonSchema" in e && "validate" in e;
1210
+ }
1211
+ function ti(e) {
1212
+ return e == null ? $r({
1213
1213
  type: "object",
1214
1214
  properties: {},
1215
1215
  additionalProperties: !1
1216
- }) : $r(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? oi(e) : ti(e) : e();
1216
+ }) : ei(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? si(e) : ni(e) : e();
1217
1217
  }
1218
- function ti(e) {
1219
- return Qr(() => {
1220
- if (!ni(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1218
+ function ni(e) {
1219
+ return $r(() => {
1220
+ if (!ri(e)) throw Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);
1221
1221
  return er(e["~standard"].jsonSchema.input({ target: "draft-07" }));
1222
1222
  }, { validate: async (t) => {
1223
1223
  let n = await e["~standard"].validate(t);
@@ -1226,19 +1226,19 @@ function ti(e) {
1226
1226
  value: n.value
1227
1227
  } : {
1228
1228
  success: !1,
1229
- error: new On({
1229
+ error: new P({
1230
1230
  value: t,
1231
1231
  cause: n.issues
1232
1232
  })
1233
1233
  };
1234
1234
  } });
1235
1235
  }
1236
- function ni(e) {
1236
+ function ri(e) {
1237
1237
  return e["~standard"].jsonSchema != null;
1238
1238
  }
1239
- function ri(e, t) {
1239
+ function ii(e, t) {
1240
1240
  let n = t?.useReferences ?? !1;
1241
- return Qr(() => Yr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1241
+ return $r(() => Xr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
1242
1242
  let n = await e.safeParseAsync(t);
1243
1243
  return n.success ? {
1244
1244
  success: !0,
@@ -1249,14 +1249,14 @@ function ri(e, t) {
1249
1249
  };
1250
1250
  } });
1251
1251
  }
1252
- function ii(e, t) {
1252
+ function ai(e, t) {
1253
1253
  let n = t?.useReferences ?? !1;
1254
- return Qr(() => er(it(e, {
1254
+ return $r(() => er(at(e, {
1255
1255
  target: "draft-7",
1256
1256
  io: "input",
1257
1257
  reused: n ? "ref" : "inline"
1258
1258
  })), { validate: async (t) => {
1259
- let n = await dt(e, t);
1259
+ let n = await ft(e, t);
1260
1260
  return n.success ? {
1261
1261
  success: !0,
1262
1262
  value: n.data
@@ -1266,27 +1266,27 @@ function ii(e, t) {
1266
1266
  };
1267
1267
  } });
1268
1268
  }
1269
- function ai(e) {
1269
+ function oi(e) {
1270
1270
  return "_zod" in e;
1271
1271
  }
1272
- function oi(e, t) {
1273
- return ai(e) ? ii(e, t) : ri(e, t);
1272
+ function si(e, t) {
1273
+ return oi(e) ? ai(e, t) : ii(e, t);
1274
1274
  }
1275
- async function si({ value: e, schema: t, context: n }) {
1276
- let r = await ci({
1275
+ async function ci({ value: e, schema: t, context: n }) {
1276
+ let r = await li({
1277
1277
  value: e,
1278
1278
  schema: t,
1279
1279
  context: n
1280
1280
  });
1281
- if (!r.success) throw On.wrap({
1281
+ if (!r.success) throw P.wrap({
1282
1282
  value: e,
1283
1283
  cause: r.error,
1284
1284
  context: n
1285
1285
  });
1286
1286
  return r.value;
1287
1287
  }
1288
- async function ci({ value: e, schema: t, context: n }) {
1289
- let r = ei(t);
1288
+ async function li({ value: e, schema: t, context: n }) {
1289
+ let r = ti(t);
1290
1290
  try {
1291
1291
  if (r.validate == null) return {
1292
1292
  success: !0,
@@ -1300,7 +1300,7 @@ async function ci({ value: e, schema: t, context: n }) {
1300
1300
  rawValue: e
1301
1301
  } : {
1302
1302
  success: !1,
1303
- error: On.wrap({
1303
+ error: P.wrap({
1304
1304
  value: e,
1305
1305
  cause: t.error,
1306
1306
  context: n
@@ -1310,7 +1310,7 @@ async function ci({ value: e, schema: t, context: n }) {
1310
1310
  } catch (t) {
1311
1311
  return {
1312
1312
  success: !1,
1313
- error: On.wrap({
1313
+ error: P.wrap({
1314
1314
  value: e,
1315
1315
  cause: t,
1316
1316
  context: n
@@ -1319,21 +1319,21 @@ async function ci({ value: e, schema: t, context: n }) {
1319
1319
  };
1320
1320
  }
1321
1321
  }
1322
- async function li({ text: e, schema: t }) {
1322
+ async function ui({ text: e, schema: t }) {
1323
1323
  try {
1324
1324
  let n = $n(e);
1325
1325
  return t == null ? {
1326
1326
  success: !0,
1327
1327
  value: n,
1328
1328
  rawValue: n
1329
- } : await ci({
1329
+ } : await li({
1330
1330
  value: n,
1331
1331
  schema: t
1332
1332
  });
1333
1333
  } catch (t) {
1334
1334
  return {
1335
1335
  success: !1,
1336
- error: Sn.isInstance(t) ? t : new Sn({
1336
+ error: Cn.isInstance(t) ? t : new Cn({
1337
1337
  text: e,
1338
1338
  cause: t
1339
1339
  }),
@@ -1341,56 +1341,56 @@ async function li({ text: e, schema: t }) {
1341
1341
  };
1342
1342
  }
1343
1343
  }
1344
- function ui({ stream: e, schema: t }) {
1344
+ function di({ stream: e, schema: t }) {
1345
1345
  return e.pipeThrough(new TextDecoderStream()).pipeThrough(new Un()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
1346
- e !== "[DONE]" && n.enqueue(await li({
1346
+ e !== "[DONE]" && n.enqueue(await ui({
1347
1347
  text: e,
1348
1348
  schema: t
1349
1349
  }));
1350
1350
  } }));
1351
1351
  }
1352
- async function H(e) {
1352
+ async function V(e) {
1353
1353
  return typeof e == "function" && (e = e()), Promise.resolve(e);
1354
1354
  }
1355
1355
  new TextDecoder();
1356
- var di = Object.defineProperty, fi = (e, t) => {
1357
- for (var n in t) di(e, n, {
1356
+ var fi = Object.defineProperty, pi = (e, t) => {
1357
+ for (var n in t) fi(e, n, {
1358
1358
  get: t[n],
1359
1359
  enumerable: !0
1360
1360
  });
1361
- }, pi = "AI_InvalidArgumentError", mi = `vercel.ai.error.${pi}`, hi = Symbol.for(mi), gi, _i, vi = class extends (_i = P, gi = hi, _i) {
1361
+ }, mi = "AI_InvalidArgumentError", hi = `vercel.ai.error.${mi}`, gi = Symbol.for(hi), _i, vi, yi = class extends (vi = N, _i = gi, vi) {
1362
1362
  constructor({ parameter: e, value: t, message: n }) {
1363
1363
  super({
1364
- name: pi,
1364
+ name: mi,
1365
1365
  message: `Invalid argument for parameter ${e}: ${n}`
1366
- }), this[gi] = !0, this.parameter = e, this.value = t;
1366
+ }), this[_i] = !0, this.parameter = e, this.value = t;
1367
1367
  }
1368
1368
  static isInstance(e) {
1369
- return P.hasMarker(e, mi);
1369
+ return N.hasMarker(e, hi);
1370
1370
  }
1371
- }, yi = "AI_NoObjectGeneratedError", bi = `vercel.ai.error.${yi}`, xi = Symbol.for(bi), Si, Ci, U = class extends (Ci = P, Si = xi, Ci) {
1371
+ }, bi = "AI_NoObjectGeneratedError", xi = `vercel.ai.error.${bi}`, Si = Symbol.for(xi), Ci, wi, H = class extends (wi = N, Ci = Si, wi) {
1372
1372
  constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
1373
1373
  super({
1374
- name: yi,
1374
+ name: bi,
1375
1375
  message: e,
1376
1376
  cause: t
1377
- }), this[Si] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1377
+ }), this[Ci] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
1378
1378
  }
1379
1379
  static isInstance(e) {
1380
- return P.hasMarker(e, bi);
1380
+ return N.hasMarker(e, xi);
1381
1381
  }
1382
- }, wi = "AI_UIMessageStreamError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi, ki = class extends (Oi = P, Di = Ei, Oi) {
1382
+ }, Ti = "AI_UIMessageStreamError", Ei = `vercel.ai.error.${Ti}`, Di = Symbol.for(Ei), Oi, ki, Ai = class extends (ki = N, Oi = Di, ki) {
1383
1383
  constructor({ chunkType: e, chunkId: t, message: n }) {
1384
1384
  super({
1385
- name: wi,
1385
+ name: Ti,
1386
1386
  message: n
1387
- }), this[Di] = !0, this.chunkType = e, this.chunkId = t;
1387
+ }), this[Oi] = !0, this.chunkType = e, this.chunkId = t;
1388
1388
  }
1389
1389
  static isInstance(e) {
1390
- return P.hasMarker(e, Ti);
1390
+ return N.hasMarker(e, Ei);
1391
1391
  }
1392
1392
  };
1393
- function Ai({ warning: e, provider: t, model: n }) {
1393
+ function ji({ warning: e, provider: t, model: n }) {
1394
1394
  let r = `AI SDK Warning${t != null && n != null ? ` (${t} / ${n})` : ""}:`;
1395
1395
  switch (e.type) {
1396
1396
  case "unsupported": {
@@ -1406,11 +1406,11 @@ function Ai({ warning: e, provider: t, model: n }) {
1406
1406
  default: return `${r} ${JSON.stringify(e, null, 2)}`;
1407
1407
  }
1408
1408
  }
1409
- var ji = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Mi = !1;
1410
- function Ni({ message: e, type: t }) {
1409
+ var Mi = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", Ni = !1;
1410
+ function Pi({ message: e, type: t }) {
1411
1411
  typeof process < "u" && typeof process.emitWarning == "function" ? process.emitWarning(e, { type: t }) : console.warn(e);
1412
1412
  }
1413
- var Pi = (e) => {
1413
+ var Fi = (e) => {
1414
1414
  if (e.warnings.length === 0) return;
1415
1415
  let t = globalThis.AI_SDK_LOG_WARNINGS;
1416
1416
  if (t !== !1) {
@@ -1418,12 +1418,12 @@ var Pi = (e) => {
1418
1418
  t(e);
1419
1419
  return;
1420
1420
  }
1421
- Mi || (Mi = !0, Ni({
1422
- message: ji,
1421
+ Ni || (Ni = !0, Pi({
1422
+ message: Mi,
1423
1423
  type: "Warning"
1424
1424
  }));
1425
- for (let t of e.warnings) Ni({
1426
- message: Ai({
1425
+ for (let t of e.warnings) Pi({
1426
+ message: ji({
1427
1427
  warning: t,
1428
1428
  provider: e.provider,
1429
1429
  model: e.model
@@ -1432,7 +1432,7 @@ var Pi = (e) => {
1432
1432
  });
1433
1433
  }
1434
1434
  };
1435
- function Fi(e, t) {
1435
+ function Ii(e, t) {
1436
1436
  if (e === void 0 && t === void 0) return;
1437
1437
  if (e === void 0) return t;
1438
1438
  if (t === void 0) return e;
@@ -1441,261 +1441,261 @@ function Fi(e, t) {
1441
1441
  let i = t[r];
1442
1442
  if (i === void 0) continue;
1443
1443
  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);
1444
- n[r] = o && s ? Fi(a, i) : i;
1444
+ n[r] = o && s ? Ii(a, i) : i;
1445
1445
  }
1446
1446
  return n;
1447
1447
  }
1448
- var W = {
1449
- array: nt,
1450
- boolean: qe,
1451
- custom: ct,
1452
- discriminatedUnion: rt,
1453
- enum: st,
1454
- instanceof: ut,
1455
- lazy: Ye,
1456
- literal: Je,
1457
- looseObject: $e,
1458
- never: Ke,
1459
- null: at,
1460
- number: ot,
1461
- object: Qe,
1462
- record: et,
1463
- string: Xe,
1464
- union: Ze,
1465
- unknown: tt
1466
- }, Ii = W.lazy(() => W.union([
1467
- W.null(),
1468
- W.string(),
1469
- W.number(),
1470
- W.boolean(),
1471
- W.record(W.string(), Ii.optional()),
1472
- W.array(Ii)
1473
- ])), G = W.record(W.string(), W.record(W.string(), Ii.optional())), Li = W.union([
1474
- W.string(),
1475
- W.instanceof(Uint8Array),
1476
- W.instanceof(ArrayBuffer),
1477
- W.custom(Jn, { message: "Must be a Buffer" })
1478
- ]), Ri = W.record(W.string(), W.string()), zi = W.object({
1479
- type: W.literal("text"),
1480
- text: W.string(),
1481
- providerOptions: G.optional()
1482
- }), Bi = W.object({
1483
- type: W.literal("image"),
1484
- image: W.union([
1485
- Li,
1486
- W.instanceof(URL),
1487
- Ri
1448
+ var U = {
1449
+ array: rt,
1450
+ boolean: Je,
1451
+ custom: lt,
1452
+ discriminatedUnion: it,
1453
+ enum: ct,
1454
+ instanceof: dt,
1455
+ lazy: Xe,
1456
+ literal: Ye,
1457
+ looseObject: et,
1458
+ never: qe,
1459
+ null: ot,
1460
+ number: st,
1461
+ object: $e,
1462
+ record: tt,
1463
+ string: Ze,
1464
+ union: Qe,
1465
+ unknown: nt
1466
+ }, Li = U.lazy(() => U.union([
1467
+ U.null(),
1468
+ U.string(),
1469
+ U.number(),
1470
+ U.boolean(),
1471
+ U.record(U.string(), Li.optional()),
1472
+ U.array(Li)
1473
+ ])), W = U.record(U.string(), U.record(U.string(), Li.optional())), Ri = U.union([
1474
+ U.string(),
1475
+ U.instanceof(Uint8Array),
1476
+ U.instanceof(ArrayBuffer),
1477
+ U.custom(Jn, { message: "Must be a Buffer" })
1478
+ ]), zi = U.record(U.string(), U.string()), Bi = U.object({
1479
+ type: U.literal("text"),
1480
+ text: U.string(),
1481
+ providerOptions: W.optional()
1482
+ }), Vi = U.object({
1483
+ type: U.literal("image"),
1484
+ image: U.union([
1485
+ Ri,
1486
+ U.instanceof(URL),
1487
+ zi
1488
1488
  ]),
1489
- mediaType: W.string().optional(),
1490
- providerOptions: G.optional()
1491
- }), Vi = W.discriminatedUnion("type", [
1492
- W.object({
1493
- type: W.literal("data"),
1494
- data: Li
1489
+ mediaType: U.string().optional(),
1490
+ providerOptions: W.optional()
1491
+ }), Hi = U.discriminatedUnion("type", [
1492
+ U.object({
1493
+ type: U.literal("data"),
1494
+ data: Ri
1495
1495
  }),
1496
- W.object({
1497
- type: W.literal("url"),
1498
- url: W.instanceof(URL)
1496
+ U.object({
1497
+ type: U.literal("url"),
1498
+ url: U.instanceof(URL)
1499
1499
  }),
1500
- W.object({
1501
- type: W.literal("reference"),
1502
- reference: Ri
1500
+ U.object({
1501
+ type: U.literal("reference"),
1502
+ reference: zi
1503
1503
  }),
1504
- W.object({
1505
- type: W.literal("text"),
1506
- text: W.string()
1504
+ U.object({
1505
+ type: U.literal("text"),
1506
+ text: U.string()
1507
1507
  })
1508
- ]), Hi = W.discriminatedUnion("type", [W.object({
1509
- type: W.literal("data"),
1510
- data: Li
1511
- }), W.object({
1512
- type: W.literal("url"),
1513
- url: W.instanceof(URL)
1514
- })]), Ui = W.object({
1515
- type: W.literal("file"),
1516
- data: W.union([
1517
- Vi,
1518
- Li,
1519
- W.instanceof(URL),
1520
- Ri
1521
- ]),
1522
- filename: W.string().optional(),
1523
- mediaType: W.string(),
1524
- providerOptions: G.optional()
1525
- }), Wi = W.object({
1526
- type: W.literal("reasoning"),
1527
- text: W.string(),
1528
- providerOptions: G.optional()
1529
- }), Gi = W.object({
1530
- type: W.literal("custom"),
1531
- kind: W.string().transform((e) => e),
1532
- providerOptions: G.optional()
1533
- }), Ki = W.object({
1534
- type: W.literal("reasoning-file"),
1535
- data: W.union([
1508
+ ]), Ui = U.discriminatedUnion("type", [U.object({
1509
+ type: U.literal("data"),
1510
+ data: Ri
1511
+ }), U.object({
1512
+ type: U.literal("url"),
1513
+ url: U.instanceof(URL)
1514
+ })]), Wi = U.object({
1515
+ type: U.literal("file"),
1516
+ data: U.union([
1536
1517
  Hi,
1537
- Li,
1538
- W.instanceof(URL)
1518
+ Ri,
1519
+ U.instanceof(URL),
1520
+ zi
1521
+ ]),
1522
+ filename: U.string().optional(),
1523
+ mediaType: U.string(),
1524
+ providerOptions: W.optional()
1525
+ }), Gi = U.object({
1526
+ type: U.literal("reasoning"),
1527
+ text: U.string(),
1528
+ providerOptions: W.optional()
1529
+ }), Ki = U.object({
1530
+ type: U.literal("custom"),
1531
+ kind: U.string().transform((e) => e),
1532
+ providerOptions: W.optional()
1533
+ }), qi = U.object({
1534
+ type: U.literal("reasoning-file"),
1535
+ data: U.union([
1536
+ Ui,
1537
+ Ri,
1538
+ U.instanceof(URL)
1539
1539
  ]),
1540
- mediaType: W.string(),
1541
- providerOptions: G.optional()
1542
- }), qi = W.object({
1543
- type: W.literal("tool-call"),
1544
- toolCallId: W.string(),
1545
- toolName: W.string(),
1546
- input: W.unknown(),
1547
- providerOptions: G.optional(),
1548
- providerExecuted: W.boolean().optional()
1549
- }), Ji = W.discriminatedUnion("type", [
1550
- W.object({
1551
- type: W.literal("text"),
1552
- value: W.string(),
1553
- providerOptions: G.optional()
1540
+ mediaType: U.string(),
1541
+ providerOptions: W.optional()
1542
+ }), Ji = U.object({
1543
+ type: U.literal("tool-call"),
1544
+ toolCallId: U.string(),
1545
+ toolName: U.string(),
1546
+ input: U.unknown(),
1547
+ providerOptions: W.optional(),
1548
+ providerExecuted: U.boolean().optional()
1549
+ }), Yi = U.discriminatedUnion("type", [
1550
+ U.object({
1551
+ type: U.literal("text"),
1552
+ value: U.string(),
1553
+ providerOptions: W.optional()
1554
1554
  }),
1555
- W.object({
1556
- type: W.literal("json"),
1557
- value: Ii,
1558
- providerOptions: G.optional()
1555
+ U.object({
1556
+ type: U.literal("json"),
1557
+ value: Li,
1558
+ providerOptions: W.optional()
1559
1559
  }),
1560
- W.object({
1561
- type: W.literal("execution-denied"),
1562
- reason: W.string().optional(),
1563
- providerOptions: G.optional()
1560
+ U.object({
1561
+ type: U.literal("execution-denied"),
1562
+ reason: U.string().optional(),
1563
+ providerOptions: W.optional()
1564
1564
  }),
1565
- W.object({
1566
- type: W.literal("error-text"),
1567
- value: W.string(),
1568
- providerOptions: G.optional()
1565
+ U.object({
1566
+ type: U.literal("error-text"),
1567
+ value: U.string(),
1568
+ providerOptions: W.optional()
1569
1569
  }),
1570
- W.object({
1571
- type: W.literal("error-json"),
1572
- value: Ii,
1573
- providerOptions: G.optional()
1570
+ U.object({
1571
+ type: U.literal("error-json"),
1572
+ value: Li,
1573
+ providerOptions: W.optional()
1574
1574
  }),
1575
- W.object({
1576
- type: W.literal("content"),
1577
- value: W.array(W.union([
1578
- W.object({
1579
- type: W.literal("text"),
1580
- text: W.string(),
1581
- providerOptions: G.optional()
1575
+ U.object({
1576
+ type: U.literal("content"),
1577
+ value: U.array(U.union([
1578
+ U.object({
1579
+ type: U.literal("text"),
1580
+ text: U.string(),
1581
+ providerOptions: W.optional()
1582
1582
  }),
1583
- W.object({
1584
- type: W.literal("file"),
1585
- data: Vi,
1586
- mediaType: W.string(),
1587
- filename: W.string().optional(),
1588
- providerOptions: G.optional()
1583
+ U.object({
1584
+ type: U.literal("file"),
1585
+ data: Hi,
1586
+ mediaType: U.string(),
1587
+ filename: U.string().optional(),
1588
+ providerOptions: W.optional()
1589
1589
  }),
1590
- W.object({
1591
- type: W.literal("file-data"),
1592
- data: W.string(),
1593
- mediaType: W.string(),
1594
- filename: W.string().optional(),
1595
- providerOptions: G.optional()
1590
+ U.object({
1591
+ type: U.literal("file-data"),
1592
+ data: U.string(),
1593
+ mediaType: U.string(),
1594
+ filename: U.string().optional(),
1595
+ providerOptions: W.optional()
1596
1596
  }),
1597
- W.object({
1598
- type: W.literal("file-url"),
1599
- url: W.string(),
1600
- mediaType: W.string().optional(),
1601
- providerOptions: G.optional()
1597
+ U.object({
1598
+ type: U.literal("file-url"),
1599
+ url: U.string(),
1600
+ mediaType: U.string().optional(),
1601
+ providerOptions: W.optional()
1602
1602
  }),
1603
- W.object({
1604
- type: W.literal("file-id"),
1605
- fileId: W.union([W.string(), W.record(W.string(), W.string())]),
1606
- providerOptions: G.optional()
1603
+ U.object({
1604
+ type: U.literal("file-id"),
1605
+ fileId: U.union([U.string(), U.record(U.string(), U.string())]),
1606
+ providerOptions: W.optional()
1607
1607
  }),
1608
- W.object({
1609
- type: W.literal("file-reference"),
1610
- providerReference: W.record(W.string(), W.string()),
1611
- providerOptions: G.optional()
1608
+ U.object({
1609
+ type: U.literal("file-reference"),
1610
+ providerReference: U.record(U.string(), U.string()),
1611
+ providerOptions: W.optional()
1612
1612
  }),
1613
- W.object({
1614
- type: W.literal("image-data"),
1615
- data: W.string(),
1616
- mediaType: W.string(),
1617
- providerOptions: G.optional()
1613
+ U.object({
1614
+ type: U.literal("image-data"),
1615
+ data: U.string(),
1616
+ mediaType: U.string(),
1617
+ providerOptions: W.optional()
1618
1618
  }),
1619
- W.object({
1620
- type: W.literal("image-url"),
1621
- url: W.string(),
1622
- providerOptions: G.optional()
1619
+ U.object({
1620
+ type: U.literal("image-url"),
1621
+ url: U.string(),
1622
+ providerOptions: W.optional()
1623
1623
  }),
1624
- W.object({
1625
- type: W.literal("image-file-id"),
1626
- fileId: W.union([W.string(), W.record(W.string(), W.string())]),
1627
- providerOptions: G.optional()
1624
+ U.object({
1625
+ type: U.literal("image-file-id"),
1626
+ fileId: U.union([U.string(), U.record(U.string(), U.string())]),
1627
+ providerOptions: W.optional()
1628
1628
  }),
1629
- W.object({
1630
- type: W.literal("image-file-reference"),
1631
- providerReference: W.record(W.string(), W.string()),
1632
- providerOptions: G.optional()
1629
+ U.object({
1630
+ type: U.literal("image-file-reference"),
1631
+ providerReference: U.record(U.string(), U.string()),
1632
+ providerOptions: W.optional()
1633
1633
  }),
1634
- W.object({
1635
- type: W.literal("custom"),
1636
- providerOptions: G.optional()
1634
+ U.object({
1635
+ type: U.literal("custom"),
1636
+ providerOptions: W.optional()
1637
1637
  })
1638
1638
  ]))
1639
1639
  })
1640
- ]), Yi = W.object({
1641
- type: W.literal("tool-result"),
1642
- toolCallId: W.string(),
1643
- toolName: W.string(),
1644
- output: Ji,
1645
- providerOptions: G.optional()
1646
- }), Xi = W.object({
1647
- type: W.literal("tool-approval-request"),
1648
- approvalId: W.string(),
1649
- toolCallId: W.string(),
1650
- reason: W.string().optional()
1651
- }), Zi = W.object({
1652
- type: W.literal("tool-approval-response"),
1653
- approvalId: W.string(),
1654
- approved: W.boolean(),
1655
- reason: W.string().optional()
1656
- }), Qi = W.object({
1657
- role: W.literal("system"),
1658
- content: W.string(),
1659
- providerOptions: G.optional()
1660
- }), $i = W.object({
1661
- role: W.literal("user"),
1662
- content: W.union([W.string(), W.array(W.union([
1663
- zi,
1640
+ ]), Xi = U.object({
1641
+ type: U.literal("tool-result"),
1642
+ toolCallId: U.string(),
1643
+ toolName: U.string(),
1644
+ output: Yi,
1645
+ providerOptions: W.optional()
1646
+ }), Zi = U.object({
1647
+ type: U.literal("tool-approval-request"),
1648
+ approvalId: U.string(),
1649
+ toolCallId: U.string(),
1650
+ reason: U.string().optional()
1651
+ }), Qi = U.object({
1652
+ type: U.literal("tool-approval-response"),
1653
+ approvalId: U.string(),
1654
+ approved: U.boolean(),
1655
+ reason: U.string().optional()
1656
+ }), $i = U.object({
1657
+ role: U.literal("system"),
1658
+ content: U.string(),
1659
+ providerOptions: W.optional()
1660
+ }), ea = U.object({
1661
+ role: U.literal("user"),
1662
+ content: U.union([U.string(), U.array(U.union([
1664
1663
  Bi,
1665
- Ui
1664
+ Vi,
1665
+ Wi
1666
1666
  ]))]),
1667
- providerOptions: G.optional()
1668
- }), ea = W.object({
1669
- role: W.literal("assistant"),
1670
- content: W.union([W.string(), W.array(W.union([
1671
- zi,
1672
- Gi,
1673
- Ui,
1674
- Wi,
1667
+ providerOptions: W.optional()
1668
+ }), ta = U.object({
1669
+ role: U.literal("assistant"),
1670
+ content: U.union([U.string(), U.array(U.union([
1671
+ Bi,
1675
1672
  Ki,
1673
+ Wi,
1674
+ Gi,
1676
1675
  qi,
1677
- Yi,
1678
- Xi
1676
+ Ji,
1677
+ Xi,
1678
+ Zi
1679
1679
  ]))]),
1680
- providerOptions: G.optional()
1681
- }), ta = W.object({
1682
- role: W.literal("tool"),
1683
- content: W.array(W.union([Yi, Zi])),
1684
- providerOptions: G.optional()
1680
+ providerOptions: W.optional()
1681
+ }), na = U.object({
1682
+ role: U.literal("tool"),
1683
+ content: U.array(U.union([Xi, Qi])),
1684
+ providerOptions: W.optional()
1685
1685
  });
1686
- W.union([
1687
- Qi,
1686
+ U.union([
1688
1687
  $i,
1689
1688
  ea,
1690
- ta
1691
- ]), fi({}, {
1692
- array: () => oa,
1693
- choice: () => la,
1694
- json: () => ua,
1695
- object: () => aa,
1696
- text: () => ia
1689
+ ta,
1690
+ na
1691
+ ]), pi({}, {
1692
+ array: () => sa,
1693
+ choice: () => ua,
1694
+ json: () => da,
1695
+ object: () => oa,
1696
+ text: () => aa
1697
1697
  });
1698
- function na(e) {
1698
+ function ra(e) {
1699
1699
  let t = ["ROOT"], n = -1, r = null, i = 0;
1700
1700
  function a(e) {
1701
1701
  return e >= "0" && e <= "9" || e >= "A" && e <= "F" || e >= "a" && e <= "f";
@@ -1877,16 +1877,16 @@ function na(e) {
1877
1877
  }
1878
1878
  return l;
1879
1879
  }
1880
- async function ra(e) {
1880
+ async function ia(e) {
1881
1881
  if (e === void 0) return {
1882
1882
  value: void 0,
1883
1883
  state: "undefined-input"
1884
1884
  };
1885
- let t = await li({ text: e });
1885
+ let t = await ui({ text: e });
1886
1886
  return t.success ? {
1887
1887
  value: t.value,
1888
1888
  state: "successful-parse"
1889
- } : (t = await li({ text: na(e) }), t.success ? {
1889
+ } : (t = await ui({ text: ra(e) }), t.success ? {
1890
1890
  value: t.value,
1891
1891
  state: "repaired-parse"
1892
1892
  } : {
@@ -1894,7 +1894,7 @@ async function ra(e) {
1894
1894
  state: "failed-parse"
1895
1895
  });
1896
1896
  }
1897
- var ia = () => ({
1897
+ var aa = () => ({
1898
1898
  name: "text",
1899
1899
  responseFormat: Promise.resolve({ type: "text" }),
1900
1900
  async parseCompleteOutput({ text: e }) {
@@ -1904,19 +1904,19 @@ var ia = () => ({
1904
1904
  return { partial: e };
1905
1905
  },
1906
1906
  createElementStreamTransform() {}
1907
- }), aa = ({ schema: e, name: t, description: n }) => {
1908
- let r = ei(e);
1907
+ }), oa = ({ schema: e, name: t, description: n }) => {
1908
+ let r = ti(e);
1909
1909
  return {
1910
1910
  name: "object",
1911
- responseFormat: H(r.jsonSchema).then((e) => ({
1911
+ responseFormat: V(r.jsonSchema).then((e) => ({
1912
1912
  type: "json",
1913
1913
  schema: e,
1914
1914
  ...t != null && { name: t },
1915
1915
  ...n != null && { description: n }
1916
1916
  })),
1917
1917
  async parseCompleteOutput({ text: e }, t) {
1918
- let n = await li({ text: e });
1919
- if (!n.success) throw new U({
1918
+ let n = await ui({ text: e });
1919
+ if (!n.success) throw new H({
1920
1920
  message: "No object generated: could not parse the response.",
1921
1921
  cause: n.error,
1922
1922
  text: e,
@@ -1924,11 +1924,11 @@ var ia = () => ({
1924
1924
  usage: t.usage,
1925
1925
  finishReason: t.finishReason
1926
1926
  });
1927
- let i = await ci({
1927
+ let i = await li({
1928
1928
  value: n.value,
1929
1929
  schema: r
1930
1930
  });
1931
- if (!i.success) throw new U({
1931
+ if (!i.success) throw new H({
1932
1932
  message: "No object generated: response did not match schema.",
1933
1933
  cause: i.error,
1934
1934
  text: e,
@@ -1939,7 +1939,7 @@ var ia = () => ({
1939
1939
  return i.value;
1940
1940
  },
1941
1941
  async parsePartialOutput({ text: e }) {
1942
- let t = await ra(e);
1942
+ let t = await ia(e);
1943
1943
  switch (t.state) {
1944
1944
  case "failed-parse":
1945
1945
  case "undefined-input": return;
@@ -1949,22 +1949,22 @@ var ia = () => ({
1949
1949
  },
1950
1950
  createElementStreamTransform() {}
1951
1951
  };
1952
- }, oa = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1953
- if (sa({
1952
+ }, sa = ({ element: e, minItems: t, maxItems: n, name: r, description: i }) => {
1953
+ if (ca({
1954
1954
  name: "minItems",
1955
1955
  value: t
1956
- }), sa({
1956
+ }), ca({
1957
1957
  name: "maxItems",
1958
1958
  value: n
1959
- }), t != null && n != null && t > n) throw new vi({
1959
+ }), t != null && n != null && t > n) throw new yi({
1960
1960
  parameter: "minItems",
1961
1961
  value: t,
1962
1962
  message: "minItems must be less than or equal to maxItems"
1963
1963
  });
1964
- let a = ei(e);
1964
+ let a = ti(e);
1965
1965
  return {
1966
1966
  name: "array",
1967
- responseFormat: H(a.jsonSchema).then((e) => {
1967
+ responseFormat: V(a.jsonSchema).then((e) => {
1968
1968
  let { $schema: a, definitions: o, $defs: s, ...c } = e;
1969
1969
  return {
1970
1970
  type: "json",
@@ -1987,8 +1987,8 @@ var ia = () => ({
1987
1987
  };
1988
1988
  }),
1989
1989
  async parseCompleteOutput({ text: e }, r) {
1990
- let i = await li({ text: e });
1991
- if (!i.success) throw new U({
1990
+ let i = await ui({ text: e });
1991
+ if (!i.success) throw new H({
1992
1992
  message: "No object generated: could not parse the response.",
1993
1993
  cause: i.error,
1994
1994
  text: e,
@@ -1997,9 +1997,9 @@ var ia = () => ({
1997
1997
  finishReason: r.finishReason
1998
1998
  });
1999
1999
  let o = i.value;
2000
- if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new U({
2000
+ if (typeof o != "object" || !o || !("elements" in o) || !Array.isArray(o.elements)) throw new H({
2001
2001
  message: "No object generated: response did not match schema.",
2002
- cause: new On({
2002
+ cause: new P({
2003
2003
  value: o,
2004
2004
  cause: "response must be an object with an elements array"
2005
2005
  }),
@@ -2008,12 +2008,12 @@ var ia = () => ({
2008
2008
  usage: r.usage,
2009
2009
  finishReason: r.finishReason
2010
2010
  });
2011
- let s = ca({
2011
+ let s = la({
2012
2012
  value: o.elements,
2013
2013
  minItems: t,
2014
2014
  maxItems: n
2015
2015
  });
2016
- if (s != null) throw new U({
2016
+ if (s != null) throw new H({
2017
2017
  message: "No object generated: response did not match schema.",
2018
2018
  cause: s,
2019
2019
  text: e,
@@ -2023,11 +2023,11 @@ var ia = () => ({
2023
2023
  });
2024
2024
  let c = [];
2025
2025
  for (let t of o.elements) {
2026
- let n = await ci({
2026
+ let n = await li({
2027
2027
  value: t,
2028
2028
  schema: a
2029
2029
  });
2030
- if (!n.success) throw new U({
2030
+ if (!n.success) throw new H({
2031
2031
  message: "No object generated: response did not match schema.",
2032
2032
  cause: n.error,
2033
2033
  text: e,
@@ -2040,7 +2040,7 @@ var ia = () => ({
2040
2040
  return c;
2041
2041
  },
2042
2042
  async parsePartialOutput({ text: e }) {
2043
- let t = await ra(e);
2043
+ let t = await ia(e);
2044
2044
  switch (t.state) {
2045
2045
  case "failed-parse":
2046
2046
  case "undefined-input": return;
@@ -2050,7 +2050,7 @@ var ia = () => ({
2050
2050
  if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
2051
2051
  let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, r = [];
2052
2052
  for (let e of n) {
2053
- let t = await ci({
2053
+ let t = await li({
2054
2054
  value: e,
2055
2055
  schema: a
2056
2056
  });
@@ -2065,7 +2065,7 @@ var ia = () => ({
2065
2065
  return new TransformStream({ transform({ partialOutput: t }, r) {
2066
2066
  if (t != null) for (; e < t.length; e++) {
2067
2067
  if (n != null && e >= n) {
2068
- r.error(ca({
2068
+ r.error(la({
2069
2069
  value: t,
2070
2070
  maxItems: n
2071
2071
  }));
@@ -2077,31 +2077,31 @@ var ia = () => ({
2077
2077
  }
2078
2078
  };
2079
2079
  };
2080
- function sa({ name: e, value: t }) {
2080
+ function ca({ name: e, value: t }) {
2081
2081
  if (t != null) {
2082
- if (!Number.isInteger(t)) throw new vi({
2082
+ if (!Number.isInteger(t)) throw new yi({
2083
2083
  parameter: e,
2084
2084
  value: t,
2085
2085
  message: `${e} must be an integer`
2086
2086
  });
2087
- if (t < 0) throw new vi({
2087
+ if (t < 0) throw new yi({
2088
2088
  parameter: e,
2089
2089
  value: t,
2090
2090
  message: `${e} must be greater than or equal to 0`
2091
2091
  });
2092
2092
  }
2093
2093
  }
2094
- function ca({ value: e, minItems: t, maxItems: n }) {
2095
- if (t != null && e.length < t) return new On({
2094
+ function la({ value: e, minItems: t, maxItems: n }) {
2095
+ if (t != null && e.length < t) return new P({
2096
2096
  value: e,
2097
2097
  cause: `elements array must contain at least ${t} items`
2098
2098
  });
2099
- if (n != null && e.length > n) return new On({
2099
+ if (n != null && e.length > n) return new P({
2100
2100
  value: e,
2101
2101
  cause: `elements array must contain at most ${n} items`
2102
2102
  });
2103
2103
  }
2104
- var la = ({ options: e, name: t, description: n }) => ({
2104
+ var ua = ({ options: e, name: t, description: n }) => ({
2105
2105
  name: "choice",
2106
2106
  responseFormat: Promise.resolve({
2107
2107
  type: "json",
@@ -2119,8 +2119,8 @@ var la = ({ options: e, name: t, description: n }) => ({
2119
2119
  ...n != null && { description: n }
2120
2120
  }),
2121
2121
  async parseCompleteOutput({ text: t }, n) {
2122
- let r = await li({ text: t });
2123
- if (!r.success) throw new U({
2122
+ let r = await ui({ text: t });
2123
+ if (!r.success) throw new H({
2124
2124
  message: "No object generated: could not parse the response.",
2125
2125
  cause: r.error,
2126
2126
  text: t,
@@ -2129,9 +2129,9 @@ var la = ({ options: e, name: t, description: n }) => ({
2129
2129
  finishReason: n.finishReason
2130
2130
  });
2131
2131
  let i = r.value;
2132
- if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new U({
2132
+ if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new H({
2133
2133
  message: "No object generated: response did not match schema.",
2134
- cause: new On({
2134
+ cause: new P({
2135
2135
  value: i,
2136
2136
  cause: "response must be an object that contains a choice value."
2137
2137
  }),
@@ -2143,7 +2143,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2143
2143
  return i.result;
2144
2144
  },
2145
2145
  async parsePartialOutput({ text: t }) {
2146
- let n = await ra(t);
2146
+ let n = await ia(t);
2147
2147
  switch (n.state) {
2148
2148
  case "failed-parse":
2149
2149
  case "undefined-input": return;
@@ -2157,7 +2157,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2157
2157
  }
2158
2158
  },
2159
2159
  createElementStreamTransform() {}
2160
- }), ua = ({ name: e, description: t } = {}) => ({
2160
+ }), da = ({ name: e, description: t } = {}) => ({
2161
2161
  name: "json",
2162
2162
  responseFormat: Promise.resolve({
2163
2163
  type: "json",
@@ -2165,8 +2165,8 @@ var la = ({ options: e, name: t, description: n }) => ({
2165
2165
  ...t != null && { description: t }
2166
2166
  }),
2167
2167
  async parseCompleteOutput({ text: e }, t) {
2168
- let n = await li({ text: e });
2169
- if (!n.success) throw new U({
2168
+ let n = await ui({ text: e });
2169
+ if (!n.success) throw new H({
2170
2170
  message: "No object generated: could not parse the response.",
2171
2171
  cause: n.error,
2172
2172
  text: e,
@@ -2177,7 +2177,7 @@ var la = ({ options: e, name: t, description: n }) => ({
2177
2177
  return n.value;
2178
2178
  },
2179
2179
  async parsePartialOutput({ text: e }) {
2180
- let t = await ra(e);
2180
+ let t = await ia(e);
2181
2181
  switch (t.state) {
2182
2182
  case "failed-parse":
2183
2183
  case "undefined-input": return;
@@ -2194,12 +2194,12 @@ new TextEncoder(), new TextEncoder(), F({
2194
2194
  prefix: "call",
2195
2195
  size: 24
2196
2196
  });
2197
- function da(e, t) {
2197
+ function fa(e, t) {
2198
2198
  let n = new Headers(e ?? {});
2199
2199
  for (let [e, r] of Object.entries(t)) n.has(e) || n.set(e, r);
2200
2200
  return n;
2201
2201
  }
2202
- var fa = class extends TransformStream {
2202
+ var pa = class extends TransformStream {
2203
2203
  constructor() {
2204
2204
  super({
2205
2205
  transform(e, t) {
@@ -2212,15 +2212,15 @@ var fa = class extends TransformStream {
2212
2212
  }
2213
2213
  });
2214
2214
  }
2215
- }, pa = {
2215
+ }, ma = {
2216
2216
  "content-type": "text/event-stream",
2217
2217
  "cache-control": "no-cache",
2218
2218
  connection: "keep-alive",
2219
2219
  "x-vercel-ai-ui-message-stream": "v1",
2220
2220
  "x-accel-buffering": "no"
2221
2221
  };
2222
- function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream: i }) {
2223
- let a = r.pipeThrough(new fa());
2222
+ function ha({ status: e, statusText: t, headers: n, stream: r, consumeSseStream: i }) {
2223
+ let a = r.pipeThrough(new pa());
2224
2224
  if (i) {
2225
2225
  let [e, t] = a.tee();
2226
2226
  a = e, i({ stream: t });
@@ -2228,173 +2228,173 @@ function ma({ status: e, statusText: t, headers: n, stream: r, consumeSseStream:
2228
2228
  return new Response(a.pipeThrough(new TextEncoderStream()), {
2229
2229
  status: e,
2230
2230
  statusText: t,
2231
- headers: da(n, pa)
2231
+ headers: fa(n, ma)
2232
2232
  });
2233
2233
  }
2234
- var ha = W.record(W.string(), Ii.optional()), ga = Zr(() => oi(W.union([
2235
- W.looseObject({
2236
- type: W.literal("text-start"),
2237
- id: W.string(),
2238
- providerMetadata: G.optional()
2234
+ var ga = U.record(U.string(), Li.optional()), _a = Qr(() => si(U.union([
2235
+ U.looseObject({
2236
+ type: U.literal("text-start"),
2237
+ id: U.string(),
2238
+ providerMetadata: W.optional()
2239
2239
  }),
2240
- W.looseObject({
2241
- type: W.literal("text-delta"),
2242
- id: W.string(),
2243
- delta: W.string(),
2244
- providerMetadata: G.optional()
2240
+ U.looseObject({
2241
+ type: U.literal("text-delta"),
2242
+ id: U.string(),
2243
+ delta: U.string(),
2244
+ providerMetadata: W.optional()
2245
2245
  }),
2246
- W.looseObject({
2247
- type: W.literal("text-end"),
2248
- id: W.string(),
2249
- providerMetadata: G.optional()
2246
+ U.looseObject({
2247
+ type: U.literal("text-end"),
2248
+ id: U.string(),
2249
+ providerMetadata: W.optional()
2250
2250
  }),
2251
- W.looseObject({
2252
- type: W.literal("error"),
2253
- errorText: W.string()
2251
+ U.looseObject({
2252
+ type: U.literal("error"),
2253
+ errorText: U.string()
2254
2254
  }),
2255
- W.looseObject({
2256
- type: W.literal("tool-input-start"),
2257
- toolCallId: W.string(),
2258
- toolName: W.string(),
2259
- providerExecuted: W.boolean().optional(),
2260
- providerMetadata: G.optional(),
2261
- toolMetadata: ha.optional(),
2262
- dynamic: W.boolean().optional(),
2263
- title: W.string().optional()
2255
+ U.looseObject({
2256
+ type: U.literal("tool-input-start"),
2257
+ toolCallId: U.string(),
2258
+ toolName: U.string(),
2259
+ providerExecuted: U.boolean().optional(),
2260
+ providerMetadata: W.optional(),
2261
+ toolMetadata: ga.optional(),
2262
+ dynamic: U.boolean().optional(),
2263
+ title: U.string().optional()
2264
2264
  }),
2265
- W.looseObject({
2266
- type: W.literal("tool-input-delta"),
2267
- toolCallId: W.string(),
2268
- inputTextDelta: W.string()
2265
+ U.looseObject({
2266
+ type: U.literal("tool-input-delta"),
2267
+ toolCallId: U.string(),
2268
+ inputTextDelta: U.string()
2269
2269
  }),
2270
- W.looseObject({
2271
- type: W.literal("tool-input-available"),
2272
- toolCallId: W.string(),
2273
- toolName: W.string(),
2274
- input: W.unknown(),
2275
- providerExecuted: W.boolean().optional(),
2276
- providerMetadata: G.optional(),
2277
- toolMetadata: ha.optional(),
2278
- dynamic: W.boolean().optional(),
2279
- title: W.string().optional()
2270
+ U.looseObject({
2271
+ type: U.literal("tool-input-available"),
2272
+ toolCallId: U.string(),
2273
+ toolName: U.string(),
2274
+ input: U.unknown(),
2275
+ providerExecuted: U.boolean().optional(),
2276
+ providerMetadata: W.optional(),
2277
+ toolMetadata: ga.optional(),
2278
+ dynamic: U.boolean().optional(),
2279
+ title: U.string().optional()
2280
2280
  }),
2281
- W.looseObject({
2282
- type: W.literal("tool-input-error"),
2283
- toolCallId: W.string(),
2284
- toolName: W.string(),
2285
- input: W.unknown(),
2286
- providerExecuted: W.boolean().optional(),
2287
- providerMetadata: G.optional(),
2288
- toolMetadata: ha.optional(),
2289
- dynamic: W.boolean().optional(),
2290
- errorText: W.string(),
2291
- title: W.string().optional()
2281
+ U.looseObject({
2282
+ type: U.literal("tool-input-error"),
2283
+ toolCallId: U.string(),
2284
+ toolName: U.string(),
2285
+ input: U.unknown(),
2286
+ providerExecuted: U.boolean().optional(),
2287
+ providerMetadata: W.optional(),
2288
+ toolMetadata: ga.optional(),
2289
+ dynamic: U.boolean().optional(),
2290
+ errorText: U.string(),
2291
+ title: U.string().optional()
2292
2292
  }),
2293
- W.looseObject({
2294
- type: W.literal("tool-approval-request"),
2295
- approvalId: W.string(),
2296
- toolCallId: W.string(),
2297
- approvalDescriptor: W.unknown().optional(),
2298
- reason: W.string().optional(),
2299
- isAutomatic: W.boolean().optional(),
2300
- signature: W.string().optional()
2293
+ U.looseObject({
2294
+ type: U.literal("tool-approval-request"),
2295
+ approvalId: U.string(),
2296
+ toolCallId: U.string(),
2297
+ approvalDescriptor: U.unknown().optional(),
2298
+ reason: U.string().optional(),
2299
+ isAutomatic: U.boolean().optional(),
2300
+ signature: U.string().optional()
2301
2301
  }),
2302
- W.looseObject({
2303
- type: W.literal("tool-approval-response"),
2304
- approvalId: W.string(),
2305
- approved: W.boolean(),
2306
- reason: W.string().optional(),
2307
- providerExecuted: W.boolean().optional(),
2308
- providerMetadata: G.optional()
2302
+ U.looseObject({
2303
+ type: U.literal("tool-approval-response"),
2304
+ approvalId: U.string(),
2305
+ approved: U.boolean(),
2306
+ reason: U.string().optional(),
2307
+ providerExecuted: U.boolean().optional(),
2308
+ providerMetadata: W.optional()
2309
2309
  }),
2310
- W.looseObject({
2311
- type: W.literal("tool-output-available"),
2312
- toolCallId: W.string(),
2313
- output: W.unknown(),
2314
- providerExecuted: W.boolean().optional(),
2315
- providerMetadata: G.optional(),
2316
- toolMetadata: ha.optional(),
2317
- dynamic: W.boolean().optional(),
2318
- preliminary: W.boolean().optional()
2310
+ U.looseObject({
2311
+ type: U.literal("tool-output-available"),
2312
+ toolCallId: U.string(),
2313
+ output: U.unknown(),
2314
+ providerExecuted: U.boolean().optional(),
2315
+ providerMetadata: W.optional(),
2316
+ toolMetadata: ga.optional(),
2317
+ dynamic: U.boolean().optional(),
2318
+ preliminary: U.boolean().optional()
2319
2319
  }),
2320
- W.looseObject({
2321
- type: W.literal("tool-output-error"),
2322
- toolCallId: W.string(),
2323
- errorText: W.string(),
2324
- providerExecuted: W.boolean().optional(),
2325
- providerMetadata: G.optional(),
2326
- toolMetadata: ha.optional(),
2327
- dynamic: W.boolean().optional()
2320
+ U.looseObject({
2321
+ type: U.literal("tool-output-error"),
2322
+ toolCallId: U.string(),
2323
+ errorText: U.string(),
2324
+ providerExecuted: U.boolean().optional(),
2325
+ providerMetadata: W.optional(),
2326
+ toolMetadata: ga.optional(),
2327
+ dynamic: U.boolean().optional()
2328
2328
  }),
2329
- W.looseObject({
2330
- type: W.literal("tool-output-denied"),
2331
- toolCallId: W.string()
2329
+ U.looseObject({
2330
+ type: U.literal("tool-output-denied"),
2331
+ toolCallId: U.string()
2332
2332
  }),
2333
- W.looseObject({
2334
- type: W.literal("reasoning-start"),
2335
- id: W.string(),
2336
- providerMetadata: G.optional()
2333
+ U.looseObject({
2334
+ type: U.literal("reasoning-start"),
2335
+ id: U.string(),
2336
+ providerMetadata: W.optional()
2337
2337
  }),
2338
- W.looseObject({
2339
- type: W.literal("reasoning-delta"),
2340
- id: W.string(),
2341
- delta: W.string(),
2342
- providerMetadata: G.optional()
2338
+ U.looseObject({
2339
+ type: U.literal("reasoning-delta"),
2340
+ id: U.string(),
2341
+ delta: U.string(),
2342
+ providerMetadata: W.optional()
2343
2343
  }),
2344
- W.looseObject({
2345
- type: W.literal("reasoning-end"),
2346
- id: W.string(),
2347
- providerMetadata: G.optional()
2344
+ U.looseObject({
2345
+ type: U.literal("reasoning-end"),
2346
+ id: U.string(),
2347
+ providerMetadata: W.optional()
2348
2348
  }),
2349
- W.looseObject({
2350
- type: W.literal("custom"),
2351
- kind: W.string().transform((e) => e),
2352
- providerMetadata: G.optional()
2349
+ U.looseObject({
2350
+ type: U.literal("custom"),
2351
+ kind: U.string().transform((e) => e),
2352
+ providerMetadata: W.optional()
2353
2353
  }),
2354
- W.looseObject({
2355
- type: W.literal("source-url"),
2356
- sourceId: W.string(),
2357
- url: W.string(),
2358
- title: W.string().optional(),
2359
- providerMetadata: G.optional()
2354
+ U.looseObject({
2355
+ type: U.literal("source-url"),
2356
+ sourceId: U.string(),
2357
+ url: U.string(),
2358
+ title: U.string().optional(),
2359
+ providerMetadata: W.optional()
2360
2360
  }),
2361
- W.looseObject({
2362
- type: W.literal("source-document"),
2363
- sourceId: W.string(),
2364
- mediaType: W.string(),
2365
- title: W.string(),
2366
- filename: W.string().optional(),
2367
- providerMetadata: G.optional()
2361
+ U.looseObject({
2362
+ type: U.literal("source-document"),
2363
+ sourceId: U.string(),
2364
+ mediaType: U.string(),
2365
+ title: U.string(),
2366
+ filename: U.string().optional(),
2367
+ providerMetadata: W.optional()
2368
2368
  }),
2369
- W.looseObject({
2370
- type: W.literal("file"),
2371
- url: W.string(),
2372
- mediaType: W.string(),
2373
- providerMetadata: G.optional()
2369
+ U.looseObject({
2370
+ type: U.literal("file"),
2371
+ url: U.string(),
2372
+ mediaType: U.string(),
2373
+ providerMetadata: W.optional()
2374
2374
  }),
2375
- W.looseObject({
2376
- type: W.literal("reasoning-file"),
2377
- url: W.string(),
2378
- mediaType: W.string(),
2379
- providerMetadata: G.optional()
2375
+ U.looseObject({
2376
+ type: U.literal("reasoning-file"),
2377
+ url: U.string(),
2378
+ mediaType: U.string(),
2379
+ providerMetadata: W.optional()
2380
2380
  }),
2381
- W.looseObject({
2382
- type: W.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2383
- id: W.string().optional(),
2384
- data: W.unknown(),
2385
- transient: W.boolean().optional()
2381
+ U.looseObject({
2382
+ type: U.custom((e) => typeof e == "string" && e.startsWith("data-"), { message: "Type must start with \"data-\"" }),
2383
+ id: U.string().optional(),
2384
+ data: U.unknown(),
2385
+ transient: U.boolean().optional()
2386
2386
  }),
2387
- W.looseObject({ type: W.literal("start-step") }),
2388
- W.looseObject({ type: W.literal("finish-step") }),
2389
- W.looseObject({ type: W.literal("reset-step") }),
2390
- W.looseObject({
2391
- type: W.literal("start"),
2392
- messageId: W.string().optional(),
2393
- messageMetadata: W.unknown().optional()
2387
+ U.looseObject({ type: U.literal("start-step") }),
2388
+ U.looseObject({ type: U.literal("finish-step") }),
2389
+ U.looseObject({ type: U.literal("reset-step") }),
2390
+ U.looseObject({
2391
+ type: U.literal("start"),
2392
+ messageId: U.string().optional(),
2393
+ messageMetadata: U.unknown().optional()
2394
2394
  }),
2395
- W.looseObject({
2396
- type: W.literal("finish"),
2397
- finishReason: W.enum([
2395
+ U.looseObject({
2396
+ type: U.literal("finish"),
2397
+ finishReason: U.enum([
2398
2398
  "stop",
2399
2399
  "length",
2400
2400
  "content-filter",
@@ -2402,44 +2402,44 @@ var ha = W.record(W.string(), Ii.optional()), ga = Zr(() => oi(W.union([
2402
2402
  "error",
2403
2403
  "other"
2404
2404
  ]).optional(),
2405
- messageMetadata: W.unknown().optional()
2405
+ messageMetadata: U.unknown().optional()
2406
2406
  }),
2407
- W.looseObject({
2408
- type: W.literal("abort"),
2409
- reason: W.string().optional()
2407
+ U.looseObject({
2408
+ type: U.literal("abort"),
2409
+ reason: U.string().optional()
2410
2410
  }),
2411
- W.looseObject({
2412
- type: W.literal("message-metadata"),
2413
- messageMetadata: W.unknown()
2411
+ U.looseObject({
2412
+ type: U.literal("message-metadata"),
2413
+ messageMetadata: U.unknown()
2414
2414
  })
2415
2415
  ])));
2416
- function _a(e) {
2416
+ function va(e) {
2417
2417
  return e.type.startsWith("data-");
2418
2418
  }
2419
- function va() {
2419
+ function ya() {
2420
2420
  return /* @__PURE__ */ Object.create(null);
2421
2421
  }
2422
- function ya(e) {
2422
+ function ba(e) {
2423
2423
  return e.type.startsWith("tool-");
2424
2424
  }
2425
- function ba(e) {
2425
+ function xa(e) {
2426
2426
  return e.type === "dynamic-tool";
2427
2427
  }
2428
- function K(e) {
2429
- return ya(e) || ba(e);
2428
+ function G(e) {
2429
+ return ba(e) || xa(e);
2430
2430
  }
2431
- function xa(e) {
2431
+ function Sa(e) {
2432
2432
  return e.type.split("-").slice(1).join("-");
2433
2433
  }
2434
- var Sa = {
2434
+ var Ca = {
2435
2435
  type: "deprecated",
2436
2436
  setting: "rawInput in output-error UI message parts",
2437
2437
  message: "Use the \"input\" field instead. The \"rawInput\" field will be removed in the next major version."
2438
2438
  };
2439
- function Ca(e) {
2440
- e.some((e) => e.parts.some((e) => typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && (e.type === "dynamic-tool" || e.type.startsWith("tool-")) && "state" in e && e.state === "output-error" && Object.prototype.hasOwnProperty.call(e, "rawInput") && "rawInput" in e && e.rawInput !== void 0)) && Pi({ warnings: [Sa] });
2439
+ function wa(e) {
2440
+ e.some((e) => e.parts.some((e) => typeof e == "object" && !!e && "type" in e && typeof e.type == "string" && (e.type === "dynamic-tool" || e.type.startsWith("tool-")) && "state" in e && e.state === "output-error" && Object.prototype.hasOwnProperty.call(e, "rawInput") && "rawInput" in e && e.rawInput !== void 0)) && Fi({ warnings: [Ca] });
2441
2441
  }
2442
- function wa({ lastMessage: e, messageId: t }) {
2442
+ function Ta({ lastMessage: e, messageId: t }) {
2443
2443
  return {
2444
2444
  message: e?.role === "assistant" ? e : {
2445
2445
  id: t,
@@ -2447,12 +2447,12 @@ function wa({ lastMessage: e, messageId: t }) {
2447
2447
  role: "assistant",
2448
2448
  parts: []
2449
2449
  },
2450
- activeTextParts: va(),
2451
- activeReasoningParts: va(),
2452
- partialToolCalls: va()
2450
+ activeTextParts: ya(),
2451
+ activeReasoningParts: ya(),
2452
+ partialToolCalls: ya()
2453
2453
  };
2454
2454
  }
2455
- function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2455
+ function Ea({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
2456
2456
  return e.pipeThrough(new TransformStream({ async transform(e, s) {
2457
2457
  await r(async ({ state: r, write: c }) => {
2458
2458
  function l() {
@@ -2461,7 +2461,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2461
2461
  return e.slice(t + 1);
2462
2462
  }
2463
2463
  function u() {
2464
- return l().filter(K);
2464
+ return l().filter(G);
2465
2465
  }
2466
2466
  function d(e) {
2467
2467
  let t = u().find((t) => t.toolCallId === e);
@@ -2469,13 +2469,13 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2469
2469
  let n = r.message.parts;
2470
2470
  for (let r = n.length - 1; r >= 0; r--) {
2471
2471
  let i = n[r];
2472
- if (K(i) && i.toolCallId === e) {
2472
+ if (G(i) && i.toolCallId === e) {
2473
2473
  t = i;
2474
2474
  break;
2475
2475
  }
2476
2476
  }
2477
2477
  }
2478
- if (t == null) throw new ki({
2478
+ if (t == null) throw new Ai({
2479
2479
  chunkType: "tool-invocation",
2480
2480
  chunkId: e,
2481
2481
  message: `No tool invocation found for tool call ID "${e}".`
@@ -2483,8 +2483,8 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2483
2483
  return t;
2484
2484
  }
2485
2485
  function f(e) {
2486
- let t = r.message.parts.filter(K).find((t) => t.approval?.id === e);
2487
- if (t == null) throw new ki({
2486
+ let t = r.message.parts.filter(G).find((t) => t.approval?.id === e);
2487
+ if (t == null) throw new Ai({
2488
2488
  chunkType: "tool-approval-response",
2489
2489
  chunkId: e,
2490
2490
  message: `No tool invocation found for approval ID "${e}".`
@@ -2492,7 +2492,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2492
2492
  return t;
2493
2493
  }
2494
2494
  function p(e, t) {
2495
- let n = t ?? l().find((t) => ya(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2495
+ let n = t ?? l().find((t) => ba(t) && t.toolCallId === e.toolCallId), i = e, a = n;
2496
2496
  if (n != null) {
2497
2497
  n.state = e.state, a.input = i.input, a.output = i.output, a.errorText = i.errorText, a.rawInput = i.rawInput, a.preliminary = i.preliminary, e.title !== void 0 && (a.title = e.title), e.toolMetadata !== void 0 && (a.toolMetadata = e.toolMetadata), a.providerExecuted = i.providerExecuted ?? n.providerExecuted;
2498
2498
  let t = i.providerMetadata;
@@ -2547,8 +2547,8 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2547
2547
  }
2548
2548
  async function h(e) {
2549
2549
  if (e != null) {
2550
- let n = r.message.metadata == null ? e : Fi(r.message.metadata, e);
2551
- t != null && await si({
2550
+ let n = r.message.metadata == null ? e : Ii(r.message.metadata, e);
2551
+ t != null && await ci({
2552
2552
  value: n,
2553
2553
  schema: t,
2554
2554
  context: {
@@ -2571,7 +2571,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2571
2571
  }
2572
2572
  case "text-delta": {
2573
2573
  let t = r.activeTextParts[e.id];
2574
- if (t == null) throw new ki({
2574
+ if (t == null) throw new Ai({
2575
2575
  chunkType: "text-delta",
2576
2576
  chunkId: e.id,
2577
2577
  message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
@@ -2581,7 +2581,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2581
2581
  }
2582
2582
  case "text-end": {
2583
2583
  let t = r.activeTextParts[e.id];
2584
- if (t == null) throw new ki({
2584
+ if (t == null) throw new Ai({
2585
2585
  chunkType: "text-end",
2586
2586
  chunkId: e.id,
2587
2587
  message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
@@ -2611,7 +2611,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2611
2611
  }
2612
2612
  case "reasoning-delta": {
2613
2613
  let t = r.activeReasoningParts[e.id];
2614
- if (t == null) throw new ki({
2614
+ if (t == null) throw new Ai({
2615
2615
  chunkType: "reasoning-delta",
2616
2616
  chunkId: e.id,
2617
2617
  message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
@@ -2621,7 +2621,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2621
2621
  }
2622
2622
  case "reasoning-end": {
2623
2623
  let t = r.activeReasoningParts[e.id];
2624
- if (t == null) throw new ki({
2624
+ if (t == null) throw new Ai({
2625
2625
  chunkType: "reasoning-end",
2626
2626
  chunkId: e.id,
2627
2627
  message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
@@ -2658,7 +2658,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2658
2658
  }), c();
2659
2659
  break;
2660
2660
  case "tool-input-start": {
2661
- let t = l().filter(ya);
2661
+ let t = l().filter(ba);
2662
2662
  r.partialToolCalls[e.toolCallId] = {
2663
2663
  text: "",
2664
2664
  toolName: e.toolName,
@@ -2689,13 +2689,13 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2689
2689
  }
2690
2690
  case "tool-input-delta": {
2691
2691
  let t = r.partialToolCalls[e.toolCallId];
2692
- if (t == null) throw new ki({
2692
+ if (t == null) throw new Ai({
2693
2693
  chunkType: "tool-input-delta",
2694
2694
  chunkId: e.toolCallId,
2695
2695
  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.`
2696
2696
  });
2697
2697
  t.text += e.inputTextDelta;
2698
- let { value: n } = await ra(t.text);
2698
+ let { value: n } = await ia(t.text);
2699
2699
  t.dynamic ? m({
2700
2700
  toolCallId: e.toolCallId,
2701
2701
  toolName: t.toolName,
@@ -2735,7 +2735,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2735
2735
  }), c(), a && !e.providerExecuted && await a({ toolCall: e });
2736
2736
  break;
2737
2737
  case "tool-input-error": {
2738
- let t = l().filter(K).find((t) => t.toolCallId === e.toolCallId);
2738
+ let t = l().filter(G).find((t) => t.toolCallId === e.toolCallId);
2739
2739
  (t == null ? e.dynamic : t.type === "dynamic-tool") ? m({
2740
2740
  toolCallId: e.toolCallId,
2741
2741
  toolName: e.toolName,
@@ -2755,7 +2755,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2755
2755
  providerExecuted: e.providerExecuted,
2756
2756
  providerMetadata: e.providerMetadata,
2757
2757
  toolMetadata: e.toolMetadata
2758
- }), Ca([r.message])), c();
2758
+ }), wa([r.message])), c();
2759
2759
  break;
2760
2760
  }
2761
2761
  case "tool-approval-request": {
@@ -2799,7 +2799,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2799
2799
  toolMetadata: t.toolMetadata
2800
2800
  }, t) : p({
2801
2801
  toolCallId: e.toolCallId,
2802
- toolName: xa(t),
2802
+ toolName: Sa(t),
2803
2803
  state: "output-available",
2804
2804
  input: t.input,
2805
2805
  output: e.output,
@@ -2825,7 +2825,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2825
2825
  toolMetadata: t.toolMetadata
2826
2826
  }, t) : p({
2827
2827
  toolCallId: e.toolCallId,
2828
- toolName: xa(t),
2828
+ toolName: Sa(t),
2829
2829
  state: "output-error",
2830
2830
  input: t.input,
2831
2831
  rawInput: t.rawInput,
@@ -2843,7 +2843,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2843
2843
  case "finish-step": break;
2844
2844
  case "reset-step": {
2845
2845
  let e = l();
2846
- r.activeTextParts = va(), r.activeReasoningParts = va(), r.partialToolCalls = va(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2846
+ r.activeTextParts = ya(), r.activeReasoningParts = ya(), r.partialToolCalls = ya(), e.length > 0 && (r.message.parts.splice(r.message.parts.length - e.length, e.length), c());
2847
2847
  break;
2848
2848
  }
2849
2849
  case "start":
@@ -2858,10 +2858,10 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2858
2858
  case "error":
2859
2859
  i?.(Error(e.errorText));
2860
2860
  break;
2861
- default: if (_a(e)) {
2861
+ default: if (va(e)) {
2862
2862
  if (n?.[e.type] != null) {
2863
2863
  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;
2864
- await si({
2864
+ await ci({
2865
2865
  value: e.data,
2866
2866
  schema: n[e.type],
2867
2867
  context: {
@@ -2884,7 +2884,7 @@ function Ta({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
2884
2884
  });
2885
2885
  } }));
2886
2886
  }
2887
- async function Ea({ stream: e, onError: t, abortSignal: n }) {
2887
+ async function Da({ stream: e, onError: t, abortSignal: n }) {
2888
2888
  let r = e.getReader(), i = () => {
2889
2889
  r.cancel().catch(() => {});
2890
2890
  };
@@ -2912,7 +2912,7 @@ F({
2912
2912
  }), F({
2913
2913
  prefix: "call",
2914
2914
  size: 24
2915
- }), W.record(W.string(), Ii.optional()), W.record(W.string(), W.string()), F({
2915
+ }), U.record(U.string(), Li.optional()), U.record(U.string(), U.string()), F({
2916
2916
  prefix: "call",
2917
2917
  size: 24
2918
2918
  }), F({
@@ -2922,7 +2922,7 @@ F({
2922
2922
  prefix: "aiobj",
2923
2923
  size: 24
2924
2924
  });
2925
- var { atob: Da } = globalThis, Oa = class {
2925
+ var { atob: Oa } = globalThis, ka = class {
2926
2926
  constructor() {
2927
2927
  this.queue = [], this.isProcessing = !1;
2928
2928
  }
@@ -2947,9 +2947,9 @@ var { atob: Da } = globalThis, Oa = class {
2947
2947
  F({
2948
2948
  prefix: "aiobj",
2949
2949
  size: 24
2950
- }), W.object({
2951
- token: W.string().refine((e) => e.trim().length > 0),
2952
- url: W.string().refine((e) => {
2950
+ }), U.object({
2951
+ token: U.string().refine((e) => e.trim().length > 0),
2952
+ url: U.string().refine((e) => {
2953
2953
  try {
2954
2954
  let t = new URL(e);
2955
2955
  return (t.protocol === "ws:" || t.protocol === "wss:") && t.hostname !== "";
@@ -2957,20 +2957,20 @@ F({
2957
2957
  return !1;
2958
2958
  }
2959
2959
  }),
2960
- expiresAt: W.number().positive().max(2 ** 53 - 1).optional(),
2961
- tools: W.array(W.object({
2962
- type: W.literal("function"),
2963
- name: W.string().min(1),
2964
- description: W.string().optional(),
2965
- parameters: W.record(W.string(), W.unknown())
2960
+ expiresAt: U.number().positive().max(2 ** 53 - 1).optional(),
2961
+ tools: U.array(U.object({
2962
+ type: U.literal("function"),
2963
+ name: U.string().min(1),
2964
+ description: U.string().optional(),
2965
+ parameters: U.record(U.string(), U.unknown())
2966
2966
  })).optional()
2967
2967
  }), F({
2968
2968
  prefix: "call",
2969
2969
  size: 24
2970
2970
  });
2971
- async function ka({ response: e, url: t, fallbackMessage: n }) {
2971
+ async function Aa({ response: e, url: t, fallbackMessage: n }) {
2972
2972
  let r = await e.text();
2973
- return new nn({
2973
+ return new rn({
2974
2974
  message: r || n,
2975
2975
  url: t,
2976
2976
  requestBodyValues: void 0,
@@ -2978,7 +2978,7 @@ async function ka({ response: e, url: t, fallbackMessage: n }) {
2978
2978
  responseBody: r
2979
2979
  });
2980
2980
  }
2981
- async function Aa(e) {
2981
+ async function ja(e) {
2982
2982
  if (e == null) return [];
2983
2983
  if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Pn({
2984
2984
  functionality: "FileList",
@@ -2999,16 +2999,16 @@ async function Aa(e) {
2999
2999
  };
3000
3000
  }));
3001
3001
  }
3002
- function ja(e, t) {
3002
+ function Ma(e, t) {
3003
3003
  let n = e.search(/[?#]/);
3004
3004
  return n === -1 ? `${e}${t}` : `${e.slice(0, n)}${t}${e.slice(n)}`;
3005
3005
  }
3006
- var Ma = class {
3006
+ var Na = class {
3007
3007
  constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
3008
3008
  this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
3009
3009
  }
3010
3010
  async sendMessages({ abortSignal: e, ...t }) {
3011
- let n = await H(this.body), r = await H(this.headers), i = await H(this.credentials), a = {
3011
+ let n = await V(this.body), r = await V(this.headers), i = await V(this.credentials), a = {
3012
3012
  ...Kn(r),
3013
3013
  ...Kn(t.headers)
3014
3014
  }, o = await this.prepareSendMessagesRequest?.call(this, {
@@ -3041,16 +3041,16 @@ var Ma = class {
3041
3041
  credentials: u,
3042
3042
  signal: e
3043
3043
  });
3044
- if (!d.ok) throw await ka({
3044
+ if (!d.ok) throw await Aa({
3045
3045
  response: d,
3046
3046
  url: s,
3047
3047
  fallbackMessage: "Failed to fetch the chat response."
3048
3048
  });
3049
- if (!d.body) throw new ln({ message: "The response body is empty." });
3049
+ if (!d.body) throw new un({ message: "The response body is empty." });
3050
3050
  return this.processResponseStream(d.body);
3051
3051
  }
3052
3052
  async reconnectToStream(e) {
3053
- let t = await H(this.body), n = await H(this.headers), r = await H(this.credentials), i = {
3053
+ let t = await V(this.body), n = await V(this.headers), r = await V(this.credentials), i = {
3054
3054
  ...Kn(n),
3055
3055
  ...Kn(e.headers)
3056
3056
  }, a = await this.prepareReconnectToStreamRequest?.call(this, {
@@ -3063,37 +3063,37 @@ var Ma = class {
3063
3063
  headers: i,
3064
3064
  credentials: r,
3065
3065
  requestMetadata: e.metadata
3066
- }), o = a?.api ?? ja(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Kn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3066
+ }), o = a?.api ?? Ma(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : Kn(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
3067
3067
  method: "GET",
3068
3068
  headers: s,
3069
3069
  credentials: c,
3070
3070
  signal: e.abortSignal
3071
3071
  });
3072
3072
  if (l.status === 204) return null;
3073
- if (!l.ok) throw await ka({
3073
+ if (!l.ok) throw await Aa({
3074
3074
  response: l,
3075
3075
  url: o,
3076
3076
  fallbackMessage: "Failed to fetch the chat response."
3077
3077
  });
3078
- if (!l.body) throw new ln({ message: "The response body is empty." });
3078
+ if (!l.body) throw new un({ message: "The response body is empty." });
3079
3079
  return this.processResponseStream(l.body);
3080
3080
  }
3081
- }, Na = class extends Ma {
3081
+ }, Pa = class extends Na {
3082
3082
  constructor(e = {}) {
3083
3083
  super(e);
3084
3084
  }
3085
3085
  processResponseStream(e) {
3086
- return ui({
3086
+ return di({
3087
3087
  stream: e,
3088
- schema: ga
3088
+ schema: _a
3089
3089
  }).pipeThrough(new TransformStream({ async transform(e, t) {
3090
3090
  if (!e.success) throw e.error;
3091
3091
  t.enqueue(e.value);
3092
3092
  } }));
3093
3093
  }
3094
- }, Pa = class {
3095
- constructor({ generateId: e = qn, id: t = e(), transport: n = new Na(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3096
- this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Oa(), this.sendMessage = async (e, t) => {
3094
+ }, Fa = class {
3095
+ constructor({ generateId: e = qn, id: t = e(), transport: n = new Pa(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
3096
+ this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new ka(), this.sendMessage = async (e, t) => {
3097
3097
  if (e == null) {
3098
3098
  await this.makeRequest({
3099
3099
  trigger: "submit-message",
@@ -3108,7 +3108,7 @@ var Ma = class {
3108
3108
  this.pendingMessagePreparations.add(t);
3109
3109
  let r;
3110
3110
  try {
3111
- r = Array.isArray(e.files) ? e.files : await Aa(e.files);
3111
+ r = Array.isArray(e.files) ? e.files : await ja(e.files);
3112
3112
  } finally {
3113
3113
  this.pendingMessagePreparations.delete(t);
3114
3114
  }
@@ -3120,12 +3120,12 @@ var Ma = class {
3120
3120
  } else n = e;
3121
3121
  if (e.messageId != null) {
3122
3122
  let t = this.state.messages.findIndex((t) => t.id === e.messageId);
3123
- if (t === -1) throw new vi({
3123
+ if (t === -1) throw new yi({
3124
3124
  parameter: "message.messageId",
3125
3125
  value: e.messageId,
3126
3126
  message: `message with id ${e.messageId} not found`
3127
3127
  });
3128
- if (this.state.messages[t].role !== "user") throw new vi({
3128
+ if (this.state.messages[t].role !== "user") throw new yi({
3129
3129
  parameter: "message.messageId",
3130
3130
  value: e.messageId,
3131
3131
  message: `message with id ${e.messageId} is not a user message`
@@ -3149,7 +3149,7 @@ var Ma = class {
3149
3149
  });
3150
3150
  }, this.regenerate = async ({ messageId: e, ...t } = {}) => {
3151
3151
  let n = e == null ? this.state.messages.length - 1 : this.state.messages.findIndex((t) => t.id === e);
3152
- if (n === -1) throw new vi({
3152
+ if (n === -1) throw new yi({
3153
3153
  parameter: "messageId",
3154
3154
  value: e,
3155
3155
  message: `message ${e} not found`
@@ -3167,7 +3167,7 @@ var Ma = class {
3167
3167
  }, this.clearError = () => {
3168
3168
  this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
3169
3169
  }, this.addToolApprovalResponse = async ({ id: e, approved: t, reason: n, options: r }) => this.jobExecutor.run(async () => {
3170
- let i = this.state.messages, a = i[i.length - 1], o = (r) => K(r) && r.state === "approval-requested" && r.approval.id === e ? {
3170
+ let i = this.state.messages, a = i[i.length - 1], o = (r) => G(r) && r.state === "approval-requested" && r.approval.id === e ? {
3171
3171
  ...r,
3172
3172
  state: "approval-responded",
3173
3173
  approval: {
@@ -3188,7 +3188,7 @@ var Ma = class {
3188
3188
  });
3189
3189
  });
3190
3190
  }), this.addToolOutput = async ({ state: e = "output-available", toolCallId: t, output: n, errorText: r, options: i }) => this.jobExecutor.run(async () => {
3191
- let a = this.state.messages, o = a[a.length - 1], s = (i) => K(i) && i.toolCallId === t ? {
3191
+ let a = this.state.messages, o = a[a.length - 1], s = (i) => G(i) && i.toolCallId === t ? {
3192
3192
  ...i,
3193
3193
  state: e,
3194
3194
  output: n,
@@ -3276,7 +3276,7 @@ var Ma = class {
3276
3276
  let f = this.lastMessage, p = !1, m = !1, h = !1, g;
3277
3277
  try {
3278
3278
  let a = {
3279
- state: wa({
3279
+ state: Ta({
3280
3280
  lastMessage: e === "resume-stream" || e === "regenerate-message" ? void 0 : this.state.snapshot(f),
3281
3281
  messageId: this.generateId()
3282
3282
  }),
@@ -3295,8 +3295,8 @@ var Ma = class {
3295
3295
  body: r,
3296
3296
  trigger: e,
3297
3297
  messageId: i
3298
- }), await Ea({
3299
- stream: Ta({
3298
+ }), await Da({
3299
+ stream: Ea({
3300
3300
  stream: o,
3301
3301
  onToolCall: this.onToolCall,
3302
3302
  onData: this.onData,
@@ -3348,21 +3348,21 @@ var Ma = class {
3348
3348
  });
3349
3349
  }
3350
3350
  };
3351
- function Fa({ messages: e }) {
3351
+ function Ia({ messages: e }) {
3352
3352
  let t = e[e.length - 1];
3353
3353
  if (!t || t.role !== "assistant") return !1;
3354
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(K);
3354
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(G);
3355
3355
  return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
3356
3356
  }
3357
- function Ia({ messages: e }) {
3357
+ function La({ messages: e }) {
3358
3358
  let t = e[e.length - 1];
3359
3359
  if (!t || t.role !== "assistant") return !1;
3360
- let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(K).filter((e) => !e.providerExecuted);
3360
+ let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(G).filter((e) => !e.providerExecuted);
3361
3361
  return r.length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error");
3362
3362
  }
3363
3363
  //#endregion
3364
3364
  //#region ../node_modules/.pnpm/throttleit@2.1.0/node_modules/throttleit/index.js
3365
- var La = /* @__PURE__ */ t(((e, t) => {
3365
+ var Ra = /* @__PURE__ */ t(((e, t) => {
3366
3366
  function n(e, t) {
3367
3367
  if (typeof e != "function") throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);
3368
3368
  let n, r = 0;
@@ -3375,30 +3375,30 @@ var La = /* @__PURE__ */ t(((e, t) => {
3375
3375
  };
3376
3376
  }
3377
3377
  t.exports = n;
3378
- })), q = /* @__PURE__ */ e(o(), 1), Ra = /* @__PURE__ */ e(La(), 1), J = Ge(), za = (e, t, n) => {
3378
+ })), K = /* @__PURE__ */ e(o(), 1), za = /* @__PURE__ */ e(Ra(), 1), q = Ke(), Ba = (e, t, n) => {
3379
3379
  if (!t.has(e)) throw TypeError("Cannot " + n);
3380
- }, Y = (e, t, n) => (za(e, t, "read from private field"), n ? n.call(e) : t.get(e)), X = (e, t, n) => {
3380
+ }, J = (e, t, n) => (Ba(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Y = (e, t, n) => {
3381
3381
  if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
3382
3382
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
3383
- }, Ba = (e, t, n, r) => (za(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
3383
+ }, X = (e, t, n, r) => (Ba(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
3384
3384
  function Va(e, t) {
3385
- return t == null ? e : (0, Ra.default)(e, t);
3385
+ return t == null ? e : (0, za.default)(e, t);
3386
3386
  }
3387
3387
  function Ha(e) {
3388
3388
  return Array.isArray(e) ? [...e] : typeof e == "object" && e && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
3389
3389
  }
3390
3390
  var Z, Ua, Wa, Ga, Ka, qa, Ja, Ya, Xa, Za = class {
3391
3391
  constructor(e = []) {
3392
- X(this, Z, void 0), X(this, Ua, "ready"), X(this, Wa, void 0), X(this, Ga, /* @__PURE__ */ new Set()), X(this, Ka, /* @__PURE__ */ new Set()), X(this, qa, /* @__PURE__ */ new Set()), this.pushMessage = (e) => {
3393
- Ba(this, Z, Y(this, Z).concat(e)), Y(this, Ja).call(this);
3392
+ Y(this, Z, void 0), Y(this, Ua, "ready"), Y(this, Wa, void 0), Y(this, Ga, /* @__PURE__ */ new Set()), Y(this, Ka, /* @__PURE__ */ new Set()), Y(this, qa, /* @__PURE__ */ new Set()), this.pushMessage = (e) => {
3393
+ X(this, Z, J(this, Z).concat(e)), J(this, Ja).call(this);
3394
3394
  }, this.popMessage = () => {
3395
- Ba(this, Z, Y(this, Z).slice(0, -1)), Y(this, Ja).call(this);
3395
+ X(this, Z, J(this, Z).slice(0, -1)), J(this, Ja).call(this);
3396
3396
  }, this.replaceMessage = (e, t) => {
3397
- Ba(this, Z, [
3398
- ...Y(this, Z).slice(0, e),
3397
+ X(this, Z, [
3398
+ ...J(this, Z).slice(0, e),
3399
3399
  this.snapshot(t),
3400
- ...Y(this, Z).slice(e + 1)
3401
- ]), Y(this, Ja).call(this);
3400
+ ...J(this, Z).slice(e + 1)
3401
+ ]), J(this, Ja).call(this);
3402
3402
  }, this.snapshot = (e) => {
3403
3403
  if (typeof e != "object" || !e || !("parts" in e) || !Array.isArray(e.parts)) return e;
3404
3404
  let t = e, n = {
@@ -3408,53 +3408,53 @@ var Z, Ua, Wa, Ga, Ka, qa, Ja, Ya, Xa, Za = class {
3408
3408
  return "metadata" in t && (n.metadata = Ha(t.metadata)), n;
3409
3409
  }, this["~registerMessagesCallback"] = (e, t) => {
3410
3410
  let n = t ? Va(e, t) : e;
3411
- return Y(this, Ga).add(n), () => {
3412
- Y(this, Ga).delete(n);
3411
+ return J(this, Ga).add(n), () => {
3412
+ J(this, Ga).delete(n);
3413
3413
  };
3414
- }, this["~registerStatusCallback"] = (e) => (Y(this, Ka).add(e), () => {
3415
- Y(this, Ka).delete(e);
3416
- }), this["~registerErrorCallback"] = (e) => (Y(this, qa).add(e), () => {
3417
- Y(this, qa).delete(e);
3418
- }), X(this, Ja, () => {
3419
- Y(this, Ga).forEach((e) => e());
3420
- }), X(this, Ya, () => {
3421
- Y(this, Ka).forEach((e) => e());
3422
- }), X(this, Xa, () => {
3423
- Y(this, qa).forEach((e) => e());
3424
- }), Ba(this, Z, e);
3414
+ }, this["~registerStatusCallback"] = (e) => (J(this, Ka).add(e), () => {
3415
+ J(this, Ka).delete(e);
3416
+ }), this["~registerErrorCallback"] = (e) => (J(this, qa).add(e), () => {
3417
+ J(this, qa).delete(e);
3418
+ }), Y(this, Ja, () => {
3419
+ J(this, Ga).forEach((e) => e());
3420
+ }), Y(this, Ya, () => {
3421
+ J(this, Ka).forEach((e) => e());
3422
+ }), Y(this, Xa, () => {
3423
+ J(this, qa).forEach((e) => e());
3424
+ }), X(this, Z, e);
3425
3425
  }
3426
3426
  get status() {
3427
- return Y(this, Ua);
3427
+ return J(this, Ua);
3428
3428
  }
3429
3429
  set status(e) {
3430
- Ba(this, Ua, e), Y(this, Ya).call(this);
3430
+ X(this, Ua, e), J(this, Ya).call(this);
3431
3431
  }
3432
3432
  get error() {
3433
- return Y(this, Wa);
3433
+ return J(this, Wa);
3434
3434
  }
3435
3435
  set error(e) {
3436
- Ba(this, Wa, e), Y(this, Xa).call(this);
3436
+ X(this, Wa, e), J(this, Xa).call(this);
3437
3437
  }
3438
3438
  get messages() {
3439
- return Y(this, Z);
3439
+ return J(this, Z);
3440
3440
  }
3441
3441
  set messages(e) {
3442
- Ba(this, Z, [...e]), Y(this, Ja).call(this);
3442
+ X(this, Z, [...e]), J(this, Ja).call(this);
3443
3443
  }
3444
3444
  };
3445
3445
  Z = /* @__PURE__ */ new WeakMap(), Ua = /* @__PURE__ */ new WeakMap(), Wa = /* @__PURE__ */ new WeakMap(), Ga = /* @__PURE__ */ new WeakMap(), Ka = /* @__PURE__ */ new WeakMap(), qa = /* @__PURE__ */ new WeakMap(), Ja = /* @__PURE__ */ new WeakMap(), Ya = /* @__PURE__ */ new WeakMap(), Xa = /* @__PURE__ */ new WeakMap();
3446
- var Qa, $a = class extends Pa {
3446
+ var Qa, $a = class extends Fa {
3447
3447
  constructor({ messages: e, ...t }) {
3448
3448
  let n = new Za(e);
3449
3449
  super({
3450
3450
  ...t,
3451
3451
  state: n
3452
- }), X(this, Qa, void 0), this["~registerMessagesCallback"] = (e, t) => Y(this, Qa)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = (e) => Y(this, Qa)["~registerStatusCallback"](e), this["~registerErrorCallback"] = (e) => Y(this, Qa)["~registerErrorCallback"](e), Ba(this, Qa, n);
3452
+ }), Y(this, Qa, void 0), this["~registerMessagesCallback"] = (e, t) => J(this, Qa)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = (e) => J(this, Qa)["~registerStatusCallback"](e), this["~registerErrorCallback"] = (e) => J(this, Qa)["~registerErrorCallback"](e), X(this, Qa, n);
3453
3453
  }
3454
3454
  };
3455
3455
  Qa = /* @__PURE__ */ new WeakMap();
3456
3456
  function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}) {
3457
- let i = e ?? t, a = (0, q.useRef)({});
3457
+ let i = e ?? t, a = (0, K.useRef)({});
3458
3458
  "chat" in r || (a.current = {
3459
3459
  onToolCall: r.onToolCall,
3460
3460
  onData: r.onData,
@@ -3463,7 +3463,7 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3463
3463
  sendAutomaticallyWhen: r.sendAutomaticallyWhen,
3464
3464
  transport: r.transport
3465
3465
  });
3466
- let o, s = () => a.current.transport ?? (o ??= new Na()), c = {
3466
+ let o, s = () => a.current.transport ?? (o ??= new Pa()), c = {
3467
3467
  ...r,
3468
3468
  transport: {
3469
3469
  sendMessages: (e) => s().sendMessages(e),
@@ -3489,16 +3489,16 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3489
3489
  var t;
3490
3490
  return (t = a.current).sendAutomaticallyWhen?.call(t, e) ?? !1;
3491
3491
  }
3492
- }, l = "chat" in r ? r.chat : r.id, { chat: u, isExternallyManaged: d } = (0, q.useMemo)(() => ({
3492
+ }, l = "chat" in r ? r.chat : r.id, { chat: u, isExternallyManaged: d } = (0, K.useMemo)(() => ({
3493
3493
  chat: "chat" in r ? r.chat : new $a(c),
3494
3494
  isExternallyManaged: "chat" in r
3495
3495
  }), [l]);
3496
- (0, q.useEffect)(() => {
3496
+ (0, K.useEffect)(() => {
3497
3497
  if (!d) return () => {
3498
3498
  u.stop();
3499
3499
  };
3500
3500
  }, [u, d]);
3501
- let f = (0, q.useMemo)(() => ({ messages: u.messages }), [u]), p = (0, q.useCallback)((e) => {
3501
+ let f = (0, K.useMemo)(() => ({ messages: u.messages }), [u]), p = (0, K.useCallback)((e) => {
3502
3502
  let t = !0, n = u["~registerMessagesCallback"](() => {
3503
3503
  t && (f.messages = u.messages, e());
3504
3504
  }, i);
@@ -3509,12 +3509,12 @@ function eo({ throttle: e, experimental_throttle: t, resume: n = !1, ...r } = {}
3509
3509
  u,
3510
3510
  f,
3511
3511
  i
3512
- ]), m = (0, q.useCallback)(() => f.messages, [f]), h = (0, q.useSyncExternalStore)(p, m, m), g = (0, q.useCallback)((e) => u["~registerStatusCallback"](() => {
3512
+ ]), m = (0, K.useCallback)(() => f.messages, [f]), h = (0, K.useSyncExternalStore)(p, m, m), g = (0, K.useCallback)((e) => u["~registerStatusCallback"](() => {
3513
3513
  (u.status === "ready" || u.status === "error") && (f.messages = u.messages), e();
3514
- }), [u, f]), _ = (0, q.useCallback)(() => u.status, [u]), v = (0, q.useSyncExternalStore)(g, _, _), y = (0, q.useSyncExternalStore)(u["~registerErrorCallback"], () => u.error, () => u.error), b = (0, q.useCallback)((e) => {
3514
+ }), [u, f]), _ = (0, K.useCallback)(() => u.status, [u]), v = (0, K.useSyncExternalStore)(g, _, _), y = (0, K.useSyncExternalStore)(u["~registerErrorCallback"], () => u.error, () => u.error), b = (0, K.useCallback)((e) => {
3515
3515
  typeof e == "function" && (e = e(u.messages)), u.messages = e;
3516
3516
  }, [u]);
3517
- return (0, q.useEffect)(() => {
3517
+ return (0, K.useEffect)(() => {
3518
3518
  n && u.resumeStream();
3519
3519
  }, [n, u]), {
3520
3520
  id: u.id,
@@ -3575,7 +3575,7 @@ var oo = class extends T {
3575
3575
  super(), this.store = e;
3576
3576
  }
3577
3577
  getItems() {
3578
- let e = this.store.get(pe), t = [];
3578
+ let e = this.store.get(_e), t = [];
3579
3579
  for (let n of e.cellIds.inOrderIds) {
3580
3580
  let r = lo(n, e), i = r.cellOutput;
3581
3581
  if (!i) continue;
@@ -3653,7 +3653,7 @@ async function so(e, t, n) {
3653
3653
  let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
3654
3654
  if (i.length === 0) return [];
3655
3655
  let a = i.flatMap((e) => {
3656
- let i = document.getElementById(le.create(t));
3656
+ let i = document.getElementById(oe.create(t));
3657
3657
  return i ? {
3658
3658
  cellId: t,
3659
3659
  cellName: n,
@@ -3674,7 +3674,7 @@ async function so(e, t, n) {
3674
3674
  }
3675
3675
  function co(e) {
3676
3676
  if (v(e)) return null;
3677
- let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = Ue(e), i, a = !1;
3677
+ let t = e.mimetype, n = ao(t, String(e.data)) ? "media" : "text", r = We(e), i, a = !1;
3678
3678
  return n === "media" && (typeof e.data == "string" && e.data.startsWith("data:") || typeof e.data == "string" && e.data.startsWith("http") ? i = e.data : a = !0), {
3679
3679
  processedContent: r,
3680
3680
  imageUrl: i,
@@ -3684,7 +3684,7 @@ function co(e) {
3684
3684
  };
3685
3685
  }
3686
3686
  function lo(e, t, n) {
3687
- let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = ae(a.name, o), c;
3687
+ let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.inOrderIds.indexOf(e), s = se(a.name, o), c;
3688
3688
  r && (c = i.consoleOutputs.map((e) => co(e)).filter((e) => e !== null));
3689
3689
  let l, u = i.output;
3690
3690
  return u && !v(u) && (l = co(u) ?? void 0), {
@@ -3699,7 +3699,7 @@ function lo(e, t, n) {
3699
3699
  //#region src/core/ai/context/providers/error.ts
3700
3700
  function uo(e, t) {
3701
3701
  let n = [`Code:\n${e.cellCode}`];
3702
- if (e.tracebackHtml && n.push(`Traceback:\n${Te(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => be(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3702
+ if (e.tracebackHtml && n.push(`Traceback:\n${Ee(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Se(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3703
3703
  let r = w(e.cellId, t);
3704
3704
  r && n.push(`Database schema:\n${r}`);
3705
3705
  }
@@ -3716,12 +3716,12 @@ function fo(e, t) {
3716
3716
  });
3717
3717
  }
3718
3718
  function po(e) {
3719
- return e.errorData.length === 1 ? xe(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";
3719
+ return e.errorData.length === 1 ? Te(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Ee(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
3720
3720
  }
3721
3721
  function mo(e) {
3722
3722
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
3723
3723
  }
3724
- var ho = new he("error", "errors"), go = class extends T {
3724
+ var ho = new xe("error", "errors"), go = class extends T {
3725
3725
  title = "Errors";
3726
3726
  mentionPrefix = "@";
3727
3727
  contextType = "error";
@@ -3730,7 +3730,7 @@ var ho = new he("error", "errors"), go = class extends T {
3730
3730
  super(), this.store = e;
3731
3731
  }
3732
3732
  getItems() {
3733
- let e = ge(this.store);
3733
+ let e = ve(this.store);
3734
3734
  if (e.length === 0) return [];
3735
3735
  let t = [{
3736
3736
  uri: this.asURI("all"),
@@ -3795,7 +3795,7 @@ var ho = new he("error", "errors"), go = class extends T {
3795
3795
  formatContext(e) {
3796
3796
  return (e.data.type === "all-errors" ? e.data.errors : [e.data.error]).map((e) => fo(e, this.store)).join("\n\n");
3797
3797
  }
3798
- }, _o = oe(), vo = {
3798
+ }, _o = le(), vo = {
3799
3799
  maxDepth: 3,
3800
3800
  maxResults: 20,
3801
3801
  defaultResultsLimit: 5,
@@ -3917,7 +3917,7 @@ var ho = new he("error", "errors"), go = class extends T {
3917
3917
  description: e.message
3918
3918
  }), null));
3919
3919
  if (!l) return;
3920
- let u = l.mimeType || "text/plain", d = We({
3920
+ let u = l.mimeType || "text/plain", d = Ge({
3921
3921
  contents: l.contents ?? "",
3922
3922
  mimeType: u,
3923
3923
  isBase64: l.isBase64 ?? !1
@@ -3926,7 +3926,7 @@ var ho = new he("error", "errors"), go = class extends T {
3926
3926
  from: a,
3927
3927
  to: o,
3928
3928
  insert: ""
3929
- } }), Mt(e);
3929
+ } }), Nt(e);
3930
3930
  },
3931
3931
  info: () => {
3932
3932
  let e = document.createElement("div");
@@ -3996,10 +3996,10 @@ var ho = new he("error", "errors"), go = class extends T {
3996
3996
  displayLabel: t,
3997
3997
  detail: n.source === "memory" ? "in-memory" : n.source,
3998
3998
  boost: n.source_type === "local" ? b.LOCAL_TABLE : b.REMOTE_TABLE,
3999
- type: Ee(n),
3999
+ type: ie(n),
4000
4000
  apply: `@${t}`,
4001
4001
  section: {
4002
- name: Ee(n) === "dataframe" ? "Dataframe" : "Table",
4002
+ name: ie(n) === "dataframe" ? "Dataframe" : "Table",
4003
4003
  rank: x.TABLE.rank
4004
4004
  },
4005
4005
  info: () => this.createTableInfoElement(t, n)
@@ -4086,7 +4086,7 @@ var ho = new he("error", "errors"), go = class extends T {
4086
4086
  detail: n.dataType ?? "",
4087
4087
  type: this.contextType,
4088
4088
  section: x.VARIABLE,
4089
- info: () => ue(n)
4089
+ info: () => de(n)
4090
4090
  };
4091
4091
  }
4092
4092
  formatContext(e) {
@@ -4104,11 +4104,11 @@ var ho = new he("error", "errors"), go = class extends T {
4104
4104
  //#endregion
4105
4105
  //#region src/core/ai/context/context.ts
4106
4106
  function So(e) {
4107
- let t = e.get(re), n = e.get(ce), r = e.get(ye);
4107
+ let t = e.get(ue), n = e.get(De), r = e.get(pe);
4108
4108
  return new C().register(new bo(n)).register(new xo(r, n)).register(new go(e)).register(new oo(e)).register(new y(t.connectionsMap, n));
4109
4109
  }
4110
4110
  function Co() {
4111
- return new yo(ie());
4111
+ return new yo(ae());
4112
4112
  }
4113
4113
  //#endregion
4114
4114
  //#region src/components/editor/ai/completion-utils.ts
@@ -4128,42 +4128,42 @@ async function To(e) {
4128
4128
  type: "file",
4129
4129
  mediaType: e.type,
4130
4130
  filename: e.name,
4131
- url: await He(e, "dataUrl")
4131
+ url: await Ue(e, "dataUrl")
4132
4132
  })));
4133
4133
  }
4134
4134
  function Eo(e) {
4135
4135
  let t = e.at(-1);
4136
4136
  if (!t || t.role !== "assistant") return !1;
4137
4137
  let n = t.parts.at(-1);
4138
- return !n || !K(n) ? !1 : Ia({ messages: e }) || Fa({ messages: e }) || n.state === "output-denied" && !n.providerExecuted;
4138
+ return !n || !G(n) ? !1 : La({ messages: e }) || Ia({ messages: e }) || n.state === "output-denied" && !n.providerExecuted;
4139
4139
  }
4140
4140
  //#endregion
4141
4141
  //#region src/components/chat/chat-components.tsx
4142
4142
  var Do = (e) => {
4143
- let t = (0, N.c)(6), { attachment: n } = e;
4143
+ let t = (0, M.c)(6), { attachment: n } = e;
4144
4144
  if (n.mediaType?.startsWith("image/")) {
4145
4145
  let e = n.filename || "Attachment", r;
4146
- return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, J.jsx)("img", {
4146
+ return t[0] !== n.url || t[1] !== e ? (r = /* @__PURE__ */ (0, q.jsx)("img", {
4147
4147
  src: n.url,
4148
4148
  alt: e,
4149
4149
  className: "max-h-[100px] max-w-[100px] object-contain mb-1.5"
4150
4150
  }), t[0] = n.url, t[1] = e, t[2] = r) : r = t[2], r;
4151
4151
  }
4152
4152
  let r;
4153
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, J.jsx)(Be, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4153
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ (0, q.jsx)(Ve, { className: "h-3 w-3 mt-0.5" }), t[3] = r) : r = t[3];
4154
4154
  let i = n.filename || "Attachment", a;
4155
- return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4155
+ return t[4] === i ? a = t[5] : (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4156
4156
  className: "flex flex-row gap-1 items-center text-xs",
4157
4157
  children: [r, i]
4158
4158
  }), t[4] = i, t[5] = a), a;
4159
4159
  }, Oo = (e) => {
4160
- let t = (0, N.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4161
- t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, J.jsx)("span", {
4160
+ let t = (0, M.c)(15), { icon: n, title: r, subtitle: i, href: a } = e, o;
4161
+ t[0] === r ? o = t[1] : (o = /* @__PURE__ */ (0, q.jsx)("span", {
4162
4162
  className: "truncate font-medium",
4163
4163
  children: r
4164
4164
  }), t[0] = r, t[1] = o);
4165
4165
  let s;
4166
- t[2] === i ? s = t[3] : (s = i && /* @__PURE__ */ (0, J.jsxs)("span", {
4166
+ t[2] === i ? s = t[3] : (s = i && /* @__PURE__ */ (0, q.jsxs)("span", {
4167
4167
  className: "truncate opacity-70",
4168
4168
  children: [
4169
4169
  "(",
@@ -4172,15 +4172,15 @@ var Do = (e) => {
4172
4172
  ]
4173
4173
  }), t[2] = i, t[3] = s);
4174
4174
  let c;
4175
- t[4] !== n || t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [
4175
+ t[4] !== n || t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
4176
4176
  n,
4177
4177
  o,
4178
4178
  s
4179
4179
  ] }), t[4] = n, t[5] = o, t[6] = s, t[7] = c) : c = t[7];
4180
4180
  let l = c;
4181
- if (a && Re(a)) {
4181
+ if (a && ze(a)) {
4182
4182
  let e = i ?? r, n;
4183
- return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, J.jsx)("a", {
4183
+ return t[8] !== l || t[9] !== a || t[10] !== e ? (n = /* @__PURE__ */ (0, q.jsx)("a", {
4184
4184
  href: a,
4185
4185
  target: "_blank",
4186
4186
  rel: "noopener noreferrer",
@@ -4190,20 +4190,20 @@ var Do = (e) => {
4190
4190
  }), t[8] = l, t[9] = a, t[10] = e, t[11] = n) : n = t[11], n;
4191
4191
  }
4192
4192
  let u = i ?? r, d;
4193
- return t[12] !== l || t[13] !== u ? (d = /* @__PURE__ */ (0, J.jsx)("div", {
4193
+ return t[12] !== l || t[13] !== u ? (d = /* @__PURE__ */ (0, q.jsx)("div", {
4194
4194
  className: "inline-flex max-w-full items-center gap-1.5 rounded-md border bg-muted/50 px-2 py-1 my-1 text-xs text-muted-foreground",
4195
4195
  title: u,
4196
4196
  children: l
4197
4197
  }), t[12] = l, t[13] = u, t[14] = d) : d = t[14], d;
4198
4198
  }, ko = (e) => {
4199
- let t = (0, N.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = q.useState("");
4199
+ let t = (0, M.c)(13), { reasoning: n, index: r, isStreaming: i } = e, a = r === void 0 ? 0 : r, o = i !== void 0 && i, [s, c] = K.useState("");
4200
4200
  if (!n && !o) return null;
4201
4201
  let l = o ? "reasoning" : s, u;
4202
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4202
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-3 w-3" }), t[0] = u) : u = t[0];
4203
4203
  let d = o ? "Thinking" : "View reasoning", f = n.length > 0 && ` (${n.length} chars)`, p;
4204
- t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, J.jsx)(j, {
4204
+ t[1] !== d || t[2] !== f ? (p = /* @__PURE__ */ (0, q.jsx)(te, {
4205
4205
  className: "text-xs text-muted-foreground hover:bg-muted/50 px-2 py-1 h-auto rounded-sm [&[data-state=open]>svg]:rotate-180",
4206
- children: /* @__PURE__ */ (0, J.jsxs)("span", {
4206
+ children: /* @__PURE__ */ (0, q.jsxs)("span", {
4207
4207
  className: "flex items-center gap-2",
4208
4208
  children: [
4209
4209
  u,
@@ -4213,24 +4213,24 @@ var Do = (e) => {
4213
4213
  })
4214
4214
  }), t[1] = d, t[2] = f, t[3] = p) : p = t[3];
4215
4215
  let m;
4216
- t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, J.jsx)(_, {
4216
+ t[4] === n ? m = t[5] : (m = /* @__PURE__ */ (0, q.jsx)(_, {
4217
4217
  className: "pb-2 px-2",
4218
- children: /* @__PURE__ */ (0, J.jsx)("div", {
4218
+ children: /* @__PURE__ */ (0, q.jsx)("div", {
4219
4219
  className: "bg-muted/30 border border-muted/50 rounded-md p-3 italic text-muted-foreground/90 relative",
4220
- children: /* @__PURE__ */ (0, J.jsx)("div", {
4220
+ children: /* @__PURE__ */ (0, q.jsx)("div", {
4221
4221
  className: "pr-6",
4222
- children: /* @__PURE__ */ (0, J.jsx)(O, { content: n })
4222
+ children: /* @__PURE__ */ (0, q.jsx)(O, { content: n })
4223
4223
  })
4224
4224
  })
4225
4225
  }), t[4] = n, t[5] = m);
4226
4226
  let h;
4227
- t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, J.jsxs)(A, {
4227
+ t[6] !== p || t[7] !== m ? (h = /* @__PURE__ */ (0, q.jsxs)(A, {
4228
4228
  value: "reasoning",
4229
4229
  className: "border-0",
4230
4230
  children: [p, m]
4231
4231
  }), t[6] = p, t[7] = m, t[8] = h) : h = t[8];
4232
4232
  let g;
4233
- return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, J.jsx)(S, {
4233
+ return t[9] !== a || t[10] !== l || t[11] !== h ? (g = /* @__PURE__ */ (0, q.jsx)(S, {
4234
4234
  type: "single",
4235
4235
  collapsible: !0,
4236
4236
  className: "w-full mb-2",
@@ -4247,48 +4247,48 @@ function Ao(e) {
4247
4247
  //#endregion
4248
4248
  //#region src/components/chat/tool-call/tool-args.tsx
4249
4249
  var jo = (e) => {
4250
- let t = (0, N.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4250
+ let t = (0, M.c)(9), { input: n, label: r } = e, i = r === void 0 ? "Tool Request" : r;
4251
4251
  if (n == null) return null;
4252
4252
  let a;
4253
- t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, J.jsx)("h3", {
4253
+ t[0] === i ? a = t[1] : (a = /* @__PURE__ */ (0, q.jsx)("h3", {
4254
4254
  className: "text-xs font-semibold text-muted-foreground",
4255
4255
  children: i
4256
4256
  }), t[0] = i, t[1] = a);
4257
4257
  let o;
4258
4258
  t[2] === n ? o = t[3] : (o = JSON.stringify(n, null, 2), t[2] = n, t[3] = o);
4259
4259
  let s;
4260
- t[4] === o ? s = t[5] : (s = /* @__PURE__ */ (0, J.jsx)("pre", {
4260
+ t[4] === o ? s = t[5] : (s = /* @__PURE__ */ (0, q.jsx)("pre", {
4261
4261
  className: "bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64",
4262
4262
  children: o
4263
4263
  }), t[4] = o, t[5] = s);
4264
4264
  let c;
4265
- return t[6] !== a || t[7] !== s ? (c = /* @__PURE__ */ (0, J.jsxs)("div", {
4265
+ return t[6] !== a || t[7] !== s ? (c = /* @__PURE__ */ (0, q.jsxs)("div", {
4266
4266
  className: "space-y-2",
4267
4267
  children: [a, s]
4268
4268
  }), t[6] = a, t[7] = s, t[8] = c) : c = t[8], c;
4269
4269
  }, Mo = (e) => {
4270
- let t = (0, N.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4270
+ let t = (0, M.c)(27), { toolName: n, input: r, approval: o, onApprove: s, className: c } = e, l;
4271
4271
  t[0] === c ? l = t[1] : (l = i("rounded-md border border-(--amber-6) bg-(--amber-2) p-3 space-y-3", c), t[0] = c, t[1] = l);
4272
4272
  let u;
4273
4273
  t[2] === n ? u = t[3] : (u = Ao(n), t[2] = n, t[3] = u);
4274
4274
  let d = `Approval required for ${u}`, f;
4275
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(Kt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4275
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(qt, { className: "h-4 w-4 text-(--amber-11) mt-0.5 shrink-0" }), t[4] = f) : f = t[4];
4276
4276
  let p;
4277
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, J.jsx)("span", {
4277
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ (0, q.jsx)("span", {
4278
4278
  className: "font-semibold",
4279
4279
  children: "Approval required:"
4280
4280
  }), t[5] = p) : p = t[5];
4281
4281
  let m;
4282
4282
  t[6] === n ? m = t[7] : (m = Ao(n), t[6] = n, t[7] = m);
4283
4283
  let h;
4284
- t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, J.jsxs)("div", {
4284
+ t[8] === m ? h = t[9] : (h = /* @__PURE__ */ (0, q.jsxs)("div", {
4285
4285
  className: "flex items-start gap-2",
4286
- children: [f, /* @__PURE__ */ (0, J.jsxs)("div", {
4286
+ children: [f, /* @__PURE__ */ (0, q.jsxs)("div", {
4287
4287
  className: "text-xs text-(--amber-11) leading-relaxed",
4288
4288
  children: [
4289
4289
  p,
4290
4290
  " ",
4291
- /* @__PURE__ */ (0, J.jsx)("code", {
4291
+ /* @__PURE__ */ (0, q.jsx)("code", {
4292
4292
  className: "font-mono",
4293
4293
  children: m
4294
4294
  })
@@ -4296,9 +4296,9 @@ var jo = (e) => {
4296
4296
  })]
4297
4297
  }), t[8] = m, t[9] = h);
4298
4298
  let g;
4299
- t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4299
+ t[10] === r ? g = t[11] : (g = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[10] = r, t[11] = g);
4300
4300
  let _;
4301
- t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, J.jsx)(a, {
4301
+ t[12] !== o.id || t[13] !== s ? (_ = /* @__PURE__ */ (0, q.jsx)(a, {
4302
4302
  size: "xs",
4303
4303
  variant: "outline",
4304
4304
  onClick: () => s({
@@ -4308,7 +4308,7 @@ var jo = (e) => {
4308
4308
  children: "Deny"
4309
4309
  }), t[12] = o.id, t[13] = s, t[14] = _) : _ = t[14];
4310
4310
  let v;
4311
- t[15] !== o.id || t[16] !== s ? (v = /* @__PURE__ */ (0, J.jsx)(a, {
4311
+ t[15] !== o.id || t[16] !== s ? (v = /* @__PURE__ */ (0, q.jsx)(a, {
4312
4312
  size: "xs",
4313
4313
  onClick: () => s({
4314
4314
  id: o.id,
@@ -4317,12 +4317,12 @@ var jo = (e) => {
4317
4317
  children: "Approve"
4318
4318
  }), t[15] = o.id, t[16] = s, t[17] = v) : v = t[17];
4319
4319
  let y;
4320
- t[18] !== v || t[19] !== _ ? (y = /* @__PURE__ */ (0, J.jsxs)("div", {
4320
+ t[18] !== v || t[19] !== _ ? (y = /* @__PURE__ */ (0, q.jsxs)("div", {
4321
4321
  className: "flex items-center justify-end gap-2",
4322
4322
  children: [_, v]
4323
4323
  }), t[18] = v, t[19] = _, t[20] = y) : y = t[20];
4324
4324
  let b;
4325
- return t[21] !== l || t[22] !== y || t[23] !== d || t[24] !== h || t[25] !== g ? (b = /* @__PURE__ */ (0, J.jsxs)("div", {
4325
+ return t[21] !== l || t[22] !== y || t[23] !== d || t[24] !== h || t[25] !== g ? (b = /* @__PURE__ */ (0, q.jsxs)("div", {
4326
4326
  className: l,
4327
4327
  role: "alertdialog",
4328
4328
  "aria-label": d,
@@ -4333,30 +4333,30 @@ var jo = (e) => {
4333
4333
  ]
4334
4334
  }), t[21] = l, t[22] = y, t[23] = d, t[24] = h, t[25] = g, t[26] = b) : b = t[26], b;
4335
4335
  }, No = (e) => {
4336
- let t = (0, N.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = q.useState(o), u = q.useRef(o), d, f;
4336
+ let t = (0, M.c)(28), { toolName: n, input: r, errorText: a, isLive: o, className: s } = e, [c, l] = K.useState(o), u = K.useRef(o), d, f;
4337
4337
  t[0] === o ? (d = t[1], f = t[2]) : (d = () => {
4338
4338
  u.current && !o && l(!1), u.current = o;
4339
- }, f = [o], t[0] = o, t[1] = d, t[2] = f), q.useEffect(d, f);
4339
+ }, f = [o], t[0] = o, t[1] = d, t[2] = f), K.useEffect(d, f);
4340
4340
  let p;
4341
4341
  t[3] === s ? p = t[4] : (p = i("rounded-md border border-(--red-6) bg-(--red-2)", s), t[3] = s, t[4] = p);
4342
4342
  let m;
4343
4343
  t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => l(Po), t[5] = m) : m = t[5];
4344
4344
  let h;
4345
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, J.jsx)(me, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4345
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ (0, q.jsx)(be, { className: "h-3.5 w-3.5 shrink-0" }), t[6] = h) : h = t[6];
4346
4346
  let g;
4347
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, J.jsx)("span", {
4347
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, q.jsx)("span", {
4348
4348
  className: "font-semibold",
4349
4349
  children: "Failed:"
4350
4350
  }), t[7] = g) : g = t[7];
4351
4351
  let _;
4352
4352
  t[8] === n ? _ = t[9] : (_ = Ao(n), t[8] = n, t[9] = _);
4353
4353
  let v;
4354
- t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, J.jsxs)("span", {
4354
+ t[10] === _ ? v = t[11] : (v = /* @__PURE__ */ (0, q.jsxs)("span", {
4355
4355
  className: "flex-1 text-left",
4356
4356
  children: [
4357
4357
  g,
4358
4358
  " ",
4359
- /* @__PURE__ */ (0, J.jsx)("code", {
4359
+ /* @__PURE__ */ (0, q.jsx)("code", {
4360
4360
  className: "font-mono",
4361
4361
  children: _
4362
4362
  })
@@ -4365,9 +4365,9 @@ var jo = (e) => {
4365
4365
  let y = c && "rotate-180", b;
4366
4366
  t[12] === y ? b = t[13] : (b = i("h-3.5 w-3.5 shrink-0 transition-transform", y), t[12] = y, t[13] = b);
4367
4367
  let x;
4368
- t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, J.jsx)(ke, { className: b }), t[14] = b, t[15] = x);
4368
+ t[14] === b ? x = t[15] : (x = /* @__PURE__ */ (0, q.jsx)(Ae, { className: b }), t[14] = b, t[15] = x);
4369
4369
  let S;
4370
- t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, J.jsxs)("button", {
4370
+ t[16] !== c || t[17] !== x || t[18] !== v ? (S = /* @__PURE__ */ (0, q.jsxs)("button", {
4371
4371
  type: "button",
4372
4372
  onClick: m,
4373
4373
  className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-(--red-11) hover:bg-(--red-3) rounded-md transition-colors",
@@ -4379,18 +4379,18 @@ var jo = (e) => {
4379
4379
  ]
4380
4380
  }), t[16] = c, t[17] = x, t[18] = v, t[19] = S) : S = t[19];
4381
4381
  let C;
4382
- t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, J.jsxs)("div", {
4382
+ t[20] !== a || t[21] !== r || t[22] !== c ? (C = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4383
4383
  className: "px-3 pb-3 space-y-3 border-t border-(--red-6)/40 pt-3",
4384
- children: [/* @__PURE__ */ (0, J.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, J.jsxs)("div", { children: [/* @__PURE__ */ (0, J.jsx)("h3", {
4384
+ children: [/* @__PURE__ */ (0, q.jsx)(jo, { input: r }), a && /* @__PURE__ */ (0, q.jsxs)("div", { children: [/* @__PURE__ */ (0, q.jsx)("h3", {
4385
4385
  className: "text-xs font-semibold text-(--red-11) mb-1",
4386
4386
  children: "Error"
4387
- }), /* @__PURE__ */ (0, J.jsx)("pre", {
4387
+ }), /* @__PURE__ */ (0, q.jsx)("pre", {
4388
4388
  className: "bg-(--red-2) border border-(--red-6) rounded p-2 text-xs text-(--red-11) leading-relaxed overflow-auto scrollbar-thin max-h-64 whitespace-pre-wrap",
4389
4389
  children: a
4390
4390
  })] })]
4391
4391
  }), t[20] = a, t[21] = r, t[22] = c, t[23] = C) : C = t[23];
4392
4392
  let w;
4393
- return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, J.jsxs)("div", {
4393
+ return t[24] !== S || t[25] !== C || t[26] !== p ? (w = /* @__PURE__ */ (0, q.jsxs)("div", {
4394
4394
  className: p,
4395
4395
  children: [S, C]
4396
4396
  }), t[24] = S, t[25] = C, t[26] = p, t[27] = w) : w = t[27], w;
@@ -4401,54 +4401,54 @@ function Po(e) {
4401
4401
  //#endregion
4402
4402
  //#region src/components/chat/tool-call/tool-result.tsx
4403
4403
  function Fo(e) {
4404
- return e == null || typeof e == "object" && mt(e);
4405
- }
4406
- var Io = $e({
4407
- status: Xe().default("success"),
4408
- auth_required: qe().default(!1),
4409
- action_url: lt().optional(),
4410
- next_steps: lt().optional(),
4411
- meta: lt().optional(),
4412
- message: Xe().nullish()
4404
+ return e == null || typeof e == "object" && ht(e);
4405
+ }
4406
+ var Io = et({
4407
+ status: Ze().default("success"),
4408
+ auth_required: Je().default(!1),
4409
+ action_url: ut().optional(),
4410
+ next_steps: ut().optional(),
4411
+ meta: ut().optional(),
4412
+ message: Ze().nullish()
4413
4413
  }), Lo = (e) => {
4414
- let t = (0, N.c)(12), { data: n } = e, r;
4414
+ let t = (0, M.c)(12), { data: n } = e, r;
4415
4415
  if (t[0] !== n) {
4416
4416
  let { status: e, auth_required: i, action_url: a, meta: o, next_steps: s, message: c, ...l } = n, u;
4417
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, J.jsx)("h3", {
4417
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ (0, q.jsx)("h3", {
4418
4418
  className: "text-xs font-semibold text-muted-foreground",
4419
4419
  children: "Tool Result"
4420
4420
  }), t[2] = u) : u = t[2];
4421
4421
  let d;
4422
- t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, J.jsx)("span", {
4422
+ t[3] === e ? d = t[4] : (d = /* @__PURE__ */ (0, q.jsx)("span", {
4423
4423
  className: "text-xs px-2 py-0.5 bg-(--grass-2) text-(--grass-11) rounded-full font-medium capitalize",
4424
4424
  children: e
4425
4425
  }), t[3] = e, t[4] = d);
4426
4426
  let f;
4427
- t[5] === i ? f = t[6] : (f = i && /* @__PURE__ */ (0, J.jsx)("span", {
4427
+ t[5] === i ? f = t[6] : (f = i && /* @__PURE__ */ (0, q.jsx)("span", {
4428
4428
  className: "text-xs px-2 py-0.5 bg-(--amber-2) text-(--amber-11) rounded-full",
4429
4429
  children: "Auth Required"
4430
4430
  }), t[5] = i, t[6] = f);
4431
4431
  let p;
4432
- t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, J.jsxs)("div", {
4432
+ t[7] !== d || t[8] !== f ? (p = /* @__PURE__ */ (0, q.jsxs)("div", {
4433
4433
  className: "flex items-center justify-between",
4434
- children: [u, /* @__PURE__ */ (0, J.jsxs)("div", {
4434
+ children: [u, /* @__PURE__ */ (0, q.jsxs)("div", {
4435
4435
  className: "flex items-center gap-2",
4436
4436
  children: [d, f]
4437
4437
  })]
4438
4438
  }), t[7] = d, t[8] = f, t[9] = p) : p = t[9];
4439
4439
  let m;
4440
- t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, J.jsxs)("div", {
4440
+ t[10] === c ? m = t[11] : (m = c && /* @__PURE__ */ (0, q.jsxs)("div", {
4441
4441
  className: "flex items-start gap-2",
4442
- children: [/* @__PURE__ */ (0, J.jsx)(ve, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, J.jsx)("div", {
4442
+ children: [/* @__PURE__ */ (0, q.jsx)(fe, { className: "h-3 w-3 text-(--blue-11) mt-0.5 shrink-0" }), /* @__PURE__ */ (0, q.jsx)("div", {
4443
4443
  className: "text-xs text-foreground",
4444
4444
  children: c
4445
4445
  })]
4446
- }), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, J.jsxs)("div", {
4446
+ }), t[10] = c, t[11] = m), r = /* @__PURE__ */ (0, q.jsxs)("div", {
4447
4447
  className: "flex flex-col gap-1.5",
4448
4448
  children: [
4449
4449
  p,
4450
4450
  m,
4451
- l && /* @__PURE__ */ (0, J.jsx)("div", {
4451
+ l && /* @__PURE__ */ (0, q.jsx)("div", {
4452
4452
  className: "space-y-3",
4453
4453
  children: Object.entries(l).map(zo)
4454
4454
  })
@@ -4457,29 +4457,29 @@ var Io = $e({
4457
4457
  } else r = t[1];
4458
4458
  return r;
4459
4459
  }, Ro = (e) => {
4460
- let t = (0, N.c)(8), { result: n } = e, r;
4460
+ let t = (0, M.c)(8), { result: n } = e, r;
4461
4461
  t[0] === n ? r = t[1] : (r = Io.safeParse(n), t[0] = n, t[1] = r);
4462
4462
  let i = r;
4463
4463
  if (i.success) {
4464
4464
  let e;
4465
- return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, J.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4465
+ return t[2] === i.data ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(Lo, { data: i.data }), t[2] = i.data, t[3] = e), e;
4466
4466
  }
4467
4467
  let a;
4468
4468
  t[4] === n ? a = t[5] : (a = typeof n == "string" ? n : JSON.stringify(n, null, 2), t[4] = n, t[5] = a);
4469
4469
  let o;
4470
- return t[6] === a ? o = t[7] : (o = /* @__PURE__ */ (0, J.jsx)("div", {
4470
+ return t[6] === a ? o = t[7] : (o = /* @__PURE__ */ (0, q.jsx)("div", {
4471
4471
  className: "text-xs font-medium text-muted-foreground mb-1 max-h-64 overflow-y-auto scrollbar-thin",
4472
4472
  children: a
4473
4473
  }), t[6] = a, t[7] = o), o;
4474
4474
  };
4475
4475
  function zo(e) {
4476
4476
  let [t, n] = e;
4477
- return Fo(n) ? null : /* @__PURE__ */ (0, J.jsxs)("div", {
4477
+ return Fo(n) ? null : /* @__PURE__ */ (0, q.jsxs)("div", {
4478
4478
  className: "space-y-1.5",
4479
- children: [/* @__PURE__ */ (0, J.jsx)("span", {
4479
+ children: [/* @__PURE__ */ (0, q.jsx)("span", {
4480
4480
  className: "text-xs text-muted-foreground",
4481
4481
  children: t
4482
- }), /* @__PURE__ */ (0, J.jsx)("pre", {
4482
+ }), /* @__PURE__ */ (0, q.jsx)("pre", {
4483
4483
  className: "bg-(--slate-2) p-2 text-muted-foreground border border-(--slate-4) rounded text-xs overflow-auto scrollbar-thin max-h-64",
4484
4484
  children: JSON.stringify(n, null, 2)
4485
4485
  })]
@@ -4498,30 +4498,30 @@ var Bo = {
4498
4498
  "input-available",
4499
4499
  "approval-responded"
4500
4500
  ]), Ho = (e) => {
4501
- let t = (0, N.c)(5), { state: n, interrupted: r } = e;
4501
+ let t = (0, M.c)(5), { state: n, interrupted: r } = e;
4502
4502
  if (r) {
4503
4503
  let e;
4504
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Vt, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4504
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Ht, { className: "h-3 w-3 text-muted-foreground" }), t[0] = e) : e = t[0], e;
4505
4505
  }
4506
4506
  switch (n) {
4507
4507
  case "input-streaming":
4508
4508
  case "input-available":
4509
4509
  case "approval-responded": {
4510
4510
  let e;
4511
- return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(g, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4511
+ return t[1] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(g, { className: "h-3 w-3 animate-spin" }), t[1] = e) : e = t[1], e;
4512
4512
  }
4513
4513
  case "output-available": {
4514
4514
  let e;
4515
- return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Bt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4515
+ return t[2] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(Vt, { className: "h-3 w-3 text-(--grass-11)" }), t[2] = e) : e = t[2], e;
4516
4516
  }
4517
4517
  case "output-denied": {
4518
4518
  let e;
4519
- return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(Rt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4519
+ return t[3] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(zt, { className: "h-3 w-3 text-muted-foreground" }), t[3] = e) : e = t[3], e;
4520
4520
  }
4521
4521
  default: {
4522
- Oe(n);
4522
+ ke(n);
4523
4523
  let e;
4524
- return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, J.jsx)(h, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4524
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, q.jsx)(h, { className: "h-3 w-3" }), t[4] = e) : e = t[4], e;
4525
4525
  }
4526
4526
  }
4527
4527
  };
@@ -4532,30 +4532,30 @@ function Uo(e) {
4532
4532
  case "input-streaming":
4533
4533
  case "input-available":
4534
4534
  case "approval-responded": return "";
4535
- default: return Oe(e), "";
4535
+ default: return ke(e), "";
4536
4536
  }
4537
4537
  }
4538
4538
  var Wo = (e) => {
4539
- let t = (0, N.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4539
+ let t = (0, M.c)(34), { toolName: n, state: r, input: a, result: o, approval: s, index: c, className: l, isActive: u } = e, d = c === void 0 ? 0 : c, f = u === void 0 || u, p;
4540
4540
  t[0] !== f || t[1] !== r ? (p = !f && Vo.has(r), t[0] = f, t[1] = r, t[2] = p) : p = t[2];
4541
4541
  let m = p, h = `tool-${d}`, g;
4542
4542
  t[3] === l ? g = t[4] : (g = i("w-full", l), t[3] = l, t[4] = g);
4543
4543
  let v;
4544
4544
  t[5] !== m || t[6] !== r ? (v = i("h-6 text-xs border-border shadow-none! ring-0! bg-muted/60 hover:bg-muted py-0 px-2 gap-1 rounded-sm [&[data-state=open]>svg]:rotate-180 hover:no-underline", m ? "text-muted-foreground" : Uo(r)), t[5] = m, t[6] = r, t[7] = v) : v = t[7];
4545
4545
  let y;
4546
- t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, J.jsx)(Ho, {
4546
+ t[8] !== m || t[9] !== r ? (y = /* @__PURE__ */ (0, q.jsx)(Ho, {
4547
4547
  state: r,
4548
4548
  interrupted: m
4549
4549
  }), t[8] = m, t[9] = r, t[10] = y) : y = t[10];
4550
4550
  let b = m ? "Interrupted" : Bo[r], x;
4551
4551
  t[11] === n ? x = t[12] : (x = Ao(n), t[11] = n, t[12] = x);
4552
4552
  let C;
4553
- t[13] === x ? C = t[14] : (C = /* @__PURE__ */ (0, J.jsx)("code", {
4553
+ t[13] === x ? C = t[14] : (C = /* @__PURE__ */ (0, q.jsx)("code", {
4554
4554
  className: "font-mono text-xs",
4555
4555
  children: x
4556
4556
  }), t[13] = x, t[14] = C);
4557
4557
  let w;
4558
- t[15] !== C || t[16] !== y || t[17] !== b ? (w = /* @__PURE__ */ (0, J.jsxs)("span", {
4558
+ t[15] !== C || t[16] !== y || t[17] !== b ? (w = /* @__PURE__ */ (0, q.jsxs)("span", {
4559
4559
  className: "flex items-center gap-1",
4560
4560
  children: [
4561
4561
  y,
@@ -4565,14 +4565,14 @@ var Wo = (e) => {
4565
4565
  ]
4566
4566
  }), t[15] = C, t[16] = y, t[17] = b, t[18] = w) : w = t[18];
4567
4567
  let T;
4568
- t[19] !== w || t[20] !== v ? (T = /* @__PURE__ */ (0, J.jsx)(j, {
4568
+ t[19] !== w || t[20] !== v ? (T = /* @__PURE__ */ (0, q.jsx)(te, {
4569
4569
  className: v,
4570
4570
  children: w
4571
4571
  }), t[19] = w, t[20] = v, t[21] = T) : T = t[21];
4572
4572
  let E;
4573
- t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, J.jsx)(_, {
4573
+ t[22] !== s || t[23] !== a || t[24] !== o || t[25] !== r ? (E = /* @__PURE__ */ (0, q.jsx)(_, {
4574
4574
  className: "py-2 px-2",
4575
- children: /* @__PURE__ */ (0, J.jsx)(Go, {
4575
+ children: /* @__PURE__ */ (0, q.jsx)(Go, {
4576
4576
  state: r,
4577
4577
  input: a,
4578
4578
  result: o,
@@ -4580,61 +4580,61 @@ var Wo = (e) => {
4580
4580
  })
4581
4581
  }), t[22] = s, t[23] = a, t[24] = o, t[25] = r, t[26] = E) : E = t[26];
4582
4582
  let D;
4583
- t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, J.jsxs)(A, {
4583
+ t[27] !== T || t[28] !== E ? (D = /* @__PURE__ */ (0, q.jsxs)(A, {
4584
4584
  value: "tool-call",
4585
4585
  className: "border-0",
4586
4586
  children: [T, E]
4587
4587
  }), t[27] = T, t[28] = E, t[29] = D) : D = t[29];
4588
4588
  let O;
4589
- return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, J.jsx)(S, {
4589
+ return t[30] !== D || t[31] !== h || t[32] !== g ? (O = /* @__PURE__ */ (0, q.jsx)(S, {
4590
4590
  type: "single",
4591
4591
  collapsible: !0,
4592
4592
  className: g,
4593
4593
  children: D
4594
4594
  }, h), t[30] = D, t[31] = h, t[32] = g, t[33] = O) : O = t[33], O;
4595
4595
  }, Go = (e) => {
4596
- let t = (0, N.c)(16), { state: n, input: r, result: i, approval: a } = e;
4596
+ let t = (0, M.c)(16), { state: n, input: r, result: i, approval: a } = e;
4597
4597
  switch (n) {
4598
4598
  case "input-streaming":
4599
4599
  case "input-available":
4600
4600
  case "approval-responded": {
4601
4601
  let e;
4602
- return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4602
+ return t[0] === r ? e = t[1] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[0] = r, t[1] = e), e;
4603
4603
  }
4604
4604
  case "output-available": {
4605
4605
  let e;
4606
- t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4606
+ t[2] === r ? e = t[3] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[2] = r, t[3] = e);
4607
4607
  let n;
4608
- t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, J.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4608
+ t[4] === i ? n = t[5] : (n = i != null && /* @__PURE__ */ (0, q.jsx)(Ro, { result: i }), t[4] = i, t[5] = n);
4609
4609
  let a;
4610
- return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, J.jsxs)("div", {
4610
+ return t[6] !== e || t[7] !== n ? (a = /* @__PURE__ */ (0, q.jsxs)("div", {
4611
4611
  className: "space-y-3",
4612
4612
  children: [e, n]
4613
4613
  }), t[6] = e, t[7] = n, t[8] = a) : a = t[8], a;
4614
4614
  }
4615
4615
  case "output-denied": {
4616
4616
  let e;
4617
- t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, J.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4617
+ t[9] === r ? e = t[10] : (e = /* @__PURE__ */ (0, q.jsx)(jo, { input: r }), t[9] = r, t[10] = e);
4618
4618
  let n = a?.reason ? `: ${a.reason}` : ".", i;
4619
- t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, J.jsxs)("div", {
4619
+ t[11] === n ? i = t[12] : (i = /* @__PURE__ */ (0, q.jsxs)("div", {
4620
4620
  className: "bg-muted/40 border border-border rounded-md p-3 text-xs text-muted-foreground leading-relaxed",
4621
4621
  children: ["Tool execution was denied", n]
4622
4622
  }), t[11] = n, t[12] = i);
4623
4623
  let o;
4624
- return t[13] !== e || t[14] !== i ? (o = /* @__PURE__ */ (0, J.jsxs)("div", {
4624
+ return t[13] !== e || t[14] !== i ? (o = /* @__PURE__ */ (0, q.jsxs)("div", {
4625
4625
  className: "space-y-3",
4626
4626
  children: [e, i]
4627
4627
  }), t[13] = e, t[14] = i, t[15] = o) : o = t[15], o;
4628
4628
  }
4629
- default: return Oe(n), null;
4629
+ default: return ke(n), null;
4630
4630
  }
4631
4631
  }, Ko = (e) => {
4632
- let t = (0, N.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4632
+ let t = (0, M.c)(27), { toolName: n, state: r, result: i, errorText: a, input: o, approval: s, onApprove: c, index: l, className: u, isLive: d, isActive: f } = e, p = d === void 0 || d, m = f === void 0 || f;
4633
4633
  switch (r) {
4634
4634
  case "approval-requested": {
4635
4635
  if (s != null && c != null) {
4636
4636
  let e;
4637
- return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Mo, {
4637
+ return t[0] !== s || t[1] !== u || t[2] !== o || t[3] !== c || t[4] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Mo, {
4638
4638
  toolName: n,
4639
4639
  input: o,
4640
4640
  approval: s,
@@ -4643,7 +4643,7 @@ var Wo = (e) => {
4643
4643
  }), t[0] = s, t[1] = u, t[2] = o, t[3] = c, t[4] = n, t[5] = e) : e = t[5], e;
4644
4644
  }
4645
4645
  let e;
4646
- return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Wo, {
4646
+ return t[6] !== u || t[7] !== l || t[8] !== o || t[9] !== m || t[10] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4647
4647
  toolName: n,
4648
4648
  state: "input-available",
4649
4649
  input: o,
@@ -4654,7 +4654,7 @@ var Wo = (e) => {
4654
4654
  }
4655
4655
  case "output-error": {
4656
4656
  let e;
4657
- return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(No, {
4657
+ return t[12] !== u || t[13] !== a || t[14] !== o || t[15] !== p || t[16] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(No, {
4658
4658
  toolName: n,
4659
4659
  input: o,
4660
4660
  errorText: a,
@@ -4668,7 +4668,7 @@ var Wo = (e) => {
4668
4668
  case "output-available":
4669
4669
  case "output-denied": {
4670
4670
  let e;
4671
- return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, J.jsx)(Wo, {
4671
+ return t[18] !== s || t[19] !== u || t[20] !== l || t[21] !== o || t[22] !== m || t[23] !== i || t[24] !== r || t[25] !== n ? (e = /* @__PURE__ */ (0, q.jsx)(Wo, {
4672
4672
  toolName: n,
4673
4673
  state: r,
4674
4674
  input: o,
@@ -4679,12 +4679,12 @@ var Wo = (e) => {
4679
4679
  isActive: m
4680
4680
  }), t[18] = s, t[19] = u, t[20] = l, t[21] = o, t[22] = m, t[23] = i, t[24] = r, t[25] = n, t[26] = e) : e = t[26], e;
4681
4681
  }
4682
- default: return Oe(r), null;
4682
+ default: return ke(r), null;
4683
4683
  }
4684
4684
  }, qo = ({ message: e, isStreamingReasoning: t, isLast: n, isActive: i, addToolApprovalResponse: a }) => {
4685
- return /* @__PURE__ */ (0, J.jsx)(J.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4685
+ return /* @__PURE__ */ (0, q.jsx)(q.Fragment, { children: e.parts.map((e, t) => o(e, t)) });
4686
4686
  function o(o, s) {
4687
- if (Jo(o)) return /* @__PURE__ */ (0, J.jsx)(Ko, {
4687
+ if (Jo(o)) return /* @__PURE__ */ (0, q.jsx)(Ko, {
4688
4688
  index: s,
4689
4689
  toolName: o.type,
4690
4690
  result: o.output,
@@ -4699,19 +4699,19 @@ var Wo = (e) => {
4699
4699
  }, s);
4700
4700
  if (Yo(o)) return r.debug("Found data part", o), null;
4701
4701
  switch (o.type) {
4702
- case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, J.jsx)(q.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, J.jsx)(O, { content: o.text }, s);
4703
- case "reasoning": return /* @__PURE__ */ (0, J.jsx)(ko, {
4702
+ case "text": return o.text.includes("<marimo-") ? /* @__PURE__ */ (0, q.jsx)(K.Fragment, { children: u({ html: o.text }) }, s) : /* @__PURE__ */ (0, q.jsx)(O, { content: o.text }, s);
4703
+ case "reasoning": return /* @__PURE__ */ (0, q.jsx)(ko, {
4704
4704
  reasoning: o.text,
4705
4705
  index: s,
4706
4706
  isStreaming: t && n && s === (e.parts.length || 0) - 1
4707
4707
  }, s);
4708
- case "file": return /* @__PURE__ */ (0, J.jsx)(Do, { attachment: o }, s);
4709
- case "reasoning-file": return /* @__PURE__ */ (0, J.jsx)(Do, { attachment: {
4708
+ case "file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: o }, s);
4709
+ case "reasoning-file": return /* @__PURE__ */ (0, q.jsx)(Do, { attachment: {
4710
4710
  type: "file",
4711
4711
  mediaType: o.mediaType,
4712
4712
  url: o.url
4713
4713
  } }, s);
4714
- case "dynamic-tool": return /* @__PURE__ */ (0, J.jsx)(Ko, {
4714
+ case "dynamic-tool": return /* @__PURE__ */ (0, q.jsx)(Ko, {
4715
4715
  toolName: o.toolName,
4716
4716
  result: o.output,
4717
4717
  errorText: o.state === "output-error" ? o.errorText : void 0,
@@ -4722,23 +4722,23 @@ var Wo = (e) => {
4722
4722
  isLive: n,
4723
4723
  isActive: i
4724
4724
  }, s);
4725
- case "source-document": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4726
- icon: /* @__PURE__ */ (0, J.jsx)(we, { className: "h-3 w-3 shrink-0" }),
4725
+ case "source-document": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4726
+ icon: /* @__PURE__ */ (0, q.jsx)(ye, { className: "h-3 w-3 shrink-0" }),
4727
4727
  title: o.title,
4728
4728
  subtitle: o.filename
4729
4729
  }, s);
4730
- case "source-url": return /* @__PURE__ */ (0, J.jsx)(Oo, {
4731
- icon: /* @__PURE__ */ (0, J.jsx)(fe, { className: "h-3 w-3 shrink-0" }),
4730
+ case "source-url": return /* @__PURE__ */ (0, q.jsx)(Oo, {
4731
+ icon: /* @__PURE__ */ (0, q.jsx)(me, { className: "h-3 w-3 shrink-0" }),
4732
4732
  title: o.title ?? o.url,
4733
4733
  subtitle: o.title ? o.url : void 0,
4734
4734
  href: o.url
4735
4735
  }, s);
4736
- case "custom": return /* @__PURE__ */ (0, J.jsx)("div", {
4736
+ case "custom": return /* @__PURE__ */ (0, q.jsx)("div", {
4737
4737
  className: "text-sm text-muted-foreground",
4738
4738
  children: o.kind
4739
4739
  }, s);
4740
4740
  case "step-start": return null;
4741
- default: return Oe(o), null;
4741
+ default: return ke(o), null;
4742
4742
  }
4743
4743
  }
4744
4744
  };
@@ -4751,11 +4751,11 @@ function Yo(e) {
4751
4751
  //#endregion
4752
4752
  //#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
4753
4753
  function Xo(e) {
4754
- return yt.define({ combine: (t) => t[0] ?? e });
4754
+ return bt.define({ combine: (t) => t[0] ?? e });
4755
4755
  }
4756
4756
  //#endregion
4757
4757
  //#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
4758
- var Zo = Xo({}), Qo = xt.define(), $o = xt.define(), es = 50, ts = kt.define({
4758
+ var Zo = Xo({}), Qo = St.define(), $o = St.define(), es = 50, ts = At.define({
4759
4759
  create() {
4760
4760
  return {
4761
4761
  prompts: [],
@@ -4814,7 +4814,7 @@ function is(e = {}) {
4814
4814
  navigationIndex: -1,
4815
4815
  originalText: ""
4816
4816
  })), Zo.of(t ?? {})];
4817
- return n && r.push(wt.of([{
4817
+ return n && r.push(Tt.of([{
4818
4818
  key: "ArrowUp",
4819
4819
  run: ns
4820
4820
  }, {
@@ -4823,8 +4823,8 @@ function is(e = {}) {
4823
4823
  }])), r;
4824
4824
  }
4825
4825
  //#endregion
4826
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4827
- var as = xt.define(), Q = kt.define({
4826
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/state.js
4827
+ var as = St.define(), Q = At.define({
4828
4828
  create() {
4829
4829
  return /* @__PURE__ */ new Map();
4830
4830
  },
@@ -4836,7 +4836,7 @@ var as = xt.define(), Q = kt.define({
4836
4836
  }
4837
4837
  return r;
4838
4838
  }
4839
- }), os = kt.define({
4839
+ }), os = At.define({
4840
4840
  create() {
4841
4841
  return {
4842
4842
  onResourceClick: void 0,
@@ -4848,8 +4848,8 @@ var as = xt.define(), Q = kt.define({
4848
4848
  update(e) {
4849
4849
  return e;
4850
4850
  }
4851
- }), ss = xt.define();
4852
- kt.define({
4851
+ }), ss = St.define();
4852
+ At.define({
4853
4853
  create() {
4854
4854
  return /* @__PURE__ */ new Map();
4855
4855
  },
@@ -4863,7 +4863,7 @@ kt.define({
4863
4863
  }
4864
4864
  });
4865
4865
  //#endregion
4866
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4866
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/completion.js
4867
4867
  var cs = (e, t) => async (n) => {
4868
4868
  let r = n.matchBefore(/@(\w+)?/);
4869
4869
  if (!r || r.from === r.to && !n.explicit) return null;
@@ -4896,8 +4896,8 @@ function $(e) {
4896
4896
  return e.matchAll(new RegExp(ls.source, "g"));
4897
4897
  }
4898
4898
  //#endregion
4899
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4900
- var us = class extends Dt {
4899
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/decoration.js
4900
+ var us = class extends Ot {
4901
4901
  resource;
4902
4902
  view;
4903
4903
  constructor(e, t) {
@@ -4918,7 +4918,7 @@ var us = class extends Dt {
4918
4918
  e.preventDefault(), e.stopPropagation(), i(this.resource);
4919
4919
  }), e;
4920
4920
  }
4921
- }, ds = class extends Dt {
4921
+ }, ds = class extends Ot {
4922
4922
  uri;
4923
4923
  view;
4924
4924
  constructor(e, t) {
@@ -4938,12 +4938,12 @@ function fs(e) {
4938
4938
  let a = e.state.doc.sliceString(r, i);
4939
4939
  for (let i of $(a)) {
4940
4940
  let a = r + i.index, o = i[0].slice(1), s = t.get(o);
4941
- s ? n.push(Ct.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(Ct.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4941
+ s ? n.push(wt.replace({ widget: new us(s, e) }).range(a, a + i[0].length)) : n.push(wt.replace({ widget: new ds(o, e) }).range(a, a + i[0].length));
4942
4942
  }
4943
4943
  }
4944
- return Ct.set(n);
4944
+ return wt.set(n);
4945
4945
  }
4946
- var ps = Ot.fromClass(class {
4946
+ var ps = kt.fromClass(class {
4947
4947
  decorations;
4948
4948
  constructor(e) {
4949
4949
  this.decorations = fs(e);
@@ -4953,7 +4953,7 @@ var ps = Ot.fromClass(class {
4953
4953
  }
4954
4954
  }, { decorations: (e) => e.decorations });
4955
4955
  //#endregion
4956
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
4956
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/hover.js
4957
4957
  function ms(e) {
4958
4958
  let t = document.createElement("div");
4959
4959
  t.className = "cm-tooltip-cursor";
@@ -4983,7 +4983,7 @@ function hs(e, t, n, r = 0) {
4983
4983
  return null;
4984
4984
  }
4985
4985
  function gs(e) {
4986
- return Et((t, n) => {
4986
+ return Dt((t, n) => {
4987
4987
  let { from: r, text: i } = t.state.doc.lineAt(n), a = hs(i, n, t.state.field(Q), r);
4988
4988
  return a ? {
4989
4989
  pos: a.start,
@@ -4996,7 +4996,7 @@ function gs(e) {
4996
4996
  });
4997
4997
  }
4998
4998
  //#endregion
4999
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
4999
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/resources/input-filter.js
5000
5000
  function _s(e, t) {
5001
5001
  let n = e.field(Q), r = e.doc, i = r.lineAt(t), a = r.sliceString(i.from, i.to), o = Array.from($(a));
5002
5002
  if (o.length === 0) return null;
@@ -5053,8 +5053,8 @@ function xs(e, t) {
5053
5053
  }
5054
5054
  return null;
5055
5055
  }
5056
- var Ss = Tt.transactionFilter.of((e) => {
5057
- let t = e.annotation(St.userEvent);
5056
+ var Ss = Et.transactionFilter.of((e) => {
5057
+ let t = e.annotation(Ct.userEvent);
5058
5058
  if (!t) return e;
5059
5059
  let n = e.startState.selection.main;
5060
5060
  if (!n.empty) return e;
@@ -5236,11 +5236,11 @@ function Os(e, t) {
5236
5236
  };
5237
5237
  }
5238
5238
  function ks(e, t = {}) {
5239
- return Ot.fromClass(Os(e, t));
5239
+ return kt.fromClass(Os(e, t));
5240
5240
  }
5241
5241
  //#endregion
5242
- //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_153f5a1a0b175f1cd794f4fb73845d3a/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5243
- var As = vt.baseTheme({
5242
+ //#region ../node_modules/.pnpm/@marimo-team+codemirror-mcp@0.1.7_@codemirror+autocomplete@6.20.3_@codemirror+state@6.7_6b342e94e942eed410acc909cdad6bca/node_modules/@marimo-team/codemirror-mcp/dist/theme.js
5243
+ var As = yt.baseTheme({
5244
5244
  ".cm-resource-widget": {
5245
5245
  background: "light-dark(rgba(86,156,214,0.08),rgba(86,156,214,0.18))",
5246
5246
  borderRadius: "4px",
@@ -5273,10 +5273,10 @@ function Fs(e) {
5273
5273
  let { language: t, store: n, onAddFiles: i } = e, a = () => Ps(n);
5274
5274
  return [
5275
5275
  t.data.of({ autocomplete: cs(async () => a(), (e) => e.type === js ? Ns : So(n).getProvider(e.type)?.formatCompletion(e) || {}) }),
5276
- bt.high(wt.of([{
5276
+ xt.high(Tt.of([{
5277
5277
  key: "Tab",
5278
5278
  preventDefault: !0,
5279
- run: (e) => jt(e)
5279
+ run: (e) => Mt(e)
5280
5280
  }])),
5281
5281
  _o.of({ addAttachment: (e) => i?.([e]) }),
5282
5282
  ...i ? [t.data.of({ autocomplete: Co().createCompletionSource() })] : [],
@@ -5303,14 +5303,14 @@ function Is(e) {
5303
5303
  let t = document.createElement("div");
5304
5304
  return t.innerHTML = e, { dom: t };
5305
5305
  }
5306
- Se("marimo:ai-language", "python", de);
5307
- var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) => {
5308
- let t = (0, N.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = gt(), { theme: _ } = _t(), v;
5306
+ he("marimo:ai-language", "python", we);
5307
+ var Ls = "marimo:ai-prompt-history", Rs = new ce(rt(Ze()), () => []), zs = (e) => {
5308
+ let t = (0, M.c)(35), { value: n, placeholder: r, inputRef: a, className: o, onChange: s, onSubmit: c, onKeyDown: l, onClose: u, onAddFiles: d, additionalCompletions: f, maxHeight: p } = e, m = c, h = u, g = _t(), { theme: _ } = vt(), v;
5309
5309
  t[0] === f ? v = t[1] : (v = (e) => f ? wo([f.triggerCompletionRegex], f.completions)(e) : null, t[0] = f, t[1] = v);
5310
- let y = ht(v), b, x, S, C;
5310
+ let y = gt(v), b, x, S, C;
5311
5311
  if (t[2] !== y || t[3] !== d || t[4] !== g) {
5312
- let e = Pt();
5313
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Nt({}), t[9] = b) : b = t[9], x = e, S = Fs({
5312
+ let e = Ft();
5313
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (b = Pt({}), t[9] = b) : b = t[9], x = e, S = Fs({
5314
5314
  language: e.language,
5315
5315
  store: g,
5316
5316
  onAddFiles: d
@@ -5322,9 +5322,9 @@ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) =
5322
5322
  save: Vs
5323
5323
  } }), t[10] = w) : w = t[10];
5324
5324
  let T;
5325
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = Ft(), t[11] = T) : T = t[11];
5325
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (T = It(), t[11] = T) : T = t[11];
5326
5326
  let E;
5327
- t[12] === m ? E = t[13] : (E = bt.highest(wt.of([{
5327
+ t[12] === m ? E = t[13] : (E = xt.highest(Tt.of([{
5328
5328
  preventDefault: !0,
5329
5329
  stopPropagation: !0,
5330
5330
  any: (e, t) => {
@@ -5348,7 +5348,7 @@ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) =
5348
5348
  }
5349
5349
  }])), t[12] = m, t[13] = E);
5350
5350
  let D;
5351
- t[14] === h ? D = t[15] : (D = wt.of([{
5351
+ t[14] === h ? D = t[15] : (D = Tt.of([{
5352
5352
  key: "Escape",
5353
5353
  preventDefault: !0,
5354
5354
  stopPropagation: !0,
@@ -5361,15 +5361,15 @@ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) =
5361
5361
  S,
5362
5362
  C,
5363
5363
  w,
5364
- vt.lineWrapping,
5364
+ yt.lineWrapping,
5365
5365
  T,
5366
5366
  E,
5367
5367
  D
5368
5368
  ], t[16] = b, t[17] = x, t[18] = S, t[19] = C, t[20] = E, t[21] = D, t[22] = O) : O = t[22];
5369
5369
  let k = O, A;
5370
5370
  t[23] === o ? A = t[24] : (A = i("flex-1 font-sans overflow-auto my-1", o), t[23] = o, t[24] = A);
5371
- let ee = _ === "dark" ? "dark" : "light", j = r || "Generate with AI, @ to include context", te;
5372
- return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== j || t[33] !== n ? (te = /* @__PURE__ */ (0, J.jsx)(It, {
5371
+ let ee = _ === "dark" ? "dark" : "light", te = r || "Generate with AI, @ to include context", ne;
5372
+ return t[25] !== k || t[26] !== a || t[27] !== p || t[28] !== s || t[29] !== l || t[30] !== A || t[31] !== ee || t[32] !== te || t[33] !== n ? (ne = /* @__PURE__ */ (0, q.jsx)(Lt, {
5373
5373
  ref: a,
5374
5374
  className: A,
5375
5375
  width: "100%",
@@ -5380,8 +5380,8 @@ var Ls = "marimo:ai-prompt-history", Rs = new se(nt(Xe()), () => []), zs = (e) =
5380
5380
  onChange: s,
5381
5381
  onKeyDown: l,
5382
5382
  theme: ee,
5383
- placeholder: j
5384
- }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = j, t[33] = n, t[34] = te) : te = t[34], te;
5383
+ placeholder: te
5384
+ }), t[25] = k, t[26] = a, t[27] = p, t[28] = s, t[29] = l, t[30] = A, t[31] = ee, t[32] = te, t[33] = n, t[34] = ne) : ne = t[34], ne;
5385
5385
  };
5386
5386
  function Bs() {
5387
5387
  return Rs.get(Ls);
@@ -5391,11 +5391,11 @@ function Vs(e) {
5391
5391
  }
5392
5392
  //#endregion
5393
5393
  //#region src/plugins/impl/chat/chat-ui.tsx
5394
- var Hs = f, Us = Qe({
5395
- type: Je("stream_chunk"),
5396
- message_id: Xe(),
5397
- content: lt().nullable().transform((e) => e),
5398
- is_final: qe().optional()
5394
+ var Hs = f, Us = $e({
5395
+ type: Ye("stream_chunk"),
5396
+ message_id: Ze(),
5397
+ content: ut().nullable().transform((e) => e),
5398
+ is_final: Je().optional()
5399
5399
  });
5400
5400
  function Ws(e, t) {
5401
5401
  let { controllerRef: n, activeRequestIdRef: i } = t, a = n.current;
@@ -5407,15 +5407,15 @@ function Ws(e, t) {
5407
5407
  }), "dropped-stale") : (e.content && a.enqueue(e.content), e.is_final ? (a.close(), n.current = null, i.current = null, "closed") : "enqueued");
5408
5408
  }
5409
5409
  var Gs = (e) => {
5410
- let [t, o] = (0, q.useState)(""), [s, c] = (0, q.useState)(e.config), [u, d] = (0, q.useState)(e.config), [f, p] = (0, q.useState)(void 0), h = (0, q.useRef)(null), g = (0, q.useRef)(null), _ = (0, q.useRef)(null), v = (0, q.useRef)(null);
5410
+ let [t, o] = (0, K.useState)(""), [s, c] = (0, K.useState)(e.config), [u, d] = (0, K.useState)(e.config), [f, p] = (0, K.useState)(void 0), h = (0, K.useRef)(null), g = (0, K.useRef)(null), _ = (0, K.useRef)(null), v = (0, K.useRef)(null);
5411
5411
  Object.keys(e.config).some((t) => e.config[t] !== u[t]) && (c(e.config), d(e.config));
5412
- let y = (0, q.useRef)(s);
5412
+ let y = (0, K.useRef)(s);
5413
5413
  y.current = s;
5414
- let b = (0, q.useRef)(null), x = (0, q.useRef)(null), S = (0, q.useRef)(null), [C, w] = (0, q.useState)(null), T = () => {
5414
+ let b = (0, K.useRef)(null), x = (0, K.useRef)(null), S = (0, K.useRef)(null), [C, w] = (0, K.useState)(null), T = () => {
5415
5415
  S.current = null, w(null);
5416
- }, { data: D } = Lt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: j, stop: te, error: M, regenerate: re, clearError: ie, addToolApprovalResponse: ae } = eo({
5416
+ }, { data: D } = Rt(async () => (await e.get_chat_history({})).messages, []), O = e.value.length > 0 ? e.value : D, { messages: k, sendMessage: A, setMessages: ee, status: te, stop: ne, error: j, regenerate: ie, clearError: ae, addToolApprovalResponse: oe } = eo({
5417
5417
  sendAutomaticallyWhen: ({ messages: e }) => Eo(e),
5418
- transport: new Na({ fetch: async (t, n) => {
5418
+ transport: new Pa({ fetch: async (t, n) => {
5419
5419
  if (n === void 0) return fetch(t);
5420
5420
  let i = JSON.parse(n.body), a = n.signal, o = {
5421
5421
  max_tokens: y.current.max_tokens,
@@ -5429,7 +5429,7 @@ var Gs = (e) => {
5429
5429
  let t = i.messages.map((e) => ({
5430
5430
  ...e,
5431
5431
  content: e.parts?.map((e) => "text" in e ? e.text : "").join("\n")
5432
- })), n = _e();
5432
+ })), n = Ce();
5433
5433
  T();
5434
5434
  let s = new ReadableStream({
5435
5435
  start(t) {
@@ -5458,7 +5458,7 @@ var Gs = (e) => {
5458
5458
  config: o
5459
5459
  }).catch((e) => {
5460
5460
  b.current?.error(e), b.current = null, x.current = null;
5461
- }), ma({ stream: s });
5461
+ }), ha({ stream: s });
5462
5462
  } catch (e) {
5463
5463
  if (e instanceof Error && e.name === "AbortError") return new Response("Aborted", { status: 499 });
5464
5464
  let t = e.message?.split("failed with exception ").pop();
@@ -5489,7 +5489,7 @@ var Gs = (e) => {
5489
5489
  r.error("An error occurred:", e);
5490
5490
  }
5491
5491
  });
5492
- n(e.host, Ve.TYPE, (e) => {
5492
+ n(e.host, He.TYPE, (e) => {
5493
5493
  let t = Us.safeParse(e.detail.message);
5494
5494
  if (t.success) {
5495
5495
  if (t.data.content && t.data.message_id === x.current) {
@@ -5502,30 +5502,30 @@ var Gs = (e) => {
5502
5502
  });
5503
5503
  }
5504
5504
  });
5505
- let oe = j === "submitted" || j === "streaming", se = (t) => {
5505
+ let se = te === "submitted" || te === "streaming", ce = (t) => {
5506
5506
  let n = k.findIndex((e) => e.id === t);
5507
5507
  if (n !== -1) {
5508
5508
  let r = k.filter((e) => e.id !== t);
5509
5509
  e.delete_chat_message({ index: n }), ee(r), e.setValue(r), r.length === 0 && T();
5510
5510
  }
5511
- }, ce = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, le = {
5511
+ }, le = Array.isArray(e.allowAttachments) && e.allowAttachments.length > 0 || e.allowAttachments === !0, ue = {
5512
5512
  triggerCompletionRegex: /^\/(\w+)?/,
5513
5513
  completions: e.prompts.map((e) => ({
5514
5514
  label: `/${e}`,
5515
5515
  displayLabel: e,
5516
5516
  apply: e
5517
5517
  }))
5518
- }, ue = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5519
- (0, q.useEffect)(() => {
5518
+ }, de = e.prompts.length > 0 ? "Type your message here, / for prompts" : "Type your message here...";
5519
+ (0, K.useEffect)(() => {
5520
5520
  v.current?.scrollTo({
5521
5521
  top: v.current.scrollHeight,
5522
5522
  behavior: "smooth"
5523
5523
  });
5524
5524
  }, [k.length, v]);
5525
- let de = _.current?.view, fe = () => {
5526
- if (de) {
5527
- let e = de.state.doc.length;
5528
- de.dispatch({ changes: {
5525
+ let fe = _.current?.view, pe = () => {
5526
+ if (fe) {
5527
+ let e = fe.state.doc.length;
5528
+ fe.dispatch({ changes: {
5529
5529
  from: 0,
5530
5530
  to: e,
5531
5531
  insert: ""
@@ -5533,35 +5533,35 @@ var Gs = (e) => {
5533
5533
  }
5534
5534
  o("");
5535
5535
  };
5536
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5536
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5537
5537
  className: "flex flex-col h-full bg-(--slate-1) rounded-lg shadow border border-(--slate-6) overflow-hidden relative",
5538
5538
  style: { maxHeight: e.maxHeight },
5539
5539
  children: [
5540
- /* @__PURE__ */ (0, J.jsx)("div", {
5540
+ /* @__PURE__ */ (0, q.jsx)("div", {
5541
5541
  className: "absolute top-0 right-0 flex justify-end z-10 border border-(--slate-6) bg-inherit rounded-bl-lg",
5542
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5542
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5543
5543
  variant: "text",
5544
5544
  size: "icon",
5545
5545
  disabled: k.length === 0,
5546
5546
  onClick: () => {
5547
- ee([]), e.setValue([]), e.delete_chat_history({}), ie(), T();
5547
+ ee([]), e.setValue([]), e.delete_chat_history({}), ae(), T();
5548
5548
  },
5549
- children: /* @__PURE__ */ (0, J.jsx)(Ut, { className: "h-3 w-3" })
5549
+ children: /* @__PURE__ */ (0, q.jsx)(Wt, { className: "h-3 w-3" })
5550
5550
  })
5551
5551
  }),
5552
- /* @__PURE__ */ (0, J.jsxs)("div", {
5552
+ /* @__PURE__ */ (0, q.jsxs)("div", {
5553
5553
  className: "grow overflow-y-auto gap-4 pt-8 pb-4 px-2 flex flex-col",
5554
5554
  ref: v,
5555
5555
  children: [
5556
- k.length === 0 && /* @__PURE__ */ (0, J.jsxs)("div", {
5556
+ k.length === 0 && /* @__PURE__ */ (0, q.jsxs)("div", {
5557
5557
  className: "flex flex-col items-center justify-center h-full text-muted-foreground text-center p-4",
5558
5558
  children: [
5559
- /* @__PURE__ */ (0, J.jsx)(zt, { className: "h-12 w-12 mb-4" }),
5560
- /* @__PURE__ */ (0, J.jsx)("h3", {
5559
+ /* @__PURE__ */ (0, q.jsx)(Bt, { className: "h-12 w-12 mb-4" }),
5560
+ /* @__PURE__ */ (0, q.jsx)("h3", {
5561
5561
  className: "text-lg font-semibold mb-2",
5562
5562
  children: "No messages yet"
5563
5563
  }),
5564
- /* @__PURE__ */ (0, J.jsx)("p", {
5564
+ /* @__PURE__ */ (0, q.jsx)("p", {
5565
5565
  className: "text-sm",
5566
5566
  children: "Start a conversation by typing a message below."
5567
5567
  })
@@ -5569,55 +5569,55 @@ var Gs = (e) => {
5569
5569
  }),
5570
5570
  k.map((e, t) => {
5571
5571
  let n = e.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n"), r = t === k.length - 1;
5572
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5572
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5573
5573
  className: i("flex flex-col group gap-2", e.role === "user" ? "items-end" : "items-start"),
5574
- children: [/* @__PURE__ */ (0, J.jsx)("div", {
5574
+ children: [/* @__PURE__ */ (0, q.jsx)("div", {
5575
5575
  className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-(--sky-11) text-(--slate-1) whitespace-pre-wrap" : "bg-(--slate-4) text-(--slate-12)"}`,
5576
5576
  children: qo({
5577
5577
  message: e,
5578
- isStreamingReasoning: j === "streaming",
5578
+ isStreamingReasoning: te === "streaming",
5579
5579
  isLast: r,
5580
- isActive: oe,
5581
- addToolApprovalResponse: r ? ae : void 0
5580
+ isActive: se,
5581
+ addToolApprovalResponse: r ? oe : void 0
5582
5582
  })
5583
- }), /* @__PURE__ */ (0, J.jsxs)("div", {
5583
+ }), /* @__PURE__ */ (0, q.jsxs)("div", {
5584
5584
  className: "flex justify-end text-xs gap-2 invisible group-hover:visible",
5585
- children: [/* @__PURE__ */ (0, J.jsx)(l, {
5585
+ children: [/* @__PURE__ */ (0, q.jsx)(l, {
5586
5586
  value: n,
5587
5587
  className: "h-3 w-3",
5588
5588
  buttonClassName: "text-xs text-(--slate-9) hover:text-(--slate-11)"
5589
- }), /* @__PURE__ */ (0, J.jsx)("button", {
5589
+ }), /* @__PURE__ */ (0, q.jsx)("button", {
5590
5590
  type: "button",
5591
- onClick: () => se(e.id),
5591
+ onClick: () => ce(e.id),
5592
5592
  className: "text-xs text-(--slate-9) hover:text-(--slate-11)",
5593
- children: /* @__PURE__ */ (0, J.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5593
+ children: /* @__PURE__ */ (0, q.jsx)(m, { className: "h-3 w-3 text-(--red-9)" })
5594
5594
  })]
5595
5595
  })]
5596
5596
  }, `${e.id}-${t}`);
5597
5597
  }),
5598
- oe && /* @__PURE__ */ (0, J.jsx)("div", {
5598
+ se && /* @__PURE__ */ (0, q.jsx)("div", {
5599
5599
  className: "flex items-center justify-center mb-4",
5600
- children: /* @__PURE__ */ (0, J.jsx)(E, { size: "small" })
5600
+ children: /* @__PURE__ */ (0, q.jsx)(E, { size: "small" })
5601
5601
  }),
5602
- M && /* @__PURE__ */ (0, J.jsxs)("div", {
5602
+ j && /* @__PURE__ */ (0, q.jsxs)("div", {
5603
5603
  className: "flex items-center justify-center space-x-2 mb-4",
5604
- children: [/* @__PURE__ */ (0, J.jsx)(ft, { error: M }), /* @__PURE__ */ (0, J.jsx)(a, {
5604
+ children: [/* @__PURE__ */ (0, q.jsx)(pt, { error: j }), /* @__PURE__ */ (0, q.jsx)(a, {
5605
5605
  variant: "outline",
5606
5606
  size: "sm",
5607
- onClick: () => re(),
5607
+ onClick: () => ie(),
5608
5608
  children: "Retry"
5609
5609
  })]
5610
5610
  }),
5611
- C && !oe && !M && /* @__PURE__ */ (0, J.jsx)("div", {
5611
+ C && !se && !j && /* @__PURE__ */ (0, q.jsx)("div", {
5612
5612
  className: "flex justify-center py-2",
5613
- children: /* @__PURE__ */ (0, J.jsx)("span", {
5613
+ children: /* @__PURE__ */ (0, q.jsx)("span", {
5614
5614
  className: "text-xs text-muted-foreground",
5615
5615
  children: C
5616
5616
  })
5617
5617
  })
5618
5618
  ]
5619
5619
  }),
5620
- /* @__PURE__ */ (0, J.jsxs)("form", {
5620
+ /* @__PURE__ */ (0, q.jsxs)("form", {
5621
5621
  onSubmit: async (n) => {
5622
5622
  if (n.preventDefault(), e.disabled) return;
5623
5623
  let r = f ? await To(f) : void 0;
@@ -5627,27 +5627,27 @@ var Gs = (e) => {
5627
5627
  type: "text",
5628
5628
  text: t
5629
5629
  }, ...r ?? []]
5630
- }), fe();
5630
+ }), pe();
5631
5631
  },
5632
5632
  ref: g,
5633
5633
  inert: e.disabled || void 0,
5634
5634
  className: i("flex w-full border-t border-(--slate-6) px-2 py-1 items-center", e.disabled && "opacity-50 cursor-not-allowed"),
5635
5635
  children: [
5636
- e.showConfigurationControls && /* @__PURE__ */ (0, J.jsx)(qs, {
5636
+ e.showConfigurationControls && /* @__PURE__ */ (0, q.jsx)(qs, {
5637
5637
  config: s,
5638
5638
  onChange: c
5639
5639
  }),
5640
- e.prompts.length > 0 && /* @__PURE__ */ (0, J.jsx)(Js, {
5640
+ e.prompts.length > 0 && /* @__PURE__ */ (0, q.jsx)(Js, {
5641
5641
  prompts: e.prompts,
5642
5642
  onSelect: (e) => {
5643
5643
  o(e), requestAnimationFrame(() => {
5644
- de?.focus(), Ce(de);
5644
+ fe?.focus(), ge(fe);
5645
5645
  });
5646
5646
  }
5647
5647
  }),
5648
- /* @__PURE__ */ (0, J.jsx)(zs, {
5648
+ /* @__PURE__ */ (0, q.jsx)(zs, {
5649
5649
  className: "rounded-sm mr-2",
5650
- placeholder: ue,
5650
+ placeholder: de,
5651
5651
  value: t,
5652
5652
  inputRef: _,
5653
5653
  maxHeight: e.maxHeight ? `${e.maxHeight / 2}px` : void 0,
@@ -5656,34 +5656,34 @@ var Gs = (e) => {
5656
5656
  t.trim() && g.current?.requestSubmit();
5657
5657
  },
5658
5658
  onClose: () => {},
5659
- additionalCompletions: le
5659
+ additionalCompletions: ue
5660
5660
  }),
5661
- f && f.length === 1 && /* @__PURE__ */ (0, J.jsx)("span", {
5661
+ f && f.length === 1 && /* @__PURE__ */ (0, q.jsx)("span", {
5662
5662
  title: f[0].name,
5663
5663
  className: "text-sm text-(--slate-11) truncate shrink-0 w-fit max-w-24",
5664
5664
  children: f[0].name
5665
5665
  }),
5666
- f && f.length > 1 && /* @__PURE__ */ (0, J.jsxs)("span", {
5666
+ f && f.length > 1 && /* @__PURE__ */ (0, q.jsxs)("span", {
5667
5667
  title: [...f].map((e) => e.name).join("\n"),
5668
5668
  className: "text-sm text-(--slate-11) truncate shrink-0",
5669
5669
  children: [f.length, " files"]
5670
5670
  }),
5671
- f && f.length > 0 && /* @__PURE__ */ (0, J.jsx)(a, {
5671
+ f && f.length > 0 && /* @__PURE__ */ (0, q.jsx)(a, {
5672
5672
  type: "button",
5673
5673
  variant: "text",
5674
5674
  size: "sm",
5675
5675
  onClick: () => {
5676
5676
  p(void 0), h.current && (h.current.value = "");
5677
5677
  },
5678
- children: /* @__PURE__ */ (0, J.jsx)(De, { className: "size-3" })
5678
+ children: /* @__PURE__ */ (0, q.jsx)(Oe, { className: "size-3" })
5679
5679
  }),
5680
- ce && /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)(a, {
5680
+ le && /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(a, {
5681
5681
  type: "button",
5682
5682
  variant: "text",
5683
5683
  size: "sm",
5684
5684
  onClick: () => h.current?.click(),
5685
- children: /* @__PURE__ */ (0, J.jsx)(Ht, { className: "h-4" })
5686
- }), /* @__PURE__ */ (0, J.jsx)("input", {
5685
+ children: /* @__PURE__ */ (0, q.jsx)(Ut, { className: "h-4" })
5686
+ }), /* @__PURE__ */ (0, q.jsx)("input", {
5687
5687
  type: "file",
5688
5688
  ref: h,
5689
5689
  className: "hidden",
@@ -5693,24 +5693,24 @@ var Gs = (e) => {
5693
5693
  e.target.files && p([...e.target.files]);
5694
5694
  }
5695
5695
  })] }),
5696
- oe ? /* @__PURE__ */ (0, J.jsx)(ne, {
5696
+ se ? /* @__PURE__ */ (0, q.jsx)(re, {
5697
5697
  content: "Stop generating",
5698
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5698
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5699
5699
  type: "button",
5700
5700
  variant: "link",
5701
5701
  size: "xs",
5702
- onClick: () => te(),
5702
+ onClick: () => ne(),
5703
5703
  className: "text-(--red-9) hover:text-(--red-11)",
5704
- children: /* @__PURE__ */ (0, J.jsx)(ze, { className: "h-4 w-4 fill-current" })
5704
+ children: /* @__PURE__ */ (0, q.jsx)(Be, { className: "h-4 w-4 fill-current" })
5705
5705
  })
5706
- }) : /* @__PURE__ */ (0, J.jsx)(a, {
5706
+ }) : /* @__PURE__ */ (0, q.jsx)(a, {
5707
5707
  type: "submit",
5708
5708
  disabled: !t,
5709
5709
  variant: "outline",
5710
5710
  size: "xs",
5711
5711
  className: "text-(--slate-11)",
5712
5712
  "aria-label": "Send message",
5713
- children: /* @__PURE__ */ (0, J.jsx)(Wt, { className: "h-4 w-4" })
5713
+ children: /* @__PURE__ */ (0, q.jsx)(Gt, { className: "h-4 w-4" })
5714
5714
  })
5715
5715
  ]
5716
5716
  })
@@ -5750,7 +5750,7 @@ var Gs = (e) => {
5750
5750
  description: "Penalizes new tokens (-2: favor, 2: avoid)"
5751
5751
  }
5752
5752
  }, qs = (e) => {
5753
- let t = (0, N.c)(16), { config: n, onChange: r } = e, [i, o] = (0, q.useState)(!1), s;
5753
+ let t = (0, M.c)(16), { config: n, onChange: r } = e, [i, o] = (0, K.useState)(!1), s;
5754
5754
  t[0] !== n || t[1] !== r ? (s = (e, t) => {
5755
5755
  let i = t === null || Number.isNaN(t) ? null : t;
5756
5756
  if (i !== null) {
@@ -5768,20 +5768,20 @@ var Gs = (e) => {
5768
5768
  e.key === "Enter" && (e.preventDefault(), o(!1));
5769
5769
  }, t[3] = l) : l = t[3];
5770
5770
  let u = l, f;
5771
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, J.jsx)(ne, {
5771
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ (0, q.jsx)(re, {
5772
5772
  content: "Configuration",
5773
- children: /* @__PURE__ */ (0, J.jsx)(d, {
5773
+ children: /* @__PURE__ */ (0, q.jsx)(d, {
5774
5774
  asChild: !0,
5775
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5775
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5776
5776
  variant: "outline",
5777
5777
  size: "sm",
5778
5778
  className: "border-none shadow-none hover:bg-transparent",
5779
- children: /* @__PURE__ */ (0, J.jsx)(Gt, { className: "h-3 w-3" })
5779
+ children: /* @__PURE__ */ (0, q.jsx)(Kt, { className: "h-3 w-3" })
5780
5780
  })
5781
5781
  })
5782
5782
  }), t[4] = f) : f = t[4];
5783
5783
  let m;
5784
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, J.jsx)("h4", {
5784
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, q.jsx)("h4", {
5785
5785
  className: "font-bold leading-none",
5786
5786
  children: "Configuration"
5787
5787
  }), t[5] = m) : m = t[5];
@@ -5790,21 +5790,21 @@ var Gs = (e) => {
5790
5790
  let e;
5791
5791
  t[9] === c ? e = t[10] : (e = (e) => {
5792
5792
  let [t, n] = e;
5793
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5793
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5794
5794
  className: "grid grid-cols-3 items-center gap-1",
5795
- children: [/* @__PURE__ */ (0, J.jsxs)(pt, {
5795
+ children: [/* @__PURE__ */ (0, q.jsxs)(mt, {
5796
5796
  htmlFor: t,
5797
5797
  className: "flex w-full justify-between col-span-3 align-end",
5798
- children: [Ae.startCase(t), /* @__PURE__ */ (0, J.jsx)(ne, {
5798
+ children: [je.startCase(t), /* @__PURE__ */ (0, q.jsx)(re, {
5799
5799
  delayDuration: 200,
5800
5800
  side: "top",
5801
- content: /* @__PURE__ */ (0, J.jsx)("div", {
5801
+ content: /* @__PURE__ */ (0, q.jsx)("div", {
5802
5802
  className: "text-xs flex flex-col",
5803
5803
  children: Ks[t].description
5804
5804
  }),
5805
- children: /* @__PURE__ */ (0, J.jsx)(Le, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5805
+ children: /* @__PURE__ */ (0, q.jsx)(Re, { className: "h-3 w-3 cursor-help text-muted-foreground hover:text-foreground" })
5806
5806
  })]
5807
- }), /* @__PURE__ */ (0, J.jsx)(je, {
5807
+ }), /* @__PURE__ */ (0, q.jsx)(Me, {
5808
5808
  id: t,
5809
5809
  "aria-label": t,
5810
5810
  value: n ?? NaN,
@@ -5817,51 +5817,51 @@ var Gs = (e) => {
5817
5817
  className: "col-span-3"
5818
5818
  })]
5819
5819
  }, t);
5820
- }, t[9] = c, t[10] = e), h = At.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5820
+ }, t[9] = c, t[10] = e), h = jt.entries(n).map(e), t[6] = n, t[7] = c, t[8] = h;
5821
5821
  } else h = t[8];
5822
5822
  let g;
5823
- t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, J.jsx)(p, {
5823
+ t[11] === h ? g = t[12] : (g = /* @__PURE__ */ (0, q.jsx)(p, {
5824
5824
  className: "w-70 border",
5825
- children: /* @__PURE__ */ (0, J.jsxs)("div", {
5825
+ children: /* @__PURE__ */ (0, q.jsxs)("div", {
5826
5826
  className: "grid gap-3",
5827
5827
  children: [m, h]
5828
5828
  })
5829
5829
  }), t[11] = h, t[12] = g);
5830
5830
  let _;
5831
- return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, J.jsxs)(te, {
5831
+ return t[13] !== i || t[14] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5832
5832
  open: i,
5833
5833
  onOpenChange: o,
5834
5834
  children: [f, g]
5835
5835
  }), t[13] = i, t[14] = g, t[15] = _) : _ = t[15], _;
5836
5836
  }, Js = (e) => {
5837
- let t = (0, N.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, q.useState)(!1), [s, c] = (0, q.useState)(""), l;
5837
+ let t = (0, M.c)(18), { prompts: n, onSelect: r } = e, [i, o] = (0, K.useState)(!1), [s, c] = (0, K.useState)(""), l;
5838
5838
  t[0] === r ? l = t[1] : (l = (e) => {
5839
5839
  [...e.matchAll(/{{(\w+)}}/g)].length > 0 ? (c(e), o(!0)) : r(e);
5840
5840
  }, t[0] = r, t[1] = l);
5841
5841
  let u = l, d;
5842
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, J.jsx)(ne, {
5842
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ (0, q.jsx)(re, {
5843
5843
  content: "Select a prompt",
5844
- children: /* @__PURE__ */ (0, J.jsx)(Me, {
5844
+ children: /* @__PURE__ */ (0, q.jsx)(Ne, {
5845
5845
  asChild: !0,
5846
- children: /* @__PURE__ */ (0, J.jsx)(a, {
5846
+ children: /* @__PURE__ */ (0, q.jsx)(a, {
5847
5847
  variant: "outline",
5848
5848
  size: "sm",
5849
5849
  className: "border-none shadow-none hover:bg-transparent",
5850
- children: /* @__PURE__ */ (0, J.jsx)(ee, { className: "h-3 w-3" })
5850
+ children: /* @__PURE__ */ (0, q.jsx)(ee, { className: "h-3 w-3" })
5851
5851
  })
5852
5852
  })
5853
5853
  }), t[2] = d) : d = t[2];
5854
5854
  let f;
5855
5855
  if (t[3] !== u || t[4] !== n) {
5856
5856
  let e;
5857
- t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, J.jsx)(Pe, {
5857
+ t[6] === u ? e = t[7] : (e = (e, t) => /* @__PURE__ */ (0, q.jsx)(Fe, {
5858
5858
  onSelect: () => u(e),
5859
5859
  className: "whitespace-normal text-left",
5860
5860
  children: e
5861
5861
  }, t), t[6] = u, t[7] = e), f = n.map(e), t[3] = u, t[4] = n, t[5] = f;
5862
5862
  } else f = t[5];
5863
5863
  let m;
5864
- t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, J.jsx)(Hs, { children: /* @__PURE__ */ (0, J.jsxs)(Ie, { children: [d, /* @__PURE__ */ (0, J.jsx)(Fe, {
5864
+ t[8] === f ? m = t[9] : (m = /* @__PURE__ */ (0, q.jsx)(Hs, { children: /* @__PURE__ */ (0, q.jsxs)(Le, { children: [d, /* @__PURE__ */ (0, q.jsx)(Ie, {
5865
5865
  side: "right",
5866
5866
  align: "end",
5867
5867
  onCloseAutoFocus: Xs,
@@ -5871,30 +5871,30 @@ var Gs = (e) => {
5871
5871
  let h;
5872
5872
  t[10] === Symbol.for("react.memo_cache_sentinel") ? (h = () => o(!1), t[10] = h) : h = t[10];
5873
5873
  let g;
5874
- t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, J.jsx)(p, {
5874
+ t[11] !== r || t[12] !== s ? (g = /* @__PURE__ */ (0, q.jsx)(p, {
5875
5875
  side: "right",
5876
5876
  align: "end",
5877
5877
  className: "min-w-80 px-2",
5878
- children: /* @__PURE__ */ (0, J.jsx)(Ys, {
5878
+ children: /* @__PURE__ */ (0, q.jsx)(Ys, {
5879
5879
  prompt: s,
5880
5880
  onClose: h,
5881
5881
  onSelect: r
5882
5882
  })
5883
5883
  }), t[11] = r, t[12] = s, t[13] = g) : g = t[13];
5884
5884
  let _;
5885
- return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, J.jsxs)(te, {
5885
+ return t[14] !== i || t[15] !== m || t[16] !== g ? (_ = /* @__PURE__ */ (0, q.jsxs)(ne, {
5886
5886
  open: i,
5887
5887
  onOpenChange: o,
5888
5888
  children: [m, g]
5889
5889
  }), t[14] = i, t[15] = m, t[16] = g, t[17] = _) : _ = t[17], _;
5890
5890
  }, Ys = (e) => {
5891
- let t = (0, N.c)(32), { prompt: n, onClose: r, onSelect: i } = e, o;
5891
+ let t = (0, M.c)(32), { prompt: n, onClose: r, onSelect: i } = e, o;
5892
5892
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {}, t[0] = o) : o = t[0];
5893
- let [s, c] = (0, q.useState)(o), l, u;
5893
+ let [s, c] = (0, K.useState)(o), l, u;
5894
5894
  t[1] === n ? (l = t[2], u = t[3]) : (l = () => {
5895
5895
  let e = [...n.matchAll(/{{(\w+)}}/g)].reduce(Zs, {});
5896
5896
  c(e);
5897
- }, u = [n], t[1] = n, t[2] = l, t[3] = u), (0, q.useEffect)(l, u);
5897
+ }, u = [n], t[1] = n, t[2] = l, t[3] = u), (0, K.useEffect)(l, u);
5898
5898
  let d;
5899
5899
  t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = (e, t) => {
5900
5900
  c((n) => ({
@@ -5920,13 +5920,13 @@ var Gs = (e) => {
5920
5920
  let b;
5921
5921
  t[19] !== v || t[20] !== g || t[21] !== y ? (b = y.map((e, t) => {
5922
5922
  let [n, r] = e;
5923
- return /* @__PURE__ */ (0, J.jsxs)("div", {
5923
+ return /* @__PURE__ */ (0, q.jsxs)("div", {
5924
5924
  className: "grid grid-cols-4 items-center gap-2",
5925
- children: [/* @__PURE__ */ (0, J.jsx)(pt, {
5925
+ children: [/* @__PURE__ */ (0, q.jsx)(mt, {
5926
5926
  htmlFor: n,
5927
5927
  className: "font-semibold text-base",
5928
5928
  children: n
5929
- }), /* @__PURE__ */ (0, J.jsx)(Ne, {
5929
+ }), /* @__PURE__ */ (0, q.jsx)(Pe, {
5930
5930
  id: n,
5931
5931
  value: r,
5932
5932
  onChange: (e) => f(n, e.target.value),
@@ -5941,22 +5941,22 @@ var Gs = (e) => {
5941
5941
  }, n);
5942
5942
  }), t[19] = v, t[20] = g, t[21] = y, t[22] = b) : b = t[22];
5943
5943
  let x;
5944
- t[23] === m ? x = t[24] : (x = /* @__PURE__ */ (0, J.jsx)("div", {
5944
+ t[23] === m ? x = t[24] : (x = /* @__PURE__ */ (0, q.jsx)("div", {
5945
5945
  className: "grid gap-2 prose dark:prose-invert",
5946
- children: /* @__PURE__ */ (0, J.jsx)("blockquote", {
5946
+ children: /* @__PURE__ */ (0, q.jsx)("blockquote", {
5947
5947
  className: "text-sm",
5948
5948
  children: m
5949
5949
  })
5950
5950
  }), t[23] = m, t[24] = x);
5951
5951
  let S;
5952
- t[25] !== v || t[26] !== g ? (S = /* @__PURE__ */ (0, J.jsx)(a, {
5952
+ t[25] !== v || t[26] !== g ? (S = /* @__PURE__ */ (0, q.jsx)(a, {
5953
5953
  onClick: v,
5954
5954
  size: "xs",
5955
5955
  disabled: g,
5956
5956
  children: "Submit"
5957
5957
  }), t[25] = v, t[26] = g, t[27] = S) : S = t[27];
5958
5958
  let C;
5959
- return t[28] !== x || t[29] !== S || t[30] !== b ? (C = /* @__PURE__ */ (0, J.jsxs)("div", {
5959
+ return t[28] !== x || t[29] !== S || t[30] !== b ? (C = /* @__PURE__ */ (0, q.jsxs)("div", {
5960
5960
  className: "grid gap-4",
5961
5961
  children: [
5962
5962
  b,