@marimo-team/frontend 0.23.12-dev4 → 0.23.12-dev7

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 (188) hide show
  1. package/dist/assets/{CellStatus-DWKF60ch.js → CellStatus-6opTJjMX.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-DjiALugX.js → ConnectedDataExplorerComponent-i1kaFF7n.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-YqGfStRa.js → ErrorBoundary-Bo313Z9X.js} +1 -1
  4. package/dist/assets/{ImperativeModal-_JsD8Geg.js → ImperativeModal-B62Q6S9l.js} +1 -1
  5. package/dist/assets/{Inputs-CuKU-ENz.css → Inputs-C4Oo7q-H.css} +1 -1
  6. package/dist/assets/{JsonOutput-B7vuddcd.css → JsonOutput-BQtz7-np.css} +1 -1
  7. package/dist/assets/{JsonOutput-QXW7KD7g.js → JsonOutput-CWVuEz6C.js} +3 -3
  8. package/dist/assets/{LazyAnyLanguageCodeMirror-BqPfvXlM.js → LazyAnyLanguageCodeMirror-CsAMDSIw.js} +2 -2
  9. package/dist/assets/{MarimoErrorOutput-CbSSWhjw.js → MarimoErrorOutput-dYrcxVwq.js} +2 -2
  10. package/dist/assets/{RSPContexts-B9yuKjdT.js → RSPContexts-VzcTZjG1.js} +1 -1
  11. package/dist/assets/{RenderHTML-B283s7MJ.js → RenderHTML-ohul2q99.js} +1 -1
  12. package/dist/assets/{RunButton-C_19zU-4.js → RunButton-BMpP08P_.js} +1 -1
  13. package/dist/assets/{add-cell-with-ai-63FLemQ6.js → add-cell-with-ai-5tJjrFh0.js} +1 -1
  14. package/dist/assets/{add-connection-dialog-Bv2XA3ka.js → add-connection-dialog-pVExi7gB.js} +1 -1
  15. package/dist/assets/{agent-panel-7V3dGxQ5.js → agent-panel-By97CFFK.js} +5 -5
  16. package/dist/assets/{ai-model-dropdown-C6gk2SxA.js → ai-model-dropdown-Dvmxl0HU.js} +4 -4
  17. package/dist/assets/alert-1y_DnRWn.js +1 -0
  18. package/dist/assets/{alert-dialog-Dj7YzzBi.js → alert-dialog-CC0gG4Av.js} +1 -1
  19. package/dist/assets/{any-language-editor-DadY-3pz.js → any-language-editor-F2HBwXr3.js} +1 -1
  20. package/dist/assets/{app-config-button-CC-L3J3r.js → app-config-button-BB5z7_FE.js} +1 -1
  21. package/dist/assets/{button-DuHyjdW2.js → button-BF7GSjhW.js} +1 -1
  22. package/dist/assets/{cache-panel-BHYMMbEc.js → cache-panel-BlIrcwlT.js} +1 -1
  23. package/dist/assets/{capabilities-ClLgkhPb.js → capabilities-CjNGDxxx.js} +1 -1
  24. package/dist/assets/{cell-editor-b-XUcy_0.js → cell-editor-DQKaGrC9.js} +2 -2
  25. package/dist/assets/cell-editor-_cVIHMNI.css +2 -0
  26. package/dist/assets/{cell-link-CltAZE6t.js → cell-link-DBKqdVgo.js} +1 -1
  27. package/dist/assets/{cells-pu5xzE_v.css → cells-BVzo2MHf.css} +2 -2
  28. package/dist/assets/{cells-CHWMpikY.js → cells-DiASVTIh.js} +20 -20
  29. package/dist/assets/{chat-display-0upQ9ApT.js → chat-display-D8X6vz7W.js} +1 -1
  30. package/dist/assets/{chat-panel-C3iqwnxV.js → chat-panel-B9l3ukjX.js} +1 -1
  31. package/dist/assets/{chat-ui-CG7BMZQT.js → chat-ui-BwH7dd6n.js} +1 -1
  32. package/dist/assets/{column-preview-DPRIVh2U.js → column-preview-B3CdpsbL.js} +1 -1
  33. package/dist/assets/{command-emRtRCMn.js → command-DRHbYHUP.js} +1 -1
  34. package/dist/assets/{command-palette-J0bFdD9g.js → command-palette-D2BHtSuk.js} +1 -1
  35. package/dist/assets/{common-YBBQumDk.js → common-CvUUt55g.js} +1 -1
  36. package/dist/assets/{components-DBOw-EPg.js → components-CimBDpZ8.js} +1 -1
  37. package/dist/assets/{config-6vnnoRNy.js → config-3clPIEB9.js} +1 -1
  38. package/dist/assets/{copy-C_iQKqnH.js → copy-D8MtpXgN.js} +1 -1
  39. package/dist/assets/{copy-icon-CeGeeBdW.js → copy-icon-EHMT-qlr.js} +1 -1
  40. package/dist/assets/{createReducer-CzbhqMat.js → createReducer-3wF4dU7I.js} +1 -1
  41. package/dist/assets/{datasource-C6_8-viy.js → datasource-Da-qoi34.js} +1 -1
  42. package/dist/assets/{dates-C61OL-dM.js → dates-D8uxHHPL.js} +1 -1
  43. package/dist/assets/{dependency-graph-panel-D83-WLVK.js → dependency-graph-panel-CMjZH8W-.js} +2 -2
  44. package/dist/assets/{dialog-HQS6OqZN.js → dialog-DkJmIrsG.js} +1 -1
  45. package/dist/assets/{dist-C3166O2z.js → dist-DCqDlsgq.js} +1 -1
  46. package/dist/assets/{documentation-panel-DTnM09IC.js → documentation-panel-BS_uG8hW.js} +1 -1
  47. package/dist/assets/{download-Ct_TgW5r.js → download-CdS_EveB.js} +1 -1
  48. package/dist/assets/{dropdown-menu-ItqBTuc3.js → dropdown-menu-DfGLyCbP.js} +1 -1
  49. package/dist/assets/{edit-page-CRS0yn99.js → edit-page-DanoliKk.js} +6 -6
  50. package/dist/assets/empty-state-QmmE2oN4.js +1 -0
  51. package/dist/assets/{error-banner-Ct1mv9wE.js → error-banner-BSQVN46J.js} +1 -1
  52. package/dist/assets/{error-panel-DLrrxrpE.js → error-panel-Csh1BgrG.js} +1 -1
  53. package/dist/assets/{es-D70Vphlx.js → es-EItoYvXh.js} +1 -1
  54. package/dist/assets/{field-tn87_E9F.js → field-DlNY-dDH.js} +1 -1
  55. package/dist/assets/{file-explorer-panel-C4On50ex.js → file-explorer-panel--h0xwnRB.js} +1 -1
  56. package/dist/assets/{file-icons-CYkhl3GL.js → file-icons-D6BjDFSV.js} +1 -1
  57. package/dist/assets/{file-name-input-ChsdEroc.js → file-name-input-CsUxNFtr.js} +1 -1
  58. package/dist/assets/{floating-outline-BYOWegDI.js → floating-outline-D2cwxR8Z.js} +1 -1
  59. package/dist/assets/{focus-D5qOsUgK.js → focus-BvvRVcVF.js} +1 -1
  60. package/dist/assets/{form-DeUXsgGH.js → form-CO925gWV.js} +1 -1
  61. package/dist/assets/{formats-CBt24TWP.js → formats-ZGU43GQU.js} +1 -1
  62. package/dist/assets/{formatting-eWiw-Q8f.js → formatting-DhA_x3cD.js} +1 -1
  63. package/dist/assets/{fullscreen-BWhrFYLX.js → fullscreen-BXI8V5i6.js} +1 -1
  64. package/dist/assets/{gallery-page-Cdzff-Qg.js → gallery-page-CNPcxPCI.js} +1 -1
  65. package/dist/assets/{glide-data-editor-C-TEbaaI.js → glide-data-editor-Bmm8OMxa.js} +1 -1
  66. package/dist/assets/glide-data-editor-bv6Gjy-B.css +1 -0
  67. package/dist/assets/{globals-CtlGW6I9.js → globals-Bx8Km3LH.js} +1 -1
  68. package/dist/assets/{home-page-mSJrlwQP.js → home-page-CPt4LGp0.js} +1 -1
  69. package/dist/assets/{hooks-B7Rts5E9.js → hooks-7dyPrQQS.js} +1 -1
  70. package/dist/assets/{html-to-image-CwotZpj4.js → html-to-image-BWhkUSek.js} +1 -1
  71. package/dist/assets/index-C65kCpI9.css +2 -0
  72. package/dist/assets/{index-CPP8bPS4.js → index-awbrczCl.js} +7 -7
  73. package/dist/assets/{input-DqLOEfxi.js → input-DB2LiTiQ.js} +1 -1
  74. package/dist/assets/{kiosk-mode-BbYPCeNP.js → kiosk-mode-D0mAc3Fr.js} +1 -1
  75. package/dist/assets/{label-B0dIDKzs.js → label-CFvCMYuj.js} +1 -1
  76. package/dist/assets/{layout-D6cTuIkL.js → layout-C0MKkswN.js} +3 -3
  77. package/dist/assets/{links-DyPoFWQA.js → links-BN8FYTyp.js} +1 -1
  78. package/dist/assets/{logs-panel-Bbs9bNZs.js → logs-panel-BaGDTq_5.js} +1 -1
  79. package/dist/assets/{markdown-renderer-BNkLMIkn.js → markdown-renderer-CyLjgnQY.js} +1 -1
  80. package/dist/assets/{menu-items-CO4MfAgB.js → menu-items-CQMqwayA.js} +1 -1
  81. package/dist/assets/{mermaid-x93GPw1i.js → mermaid-yhDJCmk2.js} +1 -1
  82. package/dist/assets/{multi-icon-pwGWVz3d.css → multi-icon-CW3_9bja.css} +1 -1
  83. package/dist/assets/{multi-map-BRoHtMOY.js → multi-map-9ogswH46.js} +1 -1
  84. package/dist/assets/{name-cell-input-BLlsboll.js → name-cell-input-DBkW5PZU.js} +1 -1
  85. package/dist/assets/{numbers-B5K_E7OP.js → numbers-_ry1Nlla.js} +1 -1
  86. package/dist/assets/{outline-panel-w43V587L.css → outline-panel-DHPbKZNT.css} +1 -1
  87. package/dist/assets/{outline-panel-rkIr1QNz.js → outline-panel-xLeB4sTR.js} +1 -1
  88. package/dist/assets/{packages-panel-BDeQ6RMe.js → packages-panel-BbWGOWIZ.js} +1 -1
  89. package/dist/assets/{pair-with-agent-modal-LNomHeQ3.js → pair-with-agent-modal-Q9Od23Rh.js} +2 -2
  90. package/dist/assets/{panels-B4E3DsXP.css → panels-DDsRoC3H.css} +1 -1
  91. package/dist/assets/{panels-DklBul5F.js → panels-id0eyz64.js} +1 -1
  92. package/dist/assets/{popover-CjugjEGp.js → popover-DMNO6Poc.js} +1 -1
  93. package/dist/assets/process-output-BcuY_Us9.js +1 -0
  94. package/dist/assets/{radio-group-ro2znWCo.js → radio-group-XouISBp9.js} +1 -1
  95. package/dist/assets/{readonly-python-code-Rbx7Ee_u.js → readonly-python-code-BK3Xk2qY.js} +1 -1
  96. package/dist/assets/{renderShortcut-D7vPTxQw.js → renderShortcut-LpVarhnQ.js} +1 -1
  97. package/dist/assets/{reveal-component-CMD1_gk8.css → reveal-component-55QLSQaY.css} +1 -1
  98. package/dist/assets/{reveal-component-D--4ov10.js → reveal-component-Do91RUH9.js} +2 -2
  99. package/dist/assets/{run-page-HMHhlHXA.js → run-page-CYnMjVum.js} +1 -1
  100. package/dist/assets/{runs-C1XrKvr5.js → runs-Edg4TRSI.js} +1 -1
  101. package/dist/assets/{scratchpad-panel-1N03WMvF.js → scratchpad-panel-DH3KlUbZ.js} +1 -1
  102. package/dist/assets/{secrets-panel-BdUz6vG7.js → secrets-panel-CgahHnqr.js} +1 -1
  103. package/dist/assets/{select-D8ewebPZ.js → select-Cjly7tmx.js} +1 -1
  104. package/dist/assets/{session-NNbloO8g.js → session-CsT5Gg9j.js} +1 -1
  105. package/dist/assets/{session-panel-sp7p_i1J.js → session-panel-BJP2lKfE.js} +1 -1
  106. package/dist/assets/{share-C1RBdbis.js → share-DQjChRJG.js} +1 -1
  107. package/dist/assets/{snippets-panel-BWo8lxGn.js → snippets-panel-DKenTNmv.js} +1 -1
  108. package/dist/assets/{snippets-panel-fg1cdAzn.css → snippets-panel-Qc3aWbYx.css} +1 -1
  109. package/dist/assets/{spec-CegvVOyV.js → spec-CDgWI0fT.js} +1 -1
  110. package/dist/assets/{state-Des6nv42.js → state-Cy10NkuA.js} +1 -1
  111. package/dist/assets/{state-nw3MJ7Ul.js → state-DjrxAf9W.js} +1 -1
  112. package/dist/assets/{state-3LYweM3z.js → state-DwAS0kE4.js} +1 -1
  113. package/dist/assets/{state-C2QvlGMs.js → state-MC8-jN2e.js} +1 -1
  114. package/dist/assets/{strings-C0KZ4uek.js → strings-DvZlHYnD.js} +1 -1
  115. package/dist/assets/{swiper-component-CJYx1rIa.js → swiper-component-BwPCQTdo.js} +1 -1
  116. package/dist/assets/{swiper-component-a65-SW8d.css → swiper-component-UB_Zmrma.css} +1 -1
  117. package/dist/assets/{switch-CAAV-Q_3.js → switch-DvDNxcZP.js} +1 -1
  118. package/dist/assets/{table-D0oF_Cv_.js → table-CnW850Wt.js} +1 -1
  119. package/dist/assets/{terminal-Bd0wzkSP.js → terminal-BXH7Uaqi.js} +1 -1
  120. package/dist/assets/{textarea-BF6sxhXQ.js → textarea-BBpaAGpK.js} +1 -1
  121. package/dist/assets/{tooltip-DfvClvB6.js → tooltip-CgQpRVyN.js} +1 -1
  122. package/dist/assets/{tracing-Cgii-4al.js → tracing-Bz68-Fa1.js} +1 -1
  123. package/dist/assets/{tracing-panel-BXvvt77y.js → tracing-panel-BfgGYFNi.js} +2 -2
  124. package/dist/assets/{tree-actions-D0qu4tQX.js → tree-actions-C729o8TG.js} +1 -1
  125. package/dist/assets/{useBoolean-CEf-f6bo.js → useBoolean-BMzj74q1.js} +1 -1
  126. package/dist/assets/{useCellActionButton-CctL-6ce.js → useCellActionButton-VGB6-gGh.js} +1 -1
  127. package/dist/assets/{useDeleteCell-9SpULTHH.js → useDeleteCell-D_p8uMly.js} +1 -1
  128. package/dist/assets/{useDependencyPanelTab-DEoqXf8l.js → useDependencyPanelTab-v8fQPE_U.js} +1 -1
  129. package/dist/assets/{useEventListener-Wyg6Md5s.js → useEventListener-BakX-tnw.js} +1 -1
  130. package/dist/assets/{useHotkey-BK1MRrIi.js → useHotkey-CJo8iX8v.js} +1 -1
  131. package/dist/assets/{useIframeCapabilities-piGMPmIq.js → useIframeCapabilities-B0dNZiKK.js} +1 -1
  132. package/dist/assets/{useInstallPackage-D_8LtT7f.js → useInstallPackage-C1Dd0aIZ.js} +1 -1
  133. package/dist/assets/{useInterval-D6xsFpdR.js → useInterval-BvJQmQqd.js} +1 -1
  134. package/dist/assets/{useNotebookActions-WDk7rlWv.js → useNotebookActions-Hdu82BAI.js} +1 -1
  135. package/dist/assets/{useRunCells-CXNnlQUh.js → useRunCells-DXtOL4UR.js} +1 -1
  136. package/dist/assets/{useSplitCell-7Ob0s_PE.js → useSplitCell-CzaZEqwj.js} +1 -1
  137. package/dist/assets/{useTheme-D7YEMvxS.js → useTheme-D_ZbTTJw.js} +1 -1
  138. package/dist/assets/{utils-B-XvLACn.js → utils-DPvpQ891.js} +1 -1
  139. package/dist/assets/{utils-Dcn8htEz.js → utils-Dev6I_Kv.js} +1 -1
  140. package/dist/assets/{vega-component-Cc5BbafI.js → vega-component-Ch7x9hsC.js} +1 -1
  141. package/dist/assets/{write-secret-modal-DW9FRn4n.js → write-secret-modal-K2n79wHj.js} +1 -1
  142. package/dist/index.html +70 -70
  143. package/package.json +3 -3
  144. package/src/components/ai/display-helpers.tsx +5 -5
  145. package/src/components/app-config/ai-config.tsx +5 -5
  146. package/src/components/app-config/mcp-config.tsx +3 -3
  147. package/src/components/chat/acp/agent-panel.tsx +3 -3
  148. package/src/components/chat/acp/blocks.tsx +36 -38
  149. package/src/components/chat/acp/common.tsx +12 -16
  150. package/src/components/chat/acp/scroll-to-bottom-button.tsx +1 -1
  151. package/src/components/chat/acp/session-tabs.tsx +2 -2
  152. package/src/components/chat/chat-history-popover.tsx +1 -1
  153. package/src/components/data-table/columns.tsx +2 -2
  154. package/src/components/data-table/filter-pill-editor.tsx +1 -1
  155. package/src/components/dependency-graph/minimap-content.tsx +1 -1
  156. package/src/components/editor/RecoveryButton.tsx +1 -1
  157. package/src/components/editor/actions/pair-with-agent-modal.tsx +2 -2
  158. package/src/components/editor/ai/ai-completion-editor.tsx +1 -1
  159. package/src/components/editor/cell/CreateCellButton.tsx +1 -1
  160. package/src/components/editor/chrome/panels/empty-state.tsx +1 -1
  161. package/src/components/editor/chrome/panels/outline/floating-outline.tsx +1 -1
  162. package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +1 -1
  163. package/src/components/editor/columns/cell-column.tsx +1 -1
  164. package/src/components/editor/columns/sortable-column.tsx +2 -2
  165. package/src/components/editor/output/MarimoErrorOutput.tsx +1 -1
  166. package/src/components/editor/output/TextOutput.tsx +2 -2
  167. package/src/components/slides/minimap.tsx +2 -2
  168. package/src/components/slides/reveal-component.tsx +1 -1
  169. package/src/components/ui/alert.tsx +1 -1
  170. package/src/components/ui/command.tsx +2 -2
  171. package/src/components/ui/reorderable-list.tsx +1 -1
  172. package/src/components/ui/table.tsx +2 -5
  173. package/src/core/codemirror/language/languages/sql/renderers.tsx +60 -68
  174. package/src/core/hotkeys/hotkeys.ts +1 -0
  175. package/src/plugins/impl/MatrixPlugin.tsx +2 -2
  176. package/src/plugins/impl/TabsPlugin.tsx +1 -1
  177. package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +1 -1
  178. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +155 -98
  179. package/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx +154 -1
  180. package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -0
  181. package/dist/assets/alert-DqbbTJFm.js +0 -1
  182. package/dist/assets/cell-editor-nqEF4IhQ.css +0 -2
  183. package/dist/assets/empty-state-COZ7sMv4.js +0 -1
  184. package/dist/assets/glide-data-editor-BrZJn3-g.css +0 -1
  185. package/dist/assets/index-DYQYDO53.css +0 -2
  186. package/dist/assets/process-output-B1Leg7X7.js +0 -1
  187. /package/dist/assets/{Inputs-Ce5uKBe1.js → Inputs-CqgPhOqy.js} +0 -0
  188. /package/dist/assets/{multi-icon-DZE4vMSW.js → multi-icon-CTvmuLdL.js} +0 -0
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-DadY-3pz.js","./copy-icon-CeGeeBdW.js","./button-DuHyjdW2.js","./useEventListener-Wyg6Md5s.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-PbYoItBR.js","./cn-X2M2usMq.js","./clsx-BtEcuwwV.js","./tooltip-DfvClvB6.js","./fullscreen-BWhrFYLX.js","./react-dom-CSu739Rf.js","./dist-C3166O2z.js","./use-toast-kCNiuc-_.js","./copy-C_iQKqnH.js","./check-DQmqoJgr.js","./createLucideIcon-BTp1tQDO.js","./copy-IBNGDypD.js","./error-banner-Ct1mv9wE.js","./alert-dialog-Dj7YzzBi.js","./errors-9jMmWHd9.js","./zod-H_cgTO0M.js","./dist-DQlrXcW2.js","./dist-Dez1I5M9.js","./dist-CNKFZCiw.js","./dist-B_4mXtvJ.js","./dist-B0WqBUnf.js","./dist-D-2yWcX9.js","./dist-ZjSH4Z6x.js","./dist-BRRMCoI_.js","./dist-BzGK1_vc.js","./dist-DblYTes5.js","./dist-DyuwOQr-.js","./dist-BtrqKtvn.js","./dist-DoxplNOD.js","./dist-sJHUucQ8.js","./dist-npZrjkCf.js","./dist-CkHYcq4S.js","./esm-X3Tr2pur.js","./extends-CeSFM22p.js","./objectWithoutPropertiesLoose-BkUn3I0-.js","./dist-CwfKvuyQ.js","./esm-DwJBDgEq.js","./dist-Cqrb9QGk.js","./dist-77VmTZjj.js","./dist-FYUcqnI2.js","./dist-CfGDksO-.js","./dist-BHCGBHnf.js","./dist-BBXQ3ARp.js","./apl-Byte72fT.js","./asciiarmor-BU-VnG1Y.js","./asn1-hTvH3S4T.js","./brainfuck-C-q1Rv8J.js","./clike-BE-9Ct_H.js","./clojure-Co-TLeNo.js","./cmake-B-Nm_Opd.js","./cobol-BGdihAZT.js","./coffeescript-BUZXkMUO.js","./commonlisp-CFkPbxvX.js","./crystal-CqfqDl34.js","./css-DPEtZWJi.js","./cypher-B0t8FJvU.js","./d-DRa_XRSB.js","./diff-GLneonpD.js","./dtd-uVrZNVF0.js","./dylan-DkNeA4FZ.js","./ecl-CldUgvc9.js","./eiffel-CoMDRbRL.js","./elm-Cb5XC6ev.js","./erlang-8H3fTZ3L.js","./factor-C-_cRSDM.js","./simple-mode-CFlvn0Mm.js","./forth-B8kC4npz.js","./fortran-CNWGEL3c.js","./gas-DnZQNTHK.js","./gherkin-JfGcGvci.js","./groovy-D0FWiAVm.js","./haskell-wUB3uX-G.js","./haxe-g0JY6eL-.js","./idl-CV2cLkPc.js","./javascript-CT6okXEZ.js","./julia-CKC48ufo.js","./livescript-C43pZ6Ue.js","./lua-Cs2mb10K.js","./mathematica-B5FMK3ma.js","./mbox-36Zrn5Bd.js","./mirc-BKTAABSX.js","./mllike-DbuClUqc.js","./modelica-CKRvBm7N.js","./mscgen-B4BRgnCi.js","./mumps-BFiMcyFV.js","./nsis-BGZ5EB-j.js","./ntriples-QQAkJYAR.js","./octave-DsTphmGZ.js","./oz-CD9rr5Iz.js","./pascal-DdHEIlJE.js","./perl-DHPJBQ1u.js","./pig-Yz7ERgca.js","./powershell-CHPZ_bsU.js","./properties-CI9nc7K4.js","./protobuf-BYSIv2pY.js","./pug-CYW0agOo.js","./puppet-CEpLafZX.js","./python-BndVuwG1.js","./q-L_cetpiW.js","./r-Dd37AKWk.js","./rpm-CHrvhtlN.js","./ruby-BPOowfX6.js","./sas-BsEFSvEP.js","./scheme-B42INBu7.js","./shell-BPea12OI.js","./sieve-C-yPcLw5.js","./smalltalk-e7OO1ATb.js","./sparql-B4I2Ledx.js","./stex-0ac7Aukl.js","./stylus-CBRbZwhN.js","./swift-B2hnU7ha.js","./tcl-BtyamtaZ.js","./textile-M9mhyNE9.js","./toml-YxyxhyRy.js","./troff-C7xpi05X.js","./ttcn-cfg-DlZ5vA9E.js","./ttcn-D3YytrJU.js","./turtle-BSHvAsUe.js","./vb-DdkIDLlO.js","./vbscript-DhYGmk_p.js","./velocity-DAXJNEw4.js","./verilog-jmuT_L3b.js","./vhdl-DcVQ97RU.js","./webidl-B-YB_4OQ.js","./xquery-DOmY3Oe8.js","./yacas-pL3kJRXV.js","./z80-VwVuI_MT.js"])))=>i.map(i=>d[i]);
2
- import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-BTp1tQDO.js";import{t as m}from"./preload-helper-BW0IMuFq.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor-DadY-3pz.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133]),import.meta.url))})();export{s as __tla,r as n,a as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./any-language-editor-F2HBwXr3.js","./copy-icon-EHMT-qlr.js","./button-BF7GSjhW.js","./useEventListener-BakX-tnw.js","./compiler-runtime-B3qBwwSJ.js","./react-Bj1aDYRI.js","./chunk-LvLJmgfZ.js","./jsx-runtime-PbYoItBR.js","./cn-X2M2usMq.js","./clsx-BtEcuwwV.js","./tooltip-CgQpRVyN.js","./fullscreen-BXI8V5i6.js","./react-dom-CSu739Rf.js","./dist-DCqDlsgq.js","./use-toast-kCNiuc-_.js","./copy-D8MtpXgN.js","./check-DQmqoJgr.js","./createLucideIcon-BTp1tQDO.js","./copy-IBNGDypD.js","./error-banner-BSQVN46J.js","./alert-dialog-CC0gG4Av.js","./errors-9jMmWHd9.js","./zod-H_cgTO0M.js","./dist-DQlrXcW2.js","./dist-Dez1I5M9.js","./dist-CNKFZCiw.js","./dist-B_4mXtvJ.js","./dist-B0WqBUnf.js","./dist-D-2yWcX9.js","./dist-ZjSH4Z6x.js","./dist-BRRMCoI_.js","./dist-BzGK1_vc.js","./dist-DblYTes5.js","./dist-DyuwOQr-.js","./dist-BtrqKtvn.js","./dist-DoxplNOD.js","./dist-sJHUucQ8.js","./dist-npZrjkCf.js","./dist-CkHYcq4S.js","./esm-X3Tr2pur.js","./extends-CeSFM22p.js","./objectWithoutPropertiesLoose-BkUn3I0-.js","./dist-CwfKvuyQ.js","./esm-DwJBDgEq.js","./dist-Cqrb9QGk.js","./dist-77VmTZjj.js","./dist-FYUcqnI2.js","./dist-CfGDksO-.js","./dist-BHCGBHnf.js","./dist-BBXQ3ARp.js","./apl-Byte72fT.js","./asciiarmor-BU-VnG1Y.js","./asn1-hTvH3S4T.js","./brainfuck-C-q1Rv8J.js","./clike-BE-9Ct_H.js","./clojure-Co-TLeNo.js","./cmake-B-Nm_Opd.js","./cobol-BGdihAZT.js","./coffeescript-BUZXkMUO.js","./commonlisp-CFkPbxvX.js","./crystal-CqfqDl34.js","./css-DPEtZWJi.js","./cypher-B0t8FJvU.js","./d-DRa_XRSB.js","./diff-GLneonpD.js","./dtd-uVrZNVF0.js","./dylan-DkNeA4FZ.js","./ecl-CldUgvc9.js","./eiffel-CoMDRbRL.js","./elm-Cb5XC6ev.js","./erlang-8H3fTZ3L.js","./factor-C-_cRSDM.js","./simple-mode-CFlvn0Mm.js","./forth-B8kC4npz.js","./fortran-CNWGEL3c.js","./gas-DnZQNTHK.js","./gherkin-JfGcGvci.js","./groovy-D0FWiAVm.js","./haskell-wUB3uX-G.js","./haxe-g0JY6eL-.js","./idl-CV2cLkPc.js","./javascript-CT6okXEZ.js","./julia-CKC48ufo.js","./livescript-C43pZ6Ue.js","./lua-Cs2mb10K.js","./mathematica-B5FMK3ma.js","./mbox-36Zrn5Bd.js","./mirc-BKTAABSX.js","./mllike-DbuClUqc.js","./modelica-CKRvBm7N.js","./mscgen-B4BRgnCi.js","./mumps-BFiMcyFV.js","./nsis-BGZ5EB-j.js","./ntriples-QQAkJYAR.js","./octave-DsTphmGZ.js","./oz-CD9rr5Iz.js","./pascal-DdHEIlJE.js","./perl-DHPJBQ1u.js","./pig-Yz7ERgca.js","./powershell-CHPZ_bsU.js","./properties-CI9nc7K4.js","./protobuf-BYSIv2pY.js","./pug-CYW0agOo.js","./puppet-CEpLafZX.js","./python-BndVuwG1.js","./q-L_cetpiW.js","./r-Dd37AKWk.js","./rpm-CHrvhtlN.js","./ruby-BPOowfX6.js","./sas-BsEFSvEP.js","./scheme-B42INBu7.js","./shell-BPea12OI.js","./sieve-C-yPcLw5.js","./smalltalk-e7OO1ATb.js","./sparql-B4I2Ledx.js","./stex-0ac7Aukl.js","./stylus-CBRbZwhN.js","./swift-B2hnU7ha.js","./tcl-BtyamtaZ.js","./textile-M9mhyNE9.js","./toml-YxyxhyRy.js","./troff-C7xpi05X.js","./ttcn-cfg-DlZ5vA9E.js","./ttcn-D3YytrJU.js","./turtle-BSHvAsUe.js","./vb-DdkIDLlO.js","./vbscript-DhYGmk_p.js","./velocity-DAXJNEw4.js","./verilog-jmuT_L3b.js","./vhdl-DcVQ97RU.js","./webidl-B-YB_4OQ.js","./xquery-DOmY3Oe8.js","./yacas-pL3kJRXV.js","./z80-VwVuI_MT.js"])))=>i.map(i=>d[i]);
2
+ import{s as e}from"./chunk-LvLJmgfZ.js";import{t as i}from"./react-Bj1aDYRI.js";import{t as o}from"./createLucideIcon-BTp1tQDO.js";import{t as m}from"./preload-helper-BW0IMuFq.js";let r,a,s=(async()=>{r=o("between-horizontal-start",[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]]),a=(0,e(i(),1).lazy)(()=>m(()=>import("./any-language-editor-F2HBwXr3.js").then(async t=>(await t.__tla,t)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133]),import.meta.url))})();export{s as __tla,r as n,a as t};
@@ -1,7 +1,7 @@
1
- import{s as te}from"./chunk-LvLJmgfZ.js";import{d as Se,f as Ae,l as Ee,u as re}from"./useEvent-D91BmmQi.js";import{t as ze}from"./react-Bj1aDYRI.js";import{D as Me,Fi as qe,In as Pe,On as Le,Si as se,_r as We,b as De,it as Oe,pr as Be,xi as Qe}from"./cells-CHWMpikY.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{t as Re}from"./invariant-C2E8KCbD.js";import{i as Ve,y as He}from"./utils-Dcn8htEz.js";import{t as ne}from"./cn-X2M2usMq.js";import{t as Ue}from"./jsx-runtime-PbYoItBR.js";import{a as Ge,i as Je,n as Ke,r as Xe}from"./multi-map-BRoHtMOY.js";import{a as Ye,p as Ze,r as et,t as tt}from"./dropdown-menu-ItqBTuc3.js";import{t as B}from"./tooltip-DfvClvB6.js";import{r as le,t as S}from"./button-DuHyjdW2.js";import{t as ie}from"./createLucideIcon-BTp1tQDO.js";import{r as ae}from"./x-9vLEgLY6.js";import{t as rt}from"./chevron-right-C7RH0Nc7.js";import{t as st}from"./package-BTIV9-Dk.js";import{t as nt}from"./sparkles-COaEc8Qn.js";import{c as ce,n as lt}from"./datasource-C6_8-viy.js";import{a as it}from"./dist-BtrqKtvn.js";import{t as at}from"./RenderHTML-B283s7MJ.js";import{t as oe}from"./kbd-UVzWBHfi.js";import{t as z}from"./links-CCkJpphF.js";import{r as ct,t as ot}from"./alert-DqbbTJFm.js";import{o as mt,t as dt}from"./useInstallPackage-D_8LtT7f.js";import{n as pt}from"./state-3LYweM3z.js";import{n as k}from"./cell-link-CltAZE6t.js";var M=ie("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),me=ie("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),de=String.raw`_cell_([^\W_][\w-]*?)(_\w*)`,pe=String.raw`(?<!_)${de}`;`${de}`;var ut=new RegExp(pe),K=new RegExp(pe,"g");function ue(r){let e=[];K.lastIndex=0;let n=0,s=K.exec(r);for(;s!==null;)s.index>n&&e.push(r.slice(n,s.index)),e.push({cellId:s[1],name:s[2]}),n=s.index+s[0].length,s=K.exec(r);return n<r.length&&e.push(r.slice(n)),e}function xt(r){return ut.test(r)}function ht(r){let e=null,n=r.cursor();do n.name==="ExpressionStatement"&&(e=n.node);while(n.next());return e}function ft(r){let e=r.split(`
1
+ import{s as te}from"./chunk-LvLJmgfZ.js";import{d as Se,f as Ae,l as Ee,u as re}from"./useEvent-D91BmmQi.js";import{t as ze}from"./react-Bj1aDYRI.js";import{D as Me,Fi as qe,In as Pe,On as Le,Si as se,_r as We,b as De,it as Oe,pr as Be,xi as Qe}from"./cells-DiASVTIh.js";import{t as E}from"./compiler-runtime-B3qBwwSJ.js";import{t as Re}from"./invariant-C2E8KCbD.js";import{i as Ve,y as He}from"./utils-Dev6I_Kv.js";import{t as ne}from"./cn-X2M2usMq.js";import{t as Ue}from"./jsx-runtime-PbYoItBR.js";import{a as Ge,i as Je,n as Ke,r as Xe}from"./multi-map-9ogswH46.js";import{a as Ye,p as Ze,r as et,t as tt}from"./dropdown-menu-DfGLyCbP.js";import{t as B}from"./tooltip-CgQpRVyN.js";import{r as le,t as S}from"./button-BF7GSjhW.js";import{t as ie}from"./createLucideIcon-BTp1tQDO.js";import{r as ae}from"./x-9vLEgLY6.js";import{t as rt}from"./chevron-right-C7RH0Nc7.js";import{t as st}from"./package-BTIV9-Dk.js";import{t as nt}from"./sparkles-COaEc8Qn.js";import{c as ce,n as lt}from"./datasource-Da-qoi34.js";import{a as it}from"./dist-BtrqKtvn.js";import{t as at}from"./RenderHTML-ohul2q99.js";import{t as oe}from"./kbd-UVzWBHfi.js";import{t as z}from"./links-CCkJpphF.js";import{r as ct,t as ot}from"./alert-1y_DnRWn.js";import{o as mt,t as dt}from"./useInstallPackage-C1Dd0aIZ.js";import{n as pt}from"./state-DwAS0kE4.js";import{n as k}from"./cell-link-DBKqdVgo.js";var M=ie("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),me=ie("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),de=String.raw`_cell_([^\W_][\w-]*?)(_\w*)`,pe=String.raw`(?<!_)${de}`;`${de}`;var ut=new RegExp(pe),K=new RegExp(pe,"g");function ue(r){let e=[];K.lastIndex=0;let n=0,s=K.exec(r);for(;s!==null;)s.index>n&&e.push(r.slice(n,s.index)),e.push({cellId:s[1],name:s[2]}),n=s.index+s[0].length,s=K.exec(r);return n<r.length&&e.push(r.slice(n)),e}function xt(r){return ut.test(r)}function ht(r){let e=null,n=r.cursor();do n.name==="ExpressionStatement"&&(e=n.node);while(n.next());return e}function ft(r){let e=r.split(`
2
2
  `),n=" ",s=ht(it.parse(r));if(!s)return["def _():",...X(e,n),`${n}return`,"","","_()"].join(`
3
3
  `);let i=r.slice(0,s.from).trim(),l=r.slice(s.from).trim(),c=i.split(`
4
4
  `),a=l.split(`
5
5
  `);return["def _():",...X(c,n),`${n}return ${a[0]}`,...X(a.slice(1),n),"","","_()"].join(`
6
6
  `)}function X(r,e){if(r.length===1&&r[0]==="")return[];let n=[];for(let s of r)s===""?n.push(""):n.push(e+s);return n}function jt(r,e){var n;if(r.type==="multiple-defs")return[{title:"Fix: Wrap in a function",description:"Make this cell's variables local by wrapping the cell in a function.",fixType:"manual",onFix:async s=>{Re(s.editor,"Editor is null");let i=ft(s.editor.state.doc.toString());s.editor.dispatch({changes:{from:0,to:s.editor.state.doc.length,insert:i}})}}];if(r.type==="exception"&&r.exception_type==="NameError"){let s=(n=r.msg.match(/name '(.+)' is not defined/))==null?void 0:n[1];if(!s||!(s in xe))return[];let i=gt(s);return[{title:`Fix: Add '${i}'`,description:"Add a new cell for the missing import",fixType:"manual",onFix:async l=>{l.addCodeBelow(i)}}]}return r.type==="sql-error"&&e.aiEnabled?[{title:"Fix with AI",description:"Fix the SQL statement",fixType:"ai",onFix:async s=>{var c;let i=lt(s.cellId),l=`Fix the SQL statement: ${r.msg}.`;i&&(l+=`
7
- Database schema: ${i}`),(c=s.aiFix)==null||c.setAiCompletionCell({cellId:s.cellId,initialPrompt:l,triggerImmediately:s.aiFix.triggerFix})}}]:[]}function gt(r){let e=xe[r];return e===r?`import ${e}`:`import ${e} as ${r}`}var xe={mo:"marimo",alt:"altair",bokeh:"bokeh",dask:"dask",np:"numpy",pd:"pandas",pl:"polars",plotly:"plotly",plt:"matplotlib.pyplot",px:"plotly.express",scipy:"scipy",sk:"sklearn",sns:"seaborn",stats:"scipy.stats",tf:"tensorflow",torch:"torch",xr:"xarray",dt:"datetime",json:"json",math:"math",os:"os",re:"re",sys:"sys"},yt=E(),Nt=qe("marimo:ai-autofix-mode","autofix",Pe);function bt(){let r=(0,yt.c)(3),[e,n]=Ee(Nt),s;return r[0]!==e||r[1]!==n?(s={fixMode:e,setFixMode:n},r[0]=e,r[1]=n,r[2]=s):s=r[2],s}var Y=E(),t=te(Ue(),1);const b=r=>{let e=(0,Y.c)(21),{errors:n,cellId:s,className:i}=r,l=Ae(),{createNewCell:c}=Me(),a=re(Ve),o;if(e[0]!==a||e[1]!==n){let y;e[3]===a?y=e[4]:(y=v=>jt(v,{aiEnabled:a}),e[3]=a,e[4]=y),o=n.flatMap(y),e[0]=a,e[1]=n,e[2]=o}else o=e[2];let d=o,p=Se(pt);if(d.length===0)return null;let m=d[0],f;e[5]!==s||e[6]!==c||e[7]!==m||e[8]!==p||e[9]!==l?(f=y=>{var w;let v=(w=l.get(De).cellHandles[s].current)==null?void 0:w.editorView;m.onFix({addCodeBelow:I=>{c({cellId:s,autoFocus:!1,before:!1,code:I})},editor:v,cellId:s,aiFix:{setAiCompletionCell:p,triggerFix:y}}),v==null||v.focus()},e[5]=s,e[6]=c,e[7]=m,e[8]=p,e[9]=l,e[10]=f):f=e[10];let x=f,j;e[11]===i?j=e[12]:(j=ne("my-2",i),e[11]=i,e[12]=j);let u;e[13]!==m.description||e[14]!==m.fixType||e[15]!==m.title||e[16]!==x?(u=m.fixType==="ai"?(0,t.jsx)(ye,{tooltip:m.description,openPrompt:()=>x(!1),applyAutofix:()=>x(!0)}):(0,t.jsx)(B,{content:m.description,align:"start",children:(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"font-normal",onClick:()=>x(!1),children:[(0,t.jsx)(ce,{className:"h-3 w-3 mr-2"}),m.title]})}),e[13]=m.description,e[14]=m.fixType,e[15]=m.title,e[16]=x,e[17]=u):u=e[17];let g;return e[18]!==j||e[19]!==u?(g=(0,t.jsx)("div",{className:j,children:u}),e[18]=j,e[19]=u,e[20]=g):g=e[20],g};var he=nt,fe=ce,je="Suggest a prompt",ge="Fix with AI";const ye=r=>{let e=(0,Y.c)(21),{tooltip:n,openPrompt:s,applyAutofix:i}=r,{fixMode:l,setFixMode:c}=bt(),a=l==="prompt"?s:i,o;e[0]===l?o=e[1]:(o=l==="prompt"?(0,t.jsx)(he,{className:"h-3 w-3 mr-2 mb-0.5"}):(0,t.jsx)(fe,{className:"h-3 w-3 mr-2 mb-0.5"}),e[0]=l,e[1]=o);let d=l==="prompt"?je:ge,p;e[2]!==a||e[3]!==o||e[4]!==d?(p=(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"font-normal rounded-r-none border-r-0",onClick:a,children:[o,d]}),e[2]=a,e[3]=o,e[4]=d,e[5]=p):p=e[5];let m;e[6]!==p||e[7]!==n?(m=(0,t.jsx)(B,{content:n,align:"start",children:p}),e[6]=p,e[7]=n,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(Ze,{asChild:!0,children:(0,t.jsx)(S,{size:"xs",variant:"outline",className:"rounded-l-none px-2","aria-label":"Fix options",children:(0,t.jsx)(ae,{className:"h-3 w-3"})})}),e[9]=f):f=e[9];let x;e[10]!==l||e[11]!==c?(x=()=>{c(l==="prompt"?"autofix":"prompt")},e[10]=l,e[11]=c,e[12]=x):x=e[12];let j=l==="prompt"?"autofix":"prompt",u;e[13]===j?u=e[14]:(u=(0,t.jsx)(vt,{mode:j}),e[13]=j,e[14]=u);let g;e[15]!==x||e[16]!==u?(g=(0,t.jsxs)(tt,{children:[f,(0,t.jsx)(et,{align:"end",className:"w-56",children:(0,t.jsx)(Ye,{className:"flex items-center gap-2",onClick:x,children:u})})]}),e[15]=x,e[16]=u,e[17]=g):g=e[17];let y;return e[18]!==g||e[19]!==m?(y=(0,t.jsxs)("div",{className:"flex",children:[m,g]}),e[18]=g,e[19]=m,e[20]=y):y=e[20],y};var vt=r=>{let e=(0,Y.c)(12),{mode:n}=r,s;e[0]===n?s=e[1]:(s=n==="prompt"?(0,t.jsx)(he,{className:"h-4 w-4"}):(0,t.jsx)(fe,{className:"h-4 w-4"}),e[0]=n,e[1]=s);let i=s,l=n==="prompt"?je:ge,c=n==="prompt"?"Edit the prompt before applying":"Apply AI fixes automatically",a;e[2]===l?a=e[3]:(a=(0,t.jsx)("span",{className:"font-medium",children:l}),e[2]=l,e[3]=a);let o;e[4]===c?o=e[5]:(o=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c}),e[4]=c,e[5]=o);let d;e[6]!==a||e[7]!==o?(d=(0,t.jsxs)("div",{className:"flex flex-col",children:[a,o]}),e[6]=a,e[7]=o,e[8]=d):d=e[8];let p;return e[9]!==i||e[10]!==d?(p=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i,d]}),e[9]=i,e[10]=d,e[11]=p):p=e[11],p},Ne=E();const wt=r=>{let e=(0,Ne.c)(12),{local:n}=r,s;e[0]===n.name?s=e[1]:(s=(0,t.jsx)("span",{className:"font-code",children:n.name}),e[0]=n.name,e[1]=s);let i;e[2]===n.cellId?i=e[3]:(i=(0,t.jsx)(k,{cellId:n.cellId}),e[2]=n.cellId,e[3]=i);let l;e[4]!==s||e[5]!==i?(l=(0,t.jsxs)("div",{className:"max-w-xs",children:["Local variable ",s," in cell"," ",i,"."]}),e[4]=s,e[5]=i,e[6]=l):l=e[6];let c=l,a;e[7]===n.name?a=e[8]:(a=(0,t.jsx)("span",{className:"font-code cursor-help",children:n.name}),e[7]=n.name,e[8]=a);let o;return e[9]!==a||e[10]!==c?(o=(0,t.jsx)(B,{content:c,children:a}),e[9]=a,e[10]=c,e[11]=o):o=e[11],o},be=r=>{let e=(0,Ne.c)(4),{segments:n}=r,s;e[0]===n?s=e[1]:(s=n.map(kt),e[0]=n,e[1]=s);let i;return e[2]===s?i=e[3]:(i=(0,t.jsx)(t.Fragment,{children:s}),e[2]=s,e[3]=i),i};function kt(r,e){return typeof r=="string"?(0,t.jsx)("span",{children:r},e):(0,t.jsx)(wt,{local:r},e)}var ve=/(https?:\/\/\S+)/,It=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,we=/^data:image\//i,_t=["avatars.githubusercontent.com"];function ke(r){return we.test(r)?[{type:"image",url:r}]:r.split(ve).filter(e=>e!=="").map(e=>ve.test(e)?It.test(e)||we.test(e)||_t.some(n=>e.includes(n))?{type:"image",url:e}:{type:"url",url:e}:{type:"text",value:e})}var Ie=E(),q=te(ze(),1),$t=new Oe;const Z=r=>{let e=RegExp("\x1B\\[[0-9;]*m","g");return r.replaceAll(e,"")};var _e=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi;function Ft(r){_e.lastIndex=0;let e=_e.exec(r);if(!e)return null;let n=e.index+e[0].length,s=r.slice(n).split(/\s+/),i="",l=0;for(let a of s){let o=a.trim();if(!o)continue;if(o.startsWith("-")){l+=o.length+1;continue}let d=o.match(/^[\w,.[\]-]+/);if(d){i=d[0];break}break}if(!i)return null;let c=n+l+i.length;return{package:i,endIndex:c}}function $(r,e=""){if(!r)return null;if(!/https?:\/\//.test(r))return r;let n=ke(r);return n.length===1&&n[0].type==="text"?r:(0,t.jsx)(t.Fragment,{children:n.map((s,i)=>{let l=e?`${e}-${i}`:i;if(s.type==="url"){let c=Z(s.url);return(0,t.jsx)("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:le.stopPropagation(),className:"text-link hover:underline",children:c},l)}if(s.type==="image"){let c=Z(s.url);return(0,t.jsx)("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:le.stopPropagation(),className:"text-link hover:underline",children:c},l)}return(0,t.jsx)(q.Fragment,{children:s.value},l)})})}var Ct=r=>{let e=(0,Ie.c)(6),{packages:n,children:s}=r,{handleInstallPackages:i}=dt(),l;e[0]!==i||e[1]!==n?(l=a=>{i(n),a.preventDefault()},e[0]=i,e[1]=n,e[2]=l):l=e[2];let c;return e[3]!==s||e[4]!==l?(c=(0,t.jsx)("button",{onClick:l,className:"text-link hover:underline",type:"button",children:s}),e[3]=s,e[4]=l,e[5]=c):c=e[5],c};const Tt=r=>{if(!(r instanceof se.Text))return;let e=Z(r.data);if(!/(pip\s+install|uv\s+add|uv\s+pip\s+install)/i.test(e))return;let n=[],s=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi,i;for(;(i=s.exec(e))!==null;){let a=i.index,o=Ft(e.slice(a));o&&n.push({match:i,result:o})}if(n.length===0)return;let l=[],c=0;if(n.forEach((a,o)=>{let{match:d,result:p}=a,m=d.index,f=m+p.endIndex;if(c<m){let j=e.slice(c,m);l.push((0,t.jsx)(q.Fragment,{children:$(j,`before-${o}`)},`before-${o}`))}let x=e.slice(m,f);l.push((0,t.jsx)(Ct,{packages:[p.package],children:x},`install-${o}`)),c=f}),c<e.length){let a=e.slice(c);l.push((0,t.jsx)(q.Fragment,{children:$(a,"after")},"after"))}return(0,t.jsx)(t.Fragment,{children:l})},St=r=>{if(!(r instanceof se.Text))return;let e=r.data;if(!/https?:\/\//.test(e))return;let n=$(e);if(typeof n!="string")return(0,t.jsx)(t.Fragment,{children:n})},At=(...r)=>e=>{for(let n of r){let s=n(e);if(s!==void 0)return s}},Et=(r,e)=>(0,t.jsx)("span",{children:Qe($t.ansi_to_html(r),{replace:n=>e(n)})}),zt=r=>{let e=(0,Ie.c)(4),{text:n}=r,s;e[0]===n?s=e[1]:(s=Et(n,At(Tt,St)),e[0]=n,e[1]=s);let i=s,l;return e[2]===i?l=e[3]:(l=(0,t.jsx)(t.Fragment,{children:i}),e[2]=i,e[3]=l),l};var ee=E(),$e=r=>{let e=(0,ee.c)(16),{traceback:n}=r,[s,i]=(0,q.useState)(!0),l;e[0]===s?l=e[1]:(l=()=>i(!s),e[0]=s,e[1]=l);let c=s?"Collapse traceback":"Expand traceback",a;e[2]===s?a=e[3]:(a=s?(0,t.jsx)(ae,{className:"h-3 w-3"}):(0,t.jsx)(rt,{className:"h-3 w-3"}),e[2]=s,e[3]=a);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("span",{className:"text-[0.6875rem] uppercase tracking-wider",children:"Traceback"}),e[4]=o):o=e[4];let d;e[5]!==s||e[6]!==l||e[7]!==c||e[8]!==a?(d=(0,t.jsxs)("button",{type:"button",onClick:l,"aria-expanded":s,"aria-label":c,className:"flex items-center gap-1 text-muted-foreground/70 hover:text-muted-foreground transition-colors",children:[a,o]}),e[5]=s,e[6]=l,e[7]=c,e[8]=a,e[9]=d):d=e[9];let p;e[10]!==s||e[11]!==n?(p=s&&(0,t.jsx)("div",{className:"font-code text-sm mt-1 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text",children:at({html:n})}),e[10]=s,e[11]=n,e[12]=p):p=e[12];let m;return e[13]!==d||e[14]!==p?(m=(0,t.jsxs)("div",{className:"mt-2",children:[d,p]}),e[13]=d,e[14]=p,e[15]=m):m=e[15],m},F=r=>{let e=(0,ee.c)(10),n=r.title??"Tip",s;e[0]===n?s=e[1]:(s=(0,t.jsx)(Ge,{className:"pt-2 pb-0 font-normal",children:n}),e[0]=n,e[1]=s);let i;e[2]===r.children?i=e[3]:(i=(0,t.jsx)(Xe,{className:"mr-24 text-[0.84375rem]",wrapperClassName:"pt-0 pb-2",children:r.children}),e[2]=r.children,e[3]=i);let l;e[4]!==s||e[5]!==i?(l=(0,t.jsxs)(Je,{value:"item-1",className:"text-muted-foreground",children:[s,i]}),e[4]=s,e[5]=i,e[6]=l):l=e[6];let c;return e[7]!==r.className||e[8]!==l?(c=(0,t.jsx)(Ke,{type:"single",collapsible:!0,className:r.className,children:l}),e[7]=r.className,e[8]=l,e[9]=c):c=e[9],c};const Mt=r=>{let e=(0,ee.c)(38),{errors:n,cellId:s,className:i}=r,l=Le(),c=re(He).display.cell_output==="above",a="This cell wasn't run because it has errors",o="destructive",d="text-error",p=null;if(n.some(qt))a="Interrupted";else if(n.some(Pt))a="An internal error occurred";else if(n.some(Lt))a="Ancestor prevented from running",o="default",d="text-secondary-foreground";else if(n.some(Wt))a="Ancestor stopped",o="default",d="text-secondary-foreground";else if(n.some(Dt))a="SQL error";else if(n.some(Ot))a=null,p="Cell not run";else{let w;e[0]===n?w=e[1]:(w=n.find(Bt),e[0]=n,e[1]=w);let I=w;I&&"exception_type"in I&&(a=I.exception_type)}let m,f,x,j,u,g;if(e[2]!==o||e[3]!==s||e[4]!==l||e[5]!==i||e[6]!==n||e[7]!==c||e[8]!==p||e[9]!==d||e[10]!==a){let w=n.filter(Qt),I=n.filter(Rt),P=n.filter(Vt),Q=n.filter(Ht),R=n.filter(Ut),L=n.filter(Gt),W=n.filter(Jt),V=n.filter(Kt),H=n.filter(Xt),U=n.filter(Yt),A=n.filter(Zt),G=n.filter(er),J=n.filter(tr),D;e[17]===l?D=e[18]:(D=()=>{l.openApplication("scratchpad")},e[17]=l,e[18]=D);let Fe=D,Ce=()=>{let N=[];if(A.length>0||G.length>0){let h=A.some(rr),_=!h&&A.some(sr);N.push((0,t.jsxs)("div",{children:[A.map(nr),G.map(lr),h&&(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>mt(l),children:[(0,t.jsx)(st,{className:"h-3.5 w-3.5 mr-1.5 mb-0.5"}),(0,t.jsx)("span",{children:"Open package manager"})]}),_&&(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>l.openApplication("terminal"),children:[(0,t.jsx)(me,{className:"h-3.5 w-3.5 mr-1.5"}),(0,t.jsx)("span",{children:"Open terminal"})]}),s&&(0,t.jsx)(b,{errors:[...A,...G],cellId:s})]},"syntax-unknown"))}if(w.length>0&&N.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"The setup cell cannot be run because it has references."}),(0,t.jsx)("ul",{className:"list-disc",children:w.flatMap(ir)}),s&&(0,t.jsx)(b,{errors:w,cellId:s}),(0,t.jsxs)(F,{title:"Why can't the setup cell have references?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"The setup cell contains logic that must be run before any other cell runs, including top-level imports used by top-level functions. For this reason, it can't refer to other cells' variables."}),(0,t.jsx)("p",{className:"py-2",children:"Try simplifying the setup cell to only contain only necessary variables."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-setup",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"setup-refs")),I.length>0&&N.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell is in a cycle."}),(0,t.jsx)("ul",{className:"list-disc",children:I.flatMap(ar)}),s&&(0,t.jsx)(b,{errors:I,cellId:s}),(0,t.jsxs)(F,{title:"What are cycles and how do I resolve them?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"An example of a cycle is if one cell declares a variable 'a' and reads 'b', and another cell declares 'b' and and reads 'a'. Cycles like this make it impossible for marimo to know how to run your cells, and generally suggest that your code has a bug."}),(0,t.jsx)("p",{className:"py-2",children:"Try merging these cells into a single cell to eliminate the cycle."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-cycles",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"cycle")),P.length>0){let h=P[0].name;N.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell redefines variables from other cells."}),P.map(or),s&&(0,t.jsx)(b,{errors:P,cellId:s}),(0,t.jsxs)(F,{title:"Why can't I redefine variables?",children:[(0,t.jsx)("p",{className:"pb-2",children:"marimo requires that each variable is defined in just one cell. This constraint enables reactive and reproducible execution, arbitrary cell reordering, seamless UI elements, execution as a script, and more."}),(0,t.jsxs)("p",{className:"py-2",children:["Try merging this cell with the mentioned cells or wrapping it in a function. Alternatively, prefix variables with an underscore (e.g., ",(0,t.jsxs)(oe,{className:"inline",children:["_",h]}),"). to make them private to this cell."]}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-multiple-definitions",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]}),(0,t.jsx)(F,{title:"Need a scratchpad?",children:(0,t.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,t.jsxs)(S,{size:"xs",variant:"link",className:"my-2 font-normal mx-0 px-0",onClick:Fe,children:[(0,t.jsx)(Be,{className:"h-3"}),(0,t.jsx)("span",{children:"Try the scratchpad"})]}),(0,t.jsx)("span",{children:"to experiment without restrictions on variable names."})]})})]},"multiple-defs"))}return Q.length>0&&N.push((0,t.jsxs)("div",{children:[Q.map(mr),s&&(0,t.jsx)(b,{errors:Q,cellId:s}),(0,t.jsxs)(F,{title:"Why can't I use `import *`?",children:[(0,t.jsx)("p",{className:"pb-2",children:"Star imports are incompatible with marimo's git-friendly file format and reproducible reactive execution."}),(0,t.jsx)("p",{className:"py-2",children:"marimo's Python file format stores code in functions, so notebooks can be imported as regular Python modules without executing all their code. But Python disallows `import *` everywhere except at the top-level of a module."}),(0,t.jsx)("p",{className:"py-2",children:"Star imports would also silently add names to globals, which would be incompatible with reactive execution."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-import-star",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"import-star")),R.length>0&&N.push((0,t.jsxs)("div",{children:[R.map(dr),s&&(0,t.jsx)(b,{errors:R,cellId:s})]},"interruption")),L.length>0&&N.push((0,t.jsxs)("ul",{children:[L.map((h,_)=>h.exception_type==="NameError"&&h.msg.startsWith("name 'mo'")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"name 'mo' is not defined."}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["The marimo module (imported as"," ",(0,t.jsx)(oe,{className:"inline",children:"mo"}),") is required for Markdown, SQL, and UI elements."]})]})},`exception-${_}`):h.exception_type==="NameError"&&h.msg.startsWith("name '_")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:(0,t.jsx)(be,{segments:ue(h.msg)})}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["Variables prefixed with an underscore are local to a cell"," ","(",(0,t.jsxs)(z,{href:"https://links.marimo.app/local-variables",children:["docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),")."]}),c&&(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]})},`exception-${_}`):(0,t.jsx)("li",{className:"my-2",children:h.raising_cell==null?(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:$(h.msg,`exception-${_}`)}),"traceback"in h&&h.traceback?(0,t.jsx)($e,{traceback:h.traceback}):c&&(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]}):(0,t.jsxs)("div",{children:[$(h.msg,`exception-${_}`),(0,t.jsx)(k,{cellId:h.raising_cell}),"traceback"in h&&h.traceback&&(0,t.jsx)($e,{traceback:h.traceback})]})},`exception-${_}`)),L.some(pr)&&(0,t.jsx)(F,{children:"Fix the error in the mentioned cells, or handle the exceptions with try/except blocks."}),s&&(0,t.jsx)(b,{errors:L,cellId:s})]},"exception")),W.length>0&&N.push((0,t.jsxs)("ul",{children:[W.map(ur),s&&(0,t.jsx)(b,{errors:W,cellId:s}),(0,t.jsx)(F,{children:W.some(xr)?"Ensure that the referenced cells define the required variables, or turn off strict execution.":"Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."})]},"strict-exception")),V.length>0&&N.push((0,t.jsxs)("div",{children:[V.map(hr),s&&(0,t.jsx)(b,{errors:V,cellId:s})]},"internal")),H.length>0&&N.push((0,t.jsxs)("div",{children:[H.map(fr),s&&(0,t.jsx)(b,{errors:H,cellId:s})]},"ancestor-prevented")),U.length>0&&N.push((0,t.jsxs)("div",{children:[U.map(jr),s&&(0,t.jsx)(b,{errors:U,cellId:s})]},"ancestor-stopped")),J.length>0&&N.push((0,t.jsxs)("div",{children:[J.map(gr),s&&(0,t.jsx)(b,{errors:J,cellId:s,className:"mt-2.5"})]},"sql-errors")),N},C;e[19]===p?C=e[20]:(C=p&&(0,t.jsxs)("div",{className:"flex items-center gap-1 font-code text-[0.6875rem] uppercase tracking-wider text-muted-foreground/70",children:[p,(0,t.jsx)(B,{content:"marimo didn't run this cell because it detected an error.",delayDuration:200,children:(0,t.jsx)(We,{className:"size-3 cursor-help"})})]}),e[19]=p,e[20]=C);let T;e[21]!==d||e[22]!==a?(T=a&&(0,t.jsx)(ct,{className:`font-code font-medium ${d}`,children:a}),e[21]=d,e[22]=a,e[23]=T):T=e[23];let O;e[24]!==C||e[25]!==T?(O=(0,t.jsxs)("div",{className:"space-y-0.5",children:[C,T]}),e[24]=C,e[25]=T,e[26]=O):O=e[26];let Te=O;m=ot,j=o,e[27]===i?u=e[28]:(u=ne("border-none font-code text-sm text-[0.84375rem] p-0 text-muted-foreground normal [&:has(svg)]:pl-0 space-y-2",i),e[27]=i,e[28]=u),g=Te,f="flex flex-col gap-4",x=Ce(),e[2]=o,e[3]=s,e[4]=l,e[5]=i,e[6]=n,e[7]=c,e[8]=p,e[9]=d,e[10]=a,e[11]=m,e[12]=f,e[13]=x,e[14]=j,e[15]=u,e[16]=g}else m=e[11],f=e[12],x=e[13],j=e[14],u=e[15],g=e[16];let y;e[29]!==f||e[30]!==x?(y=(0,t.jsx)("div",{className:f,children:x}),e[29]=f,e[30]=x,e[31]=y):y=e[31];let v;return e[32]!==m||e[33]!==j||e[34]!==u||e[35]!==g||e[36]!==y?(v=(0,t.jsxs)(m,{variant:j,className:u,children:[g,y]}),e[32]=m,e[33]=j,e[34]=u,e[35]=g,e[36]=y,e[37]=v):v=e[37],v};function qt(r){return r.type==="interruption"}function Pt(r){return r.type==="internal"}function Lt(r){return r.type==="ancestor-prevented"}function Wt(r){return r.type==="ancestor-stopped"}function Dt(r){return r.type==="sql-error"}function Ot(r){return r.type==="multiple-defs"||r.type==="cycle"||r.type==="setup-refs"||r.type==="import-star"}function Bt(r){return r.type==="exception"}function Qt(r){return r.type==="setup-refs"}function Rt(r){return r.type==="cycle"}function Vt(r){return r.type==="multiple-defs"}function Ht(r){return r.type==="import-star"}function Ut(r){return r.type==="interruption"}function Gt(r){return r.type==="exception"}function Jt(r){return r.type==="strict-exception"}function Kt(r){return r.type==="internal"}function Xt(r){return r.type==="ancestor-prevented"}function Yt(r){return r.type==="ancestor-stopped"}function Zt(r){return r.type==="syntax"}function er(r){return r.type==="unknown"}function tr(r){return r.type==="sql-error"}function rr(r){return r.msg.includes("!pip")}function sr(r){return r.msg.includes("use os.subprocess")}function nr(r,e){return(0,t.jsx)("pre",{children:$(r.msg,`syntax-${e}`)},`syntax-${e}`)}function lr(r,e){return(0,t.jsx)("pre",{children:$(r.msg,`unknown-${e}`)},`unknown-${e}`)}function ir(r,e){return r.edges_with_vars.map((n,s)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(k,{cellId:n[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[": "," ",n[1].length===1?n[1][0]:n[1].join(", ")]})]},`setup-refs-${e}-${s}`))}function ar(r,e){return r.edges_with_vars.map((n,s)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(k,{cellId:n[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" -> ",n[1].length===1?n[1][0]:n[1].join(", ")," -> "]}),(0,t.jsx)(k,{cellId:n[2]})]},`cycle-${e}-${s}`))}function cr(r,e){return(0,t.jsx)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:(0,t.jsx)(k,{cellId:r})},`cell-${e}`)}function or(r,e){return(0,t.jsxs)(q.Fragment,{children:[(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:`'${r.name}' was also defined by:`}),(0,t.jsx)("ul",{className:"list-disc",children:r.cells.map(cr)})]},`multiple-defs-${e}`)}function mr(r,e){return(0,t.jsx)("p",{className:"text-muted-foreground",children:r.msg},`import-star-${e}`)}function dr(r,e){return(0,t.jsx)("p",{children:"This cell was interrupted and needs to be re-run."},`interruption-${e}`)}function pr(r){return r.raising_cell!=null}function ur(r,e){return(0,t.jsx)("li",{className:"my-2",children:r.blamed_cell==null?(0,t.jsx)("p",{children:r.msg}):(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(k,{cellId:r.blamed_cell})]})},`strict-exception-${e}`)}function xr(r){return r.blamed_cell!=null}function hr(r,e){return(0,t.jsx)("p",{children:r.msg},`internal-${e}`)}function fr(r,e){return(0,t.jsxs)("div",{children:[r.msg,r.blamed_cell==null?(0,t.jsxs)("span",{children:["(",(0,t.jsx)(k,{cellId:r.raising_cell}),")"]}):(0,t.jsxs)("span",{children:["(",(0,t.jsx)(k,{cellId:r.raising_cell}),"\xA0blames\xA0",(0,t.jsx)(k,{cellId:r.blamed_cell}),")"]})]},`ancestor-prevented-${e}`)}function jr(r,e){return(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(k,{cellId:r.raising_cell})]},`ancestor-stopped-${e}`)}function gr(r,e){return(0,t.jsx)("div",{className:"space-y-2 mt-2",children:(0,t.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.msg})},`sql-error-${e}`)}export{ye as a,me as c,be as i,zt as n,xt as o,ke as r,ue as s,Mt as t};
7
+ Database schema: ${i}`),(c=s.aiFix)==null||c.setAiCompletionCell({cellId:s.cellId,initialPrompt:l,triggerImmediately:s.aiFix.triggerFix})}}]:[]}function gt(r){let e=xe[r];return e===r?`import ${e}`:`import ${e} as ${r}`}var xe={mo:"marimo",alt:"altair",bokeh:"bokeh",dask:"dask",np:"numpy",pd:"pandas",pl:"polars",plotly:"plotly",plt:"matplotlib.pyplot",px:"plotly.express",scipy:"scipy",sk:"sklearn",sns:"seaborn",stats:"scipy.stats",tf:"tensorflow",torch:"torch",xr:"xarray",dt:"datetime",json:"json",math:"math",os:"os",re:"re",sys:"sys"},yt=E(),Nt=qe("marimo:ai-autofix-mode","autofix",Pe);function bt(){let r=(0,yt.c)(3),[e,n]=Ee(Nt),s;return r[0]!==e||r[1]!==n?(s={fixMode:e,setFixMode:n},r[0]=e,r[1]=n,r[2]=s):s=r[2],s}var Y=E(),t=te(Ue(),1);const b=r=>{let e=(0,Y.c)(21),{errors:n,cellId:s,className:i}=r,l=Ae(),{createNewCell:c}=Me(),a=re(Ve),o;if(e[0]!==a||e[1]!==n){let y;e[3]===a?y=e[4]:(y=v=>jt(v,{aiEnabled:a}),e[3]=a,e[4]=y),o=n.flatMap(y),e[0]=a,e[1]=n,e[2]=o}else o=e[2];let d=o,p=Se(pt);if(d.length===0)return null;let m=d[0],f;e[5]!==s||e[6]!==c||e[7]!==m||e[8]!==p||e[9]!==l?(f=y=>{var w;let v=(w=l.get(De).cellHandles[s].current)==null?void 0:w.editorView;m.onFix({addCodeBelow:I=>{c({cellId:s,autoFocus:!1,before:!1,code:I})},editor:v,cellId:s,aiFix:{setAiCompletionCell:p,triggerFix:y}}),v==null||v.focus()},e[5]=s,e[6]=c,e[7]=m,e[8]=p,e[9]=l,e[10]=f):f=e[10];let x=f,j;e[11]===i?j=e[12]:(j=ne("my-2",i),e[11]=i,e[12]=j);let u;e[13]!==m.description||e[14]!==m.fixType||e[15]!==m.title||e[16]!==x?(u=m.fixType==="ai"?(0,t.jsx)(ye,{tooltip:m.description,openPrompt:()=>x(!1),applyAutofix:()=>x(!0)}):(0,t.jsx)(B,{content:m.description,align:"start",children:(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"font-normal",onClick:()=>x(!1),children:[(0,t.jsx)(ce,{className:"h-3 w-3 mr-2"}),m.title]})}),e[13]=m.description,e[14]=m.fixType,e[15]=m.title,e[16]=x,e[17]=u):u=e[17];let g;return e[18]!==j||e[19]!==u?(g=(0,t.jsx)("div",{className:j,children:u}),e[18]=j,e[19]=u,e[20]=g):g=e[20],g};var he=nt,fe=ce,je="Suggest a prompt",ge="Fix with AI";const ye=r=>{let e=(0,Y.c)(21),{tooltip:n,openPrompt:s,applyAutofix:i}=r,{fixMode:l,setFixMode:c}=bt(),a=l==="prompt"?s:i,o;e[0]===l?o=e[1]:(o=l==="prompt"?(0,t.jsx)(he,{className:"h-3 w-3 mr-2 mb-0.5"}):(0,t.jsx)(fe,{className:"h-3 w-3 mr-2 mb-0.5"}),e[0]=l,e[1]=o);let d=l==="prompt"?je:ge,p;e[2]!==a||e[3]!==o||e[4]!==d?(p=(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"font-normal rounded-r-none border-r-0",onClick:a,children:[o,d]}),e[2]=a,e[3]=o,e[4]=d,e[5]=p):p=e[5];let m;e[6]!==p||e[7]!==n?(m=(0,t.jsx)(B,{content:n,align:"start",children:p}),e[6]=p,e[7]=n,e[8]=m):m=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(Ze,{asChild:!0,children:(0,t.jsx)(S,{size:"xs",variant:"outline",className:"rounded-l-none px-2","aria-label":"Fix options",children:(0,t.jsx)(ae,{className:"h-3 w-3"})})}),e[9]=f):f=e[9];let x;e[10]!==l||e[11]!==c?(x=()=>{c(l==="prompt"?"autofix":"prompt")},e[10]=l,e[11]=c,e[12]=x):x=e[12];let j=l==="prompt"?"autofix":"prompt",u;e[13]===j?u=e[14]:(u=(0,t.jsx)(vt,{mode:j}),e[13]=j,e[14]=u);let g;e[15]!==x||e[16]!==u?(g=(0,t.jsxs)(tt,{children:[f,(0,t.jsx)(et,{align:"end",className:"w-56",children:(0,t.jsx)(Ye,{className:"flex items-center gap-2",onClick:x,children:u})})]}),e[15]=x,e[16]=u,e[17]=g):g=e[17];let y;return e[18]!==g||e[19]!==m?(y=(0,t.jsxs)("div",{className:"flex",children:[m,g]}),e[18]=g,e[19]=m,e[20]=y):y=e[20],y};var vt=r=>{let e=(0,Y.c)(12),{mode:n}=r,s;e[0]===n?s=e[1]:(s=n==="prompt"?(0,t.jsx)(he,{className:"h-4 w-4"}):(0,t.jsx)(fe,{className:"h-4 w-4"}),e[0]=n,e[1]=s);let i=s,l=n==="prompt"?je:ge,c=n==="prompt"?"Edit the prompt before applying":"Apply AI fixes automatically",a;e[2]===l?a=e[3]:(a=(0,t.jsx)("span",{className:"font-medium",children:l}),e[2]=l,e[3]=a);let o;e[4]===c?o=e[5]:(o=(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:c}),e[4]=c,e[5]=o);let d;e[6]!==a||e[7]!==o?(d=(0,t.jsxs)("div",{className:"flex flex-col",children:[a,o]}),e[6]=a,e[7]=o,e[8]=d):d=e[8];let p;return e[9]!==i||e[10]!==d?(p=(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[i,d]}),e[9]=i,e[10]=d,e[11]=p):p=e[11],p},Ne=E();const wt=r=>{let e=(0,Ne.c)(12),{local:n}=r,s;e[0]===n.name?s=e[1]:(s=(0,t.jsx)("span",{className:"font-code",children:n.name}),e[0]=n.name,e[1]=s);let i;e[2]===n.cellId?i=e[3]:(i=(0,t.jsx)(k,{cellId:n.cellId}),e[2]=n.cellId,e[3]=i);let l;e[4]!==s||e[5]!==i?(l=(0,t.jsxs)("div",{className:"max-w-xs",children:["Local variable ",s," in cell"," ",i,"."]}),e[4]=s,e[5]=i,e[6]=l):l=e[6];let c=l,a;e[7]===n.name?a=e[8]:(a=(0,t.jsx)("span",{className:"font-code cursor-help",children:n.name}),e[7]=n.name,e[8]=a);let o;return e[9]!==a||e[10]!==c?(o=(0,t.jsx)(B,{content:c,children:a}),e[9]=a,e[10]=c,e[11]=o):o=e[11],o},be=r=>{let e=(0,Ne.c)(4),{segments:n}=r,s;e[0]===n?s=e[1]:(s=n.map(kt),e[0]=n,e[1]=s);let i;return e[2]===s?i=e[3]:(i=(0,t.jsx)(t.Fragment,{children:s}),e[2]=s,e[3]=i),i};function kt(r,e){return typeof r=="string"?(0,t.jsx)("span",{children:r},e):(0,t.jsx)(wt,{local:r},e)}var ve=/(https?:\/\/\S+)/,It=/\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i,we=/^data:image\//i,_t=["avatars.githubusercontent.com"];function ke(r){return we.test(r)?[{type:"image",url:r}]:r.split(ve).filter(e=>e!=="").map(e=>ve.test(e)?It.test(e)||we.test(e)||_t.some(n=>e.includes(n))?{type:"image",url:e}:{type:"url",url:e}:{type:"text",value:e})}var Ie=E(),q=te(ze(),1),$t=new Oe;const Z=r=>{let e=RegExp("\x1B\\[[0-9;]*m","g");return r.replaceAll(e,"")};var _e=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi;function Ft(r){_e.lastIndex=0;let e=_e.exec(r);if(!e)return null;let n=e.index+e[0].length,s=r.slice(n).split(/\s+/),i="",l=0;for(let a of s){let o=a.trim();if(!o)continue;if(o.startsWith("-")){l+=o.length+1;continue}let d=o.match(/^[\w,.[\]-]+/);if(d){i=d[0];break}break}if(!i)return null;let c=n+l+i.length;return{package:i,endIndex:c}}function $(r,e=""){if(!r)return null;if(!/https?:\/\//.test(r))return r;let n=ke(r);return n.length===1&&n[0].type==="text"?r:(0,t.jsx)(t.Fragment,{children:n.map((s,i)=>{let l=e?`${e}-${i}`:i;if(s.type==="url"){let c=Z(s.url);return(0,t.jsx)("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:le.stopPropagation(),className:"text-link hover:underline",children:c},l)}if(s.type==="image"){let c=Z(s.url);return(0,t.jsx)("a",{href:c,target:"_blank",rel:"noopener noreferrer",onClick:le.stopPropagation(),className:"text-link hover:underline",children:c},l)}return(0,t.jsx)(q.Fragment,{children:s.value},l)})})}var Ct=r=>{let e=(0,Ie.c)(6),{packages:n,children:s}=r,{handleInstallPackages:i}=dt(),l;e[0]!==i||e[1]!==n?(l=a=>{i(n),a.preventDefault()},e[0]=i,e[1]=n,e[2]=l):l=e[2];let c;return e[3]!==s||e[4]!==l?(c=(0,t.jsx)("button",{onClick:l,className:"text-link hover:underline",type:"button",children:s}),e[3]=s,e[4]=l,e[5]=c):c=e[5],c};const Tt=r=>{if(!(r instanceof se.Text))return;let e=Z(r.data);if(!/(pip\s+install|uv\s+add|uv\s+pip\s+install)/i.test(e))return;let n=[],s=/(pip\s+install|uv\s+add|uv\s+pip\s+install)\s+/gi,i;for(;(i=s.exec(e))!==null;){let a=i.index,o=Ft(e.slice(a));o&&n.push({match:i,result:o})}if(n.length===0)return;let l=[],c=0;if(n.forEach((a,o)=>{let{match:d,result:p}=a,m=d.index,f=m+p.endIndex;if(c<m){let j=e.slice(c,m);l.push((0,t.jsx)(q.Fragment,{children:$(j,`before-${o}`)},`before-${o}`))}let x=e.slice(m,f);l.push((0,t.jsx)(Ct,{packages:[p.package],children:x},`install-${o}`)),c=f}),c<e.length){let a=e.slice(c);l.push((0,t.jsx)(q.Fragment,{children:$(a,"after")},"after"))}return(0,t.jsx)(t.Fragment,{children:l})},St=r=>{if(!(r instanceof se.Text))return;let e=r.data;if(!/https?:\/\//.test(e))return;let n=$(e);if(typeof n!="string")return(0,t.jsx)(t.Fragment,{children:n})},At=(...r)=>e=>{for(let n of r){let s=n(e);if(s!==void 0)return s}},Et=(r,e)=>(0,t.jsx)("span",{children:Qe($t.ansi_to_html(r),{replace:n=>e(n)})}),zt=r=>{let e=(0,Ie.c)(4),{text:n}=r,s;e[0]===n?s=e[1]:(s=Et(n,At(Tt,St)),e[0]=n,e[1]=s);let i=s,l;return e[2]===i?l=e[3]:(l=(0,t.jsx)(t.Fragment,{children:i}),e[2]=i,e[3]=l),l};var ee=E(),$e=r=>{let e=(0,ee.c)(16),{traceback:n}=r,[s,i]=(0,q.useState)(!0),l;e[0]===s?l=e[1]:(l=()=>i(!s),e[0]=s,e[1]=l);let c=s?"Collapse traceback":"Expand traceback",a;e[2]===s?a=e[3]:(a=s?(0,t.jsx)(ae,{className:"h-3 w-3"}):(0,t.jsx)(rt,{className:"h-3 w-3"}),e[2]=s,e[3]=a);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("span",{className:"text-[0.6875rem] uppercase tracking-wider",children:"Traceback"}),e[4]=o):o=e[4];let d;e[5]!==s||e[6]!==l||e[7]!==c||e[8]!==a?(d=(0,t.jsxs)("button",{type:"button",onClick:l,"aria-expanded":s,"aria-label":c,className:"flex items-center gap-1 text-muted-foreground/70 hover:text-muted-foreground transition-colors",children:[a,o]}),e[5]=s,e[6]=l,e[7]=c,e[8]=a,e[9]=d):d=e[9];let p;e[10]!==s||e[11]!==n?(p=s&&(0,t.jsx)("div",{className:"font-code text-sm mt-1 p-3 bg-muted rounded border overflow-auto max-h-[50vh] cursor-text select-text",children:at({html:n})}),e[10]=s,e[11]=n,e[12]=p):p=e[12];let m;return e[13]!==d||e[14]!==p?(m=(0,t.jsxs)("div",{className:"mt-2",children:[d,p]}),e[13]=d,e[14]=p,e[15]=m):m=e[15],m},F=r=>{let e=(0,ee.c)(10),n=r.title??"Tip",s;e[0]===n?s=e[1]:(s=(0,t.jsx)(Ge,{className:"pt-2 pb-0 font-normal",children:n}),e[0]=n,e[1]=s);let i;e[2]===r.children?i=e[3]:(i=(0,t.jsx)(Xe,{className:"mr-24 text-[0.84375rem]",wrapperClassName:"pt-0 pb-2",children:r.children}),e[2]=r.children,e[3]=i);let l;e[4]!==s||e[5]!==i?(l=(0,t.jsxs)(Je,{value:"item-1",className:"text-muted-foreground",children:[s,i]}),e[4]=s,e[5]=i,e[6]=l):l=e[6];let c;return e[7]!==r.className||e[8]!==l?(c=(0,t.jsx)(Ke,{type:"single",collapsible:!0,className:r.className,children:l}),e[7]=r.className,e[8]=l,e[9]=c):c=e[9],c};const Mt=r=>{let e=(0,ee.c)(38),{errors:n,cellId:s,className:i}=r,l=Le(),c=re(He).display.cell_output==="above",a="This cell wasn't run because it has errors",o="destructive",d="text-error",p=null;if(n.some(qt))a="Interrupted";else if(n.some(Pt))a="An internal error occurred";else if(n.some(Lt))a="Ancestor prevented from running",o="default",d="text-secondary-foreground";else if(n.some(Wt))a="Ancestor stopped",o="default",d="text-secondary-foreground";else if(n.some(Dt))a="SQL error";else if(n.some(Ot))a=null,p="Cell not run";else{let w;e[0]===n?w=e[1]:(w=n.find(Bt),e[0]=n,e[1]=w);let I=w;I&&"exception_type"in I&&(a=I.exception_type)}let m,f,x,j,u,g;if(e[2]!==o||e[3]!==s||e[4]!==l||e[5]!==i||e[6]!==n||e[7]!==c||e[8]!==p||e[9]!==d||e[10]!==a){let w=n.filter(Qt),I=n.filter(Rt),P=n.filter(Vt),Q=n.filter(Ht),R=n.filter(Ut),L=n.filter(Gt),W=n.filter(Jt),V=n.filter(Kt),H=n.filter(Xt),U=n.filter(Yt),A=n.filter(Zt),G=n.filter(er),J=n.filter(tr),D;e[17]===l?D=e[18]:(D=()=>{l.openApplication("scratchpad")},e[17]=l,e[18]=D);let Fe=D,Ce=()=>{let N=[];if(A.length>0||G.length>0){let h=A.some(rr),_=!h&&A.some(sr);N.push((0,t.jsxs)("div",{children:[A.map(nr),G.map(lr),h&&(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>mt(l),children:[(0,t.jsx)(st,{className:"h-3.5 w-3.5 mr-1.5 mb-0.5"}),(0,t.jsx)("span",{children:"Open package manager"})]}),_&&(0,t.jsxs)(S,{size:"xs",variant:"outline",className:"mt-2 font-normal",onClick:()=>l.openApplication("terminal"),children:[(0,t.jsx)(me,{className:"h-3.5 w-3.5 mr-1.5"}),(0,t.jsx)("span",{children:"Open terminal"})]}),s&&(0,t.jsx)(b,{errors:[...A,...G],cellId:s})]},"syntax-unknown"))}if(w.length>0&&N.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"The setup cell cannot be run because it has references."}),(0,t.jsx)("ul",{className:"list-disc",children:w.flatMap(ir)}),s&&(0,t.jsx)(b,{errors:w,cellId:s}),(0,t.jsxs)(F,{title:"Why can't the setup cell have references?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"The setup cell contains logic that must be run before any other cell runs, including top-level imports used by top-level functions. For this reason, it can't refer to other cells' variables."}),(0,t.jsx)("p",{className:"py-2",children:"Try simplifying the setup cell to only contain only necessary variables."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-setup",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"setup-refs")),I.length>0&&N.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell is in a cycle."}),(0,t.jsx)("ul",{className:"list-disc",children:I.flatMap(ar)}),s&&(0,t.jsx)(b,{errors:I,cellId:s}),(0,t.jsxs)(F,{title:"What are cycles and how do I resolve them?",className:"mb-2",children:[(0,t.jsx)("p",{className:"pb-2",children:"An example of a cycle is if one cell declares a variable 'a' and reads 'b', and another cell declares 'b' and and reads 'a'. Cycles like this make it impossible for marimo to know how to run your cells, and generally suggest that your code has a bug."}),(0,t.jsx)("p",{className:"py-2",children:"Try merging these cells into a single cell to eliminate the cycle."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-cycles",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"cycle")),P.length>0){let h=P[0].name;N.push((0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground font-medium",children:"This cell redefines variables from other cells."}),P.map(or),s&&(0,t.jsx)(b,{errors:P,cellId:s}),(0,t.jsxs)(F,{title:"Why can't I redefine variables?",children:[(0,t.jsx)("p",{className:"pb-2",children:"marimo requires that each variable is defined in just one cell. This constraint enables reactive and reproducible execution, arbitrary cell reordering, seamless UI elements, execution as a script, and more."}),(0,t.jsxs)("p",{className:"py-2",children:["Try merging this cell with the mentioned cells or wrapping it in a function. Alternatively, prefix variables with an underscore (e.g., ",(0,t.jsxs)(oe,{className:"inline",children:["_",h]}),"). to make them private to this cell."]}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-multiple-definitions",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]}),(0,t.jsx)(F,{title:"Need a scratchpad?",children:(0,t.jsxs)("div",{className:"flex flex-row gap-2 items-center",children:[(0,t.jsxs)(S,{size:"xs",variant:"link",className:"my-2 font-normal mx-0 px-0",onClick:Fe,children:[(0,t.jsx)(Be,{className:"h-3"}),(0,t.jsx)("span",{children:"Try the scratchpad"})]}),(0,t.jsx)("span",{children:"to experiment without restrictions on variable names."})]})})]},"multiple-defs"))}return Q.length>0&&N.push((0,t.jsxs)("div",{children:[Q.map(mr),s&&(0,t.jsx)(b,{errors:Q,cellId:s}),(0,t.jsxs)(F,{title:"Why can't I use `import *`?",children:[(0,t.jsx)("p",{className:"pb-2",children:"Star imports are incompatible with marimo's git-friendly file format and reproducible reactive execution."}),(0,t.jsx)("p",{className:"py-2",children:"marimo's Python file format stores code in functions, so notebooks can be imported as regular Python modules without executing all their code. But Python disallows `import *` everywhere except at the top-level of a module."}),(0,t.jsx)("p",{className:"py-2",children:"Star imports would also silently add names to globals, which would be incompatible with reactive execution."}),(0,t.jsxs)("p",{className:"py-2",children:[(0,t.jsxs)(z,{href:"https://links.marimo.app/errors-import-star",children:["Learn more at our docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),"."]})]})]},"import-star")),R.length>0&&N.push((0,t.jsxs)("div",{children:[R.map(dr),s&&(0,t.jsx)(b,{errors:R,cellId:s})]},"interruption")),L.length>0&&N.push((0,t.jsxs)("ul",{children:[L.map((h,_)=>h.exception_type==="NameError"&&h.msg.startsWith("name 'mo'")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"name 'mo' is not defined."}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["The marimo module (imported as"," ",(0,t.jsx)(oe,{className:"inline",children:"mo"}),") is required for Markdown, SQL, and UI elements."]})]})},`exception-${_}`):h.exception_type==="NameError"&&h.msg.startsWith("name '_")?(0,t.jsx)("li",{className:"my-2",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:(0,t.jsx)(be,{segments:ue(h.msg)})}),(0,t.jsxs)("p",{className:"text-muted-foreground mt-2",children:["Variables prefixed with an underscore are local to a cell"," ","(",(0,t.jsxs)(z,{href:"https://links.marimo.app/local-variables",children:["docs"," ",(0,t.jsx)(M,{size:"0.75rem",className:"inline"})]}),")."]}),c&&(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]})},`exception-${_}`):(0,t.jsx)("li",{className:"my-2",children:h.raising_cell==null?(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:$(h.msg,`exception-${_}`)}),"traceback"in h&&h.traceback?(0,t.jsx)($e,{traceback:h.traceback}):c&&(0,t.jsx)("div",{className:"text-muted-foreground mt-2",children:"See the console area for a traceback."})]}):(0,t.jsxs)("div",{children:[$(h.msg,`exception-${_}`),(0,t.jsx)(k,{cellId:h.raising_cell}),"traceback"in h&&h.traceback&&(0,t.jsx)($e,{traceback:h.traceback})]})},`exception-${_}`)),L.some(pr)&&(0,t.jsx)(F,{children:"Fix the error in the mentioned cells, or handle the exceptions with try/except blocks."}),s&&(0,t.jsx)(b,{errors:L,cellId:s})]},"exception")),W.length>0&&N.push((0,t.jsxs)("ul",{children:[W.map(ur),s&&(0,t.jsx)(b,{errors:W,cellId:s}),(0,t.jsx)(F,{children:W.some(xr)?"Ensure that the referenced cells define the required variables, or turn off strict execution.":"Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."})]},"strict-exception")),V.length>0&&N.push((0,t.jsxs)("div",{children:[V.map(hr),s&&(0,t.jsx)(b,{errors:V,cellId:s})]},"internal")),H.length>0&&N.push((0,t.jsxs)("div",{children:[H.map(fr),s&&(0,t.jsx)(b,{errors:H,cellId:s})]},"ancestor-prevented")),U.length>0&&N.push((0,t.jsxs)("div",{children:[U.map(jr),s&&(0,t.jsx)(b,{errors:U,cellId:s})]},"ancestor-stopped")),J.length>0&&N.push((0,t.jsxs)("div",{children:[J.map(gr),s&&(0,t.jsx)(b,{errors:J,cellId:s,className:"mt-2.5"})]},"sql-errors")),N},C;e[19]===p?C=e[20]:(C=p&&(0,t.jsxs)("div",{className:"flex items-center gap-1 font-code text-[0.6875rem] uppercase tracking-wider text-muted-foreground/70",children:[p,(0,t.jsx)(B,{content:"marimo didn't run this cell because it detected an error.",delayDuration:200,children:(0,t.jsx)(We,{className:"size-3 cursor-help"})})]}),e[19]=p,e[20]=C);let T;e[21]!==d||e[22]!==a?(T=a&&(0,t.jsx)(ct,{className:`font-code font-medium ${d}`,children:a}),e[21]=d,e[22]=a,e[23]=T):T=e[23];let O;e[24]!==C||e[25]!==T?(O=(0,t.jsxs)("div",{className:"space-y-0.5",children:[C,T]}),e[24]=C,e[25]=T,e[26]=O):O=e[26];let Te=O;m=ot,j=o,e[27]===i?u=e[28]:(u=ne("border-none font-code text-sm text-[0.84375rem] p-0 text-muted-foreground normal has-[svg]:pl-0 space-y-2",i),e[27]=i,e[28]=u),g=Te,f="flex flex-col gap-4",x=Ce(),e[2]=o,e[3]=s,e[4]=l,e[5]=i,e[6]=n,e[7]=c,e[8]=p,e[9]=d,e[10]=a,e[11]=m,e[12]=f,e[13]=x,e[14]=j,e[15]=u,e[16]=g}else m=e[11],f=e[12],x=e[13],j=e[14],u=e[15],g=e[16];let y;e[29]!==f||e[30]!==x?(y=(0,t.jsx)("div",{className:f,children:x}),e[29]=f,e[30]=x,e[31]=y):y=e[31];let v;return e[32]!==m||e[33]!==j||e[34]!==u||e[35]!==g||e[36]!==y?(v=(0,t.jsxs)(m,{variant:j,className:u,children:[g,y]}),e[32]=m,e[33]=j,e[34]=u,e[35]=g,e[36]=y,e[37]=v):v=e[37],v};function qt(r){return r.type==="interruption"}function Pt(r){return r.type==="internal"}function Lt(r){return r.type==="ancestor-prevented"}function Wt(r){return r.type==="ancestor-stopped"}function Dt(r){return r.type==="sql-error"}function Ot(r){return r.type==="multiple-defs"||r.type==="cycle"||r.type==="setup-refs"||r.type==="import-star"}function Bt(r){return r.type==="exception"}function Qt(r){return r.type==="setup-refs"}function Rt(r){return r.type==="cycle"}function Vt(r){return r.type==="multiple-defs"}function Ht(r){return r.type==="import-star"}function Ut(r){return r.type==="interruption"}function Gt(r){return r.type==="exception"}function Jt(r){return r.type==="strict-exception"}function Kt(r){return r.type==="internal"}function Xt(r){return r.type==="ancestor-prevented"}function Yt(r){return r.type==="ancestor-stopped"}function Zt(r){return r.type==="syntax"}function er(r){return r.type==="unknown"}function tr(r){return r.type==="sql-error"}function rr(r){return r.msg.includes("!pip")}function sr(r){return r.msg.includes("use os.subprocess")}function nr(r,e){return(0,t.jsx)("pre",{children:$(r.msg,`syntax-${e}`)},`syntax-${e}`)}function lr(r,e){return(0,t.jsx)("pre",{children:$(r.msg,`unknown-${e}`)},`unknown-${e}`)}function ir(r,e){return r.edges_with_vars.map((n,s)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(k,{cellId:n[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[": "," ",n[1].length===1?n[1][0]:n[1].join(", ")]})]},`setup-refs-${e}-${s}`))}function ar(r,e){return r.edges_with_vars.map((n,s)=>(0,t.jsxs)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:[(0,t.jsx)(k,{cellId:n[0]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[" -> ",n[1].length===1?n[1][0]:n[1].join(", ")," -> "]}),(0,t.jsx)(k,{cellId:n[2]})]},`cycle-${e}-${s}`))}function cr(r,e){return(0,t.jsx)("li",{className:"my-0.5 ml-8 text-muted-foreground/40",children:(0,t.jsx)(k,{cellId:r})},`cell-${e}`)}function or(r,e){return(0,t.jsxs)(q.Fragment,{children:[(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:`'${r.name}' was also defined by:`}),(0,t.jsx)("ul",{className:"list-disc",children:r.cells.map(cr)})]},`multiple-defs-${e}`)}function mr(r,e){return(0,t.jsx)("p",{className:"text-muted-foreground",children:r.msg},`import-star-${e}`)}function dr(r,e){return(0,t.jsx)("p",{children:"This cell was interrupted and needs to be re-run."},`interruption-${e}`)}function pr(r){return r.raising_cell!=null}function ur(r,e){return(0,t.jsx)("li",{className:"my-2",children:r.blamed_cell==null?(0,t.jsx)("p",{children:r.msg}):(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(k,{cellId:r.blamed_cell})]})},`strict-exception-${e}`)}function xr(r){return r.blamed_cell!=null}function hr(r,e){return(0,t.jsx)("p",{children:r.msg},`internal-${e}`)}function fr(r,e){return(0,t.jsxs)("div",{children:[r.msg,r.blamed_cell==null?(0,t.jsxs)("span",{children:["(",(0,t.jsx)(k,{cellId:r.raising_cell}),")"]}):(0,t.jsxs)("span",{children:["(",(0,t.jsx)(k,{cellId:r.raising_cell}),"\xA0blames\xA0",(0,t.jsx)(k,{cellId:r.blamed_cell}),")"]})]},`ancestor-prevented-${e}`)}function jr(r,e){return(0,t.jsxs)("div",{children:[r.msg,(0,t.jsx)(k,{cellId:r.raising_cell})]},`ancestor-stopped-${e}`)}function gr(r,e){return(0,t.jsx)("div",{className:"space-y-2 mt-2",children:(0,t.jsx)("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.msg})},`sql-error-${e}`)}export{ye as a,me as c,be as i,zt as n,xt as o,ke as r,ue as s,Mt as t};
@@ -1 +1 @@
1
- import{s as Ce}from"./chunk-LvLJmgfZ.js";import{t as ye}from"./react-Bj1aDYRI.js";import{$ as Se,Y as ke,et as _e}from"./input-DqLOEfxi.js";import{D as Le,F as xe,I as v,L as Me,N as w,P as S,T as Fe,V as R,c as Ie,j as k,k as Pe,l as We,p as Ae,w as Ke,x as ne}from"./usePress-BSFUeqnS.js";import{t as He}from"./context-C2Ie4tn_.js";var Be=class{get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,n=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let i=r,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});t.push(l),l.currentNode=n,this._currentSetFor.add(l),r=n=i.host}else r=r.parentNode;let o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(o),o.currentNode=n,this._currentSetFor.add(o),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return k(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){var t;let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(t=this.filter)!=null&&t.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(t):(r=this.filter)!=null&&r.acceptNode&&(n=this.filter.acceptNode(t)),n===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let o=this.lastChild();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var l;if(i.nodeType===Node.ELEMENT_NODE){let a=i.shadowRoot;if(a){let d=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((l=this.filter)!=null&&l.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}};function oe(e,t,r,n){return xe()?new Be(e,t,r,n):e.createTreeWalker(t,r,n)}var h=Ce(ye(),1);function De(e,t){let r=(0,h.useRef)(!0),n=(0,h.useRef)(null),o=Ae(e);(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,h.useEffect)(()=>{let i=n.current;r.current?r.current=!1:(!i||t.some((l,a)=>!Object.is(l,i[a])))&&o(),n.current=t},t)}function z(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&r.overflow!=="hidden"&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function Oe(e,t){let r=e;for(z(r,t)&&(r=r.parentElement);r&&!z(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function ie(e,t){let r=[],n=document.scrollingElement||document.documentElement;do z(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function je(e){return Ke()?e.metaKey:e.ctrlKey}var ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ve(e){return e instanceof HTMLInputElement&&!ze.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var qe=0,q=new Map;function Ue(e){let[t,r]=(0,h.useState)();return R(()=>{if(!e)return;let n=q.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${qe++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},q.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),q.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function U(e,t,r={}){let{block:n="nearest",inline:o="nearest"}=r;if(e===t)return;let i=e.scrollTop,l=e.scrollLeft,a=t.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.getComputedStyle(t),s=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,u=e===f?0:d.top,N=e===f?e.clientHeight:d.bottom,b=e===f?0:d.left,P=e===f?e.clientWidth:d.right,_=parseInt(c.scrollMarginTop,10)||0,pe=parseInt(c.scrollMarginBottom,10)||0,Ne=parseInt(c.scrollMarginLeft,10)||0,me=parseInt(c.scrollMarginRight,10)||0,be=parseInt(s.scrollPaddingTop,10)||0,ve=parseInt(s.scrollPaddingBottom,10)||0,Ee=parseInt(s.scrollPaddingLeft,10)||0,ge=parseInt(s.scrollPaddingRight,10)||0,Q=parseInt(s.borderTopWidth,10)||0,Z=parseInt(s.borderBottomWidth,10)||0,ee=parseInt(s.borderLeftWidth,10)||0,te=parseInt(s.borderRightWidth,10)||0,W=a.top-_,A=a.bottom+pe,K=a.left-Ne,H=a.right+me,Te=e===f?0:ee+te,we=e===f?0:Q+Z,re=e.offsetWidth-e.clientWidth-Te,Re=e.offsetHeight-e.clientHeight-we,B=u+Q+be,D=N-Z-ve-Re,L=b+ee+Ee,x=P-te-ge;s.direction==="rtl"&&!Le()?L+=re:x-=re;let O=W<B||A>D,j=K<L||H>x;if(O&&n==="start")i+=W-B;else if(O&&n==="center")i+=(W+A)/2-(B+D)/2;else if(O&&n==="end")i+=A-D;else if(O&&n==="nearest"){let M=W-B,F=A-D;i+=Math.abs(M)<=Math.abs(F)?M:F}if(j&&o==="start")l+=K-L;else if(j&&o==="center")l+=(K+H)/2-(L+x)/2;else if(j&&o==="end")l+=H-x;else if(j&&o==="nearest"){let M=K-L,F=H-x;l+=Math.abs(M)<=Math.abs(F)?M:F}e.scrollTo({left:l,top:i})}function $e(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let l=document.scrollingElement||document.documentElement;if(window.getComputedStyle(l).overflow!=="hidden"&&!ne()){var n;let{left:a,top:d}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)==null||n.call(e,{block:"nearest"});let{left:c,top:s}=e.getBoundingClientRect();if(Math.abs(a-c)>1||Math.abs(d-s)>1){var o,i;r==null||(o=r.scrollIntoView)==null||o.call(r,{block:"center",inline:"center"}),(i=e.scrollIntoView)==null||i.call(e,{block:"nearest"})}}else{let{left:a,top:d}=e.getBoundingClientRect(),c=ie(e,!0);for(let u of c)U(u,e);let{left:s,top:f}=e.getBoundingClientRect();if(Math.abs(a-s)>1||Math.abs(d-f)>1){c=r?ie(r,!0):[];for(let u of c)U(u,r,{block:"center",inline:"center"})}}}}var $=new Map;function Ye(e){let{locale:t}=He(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($.has(r))return $.get(r);let n=new Intl.Collator(t,e);return $.set(r,n),n}var le=h.createContext(null),Y="react-aria-focus-scope-restore",p=null;function Ge(e){let{children:t,contain:r,restoreFocus:n,autoFocus:o}=e,i=(0,h.useRef)(null),l=(0,h.useRef)(null),a=(0,h.useRef)([]),{parentNode:d}=(0,h.useContext)(le)||{},c=(0,h.useMemo)(()=>new X({scopeRef:a}),[a]);R(()=>{let u=d||m.root;if(m.getTreeNode(u.scopeRef)&&p&&!V(p,u.scopeRef)){let N=m.getTreeNode(p);N&&(u=N)}u.addChild(c),m.addNode(c)},[c,d]),R(()=>{let u=m.getTreeNode(a);u&&(u.contain=!!r)},[r]),R(()=>{var P;let u=(P=i.current)==null?void 0:P.nextSibling,N=[],b=_=>_.stopPropagation();for(;u&&u!==l.current;)N.push(u),u.addEventListener(Y,b),u=u.nextSibling;return a.current=N,()=>{for(let _ of N)_.removeEventListener(Y,b)}},[t]),rt(a,n,r),Ze(a,r),nt(a,n,r),tt(a,o),(0,h.useEffect)(()=>{let u=w(v(a.current?a.current[0]:void 0)),N=null;if(T(u,a.current)){for(let b of m.traverse())b.scopeRef&&T(u,b.scopeRef.current)&&(N=b);N===m.getTreeNode(a)&&(p=N.scopeRef)}},[a]),R(()=>()=>{var N,b;let u=((b=(N=m.getTreeNode(a))==null?void 0:N.parent)==null?void 0:b.scopeRef)??null;(a===p||V(a,p))&&(!u||m.getTreeNode(u))&&(p=u),m.removeTreeNode(a)},[a]);let s=(0,h.useMemo)(()=>Je(a),[]),f=(0,h.useMemo)(()=>({focusManager:s,parentNode:c}),[c,s]);return h.createElement(le.Provider,{value:f},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}function Je(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[0].previousElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.nextNode();return!s&&i&&(c.currentNode=d,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[r.length-1].nextElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.previousNode();return!s&&i&&(c.currentNode=d,s=c.previousNode()),s&&E(s,!0),s},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let l=i.nextNode();return l&&E(l,!0),l},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let l=i.previousNode();return l&&E(l,!0),l}}}function y(e){return e[0].parentElement}function I(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Xe(e){if(!e.form)return Array.from(v(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(n=>!n.form);let t=e.form.elements.namedItem(e.name),r=Me(e);return t instanceof r.RadioNodeList?Array.from(t).filter(n=>n instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}function Qe(e){if(e.checked)return!0;let t=Xe(e);return t.length>0&&!t.some(r=>r.checked)}function Ze(e,t){let r=(0,h.useRef)(void 0),n=(0,h.useRef)(void 0);R(()=>{let o=e.current;if(!t){n.current&&(n.current=(cancelAnimationFrame(n.current),void 0));return}let i=v(o?o[0]:void 0),l=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!I(e)||c.isComposing)return;let s=w(i),f=e.current;if(!f||!T(s,f))return;let u=g(y(f),{tabbable:!0},f);if(!s)return;u.currentNode=s;let N=c.shiftKey?u.previousNode():u.nextNode();N||(N=(u.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,c.shiftKey?u.previousNode():u.nextNode())),c.preventDefault(),N&&E(N,!0)},a=c=>{(!p||V(p,e))&&T(S(c),e.current)?(p=e,r.current=S(c)):I(e)&&!C(S(c),e)?r.current?r.current.focus():p&&p.current&&G(p.current):I(e)&&(r.current=S(c))},d=c=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let s=_e(),f=(s==="virtual"||s===null)&&Fe()&&ne(),u=w(i);if(!f&&u&&I(e)&&!C(u,e)){p=e;let b=S(c);if(b&&b.isConnected){var N;r.current=b,(N=r.current)==null||N.focus()}else p.current&&G(p.current)}})};return i.addEventListener("keydown",l,!1),i.addEventListener("focusin",a,!1),o==null||o.forEach(c=>c.addEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",d,!1)),()=>{i.removeEventListener("keydown",l,!1),i.removeEventListener("focusin",a,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",d,!1))}},[e,t]),R(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function ce(e){return C(e)}function T(e,t){return!e||!t?!1:t.some(r=>k(r,e))}function C(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of m.traverse(m.getTreeNode(t)))if(r&&T(e,r.current))return!0;return!1}function et(e){return C(e,p)}function V(e,t){var n;let r=(n=m.getTreeNode(t))==null?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function E(e,t=!1){if(e!=null&&!t)try{Se(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function se(e,t=!0){let r=e[0].previousElementSibling,n=y(e),o=g(n,{tabbable:t},e);o.currentNode=r;let i=o.nextNode();return t&&!i&&(n=y(e),o=g(n,{tabbable:!1},e),o.currentNode=r,i=o.nextNode()),i}function G(e,t=!0){E(se(e,t))}function tt(e,t){let r=h.useRef(t);(0,h.useEffect)(()=>{r.current&&(p=e,!T(w(v(e.current?e.current[0]:void 0)),p.current)&&e.current&&G(e.current)),r.current=!1},[e])}function rt(e,t,r){R(()=>{if(t||r)return;let n=e.current,o=v(n?n[0]:void 0),i=l=>{let a=S(l);T(a,e.current)?p=e:ce(a)||(p=null)};return o.addEventListener("focusin",i,!1),n==null||n.forEach(l=>l.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),n==null||n.forEach(l=>l.removeEventListener("focusin",i,!1))}},[e,t,r])}function ae(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function nt(e,t,r){let n=(0,h.useRef)(typeof document<"u"?w(v(e.current?e.current[0]:void 0)):null);R(()=>{let o=e.current,i=v(o?o[0]:void 0);if(!t||r)return;let l=()=>{(!p||V(p,e))&&T(w(i),e.current)&&(p=e)};return i.addEventListener("focusin",l,!1),o==null||o.forEach(a=>a.addEventListener("focusin",l,!1)),()=>{i.removeEventListener("focusin",l,!1),o==null||o.forEach(a=>a.removeEventListener("focusin",l,!1))}},[e,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!I(e)||l.isComposing)return;let a=o.activeElement;if(!C(a,e)||!ae(e))return;let d=m.getTreeNode(e);if(!d)return;let c=d.nodeToRestore,s=g(o.body,{tabbable:!0});s.currentNode=a;let f=l.shiftKey?s.previousNode():s.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,d.nodeToRestore=void 0),(!f||!C(f,e))&&c){s.currentNode=c;do f=l.shiftKey?s.previousNode():s.nextNode();while(C(f,e));l.preventDefault(),l.stopPropagation(),f?E(f,!0):ce(c)?E(c,!0):a.blur()}};return r||o.addEventListener("keydown",i,!0),()=>{r||o.removeEventListener("keydown",i,!0)}},[e,t,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=m.getTreeNode(e);if(i)return i.nodeToRestore=n.current??void 0,()=>{let l=m.getTreeNode(e);if(!l)return;let a=l.nodeToRestore,d=w(o);if(t&&a&&(d&&C(d,e)||d===o.body&&ae(e))){let c=m.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let s=c.getTreeNode(e);for(;s;){if(s.nodeToRestore&&s.nodeToRestore.isConnected){ue(s.nodeToRestore);return}s=s.parent}for(s=c.getTreeNode(e);s;){if(s.scopeRef&&s.scopeRef.current&&m.getTreeNode(s.scopeRef)){ue(se(s.scopeRef.current,!0));return}s=s.parent}}})}}},[e,t])}function ue(e){e.dispatchEvent(new CustomEvent(Y,{bubbles:!0,cancelable:!0}))&&E(e)}function g(e,t,r){let n=t!=null&&t.tabbable?We:Ie,o=v((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),i=oe(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return k(t==null?void 0:t.from,l)||t!=null&&t.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!Qe(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:n(l)&&(!r||T(l,r))&&(!(t!=null&&t.accept)||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function ot(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});k(n,d)&&(c.currentNode=d);let s=c.nextNode();return!s&&l&&(c.currentNode=n,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});if(k(n,d))c.currentNode=d;else{let f=J(c);return f&&E(f,!0),f??null}let s=c.previousNode();if(!s&&l){c.currentNode=n;let f=J(c);if(!f)return null;s=f}return s&&E(s,!0),s??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=g(n,{tabbable:o,accept:i}).nextNode();return l&&E(l,!0),l},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=J(g(n,{tabbable:o,accept:i}));return l&&E(l,!0),l??null}}}function J(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var it=class he{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let o=this.fastMap.get(r??null);if(!o)return;let i=new X({scopeRef:t});o.addChild(i),i.parent=o,this.fastMap.set(t,i),n&&(i.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let i of this.traverse())i!==r&&r.nodeToRestore&&i.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&T(i.nodeToRestore,r.scopeRef.current)&&(i.nodeToRestore=r.nodeToRestore);let o=r.children;n&&(n.removeChild(r),o.size>0&&o.forEach(i=>n&&n.addChild(i))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var r;let t=new he;for(let n of this.traverse())t.addTreeNode(n.scopeRef,((r=n.parent)==null?void 0:r.scopeRef)??null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X({scopeRef:null}),this.fastMap.set(null,this.root)}},X=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},m=new it,de={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function fe(e={}){let{style:t,isFocusable:r}=e,[n,o]=(0,h.useState)(!1),{focusWithinProps:i}=ke({isDisabled:!r,onFocusWithinChange:a=>o(a)}),l=(0,h.useMemo)(()=>n?t:t?{...de,...t}:de,[n]);return{visuallyHiddenProps:{...i,style:l}}}function lt(e){let{children:t,elementType:r="div",isFocusable:n,style:o,...i}=e,{visuallyHiddenProps:l}=fe(e);return h.createElement(r,Pe(i,l),t)}var ct=(0,h.createContext)(null);(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null);var st=(0,h.createContext)({}),at=(0,h.createContext)(null);(0,h.createContext)(null);export{z as _,fe as a,g as c,U as d,$e as f,Oe as g,Ve as h,lt as i,ot as l,je as m,at as n,et as o,Ue as p,st as r,Ge as s,ct as t,Ye as u,De as v,oe as y};
1
+ import{s as Ce}from"./chunk-LvLJmgfZ.js";import{t as ye}from"./react-Bj1aDYRI.js";import{$ as Se,Y as ke,et as _e}from"./input-DB2LiTiQ.js";import{D as Le,F as xe,I as v,L as Me,N as w,P as S,T as Fe,V as R,c as Ie,j as k,k as Pe,l as We,p as Ae,w as Ke,x as ne}from"./usePress-BSFUeqnS.js";import{t as He}from"./context-C2Ie4tn_.js";var Be=class{get currentNode(){return this._currentNode}set currentNode(e){if(!k(this.root,e))throw Error("Cannot set currentNode to a node that is not contained by the root node.");let t=[],r=e,n=e;for(this._currentNode=e;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let i=r,l=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});t.push(l),l.currentNode=n,this._currentSetFor.add(l),r=n=i.host}else r=r.parentNode;let o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(o),o.currentNode=n,this._currentSetFor.add(o),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return k(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){var t;let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(t=this.filter)!=null&&t.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.nextNode();return r&&(this.currentNode=r),r}else return null}previousNode(){var r;let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let n;if(typeof this.filter=="function"?n=this.filter(t):(r=this.filter)!=null&&r.acceptNode&&(n=this.filter.acceptNode(t)),n===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let o=this.lastChild();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let n=this.previousNode();return n&&(this.currentNode=n),n}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,t,r,n){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var l;if(i.nodeType===Node.ELEMENT_NODE){let a=i.shadowRoot;if(a){let d=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(d),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((l=this.filter)!=null&&l.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=n??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,r,this._acceptNode));let o=t.shadowRoot;if(o){let i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}};function oe(e,t,r,n){return xe()?new Be(e,t,r,n):e.createTreeWalker(t,r,n)}var h=Ce(ye(),1);function De(e,t){let r=(0,h.useRef)(!0),n=(0,h.useRef)(null),o=Ae(e);(0,h.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,h.useEffect)(()=>{let i=n.current;r.current?r.current=!1:(!i||t.some((l,a)=>!Object.is(l,i[a])))&&o(),n.current=t},t)}function z(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,o=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&r.overflow!=="hidden"&&(o=!0),o&&t&&(o=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),o}function Oe(e,t){let r=e;for(z(r,t)&&(r=r.parentElement);r&&!z(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function ie(e,t){let r=[],n=document.scrollingElement||document.documentElement;do z(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function je(e){return Ke()?e.metaKey:e.ctrlKey}var ze=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ve(e){return e instanceof HTMLInputElement&&!ze.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var qe=0,q=new Map;function Ue(e){let[t,r]=(0,h.useState)();return R(()=>{if(!e)return;let n=q.get(e);if(n)r(n.element.id);else{let o=`react-aria-description-${qe++}`;r(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),n={refCount:0,element:i},q.set(e,n)}return n.refCount++,()=>{n&&--n.refCount===0&&(n.element.remove(),q.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function U(e,t,r={}){let{block:n="nearest",inline:o="nearest"}=r;if(e===t)return;let i=e.scrollTop,l=e.scrollLeft,a=t.getBoundingClientRect(),d=e.getBoundingClientRect(),c=window.getComputedStyle(t),s=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,u=e===f?0:d.top,N=e===f?e.clientHeight:d.bottom,b=e===f?0:d.left,P=e===f?e.clientWidth:d.right,_=parseInt(c.scrollMarginTop,10)||0,pe=parseInt(c.scrollMarginBottom,10)||0,Ne=parseInt(c.scrollMarginLeft,10)||0,me=parseInt(c.scrollMarginRight,10)||0,be=parseInt(s.scrollPaddingTop,10)||0,ve=parseInt(s.scrollPaddingBottom,10)||0,Ee=parseInt(s.scrollPaddingLeft,10)||0,ge=parseInt(s.scrollPaddingRight,10)||0,Q=parseInt(s.borderTopWidth,10)||0,Z=parseInt(s.borderBottomWidth,10)||0,ee=parseInt(s.borderLeftWidth,10)||0,te=parseInt(s.borderRightWidth,10)||0,W=a.top-_,A=a.bottom+pe,K=a.left-Ne,H=a.right+me,Te=e===f?0:ee+te,we=e===f?0:Q+Z,re=e.offsetWidth-e.clientWidth-Te,Re=e.offsetHeight-e.clientHeight-we,B=u+Q+be,D=N-Z-ve-Re,L=b+ee+Ee,x=P-te-ge;s.direction==="rtl"&&!Le()?L+=re:x-=re;let O=W<B||A>D,j=K<L||H>x;if(O&&n==="start")i+=W-B;else if(O&&n==="center")i+=(W+A)/2-(B+D)/2;else if(O&&n==="end")i+=A-D;else if(O&&n==="nearest"){let M=W-B,F=A-D;i+=Math.abs(M)<=Math.abs(F)?M:F}if(j&&o==="start")l+=K-L;else if(j&&o==="center")l+=(K+H)/2-(L+x)/2;else if(j&&o==="end")l+=H-x;else if(j&&o==="nearest"){let M=K-L,F=H-x;l+=Math.abs(M)<=Math.abs(F)?M:F}e.scrollTo({left:l,top:i})}function $e(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let l=document.scrollingElement||document.documentElement;if(window.getComputedStyle(l).overflow!=="hidden"&&!ne()){var n;let{left:a,top:d}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)==null||n.call(e,{block:"nearest"});let{left:c,top:s}=e.getBoundingClientRect();if(Math.abs(a-c)>1||Math.abs(d-s)>1){var o,i;r==null||(o=r.scrollIntoView)==null||o.call(r,{block:"center",inline:"center"}),(i=e.scrollIntoView)==null||i.call(e,{block:"nearest"})}}else{let{left:a,top:d}=e.getBoundingClientRect(),c=ie(e,!0);for(let u of c)U(u,e);let{left:s,top:f}=e.getBoundingClientRect();if(Math.abs(a-s)>1||Math.abs(d-f)>1){c=r?ie(r,!0):[];for(let u of c)U(u,r,{block:"center",inline:"center"})}}}}var $=new Map;function Ye(e){let{locale:t}=He(),r=t+(e?Object.entries(e).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if($.has(r))return $.get(r);let n=new Intl.Collator(t,e);return $.set(r,n),n}var le=h.createContext(null),Y="react-aria-focus-scope-restore",p=null;function Ge(e){let{children:t,contain:r,restoreFocus:n,autoFocus:o}=e,i=(0,h.useRef)(null),l=(0,h.useRef)(null),a=(0,h.useRef)([]),{parentNode:d}=(0,h.useContext)(le)||{},c=(0,h.useMemo)(()=>new X({scopeRef:a}),[a]);R(()=>{let u=d||m.root;if(m.getTreeNode(u.scopeRef)&&p&&!V(p,u.scopeRef)){let N=m.getTreeNode(p);N&&(u=N)}u.addChild(c),m.addNode(c)},[c,d]),R(()=>{let u=m.getTreeNode(a);u&&(u.contain=!!r)},[r]),R(()=>{var P;let u=(P=i.current)==null?void 0:P.nextSibling,N=[],b=_=>_.stopPropagation();for(;u&&u!==l.current;)N.push(u),u.addEventListener(Y,b),u=u.nextSibling;return a.current=N,()=>{for(let _ of N)_.removeEventListener(Y,b)}},[t]),rt(a,n,r),Ze(a,r),nt(a,n,r),tt(a,o),(0,h.useEffect)(()=>{let u=w(v(a.current?a.current[0]:void 0)),N=null;if(T(u,a.current)){for(let b of m.traverse())b.scopeRef&&T(u,b.scopeRef.current)&&(N=b);N===m.getTreeNode(a)&&(p=N.scopeRef)}},[a]),R(()=>()=>{var N,b;let u=((b=(N=m.getTreeNode(a))==null?void 0:N.parent)==null?void 0:b.scopeRef)??null;(a===p||V(a,p))&&(!u||m.getTreeNode(u))&&(p=u),m.removeTreeNode(a)},[a]);let s=(0,h.useMemo)(()=>Je(a),[]),f=(0,h.useMemo)(()=>({focusManager:s,parentNode:c}),[c,s]);return h.createElement(le.Provider,{value:f},h.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:i}),t,h.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:l}))}function Je(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[0].previousElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.nextNode();return!s&&i&&(c.currentNode=d,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(t={}){let r=e.current,{from:n,tabbable:o,wrap:i,accept:l}=t,a=n||w(v(r[0]??void 0)),d=r[r.length-1].nextElementSibling,c=g(y(r),{tabbable:o,accept:l},r);c.currentNode=T(a,r)?a:d;let s=c.previousNode();return!s&&i&&(c.currentNode=d,s=c.previousNode()),s&&E(s,!0),s},focusFirst(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[0].previousElementSibling;let l=i.nextNode();return l&&E(l,!0),l},focusLast(t={}){let r=e.current,{tabbable:n,accept:o}=t,i=g(y(r),{tabbable:n,accept:o},r);i.currentNode=r[r.length-1].nextElementSibling;let l=i.previousNode();return l&&E(l,!0),l}}}function y(e){return e[0].parentElement}function I(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function Xe(e){if(!e.form)return Array.from(v(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(n=>!n.form);let t=e.form.elements.namedItem(e.name),r=Me(e);return t instanceof r.RadioNodeList?Array.from(t).filter(n=>n instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}function Qe(e){if(e.checked)return!0;let t=Xe(e);return t.length>0&&!t.some(r=>r.checked)}function Ze(e,t){let r=(0,h.useRef)(void 0),n=(0,h.useRef)(void 0);R(()=>{let o=e.current;if(!t){n.current&&(n.current=(cancelAnimationFrame(n.current),void 0));return}let i=v(o?o[0]:void 0),l=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!I(e)||c.isComposing)return;let s=w(i),f=e.current;if(!f||!T(s,f))return;let u=g(y(f),{tabbable:!0},f);if(!s)return;u.currentNode=s;let N=c.shiftKey?u.previousNode():u.nextNode();N||(N=(u.currentNode=c.shiftKey?f[f.length-1].nextElementSibling:f[0].previousElementSibling,c.shiftKey?u.previousNode():u.nextNode())),c.preventDefault(),N&&E(N,!0)},a=c=>{(!p||V(p,e))&&T(S(c),e.current)?(p=e,r.current=S(c)):I(e)&&!C(S(c),e)?r.current?r.current.focus():p&&p.current&&G(p.current):I(e)&&(r.current=S(c))},d=c=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{let s=_e(),f=(s==="virtual"||s===null)&&Fe()&&ne(),u=w(i);if(!f&&u&&I(e)&&!C(u,e)){p=e;let b=S(c);if(b&&b.isConnected){var N;r.current=b,(N=r.current)==null||N.focus()}else p.current&&G(p.current)}})};return i.addEventListener("keydown",l,!1),i.addEventListener("focusin",a,!1),o==null||o.forEach(c=>c.addEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.addEventListener("focusout",d,!1)),()=>{i.removeEventListener("keydown",l,!1),i.removeEventListener("focusin",a,!1),o==null||o.forEach(c=>c.removeEventListener("focusin",a,!1)),o==null||o.forEach(c=>c.removeEventListener("focusout",d,!1))}},[e,t]),R(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}function ce(e){return C(e)}function T(e,t){return!e||!t?!1:t.some(r=>k(r,e))}function C(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of m.traverse(m.getTreeNode(t)))if(r&&T(e,r.current))return!0;return!1}function et(e){return C(e,p)}function V(e,t){var n;let r=(n=m.getTreeNode(t))==null?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function E(e,t=!1){if(e!=null&&!t)try{Se(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function se(e,t=!0){let r=e[0].previousElementSibling,n=y(e),o=g(n,{tabbable:t},e);o.currentNode=r;let i=o.nextNode();return t&&!i&&(n=y(e),o=g(n,{tabbable:!1},e),o.currentNode=r,i=o.nextNode()),i}function G(e,t=!0){E(se(e,t))}function tt(e,t){let r=h.useRef(t);(0,h.useEffect)(()=>{r.current&&(p=e,!T(w(v(e.current?e.current[0]:void 0)),p.current)&&e.current&&G(e.current)),r.current=!1},[e])}function rt(e,t,r){R(()=>{if(t||r)return;let n=e.current,o=v(n?n[0]:void 0),i=l=>{let a=S(l);T(a,e.current)?p=e:ce(a)||(p=null)};return o.addEventListener("focusin",i,!1),n==null||n.forEach(l=>l.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),n==null||n.forEach(l=>l.removeEventListener("focusin",i,!1))}},[e,t,r])}function ae(e){let t=m.getTreeNode(p);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(t==null?void 0:t.scopeRef)===e}function nt(e,t,r){let n=(0,h.useRef)(typeof document<"u"?w(v(e.current?e.current[0]:void 0)):null);R(()=>{let o=e.current,i=v(o?o[0]:void 0);if(!t||r)return;let l=()=>{(!p||V(p,e))&&T(w(i),e.current)&&(p=e)};return i.addEventListener("focusin",l,!1),o==null||o.forEach(a=>a.addEventListener("focusin",l,!1)),()=>{i.removeEventListener("focusin",l,!1),o==null||o.forEach(a=>a.removeEventListener("focusin",l,!1))}},[e,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=l=>{if(l.key!=="Tab"||l.altKey||l.ctrlKey||l.metaKey||!I(e)||l.isComposing)return;let a=o.activeElement;if(!C(a,e)||!ae(e))return;let d=m.getTreeNode(e);if(!d)return;let c=d.nodeToRestore,s=g(o.body,{tabbable:!0});s.currentNode=a;let f=l.shiftKey?s.previousNode():s.nextNode();if((!c||!c.isConnected||c===o.body)&&(c=void 0,d.nodeToRestore=void 0),(!f||!C(f,e))&&c){s.currentNode=c;do f=l.shiftKey?s.previousNode():s.nextNode();while(C(f,e));l.preventDefault(),l.stopPropagation(),f?E(f,!0):ce(c)?E(c,!0):a.blur()}};return r||o.addEventListener("keydown",i,!0),()=>{r||o.removeEventListener("keydown",i,!0)}},[e,t,r]),R(()=>{let o=v(e.current?e.current[0]:void 0);if(!t)return;let i=m.getTreeNode(e);if(i)return i.nodeToRestore=n.current??void 0,()=>{let l=m.getTreeNode(e);if(!l)return;let a=l.nodeToRestore,d=w(o);if(t&&a&&(d&&C(d,e)||d===o.body&&ae(e))){let c=m.clone();requestAnimationFrame(()=>{if(o.activeElement===o.body){let s=c.getTreeNode(e);for(;s;){if(s.nodeToRestore&&s.nodeToRestore.isConnected){ue(s.nodeToRestore);return}s=s.parent}for(s=c.getTreeNode(e);s;){if(s.scopeRef&&s.scopeRef.current&&m.getTreeNode(s.scopeRef)){ue(se(s.scopeRef.current,!0));return}s=s.parent}}})}}},[e,t])}function ue(e){e.dispatchEvent(new CustomEvent(Y,{bubbles:!0,cancelable:!0}))&&E(e)}function g(e,t,r){let n=t!=null&&t.tabbable?We:Ie,o=v((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),i=oe(o,e||o,NodeFilter.SHOW_ELEMENT,{acceptNode(l){return k(t==null?void 0:t.from,l)||t!=null&&t.tabbable&&l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(!Qe(l)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===l.name)?NodeFilter.FILTER_REJECT:n(l)&&(!r||T(l,r))&&(!(t!=null&&t.accept)||t.accept(l))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(i.currentNode=t.from),i}function ot(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});k(n,d)&&(c.currentNode=d);let s=c.nextNode();return!s&&l&&(c.currentNode=n,s=c.nextNode()),s&&E(s,!0),s},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:o,tabbable:i=t.tabbable,wrap:l=t.wrap,accept:a=t.accept}=r,d=o||w(v(n)),c=g(n,{tabbable:i,accept:a});if(k(n,d))c.currentNode=d;else{let f=J(c);return f&&E(f,!0),f??null}let s=c.previousNode();if(!s&&l){c.currentNode=n;let f=J(c);if(!f)return null;s=f}return s&&E(s,!0),s??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=g(n,{tabbable:o,accept:i}).nextNode();return l&&E(l,!0),l},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:o=t.tabbable,accept:i=t.accept}=r,l=J(g(n,{tabbable:o,accept:i}));return l&&E(l,!0),l??null}}}function J(e){let t,r;do r=e.lastChild(),r&&(t=r);while(r);return t}var it=class he{get size(){return this.fastMap.size}getTreeNode(t){return this.fastMap.get(t)}addTreeNode(t,r,n){let o=this.fastMap.get(r??null);if(!o)return;let i=new X({scopeRef:t});o.addChild(i),i.parent=o,this.fastMap.set(t,i),n&&(i.nodeToRestore=n)}addNode(t){this.fastMap.set(t.scopeRef,t)}removeTreeNode(t){if(t===null)return;let r=this.fastMap.get(t);if(!r)return;let n=r.parent;for(let i of this.traverse())i!==r&&r.nodeToRestore&&i.nodeToRestore&&r.scopeRef&&r.scopeRef.current&&T(i.nodeToRestore,r.scopeRef.current)&&(i.nodeToRestore=r.nodeToRestore);let o=r.children;n&&(n.removeChild(r),o.size>0&&o.forEach(i=>n&&n.addChild(i))),this.fastMap.delete(r.scopeRef)}*traverse(t=this.root){if(t.scopeRef!=null&&(yield t),t.children.size>0)for(let r of t.children)yield*this.traverse(r)}clone(){var r;let t=new he;for(let n of this.traverse())t.addTreeNode(n.scopeRef,((r=n.parent)==null?void 0:r.scopeRef)??null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new X({scopeRef:null}),this.fastMap.set(null,this.root)}},X=class{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}},m=new it,de={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function fe(e={}){let{style:t,isFocusable:r}=e,[n,o]=(0,h.useState)(!1),{focusWithinProps:i}=ke({isDisabled:!r,onFocusWithinChange:a=>o(a)}),l=(0,h.useMemo)(()=>n?t:t?{...de,...t}:de,[n]);return{visuallyHiddenProps:{...i,style:l}}}function lt(e){let{children:t,elementType:r="div",isFocusable:n,style:o,...i}=e,{visuallyHiddenProps:l}=fe(e);return h.createElement(r,Pe(i,l),t)}var ct=(0,h.createContext)(null);(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null),(0,h.createContext)(null);var st=(0,h.createContext)({}),at=(0,h.createContext)(null);(0,h.createContext)(null);export{z as _,fe as a,g as c,U as d,$e as f,Oe as g,Ve as h,lt as i,ot as l,je as m,at as n,et as o,Ue as p,st as r,Ge as s,ct as t,Ye as u,De as v,oe as y};
@@ -1 +1 @@
1
- import{s as y}from"./chunk-LvLJmgfZ.js";import{i as E,p as T,u as C}from"./useEvent-D91BmmQi.js";import{t as M}from"./react-Bj1aDYRI.js";import{Si as f,bn as k,m as H,ot as j,wn as I,xi as L,xt as N}from"./cells-CHWMpikY.js";import{t as g}from"./compiler-runtime-B3qBwwSJ.js";import{_ as w}from"./useEventListener-Wyg6Md5s.js";import{c as _}from"./utils-Dcn8htEz.js";import{t as A}from"./jsx-runtime-PbYoItBR.js";import{t as F}from"./tooltip-DfvClvB6.js";import{t as O}from"./copy-icon-CeGeeBdW.js";import{t as V}from"./usePress-BSFUeqnS.js";import{n as W}from"./useDebounce-CpLI2dsc.js";import{t as R}from"./useRunCells-CXNnlQUh.js";var q=g(),u=y(M(),1),l=y(A(),1);const z=e=>{let t=(0,q.c)(16),r,n,i;t[0]===e?(r=t[1],n=t[2],i=t[3]):({href:n,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=i);let a=(0,u.useRef)(null),o;t[4]===n?o=t[5]:(o=()=>{let h=new URL(globalThis.location.href);h.hash=n,globalThis.history.pushState({},"",h.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=n.slice(1),v=document.getElementById(S);v&&v.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=n,t[5]=o);let s=o,c;t[6]===s?c=t[7]:(c={onPress:()=>{s()}},t[6]=s,t[7]=c);let{pressProps:d}=V(c),m;t[8]===s?m=t[9]:(m=h=>{h.preventDefault(),s()},t[8]=s,t[9]=m);let b=m,p;return t[10]!==r||t[11]!==b||t[12]!==n||t[13]!==d||t[14]!==i?(p=(0,l.jsx)("a",{ref:a,href:n,...d,onClick:b,...i,children:r}),t[10]=r,t[11]=b,t[12]=n,t[13]=d,t[14]=i,t[15]=p):p=t[15],p};async function $(e){let t=H().inOrderIds.at(0);if(t)try{let r=await k.request({document:e,cellId:t});if(!r||r.options.length===0)return;let n=e.split(".").pop()??e,i=r.options[0],a=r.options.find(o=>o.name===n)??i;a!=null&&a.completion_info&&E.set(I,{documentation:a.completion_info})}catch(r){w.debug(`Doc lookup failed for "${e}"`,r)}}var P=g();const D=e=>{let t=(0,P.c)(8),{qualifiedName:r,children:n}=e,i;t[0]===r?i=t[1]:(i=()=>{$(r)},t[0]=r,t[1]=i);let a=W(i,100),o;t[2]===a?o=t[3]:(o=()=>a.cancel(),t[2]=a,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,l.jsx)("span",{onMouseEnter:a,onMouseLeave:o,children:n}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s};function B(e){if(typeof e!="object"||!e)return!1;let t=e;return!(t.trusted!==!0||t.notebookCode!==void 0&&typeof t.notebookCode!="string")}function U(){let e=window==null?void 0:window.__MARIMO_EXPORT_CONTEXT__;return B(e)?e:void 0}function x(){var e;return((e=U())==null?void 0:e.trusted)===!0}function X(){if(E.get(R)||x()||E.get(_))return!0;try{if(j()==="read")return!0}catch{}return!1}var G=T(e=>{let t=e(R),r=e(_);if(t||r||x())return!1;let n=!0;try{n=j()==="read"}catch{return!0}return!n});function J(){return C(G)}var K=g(),Z=e=>{if(e instanceof f.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return u.createElement(u.Fragment)},Q=(e,t)=>{if(t instanceof f.Element&&t.name==="body"){if((0,u.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},Y=(e,t)=>{if(t instanceof f.Element&&t.name==="html"){if((0,u.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},tt=e=>{if(e instanceof f.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,n])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,n)}),(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},et=e=>{if(e instanceof f.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!X())return w.warn(`[RenderHTML] refusing <script src> in untrusted context: ${t}`),(0,l.jsx)(l.Fragment,{});if(![...document.querySelectorAll("script[src]")].some(r=>r.getAttribute("src")===t)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,l.jsx)(l.Fragment,{})}},rt=(e,t)=>{if(t instanceof f.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let n=null;return(0,u.isValidElement)(e)&&"props"in e&&(n=e.props.children),(0,l.jsx)(z,{href:r,...t.attribs,children:n})}}},nt=(e,t,r)=>{var n,i;if(t instanceof f.Element&&t.name==="div"&&((i=(n=t.attribs)==null?void 0:n.class)!=null&&i.includes("codehilite")))return(0,l.jsx)(st,{children:e},r)},it=(e,t,r)=>{var i;if(!(t instanceof f.Element)||t.name!=="img")return;let n=(i=t.attribs)==null?void 0:i.src;if(!(!n||!(0,u.isValidElement)(e))&&!/^data:/i.test(n))return(0,u.cloneElement)(e,{key:`${n}-${r}`})},at=(e,t)=>{var r;if(t instanceof f.Element&&((r=t.attribs)!=null&&r["data-marimo-doc"])){let n=t.attribs["data-marimo-doc"];return(0,l.jsx)(D,{qualifiedName:n,children:e})}},ot=(e,t)=>{var r,n;if(t instanceof f.Element&&((r=t.attribs)!=null&&r["data-tooltip"])){if((((n=t.name)==null?void 0:n.toLowerCase())??"").startsWith("marimo-"))return;let i=t.attribs["data-tooltip"];return(0,l.jsx)(F,{content:i,children:e})}},st=e=>{let t=(0,K.c)(3),{children:r}=e,n=(0,u.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,l.jsx)(O,{tooltip:!1,className:"p-1",value:()=>{var s;let o=(s=n.current)==null?void 0:s.firstChild;return o&&o.textContent||""}})}),t[0]=i):i=t[0];let a;return t[1]===r?a=t[2]:(a=(0,l.jsxs)("div",{className:"relative group codehilite-wrapper",ref:n,children:[r,i]}),t[1]=r,t[2]=a),a};const lt=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,l.jsx)(ct,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var ct=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let n=J();return mt({html:(0,u.useMemo)(()=>r||n?N(e):e,[e,r,n]),additionalReplacements:t})};function mt({html:e,additionalReplacements:t=[]}){let r=[Z,tt,et,...t],n=[nt,rt,at,ot,Q,Y],i=[it];return L(e,{replace:(a,o)=>{for(let s of r){let c=s(a,o);if(c)return c}return a},transform:(a,o,s)=>{let c=a;for(let d of n){let m=d(c,o,s);if(m){c=m;break}}for(let d of i){let m=d(c,o,s);m&&(c=m)}return c}})}export{x as n,lt as t};
1
+ import{s as y}from"./chunk-LvLJmgfZ.js";import{i as E,p as T,u as C}from"./useEvent-D91BmmQi.js";import{t as M}from"./react-Bj1aDYRI.js";import{Si as f,bn as k,m as H,ot as j,wn as I,xi as L,xt as N}from"./cells-DiASVTIh.js";import{t as g}from"./compiler-runtime-B3qBwwSJ.js";import{_ as w}from"./useEventListener-BakX-tnw.js";import{c as _}from"./utils-Dev6I_Kv.js";import{t as A}from"./jsx-runtime-PbYoItBR.js";import{t as F}from"./tooltip-CgQpRVyN.js";import{t as O}from"./copy-icon-EHMT-qlr.js";import{t as V}from"./usePress-BSFUeqnS.js";import{n as W}from"./useDebounce-CpLI2dsc.js";import{t as R}from"./useRunCells-DXtOL4UR.js";var q=g(),u=y(M(),1),l=y(A(),1);const z=e=>{let t=(0,q.c)(16),r,n,i;t[0]===e?(r=t[1],n=t[2],i=t[3]):({href:n,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=n,t[3]=i);let a=(0,u.useRef)(null),o;t[4]===n?o=t[5]:(o=()=>{let h=new URL(globalThis.location.href);h.hash=n,globalThis.history.pushState({},"",h.toString()),globalThis.dispatchEvent(new HashChangeEvent("hashchange"));let S=n.slice(1),v=document.getElementById(S);v&&v.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=n,t[5]=o);let s=o,c;t[6]===s?c=t[7]:(c={onPress:()=>{s()}},t[6]=s,t[7]=c);let{pressProps:d}=V(c),m;t[8]===s?m=t[9]:(m=h=>{h.preventDefault(),s()},t[8]=s,t[9]=m);let b=m,p;return t[10]!==r||t[11]!==b||t[12]!==n||t[13]!==d||t[14]!==i?(p=(0,l.jsx)("a",{ref:a,href:n,...d,onClick:b,...i,children:r}),t[10]=r,t[11]=b,t[12]=n,t[13]=d,t[14]=i,t[15]=p):p=t[15],p};async function $(e){let t=H().inOrderIds.at(0);if(t)try{let r=await k.request({document:e,cellId:t});if(!r||r.options.length===0)return;let n=e.split(".").pop()??e,i=r.options[0],a=r.options.find(o=>o.name===n)??i;a!=null&&a.completion_info&&E.set(I,{documentation:a.completion_info})}catch(r){w.debug(`Doc lookup failed for "${e}"`,r)}}var P=g();const D=e=>{let t=(0,P.c)(8),{qualifiedName:r,children:n}=e,i;t[0]===r?i=t[1]:(i=()=>{$(r)},t[0]=r,t[1]=i);let a=W(i,100),o;t[2]===a?o=t[3]:(o=()=>a.cancel(),t[2]=a,t[3]=o);let s;return t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,l.jsx)("span",{onMouseEnter:a,onMouseLeave:o,children:n}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7],s};function B(e){if(typeof e!="object"||!e)return!1;let t=e;return!(t.trusted!==!0||t.notebookCode!==void 0&&typeof t.notebookCode!="string")}function U(){let e=window==null?void 0:window.__MARIMO_EXPORT_CONTEXT__;return B(e)?e:void 0}function x(){var e;return((e=U())==null?void 0:e.trusted)===!0}function X(){if(E.get(R)||x()||E.get(_))return!0;try{if(j()==="read")return!0}catch{}return!1}var G=T(e=>{let t=e(R),r=e(_);if(t||r||x())return!1;let n=!0;try{n=j()==="read"}catch{return!0}return!n});function J(){return C(G)}var K=g(),Z=e=>{if(e instanceof f.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return u.createElement(u.Fragment)},Q=(e,t)=>{if(t instanceof f.Element&&t.name==="body"){if((0,u.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},Y=(e,t)=>{if(t instanceof f.Element&&t.name==="html"){if((0,u.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,l.jsx)(l.Fragment,{children:r})}return}},tt=e=>{if(e instanceof f.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,n])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,n)}),(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},et=e=>{if(e instanceof f.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!X())return w.warn(`[RenderHTML] refusing <script src> in untrusted context: ${t}`),(0,l.jsx)(l.Fragment,{});if(![...document.querySelectorAll("script[src]")].some(r=>r.getAttribute("src")===t)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,l.jsx)(l.Fragment,{})}},rt=(e,t)=>{if(t instanceof f.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let n=null;return(0,u.isValidElement)(e)&&"props"in e&&(n=e.props.children),(0,l.jsx)(z,{href:r,...t.attribs,children:n})}}},nt=(e,t,r)=>{var n,i;if(t instanceof f.Element&&t.name==="div"&&((i=(n=t.attribs)==null?void 0:n.class)!=null&&i.includes("codehilite")))return(0,l.jsx)(st,{children:e},r)},it=(e,t,r)=>{var i;if(!(t instanceof f.Element)||t.name!=="img")return;let n=(i=t.attribs)==null?void 0:i.src;if(!(!n||!(0,u.isValidElement)(e))&&!/^data:/i.test(n))return(0,u.cloneElement)(e,{key:`${n}-${r}`})},at=(e,t)=>{var r;if(t instanceof f.Element&&((r=t.attribs)!=null&&r["data-marimo-doc"])){let n=t.attribs["data-marimo-doc"];return(0,l.jsx)(D,{qualifiedName:n,children:e})}},ot=(e,t)=>{var r,n;if(t instanceof f.Element&&((r=t.attribs)!=null&&r["data-tooltip"])){if((((n=t.name)==null?void 0:n.toLowerCase())??"").startsWith("marimo-"))return;let i=t.attribs["data-tooltip"];return(0,l.jsx)(F,{content:i,children:e})}},st=e=>{let t=(0,K.c)(3),{children:r}=e,n=(0,u.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,l.jsx)(O,{tooltip:!1,className:"p-1",value:()=>{var s;let o=(s=n.current)==null?void 0:s.firstChild;return o&&o.textContent||""}})}),t[0]=i):i=t[0];let a;return t[1]===r?a=t[2]:(a=(0,l.jsxs)("div",{className:"relative group codehilite-wrapper",ref:n,children:[r,i]}),t[1]=r,t[2]=a),a};const lt=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,l.jsx)(ct,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var ct=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let n=J();return mt({html:(0,u.useMemo)(()=>r||n?N(e):e,[e,r,n]),additionalReplacements:t})};function mt({html:e,additionalReplacements:t=[]}){let r=[Z,tt,et,...t],n=[nt,rt,at,ot,Q,Y],i=[it];return L(e,{replace:(a,o)=>{for(let s of r){let c=s(a,o);if(c)return c}return a},transform:(a,o,s)=>{let c=a;for(let d of n){let m=d(c,o,s);if(m){c=m;break}}for(let d of i){let m=d(c,o,s);m&&(c=m)}return c}})}export{x as n,lt as t};
@@ -1 +1 @@
1
- import{s as S}from"./chunk-LvLJmgfZ.js";import{t as D}from"./react-Bj1aDYRI.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{v as M}from"./useEventListener-Wyg6Md5s.js";import{h as w,u as q}from"./config-6vnnoRNy.js";import{n as E,t as T}from"./cn-X2M2usMq.js";import{t as F}from"./jsx-runtime-PbYoItBR.js";import{t as O}from"./tooltip-DfvClvB6.js";import{r as W}from"./button-DuHyjdW2.js";import{r as L}from"./requests-KshNNAOp.js";import{t as V}from"./createLucideIcon-BTp1tQDO.js";import{i as N}from"./useDeleteCell-9SpULTHH.js";import{C as B,O as I,ut as P,w as K}from"./input-DqLOEfxi.js";import{t as U}from"./square-35tXIgiR.js";import{N as H,P as _,V as G,j as C,k as J}from"./usePress-BSFUeqnS.js";import{l as Q}from"./RSPContexts-B9yuKjdT.js";import{t as X}from"./context-C2Ie4tn_.js";import{a as z}from"./renderShortcut-D7vPTxQw.js";var Y=V("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),y=S(D(),1);function Z(n,e){let{"aria-label":t,"aria-labelledby":a,orientation:r="horizontal"}=n,[o,c]=(0,y.useState)(!1);G(()=>{var i;c(!!(e.current&&((i=e.current.parentElement)!=null&&i.closest('[role="toolbar"]'))))});let{direction:u}=X(),m=u==="rtl"&&r==="horizontal",f=Q(e),l=i=>{if(C(i.currentTarget,_(i))){if(r==="horizontal"&&i.key==="ArrowRight"||r==="vertical"&&i.key==="ArrowDown")m?f.focusPrevious():f.focusNext();else if(r==="horizontal"&&i.key==="ArrowLeft"||r==="vertical"&&i.key==="ArrowUp")m?f.focusNext():f.focusPrevious();else if(i.key==="Tab"){i.stopPropagation(),s.current=H(),i.shiftKey?f.focusFirst():f.focusLast();return}else return;i.stopPropagation(),i.preventDefault()}},s=(0,y.useRef)(null),b=i=>{!C(i.currentTarget,i.relatedTarget)&&!s.current&&(s.current=_(i))},p=i=>{if(s.current&&!C(i.currentTarget,i.relatedTarget)&&C(e.current,_(i))){var h;(h=s.current)==null||h.focus(),s.current=null}};return{toolbarProps:{...P(n,{labelable:!0}),role:o?"group":"toolbar","aria-orientation":r,"aria-label":t,"aria-labelledby":t==null?a:void 0,onKeyDownCapture:o?void 0:l,onFocusCapture:o?void 0:p,onBlurCapture:o?void 0:b}}}var $=(0,y.createContext)({}),ee=(0,y.forwardRef)(function(n,e){[n,e]=B(n,e,$);let{toolbarProps:t}=Z(n,e),a=K({...n,values:{orientation:n.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=P(n,{global:!0});return delete r.id,y.createElement(I.div,{...J(r,a,t),ref:e,slot:n.slot||void 0,"data-orientation":n.orientation||"horizontal"},a.children)}),te=x(),re=200;function R(n){let e=(0,te.c)(3),[t,a]=(0,y.useState)(!1),r,o;return e[0]===n?(r=e[1],o=e[2]):(r=()=>{if(!n)return;a(!1);let c=setTimeout(()=>{a(!0)},re);return()=>clearTimeout(c)},o=[n],e[0]=n,e[1]=r,e[2]=o),(0,y.useEffect)(r,o),n&&t}var A=x(),g=S(F(),1),oe=E("rounded-full shadow-xs-solid border p-[5px] transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 [&>svg]:size-3 active:shadow-none bg-background",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",stale:"bg-(--yellow-3) hover:bg-(--yellow-4) text-(--yellow-11)",green:"hover:bg-(--grass-2) hover:text-(--grass-11) hover:border-[var(--grass-7)],",disabled:"opacity-50 cursor-not-allowed",danger:"hover:bg-(--red-3) hover:text-(--red-11)"}},defaultVariants:{variant:"default"}});const k=n=>{let e=(0,A.c)(18),t,a,r,o,c,u,m;if(e[0]!==n){let{children:s,tooltip:b,disabled:p,variant:i,...h}=n;t=s,m=b;let d=p===void 0?!1:p;a=d,r=h,o=v=>{var j;d||((j=h.onClick)==null||j.call(h,v))},c=W.preventFocus,u=T(oe({variant:i}),h.className),e[0]=n,e[1]=t,e[2]=a,e[3]=r,e[4]=o,e[5]=c,e[6]=u,e[7]=m}else t=e[1],a=e[2],r=e[3],o=e[4],c=e[5],u=e[6],m=e[7];let f;e[8]!==t||e[9]!==a||e[10]!==r||e[11]!==o||e[12]!==c||e[13]!==u?(f=(0,g.jsx)("button",{disabled:a,...r,onClick:o,onMouseDown:c,className:u,children:t}),e[8]=t,e[9]=a,e[10]=r,e[11]=o,e[12]=c,e[13]=u,e[14]=f):f=e[14];let l=f;if(m){let s;return e[15]!==l||e[16]!==m?(s=(0,g.jsx)(O,{content:m,side:"top",delayDuration:200,usePortal:!1,children:l}),e[15]=l,e[16]=m,e[17]=s):s=e[17],s}return l},ae=n=>{let e=(0,A.c)(5),{children:t,className:a}=n,r;e[0]===a?r=e[1]:(r=T("flex items-center gap-1 bg-background m-[2px] rounded-full",a),e[0]=a,e[1]=r);let o;return e[2]!==t||e[3]!==r?(o=(0,g.jsx)(ee,{className:r,children:t}),e[2]=t,e[3]=r,e[4]=o):o=e[4],o};var ne=x();const ie=n=>{let e=(0,ne.c)(9),{connectionState:t,status:a}=n,{sendInterrupt:r}=L(),o=R(a==="running"),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=z("global.interrupt"),e[0]=c):c=e[0];let u;e[1]!==t||e[2]!==o?(u=w(t)||!o,e[1]=t,e[2]=o,e[3]=u):u=e[3];let m=o?r:M.NOOP,f=o?"stale":"disabled",l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=(0,g.jsx)(U,{strokeWidth:1.5}),e[4]=l):l=e[4];let s;return e[5]!==u||e[6]!==m||e[7]!==f?(s=(0,g.jsx)(k,{tooltip:c,disabled:u,onClick:m,variant:f,"data-testid":"run-button",children:l}),e[5]=u,e[6]=m,e[7]=f,e[8]=s):s=e[8],s};var le=x();function se({connectionState:n,needsRun:e,loading:t,inactive:a}){return w(n)?"disabled":e&&!t?"stale":t||a?"disabled":"green"}const de=n=>{let e=(0,le.c)(27),{onClick:t,connectionState:a,needsRun:r,status:o,config:c,edited:u}=n,m=o==="disabled-transitively",f=o==="running"||o==="queued",l,s;e[0]!==m||e[1]!==c.disabled||e[2]!==a||e[3]!==u||e[4]!==f||e[5]!==r?(l=w(a)||f||!c.disabled&&m&&!u,s=se({connectionState:a,needsRun:r,loading:f,inactive:l}),e[0]=m,e[1]=c.disabled,e[2]=a,e[3]=u,e[4]=f,e[5]=r,e[6]=l,e[7]=s):(l=e[6],s=e[7]);let b=s;if(c.disabled){let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(Y,{}),e[8]=d):d=e[8];let v;return e[9]!==l||e[10]!==t||e[11]!==b?(v=(0,g.jsx)(k,{tooltip:"Add code to notebook",disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:d}),e[9]=l,e[10]=t,e[11]=b,e[12]=v):v=e[12],v}if(!c.disabled&&m&&!u){let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(N,{strokeWidth:1.2}),e[13]=d):d=e[13];let v;return e[14]!==l||e[15]!==t||e[16]!==b?(v=(0,g.jsx)(k,{disabled:l,tooltip:"This cell can't be run because it has a disabled ancestor",onClick:t,variant:b,"data-testid":"run-button",children:d}),e[14]=l,e[15]=t,e[16]=b,e[17]=v):v=e[17],v}let p;if(w(a)){let d;e[18]===a?d=e[19]:(d=q(a),e[18]=a,e[19]=d),p=d}else if(o==="queued")p="This cell is already queued to run";else if(o==="running")p="This cell is already running.";else{let d;e[20]===Symbol.for("react.memo_cache_sentinel")?(d=z("cell.run"),e[20]=d):d=e[20],p=d}let i;e[21]===Symbol.for("react.memo_cache_sentinel")?(i=(0,g.jsx)(N,{strokeWidth:1.2}),e[21]=i):i=e[21];let h;return e[22]!==l||e[23]!==t||e[24]!==p||e[25]!==b?(h=(0,g.jsx)(k,{tooltip:p,disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:i}),e[22]=l,e[23]=t,e[24]=p,e[25]=b,e[26]=h):h=e[26],h};export{R as a,k as i,ie as n,ae as r,de as t};
1
+ import{s as S}from"./chunk-LvLJmgfZ.js";import{t as D}from"./react-Bj1aDYRI.js";import{t as x}from"./compiler-runtime-B3qBwwSJ.js";import{v as M}from"./useEventListener-BakX-tnw.js";import{h as w,u as q}from"./config-3clPIEB9.js";import{n as E,t as T}from"./cn-X2M2usMq.js";import{t as F}from"./jsx-runtime-PbYoItBR.js";import{t as O}from"./tooltip-CgQpRVyN.js";import{r as W}from"./button-BF7GSjhW.js";import{r as L}from"./requests-KshNNAOp.js";import{t as V}from"./createLucideIcon-BTp1tQDO.js";import{i as N}from"./useDeleteCell-D_p8uMly.js";import{C as B,O as I,ut as P,w as K}from"./input-DB2LiTiQ.js";import{t as U}from"./square-35tXIgiR.js";import{N as H,P as _,V as G,j as C,k as J}from"./usePress-BSFUeqnS.js";import{l as Q}from"./RSPContexts-VzcTZjG1.js";import{t as X}from"./context-C2Ie4tn_.js";import{a as z}from"./renderShortcut-LpVarhnQ.js";var Y=V("hard-drive-download",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]]),y=S(D(),1);function Z(n,e){let{"aria-label":t,"aria-labelledby":a,orientation:r="horizontal"}=n,[o,c]=(0,y.useState)(!1);G(()=>{var i;c(!!(e.current&&((i=e.current.parentElement)!=null&&i.closest('[role="toolbar"]'))))});let{direction:u}=X(),m=u==="rtl"&&r==="horizontal",f=Q(e),l=i=>{if(C(i.currentTarget,_(i))){if(r==="horizontal"&&i.key==="ArrowRight"||r==="vertical"&&i.key==="ArrowDown")m?f.focusPrevious():f.focusNext();else if(r==="horizontal"&&i.key==="ArrowLeft"||r==="vertical"&&i.key==="ArrowUp")m?f.focusNext():f.focusPrevious();else if(i.key==="Tab"){i.stopPropagation(),s.current=H(),i.shiftKey?f.focusFirst():f.focusLast();return}else return;i.stopPropagation(),i.preventDefault()}},s=(0,y.useRef)(null),b=i=>{!C(i.currentTarget,i.relatedTarget)&&!s.current&&(s.current=_(i))},p=i=>{if(s.current&&!C(i.currentTarget,i.relatedTarget)&&C(e.current,_(i))){var h;(h=s.current)==null||h.focus(),s.current=null}};return{toolbarProps:{...P(n,{labelable:!0}),role:o?"group":"toolbar","aria-orientation":r,"aria-label":t,"aria-labelledby":t==null?a:void 0,onKeyDownCapture:o?void 0:l,onFocusCapture:o?void 0:p,onBlurCapture:o?void 0:b}}}var $=(0,y.createContext)({}),ee=(0,y.forwardRef)(function(n,e){[n,e]=B(n,e,$);let{toolbarProps:t}=Z(n,e),a=K({...n,values:{orientation:n.orientation||"horizontal"},defaultClassName:"react-aria-Toolbar"}),r=P(n,{global:!0});return delete r.id,y.createElement(I.div,{...J(r,a,t),ref:e,slot:n.slot||void 0,"data-orientation":n.orientation||"horizontal"},a.children)}),te=x(),re=200;function R(n){let e=(0,te.c)(3),[t,a]=(0,y.useState)(!1),r,o;return e[0]===n?(r=e[1],o=e[2]):(r=()=>{if(!n)return;a(!1);let c=setTimeout(()=>{a(!0)},re);return()=>clearTimeout(c)},o=[n],e[0]=n,e[1]=r,e[2]=o),(0,y.useEffect)(r,o),n&&t}var A=x(),g=S(F(),1),oe=E("rounded-full shadow-xs-solid border p-[5px] transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 [&>svg]:size-3 active:shadow-none bg-background",{variants:{variant:{default:"hover:bg-accent hover:text-accent-foreground",stale:"bg-(--yellow-3) hover:bg-(--yellow-4) text-(--yellow-11)",green:"hover:bg-(--grass-2) hover:text-(--grass-11) hover:border-[var(--grass-7)],",disabled:"opacity-50 cursor-not-allowed",danger:"hover:bg-(--red-3) hover:text-(--red-11)"}},defaultVariants:{variant:"default"}});const k=n=>{let e=(0,A.c)(18),t,a,r,o,c,u,m;if(e[0]!==n){let{children:s,tooltip:b,disabled:p,variant:i,...h}=n;t=s,m=b;let d=p===void 0?!1:p;a=d,r=h,o=v=>{var j;d||((j=h.onClick)==null||j.call(h,v))},c=W.preventFocus,u=T(oe({variant:i}),h.className),e[0]=n,e[1]=t,e[2]=a,e[3]=r,e[4]=o,e[5]=c,e[6]=u,e[7]=m}else t=e[1],a=e[2],r=e[3],o=e[4],c=e[5],u=e[6],m=e[7];let f;e[8]!==t||e[9]!==a||e[10]!==r||e[11]!==o||e[12]!==c||e[13]!==u?(f=(0,g.jsx)("button",{disabled:a,...r,onClick:o,onMouseDown:c,className:u,children:t}),e[8]=t,e[9]=a,e[10]=r,e[11]=o,e[12]=c,e[13]=u,e[14]=f):f=e[14];let l=f;if(m){let s;return e[15]!==l||e[16]!==m?(s=(0,g.jsx)(O,{content:m,side:"top",delayDuration:200,usePortal:!1,children:l}),e[15]=l,e[16]=m,e[17]=s):s=e[17],s}return l},ae=n=>{let e=(0,A.c)(5),{children:t,className:a}=n,r;e[0]===a?r=e[1]:(r=T("flex items-center gap-1 bg-background m-[2px] rounded-full",a),e[0]=a,e[1]=r);let o;return e[2]!==t||e[3]!==r?(o=(0,g.jsx)(ee,{className:r,children:t}),e[2]=t,e[3]=r,e[4]=o):o=e[4],o};var ne=x();const ie=n=>{let e=(0,ne.c)(9),{connectionState:t,status:a}=n,{sendInterrupt:r}=L(),o=R(a==="running"),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=z("global.interrupt"),e[0]=c):c=e[0];let u;e[1]!==t||e[2]!==o?(u=w(t)||!o,e[1]=t,e[2]=o,e[3]=u):u=e[3];let m=o?r:M.NOOP,f=o?"stale":"disabled",l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=(0,g.jsx)(U,{strokeWidth:1.5}),e[4]=l):l=e[4];let s;return e[5]!==u||e[6]!==m||e[7]!==f?(s=(0,g.jsx)(k,{tooltip:c,disabled:u,onClick:m,variant:f,"data-testid":"run-button",children:l}),e[5]=u,e[6]=m,e[7]=f,e[8]=s):s=e[8],s};var le=x();function se({connectionState:n,needsRun:e,loading:t,inactive:a}){return w(n)?"disabled":e&&!t?"stale":t||a?"disabled":"green"}const de=n=>{let e=(0,le.c)(27),{onClick:t,connectionState:a,needsRun:r,status:o,config:c,edited:u}=n,m=o==="disabled-transitively",f=o==="running"||o==="queued",l,s;e[0]!==m||e[1]!==c.disabled||e[2]!==a||e[3]!==u||e[4]!==f||e[5]!==r?(l=w(a)||f||!c.disabled&&m&&!u,s=se({connectionState:a,needsRun:r,loading:f,inactive:l}),e[0]=m,e[1]=c.disabled,e[2]=a,e[3]=u,e[4]=f,e[5]=r,e[6]=l,e[7]=s):(l=e[6],s=e[7]);let b=s;if(c.disabled){let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(Y,{}),e[8]=d):d=e[8];let v;return e[9]!==l||e[10]!==t||e[11]!==b?(v=(0,g.jsx)(k,{tooltip:"Add code to notebook",disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:d}),e[9]=l,e[10]=t,e[11]=b,e[12]=v):v=e[12],v}if(!c.disabled&&m&&!u){let d;e[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,g.jsx)(N,{strokeWidth:1.2}),e[13]=d):d=e[13];let v;return e[14]!==l||e[15]!==t||e[16]!==b?(v=(0,g.jsx)(k,{disabled:l,tooltip:"This cell can't be run because it has a disabled ancestor",onClick:t,variant:b,"data-testid":"run-button",children:d}),e[14]=l,e[15]=t,e[16]=b,e[17]=v):v=e[17],v}let p;if(w(a)){let d;e[18]===a?d=e[19]:(d=q(a),e[18]=a,e[19]=d),p=d}else if(o==="queued")p="This cell is already queued to run";else if(o==="running")p="This cell is already running.";else{let d;e[20]===Symbol.for("react.memo_cache_sentinel")?(d=z("cell.run"),e[20]=d):d=e[20],p=d}let i;e[21]===Symbol.for("react.memo_cache_sentinel")?(i=(0,g.jsx)(N,{strokeWidth:1.2}),e[21]=i):i=e[21];let h;return e[22]!==l||e[23]!==t||e[24]!==p||e[25]!==b?(h=(0,g.jsx)(k,{tooltip:p,disabled:l,onClick:t,variant:b,"data-testid":"run-button",children:i}),e[22]=l,e[23]=t,e[24]=p,e[25]=b,e[26]=h):h=e[26],h};export{R as a,k as i,ie as n,ae as r,de as t};
@@ -1,4 +1,4 @@
1
- var Oi=Object.defineProperty;var Ri=(t,e,a)=>e in t?Oi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var D=(t,e,a)=>Ri(t,typeof e!="symbol"?e+"":e,a);import{s as Ba,t as Ni}from"./chunk-LvLJmgfZ.js";import{f as ss,i as Ja,l as Mi,n as ns,o as ji,u as is}from"./useEvent-D91BmmQi.js";import{t as Pi}from"./react-Bj1aDYRI.js";import{Ar as $i,Ct as Ka,D as os,Di as Li,Fi as Di,Hi as Zi,In as Fi,Lt as zi,Mr as Ui,Ni as qi,Nr as ls,Vi as ds,Xt as us,b as Xe,br as Vi,f as Wi,i as Bi,nn as Ji,nr as Ki,si as Yi,ui as Hi,vr as Gi,zn as Qi}from"./cells-CHWMpikY.js";import{B as fe,D as Xi,E as cs,H as eo,I as mt,J as ps,L as X,M as V,N as ms,O as to,P as A,R as h,S as ao,T as U,V as H,W as hs,b as ht,k as w,w as Se,x as fa}from"./zod-H_cgTO0M.js";import{t as Wt}from"./compiler-runtime-B3qBwwSJ.js";import{T as ro,t as so}from"./ai-model-dropdown-C6gk2SxA.js";import{_ as oe,p as no}from"./useEventListener-Wyg6Md5s.js";import{n as io}from"./utils-Dcn8htEz.js";import{o as oo}from"./config-6vnnoRNy.js";import{t as Ya}from"./cn-X2M2usMq.js";import{t as lo}from"./jsx-runtime-PbYoItBR.js";import{d as uo}from"./popover-CjugjEGp.js";import{a as fs,c as co,p as po,r as mo,t as ho}from"./dropdown-menu-ItqBTuc3.js";import{t as ga}from"./tooltip-DfvClvB6.js";import{t as et}from"./button-DuHyjdW2.js";import{$t as fo,Ct as go,Kt as gs,Ut as yo,Wt as vo,Xt as ya,Zt as va,at as Ha,dt as ys,st as vs,ut as xo,wt as xa}from"./dist-Dez1I5M9.js";import{t as bo}from"./createReducer-CzbhqMat.js";import{h as _o,n as wo,o as ko,r as Co}from"./dist-B0WqBUnf.js";import{i as xs}from"./strings-C0KZ4uek.js";import{r as Io,t as Eo}from"./requests-KshNNAOp.js";import{t as Ga}from"./createLucideIcon-BTp1tQDO.js";import{r as To,t as So}from"./fileToBase64-BSOFR3RV.js";import{t as bs}from"./x-9vLEgLY6.js";import{f as Ao,l as _s,n as Oo}from"./markdown-renderer-BNkLMIkn.js";import{t as ws}from"./file-BvoBtS_V.js";import{t as Ro}from"./image-BzUcK6ho.js";import{t as No}from"./spinner-BbI9qk88.js";import{i as Mo,t as jo}from"./useDeleteCell-9SpULTHH.js";import{r as Po}from"./input-DqLOEfxi.js";import{t as $o}from"./sparkles-COaEc8Qn.js";import{a as Bt,i as jt,o as Jt,r as Pt,s as Lo,t as Do}from"./datasource-C6_8-viy.js";import{a as Zo}from"./dist-DblYTes5.js";import{t as Qa}from"./use-toast-kCNiuc-_.js";import{a as Fo}from"./session-NNbloO8g.js";import{r as zo}from"./useTheme-D7YEMvxS.js";import{n as Uo}from"./useRunCells-CXNnlQUh.js";import{t as qo}from"./blob-BiK5xmlC.js";import{i as Vo}from"./errors-9jMmWHd9.js";import{i as Xa}from"./cell-link-CltAZE6t.js";import{r as Wo,t as Bo}from"./html-to-image-CwotZpj4.js";import{n as er}from"./renderShortcut-D7vPTxQw.js";import{n as Jo}from"./icons-avFV3lBF.js";import{r as Ko,t as Yo}from"./esm-X3Tr2pur.js";import{t as Ho}from"./process-output-B1Leg7X7.js";var ks=Ga("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),Cs=Ga("paperclip",[["path",{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",key:"1miecu"}]]),Is=Ga("send-horizontal",[["path",{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",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),Es="vercel.ai.error",Go=Symbol.for(Es),Ts,Ss,ke=class _i extends(Ss=Error,Ts=Go,Ss){constructor({name:e,message:a,cause:r}){super(a),this[Ts]=!0,this.name=e,this.cause=r}static isInstance(e){return _i.hasMarker(e,Es)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function As(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Os="AI_InvalidArgumentError",Rs=`vercel.ai.error.${Os}`,Qo=Symbol.for(Rs),Ns,Ms,Xo=class extends(Ms=ke,Ns=Qo,Ms){constructor({message:t,cause:e,argument:a}){super({name:Os,message:t,cause:e}),this[Ns]=!0,this.argument=a}static isInstance(t){return ke.hasMarker(t,Rs)}},js="AI_JSONParseError",Ps=`vercel.ai.error.${js}`,el=Symbol.for(Ps),$s,Ls,Ds=class extends(Ls=ke,$s=el,Ls){constructor({text:t,cause:e}){super({name:js,message:`JSON parsing failed: Text: ${t}.
1
+ var Oi=Object.defineProperty;var Ri=(t,e,a)=>e in t?Oi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var D=(t,e,a)=>Ri(t,typeof e!="symbol"?e+"":e,a);import{s as Ba,t as Ni}from"./chunk-LvLJmgfZ.js";import{f as ss,i as Ja,l as Mi,n as ns,o as ji,u as is}from"./useEvent-D91BmmQi.js";import{t as Pi}from"./react-Bj1aDYRI.js";import{Ar as $i,Ct as Ka,D as os,Di as Li,Fi as Di,Hi as Zi,In as Fi,Lt as zi,Mr as Ui,Ni as qi,Nr as ls,Vi as ds,Xt as us,b as Xe,br as Vi,f as Wi,i as Bi,nn as Ji,nr as Ki,si as Yi,ui as Hi,vr as Gi,zn as Qi}from"./cells-DiASVTIh.js";import{B as fe,D as Xi,E as cs,H as eo,I as mt,J as ps,L as X,M as V,N as ms,O as to,P as A,R as h,S as ao,T as U,V as H,W as hs,b as ht,k as w,w as Se,x as fa}from"./zod-H_cgTO0M.js";import{t as Wt}from"./compiler-runtime-B3qBwwSJ.js";import{T as ro,t as so}from"./ai-model-dropdown-Dvmxl0HU.js";import{_ as oe,p as no}from"./useEventListener-BakX-tnw.js";import{n as io}from"./utils-Dev6I_Kv.js";import{o as oo}from"./config-3clPIEB9.js";import{t as Ya}from"./cn-X2M2usMq.js";import{t as lo}from"./jsx-runtime-PbYoItBR.js";import{d as uo}from"./popover-DMNO6Poc.js";import{a as fs,c as co,p as po,r as mo,t as ho}from"./dropdown-menu-DfGLyCbP.js";import{t as ga}from"./tooltip-CgQpRVyN.js";import{t as et}from"./button-BF7GSjhW.js";import{$t as fo,Ct as go,Kt as gs,Ut as yo,Wt as vo,Xt as ya,Zt as va,at as Ha,dt as ys,st as vs,ut as xo,wt as xa}from"./dist-Dez1I5M9.js";import{t as bo}from"./createReducer-3wF4dU7I.js";import{h as _o,n as wo,o as ko,r as Co}from"./dist-B0WqBUnf.js";import{i as xs}from"./strings-DvZlHYnD.js";import{r as Io,t as Eo}from"./requests-KshNNAOp.js";import{t as Ga}from"./createLucideIcon-BTp1tQDO.js";import{r as To,t as So}from"./fileToBase64-BSOFR3RV.js";import{t as bs}from"./x-9vLEgLY6.js";import{f as Ao,l as _s,n as Oo}from"./markdown-renderer-CyLjgnQY.js";import{t as ws}from"./file-BvoBtS_V.js";import{t as Ro}from"./image-BzUcK6ho.js";import{t as No}from"./spinner-BbI9qk88.js";import{i as Mo,t as jo}from"./useDeleteCell-D_p8uMly.js";import{r as Po}from"./input-DB2LiTiQ.js";import{t as $o}from"./sparkles-COaEc8Qn.js";import{a as Bt,i as jt,o as Jt,r as Pt,s as Lo,t as Do}from"./datasource-Da-qoi34.js";import{a as Zo}from"./dist-DblYTes5.js";import{t as Qa}from"./use-toast-kCNiuc-_.js";import{a as Fo}from"./session-CsT5Gg9j.js";import{r as zo}from"./useTheme-D_ZbTTJw.js";import{n as Uo}from"./useRunCells-DXtOL4UR.js";import{t as qo}from"./blob-BiK5xmlC.js";import{i as Vo}from"./errors-9jMmWHd9.js";import{i as Xa}from"./cell-link-DBKqdVgo.js";import{r as Wo,t as Bo}from"./html-to-image-BWhkUSek.js";import{n as er}from"./renderShortcut-LpVarhnQ.js";import{n as Jo}from"./icons-avFV3lBF.js";import{r as Ko,t as Yo}from"./esm-X3Tr2pur.js";import{t as Ho}from"./process-output-BcuY_Us9.js";var ks=Ga("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]),Cs=Ga("paperclip",[["path",{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",key:"1miecu"}]]),Is=Ga("send-horizontal",[["path",{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",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]),Es="vercel.ai.error",Go=Symbol.for(Es),Ts,Ss,ke=class _i extends(Ss=Error,Ts=Go,Ss){constructor({name:e,message:a,cause:r}){super(a),this[Ts]=!0,this.name=e,this.cause=r}static isInstance(e){return _i.hasMarker(e,Es)}static hasMarker(e,a){let r=Symbol.for(a);return typeof e=="object"&&!!e&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function As(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Os="AI_InvalidArgumentError",Rs=`vercel.ai.error.${Os}`,Qo=Symbol.for(Rs),Ns,Ms,Xo=class extends(Ms=ke,Ns=Qo,Ms){constructor({message:t,cause:e,argument:a}){super({name:Os,message:t,cause:e}),this[Ns]=!0,this.argument=a}static isInstance(t){return ke.hasMarker(t,Rs)}},js="AI_JSONParseError",Ps=`vercel.ai.error.${js}`,el=Symbol.for(Ps),$s,Ls,Ds=class extends(Ls=ke,$s=el,Ls){constructor({text:t,cause:e}){super({name:js,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${As(e)}`,cause:e}),this[$s]=!0,this.text=t}static isInstance(t){return ke.hasMarker(t,Ps)}},Zs="AI_TypeValidationError",Fs=`vercel.ai.error.${Zs}`,tl=Symbol.for(Fs),zs,Us,tt=class Gr extends(Us=ke,zs=tl,Us){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r!=null&&r.field&&(s+=` for ${r.field}`),(r==null?void 0:r.entityName)||(r==null?void 0:r.entityId)){s+=" (";let n=[];r.entityName&&n.push(r.entityName),r.entityId&&n.push(`id: "${r.entityId}"`),s+=n.join(", "),s+=")"}super({name:Zs,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${As(a)}`,cause:a}),this[zs]=!0,this.value=e,this.context=r}static isInstance(e){return ke.hasMarker(e,Fs)}static wrap({value:e,cause:a,context:r}){var s,n,o;return Gr.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===(r==null?void 0:r.field)&&((n=a.context)==null?void 0:n.entityName)===(r==null?void 0:r.entityName)&&((o=a.context)==null?void 0:o.entityId)===(r==null?void 0:r.entityId)?a:new Gr({value:e,cause:a,context:r})}},W;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw Error()}t.assertNever=a,t.arrayToEnum=s=>{let n={};for(let o of s)n[o]=o;return n},t.getValidEnumValues=s=>{let n=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),o={};for(let i of n)o[i]=s[i];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let n=[];for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&n.push(o);return n},t.find=(s,n)=>{for(let o of s)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(W||(W={}));var al;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(al||(al={}));const S=W.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),at=t=>{switch(typeof t){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(t)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(t)?S.array:t===null?S.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?S.promise:typeof Map<"u"&&t instanceof Map?S.map:typeof Set<"u"&&t instanceof Set?S.set:typeof Date<"u"&&t instanceof Date?S.date:S.object;default:return S.unknown}},x=W.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Le=class wi extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){let a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(a(o));else{let i=r,l=0;for(;l<o.path.length;){let d=o.path[l];l===o.path.length-1?(i[d]=i[d]||{_errors:[]},i[d]._errors.push(a(o))):i[d]=i[d]||{_errors:[]},i=i[d],l++}}};return s(this),r}static assert(e){if(!(e instanceof wi))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,W.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){let a=Object.create(null),r=[];for(let s of this.issues)if(s.path.length>0){let n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}};Le.create=t=>new Le(t);var Kt=(t,e)=>{let a;switch(t.code){case x.invalid_type:a=t.received===S.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(t.expected,W.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:a=`Unrecognized key(s) in object: ${W.joinValues(t.keys,", ")}`;break;case x.invalid_union:a="Invalid input";break;case x.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${W.joinValues(t.options)}`;break;case x.invalid_enum_value:a=`Invalid enum value. Expected ${W.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:a="Invalid function arguments";break;case x.invalid_return_type:a="Invalid function return type";break;case x.invalid_date:a="Invalid date";break;case x.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(a=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(a=`${a} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?a=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?a=`Invalid input: must end with "${t.validation.endsWith}"`:W.assertNever(t.validation):a=t.validation==="regex"?"Invalid":`Invalid ${t.validation}`;break;case x.too_small:a=t.type==="array"?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"||t.type==="bigint"?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case x.too_big:a=t.type==="array"?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case x.custom:a="Invalid input";break;case x.invalid_intersection_types:a="Intersection results could not be merged";break;case x.not_multiple_of:a=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:a="Number must be finite";break;default:a=e.defaultError,W.assertNever(t)}return{message:a}},rl=Kt;function tr(){return rl}const ar=t=>{let{data:e,path:a,errorMaps:r,issueData:s}=t,n=[...a,...s.path||[]],o={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let i="",l=r.filter(d=>!!d).slice().reverse();for(let d of l)i=d(o,{data:e,defaultError:i}).message;return{...s,path:n,message:i}};function I(t,e){let a=tr(),r=ar({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===Kt?void 0:Kt].filter(s=>!!s)});t.common.issues.push(r)}var xe=class ki{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,a){let r=[];for(let s of a){if(s.status==="aborted")return j;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,a){let r=[];for(let s of a){let n=await s.key,o=await s.value;r.push({key:n,value:o})}return ki.mergeObjectSync(e,r)}static mergeObjectSync(e,a){let r={};for(let s of a){let{key:n,value:o}=s;if(n.status==="aborted"||o.status==="aborted")return j;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(o.value!==void 0||s.alwaysSet)&&(r[n.value]=o.value)}return{status:e.value,value:r}}};const j=Object.freeze({status:"aborted"}),rr=t=>({status:"dirty",value:t}),ve=t=>({status:"valid",value:t}),qs=t=>t.status==="aborted",Vs=t=>t.status==="dirty",$t=t=>t.status==="valid",ba=t=>typeof Promise<"u"&&t instanceof Promise;var R;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(R||(R={}));var De=class{constructor(t,e,a,r){this._cachedPath=[],this.parent=t,this.data=e,this._path=a,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ws=(t,e)=>{if($t(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){return this._error||(this._error=new Le(t.common.issues)),this._error}}};function L(t){if(!t)return{};let{errorMap:e,invalid_type_error:a,required_error:r,description:s}=t;if(e&&(a||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(n,o)=>{let{message:i}=t;return n.code==="invalid_enum_value"?{message:i??o.defaultError}:o.data===void 0?{message:i??r??o.defaultError}:n.code==="invalid_type"?{message:i??a??o.defaultError}:{message:o.defaultError}},description:s}}var F=class{get description(){return this._def.description}_getType(t){return at(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:at(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new xe,ctx:{common:t.parent.common,data:t.data,parsedType:at(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(ba(e))throw Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let a=this.safeParse(t,e);if(a.success)return a.data;throw a.error}safeParse(t,e){let a={common:{issues:[],async:(e==null?void 0:e.async)??!1,contextualErrorMap:e==null?void 0:e.errorMap},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:at(t)};return Ws(a,this._parseSync({data:t,path:a.path,parent:a}))}"~validate"(t){var a,r;let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:at(t)};if(!this["~standard"].async)try{let s=this._parseSync({data:t,path:[],parent:e});return $t(s)?{value:s.value}:{issues:e.common.issues}}catch(s){(r=(a=s==null?void 0:s.message)==null?void 0:a.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then(s=>$t(s)?{value:s.value}:{issues:e.common.issues})}async parseAsync(t,e){let a=await this.safeParseAsync(t,e);if(a.success)return a.data;throw a.error}async safeParseAsync(t,e){let a={common:{issues:[],contextualErrorMap:e==null?void 0:e.errorMap,async:!0},path:(e==null?void 0:e.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:at(t)},r=this._parse({data:t,path:a.path,parent:a});return Ws(a,await(ba(r)?r:Promise.resolve(r)))}refine(t,e){let a=r=>typeof e=="string"||e===void 0?{message:e}:typeof e=="function"?e(r):e;return this._refinement((r,s)=>{let n=t(r),o=()=>s.addIssue({code:x.custom,...a(r)});return typeof Promise<"u"&&n instanceof Promise?n.then(i=>i?!0:(o(),!1)):n?!0:(o(),!1)})}refinement(t,e){return this._refinement((a,r)=>t(a)?!0:(r.addIssue(typeof e=="function"?e(a,r):e),!1))}_refinement(t){return new Ve({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return We.create(this,this._def)}nullable(){return gt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this)}promise(){return Yt.create(this,this._def)}or(t){return Ca.create([this,t],this._def)}and(t){return Ia.create(this,t,this._def)}transform(t){return new Ve({...L(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t=="function"?t:()=>t;return new Oa({...L(this._def),innerType:this,defaultValue:e,typeName:_.ZodDefault})}brand(){return new Hs({typeName:_.ZodBranded,type:this,...L(this._def)})}catch(t){let e=typeof t=="function"?t:()=>t;return new Ra({...L(this._def),innerType:this,catchValue:e,typeName:_.ZodCatch})}describe(t){let e=this.constructor;return new e({...this._def,description:t})}pipe(t){return Gs.create(this,t)}readonly(){return Na.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},sl=/^c[^\s-]{8,}$/i,nl=/^[0-9a-z]+$/,il=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ol=/^[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}$/i,ll=/^[a-z0-9_-]{21}$/i,dl=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ul=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,cl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Bs,ml=/^(?:(?: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])$/,hl=/^(?:(?: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])$/,fl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,gl=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yl=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Js="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",xl=RegExp(`^${Js}$`);function Ks(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision??(e=`${e}(\\.\\d+)?`);let a=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${a}`}function bl(t){return RegExp(`^${Ks(t)}$`)}function _l(t){let e=`${Js}T${Ks(t)}`,a=[];return a.push(t.local?"Z?":"Z"),t.offset&&a.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${a.join("|")})`,RegExp(`^${e}$`)}function wl(t,e){return!!((e==="v4"||!e)&&ml.test(t)||(e==="v6"||!e)&&fl.test(t))}function kl(t,e){if(!dl.test(t))return!1;try{let[a]=t.split(".");if(!a)return!1;let r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||!s||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function Cl(t,e){return!!((e==="v4"||!e)&&hl.test(t)||(e==="v6"||!e)&&gl.test(t))}var _a=class oa extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){let s=this._getOrReturnCtx(e);return I(s,{code:x.invalid_type,expected:S.string,received:s.parsedType}),j}let a=new xe,r;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){let n=e.data.length>s.value,o=e.data.length<s.value;(n||o)&&(r=this._getOrReturnCtx(e,r),n?I(r,{code:x.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&I(r,{code:x.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")cl.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"email",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Bs||(Bs=new RegExp(pl,"u")),Bs.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"emoji",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")ol.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"uuid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")ll.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"nanoid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")sl.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"cuid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")nl.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"cuid2",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")il.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"ulid",code:x.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),I(r,{validation:"url",code:x.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"regex",code:x.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?_l(s).test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?xl.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?bl(s).test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:x.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?ul.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"duration",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?wl(e.data,s.version)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"ip",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?kl(e.data,s.alg)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"jwt",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?Cl(e.data,s.version)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"cidr",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?yl.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"base64",code:x.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?vl.test(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{validation:"base64url",code:x.invalid_string,message:s.message}),a.dirty()):W.assertNever(s);return{status:a.value,value:e.data}}_regex(e,a,r){return this.refinement(s=>e.test(s),{validation:a,code:x.invalid_string,...R.errToObj(r)})}_addCheck(e){return new oa({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...R.errToObj(e)})}url(e){return this._addCheck({kind:"url",...R.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...R.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...R.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...R.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...R.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...R.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...R.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...R.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...R.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...R.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...R.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,...R.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...R.errToObj(e)})}regex(e,a){return this._addCheck({kind:"regex",regex:e,...R.errToObj(a)})}includes(e,a){return this._addCheck({kind:"includes",value:e,position:a==null?void 0:a.position,...R.errToObj(a==null?void 0:a.message)})}startsWith(e,a){return this._addCheck({kind:"startsWith",value:e,...R.errToObj(a)})}endsWith(e,a){return this._addCheck({kind:"endsWith",value:e,...R.errToObj(a)})}min(e,a){return this._addCheck({kind:"min",value:e,...R.errToObj(a)})}max(e,a){return this._addCheck({kind:"max",value:e,...R.errToObj(a)})}length(e,a){return this._addCheck({kind:"length",value:e,...R.errToObj(a)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new oa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new oa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new oa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxLength(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};_a.create=t=>new _a({checks:[],typeName:_.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});function Il(t,e){let a=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=a>r?a:r;return Number.parseInt(t.toFixed(s).replace(".",""))%Number.parseInt(e.toFixed(s).replace(".",""))/10**s}var sr=class Qr extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){let s=this._getOrReturnCtx(e);return I(s,{code:x.invalid_type,expected:S.number,received:s.parsedType}),j}let a,r=new xe;for(let s of this._def.checks)s.kind==="int"?W.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),I(a,{code:x.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?Il(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),I(a,{code:x.not_finite,message:s.message}),r.dirty()):W.assertNever(s);return{status:r.value,value:e.data}}gte(e,a){return this.setLimit("min",e,!0,R.toString(a))}gt(e,a){return this.setLimit("min",e,!1,R.toString(a))}lte(e,a){return this.setLimit("max",e,!0,R.toString(a))}lt(e,a){return this.setLimit("max",e,!1,R.toString(a))}setLimit(e,a,r,s){return new Qr({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:R.toString(s)}]})}_addCheck(e){return new Qr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:R.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(a)})}finite(e){return this._addCheck({kind:"finite",message:R.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:-(2**53-1),message:R.toString(e)})._addCheck({kind:"max",inclusive:!0,value:2**53-1,message:R.toString(e)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&W.isInteger(e.value))}get isFinite(){let e=null,a=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(a===null||r.value>a)&&(a=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(a)&&Number.isFinite(e)}};sr.create=t=>new sr({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});var nr=class Xr extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let a,r=new xe;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),I(a,{code:x.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):W.assertNever(s);return{status:r.value,value:e.data}}_getInvalidInput(e){let a=this._getOrReturnCtx(e);return I(a,{code:x.invalid_type,expected:S.bigint,received:a.parsedType}),j}gte(e,a){return this.setLimit("min",e,!0,R.toString(a))}gt(e,a){return this.setLimit("min",e,!1,R.toString(a))}lte(e,a){return this.setLimit("max",e,!0,R.toString(a))}lt(e,a){return this.setLimit("max",e,!1,R.toString(a))}setLimit(e,a,r,s){return new Xr({...this._def,checks:[...this._def.checks,{kind:e,value:a,inclusive:r,message:R.toString(s)}]})}_addCheck(e){return new Xr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,a){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(a)})}get minValue(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e}get maxValue(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e}};nr.create=t=>new nr({checks:[],typeName:_.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...L(t)});var ir=class extends F{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.boolean,received:e.parsedType}),j}return ve(t.data)}};ir.create=t=>new ir({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...L(t)});var or=class Ci extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){let s=this._getOrReturnCtx(e);return I(s,{code:x.invalid_type,expected:S.date,received:s.parsedType}),j}if(Number.isNaN(e.data.getTime()))return I(this._getOrReturnCtx(e),{code:x.invalid_date}),j;let a=new xe,r;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(r=this._getOrReturnCtx(e,r),I(r,{code:x.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):W.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ci({...this._def,checks:[...this._def.checks,e]})}min(e,a){return this._addCheck({kind:"min",value:e.getTime(),message:R.toString(a)})}max(e,a){return this._addCheck({kind:"max",value:e.getTime(),message:R.toString(a)})}get minDate(){let e=null;for(let a of this._def.checks)a.kind==="min"&&(e===null||a.value>e)&&(e=a.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let a of this._def.checks)a.kind==="max"&&(e===null||a.value<e)&&(e=a.value);return e==null?null:new Date(e)}};or.create=t=>new or({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...L(t)});var lr=class extends F{_parse(t){if(this._getType(t)!==S.symbol){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.symbol,received:e.parsedType}),j}return ve(t.data)}};lr.create=t=>new lr({typeName:_.ZodSymbol,...L(t)});var wa=class extends F{_parse(t){if(this._getType(t)!==S.undefined){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.undefined,received:e.parsedType}),j}return ve(t.data)}};wa.create=t=>new wa({typeName:_.ZodUndefined,...L(t)});var ka=class extends F{_parse(t){if(this._getType(t)!==S.null){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.null,received:e.parsedType}),j}return ve(t.data)}};ka.create=t=>new ka({typeName:_.ZodNull,...L(t)});var dr=class extends F{constructor(){super(...arguments),this._any=!0}_parse(t){return ve(t.data)}};dr.create=t=>new dr({typeName:_.ZodAny,...L(t)});var Lt=class extends F{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ve(t.data)}};Lt.create=t=>new Lt({typeName:_.ZodUnknown,...L(t)});var rt=class extends F{_parse(t){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.never,received:e.parsedType}),j}};rt.create=t=>new rt({typeName:_.ZodNever,...L(t)});var ur=class extends F{_parse(t){if(this._getType(t)!==S.undefined){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.void,received:e.parsedType}),j}return ve(t.data)}};ur.create=t=>new ur({typeName:_.ZodVoid,...L(t)});var Dt=class za extends F{_parse(e){let{ctx:a,status:r}=this._processInputParams(e),s=this._def;if(a.parsedType!==S.array)return I(a,{code:x.invalid_type,expected:S.array,received:a.parsedType}),j;if(s.exactLength!==null){let o=a.data.length>s.exactLength.value,i=a.data.length<s.exactLength.value;(o||i)&&(I(a,{code:o?x.too_big:x.too_small,minimum:i?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&a.data.length<s.minLength.value&&(I(a,{code:x.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&a.data.length>s.maxLength.value&&(I(a,{code:x.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),a.common.async)return Promise.all([...a.data].map((o,i)=>s.type._parseAsync(new De(a,o,a.path,i)))).then(o=>xe.mergeArray(r,o));let n=[...a.data].map((o,i)=>s.type._parseSync(new De(a,o,a.path,i)));return xe.mergeArray(r,n)}get element(){return this._def.type}min(e,a){return new za({...this._def,minLength:{value:e,message:R.toString(a)}})}max(e,a){return new za({...this._def,maxLength:{value:e,message:R.toString(a)}})}length(e,a){return new za({...this._def,exactLength:{value:e,message:R.toString(a)}})}nonempty(e){return this.min(1,e)}};Dt.create=(t,e)=>new Dt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...L(e)});function Zt(t){if(t instanceof Ae){let e={};for(let a in t.shape){let r=t.shape[a];e[a]=We.create(Zt(r))}return new Ae({...t._def,shape:()=>e})}else return t instanceof Dt?new Dt({...t._def,type:Zt(t.element)}):t instanceof We?We.create(Zt(t.unwrap())):t instanceof gt?gt.create(Zt(t.unwrap())):t instanceof ft?ft.create(t.items.map(e=>Zt(e))):t}var Ae=class Me extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:W.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==S.object){let l=this._getOrReturnCtx(e);return I(l,{code:x.invalid_type,expected:S.object,received:l.parsedType}),j}let{status:a,ctx:r}=this._processInputParams(e),{shape:s,keys:n}=this._getCached(),o=[];if(!(this._def.catchall instanceof rt&&this._def.unknownKeys==="strip"))for(let l in r.data)n.includes(l)||o.push(l);let i=[];for(let l of n){let d=s[l],u=r.data[l];i.push({key:{status:"valid",value:l},value:d._parse(new De(r,u,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof rt){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of o)i.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(l==="strict")o.length>0&&(I(r,{code:x.unrecognized_keys,keys:o}),a.dirty());else if(l!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let d of o){let u=r.data[d];i.push({key:{status:"valid",value:d},value:l._parse(new De(r,u,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of i){let u=await d.key,p=await d.value;l.push({key:u,value:p,alwaysSet:d.alwaysSet})}return l}).then(l=>xe.mergeObjectSync(a,l)):xe.mergeObjectSync(a,i)}get shape(){return this._def.shape()}strict(e){return R.errToObj,new Me({...this._def,unknownKeys:"strict",...e===void 0?{}:{errorMap:(a,r)=>{var n,o;let s=((o=(n=this._def).errorMap)==null?void 0:o.call(n,a,r).message)??r.defaultError;return a.code==="unrecognized_keys"?{message:R.errToObj(e).message??s}:{message:s}}}})}strip(){return new Me({...this._def,unknownKeys:"strip"})}passthrough(){return new Me({...this._def,unknownKeys:"passthrough"})}extend(e){return new Me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,a){return this.augment({[e]:a})}catchall(e){return new Me({...this._def,catchall:e})}pick(e){let a={};for(let r of W.objectKeys(e))e[r]&&this.shape[r]&&(a[r]=this.shape[r]);return new Me({...this._def,shape:()=>a})}omit(e){let a={};for(let r of W.objectKeys(this.shape))e[r]||(a[r]=this.shape[r]);return new Me({...this._def,shape:()=>a})}deepPartial(){return Zt(this)}partial(e){let a={};for(let r of W.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?a[r]=s:a[r]=s.optional()}return new Me({...this._def,shape:()=>a})}required(e){let a={};for(let r of W.objectKeys(this.shape))if(e&&!e[r])a[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof We;)s=s._def.innerType;a[r]=s}return new Me({...this._def,shape:()=>a})}keyof(){return Ys(W.objectKeys(this.shape))}};Ae.create=(t,e)=>new Ae({shape:()=>t,unknownKeys:"strip",catchall:rt.create(),typeName:_.ZodObject,...L(e)}),Ae.strictCreate=(t,e)=>new Ae({shape:()=>t,unknownKeys:"strict",catchall:rt.create(),typeName:_.ZodObject,...L(e)}),Ae.lazycreate=(t,e)=>new Ae({shape:t,unknownKeys:"strip",catchall:rt.create(),typeName:_.ZodObject,...L(e)});var Ca=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),a=this._def.options;function r(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return e.common.issues.push(...o.ctx.common.issues),o.result;let n=s.map(o=>new Le(o.ctx.common.issues));return I(e,{code:x.invalid_union,unionErrors:n}),j}if(e.common.async)return Promise.all(a.map(async s=>{let n={...e,common:{...e.common,issues:[]},parent:null};return{result:await s._parseAsync({data:e.data,path:e.path,parent:n}),ctx:n}})).then(r);{let s,n=[];for(let i of a){let l={...e,common:{...e.common,issues:[]},parent:null},d=i._parseSync({data:e.data,path:e.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:l}),l.common.issues.length&&n.push(l.common.issues)}if(s)return e.common.issues.push(...s.ctx.common.issues),s.result;let o=n.map(i=>new Le(i));return I(e,{code:x.invalid_union,unionErrors:o}),j}}get options(){return this._def.options}};Ca.create=(t,e)=>new Ca({options:t,typeName:_.ZodUnion,...L(e)});var st=t=>t instanceof Ea?st(t.schema):t instanceof Ve?st(t.innerType()):t instanceof Ta?[t.value]:t instanceof Sa?t.options:t instanceof Aa?W.objectValues(t.enum):t instanceof Oa?st(t._def.innerType):t instanceof wa?[void 0]:t instanceof ka?[null]:t instanceof We?[void 0,...st(t.unwrap())]:t instanceof gt?[null,...st(t.unwrap())]:t instanceof Hs||t instanceof Na?st(t.unwrap()):t instanceof Ra?st(t._def.innerType):[],El=class Ii extends F{_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==S.object)return I(a,{code:x.invalid_type,expected:S.object,received:a.parsedType}),j;let r=this.discriminator,s=a.data[r],n=this.optionsMap.get(s);return n?a.common.async?n._parseAsync({data:a.data,path:a.path,parent:a}):n._parseSync({data:a.data,path:a.path,parent:a}):(I(a,{code:x.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),j)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,a,r){let s=new Map;for(let n of a){let o=st(n.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(s.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,n)}}return new Ii({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:a,optionsMap:s,...L(r)})}};function cr(t,e){let a=at(t),r=at(e);if(t===e)return{valid:!0,data:t};if(a===S.object&&r===S.object){let s=W.objectKeys(e),n=W.objectKeys(t).filter(i=>s.indexOf(i)!==-1),o={...t,...e};for(let i of n){let l=cr(t[i],e[i]);if(!l.valid)return{valid:!1};o[i]=l.data}return{valid:!0,data:o}}else if(a===S.array&&r===S.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let n=0;n<t.length;n++){let o=t[n],i=e[n],l=cr(o,i);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return a===S.date&&r===S.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ia=class extends F{_parse(t){let{status:e,ctx:a}=this._processInputParams(t),r=(s,n)=>{if(qs(s)||qs(n))return j;let o=cr(s.value,n.value);return o.valid?((Vs(s)||Vs(n))&&e.dirty(),{status:e.value,value:o.data}):(I(a,{code:x.invalid_intersection_types}),j)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,n])=>r(s,n)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Ia.create=(t,e,a)=>new Ia({left:t,right:e,typeName:_.ZodIntersection,...L(a)});var ft=class Ei extends F{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.array)return I(r,{code:x.invalid_type,expected:S.array,received:r.parsedType}),j;if(r.data.length<this._def.items.length)return I(r,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&r.data.length>this._def.items.length&&(I(r,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());let s=[...r.data].map((n,o)=>{let i=this._def.items[o]||this._def.rest;return i?i._parse(new De(r,n,r.path,o)):null}).filter(n=>!!n);return r.common.async?Promise.all(s).then(n=>xe.mergeArray(a,n)):xe.mergeArray(a,s)}get items(){return this._def.items}rest(e){return new Ei({...this._def,rest:e})}};ft.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ft({items:t,typeName:_.ZodTuple,rest:null,...L(e)})};var Tl=class es extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.object)return I(r,{code:x.invalid_type,expected:S.object,received:r.parsedType}),j;let s=[],n=this._def.keyType,o=this._def.valueType;for(let i in r.data)s.push({key:n._parse(new De(r,i,r.path,i)),value:o._parse(new De(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?xe.mergeObjectAsync(a,s):xe.mergeObjectSync(a,s)}get element(){return this._def.valueType}static create(e,a,r){return a instanceof F?new es({keyType:e,valueType:a,typeName:_.ZodRecord,...L(r)}):new es({keyType:_a.create(),valueType:e,typeName:_.ZodRecord,...L(a)})}},pr=class extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:a}=this._processInputParams(t);if(a.parsedType!==S.map)return I(a,{code:x.invalid_type,expected:S.map,received:a.parsedType}),j;let r=this._def.keyType,s=this._def.valueType,n=[...a.data.entries()].map(([o,i],l)=>({key:r._parse(new De(a,o,a.path,[l,"key"])),value:s._parse(new De(a,i,a.path,[l,"value"]))}));if(a.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let i of n){let l=await i.key,d=await i.value;if(l.status==="aborted"||d.status==="aborted")return j;(l.status==="dirty"||d.status==="dirty")&&e.dirty(),o.set(l.value,d.value)}return{status:e.value,value:o}})}else{let o=new Map;for(let i of n){let l=i.key,d=i.value;if(l.status==="aborted"||d.status==="aborted")return j;(l.status==="dirty"||d.status==="dirty")&&e.dirty(),o.set(l.value,d.value)}return{status:e.value,value:o}}}};pr.create=(t,e,a)=>new pr({valueType:e,keyType:t,typeName:_.ZodMap,...L(a)});var mr=class ts extends F{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.parsedType!==S.set)return I(r,{code:x.invalid_type,expected:S.set,received:r.parsedType}),j;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(I(r,{code:x.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),a.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(I(r,{code:x.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),a.dirty());let n=this._def.valueType;function o(l){let d=new Set;for(let u of l){if(u.status==="aborted")return j;u.status==="dirty"&&a.dirty(),d.add(u.value)}return{status:a.value,value:d}}let i=[...r.data.values()].map((l,d)=>n._parse(new De(r,l,r.path,d)));return r.common.async?Promise.all(i).then(l=>o(l)):o(i)}min(e,a){return new ts({...this._def,minSize:{value:e,message:R.toString(a)}})}max(e,a){return new ts({...this._def,maxSize:{value:e,message:R.toString(a)}})}size(e,a){return this.min(e,a).max(e,a)}nonempty(e){return this.min(1,e)}};mr.create=(t,e)=>new mr({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...L(e)});var Sl=class Ua extends F{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:a}=this._processInputParams(e);if(a.parsedType!==S.function)return I(a,{code:x.invalid_type,expected:S.function,received:a.parsedType}),j;function r(i,l){return ar({data:i,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,tr(),Kt].filter(d=>!!d),issueData:{code:x.invalid_arguments,argumentsError:l}})}function s(i,l){return ar({data:i,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,tr(),Kt].filter(d=>!!d),issueData:{code:x.invalid_return_type,returnTypeError:l}})}let n={errorMap:a.common.contextualErrorMap},o=a.data;if(this._def.returns instanceof Yt){let i=this;return ve(async function(...l){let d=new Le([]),u=await i._def.args.parseAsync(l,n).catch(f=>{throw d.addIssue(r(l,f)),d}),p=await Reflect.apply(o,this,u);return await i._def.returns._def.type.parseAsync(p,n).catch(f=>{throw d.addIssue(s(p,f)),d})})}else{let i=this;return ve(function(...l){let d=i._def.args.safeParse(l,n);if(!d.success)throw new Le([r(l,d.error)]);let u=Reflect.apply(o,this,d.data),p=i._def.returns.safeParse(u,n);if(!p.success)throw new Le([s(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ua({...this._def,args:ft.create(e).rest(Lt.create())})}returns(e){return new Ua({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,a,r){return new Ua({args:e||ft.create([]).rest(Lt.create()),returns:a||Lt.create(),typeName:_.ZodFunction,...L(r)})}},Ea=class extends F{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};Ea.create=(t,e)=>new Ea({getter:t,typeName:_.ZodLazy,...L(e)});var Ta=class extends F{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return I(e,{received:e.data,code:x.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ta.create=(t,e)=>new Ta({value:t,typeName:_.ZodLiteral,...L(e)});function Ys(t,e){return new Sa({values:t,typeName:_.ZodEnum,...L(e)})}var Sa=class as extends F{_parse(e){if(typeof e.data!="string"){let a=this._getOrReturnCtx(e),r=this._def.values;return I(a,{expected:W.joinValues(r),received:a.parsedType,code:x.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let a=this._getOrReturnCtx(e),r=this._def.values;return I(a,{received:a.data,code:x.invalid_enum_value,options:r}),j}return ve(e.data)}get options(){return this._def.values}get enum(){let e={};for(let a of this._def.values)e[a]=a;return e}get Values(){let e={};for(let a of this._def.values)e[a]=a;return e}get Enum(){let e={};for(let a of this._def.values)e[a]=a;return e}extract(e,a=this._def){return as.create(e,{...this._def,...a})}exclude(e,a=this._def){return as.create(this.options.filter(r=>!e.includes(r)),{...this._def,...a})}};Sa.create=Ys;var Aa=class extends F{_parse(t){let e=W.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==S.string&&a.parsedType!==S.number){let r=W.objectValues(e);return I(a,{expected:W.joinValues(r),received:a.parsedType,code:x.invalid_type}),j}if(this._cache||(this._cache=new Set(W.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=W.objectValues(e);return I(a,{received:a.data,code:x.invalid_enum_value,options:r}),j}return ve(t.data)}get enum(){return this._def.values}};Aa.create=(t,e)=>new Aa({values:t,typeName:_.ZodNativeEnum,...L(e)});var Yt=class extends F{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);return e.parsedType!==S.promise&&e.common.async===!1?(I(e,{code:x.invalid_type,expected:S.promise,received:e.parsedType}),j):ve((e.parsedType===S.promise?e.data:Promise.resolve(e.data)).then(a=>this._def.type.parseAsync(a,{path:e.path,errorMap:e.common.contextualErrorMap})))}};Yt.create=(t,e)=>new Yt({type:t,typeName:_.ZodPromise,...L(e)});var Ve=class extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:a}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:n=>{I(a,n),n.fatal?e.abort():e.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let n=r.transform(a.data,s);if(a.common.async)return Promise.resolve(n).then(async o=>{if(e.value==="aborted")return j;let i=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return i.status==="aborted"?j:i.status==="dirty"||e.value==="dirty"?rr(i.value):i});{if(e.value==="aborted")return j;let o=this._def.schema._parseSync({data:n,path:a.path,parent:a});return o.status==="aborted"?j:o.status==="dirty"||e.value==="dirty"?rr(o.value):o}}if(r.type==="refinement"){let n=o=>{let i=r.refinement(o,s);if(a.common.async)return Promise.resolve(i);if(i instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){let o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?j:(o.status==="dirty"&&e.dirty(),n(o.value),{status:e.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?j:(o.status==="dirty"&&e.dirty(),n(o.value).then(()=>({status:e.value,value:o.value}))))}if(r.type==="transform")if(a.common.async===!1){let n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!$t(n))return j;let o=r.transform(n.value,s);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(n=>$t(n)?Promise.resolve(r.transform(n.value,s)).then(o=>({status:e.value,value:o})):j);W.assertNever(r)}};Ve.create=(t,e,a)=>new Ve({schema:t,typeName:_.ZodEffects,effect:e,...L(a)}),Ve.createWithPreprocess=(t,e,a)=>new Ve({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...L(a)});var We=class extends F{_parse(t){return this._getType(t)===S.undefined?ve(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};We.create=(t,e)=>new We({innerType:t,typeName:_.ZodOptional,...L(e)});var gt=class extends F{_parse(t){return this._getType(t)===S.null?ve(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};gt.create=(t,e)=>new gt({innerType:t,typeName:_.ZodNullable,...L(e)});var Oa=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),a=e.data;return e.parsedType===S.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};Oa.create=(t,e)=>new Oa({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});var Ra=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),a={...e,common:{...e.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return ba(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Le(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Le(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Ra.create=(t,e)=>new Ra({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});var hr=class extends F{_parse(t){if(this._getType(t)!==S.nan){let e=this._getOrReturnCtx(t);return I(e,{code:x.invalid_type,expected:S.nan,received:e.parsedType}),j}return{status:"valid",value:t.data}}};hr.create=t=>new hr({typeName:_.ZodNaN,...L(t)});var Hs=class extends F{_parse(t){let{ctx:e}=this._processInputParams(t),a=e.data;return this._def.type._parse({data:a,path:e.path,parent:e})}unwrap(){return this._def.type}},Gs=class Ti extends F{_parse(e){let{status:a,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?j:s.status==="dirty"?(a.dirty(),rr(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?j:s.status==="dirty"?(a.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,a){return new Ti({in:e,out:a,typeName:_.ZodPipeline})}},Na=class extends F{_parse(t){let e=this._def.innerType._parse(t),a=r=>($t(r)&&(r.value=Object.freeze(r.value)),r);return ba(e)?e.then(r=>a(r)):a(e)}unwrap(){return this._def.innerType}};Na.create=(t,e)=>new Na({innerType:t,typeName:_.ZodReadonly,...L(e)}),Ae.lazycreate;var _;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={})),_a.create,sr.create,hr.create,nr.create,ir.create,or.create,lr.create,wa.create,ka.create,dr.create,Lt.create,rt.create,ur.create,Dt.create,Ae.create,Ae.strictCreate,Ca.create,El.create,Ia.create,ft.create,Tl.create,pr.create,mr.create,Sl.create,Ea.create,Ta.create,Sa.create,Aa.create,Yt.create,Ve.create,We.create,gt.create,Ve.createWithPreprocess,Gs.create;var Qs=class extends Error{constructor(t,e){super(t),this.name="ParseError",this.type=e.type,this.field=e.field,this.value=e.value,this.line=e.line}},Xs=10,Al=13,yt=32;function fr(t){}function Ol(t){if(typeof t=="function")throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=fr,onError:a=fr,onRetry:r=fr,onComment:s}=t,n=[],o=!0,i,l="",d=0,u;function p(m){if(o&&(o=!1,m.charCodeAt(0)===239&&m.charCodeAt(1)===187&&m.charCodeAt(2)===191&&(m=m.slice(3))),n.length===0){let C=f(m);C!==""&&n.push(C);return}if(m.indexOf(`
4
4
  `)===-1&&m.indexOf("\r")===-1){n.push(m);return}n.push(m);let g=n.join("");n.length=0;let v=f(g);v!==""&&n.push(v)}function f(m){let g=0;if(m.indexOf("\r")===-1){let v=m.indexOf(`